protected function _initDesign() { if (!$this->_request->isInstalling()) { $request = $this->_request; $this->_prepareBlocks(); } $locale = Zend_Registry::get('Zend_Locale'); $lang = Core_Model_Language::getCurrentLanguage(); $detect = new Mobile_Detect(); $this->getPluginLoader()->addPrefixPath('Siberian_Application_Resource', 'Siberian/Application/Resource'); if (!$this->_request->isInstalling()) { if ($this->_request->isApplication()) { $apptype = 'mobile'; } else { $apptype = 'desktop'; } if ($detect->isMobile() || $apptype == 'mobile') { $device_type = 'mobile'; } else { $device_type = 'desktop'; } $code = 'siberian'; } else { $apptype = 'desktop'; $device_type = 'desktop'; $code = "installer"; } $base_paths = array(APPLICATION_PATH . "/design/email/template/"); define('APPLICATION_TYPE', $apptype); define('DEVICE_TYPE', $device_type); define('DEVICE_IS_IPHONE', $detect->isIphone() || $detect->isIpad()); define('IS_APPLICATION', $detect->isApplication() && $this->_request->isApplication()); Core_Model_Directory::setDesignPath("/app/design/{$apptype}/{$code}"); define('DESIGN_CODE', $code); $resources = array('resources' => array('layout' => array('layoutPath' => APPLICATION_PATH . "/design/{$apptype}/{$code}/template/page"))); $base_paths[] = APPLICATION_PATH . "/design/{$apptype}/{$code}/template/"; $this->setOptions($resources); $this->bootstrap('View'); $view = $this->getResource('View'); $view->doctype('HTML5'); foreach ($base_paths as $base_path) { $view->addBasePath($base_path); } Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setNeverRender(true); Core_View_Default::setDevice($detect); }
protected function _initDesign() { $detect = new Mobile_Detect(); $design_codes = array("desktop" => "siberian", "mobile" => "angular"); Zend_Registry::set("design_codes", $design_codes); if (!$this->getRequest()->isInstalling()) { if ($this->getRequest()->isApplication()) { $apptype = 'mobile'; } else { $apptype = 'desktop'; } if ($detect->isMobile() || $apptype == 'mobile') { $device_type = 'mobile'; } else { $device_type = 'desktop'; } if ($this->getRequest()->isApplication()) { $code = $design_codes["mobile"]; } else { if ($this->_isInstanceOfBackoffice()) { $code = 'backoffice'; } else { $code = $design_codes["desktop"]; } } } else { $apptype = 'desktop'; $device_type = 'desktop'; $code = "installer"; } $base_paths = array(APPLICATION_PATH . "/design/email/template/"); if (!defined("APPLICATION_TYPE")) { define("APPLICATION_TYPE", $apptype); } if (!defined("DEVICE_TYPE")) { define("DEVICE_TYPE", $device_type); } if (!defined("DEVICE_IS_IPHONE")) { define("DEVICE_IS_IPHONE", $detect->isIphone() || $detect->isIpad()); } if (!defined("IS_APPLICATION")) { define("IS_APPLICATION", $detect->isNative() && $this->getRequest()->isApplication()); } if (!defined("DESIGN_CODE")) { define("DESIGN_CODE", $code); } Core_Model_Directory::setDesignPath("/app/design/{$apptype}/{$code}"); $resources = array('resources' => array('layout' => array('layoutPath' => APPLICATION_PATH . "/design/{$apptype}/{$code}/template/page"))); $base_paths[] = APPLICATION_PATH . "/design/{$apptype}/{$code}/template/"; $bootstrap = Zend_Controller_Front::getInstance()->getParam("bootstrap"); $bootstrap->setOptions($resources); $bootstrap->bootstrap('View'); $view = $bootstrap->getResource('View'); $view->doctype('HTML5'); foreach ($base_paths as $base_path) { $view->addBasePath($base_path); } Core_View_Default::setDevice($detect); Application_Controller_Mobile_Default::setDevice($detect); if (!$this->getRequest()->isInstalling()) { $blocks = array(); if ($this->getRequest()->isApplication()) { $blocks = $this->getRequest()->getApplication()->getBlocks(); } else { if (!$this->_isInstanceOfBackoffice()) { $blocks = $this->getRequest()->getWhiteLabelEditor()->getBlocks(); if ($block = $this->getRequest()->getWhiteLabelEditor()->getBlock("area")) { $icon_color = $block->getColor(); Application_Model_Option_Value::setEditorIconColor($icon_color); } } } if (!empty($blocks)) { Core_View_Default::setBlocks($blocks); } } }