Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / forum / forum.views.inc
1 <?php
2
3 /**
4  * @file
5  * Provide views data for forum.module.
6  */
7
8 /**
9  * Implements hook_views_data().
10  */
11 function forum_views_data() {
12
13   $data['forum_index']['table']['group'] = t('Forum');
14   $data['forum_index']['table']['base'] = [
15     'field' => 'nid',
16     'title' => t('Forum content'),
17     'access query tag' => 'node_access',
18   ];
19
20   $data['forum_index']['nid'] = [
21     'title' => t('Nid'),
22     'help' => t('The content ID of the forum index entry.'),
23     'field' => [
24       'id' => 'numeric',
25     ],
26     'filter' => [
27       'id' => 'numeric',
28     ],
29     'argument' => [
30       'id' => 'numeric',
31     ],
32     'sort' => [
33       'id' => 'standard',
34     ],
35     'relationship' => [
36       'base' => 'node',
37       'base field' => 'nid',
38       'label' => t('Node'),
39     ],
40   ];
41
42   $data['forum_index']['title'] = [
43     'title' => t('Title'),
44     'help' => t('The content title.'),
45     'field' => [
46       'id' => 'standard',
47       'link_to_node default' => TRUE,
48     ],
49     'sort' => [
50       'id' => 'standard',
51     ],
52     'filter' => [
53       'id' => 'string',
54     ],
55     'argument' => [
56       'id' => 'string',
57     ],
58   ];
59
60   $data['forum_index']['tid'] = [
61     'title' => t('Has taxonomy term ID'),
62     'help' => t('Display content if it has the selected taxonomy terms.'),
63     'argument' => [
64       'id' => 'taxonomy_index_tid',
65       'name table' => 'taxonomy_term_data',
66       'name field' => 'name',
67       'empty field name' => t('Uncategorized'),
68       'numeric' => TRUE,
69       'skip base' => 'taxonomy_term_data',
70     ],
71     'field' => [
72       'id' => 'numeric',
73     ],
74     'filter' => [
75       'title' => t('Has taxonomy term'),
76       'id' => 'taxonomy_index_tid',
77       'hierarchy table' => 'taxonomy_term_hierarchy',
78       'numeric' => TRUE,
79       'skip base' => 'taxonomy_term_data',
80       'allow empty' => TRUE,
81     ],
82     'relationship' => [
83       'base' => 'taxonomy_term',
84       'base field' => 'tid',
85       'label' => t('Term'),
86     ],
87   ];
88
89
90   $data['forum_index']['created'] = [
91     'title' => t('Post date'),
92     'help' => t('The date the content was posted.'),
93     'field' => [
94       'id' => 'date',
95     ],
96     'sort' => [
97       'id' => 'date'
98     ],
99     'filter' => [
100       'id' => 'date',
101     ],
102   ];
103
104   $data['forum_index']['sticky'] = [
105     'title' => t('Sticky'),
106     'help' => t('Whether or not the content is sticky.'),
107     'field' => [
108       'id' => 'boolean',
109       'click sortable' => TRUE,
110       'output formats' => [
111         'sticky' => [t('Sticky'), t('Not sticky')],
112       ],
113     ],
114     'filter' => [
115       'id' => 'boolean',
116       'label' => t('Sticky'),
117       'type' => 'yes-no',
118     ],
119     'sort' => [
120       'id' => 'standard',
121       'help' => t('Whether or not the content is sticky. To list sticky content first, set this to descending.'),
122     ],
123   ];
124
125   $data['forum_index']['last_comment_timestamp'] = [
126     'title' => t('Last comment time'),
127     'help' => t('Date and time of when the last comment was posted.'),
128     'field' => [
129       'id' => 'comment_last_timestamp',
130     ],
131     'sort' => [
132       'id' => 'date',
133     ],
134     'filter' => [
135       'id' => 'date',
136     ],
137   ];
138
139   $data['forum_index']['comment_count'] = [
140     'title' => t('Comment count'),
141     'help' => t('The number of comments a node has.'),
142     'field' => [
143       'id' => 'numeric',
144     ],
145     'filter' => [
146       'id' => 'numeric',
147     ],
148     'sort' => [
149       'id' => 'standard',
150     ],
151     'argument' => [
152       'id' => 'standard',
153     ],
154   ];
155
156   return $data;
157 }