ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilRepositoryExplorerGUI Class Reference

Repository explorer GUI class. More...

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

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

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

Additional Inherited Members

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

Detailed Description

Repository explorer GUI class.

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

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

Member Function Documentation

◆ getChildsOfNode()

ilRepositoryExplorerGUI::getChildsOfNode (   $a_parent_node_id)

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

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

419  : array
420  {
422 
423  if (!$rbacsystem->checkAccess("read", $a_parent_node_id)) {
424  return [];
425  }
426 
427  $obj_id = ilObject::_lookupObjId($a_parent_node_id);
428  if (!ilConditionHandler::_checkAllConditionsOfTarget($a_parent_node_id, $obj_id)) {
429  return [];
430  }
431 
432  $childs = parent::getChildsOfNode($a_parent_node_id);
433 
434  foreach ($childs as $c) {
435  $this->parent_node_id[$c["child"]] = $a_parent_node_id;
436  $this->node_data[$c["child"]] = $c;
437  }
438 
439  return $childs;
440  }
$c
Definition: deliver.php:25
static _lookupObjId(int $ref_id)
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
static _checkAllConditionsOfTarget(int $a_target_ref_id, int $a_target_id, string $a_target_type="", int $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
+ Here is the call graph for this function:

◆ getNodeContent()

ilRepositoryExplorerGUI::getNodeContent (   $a_node)

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

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

Referenced by getNodeIconAlt().

107  : string
108  {
109  $lng = $this->lng;
110 
111  $title = $a_node["title"];
112 
113  if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
114  if ($title === "ILIAS") {
115  $title = $lng->txt("repository");
116  }
117  } elseif ($a_node["type"] === "sess" &&
118  !trim($title)) {
119  // #14367 - see ilObjSessionListGUI
120  $app_info = ilSessionAppointment::_lookupAppointment($a_node["obj_id"]);
121  $title = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'], (bool) $app_info['fullday']);
122  }
123  return $title;
124  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _lookupAppointment(int $a_obj_id)
getNodeId($a_node)
Get id for node.
static _appointmentToString(int $start, int $end, bool $fulltime)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNodeHref()

ilRepositoryExplorerGUI::getNodeHref (   $a_node)

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

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

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

◆ getNodeIcon()

ilRepositoryExplorerGUI::getNodeIcon (   $a_node)

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

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

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

◆ getNodeIconAlt()

ilRepositoryExplorerGUI::getNodeIconAlt (   $a_node)

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

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

132  : string
133  {
134  $lng = $this->lng;
135 
136  if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
137  $title = $a_node["title"];
138  if ($title === "ILIAS") {
139  $title = $lng->txt("repository");
140  }
141  return $title;
142  }
143 
144  $lng = $this->lng;
145  return $lng->txt("obj_" . $a_node["type"]) . ": " . $this->getNodeContent($a_node);
146  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getNodeId($a_node)
Get id for node.
+ Here is the call graph for this function:

◆ getParentCourseOrGroup()

ilRepositoryExplorerGUI::getParentCourseOrGroup ( int  $node_id)
protected

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

References $parent_node_id.

Referenced by isNodeVisible().

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

◆ getRootNode()

ilRepositoryExplorerGUI::getRootNode ( )

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

References ilTreeExplorerGUI\getTree().

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

97  {
98  if ($this->top_node_id > 0) {
99  $root_node = $this->getTree()->getNodeData($this->top_node_id);
100  } else {
101  $root_node = parent::getRootNode();
102  }
103  $this->node_data[$root_node["child"]] = $root_node;
104  return $root_node;
105  }
+ 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 449 of file class.ilRepositoryExplorerGUI.php.

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

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

449  : int
450  {
451  global $DIC;
452 
453  $setting = $DIC->settings();
454  $tree = $DIC->repositoryTree();
455 
456  $top_node = 0;
457  if ($ref_id > 0 && $setting->get("rep_tree_limit_grp_crs")) {
459  foreach ($path as $n) {
460  if ($top_node > 0) {
461  break;
462  }
463  if (in_array(
465  ["crs", "grp"]
466  )) {
467  $top_node = $n;
468  }
469  }
470  }
471  return $top_node;
472  }
$path
Definition: ltiservices.php:29
static _lookupObjId(int $ref_id)
$ref_id
Definition: ltiauth.php:65
global $DIC
Definition: shib_login.php:22
getPathId(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isNodeClickable()

ilRepositoryExplorerGUI::isNodeClickable (   $a_node)

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

References ILIAS\Repository\access().

442  : bool
443  {
444  return
445  $this->access->checkAccess("read", "", (int) $a_node["child"]) ||
446  $this->access->checkAccess("join", "", (int) $a_node["child"]);
447  }
+ Here is the call graph for this function:

◆ isNodeHighlighted()

ilRepositoryExplorerGUI::isNodeHighlighted (   $a_node)

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

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

148  : bool
149  {
150  if ((int) $a_node["child"] === $this->cur_ref_id ||
151  ($this->cur_ref_id === 0 && (int) $a_node["child"] === (int) $this->getNodeId($this->getRootNode()))) {
152  return true;
153  }
154  return false;
155  }
getNodeId($a_node)
Get id for node.
+ Here is the call graph for this function:

◆ isNodeVisible()

ilRepositoryExplorerGUI::isNodeVisible (   $a_node)

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

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

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

◆ nodeHasVisibleChilds()

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

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

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

◆ sortChilds()

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

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

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

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

Field Documentation

◆ $access

ilAccessHandler ilRepositoryExplorerGUI::$access
protected

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

Referenced by isNodeVisible(), and sortChilds().

◆ $cur_ref_id

int ilRepositoryExplorerGUI::$cur_ref_id = 0
protected

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

◆ $db

ilDBInterface ilRepositoryExplorerGUI::$db
protected

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

◆ $node_data

array ilRepositoryExplorerGUI::$node_data = []
protected

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

◆ $obj_definition

ilObjectDefinition ilRepositoryExplorerGUI::$obj_definition
protected

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

Referenced by sortChilds().

◆ $parent_node_id

array ilRepositoryExplorerGUI::$parent_node_id = []
protected

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

Referenced by getParentCourseOrGroup().

◆ $rbacsystem

ilRbacSystem ilRepositoryExplorerGUI::$rbacsystem
protected

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

Referenced by getChildsOfNode().

◆ $request

StandardGUIRequest ilRepositoryExplorerGUI::$request
protected

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

◆ $session_materials

array ilRepositoryExplorerGUI::$session_materials = []
protected

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

◆ $settings

ilSetting ilRepositoryExplorerGUI::$settings
protected

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

Referenced by isNodeVisible().

◆ $top_node_id

int ilRepositoryExplorerGUI::$top_node_id
protected

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

◆ $type_grps

array ilRepositoryExplorerGUI::$type_grps = []
protected

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

◆ $user

ilObjUser ilRepositoryExplorerGUI::$user
protected

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


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