4 require_once
'Services/Repository/classes/class.ilRepositoryExplorer.php';
32 public function __construct($a_type, $a_target, $a_session_variable)
37 $this->type = $a_type;
41 $this->root_id = $this->tree->readRootId();
42 $this->order_column =
'title';
46 $this->filter = array();
64 public function isClickable($a_type, $a_ref_id, $a_obj_id = 0)
71 $this->form_items[
$type] =
true;
75 $this->form_items[
$type] =
false;
79 $this->checked_items = $a_checked_items;
83 return in_array($a_id, $this->checked_items) ?
true :
false;
87 $this->post_var = $a_post_var;
96 if(!array_key_exists($a_type, $this->form_items) || !$this->form_items[$a_type])
return '';
100 case self::SEL_TYPE_CHECK:
104 case self::SEL_TYPE_RADIO:
114 if (!isset($a_node_id) or !is_array($a_option))
116 $this->ilias->raiseError(get_class($this).
"::formatObject(): Missing parameter or wrong datatype! ".
117 "node_id: ".$a_node_id.
" options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
121 foreach ($a_option[
"tab"] as $picture)
123 if ($picture ==
'plus')
125 $tpl->setCurrentBlock(
"exp_desc");
126 $tpl->setVariable(
"EXP_DESC", $lng->txt(
"expand"));
127 $tpl->parseCurrentBlock();
129 $tpl->setCurrentBlock(
"expander");
130 $tpl->setVariable(
"LINK_NAME", $a_node_id);
131 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
132 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/plus.gif"));
133 $tpl->parseCurrentBlock();
137 if ($picture ==
'minus' && $this->show_minus)
139 $tpl->setCurrentBlock(
"exp_desc");
140 $tpl->setVariable(
"EXP_DESC", $lng->txt(
"collapse"));
141 $tpl->parseCurrentBlock();
143 $tpl->setCurrentBlock(
"expander");
144 $tpl->setVariable(
"LINK_NAME", $a_node_id);
145 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
146 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/minus.gif"));
147 $tpl->parseCurrentBlock();
154 $tpl->setCurrentBlock(
"blank");
155 $tpl->setVariable(
"BLANK_PATH", $this->
getImage(
"browser/blank.gif"));
156 $tpl->parseCurrentBlock();
159 if ($this->output_icons)
161 $tpl->setCurrentBlock(
"icon");
162 $tpl->setVariable(
"ICON_IMAGE" , $this->
getImage(
"icon_".$a_option[
"type"].
".gif", $a_option[
"type"], $a_obj_id));
164 $tpl->setVariable(
"TARGET_ID" ,
"iconid_".$a_node_id);
165 $this->iconList[] =
"iconid_".$a_node_id;
166 $tpl->setVariable(
"TXT_ALT_IMG", $lng->txt($a_option[
"desc"]));
167 $tpl->parseCurrentBlock();
170 if(strlen($formItem = $this->
buildFormItem($a_node_id, $a_option[
'type'])))
172 $tpl->setCurrentBlock(
'check');
173 $tpl->setVariable(
'OBJ_CHECK', $formItem);
174 $tpl->parseCurrentBlock();
177 if ($this->
isClickable($a_option[
"type"], $a_node_id,$a_obj_id))
179 $tpl->setCurrentBlock(
"link");
187 if ($style_class !=
"")
189 $tpl->setVariable(
"A_CLASS",
' class="'.$style_class.
'" ' );
192 if (($onclick = $this->
buildOnClick($a_node_id, $a_option[
"type"], $a_option[
"title"])) !=
"")
194 $tpl->setVariable(
"ONCLICK",
"onClick=\"$onclick\"");
197 $tpl->setVariable(
"LINK_NAME", $a_node_id);
199 $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]),
200 $this->textwidth,
true));
202 $this->
buildDescription($a_option[
"description"], $a_node_id, $a_option[
"type"]), $this->textwidth,
true));
203 $frame_target = $this->
buildFrameTarget($a_option[
"type"], $a_node_id, $a_option[
"obj_id"]);
204 if ($frame_target !=
"")
206 $tpl->setVariable(
"TARGET",
" target=\"".$frame_target.
"\"");
208 $tpl->parseCurrentBlock();
212 $tpl->setCurrentBlock(
"text");
214 $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]), $this->textwidth,
true));
216 $this->
buildDescription($a_option[
"desc"], $a_node_id, $a_option[
"type"]), $this->textwidth,
true));
217 $tpl->parseCurrentBlock();
220 $tpl->setCurrentBlock(
"list_item");
221 $tpl->parseCurrentBlock();
222 $tpl->touchBlock(
"element");
240 $tpl->setCurrentBlock(
"icon");
241 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
245 $title = $lng->txt(
"repository");
250 $tpl->parseCurrentBlock();
252 if(strlen($formItem = $this->
buildFormItem($a_obj_id, $a_option[
'type'])))
254 $tpl->setCurrentBlock(
'check');
255 $tpl->setVariable(
'OBJ_CHECK', $formItem);
256 $tpl->parseCurrentBlock();