Пример #1
0
 /**
  * Add block object to layout based on xml node data
  *
  * @param Varien_Simplexml_Element $node
  * @param Varien_Simplexml_Element $parent
  *
  * @return Aoe_Layout_Model_Layout
  */
 protected function _generateBlock($node, $parent)
 {
     if ($node instanceof Mage_Core_Model_Layout_Element) {
         if (!$this->checkConditionals($node)) {
             return $this;
         }
     }
     return parent::_generateBlock($node, $parent);
 }
Пример #2
0
 protected function _generateBlock($node, $parent)
 {
     if (isset($node['ifconfig']) && ($configPath = (string) $node['ifconfig'])) {
         if (!Mage::getStoreConfigFlag($configPath)) {
             return;
         }
     }
     return parent::_generateBlock($node, $parent);
 }
 /**
  * Add block object to layout based on xml node data
  *
  * @param Varien_Simplexml_Element $node
  * @param Varien_Simplexml_Element $parent
  * @return Mage_Core_Model_Layout
  */
 protected function _generateBlock($node, $parent)
 {
     $viewerEnabled = Mage::getStoreConfigFlag('dev/debug/widgetslotviewer_enable');
     if ($viewerEnabled && isset($node->label)) {
         $blockLabel = $node->label;
         $viewerName = $node['name'] . '.slot_viewer';
         $viewerXml = "<block type='core/template' name='{$viewerName}' template='widgetslotviewer/slotviewer.phtml'>" . "<action method='setParentLabel'><label>{$blockLabel}</label></action>" . "</block>";
         $viewerChild = new Varien_Simplexml_Element($viewerXml);
         $node->appendChild($viewerChild);
     }
     return parent::_generateBlock($node, $parent);
 }
Пример #4
0
 /**
  * Add block object to layout based on xml node data
  *
  * @param Varien_Simplexml_Element $node
  * @param Varien_Simplexml_Element $parent
  * @return Mage_Core_Model_Layout
  */
 protected function _generateBlock($node, $parent)
 {
     // Check for enterprise version to determine if we should render the targetrule blocks
     $ee = Mage::helper('mybuys')->isMageEnterprise();
     $myBuysBlockName = (string) $node['name'];
     // If CE, then do not add these blocks
     if (!$ee && ($myBuysBlockName == "mybuys_targetrule_related" || $myBuysBlockName == "mybuys_targetrule_upsell")) {
         return $this;
     } else {
         // For all others, call the parent
         parent::_generateBlock($node, $parent);
     }
 }
Пример #5
0
 /**
  * Records information about new block creation
  * (non-PHPdoc)
  * @see Mage_Core_Model_Layout::_generateBlock()
  */
 protected function _generateBlock($node, $parent)
 {
     $this->_collectedBlock = null;
     parent::_generateBlock($node, $parent);
     if ($this->_collectedBlock !== null) {
         $target = $this->_collectedBlock->getNameInLayout();
         $params = array();
         if (isset($node['as'])) {
             $params['alias'] = (string) $node['as'];
         } else {
             $params['alias'] = $target;
         }
         if (isset($node['class'])) {
             $params['type'] = (string) $node['class'];
         } elseif (isset($node['type'])) {
             $params['type'] = (string) $node['type'];
         }
         $params['class'] = get_class($this->_collectedBlock);
         $params['is_root'] = isset($node['output']);
         $this->record(self::ACTION_BLOCK_CREATED, $target, $params);
         if (isset($node['template'])) {
             $this->record(self::ACTION_BLOCK_ACTION, $target . '::setTemplate', array('template' => (string) $node['template']));
         }
     }
     return $this;
 }
Пример #6
0
 private function processingGenerateBlock($node, $parent, $config_node)
 {
     $node['template'] = $config_node;
     return parent::_generateBlock($node, $parent);
 }
Пример #7
0
 /**
  * Add block object to layout based on XML node data
  *
  * @param Varien_Simplexml_Element $node
  * @param Varien_Simplexml_Element $parent
  * @return Mage_Core_Model_Layout
  */
 protected function _generateBlock($node, $parent)
 {
     parent::_generateBlock($node, $parent);
     $blockName = (string) $node['name'];
     $block = $this->getBlock($blockName);
     if (!$block) {
         return $this;
     }
     if (in_array($blockName, array_keys($this->_cacheBlocks))) {
         $block->setData('cache_lifetime', $this->_cacheBlocks[$blockName]['lifetime']);
         if (!empty($this->_cacheBlocks[$blockName]['key'])) {
             $block->setData('cache_key', $this->_cacheBlocks[$blockName]['key']);
         }
     }
     if (in_array($blockName, array_keys($this->_esiBlocks))) {
         $block->setData('esi', 1);
     }
     return $this;
 }