function menu_test_theme_page_callback

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

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.