You are here

function cleanpager_check_match in Clean Pagination 7

Same name and namespace in other branches
  1. 5 cleanpager.module \cleanpager_check_match()
  2. 6 cleanpager.module \cleanpager_check_match()

Checks if the page should use clean pagination

3 calls to cleanpager_check_match()
cleanpager_boot in ./cleanpager.module
Implements hook_boot().
cleanpager_init in ./cleanpager.module
Implements hook_init().
cleanpager_theme_pager_link in ./cleanpager.module
Override theme for a pager link

File

./cleanpager.module, line 168

Code

function cleanpager_check_match() {
  $q_use = NULL;
  $q = cleanpager_path();
  if (cleanpager_match_path($q)) {
    $q_use = $q;
  }

  // The main path didn't work, try the path alias.
  if ($q_use === NULL) {
    $q = drupal_get_path_alias($q);
    if (cleanpager_match_path($q)) {
      $q_use = $q;
    }
    else {
      $q = drupal_get_normal_path($q);
      if (cleanpager_match_path($q)) {
        $q_use = $q;
      }
    }
  }

  // The path was matched.
  if ($q_use !== NULL) {
    _cleanpager_rewrite_path();
    return $q;
  }
  return FALSE;
}