diff --git a/html/includes/theme.inc b/html/includes/theme.inc index 6b3582c..fe11750 100644 --- a/html/includes/theme.inc +++ b/html/includes/theme.inc @@ -522,30 +522,26 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { 'process functions' => 'process', ); - // Keep a list of phase (process and preprocess) functions keyed by $phase - // and $prefix. - static $phase_functions, $hook_specific_phase_functions; + // Keep a list of phase (process and preprocess) functions keyed by $function. + static $phase_functions; if (!isset($phase_functions)) { $phase_functions = array(); - $hook_specific_phase_functions = array(); $all_functions = get_defined_functions(); $functions = $all_functions['user']; foreach ($variable_process_phases as $phase_key => $phase) { foreach (preg_grep('/_' . $phase . '/', $functions) as $function) { list($prefix,) = explode('_' . $phase, $function, 2); if ($function === $prefix . '_' . $phase) { - $phase_functions[$phase][$prefix] = $function; + $phase_functions[$function] = TRUE; } elseif (strpos($function, $prefix . '_' . $phase . '_') === 0) { - $theme_hook = str_replace($prefix . '_' . $phase . '_', '', $function); - $hook_specific_phase_functions[$phase][$prefix][$theme_hook] = $function; + $phase_functions[$function] = TRUE; } } } } $module_list = module_list(); - $hook_defaults = array( 'variables' => TRUE, 'render element' => TRUE, @@ -635,10 +631,10 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { foreach ($prefixes as $prefix) { // Only use non-hook-specific variable processors for theming hooks // implemented as templates. See theme(). - if (isset($info['template']) && isset($phase_functions[$phase][$prefix])) { + if (isset($info['template']) && isset($phase_functions[$prefix . '_' . $phase])) { $info[$phase_key][] = $prefix . '_' . $phase; } - if (isset($hook_specific_phase_functions[$phase][$prefix][$hook])) { + if (isset($phase_functions[$prefix . '_' . $phase . '_' . $hook])) { $info[$phase_key][] = $prefix . '_' . $phase . '_' . $hook; } } @@ -673,10 +669,10 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) { } // Only use non-hook-specific variable processors for theming hooks // implemented as templates. See theme(). - if (isset($info['template']) && isset($phase_functions[$phase][$name])) { + if (isset($info['template']) && isset($phase_functions[$name . '_' . $phase])) { $cache[$hook][$phase_key][] = $name . '_' . $phase; } - if (isset($hook_specific_phase_functions[$phase][$name][$hook])) { + if (isset($phase_functions[$name . '_' . $phase . '_' . $hook])) { $cache[$hook][$phase_key][] = $name . '_' . $phase . '_' . $hook; $cache[$hook]['theme path'] = $path; }