| @@ 16-40 (lines=25) @@ | ||
| 13 | /** |
|
| 14 | * Advertisement management ACP module. |
|
| 15 | */ |
|
| 16 | class main_module |
|
| 17 | { |
|
| 18 | public $page_title; |
|
| 19 | public $tpl_name; |
|
| 20 | public $u_action; |
|
| 21 | ||
| 22 | public function main($id, $mode) |
|
| 23 | { |
|
| 24 | global $phpbb_container; |
|
| 25 | ||
| 26 | /** @var \phpbb\ads\controller\admin_controller $admin_controller */ |
|
| 27 | $admin_controller = $phpbb_container->get('phpbb.ads.admin.controller'); |
|
| 28 | ||
| 29 | // Make the $u_action url available in the admin controller |
|
| 30 | $admin_controller->set_page_url($this->u_action); |
|
| 31 | ||
| 32 | // Load a template from adm/style for our ACP page |
|
| 33 | $this->tpl_name = $mode . '_ads'; |
|
| 34 | ||
| 35 | // Set the page title for our ACP page |
|
| 36 | $this->page_title = $admin_controller->get_page_title(); |
|
| 37 | ||
| 38 | $admin_controller->{'mode_' . $mode}(); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 16-40 (lines=25) @@ | ||
| 13 | /** |
|
| 14 | * Advertisement management ACP module. |
|
| 15 | */ |
|
| 16 | class main_module |
|
| 17 | { |
|
| 18 | public $page_title; |
|
| 19 | public $tpl_name; |
|
| 20 | public $u_action; |
|
| 21 | ||
| 22 | public function main() |
|
| 23 | { |
|
| 24 | global $phpbb_container; |
|
| 25 | ||
| 26 | /** @var \phpbb\ads\controller\ucp_controller $ucp_controller */ |
|
| 27 | $ucp_controller = $phpbb_container->get('phpbb.ads.ucp.controller'); |
|
| 28 | ||
| 29 | // Make the $u_action url available in the UCP controller |
|
| 30 | $ucp_controller->set_page_url($this->u_action); |
|
| 31 | ||
| 32 | // Load a template |
|
| 33 | $this->tpl_name = 'ucp_ads_stats'; |
|
| 34 | ||
| 35 | // Set the page title for our UCP page |
|
| 36 | $this->page_title = $ucp_controller->get_page_title(); |
|
| 37 | ||
| 38 | $ucp_controller->main(); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||