From ff61e73a3003d97dff7aec6bda4abf68677a139b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 1 Sep 2007 05:35:15 +0000 Subject: - Patch #160395 by dvessel and merlinofchaos: allow theme engine to register theme variable functions. --- includes/theme.inc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'includes') diff --git a/includes/theme.inc b/includes/theme.inc index 542721b85..19cb0a086 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -278,11 +278,18 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { } } - if (function_exists($prefix .'_preprocess')) { - $info['preprocess functions'][] = $prefix .'_preprocess'; + // Let the theme engine register theme specific variable functions. + $prefixes[] = $prefix; + if ($type == 'theme_engine') { + $prefixes[] = $theme; } - if (function_exists($prefix .'_preprocess_'. $hook)) { - $info['preprocess functions'][] = $prefix .'_preprocess_'. $hook; + foreach ($prefixes as $prefix) { + if (function_exists($prefix .'_preprocess')) { + $info['preprocess functions'][] = $prefix .'_preprocess'; + } + if (function_exists($prefix .'_preprocess_'. $hook)) { + $info['preprocess functions'][] = $prefix .'_preprocess_'. $hook; + } } } if (isset($cache[$hook]['preprocess functions']) && is_array($cache[$hook]['preprocess functions']) && empty($cache[$hook]['override preprocess functions'])) { -- cgit v1.2.3