menu_get_custom_theme
- Versions
- 7
menu_get_custom_theme($initialize = FALSE)
Gets the custom theme for the current page, if there is one.
See also
Parameters
$initialize This parameter should only be used internally; it is set to TRUE in order to force the custom theme to be initialized from the menu router item for the current page.
Return value
The machine-readable name of the custom theme, if there is one.
Related topics
Code
includes/menu.inc, line 1500
<?php
function menu_get_custom_theme($initialize = FALSE) {
$custom_theme = &drupal_static(__FUNCTION__);
// Skip this if the site is offline or being installed or updated, since the
// menu system may not be correctly initialized then.
if ($initialize && !_menu_site_is_offline(TRUE) && (!defined('MAINTENANCE_MODE') || (MAINTENANCE_MODE != 'update' && MAINTENANCE_MODE != 'install'))) {
$router_item = menu_get_item();
if (!empty($router_item['access']) && !empty($router_item['theme_callback']) && function_exists($router_item['theme_callback'])) {
$custom_theme = call_user_func_array($router_item['theme_callback'], $router_item['theme_arguments']);
}
}
return $custom_theme;
}
?>Login or register to post comments 