history.views.inc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * @file
  4. * Provide views data for history.module.
  5. */
  6. /**
  7. * Implements hook_views_data().
  8. */
  9. function history_views_data() {
  10. // History table
  11. // We're actually defining a specific instance of the table, so let's
  12. // alias it so that we can later add the real table for other purposes if we
  13. // need it.
  14. $data['history']['table']['group'] = t('Content');
  15. // Explain how this table joins to others.
  16. $data['history']['table']['join'] = [
  17. // Directly links to node table.
  18. 'node_field_data' => [
  19. 'table' => 'history',
  20. 'left_field' => 'nid',
  21. 'field' => 'nid',
  22. 'extra' => [
  23. ['field' => 'uid', 'value' => '***CURRENT_USER***', 'numeric' => TRUE],
  24. ],
  25. ],
  26. ];
  27. $data['history']['timestamp'] = [
  28. 'title' => t('Has new content'),
  29. 'field' => [
  30. 'id' => 'history_user_timestamp',
  31. 'help' => t('Show a marker if the content is new or updated.'),
  32. ],
  33. 'filter' => [
  34. 'help' => t('Show only content that is new or updated.'),
  35. 'id' => 'history_user_timestamp',
  36. ],
  37. ];
  38. return $data;
  39. }