2
// $Id: comment.views_default.inc,v 1.7 2009/01/27 20:24:09 merlinofchaos Exp $
5
* Contains default views on behalf of the comment module.
9
* Implementation of hook_default_view_views().
11
function comment_views_default_views() {
13
$view->name = 'comments_recent';
14
$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.';
15
$view->tag = 'default';
17
$view->base_table = 'comments';
18
$view->is_cacheable = '0';
19
$view->api_version = 2;
20
$view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
21
$handler = $view->new_display('default', 'Defaults', 'default');
22
$handler->override_option('relationships', array(
25
'table' => 'comments',
31
$handler->override_option('fields', array(
34
'table' => 'comments',
37
'link_to_comment' => 1,
38
'relationship' => 'none',
42
'table' => 'comments',
43
'field' => 'timestamp',
45
'date_format' => 'time ago',
46
'custom_date_format' => '',
47
'relationship' => 'none',
50
$handler->override_option('sorts', array(
53
'table' => 'comments',
54
'field' => 'timestamp',
56
'granularity' => 'second',
57
'relationship' => 'none',
60
$handler->override_option('filters', array(
61
'status_extra' => array(
62
'id' => 'status_extra',
64
'field' => 'status_extra',
73
'relationship' => 'nid',
76
$handler->override_option('access', array(
81
$handler->override_option('title', 'Recent comments');
82
$handler->override_option('items_per_page', 5);
83
$handler->override_option('use_more', 1);
84
$handler->override_option('style_plugin', 'list');
85
$handler->override_option('style_options', array(
88
$handler = $view->new_display('page', 'Page', 'page');
89
$handler->override_option('fields', array(
94
'label' => 'Reply to',
95
'relationship' => 'nid',
100
'table' => 'comments',
101
'field' => 'timestamp',
103
'date_format' => 'time ago',
104
'custom_date_format' => '',
105
'relationship' => 'none',
109
'table' => 'comments',
110
'field' => 'subject',
112
'link_to_comment' => 1,
113
'relationship' => 'none',
117
'table' => 'comments',
118
'field' => 'comment',
120
'relationship' => 'none',
123
$handler->override_option('items_per_page', 25);
124
$handler->override_option('use_pager', '1');
125
$handler->override_option('row_options', array(
128
'timestamp' => 'timestamp',
130
'separator' => ' ',
132
$handler->override_option('path', 'comments/recent');
133
$handler->override_option('menu', array(
138
$handler->override_option('tab_options', array(
143
$handler = $view->new_display('block', 'Block', 'block');
144
$handler->override_option('block_description', 'Recent comments view');
145
$views[$view->name] = $view;
148
$view->name = 'tracker';
149
$view->description = 'Shows all new activity on system.';
150
$view->tag = 'default';
151
$view->view_php = '';
152
$view->base_table = 'node';
153
$view->is_cacheable = '0';
154
$view->api_version = 2;
155
$view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
156
$handler = $view->new_display('default', 'Defaults', 'default');
157
$handler->override_option('fields', array(
169
'link_to_node' => TRUE,
176
'link_to_user' => TRUE,
178
'comment_count' => array(
179
'id' => 'comment_count',
180
'table' => 'node_comment_statistics',
181
'field' => 'comment_count',
182
'label' => 'Replies',
183
'set_precision' => FALSE,
190
'last_comment_timestamp' => array(
191
'id' => 'last_comment_timestamp',
192
'table' => 'node_comment_statistics',
193
'field' => 'last_comment_timestamp',
194
'label' => 'Last Post',
195
'date_format' => 'small',
196
'custom_date_format' => '',
198
'timestamp' => array(
200
'table' => 'history_user',
201
'field' => 'timestamp',
204
'relationship' => 'none',
208
'new_comments' => array(
209
'id' => 'new_comments',
211
'field' => 'new_comments',
213
'set_precision' => FALSE,
219
'link_to_comment' => 1,
221
'relationship' => 'none',
224
$handler->override_option('sorts', array(
225
'last_comment_timestamp' => array(
226
'id' => 'last_comment_timestamp',
227
'table' => 'node_comment_statistics',
228
'field' => 'last_comment_timestamp',
230
'granularity' => 'second',
233
$handler->override_option('arguments', array(
234
'uid_touch' => array(
237
'field' => 'uid_touch',
238
'default_action' => 'ignore',
239
'style_plugin' => 'default_summary',
240
'style_options' => array(
243
'items_per_page' => 25,
246
'wildcard_substitution' => 'All',
247
'title' => 'Recent posts for %1',
248
'default_argument_type' => 'fixed',
249
'default_argument' => '',
250
'validate_type' => 'none',
251
'validate_fail' => 'not found',
252
'relationship' => 'none',
253
'default_argument_fixed' => '',
254
'default_argument_php' => '',
255
'validate_argument_node_type' => array(
263
'validate_argument_php' => '',
266
$handler->override_option('filters', array(
281
'table' => 'comments',
291
'relationship' => 'none',
295
$handler->override_option('access', array(
300
$handler->override_option('title', 'Recent posts');
301
$handler->override_option('items_per_page', '25');
302
$handler->override_option('use_pager', TRUE);
303
$handler->override_option('style_plugin', 'table');
304
$handler->override_option('style_options', array(
311
'comment_count' => 'comment_count',
312
'last_comment_timestamp' => 'last_comment_timestamp',
313
'timestamp' => 'title',
314
'new_comments' => 'comment_count',
323
'separator' => ' ',
329
'comment_count' => array(
331
'separator' => '<br />',
333
'last_comment_timestamp' => array(
335
'separator' => ' ',
337
'timestamp' => array(
340
'new_comments' => array(
344
'default' => 'last_comment_timestamp',
346
$handler = $view->new_display('page', 'Page', 'page');
347
$handler->override_option('path', 'tracker');
348
$handler->override_option('menu', array(
350
'title' => 'Recent posts',
353
$handler->override_option('tab_options', array(
358
$views[$view->name] = $view;