12 require_once(
"./Services/UIComponent/Explorer/classes/class.ilExplorer.php");
39 $this->tree =
new ilTree($a_user_id);
40 $this->tree->setTableNames(
'mail_tree',
'mail_obj_data');
41 $this->root_id = $this->tree->readRootId();
42 $this->user_id = $a_user_id;
55 $this->format_options[0][
"tab"] = array();
57 $depth = $this->tree->getMaximumDepth();
59 for ($i=0;$i<$depth;++$i)
64 $tpl->addBlockFile(
"EXPLORER_TOP",
"exp_top",
"tpl.explorer_top.html");
67 $tpl->setBodyClass(
"il_Explorer");
69 $tpl_tree =
new ilTemplate(
"tpl.tree.html",
true,
true,
"Services/UIComponent/Explorer");
73 foreach ($this->format_options as $key => $options)
75 if (!$options[
"visible"])
86 $cur_depth = $options[
"depth"];
88 if ($options[
"visible"] and $key != 0)
90 $this->
formatObject($tpl_tree, $options[
"child"],$options);
94 $this->
formatHeader($tpl_tree, $options[
"child"],$options);
100 return $tpl_tree->get();
118 if ($objects = $this->tree->getChilds($a_parent,
"title,m_type"))
121 $tab = ++$a_depth - 2;
125 for($i=0;$i<count($objects);++$i)
127 $objects[$i][
"title"] = $lng->txt(
"mail_".$objects[$i][
"title"]);
131 foreach ($objects as $key => $object)
134 if ($object[
"child"] != $this->root_id)
137 $parent_index = $this->
getIndex($object);
139 $this->format_options[
"$counter"][
"parent"] = $object[
"parent"];
140 $this->format_options[
"$counter"][
"child"] = $object[
"child"];
141 $this->format_options[
"$counter"][
"title"] = $object[
"title"];
142 $this->format_options[
"$counter"][
"type"] = $object[
"m_type"];
143 $this->format_options[
"$counter"][
"desc"] = $object[
"m_type"];
144 $this->format_options[
"$counter"][
"depth"] =
$tab;
145 $this->format_options[
"$counter"][
"container"] =
false;
146 $this->format_options[
"$counter"][
"visible"] =
true;
149 for ($i = 0; $i <
$tab; ++$i)
151 $this->format_options[
"$counter"][
"tab"][] =
'blank';
155 if ($parent_index == 0)
157 if (!in_array($object[
"parent"], $this->expanded))
159 $this->expanded[] = $object[
"parent"];
164 if ($object[
"child"] != $this->root_id and (!in_array($object[
"parent"],$this->expanded)
165 or !$this->format_options[
"$parent_index"][
"visible"]))
167 $this->format_options[
"$counter"][
"visible"] =
false;
171 if ($object[
"child"] != $this->root_id)
173 $this->format_options[
"$parent_index"][
"container"] =
true;
175 if (in_array($object[
"parent"],$this->expanded))
177 $this->format_options[
"$parent_index"][
"tab"][($tab-2)] =
'minus';
181 $this->format_options[
"$parent_index"][
"tab"][($tab-2)] =
'plus';
188 $this->
setOutput($object[
"child"],$a_depth);
218 if($a_node_id > 0 && !in_array($a_node_id,
$_SESSION[
"mexpand"]))
220 array_push(
$_SESSION[
"mexpand"],$a_node_id);
225 $key = array_keys(
$_SESSION[
"mexpand"],-(
int) $a_node_id);
242 $a_child = $a_type ==
'+' ? $a_child : -(int) $a_child;
244 return eregi_replace(
"(mexpand=)(-?[0-9]+)",
"\\1".$a_child, $_SERVER[
"REQUEST_URI"]);
250 function getImage($a_name, $a_type =
"", $a_obj_id =
"")