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) |
||
90 | |||
91 | /** |
||
92 | * Display data in the ACP module |
||
93 | * |
||
94 | * @param string $mode The ACP module mode (manage|settings) |
||
95 | * @param array $data Array of data to assign to the template |
||
96 | */ |
||
97 | protected function display($mode, $data) |
||
106 | |||
107 | /** |
||
108 | * Get a list of available sites |
||
109 | * |
||
110 | * @return array An array of available sites |
||
111 | */ |
||
112 | protected function get_sites() |
||
135 | |||
136 | /** |
||
137 | * Save site managed data to the database |
||
138 | */ |
||
139 | protected function save_manage() |
||
150 | |||
151 | /** |
||
152 | * Save settings data to the database |
||
153 | */ |
||
154 | protected function save_settings() |
||
162 | |||
163 | /** |
||
164 | * Check the form key, trigger error if invalid |
||
165 | */ |
||
166 | protected function check_form_key() |
||
173 | } |
||
174 |
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