2
// $Id: votingapi.views_default.inc,v 1.1.2.6 2008/12/04 18:34:39 eaton Exp $
6
* Provide default views data for votingapi.module.
9
function votingapi_views_default_views() {
13
$view->name = 'top_content';
14
$view->description = 'Top rated content';
15
$view->tag = 'votingapi';
17
$view->base_table = 'node';
18
$view->is_cacheable = FALSE;
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('fields', array(
30
'relationship' => 'none',
39
'relationship' => 'none',
43
'date_format' => 'time ago',
44
'custom_date_format' => '1',
49
'relationship' => 'none',
52
$handler->override_option('filters', array(
65
'relationship' => 'none',
68
$handler->override_option('access', array(
71
$handler->override_option('title', 'Top rated content');
72
$handler->override_option('use_pager', '1');
73
$handler->override_option('style_plugin', 'table');
74
$handler->override_option('style_options', array(
82
'created' => 'created',
100
$handler = $view->new_display('page', 'Fivestar', 'page_1');
101
$handler->override_option('relationships', array(
102
'votingapi_cache' => array(
103
'label' => 'Voting results',
105
'votingapi' => array(
106
'value_type' => 'percent',
108
'function' => 'average',
110
'id' => 'votingapi_cache',
112
'field' => 'votingapi_cache',
114
'button' => 'Use default',
116
'relationship' => 'none',
119
$handler->override_option('fields', array(
127
'relationship' => 'none',
136
'relationship' => 'none',
140
'date_format' => 'time ago',
141
'custom_date_format' => '1',
145
'field' => 'created',
146
'relationship' => 'none',
150
'set_precision' => FALSE,
156
'appearance' => 'fivestar_views_value_display_handler',
159
'table' => 'votingapi_cache',
162
'button' => 'Use default',
164
'relationship' => 'votingapi_cache',
167
$handler->override_option('sorts', array(
171
'table' => 'votingapi_cache',
173
'relationship' => 'votingapi_cache',
175
'button' => 'Use default',
179
$handler->override_option('header', 'This page is a demonstration of VotingAPI\'s integration with the Views module. It\'s set up to display nodes sorted by percentage ratings, the style used by Fivestar module.');
180
$handler->override_option('header_format', '1');
181
$handler->override_option('header_empty', 0);
182
$handler->override_option('style_options', array(
190
'created' => 'created',
211
'default' => 'value',
213
$handler->override_option('path', 'top-rated-percent');
214
$handler->override_option('menu', array(
216
'title' => 'Top content (Fivestar)',
218
'name' => 'navigation',
220
$handler->override_option('tab_options', array(
225
$handler = $view->new_display('page', 'Plus1', 'page_2');
226
$handler->override_option('relationships', array(
227
'votingapi_cache' => array(
228
'label' => 'Voting results',
230
'votingapi' => array(
231
'value_type' => 'points',
235
'id' => 'votingapi_cache',
237
'field' => 'votingapi_cache',
239
'button' => 'Use default',
241
'relationship' => 'none',
244
$handler->override_option('fields', array(
252
'relationship' => 'none',
261
'relationship' => 'none',
265
'date_format' => 'time ago',
266
'custom_date_format' => '1',
270
'field' => 'created',
271
'relationship' => 'none',
275
'set_precision' => FALSE,
280
'suffix' => ' points',
284
'table' => 'votingapi_cache',
287
'button' => 'Use default',
289
'relationship' => 'votingapi_cache',
292
$handler->override_option('sorts', array(
296
'table' => 'votingapi_cache',
299
'button' => 'Use default',
301
'relationship' => 'votingapi_cache',
304
$handler->override_option('header', 'This page is a demonstration of VotingAPI\'s integration with the Views module. It\'s set up to display nodes sorted by point ratings, the style used by the Plus1 and VoteUpDown modules.');
305
$handler->override_option('header_format', '1');
306
$handler->override_option('header_empty', 0);
307
$handler->override_option('style_options', array(
315
'created' => 'created',
336
'default' => 'value',
338
$handler->override_option('path', 'top-rated-points');
339
$handler->override_option('menu', array(
341
'title' => 'Top content (Plus1)',
343
'name' => 'navigation',
345
$handler->override_option('tab_options', array(
350
$handler = $view->new_display('page', 'Current user', 'page_3');
351
$handler->override_option('relationships', array(
352
'votingapi_vote' => array(
353
'label' => 'Individual votes',
355
'votingapi' => array(
360
'id' => 'votingapi_vote',
362
'field' => 'votingapi_vote',
364
'button' => 'Use default',
366
'relationship' => 'none',
369
$handler->override_option('fields', array(
377
'relationship' => 'none',
379
'value_type' => array(
380
'label' => 'Vote type',
382
'id' => 'value_type',
383
'table' => 'votingapi_vote',
384
'field' => 'value_type',
386
'button' => 'Override',
388
'relationship' => 'votingapi_vote',
392
'set_precision' => FALSE,
401
'table' => 'votingapi_vote',
404
'button' => 'Override',
406
'relationship' => 'votingapi_vote',
408
'timestamp' => array(
409
'label' => 'Timestamp',
410
'date_format' => 'time ago',
411
'custom_date_format' => '1',
414
'table' => 'votingapi_vote',
415
'field' => 'timestamp',
417
'button' => 'Use default',
419
'relationship' => 'votingapi_vote',
422
$handler->override_option('sorts', array(
423
'timestamp' => array(
426
'table' => 'votingapi_vote',
427
'field' => 'timestamp',
429
'button' => 'Use default',
431
'relationship' => 'votingapi_vote',
434
$handler->override_option('arguments', array(
436
'default_action' => 'default',
437
'style_plugin' => 'default_summary',
438
'style_options' => array(),
440
'wildcard_substitution' => 'Everyone',
441
'title' => '%1\'s votes',
442
'default_argument_type' => 'current_user',
443
'default_argument' => '',
444
'validate_type' => 'none',
445
'validate_fail' => 'not found',
449
'table' => 'votingapi_vote',
451
'relationship' => 'votingapi_vote',
453
'button' => 'Use default',
455
'default_options_div_prefix' => '',
456
'default_argument_user' => 0,
457
'default_argument_fixed' => '',
458
'default_argument_php' => '',
459
'validate_argument_node_type' => array(
463
'validate_argument_node_access' => 0,
464
'validate_argument_nid_type' => 'nid',
465
'validate_argument_vocabulary' => array(),
466
'validate_argument_type' => 'tid',
467
'validate_argument_php' => '',
470
$handler->override_option('filters', array(
483
'relationship' => 'none',
486
'operator' => 'not empty',
499
'table' => 'votingapi_vote',
502
'button' => 'Use default',
504
'relationship' => 'votingapi_vote',
507
$handler->override_option('title', 'Your votes');
508
$handler->override_option('style_options', array(
515
'value_type' => 'value_type',
517
'timestamp' => 'timestamp',
524
'value_type' => array(
532
'timestamp' => array(
537
'default' => 'timestamp',
539
$handler->override_option('path', 'your-votes');
540
$handler->override_option('menu', array(
542
'title' => 'Your votes',
544
'name' => 'navigation',
546
$handler->override_option('tab_options', array(
553
$views[$view->name] = $view;