You are here

function video_views_default_views in Video 6

Same name and namespace in other branches
  1. 5 views_video.inc \video_views_default_views()
  2. 6.2 views/video.views_default.inc \video_views_default_views()

Provide a default view

Return value

array - of views

File

./views_video.inc, line 105

Code

function video_views_default_views() {
  $views = array();

  // recent video node activity view
  $view = new stdClass();
  $view->name = 'video_tracker';
  $view->description = t('Shows all recent video activity (table format)');
  $view->access = array();
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = t('Recent video activity');
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = t('There is no recent video activity');
  $view->page_empty_format = '1';
  $view->page_type = 'table';
  $view->url = 'video/tracker';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '20';
  $view->sort = array();
  $view->argument = array();
  $view->field = array(
    array(
      'tablename' => 'node',
      'field' => 'title',
      'label' => t('Title'),
      'handler' => 'views_handler_field_nodelink',
      'sortable' => '1',
    ),
    array(
      'tablename' => 'node',
      'field' => 'changed',
      'label' => t('Last Updated'),
      'handler' => 'views_handler_field_date_small',
      'sortable' => '1',
      'defaultsort' => 'DESC',
    ),
    array(
      'tablename' => 'users',
      'field' => 'name',
      'label' => t('Author'),
    ),
    array(
      'tablename' => 'video',
      'field' => 'video_image',
      'label' => t('Preview / Play'),
    ),
  );
  $view->filter = array(
    array(
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array(
        0 => 'video',
      ),
    ),
    array(
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
  );
  $view->exposed_filter = array();
  $view->requires = array(
    node,
    users,
    video,
  );
  $views[$view->name] = $view;
  return $views;
}