You are here

function _date_views_argument_summary in Date 5.2

Views values vary depending on the op: $op = 'summary' $argtype = name of the argument $query = views object $arg = argument type

File

date/date_views.inc, line 459

Code

function _date_views_argument_summary(&$query, $argtype, $arg, $field_type) {
  $field_name = _date_views_arg_field_name($argtype);
  $field = content_fields($field_name);
  $db_info = content_database_info($field);
  $value = substr($field_name, -1) == 2 ? 'value2' : 'value';
  $value = $db_info['columns'][$value]['column'];
  $table = 'node_data_' . $field['field_name'];
  $sql_field = "{$table}.{$value}";
  $date_handler = new date_sql_handler();
  $date_handler
    ->construct($field_type);
  $date_handler->sql_field_name = $sql_field;
  $date_handler->granularity = $arg;
  date_views_set_timezone($date_handler, $field);
  $query->date_handler = $date_handler;
  $format = $date_handler
    ->views_formats($date_handler->granularity, 'sql');
  $fieldinfo['field'] = $date_handler
    ->sql_format($format, $date_handler
    ->sql_field($sql_field));
  $fieldinfo['fieldname'] = 'range';
  $query
    ->ensure_table($table);
  return $fieldinfo;
}