예제 #1
0
파일: catalog.php 프로젝트: nellka/mebel
$listCategory['null'] = $lang['NO_SELECT'];
$lc = MG::get('category')->getTitleCategory($arrayCategories, URL::get('category_id'), true);
if (!empty($lc)) {
    foreach ($lc as $key => $value) {
        $listCategory[$key] = $value;
    }
}
$this->listCategory = $listCategory;
$model = new Models_Catalog();
if (empty($_REQUEST['cat_id']) || $_REQUEST['cat_id'] == "null") {
    $_REQUEST['cat_id'] = 0;
}
$model->categoryId = MG::get('category')->getCategoryList($_REQUEST['cat_id']);
// В конец списка, добавляем корневую текущую категорию.
$model->categoryId[] = $_REQUEST['cat_id'];
if (!$model->getCurrentCategory()) {
    $model->categoryId = array(0);
}
$_REQUEST['category_ids'] = $model->categoryId;
if (empty($_REQUEST['category_ids'])) {
    $_REQUEST['category_ids'] = array(0);
}
$arrfilter = $model->filterPublic(false, false, false);
$this->filter = $arrfilter['filterBarHtml'];
if (isset($_REQUEST['applyFilter'])) {
    $userFilter = $arrfilter['userFilter'];
}
$sorterData = explode('|', $_POST['sorter']);
if ($sorterData[1] > 0) {
    $sorterData[3] = 'desc';
} else {