Obtain the title of the page.

Parameters

string $page_text: Raw text to be use as fallback to infer the page's title.

Return value

string the page's title.

1 call to _easy_breadcrumb_obtain_page_title()
_easy_breadcrumb_build_items in ./easy_breadcrumb.module
Helper function to generate breadcrumb items.

File

./easy_breadcrumb.module, line 355

Code

function _easy_breadcrumb_obtain_page_title($page_text) {
    $use_page_title_when_available = variable_get(EasyBreadcrumbConstants::DB_VAR_TITLE_FROM_PAGE_WHEN_AVAILABLE, TRUE);
    // Tries to get the title of the current page (if available).
    if ($use_page_title_when_available) {
        $title = drupal_get_title();
    }
    // Just deduce the title from the given fallback.
    if (!isset($title) || $title === '') {
        $title = _easy_breadcrumb_normalize_text($page_text);
    }
    return $title;
}