You are here

function calendar_real_url in Calendar 5

Same name and namespace in other branches
  1. 5.2 calendar.module \calendar_real_url()

Figure out what the URL of the calendar view we're currently looking at is.

3 calls to calendar_real_url()
calendar_get_nodes in ./calendar.module
The workhorse function that takes the beginning array of items and alters it to an array of calendar nodes that the theme can handle.
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_show_nav in ./calendar.theme
Format the calendar navigation

File

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

Code

function calendar_real_url($view, $args) {

  // Add non-calendar arguments to the base url.
  $parts = explode('/', $view->url);
  $bump = 0;
  foreach ($parts as $delta => $part) {

    // If one of the args is buried in the url, add it here and adjust
    // the delta values we'll compare the calendar arg positions to.
    if (in_array($part, array(
      '$arg',
      '$node',
      '$user',
      '$group',
    ))) {
      $parts[$delta] = array_shift($args);
      $bump++;
    }
  }
  foreach ($args as $delta => $arg) {
    if (!in_array($delta + $bump, calendar_arg_positions($view)) && !empty($arg)) {
      array_push($parts, $arg);
    }
  }
  return implode('/', $parts);
}