ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
 

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

47 {
48 global $DIC;
49
50 $this->obj_definition = $DIC["objDefinition"];
51 $this->tree = $DIC->repositoryTree();
52 $this->obj_data_cache = $DIC["ilObjDataCache"];
53 $this->user = $DIC->user();
54 $this->rbacsystem = $DIC->rbac()->system();
55 $this->context = $a_context;
56 }
user()
Definition: user.php:4
global $DIC
Definition: saml.php:7

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

59 {
60 $this->obj_ids[] = $a_obj_id;
61 $this->obj_ids_by_type[$a_type][] = $a_obj_id;
62 $this->types[] = $a_type;
63
64 if ($a_ref_id) {
65 $this->ref_ids[] = $a_ref_id;
66 $this->ref_ids_by_type[$a_type][] = $a_ref_id;
67 }
68 }
$a_type
Definition: workflow.php:92

References $a_type.

◆ preload()

ilObjectListGUIPreloader::preload ( )

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

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