aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/template/twig/twig.php32
-rw-r--r--phpBB/phpbb/version_helper.php5
2 files changed, 30 insertions, 7 deletions
diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php
index 9d3b994ce6..bf27dd5f20 100644
--- a/phpBB/phpbb/template/twig/twig.php
+++ b/phpBB/phpbb/template/twig/twig.php
@@ -214,9 +214,13 @@ class twig extends \phpbb\template\base
*
* Note: Templates are still compiled to phpBB's cache directory.
*
- * @param string|array $names Array of names or string of name of template(s) in inheritance tree order, used by extensions.
- * @param string|array or string $paths Array of style paths, relative to current root directory
- * @return phpbb_template $this
+ * @param string|array $names Array of names (or detailed names) or string of name of template(s) in inheritance tree order, used by extensions.
+ * E.g. array(
+ * 'name' => 'adm',
+ * 'ext_path' => 'adm/style/',
+ * )
+ * @param string|array of string $paths Array of style paths, relative to current root directory
+ * @return \phpbb\template\template $this
*/
public function set_custom_style($names, $paths)
{
@@ -237,10 +241,26 @@ class twig extends \phpbb\template\base
$namespace = str_replace('/', '_', $ext_namespace);
$paths = array();
- foreach ($names as $style_name)
+ foreach ($names as $template_dir)
{
- $ext_style_path = $ext_path . 'styles/' . $style_name . '/';
- $ext_style_template_path = $ext_style_path . 'template/';
+ if (is_array($template_dir))
+ {
+ if (isset($template_dir['ext_path']))
+ {
+ $ext_style_template_path = $ext_path . $template_dir['ext_path'];
+ $ext_style_path = dirname($ext_style_template_path);
+ }
+ else
+ {
+ $ext_style_path = $ext_path . 'styles/' . $template_dir['name'] . '/';
+ $ext_style_template_path = $ext_style_path . 'template/';
+ }
+ }
+ else
+ {
+ $ext_style_path = $ext_path . 'styles/' . $template_dir . '/';
+ $ext_style_template_path = $ext_style_path . 'template/';
+ }
if (is_dir($ext_style_template_path))
{
diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php
index 47e9bbe0f3..5991744e76 100644
--- a/phpBB/phpbb/version_helper.php
+++ b/phpBB/phpbb/version_helper.php
@@ -251,7 +251,7 @@ class version_helper
$info = json_decode($info, true);
- if (empty($info['stable']) || empty($info['unstable']))
+ if (empty($info['stable']) && empty($info['unstable']))
{
$this->user->add_lang('acp/common');
@@ -267,6 +267,9 @@ class version_helper
}
}
+ $info['stable'] = (empty($info['stable'])) ? array() : $info['stable'];
+ $info['unstable'] = (empty($info['unstable'])) ? $info['stable'] : $info['unstable'];
+
$this->cache->put($cache_file, $info, 86400); // 24 hours
}