views_bonus_archive.module

Tracking 5.x-1.x branch
  1. drupal
    1. 5 contributions/views_bonus/views_bonus_archive.module

File

View source
  1. <?php
  2. function views_bonus_archive_views_default_views() {
  3. $view = new stdClass();
  4. $view->name = $view->url = 'archive';
  5. $view->description = t('Bonus Pack: Monthly archive');
  6. $view->view_args_php = 'if ($type == \'page\' && !$arg[0]) {
  7. $limit = 25;
  8. }';
  9. $view->page_title = t('Month');
  10. $view->block_title = t('Archive');
  11. $view->page_type = $view->block_type = 'teaser';
  12. $view->block = $view->page = $view->use_pager = TRUE;
  13. $view->nodes_per_page = '10';
  14. $view->nodes_per_block = '5';
  15. $view->page_empty_format = $view->block_more = $view->page_footer_format = $view->page_header_format =
  16. $view->block_header_format = $view->block_footer_format = $view->block_empty_format = '1';
  17. $view->block_use_page_header = $view->block_use_page_footer = $view->block_use_page_empty = FALSE;
  18. $view->sort = array(
  19. array(
  20. 'tablename' => 'node',
  21. 'field' => 'created',
  22. 'sortorder' => 'DESC',
  23. 'options' => '',
  24. ),
  25. );
  26. $view->argument = array(
  27. array(
  28. 'type' => 'monthyear',
  29. 'argdefault' => '5',
  30. 'title' => '%1',
  31. 'options' => '',
  32. 'wildcard' => '',
  33. 'wildcard_substitution' => '',
  34. ),
  35. );
  36. $view->access = $view->field = $view->filter = $view->exposed_filter = array();
  37. foreach (array('page', 'block') as $type) {
  38. foreach (array('header', 'footer', 'empty') as $name) {
  39. $variable = $type .'_'. $name;
  40. $view->$variable = '';
  41. }
  42. }
  43. return array('archive' => $view);
  44. }