function menu_get_custom_theme

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 menu.inc menu_get_custom_theme($initialize = FALSE)
cle7 menu.inc menu_get_custom_theme($initialize = FALSE)
elmsmedia7 menu.inc menu_get_custom_theme($initialize = FALSE)
icor7 menu.inc menu_get_custom_theme($initialize = FALSE)
meedjum_blog7 menu.inc menu_get_custom_theme($initialize = FALSE)
mooc7 menu.inc menu_get_custom_theme($initialize = FALSE)

Gets the custom theme for the current page, if there is one.

Parameters

$initialize: This parameter should only be used internally; it is set to TRUE in order to force the custom theme to be initialized for the current page request.

Return value

The machine-readable name of the custom theme, if there is one.

See also

menu_set_custom_theme()

Related topics

3 calls to menu_get_custom_theme()
drupal_theme_initialize in includes/theme.inc
Initializes the theme system by loading the theme.
menu_set_custom_theme in includes/menu.inc
Sets a custom theme for the current page, if there is one.
menu_test_theme_page_callback in modules/simpletest/tests/menu_test.module
Page callback to use when testing the theme callback functionality.

File

includes/menu.inc, line 1740
API for the Drupal menu system.

Code

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'))) {
    // First allow modules to dynamically set a custom theme for the current
    // page. Since we can only have one, the last module to return a valid
    // theme takes precedence.
    $custom_themes = array_filter(module_invoke_all('custom_theme'), 'drupal_theme_access');
    if (!empty($custom_themes)) {
      $custom_theme = array_pop($custom_themes);
    }
    // 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;
      }
    }
  }
  return $custom_theme;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.