history.views.inc 1.1 KB
Newer Older
1 2 3 4
<?php

/**
 * @file
5
 * Provide views data for history.module.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 */

/**
 * Implements hook_views_data().
 */
function history_views_data() {
  // History table

  // We're actually defining a specific instance of the table, so let's
  // alias it so that we can later add the real table for other purposes if we
  // need it.
  $data['history']['table']['group']  = t('Content');

  // Explain how this table joins to others.
  $data['history']['table']['join'] = array(
     // Directly links to node table.
22
    'node_field_data' => array(
23 24 25 26 27 28 29 30 31 32 33 34
      'table' => 'history',
      'left_field' => 'nid',
      'field' => 'nid',
      'extra' => array(
        array('field' => 'uid', 'value' => '***CURRENT_USER***', 'numeric' => TRUE),
      ),
    ),
  );

  $data['history']['timestamp'] = array(
    'title' => t('Has new content'),
    'field' => array(
35
      'id' => 'history_user_timestamp',
36 37 38 39
      'help' => t('Show a marker if the content is new or updated.'),
    ),
    'filter' => array(
      'help' => t('Show only content that is new or updated.'),
40
      'id' => 'history_user_timestamp',
41 42 43 44 45
    ),
  );

  return $data;
}