//$data["itemList"] = $pages; } else { $data["result"] = false; $data["errors"] = array("access denied"); } break; } break; case PAGE_DELETE: init($_POST["label"]); if (G::$user->isOrHigher(U_MODERATOR)) { $result = G::$pageData->delete(); $data["result"] = $result; $data["errors"] = G::$pageData->getErrors(); $fields = array(TABLE_PAGES . ".id", "title", "label"); $pages = PageUtils::getItemsList($fields); $data["pageList"] = $pages; } else { $data["result"] = false; $data["errors"] = array("access denied"); } break; case GET_CATEGORIES_TREE: init("admin/catalogue"); // PageData load G::$pageData->load(); if (G::$user->isOrHigher(U_MODERATOR)) { include $_SERVER["DOCUMENT_ROOT"] . PATH_INCLUDES . "admin/admin_categories_tree.php"; } else { echo "ACCESS DENIED"; }
<?php $products = PageUtils::getItemsList("catalogue", true); ?> <!--div class="cropper-container"> <img class="cropper" src="/images/catalogue/large/durr-trio.jpg"> <div class="extra-preview"> </div> </div --> <button class="button-css-blue" id="table_clean_filters">Clear filters</button> <span id="table_rowcount"></span> <button class="button-css-blue" id="button_minimize_table" style="float: right;">_</button> <button class="button-css-blue" id="button_create_new" style="float: right; margin-right:5px;">Create NEW</button> <div class="semi-spoiler" height="200"> <table id="table_products_list" class="nodes_list_table"> <thead> <tr> <th width="30px">id</th> <th width="60px" filter-type='ddl'>type</th> <th filter-type='ddl'>brand_id</th> <th>marking</th> <th>image</th> <th>label</th> <th width="30%">title</th> <th width="60px">price</th> <th width="60px">amount</th> </tr>
/** * @param $type - pages|articles|catalogue * @return mixed */ public function getItemsList($type) { if (!isset($this->lists)) { $this->lists = array(); } if (!isset($lists[$type])) { $lists[$type] = PageUtils::getItemsList($type); } return $lists[$type]; }