public function __construct($request)
 {
     parent::__construct($request);
     $this->templateDirectory = realpath(dirname(__FILE__) . "/../template") . "/";
     $this->template = "itemEdit.html.php";
     $UserModel = new User_Model();
     $this->component = "menu";
     $itemId = $request->get("itemId");
     if (empty($itemId)) {
         $this->action = "insert";
     } else {
         $this->action = "update";
     }
     $this->aItemSelect = DKY_Item::getItems(null, true);
     if (empty($itemId) && !empty($_SESSION["aBlock"][$this->block_id]["itemId"])) {
         $itemId = $_SESSION["aBlock"][$this->block_id]["itemId"];
     }
     if (empty($itemId) || $this->action == "insert") {
         $this->action = "insert";
         $this->aItem = null;
         unset($_SESSION["aBlock"][$this->block_id]["itemId"]);
     } else {
         $_SESSION["aBlock"][$this->block_id]["itemId"] = $itemId;
         $this->aItem = DKY_Item::getItemById($itemId);
         $this->action = "update";
         unset($this->aItemSelect[$itemId]);
         // Can't select itself as a parent.
     }
     $this->aGroups = $UserModel->getGroups(true);
     $this->getItemsURL = DKY_HTTP::makeURL($request->aURL["path"], "menu", "get_items");
     $this->cancelURL = DKY_HTTP::makeURL($request->aURL["path"], "menu", "list_items");
 }
Beispiel #2
0
 public function __construct($request)
 {
     parent::__construct($request);
     $this->templateDirectory = realpath(dirname(__FILE__) . "/../template") . "/";
     $this->template = "login.html.php";
     $this->component = "user";
     $this->action = "login";
     $this->aMessages = DKY_Output::getMessages();
 }
 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");
 }
Beispiel #4
0
 public function __construct($request)
 {
     parent::__construct($request);
     $this->templateDirectory = realpath(dirname(__FILE__) . "/../template") . "/";
     $this->template = "blank.html.php";
 }