5 require_once(
"./Services/UIComponent/Explorer/classes/class.ilExplorer.php");
48 $this->tree =
new ilTree($a_user_id);
49 $this->tree->setTableNames(
'bookmark_tree',
'bookmark_data');
50 $this->root_id = $this->tree->readRootId();
51 $this->user_id = $a_user_id;
52 $this->allowed_types= array (
'bmf',
'dum');
53 $this->enablesmallmode =
false;
63 $this->enablesmallmode = $a_enablesmallmode;
73 return $this->enablesmallmode;
90 if ($objects = $this->tree->getChilds($a_parent,
"type DESC,title"))
93 $tab = ++$a_depth - 2;
97 for($i=0;$i<count($objects);++$i)
104 foreach ($objects as $key => $object)
106 if (!in_array($object[
"type"],$this->allowed_types))
112 if ($object[
"child"] != $this->root_id)
115 $parent_index = $this->
getIndex($object);
118 if ($object[
"type"]==
'bm') {
119 $this->bm_targets[$object[
"child"]]=$object[
"target"];
122 if($this->root && !$counter)
125 $object[
"title"] = $this->root;
129 $this->format_options[
"$counter"][
"parent"] = $object[
"parent"];
130 $this->format_options[
"$counter"][
"child"] = $object[
"child"];
131 $this->format_options[
"$counter"][
"title"] = $object[
"title"];
132 $this->format_options[
"$counter"][
"description"] = $object[
"description"];
133 $this->format_options[
"$counter"][
"type"] = $object[
"type"];
134 $this->format_options[
"$counter"][
"depth"] =
$tab;
135 $this->format_options[
"$counter"][
"container"] =
false;
136 $this->format_options[
"$counter"][
"visible"] =
true;
139 for ($i = 0; $i <
$tab; ++$i)
141 $this->format_options[
"$counter"][
"tab"][] =
'blank';
144 if ($object[
"child"] != $this->root_id and ((!in_array($object[
"parent"],$this->expanded) && !$this->expand_all)
145 or !$this->format_options[
"$parent_index"][
"visible"]))
147 $this->format_options[
"$counter"][
"visible"] =
false;
151 if ($object[
"child"] != $this->root_id)
153 $this->format_options[
"$parent_index"][
"container"] =
true;
155 if(!$this->expand_all)
157 if (in_array($object[
"parent"],$this->expanded))
159 $this->format_options[
"$parent_index"][
"tab"][($tab-2)] =
'minus';
163 $this->format_options[
"$parent_index"][
"tab"][($tab-2)] =
'plus';
171 $this->
setOutput($object[
"child"],$a_depth);
197 if ($a_node_id ==
"")
208 if($a_node_id > 0 && !in_array($a_node_id,
$_SESSION[
"mexpand"]))
210 array_push(
$_SESSION[
"mexpand"],$a_node_id);
215 $key = array_keys(
$_SESSION[
"mexpand"],-(
int) $a_node_id);
226 if (
$_REQUEST[
'bm_link'] && $a_type ==
'bmf')
228 $link = $_SERVER[
'REQUEST_URI'];
229 $link = ereg_replace(
'bmf_id=[0-9]*',
'bmf_id=' . $a_node_id, $link);
236 return htmlentities($this->bm_targets[$a_node_id]);
239 $target = (strpos($this->target,
"?") ===
false)
242 return $target.$this->target_get.
"=".$a_node_id.$this->params_get;
268 $this->allowed_types = $a_types;
277 $this->show_details = $s_details;
286 if ($this->show_details==
'y' && !empty($a_desc))
301 return $lng->txt(
"icon").
" ".$lng->txt($a_type);
306 $this->root = $a_caption;