calendar.views.inc 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * @file
  4. *
  5. * Creates calendar displays of Views results.
  6. */
  7. /**
  8. * Implementation of hook_views_plugins
  9. */
  10. function calendar_views_plugins() {
  11. $views_path = drupal_get_path('module', 'views');
  12. $module_path = drupal_get_path('module', 'calendar');
  13. $theme_path = $module_path;
  14. module_load_include('inc', 'calendar', 'theme/theme');
  15. // Limit these plugins to base tables that represent entities.
  16. $base = array_keys(date_views_base_tables());
  17. $data = array(
  18. 'module' => 'calendar', // This just tells our themes are elsewhere.
  19. 'style' => array(
  20. 'calendar_style' => array(
  21. 'title' => t('Calendar'),
  22. 'help' => t('Present view results as a Calendar.'),
  23. 'handler' => 'calendar_plugin_style',
  24. 'path' => "$module_path/includes",
  25. 'theme' => 'calendar_style',
  26. 'theme file' => 'theme.inc',
  27. 'theme path' => "$module_path/theme",
  28. 'additional themes' => array(
  29. 'calendar_mini' => 'style',
  30. 'calendar_day' => 'style',
  31. 'calendar_week' => 'style',
  32. 'calendar_month' => 'style',
  33. 'calendar_year' => 'style',
  34. 'calendar_day_overlap' => 'style',
  35. 'calendar_week_overlap' => 'style',
  36. ),
  37. 'uses fields' => TRUE,
  38. 'uses grouping' => FALSE,
  39. 'uses row plugin' => TRUE,
  40. 'uses options' => TRUE,
  41. 'type' => 'normal',
  42. 'even empty' => TRUE,
  43. 'base' => $base,
  44. ),
  45. ),
  46. 'row' => array(
  47. 'calendar_node' => array(
  48. 'title' => t('Calendar Items (DEPRECATED, switch to Calendar Entities)'),
  49. 'help' => t('Displays each selected node as a Calendar item.'),
  50. 'handler' => 'calendar_plugin_row_node',
  51. 'path' => "$module_path/includes",
  52. 'base' => array('node'), // only works with 'node' as base.
  53. 'uses options' => TRUE,
  54. 'uses fields' => TRUE,
  55. 'type' => 'normal',
  56. ),
  57. 'calendar_entity' => array(
  58. 'title' => t('Calendar Entities'),
  59. 'help' => t('Displays each selected entity as a Calendar item.'),
  60. 'handler' => 'calendar_plugin_row',
  61. 'path' => "$module_path/includes",
  62. 'base' => $base,
  63. 'uses options' => TRUE,
  64. 'uses fields' => TRUE,
  65. 'type' => 'normal',
  66. ),
  67. ),
  68. );
  69. return $data;
  70. }