ILIAS  release_8 Revision v8.24
class.ilTestPlayerLayoutProvider.php
Go to the documentation of this file.
1<?php
2
29
34
43{
44 public const TEST_PLAYER_KIOSK_MODE_ENABLED = 'test_player_kiosk_mode_enabled';
45 public const TEST_PLAYER_TITLE = 'test_player_title';
46 public const TEST_PLAYER_SHORT_TITLE = 'test_player_instance_name';
47
48
50 {
51 return $this->context_collection->repository();
52 }
53
54 public function getLogoModification(CalledContexts $called_contexts): ?LogoModification
55 {
56 if ($this->isKioskModeEnabled($called_contexts)) {
57 $logo = $this->globalScreen()->layout()->factory()->logo();
58
59 $logo = $logo->withModification(function (?Image $current): ?Image {
60 return null;
61 });
62
63 return $logo->withHighPriority();
64 }
65
66 return null;
67 }
69 {
70 if ($this->isKioskModeEnabled($called_contexts)) {
71 $logo = $this->globalScreen()->layout()->factory()->logo();
72
73 $logo = $logo->withModification(function (?Image $current): ?Image {
74 return null;
75 });
76
77 return $logo->withHighPriority();
78 }
79
80 return null;
81 }
82
83 public function getMainBarModification(CalledContexts $called_contexts): ?MainBarModification
84 {
85 if ($this->isKioskModeEnabled($called_contexts)) {
86 $mainBar = $this->globalScreen()->layout()->factory()->mainbar();
87
88 $mainBar = $mainBar->withModification(function (?MainBar $current): ?MainBar {
89 return null;
90 });
91
92 return $mainBar->withHighPriority();
93 }
94
95 return null;
96 }
97
98 public function getMetaBarModification(CalledContexts $called_contexts): ?MetaBarModification
99 {
100 if ($this->isKioskModeEnabled($called_contexts)) {
101 $metaBar = $this->globalScreen()->layout()->factory()->metabar();
102
103 $metaBar = $metaBar->withModification(function (?MetaBar $current): ?MetaBar {
104 return null;
105 });
106
107 return $metaBar->withHighPriority();
108 }
109
110 return null;
111 }
112
113 public function getFooterModification(CalledContexts $called_contexts): ?FooterModification
114 {
115 if ($this->isKioskModeEnabled($called_contexts)) {
116 $footer = $this->globalScreen()->layout()->factory()->footer();
117
118 $footer = $footer->withModification(function (?Footer $current): ?Footer {
119 return null;
120 });
121
122 return $footer->withHighPriority();
123 }
124
125 return null;
126 }
127
128 protected function isKioskModeEnabled(CalledContexts $called_contexts): bool
129 {
130 $additionalData = $called_contexts->current()->getAdditionalData();
131 $isKioskModeEnabled = $additionalData->is(self::TEST_PLAYER_KIOSK_MODE_ENABLED, true);
132
133 return $isKioskModeEnabled;
134 }
135
137 {
138 if ($this->isKioskModeEnabled($called_contexts)) {
139 $title = $called_contexts->current()->getAdditionalData()->get(self::TEST_PLAYER_SHORT_TITLE);
140 if($title == null) {
141 $title = '';
142 }
143 return $this->globalScreen()->layout()->factory()->short_title()
144 ->withModification(
145 function (?string $content) use ($title): ?string {
146 return $title;
147 }
148 )
149 ->withHighPriority();
150 }
151 return null;
152 }
153
155 {
156 if ($called_contexts->current()->getAdditionalData()->exists(self::TEST_PLAYER_TITLE)) {
157 $title = $called_contexts->current()->getAdditionalData()->get(self::TEST_PLAYER_TITLE);
158 if($title == null) {
159 $title = '';
160 }
161 return $this->globalScreen()->layout()->factory()->view_title()
162 ->withModification(
163 function (?string $content) use ($title): ?string {
164 return $title;
165 }
166 )
167 ->withHighPriority();
168 }
169 return null;
170 }
171
172}
getFooterModification(CalledContexts $called_contexts)
@inheritDoc
getMetaBarModification(CalledContexts $called_contexts)
@inheritDoc
getMainBarModification(CalledContexts $called_contexts)
@inheritDoc
isKioskModeEnabled(CalledContexts $called_contexts)
getResponsiveLogoModification(CalledContexts $called_contexts)
getViewTitleModification(CalledContexts $called_contexts)
@inheritDoc
getShortTitleModification(CalledContexts $called_contexts)
@inheritDoc
getLogoModification(CalledContexts $called_contexts)
@inheritDoc
This describes the Footer.
Definition: Footer.php:33
This describes the MainBar.
Definition: MainBar.php:34
This describes the MetaBar.
Definition: MetaBar.php:33