You are here

function lightbox2_exclude_these_paths in Lightbox2 6

Same name and namespace in other branches
  1. 8 lightbox2.module \lightbox2_exclude_these_paths()
  2. 5.2 lightbox2.module \lightbox2_exclude_these_paths()
  3. 5 lightbox2.module \lightbox2_exclude_these_paths()
  4. 7.2 lightbox2.module \lightbox2_exclude_these_paths()
  5. 7 lightbox2.module \lightbox2_exclude_these_paths()

Return TRUE if current path is disabled for lightbox according to lightbox2_page_list and lightbox2_page_init_action.

1 call to lightbox2_exclude_these_paths()
lightbox2_init in ./lightbox2.module
Implementation of hook_init().

File

./lightbox2.module, line 1132
Enables the use of lightbox2 which places images above your current page, not within. This frees you from the constraints of the layout, particularly column widths.

Code

function lightbox2_exclude_these_paths() {
  $action = variable_get('lightbox2_page_init_action', 'page_disable');
  $page_list = variable_get('lightbox2_page_list', '');
  if (!empty($page_list)) {

    // Retrieve Drupal alias for the current path (if exists).
    $alias = drupal_get_path_alias($_GET['q']);
    if (drupal_match_path($_GET['q'], $page_list) || drupal_match_path($alias, $page_list)) {
      return $action == 'page_disable' ? 1 : 0;
    }
  }
  return $action == 'page_disable' ? 0 : 1;
}