/** * Method to display the requested view * * @param string $tpl * @return null */ public function display($tpl = null) { // Add debugging MageBridgeDebugHelper::addDebug(); // Build the block $this->block = $this->build(); if (!empty($this->block)) { $this->block = $this->addFixes($this->block); } // Display the view parent::display($tpl); }
/** * Event onAfterDispatch * * @access public * * @param null * * @return null */ public function onAfterDispatch() { // Don't do anything if MageBridge is not enabled if ($this->isEnabled() == false) { return; } // Display the component-only on specific pages /* $pages = array( 'catalog/product/gallery/id/*', 'catalog/product_compare/index', ); if (MageBridgeTemplateHelper::isPage($pages)) { $this->input->set('tmpl', 'component'); } */ // Perform actions on the frontend if ($this->app->isSite() && $this->doc->getType() == 'html') { // Handle JavaScript conflicts $disableJsMootools = $this->loadConfig('disable_js_mootools'); if ($disableJsMootools == 1) { $headData = $this->doc->getHeadData(); if (isset($headData['script'])) { foreach ($headData['script'] as $index => $headScript) { if (preg_match('/window\\.addEvent/', $headScript)) { //$this->console[] = 'MageBridge removed inline MooTools scripts'; //unset($headdata['script'][$index]); // @todo: Make sure this does NOT remove all custom-tags continue; } } $this->doc->setHeadData($headData); } } // Add the debugging bar if configured MageBridgeDebugHelper::addDebug(); } }