/[drupal]/contributions/modules/cre/views/cre.views_default.inc
ViewVC logotype

Diff of /contributions/modules/cre/views/cre.views_default.inc

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

revision 1.1, Sat Mar 7 16:34:49 2009 UTC revision 1.1.2.1, Sat Mar 7 16:34:49 2009 UTC
# Line 0  Line 1 
1    <?php
2    
3    function cre_views_default_views() {
4      $view = new view;
5      $view->name = 'Recommendation';
6      $view->description = 'Recommendations';
7      $view->tag = 'cre';
8      $view->view_php = '';
9      $view->base_table = 'node';
10      $view->is_cacheable = FALSE;
11      $view->api_version = 2;
12      $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
13      $handler = $view->new_display('default', 'Defaults', 'default');
14      $handler->override_option('fields', array(
15        'title' => array(
16          'label' => 'Title',
17          'link_to_node' => 1,
18          'exclude' => 0,
19          'id' => 'title',
20          'table' => 'cre_node_recommendations',
21          'field' => 'title',
22          'relationship' => 'none',
23        ),
24        'score' => array(
25          'label' => 'Predicted Rating',
26          'set_precision' => FALSE,
27          'precision' => 0,
28          'decimal' => '.',
29          'separator' => ',',
30          'prefix' => '',
31          'suffix' => '',
32          'exclude' => 0,
33          'id' => 'score',
34          'table' => 'cre_recommendations',
35          'field' => 'score',
36          'override' => array(
37            'button' => 'Override',
38          ),
39          'relationship' => 'none',
40        ),
41      ));
42      $handler->override_option('sorts', array(
43        'score' => array(
44          'order' => 'DESC',
45          'id' => 'score',
46          'table' => 'cre_recommendations',
47          'field' => 'score',
48          'override' => array(
49            'button' => 'Override',
50          ),
51          'relationship' => 'none',
52        ),
53      ));
54      $handler->override_option('access', array(
55        'type' => 'none',
56      ));
57      $handler->override_option('title', 'My Recommendations');
58      $handler->override_option('style_plugin', 'table');
59      $handler->override_option('style_options', array(
60        'grouping' => '',
61        'override' => 1,
62        'sticky' => 0,
63        'order' => 'desc',
64        'columns' => array(
65          'title' => 'title',
66          'score' => 'score',
67        ),
68        'info' => array(
69          'title' => array(
70            'sortable' => 0,
71            'separator' => '',
72          ),
73          'score' => array(
74            'sortable' => 0,
75            'separator' => '',
76          ),
77        ),
78        'default' => 'score',
79      ));
80      $handler = $view->new_display('page', 'Recommendations Landing Page', 'page_1');
81      $handler->override_option('path', 'recommendations');
82      $handler->override_option('menu', array(
83        'type' => 'none',
84        'title' => '',
85        'weight' => 0,
86        'name' => 'navigation',
87      ));
88      $handler->override_option('tab_options', array(
89        'type' => 'none',
90        'title' => '',
91        'weight' => 0,
92      ));
93      $handler = $view->new_display('block', 'Recommendations Block', 'block_1');
94      $handler->override_option('fields', array(
95        'title' => array(
96          'label' => '',
97          'link_to_node' => 1,
98          'exclude' => 0,
99          'id' => 'title',
100          'table' => 'cre_node_recommendations',
101          'field' => 'title',
102          'relationship' => 'none',
103          'override' => array(
104            'button' => 'Use default',
105          ),
106        ),
107      ));
108      $handler->override_option('items_per_page', 5);
109      $handler->override_option('style_plugin', 'list');
110      $handler->override_option('style_options', array(
111        'grouping' => '',
112        'type' => 'ul',
113      ));
114      $handler->override_option('block_description', '');
115      $handler->override_option('block_caching', -1);
116    
117    
118      $views[$view->name] = $view;
119    
120      return $views;
121    }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.1

  ViewVC Help
Powered by ViewVC 1.1.2