You are here

function views_handler_argument::default_summary in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 6.2 handlers/views_handler_argument.inc \views_handler_argument::default_summary()
  2. 7.3 handlers/views_handler_argument.inc \views_handler_argument::default_summary()

Default action: summary.

If an argument was expected and was not given, in this case, display a summary query.

File

handlers/views_handler_argument.inc, line 542

Class

views_handler_argument
Base class for arguments.

Code

function default_summary($order, $by = NULL) {
  $this->view->build_info['summary'] = TRUE;
  $this->view->build_info['summary_level'] = $this->options['id'];

  // Change the display style to the summary style for this
  // argument.
  $this->view->plugin_name = $this->options['style_plugin'];
  $this->view->style_options = $this->options['style_options'];

  // Clear out the normal primary field and whatever else may have
  // been added and let the summary do the work.
  $this->query
    ->clear_fields();
  $this
    ->summary_query();
  $this
    ->summary_sort($order, $by);

  // Summaries have their own sorting and fields, so tell the View not
  // to build these.
  $this->view->build_sort = $this->view->build_fields = FALSE;
  return TRUE;
}