1 | <?php |
||
16 | class main_module |
||
17 | { |
||
18 | /** @var \phpbb\cache\driver\driver_interface $cache */ |
||
19 | protected $cache; |
||
20 | |||
21 | /** @var \phpbb\config\config $config */ |
||
22 | protected $config; |
||
23 | |||
24 | /** @var \phpbb\config\db_text $config_text */ |
||
25 | protected $config_text; |
||
26 | |||
27 | /** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */ |
||
28 | protected $container; |
||
29 | |||
30 | /** @var \phpbb\language\language $language */ |
||
31 | protected $language; |
||
32 | |||
33 | /** @var \phpbb\log\log $log */ |
||
34 | protected $log; |
||
35 | |||
36 | /** @var \phpbb\request\request $request */ |
||
37 | protected $request; |
||
38 | |||
39 | /** @var \phpbb\template\template $template */ |
||
40 | protected $template; |
||
41 | |||
42 | /** @var \phpbb\user */ |
||
43 | protected $user; |
||
44 | |||
45 | /** @var array $enabled_sites */ |
||
46 | protected $enabled_sites; |
||
47 | |||
48 | /** @var string $page_title */ |
||
49 | public $page_title; |
||
50 | |||
51 | /** @var string $tpl_name */ |
||
52 | public $tpl_name; |
||
53 | |||
54 | /** @var string $u_action */ |
||
55 | public $u_action; |
||
56 | |||
57 | /** |
||
58 | * Constructor |
||
59 | */ |
||
60 | public function __construct() |
||
76 | |||
77 | /** |
||
78 | * Main ACP module |
||
79 | * |
||
80 | * @param int $id The module ID (not used) |
||
81 | * @param string $mode The module mode (manage|settings) |
||
82 | */ |
||
83 | public function main($id, $mode) |
||
105 | |||
106 | /** |
||
107 | * Add settings template vars to the form |
||
108 | */ |
||
109 | protected function display_settings() |
||
118 | |||
119 | /** |
||
120 | * Add manage sites template vars to the form |
||
121 | */ |
||
122 | protected function display_manage() |
||
129 | |||
130 | /** |
||
131 | * Get a list of available sites |
||
132 | * |
||
133 | * @return array An array of available sites |
||
134 | */ |
||
135 | protected function get_sites() |
||
154 | |||
155 | /** |
||
156 | * Get enabled media sites stored in the database |
||
157 | * |
||
158 | * @return array An array of enabled sites |
||
159 | */ |
||
160 | protected function get_enabled_sites() |
||
170 | |||
171 | /** |
||
172 | * Save site managed data to the database |
||
173 | */ |
||
174 | protected function save_manage() |
||
184 | |||
185 | /** |
||
186 | * Save settings data to the database |
||
187 | */ |
||
188 | protected function save_settings() |
||
200 | |||
201 | /** |
||
202 | * Purge cached TextFormatter files |
||
203 | */ |
||
204 | protected function purge_textformatter_cache() |
||
209 | } |
||
210 |
Instead of relying on
global
state, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state