You are here

function bootstrap_library_check_path in Bootstrap Library 7

1 call to bootstrap_library_check_path()
bootstrap_library_init in ./bootstrap_library.module
Implements hook_init().

File

./bootstrap_library.module, line 93
Primarily Drupal hooks.

Code

function bootstrap_library_check_path($visibility, $pages) {
  $pages = drupal_strtolower($pages);

  // Convert the Drupal path to lowercase
  $path = drupal_strtolower(drupal_get_path_alias($_GET['q']));

  // Compare the lowercase internal and lowercase path alias (if any).
  $page_match = drupal_match_path($path, $pages);
  if ($path != $_GET['q']) {
    $page_match = $page_match || drupal_match_path($_GET['q'], $pages);
  }

  // When $block->visibility has a value of 0 (BLOCK_VISIBILITY_NOTLISTED),
  // the block is displayed on all pages except those listed in $block->pages.
  // When set to 1 (BLOCK_VISIBILITY_LISTED), it is displayed only on those
  // pages listed in $block->pages.
  $page_match = !($visibility xor $page_match);
  return $page_match;
}