mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-11 19:24:01 +02:00
[ticket/11628] Remove third parameter ($names) from set_custom_style
This was basically duplicating functionality. $names would be used if not empty, else array($name) would be used. Merged functionality into the first argument PHPBB3-11628
This commit is contained in:
@@ -50,7 +50,7 @@ $module_id = request_var('i', '');
|
||||
$mode = request_var('mode', '');
|
||||
|
||||
// Set custom style for admin area
|
||||
$template->set_custom_style('admin', $phpbb_admin_path . 'style', array(), '');
|
||||
$template->set_custom_style('admin', $phpbb_admin_path . 'style', '');
|
||||
$template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets');
|
||||
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
|
||||
|
||||
|
@@ -22,7 +22,7 @@ $auth->acl($user->data);
|
||||
$user->setup();
|
||||
|
||||
// Set custom template for admin area
|
||||
$template->set_custom_style('admin', $phpbb_admin_path . 'style', array(), '');
|
||||
$template->set_custom_style('admin', $phpbb_admin_path . 'style', '');
|
||||
|
||||
$template->set_filenames(array(
|
||||
'body' => 'colour_swatch.html')
|
||||
|
@@ -508,7 +508,7 @@ class p_master
|
||||
|
||||
if (is_dir($module_style_dir))
|
||||
{
|
||||
$template->set_custom_style('admin', array($module_style_dir, $phpbb_admin_path . 'style'), array(), '');
|
||||
$template->set_custom_style('admin', array($module_style_dir, $phpbb_admin_path . 'style'), '');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -213,7 +213,7 @@ $config = new phpbb_config(array(
|
||||
));
|
||||
|
||||
$template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context());
|
||||
$template->set_custom_style('admin', $phpbb_admin_path . 'style', array(), '');
|
||||
$template->set_custom_style('admin', $phpbb_admin_path . 'style', '');
|
||||
$template->assign_var('T_ASSETS_PATH', '../assets');
|
||||
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
|
||||
|
||||
|
@@ -138,7 +138,7 @@ class install_update extends module
|
||||
}
|
||||
|
||||
// Set custom template again. ;)
|
||||
$template->set_custom_style('admin', $phpbb_admin_path . 'style', array(), '');
|
||||
$template->set_custom_style('admin', $phpbb_admin_path . 'style', '');
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_USER_LANG' => $user->lang['USER_LANG'],
|
||||
|
@@ -55,13 +55,12 @@ interface phpbb_template
|
||||
*
|
||||
* Note: Templates are still compiled to phpBB's cache directory.
|
||||
*
|
||||
* @param string $name Name of style, used for cache prefix. Examples: "admin", "prosilver"
|
||||
* @param string|array $names Array of names or string of name of template(s) in inheritance tree order, used by extensions.
|
||||
* @param array or string $paths Array of style paths, relative to current root directory
|
||||
* @param array $names Array of names of templates in inheritance tree order, used by extensions. If empty, $name will be used.
|
||||
* @param string $template_path Path to templates, relative to style directory. False if path should be set to default (templates/).
|
||||
* @return phpbb_template $this
|
||||
*/
|
||||
public function set_custom_style($name, $paths, $names = array(), $template_path = false);
|
||||
public function set_custom_style($names, $paths, $template_path = false);
|
||||
|
||||
/**
|
||||
* Sets the style names/paths corresponding to style hierarchy being compiled
|
||||
|
@@ -236,22 +236,21 @@ class phpbb_template_twig implements phpbb_template
|
||||
*
|
||||
* Note: Templates are still compiled to phpBB's cache directory.
|
||||
*
|
||||
* @param string $name Name of style, used for cache prefix. Examples: "admin", "prosilver"
|
||||
* @param string|array $names Array of names or string of name of template(s) in inheritance tree order, used by extensions.
|
||||
* @param array or string $paths Array of style paths, relative to current root directory
|
||||
* @param array $names Array of names of templates in inheritance tree order, used by extensions. If empty, $name will be used.
|
||||
* @param string $template_path Path to templates, relative to style directory. False if path should be set to default (templates/).
|
||||
* @return phpbb_template $this
|
||||
*/
|
||||
public function set_custom_style($name, $paths, $names = array(), $template_path = false)
|
||||
public function set_custom_style($names, $paths, $template_path = false)
|
||||
{
|
||||
if (is_string($paths))
|
||||
{
|
||||
$paths = array($paths);
|
||||
}
|
||||
|
||||
if (empty($names))
|
||||
if (!is_array($names))
|
||||
{
|
||||
$names = array($name);
|
||||
$names = array($names);
|
||||
}
|
||||
|
||||
$new_paths = array();
|
||||
|
Reference in New Issue
Block a user