32 include_once(
"./Services/UIComponent/Explorer/classes/class.ilExplorer.php");
33 include_once(
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php");
68 $this->root_id = $this->tree->readRootId();
69 $this->user_id = $a_user_id;
70 $this->allowed_types= array (
'wfld',
'wsrt');
71 $this->enablesmallmode =
false;
81 $this->enablesmallmode = $a_enablesmallmode;
91 return $this->enablesmallmode;
108 if ($objects = $this->tree->getChilds($a_parent,
"type DESC,title"))
110 $tab = ++$a_depth - 2;
112 foreach ($objects as $key => $object)
114 if (!in_array($object[
"type"],$this->allowed_types))
120 if ($object[
"child"] != $this->root_id)
123 $parent_index = $this->
getIndex($object);
126 $this->format_options[
"$counter"][
"parent"] = $object[
"parent"];
127 $this->format_options[
"$counter"][
"child"] = $object[
"child"];
128 $this->format_options[
"$counter"][
"title"] = $object[
"title"];
129 $this->format_options[
"$counter"][
"description"] = $object[
"description"];
130 $this->format_options[
"$counter"][
"type"] = $object[
"type"];
131 $this->format_options[
"$counter"][
"depth"] =
$tab;
132 $this->format_options[
"$counter"][
"container"] =
false;
133 $this->format_options[
"$counter"][
"visible"] =
true;
136 for ($i = 0; $i <
$tab; ++$i)
138 $this->format_options[
"$counter"][
"tab"][] =
'blank';
141 if ($object[
"child"] != $this->root_id and (!in_array($object[
"parent"],$this->expanded)
142 or !$this->format_options[
"$parent_index"][
"visible"]))
144 $this->format_options[
"$counter"][
"visible"] =
false;
148 if ($object[
"child"] != $this->root_id)
150 $this->format_options[
"$parent_index"][
"container"] =
true;
152 if (in_array($object[
"parent"],$this->expanded))
154 $this->format_options[
"$parent_index"][
"tab"][($tab-2)] =
'minus';
158 $this->format_options[
"$parent_index"][
"tab"][($tab-2)] =
'plus';
165 $this->
setOutput($object[
"child"],$a_depth);
181 $title = $lng->txt(
"wsp_personal_workspace");
183 $tpl->setCurrentBlock(
"icon");
186 $tpl->parseCurrentBlock();
188 $tpl->setCurrentBlock(
"link");
194 if ($style_class !=
"")
196 $tpl->setVariable(
"A_CLASS",
' class="'.$style_class.
'" ' );
199 $tpl->parseCurrentBlock();
210 if ($a_node_id ==
"")
216 if(!is_array(
$_SESSION[$this->expand_variable]))
221 if($a_node_id > 0 && !in_array($a_node_id,
$_SESSION[$this->expand_variable]))
223 array_push(
$_SESSION[$this->expand_variable],$a_node_id);
228 $key = array_keys(
$_SESSION[$this->expand_variable],-(
int) $a_node_id);
229 unset(
$_SESSION[$this->expand_variable][$key[0]]);
244 $ilCtrl->setParameterByClass(
"ilobjworkspacerootfoldergui",
"wsp_id", $a_node_id);
245 return $ilCtrl->getLinkTargetByClass(
"ilobjworkspacerootfoldergui",
"");
248 $ilCtrl->setParameterByClass(
"ilobjworkspacefoldergui",
"wsp_id", $a_node_id);
249 return $ilCtrl->getLinkTargetByClass(
"ilobjworkspacefoldergui",
"");
271 $this->allowed_types = $a_types;
280 $this->show_details = $s_details;
289 if ($this->show_details==
'y' && !empty($a_desc))
304 return $lng->txt(
"icon").
" ".$lng->txt($a_type);
309 return sizeof($this->tree->getChildsByType($a_node_id,
"wfld"));
314 return $this->tree->getParentId($a_node_id);
322 $tpl->setBodyClass(
"std");