예제 #1
0
 /**
  * Si le catalogue est activé, on inscrit les URLs dans le sitemap
  * @access private
  */
 private function writeCatalog($idlang)
 {
     /*instance la classe*/
     $sitemap = new magixcjquery_xml_sitemap();
     $attr_name = parent::s_config_named_data('catalog');
     if ($attr_name['status'] == 1) {
         // Table des langues
         $lang = new backend_db_block_lang();
         // Retourne le code ISO
         $db = $lang->s_data_iso($idlang);
         $sitemap->writeMakeNode(magixcjquery_html_helpersHtml::getUrl() . magixglobal_model_rewrite::filter_catalog_root_url($db['iso'], true), $this->lastmod_dateFormat(), 'always', 0.7);
         foreach (parent::s_catalog_category($idlang) as $data) {
             $sitemap->writeMakeNode(magixcjquery_html_helpersHtml::getUrl() . magixglobal_model_rewrite::filter_catalog_category_url($data['iso'], $data['pathclibelle'], $data['idclc'], true), $this->lastmod_dateFormat(), 'always', 0.8);
         }
         foreach (parent::s_catalog_subcategory_sitemap($idlang) as $data) {
             $sitemap->writeMakeNode(magixcjquery_html_helpersHtml::getUrl() . magixglobal_model_rewrite::filter_catalog_subcategory_url($data['iso'], $data['pathclibelle'], $data['idclc'], $data['pathslibelle'], $data['idcls'], true), $this->lastmod_dateFormat(), 'always', 0.8);
         }
         foreach (parent::s_catalog_sitemap($idlang) as $data) {
             $uri = magixglobal_model_rewrite::filter_catalog_product_url($data['iso'], $data['pathclibelle'], $data['idclc'], $data['pathslibelle'], $data['idcls'], $data['urlcatalog'], $data['idproduct'], true);
             $sitemap->writeMakeNode(magixcjquery_html_helpersHtml::getUrl() . $uri, $this->lastmod_dateFormat(), 'always', 0.9);
         }
     }
 }
예제 #2
0
 /**
  * Formate les valeurs principales d'un élément suivant la ligne passées en paramètre
  * @param $row
  * @param $current
  * @return array|null
  * @todo revoir le nommage de 'current', lui préférant 'active'
  */
 public function setItemData($row, $current)
 {
     $ModelImagepath = new magixglobal_model_imagepath();
     $ModelTemplate = new frontend_model_template();
     $ModelRewrite = new magixglobal_model_rewrite();
     $data = null;
     if ($row != null) {
         // *** Product
         if (isset($row['titlecatalog'])) {
             $subcat['id'] = isset($row['idcls']) ? $row['idcls'] : null;
             $subcat['name'] = isset($row['pathslibelle']) ? $row['pathslibelle'] : null;
             if (isset($row['imgcatalog'])) {
                 $data['imgSrc'] = array('small' => $ModelImagepath->filterPathImg(array('filtermod' => 'catalog', 'img' => 'mini/' . $row['imgcatalog'], 'levelmod' => '')), 'medium' => $ModelImagepath->filterPathImg(array('filtermod' => 'catalog', 'img' => 'medium/' . $row['imgcatalog'], 'levelmod' => '')), 'large' => $ModelImagepath->filterPathImg(array('filtermod' => 'catalog', 'img' => 'product/' . $row['imgcatalog'], 'levelmod' => '')));
             }
             $data['imgSrc']['default'] = $ModelImagepath->filterPathImg(array('img' => 'skin/' . $ModelTemplate->frontendTheme()->themeSelected() . '/img/catalog/product-default.png'));
             $data['url'] = $ModelRewrite->filter_catalog_product_url($row['iso'], $row['pathclibelle'], $row['idclc'], $subcat['name'], $subcat['id'], $row['urlcatalog'], $row['idproduct'], true);
             $data['active'] = false;
             if (is_array($current)) {
                 $data['active'] = (isset($current['product']['id']) and $current['product']['id'] == $row['idproduct']) ? true : false;
             } elseif ($current === true) {
                 $data['active'] = true;
             }
             $data['id'] = $row['idproduct'];
             $data['name'] = $row['titlecatalog'];
             $data['price'] = $row['price'];
             $data['content'] = $row['desccatalog'];
             // *** Subcategory
         } elseif (isset($row['slibelle'])) {
             $data['active'] = false;
             if (is_array($current) and isset($current['subcategory']['id'])) {
                 $data['active'] = $current['subcategory']['id'] == $row['idcls'] ? true : false;
             }
             if (isset($row['img_s'])) {
                 $data['imgSrc'] = array();
                 $data['imgSrc']['small'] = $ModelImagepath->filterPathImg(array('filtermod' => 'catalog', 'img' => $row['img_s'], 'levelmod' => 'subcategory'));
                 $data['imgSrc']['medium'] = $data['imgSrc']['small'];
                 $data['imgSrc']['large'] = $data['imgSrc']['small'];
             }
             $data['imgSrc']['default'] = $ModelImagepath->filterPathImg(array('img' => 'skin/' . $ModelTemplate->frontendTheme()->themeSelected() . '/img/catalog/subcategory-default.png'));
             $data['url'] = $ModelRewrite->filter_catalog_subcategory_url($row['iso'], $row['pathclibelle'], $row['idclc'], $row['pathslibelle'], $row['idcls'], true);
             $data['id'] = $row['idcls'];
             $data['name'] = $row['slibelle'];
             $data['content'] = $row['s_content'] != '' ? $row['s_content'] : null;
             // *** Category
         } elseif (isset($row['clibelle'])) {
             $data['active'] = false;
             if (is_array($current) and isset($current['category']['id'])) {
                 $data['active'] = $current['category']['id'] == $row['idclc'] ? true : false;
             }
             if (isset($row['img_c'])) {
                 $data['imgSrc'] = array();
                 $data['imgSrc']['small'] = $ModelImagepath->filterPathImg(array('filtermod' => 'catalog', 'img' => $row['img_c'], 'levelmod' => 'category'));
                 // I know it's like cheat
                 $data['imgSrc']['medium'] = $data['imgSrc']['small'];
                 $data['imgSrc']['large'] = $data['imgSrc']['small'];
             }
             $data['imgSrc']['default'] = $ModelImagepath->filterPathImg(array('img' => 'skin/' . $ModelTemplate->frontendTheme()->themeSelected() . '/img/catalog/category-default.png'));
             $data['url'] = $ModelRewrite->filter_catalog_category_url($row['iso'], $row['pathclibelle'], $row['idclc'], true);
             $data['id'] = $row['idclc'];
             $data['name'] = $row['clibelle'];
             $data['content'] = $row['c_content'] != '' ? $row['c_content'] : null;
             // *** Micro-gallery (product page)
         } elseif (isset($row['idmicro'])) {
             $data['id'] = $row['idmicro'];
             $data['img_src']['small'] = $ModelImagepath->filterPathImg(array('filtermod' => 'catalog', 'img' => 'mini/' . $row['imgcatalog'], 'levelmod' => 'galery'));
             $data['img_src']['medium'] = $ModelImagepath->filterPathImg(array('filtermod' => 'catalog', 'img' => 'maxi/' . $row['imgcatalog'], 'levelmod' => 'galery'));
         }
         return $data;
     }
 }
예제 #3
0
 /**
  * Retourne l'URL de la sous catégorie
  * @param $data
  */
 private function json_uri_subcategory($data)
 {
     if ($data != null) {
         $url = magixglobal_model_rewrite::filter_catalog_subcategory_url($data['iso'], $data['pathclibelle'], $data['idclc'], $data['pathslibelle'], $data['idcls'], true);
         $categoryinput = '{"subcategorylink":' . json_encode(magixcjquery_url_clean::rplMagixString($url)) . '}';
         print $categoryinput;
     }
 }