[TASK] Stabilize / Solidify public API of adminPanel
[Packages/TYPO3.CMS.git] / typo3 / sysext / adminpanel / Tests / Unit / Fixtures / SubModuleFixture.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\AdminPanelSubModuleInterface;
21
22 class SubModuleFixture implements AdminPanelSubModuleInterface
23 {
24
25 /**
26 * Initialize the module - runs early in a TYPO3 request
27 *
28 * @param ServerRequestInterface $request
29 */
30 public function initializeModule(ServerRequestInterface $request): void
31 {
32 }
33
34 /**
35 * Identifier for this Sub-module,
36 * for example "preview" or "cache"
37 *
38 * @return string
39 */
40 public function getIdentifier(): string
41 {
42 return 'example-submodule';
43 }
44
45 /**
46 * Sub-Module label
47 *
48 * @return string
49 */
50 public function getLabel(): string
51 {
52 return 'Example SubModule';
53 }
54
55 /**
56 * Sub-Module content as rendered HTML
57 *
58 * @return string
59 */
60 public function getContent(): string
61 {
62 return 'content';
63 }
64
65 /**
66 * Settings as HTML form elements (without wrapping form tag or save button)
67 *
68 * @return string
69 */
70 public function getSettings(): string
71 {
72 return 'settings';
73 }
74
75 /**
76 * Executed on saving / submit of the configuration form
77 * Can be used to react to changed settings
78 * (for example: clearing a specific cache)
79 *
80 * @param array $configurationToSave
81 * @param ServerRequestInterface $request
82 */
83 public function onSubmit(array $configurationToSave, ServerRequestInterface $request): void
84 {
85 }
86 }