ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilPasteIntoMultipleItemsExplorer Class Reference

ilPasteIntoMultipleItemsExplorer Explorer More...

+ Inheritance diagram for ilPasteIntoMultipleItemsExplorer:
+ Collaboration diagram for ilPasteIntoMultipleItemsExplorer:

Public Member Functions

 __construct (int $type, string $target, string $session_variable)
 
 isClickable (string $type, int $ref_id=0)
 
 addFormItemForType (string $type)
 
 removeFormItemForType (string $type)
 
 setCheckedItems (array $checked_items=[])
 
 isItemChecked (int $id)
 
 setPostVar (string $post_var)
 
 getPostVar ()
 
 setRequiredFormItemPermission (string $form_item_permission)
 
 getRequiredFormItemPermission ()
 
 buildFormItem (int $node_id, string $type)
 
 formatObject (ilTemplate $tpl, $node_id, array $option, $obj_id=0)
 
 formatHeader (ilTemplate $tpl, $obj_id, array $option)
 
 showChilds ($parent_id, $obj_id=0)
 
 isVisible ($ref_id, string $type)
 
- Public Member Functions inherited from ilRepositoryExplorer
 setForceOpenPath (array $a_path)
 set force open path More...
 
 buildLinkTarget ($a_node_id, string $a_type)
 note: most of this stuff is used by ilCourseContentInterface too More...
 
 getImage (string $a_name, string $a_type="", $a_obj_id="")
 
 isClickable (string $type, int $ref_id=0)
 
 showChilds ($a_parent_id, int $a_obj_id=0)
 
 isVisible ($a_ref_id, string $a_type)
 
 formatHeader (ilTemplate $tpl, $a_obj_id, array $a_option)
 
 sortNodes (array $a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array More...
 
 forceExpanded ($a_obj_id)
 force expansion of node More...
 
- Public Member Functions inherited from ilExplorer
 setId (string $a_val)
 
 getId ()
 
 setAsynchExpanding (bool $a_val)
 
 getAsynchExpanding ()
 
 initItemCounter (int $a_number)
 
 setTitle (string $a_val)
 
 setTitleLength (int $a_length)
 
 getTitleLength ()
 
 getTitle ()
 
 setRoot ($a_root_id)
 
 getRoot ()
 
 setOrderColumn (string $a_column)
 
 setOrderDirection (string $a_direction)
 
 setTargetGet (string $a_target_get)
 
 setParamsGet (array $a_params_get)
 
 setExpandTarget (string $a_exp_target)
 target script for expand icons More...
 
 setFrameUpdater (string $a_up_frame, string $a_up_script, string $a_params="")
 
 highlightNode (string $a_id)
 
 checkPermissions (bool $a_check)
 
 setSessionExpandVariable (string $a_var_name="expand")
 
 outputIcons (bool $a_icons)
 
 setClickable (string $a_type, bool $a_clickable)
 
 isVisible ( $a_ref_id, string $a_type)
 
 setTreeLead (string $a_val)
 
 getTreeLead ()
 
 isClickable (string $type, int $ref_id=0)
 
 setPostSort (bool $a_sort)
 
 setFilterMode (int $a_mode=IL_FM_NEGATIVE)
 
 getFilterMode ()
 
 setUseStandardFrame (bool $a_val)
 Set use standard frame. More...
 
 getUseStandardFrame ()
 
 getChildsOfNode ($a_parent_id)
 
 setOutput ( $a_parent_id, int $a_depth=1, int $a_obj_id=0, bool $a_highlighted_subtree=false)
 Creates output for explorer view in admin menue recursive method. More...
 
 modifyChilds ( $a_parent_id, array $a_objects)
 
 showChilds ($a_parent_id)
 determines wether the childs of an object should be shown or not note: this standard implementation always returns true but it could be overwritten by derived classes (e.g. More...
 
 forceExpanded ($a_obj_id)
 force expansion of node More...
 
 getMaximumTreeDepth ()
 
 getOutput ()
 
 handleListEndTags (ilTemplate $a_tpl_tree, int $a_cur_depth, int $a_item_depth)
 handle list end tags ( and ) More...
 
 handleListStartTags (ilTemplate $a_tpl_tree, int $a_cur_depth, int $a_item_depth)
 handle list start tags ( More...
 
 formatHeader (ilTemplate $tpl, $a_obj_id, array $a_option)
 
 formatObject (ilTemplate $tpl, $a_node_id, array $a_option, $a_obj_id=0)
 
 getImage (string $a_name, string $a_type="", $a_obj_id="")
 
 getImageAlt (string $a_default_text, string $a_type="", $a_obj_id="")
 
 getNodeStyleClass ( $a_id, string $a_type)
 
 buildLinkTarget ( $a_node_id, string $a_type)
 
 buildOnClick ( $a_node_id, string $a_type, string $a_title)
 
 buildTitle (string $a_title, $a_id, string $a_type)
 
 buildDescription (string $a_desc, $a_id, string $a_type)
 
 buildSelect ($a_node_id, string $a_type)
 standard implementation for adding an option select box between image and title More...
 
 buildFrameTarget (string $a_type, $a_child=0, $a_obj_id=0)
 
 createTarget (string $a_type, $a_node_id, bool $a_highlighted_subtree=false, bool $a_append_anch=true)
 
 setFrameTarget (string $a_target)
 
 createLines (int $a_depth)
 
 is_in_array (int $a_start, int $a_depth)
 
 getIndex (array $a_data)
 
 addFilter (string $a_item)
 
 delFilter (string $a_item)
 
 setExpand ($a_node_id)
 set the expand option this value is stored in a SESSION variable to save it different view (lo view, frm view,...) More...
 
 forceExpandAll (bool $a_mode, bool $a_show_minus=true)
 force expandAll. More...
 
 setFiltered (bool $a_bool)
 
 checkFilter (string $a_item)
 
 sortNodes (array $a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array More...
 

Data Fields

const SEL_TYPE_CHECK = 1
 
const SEL_TYPE_RADIO = 2
 
- Data Fields inherited from ilExplorer
string $id = ""
 
string $output = ""
 
array $format_options = []
 
ilTree $tree
 
string $target = ""
 
string $target_get = ""
 
string $params_get = ""
 
array $expanded = []
 
string $order_column = ""
 
string $order_direction = "asc"
 
string $expand_target = null
 
bool $rbac_check = false
 
bool $output_icons = false
 
string $expand_variable = ""
 
array $is_clickable = []
 
bool $post_sort = false
 
bool $filtered = false
 
bool $filter_mode
 
bool $expand_all = false
 
 $root_id = null
 
bool $use_standard_frame = false
 

Protected Attributes

int $type = 0
 
ClipboardManager $clipboard
 
array $checked_items = []
 
string $post_var = ''
 
array $form_items = []
 
string $form_item_permission = 'read'
 
- Protected Attributes inherited from ilRepositoryExplorer
ilSetting $settings
 
ilDBInterface $db
 
ilObjUser $user
 
ilAccessHandler $access
 
ilCtrl $ctrl
 
array $force_open_path
 
StandardGUIRequest $request
 
array $session_materials
 
array $item_group_items
 
array $type_grps
 
- Protected Attributes inherited from ilExplorer
ilObjectDefinition $obj_definition
 
ilErrorHandling $error
 
ilRbacSystem $rbacsystem
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
 $filter = []
 
string $highlighted = ""
 
bool $show_minus = true
 
int $counter = 0
 
bool $asnch_expanding = false
 
int $textwidth = 0
 
string $title = ""
 
string $up_frame = ""
 
string $a_up_script = ""
 
string $up_params = ""
 
string $frame_target = ""
 
string $up_script = ""
 
string $tree_lead = ""
 
array $iconList = []
 
ILIAS Refinery Factory $refinery
 
ILIAS HTTP Wrapper WrapperFactory $wrapper
 

Additional Inherited Members

- Protected Member Functions inherited from ilExplorer
 requestStr (string $key)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilPasteIntoMultipleItemsExplorer::__construct ( int  $type,
string  $target,
string  $session_variable 
)

Definition at line 42 of file class.ilPasteIntoMultipleItemsExplorer.php.

43 {
44 global $DIC;
45
46 $this->setId("cont_paste_explorer");
47 $this->type = $type;
48
50
51 $this->root_id = $this->tree->readRootId();
52 $this->order_column = 'title';
53 $this->setSessionExpandVariable($session_variable);
54
55 $this->addFilter('root');
56 $this->addFilter('crs');
57 $this->addFilter('grp');
58 $this->addFilter('cat');
59 $this->addFilter('fold');
60 $this->addFilter('lso');
61
62 $this->addFormItemForType('root');
63 $this->addFormItemForType('crs');
64 $this->addFormItemForType('grp');
65 $this->addFormItemForType('cat');
66 $this->addFormItemForType('fold');
67 $this->addFormItemForType('lso');
68
69 $this->setFiltered(true);
71 $this->clipboard = $DIC
72 ->repository()
73 ->internal()
74 ->domain()
75 ->clipboard();
76 }
const IL_FM_POSITIVE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addFilter(string $a_item)
setFilterMode(int $a_mode=IL_FM_NEGATIVE)
setSessionExpandVariable(string $a_var_name="expand")
setFiltered(bool $a_bool)
setId(string $a_val)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilExplorer\$target, $type, ILIAS\GlobalScreen\Provider\__construct(), ilExplorer\addFilter(), addFormItemForType(), IL_FM_POSITIVE, ilExplorer\setFiltered(), ilExplorer\setFilterMode(), ilExplorer\setId(), and ilExplorer\setSessionExpandVariable().

+ Here is the call graph for this function:

Member Function Documentation

◆ addFormItemForType()

ilPasteIntoMultipleItemsExplorer::addFormItemForType ( string  $type)

Definition at line 85 of file class.ilPasteIntoMultipleItemsExplorer.php.

85 : void
86 {
87 $this->form_items[$type] = true;
88 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ buildFormItem()

ilPasteIntoMultipleItemsExplorer::buildFormItem ( int  $node_id,
string  $type 
)

Definition at line 125 of file class.ilPasteIntoMultipleItemsExplorer.php.

125 : string
126 {
127 if (!$this->access->checkAccess($this->getRequiredFormItemPermission(), '', $node_id)) {
128 return "";
129 }
130
131 if (
132 !array_key_exists($type, $this->form_items) ||
133 !$this->form_items[$type]
134 ) {
135 return "";
136 }
137
138 $disabled = false;
139 if ($this->clipboard->hasEntries()) {
140 $disabled = in_array($node_id, $this->clipboard->getRefIds());
141 } elseif ($this->clipboard->getCmd() == 'copy' && $node_id == $this->clipboard->getParent()) {
142 $disabled = true;
143 }
144
145 switch ($this->type) {
148 $this->isItemChecked($node_id),
149 $this->post_var,
150 (string) $node_id,
151 $disabled
152 );
155 $this->isItemChecked($node_id),
156 $this->post_var,
157 (string) $node_id,
158 '',
159 $disabled
160 );
161 }
162 return "";
163 }
static formRadioButton(bool $checked, string $varname, string $value, ?string $onclick=null, bool $disabled=false)
static formCheckbox(bool $checked, string $varname, string $value, bool $disabled=false)

References ILIAS\Repository\access(), ilLegacyFormElementsUtil\formCheckbox(), and ilLegacyFormElementsUtil\formRadioButton().

+ Here is the call graph for this function:

◆ formatHeader()

ilPasteIntoMultipleItemsExplorer::formatHeader ( ilTemplate  $tpl,
  $obj_id,
array  $option 
)

Reimplemented from ilRepositoryExplorer.

Definition at line 286 of file class.ilPasteIntoMultipleItemsExplorer.php.

286 : void
287 {
288 $path = ilObject::_getIcon((int) $obj_id, "tiny", "root");
289
290 $tpl->setCurrentBlock("icon");
291 $nd = $this->tree->getNodeData(ROOT_FOLDER_ID);
292 $title = $nd["title"];
293 if ($title == "ILIAS") {
294 $title = $this->lng->txt("repository");
295 }
296
297 $tpl->setVariable("ICON_IMAGE", $path);
298 $tpl->setVariable("TXT_ALT_IMG", $title);
300
301 if (strlen($formItem = $this->buildFormItem((int) $obj_id, $option['type']))) {
302 $tpl->setCurrentBlock('check');
303 $tpl->setVariable('OBJ_CHECK', $formItem);
305 }
306
307 $tpl->setVariable('OBJ_TITLE', $title);
308 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
ilGlobalTemplateInterface $tpl
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
const ROOT_FOLDER_ID
Definition: constants.php:32
$nd
Definition: error.php:30
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
$path
Definition: ltiservices.php:30

References $nd, $path, ilObject\_getIcon(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), ROOT_FOLDER_ID, ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ formatObject()

ilPasteIntoMultipleItemsExplorer::formatObject ( ilTemplate  $tpl,
  $node_id,
array  $option,
  $obj_id = 0 
)

Reimplemented from ilExplorer.

Definition at line 165 of file class.ilPasteIntoMultipleItemsExplorer.php.

165 : void
166 {
167 $node_id = (int) $node_id;
168 $obj_id = (int) $obj_id;
169 if (!isset($node_id) or !is_array($option)) {
170 $this->error->raiseError(
171 get_class($this) .
172 "::formatObject(): Missing parameter or wrong datatype! " .
173 "node_id: " .
174 $node_id .
175 " options:" .
176 var_dump($option),
177 $this->error->WARNING
178 );
179 }
180
181 $pic = false;
182 foreach ($option["tab"] as $picture) {
183 if ($picture == 'plus') {
184 $tpl->setCurrentBlock("expander");
185 $tpl->setVariable("EXP_DESC", $this->lng->txt("expand"));
186 $target = $this->createTarget('+', $node_id);
187 $tpl->setVariable("LINK_NAME", $node_id);
188 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
189 $tpl->setVariable("IMGPATH", $this->getImage("browser/plus.png"));
190 $tpl->parseCurrentBlock();
191 $pic = true;
192 }
193
194 if ($picture == 'minus' && $this->show_minus) {
195 $tpl->setCurrentBlock("expander");
196 $tpl->setVariable("EXP_DESC", $this->lng->txt("collapse"));
197 $target = $this->createTarget('-', $node_id);
198 $tpl->setVariable("LINK_NAME", $node_id);
199 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
200 $tpl->setVariable("IMGPATH", $this->getImage("browser/minus.png"));
201 $tpl->parseCurrentBlock();
202 $pic = true;
203 }
204 }
205
206 if (!$pic) {
207 $tpl->setCurrentBlock("blank");
208 $tpl->setVariable("BLANK_PATH", $this->getImage("browser/blank.png"));
209 $tpl->parseCurrentBlock();
210 }
211
212 if ($this->output_icons) {
213 $tpl->setCurrentBlock("icon");
214
215 $path = ilObject::_getIcon($obj_id, "tiny", $option["type"]);
216 $tpl->setVariable("ICON_IMAGE", $path);
217
218 $tpl->setVariable("TARGET_ID", "iconid_" . $node_id);
219 $this->iconList[] = "iconid_" . $node_id;
220 $tpl->setVariable("TXT_ALT_IMG", $this->lng->txt($option["desc"]));
222 }
223
224 if (strlen($formItem = $this->buildFormItem($node_id, $option['type']))) {
225 $tpl->setCurrentBlock('check');
226 $tpl->setVariable('OBJ_CHECK', $formItem);
228 }
229
230 if ($this->isClickable($option["type"], $node_id)) {
231 $tpl->setCurrentBlock("link");
232 $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($node_id, $option["type"]));
233
234 $style_class = $this->getNodeStyleClass($node_id, $option["type"]);
235
236 if ($style_class != "") {
237 $tpl->setVariable("A_CLASS", ' class="' . $style_class . '" ');
238 }
239
240 if (($onclick = $this->buildOnClick($node_id, $option["type"], $option["title"])) != "") {
241 $tpl->setVariable("ONCLICK", "onClick=\"$onclick\"");
242 }
243
244 $tpl->setVariable("LINK_NAME", $node_id);
245 $tpl->setVariable("TITLE", $this->buildTitle($option["title"], $node_id, $option["type"]));
247 "DESC",
249 $this->buildDescription($option["description"], $node_id, $option["type"]),
250 $this->textwidth,
251 true
252 )
253 );
254 $frame_target = $this->buildFrameTarget($option["type"], $node_id, $option["obj_id"]);
255 if ($frame_target != "") {
256 $tpl->setVariable("TARGET", " target=\"" . $frame_target . "\"");
257 }
258 } else {
259 $obj_title = $this->buildTitle($option["title"], $node_id, $option["type"]);
260
261 if ($node_id == $this->highlighted) {
262 $obj_title = "<span class=\"ilHighlighted\">" . $obj_title . "</span>";
263 }
264
265 $tpl->setCurrentBlock("text");
266 $tpl->setVariable("OBJ_TITLE", $obj_title);
268 "OBJ_DESC",
270 $this->buildDescription($option["desc"], $node_id, $option["type"]),
271 $this->textwidth,
272 true
273 )
274 );
275 }
277
278 $tpl->setCurrentBlock("list_item");
280 $tpl->touchBlock("element");
281 }
error(string $a_errmsg)
buildOnClick( $a_node_id, string $a_type, string $a_title)
getNodeStyleClass( $a_id, string $a_type)
buildTitle(string $a_title, $a_id, string $a_type)
buildFrameTarget(string $a_type, $a_child=0, $a_obj_id=0)
buildDescription(string $a_desc, $a_id, string $a_type)
string $frame_target
createTarget(string $a_type, $a_node_id, bool $a_highlighted_subtree=false, bool $a_append_anch=true)
buildLinkTarget($a_node_id, string $a_type)
note: most of this stuff is used by ilCourseContentInterface too
getImage(string $a_name, string $a_type="", $a_obj_id="")
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
touchBlock(string $block)
overwrites ITX::touchBlock.

References $path, ilObject\_getIcon(), error(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), ilStr\shortenTextExtended(), and ilTemplate\touchBlock().

+ Here is the call graph for this function:

◆ getPostVar()

ilPasteIntoMultipleItemsExplorer::getPostVar ( )

Definition at line 110 of file class.ilPasteIntoMultipleItemsExplorer.php.

110 : string
111 {
112 return $this->post_var;
113 }

◆ getRequiredFormItemPermission()

ilPasteIntoMultipleItemsExplorer::getRequiredFormItemPermission ( )

◆ isClickable()

ilPasteIntoMultipleItemsExplorer::isClickable ( string  $type,
int  $ref_id = 0 
)

Reimplemented from ilRepositoryExplorer.

Definition at line 78 of file class.ilPasteIntoMultipleItemsExplorer.php.

81 : bool {
82 return false;
83 }

◆ isItemChecked()

ilPasteIntoMultipleItemsExplorer::isItemChecked ( int  $id)

Definition at line 100 of file class.ilPasteIntoMultipleItemsExplorer.php.

100 : bool
101 {
102 return in_array($id, $this->checked_items);
103 }

References $id.

◆ isVisible()

ilPasteIntoMultipleItemsExplorer::isVisible (   $ref_id,
string  $type 
)

Reimplemented from ilRepositoryExplorer.

Definition at line 321 of file class.ilPasteIntoMultipleItemsExplorer.php.

321 : bool
322 {
323 if (!$this->access->checkAccess('visible', '', (int) $ref_id)) {
324 return false;
325 }
326 return true;
327 }
$ref_id
Definition: ltiauth.php:66

References $ref_id, and ILIAS\Repository\access().

+ Here is the call graph for this function:

◆ removeFormItemForType()

ilPasteIntoMultipleItemsExplorer::removeFormItemForType ( string  $type)

Definition at line 90 of file class.ilPasteIntoMultipleItemsExplorer.php.

90 : void
91 {
92 $this->form_items[$type] = false;
93 }

◆ setCheckedItems()

ilPasteIntoMultipleItemsExplorer::setCheckedItems ( array  $checked_items = [])

Definition at line 95 of file class.ilPasteIntoMultipleItemsExplorer.php.

95 : void
96 {
97 $this->checked_items = $checked_items;
98 }

◆ setPostVar()

ilPasteIntoMultipleItemsExplorer::setPostVar ( string  $post_var)

Definition at line 105 of file class.ilPasteIntoMultipleItemsExplorer.php.

105 : void
106 {
107 $this->post_var = $post_var;
108 }

◆ setRequiredFormItemPermission()

ilPasteIntoMultipleItemsExplorer::setRequiredFormItemPermission ( string  $form_item_permission)

Definition at line 115 of file class.ilPasteIntoMultipleItemsExplorer.php.

115 : void
116 {
117 $this->form_item_permission = $form_item_permission;
118 }

◆ showChilds()

ilPasteIntoMultipleItemsExplorer::showChilds (   $parent_id,
  $obj_id = 0 
)

Definition at line 310 of file class.ilPasteIntoMultipleItemsExplorer.php.

310 : bool
311 {
312 if ($parent_id == 0) {
313 return true;
314 }
315 if ($this->access->checkAccess("read", "", (int) $parent_id)) {
316 return true;
317 }
318 return false;
319 }

References ILIAS\Repository\access().

+ Here is the call graph for this function:

Field Documentation

◆ $checked_items

array ilPasteIntoMultipleItemsExplorer::$checked_items = []
protected

Definition at line 37 of file class.ilPasteIntoMultipleItemsExplorer.php.

◆ $clipboard

ClipboardManager ilPasteIntoMultipleItemsExplorer::$clipboard
protected

Definition at line 35 of file class.ilPasteIntoMultipleItemsExplorer.php.

◆ $form_item_permission

string ilPasteIntoMultipleItemsExplorer::$form_item_permission = 'read'
protected

Definition at line 40 of file class.ilPasteIntoMultipleItemsExplorer.php.

◆ $form_items

array ilPasteIntoMultipleItemsExplorer::$form_items = []
protected

Definition at line 39 of file class.ilPasteIntoMultipleItemsExplorer.php.

◆ $post_var

string ilPasteIntoMultipleItemsExplorer::$post_var = ''
protected

Definition at line 38 of file class.ilPasteIntoMultipleItemsExplorer.php.

◆ $type

int ilPasteIntoMultipleItemsExplorer::$type = 0
protected

Definition at line 34 of file class.ilPasteIntoMultipleItemsExplorer.php.

Referenced by __construct().

◆ SEL_TYPE_CHECK

const ilPasteIntoMultipleItemsExplorer::SEL_TYPE_CHECK = 1

Definition at line 31 of file class.ilPasteIntoMultipleItemsExplorer.php.

◆ SEL_TYPE_RADIO

const ilPasteIntoMultipleItemsExplorer::SEL_TYPE_RADIO = 2

The documentation for this class was generated from the following file: