ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjectListGUIPreloader Class Reference

Preloader for object list GUIs. More...

+ Collaboration diagram for ilObjectListGUIPreloader:

Public Member Functions

 __construct ($a_context)
 
 addItem ($a_obj_id, $a_type, $a_ref_id=null)
 
 preload ()
 

Protected Attributes

 $context
 
 $obj_ids
 
 $obj_ids_by_type
 
 $ref_ids
 
 $ref_ids_by_type
 
 $types
 

Detailed Description

Preloader for object list GUIs.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id
class.ilObject.php 46291 2013-11-19 15:09:45Z jluetzen

Definition at line 12 of file class.ilObjectListGUIPreloader.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjectListGUIPreloader::__construct (   $a_context)

Definition at line 21 of file class.ilObjectListGUIPreloader.php.

22  {
23  $this->context = $a_context;
24  }

Member Function Documentation

◆ addItem()

ilObjectListGUIPreloader::addItem (   $a_obj_id,
  $a_type,
  $a_ref_id = null 
)

Definition at line 26 of file class.ilObjectListGUIPreloader.php.

References $a_type.

27  {
28  $this->obj_ids[] = $a_obj_id;
29  $this->obj_ids_by_type[$a_type][] = $a_obj_id;
30  $this->types[] = $a_type;
31 
32  if($a_ref_id)
33  {
34  $this->ref_ids[] = $a_ref_id;
35  $this->ref_ids_by_type[$a_type][] = $a_ref_id;
36  }
37  }
$a_type
Definition: workflow.php:93

◆ preload()

ilObjectListGUIPreloader::preload ( )

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

References $ilUser, $location, $ref_ids, array, ilObjectListGUI\CONTEXT_PERSONAL_DESKTOP, ilObjectListGUI\CONTEXT_REPOSITORY, ilObjectListGUI\CONTEXT_SEARCH, ilAdvancedMDValues\preloadByObjIds(), ilObjectListGUI\preloadCommonProperties(), ilConditionHandler\preloadConditionsForTargetRecords(), ilObjectActivation\preloadData(), ilObjUser\preloadIsDesktopItem(), ilRating\preloadListGUIData(), and ilLPStatus\preloadListGUIData().

40  {
41  global $objDefinition, $tree, $ilObjDataCache, $ilUser, $rbacsystem;
42 
43  if(!$this->obj_ids)
44  {
45  return;
46  }
47 
48  $this->obj_ids = array_unique($this->obj_ids);
49  $this->types = array_unique($this->types);
50  if($this->ref_ids)
51  {
52  $this->ref_ids = array_unique($this->ref_ids);
53  }
54 
55  // type specific preloads
56  include_once("./Services/AccessControl/classes/class.ilConditionHandler.php");
57  foreach ($this->types as $type)
58  {
59  $this->obj_ids_by_type[$type] = array_unique($this->obj_ids_by_type[$type]);
60 
61  if(is_array($this->ref_ids_by_type[$type]))
62  {
63  $this->ref_ids_by_type[$type] = array_unique($this->ref_ids_by_type[$type]);
64  }
65 
66  if($this->context == ilObjectListGUI::CONTEXT_REPOSITORY ||
68  $this->context == ilObjectListGUI::CONTEXT_SEARCH)
69  {
71  $this->obj_ids_by_type[$type]);
72  }
73 
74  $class = $objDefinition->getClassName($type);
75  $location = $objDefinition->getLocation($type);
76  if($class && $location) // #12775
77  {
78  $full_class = "ilObj".$class."Access";
79  include_once($location."/class.".$full_class.".php");
80  if(class_exists($full_class))
81  {
82  call_user_func(array($full_class, "_preloadData"),
83  $this->obj_ids_by_type[$type], $this->ref_ids_by_type[$type]);
84  }
85  }
86  }
87 
88  if($this->ref_ids)
89  {
90  $tree->preloadDeleted($this->ref_ids);
91  $tree->preloadDepthParent($this->ref_ids);
92  $ilObjDataCache->preloadReferenceCache($this->ref_ids, false);
93  $rbacsystem->preloadRbacPaCache($this->ref_ids, $ilUser->getId());
94 
95  if($ilUser->getId != ANONYMOUS_USER_ID &&
97  {
99  }
100 
101  include_once("./Services/Object/classes/class.ilObjectActivation.php");
102  ilObjectActivation::preloadData($this->ref_ids);
103  }
104 
105  include_once("./Services/Object/classes/class.ilObjectListGUI.php");
106  ilObjectListGUI::preloadCommonProperties($this->obj_ids, $this->context);
107 
108  if($this->context == ilObjectListGUI::CONTEXT_REPOSITORY)
109  {
110  include_once("./Services/Rating/classes/class.ilRating.php");
111  include_once("./Services/Rating/classes/class.ilRatingGUI.php");
112  ilRating::preloadListGUIData($this->obj_ids);
113 
114  include_once("./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php");
115  ilAdvancedMDValues::preloadByObjIds($this->obj_ids);
116  }
117 
118  if($this->context == ilObjectListGUI::CONTEXT_REPOSITORY ||
119  $this->context == ilObjectListGUI::CONTEXT_PERSONAL_DESKTOP ||
120  $this->context == ilObjectListGUI::CONTEXT_SEARCH)
121  {
122  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
123  ilLPStatus::preloadListGUIData($this->obj_ids);
124  }
125  }
static preloadIsDesktopItem($a_usr_id, $a_item_ids)
Preload desktop item information.
static preloadListGUIData($a_obj_ids)
$location
Definition: buildRTE.php:44
static preloadByObjIds(array $a_obj_ids)
Preload list gui data.
static preloadCommonProperties($a_obj_ids, $a_context)
Preload common properties.
static preloadConditionsForTargetRecords($a_type, $a_obj_ids)
Preload conditions for target records.
$ilUser
Definition: imgupload.php:18
static preloadData(array $a_ref_ids)
Preload data to internal cache.
Create styles array
The data for the language used.
static preloadListGUIData(array $a_obj_ids)
Preload rating data for list guis.
+ Here is the call graph for this function:

Field Documentation

◆ $context

ilObjectListGUIPreloader::$context
protected

Definition at line 14 of file class.ilObjectListGUIPreloader.php.

◆ $obj_ids

ilObjectListGUIPreloader::$obj_ids
protected

Definition at line 15 of file class.ilObjectListGUIPreloader.php.

◆ $obj_ids_by_type

ilObjectListGUIPreloader::$obj_ids_by_type
protected

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

◆ $ref_ids

ilObjectListGUIPreloader::$ref_ids
protected

Definition at line 17 of file class.ilObjectListGUIPreloader.php.

Referenced by preload().

◆ $ref_ids_by_type

ilObjectListGUIPreloader::$ref_ids_by_type
protected

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

◆ $types

ilObjectListGUIPreloader::$types
protected

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


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