function scrollreveal_check_path in Scroll Reveal 7
Same name and namespace in other branches
- 7.2 scrollreveal.module \scrollreveal_check_path()
1 call to scrollreveal_check_path()
- scrollreveal_init in ./
scrollreveal.module - Implements hook_init().
File
- ./
scrollreveal.module, line 26 - Basic Module file.
Code
function scrollreveal_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;
}