You are here

function publication_date_views_data in Publication Date 7

Same name and namespace in other branches
  1. 8 includes/publication_date.views.inc \publication_date_views_data()
  2. 6 publication_date.views.inc \publication_date_views_data()
  3. 7.2 includes/publication_date.views.inc \publication_date_views_data()

Implements hook_views_data()

File

includes/publication_date.views.inc, line 16
Provide views data and handlers for the Publication Date module.

Code

function publication_date_views_data() {
  $data = array();
  $data['publication_date']['table']['group'] = t('Node');

  // how is the scheduler table linked to the nodes
  $data['publication_date']['table']['join']['node'] = array(
    'left_field' => 'nid',
    'field' => 'nid',
  );

  // description of the fields (columns)
  $data['publication_date']['published_at'] = array(
    'title' => t('Published at'),
    'help' => t('Date/time on which the article has been published'),
    'field' => array(
      'handler' => 'views_handler_field_date',
      'click sortable' => TRUE,
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_date',
      'label' => t('Published at'),
    ),
    'sort' => array(
      'handler' => 'views_handler_sort_date',
    ),
  );
  return $data;
}