ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTestPlayerLayoutProvider Class Reference
+ Inheritance diagram for ilTestPlayerLayoutProvider:
+ Collaboration diagram for ilTestPlayerLayoutProvider:

Public Member Functions

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

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)
Parameters
CalledContexts$screen_context_stack
Returns
FooterModification|null

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

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

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

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isKioskModeEnabled(CalledContexts $called_contexts)
+ Here is the call graph for this function:

◆ getLogoModification()

ilTestPlayerLayoutProvider::getLogoModification ( CalledContexts  $screen_context_stack)
Parameters
CalledContexts$screen_context_stack
Returns
LogoModification|null

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

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

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

192  {
193  if (!$this->isKioskModeEnabled($called_contexts)) {
194  return null;
195  }
196  return $this->globalScreen()->layout()->factory()->logo()->withModification(
197  static function (?Image $logo): ?Image {
198  return $logo->withAction('');
199  }
200  )->withPriority(self::MODIFICATION_PRIORITY);
201  }
withAction($action)
Get an image like this with an action.
Definition: Image.php:125
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isKioskModeEnabled(CalledContexts $called_contexts)
+ Here is the call graph for this function:

◆ getMainBarModification()

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

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

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

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

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:33
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
withClearedEntries()
Get a copy of this MainBar without any entries.
isKioskModeEnabled(CalledContexts $called_contexts)
global $lng
Definition: privfeed.php:31
withToolsButton(Button\Bulky $button)
Set button for the tools-trigger.
$r
+ Here is the call graph for this function:

◆ getMetaBarModification()

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

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

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

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

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isKioskModeEnabled(CalledContexts $called_contexts)
This describes the MetaBar.
Definition: MetaBar.php:32
+ Here is the call graph for this function:

◆ getShortTitleModification()

ilTestPlayerLayoutProvider::getShortTitleModification ( CalledContexts  $screen_context_stack)
Parameters
CalledContexts$screen_context_stack
Returns
ShortTitleModification|null

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

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

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

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isKioskModeEnabled(CalledContexts $called_contexts)
+ Here is the call graph for this function:

◆ getTitleModification()

ilTestPlayerLayoutProvider::getTitleModification ( CalledContexts  $screen_context_stack)
Parameters
CalledContexts$screen_context_stack
Returns
TitleModification|null

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

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

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

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  if ($title == null) {
181  $title = '';
182  }
183  return $this->globalScreen()->layout()->factory()->view_title()
184  ->withModification(
185  function (?string $content) use ($title): ?string {
186  return $title;
187  }
188  )->withPriority(self::MODIFICATION_PRIORITY);
189  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getViewTitleModification()

ilTestPlayerLayoutProvider::getViewTitleModification ( CalledContexts  $screen_context_stack)
Parameters
CalledContexts$screen_context_stack
Returns
ViewTitleModification|null

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

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

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

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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.

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

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

59  : bool
60  {
61  return $called_contexts->current()->getAdditionalData()
62  ->is(self::TEST_PLAYER_KIOSK_MODE_ENABLED, true);
63  }
+ 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: