You are here

function breadcrumb_manager_is_title_required in Breadcrumb Manager 7

Check if the current page title is missing or in blacklist.

Return value

bool|string Returns the page title if it's required. Otherwise returns FALSE.

3 calls to breadcrumb_manager_is_title_required()
BreadcrumbManagerTitleMetaTag::getElement in includes/breadcrumb_manager.metatag.inc
Get the HTML tag for this meta tag.
breadcrumb_manager_preprocess_html in ./breadcrumb_manager.module
Implements hook_preprocess_html().
breadcrumb_manager_preprocess_page in ./breadcrumb_manager.module
Implements hook_preprocess_page().

File

./breadcrumb_manager.module, line 375
Code for Breadcrumb Manager module.

Code

function breadcrumb_manager_is_title_required() {
  $title = trim(drupal_get_title());
  $title_in_blacklist = FALSE;
  if (!empty($title)) {
    $titles_blacklist = explode("\n", trim(variable_get('breadcrumb_manager_titles_blacklist', '')));
    foreach ($titles_blacklist as $blacklist_title) {
      if ($title == trim($blacklist_title)) {
        $title_in_blacklist = TRUE;
        break;
      }
    }
  }
  if ((empty($title) || $title_in_blacklist) && variable_get('breadcrumb_manager_set_title', FALSE)) {
    $source = current_path();
    $alias = drupal_lookup_path('alias', $source);
    $path = !empty($alias) ? $alias : $source;
    $title = breadcrumb_manager_get_title($path);
    return !empty($title) ? $title : FALSE;
  }
  return FALSE;
}