ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 30 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 46 of file class.ItemPresentationManager.php.

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().

53  {
54  $this->container = $container;
55  $this->domain = $domain;
56  $this->container_user_filter = $container_user_filter;
57  $this->repo_clipboard = $repo_clipboard;
58  $this->mode_manager = $domain->content()->mode($container);
59  $this->include_empty_blocks = $include_empty_blocks;
60  $this->lang = $lang;
61 
62  // sequence from view manager
63  }
+ Here is the call graph for this function:

Member Function Documentation

◆ canManageItems()

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

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

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

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

◆ canOrderItems()

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

Controls the ordering subtab.

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

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

99  : bool
100  {
101  $user = $this->domain->user();
102  $rbacsystem = $this->domain->rbac()->system();
103 
104  if (is_null($this->can_order)) {
105  $this->can_order = false;
106  if ($user->getId() !== ANONYMOUS_USER_ID &&
107  is_object($this->container) &&
108  $rbacsystem->checkAccess("write", $this->container->getRefId())) {
109  $this->can_order = (\ilContainerSortingSettings::_lookupSortMode($this->container->getId()) === \ilContainer::SORT_MANUAL);
110  }
111  }
112  return $this->can_order;
113  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
+ Here is the call graph for this function:

◆ filteredSubtree()

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

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

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

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

164  : bool
165  {
166  return $this->isClassificationFilterActive() && in_array(
167  $this->container->getType(),
168  ["grp", "crs"]
169  );
170  }
+ 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 130 of file class.ItemPresentationManager.php.

References ilContainer\SORT_MANUAL, and ilContainer\VIEW_SESSIONS.

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

130  : bool
131  {
132  // see #43205
133  return ($this->container->getViewMode() === \ilContainer::VIEW_SESSIONS ||
134  $this->container->getOrderType() !== \ilContainer::SORT_MANUAL);
135  }
+ Here is the caller graph for this function:

◆ getAllRefIds()

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

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

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

227  : ?array
228  {
229  $this->init();
230  return $this->item_set->getAllRefIds();
231  }
+ Here is the call graph for this function:

◆ getItemBlockSequence()

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

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

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

209  : ItemBlockSequence
210  {
211  $this->init();
212  return $this->sequence_generator->getSequence();
213  }
+ Here is the call graph for this function:

◆ getPageEmbeddedBlockIds()

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

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

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

215  : array
216  {
217  $this->init();
218  return $this->sequence_generator->getPageEmbeddedBlockIds();
219  }
+ Here is the call graph for this function:

◆ getRawDataByRefId()

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

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

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

221  : ?array
222  {
223  $this->init();
224  return $this->item_set->getRawDataByRefId($ref_id);
225  }
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:

◆ getRefIdsOfType()

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

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

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

233  : array
234  {
235  $this->init();
236  return $this->item_set->getRefIdsOfType($type);
237  }
+ Here is the call graph for this function:

◆ hasItems()

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

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

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

203  : bool
204  {
205  $this->init();
206  return $this->item_set->hasItems();
207  }
+ Here is the call graph for this function:

◆ init()

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

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

References ILIAS\Container\Content\ItemPresentationManager\$include_empty_blocks, ILIAS\Container\Content\ItemPresentationManager\$item_set, ILIAS\Container\Content\ItemPresentationManager\$lang, $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().

172  : void
173  {
174  // already initialised?
175  if (!is_null($this->item_set)) {
176  return;
177  }
178 
179  // get item set
180  $ref_id = $this->container->getRefId();
181  if ($this->filteredSubtree()) {
182  $this->item_set = $this->domain->content()->itemSetTree($ref_id, $this->container_user_filter);
183  } else {
184  $this->item_set = $this->domain->content()->itemSetFlat(
185  $ref_id,
186  $this->container_user_filter,
188  );
189  }
190 
191  // get view
192  $view = $this->domain->content()->view($this->container);
193  // get item block sequence generator
194  $this->sequence_generator = $this->domain->content()->itemBlockSequenceGenerator(
195  $this->container,
196  $view->getBlockSequence(),
200  );
201  }
$ref_id
Definition: ltiauth.php:67
+ 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 118 of file class.ItemPresentationManager.php.

References ilContainer\VIEW_SESSIONS.

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

◆ isClassificationFilterActive()

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

from ilContainer, should be removed there

make proper service in classification component

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

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

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

142  : bool
143  {
144  $ref_id = $this->container->getRefId();
145  // apply container classification filters
146  $classification = $this->domain->classification($ref_id);
148  $this->container->getRefId(),
149  $this->container->getId(),
150  $this->container->getType()
151  ) as $class_provider) {
152  $id = get_class($class_provider);
153  $current = $classification->getSelectionOfProvider($id);
154  if ($current) {
155  return true;
156  }
157  }
158  return false;
159  }
$ref_id
Definition: ltiauth.php:67
$classification
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static getValidProviders(int $a_parent_ref_id, int $a_parent_obj_id, string $a_parent_obj_type)
Get all valid providers (for parent container)
+ 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 43 of file class.ItemPresentationManager.php.

◆ $item_set

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

◆ $lang

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

◆ $mode_manager

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

Definition at line 34 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 38 of file class.ItemPresentationManager.php.

◆ $type_grps

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

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


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