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

Contents of /contributions/modules/views/modules/node.views_default.inc

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


Revision 1.11 - (show annotations) (download) (as text)
Wed Feb 18 00:07:22 2009 UTC (9 months, 1 week ago) by merlinofchaos
Branch: MAIN
CVS Tags: DRUPAL-6--2-7, DRUPAL-6--2-6, DRUPAL-6--2-5, DRUPAL-6--2-4, DRUPAL-6--3-0-ALPHA1, HEAD
Branch point for: DRUPAL-6--2, DRUPAL-6--3, DRUPAL-7--3
Changes since 1.10: +1 -3 lines
File MIME type: text/x-php
#372959: Archive view should not use AJAX by default.
1 <?php
2 // $Id: node.views_default.inc,v 1.10 2008/10/28 20:19:40 merlinofchaos Exp $
3 /**
4 * @file
5 * Contains default views on behalf of the node module.
6 */
7
8 /**
9 * Implementation of hook_default_view_views().
10 */
11 function node_views_default_views() {
12 $view = new view;
13 $view->name = 'frontpage';
14 $view->description = 'Emulates the default Drupal front page; you may set the default home page path to this view to make it your front page.';
15 $view->tag = 'default';
16 $view->view_php = '';
17 $view->base_table = 'node';
18 $view->is_cacheable = '0';
19 $view->api_version = 2;
20 $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
21 $handler = $view->new_display('default', 'Defaults', 'default');
22 $handler->override_option('sorts', array(
23 'sticky' => array(
24 'id' => 'sticky',
25 'table' => 'node',
26 'field' => 'sticky',
27 'order' => 'DESC',
28 ),
29 'created' => array(
30 'id' => 'created',
31 'table' => 'node',
32 'field' => 'created',
33 'order' => 'DESC',
34 'relationship' => 'none',
35 'granularity' => 'second',
36 ),
37 ));
38 $handler->override_option('filters', array(
39 'promote' => array(
40 'id' => 'promote',
41 'table' => 'node',
42 'field' => 'promote',
43 'operator' => '=',
44 'value' => '1',
45 'group' => 0,
46 'exposed' => FALSE,
47 'expose' => array(
48 'operator' => FALSE,
49 'label' => '',
50 ),
51 ),
52 'status' => array(
53 'id' => 'status',
54 'table' => 'node',
55 'field' => 'status',
56 'operator' => '=',
57 'value' => '1',
58 'group' => 0,
59 'exposed' => FALSE,
60 'expose' => array(
61 'operator' => FALSE,
62 'label' => '',
63 ),
64 ),
65 ));
66 $handler->override_option('access', array(
67 'type' => 'none',
68 'role' => array(),
69 'perm' => '',
70 ));
71 $handler->override_option('header_format', '1');
72 $handler->override_option('footer_format', '1');
73 $handler->override_option('empty_format', '1');
74 $handler->override_option('use_pager', '1');
75 $handler->override_option('row_plugin', 'node');
76 $handler->override_option('row_options', array(
77 'teaser' => 1,
78 'links' => 1,
79 ));
80 $handler = $view->new_display('page', 'Page', 'page');
81 $handler->override_option('path', 'frontpage');
82 $handler->override_option('menu', array(
83 'type' => 'none',
84 'title' => '',
85 'weight' => 0,
86 ));
87 $handler->override_option('tab_options', array(
88 'type' => 'none',
89 'title' => '',
90 'weight' => 0,
91 ));
92 $handler = $view->new_display('feed', 'Feed', 'feed');
93 $handler->override_option('sitename_title', '1');
94 $handler->override_option('title', 'Front page feed');
95 $handler->override_option('style_options', array(
96 'mission_description' => 1,
97 'description' => '',
98 ));
99 $handler->override_option('row_plugin', 'node_rss');
100 $handler->override_option('row_options', array(
101 'item_length' => 'default',
102 ));
103 $handler->override_option('path', 'rss.xml');
104 $handler->override_option('menu', array(
105 'type' => 'none',
106 'title' => '',
107 'weight' => 0,
108 ));
109 $handler->override_option('tab_options', array(
110 'type' => 'none',
111 'title' => '',
112 'weight' => 0,
113 ));
114 $handler->override_option('displays', array(
115 'default' => 'default',
116 'page' => 'page',
117 ));
118 $views[$view->name] = $view;
119
120 $view = new view;
121 $view->name = 'glossary';
122 $view->description = 'A list of all content, by letter.';
123 $view->tag = 'default';
124 $view->view_php = '';
125 $view->base_table = 'node';
126 $view->is_cacheable = '0';
127 $view->api_version = 2;
128 $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
129 $handler = $view->new_display('default', 'Defaults', 'default');
130 $handler->override_option('fields', array(
131 'title' => array(
132 'label' => 'Title',
133 'link_to_node' => 1,
134 'exclude' => 0,
135 'id' => 'title',
136 'table' => 'node',
137 'field' => 'title',
138 'relationship' => 'none',
139 ),
140 'name' => array(
141 'label' => 'Author',
142 'link_to_user' => 1,
143 'exclude' => 0,
144 'id' => 'name',
145 'table' => 'users',
146 'field' => 'name',
147 'relationship' => 'none',
148 ),
149 'changed' => array(
150 'label' => 'Last update',
151 'date_format' => 'large',
152 'custom_date_format' => '',
153 'exclude' => 0,
154 'id' => 'changed',
155 'table' => 'node',
156 'field' => 'changed',
157 'relationship' => 'none',
158 ),
159 ));
160 $handler->override_option('arguments', array(
161 'title' => array(
162 'default_action' => 'default',
163 'style_plugin' => 'default_summary',
164 'style_options' => array(),
165 'wildcard' => 'all',
166 'wildcard_substitution' => 'All',
167 'title' => '',
168 'default_argument_type' => 'fixed',
169 'default_argument' => '',
170 'validate_type' => 'none',
171 'validate_fail' => 'not found',
172 'glossary' => 1,
173 'limit' => '1',
174 'case' => 'upper',
175 'path_case' => 'lower',
176 'transform_dash' => 0,
177 'id' => 'title',
178 'table' => 'node',
179 'field' => 'title',
180 'relationship' => 'none',
181 'default_argument_user' => 0,
182 'default_argument_fixed' => 'a',
183 'default_argument_php' => '',
184 'validate_argument_vocabulary' => array(),
185 'validate_argument_type' => 'tid',
186 'validate_argument_php' => '',
187 ),
188 ));
189 $handler->override_option('access', array(
190 'type' => 'none',
191 'role' => array(),
192 'perm' => '',
193 ));
194 $handler->override_option('use_ajax', '1');
195 $handler->override_option('items_per_page', 36);
196 $handler->override_option('use_pager', '1');
197 $handler->override_option('style_plugin', 'table');
198 $handler->override_option('style_options', array(
199 'grouping' => '',
200 'override' => 1,
201 'sticky' => 0,
202 'order' => 'asc',
203 'columns' => array(
204 'title' => 'title',
205 'name' => 'name',
206 'changed' => 'changed',
207 ),
208 'info' => array(
209 'title' => array(
210 'sortable' => 1,
211 'separator' => '',
212 ),
213 'name' => array(
214 'sortable' => 1,
215 'separator' => '',
216 ),
217 'changed' => array(
218 'sortable' => 1,
219 'separator' => '',
220 ),
221 ),
222 'default' => 'title',
223 ));
224 $handler = $view->new_display('page', 'Page', 'page');
225 $handler->override_option('path', 'glossary');
226 $handler->override_option('menu', array(
227 'type' => 'normal',
228 'title' => 'Glossary',
229 'weight' => '0',
230 ));
231 $handler->override_option('tab_options', array(
232 'type' => 'none',
233 'title' => '',
234 'weight' => 0,
235 ));
236 $handler = $view->new_display('attachment', 'Attachment', 'attachment');
237 $handler->override_option('arguments', array(
238 'title' => array(
239 'default_action' => 'summary asc',
240 'style_plugin' => 'unformatted_summary',
241 'style_options' => array(
242 'count' => 1,
243 'override' => 0,
244 'items_per_page' => '25',
245 'inline' => 1,
246 'separator' => ' | ',
247 ),
248 'wildcard' => 'all',
249 'wildcard_substitution' => 'All',
250 'title' => '',
251 'default_argument_type' => 'fixed',
252 'default_argument' => '',
253 'validate_type' => 'none',
254 'validate_fail' => 'not found',
255 'glossary' => 1,
256 'limit' => '1',
257 'case' => 'upper',
258 'path_case' => 'lower',
259 'transform_dash' => 0,
260 'id' => 'title',
261 'table' => 'node',
262 'field' => 'title',
263 'relationship' => 'none',
264 'default_argument_user' => 0,
265 'default_argument_fixed' => 'a',
266 'validate_argument_vocabulary' => array(),
267 'validate_argument_php' => '',
268 ),
269 ));
270 $handler->override_option('inherit_arguments', 0);
271 $handler->override_option('displays', array(
272 'default' => 'default',
273 'page' => 'page',
274 ));
275 $views[$view->name] = $view;
276
277 $view = new view;
278 $view->name = 'archive';
279 $view->description = 'Display a list of months that link to content for that month.';
280 $view->tag = 'default';
281 $view->view_php = '';
282 $view->base_table = 'node';
283 $view->is_cacheable = '0';
284 $view->api_version = 2;
285 $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
286 $handler = $view->new_display('default', 'Defaults', 'default');
287 $handler->override_option('title', 'Monthly archive');
288 $handler->override_option('sorts', array(
289 'created' => array(
290 'id' => 'created',
291 'table' => 'node',
292 'field' => 'created',
293 'order' => 'DESC',
294 'granularity' => 'second',
295 'relationship' => 'none',
296 ),
297 ));
298 $handler->override_option('arguments', array(
299 'created_year_month' => array(
300 'id' => 'created_year_month',
301 'table' => 'node',
302 'field' => 'created_year_month',
303 'default_action' => 'summary desc',
304 'style_plugin' => 'default_summary',
305 'style_options' => array(
306 'count' => 1,
307 'override' => 1,
308 'items_per_page' => '30',
309 ),
310 'wildcard' => 'all',
311 'wildcard_substitution' => 'All',
312 'title' => '%1',
313 'relationship' => 'none',
314 'validate_type' => 'none',
315 'validate_fail' => 'not found',
316 'default_argument_type' => 'fixed',
317 ),
318 ));
319 $handler->override_option('filters', array(
320 'status' => array(
321 'id' => 'status',
322 'table' => 'node',
323 'field' => 'status',
324 'operator' => '=',
325 'value' => 1,
326 'group' => 0,
327 'exposed' => FALSE,
328 'expose' => array(
329 'operator' => FALSE,
330 'label' => '',
331 ),
332 'relationship' => 'none',
333 ),
334 ));
335 $handler->override_option('access', array(
336 'type' => 'none',
337 'role' => array(),
338 'perm' => '',
339 ));
340 $handler->override_option('use_pager', '1');
341 $handler->override_option('row_plugin', 'node');
342 $handler->override_option('row_options', array(
343 'teaser' => TRUE,
344 'links' => TRUE,
345 ));
346 $handler = $view->new_display('page', 'Page', 'page');
347 $handler->override_option('path', 'archive');
348 $handler->override_option('menu', array(
349 'type' => 'none',
350 'title' => '',
351 'weight' => 0,
352 ));
353 $handler->override_option('tab_options', array(
354 'type' => 'none',
355 'title' => '',
356 'weight' => 0,
357 ));
358 $handler = $view->new_display('block', 'Block', 'block');
359 $handler->override_option('arguments', array(
360 'created_year_month' => array(
361 'id' => 'created_year_month',
362 'table' => 'node',
363 'field' => 'created_year_month',
364 'default_action' => 'summary asc',
365 'style_plugin' => 'default_summary',
366 'style_options' => array(
367 'count' => 1,
368 'override' => 0,
369 'items_per_page' => '30',
370 ),
371 'wildcard' => 'all',
372 'wildcard_substitution' => 'All',
373 'title' => '%1',
374 'relationship' => 'none',
375 'validate_type' => 'none',
376 'validate_fail' => 'not found',
377 'default_argument_type' => 'fixed',
378 ),
379 ));
380 $handler->override_option('block_description', 'Archive list');
381 $views[$view->name] = $view;
382
383 return $views;
384 }

  ViewVC Help
Powered by ViewVC 1.1.2