public function main()
 {
     //use to init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $this->load->helper('html');
     $this->loadLanguage('common/header');
     $message_link = $this->html->getSecureURL('tool/message_manager');
     $logs_link = $this->html->getSecureURL('tool/error_log');
     $this->view->assign('title', $this->document->getTitle());
     $this->view->assign('base', HTTPS_SERVER ? HTTPS_SERVER : HTTP_SERVER);
     $this->view->assign('links', $this->document->getLinks());
     $this->view->assign('styles', $this->document->getStyles());
     $this->view->assign('scripts', $this->document->getScripts());
     $this->view->assign('notifier_updater_url', $this->html->getSecureURL('listing_grid/message_grid/getnotifies'));
     $this->view->assign('ck_rl_url', $this->html->getSecureURL('common/resource_library', '&type=image&mode=url'));
     $this->view->assign('language_code', $this->session->data['language']);
     $this->view->assign('retina', $this->config->get('config_retina_enable'));
     $this->view->assign('message_manager_url', $message_link);
     //if enabled system check for all 0 or for admin only 1
     if (!$this->config->get('config_system_check') || $this->config->get('config_system_check') == 1) {
         //run system check to make sure system is stable to run the request
         list($system_messages, $counts) = run_system_check($this->registry, 'log');
         if (count($system_messages) > 0) {
             if ($counts['error_count']) {
                 $this->view->assign('system_error', sprintf($this->language->get('text_system_error'), $message_link, $logs_link));
             }
             if ($counts['warning_count']) {
                 $this->view->assign('system_warning', sprintf($this->language->get('text_system_warning'), $message_link));
             }
             if ($counts['notice_count']) {
                 $this->view->assign('system_notice', sprintf($this->language->get('text_system_notice'), $message_link));
             }
         }
     }
     if ($this->session->data['checkupdates']) {
         $this->view->assign('check_updates_url', $this->html->getSecureURL('r/common/common/checkUpdates'));
     }
     $icon_path = $this->config->get('config_icon');
     if ($icon_path) {
         if (!is_file(DIR_RESOURCE . $this->config->get('config_icon'))) {
             $this->messages->saveWarning('Check favicon.', 'Warning: please check favicon in your store settings. Current path is "' . DIR_RESOURCE . $this->config->get('config_icon') . '" but file does not exists.');
             $icon_path = '';
         }
     }
     $this->view->assign('icon', $icon_path);
     if (isset($this->request->server['HTTPS']) && ($this->request->server['HTTPS'] == 'on' || $this->request->server['HTTPS'] == '1')) {
         $this->view->assign('ssl', 1);
     }
     $this->processTemplate('common/head.tpl');
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
 }
Exemplo n.º 2
0
 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     //run system check to make sure system is stable to run the request
     //for storefront log messages. nothing is shown to users
     run_system_check($this->registry, 'log');
     $this->loadLanguage('common/header');
     $this->view->assign('title', $this->document->getTitle());
     $this->view->assign('keywords', $this->document->getKeywords());
     $this->view->assign('description', $this->document->getDescription());
     $this->view->assign('template', $this->config->get('config_storefront_template'));
     $retina = $this->config->get('config_retina_enable');
     $this->view->assign('retina', $retina);
     //remove cookie for retina
     if (!$retina) {
         $this->request->deleteCookie('HTTP_IS_RETINA');
     }
     if (isset($this->request->server['HTTPS']) && ($this->request->server['HTTPS'] == 'on' || $this->request->server['HTTPS'] == '1')) {
         $this->view->assign('base', HTTPS_SERVER);
     } else {
         $this->view->assign('base', HTTP_SERVER);
     }
     $icon_rl = $this->config->get('config_icon');
     //see if we have a resource ID or path
     if ($icon_rl) {
         if (is_numeric($icon_rl)) {
             $resource = new AResource('image');
             $image_data = $resource->getResource($icon_rl);
             if (is_file(DIR_RESOURCE . $image_data['image'])) {
                 $icon_rl = 'resources/' . $image_data['image'];
             } else {
                 $icon_rl = $image_data['resource_code'];
             }
         } else {
             if (!is_file(DIR_RESOURCE . $icon_rl)) {
                 $this->messages->saveWarning('Check favicon.', 'Warning: please check favicon in your store settings. Current path is "' . DIR_RESOURCE . $icon_rl . '" but file does not exists.');
                 $icon_rl = '';
             }
         }
     }
     $this->view->assign('icon', $icon_rl);
     $this->view->assign('lang', $this->language->get('code'));
     $this->view->assign('direction', $this->language->get('direction'));
     $this->view->assign('links', $this->document->getLinks());
     $this->view->assign('styles', $this->document->getStyles());
     $this->view->assign('scripts', $this->document->getScripts());
     $this->view->assign('breadcrumbs', $this->document->getBreadcrumbs());
     $this->view->assign('store', $this->config->get('store_name'));
     if (isset($this->request->server['HTTPS']) && ($this->request->server['HTTPS'] == 'on' || $this->request->server['HTTPS'] == '1')) {
         $this->view->assign('ssl', 1);
     }
     $this->view->assign('cart_url', $this->html->getURL('checkout/cart'));
     $this->view->assign('cart_ajax', (int) $this->config->get('config_cart_ajax'));
     $this->view->assign('cart_ajax_url', $this->html->getURL('r/product/product/addToCart'));
     $this->view->assign('search_url', $this->html->getURL('product/search'));
     $this->view->assign('call_to_order_url', $this->html->getURL('content/contact'));
     //load template debug resources if needed
     $this->view->assign('template_debug_mode', $this->config->get('storefront_template_debug'));
     $this->processTemplate('common/head.tpl');
     //init controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
 }
Exemplo n.º 3
0
 /**
  * void function run server-server update check procedure
  */
 public function checkSystem()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     $last_time_check = $this->session->data['system_check_last_time'];
     //skip first time check
     if (!$last_time_check) {
         $this->session->data['system_check_last_time'] = time();
         return null;
     }
     if (time() - $last_time_check < $this->system_check_period) {
         return null;
     }
     $message_link = $this->html->getSecureURL('tool/message_manager');
     $logs_link = $this->html->getSecureURL('tool/error_log');
     //if enabled system check for all 0 or for admin only 1
     //run system check to make sure system is stable to run the request
     list($system_messages, $counts) = run_system_check($this->registry, 'log');
     if (count($system_messages) > 0) {
         if ($counts['error_count']) {
             $result['error'] = sprintf($this->language->get('text_system_error'), $message_link, $logs_link);
         }
         if ($counts['warning_count']) {
             $result['warning'] = sprintf($this->language->get('text_system_warning'), $message_link);
         }
         if ($counts['notice_count']) {
             $result['notice'] = sprintf($this->language->get('text_system_notice'), $message_link);
         }
     }
     $this->session->data['system_check_last_time'] = time();
     //update controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
     $this->load->library('json');
     $this->response->addJSONHeader();
     $this->response->setOutput(AJson::encode($result));
 }
Exemplo n.º 4
0
 public function main()
 {
     //init controller data
     $this->extensions->hk_InitData($this, __FUNCTION__);
     //if enabled system check for all 0 or for storefront only 2
     if (!$this->config->get('config_system_check') || $this->config->get('config_system_check') == 2) {
         //run system check to make sure system is stable to run the request
         //for storefront log messages. nothing is shown to users
         run_system_check($this->registry, 'log');
     }
     $this->loadLanguage('common/header');
     $this->view->assign('title', $this->document->getTitle());
     $this->view->assign('keywords', $this->document->getKeywords());
     $this->view->assign('description', $this->document->getDescription());
     $this->view->assign('template', $this->config->get('config_storefront_template'));
     $this->view->assign('retina', $this->config->get('config_retina_enable'));
     if (isset($this->request->server['HTTPS']) && ($this->request->server['HTTPS'] == 'on' || $this->request->server['HTTPS'] == '1')) {
         $this->view->assign('base', HTTPS_SERVER);
     } else {
         $this->view->assign('base', HTTP_SERVER);
     }
     $icon_rl = $this->config->get('config_icon');
     if ($icon_rl) {
         //see if we have a resource ID or path
         if (is_numeric($icon_rl)) {
             $resource = new AResource('image');
             $image_data = $resource->getResource($icon_rl);
             if (is_file(DIR_RESOURCE . $image_data['image'])) {
                 $icon_rl = 'resources/' . $image_data['image'];
             } else {
                 $icon_rl = $image_data['resource_code'];
             }
         } else {
             if (!is_file(DIR_RESOURCE . $icon_rl)) {
                 $this->messages->saveWarning('Check favicon.', 'Warning: please check favicon in your store settings. Current path is "' . DIR_RESOURCE . $icon_rl . '" but file does not exists.');
                 $icon_rl = '';
             }
         }
     }
     $this->view->assign('icon', $icon_rl);
     $this->view->assign('lang', $this->language->get('code'));
     $this->view->assign('direction', $this->language->get('direction'));
     $this->view->assign('links', $this->document->getLinks());
     $this->view->assign('styles', $this->document->getStyles());
     $this->view->assign('scripts', $this->document->getScripts());
     $this->view->assign('breadcrumbs', $this->document->getBreadcrumbs());
     $this->view->assign('store', $this->config->get('store_name'));
     if (isset($this->request->server['HTTPS']) && ($this->request->server['HTTPS'] == 'on' || $this->request->server['HTTPS'] == '1')) {
         $this->view->assign('ssl', 1);
     }
     $this->view->assign('cart_url', $this->html->getURL('checkout/cart'));
     $this->view->assign('cart_ajax', (int) $this->config->get('config_cart_ajax'));
     $this->view->assign('cart_ajax_url', $this->html->getURL('r/product/product/addToCart'));
     $this->view->assign('search_url', $this->html->getURL('product/search'));
     $this->view->assign('call_to_order_url', $this->html->getURL('content/contact'));
     //load template debug resources if needed
     $this->view->assign('template_debug_mode', $this->config->get('storefront_template_debug'));
     $this->processTemplate('common/head.tpl');
     //Log Online Customers
     $ip = '';
     if (isset($this->request->server['REMOTE_ADDR'])) {
         $ip = $this->request->server['REMOTE_ADDR'];
     }
     $url = '';
     if (isset($this->request->server['HTTP_HOST']) && isset($this->request->server['REQUEST_URI'])) {
         $url = 'http://' . $this->request->server['HTTP_HOST'] . $this->request->server['REQUEST_URI'];
     }
     $referer = '';
     if (isset($this->request->server['HTTP_REFERER'])) {
         $referer = $this->request->server['HTTP_REFERER'];
     }
     $customer_id = '';
     if (is_object($this->customer)) {
         $customer_id = $this->customer->getId();
     }
     $this->loadModel('tool/online_now');
     $this->model_tool_online_now->setOnline($ip, $customer_id, $url, $referer);
     //init controller data
     $this->extensions->hk_UpdateData($this, __FUNCTION__);
 }