function fancybox_active in fancyBox 7
Same name and namespace in other branches
- 6 fancybox.module \fancybox_active()
- 7.2 fancybox.module \fancybox_active()
Check whether Fancybox should be initialized for the current URL.
1 call to fancybox_active()
- fancybox_init in ./
fancybox.module - Implementation of hook_init().
File
- ./
fancybox.module, line 55 - Provides the Fancybox jQuery plugin for displaying images, HTML content and multimedia in an elegant box.
Code
function fancybox_active($settings) {
// If PHP is selected, evaluate it.
if ($settings['activation']['activation_type'] == 'php') {
if (module_exists('php')) {
return php_eval($settings['activation']['activation_pages']);
}
else {
return FALSE;
}
}
// Compare defined paths with the current path.
$path = drupal_get_path_alias($_GET['q']);
$page_match = drupal_match_path($path, $settings['activation']['activation_pages']);
if ($path != $_GET['q']) {
$page_match = $page_match || drupal_match_path($_GET['q'], $settings['activation']['activation_pages']);
}
// Decide whether to include or exclude pages.
if ($settings['activation']['activation_type'] == 'exclude') {
return !$page_match;
}
else {
return $page_match;
}
}