function _spaces_core_views_changes in Spaces 5.2
Same name and namespace in other branches
- 5 spaces_core/spaces_core.module \_spaces_core_views_changes()
1 string reference to '_spaces_core_views_changes'
- spaces_core_views_default_views in spaces_core/
spaces_core.module - Implementation of hook_default_views().
File
- spaces_core/
spaces_core.module, line 704
Code
function _spaces_core_views_changes() {
$view = new stdClass();
$view->name = 'spaces_changes';
$view->description = t('Displays a list of recently modified nodes.');
$view->access = array();
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = t('Recent Changes');
$view->page_type = 'table';
$view->url = 'changes';
$view->use_pager = TRUE;
$view->nodes_per_page = '25';
$view->block = TRUE;
$view->block_title = t('Recent Changes');
$view->block_empty = "<p class='views-empty'>" . t('No recent changes.') . "</p>";
$view->block_empty_format = '1';
$view->block_type = 'spaces_datetitle';
$view->nodes_per_block = '5';
$view->argument = array();
$view->sort = array(
array(
'tablename' => 'node',
'field' => 'changed',
'sortorder' => 'DESC',
'options' => 'normal',
),
);
$view->field = array(
array(
'tablename' => 'og_node_data',
'field' => 'title',
'label' => 'Group',
'handler' => 'spaces_views_handler_crayon_name',
'options' => 'og',
),
array(
'tablename' => 'node',
'field' => 'title',
'label' => t('Title'),
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
array(
'tablename' => 'node',
'field' => 'changed',
'label' => t('Changed'),
'handler' => 'views_handler_field_since',
'options' => 1,
),
array(
'tablename' => 'node',
'field' => 'type',
'label' => t('Type'),
),
array(
'tablename' => 'users',
'field' => 'name',
'label' => t('Author'),
),
);
if (variable_get('spaces_calendar_feed_itemtype', '')) {
$excluded = array(
'shout',
variable_get('spaces_calendar_feed_itemtype', ''),
);
}
else {
$excluded = array(
'shout',
);
}
$view->filter = array(
array(
'tablename' => 'node',
'field' => 'type',
'operator' => 'NOR',
'options' => '',
'value' => array_merge(og_get_types('group'), $excluded),
),
array(
'tablename' => 'og_uid_node',
'field' => 'currentuid',
'operator' => '=',
'options' => '',
'value' => '***CURRENT_USER***',
),
array(
'tablename' => 'spaces',
'field' => 'type',
'operator' => 'active',
'options' => '',
'value' => 'all',
),
array(
'tablename' => 'node',
'field' => 'changed',
'operator' => '>',
'options' => -1 * SPACES_ARCHIVE_TIMESTAMP,
'value' => 'now',
),
);
$view->exposed_filter = array();
$view->requires = array(
'node',
'users',
'og_node_data',
'og_uid_node',
);
return $view;
}