コード例 #1
0
 /**
  * Executes an action on layout object
  *
  * @param LayoutInterface $layout
  * @param ProcessorInterface $processor
  * @return $this
  */
 public function execute(LayoutInterface $layout, ProcessorInterface $processor)
 {
     $loader = $layout->getLoader();
     if (!$loader->isLoaded($this->handle)) {
         $loader->loadIntoProcessor($this->handle, $processor, $layout->getUpdate()->getIndex(UpdateInterface::INDEX_NORMAL));
     }
     return $this;
 }
コード例 #2
0
 /**
  * Executes an action on layout object
  *
  * @param LayoutInterface $layout
  * @param ProcessorInterface $processor
  * @return $this
  */
 public function execute(LayoutInterface $layout, ProcessorInterface $processor)
 {
     if (!empty($this->options['ifconfig']) && !Mage::getStoreConfigFlag($this->options['ifconfig'])) {
         return $this;
     }
     $callback = $this->callback;
     $block = $layout->findBlockById($this->getBlockId());
     if ($block !== false) {
         $callback($block);
     }
     return $this;
 }
コード例 #3
0
 /**
  * Creates a block in the layout, based on item arguments
  *
  * @param LayoutInterface $layout
  * @param ProcessorInterface $processor
  * @return $this
  */
 public function execute(LayoutInterface $layout, ProcessorInterface $processor)
 {
     $options = $this->options;
     if (!empty($options['class'])) {
         $classAlias = $options['class'];
     } elseif (!empty($options['type'])) {
         $classAlias = $options['type'];
     } else {
         return $this;
     }
     $options['parent'] = $this->parentBlockId;
     $layout->newBlock($classAlias, $this->getBlockId(), $options);
     return $this;
 }