ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ($new=false)
 Get HTML. More...
 
 getChildren ($node, $environment=null)
 Get a list of records (that list can also be empty).Each record will be relayed to $this->build to retrieve a Node. Also, each record will be asked for Sub-Nodes using this function.
Returns
array
More...
 
 build (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record, $environment=null)
 
 getTreeLabel ()
 
 getTreeComponent ()
 Get Tree UI. More...
 
 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
 __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 ($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...
 
- 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 ()
 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...
 

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 ()
 
 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 ()
 Render tree. More...
 
- 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
 
 $httpRequest
 
 $tree = null
 
 $tree_label = ""
 
 $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()
 
 $ui
 
- 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 = ""
 
 $open_nodes = []
 
 $store
 
 $parent_obj
 
 $child_limit = 0
 
 $parent_cmd = ''
 

Additional Inherited Members

- 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 $this->top_node_id = self::getTopNodeForRefId($this->cur_ref_id);
86
87 parent::__construct("rep_exp", $a_parent_obj, $a_parent_cmd, $tree);
88
89 $this->setSkipRootNode(false);
90 $this->setNodeOpen($this->tree->readRootId());
91 $this->setAjax(true);
92 $this->setOrderField("title");
93 if ($ilSetting->get("repository_tree_pres") == "" ||
94 ($ilSetting->get("rep_tree_limit_grp_crs") && $this->top_node_id == 0)) {
95 $this->setTypeWhiteList($objDefinition->getExplorerContainerTypes());
96 } elseif ($ilSetting->get("repository_tree_pres") == "all_types") {
97 $white = array();
98 foreach ($objDefinition->getSubObjectsRecursively("root") as $rtype) {
99 if (/* $rtype["name"] != "itgr" && */ !$objDefinition->isSideBlock($rtype["name"])) {
100 $white[] = $rtype["name"];
101 }
102 }
103 $this->setTypeWhiteList($white);
104 }
105 if ((int) $_GET["ref_id"] > 0) {
106 $this->setPathOpen((int) $_GET["ref_id"]);
107 }
108
109 $this->setChildLimit((int) $ilSetting->get("rep_tree_limit_number"));
110 }
user()
Definition: user.php:4
$_GET["client_id"]
setChildLimit($a_val)
Set child limit.
setSkipRootNode($a_val)
Set skip root node.
setNodeOpen($a_id)
Set node to be opened (additional custom opened node, not standard expand behaviour)
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.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilSetting
Definition: privfeed.php:17
settings()
Definition: settings.php:2
$DIC
Definition: xapitoken.php:46

References $_GET, $DIC, $ilSetting, ilTreeExplorerGUI\$tree, ILIAS\GlobalScreen\Provider\__construct(), getTopNodeForRefId(), ilExplorerBaseGUI\setAjax(), ilExplorerBaseGUI\setChildLimit(), ilExplorerBaseGUI\setNodeOpen(), 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 515 of file class.ilRepositoryExplorerGUI.php.

516 {
518
519 if (!$rbacsystem->checkAccess("read", $a_parent_node_id)) {
520 return array();
521 }
522
523 $obj_id = ilObject::_lookupObjId($a_parent_node_id);
524 if (!ilConditionHandler::_checkAllConditionsOfTarget($a_parent_node_id, $obj_id)) {
525 return array();
526 }
527
528 $childs = parent::getChildsOfNode($a_parent_node_id);
529
530 foreach ($childs as $c) {
531 $this->parent_node_id[$c["child"]] = $a_parent_node_id;
532 $this->node_data[$c["child"]] = $c;
533 }
534
535 return $childs;
536 }
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
static _lookupObjId($a_id)

References Vendor\Package\$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 135 of file class.ilRepositoryExplorerGUI.php.

136 {
138
139 $title = $a_node["title"];
140
141 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
142 if ($title == "ILIAS") {
143 $title = $lng->txt("repository");
144 }
145 } elseif ($a_node["type"] == "sess" &&
146 !trim($title)) {
147 // #14367 - see ilObjSessionListGUI
148 include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
149 $app_info = ilSessionAppointment::_lookupAppointment($a_node["obj_id"]);
150 $title = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'], $app_info['fullday']);
151 }
152
153 return $title;
154 }
static _lookupAppointment($a_obj_id)
lookup appointment
static _appointmentToString($start, $end, $fulltime)
getNodeId($a_node)
Get id for node.

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

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
mixed$a_nodenode object/array
Returns
string href attribute

Reimplemented from ilExplorerBaseGUI.

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

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

163 {
164 $obj_id = ilObject::_lookupObjId($a_node["child"]);
165 return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]);
166 }

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

175 {
177
178 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
179 $title = $a_node["title"];
180 if ($title == "ILIAS") {
181 $title = $lng->txt("repository");
182 }
183 return $title;
184 }
185
187 return $lng->txt("obj_" . $a_node["type"]) . ": " . $this->getNodeContent($a_node);
188 }
getNodeContent($a_node)
Get node content.

References $lng, getNodeContent(), 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 329 of file class.ilRepositoryExplorerGUI.php.

330 {
331 $current_node_id = $node_id;
332 while (isset($this->parent_node_id[$current_node_id])) {
333 $parent_node_id = $this->parent_node_id[$current_node_id];
334 if (isset($this->node_data[$parent_node_id]) && in_array($this->node_data[$parent_node_id]["type"], ["grp", "crs"])) {
335 return $parent_node_id;
336 }
337 $current_node_id = $parent_node_id;
338 }
339 return 0;
340 }

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

119 {
120 if ($this->top_node_id > 0) {
121 $root_node = $this->getTree()->getNodeData($this->top_node_id);
122 } else {
123 $root_node = parent::getRootNode();
124 }
125 $this->node_data[$root_node["child"]] = $root_node;
126 return $root_node;
127 }

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

643 : int {
644 global $DIC;
645
646 $setting = $DIC->settings();
647 $tree = $DIC->repositoryTree();
648
649 $top_node = 0;
650 if ($setting->get("rep_tree_limit_grp_crs") && $ref_id > 0) {
651 $path = $tree->getPathId($ref_id);
652 foreach ($path as $n) {
653 if ($top_node > 0) {
654 break;
655 }
656 if (in_array(
658 array("crs", "grp")
659 )) {
660 $top_node = $n;
661 }
662 }
663 }
664 return $top_node;
665 }
$n
Definition: RandomTest.php:85
static _lookupType($a_id, $a_reference=false)
lookup object type

References $n, ilTreeExplorerGUI\$tree, ilObject\_lookupObjId(), and ilObject\_lookupType().

Referenced by __construct(), and 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
mixed$a_nodenode object/array
Returns
boolean node clickable true/false

Reimplemented from ilExplorerBaseGUI.

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

545 {
550 $ilAccess = $this->access;
551
552 $obj_id = ilObject::_lookupObjId($a_node["child"]);
553 if (!ilConditionHandler::_checkAllConditionsOfTarget($a_node["child"], $obj_id)) {
554 return false;
555 }
556
557 switch ($a_node["type"]) {
558 case 'tst':
559 if (!$rbacsystem->checkAccess("read", $a_node["child"])) {
560 return false;
561 }
562
563 $query = sprintf("SELECT * FROM tst_tests WHERE obj_fi=%s", $obj_id);
564 $res = $ilDB->query($query);
565 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
566 return (bool) $row->complete;
567 }
568 return false;
569
570 case 'svy':
571 if (!$rbacsystem->checkAccess("read", $a_node["child"])) {
572 return false;
573 }
574
575 $query = sprintf("SELECT * FROM svy_svy WHERE obj_fi=%s", $obj_id);
576 $res = $ilDB->query($query);
577 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
578 return (bool) $row->complete;
579 }
580 return false;
581
582 // media pools can only be edited
583 case "mep":
584 if ($rbacsystem->checkAccess("read", $a_node["child"])) {
585 return true;
586 } else {
587 return false;
588 }
589 break;
590 case 'grpr':
591 case 'crsr':
592 case 'catr':
593 include_once('./Services/ContainerReference/classes/class.ilContainerReferenceAccess.php');
594 return ilContainerReferenceAccess::_isAccessible($a_node["child"]);
595
596 case 'prg':
597 return $rbacsystem->checkAccess("read", $a_node["child"]);
598
599 // all other types are only clickable, if read permission is given
600 default:
601 if ($rbacsystem->checkAccess("read", $a_node["child"])) {
602 // check if lm is online
603 if ($a_node["type"] == "lm") {
604 include_once("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
605 $lm_obj = new ilObjLearningModule($a_node["child"]);
606 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
607 return false;
608 }
609 }
610 // check if fblm is online
611 if ($a_node["type"] == "htlm") {
612 include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
613 $lm_obj = new ilObjFileBasedLM($a_node["child"]);
614 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
615 return false;
616 }
617 }
618 // check if fblm is online
619 if ($a_node["type"] == "sahs") {
620 include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
621 $lm_obj = new ilObjSAHSLearningModule($a_node["child"]);
622 if (($lm_obj->getOfflineStatus()) && (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
623 return false;
624 }
625 }
626 // check if glossary is online
627 if ($a_node["type"] == "glo") {
628 $obj_id = ilObject::_lookupObjectId($a_node["child"]);
629 if ((!ilObjGlossary::_lookupOnline($obj_id)) &&
630 (!$rbacsystem->checkAccess('write', $a_node["child"]))) {
631 return false;
632 }
633 }
634
635 return true;
636 } else {
637 return false;
638 }
639 break;
640 }
641 }
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, 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 196 of file class.ilRepositoryExplorerGUI.php.

197 {
198 if ($a_node["child"] == $_GET["ref_id"] ||
199 ($_GET["ref_id"] == "" && $a_node["child"] == $this->getNodeId($this->getRootNode()))) {
200 return true;
201 }
202 return false;
203 }

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

289 {
290 $ilAccess = $this->access;
293
294 if (!$ilAccess->checkAccess('visible', '', $a_node["child"])) {
295 return false;
296 }
297
298 if ($ilSetting->get("repository_tree_pres") == "all_types") {
299 /*$container_parent_id = $tree->checkForParentType($a_node["child"], 'grp');
300 if (!$container_parent_id) {
301 $container_parent_id = $tree->checkForParentType($a_node["child"], 'crs');
302 }*/
303 // see #21215
304 $container_parent_id = $this->getParentCourseOrGroup($a_node["child"]);
305 if ($container_parent_id > 0) {
306 // do not display session materials for container course/group
307 if ($container_parent_id != $a_node["child"]) {
308 // get container event items only once
309 if (!isset($this->session_materials[$container_parent_id])) {
310 include_once './Modules/Session/classes/class.ilEventItems.php';
311 $this->session_materials[$container_parent_id] = ilEventItems::_getItemsOfContainer($container_parent_id);
312 }
313 if (in_array($a_node["child"], $this->session_materials[$container_parent_id])) {
314 return false;
315 }
316 }
317 }
318 }
319
320 return true;
321 }
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 351 of file class.ilRepositoryExplorerGUI.php.

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

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

+ 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: