You are here

function cleanpager_path in Clean Pagination 6

Same name and namespace in other branches
  1. 7 cleanpager.module \cleanpager_path()

Remove number at end of path

3 calls to cleanpager_path()
cleanpager_check_match in ./cleanpager.module
Checks if the page should use clean pagination
cleanpager_init in ./cleanpager.module
Implementation of hook_init().
cleanpager_theme_pager_link in ./cleanpager.module
Override theme for a pager link

File

./cleanpager.module, line 99

Code

function cleanpager_path() {
  $q = $_GET['q'];
  $q_array = explode('/', $_GET['q']);
  if (_cleanpager_is_pager_element(end($q_array))) {
    array_pop($q_array);

    // Check for page/page_number
    if (variable_get('cleanpager_use_additional_path', TRUE)) {
      if (end($q_array) == CLEANPAGER_ADDITIONAL_PATH_VARIABLE) {
        array_pop($q_array);
        $q = implode('/', $q_array);
      }
    }
    else {
      $q = implode('/', $q_array);
    }
  }
  return $q;
}