-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathext.php
More file actions
45 lines (38 loc) · 1.3 KB
/
ext.php
File metadata and controls
45 lines (38 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
*
* @package Add user
* @copyright (c) 2014 John Peskens (http://ForumHulp.com)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
// This file is needed for phpBB3 to properly register the extension
namespace forumhulp\adduser;
class ext extends \phpbb\extension\base
{
public function is_enableable()
{
if (!class_exists('forumhulp\helper\helper'))
{
$this->container->get('user')->add_lang_ext('forumhulp/adduser', 'info_acp_adduser');
trigger_error($this->container->get('user')->lang['FH_HELPER_NOTICE'], E_USER_WARNING);
}
if (!$this->container->get('ext.manager')->is_enabled('forumhulp/helper'))
{
$this->container->get('ext.manager')->enable('forumhulp/helper');
}
return class_exists('forumhulp\helper\helper');
}
public function enable_step($old_state)
{
if (empty($old_state))
{
$this->container->get('user')->add_lang_ext('forumhulp/adduser', 'info_acp_adduser');
$this->container->get('template')->assign_var('L_EXTENSION_ENABLE_SUCCESS', $this->container->get('user')->lang['EXTENSION_ENABLE_SUCCESS'] .
(isset($this->container->get('user')->lang['ADD_USER_NOTICE']) ?
$this->container->get('user')->lang['ADD_USER_NOTICE'] : ''));
}
// Run parent enable step method
return parent::enable_step($old_state);
}
}