コード例 #1
0
ファイル: view.html.php プロジェクト: jeprodev/jeproshop
 public function display($tpl = null)
 {
     if (!isset($this->context) || $this->context == null) {
         $this->context = JeproshopContext::getContext();
     }
     if (!$this->context->controller->isInitialized()) {
         $this->context->controller->initialize();
     }
     $app = JFactory::getApplication();
     $useSSL = isset($this->context->controller->ssl_enabled) && $this->context->conteoller->ssl_enabled && $app->input->get('enable_ssl') || JeproshopTools::usingSecureMode() ? true : false;
     $protocol_content = $useSSL ? 'https://' : 'http://';
     /*$contextParams = $this->context->controller->getContextParams();
       foreach ($contextParams as $assign_key => $assign_value){
           if (!is_array($assign_value) && mb_substr($assign_value, 0, 1, 'utf-8') == '/' || $protocol_content == 'https://'){
               $this->assignRef($assign_key, $protocol_content.JeproshopTools::getMediaServer($assign_value).$assign_value);
           }else{
               $this->assignRef($assign_key, $assign_value);
           }
       }*/
     if (!isset(self::$cache_products)) {
         $category = new JeproshopCategoryModelCategory(JeproshopContext::getContext()->shop->getCategoryId(), (int) JeproshopContext::getContext()->language->lang_id);
         $nb = (int) JeproshopSettingModelSetting::getValue('number_of_products_on_page');
         self::$cache_products = JeproshopDefaultModelDefault::getProducts((int) JeproshopContext::getContext()->language->lang_id, 0, $nb ? $nb : 8, 'position');
     }
     if (self::$cache_products === false || empty(self::$cache_products)) {
         self::$cache_products = false;
     }
     $this->assignRef('products', self::$cache_products);
     $display_add_product = JeproshopSettingModelSetting::getValue('display_category_attribute');
     $this->assignRef('display_add_product', $display_add_product);
     $homeSize = JeproshopImageModelImage::getSize(JeproshopImageTypeModelImageType::getFormatName('home'));
     $this->assignRef('homeSize', $homeSize);
     $this->assignRef('pagination', JeproshopDefaultModelDefault::$_pagination);
     parent::display($tpl);
 }