4 require_once
'Services/Repository/classes/class.ilRepositoryExplorer.php';
37 $this->
setId(
"cont_paste_explorer");
42 parent::__construct($a_target);
44 $this->root_id = $this->tree->readRootId();
45 $this->order_column =
'title';
49 $this->filter =
array();
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) ||
134 if(is_array(
$_SESSION[
"clipboard"][
"ref_ids"]))
136 $disabled = in_array($a_node_id,
$_SESSION[
"clipboard"][
"ref_ids"]);
138 else if((
int)
$_SESSION[
"clipboard"][
"ref_ids"])
140 $disabled = $a_node_id == $_SESSION[
"clipboard"][
"ref_ids"];
142 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(
"expander");
175 $tpl->setVariable(
"EXP_DESC", $lng->txt(
"expand"));
177 $tpl->setVariable(
"LINK_NAME", $a_node_id);
178 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
179 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/plus.png"));
180 $tpl->parseCurrentBlock();
184 if ($picture ==
'minus' && $this->show_minus)
186 $tpl->setCurrentBlock(
"expander");
187 $tpl->setVariable(
"EXP_DESC", $lng->txt(
"collapse"));
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");
211 $tpl->setVariable(
"TARGET_ID" ,
"iconid_".$a_node_id);
212 $this->iconList[] =
"iconid_".$a_node_id;
213 $tpl->setVariable(
"TXT_ALT_IMG", $lng->txt($a_option[
"desc"]));
214 $tpl->parseCurrentBlock();
217 if(strlen($formItem = $this->
buildFormItem($a_node_id, $a_option[
'type'])))
219 $tpl->setCurrentBlock(
'check');
220 $tpl->setVariable(
'OBJ_CHECK', $formItem);
221 $tpl->parseCurrentBlock();
224 if ($this->
isClickable($a_option[
"type"], $a_node_id,$a_obj_id))
226 $tpl->setCurrentBlock(
"link");
234 if ($style_class !=
"")
236 $tpl->setVariable(
"A_CLASS",
' class="'.$style_class.
'" ' );
239 if (($onclick = $this->
buildOnClick($a_node_id, $a_option[
"type"], $a_option[
"title"])) !=
"")
241 $tpl->setVariable(
"ONCLICK",
"onClick=\"$onclick\"");
244 $tpl->setVariable(
"LINK_NAME", $a_node_id);
245 $tpl->setVariable(
"TITLE", $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]));
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 $obj_title = $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]);
260 if($a_node_id == $this->highlighted)
262 $obj_title =
"<span class=\"ilHighlighted\">".$obj_title.
"</span>";
265 $tpl->setCurrentBlock(
"text");
266 $tpl->setVariable(
"OBJ_TITLE", $obj_title);
268 $this->
buildDescription($a_option[
"desc"], $a_node_id, $a_option[
"type"]), $this->textwidth,
true));
269 $tpl->parseCurrentBlock();
272 $tpl->setCurrentBlock(
"list_item");
273 $tpl->parseCurrentBlock();
274 $tpl->touchBlock(
"element");
292 $tpl->setCurrentBlock(
"icon");
293 $nd = $tree->getNodeData(ROOT_FOLDER_ID);
297 $title = $lng->txt(
"repository");
302 $tpl->parseCurrentBlock();
304 if(strlen($formItem = $this->
buildFormItem($a_obj_id, $a_option[
'type'])))
306 $tpl->setCurrentBlock(
'check');
307 $tpl->setVariable(
'OBJ_CHECK', $formItem);
308 $tpl->parseCurrentBlock();
323 if ($ilAccess->checkAccess(
"read",
"", $a_ref_id))
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
formatHeader($tpl, $a_obj_id, $a_option)
getNodeStyleClass($a_id, $a_type)
get style class for node
buildLinkTarget($a_node_id, $a_type)
note: most of this stuff is used by ilCourseContentInterface too
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
getRequiredFormItemPermission()
Get required permission.
addFormItemForType($type)
isClickable($a_type, $a_ref_id=0, $a_obj_id=0)
showChilds($a_ref_id, $a_obj_id=0)
setFiltered($a_bool)
active/deactivate the filter public
createTarget($a_type, $a_node_id, $a_highlighted_subtree=false, $a_append_anch=true)
Creates Get Parameter private.
buildOnClick($a_node_id, $a_type, $a_title)
get onclick event handling (may be overwritten by derived classes)
__construct($a_type, $a_target, $a_session_variable)
Constructor public.
getImage($a_name, $a_type="", $a_obj_id="")
get image path
buildFormItem($a_node_id, $a_type)
formatObject($tpl, $a_node_id, $a_option, $a_obj_id=0)
redirection script todo: (a better solution should control the processing via a xml file) ...
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
STATIC, do not use $this inside!
Create styles array
The data for the language used.
static formRadioButton($checked, $varname, $value, $onclick=null, $disabled=false)
??? public
buildTitle($a_title, $a_id, $a_type)
standard implementation for title, may be overwritten by derived classes
setCheckedItems($a_checked_items=array())
setRequiredFormItemPermission($a_form_item_permission)
Set required perission for form item visibility.
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
addFilter($a_item)
adds item to the filter public
removeFormItemForType($type)
buildDescription($a_desc, $a_id, $a_type)
standard implementation for description, may be overwritten by derived classes
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public