if (isset($_GET["sort"])) { $callBackParam["sort"] = $_GET["sort"]; if (isset($_GET["sort_dir"])) { $callBackParam["direction"] = $_GET["sort_dir"]; } } if (!isset($_GET["search"])) { $callBackParam["categoryID"] = $categoryID; } $callBackParam["searchInSubcategories"] = false; $count = 0; $navigatorHtml = GetNavigatorHtml(_getUrlToNavigate(), 20, 'prdSearchProductByTemplateAdmin', $callBackParam, $products, $offset, $count); for ($i = 0; $i < count($products); $i++) { $products[$i]["picture_count"] = GetPictureCount($products[$i]["productID"]); $products[$i]["thumbnail_count"] = GetThumbnailCount($products[$i]["productID"]); $products[$i]["enlarged_count"] = GetEnlargedPictureCount($products[$i]["productID"]); } $smarty->assign("navigatorHtml", $navigatorHtml); $smarty->hassign("urlToSort", _getUrlToSort()); $smarty->hassign("urlToSubmit", _getUrlToSubmit()); $smarty->hassign("urlToDelete", _getUrlToDelete()); $smarty->hassign("urlToCategoryTreeExpand", _getUrlToCategoryTreeExpand()); $smarty->assign("searched_count", str_replace("{N}", count($products), ADMIN_N_RECORD_IS_SEARCHED)); //products list $smarty->assign("products", $products); //set main template $smarty->assign("admin_sub_dpt", "catalog_products_categories.tpl"); $cats = catGetCategoryCListMin(); $smarty->assign("cats", $cats); } }
// Process pages if (isset($_POST['setPagesSlugs']) && $_POST['setPagesSlugs']) { $countUpdated = fu_generate_slugs_pages(isset($_POST['rewriteExistingSlugs']) && $_POST['rewriteExistingSlugs'], isset($_POST['addHtmlExtension']) && $_POST['addHtmlExtension'], isset($_POST['lowercase']) && $_POST['lowercase']); $smartyResultMsg[] = sprintf('Обновлены адреса для %d статических страниц', $countUpdated); } $smarty->assign('resultMsg', implode("<br>\n", $smartyResultMsg)); break; } } if (isset($categoryID)) { $objectType = 'cat'; } else { $objectType = isset($_POST['object']) ? $_POST['object'] : null; } // Get categories tree $catTree = catGetCategoryCListMin(); // Get objects list $objects = array(); switch ($objectType) { case 'cat': $count = 3; $products = prdGetProductByCategory(array('categoryID' => $categoryID, 'fullFlag' => false), $count); foreach ($catTree as $cat) { if ($cat['parent'] == $categoryID) { $objects[] = array('id' => 'cat_' . $cat['categoryID'], 'name' => $cat['name'], 'uri' => $cat['uri'], 'isFolder' => 1); } } foreach ($products as $product) { $pName = !empty($product['sef']) ? $product['sef'] : $product['name']; $objects[] = array('id' => 'prod_' . $product['productID'], 'name' => $pName, 'uri' => $product['uri']); }