4 require_once
'Services/Repository/classes/class.ilRepositoryExplorer.php';
33 public function __construct($a_type, $a_target, $a_session_variable)
37 $this->
setId(
"cont_paste_explorer");
40 $this->type = $a_type;
44 $this->root_id = $this->tree->readRootId();
45 $this->order_column =
'title';
49 $this->filter = array();
67 public function isClickable($a_type, $a_ref_id, $a_obj_id = 0)
74 $this->form_items[
$type] =
true;
78 $this->form_items[
$type] =
false;
82 $this->checked_items = $a_checked_items;
86 return in_array($a_id, $this->checked_items) ?
true :
false;
90 $this->post_var = $a_post_var;
105 $this->form_item_permission = $a_form_item_permission;
126 !array_key_exists($a_type, $this->form_items) ||
127 !$this->form_items[$a_type]
133 if(is_array(
$_SESSION[
"clipboard"][
"ref_ids"]))
135 $disabled = in_array($a_node_id,
$_SESSION[
"clipboard"][
"ref_ids"]);
137 else if((
int)
$_SESSION[
"clipboard"][
"ref_ids"])
139 $disabled = $a_node_id == $_SESSION[
"clipboard"][
"ref_ids"];
141 else if($_SESSION[
"clipboard"][
"cmd"] ==
'copy' && $a_node_id == $_SESSION[
"clipboard"][
"parent"])
149 case self::SEL_TYPE_CHECK:
153 case self::SEL_TYPE_RADIO:
163 if (!isset($a_node_id) or !is_array($a_option))
165 $this->ilias->raiseError(get_class($this).
"::formatObject(): Missing parameter or wrong datatype! ".
166 "node_id: ".$a_node_id.
" options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
170 foreach ($a_option[
"tab"] as $picture)
172 if ($picture ==
'plus')
174 $tpl->setCurrentBlock(
"exp_desc");
175 $tpl->setVariable(
"EXP_DESC", $lng->txt(
"expand"));
176 $tpl->parseCurrentBlock();
178 $tpl->setCurrentBlock(
"expander");
179 $tpl->setVariable(
"LINK_NAME", $a_node_id);
180 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
181 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/plus.png"));
182 $tpl->parseCurrentBlock();
186 if ($picture ==
'minus' && $this->show_minus)
188 $tpl->setCurrentBlock(
"exp_desc");
189 $tpl->setVariable(
"EXP_DESC", $lng->txt(
"collapse"));
190 $tpl->parseCurrentBlock();
192 $tpl->setCurrentBlock(
"expander");
193 $tpl->setVariable(
"LINK_NAME", $a_node_id);
194 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
195 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/minus.png"));
196 $tpl->parseCurrentBlock();
203 $tpl->setCurrentBlock(
"blank");
204 $tpl->setVariable(
"BLANK_PATH", $this->
getImage(
"browser/blank.png"));
205 $tpl->parseCurrentBlock();
208 if ($this->output_icons)
210 $tpl->setCurrentBlock(
"icon");
215 $tpl->setVariable(
"TARGET_ID" ,
"iconid_".$a_node_id);
216 $this->iconList[] =
"iconid_".$a_node_id;
217 $tpl->setVariable(
"TXT_ALT_IMG", $lng->txt($a_option[
"desc"]));
218 $tpl->parseCurrentBlock();
221 if(strlen($formItem = $this->
buildFormItem($a_node_id, $a_option[
'type'])))
223 $tpl->setCurrentBlock(
'check');
224 $tpl->setVariable(
'OBJ_CHECK', $formItem);
225 $tpl->parseCurrentBlock();
228 if ($this->
isClickable($a_option[
"type"], $a_node_id,$a_obj_id))
230 $tpl->setCurrentBlock(
"link");
238 if ($style_class !=
"")
240 $tpl->setVariable(
"A_CLASS",
' class="'.$style_class.
'" ' );
243 if (($onclick = $this->
buildOnClick($a_node_id, $a_option[
"type"], $a_option[
"title"])) !=
"")
245 $tpl->setVariable(
"ONCLICK",
"onClick=\"$onclick\"");
248 $tpl->setVariable(
"LINK_NAME", $a_node_id);
249 $tpl->setVariable(
"TITLE", $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]));
251 $this->
buildDescription($a_option[
"description"], $a_node_id, $a_option[
"type"]), $this->textwidth,
true));
252 $frame_target = $this->
buildFrameTarget($a_option[
"type"], $a_node_id, $a_option[
"obj_id"]);
253 if ($frame_target !=
"")
255 $tpl->setVariable(
"TARGET",
" target=\"".$frame_target.
"\"");
257 $tpl->parseCurrentBlock();
261 $obj_title = $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]);
264 if($a_node_id == $this->highlighted)
266 $obj_title =
"<span class=\"ilHighlighted\">".$obj_title.
"</span>";
269 $tpl->setCurrentBlock(
"text");
270 $tpl->setVariable(
"OBJ_TITLE", $obj_title);
272 $this->
buildDescription($a_option[
"desc"], $a_node_id, $a_option[
"type"]), $this->textwidth,
true));
273 $tpl->parseCurrentBlock();
276 $tpl->setCurrentBlock(
"list_item");
277 $tpl->parseCurrentBlock();
278 $tpl->touchBlock(
"element");
296 $tpl->setCurrentBlock(
"icon");
297 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
301 $title = $lng->txt(
"repository");
306 $tpl->parseCurrentBlock();
308 if(strlen($formItem = $this->
buildFormItem($a_obj_id, $a_option[
'type'])))
310 $tpl->setCurrentBlock(
'check');
311 $tpl->setVariable(
'OBJ_CHECK', $formItem);
312 $tpl->parseCurrentBlock();
327 if ($ilAccess->checkAccess(
"read",
"", $a_ref_id))
342 if(!$ilAccess->checkAccess(
'visible',
'', $a_ref_id))