You are here

function menu_test_theme_page_callback in SimpleTest 7

Page callback to use when testing the theme callback functionality.

Parameters

$inherited: An optional boolean to set to TRUE when the requested page is intended to inherit the theme of its parent.

Return value

A string describing the requested custom theme and actual theme being used for the current page request.

1 string reference to 'menu_test_theme_page_callback'
menu_test_menu in tests/menu_test.module
Implement hook_menu().

File

tests/menu_test.module, line 83
Dummy module implementing hook menu.

Code

function menu_test_theme_page_callback($inherited = FALSE) {
  global $theme_key;

  // Initialize the theme system so that $theme_key will be populated.
  drupal_theme_initialize();

  // Now check both the requested custom theme and the actual theme being used.
  $custom_theme = menu_get_custom_theme();
  $requested_theme = empty($custom_theme) ? 'NONE' : $custom_theme;
  $output = "Requested theme: {$requested_theme}. Actual theme: {$theme_key}.";
  if ($inherited) {
    $output .= ' Theme callback inheritance is being tested.';
  }
  return $output;
}