Public Member Functions | |
getScriptCode () | |
setScriptType ($scriptType) | |
Protected Member Functions | |
_initGoogleOptimizerModel () | |
_setGoogleOptimizerModel ($model) | |
_getGoogleOptimizerModel () | |
_toHtml () | |
Protected Attributes | |
$_scriptType = null | |
$_googleOptmizerModel = null | |
$_avaibleScriptTypes = array('control_script', 'tracking_script', 'conversion_script') |
Definition at line 35 of file Code.php.
_getGoogleOptimizerModel | ( | ) | [protected] |
_initGoogleOptimizerModel | ( | ) | [protected] |
override this method if need something special for type of script
Reimplemented in Mage_GoogleOptimizer_Block_Code_Category, Mage_GoogleOptimizer_Block_Code_Conversion, Mage_GoogleOptimizer_Block_Code_Page, and Mage_GoogleOptimizer_Block_Code_Product.
Definition at line 46 of file Code.php.
_setGoogleOptimizerModel | ( | $ | model | ) | [protected] |
Setting google optimizer model
Varien_Object | $model |
Definition at line 57 of file Code.php.
_toHtml | ( | ) | [protected] |
Render block HTML
Reimplemented from Mage_Core_Block_Template.
Definition at line 73 of file Code.php.
00074 { 00075 return parent::_toHtml() . $this->getScriptCode(); 00076 }
getScriptCode | ( | ) |
Return script by type $this->_scriptType
Definition at line 83 of file Code.php.
00084 { 00085 if (!Mage::helper('googleoptimizer')->isOptimizerActive()) { 00086 return ''; 00087 } 00088 if (is_null($this->_scriptType)) { 00089 return ''; 00090 } 00091 $this->_initGoogleOptimizerModel(); 00092 if (!($this->_getGoogleOptimizerModel() instanceof Varien_Object)) { 00093 return ''; 00094 } 00095 return $this->_getGoogleOptimizerModel()->getData($this->_scriptType); 00096 }
setScriptType | ( | $ | scriptType | ) |
Check than set script type
string | $scriptType |
Definition at line 104 of file Code.php.
00105 { 00106 if (in_array($scriptType, $this->_avaibleScriptTypes)) { 00107 $this->_scriptType = $scriptType; 00108 } 00109 return $this; 00110 }
$_avaibleScriptTypes = array('control_script', 'tracking_script', 'conversion_script') [protected] |