summaryrefslogtreecommitdiff
path: root/includes/theme.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/theme.inc')
-rw-r--r--includes/theme.inc31
1 files changed, 16 insertions, 15 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index 0ad132f10..32feb595a 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -189,7 +189,7 @@ function _drupal_theme_initialize($theme, $base_theme = array(), $registry_callb
}
}
- if (function_exists($registry_callback)) {
+ if (drupal_function_exists($registry_callback)) {
$registry_callback($theme, $base_theme, $theme_engine);
}
}
@@ -322,6 +322,7 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
if (function_exists($function)) {
$result = $function($cache, $type, $theme, $path);
+
foreach ($result as $hook => $info) {
$result[$hook]['type'] = $type;
$result[$hook]['theme path'] = $path;
@@ -335,14 +336,12 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
// functions on behalf of core .include files.
// All files are included to be safe. Conditionally included
// files can prevent them from getting registered.
- if (isset($cache[$hook]['includes'])) {
- $result[$hook]['includes'] = $cache[$hook]['includes'];
+ if (isset($info['file']) && !isset($info['path'])) {
+ $result[$hook]['file'] = $path . '/' . $info['file'];
+ include_once DRUPAL_ROOT . '/' . $result[$hook]['file'];
}
- if (isset($info['file'])) {
- $include_file = isset($info['path']) ? $info['path'] : $path;
- $include_file .= '/' . $info['file'];
- include_once DRUPAL_ROOT . '/' . $include_file;
- $result[$hook]['includes'][] = $include_file;
+ elseif (isset($info['file']) && isset($info['path'])) {
+ include_once DRUPAL_ROOT . '/' . $info['path'] . '/' . $info['file'];
}
// If 'arguments' have been defined previously, carry them forward.
@@ -761,10 +760,12 @@ function theme() {
$theme_path = $info['theme path'];
// Include a file if the theme function or variable processor is held elsewhere.
- if (!empty($info['includes'])) {
- foreach ($info['includes'] as $include_file) {
- include_once DRUPAL_ROOT . '/' . $include_file;
+ if (!empty($info['file'])) {
+ $include_file = $info['file'];
+ if (isset($info['path'])) {
+ $include_file = $info['path'] . '/' . $include_file;
}
+ include_once DRUPAL_ROOT . '/' . $include_file;
}
if (isset($info['function'])) {
// The theme call is a function.
@@ -803,7 +804,7 @@ function theme() {
foreach (array('preprocess functions', 'process functions') as $phase) {
if (!empty($info[$phase])) {
foreach ($info[$phase] as $processor_function) {
- if (function_exists($processor_function)) {
+ if (drupal_function_exists($processor_function)) {
$processor_function($variables, $hook_clone);
}
}
@@ -829,7 +830,7 @@ function theme() {
$suggestions[] = $variables['theme_function'];
}
foreach (array_reverse($suggestions) as $suggestion) {
- if (function_exists($suggestion)) {
+ if (drupal_function_exists($suggestion)) {
$info['function'] = $suggestion;
break;
}
@@ -841,7 +842,7 @@ function theme() {
}
// Call the function.
- if (function_exists($info['function'])) {
+ if (drupal_function_exists($info['function'])) {
$output = call_user_func_array($info['function'], $args);
}
}
@@ -884,7 +885,7 @@ function theme() {
foreach (array('preprocess functions', 'process functions') as $phase) {
if (!empty($info[$phase])) {
foreach ($info[$phase] as $processor_function) {
- if (function_exists($processor_function)) {
+ if (drupal_function_exists($processor_function)) {
call_user_func_array($processor_function, $args);
}
}