aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_module.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2013-07-11 12:11:41 -0700
committerNils Adermann <naderman@naderman.de>2013-07-11 12:11:41 -0700
commit59f34bef087259722e1f7eaa95b96460e007cb30 (patch)
treed7dfcc712537e672a965d924cac679670d09583e /phpBB/includes/functions_module.php
parent7104aeb77e2f6066cbbda0585fc8523426e4b7c7 (diff)
parent947b907efef43704c620507db17aff4fe115f219 (diff)
downloadforums-59f34bef087259722e1f7eaa95b96460e007cb30.tar
forums-59f34bef087259722e1f7eaa95b96460e007cb30.tar.gz
forums-59f34bef087259722e1f7eaa95b96460e007cb30.tar.bz2
forums-59f34bef087259722e1f7eaa95b96460e007cb30.tar.xz
forums-59f34bef087259722e1f7eaa95b96460e007cb30.zip
Merge pull request #1470 from EXreaction/feature/twig
Feature/twig
Diffstat (limited to 'phpBB/includes/functions_module.php')
-rw-r--r--phpBB/includes/functions_module.php38
1 files changed, 37 insertions, 1 deletions
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index 0d387ace6d..99c24fcb19 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -455,7 +455,7 @@ class p_master
*/
function load_active($mode = false, $module_url = false, $execute_module = true)
{
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $phpbb_style;
$module_path = $this->include_path . $this->p_class;
$icat = request_var('icat', '');
@@ -494,6 +494,24 @@ class p_master
// We pre-define the action parameter we are using all over the place
if (defined('IN_ADMIN'))
{
+ /*
+ * If this is an extension module, we'll try to automatically set
+ * the style paths for the extension (the ext author can change them
+ * if necessary).
+ */
+ $module_dir = explode('_', get_class($this->module));
+
+ // 0 phpbb, 1 ext, 2 vendor, 3 extension name, ...
+ if (isset($module_dir[3]) && $module_dir[1] === 'ext')
+ {
+ $module_style_dir = $phpbb_root_path . 'ext/' . $module_dir[2] . '/' . $module_dir[3] . '/adm/style';
+
+ if (is_dir($module_style_dir))
+ {
+ $phpbb_style->set_custom_style('admin', array($module_style_dir, $phpbb_admin_path . 'style'), array(), '');
+ }
+ }
+
// Is first module automatically enabled a duplicate and the category not passed yet?
if (!$icat && $this->module_ary[$this->active_module_row_id]['is_duplicate'])
{
@@ -505,6 +523,24 @@ class p_master
}
else
{
+ /*
+ * If this is an extension module, we'll try to automatically set
+ * the style paths for the extension (the ext author can change them
+ * if necessary).
+ */
+ $module_dir = explode('_', get_class($this->module));
+
+ // 0 phpbb, 1 ext, 2 vendor, 3 extension name, ...
+ if (isset($module_dir[3]) && $module_dir[1] === 'ext')
+ {
+ $module_style_dir = 'ext/' . $module_dir[2] . '/' . $module_dir[3] . '/styles';
+
+ if (is_dir($phpbb_root_path . $module_style_dir))
+ {
+ $phpbb_style->set_style(array($module_style_dir, 'styles'));
+ }
+ }
+
// If user specified the module url we will use it...
if ($module_url !== false)
{