Fix for routing

This commit is contained in:
Biosek
2015-03-12 19:15:18 +01:00
parent 621aa7d9f9
commit c5daf2fb37
3 changed files with 22 additions and 5 deletions

View File

@@ -28,6 +28,7 @@ services:
arguments: arguments:
- @auth - @auth
- @config - @config
- @controller.helper
- @template - @template
- @user - @user
- @dbal.conn - @dbal.conn

View File

@@ -26,13 +26,14 @@ class listener implements EventSubscriberInterface
protected $php_ext; protected $php_ext;
/** @var \phpbb\controller\helper */
protected $controller_helper;
public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\controller\helper $controller_helper, \phpbb\template\template $template, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, $root_path, $php_ext, $auth)
public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, $root_path, $php_ext, $auth)
{ {
$this->config = $config; $this->config = $config;
$this->template = $template; $this->template = $template;
$this->controller_helper = $controller_helper;
$this->user = $user; $this->user = $user;
$this->db = $db; $this->db = $db;
$this->root_path = $root_path; $this->root_path = $root_path;
@@ -44,6 +45,7 @@ class listener implements EventSubscriberInterface
{ {
return array( return array(
'core.user_setup' => 'load_language_on_setup', 'core.user_setup' => 'load_language_on_setup',
'core.page_header' => 'add_page_header_link',
); );
} }
@@ -56,4 +58,18 @@ class listener implements EventSubscriberInterface
); );
$event['lang_set_ext'] = $lang_set_ext; $event['lang_set_ext'] = $lang_set_ext;
} }
/**
* Create a URL to the mchat controller file for the header linklist
*
* @param object $event The event object
* @return null
* @access public
*/
public function add_page_header_link($event)
{
$this->template->assign_vars(array(
'U_MCHAT' => $this->controller_helper->route('dmzx_mchat_controller'),
));
}
} }

View File

@@ -1 +1 @@
<li class="small-icon icon-bump"><a href="{ROOT_PATH}app.php/chat" title="{L_MCHAT_TITLE}">{L_MCHAT_TITLE}</a></li> <li class="small-icon icon-bump"><a href="{U_MCHAT}" title="{L_MCHAT_TITLE}">{L_MCHAT_TITLE}</a></li>