You are here

function _custom_breadcrumbs_paths_page_match in Custom Breadcrumbs 6.2

Same name and namespace in other branches
  1. 7.2 custom_breadcrumbs_paths/custom_breadcrumbs_paths.module \_custom_breadcrumbs_paths_page_match()

Determines if the current path matches the breadcrumb specific path.

Parameters

$breadcrumb: The breadcrumb object.

Return value

$page_match TRUE if the current path matches the breadcrumb specific path, FALSE otherwise.

1 call to _custom_breadcrumbs_paths_page_match()
_custom_breadcrumbs_paths_set_breadcrumb in custom_breadcrumbs_paths/custom_breadcrumbs_paths.module
Checks for a custom breadcrumb at the current path and sets it if one is found.

File

custom_breadcrumbs_paths/custom_breadcrumbs_paths.module, line 205

Code

function _custom_breadcrumbs_paths_page_match($breadcrumb) {
  $page_match = FALSE;
  if (isset($_REQUEST['q'])) {
    if (isset($breadcrumb->language) && $breadcrumb->language != '') {

      // Check for a match on the prefixed path.
      $path = $breadcrumb->language . '/' . $breadcrumb->specific_path;
      $page_match = _custom_breadcrumbs_match_path($_REQUEST['q'], $path);
    }
    else {

      // Append the current language if the breadcrumb language is 'All'.
      global $language;
      $path = $language->language . '/' . $breadcrumb->specific_path;
      $page_match = _custom_breadcrumbs_match_path($_REQUEST['q'], $path);
    }
    if (!$page_match) {

      // Check for a direct match.
      $page_match = _custom_breadcrumbs_match_path($_REQUEST['q'], $breadcrumb->specific_path);
    }
  }
  return $page_match;
}