/** * Check whether given block match allowed block types * * @param Mage_Core_Model_Layout_Element $block * @return boolean */ protected function _filterBlock($block) { if (!$this->getAllowedBlocks()) { return true; } if (in_array((string) $block->getAttribute('name'), $this->getAllowedBlocks())) { return true; } return false; }
/** * Run action defined in layout update * * @param Mage_Core_Model_Layout_Element $node * @param Mage_Core_Model_Layout_Element $parent */ protected function _generateAction($node, $parent) { $configPath = $node->getAttribute('ifconfig'); if ($configPath && !Mage::getStoreConfigFlag($configPath)) { return; } $method = $node->getAttribute('method'); $parentName = $node->getAttribute('block'); if (empty($parentName)) { $parentName = $parent->getElementName(); } $profilerKey = 'BLOCK_ACTION:' . $parentName . '>' . $method; Magento_Profiler::start($profilerKey); $block = $this->getBlock($parentName); if (!empty($block)) { $args = $this->_extractArgs($node); $this->_translator->translateActionParameters($node, $args); call_user_func_array(array($block, $method), $args); } Magento_Profiler::stop($profilerKey); }