ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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

 $obj_definition
 
 $tree
 
 $obj_data_cache
 
 $user
 
 $rbacsystem
 
 $context
 
 $obj_ids
 
 $obj_ids_by_type
 
 $ref_ids
 
 $ref_ids_by_type
 
 $types
 
 $fav_manager
 

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 51 of file class.ilObjectListGUIPreloader.php.

52 {
53 global $DIC;
54
55 $this->obj_definition = $DIC["objDefinition"];
56 $this->tree = $DIC->repositoryTree();
57 $this->obj_data_cache = $DIC["ilObjDataCache"];
58 $this->user = $DIC->user();
59 $this->rbacsystem = $DIC->rbac()->system();
60 $this->context = $a_context;
61 $this->fav_manager = new ilFavouritesManager();
62 }
user()
Definition: user.php:4
Manages favourites, currently the interface for other components, needs discussion.
$DIC
Definition: xapitoken.php:46

References $DIC, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addItem()

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

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

65 {
66 $this->obj_ids[] = $a_obj_id;
67 $this->obj_ids_by_type[$a_type][] = $a_obj_id;
68 $this->types[] = $a_type;
69
70 if ($a_ref_id) {
71 $this->ref_ids[] = $a_ref_id;
72 $this->ref_ids_by_type[$a_type][] = $a_ref_id;
73 }
74 }
$a_type
Definition: workflow.php:92

References $a_type.

◆ preload()

ilObjectListGUIPreloader::preload ( )

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

77 {
78 $objDefinition = $this->obj_definition;
80 $ilObjDataCache = $this->obj_data_cache;
83
84 if (!$this->obj_ids) {
85 return;
86 }
87
88 $this->obj_ids = array_unique($this->obj_ids);
89 $this->types = array_unique($this->types);
90 if ($this->ref_ids) {
91 $this->ref_ids = array_unique($this->ref_ids);
92 }
93
94 // type specific preloads
95 include_once("./Services/Conditions/classes/class.ilConditionHandler.php");
96 foreach ($this->types as $type) {
97 $this->obj_ids_by_type[$type] = array_unique($this->obj_ids_by_type[$type]);
98
99 if (is_array($this->ref_ids_by_type[$type])) {
100 $this->ref_ids_by_type[$type] = array_unique($this->ref_ids_by_type[$type]);
101 }
102
103 if ($this->context == ilObjectListGUI::CONTEXT_REPOSITORY ||
105 $this->context == ilObjectListGUI::CONTEXT_SEARCH) {
107 $type,
108 $this->obj_ids_by_type[$type]
109 );
110 }
111
112 $class = $objDefinition->getClassName($type);
113 $location = $objDefinition->getLocation($type);
114 if ($class && $location) { // #12775
115 $full_class = "ilObj" . $class . "Access";
116 include_once($location . "/class." . $full_class . ".php");
117 if (class_exists($full_class)) {
118 call_user_func(
119 array($full_class, "_preloadData"),
120 $this->obj_ids_by_type[$type],
121 $this->ref_ids_by_type[$type]
122 );
123 }
124 }
125 }
126
127 if ($this->ref_ids) {
128 $tree->preloadDeleted($this->ref_ids);
129 $tree->preloadDepthParent($this->ref_ids);
130 $ilObjDataCache->preloadReferenceCache($this->ref_ids, false);
131 $rbacsystem->preloadRbacPaCache($this->ref_ids, $ilUser->getId());
132
133 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
135 $this->fav_manager->loadData($ilUser->getId(), $this->ref_ids);
136 }
137
138 include_once("./Services/Object/classes/class.ilObjectActivation.php");
139 ilObjectActivation::preloadData($this->ref_ids);
140 }
141
142 include_once("./Services/Object/classes/class.ilObjectListGUI.php");
143 ilObjectListGUI::preloadCommonProperties($this->obj_ids, $this->context);
144
145 if ($this->context == ilObjectListGUI::CONTEXT_REPOSITORY) {
146 include_once("./Services/Rating/classes/class.ilRating.php");
147 include_once("./Services/Rating/classes/class.ilRatingGUI.php");
148 ilRating::preloadListGUIData($this->obj_ids);
149
150 include_once("./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php");
152 }
153
154 if ($this->context == ilObjectListGUI::CONTEXT_REPOSITORY ||
156 $this->context == ilObjectListGUI::CONTEXT_SEARCH) {
157 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
158 ilLPStatus::preloadListGUIData($this->obj_ids);
159 }
160 }
$location
Definition: buildRTE.php:44
static preloadByObjIds(array $a_obj_ids)
Preload list gui data.
static preloadPersistedConditionsForTargetRecords($a_type, $a_obj_ids)
Preload conditions for target records.
static preloadListGUIData($a_obj_ids)
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.
$type
$ilUser
Definition: imgupload.php:18

References $ilUser, $location, $obj_data_cache, $obj_definition, $rbacsystem, $tree, $type, $user, ilObjectListGUI\CONTEXT_PERSONAL_DESKTOP, ilObjectListGUI\CONTEXT_REPOSITORY, ilObjectListGUI\CONTEXT_SEARCH, ilAdvancedMDValues\preloadByObjIds(), ilObjectListGUI\preloadCommonProperties(), ilObjectActivation\preloadData(), ilLPStatus\preloadListGUIData(), ilRating\preloadListGUIData(), and ilConditionHandler\preloadPersistedConditionsForTargetRecords().

+ Here is the call graph for this function:

Field Documentation

◆ $context

ilObjectListGUIPreloader::$context
protected

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

◆ $fav_manager

ilObjectListGUIPreloader::$fav_manager
protected

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

◆ $obj_data_cache

ilObjectListGUIPreloader::$obj_data_cache
protected

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

Referenced by preload().

◆ $obj_definition

ilObjectListGUIPreloader::$obj_definition
protected

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

Referenced by preload().

◆ $obj_ids

ilObjectListGUIPreloader::$obj_ids
protected

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

◆ $obj_ids_by_type

ilObjectListGUIPreloader::$obj_ids_by_type
protected

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

◆ $rbacsystem

ilObjectListGUIPreloader::$rbacsystem
protected

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

Referenced by preload().

◆ $ref_ids

ilObjectListGUIPreloader::$ref_ids
protected

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

◆ $ref_ids_by_type

ilObjectListGUIPreloader::$ref_ids_by_type
protected

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

◆ $tree

ilObjectListGUIPreloader::$tree
protected

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

Referenced by preload().

◆ $types

ilObjectListGUIPreloader::$types
protected

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

◆ $user

ilObjectListGUIPreloader::$user
protected

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

Referenced by preload().


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