aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Guse <nathaniel.guse@gmail.com>2013-07-24 12:55:41 -0500
committerNathaniel Guse <nathaniel.guse@gmail.com>2013-07-24 12:56:39 -0500
commit4b761f65758c40db4851983fa3a08d354da3323d (patch)
tree8bc46941ba86b83d190dcb4648f275138215ed85
parentbfbc7aa74250ea5e9e39efc63caf7cfdb9407e14 (diff)
downloadforums-4b761f65758c40db4851983fa3a08d354da3323d.tar
forums-4b761f65758c40db4851983fa3a08d354da3323d.tar.gz
forums-4b761f65758c40db4851983fa3a08d354da3323d.tar.bz2
forums-4b761f65758c40db4851983fa3a08d354da3323d.tar.xz
forums-4b761f65758c40db4851983fa3a08d354da3323d.zip
[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
-rw-r--r--phpBB/adm/index.php2
-rw-r--r--phpBB/adm/swatch.php2
-rw-r--r--phpBB/includes/functions_module.php2
-rw-r--r--phpBB/install/index.php2
-rw-r--r--phpBB/install/install_update.php2
-rw-r--r--phpBB/phpbb/template/template.php5
-rw-r--r--phpBB/phpbb/template/twig/twig.php9
-rw-r--r--tests/template/includephp_test.php2
-rw-r--r--tests/template/template_events_test.php2
-rw-r--r--tests/template/template_test.php2
-rw-r--r--tests/template/template_test_case.php2
-rw-r--r--tests/template/template_test_case_with_tree.php2
12 files changed, 16 insertions, 18 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index 3f29072899..c79327d22c 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -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');
diff --git a/phpBB/adm/swatch.php b/phpBB/adm/swatch.php
index 70441ffeed..ef89081dc8 100644
--- a/phpBB/adm/swatch.php
+++ b/phpBB/adm/swatch.php
@@ -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')
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index a5ece1ecac..c84e02afe6 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -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'), '');
}
}
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index fd0d8a2d48..f80b975e2c 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -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');
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index 51fbd1975c..63f10c96d7 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -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'],
diff --git a/phpBB/phpbb/template/template.php b/phpBB/phpbb/template/template.php
index 95a48ba0ad..c77586587f 100644
--- a/phpBB/phpbb/template/template.php
+++ b/phpBB/phpbb/template/template.php
@@ -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
diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php
index 48ea8edeb1..c9249196e7 100644
--- a/phpBB/phpbb/template/twig/twig.php
+++ b/phpBB/phpbb/template/twig/twig.php
@@ -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();
diff --git a/tests/template/includephp_test.php b/tests/template/includephp_test.php
index 1afa933514..70e7cea232 100644
--- a/tests/template/includephp_test.php
+++ b/tests/template/includephp_test.php
@@ -46,7 +46,7 @@ class phpbb_template_includephp_test extends phpbb_template_template_test_case
$this->setup_engine(array('tpl_allow_php' => true));
- $this->template->set_custom_style('tests', $cache_dir, array(), '');
+ $this->template->set_custom_style('tests', $cache_dir, '');
$this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php");
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index 7de3ebbfae..1b2ab38e2b 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -107,6 +107,6 @@ Zeta test event in all',
dirname(__FILE__) . "/datasets/$dataset/"
);
$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context, $this->extension_manager);
- $this->template->set_custom_style('silver', array($this->template_path), $style_names, '');
+ $this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path), '');
}
}
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 3989f10229..0cc53f4d07 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -410,7 +410,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
$this->setup_engine(array('tpl_allow_php' => true));
- $this->template->set_custom_style('tests', $cache_dir, array(), '');
+ $this->template->set_custom_style('tests', $cache_dir, '');
$this->run_template('php.html', array(), array(), array(), 'test');
}
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index f90d291d15..00c89e4501 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -65,7 +65,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
$this->template_path = $this->test_path . '/templates';
$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $this->user, new phpbb_template_context());
- $this->template->set_custom_style('tests', $this->template_path, array(), '');
+ $this->template->set_custom_style('tests', $this->template_path, '');
}
protected function setUp()
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index 7de719f430..1a29fd27b0 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -21,6 +21,6 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
$this->template_path = $this->test_path . '/templates';
$this->parent_template_path = $this->test_path . '/parent_templates';
$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context());
- $this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path), array(), '');
+ $this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path), '');
}
}