Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: 7.x-1.x
Fetching contributors…

Cannot retrieve contributors at this time

177 lines (175 sloc) 4.692 kB
<?php
/**
* @file smackdown.views_default.inc
*
* Provide a few default views for smackdown module.
*/
function smackdown_views_default_views() {
$view = new view;
$view->name = 'smackdowns';
$view->description = 'smackdown mosts (recent/votes/comments)';
$view->tag = 'smackdown';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
'votingapi_cache' => array(
'id' => 'votingapi_cache',
'table' => 'node',
'field' => 'votingapi_cache',
),
));
$handler->override_option('sorts', array(
'created' => array(
'id' => 'created',
'table' => 'node',
'field' => 'created',
),
));
$handler->override_option('filters', array(
'status' => array(
'operator' => '=',
'value' => 1,
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status',
'table' => 'node',
'field' => 'status',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'type' => array(
'operator' => 'in',
'value' => array(
'smackdown' => 'smackdown',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
'teaser' => 1,
'links' => 1,
'comments' => 0,
));
$handler = $view->new_display('page', 'most recent', 'page_1');
$handler->override_option('sorts', array(
'created' => array(
'order' => 'DESC',
'granularity' => 'second',
'id' => 'created',
'table' => 'node',
'field' => 'created',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('path', 'smackdowns/recent');
$handler->override_option('menu', array(
'type' => 'default tab',
'title' => 'most recent',
'weight' => '0',
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'normal',
'title' => 'smackdown statistics',
'weight' => '0',
));
$handler = $view->new_display('page', 'most votes', 'page_2');
$handler->override_option('relationships', array(
'votingapi_cache' => array(
'label' => 'Voting results',
'required' => 0,
'votingapi' => array(
'value_type' => '',
'tag' => 'smackdown',
'function' => '',
),
'id' => 'votingapi_cache',
'table' => 'node',
'field' => 'votingapi_cache',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'value' => array(
'order' => 'DESC',
'id' => 'value',
'table' => 'votingapi_cache',
'field' => 'value',
'relationship' => 'votingapi_cache',
'override' => array(
'button' => 'Use default',
),
),
));
$handler->override_option('path', 'smackdowns/votes');
$handler->override_option('menu', array(
'type' => 'tab',
'title' => 'most votes',
'weight' => '0',
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'weight' => 0,
));
$handler = $view->new_display('page', 'most comments', 'page_3');
$handler->override_option('sorts', array(
'comment_count' => array(
'order' => 'DESC',
'id' => 'comment_count',
'table' => 'node_comment_statistics',
'field' => 'comment_count',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('path', 'smackdowns/comments');
$handler->override_option('menu', array(
'type' => 'tab',
'title' => 'most comments',
'weight' => '1',
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'weight' => 0,
));
$views[$view->name] = $view;
return $views;
}
Jump to Line
Something went wrong with that request. Please try again.