/[drupal]/contributions/modules/rsvp/rsvp.views.inc
ViewVC logotype

Contents of /contributions/modules/rsvp/rsvp.views.inc

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


Revision 1.1 - (show annotations) (download) (as text)
Sun Nov 30 21:12:07 2008 UTC (11 months, 3 weeks ago) by owahab
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-RC1, DRUPAL-6--1-0-RC2, DRUPAL-6--1-0-RC3, DRUPAL-6--1-0-RC4, DRUPAL-6--1-0, DRUPAL-6--1-1, HEAD
Branch point for: DRUPAL-6--1, DRUPAL-6--2
File MIME type: text/x-php
#330247 by ulf1, adding new files
1 <?php
2 // $Id$
3
4 /**
5 * @module rsvp
6 * @package rsvp - A drupal module developed for civicspace - a distribution of drupal.
7 * @description Provides view support for rsvp.
8 * @author crunchywelch (welch@advomatic.com)
9 * @author Omar Abdel-Wahab (owahab@gmail.com)
10 * @author Ulf Schenk (ulf@schenkunlimited.net)
11 *
12 */
13
14 /**
15 * Declare rsvp tables to views.
16 *
17 * @return array of tables.
18 */
19 function rsvp_views_data() {
20
21 $data = array(
22 'rsvp' => array(
23 'table' => array(
24 'group' => t('RSVP'),
25
26 'join' => array(
27 'node' => array(
28 'left_field' => 'nid',
29 'field' => 'nid',
30 'type' => 'INNER',
31 ),
32 ),
33 ),
34 'total_rsvps' => array(
35 'title' => t(' Total RSVPs'),
36 'help' => t('Display total RSVPs for the node.'),
37 'field' => array(
38 'handler' => 'rsvp_handler_field_rsvp_total_rsvps',
39 'click sortable' => true,
40 ),
41 // 'sort' => array(
42 // 'handler' => 'views_rsvp_sort_handler_total_rsvp',
43 // 'help' => t('Sort by the total RSVPs on a node'),
44 // ),
45
46 ),
47
48 ),
49
50 'rsvp_invite' => array(
51 'table' => array(
52 'group' => t('RSVP'),
53 'base' => array(
54 'field' => 'rid',
55 'title' => t('RSVP'),
56 'help' => t('Displaying rsvp'),
57 ),
58
59 'join' => array(
60 'node' => array(
61 'left_table' => 'rsvp',
62 'left_field' => 'rid',
63 'field' => 'rid',
64 ),
65 'rsvp' => array(
66 'left_field' => 'rid',
67 'field' => 'rid',
68 ),
69 ),
70 ),
71 'total_invites' => array(
72 'title' => t('Total Invites'),
73 'help' => t('Display total invites for all RSVPs on the node.'),
74 'field' => array(
75 'handler' => 'rsvp_handler_field_rsvp_invite_total_invites',
76 'click sortable' => true,
77 ),
78 /* 'sort' => array(
79 'help' => t('Sort by the total invites in all RSVPs on a node'),
80 ),
81 */
82 ),
83
84 ),
85
86
87
88
89
90 );
91
92 return $data;
93
94 }
95
96 function rsvp_views_handlers() {
97 return array(
98 'handlers' => array(
99 'rsvp_handler_field_rsvp_total_rsvps' => array(
100 'parent' => 'views_handler_field',
101 ),
102 'rsvp_handler_field_rsvp_invite_total_invites' => array(
103 'parent' => 'views_handler_field',
104 ),
105 /* 'rsvp_handler_field_rsvp_invite_total_invites' => array(
106 'parent' => 'views_handler_filter_in_operator',
107 ),
108 */ ),
109 );
110 }
111
112
113
114 ///////////////////
115
116 /*function views_rsvp_sort_handler_total_rsvp($action, &$query, $sortinfo, $sort) {
117 $query->orderby[] = "rsvp.rsvp_total_rsvps $sort[sortorder]";
118 }
119 */

  ViewVC Help
Powered by ViewVC 1.1.2