ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilRepositoryExplorerGUI Class Reference

Repository explorer GUI class. More...

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

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd)
 Constructor. More...
 
 getRootNode ()
 Get root node. More...
 
 getNodeContent ($a_node)
 Get node content. More...
 
 getNodeIcon ($a_node)
 Get node icon. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt text. More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
 isNodeVisible ($a_node)
 Is node visible. More...
 
 sortChilds ($a_childs, $a_parent_node_id)
 Sort childs. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
- Public Member Functions inherited from ilTreeExplorerGUI
 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd, $a_tree)
 Constructor. More...
 
 getTree ()
 Get tree. More...
 
 setOrderField ($a_val, $a_numeric=false)
 Set order field. More...
 
 getOrderField ()
 Get order field. More...
 
 setTypeWhiteList ($a_val)
 Set type white list. More...
 
 getTypeWhiteList ()
 Get type white list. More...
 
 setTypeBlackList ($a_val)
 Set type black list. More...
 
 getTypeBlackList ()
 Get type black list. More...
 
 setPreloadChilds ($a_val)
 Set preload childs. More...
 
 getPreloadChilds ()
 Get preload childs. More...
 
 getSuccessorNode ($a_node_id, $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 ()
 Get HTML. More...
 
- Public Member Functions inherited from ilExplorerBaseGUI
 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd)
 Constructor. More...
 
 setChildLimit ($a_val)
 Set child limit. More...
 
 getChildLimit ()
 Get child limit. More...
 
 setSearchTerm ($a_val)
 Set search term. More...
 
 getSearchTerm ()
 Get search term. More...
 
 setMainTemplate (ilTemplate $a_main_tpl=null)
 Set main template (that is responsible for adding js/css) More...
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs 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 childs? More...
 
 sortChilds ($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 ($a_val)
 Set skip root node. More...
 
 getSkipRootNode ()
 Get skip root node. More...
 
 setAjax ($a_val)
 Set ajax. More...
 
 getAjax ()
 Get ajax. More...
 
 setSecondaryHighlightedNodes ($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 ($a_postvar, $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 ($a_val)
 Set offline mode. More...
 
 getOfflineMode ()
 Get offline mode. More...
 
 handleCommand ()
 Handle explorer internal command. More...
 
 getContainerId ()
 Get container id. More...
 
 openNode ()
 Open node. More...
 
 closeNode ()
 Close node. More...
 
 getNodeAsync ()
 Get node asynchronously. More...
 
 beforeRendering ()
 Before rendering. More...
 
 getOnLoadCode ()
 Get on load code. More...
 
 getHTML ()
 Get HTML. More...
 
 renderNode ($a_node, $tpl)
 Render node. More...
 
 renderChilds ($a_node_id, $tpl)
 Render childs. More...
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id. More...
 
 getNodeIdForDomNodeId ($a_dom_node_id)
 Get node id for dom node id. More...
 
 listItemStart ($tpl, $a_node)
 List item start. More...
 
 listItemEnd ($tpl)
 List item end. More...
 
 listStart ($tpl)
 List start. More...
 
 listEnd ($tpl)
 List end. More...
 
 isNodeOnclickEnabled ()
 
 setNodeOnclickEnabled ($nodeOnclickEnabled)
 
 isEnableDnd ()
 
 setEnableDnd ($enable_dnd)
 Enable Drag & Drop functionality. More...
 

Protected Member Functions

 getParentCourseOrGroup ($node_id)
 Get upper course or group. More...
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 Preload childs. More...
 
 matches ($node)
 Does a node match a search term (or is search term empty) More...
 
 getRootId ()
 
- 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 ()
 

Protected Attributes

 $settings
 
 $obj_definition
 
 $lng
 
 $ctrl
 
 $access
 
 $rbacsystem
 
 $db
 
 $user
 
 $type_grps = array()
 
 $session_materials = array()
 
 $parent_node_id = []
 
 $node_data = []
 
- Protected Attributes inherited from ilTreeExplorerGUI
 $lng
 
 $tree = null
 
 $order_field = ""
 
 $order_field_numeric = false
 
 $type_white_list = array()
 
 $type_black_list = array()
 
 $childs = array()
 
 $preloaded = false
 
 $preload_childs = false
 
 $root_node_data = null
 
 $all_childs = array()
 
- Protected Attributes inherited from ilExplorerBaseGUI
 $log
 
 $ctrl
 
 $tpl
 
 $skip_root_node = false
 
 $ajax = false
 
 $custom_open_nodes = array()
 
 $selected_nodes = array()
 
 $select_postvar = ""
 
 $offline_mode = false
 
 $sec_highl_nodes = array()
 
 $enable_dnd = false
 
 $search_term = ""
 
 $child_limit = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 Get local path of explorer js. More...
 
static getLocalJsTreeJsPath ()
 Get local path of jsTree js. More...
 
static getLocalJsTreeCssPath ()
 Get local path of jsTree js. More...
 
static createHTMLExportDirs ($a_target_dir)
 Create html export directories. More...
 
static init ($a_main_tpl=null)
 Init JS. More...
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static $js_tree_path = "./libs/bower/bower_components/jstree/dist/jstree.js"
 
static $js_tree_path_css = "./libs/bower/bower_components/jstree/dist/themes/default/style.min.css"
 
static $js_expl_path = "./Services/UIComponent/Explorer2/js/Explorer2.js"
 

Detailed Description

Repository explorer GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$
Todo:
: isClickable, top node id

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

Constructor & Destructor Documentation

◆ __construct()

ilRepositoryExplorerGUI::__construct (   $a_parent_obj,
  $a_parent_cmd 
)

Constructor.

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

68 {
69 global $DIC;
70
71 $this->tree = $DIC->repositoryTree();
72 $this->settings = $DIC->settings();
73 $this->obj_definition = $DIC["objDefinition"];
74 $this->lng = $DIC->language();
75 $this->ctrl = $DIC->ctrl();
76 $this->access = $DIC->access();
77 $this->rbacsystem = $DIC->rbac()->system();
78 $this->db = $DIC->database();
79 $this->user = $DIC->user();
80 $tree = $DIC->repositoryTree();
81 $ilSetting = $DIC->settings();
82 $objDefinition = $DIC["objDefinition"];
83
84 $this->cur_ref_id = (int) $_GET["ref_id"];
85
86 $this->top_node_id = 0;
87 if ($ilSetting->get("rep_tree_limit_grp_crs") && $this->cur_ref_id > 0) {
88 $path = $tree->getPathId($this->cur_ref_id);
89 foreach ($path as $n) {
90 if ($top_node > 0) {
91 break;
92 }
93 if (in_array(
95 array("crs", "grp")
96 )) {
97 $this->top_node_id = $n;
98 }
99 }
100 }
101
102 parent::__construct("rep_exp", $a_parent_obj, $a_parent_cmd, $tree);
103
104 $this->setSkipRootNode(false);
105 $this->setAjax(true);
106 $this->setOrderField("title");
107 if ($ilSetting->get("repository_tree_pres") == "" ||
108 ($ilSetting->get("rep_tree_limit_grp_crs") && $this->top_node_id == 0)) {
109 $this->setTypeWhiteList($objDefinition->getExplorerContainerTypes());
110 } elseif ($ilSetting->get("repository_tree_pres") == "all_types") {
111 $white = array();
112 foreach ($objDefinition->getSubObjectsRecursively("root") as $rtype) {
113 if (/* $rtype["name"] != "itgr" && */ !$objDefinition->isSideBlock($rtype["name"])) {
114 $white[] = $rtype["name"];
115 }
116 }
117 $this->setTypeWhiteList($white);
118 }
119 if ((int) $_GET["ref_id"] > 0) {
120 $this->setPathOpen((int) $_GET["ref_id"]);
121 }
122
123 $this->setChildLimit((int) $ilSetting->get("rep_tree_limit_number"));
124 }
user()
Definition: user.php:4
$n
Definition: RandomTest.php:85
$path
Definition: aliased.php:25
$_GET["client_id"]
setChildLimit($a_val)
Set child limit.
setSkipRootNode($a_val)
Set skip root node.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
setTypeWhiteList($a_val)
Set type white list.
setPathOpen($a_id)
Set node path to be opened.
setOrderField($a_val, $a_numeric=false)
Set order field.
$white
Definition: example_030.php:84
global $ilSetting
Definition: privfeed.php:17
global $DIC
Definition: saml.php:7
settings()
Definition: settings.php:2

References $_GET, $DIC, $ilSetting, $n, $path, ilTreeExplorerGUI\$tree, $white, ilObject\_lookupObjId(), ilObject\_lookupType(), ilExplorerBaseGUI\setAjax(), ilExplorerBaseGUI\setChildLimit(), ilTreeExplorerGUI\setOrderField(), ilTreeExplorerGUI\setPathOpen(), ilExplorerBaseGUI\setSkipRootNode(), settings(), ilTreeExplorerGUI\setTypeWhiteList(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ getChildsOfNode()

ilRepositoryExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get childs of node.

Parameters

return

Reimplemented from ilTreeExplorerGUI.

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

520 {
522
523 if (!$rbacsystem->checkAccess("read", $a_parent_node_id)) {
524 return array();
525 }
526
527 $obj_id = ilObject::_lookupObjId($a_parent_node_id);
528 if (!ilConditionHandler::_checkAllConditionsOfTarget($a_parent_node_id, $obj_id)) {
529 return array();
530 }
531
532 $childs = parent::getChildsOfNode($a_parent_node_id);
533
534 foreach ($childs as $c) {
535 $this->parent_node_id[$c["child"]] = $a_parent_node_id;
536 $this->node_data[$c["child"]] = $c;
537 }
538
539 return $childs;
540 }
static _checkAllConditionsOfTarget($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0)
checks wether all conditions of a target object are fulfilled

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

+ Here is the call graph for this function:

◆ getNodeContent()

ilRepositoryExplorerGUI::getNodeContent (   $a_node)

Get node content.

Parameters
array
Returns

Reimplemented from ilExplorerBaseGUI.

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

150 {
152
153 $title = $a_node["title"];
154
155 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
156 if ($title == "ILIAS") {
157 $title = $lng->txt("repository");
158 }
159 } elseif ($a_node["type"] == "sess" &&
160 !trim($title)) {
161 // #14367 - see ilObjSessionListGUI
162 include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
163 $app_info = ilSessionAppointment::_lookupAppointment($a_node["obj_id"]);
164 $title = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'], $app_info['fullday']);
165 }
166
167 return $title;
168 }
static _lookupAppointment($a_obj_id)
lookup appointment
static _appointmentToString($start, $end, $fulltime)
getNodeId($a_node)
Get id for node.

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

+ Here is the call graph for this function:

◆ getNodeHref()

ilRepositoryExplorerGUI::getNodeHref (   $a_node)

Get href for node.

Parameters
mixed$a_nodenode object/array
Returns
string href attribute

Reimplemented from ilExplorerBaseGUI.

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

226 {
228
229 switch ($a_node["type"]) {
230 case "root":
231 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
232 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
233 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
234 return $link;
235
236 case "cat":
237 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
238 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
239 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
240 return $link;
241
242 case "catr":
243 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
244 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "redirect");
245 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
246 return $link;
247
248 case "grp":
249 $ilCtrl->setParameterByClass("ilobjgroupgui", "ref_id", $a_node["child"]);
250 $link = $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjgroupgui"), "");
251 $ilCtrl->setParameterByClass("ilobjgroupgui", "ref_id", $_GET["ref_id"]);
252 return $link;
253
254 case "grpr":
255 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
256 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "redirect");
257 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
258 return $link;
259
260 case "crs":
261 $ilCtrl->setParameterByClass("ilobjcoursegui", "ref_id", $a_node["child"]);
262 $link = $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjcoursegui"), "view");
263 $ilCtrl->setParameterByClass("ilobjcoursegui", "ref_id", $_GET["ref_id"]);
264 return $link;
265
266 case "crsr":
267 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
268 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "redirect");
269 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
270 return $link;
271
272 case 'rcrs':
273 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
274 $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "infoScreen");
275 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
276 return $link;
277
278 case 'prg':
279 $ilCtrl->setParameterByClass("ilobjstudyprogrammegui", "ref_id", $a_node["child"]);
280 $link = $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjstudyprogrammegui"), "view");
281 $ilCtrl->setParameterByClass("ilobjstudyprogrammegui", "ref_id", $_GET["ref_id"]);
282 return $link;
283
284 default:
285 include_once('./Services/Link/classes/class.ilLink.php');
286 return ilLink::_getStaticLink($a_node["child"], $a_node["type"], true);
287
288 }
289 }
global $ilCtrl
Definition: ilias.php:18

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

+ Here is the call graph for this function:

◆ getNodeIcon()

ilRepositoryExplorerGUI::getNodeIcon (   $a_node)

Get node icon.

Parameters
array
Returns

Reimplemented from ilExplorerBaseGUI.

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

177 {
178 $obj_id = ilObject::_lookupObjId($a_node["child"]);
179 return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]);
180 }

References ilObject\_lookupObjId().

+ Here is the call graph for this function:

◆ getNodeIconAlt()

ilRepositoryExplorerGUI::getNodeIconAlt (   $a_node)

Get node icon alt text.

Parameters
arraynode array
Returns
string alt text

Reimplemented from ilTreeExplorerGUI.

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

189 {
191
192 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
193 $title = $a_node["title"];
194 if ($title == "ILIAS") {
195 $title = $lng->txt("repository");
196 }
197 return $lng->txt("icon") . " " . $title;
198 }
199
200
201 return parent::getNodeIconAlt($a_node);
202 }

References $lng, $title, ilTreeExplorerGUI\getNodeId(), and getRootNode().

+ Here is the call graph for this function:

◆ getParentCourseOrGroup()

ilRepositoryExplorerGUI::getParentCourseOrGroup (   $node_id)
protected

Get upper course or group.

Parameters
int$node_id
Returns
int

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

339 {
340 $current_node_id = $node_id;
341 while (isset($this->parent_node_id[$current_node_id])) {
342 $parent_node_id = $this->parent_node_id[$current_node_id];
343 if (isset($this->node_data[$parent_node_id]) && in_array($this->node_data[$parent_node_id]["type"], ["grp", "crs"])) {
344 return $parent_node_id;
345 }
346 $current_node_id = $parent_node_id;
347 }
348 return 0;
349 }

References $parent_node_id.

Referenced by isNodeVisible().

+ Here is the caller graph for this function:

◆ getRootNode()

ilRepositoryExplorerGUI::getRootNode ( )

Get root node.

Parameters

return

Reimplemented from ilTreeExplorerGUI.

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

133 {
134 if ($this->top_node_id > 0) {
135 $root_node = $this->getTree()->getNodeData($this->top_node_id);
136 } else {
137 $root_node = parent::getRootNode();
138 }
139 $this->node_data[$root_node["child"]] = $root_node;
140 return $root_node;
141 }

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:

◆ isNodeClickable()

ilRepositoryExplorerGUI::isNodeClickable (   $a_node)

Is node clickable?

Parameters
mixed$a_nodenode object/array
Returns
boolean node clickable true/false

Reimplemented from ilExplorerBaseGUI.

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

549 {
554 $ilAccess = $this->access;
555
556 $obj_id = ilObject::_lookupObjId($a_node["child"]);
557 if (!ilConditionHandler::_checkAllConditionsOfTarget($a_node["child"], $obj_id)) {
558 return false;
559 }
560
561 switch ($a_node["type"]) {
562 case 'tst':
563 if (!$rbacsystem->checkAccess("read", $a_node["child"])) {
564 return false;
565 }
566
567 $query = sprintf("SELECT * FROM tst_tests WHERE obj_fi=%s", $obj_id);
568 $res = $ilDB->query($query);
569 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
570 return (bool) $row->complete;
571 }
572 return false;
573
574 case 'svy':
575 if (!$rbacsystem->checkAccess("read", $a_node["child"])) {
576 return false;
577 }
578
579 $query = sprintf("SELECT * FROM svy_svy WHERE obj_fi=%s", $obj_id);
580 $res = $ilDB->query($query);
581 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
582 return (bool) $row->complete;
583 }
584 return false;
585
586 // media pools can only be edited
587 case "mep":
588 if ($rbacsystem->checkAccess("read", $a_node["child"])) {
589 return true;
590 } else {
591 return false;
592 }
593 break;
594 case 'grpr':
595 case 'crsr':
596 case 'catr':
597 include_once('./Services/ContainerReference/classes/class.ilContainerReferenceAccess.php');
598 return ilContainerReferenceAccess::_isAccessible($a_node["child"]);
599
600 case 'prg':
601 return $rbacsystem->checkAccess("read", $a_node["child"]);
602
603 // all other types are only clickable, if read permission is given
604 default:
605 if ($rbacsystem->checkAccess("read", $a_node["child"])) {
606 // check if lm is online
607 if ($a_node["type"] == "lm") {
608 include_once("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
609 $lm_obj = new ilObjLearningModule($a_node["child"]);
610 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
611 return false;
612 }
613 }
614 // check if fblm is online
615 if ($a_node["type"] == "htlm") {
616 include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
617 $lm_obj = new ilObjFileBasedLM($a_node["child"]);
618 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
619 return false;
620 }
621 }
622 // check if fblm is online
623 if ($a_node["type"] == "sahs") {
624 include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
625 $lm_obj = new ilObjSAHSLearningModule($a_node["child"]);
626 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
627 return false;
628 }
629 }
630 // check if glossary is online
631 if ($a_node["type"] == "glo") {
632 $obj_id = ilObject::_lookupObjectId($a_node["child"]);
633 include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
634 if ((!ilObjGlossary::_lookupOnline($obj_id)) &&
635 (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
636 return false;
637 }
638 }
639
640 return true;
641 } else {
642 return false;
643 }
644 break;
645 }
646 }
static _isAccessible($a_ref_id)
Check if target is accessible and not deleted.
File Based Learning Module (HTML) object.
static _lookupOnline($a_id)
check wether content object is online
Class ilObjLearningModule.
Class ilObjSCORMLearningModule.
static _lookupObjectId($a_ref_id)
lookup object id
$row
$query
foreach($_POST as $key=> $value) $res
global $ilDB
$ilUser
Definition: imgupload.php:18

References $access, $db, $ilDB, $ilUser, $query, $rbacsystem, $res, $row, ilTreeExplorerGUI\$tree, $user, ilConditionHandler\_checkAllConditionsOfTarget(), ilContainerReferenceAccess\_isAccessible(), ilObject\_lookupObjectId(), ilObject\_lookupObjId(), ilObjGlossary\_lookupOnline(), and ilDBConstants\FETCHMODE_OBJECT.

+ Here is the call graph for this function:

◆ isNodeHighlighted()

ilRepositoryExplorerGUI::isNodeHighlighted (   $a_node)

Is node highlighted?

Parameters
mixed$a_nodenode object/array
Returns
boolean node visible true/false

Reimplemented from ilExplorerBaseGUI.

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

211 {
212 if ($a_node["child"] == $_GET["ref_id"] ||
213 ($_GET["ref_id"] == "" && $a_node["child"] == $this->getNodeId($this->getRootNode()))) {
214 return true;
215 }
216 return false;
217 }

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

+ Here is the call graph for this function:

◆ isNodeVisible()

ilRepositoryExplorerGUI::isNodeVisible (   $a_node)

Is node visible.

Parameters

return

Reimplemented from ilExplorerBaseGUI.

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

298 {
299 $ilAccess = $this->access;
302
303 if (!$ilAccess->checkAccess('visible', '', $a_node["child"])) {
304 return false;
305 }
306
307 if ($ilSetting->get("repository_tree_pres") == "all_types") {
308 /*$container_parent_id = $tree->checkForParentType($a_node["child"], 'grp');
309 if (!$container_parent_id) {
310 $container_parent_id = $tree->checkForParentType($a_node["child"], 'crs');
311 }*/
312 // see #21215
313 $container_parent_id = $this->getParentCourseOrGroup($a_node["child"]);
314 if ($container_parent_id > 0) {
315 // do not display session materials for container course/group
316 if ($container_parent_id != $a_node["child"]) {
317 // get container event items only once
318 if (!isset($this->session_materials[$container_parent_id])) {
319 include_once './Modules/Session/classes/class.ilEventItems.php';
320 $this->session_materials[$container_parent_id] = ilEventItems::_getItemsOfContainer($container_parent_id);
321 }
322 if (in_array($a_node["child"], $this->session_materials[$container_parent_id])) {
323 return false;
324 }
325 }
326 }
327 }
328
329 return true;
330 }
static _getItemsOfContainer($a_ref_id)
getParentCourseOrGroup($node_id)
Get upper course or group.

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

+ Here is the call graph for this function:

◆ sortChilds()

ilRepositoryExplorerGUI::sortChilds (   $a_childs,
  $a_parent_node_id 
)

Sort childs.

Parameters
array$a_childsarray of child nodes
mixed$a_parent_nodeparent node
Returns
array array of childs nodes

Reimplemented from ilExplorerBaseGUI.

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

361 {
362 $objDefinition = $this->obj_definition;
363 $ilAccess = $this->access;
364
365 $parent_obj_id = ilObject::_lookupObjId($a_parent_node_id);
366 if ($parent_obj_id > 0) {
367 $parent_type = ilObject::_lookupType($parent_obj_id);
368 } else {
369 $parent_type = "dummy";
370 $this->type_grps["dummy"] = array("root" => "dummy");
371 }
372
373 // alex: if this is not initialized, things are messed up
374 // see bug 0015978
375 $this->type_grps = array();
376
377 if (empty($this->type_grps[$parent_type])) {
378 $this->type_grps[$parent_type] =
379 $objDefinition->getGroupedRepositoryObjectTypes($parent_type);
380 }
381
382 // #14465 - item groups
383 include_once('./Services/Object/classes/class.ilObjectActivation.php');
384 $group = array();
385 $igroup = array(); // used for item groups, see bug #0015978
386 $in_any_group = array();
387 foreach ($a_childs as $child) {
388 // item group: get childs
389 if ($child["type"] == "itgr") {
390 $g = $child["child"];
392 if ($items) {
393 // add item group ref id to item group block
394 $this->type_grps[$parent_type]["itgr"]["ref_ids"][] = $g;
395
396 // #16697 - check item group permissions
397 $may_read = $ilAccess->checkAccess('read', '', $g);
398
399 // see bug #0015978
400 if ($may_read) {
401 include_once("./Services/Container/classes/class.ilContainerSorting.php");
402 $items = ilContainerSorting::_getInstance($parent_obj_id)->sortSubItems('itgr', $child["obj_id"], $items);
403 }
404
405 foreach ($items as $item) {
406 $in_any_group[] = $item["child"];
407
408 if ($may_read) {
409 $igroup[$g][] = $item;
410 $group[$g][] = $item;
411 }
412 }
413 }
414 }
415 // type group
416 else {
417 $g = $objDefinition->getGroupOfObj($child["type"]);
418 if ($g == "") {
419 $g = $child["type"];
420 }
421 $group[$g][] = $child;
422 }
423 }
424
425 $in_any_group = array_unique($in_any_group);
426
427 // custom block sorting?
428 include_once("./Services/Container/classes/class.ilContainerSorting.php");
429 $sort = ilContainerSorting::_getInstance($parent_obj_id);
430 $block_pos = $sort->getBlockPositions();
431 if (is_array($block_pos) && count($block_pos) > 0) {
432 $tmp = $this->type_grps[$parent_type];
433
434 $this->type_grps[$parent_type] = array();
435 foreach ($block_pos as $block_type) {
436 // type group
437 if (!is_numeric($block_type) &&
438 array_key_exists($block_type, $tmp)) {
439 $this->type_grps[$parent_type][$block_type] = $tmp[$block_type];
440 unset($tmp[$block_type]);
441 }
442 // item group
443 else {
444 // using item group ref id directly
445 $this->type_grps[$parent_type][$block_type] = array();
446 }
447 }
448
449 // append missing
450 if (sizeof($tmp)) {
451 foreach ($tmp as $block_type => $grp) {
452 $this->type_grps[$parent_type][$block_type] = $grp;
453 }
454 }
455
456 unset($tmp);
457 }
458
459 $childs = array();
460 $done = array();
461
462 foreach ($this->type_grps[$parent_type] as $t => $g) {
463 // type group
464 if (is_array($group[$t])) {
465 // see bug #0015978
466 // custom sorted igroups
467 if (is_array($igroup[$t])) {
468 foreach ($igroup[$t] as $k => $item) {
469 if (!in_array($item["child"], $done)) {
470 $childs[] = $item;
471 $done[] = $item["child"];
472 }
473 }
474 } else {
475 // do we have to sort this group??
476 include_once("./Services/Container/classes/class.ilContainer.php");
477 include_once("./Services/Container/classes/class.ilContainerSorting.php");
478 $sort = ilContainerSorting::_getInstance($parent_obj_id);
479 $group = $sort->sortItems($group);
480
481 // need extra session sorting here
482 if ($t == "sess") {
483 }
484
485 foreach ($group[$t] as $k => $item) {
486 if (!in_array($item["child"], $done) &&
487 !in_array($item["child"], $in_any_group)) { // #16697
488 $childs[] = $item;
489 $done[] = $item["child"];
490 }
491 }
492 }
493 }
494 // item groups (if not custom block sorting)
495 elseif ($t == "itgr" &&
496 is_array($g["ref_ids"])) {
497 foreach ($g["ref_ids"] as $ref_id) {
498 if (isset($group[$ref_id])) {
499 foreach ($group[$ref_id] as $k => $item) {
500 if (!in_array($item["child"], $done)) {
501 $childs[] = $item;
502 $done[] = $item["child"];
503 }
504 }
505 }
506 }
507 }
508 }
509
510 return $childs;
511 }
static _getInstance($a_obj_id)
get instance by obj_id
static getItemsByItemGroup($a_item_group_ref_id)
Get materials of item group.

References $access, ilTreeExplorerGUI\$childs, $obj_definition, $t, ilContainerSorting\_getInstance(), ilObject\_lookupObjId(), ilObject\_lookupType(), and ilObjectActivation\getItemsByItemGroup().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilRepositoryExplorerGUI::$access
protected

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

Referenced by isNodeClickable(), isNodeVisible(), and sortChilds().

◆ $ctrl

ilRepositoryExplorerGUI::$ctrl
protected

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

Referenced by getNodeHref().

◆ $db

ilRepositoryExplorerGUI::$db
protected

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

Referenced by isNodeClickable().

◆ $lng

ilRepositoryExplorerGUI::$lng
protected

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

Referenced by getNodeContent(), and getNodeIconAlt().

◆ $node_data

ilRepositoryExplorerGUI::$node_data = []
protected

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

◆ $obj_definition

ilRepositoryExplorerGUI::$obj_definition
protected

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

Referenced by sortChilds().

◆ $parent_node_id

ilRepositoryExplorerGUI::$parent_node_id = []
protected

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

Referenced by getParentCourseOrGroup().

◆ $rbacsystem

ilRepositoryExplorerGUI::$rbacsystem
protected

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

Referenced by getChildsOfNode(), and isNodeClickable().

◆ $session_materials

ilRepositoryExplorerGUI::$session_materials = array()
protected

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

◆ $settings

ilRepositoryExplorerGUI::$settings
protected

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

Referenced by isNodeVisible().

◆ $type_grps

ilRepositoryExplorerGUI::$type_grps = array()
protected

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

◆ $user

ilRepositoryExplorerGUI::$user
protected

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

Referenced by isNodeClickable().


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