4 require_once
'Services/Repository/classes/class.ilRepositoryExplorer.php';
37 $this->root_id = $this->tree->readRootId();
38 $this->order_column =
'title';
42 $this->filter = array();
57 public function isClickable($a_type, $a_ref_id, $a_obj_id = 0)
64 $this->form_items[$type] =
true;
68 $this->form_items[$type] =
false;
72 $this->checked_item = $a_checked_item;
76 return $this->checked_item == $a_id ?
true :
false;
80 $this->post_var = $a_post_var;
89 $this->excluded_obj_id = $a_obj_id;
101 global $ilObjDataCache, $ilAccess;
103 if(!array_key_exists($a_type, $this->form_items) || !$this->form_items[$a_type])
return '';
105 if($ilObjDataCache->lookupObjId($a_node_id) == $this->
getExcludeObjId())
return '';
107 if(!$ilAccess->checkAccess(
'moderate_frm',
'', $a_node_id))
return '';
116 if (!isset($a_node_id) or !is_array($a_option))
118 $this->ilias->raiseError(get_class($this).
"::formatObject(): Missing parameter or wrong datatype! ".
119 "node_id: ".$a_node_id.
" options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
123 foreach ($a_option[
"tab"] as $picture)
125 if ($picture ==
'plus')
127 $tpl->setCurrentBlock(
"exp_desc");
128 $tpl->setVariable(
"EXP_DESC", $lng->txt(
"expand"));
129 $tpl->parseCurrentBlock();
131 $tpl->setCurrentBlock(
"expander");
132 $tpl->setVariable(
"LINK_NAME", $a_node_id);
133 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
134 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/plus.png"));
135 $tpl->parseCurrentBlock();
139 if ($picture ==
'minus' && $this->show_minus)
141 $tpl->setCurrentBlock(
"exp_desc");
142 $tpl->setVariable(
"EXP_DESC", $lng->txt(
"collapse"));
143 $tpl->parseCurrentBlock();
145 $tpl->setCurrentBlock(
"expander");
146 $tpl->setVariable(
"LINK_NAME", $a_node_id);
147 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
148 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/minus.png"));
149 $tpl->parseCurrentBlock();
156 $tpl->setCurrentBlock(
"blank");
157 $tpl->setVariable(
"BLANK_PATH", $this->
getImage(
"browser/blank.png"));
158 $tpl->parseCurrentBlock();
161 if ($this->output_icons)
163 $tpl->setCurrentBlock(
"icon");
164 $tpl->setVariable(
"ICON_IMAGE" , $this->
getImage(
"icon_".$a_option[
"type"].
".png", $a_option[
"type"], $a_obj_id));
166 $tpl->setVariable(
"TARGET_ID" ,
"iconid_".$a_node_id);
167 $this->iconList[] =
"iconid_".$a_node_id;
168 $tpl->setVariable(
"TXT_ALT_IMG", $lng->txt($a_option[
"desc"]));
169 $tpl->parseCurrentBlock();
172 if(strlen($formItem = $this->
buildFormItem($a_node_id, $a_option[
'type'])))
174 $tpl->setCurrentBlock(
'check');
175 $tpl->setVariable(
'OBJ_CHECK', $formItem);
176 $tpl->parseCurrentBlock();
179 if ($this->
isClickable($a_option[
"type"], $a_node_id,$a_obj_id))
181 $tpl->setCurrentBlock(
"link");
189 if ($style_class !=
"")
191 $tpl->setVariable(
"A_CLASS",
' class="'.$style_class.
'" ' );
194 if (($onclick = $this->
buildOnClick($a_node_id, $a_option[
"type"], $a_option[
"title"])) !=
"")
196 $tpl->setVariable(
"ONCLICK",
"onClick=\"$onclick\"");
199 $tpl->setVariable(
"LINK_NAME", $a_node_id);
201 $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]),
202 $this->textwidth,
true));
204 $this->
buildDescription($a_option[
"description"], $a_node_id, $a_option[
"type"]), $this->textwidth,
true));
205 $frame_target = $this->
buildFrameTarget($a_option[
"type"], $a_node_id, $a_option[
"obj_id"]);
206 if ($frame_target !=
"")
208 $tpl->setVariable(
"TARGET",
" target=\"".$frame_target.
"\"");
210 $tpl->parseCurrentBlock();
214 $tpl->setCurrentBlock(
"text");
216 $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]), $this->textwidth,
true));
218 $this->
buildDescription($a_option[
"desc"], $a_node_id, $a_option[
"type"]), $this->textwidth,
true));
219 $tpl->parseCurrentBlock();
222 $tpl->setCurrentBlock(
"list_item");
223 $tpl->parseCurrentBlock();
224 $tpl->touchBlock(
"element");
242 $tpl->setCurrentBlock(
"icon");
243 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
247 $title = $lng->txt(
"repository");
252 $tpl->parseCurrentBlock();
254 if(strlen($formItem = $this->
buildFormItem($a_obj_id, $a_option[
'type'])))
256 $tpl->setCurrentBlock(
'check');
257 $tpl->setVariable(
'OBJ_CHECK', $formItem);
258 $tpl->parseCurrentBlock();