ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilLSViewLayoutProvider Class Reference

Class ilLSViewLayoutProvider. More...

+ Inheritance diagram for ilLSViewLayoutProvider:
+ Collaboration diagram for ilLSViewLayoutProvider:

Public Member Functions

 isInterestedInContexts ()
 
 getMainBarModification (CalledContexts $screen_context_stack)
 
 getMetaBarModification (CalledContexts $screen_context_stack)
 
 getBreadCrumbsModification (CalledContexts $screen_context_stack)
 
 getContentModification (CalledContexts $screen_context_stack)
 
 getPageBuilderDecorator (CalledContexts $screen_context_stack)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider
 __construct (Container $dic)
 
 getContentModification (CalledContexts $screen_context_stack)
 
 getLogoModification (CalledContexts $screen_context_stack)
 
 getResponsiveLogoModification (CalledContexts $screen_context_stack)
 
 getMainBarModification (CalledContexts $screen_context_stack)
 
 getMetaBarModification (CalledContexts $screen_context_stack)
 
 getBreadCrumbsModification (CalledContexts $screen_context_stack)
 
 getFooterModification (CalledContexts $screen_context_stack)
 
 getPageBuilderDecorator (CalledContexts $screen_context_stack)
 
 getTitleModification (CalledContexts $screen_context_stack)
 
 getShortTitleModification (CalledContexts $screen_context_stack)
 
 getViewTitleModification (CalledContexts $screen_context_stack)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (protected Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 

Protected Member Functions

 isKioskModeEnabled (CalledContexts $screen_context_stack)
 
- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 

Protected Attributes

Collection $data_collection = null
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider
ContextCollection $context_collection
 
DataFactory $data
 
ModificationFactory $factory
 

Detailed Description

Member Function Documentation

◆ getBreadCrumbsModification()

ilLSViewLayoutProvider::getBreadCrumbsModification ( CalledContexts  $screen_context_stack)
Parameters
CalledContexts$screen_context_stack
Returns
BreadCrumbsModification|null

Implements ILIAS\GlobalScreen\Scope\Layout\Provider\ModificationProvider.

Definition at line 103 of file class.ilLSViewLayoutProvider.php.

References ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), isKioskModeEnabled(), and null.

104  {
105  if (!$this->isKioskModeEnabled($screen_context_stack)) {
106  return null;
107  }
108 
109  return $this->globalScreen()->layout()->factory()->breadcrumbs()
110  ->withModification(
111  fn(?Breadcrumbs $current): ?Breadcrumbs => null
112  )
113  ->withHighPriority();
114  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isKioskModeEnabled(CalledContexts $screen_context_stack)
+ Here is the call graph for this function:

◆ getContentModification()

ilLSViewLayoutProvider::getContentModification ( CalledContexts  $screen_context_stack)
Parameters
CalledContexts$screen_context_stack
Returns
ContentModification

Implements ILIAS\GlobalScreen\Scope\Layout\Provider\ModificationProvider.

Definition at line 116 of file class.ilLSViewLayoutProvider.php.

References ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), ilLSPlayer\GS_DATA_LS_CONTENT, isKioskModeEnabled(), and null.

117  {
118  if (!$this->isKioskModeEnabled($screen_context_stack)) {
119  return null;
120  }
121  $html = $this->data_collection->get(ilLSPlayer::GS_DATA_LS_CONTENT);
122  // TODO: Once we have more control over the content, we could just setContent
123  // in ilObjLearningSequenceLearnerGUI like any other object and later strip
124  // away the header here.
125  return $this->globalScreen()->layout()->factory()->content()
126  ->withModification(
127  function (?Content $content) use ($html): ?Content {
128  $ui = $this->dic->ui();
129  return $ui->factory()->legacy()->content($html);
130  }
131  )
132  ->withHighPriority();
133  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isKioskModeEnabled(CalledContexts $screen_context_stack)
const GS_DATA_LS_CONTENT
+ Here is the call graph for this function:

◆ getMainBarModification()

ilLSViewLayoutProvider::getMainBarModification ( CalledContexts  $screen_context_stack)
Parameters
CalledContexts$screen_context_stack
Returns
MainBarModification|null

Implements ILIAS\GlobalScreen\Scope\Layout\Provider\ModificationProvider.

Definition at line 63 of file class.ilLSViewLayoutProvider.php.

References ILIAS\UI\Component\MainControls\MainBar\getToolEntries(), ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), ilLSPlayer\GS_DATA_LS_MAINBARCONTROLS, isKioskModeEnabled(), null, ILIAS\UI\Component\MainControls\MainBar\withAdditionalEntry(), ILIAS\UI\Component\MainControls\MainBar\withAdditionalToolEntry(), and ILIAS\UI\Component\MainControls\MainBar\withClearedEntries().

64  {
65  if (!$this->isKioskModeEnabled($screen_context_stack)) {
66  return null;
67  }
68  return $this->globalScreen()->layout()->factory()->mainbar()
69  ->withModification(
70  function (?MainBar $mainbar): ?MainBar {
71  if ($mainbar === null) {
72  $ui = $this->dic->ui();
73  $mainbar = $ui->factory()->mainControls()->mainbar();
74  }
75  $entries = $this->data_collection->get(ilLSPlayer::GS_DATA_LS_MAINBARCONTROLS);
76  $tools = $mainbar->getToolEntries();
77  $mainbar = $mainbar->withClearedEntries();
78 
79  foreach ($entries as $key => $entry) {
80  $mainbar = $mainbar->withAdditionalEntry($key, $entry);
81  }
82  foreach ($tools as $key => $entry) {
83  $mainbar = $mainbar->withAdditionalToolEntry($key, $entry);
84  }
85  return $mainbar;
86  }
87  )
88  ->withHighPriority();
89  }
This describes the MainBar.
Definition: MainBar.php:33
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isKioskModeEnabled(CalledContexts $screen_context_stack)
withClearedEntries()
Get a copy of this MainBar without any entries.
withAdditionalEntry(string $id, $entry)
Append an entry.
const GS_DATA_LS_MAINBARCONTROLS
withAdditionalToolEntry(string $id, Slate\Slate $entry, bool $initially_hidden=false, ?Button\Close $close_button=null)
Append a tool-entry.
+ Here is the call graph for this function:

◆ getMetaBarModification()

ilLSViewLayoutProvider::getMetaBarModification ( CalledContexts  $screen_context_stack)
Parameters
CalledContexts$screen_context_stack
Returns
MetaBarModification|null

Implements ILIAS\GlobalScreen\Scope\Layout\Provider\ModificationProvider.

Definition at line 91 of file class.ilLSViewLayoutProvider.php.

References ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), isKioskModeEnabled(), null, and ILIAS\UI\Component\MainControls\MetaBar\withClearedEntries().

92  {
93  if (!$this->isKioskModeEnabled($screen_context_stack)) {
94  return null;
95  }
96  return $this->globalScreen()->layout()->factory()->metabar()
97  ->withModification(
98  fn(?MetaBar $metabar): ?Metabar => $metabar !== null ? $metabar->withClearedEntries() : null
99  )
100  ->withHighPriority();
101  }
withClearedEntries()
Get a copy of this MetaBar without any entries.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isKioskModeEnabled(CalledContexts $screen_context_stack)
This describes the MetaBar.
Definition: MetaBar.php:32
+ Here is the call graph for this function:

◆ getPageBuilderDecorator()

ilLSViewLayoutProvider::getPageBuilderDecorator ( CalledContexts  $screen_context_stack)
Parameters
CalledContexts$screen_context_stack
Returns
PageBuilderModification|null

PhpIncompatibleReturnTypeInspection

Implements ILIAS\GlobalScreen\Scope\Layout\Provider\ModificationProvider.

Definition at line 135 of file class.ilLSViewLayoutProvider.php.

References Vendor\Package\$f, $parts, factory(), ilLSPlayer\GS_DATA_LS_METABARCONTROLS, isKioskModeEnabled(), and null.

136  {
137  if (!$this->isKioskModeEnabled($screen_context_stack)) {
138  return null;
139  }
140 
141  $exit = $this->data_collection->get(\ilLSPlayer::GS_DATA_LS_METABARCONTROLS)['exit'];
142  $label = $this->dic['lng']->txt('lso_player_viewmodelabel');
143 
144  $lnk = new URI($exit->getAction());
145 
147  return $this->factory->page()->withModification(
148  function (PagePartProvider $parts) use ($label, $lnk): Page {
149  $p = new StandardPageBuilder();
150  $f = $this->dic['ui.factory'];
151  $page = $p->build($parts);
152  $modeinfo = $f->mainControls()->modeInfo($label, $lnk);
153  return $page->withModeInfo($modeinfo);
154  }
155  )->withHighPriority();
156  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
factory()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isKioskModeEnabled(CalledContexts $screen_context_stack)
This describes the Page.
Definition: Page.php:30
const GS_DATA_LS_METABARCONTROLS
+ Here is the call graph for this function:

◆ isInterestedInContexts()

ilLSViewLayoutProvider::isInterestedInContexts ( )

◆ isKioskModeEnabled()

ilLSViewLayoutProvider::isKioskModeEnabled ( CalledContexts  $screen_context_stack)
protected

Definition at line 57 of file class.ilLSViewLayoutProvider.php.

References ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), and ilLSPlayer\GS_DATA_LS_KIOSK_MODE.

Referenced by getBreadCrumbsModification(), getContentModification(), getMainBarModification(), getMetaBarModification(), and getPageBuilderDecorator().

57  : bool
58  {
59  $this->data_collection = $screen_context_stack->current()->getAdditionalData();
60  return $this->data_collection->is(ilLSPlayer::GS_DATA_LS_KIOSK_MODE, true);
61  }
const GS_DATA_LS_KIOSK_MODE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $data_collection

Collection ilLSViewLayoutProvider::$data_collection = null
protected

Definition at line 47 of file class.ilLSViewLayoutProvider.php.


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