Files
Files
This commit is contained in:
59
event/listener.php
Normal file
59
event/listener.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package phpBB Extension - mChat
|
||||
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
namespace dmzx\mchat\event;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
|
||||
class listener implements EventSubscriberInterface
|
||||
{
|
||||
|
||||
protected $config;
|
||||
|
||||
protected $template;
|
||||
|
||||
protected $user;
|
||||
|
||||
protected $db;
|
||||
|
||||
protected $root_path;
|
||||
|
||||
protected $php_ext;
|
||||
|
||||
|
||||
|
||||
|
||||
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->template = $template;
|
||||
$this->user = $user;
|
||||
$this->db = $db;
|
||||
$this->root_path = $root_path;
|
||||
$this->php_ext = $php_ext;
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
static public function getSubscribedEvents()
|
||||
{
|
||||
return array(
|
||||
'core.user_setup' => 'load_language_on_setup',
|
||||
);
|
||||
}
|
||||
|
||||
public function load_language_on_setup($event)
|
||||
{
|
||||
$lang_set_ext = $event['lang_set_ext'];
|
||||
$lang_set_ext[] = array(
|
||||
'ext_name' => 'dmzx/mchat',
|
||||
'lang_set' => 'common',
|
||||
);
|
||||
$event['lang_set_ext'] = $lang_set_ext;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user