ILIAS  release_8 Revision v8.24
ilRepositoryExplorerGUI Class Reference

Repository explorer GUI class. More...

+ Inheritance diagram for ilRepositoryExplorerGUI:
+ Collaboration diagram for ilRepositoryExplorerGUI:

Public Member Functions

 getRootNode ()
 Get root node. More...
 
 getNodeContent ($a_node)
 Get content of a node. More...
 
 getNodeIcon ($a_node)
 Get node icon path. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
 isNodeVisible ($a_node)
 Is node visible? More...
 
 sortChilds (array $a_childs, $a_parent_node_id)
 Sort childs. More...
 
 nodeHasVisibleChilds ($a_node)
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
- Public Member Functions inherited from ilTreeExplorerGUI
 __construct (string $a_expl_id, $a_parent_obj, string $a_parent_cmd, ilTree $a_tree, string $a_node_parameter_name="node_id")
 
 getTree ()
 
 setOrderField (string $a_val, bool $a_numeric=false)
 
 getOrderField ()
 
 setTypeWhiteList (array $a_val)
 Set type white list. More...
 
 getTypeWhiteList ()
 Get type white list. More...
 
 setTypeBlackList (array $a_val)
 Set type black list. More...
 
 getTypeBlackList ()
 Get type black list. More...
 
 setPreloadChilds (bool $a_val)
 
 getPreloadChilds ()
 
 getSuccessorNode ( $a_node_id, string $a_type="")
 Get successor node (currently only(!) based on lft/rgt tree values) More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 getNodeId ($a_node)
 Get id for node. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getRootNode ()
 Get root node. More...
 
 setRootId ($a_root)
 
 setPathOpen ($a_id)
 Set node path to be opened. More...
 
 getHTML ($new=false)
 Get HTML. More...
 
 getChildren ($record, $environment=null)
 Get a list of records (that list can also be empty). More...
 
 build (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record, $environment=null)
 
 getTreeLabel ()
 
 getTreeComponent ()
 
 toggleExplorerNodeState ()
 Should be called by an ilCtrl-enabled command class if a tree node toggle action should be processed. More...
 
- Public Member Functions inherited from ilExplorerBaseGUI
 setChildLimit (int $a_val)
 
 getChildLimit ()
 
 setSearchTerm (string $a_val)
 
 getSearchTerm ()
 
 setMainTemplate (ilGlobalTemplateInterface $a_main_tpl=null)
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get children of node. More...
 
 getNodeContent ($a_node)
 Get content of a node. More...
 
 getNodeId ($a_node)
 Get id of a node. More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
 nodeHasVisibleChilds ($a_node)
 Node has children Please note that this standard method may not be optimal depending on what a derived class does in isNodeVisible. More...
 
 sortChilds (array $a_childs, $a_parent_node_id)
 Sort childs. More...
 
 getNodeIcon ($a_node)
 Get node icon path. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getNodeTarget ($a_node)
 Get node target (frame) attribute. More...
 
 getNodeOnClick ($a_node)
 Get node onclick attribute. More...
 
 isNodeVisible ($a_node)
 Is node visible? More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 getId ()
 Get id of explorer element. More...
 
 setSkipRootNode (bool $a_val)
 
 getSkipRootNode ()
 
 setAjax (bool $a_val)
 
 getAjax ()
 
 setSecondaryHighlightedNodes (array $a_val)
 Set secondary (background) highlighted nodes. More...
 
 getSecondaryHighlightedNodes ()
 Get secondary (background) highlighted nodes. More...
 
 setNodeOpen ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setSelectMode (string $a_postvar, bool $a_multi=false)
 Set select mode (to deactivate, pass an empty string as postvar) More...
 
 setNodeSelected ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setOfflineMode (bool $a_val)
 
 getOfflineMode ()
 
 handleCommand ()
 Handle explorer internal command. More...
 
 getContainerId ()
 
 openNode ()
 Open node. More...
 
 closeNode ()
 Close node. More...
 
 getNodeAsync ()
 Get node asynchronously. More...
 
 beforeRendering ()
 Before rendering. More...
 
 getOnLoadCode ()
 Get on load code. More...
 
 getHTML ()
 
 renderNode ($a_node, ilTemplate $tpl)
 Render node. More...
 
 renderChilds ($a_node_id, ilTemplate $tpl)
 Render childs. More...
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id. More...
 
 getNodeIdForDomNodeId (string $a_dom_node_id)
 Get node id for dom node id. More...
 
 listItemStart (ilTemplate $tpl, $a_node)
 List item start. More...
 
 listItemEnd (ilTemplate $tpl)
 
 listStart (ilTemplate $tpl)
 
 listEnd (ilTemplate $tpl)
 
 isNodeOnclickEnabled ()
 
 setNodeOnclickEnabled (bool $nodeOnclickEnabled)
 
 isEnableDnd ()
 
 setEnableDnd (bool $enable_dnd)
 
- Public Member Functions inherited from ILIAS\UI\Component\Tree\TreeRecursion
 getChildren ( $record, $environment=null)
 Get a list of records (that list can also be empty). More...
 
 build (Node\Factory $factory, $record, $environment=null)
 Build and return a Node. More...
 

Static Public Member Functions

static getTopNodeForRefId (int $ref_id)
 
- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 
static getLocalJsTreeJsPath ()
 
static getLocalJsTreeCssPath ()
 
static createHTMLExportDirs (string $a_target_dir)
 
static init (ilGlobalTemplateInterface $a_main_tpl=null)
 

Protected Member Functions

 getParentCourseOrGroup (int $node_id)
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 
 matches ($node)
 Does a node match a search term (or is search term empty) More...
 
 getRootId ()
 
 createNode (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record)
 Creates at tree node, can be overwritten in derivatives if another node type should be used. More...
 
 getNodeStateToggleCmdClasses ($record)
 Should return an array of ilCtrl-enabled command classes which should be used to build the URL for the expand/collapse actions applied on a tree node. More...
 
 render ()
 
- Protected Member Functions inherited from ilExplorerBaseGUI
 isNodeSelectable ($a_node)
 Is node selectable? More...
 
 getNodeToggleOnClick ($a_node)
 Get onclick attribute for node toggling. More...
 
 getSelectOnClick ($a_node)
 Get onclick attribute for selecting radio/checkbox. More...
 
 isNodeOpen ($node_id)
 Get all open nodes. More...
 
 getJSTreePlugins ()
 
 isNodeRequested (string $a_node_id)
 

Protected Attributes

ilSetting $settings
 
ilObjectDefinition $obj_definition
 
ilAccessHandler $access
 
ilRbacSystem $rbacsystem
 
ilDBInterface $db
 
ilObjUser $user
 
array $type_grps = []
 
array $session_materials = []
 
array $parent_node_id = []
 
array $node_data = []
 
StandardGUIRequest $request
 
int $cur_ref_id = 0
 
int $top_node_id
 
- Protected Attributes inherited from ilTreeExplorerGUI
ilLanguage $lng
 
Psr Http Message ServerRequestInterface $httpRequest
 
ilTree $tree = null
 
string $tree_label = ""
 
string $order_field = ""
 
bool $order_field_numeric = false
 
array $type_white_list = array()
 
array $type_black_list = array()
 
array $childs = array()
 
bool $preloaded = false
 
bool $preload_childs = false
 
array $root_node_data = null
 
array $all_childs = array()
 
 $root_id = 0
 
ILIAS DI UIServices $ui
 
- Protected Attributes inherited from ilExplorerBaseGUI
string $node_parameter_name
 
ilLogger $log
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
bool $skip_root_node = false
 
bool $ajax = false
 
array $custom_open_nodes = array()
 
array $selected_nodes = array()
 
string $select_postvar = ""
 
bool $offline_mode = false
 
array $sec_highl_nodes = array()
 
bool $enable_dnd = false
 
string $search_term = ""
 
array $open_nodes = []
 
ilSessionIStorage $store
 
bool $select_multi = false
 
 $parent_obj
 
int $child_limit = 0
 
string $parent_cmd = ''
 
string $requested_exp_cmd = ""
 
string $requested_exp_cont = ""
 
string $requested_searchterm = ""
 
string $requested_node_id = ""
 
string $id
 

Additional Inherited Members

- Static Protected Attributes inherited from ilExplorerBaseGUI
static string $js_tree_path = "./node_modules/jstree/dist/jstree.js"
 
static string $js_tree_path_css = "./node_modules/jstree/dist/themes/default/style.min.css"
 
static string $js_expl_path = "./Services/UIComponent/Explorer2/js/Explorer2.js"
 

Detailed Description

Repository explorer GUI class.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Todo:
: isClickable, top node id

Definition at line 27 of file class.ilRepositoryExplorerGUI.php.

Member Function Documentation

◆ getChildsOfNode()

ilRepositoryExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get childs of node.

Parameters
int | string$a_parent_node_idparent id
Returns
array childs

Reimplemented from ilTreeExplorerGUI.

Definition at line 420 of file class.ilRepositoryExplorerGUI.php.

420 : array
421 {
423
424 if (!$rbacsystem->checkAccess("read", $a_parent_node_id)) {
425 return [];
426 }
427
428 $obj_id = ilObject::_lookupObjId($a_parent_node_id);
429 if (!ilConditionHandler::_checkAllConditionsOfTarget($a_parent_node_id, $obj_id)) {
430 return [];
431 }
432
433 $childs = parent::getChildsOfNode($a_parent_node_id);
434
435 foreach ($childs as $c) {
436 $this->parent_node_id[$c["child"]] = $a_parent_node_id;
437 $this->node_data[$c["child"]] = $c;
438 }
439
440 return $childs;
441 }
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 _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 ...
$c
Definition: cli.php:38

References $c, ilTreeExplorerGUI\$childs, $rbacsystem, ilConditionHandler\_checkAllConditionsOfTarget(), ilObject\_lookupObjId(), and ilRbacSystem\checkAccess().

+ Here is the call graph for this function:

◆ getNodeContent()

ilRepositoryExplorerGUI::getNodeContent (   $a_node)

Get content of a node.

Parameters
object | array$a_nodenode array or object
Returns
string content of the node

Reimplemented from ilExplorerBaseGUI.

Definition at line 107 of file class.ilRepositoryExplorerGUI.php.

107 : string
108 {
110
111 $title = $a_node["title"];
112
113 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
114 if ($title === "ILIAS") {
115 $title = $lng->txt("repository");
116 }
117 } elseif ($a_node["type"] === "sess" &&
118 !trim($title)) {
119 // #14367 - see ilObjSessionListGUI
120 $app_info = ilSessionAppointment::_lookupAppointment($a_node["obj_id"]);
121 $title = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'], (bool) $app_info['fullday']);
122 }
123 return $title;
124 }
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 _lookupAppointment(int $a_obj_id)
static _appointmentToString(int $start, int $end, bool $fulltime)
getNodeId($a_node)
Get id for node.

References ilTreeExplorerGUI\$lng, ilSessionAppointment\_appointmentToString(), ilSessionAppointment\_lookupAppointment(), ilTreeExplorerGUI\getNodeId(), getRootNode(), and ilLanguage\txt().

Referenced by getNodeIconAlt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNodeHref()

ilRepositoryExplorerGUI::getNodeHref (   $a_node)

Get href for node.

Parameters
object | array$a_node
Returns
string href attribute

Reimplemented from ilExplorerBaseGUI.

Definition at line 157 of file class.ilRepositoryExplorerGUI.php.

157 : string
158 {
159 $ilCtrl = $this->ctrl;
160
161 switch ($a_node["type"]) {
162 case "cat":
163 case "root":
164 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
165 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
166 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->cur_ref_id);
167 return $link;
168
169 case "grpr":
170 case "crsr":
171 case "prgr":
172 case "catr":
173 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
174 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "redirect");
175 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->cur_ref_id);
176 return $link;
177
178 case "grp":
179 $ilCtrl->setParameterByClass("ilobjgroupgui", "ref_id", $a_node["child"]);
180 $link = $ilCtrl->getLinkTargetByClass(["ilrepositorygui", "ilobjgroupgui"], "");
181 $ilCtrl->setParameterByClass("ilobjgroupgui", "ref_id", $this->cur_ref_id);
182 return $link;
183
184 case "crs":
185 $ilCtrl->setParameterByClass("ilobjcoursegui", "ref_id", $a_node["child"]);
186 $link = $ilCtrl->getLinkTargetByClass(["ilrepositorygui", "ilobjcoursegui"], "view");
187 $ilCtrl->setParameterByClass("ilobjcoursegui", "ref_id", $this->cur_ref_id);
188 return $link;
189
190 case 'rcrs':
191 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
192 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "infoScreen");
193 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->cur_ref_id);
194 return $link;
195
196 case 'prg':
197 $ilCtrl->setParameterByClass("ilobjstudyprogrammegui", "ref_id", $a_node["child"]);
198 $link = $ilCtrl->getLinkTargetByClass(["ilrepositorygui", "ilobjstudyprogrammegui"], "view");
199 $ilCtrl->setParameterByClass("ilobjstudyprogrammegui", "ref_id", $this->cur_ref_id);
200 return $link;
201
202 default:
203 return ilLink::_getStaticLink($a_node["child"], $a_node["type"], true);
204
205 }
206 }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc

References ilExplorerBaseGUI\$ctrl, ilLink\_getStaticLink(), and ilCtrl\setParameterByClass().

+ Here is the call graph for this function:

◆ getNodeIcon()

ilRepositoryExplorerGUI::getNodeIcon (   $a_node)

Get node icon path.

Parameters
object | array$a_node
Returns
string image file path

Reimplemented from ilExplorerBaseGUI.

Definition at line 126 of file class.ilRepositoryExplorerGUI.php.

126 : string
127 {
128 $obj_id = ilObject::_lookupObjId((int) $a_node["child"]);
129 return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]);
130 }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.

References ilObject\_getIcon(), and ilObject\_lookupObjId().

+ Here is the call graph for this function:

◆ getNodeIconAlt()

ilRepositoryExplorerGUI::getNodeIconAlt (   $a_node)

Get node icon alt attribute.

Parameters
object | array$a_nodenode
Returns
string image alt attribute

Reimplemented from ilTreeExplorerGUI.

Definition at line 132 of file class.ilRepositoryExplorerGUI.php.

132 : string
133 {
135
136 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
137 $title = $a_node["title"];
138 if ($title === "ILIAS") {
139 $title = $lng->txt("repository");
140 }
141 return $title;
142 }
143
145 return $lng->txt("obj_" . $a_node["type"]) . ": " . $this->getNodeContent($a_node);
146 }
getNodeContent($a_node)
Get content of a node.

References ilTreeExplorerGUI\$lng, getNodeContent(), ilTreeExplorerGUI\getNodeId(), getRootNode(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getParentCourseOrGroup()

ilRepositoryExplorerGUI::getParentCourseOrGroup ( int  $node_id)
protected

Definition at line 242 of file class.ilRepositoryExplorerGUI.php.

242 : int
243 {
244 $current_node_id = $node_id;
245 while (isset($this->parent_node_id[$current_node_id])) {
246 $parent_node_id = $this->parent_node_id[$current_node_id];
247 if (isset($this->node_data[$parent_node_id]) && in_array($this->node_data[$parent_node_id]["type"], ["grp", "crs"])) {
248 return $parent_node_id;
249 }
250 $current_node_id = $parent_node_id;
251 }
252 return 0;
253 }

References $parent_node_id.

Referenced by isNodeVisible().

+ Here is the caller graph for this function:

◆ getRootNode()

ilRepositoryExplorerGUI::getRootNode ( )

Get root node.

Returns
object|array node

Reimplemented from ilTreeExplorerGUI.

Definition at line 96 of file class.ilRepositoryExplorerGUI.php.

97 {
98 if ($this->top_node_id > 0) {
99 $root_node = $this->getTree()->getNodeData($this->top_node_id);
100 } else {
101 $root_node = parent::getRootNode();
102 }
103 $this->node_data[$root_node["child"]] = $root_node;
104 return $root_node;
105 }

References ilTreeExplorerGUI\getTree().

Referenced by getNodeContent(), getNodeIconAlt(), and isNodeHighlighted().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTopNodeForRefId()

static ilRepositoryExplorerGUI::getTopNodeForRefId ( int  $ref_id)
static

Definition at line 539 of file class.ilRepositoryExplorerGUI.php.

539 : int
540 {
541 global $DIC;
542
543 $setting = $DIC->settings();
544 $tree = $DIC->repositoryTree();
545
546 $top_node = 0;
547 if ($ref_id > 0 && $setting->get("rep_tree_limit_grp_crs")) {
549 foreach ($path as $n) {
550 if ($top_node > 0) {
551 break;
552 }
553 if (in_array(
555 ["crs", "grp"]
556 )) {
557 $top_node = $n;
558 }
559 }
560 }
561 return $top_node;
562 }
static _lookupType(int $id, bool $reference=false)
getPathId(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
$path
Definition: ltiservices.php:32

References $DIC, $path, $ref_id, ilTreeExplorerGUI\$tree, ilObject\_lookupObjId(), ilObject\_lookupType(), and ilTree\getPathId().

Referenced by ILIAS\Repository\Provider\RepositoryMainBarProvider\getStaticSubItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isNodeClickable()

ilRepositoryExplorerGUI::isNodeClickable (   $a_node)

Is node clickable?

Parameters
object | array$a_nodenode
Returns
bool node clickable true/false

Reimplemented from ilExplorerBaseGUI.

Definition at line 443 of file class.ilRepositoryExplorerGUI.php.

443 : bool
444 {
447
448 $obj_id = ilObject::_lookupObjId($a_node["child"]);
449 if (
450 !ilConditionHandler::_checkAllConditionsOfTarget($a_node["child"], $obj_id)
451 && !$rbacsystem->checkAccess('write', $a_node["child"])
452 ) {
453 return false;
454 }
455
456 switch ($a_node["type"]) {
457 case 'tst':
458 if (!$rbacsystem->checkAccess("read", $a_node["child"])) {
459 return false;
460 }
461
462 $query = sprintf("SELECT * FROM tst_tests WHERE obj_fi=%s", $obj_id);
463 $res = $ilDB->query($query);
464 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
465 return (bool) $row->complete;
466 }
467 return false;
468
469 case 'svy':
470 if (!$rbacsystem->checkAccess("read", $a_node["child"])) {
471 return false;
472 }
473
474 $query = sprintf("SELECT * FROM svy_svy WHERE obj_fi=%s", $obj_id);
475 $res = $ilDB->query($query);
476 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
477 return (bool) $row->complete;
478 }
479 return false;
480
481 // media pools can only be edited
482 case "mep":
483 if ($rbacsystem->checkAccess("read", $a_node["child"])) {
484 return true;
485 }
486 return false;
487 case 'grpr':
488 case 'crsr':
489 case 'catr':
490 return ilContainerReferenceAccess::_isAccessible($a_node["child"]);
491
492 case 'prg':
493 return $rbacsystem->checkAccess("read", $a_node["child"]);
494
495 case 'crs':
496 case 'grp':
497 return $rbacsystem->checkAccess("read", $a_node["child"]) ||
498 $rbacsystem->checkAccess("join", $a_node["child"]);
499
500 // all other types are only clickable, if read permission is given
501 default:
502 if ($rbacsystem->checkAccess("read", $a_node["child"])) {
503 // check if lm is online
504 if ($a_node["type"] === "lm") {
505 $lm_obj = new ilObjLearningModule($a_node["child"]);
506 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
507 return false;
508 }
509 }
510 // check if fblm is online
511 if ($a_node["type"] === "htlm") {
512 $lm_obj = new ilObjFileBasedLM($a_node["child"]);
513 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
514 return false;
515 }
516 }
517 // check if fblm is online
518 if ($a_node["type"] === "sahs") {
519 $lm_obj = new ilObjSAHSLearningModule($a_node["child"]);
520 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
521 return false;
522 }
523 }
524 // check if glossary is online
525 if ($a_node["type"] === "glo") {
526 $obj_id = ilObject::_lookupObjectId($a_node["child"]);
527 if ((!ilObjGlossary::_lookupOnline($obj_id)) &&
528 (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
529 return false;
530 }
531 }
532
533 return true;
534 }
535 return false;
536 }
537 }
static _isAccessible(int $a_ref_id)
Check if target is accessible and not deleted.
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)
$res
Definition: ltiservices.php:69
$query

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

+ Here is the call graph for this function:

◆ isNodeHighlighted()

ilRepositoryExplorerGUI::isNodeHighlighted (   $a_node)

Is node highlighted?

Parameters
object | array$a_nodenode
Returns
bool node highlighted true/false

Reimplemented from ilExplorerBaseGUI.

Definition at line 148 of file class.ilRepositoryExplorerGUI.php.

148 : bool
149 {
150 if ((int) $a_node["child"] === $this->cur_ref_id ||
151 ($this->cur_ref_id === 0 && (int) $a_node["child"] === (int) $this->getNodeId($this->getRootNode()))) {
152 return true;
153 }
154 return false;
155 }

References ilTreeExplorerGUI\getNodeId(), and getRootNode().

+ Here is the call graph for this function:

◆ isNodeVisible()

ilRepositoryExplorerGUI::isNodeVisible (   $a_node)

Is node visible?

Parameters
object | array$a_nodenode
Returns
bool node visible true/false

Reimplemented from ilExplorerBaseGUI.

Definition at line 208 of file class.ilRepositoryExplorerGUI.php.

208 : bool
209 {
210 $ilAccess = $this->access;
213
214 if (!$ilAccess->checkAccess('visible', '', $a_node["child"])) {
215 return false;
216 }
217
218 if ($ilSetting->get("repository_tree_pres") === "all_types") {
219 /*$container_parent_id = $tree->checkForParentType($a_node["child"], 'grp');
220 if (!$container_parent_id) {
221 $container_parent_id = $tree->checkForParentType($a_node["child"], 'crs');
222 }*/
223 // see #21215
224 $container_parent_id = $this->getParentCourseOrGroup($a_node["child"]);
225 if ($container_parent_id > 0) {
226 // do not display session materials for container course/group
227 if ($container_parent_id !== (int) $a_node["child"]) {
228 // get container event items only once
229 if (!isset($this->session_materials[$container_parent_id])) {
230 $this->session_materials[$container_parent_id] = ilEventItems::_getItemsOfContainer($container_parent_id);
231 }
232 if (in_array($a_node["child"], $this->session_materials[$container_parent_id])) {
233 return false;
234 }
235 }
236 }
237 }
238
239 return true;
240 }
static _getItemsOfContainer(int $a_ref_id)
global $ilSetting
Definition: privfeed.php:17

References $access, $ilSetting, $settings, ilTreeExplorerGUI\$tree, ilEventItems\_getItemsOfContainer(), and getParentCourseOrGroup().

+ Here is the call graph for this function:

◆ nodeHasVisibleChilds()

ilRepositoryExplorerGUI::nodeHasVisibleChilds (   $a_node)
Parameters
object | array$a_node
Returns
bool

Reimplemented from ilExplorerBaseGUI.

Definition at line 412 of file class.ilRepositoryExplorerGUI.php.

412 : bool
413 {
414 if (!$this->obj_definition->isContainer($a_node["type"] ?? "")) {
415 return false;
416 }
417 return parent::nodeHasVisibleChilds($a_node);
418 }

◆ sortChilds()

ilRepositoryExplorerGUI::sortChilds ( array  $a_childs,
  $a_parent_node_id 
)

Sort childs.

Parameters
array$a_childsarray of child nodes
string$a_parent_node_idparent node
Returns
array array of childs nodes

Reimplemented from ilExplorerBaseGUI.

Definition at line 256 of file class.ilRepositoryExplorerGUI.php.

256 : array
257 {
258 $objDefinition = $this->obj_definition;
259 $ilAccess = $this->access;
260
261 $parent_obj_id = ilObject::_lookupObjId((int) $a_parent_node_id);
262 if ($parent_obj_id > 0) {
263 $parent_type = ilObject::_lookupType($parent_obj_id);
264 } else {
265 $parent_type = "dummy";
266 $this->type_grps["dummy"] = ["root" => "dummy"];
267 }
268
269 // alex: if this is not initialized, things are messed up
270 // see bug 0015978
271 $this->type_grps = [];
272
273 $this->type_grps[$parent_type] =
274 $objDefinition::getGroupedRepositoryObjectTypes($parent_type);
275
276 // #14465 - item groups
277 $group = [];
278 $igroup = []; // used for item groups, see bug #0015978
279 $in_any_group = [];
280 foreach ($a_childs as $child) {
281 // item group: get childs
282 if ($child["type"] === "itgr") {
283 $g = $child["child"];
285 if ($items) {
286 // add item group ref id to item group block
287 $this->type_grps[$parent_type]["itgr"]["ref_ids"][] = $g;
288
289 // #16697 - check item group permissions
290 $may_read = $ilAccess->checkAccess('read', '', $g);
291
292 // see bug #0015978
293 if ($may_read) {
294 $items = ilContainerSorting::_getInstance($parent_obj_id)->sortSubItems('itgr', $child["obj_id"], $items);
295 }
296
297 foreach ($items as $item) {
298 $in_any_group[] = $item["child"];
299
300 if ($may_read) {
301 $igroup[$g][] = $item;
302 $group[$g][] = $item;
303 }
304 }
305 }
306 }
307 // type group
308 else {
309 $g = $objDefinition->getGroupOfObj($child["type"]);
310 if ($g == "") {
311 $g = $child["type"];
312 }
313 $group[$g][] = $child;
314 }
315 }
316
317 $in_any_group = array_unique($in_any_group);
318
319 // custom block sorting?
320 $sort = ilContainerSorting::_getInstance($parent_obj_id);
321 $block_pos = $sort->getBlockPositions();
322 if (is_array($block_pos) && count($block_pos) > 0) {
323 $tmp = $this->type_grps[$parent_type];
324
325 $this->type_grps[$parent_type] = [];
326 foreach ($block_pos as $block_type) {
327 // type group
328 if (!is_numeric($block_type) &&
329 array_key_exists($block_type, $tmp)) {
330 $this->type_grps[$parent_type][$block_type] = $tmp[$block_type];
331 unset($tmp[$block_type]);
332 }
333 // item group
334 else {
335 // using item group ref id directly
336 $this->type_grps[$parent_type][$block_type] = [];
337 }
338 }
339
340 // append missing
341 if (count($tmp)) {
342 foreach ($tmp as $block_type => $grp) {
343 $this->type_grps[$parent_type][$block_type] = $grp;
344 }
345 }
346
347 unset($tmp);
348 }
349
350 $childs = [];
351 $done = [];
352
353 foreach ($this->type_grps[$parent_type] as $t => $g) {
354 // type group
355 if (isset($group[$t]) && is_array($group[$t])) {
356 // see bug #0015978
357 // custom sorted igroups
358 if (isset($igroup[$t]) && is_array($igroup[$t])) {
359 foreach ($igroup[$t] as $k => $item) {
360 if (!in_array($item["child"], $done)) {
361 $childs[] = $item;
362 $done[] = $item["child"];
363 }
364 }
365 } else {
366 // do we have to sort this group??
367 $sort = ilContainerSorting::_getInstance($parent_obj_id);
368 $group = $sort->sortItems($group);
369
370 // need extra session sorting here
371 if ($t === "sess") {
372 foreach ($group[$t] as $k => $v) {
373 $app_info = ilSessionAppointment::_lookupAppointment($v["obj_id"]);
374 $group[$t][$k]["start"] = $app_info["start"];
375 }
376 $group[$t] = ilArrayUtil::sortArray($group[$t], 'start', 'asc', true, false);
377 }
378
379 foreach ($group[$t] as $k => $item) {
380 if (!in_array($item["child"], $done) &&
381 !in_array($item["child"], $in_any_group)) { // #16697
382 $childs[] = $item;
383 $done[] = $item["child"];
384 }
385 }
386 }
387 }
388 // item groups (if not custom block sorting)
389 elseif ($t === "itgr" &&
390 isset($g["ref_ids"]) &&
391 is_array($g["ref_ids"])) {
392 foreach ($g["ref_ids"] as $ref_id) {
393 if (isset($group[$ref_id])) {
394 foreach ($group[$ref_id] as $k => $item) {
395 if (!in_array($item["child"], $done)) {
396 $childs[] = $item;
397 $done[] = $item["child"];
398 }
399 }
400 }
401 }
402 }
403 }
404
405 return $childs;
406 }
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static _getInstance(int $a_obj_id)
static getItemsByItemGroup(int $item_group_ref_id)
Get materials of item group.

References $access, ilTreeExplorerGUI\$childs, $obj_definition, $ref_id, ilContainerSorting\_getInstance(), ilSessionAppointment\_lookupAppointment(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilObjectActivation\getItemsByItemGroup(), and ilArrayUtil\sortArray().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilRepositoryExplorerGUI::$access
protected

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

Referenced by isNodeVisible(), and sortChilds().

◆ $cur_ref_id

int ilRepositoryExplorerGUI::$cur_ref_id = 0
protected

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

◆ $db

ilDBInterface ilRepositoryExplorerGUI::$db
protected

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

Referenced by isNodeClickable().

◆ $node_data

array ilRepositoryExplorerGUI::$node_data = []
protected

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

◆ $obj_definition

ilObjectDefinition ilRepositoryExplorerGUI::$obj_definition
protected

Definition at line 30 of file class.ilRepositoryExplorerGUI.php.

Referenced by sortChilds().

◆ $parent_node_id

array ilRepositoryExplorerGUI::$parent_node_id = []
protected

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

Referenced by getParentCourseOrGroup().

◆ $rbacsystem

ilRbacSystem ilRepositoryExplorerGUI::$rbacsystem
protected

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

Referenced by getChildsOfNode(), and isNodeClickable().

◆ $request

StandardGUIRequest ilRepositoryExplorerGUI::$request
protected

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

◆ $session_materials

array ilRepositoryExplorerGUI::$session_materials = []
protected

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

◆ $settings

ilSetting ilRepositoryExplorerGUI::$settings
protected

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

Referenced by isNodeVisible().

◆ $top_node_id

int ilRepositoryExplorerGUI::$top_node_id
protected

Definition at line 41 of file class.ilRepositoryExplorerGUI.php.

◆ $type_grps

array ilRepositoryExplorerGUI::$type_grps = []
protected

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

◆ $user

ilObjUser ilRepositoryExplorerGUI::$user
protected

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


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