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

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

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


Revision 1.5 - (show annotations) (download) (as text)
Wed Oct 22 17:28:48 2008 UTC (13 months ago) by bdragon
Branch: MAIN
CVS Tags: DRUPAL-6--3-1-RC1, DRUPAL-6--3-0, DRUPAL-6--3-0-UNSTABLE4, HEAD
Branch point for: DRUPAL-6--3
Changes since 1.4: +3 -2 lines
File MIME type: text/x-php
Simplify the titles a bit in the directory view, and make the Drupal 5 version match the Drupal 6 version.
1 <?php
2 // $Id: location.views_default.inc,v 1.4 2008/09/18 18:06:31 bdragon Exp $
3
4 /**
5 * @file
6 * Default views for location module.
7 */
8
9 /**
10 * Implementation of hook_default_view_views().
11 */
12 function location_views_default_views() {
13 $view = new view;
14 $view->name = 'location_table';
15 $view->description = 'Node location table.';
16 $view->tag = '';
17 $view->view_php = '';
18 $view->base_table = 'node';
19 $view->is_cacheable = FALSE;
20 $view->api_version = 2;
21 $view->disabled = TRUE;
22 $handler = $view->new_display('default', 'Defaults', 'default');
23 $handler->override_option('fields', array(
24 'title' => array(
25 'label' => 'Title',
26 'link_to_node' => 1,
27 'exclude' => 0,
28 'id' => 'title',
29 'table' => 'node',
30 'field' => 'title',
31 'override' => array(
32 'button' => 'Override',
33 ),
34 'relationship' => 'none',
35 ),
36 'street' => array(
37 'label' => 'Street',
38 'style' => 'both',
39 'exclude' => 0,
40 'id' => 'street',
41 'table' => 'location',
42 'field' => 'street',
43 'override' => array(
44 'button' => 'Override',
45 ),
46 'relationship' => 'none',
47 ),
48 'city' => array(
49 'label' => 'City',
50 'exclude' => 0,
51 'id' => 'city',
52 'table' => 'location',
53 'field' => 'city',
54 'override' => array(
55 'button' => 'Override',
56 ),
57 'relationship' => 'none',
58 ),
59 'province' => array(
60 'label' => 'Province',
61 'style' => 'name',
62 'exclude' => 0,
63 'id' => 'province',
64 'table' => 'location',
65 'field' => 'province',
66 'relationship' => 'none',
67 ),
68 'postal_code' => array(
69 'label' => 'Postal Code',
70 'exclude' => 0,
71 'id' => 'postal_code',
72 'table' => 'location',
73 'field' => 'postal_code',
74 'override' => array(
75 'button' => 'Override',
76 ),
77 'relationship' => 'none',
78 ),
79 'country' => array(
80 'label' => 'Country',
81 'style' => 'name',
82 'exclude' => 0,
83 'id' => 'country',
84 'table' => 'location',
85 'field' => 'country',
86 'relationship' => 'none',
87 ),
88 ));
89 $handler->override_option('filters', array(
90 'status_extra' => array(
91 'operator' => '=',
92 'value' => '',
93 'group' => '0',
94 'exposed' => FALSE,
95 'expose' => array(
96 'operator' => FALSE,
97 'label' => '',
98 ),
99 'id' => 'status_extra',
100 'table' => 'node',
101 'field' => 'status_extra',
102 'override' => array(
103 'button' => 'Override',
104 ),
105 'relationship' => 'none',
106 ),
107 'lid' => array(
108 'operator' => 'not empty',
109 'value' => array(
110 'value' => '',
111 'min' => '',
112 'max' => '',
113 ),
114 'group' => '0',
115 'exposed' => FALSE,
116 'expose' => array(
117 'operator' => FALSE,
118 'label' => '',
119 ),
120 'id' => 'lid',
121 'table' => 'location',
122 'field' => 'lid',
123 'relationship' => 'none',
124 ),
125 ));
126 $handler->override_option('access', array(
127 'type' => 'none',
128 ));
129 $handler->override_option('style_plugin', 'table');
130 $handler->override_option('style_options', array(
131 'grouping' => '',
132 'override' => 1,
133 'sticky' => 0,
134 'order' => 'asc',
135 'columns' => array(
136 'title' => 'title',
137 'street' => 'street',
138 'city' => 'city',
139 'province' => 'province',
140 'postal_code' => 'postal_code',
141 'country' => 'country',
142 ),
143 'info' => array(
144 'title' => array(
145 'sortable' => 1,
146 'separator' => '',
147 ),
148 'street' => array(
149 'sortable' => 1,
150 'separator' => '',
151 ),
152 'city' => array(
153 'sortable' => 1,
154 'separator' => '',
155 ),
156 'province' => array(
157 'sortable' => 1,
158 'separator' => '',
159 ),
160 'postal_code' => array(
161 'sortable' => 1,
162 'separator' => '',
163 ),
164 'country' => array(
165 'sortable' => 1,
166 'separator' => '',
167 ),
168 ),
169 'default' => '-1',
170 ));
171 $handler = $view->new_display('page', 'Page', 'page_1');
172 $handler->override_option('path', 'location/views');
173 $handler->override_option('menu', array(
174 'type' => 'normal',
175 'title' => 'Location table',
176 'weight' => '0',
177 ));
178 $handler->override_option('tab_options', array(
179 'type' => 'none',
180 'title' => '',
181 'weight' => 0,
182 ));
183 $views[$view->name] = $view;
184
185
186 $view = new view;
187 $view->name = 'location_directory';
188 $view->description = 'Location directory filtered by arguments in the url.';
189 $view->tag = '';
190 $view->view_php = '';
191 $view->base_table = 'node';
192 $view->is_cacheable = FALSE;
193 $view->api_version = 2;
194 $view->disabled = TRUE;
195 $handler = $view->new_display('default', 'Defaults', 'default');
196 $handler->override_option('fields', array(
197 'title' => array(
198 'label' => 'Title',
199 'link_to_node' => 1,
200 'exclude' => 0,
201 'id' => 'title',
202 'table' => 'node',
203 'field' => 'title',
204 'relationship' => 'none',
205 ),
206 'street' => array(
207 'label' => 'Street',
208 'style' => 'both',
209 'exclude' => 0,
210 'id' => 'street',
211 'table' => 'location',
212 'field' => 'street',
213 'relationship' => 'none',
214 ),
215 'city' => array(
216 'label' => 'City',
217 'exclude' => 0,
218 'id' => 'city',
219 'table' => 'location',
220 'field' => 'city',
221 'relationship' => 'none',
222 ),
223 'province' => array(
224 'label' => 'Province',
225 'style' => 'name',
226 'exclude' => 0,
227 'id' => 'province',
228 'table' => 'location',
229 'field' => 'province',
230 'relationship' => 'none',
231 ),
232 'postal_code' => array(
233 'label' => 'Postal Code',
234 'exclude' => 0,
235 'id' => 'postal_code',
236 'table' => 'location',
237 'field' => 'postal_code',
238 'relationship' => 'none',
239 ),
240 'country' => array(
241 'label' => 'Country',
242 'style' => 'name',
243 'exclude' => 0,
244 'id' => 'country',
245 'table' => 'location',
246 'field' => 'country',
247 'relationship' => 'none',
248 ),
249 ));
250 $handler->override_option('arguments', array(
251 'country' => array(
252 'default_action' => 'summary asc',
253 'style_plugin' => 'default_summary',
254 'style_options' => array(
255 'count' => 1,
256 'override' => 0,
257 'items_per_page' => '25',
258 ),
259 'wildcard' => 'all',
260 'wildcard_substitution' => 'All',
261 'title' => '%1',
262 'default_argument_type' => 'fixed',
263 'default_argument' => '',
264 'validate_type' => 'none',
265 'validate_fail' => 'not found',
266 'id' => 'country',
267 'table' => 'location',
268 'field' => 'country',
269 'relationship' => 'none',
270 'default_options_div_prefix' => '',
271 'default_argument_fixed' => '',
272 'default_argument_php' => '',
273 'validate_argument_node_type' => array(
274 'page' => 0,
275 'story' => 0,
276 ),
277 'validate_argument_node_access' => 0,
278 'validate_argument_nid_type' => 'nid',
279 'validate_argument_php' => '',
280 ),
281 'province' => array(
282 'default_action' => 'summary asc',
283 'style_plugin' => 'default_summary',
284 'style_options' => array(
285 'count' => 1,
286 'override' => 0,
287 'items_per_page' => '25',
288 ),
289 'wildcard' => 'all',
290 'wildcard_substitution' => 'All',
291 'title' => '%2',
292 'default_argument_type' => 'fixed',
293 'default_argument' => '',
294 'validate_type' => 'none',
295 'validate_fail' => 'not found',
296 'id' => 'province',
297 'table' => 'location',
298 'field' => 'province',
299 'relationship' => 'none',
300 'default_options_div_prefix' => '',
301 'default_argument_fixed' => '',
302 'default_argument_php' => '',
303 'validate_argument_node_type' => array(
304 'page' => 0,
305 'story' => 0,
306 ),
307 'validate_argument_node_access' => 0,
308 'validate_argument_nid_type' => 'nid',
309 'validate_argument_php' => '',
310 ),
311 'city' => array(
312 'default_action' => 'summary asc',
313 'style_plugin' => 'default_summary',
314 'style_options' => array(
315 'count' => 1,
316 'override' => 0,
317 'items_per_page' => '25',
318 ),
319 'wildcard' => 'all',
320 'wildcard_substitution' => 'All',
321 'title' => '%3',
322 'default_argument_type' => 'fixed',
323 'default_argument' => '',
324 'validate_type' => 'none',
325 'validate_fail' => 'not found',
326 'glossary' => 1,
327 'limit' => '1',
328 'case' => 'none',
329 'path_case' => 'none',
330 'transform_dash' => 0,
331 'id' => 'city',
332 'table' => 'location',
333 'field' => 'city',
334 'relationship' => 'none',
335 'default_options_div_prefix' => '',
336 'default_argument_fixed' => '',
337 'default_argument_php' => '',
338 'validate_argument_node_type' => array(
339 'page' => 0,
340 'story' => 0,
341 ),
342 'validate_argument_node_access' => 0,
343 'validate_argument_nid_type' => 'nid',
344 'validate_argument_php' => '',
345 ),
346 ));
347 $handler->override_option('filters', array(
348 'status_extra' => array(
349 'operator' => '=',
350 'value' => '',
351 'group' => '0',
352 'exposed' => FALSE,
353 'expose' => array(
354 'operator' => FALSE,
355 'label' => '',
356 ),
357 'id' => 'status_extra',
358 'table' => 'node',
359 'field' => 'status_extra',
360 'relationship' => 'none',
361 ),
362 'lid' => array(
363 'operator' => 'not empty',
364 'value' => array(
365 'value' => '',
366 'min' => '',
367 'max' => '',
368 ),
369 'group' => '0',
370 'exposed' => FALSE,
371 'expose' => array(
372 'operator' => FALSE,
373 'label' => '',
374 ),
375 'id' => 'lid',
376 'table' => 'location',
377 'field' => 'lid',
378 'relationship' => 'none',
379 ),
380 ));
381 $handler->override_option('access', array(
382 'type' => 'none',
383 ));
384 $handler->override_option('style_plugin', 'table');
385 $handler->override_option('style_options', array(
386 'grouping' => '',
387 'override' => 1,
388 'sticky' => 0,
389 'order' => 'asc',
390 'columns' => array(
391 'title' => 'title',
392 'street' => 'street',
393 'city' => 'city',
394 'province' => 'province',
395 'postal_code' => 'postal_code',
396 'country' => 'country',
397 ),
398 'info' => array(
399 'title' => array(
400 'sortable' => 1,
401 'separator' => '',
402 ),
403 'street' => array(
404 'sortable' => 1,
405 'separator' => '',
406 ),
407 'city' => array(
408 'sortable' => 1,
409 'separator' => '',
410 ),
411 'province' => array(
412 'sortable' => 1,
413 'separator' => '',
414 ),
415 'postal_code' => array(
416 'sortable' => 1,
417 'separator' => '',
418 ),
419 'country' => array(
420 'sortable' => 1,
421 'separator' => '',
422 ),
423 ),
424 'default' => '-1',
425 ));
426 $handler = $view->new_display('page', 'Page', 'page_1');
427 $handler->override_option('title', 'Locations');
428 $handler->override_option('path', 'location/directory');
429 $handler->override_option('menu', array(
430 'type' => 'normal',
431 'title' => 'Locations',
432 'weight' => '0',
433 ));
434 $handler->override_option('tab_options', array(
435 'type' => 'none',
436 'title' => '',
437 'weight' => 0,
438 ));
439 $views[$view->name] = $view;
440
441
442 $view = new view;
443 $view->name = 'user_location_table';
444 $view->description = 'User location table.';
445 $view->tag = '';
446 $view->view_php = '';
447 $view->base_table = 'users';
448 $view->is_cacheable = FALSE;
449 $view->api_version = 2;
450 $view->disabled = TRUE;
451 $handler = $view->new_display('default', 'Defaults', 'default');
452 $handler->override_option('fields', array(
453 'name' => array(
454 'label' => 'Name',
455 'link_to_user' => 1,
456 'exclude' => 0,
457 'id' => 'name',
458 'table' => 'users',
459 'field' => 'name',
460 'override' => array(
461 'button' => 'Override',
462 ),
463 'relationship' => 'none',
464 ),
465 'street' => array(
466 'label' => 'Street',
467 'style' => 'both',
468 'exclude' => 0,
469 'id' => 'street',
470 'table' => 'location',
471 'field' => 'street',
472 'override' => array(
473 'button' => 'Override',
474 ),
475 'relationship' => 'none',
476 ),
477 'city' => array(
478 'label' => 'City',
479 'exclude' => 0,
480 'id' => 'city',
481 'table' => 'location',
482 'field' => 'city',
483 'override' => array(
484 'button' => 'Override',
485 ),
486 'relationship' => 'none',
487 ),
488 'province' => array(
489 'label' => 'Province',
490 'style' => 'name',
491 'exclude' => 0,
492 'id' => 'province',
493 'table' => 'location',
494 'field' => 'province',
495 'override' => array(
496 'button' => 'Override',
497 ),
498 'relationship' => 'none',
499 ),
500 'postal_code' => array(
501 'label' => 'Postal Code',
502 'exclude' => 0,
503 'id' => 'postal_code',
504 'table' => 'location',
505 'field' => 'postal_code',
506 'override' => array(
507 'button' => 'Override',
508 ),
509 'relationship' => 'none',
510 ),
511 'country' => array(
512 'label' => 'Country',
513 'style' => 'name',
514 'exclude' => 0,
515 'id' => 'country',
516 'table' => 'location',
517 'field' => 'country',
518 'override' => array(
519 'button' => 'Override',
520 ),
521 'relationship' => 'none',
522 ),
523 ));
524 $handler->override_option('filters', array(
525 'status' => array(
526 'operator' => '=',
527 'value' => 1,
528 'group' => '0',
529 'exposed' => FALSE,
530 'expose' => array(
531 'operator' => FALSE,
532 'label' => '',
533 ),
534 'id' => 'status',
535 'table' => 'users',
536 'field' => 'status',
537 'relationship' => 'none',
538 ),
539 'lid' => array(
540 'operator' => 'not empty',
541 'value' => array(
542 'value' => '',
543 'min' => '',
544 'max' => '',
545 ),
546 'group' => '0',
547 'exposed' => FALSE,
548 'expose' => array(
549 'operator' => FALSE,
550 'label' => '',
551 ),
552 'id' => 'lid',
553 'table' => 'location',
554 'field' => 'lid',
555 'relationship' => 'none',
556 ),
557 ));
558 $handler->override_option('access', array(
559 'type' => 'none',
560 ));
561 $handler->override_option('style_plugin', 'table');
562 $handler->override_option('style_options', array(
563 'grouping' => '',
564 'override' => 1,
565 'sticky' => 0,
566 'order' => 'asc',
567 'columns' => array(
568 'name' => 'name',
569 'street' => 'street',
570 'city' => 'city',
571 'province' => 'province',
572 'postal_code' => 'postal_code',
573 'country' => 'country',
574 ),
575 'info' => array(
576 'name' => array(
577 'sortable' => 1,
578 'separator' => '',
579 ),
580 'street' => array(
581 'sortable' => 1,
582 'separator' => '',
583 ),
584 'city' => array(
585 'sortable' => 1,
586 'separator' => '',
587 ),
588 'province' => array(
589 'sortable' => 1,
590 'separator' => '',
591 ),
592 'postal_code' => array(
593 'sortable' => 1,
594 'separator' => '',
595 ),
596 'country' => array(
597 'sortable' => 1,
598 'separator' => '',
599 ),
600 ),
601 'default' => '-1',
602 ));
603 $handler = $view->new_display('page', 'Page', 'page_1');
604 $handler->override_option('path', 'location/users');
605 $handler->override_option('menu', array(
606 'type' => 'normal',
607 'title' => 'User location table',
608 'weight' => '0',
609 ));
610 $handler->override_option('tab_options', array(
611 'type' => 'none',
612 'title' => '',
613 'weight' => 0,
614 ));
615 $views[$view->name] = $view;
616
617
618 return $views;
619 }

  ViewVC Help
Powered by ViewVC 1.1.2