function _colorbox_active in Colorbox 6
Same name and namespace in other branches
- 7.2 colorbox.module \_colorbox_active()
- 7 colorbox.module \_colorbox_active()
Check if Colorbox should be active for the current URL.
Return value
TRUE if Colorbox should be active for the current page.
2 calls to _colorbox_active()
- colorbox_handler_field_colorbox::render in views/
colorbox_handler_field_colorbox.inc - Render the trigger field and its linked popup information.
- _colorbox_doheader in ./
colorbox.module - Loads the various js and css files.
File
- ./
colorbox.module, line 140 - A light-weight, customizable lightbox plugin for jQuery 1.3
Code
function _colorbox_active() {
// Make it possible deactivate Colorbox with
// parameter ?colorbox=no in the url.
if (isset($_GET['colorbox']) && $_GET['colorbox'] == 'no') {
return FALSE;
}
// Code from the block_list funtion in block.module.
$path = drupal_get_path_alias($_GET['q']);
$colorbox_pages = variable_get('colorbox_pages', "admin*\nimg_assist*\nimce*\nnode/add/*\nnode/*/edit");
// Compare with the internal and path alias (if any).
$page_match = drupal_match_path($path, $colorbox_pages);
if ($path != $_GET['q']) {
$page_match = $page_match || drupal_match_path($_GET['q'], $colorbox_pages);
}
return !$page_match;
}