You are here

function advpoll_views_default_views in Advanced Poll 6.2

File

views/advpoll.views.inc, line 111
Views integration for Advanced Poll module.

Code

function advpoll_views_default_views() {

  // MW builds the base view and calls _advpoll_generate_blocks function to
  // append with custom blocks
  $views = array();

  // Exported view: advpoll_views
  $view = new view();
  $view->name = 'advpoll_views';
  $view->description = '';
  $view->tag = '';
  $view->base_table = 'node';
  $view->core = 6;
  $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('filters', array(
    'status' => array(
      'operator' => '=',
      'value' => '1',
      'group' => '0',
      'exposed' => FALSE,
      'expose' => array(
        'operator' => FALSE,
        'label' => '',
      ),
      'id' => 'status',
      'table' => 'node',
      'field' => 'status',
      'relationship' => 'none',
    ),
    'type' => array(
      'operator' => 'in',
      'value' => array(
        'advpoll_binary' => 'advpoll_binary',
      ),
      'group' => '0',
      'exposed' => FALSE,
      'expose' => array(
        'operator' => FALSE,
        'label' => '',
      ),
      'id' => 'type',
      'table' => 'node',
      'field' => 'type',
      'relationship' => 'none',
    ),
    'active' => array(
      'operator' => '=',
      'value' => '1',
      'group' => '0',
      'exposed' => FALSE,
      'expose' => array(
        'operator' => FALSE,
        'label' => '',
      ),
      'id' => 'active',
      'table' => 'advpoll',
      'field' => 'active',
      'relationship' => 'none',
    ),
    'end_date' => array(
      'operator' => '>',
      'value' => array(
        'type' => 'offset',
        'value' => 'now',
        'min' => '',
        'max' => '',
      ),
      'group' => '0',
      'exposed' => FALSE,
      'expose' => array(
        'operator' => FALSE,
        'label' => '',
      ),
      'id' => 'end_date',
      'table' => 'advpoll',
      'field' => 'end_date',
      'relationship' => 'none',
    ),
    'start_date' => array(
      'operator' => '<',
      'value' => array(
        'type' => 'offset',
        'value' => 'now',
        'min' => '',
        'max' => '',
      ),
      'group' => '0',
      'exposed' => FALSE,
      'expose' => array(
        'operator' => FALSE,
        'label' => '',
      ),
      'id' => 'start_date',
      'table' => 'advpoll',
      'field' => 'start_date',
      'relationship' => 'none',
    ),
  ));
  $handler
    ->override_option('access', array(
    'type' => 'none',
  ));
  $handler
    ->override_option('cache', array(
    'type' => 'none',
  ));
  $handler
    ->override_option('items_per_page', 1);
  $handler
    ->override_option('row_plugin', 'node');
  $handler
    ->override_option('row_options', array(
    'relationship' => 'none',
    'build_mode' => 'full',
    'links' => 0,
    'comments' => 0,
  ));
  _advpoll_generate_blocks($view);

  /*
   */
  $views[$view->name] = $view;
  return $views;
}