ILIAS  release_8 Revision v8.24
ilRepositoryExplorer Class Reference
+ Inheritance diagram for ilRepositoryExplorer:
+ Collaboration diagram for ilRepositoryExplorer:

Public Member Functions

 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...
 

Protected Attributes

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

- 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 Member Functions inherited from ilExplorer
 requestStr (string $key)
 

Detailed Description

Definition at line 29 of file class.ilRepositoryExplorer.php.

Member Function Documentation

◆ buildLinkTarget()

ilRepositoryExplorer::buildLinkTarget (   $a_node_id,
string  $a_type 
)

note: most of this stuff is used by ilCourseContentInterface too

Reimplemented from ilExplorer.

Definition at line 102 of file class.ilRepositoryExplorer.php.

102 : string
103 {
104 $ilCtrl = $this->ctrl;
105
106 $ref_id = $this->request->getRefId();
107
108 switch ($a_type) {
109 case "cat":
110 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node_id);
111 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
112 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
113 return $link;
114
115 case "grpr":
116 case "crsr":
117 case "catr":
118 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node_id);
119 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "redirect");
120 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
121 return $link;
122
123 case "grp":
124 $ilCtrl->setParameterByClass("ilobjgroupgui", "ref_id", $a_node_id);
125 $link = $ilCtrl->getLinkTargetByClass(["ilrepositorygui", "ilobjgroupgui"], "");
126 $ilCtrl->setParameterByClass("ilobjgroupgui", "ref_id", $ref_id);
127 return $link;
128
129 case "crs":
130 $ilCtrl->setParameterByClass("ilobjcoursegui", "ref_id", $a_node_id);
131 $link = $ilCtrl->getLinkTargetByClass(["ilrepositorygui", "ilobjcoursegui"], "view");
132 $ilCtrl->setParameterByClass("ilobjcoursegui", "ref_id", $ref_id);
133 return $link;
134
135 case 'rcrs':
136 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node_id);
137 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "infoScreen");
138 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id);
139 return $link;
140
141 case 'prg':
142 $ilCtrl->setParameterByClass("ilobjstudyprogrammegui", "ref_id", $a_node_id);
143 $link = $ilCtrl->getLinkTargetByClass("ilobjstudyprogrammegui", "view");
144 $ilCtrl->setParameterByClass("ilobjstudyprogrammegui", "ref_id", $ref_id);
145 return $link;
146
147 default:
148 return ilLink::_getStaticLink($a_node_id, $a_type, true);
149
150 }
151 }
$ref_id
Definition: ltiauth.php:67

References $ctrl, $ref_id, and ilLink\_getStaticLink().

+ Here is the call graph for this function:

◆ forceExpanded()

ilRepositoryExplorer::forceExpanded (   $a_obj_id)

force expansion of node

Reimplemented from ilExplorer.

Definition at line 394 of file class.ilRepositoryExplorer.php.

394 : bool
395 {
396 if (in_array($a_obj_id, $this->force_open_path)) {
397 return true;
398 }
399 return false;
400 }

◆ formatHeader()

ilRepositoryExplorer::formatHeader ( ilTemplate  $tpl,
  $a_obj_id,
array  $a_option 
)

Reimplemented from ilExplorer.

Reimplemented in ilPasteIntoMultipleItemsExplorer.

Definition at line 314 of file class.ilRepositoryExplorer.php.

314 : void
315 {
318 $ilCtrl = $this->ctrl;
319
320 // custom icons
321 $path = ilObject::_getIcon((int) $a_obj_id, "tiny", "root");
322
323 $tpl->setCurrentBlock("icon");
325 $title = $nd["title"];
326 if ($title === "ILIAS") {
327 $title = $lng->txt("repository");
328 }
329
330 $tpl->setVariable("ICON_IMAGE", $path);
331 $tpl->setVariable("TXT_ALT_IMG", $lng->txt("icon") . " " . $title);
333
334 $tpl->setCurrentBlock("link");
335 $tpl->setVariable("TITLE", $title);
336 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", "1");
338 "LINK_TARGET",
339 $ilCtrl->getLinkTargetByClass("ilrepositorygui", "")
340 );
341 $ilCtrl->setParameterByClass(
342 "ilrepositorygui",
343 "ref_id",
344 $this->request->getRefId()
345 );
346 $tpl->setVariable("TARGET", " target=\"_top\"");
348
349 $tpl->setCurrentBlock("element");
351 }
ilLanguage $lng
ilGlobalTemplateInterface $tpl
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
const ROOT_FOLDER_ID
Definition: constants.php:32
$nd
Definition: error.php:12
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
$path
Definition: ltiservices.php:32

References $ctrl, ilExplorer\$lng, $nd, $path, ilExplorer\$title, ilExplorer\$tpl, ilExplorer\$tree, ilObject\_getIcon(), ilTree\getNodeData(), ilGlobalTemplateInterface\parseCurrentBlock(), ROOT_FOLDER_ID, ilGlobalTemplateInterface\setCurrentBlock(), ilGlobalTemplateInterface\setVariable(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getImage()

ilRepositoryExplorer::getImage ( string  $a_name,
string  $a_type = "",
  $a_obj_id = "" 
)

Reimplemented from ilExplorer.

Definition at line 153 of file class.ilRepositoryExplorer.php.

153 : string
154 {
155 if ($a_type !== "") {
156 return ilObject::_getIcon((int) $a_obj_id, "tiny", $a_type);
157 }
158
159 return parent::getImage($a_name);
160 }

References ilObject\_getIcon().

+ Here is the call graph for this function:

◆ isClickable()

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

Reimplemented from ilExplorer.

Reimplemented in ilPasteIntoMultipleItemsExplorer.

Definition at line 162 of file class.ilRepositoryExplorer.php.

162 : bool
163 {
166
169 $ref_id,
170 $obj_id
171 )) {
172 return false;
173 }
174
175 switch ($type) {
176 case 'tst':
177 if (!$rbacsystem->checkAccess("read", $ref_id)) {
178 return false;
179 }
180
181 $query = sprintf("SELECT * FROM tst_tests WHERE obj_fi=%s", $obj_id);
182 $res = $ilDB->query($query);
183 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
184 return (bool) $row->complete;
185 }
186 return false;
187
188 case 'svy':
189 if (!$rbacsystem->checkAccess("read", $ref_id)) {
190 return false;
191 }
192
193 $query = sprintf("SELECT * FROM svy_svy WHERE obj_fi=%s", $obj_id);
194 $res = $ilDB->query($query);
195 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
196 return (bool) $row->complete;
197 }
198 return false;
199
200 // media pools can only be edited
201 case "mep":
202 if ($rbacsystem->checkAccess("read", $ref_id)) {
203 return true;
204 }
205 return false;
206 case 'grpr':
207 case 'crsr':
208 case 'catr':
210 case 'prg':
211 return $rbacsystem->checkAccess("visible", $ref_id);
212
213
214
215 // all other types are only clickable, if read permission is given
216 default:
217 if ($rbacsystem->checkAccess("read", $ref_id)) {
218 // check if lm is online
219 if ($type === "lm") {
220 $lm_obj = new ilObjLearningModule($ref_id);
221 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $ref_id))) {
222 return false;
223 }
224 }
225 // check if fblm is online
226 if ($type === "htlm") {
227 $lm_obj = new ilObjFileBasedLM($ref_id);
228 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $ref_id))) {
229 return false;
230 }
231 }
232 // check if fblm is online
233 if ($type === "sahs") {
234 $lm_obj = new ilObjSAHSLearningModule($ref_id);
235 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $ref_id))) {
236 return false;
237 }
238 }
239 // check if glossary is online
240 if ($type === "glo") {
242 if ((!ilObjGlossary::_lookupOnline($obj_id)) &&
243 (!$rbacsystem->checkAccess('write', $ref_id))) {
244 return false;
245 }
246 }
247
248 return true;
249 }
250 return false;
251 }
252 }
static _checkAllConditionsOfTarget(int $a_target_ref_id, int $a_target_id, string $a_target_type="", int $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
static _isAccessible(int $a_ref_id)
Check if target is accessible and not deleted.
ilRbacSystem $rbacsystem
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupOnline(int $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjSCORMLearningModule.
static _lookupObjectId(int $ref_id)
static _lookupObjId(int $ref_id)
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
$res
Definition: ltiservices.php:69
$query
$type

References $db, $ilDB, $query, ilExplorer\$rbacsystem, $ref_id, $res, $type, ilConditionHandler\_checkAllConditionsOfTarget(), ilContainerReferenceAccess\_isAccessible(), ilObject\_lookupObjectId(), ilObject\_lookupObjId(), ilObjGlossary\_lookupOnline(), ilRbacSystem\checkAccess(), and ilDBConstants\FETCHMODE_OBJECT.

+ Here is the call graph for this function:

◆ isVisible()

ilRepositoryExplorer::isVisible (   $a_ref_id,
string  $a_type 
)

Reimplemented from ilExplorer.

Reimplemented in ilPasteIntoMultipleItemsExplorer.

Definition at line 274 of file class.ilRepositoryExplorer.php.

274 : bool
275 {
276 $ilAccess = $this->access;
279
280 if (!$ilAccess->checkAccess('visible', '', $a_ref_id)) {
281 return false;
282 }
283
284 $is_course = false;
285 $container_parent_id = $tree->checkForParentType($a_ref_id, 'grp');
286 if (!$container_parent_id) {
287 $is_course = true;
288 $container_parent_id = $tree->checkForParentType($a_ref_id, 'crs');
289 }
290 if ($container_parent_id) {
291 // do not display session materials for container course/group
292 if ($container_parent_id !== $a_ref_id && $ilSetting->get("repository_tree_pres") === "all_types") {
293 // get container event items only once
294 if (!isset($this->session_materials[$container_parent_id])) {
295 $this->session_materials[$container_parent_id] = ilEventItems::_getItemsOfContainer($container_parent_id);
296 }
297 // get item group items only once
298 if (!isset($this->item_group_items[$container_parent_id])) {
299 $this->item_group_items[$container_parent_id] = ilItemGroupItems::_getItemsOfContainer($container_parent_id);
300 }
301 if (in_array($a_ref_id, $this->session_materials[$container_parent_id])) {
302 return false;
303 }
304 if (in_array($a_ref_id, $this->item_group_items[$container_parent_id])) {
305 return false;
306 }
307 }
308 }
309
310 return true;
311 }
static _getItemsOfContainer(int $a_ref_id)
static _getItemsOfContainer(int $a_ref_id)
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
global $ilSetting
Definition: privfeed.php:17

References $access, $ilSetting, $settings, ilExplorer\$tree, ilItemGroupItems\_getItemsOfContainer(), ilEventItems\_getItemsOfContainer(), and ilTree\checkForParentType().

+ Here is the call graph for this function:

◆ setForceOpenPath()

ilRepositoryExplorer::setForceOpenPath ( array  $a_path)

set force open path

Definition at line 94 of file class.ilRepositoryExplorer.php.

94 : void
95 {
96 $this->force_open_path = $a_path;
97 }

◆ showChilds()

ilRepositoryExplorer::showChilds (   $a_parent_id,
int  $a_obj_id = 0 
)
Parameters
int | string$a_parent_id

Definition at line 257 of file class.ilRepositoryExplorer.php.

257 : bool
258 {
260
261 if ($a_parent_id == 0) {
262 return true;
263 }
264 if (!ilConditionHandler::_checkAllConditionsOfTarget((int) $a_parent_id, $a_obj_id)) {
265 return false;
266 }
267 if ($rbacsystem->checkAccess("read", (int) $a_parent_id)) {
268 return true;
269 }
270
271 return false;
272 }

References ilExplorer\$rbacsystem, ilConditionHandler\_checkAllConditionsOfTarget(), and ilRbacSystem\checkAccess().

+ Here is the call graph for this function:

◆ sortNodes()

ilRepositoryExplorer::sortNodes ( array  $a_nodes,
  $a_parent_obj_id 
)

sort nodes and put adm object to the end of sorted array

Reimplemented from ilExplorer.

Definition at line 353 of file class.ilRepositoryExplorer.php.

353 : array
354 {
355 $objDefinition = $this->obj_definition;
356
357 if ($a_parent_obj_id > 0) {
358 $parent_type = ilObject::_lookupType($a_parent_obj_id);
359 } else {
360 $parent_type = "dummy";
361 $this->type_grps["dummy"] = ["root" => "dummy"];
362 }
363
364 if (empty($this->type_grps[$parent_type])) {
365 $this->type_grps[$parent_type] = $objDefinition->getGroupedRepositoryObjectTypes($parent_type);
366 }
367 $group = [];
368
369 foreach ($a_nodes as $node) {
370 $g = $objDefinition->getGroupOfObj($node["type"]);
371 if ($g == "") {
372 $g = $node["type"];
373 }
374 $group[$g][] = $node;
375 }
376
377 $nodes = [];
378 foreach ($this->type_grps[$parent_type] as $t => $g) {
379 if (array_key_exists($t, $group)
380 && is_array($group[$t])) {
381 // do we have to sort this group??
382 $sort = ilContainerSorting::_getInstance($a_parent_obj_id);
383 $group = $sort->sortItems($group);
384
385 foreach ($group[$t] as $k => $item) {
386 $nodes[] = $item;
387 }
388 }
389 }
390
391 return $nodes;
392 }
static _getInstance(int $a_obj_id)
ilObjectDefinition $obj_definition
static _lookupType(int $id, bool $reference=false)

References ilExplorer\$obj_definition, ilContainerSorting\_getInstance(), and ilObject\_lookupType().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilRepositoryExplorer::$access
protected

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

Referenced by isVisible().

◆ $ctrl

ilCtrl ilRepositoryExplorer::$ctrl
protected

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

Referenced by buildLinkTarget(), and formatHeader().

◆ $db

ilDBInterface ilRepositoryExplorer::$db
protected

Definition at line 32 of file class.ilRepositoryExplorer.php.

Referenced by isClickable().

◆ $force_open_path

array ilRepositoryExplorer::$force_open_path
protected

Definition at line 36 of file class.ilRepositoryExplorer.php.

◆ $item_group_items

array ilRepositoryExplorer::$item_group_items
protected

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

◆ $request

StandardGUIRequest ilRepositoryExplorer::$request
protected

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

◆ $session_materials

array ilRepositoryExplorer::$session_materials
protected

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

◆ $settings

ilSetting ilRepositoryExplorer::$settings
protected

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

Referenced by isVisible().

◆ $type_grps

array ilRepositoryExplorer::$type_grps
protected

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

◆ $user

ilObjUser ilRepositoryExplorer::$user
protected

Definition at line 33 of file class.ilRepositoryExplorer.php.


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