You are here

function photoswipe_active_url in PhotoSwipe 6

Verify that PhotoSwipe should be active for the current URL.

1 call to photoswipe_active_url()
photoswipe_init in ./photoswipe.module
Implementation of hook_init().

File

./photoswipe.module, line 65

Code

function photoswipe_active_url() {
  $pages = variable_get('photoswipe_pages', "");
  if (variable_get('photoswipe_active_type', 'disable') == 'disable') {
    $pages .= "admin*\nnode/add/*\nnode/*/edit";
  }

  // disable admin and edit pages
  $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);
  }
  if (variable_get('photoswipe_active_type', 'disable') == 'disable') {
    return !$page_match;
  }
  else {
    return $page_match;
  }
}