ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilTestPlayerLayoutProvider.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
13
18
27{
28 const TEST_PLAYER_KIOSK_MODE_ENABLED = 'test_player_kiosk_mode_enabled';
29
30
32 {
33 return $this->context_collection->repository();
34 }
35
36
37 public function getLogoModification(CalledContexts $calledContexts) : ?LogoModification
38 {
39 if ($this->isKioskModeEnabled($calledContexts)) {
40 $logo = $this->globalScreen()->layout()->factory()->logo();
41
42 $logo = $logo->withModification(function (Image $current) {
43 return null;
44 });
45
46 return $logo->withHighPriority();
47 }
48
49 return null;
50 }
51
52
53 public function getMainBarModification(CalledContexts $calledContexts) : ?MainBarModification
54 {
55 if ($this->isKioskModeEnabled($calledContexts)) {
56 $mainBar = $this->globalScreen()->layout()->factory()->mainbar();
57
58 $mainBar = $mainBar->withModification(function (MainBar $current) {
59 return null;
60 });
61
62 return $mainBar->withHighPriority();
63 }
64
65 return null;
66 }
67
68
69 public function getMetaBarModification(CalledContexts $calledContexts) : ?MetaBarModification
70 {
71 if ($this->isKioskModeEnabled($calledContexts)) {
72 $metaBar = $this->globalScreen()->layout()->factory()->metabar();
73
74 $metaBar = $metaBar->withModification(function (MetaBar $current) {
75 return null;
76 });
77
78 return $metaBar->withHighPriority();
79 }
80
81 return null;
82 }
83
84
85 public function getFooterModification(CalledContexts $calledContexts) : ?FooterModification
86 {
87 if ($this->isKioskModeEnabled($calledContexts)) {
88 $footer = $this->globalScreen()->layout()->factory()->footer();
89
90 $footer = $footer->withModification(function (Footer $current) {
91 return null;
92 });
93
94 return $footer->withHighPriority();
95 }
96
97 return null;
98 }
99
100
106 protected function isKioskModeEnabled(CalledContexts $calledContexts) : bool
107 {
108 $additionalData = $calledContexts->current()->getAdditionalData();
109 $isKioskModeEnabled = $additionalData->is(self::TEST_PLAYER_KIOSK_MODE_ENABLED, true);
110
111 return $isKioskModeEnabled;
112 }
113}
An exception for terminatinating execution or to throw for unit testing.
isKioskModeEnabled(CalledContexts $calledContexts)
getMetaBarModification(CalledContexts $calledContexts)
@inheritDoc
getFooterModification(CalledContexts $calledContexts)
@inheritDoc
getMainBarModification(CalledContexts $calledContexts)
@inheritDoc
getLogoModification(CalledContexts $calledContexts)
@inheritDoc
This describes the Footer.
Definition: Footer.php:12
This describes the MainBar.
Definition: MainBar.php:16
This describes the MetaBar.
Definition: MetaBar.php:15