<?php
// $Id: views_bonus_archive.module,v 1.1.2.3 2008/05/10 15:19:30 dmitrig01 Exp $

function views_bonus_archive_views_default_views() {
  $view = new stdClass();
  $view->name = $view->url = 'archive';
  $view->description = t('Bonus Pack: Monthly archive');
  $view->view_args_php = 'if ($type == \'page\' && !$arg[0]) {
  $limit = 25;
}';
  $view->page_title = t('Month');
  $view->block_title = t('Archive');
  $view->page_type = $view->block_type = 'teaser';
  $view->block = $view->page = $view->use_pager = TRUE;
  $view->nodes_per_page = '10';
  $view->nodes_per_block = '5';
  $view->page_empty_format = $view->block_more = $view->page_footer_format = $view->page_header_format =
    $view->block_header_format = $view->block_footer_format = $view->block_empty_format = '1';
  $view->block_use_page_header = $view->block_use_page_footer = $view->block_use_page_empty = FALSE;
  $view->sort = array(
    array(
      'tablename' => 'node',
      'field' => 'created',
      'sortorder' => 'DESC',
      'options' => '',
    ),
  );
  $view->argument = array(
    array(
      'type' => 'monthyear',
      'argdefault' => '5',
      'title' => '%1',
      'options' => '',
      'wildcard' => '',
      'wildcard_substitution' => '',
    ),
  );
  $view->access = $view->field = $view->filter = $view->exposed_filter = array();
  foreach (array('page', 'block') as $type) {
    foreach (array('header', 'footer', 'empty') as $name) {
      $variable = $type .'_'. $name;
      $view->$variable = '';
    }
  }
  
  return array('archive' => $view);
}
