function ctools_page_title_content_type_render

Output function for the 'page_title' content type.

Outputs the page title of the current page.

File

plugins/content_types/page/page_title.inc, line 31

Code

function ctools_page_title_content_type_render($subtype, $conf, $panel_args) {
    // $conf['override_title'] can have one of these three values.
    // 0 i.e. hide the title, 1 i.e. no title, and 2 i.e. pane title if it's a
    // panels page.
    if (!drupal_get_title() && isset($conf['override_title']) && $conf['override_title'] === 1) {
        return;
    }
    // TODO: This should have a setting or something for the markup.
    if (empty($conf['markup'])) {
        $conf['markup'] = 'h1';
    }
    if (empty($conf['class'])) {
        $conf['class'] = '';
    }
    if (empty($conf['id'])) {
        $conf['id'] = '';
    }
    $token = ctools_set_callback_token('title', array(
        'ctools_page_title_content_type_token',
        $conf['markup'],
        $conf['id'],
        $conf['class'],
    ));
    $block = new stdClass();
    if ($token) {
        $block->content = $token;
    }
    return $block;
}