ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\UI\Component\Legacy\Content\ItemPresentationManager Class Reference

High level business logic class. More...

+ Collaboration diagram for ILIAS\UI\Component\Legacy\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\UI\Component\Legacy\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.

References ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\$container, ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\$container_user_filter, ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\$domain, ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\$include_empty_blocks, ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\$lang, and ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\$repo_clipboard.

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  }

Member Function Documentation

◆ canManageItems()

ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::canManageItems ( )

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

References ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\$can_manage, ANONYMOUS_USER_ID, and ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\init().

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
+ Here is the call graph for this function:

◆ canOrderItems()

ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::canOrderItems ( )

Controls the ordering subtab.

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

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

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  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
+ Here is the call graph for this function:

◆ filteredSubtree()

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

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

References ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\isClassificationFilterActive().

Referenced by ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\init().

167  : bool
168  {
169  return $this->isClassificationFilterActive() && in_array(
170  $this->container->getType(),
171  ["grp", "crs"]
172  );
173  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forceSessionOrderingByDate()

ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::forceSessionOrderingByDate ( )

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

References ilContainer\SORT_MANUAL, and ilContainer\VIEW_SESSIONS.

Referenced by ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\init().

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

◆ getAllRefIds()

ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::getAllRefIds ( )

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

References ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\init().

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

◆ getItemBlockSequence()

ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::getItemBlockSequence ( )

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

References ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\init().

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

◆ getPageEmbeddedBlockIds()

ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::getPageEmbeddedBlockIds ( )

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

References ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\init().

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

◆ getRawDataByRefId()

ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::getRawDataByRefId ( int  $ref_id)

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

References ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\init().

224  : ?array
225  {
226  $this->init();
227  return $this->item_set->getRawDataByRefId($ref_id);
228  }
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:

◆ getRefIdsOfType()

ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::getRefIdsOfType ( string  $type)

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

References ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\init().

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

◆ hasItems()

ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::hasItems ( )

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

References ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\init().

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

◆ init()

ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::init ( )
protected

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

References ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\$include_empty_blocks, ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\$item_set, ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\$lang, $ref_id, ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\filteredSubtree(), and ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\forceSessionOrderingByDate().

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

175  : void
176  {
177  // already initialised?
178  if (!is_null($this->item_set)) {
179  return;
180  }
181 
182  // get item set
183  $ref_id = $this->container->getRefId();
184  if ($this->filteredSubtree()) {
185  $this->item_set = $this->domain->content()->itemSetTree($ref_id, $this->container_user_filter);
186  } else {
187  $this->item_set = $this->domain->content()->itemSetFlat(
188  $ref_id,
189  $this->container_user_filter,
191  );
192  }
193 
194  // get view
195  $view = $this->domain->content()->view($this->container);
196  // get item block sequence generator
197  $this->sequence_generator = $this->domain->content()->itemBlockSequenceGenerator(
198  $this->container,
199  $view->getBlockSequence(),
203  );
204  }
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActiveItemOrdering()

ILIAS\UI\Component\Legacy\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.

References ilContainer\VIEW_SESSIONS.

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  }

◆ isClassificationFilterActive()

ILIAS\UI\Component\Legacy\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.

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

Referenced by ILIAS\UI\Component\Legacy\Content\ItemPresentationManager\filteredSubtree().

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  }
$ref_id
Definition: ltiauth.php:65
$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\UI\Component\Legacy\Content\ItemPresentationManager::$can_manage = null
protected

◆ $can_order

bool ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::$can_order = null
protected

◆ $container

ilContainer ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::$container
protected

◆ $container_user_filter

ilContainerUserFilter ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::$container_user_filter = null
protected

◆ $domain

InternalDomainService ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::$domain
protected

◆ $include_empty_blocks

bool ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::$include_empty_blocks
protected

◆ $item_repo

ItemSessionRepository ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::$item_repo
protected

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

◆ $item_set

ItemSetManager ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::$item_set = null
protected

◆ $lang

string ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::$lang = null
protected

◆ $mode_manager

ModeManager ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::$mode_manager
protected

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

◆ $repo_clipboard

ClipboardManager ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::$repo_clipboard
protected

◆ $sequence_generator

ItemBlock ItemBlockSequenceGenerator ILIAS\UI\Component\Legacy\Content\ItemPresentationManager::$sequence_generator
protected

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

◆ $type_grps

array ILIAS\UI\Component\Legacy\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: