You are here

function date_navigation_plugin_style::query in Date 7

Same name and namespace in other branches
  1. 6.2 includes/date_navigation_plugin_style.inc \date_navigation_plugin_style::query()
  2. 6 date_api.views.inc \date_navigation_plugin_style::query()

Add anything to the query that we might need to.

Overrides views_plugin_style::query

File

date_views/includes/date_navigation_plugin_style.inc, line 44
Views navigation style plugin for Date API.

Class

date_navigation_plugin_style
Style plugin to create date back/next navigation.

Code

function query() {
  module_load_include('inc', 'date_api', 'date_api_sql');

  // Bring the argument information into the view so our theme can access it.
  $i = 0;
  foreach ($this->view->argument as $id => $argument) {
    if ($id == 'date_argument') {
      $this->view->date_info->granularity = $argument->granularity;
      $this->view->date_info->date_arg = !empty($this->view->args) && count($this->view->args) > $argument->position ? $this->view->args[$argument->position] : '';
      $this->view->date_info->date_arg_pos = $i;
      $this->view->date_info->year = isset($argument->year) ? $argument->year : NULL;
      $this->view->date_info->month = isset($argument->month) ? $argument->month : NULL;
      $this->view->date_info->day = isset($argument->day) ? $argument->day : NULL;
      $this->view->date_info->week = isset($argument->week) ? $argument->week : NULL;
      $this->view->date_info->min_date = $argument->min_date;
      $this->view->date_info->max_date = $argument->max_date;
      $this->view->date_info->url = $this->view
        ->get_url();
    }
    $i++;
  }

  // bring the node type into the query so we can use it in the theme
  $this->view->query
    ->add_field('node', 'type');
}