-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathext.php
More file actions
56 lines (49 loc) · 1.32 KB
/
Copy pathext.php
File metadata and controls
56 lines (49 loc) · 1.32 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
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
*
* @package sitemaker
* @copyright (c) 2013 Daniel A. (blitze)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace blitze\content;
class ext extends \phpbb\extension\base
{
/**
* Check whether or not the extension can be enabled.
*
* @return bool
*/
public function is_enableable()
{
$this->container->get('language')->add_lang('info_acp_content', 'blitze/content');
return $this->phpbb_version_is_ok() && $this->required_exts_are_ok();
}
/**
* Check whether or not this extension can be enabled on the current phpBB version.
*
* @return bool
*/
protected function phpbb_version_is_ok()
{
$config = $this->container->get('config');
return phpbb_version_compare($config['version'], '3.2.2', '>=') && phpbb_version_compare($config['version'], '3.3.0', '<');
}
/**
* Check whether or not the extension's dependencies are available and installed.
*
* @return bool
*/
protected function required_exts_are_ok()
{
if (!class_exists('blitze\sitemaker\ext'))
{
trigger_error($this->container->get('language')->lang('MISSING_REQUIRED_EXTENSION'), E_USER_WARNING);
}
if (!$this->container->get('ext.manager')->is_enabled('blitze/sitemaker'))
{
$this->container->get('ext.manager')->enable('blitze/sitemaker');
}
return true;
}
}