Issue #1938948 by Cottser: Temporarily allow PHPTemplate themes to use .html.twig templates during Twig conversion.
parent
0fc4db86b6
commit
332293cd3f
|
@ -510,8 +510,8 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
|
||||||
if (!isset($info['path'])) {
|
if (!isset($info['path'])) {
|
||||||
$result[$hook]['template'] = $path . '/templates/' . $info['template'];
|
$result[$hook]['template'] = $path . '/templates/' . $info['template'];
|
||||||
}
|
}
|
||||||
if ($type == 'module') {
|
if ($type == 'module' || $type == 'theme_engine') {
|
||||||
// Add two render engines for modules.
|
// Add two render engines for modules and theme engines.
|
||||||
// @todo Remove and make twig the default engine.
|
// @todo Remove and make twig the default engine.
|
||||||
$render_engines = array(
|
$render_engines = array(
|
||||||
'.html.twig' => 'twig',
|
'.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));
|
_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.
|
// Finally, hooks provided by the theme itself.
|
||||||
_theme_process_registry($cache, $theme->name, 'theme', $theme->name, dirname($theme->filename));
|
_theme_process_registry($cache, $theme->name, 'theme', $theme->name, dirname($theme->filename));
|
||||||
|
|
||||||
|
@ -1127,7 +1133,9 @@ function theme($hook, $variables = array()) {
|
||||||
$extension = $extension_function();
|
$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')) {
|
if (function_exists($info['engine'] . '_render_template')) {
|
||||||
$render_function = $info['engine'] . '_render_template';
|
$render_function = $info['engine'] . '_render_template';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue