You are here

function date_api_views_plugins in Date 6.2

Same name and namespace in other branches
  1. 6 date_api.views.inc \date_api_views_plugins()

Implementation of hook_views_plugins().

File

includes/date_api.views.inc, line 54
Defines date-related Views data and plugins:

Code

function date_api_views_plugins() {
  $path = drupal_get_path('module', 'date_api');
  $views_path = drupal_get_path('module', 'views');
  require_once "./{$path}/theme/theme.inc";
  return array(
    'module' => 'date_api',
    // This just tells our themes are elsewhere.
    'display' => array(
      // Parents are not really displays, just needed so the files can
      // be included.
      'parent' => array(
        'no ui' => TRUE,
        'handler' => 'views_plugin_display',
        'path' => "{$views_path}/plugins",
        'parent' => '',
      ),
      'attachment' => array(
        'no ui' => TRUE,
        'handler' => 'views_plugin_display_attachment',
        'path' => "{$views_path}/plugins",
        'parent' => 'parent',
      ),
      // Display plugin for date navigation.
      'date_nav' => array(
        'title' => t('Date browser'),
        'help' => t('Date back/next navigation to attach to other displays. Requires the Date argument.'),
        'handler' => 'date_plugin_display_attachment',
        'parent' => 'attachment',
        'path' => "{$path}/includes",
        'theme' => 'views_view',
        'use ajax' => TRUE,
        'admin' => t('Date browser'),
        'help topic' => 'date-browser',
      ),
    ),
    'style' => array(
      'parent' => array(
        // this isn't really a display but is necessary so the file can
        // be included.
        'no ui' => TRUE,
        'handler' => 'views_plugin_style',
        'path' => "{$views_path}/plugins",
        'theme file' => 'theme.inc',
        'theme path' => "{$views_path}/theme",
        'parent' => '',
      ),
      'date_nav' => array(
        'title' => t('Date browser style'),
        'help' => t('Creates back/next navigation.'),
        'handler' => 'date_navigation_plugin_style',
        'path' => "{$path}/includes",
        'parent' => 'parent',
        'theme' => 'date_navigation',
        'theme file' => 'theme.inc',
        'theme path' => "{$path}/theme",
        'uses row plugin' => FALSE,
        'uses fields' => FALSE,
        'uses options' => TRUE,
        'type' => 'date_nav',
        'even empty' => TRUE,
      ),
    ),
  );
}