ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Container\Content\ItemPresentationManager Class Reference

High level business logic class. More...

+ Collaboration diagram for ILIAS\Container\Content\ItemPresentationManager:

Public Member Functions

 __construct (InternalDomainService $domain, \ilContainer $container, ?\ilContainerUserFilter $container_user_filter, ClipboardManager $repo_clipboard, bool $include_empty_blocks=true, ?string $lang=null)
 
 canManageItems ()
 
 canOrderItems ()
 Controls the ordering subtab. More...
 
 isActiveItemOrdering (string $type)
 Are we currently in ordering view and the items can be ordered? More...
 
 forceSessionOrderingByDate ()
 
 filteredSubtree ()
 
 hasItems ()
 
 getItemBlockSequence ()
 
 getPageEmbeddedBlockIds ()
 
 getRawDataByRefId (int $ref_id)
 
 getAllRefIds ()
 
 getRefIdsOfType (string $type)
 

Protected Member Functions

 isClassificationFilterActive ()
 
 init ()
 

Protected Attributes

string $lang = null
 
bool $include_empty_blocks
 
ModeManager $mode_manager
 
bool $can_order = null
 
ClipboardManager $repo_clipboard
 
bool $can_manage = null
 
ItemBlock ItemBlockSequenceGenerator $sequence_generator
 
ilContainerUserFilter $container_user_filter = null
 
array $type_grps = null
 
ItemSetManager $item_set = null
 
ilContainer $container
 
ItemSessionRepository $item_repo
 
InternalDomainService $domain
 

Detailed Description

High level business logic class.

Orchestrates item set, view and block sequence generator.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 33 of file class.ItemPresentationManager.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Container\Content\ItemPresentationManager::__construct ( InternalDomainService  $domain,
\ilContainer  $container,
?\ilContainerUserFilter  $container_user_filter,
ClipboardManager  $repo_clipboard,
bool  $include_empty_blocks = true,
?string  $lang = null 
)

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

56 {
57 $this->container = $container;
58 $this->domain = $domain;
59 $this->container_user_filter = $container_user_filter;
60 $this->repo_clipboard = $repo_clipboard;
61 $this->mode_manager = $domain->content()->mode($container);
62 $this->include_empty_blocks = $include_empty_blocks;
63 $this->lang = $lang;
64
65 // sequence from view manager
66 }

References ILIAS\Container\Content\ItemPresentationManager\$container, ILIAS\Container\Content\ItemPresentationManager\$container_user_filter, ILIAS\Container\Content\ItemPresentationManager\$domain, ILIAS\Container\Content\ItemPresentationManager\$include_empty_blocks, ILIAS\Container\Content\ItemPresentationManager\$lang, ILIAS\Container\Content\ItemPresentationManager\$repo_clipboard, and ILIAS\Container\InternalDomainService\content().

+ Here is the call graph for this function:

Member Function Documentation

◆ canManageItems()

ILIAS\Container\Content\ItemPresentationManager::canManageItems ( )

Definition at line 68 of file class.ItemPresentationManager.php.

68 : bool
69 {
70 if (!is_null($this->can_manage)) {
71 return $this->can_manage;
72 }
73 $user = $this->domain->user();
74 $rbacsystem = $this->domain->rbac()->system();
75 if ($user->getId() === ANONYMOUS_USER_ID || !is_object($this->container)) {
76 return false;
77 }
78
79 if ($rbacsystem->checkAccess("write", $this->container->getRefId()) ||
80 $this->container->getHiddenFilesFound() ||
81 $this->repo_clipboard->hasEntries()) {
82 $this->can_manage = true;
83 return true;
84 }
85 $this->init();
86 $this->can_manage = false;
87 /* this is time consuming and probably not necessary
88 foreach ($this->item_set->getAllRefIds() as $ref_id) {
89 if ($this->can_manage === true) {
90 break;
91 }
92 if ($rbacsystem->checkAccess("delete", $ref_id)) {
93 $this->can_manage = true;
94 }
95 }*/
96 return $this->can_manage;
97 }
const ANONYMOUS_USER_ID
Definition: constants.php:27

References ILIAS\Container\Content\ItemPresentationManager\$can_manage, ANONYMOUS_USER_ID, and ILIAS\Container\Content\ItemPresentationManager\init().

+ Here is the call graph for this function:

◆ canOrderItems()

ILIAS\Container\Content\ItemPresentationManager::canOrderItems ( )

Controls the ordering subtab.

Definition at line 102 of file class.ItemPresentationManager.php.

102 : bool
103 {
104 $user = $this->domain->user();
105 $rbacsystem = $this->domain->rbac()->system();
106
107 if (is_null($this->can_order)) {
108 $this->can_order = false;
109 if ($user->getId() !== ANONYMOUS_USER_ID &&
110 is_object($this->container) &&
111 $rbacsystem->checkAccess("write", $this->container->getRefId())) {
112 $this->can_order = (\ilContainerSortingSettings::_lookupSortMode($this->container->getId()) === \ilContainer::SORT_MANUAL);
113 }
114 }
115 return $this->can_order;
116 }

References ILIAS\Container\Content\ItemPresentationManager\$can_order, ilContainerSortingSettings\_lookupSortMode(), ANONYMOUS_USER_ID, and ilContainer\SORT_MANUAL.

+ Here is the call graph for this function:

◆ filteredSubtree()

ILIAS\Container\Content\ItemPresentationManager::filteredSubtree ( )
Todo:
from ilContainer, should be removed there

Definition at line 167 of file class.ItemPresentationManager.php.

167 : bool
168 {
169 return $this->isClassificationFilterActive() && in_array(
170 $this->container->getType(),
171 ["grp", "crs"]
172 );
173 }

References ILIAS\Container\Content\ItemPresentationManager\isClassificationFilterActive().

Referenced by ILIAS\Container\Content\ItemPresentationManager\init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forceSessionOrderingByDate()

ILIAS\Container\Content\ItemPresentationManager::forceSessionOrderingByDate ( )

Definition at line 133 of file class.ItemPresentationManager.php.

133 : bool
134 {
135 // see #43205
136 return ($this->container->getViewMode() === \ilContainer::VIEW_SESSIONS ||
137 $this->container->getOrderType() !== \ilContainer::SORT_MANUAL);
138 }

References ilContainer\SORT_MANUAL, and ilContainer\VIEW_SESSIONS.

Referenced by ILIAS\Container\Content\ItemPresentationManager\init().

+ Here is the caller graph for this function:

◆ getAllRefIds()

ILIAS\Container\Content\ItemPresentationManager::getAllRefIds ( )

Definition at line 231 of file class.ItemPresentationManager.php.

231 : ?array
232 {
233 $this->init();
234 return $this->item_set->getAllRefIds();
235 }

References ILIAS\Container\Content\ItemPresentationManager\init().

+ Here is the call graph for this function:

◆ getItemBlockSequence()

ILIAS\Container\Content\ItemPresentationManager::getItemBlockSequence ( )

Definition at line 213 of file class.ItemPresentationManager.php.

213 : ItemBlockSequence
214 {
215 $this->init();
216 return $this->sequence_generator->getSequence();
217 }

References ILIAS\Container\Content\ItemPresentationManager\init().

+ Here is the call graph for this function:

◆ getPageEmbeddedBlockIds()

ILIAS\Container\Content\ItemPresentationManager::getPageEmbeddedBlockIds ( )

Definition at line 219 of file class.ItemPresentationManager.php.

219 : array
220 {
221 $this->init();
222 return $this->sequence_generator->getPageEmbeddedBlockIds();
223 }

References ILIAS\Container\Content\ItemPresentationManager\init().

+ Here is the call graph for this function:

◆ getRawDataByRefId()

ILIAS\Container\Content\ItemPresentationManager::getRawDataByRefId ( int  $ref_id)

Definition at line 225 of file class.ItemPresentationManager.php.

225 : ?array
226 {
227 $this->init();
228 return $this->item_set->getRawDataByRefId($ref_id);
229 }
$ref_id
Definition: ltiauth.php:66

References $ref_id, and ILIAS\Container\Content\ItemPresentationManager\init().

+ Here is the call graph for this function:

◆ getRefIdsOfType()

ILIAS\Container\Content\ItemPresentationManager::getRefIdsOfType ( string  $type)

Definition at line 237 of file class.ItemPresentationManager.php.

237 : array
238 {
239 $this->init();
240 return $this->item_set->getRefIdsOfType($type);
241 }

References ILIAS\Container\Content\ItemPresentationManager\init().

+ Here is the call graph for this function:

◆ hasItems()

ILIAS\Container\Content\ItemPresentationManager::hasItems ( )

Definition at line 207 of file class.ItemPresentationManager.php.

207 : bool
208 {
209 $this->init();
210 return $this->item_set->hasItems();
211 }

References ILIAS\Container\Content\ItemPresentationManager\init().

+ Here is the call graph for this function:

◆ init()

ILIAS\Container\Content\ItemPresentationManager::init ( )
protected

Definition at line 175 of file class.ItemPresentationManager.php.

175 : void
176 {
177 // already initialised?
178 if (!is_null($this->item_set)) {
179 return;
180 }
181
182 // get view
183 $view = $this->domain->content()->view($this->container);
184 // get item set
185 $ref_id = $this->container->getRefId();
186 if ($this->filteredSubtree()) {
187 $this->item_set = $this->domain->content()->itemSetTree($ref_id, $this->container_user_filter);
188 } else {
189 $this->item_set = $this->domain->content()->itemSetFlat(
190 $ref_id,
191 $this->container_user_filter,
193 $view instanceof ObjectiveViewManager
194 );
195 }
196
197 // get item block sequence generator
198 $this->sequence_generator = $this->domain->content()->itemBlockSequenceGenerator(
199 $this->container,
200 $view->getBlockSequence(),
201 $this->item_set,
202 $this->include_empty_blocks,
203 $this->lang
204 );
205 }

References $ref_id, ILIAS\Container\Content\ItemPresentationManager\filteredSubtree(), and ILIAS\Container\Content\ItemPresentationManager\forceSessionOrderingByDate().

Referenced by ILIAS\Container\Content\ItemPresentationManager\canManageItems(), ILIAS\Container\Content\ItemPresentationManager\getAllRefIds(), ILIAS\Container\Content\ItemPresentationManager\getItemBlockSequence(), ILIAS\Container\Content\ItemPresentationManager\getPageEmbeddedBlockIds(), ILIAS\Container\Content\ItemPresentationManager\getRawDataByRefId(), ILIAS\Container\Content\ItemPresentationManager\getRefIdsOfType(), and ILIAS\Container\Content\ItemPresentationManager\hasItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActiveItemOrdering()

ILIAS\Container\Content\ItemPresentationManager::isActiveItemOrdering ( string  $type)

Are we currently in ordering view and the items can be ordered?

Definition at line 121 of file class.ItemPresentationManager.php.

121 : bool
122 {
123 // see #43205
124 if ($this->mode_manager->isActiveItemOrdering()) {
125 if ($type === "sess" && $this->container->getViewMode() === \ilContainer::VIEW_SESSIONS) {
126 return false;
127 }
128 return true;
129 }
130 return false;
131 }

References ilContainer\VIEW_SESSIONS.

◆ isClassificationFilterActive()

ILIAS\Container\Content\ItemPresentationManager::isClassificationFilterActive ( )
protected
Todo:

from ilContainer, should be removed there

make proper service in classification component

Definition at line 145 of file class.ItemPresentationManager.php.

145 : bool
146 {
147 $ref_id = $this->container->getRefId();
148 // apply container classification filters
149 $classification = $this->domain->classification($ref_id);
151 $this->container->getRefId(),
152 $this->container->getId(),
153 $this->container->getType()
154 ) as $class_provider) {
155 $id = get_class($class_provider);
156 $current = $classification->getSelectionOfProvider($id);
157 if ($current) {
158 return true;
159 }
160 }
161 return false;
162 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$classification
static getValidProviders(int $a_parent_ref_id, int $a_parent_obj_id, string $a_parent_obj_type)
Get all valid providers (for parent container)

References $classification, $id, $ref_id, and ilClassificationProvider\getValidProviders().

Referenced by ILIAS\Container\Content\ItemPresentationManager\filteredSubtree().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $can_manage

bool ILIAS\Container\Content\ItemPresentationManager::$can_manage = null
protected

◆ $can_order

bool ILIAS\Container\Content\ItemPresentationManager::$can_order = null
protected

◆ $container

ilContainer ILIAS\Container\Content\ItemPresentationManager::$container
protected

◆ $container_user_filter

ilContainerUserFilter ILIAS\Container\Content\ItemPresentationManager::$container_user_filter = null
protected

◆ $domain

InternalDomainService ILIAS\Container\Content\ItemPresentationManager::$domain
protected

◆ $include_empty_blocks

bool ILIAS\Container\Content\ItemPresentationManager::$include_empty_blocks
protected

◆ $item_repo

ItemSessionRepository ILIAS\Container\Content\ItemPresentationManager::$item_repo
protected

Definition at line 46 of file class.ItemPresentationManager.php.

◆ $item_set

ItemSetManager ILIAS\Container\Content\ItemPresentationManager::$item_set = null
protected

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

◆ $lang

string ILIAS\Container\Content\ItemPresentationManager::$lang = null
protected

◆ $mode_manager

ModeManager ILIAS\Container\Content\ItemPresentationManager::$mode_manager
protected

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

◆ $repo_clipboard

ClipboardManager ILIAS\Container\Content\ItemPresentationManager::$repo_clipboard
protected

◆ $sequence_generator

ItemBlock ItemBlockSequenceGenerator ILIAS\Container\Content\ItemPresentationManager::$sequence_generator
protected

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

◆ $type_grps

array ILIAS\Container\Content\ItemPresentationManager::$type_grps = null
protected

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


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