From 84c72d06f03163115ae9bbc939e6ab2dbc65eb28 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 27 Nov 2010 20:25:44 +0000 Subject: =?UTF-8?q?-=20Patch=20#669510=20by=20quicksketch,=20David=5FRoths?= =?UTF-8?q?tein,=20Dave=20Reid,=20casey,=20G=C3=A1bor=20Hojtsy,=20mrfelton?= =?UTF-8?q?,=20effulgentsia:=20merge=20administration=20theme=20with=20hoo?= =?UTF-8?q?k=5Fadmin=5Fpaths().?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/menu.inc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'includes') 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; } } } -- cgit v1.2.3