summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2007-09-01 05:35:15 (GMT)
committerDries Buytaert2007-09-01 05:35:15 (GMT)
commitff61e73a3003d97dff7aec6bda4abf68677a139b (patch)
tree2198b5031311996d64320e35be0d0e543d07abe7
parent3a7d3078451f1881f8f9580dc76d1d3d3af1e621 (diff)
- Patch #160395 by dvessel and merlinofchaos: allow theme engine to register theme variable functions.
-rw-r--r--includes/theme.inc15
1 files changed, 11 insertions, 4 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index 542721b..19cb0a0 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'])) {