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