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\request\request $request */ |
||
31 | protected $request; |
||
32 | |||
33 | /** @var \phpbb\template\template $template */ |
||
34 | protected $template; |
||
35 | |||
36 | /** @var \phpbb\language\language $language */ |
||
37 | protected $language; |
||
38 | |||
39 | /** @var string $form_key */ |
||
40 | protected $form_key; |
||
41 | |||
42 | /** @var string $u_action */ |
||
43 | public $u_action; |
||
44 | |||
45 | /** |
||
46 | * Constructor |
||
47 | */ |
||
48 | public function __construct() |
||
63 | |||
64 | /** |
||
65 | * Main ACP module |
||
66 | * |
||
67 | * @param int $id The module ID |
||
68 | * @param string $mode The module mode |
||
69 | */ |
||
70 | public function main($id, $mode) |
||
96 | |||
97 | /** |
||
98 | * Display data in the ACP module |
||
99 | * |
||
100 | * @param string $mode The ACP module mode (manage|settings) |
||
101 | * @param array $data Array of data to assign to the template |
||
102 | */ |
||
103 | protected function display($mode, $data) |
||
112 | |||
113 | /** |
||
114 | * Get a list of available sites |
||
115 | * |
||
116 | * @return array An array of available sites |
||
117 | */ |
||
118 | protected function get_sites() |
||
141 | |||
142 | /** |
||
143 | * Save site managed data to the database |
||
144 | */ |
||
145 | protected function save_manage() |
||
156 | |||
157 | /** |
||
158 | * Save settings data to the database |
||
159 | */ |
||
160 | protected function save_settings() |
||
168 | |||
169 | /** |
||
170 | * Check the form key, trigger error if invalid |
||
171 | */ |
||
172 | protected function check_form_key() |
||
179 | } |
||
180 |
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