ILIAS  release_8 Revision v8.24
ilLSViewLayoutProvider Class Reference

Class ilLSViewLayoutProvider. More...

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

Public Member Functions

 isInterestedInContexts ()
 @inheritDoc More...
 
 getMainBarModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getMetaBarModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getBreadCrumbsModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getContentModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getPageBuilderDecorator (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider
 __construct (Container $dic)
 @inheritDoc More...
 
 getContentModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getLogoModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getResponsiveLogoModification (CalledContexts $screen_context_stack)
 
 getMainBarModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getMetaBarModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getBreadCrumbsModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getFooterModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getPageBuilderDecorator (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getTitleModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getShortTitleModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
 getViewTitleModification (CalledContexts $screen_context_stack)
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (Container $dic)
 @inheritDoc More...
 
 getFullyQualifiedClassName ()
 @inheritDoc More...
 
 getProviderNameForPresentation ()
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
 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)
 
 isInterestedInContexts ()
 

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)

@inheritDoc

Reimplemented from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider.

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

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)

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

+ Here is the call graph for this function:

◆ getContentModification()

ilLSViewLayoutProvider::getContentModification ( CalledContexts  $screen_context_stack)

@inheritDoc

Reimplemented from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider.

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

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 }
const GS_DATA_LS_CONTENT

References ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), ilLSPlayer\GS_DATA_LS_CONTENT, isKioskModeEnabled(), and ILIAS\UI\examples\MainControls\Slate\Legacy\legacy().

+ Here is the call graph for this function:

◆ getMainBarModification()

ilLSViewLayoutProvider::getMainBarModification ( CalledContexts  $screen_context_stack)

@inheritDoc

Reimplemented from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider.

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

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 }
const GS_DATA_LS_MAINBARCONTROLS
This describes the MainBar.
Definition: MainBar.php:34
withClearedEntries()
Get a copy of this MainBar without any entries.
withAdditionalEntry(string $id, $entry)
Append an entry.
withAdditionalToolEntry(string $id, Slate\Slate $entry, bool $initially_hidden=false, Button\Close $close_button=null)
Append a tool-entry.
string $key
Consumer key/client ID value.
Definition: System.php:193

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

+ Here is the call graph for this function:

◆ getMetaBarModification()

ilLSViewLayoutProvider::getMetaBarModification ( CalledContexts  $screen_context_stack)

@inheritDoc

Reimplemented from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider.

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

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 }
This describes the MetaBar.
Definition: MetaBar.php:33
withClearedEntries()
Get a copy of this MetaBar without any entries.

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

+ Here is the call graph for this function:

◆ getPageBuilderDecorator()

ilLSViewLayoutProvider::getPageBuilderDecorator ( CalledContexts  $screen_context_stack)

@inheritDoc

@noinspection PhpIncompatibleReturnTypeInspection

Reimplemented from ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider.

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

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 }
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35
const GS_DATA_LS_METABARCONTROLS
This describes the Page.
Definition: Page.php:31
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64

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

+ 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.

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

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

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

+ 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: