function menu_test_theme_page_callback in Drupal 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 modules/
simpletest/ tests/ menu_test.module - Implements hook_menu().
File
- modules/
simpletest/ tests/ menu_test.module, line 418 - 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 = "Custom theme: {$requested_theme}. Actual theme: {$theme_key}.";
if ($inherited) {
$output .= ' Theme callback inheritance is being tested.';
}
return $output;
}