<?php
//$Id: topichubs_recent_comments.views_default.inc,v 1.1.2.1 2009/09/02 12:00:21 inadarei Exp $

/**
 * Load all plugin defined views.
 */
function topichubs_recent_comments_views_default_views() {
  $view = new view;
  $view->name = 'topichub_recent_comments';
  $view->description = 'Display Recent comments for a Topic Hub';
  $view->tag = 'Topic Hub';
  $view->view_php = '';
  $view->base_table = 'comments';
  $view->is_cacheable = FALSE;
  $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('relationships', array(
    'nid' => array(
      'id' => 'nid',
      'table' => 'comments',
      'field' => 'nid',
      'label' => 'Node',
      'required' => FALSE,
    ),
  ));
  $handler->override_option('fields', array(
    'subject' => array(
      'id' => 'subject',
      'table' => 'comments',
      'field' => 'subject',
      'label' => '',
      'link_to_comment' => 1,
      'relationship' => 'none',
    ),
    'title' => array(
      'label' => '',
      'link_to_node' => 0,
      'exclude' => 0,
      'id' => 'title',
      'table' => 'node',
      'field' => 'title',
      'relationship' => 'nid',
    ),
    'timestamp' => array(
      'id' => 'timestamp',
      'table' => 'comments',
      'field' => 'timestamp',
      'label' => '',
      'date_format' => 'time ago',
      'custom_date_format' => '',
      'relationship' => 'none',
    ),
  ));
  $handler->override_option('sorts', array(
    'timestamp' => array(
      'id' => 'timestamp',
      'table' => 'comments',
      'field' => 'timestamp',
      'order' => 'DESC',
      'granularity' => 'second',
      'relationship' => 'none',
    ),
  ));
  $handler->override_option('arguments', array(
    'nid' => array(
      'default_action' => 'ignore',
      'style_plugin' => 'default_summary',
      'style_options' => array(),
      'wildcard' => 'all',
      'wildcard_substitution' => 'All',
      'title' => '%1: Recent Comments',
      'default_argument_type' => 'fixed',
      'default_argument' => '',
      'validate_type' => 'none',
      'validate_fail' => 'not found',
      'id' => 'nid',
      'table' => 'topichub',
      'field' => 'nid',
      'relationship' => 'nid',
      'default_options_div_prefix' => '',
      'default_argument_user' => 0,
      'default_argument_fixed' => '',
      'default_argument_php' => '',
      'validate_argument_node_type' => array(),
      'validate_argument_node_access' => 0,
      'validate_argument_nid_type' => 'nid',
      'validate_argument_vocabulary' => array(),
      'validate_argument_type' => 'tid',
      'validate_argument_php' => '',
    ),
  ));
  $handler->override_option('filters', array(
    'status_extra' => array(
      'id' => 'status_extra',
      'table' => 'node',
      'field' => 'status_extra',
      'operator' => '=',
      'value' => '',
      'group' => 0,
      'exposed' => FALSE,
      'expose' => array(
        'operator' => FALSE,
        'label' => '',
      ),
      'relationship' => 'nid',
    ),
  ));
  $handler->override_option('access', array(
    'type' => 'none',
    'role' => array(),
    'perm' => '',
  ));
  $handler->override_option('title', 'Recent comments');
  $handler->override_option('items_per_page', 5);
  $handler->override_option('use_more', 1);
  $handler->override_option('distinct', 1);
  $handler->override_option('style_plugin', 'list');
  $handler->override_option('style_options', array(
    'type' => 'ul',
  ));
  $handler = $view->new_display('block', 'Recent Comments', 'block_1');
  $handler->override_option('block_description', 'Recent Comments for Topic Hub');
  $handler->override_option('block_caching', -1);
  $handler = $view->new_display('page', 'Recent Comments Page', 'page_1');
  $handler->override_option('fields', array(
    'subject' => array(
      'id' => 'subject',
      'table' => 'comments',
      'field' => 'subject',
      'label' => '',
      'link_to_comment' => 1,
      'relationship' => 'none',
    ),
    'name' => array(
      'label' => 'By',
      'link_to_user' => 1,
      'exclude' => 0,
      'id' => 'name',
      'table' => 'comments',
      'field' => 'name',
      'override' => array(
        'button' => 'Use default',
      ),
      'relationship' => 'none',
    ),
    'title' => array(
      'label' => 'On',
      'link_to_node' => 1,
      'exclude' => 0,
      'id' => 'title',
      'table' => 'node',
      'field' => 'title',
      'relationship' => 'nid',
      'override' => array(
        'button' => 'Use default',
      ),
    ),
    'comment' => array(
      'label' => '',
      'exclude' => 0,
      'id' => 'comment',
      'table' => 'comments',
      'field' => 'comment',
      'override' => array(
        'button' => 'Use default',
      ),
      'relationship' => 'none',
    ),
    'timestamp' => array(
      'id' => 'timestamp',
      'table' => 'comments',
      'field' => 'timestamp',
      'label' => '',
      'date_format' => 'time ago',
      'custom_date_format' => '',
      'relationship' => 'none',
    ),
  ));
  $handler->override_option('items_per_page', 10);
  $handler->override_option('use_pager', '1');
  $handler->override_option('path', 'topichub-detail/recent-comments');
  $handler->override_option('menu', array(
    'type' => 'none',
    'title' => '',
    'weight' => 0,
    'name' => 'navigation',
  ));
  $handler->override_option('tab_options', array(
    'type' => 'none',
    'title' => '',
    'weight' => 0,
  ));

  return array($view->name => $view);
}

