ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 (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
 
ILIAS GlobalScreen Scope Layout Factory ModificationFactory $factory
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
Container $dic
 

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 104 of file class.ilLSViewLayoutProvider.php.

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

105  {
106  if (!$this->isKioskModeEnabled($screen_context_stack)) {
107  return null;
108  }
109 
110  return $this->globalScreen()->layout()->factory()->breadcrumbs()
111  ->withModification(
112  fn (?Breadcrumbs $current): ?Breadcrumbs => null
113  )
114  ->withHighPriority();
115  }
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 117 of file class.ilLSViewLayoutProvider.php.

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

118  {
119  if (!$this->isKioskModeEnabled($screen_context_stack)) {
120  return null;
121  }
122  $html = $this->data_collection->get(ilLSPlayer::GS_DATA_LS_CONTENT);
123  // TODO: Once we have more control over the content, we could just setContent
124  // in ilObjLearningSequenceLearnerGUI like any other object and later strip
125  // away the header here.
126  return $this->globalScreen()->layout()->factory()->content()
127  ->withModification(
128  function (?Legacy $content) use ($html): ?Legacy {
129  $ui = $this->dic->ui();
130  return $ui->factory()->legacy($html);
131  }
132  )
133  ->withHighPriority();
134  }
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 64 of file class.ilLSViewLayoutProvider.php.

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

65  {
66  if (!$this->isKioskModeEnabled($screen_context_stack)) {
67  return null;
68  }
69  return $this->globalScreen()->layout()->factory()->mainbar()
70  ->withModification(
71  function (?MainBar $mainbar): ?MainBar {
72  if ($mainbar === null) {
73  $ui = $this->dic->ui();
74  $mainbar = $ui->factory()->mainControls()->mainbar();
75  }
76  $entries = $this->data_collection->get(ilLSPlayer::GS_DATA_LS_MAINBARCONTROLS);
77  $tools = $mainbar->getToolEntries();
78  $mainbar = $mainbar->withClearedEntries();
79 
80  foreach ($entries as $key => $entry) {
81  $mainbar = $mainbar->withAdditionalEntry($key, $entry);
82  }
83  foreach ($tools as $key => $entry) {
84  $mainbar = $mainbar->withAdditionalToolEntry($key, $entry);
85  }
86  return $mainbar;
87  }
88  )
89  ->withHighPriority();
90  }
withAdditionalToolEntry(string $id, Slate\Slate $entry, bool $initially_hidden=false, Button\Close $close_button=null)
Append a tool-entry.
This describes the MainBar.
Definition: MainBar.php:33
isKioskModeEnabled(CalledContexts $screen_context_stack)
withClearedEntries()
Get a copy of this MainBar without any entries.
string $key
Consumer key/client ID value.
Definition: System.php:193
withAdditionalEntry(string $id, $entry)
Append an entry.
const GS_DATA_LS_MAINBARCONTROLS
+ 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 92 of file class.ilLSViewLayoutProvider.php.

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

93  {
94  if (!$this->isKioskModeEnabled($screen_context_stack)) {
95  return null;
96  }
97  return $this->globalScreen()->layout()->factory()->metabar()
98  ->withModification(
99  fn (?MetaBar $metabar): ?Metabar => $metabar !== null ? $metabar->withClearedEntries() : null
100  )
101  ->withHighPriority();
102  }
withClearedEntries()
Get a copy of this MetaBar without any entries.
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 136 of file class.ilLSViewLayoutProvider.php.

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

137  {
138  if (!$this->isKioskModeEnabled($screen_context_stack)) {
139  return null;
140  }
141 
142  $exit = $this->data_collection->get(\ilLSPlayer::GS_DATA_LS_METABARCONTROLS)['exit'];
143  $label = $this->dic['lng']->txt('lso_player_viewmodelabel');
144 
145  $lnk = new URI($exit->getAction());
146 
148  return $this->factory->page()->withModification(
149  function (PagePartProvider $parts) use ($label, $lnk): Page {
150  $p = new StandardPageBuilder();
151  $f = $this->dic['ui.factory'];
152  $page = $p->build($parts);
153  $modeinfo = $f->mainControls()->modeInfo($label, $lnk);
154  return $page->withModeInfo($modeinfo);
155  }
156  )->withHighPriority();
157  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
isKioskModeEnabled(CalledContexts $screen_context_stack)
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:34
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 58 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().

58  : bool
59  {
60  $this->data_collection = $screen_context_stack->current()->getAdditionalData();
61  return $this->data_collection->is(ilLSPlayer::GS_DATA_LS_KIOSK_MODE, true);
62  }
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 48 of file class.ilLSViewLayoutProvider.php.


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