Пример #1
0
 public function indexAction()
 {
     if ($this->getSession()->isLoggedIn()) {
         $this->_redirect("customer/mobile_account_edit");
     } else {
         parent::indexAction();
     }
 }
Пример #2
0
 public static function setDevice($device)
 {
     self::$_device = $device;
 }
Пример #3
0
 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);
         }
     }
 }
Пример #4
0
 public function indexAction()
 {
     $this->getSession()->isOverview = false;
     parent::indexAction();
 }