Пример #1
0
 public function initialize($smarty, $sessionManager, $config, $loadMapper, $args)
 {
     parent::initialize($smarty, $sessionManager, $config, $loadMapper, $args);
     $customer = $this->getCustomer();
     $this->addParam("user", $customer);
     $this->addParam('load_class_name', get_called_class());
 }
Пример #2
0
 public function initialize($smarty, $sessionManager, $config, $loadMapper, $args)
 {
     parent::initialize($smarty, $sessionManager, $config, $loadMapper, $args);
     $this->config = $config;
     $this->putAllPhrasesInSmarty();
     $allVarsArray = CmsSettingsManager::getInstance()->getAllVarsArray();
     $this->addParam("cms_vars", json_encode($allVarsArray));
     $this->setCustomerCartItemsCount();
     $userLevel = $this->getUserLevel();
     $customer = $this->getCustomer();
     $this->addParam("user", $customer);
     $this->addParam("userId", $this->getUserId());
     $this->addParam('userLevel', $userLevel);
     if ($userLevel == UserGroups::$USER) {
         $this->addParam('userLoginType', $customer->getLoginType());
     }
     $this->addParam('userGroupsCompany', UserGroups::$COMPANY);
     $this->addParam('userGroupsServiceCompany', UserGroups::$SERVICE_COMPANY);
     $this->addParam('userGroupsUser', UserGroups::$USER);
     $this->addParam('userGroupsGuest', UserGroups::$GUEST);
     $this->addParam('userGroupsAdmin', UserGroups::$ADMIN);
     if ($this->getUserLevel() === UserGroups::$ADMIN) {
         $this->addParam('admin_price_group', $this->getCustomer()->getPriceGroup());
     }
     $this->addParam('DOCUMENT_ROOT', DOCUMENT_ROOT);
     $this->addParam("salesPhone", $this->getCmsVar("pcstore_sales_phone_number"));
     $this->addParam("salesPhone1", $this->getCmsVar("pcstore_sales_phone_number1"));
     $this->addParam("wholePageWidth", $this->getCmsVar("whole_page_width"));
     $this->addParam("passRegexp", $this->getCmsVar("password_regexp"));
     $this->addParam("us_dollar_exchange", floatval($this->getCmsVar("us_dollar_exchange")));
     if ($userLevel == UserGroups::$COMPANY) {
         $this->addParam("customer_ping_pong_timeout_seconds", $this->getCmsVar("company_ping_pong_timeout_seconds"));
         $this->addParam("company_item_check_message_timeout_seconds", $this->getCmsVar("company_item_check_message_timeout_seconds"));
     } elseif ($userLevel == UserGroups::$USER) {
         $this->addParam("customer_ping_pong_timeout_seconds", $this->getCmsVar("user_ping_pong_timeout_seconds"));
     } elseif ($userLevel == UserGroups::$ADMIN) {
         $this->addParam("customer_ping_pong_timeout_seconds", $this->getCmsVar("admin_ping_pong_timeout_seconds"));
     } else {
         $this->addParam("customer_ping_pong_timeout_seconds", $this->getCmsVar("guest_ping_pong_timeout_seconds"));
     }
 }