Dev version of uc_views
This commit is contained in:
60
uc_views/uc_views.module
Normal file
60
uc_views/uc_views.module
Normal file
@ -0,0 +1,60 @@
|
||||
<?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_tables().
|
||||
*/
|
||||
function uc_views_date_api_tables() {
|
||||
return array('uc_orders', 'uc_cart_products');
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of hook_date_api_fields().
|
||||
*/
|
||||
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'),
|
||||
);
|
||||
|
||||
switch ($field) {
|
||||
case 'uc_orders.created':
|
||||
case 'uc_orders.modified':
|
||||
case 'uc_cart_products.changed':
|
||||
return $values;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementataion of hook_draggableviews_handlers().
|
||||
*/
|
||||
function uc_views_draggableviews_handlers() {
|
||||
return array(
|
||||
'ubercart' => array(
|
||||
'file' => 'draggableviews_handler_ubercart.inc',
|
||||
'title' => t('Ubercart'),
|
||||
'description' => 'Ubercart product list position.',
|
||||
'handler' => 'draggableviews_handler_ubercart',
|
||||
),
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user