[TASK] Decouple adminPanel from frontend
[Packages/TYPO3.CMS.git] / typo3 / sysext / adminpanel / Classes / Modules / AdminPanelModuleInterface.php
1 <?php
2 declare(strict_types = 1);
3
4 namespace TYPO3\CMS\Adminpanel\Modules;
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 TYPO3\CMS\Core\Http\ServerRequest;
20
21 /**
22 * Interface for admin panel modules registered via EXTCONF
23 *
24 * @internal until API is stable
25 */
26 interface AdminPanelModuleInterface
27 {
28
29 /**
30 * Additional JavaScript code for this module
31 * (you should only use vanilla JS here, as you cannot
32 * rely on the web site providing a specific framework)
33 *
34 * @return string
35 */
36 public function getAdditionalJavaScriptCode(): string;
37
38 /**
39 * Module content as rendered HTML
40 *
41 * @return string
42 */
43 public function getContent(): string;
44
45 /**
46 * Identifier for this module,
47 * for example "preview" or "cache"
48 *
49 * @return string
50 */
51 public function getIdentifier(): string;
52
53 /**
54 * Module label
55 *
56 * @return string
57 */
58 public function getLabel(): string;
59
60 /**
61 * Initialize the module - runs early in a TYPO3 request
62 *
63 * @param \TYPO3\CMS\Core\Http\ServerRequest $request
64 */
65 public function initializeModule(ServerRequest $request): void;
66
67 /**
68 * Module is enabled
69 * -> should be initialized
70 * A module may be enabled but not shown
71 * -> only the initializeModule() method
72 * will be called
73 *
74 * @return bool
75 */
76 public function isEnabled(): bool;
77
78 /**
79 * Module is open
80 * -> module is enabled
81 * -> module panel is shown and open
82 *
83 * @return bool
84 */
85 public function isOpen(): bool;
86
87 /**
88 * Module is shown
89 * -> module is enabled
90 * -> module panel should be displayed
91 *
92 * @return bool
93 */
94 public function isShown(): bool;
95
96 /**
97 * Executed on saving / submit of the configuration form
98 * Can be used to react to changed settings
99 * (for example: clearing a specific cache)
100 *
101 * @param array $input
102 */
103 public function onSubmit(array $input): void;
104
105 /**
106 * Does this module need a form submit?
107 *
108 * @return bool
109 */
110 public function showFormSubmitButton(): bool;
111
112 /**
113 * Returns a string array with javascript files that will be rendered after the module
114 *
115 * @return array
116 */
117 public function getJavaScriptFiles(): array;
118 }