-
Notifications
You must be signed in to change notification settings - Fork 1
/
thai_date_util.views.inc
executable file
·57 lines (54 loc) · 1.45 KB
/
thai_date_util.views.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* Implementation of hook_views_data_alter()
*/
function thai_date_util_views_data_alter(&$data) {
// created field
if (isset($data['node']['created'])) {
$data['node']['created']['field'] = array(
'handler' => 'thai_date_util_handler_field_date',
'click sortable' => TRUE,
);
}
if (isset($data['node']['changed'])) {
$data['node']['changed']['field'] = array(
'handler' => 'thai_date_util_handler_field_date',
'click sortable' => TRUE,
);
}
}
/* Failed to render views field
function thai_date_util_views_data() {
$data['date_container']['table']['group'] = t('Date Container');
$data['date_container']['table']['join'] = array(
'#global' => array(),
);
$data['date_container']['date'] = array(
'title' => t('Markup'),
'help' => t('Display custom markup text.'),
'field' => array(
'handler' => 'thai_date_util_handler_field_markup',
'click sortable' => FALSE,
'notafield' => TRUE,
),
);
return $data;
}
*/
function thai_date_util_views_handlers() {
return array(
'info' => array(
'path' => drupal_get_path('module', 'thai_date_util') .'/includes',
),
'handlers' => array(
'thai_date_util_handler_field_date' => array(
'parent' => 'date_handler_field_multiple',
),
/* Failed to render views field
'thai_date_util_handler_field_markup' => array(
'parent' => 'views_handler_field',
),
*/
),
);
}