Esempio n. 1
0
 /**
  * Contructor
  */
 public function __construct($attributes = array())
 {
     $this->_show = $this->getConfig("show");
     if (!$this->_show) {
         return;
     }
     /*End init meida files*/
     parent::__construct($attributes);
     $my_template = "";
     if ($this->hasData("template") && $this->getData("template")) {
         $my_template = $this->getData("template");
     } elseif (isset($attributes['template']) && $attributes['template']) {
         $my_template = $attributes['template'];
     } else {
         $my_template = "ves/blockbuilder/row.phtml";
     }
     $this->setTemplate($my_template);
     /*Cache Block*/
     $enable_cache = $this->getConfig("enable_cache", 0);
     if (!$enable_cache) {
         $cache_lifetime = null;
     } else {
         $cache_lifetime = $this->getConfig("cache_lifetime", 86400);
         $cache_lifetime = (int) $cache_lifetime > 0 ? $cache_lifetime : 86400;
     }
     $this->addData(array('cache_lifetime' => $cache_lifetime));
     $magento_version = Mage::getVersion();
     $magento_version = str_replace(".", "", $magento_version);
     if ((int) $magento_version >= 1900) {
         $this->addCacheTag(array(Mage_Core_Model_Store::CACHE_TAG, Mage_Cms_Model_Block::CACHE_TAG, Ves_BlockBuilder_Model_Block::CACHE_BLOCK_TAG));
     }
     /*End Cache Block*/
 }