4 require_once
'Services/Repository/classes/class.ilRepositoryExplorer.php';
52 $this->lng = $DIC->language();
53 $this->error = $DIC[
"ilErr"];
54 $this->access = $DIC->access();
55 $tree = $DIC->repositoryTree();
58 $this->
setId(
"cont_paste_explorer");
63 parent::__construct($a_target);
65 $this->root_id = $this->tree->readRootId();
66 $this->order_column =
'title';
70 $this->filter =
array();
95 $this->form_items[
$type] =
true;
99 $this->form_items[
$type] =
false;
103 $this->checked_items = $a_checked_items;
107 return in_array($a_id, $this->checked_items) ? true :
false;
111 $this->post_var = $a_post_var;
126 $this->form_item_permission = $a_form_item_permission;
146 !array_key_exists(
$a_type, $this->form_items) ||
153 if (is_array(
$_SESSION[
"clipboard"][
"ref_ids"])) {
154 $disabled = in_array($a_node_id,
$_SESSION[
"clipboard"][
"ref_ids"]);
155 } elseif ((
int)
$_SESSION[
"clipboard"][
"ref_ids"]) {
156 $disabled = $a_node_id == $_SESSION[
"clipboard"][
"ref_ids"];
157 } elseif ($_SESSION[
"clipboard"][
"cmd"] ==
'copy' && $a_node_id == $_SESSION[
"clipboard"][
"parent"]) {
161 switch ($this->type) {
162 case self::SEL_TYPE_CHECK:
166 case self::SEL_TYPE_RADIO:
177 if (!isset($a_node_id) or !is_array($a_option)) {
178 $ilErr->raiseError(get_class($this) .
"::formatObject(): Missing parameter or wrong datatype! " .
179 "node_id: " . $a_node_id .
" options:" . var_dump($a_option),
$ilErr->WARNING);
183 foreach ($a_option[
"tab"] as $picture) {
184 if ($picture ==
'plus') {
185 $tpl->setCurrentBlock(
"expander");
186 $tpl->setVariable(
"EXP_DESC",
$lng->txt(
"expand"));
188 $tpl->setVariable(
"LINK_NAME", $a_node_id);
189 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
190 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/plus.png"));
191 $tpl->parseCurrentBlock();
195 if ($picture ==
'minus' && $this->show_minus) {
196 $tpl->setCurrentBlock(
"expander");
197 $tpl->setVariable(
"EXP_DESC",
$lng->txt(
"collapse"));
199 $tpl->setVariable(
"LINK_NAME", $a_node_id);
200 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
201 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/minus.png"));
202 $tpl->parseCurrentBlock();
208 $tpl->setCurrentBlock(
"blank");
209 $tpl->setVariable(
"BLANK_PATH", $this->
getImage(
"browser/blank.png"));
210 $tpl->parseCurrentBlock();
213 if ($this->output_icons) {
214 $tpl->setCurrentBlock(
"icon");
219 $tpl->setVariable(
"TARGET_ID",
"iconid_" . $a_node_id);
220 $this->iconList[] =
"iconid_" . $a_node_id;
221 $tpl->setVariable(
"TXT_ALT_IMG",
$lng->txt($a_option[
"desc"]));
222 $tpl->parseCurrentBlock();
225 if (strlen($formItem = $this->
buildFormItem($a_node_id, $a_option[
'type']))) {
226 $tpl->setCurrentBlock(
'check');
227 $tpl->setVariable(
'OBJ_CHECK', $formItem);
228 $tpl->parseCurrentBlock();
231 if ($this->
isClickable($a_option[
"type"], $a_node_id, $a_obj_id)) {
232 $tpl->setCurrentBlock(
"link");
240 if ($style_class !=
"") {
241 $tpl->setVariable(
"A_CLASS",
' class="' . $style_class .
'" ');
244 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"]),
255 $frame_target = $this->
buildFrameTarget($a_option[
"type"], $a_node_id, $a_option[
"obj_id"]);
256 if ($frame_target !=
"") {
257 $tpl->setVariable(
"TARGET",
" target=\"" . $frame_target .
"\"");
259 $tpl->parseCurrentBlock();
261 $obj_title = $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]);
264 if ($a_node_id == $this->highlighted) {
265 $obj_title =
"<span class=\"ilHighlighted\">" . $obj_title .
"</span>";
268 $tpl->setCurrentBlock(
"text");
269 $tpl->setVariable(
"OBJ_TITLE", $obj_title);
275 $tpl->parseCurrentBlock();
278 $tpl->setCurrentBlock(
"list_item");
279 $tpl->parseCurrentBlock();
280 $tpl->touchBlock(
"element");
299 $tpl->setCurrentBlock(
"icon");
300 $nd =
$tree->getNodeData(ROOT_FOLDER_ID);
308 $tpl->parseCurrentBlock();
310 if (strlen($formItem = $this->
buildFormItem($a_obj_id, $a_option[
'type']))) {
311 $tpl->setCurrentBlock(
'check');
312 $tpl->setVariable(
'OBJ_CHECK', $formItem);
313 $tpl->parseCurrentBlock();
323 if ($a_ref_id == 0) {
327 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.
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
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.
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)
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