ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTestPlayerLayoutProvider Class Reference
+ Inheritance diagram for ilTestPlayerLayoutProvider:
+ Collaboration diagram for ilTestPlayerLayoutProvider:

Public Member Functions

 isInterestedInContexts ()
 
 getMainBarModification (CalledContexts $called_contexts)
 @inheritDoc More...
 
 getMetaBarModification (CalledContexts $called_contexts)
 @inheritDoc More...
 
 getFooterModification (CalledContexts $called_contexts)
 @inheritDoc More...
 
 getShortTitleModification (CalledContexts $called_contexts)
 @inheritDoc More...
 
 getViewTitleModification (CalledContexts $called_contexts)
 @inheritDoc More...
 
 getTitleModification (CalledContexts $called_contexts)
 @inheritDoc More...
 
 getLogoModification (CalledContexts $called_contexts)
 @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 ()
 

Data Fields

const TEST_PLAYER_KIOSK_MODE_ENABLED = 'test_player_kiosk_mode_enabled'
 
const TEST_PLAYER_TITLE = 'test_player_title'
 
const TEST_PLAYER_VIEW_TITLE = 'test_player_view_title'
 
const TEST_PLAYER_SHORT_TITLE = 'test_player_instance_name'
 
const TEST_PLAYER_QUESTIONLIST = 'test_player_questionlist'
 

Protected Member Functions

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

Private Attributes

const MODIFICATION_PRIORITY = 5
 

Additional Inherited Members

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

Detailed Description

Definition at line 44 of file class.ilTestPlayerLayoutProvider.php.

Member Function Documentation

◆ getFooterModification()

ilTestPlayerLayoutProvider::getFooterModification ( CalledContexts  $screen_context_stack)

@inheritDoc

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

Definition at line 123 of file class.ilTestPlayerLayoutProvider.php.

124 {
125 if (!$this->isKioskModeEnabled($called_contexts)) {
126 return null;
127 }
128
129 return $this->globalScreen()->layout()->factory()->footer()
130 ->withModification(
131 function (?Footer $current): ?Footer {
132 return null;
133 }
134 )->withPriority(self::MODIFICATION_PRIORITY);
135 }
isKioskModeEnabled(CalledContexts $called_contexts)

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

+ Here is the call graph for this function:

◆ getLogoModification()

ilTestPlayerLayoutProvider::getLogoModification ( CalledContexts  $screen_context_stack)

@inheritDoc

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

Definition at line 197 of file class.ilTestPlayerLayoutProvider.php.

198 {
199 if (!$this->isKioskModeEnabled($called_contexts)) {
200 return null;
201 }
202 return $this->globalScreen()->layout()->factory()->logo()->withModification(
203 static function (?Image $logo): ?Image {
204 return $logo->withAction('');
205 }
206 )->withPriority(self::MODIFICATION_PRIORITY);
207 }
withAction($action)
Get an image like this with an action.
Definition: Image.php:125

References ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), isKioskModeEnabled(), and ILIAS\UI\Component\Image\Image\withAction().

+ Here is the call graph for this function:

◆ getMainBarModification()

ilTestPlayerLayoutProvider::getMainBarModification ( CalledContexts  $screen_context_stack)

@inheritDoc

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

Definition at line 65 of file class.ilTestPlayerLayoutProvider.php.

66 {
67 $mainbar = $this->globalScreen()->layout()->factory()->mainbar();
68 $has_question_list = $called_contexts->current()->getAdditionalData()
69 ->exists(self::TEST_PLAYER_QUESTIONLIST);
70
71 if (!$this->isKioskModeEnabled($called_contexts)) {
72 return null;
73 }
74
75 $mainbar_modification = static fn(?MainBar $mainbar): ?MainBar => null;
76 if ($has_question_list) {
77 $f = $this->dic->ui()->factory();
78 $r = $this->dic->ui()->renderer();
79 $lng = $this->dic->language();
80 $question_listing = $called_contexts->current()->getAdditionalData()->get(self::TEST_PLAYER_QUESTIONLIST);
81
82 $mainbar_modification = static function (?MainBar $mainbar) use ($f, $r, $lng, $question_listing): ?MainBar {
83 $mainbar = $mainbar->withClearedEntries();
84
85 $icon = $f->symbol()->icon()->standard('tst', $lng->txt("more"));
86 $tools_button = $f->button()->bulky($icon, $lng->txt("tools"), "#")
87 ->withEngagedState(true);
88
89 $question_listing = $f->legacy()->content($r->render($question_listing));
90
91 $label = $lng->txt('mainbar_button_label_questionlist');
92 $entry = $f->maincontrols()->slate()->legacy(
93 $label,
94 $f->symbol()->icon()->standard('tst', $label),
95 $question_listing
96 );
97
98 return $mainbar
99 ->withToolsButton($tools_button)
100 ->withAdditionalToolEntry('questionlist', $entry);
101 };
102 }
103
104 return $mainbar
105 ->withModification($mainbar_modification)
106 ->withPriority(self::MODIFICATION_PRIORITY);
107 }
This describes the MainBar.
Definition: MainBar.php:34
withClearedEntries()
Get a copy of this MainBar without any entries.
withToolsButton(Button\Bulky $button)
Set button for the tools-trigger.
global $lng
Definition: privfeed.php:31

References Vendor\Package\$f, $lng, ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), isKioskModeEnabled(), ILIAS\UI\Component\MainControls\MainBar\withClearedEntries(), ILIAS\UI\Implementation\Component\Button\withEngagedState(), and ILIAS\UI\Component\MainControls\MainBar\withToolsButton().

+ Here is the call graph for this function:

◆ getMetaBarModification()

ilTestPlayerLayoutProvider::getMetaBarModification ( CalledContexts  $screen_context_stack)

@inheritDoc

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

Definition at line 109 of file class.ilTestPlayerLayoutProvider.php.

110 {
111 if (!$this->isKioskModeEnabled($called_contexts)) {
112 return null;
113 }
114
115 return $this->globalScreen()->layout()->factory()->metabar()
116 ->withModification(
117 function (?MetaBar $current): ?MetaBar {
118 return null;
119 }
120 )->withPriority(self::MODIFICATION_PRIORITY);
121 }
This describes the MetaBar.
Definition: MetaBar.php:33

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

+ Here is the call graph for this function:

◆ getShortTitleModification()

ilTestPlayerLayoutProvider::getShortTitleModification ( CalledContexts  $screen_context_stack)

@inheritDoc

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

Definition at line 137 of file class.ilTestPlayerLayoutProvider.php.

138 {
139 if (!$this->isKioskModeEnabled($called_contexts)) {
140 return null;
141 }
142
143 $title = $called_contexts->current()->getAdditionalData()->get(self::TEST_PLAYER_SHORT_TITLE);
144 if ($title === null) {
145 $title = '';
146 }
147 return $this->globalScreen()->layout()->factory()->short_title()
148 ->withModification(
149 function (?string $content) use ($title): ?string {
150 return $title;
151 }
152 )->withPriority(self::MODIFICATION_PRIORITY);
153 }

References ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), and isKioskModeEnabled().

+ Here is the call graph for this function:

◆ getTitleModification()

ilTestPlayerLayoutProvider::getTitleModification ( CalledContexts  $screen_context_stack)

@inheritDoc

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

Definition at line 173 of file class.ilTestPlayerLayoutProvider.php.

174 {
175 if (!$called_contexts->current()->getAdditionalData()->exists(self::TEST_PLAYER_TITLE)) {
176 return null;
177 }
178
179 $title = $called_contexts->current()->getAdditionalData()->get(self::TEST_PLAYER_TITLE);
180
181 if ($title == null) {
182 $title = '';
183 }
184
185 if ($title === '' && !$this->isKioskModeEnabled($called_contexts)) {
186 return null;
187 }
188
189 return $this->globalScreen()->layout()->factory()->view_title()
190 ->withModification(
191 function (?string $content) use ($title): ?string {
192 return $title;
193 }
194 )->withPriority(self::MODIFICATION_PRIORITY);
195 }

References ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), and isKioskModeEnabled().

+ Here is the call graph for this function:

◆ getViewTitleModification()

ilTestPlayerLayoutProvider::getViewTitleModification ( CalledContexts  $screen_context_stack)

@inheritDoc

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

Definition at line 155 of file class.ilTestPlayerLayoutProvider.php.

156 {
157 if (!$called_contexts->current()->getAdditionalData()->exists(self::TEST_PLAYER_VIEW_TITLE)) {
158 return null;
159 }
160
161 $title = $called_contexts->current()->getAdditionalData()->get(self::TEST_PLAYER_VIEW_TITLE);
162 if ($title === null) {
163 $title = '';
164 }
165 return $this->globalScreen()->layout()->factory()->view_title()
166 ->withModification(
167 function (?string $content) use ($title): ?string {
168 return $title;
169 }
170 )->withPriority(self::MODIFICATION_PRIORITY);
171 }

References ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current(), and ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen().

+ Here is the call graph for this function:

◆ isInterestedInContexts()

ilTestPlayerLayoutProvider::isInterestedInContexts ( )

◆ isKioskModeEnabled()

ilTestPlayerLayoutProvider::isKioskModeEnabled ( CalledContexts  $called_contexts)
protected

Definition at line 59 of file class.ilTestPlayerLayoutProvider.php.

59 : bool
60 {
61 return $called_contexts->current()->getAdditionalData()
62 ->is(self::TEST_PLAYER_KIOSK_MODE_ENABLED, true);
63 }

References ILIAS\GlobalScreen\ScreenContext\Stack\CalledContexts\current().

Referenced by getFooterModification(), getLogoModification(), getMainBarModification(), getMetaBarModification(), getShortTitleModification(), and getTitleModification().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ MODIFICATION_PRIORITY

const ilTestPlayerLayoutProvider::MODIFICATION_PRIORITY = 5
private

Definition at line 52 of file class.ilTestPlayerLayoutProvider.php.

◆ TEST_PLAYER_KIOSK_MODE_ENABLED

const ilTestPlayerLayoutProvider::TEST_PLAYER_KIOSK_MODE_ENABLED = 'test_player_kiosk_mode_enabled'

◆ TEST_PLAYER_QUESTIONLIST

const ilTestPlayerLayoutProvider::TEST_PLAYER_QUESTIONLIST = 'test_player_questionlist'

◆ TEST_PLAYER_SHORT_TITLE

const ilTestPlayerLayoutProvider::TEST_PLAYER_SHORT_TITLE = 'test_player_instance_name'

◆ TEST_PLAYER_TITLE

const ilTestPlayerLayoutProvider::TEST_PLAYER_TITLE = 'test_player_title'

◆ TEST_PLAYER_VIEW_TITLE


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