You are here

function date_views_querystring in Date 7

Same name and namespace in other branches
  1. 8 date_views/includes/date_views.views.inc \date_views_querystring()
  2. 6.2 includes/date_api.views.inc \date_views_querystring()
  3. 7.3 date_views/includes/date_views.views.inc \date_views_querystring()
  4. 7.2 date_views/includes/date_views.views.inc \date_views_querystring()
1 call to date_views_querystring()
date_views_page_url in date_views/includes/date_views.views.inc
Identify the base url of the page, needed when the calendar is embedded so we don't set the url to the calendar url.

File

date_views/includes/date_views.views.inc, line 175
Defines date-related Views data and plugins:

Code

function date_views_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',
  );

  // If we don't explicitly add a value for "view", filter it out.
  if (empty($extra_params['view'])) {
    $exclude[] = 'view';
  }
  $query = drupal_http_build_query(drupal_get_query_parameters($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;
}