3633f785c377e123b0765e0c881b2b61693557c0
[Packages/TYPO3.CMS.git] / typo3 / sysext / adminpanel / Tests / Unit / Fixtures / MainModuleFixture.php
1 <?php
2 declare(strict_types = 1);
3
4 namespace TYPO3\CMS\Adminpanel\Tests\Unit\Fixtures;
5
6 /*
7 * This file is part of the TYPO3 CMS project.
8 *
9 * It is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License, either version 2
11 * of the License, or any later version.
12 *
13 * For the full copyright and license information, please read the
14 * LICENSE.txt file that was distributed with this source code.
15 *
16 * The TYPO3 project - inspiring people to share!
17 */
18
19 use Psr\Http\Message\ServerRequestInterface;
20 use TYPO3\CMS\Adminpanel\Modules\AdminPanelModuleInterface;
21 use TYPO3\CMS\Adminpanel\Modules\AdminPanelSubModuleInterface;
22
23 class MainModuleFixture implements AdminPanelModuleInterface
24 {
25
26 /**
27 * Identifier for this module,
28 * for example "preview" or "cache"
29 *
30 * @return string
31 */
32 public function getIdentifier(): string
33 {
34 return 'example';
35 }
36
37 /**
38 * Module label
39 *
40 * @return string
41 */
42 public function getLabel(): string
43 {
44 return 'Example Label';
45 }
46
47 /**
48 * Module Icon identifier - needs to be registered in iconRegistry
49 *
50 * @return string
51 */
52 public function getIconIdentifier(): string
53 {
54 return 'actions-document-info';
55 }
56
57 /**
58 * Displayed directly in the bar if module has content
59 *
60 * @return string
61 */
62 public function getShortInfo(): string
63 {
64 return 'short info';
65 }
66
67 /**
68 * @return string
69 */
70 public function getSettings(): string
71 {
72 return 'example settings';
73 }
74
75 /**
76 * Initialize the module - runs early in a TYPO3 request
77 *
78 * @param ServerRequestInterface $request
79 */
80 public function initializeModule(ServerRequestInterface $request): void
81 {
82 }
83
84 /**
85 * Module is enabled
86 * -> should be initialized
87 * A module may be enabled but not shown
88 * -> only the initializeModule() method
89 * will be called
90 *
91 * @return bool
92 */
93 public function isEnabled(): bool
94 {
95 return true;
96 }
97
98 /**
99 * Executed on saving / submit of the configuration form
100 * Can be used to react to changed settings
101 * (for example: clearing a specific cache)
102 *
103 * @param array $configurationToSave
104 * @param ServerRequestInterface $request
105 */
106 public function onSubmit(array $configurationToSave, ServerRequestInterface $request): void
107 {
108 }
109
110 /**
111 * Returns a string array with javascript files that will be rendered after the module
112 *
113 * @return array
114 */
115 public function getJavaScriptFiles(): array
116 {
117 return [];
118 }
119
120 /**
121 * Returns a string array with css files that will be rendered after the module
122 *
123 * @return array
124 */
125 public function getCssFiles(): array
126 {
127 return [];
128 }
129
130 /**
131 * Set SubModules for current module
132 *
133 * @param AdminPanelSubModuleInterface[] $subModules
134 */
135 public function setSubModules(array $subModules): void
136 {
137 }
138
139 /**
140 * Get SubModules for current module
141 *
142 * @return AdminPanelSubModuleInterface[]
143 */
144 public function getSubModules(): array
145 {
146 return [];
147 }
148
149 /**
150 * Returns true if submodule has own settings
151 *
152 * @return bool
153 */
154 public function getHasSubmoduleSettings(): bool
155 {
156 return false;
157 }
158 }