function __construct(Am_Di $di = null) { parent::__construct(); if (null === $di) { $this->di = Am_Di::getInstance(); } else { $this->di = $di; } if ($this->di->hasService('theme')) { $this->theme = $this->di->theme; } else { $this->theme = new Am_Theme($this->di, 'default', array()); } $this->setHelperPath('Am/View/Helper', 'Am_View_Helper_'); $this->setEncoding('UTF-8'); foreach ($this->di->viewPath as $dir) { $this->addScriptPath($dir); } if (!$this->getScriptPaths()) { $this->addScriptPath(dirname(__FILE__) . '/../../application/default/views'); } $this->headScript()->prependScript("window.rootUrl = " . Am_Controller::getJson(REL_ROOT_URL) . ";\n"); $this->headScript()->prependScript("window.CKEDITOR_BASEPATH = " . Am_Controller::getJson(REL_ROOT_URL . '/application/default/views/public/js/ckeditor/') . ";\n"); $this->headScript()->prependScript("window.amLangCount = " . Am_Controller::getJson(count(Am_Di::getInstance()->config->get('lang.enabled'))) . ";\n"); }