Project

General

Profile

Paste
Download (2.38 KB) Statistics
| Branch: | Revision:

root / drupal7 / sites / all / modules / calendar / includes / calendar.views.inc @ 62e0cc08

1
<?php
2

    
3
/**
4
 * @file
5
 *
6
 * Creates calendar displays of Views results.
7
 */
8
/**
9
 * Implementation of hook_views_plugins
10
 */
11
function calendar_views_plugins() {
12
  $views_path = drupal_get_path('module', 'views');
13
  $module_path = drupal_get_path('module', 'calendar');
14
  $theme_path = $module_path;
15
  module_load_include('inc', 'calendar', 'theme/theme');
16

    
17
  // Limit these plugins to base tables that represent entities.
18
  $base = array_keys(date_views_base_tables());
19

    
20
  $data = array(
21
    'module' => 'calendar', // This just tells our themes are elsewhere.
22

    
23
    'style' => array(
24
      'calendar_style' => array(
25
        'title' => t('Calendar'),
26
        'help' => t('Present view results as a Calendar.'),
27
        'handler' => 'calendar_plugin_style',
28
        'path' => "$module_path/includes",
29
        'theme' => 'calendar_style',
30
        'theme file' => 'theme.inc',
31
        'theme path' => "$module_path/theme",
32
        'additional themes' => array(
33
          'calendar_mini' => 'style',
34
          'calendar_day' => 'style',
35
          'calendar_week' => 'style',
36
          'calendar_month' => 'style',
37
          'calendar_year' => 'style',
38
          'calendar_day_overlap' => 'style',
39
          'calendar_week_overlap' => 'style',
40
        ),
41
        'uses fields' => TRUE,
42
        'uses grouping' => FALSE,
43
        'uses row plugin' => TRUE,
44
        'uses row class' => TRUE,
45
        'uses options' => TRUE,
46
        'type' => 'normal',
47
        'even empty' => TRUE,
48
        'base' => $base,
49
      ),
50
    ),
51
    'row' => array(
52
      'calendar_node' => array(
53
        'title' => t('Calendar Items (DEPRECATED, switch to Calendar Entities)'),
54
        'help' => t('Displays each selected node as a Calendar item.'),
55
        'handler' => 'calendar_plugin_row_node',
56
        'path' => "$module_path/includes",
57
        'base' => array('node'), // only works with 'node' as base.
58
        'uses options' => TRUE,
59
        'uses fields' => TRUE,
60
        'type' => 'normal',
61
        'no ui' => TRUE,
62
      ),
63
      'calendar_entity' => array(
64
        'title' => t('Calendar Entities'),
65
        'help' => t('Displays each selected entity as a Calendar item.'),
66
        'handler' => 'calendar_plugin_row',
67
        'theme' => 'views_view_fields',
68
        'path' => "$module_path/includes",
69
        'base' => $base,
70
        'uses options' => TRUE,
71
        'uses fields' => TRUE,
72
        'type' => 'normal',
73
      ),
74
    ),
75
  );
76
  return $data;
77
}