ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 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 Attributes

 $settings
 
 $obj_definition
 
 $lng
 
 $ctrl
 
 $access
 
 $rbacsystem
 
 $db
 
 $user
 
 $type_grps = array()
 
 $session_materials = array()
 
- 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
 

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 createHTMLExportDirs ($a_target_dir)
 Create html export directories. More...
 
static init ($a_main_tpl=null)
 Init JS. More...
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 Preload childs. 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...
 
 getJSTreePlugins ()
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static $js_tree_path = "./libs/bower/bower_components/jstree/jquery.jstree.js"
 
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 64 of file class.ilRepositoryExplorerGUI.php.

65 {
66 global $DIC;
67
68 $this->tree = $DIC->repositoryTree();
69 $this->settings = $DIC->settings();
70 $this->obj_definition = $DIC["objDefinition"];
71 $this->lng = $DIC->language();
72 $this->ctrl = $DIC->ctrl();
73 $this->access = $DIC->access();
74 $this->rbacsystem = $DIC->rbac()->system();
75 $this->db = $DIC->database();
76 $this->user = $DIC->user();
77 $tree = $DIC->repositoryTree();
78 $ilSetting = $DIC->settings();
79 $objDefinition = $DIC["objDefinition"];
80
81 $this->cur_ref_id = (int) $_GET["ref_id"];
82
83 $this->top_node_id = 0;
84 if ($ilSetting->get("rep_tree_limit_grp_crs") && $this->cur_ref_id > 0) {
85 $path = $tree->getPathId($this->cur_ref_id);
86 foreach ($path as $n) {
87 if ($top_node > 0) {
88 break;
89 }
90 if (in_array(
92 array("crs", "grp")
93 )) {
94 $this->top_node_id = $n;
95 }
96 }
97 }
98
99 parent::__construct("rep_exp", $a_parent_obj, $a_parent_cmd, $tree);
100
101 $this->setSkipRootNode(false);
102 $this->setAjax(true);
103 $this->setOrderField("title");
104 if ($ilSetting->get("repository_tree_pres") == "" ||
105 ($ilSetting->get("rep_tree_limit_grp_crs") && $this->top_node_id == 0)) {
106 $this->setTypeWhiteList($objDefinition->getExplorerContainerTypes());
107 } elseif ($ilSetting->get("repository_tree_pres") == "all_types") {
108 $white = array();
109 foreach ($objDefinition->getSubObjectsRecursively("root") as $rtype) {
110 if (/* $rtype["name"] != "itgr" && */ !$objDefinition->isSideBlock($rtype["name"])) {
111 $white[] = $rtype["name"];
112 }
113 }
114 $this->setTypeWhiteList($white);
115 }
116 if ((int) $_GET["ref_id"] > 0) {
117 $this->setPathOpen((int) $_GET["ref_id"]);
118 }
119 }
user()
Definition: user.php:4
$n
Definition: RandomTest.php:85
$_GET["client_id"]
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(), 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 490 of file class.ilRepositoryExplorerGUI.php.

491 {
493
494 if (!$rbacsystem->checkAccess("read", $a_parent_node_id)) {
495 return array();
496 }
497
498 $obj_id = ilObject::_lookupObjId($a_parent_node_id);
499 if (!ilConditionHandler::_checkAllConditionsOfTarget($a_parent_node_id, $obj_id)) {
500 return array();
501 }
502
503 return parent::getChildsOfNode($a_parent_node_id);
504 }
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 $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 142 of file class.ilRepositoryExplorerGUI.php.

143 {
145
146 $title = $a_node["title"];
147
148 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
149 if ($title == "ILIAS") {
150 $title = $lng->txt("repository");
151 }
152 } elseif ($a_node["type"] == "sess" &&
153 !trim($title)) {
154 // #14367 - see ilObjSessionListGUI
155 include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
156 $app_info = ilSessionAppointment::_lookupAppointment($a_node["obj_id"]);
157 $title = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'], $app_info['fullday']);
158 }
159
160 return $title;
161 }
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 218 of file class.ilRepositoryExplorerGUI.php.

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

170 {
171 $obj_id = ilObject::_lookupObjId($a_node["child"]);
172 return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]);
173 }
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_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 text.

Parameters
arraynode array
Returns
string alt text

Reimplemented from ilTreeExplorerGUI.

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

182 {
184
185 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
186 $title = $a_node["title"];
187 if ($title == "ILIAS") {
188 $title = $lng->txt("repository");
189 }
190 return $lng->txt("icon") . " " . $title;
191 }
192
193
194 return parent::getNodeIconAlt($a_node);
195 }

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

+ Here is the call graph for this function:

◆ getRootNode()

ilRepositoryExplorerGUI::getRootNode ( )

Get root node.

Parameters

return

Reimplemented from ilTreeExplorerGUI.

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

128 {
129 if ($this->top_node_id > 0) {
130 return $this->getTree()->getNodeData($this->top_node_id);
131 } else {
132 return parent::getRootNode();
133 }
134 }

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 512 of file class.ilRepositoryExplorerGUI.php.

513 {
518 $ilAccess = $this->access;
519
520 $obj_id = ilObject::_lookupObjId($a_node["child"]);
521 if (!ilConditionHandler::_checkAllConditionsOfTarget($a_node["child"], $obj_id)) {
522 return false;
523 }
524
525 switch ($a_node["type"]) {
526 case 'tst':
527 if (!$rbacsystem->checkAccess("read", $a_node["child"])) {
528 return false;
529 }
530
531 $query = sprintf("SELECT * FROM tst_tests WHERE obj_fi=%s", $obj_id);
532 $res = $ilDB->query($query);
533 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
534 return (bool) $row->complete;
535 }
536 return false;
537
538 case 'svy':
539 if (!$rbacsystem->checkAccess("read", $a_node["child"])) {
540 return false;
541 }
542
543 $query = sprintf("SELECT * FROM svy_svy WHERE obj_fi=%s", $obj_id);
544 $res = $ilDB->query($query);
545 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
546 return (bool) $row->complete;
547 }
548 return false;
549
550 // media pools can only be edited
551 case "mep":
552 if ($rbacsystem->checkAccess("read", $a_node["child"])) {
553 return true;
554 } else {
555 return false;
556 }
557 break;
558 case 'grpr':
559 case 'crsr':
560 case 'catr':
561 include_once('./Services/ContainerReference/classes/class.ilContainerReferenceAccess.php');
562 return ilContainerReferenceAccess::_isAccessible($a_node["child"]);
563
564 case 'prg':
565 return $rbacsystem->checkAccess("read", $a_node["child"]);
566
567 // all other types are only clickable, if read permission is given
568 default:
569 if ($rbacsystem->checkAccess("read", $a_node["child"])) {
570 // check if lm is online
571 if ($a_node["type"] == "lm") {
572 include_once("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
573 $lm_obj = new ilObjLearningModule($a_node["child"]);
574 if ((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
575 return false;
576 }
577 }
578 // check if fblm is online
579 if ($a_node["type"] == "htlm") {
580 include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
581 $lm_obj = new ilObjFileBasedLM($a_node["child"]);
582 if ((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
583 return false;
584 }
585 }
586 // check if fblm is online
587 if ($a_node["type"] == "sahs") {
588 include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
589 $lm_obj = new ilObjSAHSLearningModule($a_node["child"]);
590 if ((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
591 return false;
592 }
593 }
594 // check if glossary is online
595 if ($a_node["type"] == "glo") {
596 $obj_id = ilObject::_lookupObjectId($a_node["child"]);
597 include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
598 if ((!ilObjGlossary::_lookupOnline($obj_id)) &&
599 (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
600 return false;
601 }
602 }
603
604 return true;
605 } else {
606 return false;
607 }
608 break;
609 }
610 }
sprintf('%.4f', $callTime)
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
$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(), ilDBConstants\FETCHMODE_OBJECT, and sprintf.

+ 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 203 of file class.ilRepositoryExplorerGUI.php.

204 {
205 if ($a_node["child"] == $_GET["ref_id"] ||
206 ($_GET["ref_id"] == "" && $a_node["child"] == $this->getNodeId($this->getRootNode()))) {
207 return true;
208 }
209 return false;
210 }

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 290 of file class.ilRepositoryExplorerGUI.php.

291 {
292 $ilAccess = $this->access;
295
296 if (!$ilAccess->checkAccess('visible', '', $a_node["child"])) {
297 return false;
298 }
299
300 $is_course = false;
301 $container_parent_id = $tree->checkForParentType($a_node["child"], 'grp');
302 if (!$container_parent_id) {
303 $is_course = true;
304 $container_parent_id = $tree->checkForParentType($a_node["child"], 'crs');
305 }
306 if ($container_parent_id) {
307 // do not display session materials for container course/group
308 if ($ilSetting->get("repository_tree_pres") == "all_types" && $container_parent_id != $a_node["child"]) {
309 // get container event items only once
310 if (!isset($this->session_materials[$container_parent_id])) {
311 include_once './Modules/Session/classes/class.ilEventItems.php';
312 $this->session_materials[$container_parent_id] = ilEventItems::_getItemsOfContainer($container_parent_id);
313 }
314 if (in_array($a_node["child"], $this->session_materials[$container_parent_id])) {
315 return false;
316 }
317 }
318 }
319
320 return true;
321 }
static _getItemsOfContainer($a_ref_id)

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

+ 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 331 of file class.ilRepositoryExplorerGUI.php.

332 {
333 $objDefinition = $this->obj_definition;
334 $ilAccess = $this->access;
335
336 $parent_obj_id = ilObject::_lookupObjId($a_parent_node_id);
337 if ($parent_obj_id > 0) {
338 $parent_type = ilObject::_lookupType($parent_obj_id);
339 } else {
340 $parent_type = "dummy";
341 $this->type_grps["dummy"] = array("root" => "dummy");
342 }
343
344 // alex: if this is not initialized, things are messed up
345 // see bug 0015978
346 $this->type_grps = array();
347
348 if (empty($this->type_grps[$parent_type])) {
349 $this->type_grps[$parent_type] =
350 $objDefinition->getGroupedRepositoryObjectTypes($parent_type);
351 }
352
353 // #14465 - item groups
354 include_once('./Services/Object/classes/class.ilObjectActivation.php');
355 $group = array();
356 $igroup = array(); // used for item groups, see bug #0015978
357 $in_any_group = array();
358 foreach ($a_childs as $child) {
359 // item group: get childs
360 if ($child["type"] == "itgr") {
361 $g = $child["child"];
363 if ($items) {
364 // add item group ref id to item group block
365 $this->type_grps[$parent_type]["itgr"]["ref_ids"][] = $g;
366
367 // #16697 - check item group permissions
368 $may_read = $ilAccess->checkAccess('read', '', $g);
369
370 // see bug #0015978
371 if ($may_read) {
372 include_once("./Services/Container/classes/class.ilContainerSorting.php");
373 $items = ilContainerSorting::_getInstance($parent_obj_id)->sortSubItems('itgr', $child["obj_id"], $items);
374 }
375
376 foreach ($items as $item) {
377 $in_any_group[] = $item["child"];
378
379 if ($may_read) {
380 $igroup[$g][] = $item;
381 $group[$g][] = $item;
382 }
383 }
384 }
385 }
386 // type group
387 else {
388 $g = $objDefinition->getGroupOfObj($child["type"]);
389 if ($g == "") {
390 $g = $child["type"];
391 }
392 $group[$g][] = $child;
393 }
394 }
395
396 $in_any_group = array_unique($in_any_group);
397
398 // custom block sorting?
399 include_once("./Services/Container/classes/class.ilContainerSorting.php");
400 $sort = ilContainerSorting::_getInstance($parent_obj_id);
401 $block_pos = $sort->getBlockPositions();
402 if (is_array($block_pos) && count($block_pos) > 0) {
403 $tmp = $this->type_grps[$parent_type];
404
405 $this->type_grps[$parent_type] = array();
406 foreach ($block_pos as $block_type) {
407 // type group
408 if (!is_numeric($block_type) &&
409 array_key_exists($block_type, $tmp)) {
410 $this->type_grps[$parent_type][$block_type] = $tmp[$block_type];
411 unset($tmp[$block_type]);
412 }
413 // item group
414 else {
415 // using item group ref id directly
416 $this->type_grps[$parent_type][$block_type] = array();
417 }
418 }
419
420 // append missing
421 if (sizeof($tmp)) {
422 foreach ($tmp as $block_type => $grp) {
423 $this->type_grps[$parent_type][$block_type] = $grp;
424 }
425 }
426
427 unset($tmp);
428 }
429
430 $childs = array();
431 $done = array();
432
433 foreach ($this->type_grps[$parent_type] as $t => $g) {
434 // type group
435 if (is_array($group[$t])) {
436 // see bug #0015978
437 // custom sorted igroups
438 if (is_array($igroup[$t])) {
439 foreach ($igroup[$t] as $k => $item) {
440 if (!in_array($item["child"], $done)) {
441 $childs[] = $item;
442 $done[] = $item["child"];
443 }
444 }
445 } else {
446 // do we have to sort this group??
447 include_once("./Services/Container/classes/class.ilContainer.php");
448 include_once("./Services/Container/classes/class.ilContainerSorting.php");
449 $sort = ilContainerSorting::_getInstance($parent_obj_id);
450 $group = $sort->sortItems($group);
451
452 // need extra session sorting here
453 if ($t == "sess") {
454 }
455
456 foreach ($group[$t] as $k => $item) {
457 if (!in_array($item["child"], $done) &&
458 !in_array($item["child"], $in_any_group)) { // #16697
459 $childs[] = $item;
460 $done[] = $item["child"];
461 }
462 }
463 }
464 }
465 // item groups (if not custom block sorting)
466 elseif ($t == "itgr" &&
467 is_array($g["ref_ids"])) {
468 foreach ($g["ref_ids"] as $ref_id) {
469 if (isset($group[$ref_id])) {
470 foreach ($group[$ref_id] as $k => $item) {
471 if (!in_array($item["child"], $done)) {
472 $childs[] = $item;
473 $done[] = $item["child"];
474 }
475 }
476 }
477 }
478 }
479 }
480
481 return $childs;
482 }
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().

◆ $obj_definition

ilRepositoryExplorerGUI::$obj_definition
protected

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

Referenced by sortChilds().

◆ $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: