You are here

function _spaces_calendar_views_calendar_upcoming in Spaces 5

Same name and namespace in other branches
  1. 5.2 spaces_calendar/spaces_calendar.module \_spaces_calendar_views_calendar_upcoming()
1 string reference to '_spaces_calendar_views_calendar_upcoming'
spaces_calendar_views_default_views in spaces_calendar/spaces_calendar.module
Implementation of hook_default_views

File

spaces_calendar/spaces_calendar.module, line 352

Code

function _spaces_calendar_views_calendar_upcoming() {
  $view = new stdClass();
  $view->name = 'spaces_calendar_upcoming';
  $view->description = t('Provides a listing of upcoming events');
  $view->access = array();
  $view->view_args_php = '';
  $view->page = FALSE;
  $view->block = TRUE;
  $view->block_title = t('Upcoming Events');
  $view->block_empty = '<p>' . t('No upcoming events found.') . '</p>';
  $view->block_empty_format = '2';
  $view->block_type = 'spaces_datetitle';
  $view->nodes_per_block = '5';
  $view->argument = array();
  $view->sort = array(
    array(
      'tablename' => 'node_data_' . variable_get('spaces_calendar_datefield', ''),
      'field' => variable_get('spaces_calendar_datefield', '') . '_value',
      'sortorder' => 'ASC',
      'options' => '',
    ),
  );
  $view->field = array(
    array(
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'options' => 'link',
    ),
    array(
      'tablename' => 'node_data_' . variable_get('spaces_calendar_datefield', ''),
      'field' => variable_get('spaces_calendar_datefield', '') . '_value',
      'label' => '',
      'handler' => 'content_views_field_handler_ungroup',
      'options' => 'default',
    ),
  );
  $view->filter = array(
    array(
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
    array(
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array(
        0 => variable_get('spaces_calendar_nodetype', ''),
        1 => variable_get('spaces_calendar_feed_itemtype', ''),
      ),
    ),
    array(
      'tablename' => 'node_data_' . variable_get('spaces_calendar_datefield', ''),
      'field' => variable_get('spaces_calendar_datefield', '') . '_value_default',
      'operator' => '>',
      'options' => 'now',
      'value' => '',
    ),
    array(
      'tablename' => 'og_ancestry',
      'field' => 'picg',
      'operator' => '=',
      'options' => '',
      'value' => '***CURRENT_GID***',
    ),
  );
  $view->exposed_filter = array();
  $view->requires = array(
    'node_data_' . variable_get('spaces_calendar_datefield', ''),
    'node',
  );
  return $view;
}