Beispiel #1
0
 public static function getItems($aQueryParams = null, $bShort = false, $key = "item_id")
 {
     $aItems = array();
     $do_item = DKY_Item::buildItemQuery($aQueryParams);
     $do_item->find();
     while ($aItem = $do_item->fetch()) {
         if ($bShort) {
             $aItems[$aItem[$key]] = $aItem["name"];
         } else {
             $aItems[$aItem[$key]] = $aItem;
         }
     }
     return $aItems;
 }
 public function __construct($request)
 {
     parent::__construct($request);
     $this->templateDirectory = realpath(dirname(__FILE__) . "/../template") . "/";
     $this->template = "itemList.html.php";
     $pageNum = $request->get("page");
     if (empty($pageNum)) {
         if (!empty($_SESSION["aBlock"][$this->block_id]["page"])) {
             $pageNum = $_SESSION["aBlock"][$this->block_id]["page"];
         } else {
             $pageNum = 1;
         }
     }
     $_SESSION["aBlock"][$this->block_id]["page"] = $pageNum;
     $sth = DKY_Item::buildItemQuery();
     $this->aPagedData = DKY_Pager::getPagedData($sth, $pageNum, 10, 3);
     $this->editURL = DKY_HTTP::makeURL($request->aURL["path"], "menu", "edit_item");
     $this->deleteURL = DKY_HTTP::makeURL($request->aURL["path"], "menu", "delete_item");
 }