diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-11-08 12:21:06 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-11-17 16:42:40 -0500 |
commit | 44d6dc4c4ccf969fd3d84f3b39bfd24ecd3a3f9d (patch) | |
tree | 5dd030f606400f049141dbc9b086e6288b6dd0b7 /phpBB/includes/style | |
parent | 0a29312d830c65dc293822c291bf2efd6f93a29b (diff) | |
download | forums-44d6dc4c4ccf969fd3d84f3b39bfd24ecd3a3f9d.tar forums-44d6dc4c4ccf969fd3d84f3b39bfd24ecd3a3f9d.tar.gz forums-44d6dc4c4ccf969fd3d84f3b39bfd24ecd3a3f9d.tar.bz2 forums-44d6dc4c4ccf969fd3d84f3b39bfd24ecd3a3f9d.tar.xz forums-44d6dc4c4ccf969fd3d84f3b39bfd24ecd3a3f9d.zip |
[feature/template-events] Convert a single style name to array of them.
This allows template code to know the entire style hierarchy for
templates being rendered.
PHPBB3-9550
Diffstat (limited to 'phpBB/includes/style')
-rw-r--r-- | phpBB/includes/style/style.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/phpBB/includes/style/style.php b/phpBB/includes/style/style.php index effd496fb9..9ce96c5da5 100644 --- a/phpBB/includes/style/style.php +++ b/phpBB/includes/style/style.php @@ -110,18 +110,27 @@ class phpbb_style * * @param string $name Name of style, used for cache prefix. Examples: "admin", "prosilver" * @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/). */ - public function set_custom_style($name, $paths, $template_path = false) + public function set_custom_style($name, $paths, $names = array(), $template_path = false) { if (is_string($paths)) { $paths = array($paths); } + if (empty($names)) + { + $names = array($name); + } + $this->names = $names; + $this->provider->set_styles($paths); $this->locator->set_paths($this->provider); + $this->template->style_names = $names; + if ($template_path !== false) { $this->locator->set_template_path($template_path); |