/** * Set form renderer for url_key attribute * * @param Varien_Event_Observer $observer */ public function setFormRendererAttributeUrlkey(Varien_Event_Observer $observer) { $urlKey = $observer->getEvent()->getForm()->getElement('url_key'); if ($urlKey instanceof Varien_Data_Form_Element_Abstract) { $urlKey->setRenderer($this->_app->getFrontController()->getAction()->getLayout()->createBlock('enterprise_catalog/adminhtml_catalog_form_renderer_attribute_urlkey')); } }
/** * Front end main entry point * * @param string $code * @param string $type * @param string|array $options */ public static function run($code = '', $type = 'store', $options = array()) { try { Varien_Profiler::start('mage'); Varien_Profiler::start('mage::app'); self::initApp($code, $type, $options); Varien_Profiler::stop('mage::app'); Varien_Profiler::start('mage::dispatch'); self::$_app->getFrontController()->dispatch(); Varien_Profiler::stop('mage::dispatch'); Varien_Profiler::stop('mage'); } catch (Mage_Core_Model_Session_Exception $e) { header('Location: ' . AO::getBaseUrl()); die; } catch (Mage_Core_Model_Store_Exception $e) { $baseUrl = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/'); if (!headers_sent()) { header('Location: ' . $baseUrl . '/404/'); } else { print '<script type="text/javascript">'; print "window.location.href = '{$baseUrl}';"; print '</script>'; } die; } catch (Exception $e) { if (self::isInstalled() || self::$_isDownloader) { self::printException($e); exit; } try { self::dispatchEvent('mage_run_exception', array('exception' => $e)); if (!headers_sent()) { header('Location:' . self::getUrl('install')); } else { self::printException($e); } } catch (Exception $ne) { self::printException($ne, $e->getMessage()); } } }
public function testGetFrontController() { $front = $this->_mageModel->getFrontController(); $this->assertInstanceOf('Mage_Core_Controller_Varien_Front', $front); $this->assertSame($front, $this->_mageModel->getFrontController()); }