1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Bulk export of views_default objects generated by Bulk export module.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Implementation of hook_views_default_views()
|
10
|
*/
|
11
|
function comment_views_default_views() {
|
12
|
$views = array();
|
13
|
|
14
|
$view = new view;
|
15
|
$view->name = 'comments_recent';
|
16
|
$view->description = 'Contains a block and a page to list recent comments; the block will automatically link to the page, which displays the comment body as well as a link to the node.';
|
17
|
$view->tag = 'default';
|
18
|
$view->base_table = 'comment';
|
19
|
$view->human_name = 'Recent comments';
|
20
|
$view->core = 0;
|
21
|
$view->api_version = '3.0';
|
22
|
$view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
|
23
|
|
24
|
/* Display: Master */
|
25
|
$handler = $view->new_display('default', 'Master', 'default');
|
26
|
$handler->display->display_options['title'] = 'Recent comments';
|
27
|
$handler->display->display_options['use_more'] = TRUE;
|
28
|
$handler->display->display_options['access']['type'] = 'perm';
|
29
|
$handler->display->display_options['access']['perm'] = 'access comments';
|
30
|
$handler->display->display_options['cache']['type'] = 'none';
|
31
|
$handler->display->display_options['query']['type'] = 'views_query';
|
32
|
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
|
33
|
$handler->display->display_options['exposed_form']['type'] = 'basic';
|
34
|
$handler->display->display_options['pager']['type'] = 'some';
|
35
|
$handler->display->display_options['pager']['options']['items_per_page'] = 5;
|
36
|
$handler->display->display_options['style_plugin'] = 'list';
|
37
|
$handler->display->display_options['row_plugin'] = 'fields';
|
38
|
/* Relationship: Comment: Content */
|
39
|
$handler->display->display_options['relationships']['nid']['id'] = 'nid';
|
40
|
$handler->display->display_options['relationships']['nid']['table'] = 'comment';
|
41
|
$handler->display->display_options['relationships']['nid']['field'] = 'nid';
|
42
|
/* Field: Comment: Title */
|
43
|
$handler->display->display_options['fields']['subject']['id'] = 'subject';
|
44
|
$handler->display->display_options['fields']['subject']['table'] = 'comment';
|
45
|
$handler->display->display_options['fields']['subject']['field'] = 'subject';
|
46
|
$handler->display->display_options['fields']['subject']['label'] = '';
|
47
|
$handler->display->display_options['fields']['subject']['link_to_comment'] = 1;
|
48
|
/* Field: Comment: Updated date */
|
49
|
$handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
|
50
|
$handler->display->display_options['fields']['timestamp']['table'] = 'comment';
|
51
|
$handler->display->display_options['fields']['timestamp']['field'] = 'changed';
|
52
|
$handler->display->display_options['fields']['timestamp']['label'] = '';
|
53
|
$handler->display->display_options['fields']['timestamp']['date_format'] = 'time ago';
|
54
|
/* Sort criterion: Comment: Updated date */
|
55
|
$handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
|
56
|
$handler->display->display_options['sorts']['timestamp']['table'] = 'comment';
|
57
|
$handler->display->display_options['sorts']['timestamp']['field'] = 'changed';
|
58
|
$handler->display->display_options['sorts']['timestamp']['order'] = 'DESC';
|
59
|
/* Filter criterion: Content: Published or admin */
|
60
|
$handler->display->display_options['filters']['status_extra']['id'] = 'status_extra';
|
61
|
$handler->display->display_options['filters']['status_extra']['table'] = 'node';
|
62
|
$handler->display->display_options['filters']['status_extra']['field'] = 'status_extra';
|
63
|
$handler->display->display_options['filters']['status_extra']['relationship'] = 'nid';
|
64
|
$handler->display->display_options['filters']['status_extra']['group'] = 0;
|
65
|
|
66
|
/* Display: Page */
|
67
|
$handler = $view->new_display('page', 'Page', 'page');
|
68
|
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
|
69
|
$handler->display->display_options['style_plugin'] = 'list';
|
70
|
$handler->display->display_options['defaults']['style_options'] = FALSE;
|
71
|
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
|
72
|
$handler->display->display_options['row_plugin'] = 'fields';
|
73
|
$handler->display->display_options['row_options']['inline'] = array(
|
74
|
'title' => 'title',
|
75
|
'timestamp' => 'timestamp',
|
76
|
);
|
77
|
$handler->display->display_options['row_options']['separator'] = ' ';
|
78
|
$handler->display->display_options['defaults']['row_options'] = FALSE;
|
79
|
$handler->display->display_options['defaults']['fields'] = FALSE;
|
80
|
/* Field: Content: Title */
|
81
|
$handler->display->display_options['fields']['title']['id'] = 'title';
|
82
|
$handler->display->display_options['fields']['title']['table'] = 'node';
|
83
|
$handler->display->display_options['fields']['title']['field'] = 'title';
|
84
|
$handler->display->display_options['fields']['title']['relationship'] = 'nid';
|
85
|
$handler->display->display_options['fields']['title']['label'] = 'Reply to';
|
86
|
$handler->display->display_options['fields']['title']['link_to_node'] = 1;
|
87
|
/* Field: Comment: Updated date */
|
88
|
$handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
|
89
|
$handler->display->display_options['fields']['timestamp']['table'] = 'comment';
|
90
|
$handler->display->display_options['fields']['timestamp']['field'] = 'changed';
|
91
|
$handler->display->display_options['fields']['timestamp']['label'] = '';
|
92
|
$handler->display->display_options['fields']['timestamp']['date_format'] = 'time ago';
|
93
|
/* Field: Comment: Title */
|
94
|
$handler->display->display_options['fields']['subject']['id'] = 'subject';
|
95
|
$handler->display->display_options['fields']['subject']['table'] = 'comment';
|
96
|
$handler->display->display_options['fields']['subject']['field'] = 'subject';
|
97
|
$handler->display->display_options['fields']['subject']['label'] = '';
|
98
|
$handler->display->display_options['fields']['subject']['link_to_comment'] = 1;
|
99
|
/* Field: Comment: Comment */
|
100
|
$handler->display->display_options['fields']['comment']['id'] = 'comment';
|
101
|
$handler->display->display_options['fields']['comment']['table'] = 'field_data_comment_body';
|
102
|
$handler->display->display_options['fields']['comment']['field'] = 'comment_body';
|
103
|
$handler->display->display_options['fields']['comment']['label'] = '';
|
104
|
$handler->display->display_options['path'] = 'comments/recent';
|
105
|
|
106
|
/* Display: Block */
|
107
|
$handler = $view->new_display('block', 'Block', 'block');
|
108
|
$translatables['comments_recent'] = array(
|
109
|
t('Master'),
|
110
|
t('Recent comments'),
|
111
|
t('more'),
|
112
|
t('Apply'),
|
113
|
t('Reset'),
|
114
|
t('Sort by'),
|
115
|
t('Asc'),
|
116
|
t('Desc'),
|
117
|
t('Content'),
|
118
|
t('Page'),
|
119
|
t('Reply to'),
|
120
|
t('Block'),
|
121
|
);
|
122
|
|
123
|
$views['comments_recent'] = $view;
|
124
|
|
125
|
$view = new view;
|
126
|
$view->name = 'tracker';
|
127
|
$view->description = 'Shows all new activity on system.';
|
128
|
$view->tag = 'default';
|
129
|
$view->base_table = 'node';
|
130
|
$view->human_name = 'Tracker';
|
131
|
$view->core = 0;
|
132
|
$view->api_version = '3.0';
|
133
|
$view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
|
134
|
|
135
|
/* Display: Master */
|
136
|
$handler = $view->new_display('default', 'Master', 'default');
|
137
|
$handler->display->display_options['title'] = 'Recent posts';
|
138
|
$handler->display->display_options['access']['type'] = 'perm';
|
139
|
$handler->display->display_options['access']['perm'] = 'access content';
|
140
|
$handler->display->display_options['cache']['type'] = 'none';
|
141
|
$handler->display->display_options['query']['type'] = 'views_query';
|
142
|
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
|
143
|
$handler->display->display_options['exposed_form']['type'] = 'basic';
|
144
|
$handler->display->display_options['pager']['type'] = 'full';
|
145
|
$handler->display->display_options['pager']['options']['items_per_page'] = '25';
|
146
|
$handler->display->display_options['style_plugin'] = 'table';
|
147
|
$handler->display->display_options['style_options']['columns'] = array(
|
148
|
'type' => 'type',
|
149
|
'title' => 'title',
|
150
|
'name' => 'name',
|
151
|
'comment_count' => 'comment_count',
|
152
|
'last_comment_timestamp' => 'last_comment_timestamp',
|
153
|
'timestamp' => 'title',
|
154
|
'new_comments' => 'comment_count',
|
155
|
);
|
156
|
$handler->display->display_options['style_options']['default'] = 'last_comment_timestamp';
|
157
|
$handler->display->display_options['style_options']['info'] = array(
|
158
|
'type' => array(
|
159
|
'sortable' => 1,
|
160
|
'separator' => '',
|
161
|
),
|
162
|
'title' => array(
|
163
|
'sortable' => 1,
|
164
|
'separator' => ' ',
|
165
|
),
|
166
|
'name' => array(
|
167
|
'sortable' => 1,
|
168
|
'separator' => '',
|
169
|
),
|
170
|
'comment_count' => array(
|
171
|
'sortable' => 1,
|
172
|
'separator' => '<br />',
|
173
|
),
|
174
|
'last_comment_timestamp' => array(
|
175
|
'sortable' => 1,
|
176
|
'separator' => ' ',
|
177
|
),
|
178
|
'timestamp' => array(
|
179
|
'separator' => '',
|
180
|
),
|
181
|
'new_comments' => array(
|
182
|
'separator' => '',
|
183
|
),
|
184
|
);
|
185
|
$handler->display->display_options['style_options']['override'] = 1;
|
186
|
$handler->display->display_options['style_options']['order'] = 'desc';
|
187
|
/* Relationship: Content: Author */
|
188
|
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
|
189
|
$handler->display->display_options['relationships']['uid']['table'] = 'node';
|
190
|
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
|
191
|
/* Field: Content: Type */
|
192
|
$handler->display->display_options['fields']['type']['id'] = 'type';
|
193
|
$handler->display->display_options['fields']['type']['table'] = 'node';
|
194
|
$handler->display->display_options['fields']['type']['field'] = 'type';
|
195
|
/* Field: Content: Title */
|
196
|
$handler->display->display_options['fields']['title']['id'] = 'title';
|
197
|
$handler->display->display_options['fields']['title']['table'] = 'node';
|
198
|
$handler->display->display_options['fields']['title']['field'] = 'title';
|
199
|
/* Field: User: Name */
|
200
|
$handler->display->display_options['fields']['name']['id'] = 'name';
|
201
|
$handler->display->display_options['fields']['name']['table'] = 'users';
|
202
|
$handler->display->display_options['fields']['name']['field'] = 'name';
|
203
|
$handler->display->display_options['fields']['name']['relationship'] = 'uid';
|
204
|
$handler->display->display_options['fields']['name']['label'] = 'Author';
|
205
|
/* Field: Content: Comment count */
|
206
|
$handler->display->display_options['fields']['comment_count']['id'] = 'comment_count';
|
207
|
$handler->display->display_options['fields']['comment_count']['table'] = 'node_comment_statistics';
|
208
|
$handler->display->display_options['fields']['comment_count']['field'] = 'comment_count';
|
209
|
$handler->display->display_options['fields']['comment_count']['label'] = 'Replies';
|
210
|
/* Field: Content: Last comment time */
|
211
|
$handler->display->display_options['fields']['last_comment_timestamp']['id'] = 'last_comment_timestamp';
|
212
|
$handler->display->display_options['fields']['last_comment_timestamp']['table'] = 'node_comment_statistics';
|
213
|
$handler->display->display_options['fields']['last_comment_timestamp']['field'] = 'last_comment_timestamp';
|
214
|
$handler->display->display_options['fields']['last_comment_timestamp']['label'] = 'Last Post';
|
215
|
/* Field: Content: Has new content */
|
216
|
$handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
|
217
|
$handler->display->display_options['fields']['timestamp']['table'] = 'history';
|
218
|
$handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
|
219
|
$handler->display->display_options['fields']['timestamp']['label'] = '';
|
220
|
$handler->display->display_options['fields']['timestamp']['link_to_node'] = 0;
|
221
|
$handler->display->display_options['fields']['timestamp']['comments'] = 1;
|
222
|
/* Field: Content: New comments */
|
223
|
$handler->display->display_options['fields']['new_comments']['id'] = 'new_comments';
|
224
|
$handler->display->display_options['fields']['new_comments']['table'] = 'node';
|
225
|
$handler->display->display_options['fields']['new_comments']['field'] = 'new_comments';
|
226
|
$handler->display->display_options['fields']['new_comments']['label'] = '';
|
227
|
$handler->display->display_options['fields']['new_comments']['hide_empty'] = TRUE;
|
228
|
$handler->display->display_options['fields']['new_comments']['suffix'] = ' new';
|
229
|
$handler->display->display_options['fields']['new_comments']['link_to_comment'] = 1;
|
230
|
/* Sort criterion: Content: Last comment time */
|
231
|
$handler->display->display_options['sorts']['last_comment_timestamp']['id'] = 'last_comment_timestamp';
|
232
|
$handler->display->display_options['sorts']['last_comment_timestamp']['table'] = 'node_comment_statistics';
|
233
|
$handler->display->display_options['sorts']['last_comment_timestamp']['field'] = 'last_comment_timestamp';
|
234
|
/* Contextual filter: Content: User posted or commented */
|
235
|
$handler->display->display_options['arguments']['uid_touch']['id'] = 'uid_touch';
|
236
|
$handler->display->display_options['arguments']['uid_touch']['table'] = 'node';
|
237
|
$handler->display->display_options['arguments']['uid_touch']['field'] = 'uid_touch';
|
238
|
$handler->display->display_options['arguments']['uid_touch']['exception']['title_enable'] = 1;
|
239
|
$handler->display->display_options['arguments']['uid_touch']['title_enable'] = 1;
|
240
|
$handler->display->display_options['arguments']['uid_touch']['title'] = 'Recent posts for %1';
|
241
|
$handler->display->display_options['arguments']['uid_touch']['default_argument_type'] = 'fixed';
|
242
|
$handler->display->display_options['arguments']['uid_touch']['summary']['format'] = 'default_summary';
|
243
|
$handler->display->display_options['arguments']['uid_touch']['specify_validation'] = 1;
|
244
|
/* Filter criterion: Content: Published */
|
245
|
$handler->display->display_options['filters']['status']['id'] = 'status';
|
246
|
$handler->display->display_options['filters']['status']['table'] = 'node';
|
247
|
$handler->display->display_options['filters']['status']['field'] = 'status';
|
248
|
$handler->display->display_options['filters']['status']['value'] = '1';
|
249
|
$handler->display->display_options['filters']['status']['group'] = 0;
|
250
|
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
|
251
|
|
252
|
/* Display: Page */
|
253
|
$handler = $view->new_display('page', 'Page', 'page');
|
254
|
$handler->display->display_options['path'] = 'tracker';
|
255
|
$handler->display->display_options['menu']['type'] = 'normal';
|
256
|
$handler->display->display_options['menu']['title'] = 'Recent posts';
|
257
|
$translatables['tracker'] = array(
|
258
|
t('Master'),
|
259
|
t('Recent posts'),
|
260
|
t('more'),
|
261
|
t('Apply'),
|
262
|
t('Reset'),
|
263
|
t('Sort by'),
|
264
|
t('Asc'),
|
265
|
t('Desc'),
|
266
|
t('Items per page'),
|
267
|
t('- All -'),
|
268
|
t('Offset'),
|
269
|
t('Type'),
|
270
|
t('Title'),
|
271
|
t('Author'),
|
272
|
t('Replies'),
|
273
|
t('.'),
|
274
|
t(','),
|
275
|
t('Last Post'),
|
276
|
t(' new'),
|
277
|
t('All'),
|
278
|
t('Recent posts for %1'),
|
279
|
t('Page'),
|
280
|
);
|
281
|
|
282
|
$views['tracker'] = $view;
|
283
|
|
284
|
return $views;
|
285
|
}
|