33 require_once(
"classes/class.ilExplorer.php");
67 $this->tree =
new ilTree($a_user_id);
68 $this->tree->setTableNames(
'bookmark_tree',
'bookmark_data');
69 $this->root_id = $this->tree->readRootId();
70 $this->user_id = $a_user_id;
71 $this->allowed_types= array (
'bmf',
'dum');
72 $this->enablesmallmode =
false;
82 $this->enablesmallmode = $a_enablesmallmode;
92 return $this->enablesmallmode;
109 if ($objects = $this->tree->getChilds($a_parent,
"type DESC,title"))
112 $tab = ++$a_depth - 2;
116 for($i=0;$i<count($objects);++$i)
123 foreach ($objects as $key => $object)
125 if (!in_array($object[
"type"],$this->allowed_types))
131 if ($object[
"child"] != $this->root_id)
134 $parent_index = $this->
getIndex($object);
137 if ($object[
"type"]==
'bm') {
138 $this->bm_targets[$object[
"child"]]=$object[
"target"];
140 $this->format_options[
"$counter"][
"parent"] = $object[
"parent"];
141 $this->format_options[
"$counter"][
"child"] = $object[
"child"];
142 $this->format_options[
"$counter"][
"title"] = $object[
"title"];
143 $this->format_options[
"$counter"][
"description"] = $object[
"description"];
144 $this->format_options[
"$counter"][
"type"] = $object[
"type"];
145 $this->format_options[
"$counter"][
"depth"] =
$tab;
146 $this->format_options[
"$counter"][
"container"] =
false;
147 $this->format_options[
"$counter"][
"visible"] =
true;
150 for ($i = 0; $i <
$tab; ++$i)
152 $this->format_options[
"$counter"][
"tab"][] =
'blank';
155 if ($object[
"child"] != $this->root_id and (!in_array($object[
"parent"],$this->expanded)
156 or !$this->format_options[
"$parent_index"][
"visible"]))
158 $this->format_options[
"$counter"][
"visible"] =
false;
162 if ($object[
"child"] != $this->root_id)
164 $this->format_options[
"$parent_index"][
"container"] =
true;
166 if (in_array($object[
"parent"],$this->expanded))
168 $this->format_options[
"$parent_index"][
"tab"][($tab-2)] =
'minus';
172 $this->format_options[
"$parent_index"][
"tab"][($tab-2)] =
'plus';
179 $this->
setOutput($object[
"child"],$a_depth);
205 if ($a_node_id ==
"")
216 if($a_node_id > 0 && !in_array($a_node_id,
$_SESSION[
"mexpand"]))
218 array_push(
$_SESSION[
"mexpand"],$a_node_id);
223 $key = array_keys(
$_SESSION[
"mexpand"],-(
int) $a_node_id);
234 if (
$_REQUEST[
'bm_link'] && $a_type ==
'bmf')
236 $link = $_SERVER[
'REQUEST_URI'];
237 $link = ereg_replace(
'bmf_id=[0-9]*',
'bmf_id=' . $a_node_id, $link);
244 return htmlentities($this->bm_targets[$a_node_id]);
247 $target = (strpos($this->target,
"?") ===
false)
250 return $target.$this->target_get.
"=".$a_node_id.$this->params_get;
276 $this->allowed_types = $a_types;
285 $this->show_details = $s_details;
294 if ($this->show_details==
'y' && !empty($a_desc))
309 return $lng->txt(
"icon").
" ".$lng->txt($a_type);