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

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

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


Revision 1.3 - (show annotations) (download) (as text)
Fri Dec 5 20:30:08 2008 UTC (11 months, 3 weeks ago) by nunoveloso18
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.2: +0 -0 lines
File MIME type: text/x-php
no message
1 <?php
2 // $Id: user_badges.views.inc,v 1.1 2008/11/20 17:12:09 heine Exp $
3
4 /**
5 * @file
6 * This defines views hooks for the User_badges module. It will be loaded automatically as needed by the Views module.
7 */
8
9 /**
10 * Implementation of hook_views_handlers().
11 */
12 function user_badges_views_handlers() {
13 return array(
14 'handlers' => array(
15
16 // Field handlers.
17 'views_handler_field_user_badges_user_uid' => array(
18 'parent' => 'views_handler_field',
19 ),
20 ),
21 );
22 }
23
24 /**
25 * Implementation of hook_views_data()
26 */
27 function user_badges_views_data() {
28 // ----------------------------------------------------------------
29 // user_badges table
30
31 // Describe the user_badges table.
32 // Define the base group of this table. Fields that don't
33 // have a group defined will go into this field by default.
34 $data['user_badges_user']['table']['group'] = t('User Badges');
35
36 $data['user_badges_user']['table']['base'] = array(
37 'field' => 'uid',
38 'title' => t('User Badges'),
39 'help' => t('Badges held by users on your site.'),
40 );
41
42 $data['user_badges_user']['table']['join'] = array(
43 'users' => array(
44 'left_field' => 'uid',
45 'field' => 'uid',
46 ),
47 'node' => array(
48 'left_field' => 'uid',
49 'field' => 'uid',
50 ),
51 // This goes to the node so that we have consistent authorship.
52 'node_revisions' => array(
53 'left_table' => 'node',
54 'left_field' => 'uid',
55 'field' => 'uid',
56 ),
57 );
58
59 // Describe the uid column of the user_badges table.
60 $data['user_badges_user']['uid'] = array(
61 'title' => t('Badges'),
62 'help' => t("A User's current badges."), // The help that appears on the UI,
63 'field' => array(
64 'handler' => 'views_handler_field_user_badges_user_uid',
65 ),
66
67 );
68
69 return $data;
70 }

  ViewVC Help
Powered by ViewVC 1.1.2