static function identifyPage2(&$page, $params)
 {
     if ($page == self::getMainPage() && self::identifyParam($params) !== false) {
         self::$is_main_page = true;
         $page = '';
         return true;
     }
     return false;
 }
示例#2
0
 static function identifyPage(&$params, &$_get)
 {
     if (isset($params[1]) && categoriesParser::identifyName($params[0]) && self::identifyName($params[1])) {
         categoriesParser::updateGet($params[0], $_get);
         self::updateGet($params[1], $_get);
         $_get['main_page'] = self::getMainPage();
         unset($params[0]);
         unset($params[1]);
         return true;
     } elseif (self::identifyName($params[0])) {
         $_get['main_page'] = self::getMainPage();
         self::updateGet($params[0], $_get);
         unset($params[0]);
         return true;
     }
     return false;
 }
示例#3
0
 static function parseParam(&$_get, &$params, $languages_id, $languages_code)
 {
     $pos = array_search(self::$query_key, $params);
     $products_id = 0;
     if (!empty($params[$pos + 1])) {
         $products_id = (int) $params[$pos + 1];
         // recalculate 'page', just in case the product_type passed is wrong
         if (self::getMainPage() == $_get['main_page']) {
             self::$main_page = $_get['main_page'] = zen_get_info_page($products_id);
         }
         $cPos = array_search(categoriesParser::$query_key, $params);
         if (self::getMainPage() == $_get['main_page'] || $cPos !== false) {
             // we want to make sure the order is correct, categories first then product
             unset($params[$pos]);
             unset($params[$pos + 1]);
             if ($cPos !== false) {
                 $_get['cPath'] = $cPath = self::getProductPath($products_id, $params[$cPos + 1]);
                 unset($params[$cPos]);
                 unset($params[$cPos + 1]);
             } else {
                 $_get['cPath'] = $cPath = self::getProductPath($products_id, 0);
             }
             $temp_params[0] = categoriesParser::getName($cPath, $languages_id, $languages_code);
             $temp_params[1] = self::getName($products_id, $languages_id, $languages_code);
             $params = array_merge($params, $temp_params);
         } else {
             $params[$pos] = self::getName($products_id, $languages_id, $languages_code);
             unset($params[$pos + 1]);
         }
     } else {
         unset($params[$pos]);
     }
     return $products_id;
 }
 static function parseParam(&$page, &$params, $languages_id, $languages_code)
 {
     $pos = array_search(self::$query_key, $params);
     if (!empty($params[$pos + 1])) {
         $products_id = $params[$pos + 1];
         // recalculate 'page', just in case the product_type passed is wrong
         if (self::getMainPage() == $page) {
             self::$main_page = $page = zen_get_info_page($products_id);
         }
         $params[$pos] = self::getName($products_id, $languages_id, $languages_code);
         // recalculate cPath if needed to
         if (self::getMainPage() == $page) {
             if (($cPos = array_search(categoriesParser::$query_key, $params)) !== false) {
                 $cPath = self::getProductPath($products_id, $params[$cPos + 1]);
                 $params[$cPos] = categoriesParser::getName($cPath, $languages_id, $languages_code);
                 unset($params[$cPos + 1]);
             } else {
                 $cPath = self::getProductPath($products_id, 0);
                 $params = array_merge(array(categoriesParser::getName($cPath, $languages_id, $languages_code)), $params);
                 $pos++;
             }
         }
     } else {
         unset($params[$pos]);
     }
     unset($params[$pos + 1]);
 }