You are here

function calendar_real_url in Calendar 5.2

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

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

6 calls to calendar_real_url()
calendar_get_url in ./calendar.module
An alternative to views_get_url() that will correctly substitute replacement values like $group or $node.
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_nav_title in ./calendar.theme
Theme the navigation bar title
theme_calendar_views_calendar in ./calendar.theme
Calendar Views plugin theme, overrides default views theme to create a calendar view.

... See full list

File

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

Code

function calendar_real_url($view, $args) {
  if (empty($args)) {
    return $view->url;
  }

  // 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 (substr($part, 0, 1) == '$') {
      $parts[$delta] = array_shift($args);
      $bump++;
    }
  }

  // Add in any arguments before the calendar starts.
  $start_cal = array_shift(calendar_arg_positions($view));
  foreach ($args as $delta => $arg) {
    if ($delta < $start_cal && !empty($arg)) {
      array_push($parts, $arg);
    }
  }
  return implode('/', $parts);
}