aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-05-11 14:10:45 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2012-11-17 16:39:59 -0500
commit9c31a0ffc785e30c4ff87e8d9d66e7989b55d8ef (patch)
treec86ef1435b9a19e32d92badd1612a5e83bd4f9b9 /phpBB/includes
parent0df0c6199b89f154eb6371118b4a796a4d05f36f (diff)
downloadforums-9c31a0ffc785e30c4ff87e8d9d66e7989b55d8ef.tar
forums-9c31a0ffc785e30c4ff87e8d9d66e7989b55d8ef.tar.gz
forums-9c31a0ffc785e30c4ff87e8d9d66e7989b55d8ef.tar.bz2
forums-9c31a0ffc785e30c4ff87e8d9d66e7989b55d8ef.tar.xz
forums-9c31a0ffc785e30c4ff87e8d9d66e7989b55d8ef.zip
[feature/template-events] Rename template_name to style_name.
"Style name" makes a lot more sense and should be in line with recent style/template changes. PHPBB3-9550
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/template/compile.php6
-rw-r--r--phpBB/includes/template/filter.php20
-rw-r--r--phpBB/includes/template/template.php9
3 files changed, 18 insertions, 17 deletions
diff --git a/phpBB/includes/template/compile.php b/phpBB/includes/template/compile.php
index e2e9a095dc..c2762bfd59 100644
--- a/phpBB/includes/template/compile.php
+++ b/phpBB/includes/template/compile.php
@@ -36,17 +36,17 @@ class phpbb_template_compile
* Constructor.
*
* @param bool $allow_php Whether PHP code will be allowed in templates (inline PHP code, PHP tag and INCLUDEPHP tag)
- * @param string $template_name Name of top-level template being compiled
+ * @param string $style_name Name of style to which the template being compiled belongs
* @param phpbb_style_resource_locator $locator Resource locator
* @param string $phpbb_root_path Path to phpBB root directory
* @param phpbb_extension_manager $extension_manager Extension manager to use for finding template fragments in extensions; if null, template hooks will not be invoked
* @param phpbb_user $user Current user
*/
- public function __construct($allow_php, $template_name, $locator, $phpbb_root_path, $extension_manager = null, $user = null)
+ public function __construct($allow_php, $style_name, $locator, $phpbb_root_path, $extension_manager = null, $user = null)
{
$this->filter_params = array(
'allow_php' => $allow_php,
- 'template_name' => $template_name,
+ 'style_name' => $style_name,
'locator' => $locator,
'phpbb_root_path' => $phpbb_root_path,
'extension_manager' => $extension_manager,
diff --git a/phpBB/includes/template/filter.php b/phpBB/includes/template/filter.php
index 385612b094..a87bfaef34 100644
--- a/phpBB/includes/template/filter.php
+++ b/phpBB/includes/template/filter.php
@@ -88,14 +88,15 @@ class phpbb_template_filter extends php_user_filter
private $phpbb_root_path;
/**
- * Name of the top-level template being compiled and/or rendered.
+ * Name of the style that the template being compiled and/or rendered
+ * belongs to.
*
- * This is used by hooks implementation to invoke template-specific
+ * This is used by hooks implementation to invoke style-specific
* template hooks.
*
* @var string
*/
- private $template_name;
+ private $style_name;
/**
* Extension manager.
@@ -168,7 +169,7 @@ class phpbb_template_filter extends php_user_filter
/**
* Initializer, called on creation.
*
- * Get the allow_php option, template_name, root directory and locator from params,
+ * Get the allow_php option, style_name, root directory and locator from params,
* which are passed to stream_filter_append.
*/
public function onCreate()
@@ -178,7 +179,7 @@ class phpbb_template_filter extends php_user_filter
$this->allow_php = $this->params['allow_php'];
$this->locator = $this->params['locator'];
$this->phpbb_root_path = $this->params['phpbb_root_path'];
- $this->template_name = $this->params['template_name'];
+ $this->style_name = $this->params['style_name'];
$this->extension_manager = $this->params['extension_manager'];
if (isset($this->params['user']))
{
@@ -932,17 +933,16 @@ class phpbb_template_filter extends php_user_filter
$files = array_merge($files, $finder
->extension_prefix($location)
->extension_suffix('.html')
- ->extension_directory("/styles/" . $this->template_name . "/template")
+ ->extension_directory("/styles/" . $this->style_name . "/template")
->get_files());
$all_compiled = '';
foreach ($files as $file)
{
$compiled = $this->template_compile->compile_file($file);
- if ($compiled === false)
- {
- trigger_error(sprintf('The file could not be compiled: %s', phpbb_filter_root_path($file)), E_USER_ERROR);
- }
+ if ($compiled === false) {
+ trigger_error(sprintf('The file could not be compiled: %s', phpbb_filter_root_path($file)), E_USER_ERROR);
+ }
$all_compiled .= $compiled;
}
// Need spaces inside php tags as php cannot grok
diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php
index 19ee59323a..3de5cd45a5 100644
--- a/phpBB/includes/template/template.php
+++ b/phpBB/includes/template/template.php
@@ -82,14 +82,15 @@ class phpbb_template
private $extension_manager;
/**
- * Name of the top-level template being compiled and/or rendered.
+ * Name of the style that the template being compiled and/or rendered
+ * belongs to.
*
- * This is used by hooks implementation to invoke template-specific
+ * This is used by hooks implementation to invoke style-specific
* template hooks.
*
* @var string
*/
- private $template_name;
+ private $style_name;
/**
* Constructor.
@@ -301,7 +302,7 @@ class phpbb_template
return new phpbb_template_renderer_include($output_file, $this);
}
- $compile = new phpbb_template_compile($this->config['tpl_allow_php'], $this->template_name, $this->locator, $this->phpbb_root_path, $this->extension_manager, $this->user);
+ $compile = new phpbb_template_compile($this->config['tpl_allow_php'], $this->style_name, $this->locator, $this->phpbb_root_path, $this->extension_manager, $this->user);
if ($compile->compile_file_to_file($source_file, $output_file) !== false)
{