ILIAS  release_7 Revision v7.30-3-g800a261c036
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...
 
 nodeHasVisibleChilds ($a_node)
 Node has 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 = "./node_modules/jstree/dist/jstree.js"
 
static $js_tree_path_css = "./node_modules/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.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilSetting
Definition: privfeed.php:17
settings()
Definition: settings.php:2

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

523 {
525
526 if (!$rbacsystem->checkAccess("read", $a_parent_node_id)) {
527 return array();
528 }
529
530 $obj_id = ilObject::_lookupObjId($a_parent_node_id);
531 if (!ilConditionHandler::_checkAllConditionsOfTarget($a_parent_node_id, $obj_id)) {
532 return array();
533 }
534
535 $childs = parent::getChildsOfNode($a_parent_node_id);
536
537 foreach ($childs as $c) {
538 $this->parent_node_id[$c["child"]] = $a_parent_node_id;
539 $this->node_data[$c["child"]] = $c;
540 }
541
542 return $childs;
543 }
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)
$c
Definition: cli.php:37

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 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 return $title;
153 }
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 210 of file class.ilRepositoryExplorerGUI.php.

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

References $_GET, $ctrl, 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 161 of file class.ilRepositoryExplorerGUI.php.

162 {
163 $obj_id = ilObject::_lookupObjId($a_node["child"]);
164 return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]);
165 }
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 173 of file class.ilRepositoryExplorerGUI.php.

174 {
176
177 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
178 $title = $a_node["title"];
179 if ($title == "ILIAS") {
180 $title = $lng->txt("repository");
181 }
182 return $title;
183 }
184
186 return $lng->txt("obj_" . $a_node["type"]) . ": " . $this->getNodeContent($a_node);
187 }
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 328 of file class.ilRepositoryExplorerGUI.php.

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

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

653 : int
654 {
655 global $DIC;
656
657 $setting = $DIC->settings();
658 $tree = $DIC->repositoryTree();
659
660 $top_node = 0;
661 if ($setting->get("rep_tree_limit_grp_crs") && $ref_id > 0) {
662 $path = $tree->getPathId($ref_id);
663 foreach ($path as $n) {
664 if ($top_node > 0) {
665 break;
666 }
667 if (in_array(
669 array("crs", "grp")
670 )) {
671 $top_node = $n;
672 }
673 }
674 }
675 return $top_node;
676 }
$n
Definition: RandomTest.php:85
static _lookupType($a_id, $a_reference=false)
lookup object type

References $DIC, $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 551 of file class.ilRepositoryExplorerGUI.php.

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

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

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

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

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

◆ nodeHasVisibleChilds()

ilRepositoryExplorerGUI::nodeHasVisibleChilds (   $a_node)

Node has childs?

Please note that this standard method may not be optimal depending on what a derived class does in isNodeVisible.

Parameters

return

Reimplemented from ilExplorerBaseGUI.

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

509 {
510 if (!$this->obj_definition->isContainer($a_node["type"] ?? "")) {
511 return false;
512 }
513 return parent::nodeHasVisibleChilds($a_node);
514 }

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

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