ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilBookmarkExplorerGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/UIComponent/Explorer2/classes/class.ilTreeExplorerGUI.php");
5
15{
19 public function __construct($a_parent_obj, $a_parent_cmd, $a_user_id = 0)
20 {
21 global $ilUser;
22
23 if ($a_user_id == 0)
24 {
25 $a_user_id = $ilUser->getId();
26 }
27 include_once("./Services/Bookmarks/classes/class.ilBookmarkTree.php");
28 $tree = new ilBookmarkTree($a_user_id);
29 parent::__construct("bm_exp", $a_parent_obj, $a_parent_cmd, $tree);
30
31 $this->setTypeWhiteList(array("bmf", "dum"));
32
33 $this->setSkipRootNode(false);
34 $this->setAjax(false);
35 $this->setOrderField("title");
36 }
37
44 function getNodeContent($a_node)
45 {
46 global $lng;
47
48 if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
49 {
50 return $lng->txt("bookmarks");
51 }
52
53 return $a_node["title"];
54 }
55
62 function getNodeIcon($a_node)
63 {
64 $icon = ilUtil::getImagePath("icon_".$a_node["type"].".svg");
65
66 return $icon;
67 }
68
75 function getNodeIconAlt($a_node)
76 {
77 global $lng;
78
79 return $lng->txt("icon")." ".$lng->txt($a_node["type"]);
80 }
81
82
89 function isNodeHighlighted($a_node)
90 {
91 if ($a_node["child"] == $_GET["bmf_id"] ||
92 ($_GET["bmf_id"] == "" && $a_node["child"] == $this->getNodeId($this->getRootNode())))
93 {
94 return true;
95 }
96 return false;
97 }
98
105 function getNodeHref($a_node)
106 {
107 global $ilCtrl;
108
109 switch($a_node["type"])
110 {
111 // bookmark folder
112 case "bmf":
113 // dummy root
114 case "dum":
115 $ilCtrl->setParameterByClass("ilbookmarkadministrationgui", "bmf_id", $a_node["child"]);
116 $ret = $ilCtrl->getLinkTargetByClass("ilbookmarkadministrationgui", "");
117 $ilCtrl->setParameterByClass("ilbookmarkadministrationgui", "bmf_id", $_GET["bmf_id"]);
118 return $ret;
119 break;
120 }
121 }
122
123}
124
125?>
$_GET["client_id"]
Bookmark explorer GUI class.
getNodeContent($a_node)
Get node content.
getNodeHref($a_node)
Get href for node.
__construct($a_parent_obj, $a_parent_cmd, $a_user_id=0)
Constructor.
isNodeHighlighted($a_node)
Is node highlighted?
getNodeIconAlt($a_node)
Get node icon alt attribute.
getNodeIcon($a_node)
Get node icon.
setSkipRootNode($a_val)
Set skip root node.
Explorer class that works on tree objects (Services/Tree)
setTypeWhiteList($a_val)
Set type white list.
getNodeId($a_node)
Get id for node.
setOrderField($a_val, $a_numeric=false)
Set order field.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15