/[drupal]/contributions/modules/ad_views/ad_views.views_default.inc
ViewVC logotype

Contents of /contributions/modules/ad_views/ad_views.views_default.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download) (as text)
Mon Sep 7 02:27:12 2009 UTC (2 months, 2 weeks ago) by milesgillham
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-ALPHA5, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.5: +38 -4 lines
File MIME type: text/x-php
Created default view.
1 <?php
2 // $Id: ad_views.views_default.inc,v 1.5 2009/07/06 13:46:43 milesgillham Exp $
3 /*
4 * @file
5 *
6 * Default views.
7 * By default they will not be enabled.
8 */
9
10 /*
11 * Implements hook_views_default_views()
12 */
13
14 function ad_views_views_default_views() {
15 $views = array();
16 $view = ad_views_views_default_view_ads();
17 if (!empty($view)) {
18 $views[$view->name] = $view;
19 }
20 return $views;
21 }
22
23 function ad_views_views_default_view_ads() {
24 $view = new view;
25 $view->name = 'Random advertisement';
26 $view->description = 'Example view that displays a random advertisement.';
27 $view->tag = '';
28 $view->view_php = '';
29 $view->base_table = 'ads';
30 $view->is_cacheable = FALSE;
31 $view->api_version = 2;
32 $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
33 $handler = $view->new_display('default', 'Defaults', 'default');
34 $handler->override_option('fields', array(
35 'aid' => array(
36 'id' => 'aid',
37 'table' => 'ads',
38 'field' => 'aid',
39 ),
40 ));
41 $handler->override_option('sorts', array(
42 'random' => array(
43 'id' => 'random',
44 'table' => 'views',
45 'field' => 'random',
46 ),
47 ));
48 $handler->override_option('access', array(
49 'type' => 'none',
50 ));
51 $handler->override_option('cache', array(
52 'type' => 'none',
53 ));
54 $handler->override_option('items_per_page', 1);
55 $handler->override_option('distinct', 0);
56 $handler->override_option('row_plugin', 'ad');
57 $handler->override_option('row_options', array(
58 'teaser_only' => 0,
59 ));
60 return $view;
61 }

  ViewVC Help
Powered by ViewVC 1.1.2