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

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

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


Revision 1.3 - (show annotations) (download) (as text)
Sat Dec 6 03:18:46 2008 UTC (11 months, 2 weeks ago) by pyutaros
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +0 -0 lines
File MIME type: text/x-php
#322607 by Microbe:  Ascendants and Descendants tabs appear on every node type
#326432 by Microbe:  New 6.x-1.0-beta2 instalation - warning: mysql_fetch_array()
#339263 by Microbe:  Misspelling of word "Birth" in table
#339265 by Microbe:  Marriage type fields requested, in addition to "Religious"
#331459 by Microbe:  GEDCOM data confused on import
1 <?php
2
3
4 /**
5 * Implementation of hook_default_view_views().
6 */
7 function family_views_default_views() {
8 $view = new view;
9 $view->name = 'family';
10 $view->description = 'Family main page and Family Indexes';
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 = FALSE; /* 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' => 'Title',
21 'link_to_node' => 1,
22 'exclude' => 0,
23 'id' => 'title',
24 'table' => 'node',
25 'field' => 'title',
26 'override' => array(
27 'button' => 'Override',
28 ),
29 'relationship' => 'none',
30 ),
31 'changed' => array(
32 'id' => 'changed',
33 'table' => 'node',
34 'field' => 'changed',
35 ),
36 ));
37 $handler->override_option('sorts', array(
38 'title' => array(
39 'order' => 'DESC',
40 'id' => 'title',
41 'table' => 'node',
42 'field' => 'title',
43 'relationship' => 'none',
44 ),
45 ));
46 $handler->override_option('filters', array(
47 'type' => array(
48 'operator' => 'in',
49 'value' => array(),
50 'group' => '0',
51 'exposed' => FALSE,
52 'expose' => array(
53 'operator' => FALSE,
54 'label' => '',
55 ),
56 'id' => 'type',
57 'table' => 'node',
58 'field' => 'type',
59 'relationship' => 'none',
60 ),
61 'status' => array(
62 'operator' => '=',
63 'value' => 1,
64 'group' => '0',
65 'exposed' => FALSE,
66 'expose' => array(
67 'operator' => FALSE,
68 'label' => '',
69 ),
70 'id' => 'status',
71 'table' => 'node',
72 'field' => 'status',
73 'relationship' => 'none',
74 ),
75 ));
76 $handler->override_option('access', array(
77 'type' => 'perm',
78 'perm' => 'access family nodes',
79 ));
80 $handler->override_option('title', 'Family');
81 $handler->override_option('items_per_page', 40);
82 $handler->override_option('use_pager', '1');
83 $handler->override_option('style_plugin', 'table');
84 $handler->override_option('style_options', array(
85 'grouping' => '',
86 'override' => 1,
87 'sticky' => 0,
88 'order' => 'desc',
89 'columns' => array(
90 'lastname' => 'lastname',
91 'firstname' => 'firstname',
92 'middlename' => 'middlename',
93 'gender' => 'gender',
94 'birthdate' => 'birthdate',
95 'deathdate' => 'deathdate',
96 ),
97 'info' => array(
98 'lastname' => array(
99 'sortable' => 1,
100 'separator' => '',
101 ),
102 'firstname' => array(
103 'sortable' => 1,
104 'separator' => '',
105 ),
106 'middlename' => array(
107 'sortable' => 1,
108 'separator' => '',
109 ),
110 'gender' => array(
111 'sortable' => 1,
112 'separator' => '',
113 ),
114 'birthdate' => array(
115 'sortable' => 1,
116 'separator' => '',
117 ),
118 'deathdate' => array(
119 'sortable' => 1,
120 'separator' => '',
121 ),
122 ),
123 'default' => '-1',
124 ));
125 $handler = $view->new_display('page', 'Family Page', 'page_1');
126 $handler->override_option('fields', array(
127 'title' => array(
128 'label' => 'Title',
129 'link_to_node' => 1,
130 'exclude' => 0,
131 'id' => 'title',
132 'table' => 'node',
133 'field' => 'title',
134 'override' => array(
135 'button' => 'Override',
136 ),
137 'relationship' => 'none',
138 ),
139 'changed' => array(
140 'label' => 'Last Updated',
141 'date_format' => 'time ago',
142 'custom_date_format' => '',
143 'exclude' => 0,
144 'id' => 'changed',
145 'table' => 'node',
146 'field' => 'changed',
147 'override' => array(
148 'button' => 'Use default',
149 ),
150 'relationship' => 'none',
151 ),
152 'type' => array(
153 'label' => 'Type',
154 'link_to_node' => 0,
155 'exclude' => 0,
156 'id' => 'type',
157 'table' => 'node',
158 'field' => 'type',
159 'override' => array(
160 'button' => 'Use default',
161 ),
162 'relationship' => 'none',
163 ),
164 ));
165 $handler->override_option('sorts', array(
166 'changed' => array(
167 'order' => 'DESC',
168 'granularity' => 'second',
169 'id' => 'changed',
170 'table' => 'node',
171 'field' => 'changed',
172 'override' => array(
173 'button' => 'Use default',
174 ),
175 'relationship' => 'none',
176 ),
177 ));
178 $handler->override_option('filters', array(
179 'type' => array(
180 'operator' => 'in',
181 'value' => array(
182 'family_individual' => 'family_individual',
183 'family_group' => 'family_group',
184 'family_location' => 'family_location',
185 ),
186 'group' => '0',
187 'exposed' => FALSE,
188 'expose' => array(
189 'operator' => FALSE,
190 'label' => '',
191 ),
192 'id' => 'type',
193 'table' => 'node',
194 'field' => 'type',
195 'relationship' => 'none',
196 'override' => array(
197 'button' => 'Use default',
198 ),
199 ),
200 'status' => array(
201 'operator' => '=',
202 'value' => 1,
203 'group' => '0',
204 'exposed' => FALSE,
205 'expose' => array(
206 'operator' => FALSE,
207 'label' => '',
208 ),
209 'id' => 'status',
210 'table' => 'node',
211 'field' => 'status',
212 'override' => array(
213 'button' => 'Use default',
214 ),
215 'relationship' => 'none',
216 ),
217 ));
218 $handler->override_option('header', '<p>
219 Welcome to the family area. Here you can view all the data on the website. In the left menu you can choose to view all individuals, groups and locations. To view a family tree, ascendancy or descendancy go to the page of the family member you want to view and click the associated tab along the top menu. If you have more information to add to this family tree you can add it by clicking \'create content\' on the side menu or commenting on the page you have information to add to. If you are not sure how to do this please contact the webmaster by clicking the contact link in the menu.
220 </p>');
221 $handler->override_option('header_format', '1');
222 $handler->override_option('header_empty', 1);
223 $handler->override_option('items_per_page', 10);
224 $handler->override_option('use_pager', '0');
225 $handler->override_option('style_options', array(
226 'grouping' => '',
227 'override' => 1,
228 'sticky' => 0,
229 'order' => 'desc',
230 'columns' => array(
231 'title' => 'title',
232 'changed' => 'changed',
233 'type' => 'type',
234 ),
235 'info' => array(
236 'title' => array(
237 'sortable' => 0,
238 'separator' => '',
239 ),
240 'changed' => array(
241 'sortable' => 0,
242 'separator' => '',
243 ),
244 'type' => array(
245 'sortable' => 0,
246 'separator' => '',
247 ),
248 ),
249 'default' => '-1',
250 ));
251 $handler->override_option('path', 'family');
252 $handler->override_option('menu', array(
253 'type' => 'normal',
254 'title' => 'Family',
255 'weight' => '0',
256 ));
257 $handler->override_option('tab_options', array(
258 'type' => 'none',
259 'title' => '',
260 'weight' => 0,
261 ));
262 $handler = $view->new_display('page', 'Individuals Page', 'page_2');
263 $handler->override_option('fields', array(
264 'lastname' => array(
265 'label' => 'Surname',
266 'link_to_node' => 1,
267 'exclude' => 0,
268 'id' => 'lastname',
269 'table' => 'family_individual',
270 'field' => 'lastname',
271 'relationship' => 'none',
272 'override' => array(
273 'button' => 'Use default',
274 ),
275 ),
276 'firstname' => array(
277 'label' => 'Forename',
278 'link_to_node' => 1,
279 'exclude' => 0,
280 'id' => 'firstname',
281 'table' => 'family_individual',
282 'field' => 'firstname',
283 'relationship' => 'none',
284 ),
285 'middlename' => array(
286 'label' => 'Middlename(s)',
287 'link_to_node' => 1,
288 'exclude' => 0,
289 'id' => 'middlename',
290 'table' => 'family_individual',
291 'field' => 'middlename',
292 'relationship' => 'none',
293 ),
294 'gender' => array(
295 'label' => 'Gender',
296 'link_to_node' => 1,
297 'exclude' => 0,
298 'id' => 'gender',
299 'table' => 'family_individual',
300 'field' => 'gender',
301 'relationship' => 'none',
302 ),
303 'birthdate' => array(
304 'label' => 'Birth Date',
305 'exclude' => 0,
306 'id' => 'birthdate',
307 'table' => 'family_individual',
308 'field' => 'birthdate',
309 'relationship' => 'none',
310 ),
311 'deathdate' => array(
312 'label' => 'Death Date',
313 'exclude' => 0,
314 'id' => 'deathdate',
315 'table' => 'family_individual',
316 'field' => 'deathdate',
317 'relationship' => 'none',
318 ),
319 ));
320 $handler->override_option('sorts', array(
321 'lastname' => array(
322 'order' => 'DESC',
323 'id' => 'lastname',
324 'table' => 'family_individual',
325 'field' => 'lastname',
326 'override' => array(
327 'button' => 'Use default',
328 ),
329 'relationship' => 'none',
330 ),
331 ));
332 $handler->override_option('filters', array(
333 'type' => array(
334 'operator' => 'in',
335 'value' => array(
336 'family_individual' => 'family_individual',
337 ),
338 'group' => '0',
339 'exposed' => FALSE,
340 'expose' => array(
341 'operator' => FALSE,
342 'label' => '',
343 ),
344 'id' => 'type',
345 'table' => 'node',
346 'field' => 'type',
347 'relationship' => 'none',
348 'override' => array(
349 'button' => 'Use default',
350 ),
351 ),
352 'status' => array(
353 'operator' => '=',
354 'value' => 1,
355 'group' => '0',
356 'exposed' => FALSE,
357 'expose' => array(
358 'operator' => FALSE,
359 'label' => '',
360 ),
361 'id' => 'status',
362 'table' => 'node',
363 'field' => 'status',
364 'override' => array(
365 'button' => 'Use default',
366 ),
367 'relationship' => 'none',
368 ),
369 ));
370 $handler->override_option('title', 'Individuals Index');
371 $handler->override_option('style_options', array(
372 'grouping' => '',
373 'override' => 1,
374 'sticky' => 0,
375 'order' => 'desc',
376 'columns' => array(
377 'lastname' => 'lastname',
378 'firstname' => 'firstname',
379 'middlename' => 'middlename',
380 'gender' => 'gender',
381 'birthdate' => 'birthdate',
382 'deathdate' => 'deathdate',
383 ),
384 'info' => array(
385 'lastname' => array(
386 'sortable' => 1,
387 'separator' => '',
388 ),
389 'firstname' => array(
390 'sortable' => 1,
391 'separator' => '',
392 ),
393 'middlename' => array(
394 'sortable' => 1,
395 'separator' => '',
396 ),
397 'gender' => array(
398 'sortable' => 1,
399 'separator' => '',
400 ),
401 'birthdate' => array(
402 'sortable' => 1,
403 'separator' => '',
404 ),
405 'deathdate' => array(
406 'sortable' => 1,
407 'separator' => '',
408 ),
409 ),
410 'default' => 'lastname',
411 ));
412 $handler->override_option('path', 'family/individual');
413 $handler->override_option('menu', array(
414 'type' => 'normal',
415 'title' => 'Individuals Index',
416 'weight' => '0',
417 ));
418 $handler->override_option('tab_options', array(
419 'type' => 'none',
420 'title' => '',
421 'weight' => 0,
422 ));
423 $handler = $view->new_display('page', 'Groups Page', 'page_3');
424 $handler->override_option('fields', array(
425 'title' => array(
426 'label' => 'Title',
427 'link_to_node' => 1,
428 'exclude' => 0,
429 'id' => 'title',
430 'table' => 'node',
431 'field' => 'title',
432 'override' => array(
433 'button' => 'Use default',
434 ),
435 'relationship' => 'none',
436 ),
437 'marr_type' => array(
438 'label' => 'Type',
439 'link_to_node' => 1,
440 'exclude' => 0,
441 'id' => 'marr_type',
442 'table' => 'family_group',
443 'field' => 'marr_type',
444 'override' => array(
445 'button' => 'Use default',
446 ),
447 'relationship' => 'none',
448 ),
449 'parent1' => array(
450 'label' => 'Parent 1',
451 'exclude' => 0,
452 'id' => 'parent1',
453 'table' => 'family_group',
454 'field' => 'parent1',
455 'override' => array(
456 'button' => 'Use default',
457 ),
458 'relationship' => 'none',
459 ),
460 'parent2' => array(
461 'label' => 'Parent 2',
462 'exclude' => 0,
463 'id' => 'parent2',
464 'table' => 'family_group',
465 'field' => 'parent2',
466 'override' => array(
467 'button' => 'Use default',
468 ),
469 'relationship' => 'none',
470 ),
471 ));
472 $handler->override_option('sorts', array(
473 'title' => array(
474 'order' => 'DESC',
475 'id' => 'title',
476 'table' => 'node',
477 'field' => 'title',
478 'override' => array(
479 'button' => 'Use default',
480 ),
481 'relationship' => 'none',
482 ),
483 ));
484 $handler->override_option('filters', array(
485 'type' => array(
486 'operator' => 'in',
487 'value' => array(
488 'family_group' => 'family_group',
489 ),
490 'group' => '0',
491 'exposed' => FALSE,
492 'expose' => array(
493 'operator' => FALSE,
494 'label' => '',
495 ),
496 'id' => 'type',
497 'table' => 'node',
498 'field' => 'type',
499 'relationship' => 'none',
500 'override' => array(
501 'button' => 'Use default',
502 ),
503 ),
504 'status' => array(
505 'operator' => '=',
506 'value' => 1,
507 'group' => '0',
508 'exposed' => FALSE,
509 'expose' => array(
510 'operator' => FALSE,
511 'label' => '',
512 ),
513 'id' => 'status',
514 'table' => 'node',
515 'field' => 'status',
516 'override' => array(
517 'button' => 'Use default',
518 ),
519 'relationship' => 'none',
520 ),
521 ));
522 $handler->override_option('title', 'Groups Index');
523 $handler->override_option('style_options', array(
524 'grouping' => '',
525 'override' => 1,
526 'sticky' => 0,
527 'order' => 'desc',
528 'columns' => array(
529 'title' => 'title',
530 'marr_type' => 'marr_type',
531 'parent1' => 'parent1',
532 'parent2' => 'parent2',
533 ),
534 'info' => array(
535 'title' => array(
536 'sortable' => 1,
537 'separator' => '',
538 ),
539 'marr_type' => array(
540 'sortable' => 1,
541 'separator' => '',
542 ),
543 'parent1' => array(
544 'sortable' => 1,
545 'separator' => '',
546 ),
547 'parent2' => array(
548 'sortable' => 1,
549 'separator' => '',
550 ),
551 ),
552 'default' => 'title',
553 ));
554 $handler->override_option('path', 'family/group');
555 $handler->override_option('menu', array(
556 'type' => 'normal',
557 'title' => 'Groups Index',
558 'weight' => '0',
559 ));
560 $handler->override_option('tab_options', array(
561 'type' => 'none',
562 'title' => '',
563 'weight' => 0,
564 ));
565 $handler = $view->new_display('page', 'Locations Page', 'page_4');
566 $handler->override_option('fields', array(
567 'building' => array(
568 'label' => 'Building',
569 'link_to_node' => 1,
570 'exclude' => 0,
571 'id' => 'building',
572 'table' => 'family_location',
573 'field' => 'building',
574 'override' => array(
575 'button' => 'Use default',
576 ),
577 'relationship' => 'none',
578 ),
579 'street' => array(
580 'label' => 'Street',
581 'link_to_node' => 1,
582 'exclude' => 0,
583 'id' => 'street',
584 'table' => 'family_location',
585 'field' => 'street',
586 'override' => array(
587 'button' => 'Use default',
588 ),
589 'relationship' => 'none',
590 ),
591 'city' => array(
592 'label' => 'City',
593 'link_to_node' => 1,
594 'exclude' => 0,
595 'id' => 'city',
596 'table' => 'family_location',
597 'field' => 'city',
598 'override' => array(
599 'button' => 'Use default',
600 ),
601 'relationship' => 'none',
602 ),
603 'county' => array(
604 'label' => 'County',
605 'link_to_node' => 1,
606 'exclude' => 0,
607 'id' => 'county',
608 'table' => 'family_location',
609 'field' => 'county',
610 'override' => array(
611 'button' => 'Use default',
612 ),
613 'relationship' => 'none',
614 ),
615 'state_province' => array(
616 'label' => 'State/Province',
617 'link_to_node' => 1,
618 'exclude' => 1,
619 'id' => 'state_province',
620 'table' => 'family_location',
621 'field' => 'state_province',
622 'override' => array(
623 'button' => 'Use default',
624 ),
625 'relationship' => 'none',
626 ),
627 'country' => array(
628 'label' => 'Country',
629 'link_to_node' => 1,
630 'exclude' => 0,
631 'id' => 'country',
632 'table' => 'family_location',
633 'field' => 'country',
634 'override' => array(
635 'button' => 'Use default',
636 ),
637 'relationship' => 'none',
638 ),
639 ));
640 $handler->override_option('sorts', array(
641 'title' => array(
642 'order' => 'DESC',
643 'id' => 'title',
644 'table' => 'node',
645 'field' => 'title',
646 'override' => array(
647 'button' => 'Use default',
648 ),
649 'relationship' => 'none',
650 ),
651 ));
652 $handler->override_option('filters', array(
653 'type' => array(
654 'operator' => 'in',
655 'value' => array(
656 'family_location' => 'family_location',
657 ),
658 'group' => '0',
659 'exposed' => FALSE,
660 'expose' => array(
661 'operator' => FALSE,
662 'label' => '',
663 ),
664 'id' => 'type',
665 'table' => 'node',
666 'field' => 'type',
667 'relationship' => 'none',
668 'override' => array(
669 'button' => 'Use default',
670 ),
671 ),
672 'status' => array(
673 'operator' => '=',
674 'value' => 1,
675 'group' => '0',
676 'exposed' => FALSE,
677 'expose' => array(
678 'operator' => FALSE,
679 'label' => '',
680 ),
681 'id' => 'status',
682 'table' => 'node',
683 'field' => 'status',
684 'override' => array(
685 'button' => 'Use default',
686 ),
687 'relationship' => 'none',
688 ),
689 ));
690 $handler->override_option('title', 'Locations Index');
691 $handler->override_option('style_options', array(
692 'grouping' => '',
693 'override' => 1,
694 'sticky' => 0,
695 'order' => 'desc',
696 'columns' => array(
697 'building' => 'building',
698 'street' => 'street',
699 'city' => 'city',
700 'county' => 'county',
701 'state_province' => 'state_province',
702 'country' => 'country',
703 ),
704 'info' => array(
705 'building' => array(
706 'sortable' => 1,
707 'separator' => '',
708 ),
709 'street' => array(
710 'sortable' => 1,
711 'separator' => '',
712 ),
713 'city' => array(
714 'sortable' => 1,
715 'separator' => '',
716 ),
717 'county' => array(
718 'sortable' => 1,
719 'separator' => '',
720 ),
721 'state_province' => array(
722 'sortable' => 1,
723 'separator' => '',
724 ),
725 'country' => array(
726 'sortable' => 1,
727 'separator' => '',
728 ),
729 ),
730 'default' => '-1',
731 ));
732 $handler->override_option('path', 'family/location');
733 $handler->override_option('menu', array(
734 'type' => 'normal',
735 'title' => 'Location Index',
736 'weight' => '0',
737 ));
738 $handler->override_option('tab_options', array(
739 'type' => 'none',
740 'title' => '',
741 'weight' => 0,
742 ));
743 $views[$view->name] = $view;
744
745 return $views;
746 }

  ViewVC Help
Powered by ViewVC 1.1.2