ILIAS  release_4-4 Revision
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...
 
 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...
 
 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
 

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...
 
- 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"));
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 410 of file class.ilRepositoryExplorerGUI.php.

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

411  {
412  global $rbacsystem;
413 
414  if (!$rbacsystem->checkAccess("read", $a_parent_node_id))
415  {
416  return array();
417  }
418 
419  $obj_id = ilObject::_lookupObjId($a_parent_node_id);
420  if (!ilConditionHandler::_checkAllConditionsOfTarget($a_parent_node_id, $obj_id))
421  {
422  return array();
423  }
424 
425  return parent::getChildsOfNode($a_parent_node_id);
426  }
_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  if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
109  {
110  if ($title == "ILIAS")
111  {
112  $title = $lng->txt("repository");
113  }
114  }
115  else if($a_node["type"] == "sess" &&
116  !trim($title))
117  {
118  // #14367 - see ilObjSessionListGUI
119  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
120  $app_info = ilSessionAppointment::_lookupAppointment($a_node["obj_id"]);
121  $title = ilSessionAppointment::_appointmentToString($app_info['start'], $app_info['end'],$app_info['fullday']);
122  }
123 
124  return $title;
125  }
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 185 of file class.ilRepositoryExplorerGUI.php.

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

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

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

134  {
135  $obj_id = ilObject::_lookupObjId($a_node["child"]);
136  return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]);
137  }
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 145 of file class.ilRepositoryExplorerGUI.php.

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

146  {
147  global $lng;
148 
149  if ($a_node["child"] == $this->getNodeId($this->getRootNode()))
150  {
151  $title = $a_node["title"];
152  if ($title == "ILIAS")
153  {
154  $title = $lng->txt("repository");
155  }
156  return $lng->txt("icon")." ".$title;
157  }
158 
159 
160  return parent::getNodeIconAlt($a_node);
161  }
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 434 of file class.ilRepositoryExplorerGUI.php.

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

435  {
436  global $rbacsystem,$tree,$ilDB,$ilUser,$ilAccess;
437 
438  $obj_id = ilObject::_lookupObjId($a_node["child"]);
439  if (!ilConditionHandler::_checkAllConditionsOfTarget($a_node["child"], $obj_id))
440  {
441  return false;
442  }
443 
444  switch ($a_node["type"])
445  {
446  case "crs":
447  return $ilAccess->checkAccess("read", "", $a_node["child"]);
448 
449  // visible groups can allways be clicked; group processing decides
450  // what happens next
451  case "grp":
452  return true;
453 
454  case 'tst':
455  if(!$rbacsystem->checkAccess("read", $a_node["child"]))
456  {
457  return false;
458  }
459 
460  $query = sprintf("SELECT * FROM tst_tests WHERE obj_fi=%s", $obj_id);
461  $res = $ilDB->query($query);
462  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
463  {
464  return (bool) $row->complete;
465  }
466  return false;
467 
468  case 'svy':
469  if(!$rbacsystem->checkAccess("read", $a_node["child"]))
470  {
471  return false;
472  }
473 
474  $query = sprintf("SELECT * FROM svy_svy WHERE obj_fi=%s", $obj_id);
475  $res = $ilDB->query($query);
476  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
477  {
478  return (bool) $row->complete;
479  }
480  return false;
481 
482  // media pools can only be edited
483  case "mep":
484  if ($rbacsystem->checkAccess("read", $a_node["child"]))
485  {
486  return true;
487  }
488  else
489  {
490  return false;
491  }
492  break;
493 
494  case 'crsr':
495  case 'catr':
496  include_once('./Services/ContainerReference/classes/class.ilContainerReferenceAccess.php');
497  return ilContainerReferenceAccess::_isAccessible($a_node["child"]);
498 
499 
500  // all other types are only clickable, if read permission is given
501  default:
502  if ($rbacsystem->checkAccess("read", $a_node["child"]))
503  {
504  // check if lm is online
505  if ($a_node["type"] == "lm")
506  {
507  include_once("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
508  $lm_obj =& new ilObjLearningModule($a_node["child"]);
509  if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write', $a_node["child"])))
510  {
511  return false;
512  }
513  }
514  // check if fblm is online
515  if ($a_node["type"] == "htlm")
516  {
517  include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
518  $lm_obj =& new ilObjFileBasedLM($a_node["child"]);
519  if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write', $a_node["child"])))
520  {
521  return false;
522  }
523  }
524  // check if fblm is online
525  if ($a_node["type"] == "sahs")
526  {
527  include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
528  $lm_obj =& new ilObjSAHSLearningModule($a_node["child"]);
529  if((!$lm_obj->getOnline()) && (!$rbacsystem->checkAccess('write', $a_node["child"])))
530  {
531  return false;
532  }
533  }
534  // check if glossary is online
535  if ($a_node["type"] == "glo")
536  {
537  $obj_id = ilObject::_lookupObjectId($a_node["child"]);
538  include_once("./Modules/Glossary/classes/class.ilObjGlossary.php");
539  if((!ilObjGlossary::_lookupOnline($obj_id)) &&
540  (!$rbacsystem->checkAccess('write', $a_node["child"])))
541  {
542  return false;
543  }
544  }
545 
546  return true;
547  }
548  else
549  {
550  return false;
551  }
552  break;
553  }
554  }
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)
global $ilUser
Definition: imgupload.php:15
_lookupOnline($a_id)
check wether content object is online
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 169 of file class.ilRepositoryExplorerGUI.php.

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

170  {
171  if ($a_node["child"] == $_GET["ref_id"] ||
172  ($_GET["ref_id"] == "" && $a_node["child"] == $this->getNodeId($this->getRootNode())))
173  {
174  return true;
175  }
176  return false;
177  }
$_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 252 of file class.ilRepositoryExplorerGUI.php.

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

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

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

298  {
299  global $objDefinition;
300 
301  $parent_obj_id = ilObject::_lookupObjId($a_parent_node_id);
302 
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  if (empty($this->type_grps[$parent_type]))
314  {
315  $this->type_grps[$parent_type] =
316  $objDefinition->getGroupedRepositoryObjectTypes($parent_type);
317  }
318 
319  // #14465 - item groups
320  include_once('./Services/Object/classes/class.ilObjectActivation.php');
321  $group = array();
322  foreach ($a_childs as $child)
323  {
324  // item group: get childs
325  if ($child["type"] == "itgr")
326  {
327  $g = $child["child"];
329  if ($items)
330  {
331  // add item group ref id to item group block
332  $this->type_grps[$parent_type]["itgr"]["ref_ids"][] = $g;
333 
334  foreach($items as $item)
335  {
336  $group[$g][] = $item;
337  }
338  }
339  }
340  // type group
341  else
342  {
343  $g = $objDefinition->getGroupOfObj($child["type"]);
344  if ($g == "")
345  {
346  $g = $child["type"];
347  }
348  $group[$g][] = $child;
349  }
350  }
351 
352  $childs = array();
353  $done = array();
354  foreach ($this->type_grps[$parent_type] as $t => $g)
355  {
356  // type group
357  if (is_array($group[$t]))
358  {
359  // do we have to sort this group??
360  include_once("./Services/Container/classes/class.ilContainer.php");
361  include_once("./Services/Container/classes/class.ilContainerSorting.php");
362  $sort = ilContainerSorting::_getInstance($parent_obj_id);
363  $group = $sort->sortItems($group);
364 
365  // need extra session sorting here
366  if ($t == "sess")
367  {
368 
369  }
370 
371  foreach ($group[$t] as $k => $item)
372  {
373  if (!in_array($item["child"], $done))
374  {
375  $childs[] = $item;
376  $done[] = $item["child"];
377  }
378  }
379  }
380  // item groups
381  else if ($t == "itgr" &&
382  is_array($g["ref_ids"]))
383  {
384  foreach ($g["ref_ids"] as $ref_id)
385  {
386  if (isset($group[$ref_id]))
387  {
388  foreach ($group[$ref_id] as $k => $item)
389  {
390  if(!in_array($item["child"], $done))
391  {
392  $childs[] = $item;
393  $done[] = $item["child"];
394  }
395  }
396  }
397  }
398  }
399  }
400 
401  return $childs;
402  }
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: