4 require_once
'Services/Repository/classes/class.ilRepositoryExplorer.php';
43 $this->type = $a_type;
44 $this->access = $a_access_handler;
53 $root =
new $root(null);
61 $this->tree = $a_tree;
63 $this->order_column =
'title';
67 $this->filter = array();
82 $this->access->checkAccess(
'read',
'', $a_ref_id))
94 public function sortNodes($a_nodes,$a_parent_obj_id)
99 public function isClickable($a_type, $a_ref_id, $a_obj_id = 0)
101 if(is_array($this->clickable) && in_array($a_type, $this->clickable) &&
111 $this->form_items[
$type] =
true;
115 $this->form_items[
$type] =
false;
119 $this->form_items = array();
123 $this->checked_items = $a_checked_items;
127 return in_array($a_id, $this->checked_items) ?
true :
false;
131 $this->post_var = $a_post_var;
140 if(!array_key_exists($a_type, $this->form_items) || !$this->form_items[$a_type])
147 case self::SEL_TYPE_CHECK:
150 case self::SEL_TYPE_RADIO:
159 if (!isset($a_node_id) or !is_array($a_option))
161 $this->ilias->raiseError(get_class($this).
"::formatObject(): Missing parameter or wrong datatype! ".
162 "node_id: ".$a_node_id.
" options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
166 foreach ($a_option[
"tab"] as $picture)
168 if ($picture ==
'plus')
170 $tpl->setCurrentBlock(
"exp_desc");
171 $tpl->setVariable(
"EXP_DESC", $lng->txt(
"expand"));
172 $tpl->parseCurrentBlock();
174 $tpl->setCurrentBlock(
"expander");
175 $tpl->setVariable(
"LINK_NAME", $a_node_id);
176 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
177 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/plus.png"));
178 $tpl->parseCurrentBlock();
182 if ($picture ==
'minus' && $this->show_minus)
184 $tpl->setCurrentBlock(
"exp_desc");
185 $tpl->setVariable(
"EXP_DESC", $lng->txt(
"collapse"));
186 $tpl->parseCurrentBlock();
188 $tpl->setCurrentBlock(
"expander");
189 $tpl->setVariable(
"LINK_NAME", $a_node_id);
190 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
191 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/minus.png"));
192 $tpl->parseCurrentBlock();
199 $tpl->setCurrentBlock(
"blank");
200 $tpl->setVariable(
"BLANK_PATH", $this->
getImage(
"browser/blank.png"));
201 $tpl->parseCurrentBlock();
204 if ($this->output_icons)
206 $tpl->setCurrentBlock(
"icon");
207 $tpl->setVariable(
"ICON_IMAGE" , $this->
getImage(
"icon_".$a_option[
"type"].
".png", $a_option[
"type"], $a_obj_id));
209 $tpl->setVariable(
"TARGET_ID" ,
"iconid_".$a_node_id);
210 $this->iconList[] =
"iconid_".$a_node_id;
211 $tpl->setVariable(
"TXT_ALT_IMG", $lng->txt($a_option[
"desc"]));
212 $tpl->parseCurrentBlock();
215 if(strlen($formItem = $this->
buildFormItem($a_node_id, $a_option[
'type'])))
217 $tpl->setCurrentBlock(
'check');
218 $tpl->setVariable(
'OBJ_CHECK', $formItem);
219 $tpl->parseCurrentBlock();
222 if ($this->
isClickable($a_option[
"type"], $a_node_id,$a_obj_id))
224 $tpl->setCurrentBlock(
"link");
232 if ($style_class !=
"")
234 $tpl->setVariable(
"A_CLASS",
' class="'.$style_class.
'" ' );
237 if (($onclick = $this->
buildOnClick($a_node_id, $a_option[
"type"], $a_option[
"title"])) !=
"")
239 $tpl->setVariable(
"ONCLICK",
"onClick=\"$onclick\"");
242 $tpl->setVariable(
"LINK_NAME", $a_node_id);
244 $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]),
245 $this->textwidth,
true));
247 $this->
buildDescription($a_option[
"description"], $a_node_id, $a_option[
"type"]), $this->textwidth,
true));
248 $frame_target = $this->
buildFrameTarget($a_option[
"type"], $a_node_id, $a_option[
"obj_id"]);
249 if ($frame_target !=
"")
251 $tpl->setVariable(
"TARGET",
" target=\"".$frame_target.
"\"");
253 $tpl->parseCurrentBlock();
257 $tpl->setCurrentBlock(
"text");
259 $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]), $this->textwidth,
true));
261 $this->
buildDescription($a_option[
"desc"], $a_node_id, $a_option[
"type"]), $this->textwidth,
true));
262 $tpl->parseCurrentBlock();
265 $tpl->setCurrentBlock(
"list_item");
266 $tpl->parseCurrentBlock();
267 $tpl->touchBlock(
"element");
284 $tpl->setCurrentBlock(
"icon");
285 $title = $this->tree->getNodeData($this->root_id);
289 $title = $lng->txt(
"personal_workspace");
294 $tpl->parseCurrentBlock();
296 if(strlen($formItem = $this->
buildFormItem($a_obj_id, $a_option[
'type'])))
298 $tpl->setCurrentBlock(
'check');
299 $tpl->setVariable(
'OBJ_CHECK', $formItem);
300 $tpl->parseCurrentBlock();
308 $this->clickable[] = $a_type;
313 $this->custom_link_target = $a_target;
318 if(!$this->custom_link_target)
323 $link = $this->custom_link_target.
"&".$this->target_get.
"=".$a_node_id;