mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 14:48:53 +00:00
[ticket/13133] Allow @vendor_name for includecss
PHPBB3-13133
This commit is contained in:
parent
5b186c936d
commit
911831a9c5
1 changed files with 28 additions and 4 deletions
|
@ -189,13 +189,24 @@ class twig extends \phpbb\template\base
|
||||||
{
|
{
|
||||||
$path = $this->phpbb_root_path . trim($directory, '/') . "/{$name}/";
|
$path = $this->phpbb_root_path . trim($directory, '/') . "/{$name}/";
|
||||||
$template_path = $path . 'template/';
|
$template_path = $path . 'template/';
|
||||||
|
$theme_path = $path . 'theme/';
|
||||||
|
|
||||||
|
$ok = false;
|
||||||
if (is_dir($template_path))
|
if (is_dir($template_path))
|
||||||
|
{
|
||||||
|
$ok = true;
|
||||||
|
$paths[] = $template_path;
|
||||||
|
}
|
||||||
|
if (is_dir($theme_path))
|
||||||
|
{
|
||||||
|
$ok = true;
|
||||||
|
$paths[] = $theme_path;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($ok)
|
||||||
{
|
{
|
||||||
// Add the base style directory as a safe directory
|
// Add the base style directory as a safe directory
|
||||||
$this->twig->getLoader()->addSafeDirectory($path);
|
$this->twig->getLoader()->addSafeDirectory($path);
|
||||||
|
|
||||||
$paths[] = $template_path;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -253,25 +264,38 @@ class twig extends \phpbb\template\base
|
||||||
{
|
{
|
||||||
$ext_style_template_path = $ext_path . $template_dir['ext_path'];
|
$ext_style_template_path = $ext_path . $template_dir['ext_path'];
|
||||||
$ext_style_path = dirname($ext_style_template_path);
|
$ext_style_path = dirname($ext_style_template_path);
|
||||||
|
$ext_style_theme_path = $ext_style_path . 'theme/';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ext_style_path = $ext_path . 'styles/' . $template_dir['name'] . '/';
|
$ext_style_path = $ext_path . 'styles/' . $template_dir['name'] . '/';
|
||||||
$ext_style_template_path = $ext_style_path . 'template/';
|
$ext_style_template_path = $ext_style_path . 'template/';
|
||||||
|
$ext_style_theme_path = $ext_style_path . 'theme/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$ext_style_path = $ext_path . 'styles/' . $template_dir . '/';
|
$ext_style_path = $ext_path . 'styles/' . $template_dir . '/';
|
||||||
$ext_style_template_path = $ext_style_path . 'template/';
|
$ext_style_template_path = $ext_style_path . 'template/';
|
||||||
|
$ext_style_theme_path = $ext_style_path . 'theme/';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$ok = false;
|
||||||
if (is_dir($ext_style_template_path))
|
if (is_dir($ext_style_template_path))
|
||||||
|
{
|
||||||
|
$ok = true;
|
||||||
|
$paths[] = $ext_style_template_path;
|
||||||
|
}
|
||||||
|
if (is_dir($ext_style_theme_path))
|
||||||
|
{
|
||||||
|
$ok = true;
|
||||||
|
$paths[] = $ext_style_theme_path;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($ok)
|
||||||
{
|
{
|
||||||
// Add the base style directory as a safe directory
|
// Add the base style directory as a safe directory
|
||||||
$this->twig->getLoader()->addSafeDirectory($ext_style_path);
|
$this->twig->getLoader()->addSafeDirectory($ext_style_path);
|
||||||
|
|
||||||
$paths[] = $ext_style_template_path;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue