Line 114 | Line 114 |
---|
$this->user ) );
|
$this->user ) );
|
| if (defined('DEBUG')) { $this->twig->addExtension(new \Twig_Extension_Debug()); }
|
$lexer = new \phpbb\template\twig\lexer($this->twig);
| $lexer = new \phpbb\template\twig\lexer($this->twig);
|
Line 189 | Line 194 |
---|
{ $path = $this->phpbb_root_path . trim($directory, '/') . "/{$name}/"; $template_path = $path . 'template/';
|
{ $path = $this->phpbb_root_path . trim($directory, '/') . "/{$name}/"; $template_path = $path . 'template/';
|
| $theme_path = $path . 'theme/';
|
|
|
| $is_valid_dir = false;
|
if (is_dir($template_path))
|
if (is_dir($template_path))
|
| { $is_valid_dir = true; $paths[] = $template_path; } if (is_dir($theme_path)) { $is_valid_dir = true; $paths[] = $theme_path; }
if ($is_valid_dir)
|
{ // Add the base style directory as a safe directory $this->twig->getLoader()->addSafeDirectory($path);
|
{ // Add the base style directory as a safe directory $this->twig->getLoader()->addSafeDirectory($path);
|
$paths[] = $template_path;
| |
} } }
| } } }
|
Line 253 | Line 269 |
---|
{ $ext_style_template_path = $ext_path . $template_dir['ext_path']; $ext_style_path = dirname($ext_style_template_path);
|
{ $ext_style_template_path = $ext_path . $template_dir['ext_path']; $ext_style_path = dirname($ext_style_template_path);
|
| $ext_style_theme_path = $ext_style_path . 'theme/';
|
} 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['name'] . '/'; $ext_style_template_path = $ext_style_path . 'template/';
|
| $ext_style_theme_path = $ext_style_path . 'theme/';
|
} } else { $ext_style_path = $ext_path . 'styles/' . $template_dir . '/'; $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/';
|
| $ext_style_theme_path = $ext_style_path . 'theme/';
|
}
|
}
|
| $is_valid_dir = false;
|
if (is_dir($ext_style_template_path))
|
if (is_dir($ext_style_template_path))
|
| { $is_valid_dir = true; $paths[] = $ext_style_template_path; } if (is_dir($ext_style_theme_path)) { $is_valid_dir = true; $paths[] = $ext_style_theme_path; }
if ($is_valid_dir)
|
{ // Add the base style directory as a safe directory $this->twig->getLoader()->addSafeDirectory($ext_style_path);
|
{ // Add the base style directory as a safe directory $this->twig->getLoader()->addSafeDirectory($ext_style_path);
|
$paths[] = $ext_style_template_path;
| |
} }
| } }
|
Line 321 | Line 350 |
---|
return $this->twig->render($this->get_filename_from_handle($handle), $this->get_template_vars()); }
|
return $this->twig->render($this->get_filename_from_handle($handle), $this->get_template_vars()); }
|
$this->assign_var($template_var, $this->twig->render($this->get_filename_from_handle($handle, $this->get_template_vars())));
| $this->assign_var($template_var, $this->twig->render($this->get_filename_from_handle($handle), $this->get_template_vars()));
|
return $this; }
| return $this; }
|