- Patch #160395 by dvessel and merlinofchaos: allow theme engine to register theme variable functions.
parent
3a7d307845
commit
ff61e73a30
|
@ -278,11 +278,18 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists($prefix .'_preprocess')) {
|
// Let the theme engine register theme specific variable functions.
|
||||||
$info['preprocess functions'][] = $prefix .'_preprocess';
|
$prefixes[] = $prefix;
|
||||||
|
if ($type == 'theme_engine') {
|
||||||
|
$prefixes[] = $theme;
|
||||||
}
|
}
|
||||||
if (function_exists($prefix .'_preprocess_'. $hook)) {
|
foreach ($prefixes as $prefix) {
|
||||||
$info['preprocess functions'][] = $prefix .'_preprocess_'. $hook;
|
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'])) {
|
if (isset($cache[$hook]['preprocess functions']) && is_array($cache[$hook]['preprocess functions']) && empty($cache[$hook]['override preprocess functions'])) {
|
||||||
|
|
Loading…
Reference in New Issue