Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / dblog / dblog.views.inc
1 <?php
2
3 /**
4  * @file
5  * Provide views data for dblog.module.
6  */
7
8 /**
9  * Implements hook_views_data().
10  */
11 function dblog_views_data() {
12   $data = [];
13
14   $data['watchdog']['table']['group'] = t('Watchdog');
15   $data['watchdog']['table']['wizard_id'] = 'watchdog';
16
17   $data['watchdog']['table']['base'] = [
18     'field' => 'wid',
19     'title' => t('Log entries'),
20     'help' => t('Contains a list of log entries.'),
21   ];
22
23   $data['watchdog']['wid'] = [
24     'title' => t('WID'),
25     'help' => t('Unique watchdog event ID.'),
26     'field' => [
27       'id' => 'numeric',
28     ],
29     'filter' => [
30       'id' => 'numeric',
31     ],
32     'argument' => [
33       'id' => 'numeric',
34     ],
35     'sort' => [
36       'id' => 'standard',
37     ],
38   ];
39
40   $data['watchdog']['uid'] = [
41     'title' => t('UID'),
42     'help' => t('The user ID of the user on which the log entry was written..'),
43     'field' => [
44       'id' => 'numeric',
45     ],
46     'filter' => [
47       'id' => 'numeric',
48     ],
49     'argument' => [
50       'id' => 'numeric',
51     ],
52     'relationship' => [
53       'title' => t('User'),
54       'help' => t('The user on which the log entry as written.'),
55       'base' => 'users',
56       'base field' => 'uid',
57       'id' => 'standard',
58     ],
59   ];
60
61   $data['watchdog']['type'] = [
62     'title' => t('Type'),
63     'help' => t('The type of the log entry, for example "user" or "page not found".'),
64     'field' => [
65       'id' => 'standard',
66     ],
67     'argument' => [
68       'id' => 'string',
69     ],
70     'filter' => [
71       'id' => 'in_operator',
72       'options callback' => '_dblog_get_message_types',
73     ],
74     'sort' => [
75       'id' => 'standard',
76     ],
77   ];
78
79   $data['watchdog']['message'] = [
80     'title' => t('Message'),
81     'help' => t('The actual message of the log entry.'),
82     'field' => [
83       'id' => 'dblog_message',
84     ],
85     'argument' => [
86       'id' => 'string',
87     ],
88     'filter' => [
89       'id' => 'string',
90     ],
91     'sort' => [
92       'id' => 'standard',
93     ],
94   ];
95
96   $data['watchdog']['variables'] = [
97     'title' => t('Variables'),
98     'help' => t('The variables of the log entry in a serialized format.'),
99     'field' => [
100       'id' => 'serialized',
101       'click sortable' => FALSE,
102     ],
103     'argument' => [
104       'id' => 'string',
105     ],
106     'filter' => [
107       'id' => 'string',
108     ],
109     'sort' => [
110       'id' => 'standard',
111     ],
112   ];
113
114   $data['watchdog']['severity'] = [
115     'title' => t('Severity level'),
116     'help' => t('The severity level of the event; ranges from 0 (Emergency) to 7 (Debug).'),
117     'field' => [
118       'id' => 'machine_name',
119       'options callback' => 'Drupal\dblog\Controller\DbLogController::getLogLevelClassMap',
120     ],
121     'filter' => [
122       'id' => 'in_operator',
123       'options callback' => 'Drupal\dblog\Controller\DbLogController::getLogLevelClassMap',
124     ],
125     'sort' => [
126       'id' => 'standard',
127     ],
128   ];
129
130   $data['watchdog']['link'] = [
131     'title' => t('Operations'),
132     'help' => t('Operation links for the event.'),
133     'field' => [
134       'id' => 'dblog_operations',
135     ],
136     'argument' => [
137       'id' => 'string',
138     ],
139     'filter' => [
140       'id' => 'string',
141     ],
142     'sort' => [
143       'id' => 'standard',
144     ],
145   ];
146
147   $data['watchdog']['location'] = [
148     'title' => t('Location'),
149     'help' => t('URL of the origin of the event.'),
150     'field' => [
151       'id' => 'standard',
152     ],
153     'argument' => [
154       'id' => 'string',
155     ],
156     'filter' => [
157       'id' => 'string',
158     ],
159     'sort' => [
160       'id' => 'standard',
161     ],
162   ];
163
164   $data['watchdog']['referer'] = [
165     'title' => t('Referer'),
166     'help' => t('URL of the previous page.'),
167     'field' => [
168       'id' => 'standard',
169     ],
170     'argument' => [
171       'id' => 'string',
172     ],
173     'filter' => [
174       'id' => 'string',
175     ],
176     'sort' => [
177       'id' => 'standard',
178     ],
179   ];
180
181   $data['watchdog']['hostname'] = [
182     'title' => t('Hostname'),
183     'help' => t('Hostname of the user who triggered the event.'),
184     'field' => [
185       'id' => 'standard',
186     ],
187     'argument' => [
188       'id' => 'string',
189     ],
190     'filter' => [
191       'id' => 'string',
192     ],
193     'sort' => [
194       'id' => 'standard',
195     ],
196   ];
197
198   $data['watchdog']['timestamp'] = [
199     'title' => t('Timestamp'),
200     'help' => t('Date when the event occurred.'),
201     'field' => [
202       'id' => 'date',
203     ],
204     'argument' => [
205       'id' => 'date',
206     ],
207     'filter' => [
208       'id' => 'date',
209     ],
210     'sort' => [
211       'id' => 'date',
212     ],
213   ];
214
215   return $data;
216 }