33 require_once(
"classes/class.ilExplorer.php");
60 $this->tree =
new ilTree($a_user_id);
61 $this->tree->setTableNames(
'mail_tree',
'mail_obj_data');
62 $this->root_id = $this->tree->readRootId();
63 $this->user_id = $a_user_id;
76 $this->format_options[0][
"tab"] = array();
78 $depth = $this->tree->getMaximumDepth();
80 for ($i=0;$i<$depth;++$i)
85 $tpl->addBlockFile(
"EXPLORER_TOP",
"exp_top",
"tpl.explorer_top.html");
88 $tpl->setBodyClass(
"il_Explorer");
90 $tpl_tree =
new ilTemplate(
"tpl.tree.html",
true,
true);
94 foreach ($this->format_options as $key => $options)
96 if (!$options[
"visible"])
107 $cur_depth = $options[
"depth"];
109 if ($options[
"visible"] and $key != 0)
111 $this->
formatObject($tpl_tree, $options[
"child"],$options);
115 $this->
formatHeader($tpl_tree, $options[
"child"],$options);
121 return $tpl_tree->get();
139 if ($objects = $this->tree->getChilds($a_parent,
"title,m_type"))
142 $tab = ++$a_depth - 2;
146 for($i=0;$i<count($objects);++$i)
148 $objects[$i][
"title"] = $lng->txt(
"mail_".$objects[$i][
"title"]);
152 foreach ($objects as $key => $object)
155 if ($object[
"child"] != $this->root_id)
158 $parent_index = $this->
getIndex($object);
160 $this->format_options[
"$counter"][
"parent"] = $object[
"parent"];
161 $this->format_options[
"$counter"][
"child"] = $object[
"child"];
162 $this->format_options[
"$counter"][
"title"] = $object[
"title"];
163 $this->format_options[
"$counter"][
"type"] = $object[
"m_type"];
164 $this->format_options[
"$counter"][
"desc"] = $object[
"m_type"];
165 $this->format_options[
"$counter"][
"depth"] =
$tab;
166 $this->format_options[
"$counter"][
"container"] =
false;
167 $this->format_options[
"$counter"][
"visible"] =
true;
170 for ($i = 0; $i <
$tab; ++$i)
172 $this->format_options[
"$counter"][
"tab"][] =
'blank';
176 if ($parent_index == 0)
178 if (!in_array($object[
"parent"], $this->expanded))
180 $this->expanded[] = $object[
"parent"];
185 if ($object[
"child"] != $this->root_id and (!in_array($object[
"parent"],$this->expanded)
186 or !$this->format_options[
"$parent_index"][
"visible"]))
188 $this->format_options[
"$counter"][
"visible"] =
false;
192 if ($object[
"child"] != $this->root_id)
194 $this->format_options[
"$parent_index"][
"container"] =
true;
196 if (in_array($object[
"parent"],$this->expanded))
198 $this->format_options[
"$parent_index"][
"tab"][($tab-2)] =
'minus';
202 $this->format_options[
"$parent_index"][
"tab"][($tab-2)] =
'plus';
209 $this->
setOutput($object[
"child"],$a_depth);
239 if($a_node_id > 0 && !in_array($a_node_id,
$_SESSION[
"mexpand"]))
241 array_push(
$_SESSION[
"mexpand"],$a_node_id);
246 $key = array_keys(
$_SESSION[
"mexpand"],-(
int) $a_node_id);
263 $a_child = $a_type ==
'+' ? $a_child : -(int) $a_child;
265 return eregi_replace(
"(mexpand=)(-?[0-9]+)",
"\\1".$a_child, $_SERVER[
"REQUEST_URI"]);
271 function getImage($a_name, $a_type =
"", $a_obj_id =
"")