You are here

function calendar_querystring in Calendar 5.2

Pick up filter and sort info from url.

6 calls to calendar_querystring()
calendar_page_url in ./calendar.module
Identify the base url of the page, needed when the calendar is embedded so we don't set the url to the calendar url.
calendar_views_query_alter in ./calendar.module
Implementation of hook_views_query() Insert filters into the query based on the current calendar view and the selected fields Used when the actual view arguments don't provide enough info to construct the query. i.e. on a view with no arguments…
theme_calendar_date_box in ./calendar.theme
Format an date's day box in a calendar
theme_calendar_links in ./calendar.theme
Links at the top of the calendar.
theme_calendar_nav in ./calendar.theme
Function to construct back and next navigation from views arguments

... See full list

File

./calendar.module, line 572
Adds calendar filtering and displays to Views.

Code

function calendar_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_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;
}