ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

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 }

◆ preload()

ilObjectListGUIPreloader::preload ( )

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

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 {
98 ilObjUser::preloadIsDesktopItem($ilUser->getId(), $this->ref_ids);
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");
116 }
117
118 if($this->context == ilObjectListGUI::CONTEXT_REPOSITORY ||
120 $this->context == ilObjectListGUI::CONTEXT_SEARCH)
121 {
122 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
123 ilLPStatus::preloadListGUIData($this->obj_ids);
124 }
125 }
$location
Definition: buildRTE.php:44
static preloadByObjIds(array $a_obj_ids)
Preload list gui data.
preloadConditionsForTargetRecords($a_type, $a_obj_ids)
Preload conditions for target records.
static preloadListGUIData($a_obj_ids)
static preloadIsDesktopItem($a_usr_id, $a_item_ids)
Preload desktop item information.
static preloadData(array $a_ref_ids)
Preload data to internal cache.
static preloadCommonProperties($a_obj_ids, $a_context)
Preload common properties.
static preloadListGUIData(array $a_obj_ids)
Preload rating data for list guis.
global $ilUser
Definition: imgupload.php:15

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

+ 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.

◆ $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: