You are here

function _spaces_dashboard_views_group_dashboard in Spaces 5.2

Same name and namespace in other branches
  1. 5 spaces_dashboard/spaces_dashboard.module \_spaces_dashboard_views_group_dashboard()
1 string reference to '_spaces_dashboard_views_group_dashboard'
spaces_dashboard_views_default_views in spaces_dashboard/spaces_dashboard.module
Implementation of hook_default_views

File

spaces_dashboard/spaces_dashboard.module, line 379

Code

function _spaces_dashboard_views_group_dashboard() {
  $view = new stdClass();
  $view->name = 'spaces_group_dashboard';
  $view->description = '';
  $view->access = array();
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = 'Group Dashboard';
  $view->page_empty = '<p>' . t('No posts found in your groups.') . '</p>';
  $view->page_empty_format = '4';
  $view->page_type = 'table';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '25';
  $view->sort = array(
    array(
      'tablename' => 'node_comment_statistics',
      'field' => 'last_changed',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array();
  $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' => 'Title',
      'handler' => 'spaces_views_handler_field_nodelink',
      'options' => 'link',
    ),
    array(
      'tablename' => 'node',
      'field' => 'type',
      'label' => 'Type',
    ),
    array(
      'tablename' => 'node_comment_statistics',
      'field' => 'last_comment_name',
      'label' => 'Last post',
    ),
    array(
      'tablename' => 'node_comment_statistics',
      'field' => 'last_changed',
      'label' => 'On',
      'handler' => 'views_handler_field_since',
      'options' => 1,
    ),
  );
  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' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
    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' => 'node',
      'field' => 'changed',
      'operator' => '>',
      'options' => -1 * SPACES_ARCHIVE_TIMESTAMP,
      'value' => 'now',
    ),
    array(
      'tablename' => 'og_ancestry',
      'field' => 'gid',
      'operator' => '=',
      'options' => '',
      'value' => '',
    ),
  );
  $view->exposed_filter = array(
    array(
      'tablename' => 'og_ancestry',
      'field' => 'gid',
      'label' => 'Posts in my groups',
      'optional' => '1',
      'is_default' => '0',
      'operator' => '1',
      'single' => '1',
    ),
  );
  $view->requires = array(
    node_comment_statistics,
    og_node_data,
    node,
    og_uid_node,
    og_ancestry,
  );
  return $view;
}