annotate core/modules/history/history.views.inc @ 0:4c8ae668cc8c
Initial import (non-working)
author |
Chris Cannam |
date |
Wed, 29 Nov 2017 16:09:58 +0000 |
parents |
|
children |
129ea1e6d783 |
rev |
line source |
Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 /**
|
Chris@0
|
4 * @file
|
Chris@0
|
5 * Provide views data for history.module.
|
Chris@0
|
6 */
|
Chris@0
|
7
|
Chris@0
|
8 /**
|
Chris@0
|
9 * Implements hook_views_data().
|
Chris@0
|
10 */
|
Chris@0
|
11 function history_views_data() {
|
Chris@0
|
12 // History table
|
Chris@0
|
13
|
Chris@0
|
14 // We're actually defining a specific instance of the table, so let's
|
Chris@0
|
15 // alias it so that we can later add the real table for other purposes if we
|
Chris@0
|
16 // need it.
|
Chris@0
|
17 $data['history']['table']['group'] = t('Content');
|
Chris@0
|
18
|
Chris@0
|
19 // Explain how this table joins to others.
|
Chris@0
|
20 $data['history']['table']['join'] = [
|
Chris@0
|
21 // Directly links to node table.
|
Chris@0
|
22 'node_field_data' => [
|
Chris@0
|
23 'table' => 'history',
|
Chris@0
|
24 'left_field' => 'nid',
|
Chris@0
|
25 'field' => 'nid',
|
Chris@0
|
26 'extra' => [
|
Chris@0
|
27 ['field' => 'uid', 'value' => '***CURRENT_USER***', 'numeric' => TRUE],
|
Chris@0
|
28 ],
|
Chris@0
|
29 ],
|
Chris@0
|
30 ];
|
Chris@0
|
31
|
Chris@0
|
32 $data['history']['timestamp'] = [
|
Chris@0
|
33 'title' => t('Has new content'),
|
Chris@0
|
34 'field' => [
|
Chris@0
|
35 'id' => 'history_user_timestamp',
|
Chris@0
|
36 'help' => t('Show a marker if the content is new or updated.'),
|
Chris@0
|
37 ],
|
Chris@0
|
38 'filter' => [
|
Chris@0
|
39 'help' => t('Show only content that is new or updated.'),
|
Chris@0
|
40 'id' => 'history_user_timestamp',
|
Chris@0
|
41 ],
|
Chris@0
|
42 ];
|
Chris@0
|
43
|
Chris@0
|
44 return $data;
|
Chris@0
|
45 }
|