|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * |
| 4 | + * @package phpBB.de pastebin |
| 5 | + * @copyright (c) 2015 phpBB.de, gn#36 |
| 6 | + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 |
| 7 | + * |
| 8 | + */ |
| 9 | + |
| 10 | +namespace phpbbde\pastebin\event; |
| 11 | + |
| 12 | +/** |
| 13 | + * @ignore |
| 14 | + */ |
| 15 | +use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
| 16 | + |
| 17 | +/** |
| 18 | + * Event listener |
| 19 | + */ |
| 20 | +class header_events implements EventSubscriberInterface |
| 21 | +{ |
| 22 | + static public function getSubscribedEvents() |
| 23 | + { |
| 24 | + return array( |
| 25 | + 'core.page_header_after' => 'page_header_after', |
| 26 | + ); |
| 27 | + } |
| 28 | + |
| 29 | + /** |
| 30 | + * Constructor |
| 31 | + * |
| 32 | + * @param \phpbb\auth\auth $auth Auth object |
| 33 | + * @param \phpbb\template\template $template Template object |
| 34 | + * @param \phpbb\controller\helper $helper Helper |
| 35 | + * @param string $phpbb_root_path phpBB root path (community/) |
| 36 | + * @param string $php_ext php file extension (php) |
| 37 | + * @param string $root_path php file extension (...phpbb.de/) |
| 38 | + */ |
| 39 | + public function __construct(\phpbb\auth\auth $auth, \phpbb\template\template $template, \phpbb\controller\helper $helper, \phpbb\user $user, $phpbb_root_path, $php_ext) |
| 40 | + { |
| 41 | + $this->auth = $auth; |
| 42 | + $this->template = $template; |
| 43 | + $this->phpbb_root_path = $phpbb_root_path; |
| 44 | + $this->helper = $helper; |
| 45 | + $this->php_ext = $php_ext; |
| 46 | + $this->user = $user; |
| 47 | + } |
| 48 | + |
| 49 | + public function page_header_after($event) |
| 50 | + { |
| 51 | + $this->user->add_lang_ext('phpbbde/pastebin', 'global'); |
| 52 | + |
| 53 | + $this->template->assign_vars(array( |
| 54 | + // Main Menu |
| 55 | + 'U_PASTEBIN' => $this->helper->route('phpbbde_pastebin_main_controller'), |
| 56 | + )); |
| 57 | + } |
| 58 | +} |
0 commit comments