You are here

uc_views.module in Ubercart Views 6.2

Same filename and directory in other branches
  1. 6.3 uc_views.module
  2. 6 uc_views.module

File

uc_views.module
View source
<?php

/**
 * Implementation of hook_views_api().
 */
function uc_views_views_api() {
  return array(
    'api' => '2.0',
    'path' => drupal_get_path('module', 'uc_views') . '/views',
  );
}

/**
 * Implementation of hook_date_api_fields().
 * on behalf of core fields.
 *
 * All modules that create custom fields that use the
 * 'views_handler_field_date' handler can provide
 * additional information here about the type of
 * date they create so the date can be used by
 * the Date API views date argument and date filter.
 *
 * Thank you justindodge for this! 
 */
function uc_views_date_api_fields($field) {
  $values = array(
    // The type of date: DATE_UNIX, DATE_ISO, DATE_DATETIME.
    'sql_type' => DATE_UNIX,
    // Timezone handling options: 'none', 'site', 'date', 'utc'.
    'tz_handling' => 'site',
    // Needed only for dates that use 'date' tz_handling.
    'timezone_field' => '',
    // Needed only for dates that use 'date' tz_handling.
    'offset_field' => '',
    // Array of "table.field" values for related fields that should be
    // loaded automatically in the Views SQL.
    'related_fields' => array(),
    // Granularity of this date field's db data.
    'granularity' => array(
      'year',
      'month',
      'day',
      'hour',
      'minute',
      'second',
    ),
  );
  return $values;
}

Functions

Namesort descending Description
uc_views_date_api_fields Implementation of hook_date_api_fields(). on behalf of core fields.
uc_views_views_api Implementation of hook_views_api().