public function init() { parent::init(); // Test si un id de value est passé en paramètre if ($id = $this->getRequest()->getParam('option_value_id')) { // Créé et charge l'objet $this->_current_option_value = new Application_Model_Option_Value(); $this->_current_option_value->find($id); // Récupère le layout de l'option_value en cours if ($this->_current_option_value->getLayoutId()) { $this->_layout_id = $this->_current_option_value->getLayoutId(); } } $excluded = '/(' . join(')|(', array('front_mobile_home_view', 'application_device_check', 'customer_mobile_account', 'customer_mobile_account_autoconnect', 'push_mobile_list', 'push_mobile_count', 'application_mobile_customization_colors', 'application_mobile_previewer_infos', 'front_mobile_gmaps_view', 'mcommerce_mobile_cart_view')) . ')/'; if (!$this->_current_option_value and !preg_match($excluded, $this->getFullActionName('_'))) { $this->_redirect('/'); return $this; } else { if ($this->getFullActionName('_') == 'front_mobile_home_view') { $this->_layout_id = $this->getApplication()->getLayoutId(); } else { $this->_layout_id = 1; //$this->_current_option_value->getLayout()->getCode(); } } Core_View_Mobile_Default::setCurrentOption($this->_current_option_value); $this->log(); return $this; }
public static function setBlocks($blocks) { self::$_blocks = $blocks; }
protected function _prepareBlocks() { if ($this->_request->isApplication()) { Core_View_Mobile_Default::setBlocks(Application_Model_Application::getInstance()->getDesignBlocks()); } }
public function init() { parent::init(); $this->_layout_id = 1; // Test si un id de value est passé en paramètre $id = $this->getRequest()->getParam('option_value_id'); if (!$id) { $id = $this->getRequest()->getParam('value_id'); } if (!$id) { try { $data = Zend_Json::decode($this->getRequest()->getRawBody()); if ($data && !empty($data['value_id'])) { $id = $data['value_id']; } } catch (Zend_Json_Exception $e) { $id = null; } catch (Exception $e) { $id = null; } } if ($id) { // Créé et charge l'objet $this->_current_option_value = new Application_Model_Option_Value(); if ($id != "homepage") { $this->_current_option_value->find($id); // Récupère le layout de l'option_value en cours if ($this->_current_option_value->getLayoutId()) { $this->_layout_id = $this->_current_option_value->getLayoutId(); } } else { $this->_current_option_value->setIsHomepage(true); } } // $excluded = '/('.join(')|(', // array( // 'front_mobile_home_view', // 'front_mobile_home_template', // 'application_device_check', // 'customer_mobile_account', // 'customer_mobile_account_autoconnect', // 'push_mobile_list', // 'push_mobile_count', // 'application_mobile_customization_colors', // 'application_mobile_previewer_infos', // 'front_mobile_gmaps_view', // 'mcommerce_mobile_cart_view', // 'findall', // 'find', // 'backgroundimage' // ) // ).')/'; // // Zend_Debug::dump($excluded);die; // // if(!$this->_current_option_value AND !preg_match($excluded, $this->getFullActionName('_'))) { // $this->_redirect('/'); // return $this; // } // else if ($this->getFullActionName('_') == 'front_mobile_home_view') { $this->_layout_id = $this->getApplication()->getLayoutId(); } Core_View_Mobile_Default::setCurrentOption($this->_current_option_value); $this->_log(); return $this; }
public function __construct($config = array()) { parent::__construct($config); $this->_customer = $this->getSession()->getCustomer(); }
public static function setCurrentOption($option) { self::$_current_option = $option; }