Commit 332293cd authored by catch's avatar catch

Issue #1938948 by Cottser: Temporarily allow PHPTemplate themes to use...

Issue #1938948 by Cottser: Temporarily allow PHPTemplate themes to use .html.twig templates during Twig conversion.
parent 0fc4db86
......@@ -510,8 +510,8 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
if (!isset($info['path'])) {
$result[$hook]['template'] = $path . '/templates/' . $info['template'];
}
if ($type == 'module') {
// Add two render engines for modules.
if ($type == 'module' || $type == 'theme_engine') {
// Add two render engines for modules and theme engines.
// @todo Remove and make twig the default engine.
$render_engines = array(
'.html.twig' => 'twig',
......@@ -663,6 +663,12 @@ function _theme_build_registry($theme, $base_theme, $theme_engine) {
_theme_process_registry($cache, $theme_engine, 'theme_engine', $theme->name, dirname($theme->filename));
}
if ($theme_engine == 'phptemplate') {
// Check for Twig templates if this is a PHPTemplate theme.
// @todo Remove this once all core themes are converted to Twig.
_theme_process_registry($cache, 'twig', 'theme_engine', $theme->name, dirname($theme->filename));
}
// Finally, hooks provided by the theme itself.
_theme_process_registry($cache, $theme->name, 'theme', $theme->name, dirname($theme->filename));
......@@ -1127,7 +1133,9 @@ function theme($hook, $variables = array()) {
$extension = $extension_function();
}
}
elseif (isset($info['engine'])) {
// @todo Change this 'if' back to 'elseif' once Twig conversion is
// complete. Normally only modules have this key set.
if (isset($info['engine'])) {
if (function_exists($info['engine'] . '_render_template')) {
$render_function = $info['engine'] . '_render_template';
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment