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

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

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


Revision 1.1 - (show annotations) (download) (as text)
Sat Sep 6 21:04:50 2008 UTC (14 months, 3 weeks ago) by seanr
Branch: MAIN
CVS Tags: DRUPAL-6--1-7, DRUPAL-6--1-8, DRUPAL-6--1-9, DRUPAL-6--1-4, DRUPAL-6--1-6, DRUPAL-5--1-23, DRUPAL-6--1-0, DRUPAL-6--1-1, HEAD
Branch point for: DRUPAL-6--1
File MIME type: text/x-php
Views 2 integration
1 <?php
2 // $Id$
3
4 /**
5 * Implementation of hook_views_default_views()
6 */
7 function forward_views_default_views() {
8 $view = new view;
9 $view->name = 'forward_forwards';
10 $view->description = 'Display most forwarded nodes';
11 $view->tag = '';
12 $view->view_php = '';
13 $view->base_table = 'node';
14 $view->is_cacheable = FALSE;
15 $view->api_version = 2;
16 $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
17 $handler = $view->new_display('default', 'Defaults', 'default');
18 $handler->override_option('fields', array(
19 'title' => array(
20 'label' => '',
21 'link_to_node' => 1,
22 'exclude' => 0,
23 'id' => 'title',
24 'table' => 'node',
25 'field' => 'title',
26 'relationship' => 'none',
27 ),
28 'forward_count' => array(
29 'label' => 'Forwards',
30 'set_precision' => FALSE,
31 'precision' => 0,
32 'decimal' => '.',
33 'separator' => ',',
34 'prefix' => '',
35 'suffix' => '',
36 'exclude' => 0,
37 'id' => 'forward_count',
38 'table' => 'forward_statistics',
39 'field' => 'forward_count',
40 'relationship' => 'none',
41 ),
42 ));
43 $handler->override_option('sorts', array(
44 'forward_count' => array(
45 'order' => 'DESC',
46 'id' => 'forward_count',
47 'table' => 'forward_statistics',
48 'field' => 'forward_count',
49 'relationship' => 'none',
50 ),
51 ));
52 $handler->override_option('filters', array(
53 'status_extra' => array(
54 'id' => 'status_extra',
55 'table' => 'node',
56 'field' => 'status_extra',
57 ),
58 'forward_count' => array(
59 'operator' => '>=',
60 'value' => array(
61 'value' => '1',
62 'min' => '',
63 'max' => '',
64 ),
65 'group' => '0',
66 'exposed' => FALSE,
67 'expose' => array(
68 'operator' => FALSE,
69 'label' => '',
70 ),
71 'id' => 'forward_count',
72 'table' => 'forward_statistics',
73 'field' => 'forward_count',
74 'relationship' => 'none',
75 ),
76 ));
77 $handler->override_option('access', array(
78 'type' => 'none',
79 'role' => array(),
80 'perm' => '',
81 ));
82 $handler->override_option('title', 'Most forwarded');
83 $handler->override_option('items_per_page', 5);
84 $handler->override_option('style_plugin', 'list');
85 $handler = $view->new_display('block', 'Block', 'block_1');
86
87 $views[$view->name] = $view;
88
89
90 $view = new view;
91 $view->name = 'forward_clickthroughs';
92 $view->description = 'Display forwarded nodes most with most clickthroughs';
93 $view->tag = '';
94 $view->view_php = '';
95 $view->base_table = 'node';
96 $view->is_cacheable = FALSE;
97 $view->api_version = 2;
98 $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
99 $handler = $view->new_display('default', 'Defaults', 'default');
100 $handler->override_option('fields', array(
101 'title' => array(
102 'label' => '',
103 'link_to_node' => 1,
104 'exclude' => 0,
105 'id' => 'title',
106 'table' => 'node',
107 'field' => 'title',
108 'relationship' => 'none',
109 ),
110 'clickthrough_count' => array(
111 'label' => 'Forwards',
112 'set_precision' => FALSE,
113 'precision' => 0,
114 'decimal' => '.',
115 'separator' => ',',
116 'prefix' => '',
117 'suffix' => '',
118 'exclude' => 0,
119 'id' => 'clickthrough_count',
120 'table' => 'forward_statistics',
121 'field' => 'clickthrough_count',
122 'relationship' => 'none',
123 ),
124 ));
125 $handler->override_option('sorts', array(
126 'clickthrough_count' => array(
127 'order' => 'DESC',
128 'id' => 'clickthrough_count',
129 'table' => 'forward_statistics',
130 'field' => 'clickthrough_count',
131 'relationship' => 'none',
132 ),
133 ));
134 $handler->override_option('filters', array(
135 'status_extra' => array(
136 'id' => 'status_extra',
137 'table' => 'node',
138 'field' => 'status_extra',
139 ),
140 'clickthrough_count' => array(
141 'operator' => '>=',
142 'value' => array(
143 'value' => '1',
144 'min' => '',
145 'max' => '',
146 ),
147 'group' => '0',
148 'exposed' => FALSE,
149 'expose' => array(
150 'operator' => FALSE,
151 'label' => '',
152 ),
153 'id' => 'clickthrough_count',
154 'table' => 'forward_statistics',
155 'field' => 'clickthrough_count',
156 'relationship' => 'none',
157 ),
158 ));
159 $handler->override_option('access', array(
160 'type' => 'none',
161 'role' => array(),
162 'perm' => '',
163 ));
164 $handler->override_option('title', 'Most clickthroughs');
165 $handler->override_option('items_per_page', 5);
166 $handler->override_option('style_plugin', 'list');
167 $handler = $view->new_display('block', 'Block', 'block_1');
168
169 $views[$view->name] = $view;
170
171
172 $view = new view;
173 $view->name = 'forward_recent';
174 $view->description = 'Display recently forwarded nodes';
175 $view->tag = '';
176 $view->view_php = '';
177 $view->base_table = 'node';
178 $view->is_cacheable = FALSE;
179 $view->api_version = 2;
180 $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
181 $handler = $view->new_display('default', 'Defaults', 'default');
182 $handler->override_option('fields', array(
183 'title' => array(
184 'label' => '',
185 'link_to_node' => 1,
186 'exclude' => 0,
187 'id' => 'title',
188 'table' => 'node',
189 'field' => 'title',
190 'relationship' => 'none',
191 ),
192 'forward_count' => array(
193 'label' => 'Forwards',
194 'set_precision' => FALSE,
195 'precision' => 0,
196 'decimal' => '.',
197 'separator' => ',',
198 'prefix' => '',
199 'suffix' => '',
200 'exclude' => 0,
201 'id' => 'forward_count',
202 'table' => 'forward_statistics',
203 'field' => 'forward_count',
204 'relationship' => 'none',
205 ),
206 ));
207 $handler->override_option('sorts', array(
208 'last_forward_timestamp' => array(
209 'order' => 'DESC',
210 'granularity' => 'second',
211 'id' => 'last_forward_timestamp',
212 'table' => 'forward_statistics',
213 'field' => 'last_forward_timestamp',
214 'relationship' => 'none',
215 ),
216 ));
217 $handler->override_option('filters', array(
218 'status_extra' => array(
219 'id' => 'status_extra',
220 'table' => 'node',
221 'field' => 'status_extra',
222 ),
223 'forward_count' => array(
224 'operator' => '>=',
225 'value' => array(
226 'value' => '1',
227 'min' => '',
228 'max' => '',
229 ),
230 'group' => '0',
231 'exposed' => FALSE,
232 'expose' => array(
233 'operator' => FALSE,
234 'label' => '',
235 ),
236 'id' => 'forward_count',
237 'table' => 'forward_statistics',
238 'field' => 'forward_count',
239 'relationship' => 'none',
240 ),
241 ));
242 $handler->override_option('access', array(
243 'type' => 'none',
244 'role' => array(),
245 'perm' => '',
246 ));
247 $handler->override_option('title', 'Recent forwards');
248 $handler->override_option('items_per_page', 5);
249 $handler->override_option('style_plugin', 'list');
250 $handler = $view->new_display('block', 'Block', 'block_1');
251
252 $views[$view->name] = $view;
253
254 return $views;
255 }
256

  ViewVC Help
Powered by ViewVC 1.1.2