ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 (protected Container $dic)
 
 getFullyQualifiedClassName ()
 
 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
 
DataFactory $data
 
ModificationFactory $factory
 

Detailed Description

Member Function Documentation

◆ getBreadCrumbsModification()

ilLSViewLayoutProvider::getBreadCrumbsModification ( CalledContexts  $screen_context_stack)

@inheritDoc

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

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

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

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

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

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

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

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 }
factory()
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:61

References Vendor\Package\$f, $parts, factory(), 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 57 of file class.ilLSViewLayoutProvider.php.

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

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


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