ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 setPathOpen ($a_id)
 Set node path to be opened. More...
 
 getHTML ()
 Get HTML. More...
 
- Public Member Functions inherited from ilExplorerBaseGUI
 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd)
 Constructor. More...
 
 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...
 

Protected Attributes

 $type_grps = array()
 
 $session_materials = array()
 
- Protected Attributes inherited from ilTreeExplorerGUI
 $tree = null
 
 $order_field = ""
 
 $order_field_numeric = false
 
 $type_white_list = array()
 
 $type_black_list = array()
 
 $childs = array()
 
 $preloaded = false
 
 $preload_childs = false
 
 $root_node_data = null
 
 $all_childs = array()
 
- Protected Attributes inherited from ilExplorerBaseGUI
 $skip_root_node = false
 
 $ajax = false
 
 $custom_open_nodes = array()
 
 $selected_nodes = array()
 
 $select_postvar = ""
 
 $offline_mode = false
 
 $sec_highl_nodes = array()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 Get local path of explorer js. More...
 
static getLocalJsTreeJsPath ()
 Get local path of jsTree js. More...
 
static createHTMLExportDirs ($a_target_dir)
 Create html export directories. More...
 
static init ()
 Init JS. More...
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 Preload childs. More...
 
- Protected Member Functions inherited from ilExplorerBaseGUI
 getNodeToggleOnClick ($a_node)
 Get onclick attribute for node toggling. More...
 
 getSelectOnClick ($a_node)
 Get onclick attribute for selecting radio/checkbox. More...
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static $js_tree_path = "./Services/UIComponent/Explorer2/lib/jstree-v.pre1.0/jquery.jstree.js"
 
static $js_expl_path = "./Services/UIComponent/Explorer2/js/Explorer2.js"
 

Detailed Description

Repository explorer GUI class.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilRepositoryExplorerGUI::__construct (   $a_parent_obj,
  $a_parent_cmd 
)

Constructor.

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

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

25  {
26  global $tree, $ilSetting, $objDefinition;
27 
28  $this->cur_ref_id = (int) $_GET["ref_id"];
29 
30  $this->top_node_id = 0;
31  if ($ilSetting->get("rep_tree_limit_grp_crs") && $this->cur_ref_id > 0)
32  {
33  $path = $tree->getPathId($this->cur_ref_id);
34  foreach ($path as $n)
35  {
36  if ($top_node > 0)
37  {
38  break;
39  }
41  array("crs", "grp")))
42  {
43  $this->top_node_id = $n;
44  }
45  }
46 
47  }
48 
49  parent::__construct("rep_exp", $a_parent_obj, $a_parent_cmd, $tree);
50 
51  $this->setSkipRootNode(false);
52  $this->setAjax(true);
53  $this->setOrderField("title");
54 
55  if ($ilSetting->get("repository_tree_pres") == "" ||
56  ($ilSetting->get("rep_tree_limit_grp_crs") && $this->top_node_id == 0))
57  {
58  $this->setTypeWhiteList(array("root", "cat", "catr", "grp", "icrs",
59  "crs", "crsr", "rcrs", "itgr"));
60  }
61  else if ($ilSetting->get("repository_tree_pres") == "all_types")
62  {
63  $white = array();
64  foreach ($objDefinition->getSubObjectsRecursively("root") as $rtype)
65  {
66  if (/* $rtype["name"] != "itgr" && */ !$objDefinition->isSideBlock($rtype["name"]))
67  {
68  $white[] = $rtype["name"];
69  }
70  }
71  $this->setTypeWhiteList($white);
72  }
73  if ((int) $_GET["ref_id"] > 0)
74  {
75  $this->setPathOpen((int) $_GET["ref_id"]);
76  }
77  }
$_GET["client_id"]
setSkipRootNode($a_val)
Set skip root node.
setPathOpen($a_id)
Set node path to be opened.
setTypeWhiteList($a_val)
Set type white list.
static _lookupObjId($a_id)
$n
Definition: RandomTest.php:80
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilSetting
Definition: privfeed.php:40
$path
Definition: index.php:22
setOrderField($a_val, $a_numeric=false)
Set order field.
+ Here is the call graph for this function:

Member Function Documentation

◆ getChildsOfNode()

ilRepositoryExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get childs of node.

Parameters

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

References ilConditionHandler\_checkAllConditionsOfTarget(), and ilObject\_lookupObjId().

492  {
493  global $rbacsystem;
494 
495  if (!$rbacsystem->checkAccess("read", $a_parent_node_id))
496  {
497  return array();
498  }
499 
500  $obj_id = ilObject::_lookupObjId($a_parent_node_id);
501  if (!ilConditionHandler::_checkAllConditionsOfTarget($a_parent_node_id, $obj_id))
502  {
503  return array();
504  }
505 
506  return parent::getChildsOfNode($a_parent_node_id);
507  }
_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)
+ Here is the call graph for this function:

◆ getNodeContent()

ilRepositoryExplorerGUI::getNodeContent (   $a_node)

Get node content.

Parameters
array
Returns

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

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

104  {
105  global $lng;
106 
107  $title = $a_node["title"];
108 
109  if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
110  {
111  if ($title == "ILIAS")
112  {
113  $title = $lng->txt("repository");
114  }
115  }
116  else if($a_node["type"] == "sess" &&
117  !trim($title))
118  {
119  // #14367 - see ilObjSessionListGUI
120  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
121  $app_info = ilSessionAppointment::_lookupAppointment($a_node["obj_id"]);
122  $title = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'],$app_info['fullday']);
123  }
124 
125  return $title;
126  }
static _appointmentToString($start, $end, $fulltime)
getNodeId($a_node)
Get id for node.
global $lng
Definition: privfeed.php:40
static _lookupAppointment($a_obj_id)
lookup appointment
+ Here is the call graph for this function:

◆ getNodeHref()

ilRepositoryExplorerGUI::getNodeHref (   $a_node)

Get href for node.

Parameters
mixed$a_nodenode object/array
Returns
string href attribute

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

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

187  {
188  global $ilCtrl;
189 
190  switch($a_node["type"])
191  {
192  case "root":
193  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
194  $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
195  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
196  return $link;
197 
198  case "cat":
199  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
200  $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "");
201  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
202  return $link;
203 
204  case "catr":
205  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
206  $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "redirect");
207  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
208  return $link;
209 
210  case "grp":
211  $ilCtrl->setParameterByClass("ilobjgroupgui", "ref_id", $a_node["child"]);
212  $link = $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjgroupgui"), "");
213  $ilCtrl->setParameterByClass("ilobjgroupgui", "ref_id", $_GET["ref_id"]);
214  return $link;
215 
216  case "crs":
217  $ilCtrl->setParameterByClass("ilobjcoursegui", "ref_id", $a_node["child"]);
218  $link = $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjcoursegui"), "view");
219  $ilCtrl->setParameterByClass("ilobjcoursegui", "ref_id", $_GET["ref_id"]);
220  return $link;
221 
222  case "crsr":
223  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
224  $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "redirect");
225  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
226  return $link;
227 
228  case "icrs":
229  $ilCtrl->setParameterByClass("ilobjilinccoursegui", "ref_id", $a_node["child"]);
230  $link = $ilCtrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjilinccoursegui"), "");
231  $ilCtrl->setParameterByClass("ilobjilinccoursegui", "ref_id", $_GET["ref_id"]);
232  return $link;
233 
234  case 'rcrs':
235  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_node["child"]);
236  $link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", "infoScreen");
237  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
238  return $link;
239 
240  default:
241  include_once('./Services/Link/classes/class.ilLink.php');
242  return ilLink::_getStaticLink($a_node["child"], $a_node["type"], true);
243 
244  }
245  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ getNodeIcon()

ilRepositoryExplorerGUI::getNodeIcon (   $a_node)

Get node icon.

Parameters
array
Returns

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

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

135  {
136  $obj_id = ilObject::_lookupObjId($a_node["child"]);
137  return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]);
138  }
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static _lookupObjId($a_id)
+ 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

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

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

147  {
148  global $lng;
149 
150  if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
151  {
152  $title = $a_node["title"];
153  if ($title == "ILIAS")
154  {
155  $title = $lng->txt("repository");
156  }
157  return $lng->txt("icon")." ".$title;
158  }
159 
160 
161  return parent::getNodeIconAlt($a_node);
162  }
getNodeId($a_node)
Get id for node.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ getRootNode()

ilRepositoryExplorerGUI::getRootNode ( )

Get root node.

Parameters

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

References ilTreeExplorerGUI\getTree().

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

86  {
87  if ($this->top_node_id > 0)
88  {
89  return $this->getTree()->getNodeData($this->top_node_id);
90  }
91  else
92  {
93  return parent::getRootNode();
94  }
95  }
+ 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

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

References $ilDB, $ilUser, $query, $res, $row, ilTreeExplorerGUI\$tree, ilConditionHandler\_checkAllConditionsOfTarget(), ilContainerReferenceAccess\_isAccessible(), ilObject\_lookupObjectId(), ilObject\_lookupObjId(), ilObjGlossary\_lookupOnline(), and DB_FETCHMODE_OBJECT.

516  {
517  global $rbacsystem,$tree,$ilDB,$ilUser,$ilAccess;
518 
519  $obj_id = ilObject::_lookupObjId($a_node["child"]);
520  if (!ilConditionHandler::_checkAllConditionsOfTarget($a_node["child"], $obj_id))
521  {
522  return false;
523  }
524 
525  switch ($a_node["type"])
526  {
527  case "crs":
528  return $ilAccess->checkAccess("read", "", $a_node["child"]);
529 
530  // visible groups can allways be clicked; group processing decides
531  // what happens next
532  case "grp":
533  return true;
534 
535  case 'tst':
536  if(!$rbacsystem->checkAccess("read", $a_node["child"]))
537  {
538  return false;
539  }
540 
541  $query = sprintf("SELECT * FROM tst_tests WHERE obj_fi=%s", $obj_id);
542  $res = $ilDB->query($query);
543  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
544  {
545  return (bool) $row->complete;
546  }
547  return false;
548 
549  case 'svy':
550  if(!$rbacsystem->checkAccess("read", $a_node["child"]))
551  {
552  return false;
553  }
554 
555  $query = sprintf("SELECT * FROM svy_svy WHERE obj_fi=%s", $obj_id);
556  $res = $ilDB->query($query);
557  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
558  {
559  return (bool) $row->complete;
560  }
561  return false;
562 
563  // media pools can only be edited
564  case "mep":
565  if ($rbacsystem->checkAccess("read", $a_node["child"]))
566  {
567  return true;
568  }
569  else
570  {
571  return false;
572  }
573  break;
574 
575  case 'crsr':
576  case 'catr':
577  include_once('./Services/ContainerReference/classes/class.ilContainerReferenceAccess.php');
578  return ilContainerReferenceAccess::_isAccessible($a_node["child"]);
579 
580 
581  // all other types are only clickable, if read permission is given
582  default:
583  if ($rbacsystem->checkAccess("read", $a_node["child"]))
584  {
585  // check if lm is online
586  if ($a_node["type"] == "lm")
587  {
588  include_once("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
589  $lm_obj =& new ilObjLearningModule($a_node["child"]);
590  if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write', $a_node["child"])))
591  {
592  return false;
593  }
594  }
595  // check if fblm is online
596  if ($a_node["type"] == "htlm")
597  {
598  include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
599  $lm_obj =& new ilObjFileBasedLM($a_node["child"]);
600  if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write', $a_node["child"])))
601  {
602  return false;
603  }
604  }
605  // check if fblm is online
606  if ($a_node["type"] == "sahs")
607  {
608  include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
609  $lm_obj =& new ilObjSAHSLearningModule($a_node["child"]);
610  if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write', $a_node["child"])))
611  {
612  return false;
613  }
614  }
615  // check if glossary is online
616  if ($a_node["type"] == "glo")
617  {
618  $obj_id = ilObject::_lookupObjectId($a_node["child"]);
619  include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
620  if((!ilObjGlossary::_lookupOnline($obj_id)) &&
621  (!$rbacsystem->checkAccess('write', $a_node["child"])))
622  {
623  return false;
624  }
625  }
626 
627  return true;
628  }
629  else
630  {
631  return false;
632  }
633  break;
634  }
635  }
Class ilObjLearningModule.
File Based Learning Module (HTML) object.
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
static _lookupObjectId($a_ref_id)
lookup object id
_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 _isAccessible($a_ref_id)
Check if target is accessible and not deleted.
static _lookupObjId($a_id)
_lookupOnline($a_id)
check wether content object is online
global $ilUser
Definition: imgupload.php:15
global $ilDB
Class ilObjSCORMLearningModule.
+ 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

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

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

171  {
172  if ($a_node["child"] == $_GET["ref_id"] ||
173  ($_GET["ref_id"] == "" && $a_node["child"] == $this->getNodeId($this->getRootNode())))
174  {
175  return true;
176  }
177  return false;
178  }
$_GET["client_id"]
getNodeId($a_node)
Get id for node.
+ Here is the call graph for this function:

◆ isNodeVisible()

ilRepositoryExplorerGUI::isNodeVisible (   $a_node)

Is node visible.

Parameters

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

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

254  {
255  global $ilAccess,$tree,$ilSetting;
256 
257  if (!$ilAccess->checkAccess('visible', '', $a_node["child"]))
258  {
259  return false;
260  }
261 
262  $is_course = false;
263  $container_parent_id = $tree->checkForParentType($a_node["child"], 'grp');
264  if(!$container_parent_id)
265  {
266  $is_course = true;
267  $container_parent_id = $tree->checkForParentType($a_node["child"], 'crs');
268  }
269  if($container_parent_id)
270  {
271  // do not display session materials for container course/group
272  if($ilSetting->get("repository_tree_pres") == "all_types" && $container_parent_id != $a_node["child"])
273  {
274  // get container event items only once
275  if(!isset($this->session_materials[$container_parent_id]))
276  {
277  include_once './Modules/Session/classes/class.ilEventItems.php';
278  $this->session_materials[$container_parent_id] = ilEventItems::_getItemsOfContainer($container_parent_id);
279  }
280  if(in_array($a_node["child"], $this->session_materials[$container_parent_id]))
281  {
282  return false;
283  }
284  }
285  }
286 
287  return true;
288  }
_getItemsOfContainer($a_ref_id)
global $ilSetting
Definition: privfeed.php:40
+ 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

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

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

299  {
300  global $objDefinition, $ilAccess;
301 
302  $parent_obj_id = ilObject::_lookupObjId($a_parent_node_id);
303  if ($parent_obj_id > 0)
304  {
305  $parent_type = ilObject::_lookupType($parent_obj_id);
306  }
307  else
308  {
309  $parent_type = "dummy";
310  $this->type_grps["dummy"] = array("root" => "dummy");
311  }
312 
313  // alex: if this is not initialized, things are messed up
314  // see bug 0015978
315  $this->type_grps = array();
316 
317  if (empty($this->type_grps[$parent_type]))
318  {
319  $this->type_grps[$parent_type] =
320  $objDefinition->getGroupedRepositoryObjectTypes($parent_type);
321  }
322 
323  // #14465 - item groups
324  include_once('./Services/Object/classes/class.ilObjectActivation.php');
325  $group = array();
326  $igroup = array(); // used for item groups, see bug #0015978
327  $in_any_group = array();
328  foreach ($a_childs as $child)
329  {
330  // item group: get childs
331  if ($child["type"] == "itgr")
332  {
333  $g = $child["child"];
334 
336  if ($items)
337  {
338  // add item group ref id to item group block
339  $this->type_grps[$parent_type]["itgr"]["ref_ids"][] = $g;
340 
341  // #16697 - check item group permissions
342  $may_read = $ilAccess->checkAccess('read', '', $g);
343 
344  // see bug #0015978
345  if ($may_read)
346  {
347  include_once("./Services/Container/classes/class.ilContainerSorting.php");
348  $items = ilContainerSorting::_getInstance($parent_obj_id)->sortSubItems('itgr', $child["obj_id"], $items);
349  }
350 
351  foreach($items as $item)
352  {
353  $in_any_group[] = $item["child"];
354 
355  if($may_read)
356  {
357  $igroup[$g][] = $item;
358  $group[$g][] = $item;
359  }
360  }
361  }
362  }
363  // type group
364  else
365  {
366  $g = $objDefinition->getGroupOfObj($child["type"]);
367  if ($g == "")
368  {
369  $g = $child["type"];
370  }
371  $group[$g][] = $child;
372  }
373  }
374 
375  $in_any_group = array_unique($in_any_group);
376 
377  // custom block sorting?
378  include_once("./Services/Container/classes/class.ilContainerSorting.php");
379  $sort = ilContainerSorting::_getInstance($parent_obj_id);
380  $block_pos = $sort->getBlockPositions();
381  if (sizeof($block_pos))
382  {
383  $tmp = $this->type_grps[$parent_type];
384 
385  $this->type_grps[$parent_type] = array();
386  foreach ($block_pos as $block_type)
387  {
388  // type group
389  if (!is_numeric($block_type) &&
390  array_key_exists($block_type, $tmp))
391  {
392  $this->type_grps[$parent_type][$block_type] = $tmp[$block_type];
393  unset($tmp[$block_type]);
394  }
395  // item group
396  else
397  {
398  // using item group ref id directly
399  $this->type_grps[$parent_type][$block_type] = array();
400  }
401  }
402 
403  // append missing
404  if (sizeof($tmp))
405  {
406  foreach ($tmp as $block_type => $grp)
407  {
408  $this->type_grps[$parent_type][$block_type] = $grp;
409  }
410  }
411 
412  unset($tmp);
413  }
414 
415  $childs = array();
416  $done = array();
417 
418  foreach ($this->type_grps[$parent_type] as $t => $g)
419  {
420  // type group
421  if (is_array($group[$t]))
422  {
423  // see bug #0015978
424  // custom sorted igroups
425  if (is_array($igroup[$t]))
426  {
427  foreach ($igroup[$t] as $k => $item)
428  {
429  if (!in_array($item["child"], $done))
430  {
431  $childs[] = $item;
432  $done[] = $item["child"];
433  }
434  }
435  }
436  else
437  {
438  // do we have to sort this group??
439  include_once("./Services/Container/classes/class.ilContainer.php");
440  include_once("./Services/Container/classes/class.ilContainerSorting.php");
441  $sort = ilContainerSorting::_getInstance($parent_obj_id);
442  $group = $sort->sortItems($group);
443 
444  // need extra session sorting here
445  if ($t == "sess")
446  {
447 
448  }
449 
450  foreach ($group[$t] as $k => $item)
451  {
452  if (!in_array($item["child"], $done) &&
453  !in_array($item["child"], $in_any_group)) // #16697
454  {
455  $childs[] = $item;
456  $done[] = $item["child"];
457  }
458  }
459  }
460  }
461  // item groups (if not custom block sorting)
462  else if ($t == "itgr" &&
463  is_array($g["ref_ids"]))
464  {
465  foreach ($g["ref_ids"] as $ref_id)
466  {
467  if (isset($group[$ref_id]))
468  {
469  foreach ($group[$ref_id] as $k => $item)
470  {
471  if(!in_array($item["child"], $done))
472  {
473  $childs[] = $item;
474  $done[] = $item["child"];
475  }
476  }
477  }
478  }
479  }
480  }
481 
482  return $childs;
483  }
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
$ref_id
Definition: sahs_server.php:39
static getItemsByItemGroup($a_item_group_ref_id)
Get materials of item group.
static _getInstance($a_obj_id)
get instance by obj_id
+ Here is the call graph for this function:

Field Documentation

◆ $session_materials

ilRepositoryExplorerGUI::$session_materials = array()
protected

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

◆ $type_grps

ilRepositoryExplorerGUI::$type_grps = array()
protected

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


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