forked from developmentseed/FeatureServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfserver.views.inc
80 lines (74 loc) · 2 KB
/
fserver.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
<?php
/**
* Implementation of hook_views_plugins().
*/
function fserver_views_plugins() {
return array(
'module' => 'views',
'style' => array(
'updatexml' => array(
'title' => t('Update XML'),
'help' => t('Generates a project XML feed compatible with the update module.'),
'handler' => 'fserver_plugin_style_updatexml',
'theme' => 'fserver_updatexml',
'theme path' => drupal_get_path('module', 'fserver') .'/views',
'path' => drupal_get_path('module', 'fserver') .'/views',
'uses row plugin' => FALSE,
'uses fields' => TRUE,
'uses options' => TRUE,
'type' => 'feed',
),
),
);
}
/**
* Implementation of hook_views_plugins().
*/
function fserver_views_data() {
$data = array();
// MD5 hash
$data['files']['mdhash'] = array(
'real field' => 'filepath',
'title' => t('MD5 hash'),
'help' => t('Provides an MD5 hash of the file.'),
'field' => array(
'handler' => 'fserver_handler_field_mdhash',
),
);
// Release tag (Content group)
$data['views']['release_tag'] = array(
'group' => t('Content'),
'title' => t('Release tag'),
'help' => t('Formatted release tag [Core].x-[Major].[Patch][-Extra]'),
'field' => array(
'handler' => 'fserver_handler_field_release_tag',
'click sortable' => TRUE,
'title' => t('Release'),
),
'sort' => array(
'handler' => 'fserver_handler_sort_release_tag',
),
);
return $data;
}
/**
* Implementation of hook_views_handlers().
*/
function fserver_views_handlers() {
return array(
'info' => array(
'path' => drupal_get_path('module', 'fserver') .'/views',
),
'handlers' => array(
'fserver_handler_field_mdhash' => array(
'parent' => 'views_handler_field',
),
'fserver_handler_field_release_tag' => array(
'parent' => 'views_handler_field',
),
'fserver_handler_sort_release_tag' => array(
'parent' => 'views_handler_sort',
),
),
);
}