1 | <?php |
||
15 | class startpage implements EventSubscriberInterface |
||
16 | { |
||
17 | /** @var \phpbb\config\config */ |
||
18 | protected $config; |
||
19 | |||
20 | /** @var ContainerInterface */ |
||
21 | protected $phpbb_container; |
||
22 | |||
23 | /** @var \phpbb\request\request_interface */ |
||
24 | protected $request; |
||
25 | |||
26 | /** @var \phpbb\template\template */ |
||
27 | protected $template; |
||
28 | |||
29 | /** @var \phpbb\language\language */ |
||
30 | protected $translator; |
||
31 | |||
32 | /** @var \phpbb\user */ |
||
33 | protected $user; |
||
34 | |||
35 | /** @var string */ |
||
36 | protected $php_ext; |
||
37 | |||
38 | /* @var bool */ |
||
39 | protected $is_startpage = false; |
||
40 | |||
41 | /** |
||
42 | * Constructor |
||
43 | * |
||
44 | * @param \phpbb\config\config $config Config object |
||
45 | * @param ContainerInterface $phpbb_container Service container |
||
46 | * @param \phpbb\request\request_interface $request Request object |
||
47 | * @param \phpbb\template\template $template Template object |
||
48 | * @param \phpbb\language\language $translator Language object |
||
49 | * @param \phpbb\user $user User object |
||
50 | * @param string $php_ext php file extension |
||
51 | */ |
||
52 | 16 | public function __construct(\phpbb\config\config $config, ContainerInterface $phpbb_container, \phpbb\request\request_interface $request, \phpbb\template\template $template, \phpbb\language\language $translator, \phpbb\user $user, $php_ext) |
|
62 | |||
63 | /** |
||
64 | * @return array |
||
65 | */ |
||
66 | 1 | public static function getSubscribedEvents() |
|
74 | |||
75 | /** |
||
76 | * If start page is set, |
||
77 | * - Add "Forum" to navbar |
||
78 | * - Add "Forum" to the breadcrump when viewing forum page (viewforum/viewtopic/posting) |
||
79 | */ |
||
80 | 7 | public function add_forum_to_navbar() |
|
103 | |||
104 | /** |
||
105 | * If we are on the index page and we have set a custom start page, |
||
106 | * we do not want breadcrumbs like Home > Articles on the index page. |
||
107 | * This removes everything else, leaving just 'Home' |
||
108 | * @return void |
||
109 | */ |
||
110 | 2 | public function cleanup_breadcrumbs() |
|
117 | |||
118 | /** |
||
119 | * @return void |
||
120 | */ |
||
121 | 6 | public function set_startpage() |
|
141 | |||
142 | /** |
||
143 | * @codeCoverageIgnore |
||
144 | */ |
||
145 | protected function exit_handler() |
||
149 | |||
150 | /** |
||
151 | * @return object|false |
||
152 | */ |
||
153 | 5 | protected function get_startpage_controller() |
|
177 | } |
||
178 |