-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathyql_views_query.views.inc
94 lines (87 loc) · 2.4 KB
/
yql_views_query.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/**
* Implements hook_views_data
*/
/**
* @todo Please document this function.
* @see http://drupal.org/node/1354
*/
function yql_views_query_views_data() {
$data['yql']['table']['group'] = t('YQL');
$data['yql']['table']['base'] = array(
'title' => t('YQL Query: Flexible'),
'help' => t('Flexible querying from YQL endpoint.'),
'query class' => 'yql_query',
);
$data['yql']['column'] = array(
'title' => t('Column'),
'help' => t('Add/filter the value of a column in the table.'),
'field' => array(
'handler' => 'yql_views_query_handler_field_column',
),
'filter' => array(
'handler' => 'yql_views_query_handler_filter_column',
),
'sort' => array(
'handler' => 'yql_views_query_handler_sort_column',
),
'argument' => array(
'handler' => 'yql_views_query_handler_argument_column',
),
);
return $data;
}
/**
* Implements hook_views_handlers().
*/
function yql_views_query_views_handlers() {
return array(
'info' => array(
'path' => drupal_get_path('module', 'yql_views_query') . '/handlers',
),
'handlers' => array(
// Fields
'yql_views_query_handler_field' => array(
'parent' => 'views_handler_field',
),
'yql_views_query_handler_field_column' => array(
'parent' => 'yql_views_query_handler_field',
),
// Filters
'yql_views_query_handler_filter' => array(
'parent' => 'views_handler_filter',
),
'yql_views_query_handler_filter_column' => array(
'parent' => 'yql_views_query_handler_filter',
),
// Sort handlers
'yql_views_query_handler_sort' => array(
'parent' => 'views_handler_sort',
),
'yql_views_query_handler_sort_column' => array(
'parent' => 'yql_views_query_handler_sort',
),
// Argument handlers
'yql_views_query_handler_argument' => array(
'parent' => 'views_handler_argument',
),
'yql_views_query_handler_argument_column' => array(
'parent' => 'yql_views_query_handler_argument',
),
),
);
}
/**
* Implements hook_views_plugins().
*/
function yql_views_query_views_plugins() {
return array(
'query' => array(
'yql_query' => array(
'title' => t('YQL Query'),
'help' => t('Query will be generated and run using YQL.'),
'handler' => 'yql_views_query_plugin_query_yql',
),
),
);
}