diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-11-27 20:25:44 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-11-27 20:25:44 +0000 |
commit | 84c72d06f03163115ae9bbc939e6ab2dbc65eb28 (patch) | |
tree | 70506c548713a51c9f9e51e866849b5858de46fd /includes/menu.inc | |
parent | 22cfc5bb2cf84d88356b50ab8f497add152d1858 (diff) | |
download | brdo-84c72d06f03163115ae9bbc939e6ab2dbc65eb28.tar.gz brdo-84c72d06f03163115ae9bbc939e6ab2dbc65eb28.tar.bz2 |
- Patch #669510 by quicksketch, David_Rothstein, Dave Reid, casey, Gábor Hojtsy, mrfelton, effulgentsia: merge administration theme with hook_admin_paths().
Diffstat (limited to 'includes/menu.inc')
-rw-r--r-- | includes/menu.inc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/includes/menu.inc b/includes/menu.inc index b19abdbb4..382f02cd4 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -1651,15 +1651,14 @@ function menu_get_custom_theme($initialize = FALSE) { if (!empty($custom_themes)) { $custom_theme = array_pop($custom_themes); } - // Otherwise, execute the theme callback function for the current page, if - // there is one, in order to determine the custom theme to set. - if (!isset($custom_theme)) { - $router_item = menu_get_item(); - if (!empty($router_item['access']) && !empty($router_item['theme_callback']) && function_exists($router_item['theme_callback'])) { - $theme_name = call_user_func_array($router_item['theme_callback'], $router_item['theme_arguments']); - if (drupal_theme_access($theme_name)) { - $custom_theme = $theme_name; - } + // If there is a theme callback function for the current page, execute it. + // If this returns a valid theme, it will override any theme that was set + // by a hook_custom_theme() implementation above. + $router_item = menu_get_item(); + if (!empty($router_item['access']) && !empty($router_item['theme_callback']) && function_exists($router_item['theme_callback'])) { + $theme_name = call_user_func_array($router_item['theme_callback'], $router_item['theme_arguments']); + if (drupal_theme_access($theme_name)) { + $custom_theme = $theme_name; } } } |