diff --git a/app/code/core/Mage/Core/Block/Abstract.php b/app/code/core/Mage/Core/Block/Abstract.php index 0bb77cb12d47c..2ac7f544175ae 100644 --- a/app/code/core/Mage/Core/Block/Abstract.php +++ b/app/code/core/Mage/Core/Block/Abstract.php @@ -95,6 +95,19 @@ abstract class Mage_Core_Block_Abstract extends Varien_Object */ protected $_eventManager; + + /** + * The prefix for the customized block events + * @var string + */ + protected $_eventPrefix; + + /** + * The object for the customized block events + * @var string + */ + protected $_eventObject; + /** * Class constructor * @@ -614,6 +627,10 @@ public function setFrameTags($openTag, $closeTag = null) final public function toHtml() { Mage::dispatchEvent('core_block_abstract_to_html_before', array('block' => $this)); + if ($this->_eventPrefix && $this->_eventObject) { + Mage::dispatchEvent($this->_eventPrefix . '_to_html_before', array($this->_eventObject => $this)); + } + if (Mage::getStoreConfig('advanced/modules_disable_output/' . $this->getModuleName())) { return ''; } diff --git a/app/code/core/Mage/Core/Controller/Varien/Action.php b/app/code/core/Mage/Core/Controller/Varien/Action.php index 2d683c489a083..226b0e010ca08 100755 --- a/app/code/core/Mage/Core/Controller/Varien/Action.php +++ b/app/code/core/Mage/Core/Controller/Varien/Action.php @@ -38,6 +38,7 @@ abstract class Mage_Core_Controller_Varien_Action implements Mage_Core_Controlle { const FLAG_NO_CHECK_INSTALLATION = 'no-install-check'; const FLAG_NO_DISPATCH = 'no-dispatch'; + const FLAG_NO_DISPATCH_ACTION = 'no-dispatch-action'; const FLAG_NO_PRE_DISPATCH = 'no-preDispatch'; const FLAG_NO_POST_DISPATCH = 'no-postDispatch'; const FLAG_NO_START_SESSION = 'no-startSession'; @@ -469,7 +470,11 @@ public function dispatch($action) */ if (!$this->getFlag('', self::FLAG_NO_DISPATCH)) { Magento_Profiler::start('action_body'); - $this->$actionMethodName(); + + if (!$this->getFlag('', self::FLAG_NO_DISPATCH_ACTION)) { + $this->$actionMethodName(); + } + Magento_Profiler::stop('action_body'); Magento_Profiler::start('postdispatch'); diff --git a/app/code/core/Mage/Tax/Model/Calculation.php b/app/code/core/Mage/Tax/Model/Calculation.php index bdc78ae5000fb..b0197122606c9 100644 --- a/app/code/core/Mage/Tax/Model/Calculation.php +++ b/app/code/core/Mage/Tax/Model/Calculation.php @@ -188,7 +188,7 @@ public function getRate($request) $this->unsRateValue(); $this->unsCalculationProcess(); $this->unsEventModuleId(); - Mage::dispatchEvent('tax_rate_data_fetch', array('request'=>$request)); + Mage::dispatchEvent('tax_rate_data_fetch', array('request'=>$request, 'sender'=>$this)); if (!$this->hasRateValue()) { $rateInfo = $this->_getResource()->getRateInfo($request); $this->setCalculationProcess($rateInfo['process']);