function date_querystring in Date 6.2
Pick up filter and sort info from url.
1 call to date_querystring()
- date_real_url in ./
date_api.module - Figure out the URL of the date view we're currently looking at, adapted to various date types or specific date arguments.
File
- ./
date_api.module, line 2478 - This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.
Code
function date_querystring($view, $extra_params = array()) {
$query_params = array_merge($_GET, $extra_params);
// Allow NULL params to be removed from the query string.
foreach ($extra_params as $key => $value) {
if (!isset($value)) {
unset($query_params[$key]);
}
}
// Filter the special "q" and "view" variables out of the query string.
$exclude = array(
'q',
);
$query = drupal_query_string_encode($query_params, $exclude);
// To prevent an empty query string from adding a "?" on to the end of a URL,
// we return NULL.
return !empty($query) ? $query : NULL;
}