You are here

function publication_date_views_data in Publication Date 6

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

@file Provide views data and handlers for publication_date.module

File

./publication_date.views.inc, line 8
Provide views data and handlers for publication_date.module

Code

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

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

  // description of the fields (columns)
  $tables['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 $tables;
}