mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/twig] acp module tpls are in ext/adm, ucp/mcp in styles/
PHPBB3-11598
This commit is contained in:
parent
38700a80f8
commit
53496e6a47
1 changed files with 37 additions and 19 deletions
|
@ -455,7 +455,7 @@ class p_master
|
||||||
*/
|
*/
|
||||||
function load_active($mode = false, $module_url = false, $execute_module = true)
|
function load_active($mode = false, $module_url = false, $execute_module = true)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $style;
|
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $phpbb_style;
|
||||||
|
|
||||||
$module_path = $this->include_path . $this->p_class;
|
$module_path = $this->include_path . $this->p_class;
|
||||||
$icat = request_var('icat', '');
|
$icat = request_var('icat', '');
|
||||||
|
@ -491,6 +491,38 @@ class p_master
|
||||||
|
|
||||||
$this->module = new $class_name($this);
|
$this->module = new $class_name($this);
|
||||||
|
|
||||||
|
// 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'])
|
||||||
|
{
|
||||||
|
$icat = $this->module_ary[$this->active_module_row_id]['parent'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Not being able to overwrite ;)
|
||||||
|
$this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
* If this is an extension module, we'll try to automatically set
|
* If this is an extension module, we'll try to automatically set
|
||||||
* the style paths for the extension (the ext author can change them
|
* the style paths for the extension (the ext author can change them
|
||||||
|
@ -503,26 +535,12 @@ class p_master
|
||||||
{
|
{
|
||||||
$module_style_dir = 'ext/' . $module_dir[2] . '/' . $module_dir[3] . '/styles';
|
$module_style_dir = 'ext/' . $module_dir[2] . '/' . $module_dir[3] . '/styles';
|
||||||
|
|
||||||
if (is_dir($module_style_dir))
|
if (is_dir($phpbb_root_path . $module_style_dir))
|
||||||
{
|
{
|
||||||
$style->set_style(array($module_style_dir, 'styles'));
|
$phpbb_style->set_style(array($module_style_dir, 'styles'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We pre-define the action parameter we are using all over the place
|
|
||||||
if (defined('IN_ADMIN'))
|
|
||||||
{
|
|
||||||
// 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'])
|
|
||||||
{
|
|
||||||
$icat = $this->module_ary[$this->active_module_row_id]['parent'];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Not being able to overwrite ;)
|
|
||||||
$this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// If user specified the module url we will use it...
|
// If user specified the module url we will use it...
|
||||||
if ($module_url !== false)
|
if ($module_url !== false)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue