forked from openscholar/views_ical
-
Notifications
You must be signed in to change notification settings - Fork 0
/
views_ical.module
80 lines (73 loc) · 1.84 KB
/
views_ical.module
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
/**
* Implements hook_date_format_types().
*/
function views_ical_date_format_types() {
// Define iCal date format type.
return array(
'ical' => t('iCal'),
);
}
/**
* Implements hook_date_formats().
*/
function views_ical_date_formats() {
return array(
array(
'type' => 'ical',
'format' => 'Ymd\THi\0\0\Z',
'locales' => array(),
),
);
}
/**
* Implements hook_views_api().
*/
function views_ical_views_api() {
return array(
'api' => 3,
'path' => drupal_get_path('module', 'views_ical'),
);
}
/**
* Implements hook_views_plugins
*/
function views_ical_views_plugins() {
$module_path = drupal_get_path('module', 'views_ical');
$theme_path = $module_path . '/theme';
$plugins = array(
'module' => 'views_ical', // This just tells our themes are elsewhere.
'style' => array(
'views_ical' => array(
'title' => t('Views iCal Feed'),
'help' => t('Generates an iCal VCALENDAR feed from a view.'),
'handler' => 'views_ical_plugin_style_ical_feed',
'path' => $module_path,
'theme' => 'views_ical_vcalendar',
'theme file' => 'theme.inc',
'theme path' => $theme_path,
'uses fields' => TRUE,
'uses grouping' => FALSE,
'uses row plugin' => TRUE,
'uses options' => FALSE,
'type' => 'feed',
'even empty' => TRUE,
),
),
'row' => array(
'views_ical' => array(
'title' => t('Views iCal Fields'),
'help' => t('Display fields for an iCal VEVENT item.'),
'handler' => 'views_plugin_row',
'path' => $module_path,
'theme' => 'views_ical_vevent',
'theme file' => 'theme.inc',
'theme path' => $theme_path,
'uses options' => FALSE,
'uses fields' => TRUE,
'type' => 'feed',
),
),
);
return $plugins;
}