Mage_GoogleOptimizer_Block_Code Class Reference

Inheritance diagram for Mage_GoogleOptimizer_Block_Code:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object Mage_GoogleOptimizer_Block_Code_Category Mage_GoogleOptimizer_Block_Code_Conversion Mage_GoogleOptimizer_Block_Code_Page Mage_GoogleOptimizer_Block_Code_Product

List of all members.

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')


Detailed Description

Definition at line 35 of file Code.php.


Member Function Documentation

_getGoogleOptimizerModel (  )  [protected]

Return google optimizer model

Returns:
Varien_Object

Definition at line 68 of file Code.php.

00069     {
00070         return $this->_googleOptmizerModel;
00071     }

_initGoogleOptimizerModel (  )  [protected]

override this method if need something special for type of script

Returns:
Mage_GoogleOptimizer_Block_Code

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.

00047     {
00048         return $this;
00049     }

_setGoogleOptimizerModel ( model  )  [protected]

Setting google optimizer model

Parameters:
Varien_Object $model
Returns:
Mage_GoogleOptimizer_Block_Code

Definition at line 57 of file Code.php.

00058     {
00059         $this->_googleOptmizerModel = $model;
00060         return $this;
00061     }

_toHtml (  )  [protected]

Render block HTML

Returns:
string

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

Returns:
string

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

Parameters:
string $scriptType
Returns:
Mage_GoogleOptimizer_Block_Code

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     }


Member Data Documentation

$_avaibleScriptTypes = array('control_script', 'tracking_script', 'conversion_script') [protected]

Definition at line 39 of file Code.php.

$_googleOptmizerModel = null [protected]

Definition at line 38 of file Code.php.

$_scriptType = null [protected]

Definition at line 37 of file Code.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:17 2009 for Magento by  doxygen 1.5.8