tablesort_get_querystring

Definition

tablesort_get_querystring()
includes/tablesort.inc, line 136

Description

Compose a query string to append to table sorting requests.

Return value

A query string that consists of all components of the current page request except for those pertaining to table sorting.

Code

<?php
function tablesort_get_querystring() {
  $cgi = $_SERVER['REQUEST_METHOD'] == 'GET' ? $_GET : $_POST;
  $query_string = '';
  foreach ($cgi as $key => $val) {
    if ($key != 'order' && $key != 'sort' && $key != 'q') {
      $query_string .= '&'. $key .'='. $val;
    }
  }
  return $query_string;
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.