| 1 |
<?php
|
| 2 |
// $Id: userpoints.views.inc,v 1.1.2.1 2008/08/05 02:40:21 kbahey Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* This defines views hooks for the Userpoints module. It will be loaded automatically as needed by the Views module.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Implementation of hook_views_data()
|
| 11 |
*/
|
| 12 |
function userpoints_views_data() {
|
| 13 |
// ----------------------------------------------------------------
|
| 14 |
// userpoints table
|
| 15 |
|
| 16 |
// Define the base group of this table. Fields that don't
|
| 17 |
// have a group defined will go into this field by default.
|
| 18 |
$data['userpoints']['table']['group'] = t('Userpoints');
|
| 19 |
|
| 20 |
$data['userpoints']['table']['base'] = array(
|
| 21 |
'field' => 'uid',
|
| 22 |
'title' => t('Userpoints'),
|
| 23 |
'help' => t('Points accumulated by users on your site.'),
|
| 24 |
);
|
| 25 |
|
| 26 |
$data['userpoints']['table']['join'] = array(
|
| 27 |
'users' => array(
|
| 28 |
'left_field' => 'uid',
|
| 29 |
'field' => 'uid',
|
| 30 |
),
|
| 31 |
'node' => array(
|
| 32 |
'left_field' => 'uid',
|
| 33 |
'field' => 'uid',
|
| 34 |
),
|
| 35 |
// This goes to the node so that we have consistent authorship.
|
| 36 |
'node_revisions' => array(
|
| 37 |
'left_table' => 'node',
|
| 38 |
'left_field' => 'uid',
|
| 39 |
'field' => 'uid',
|
| 40 |
),
|
| 41 |
);
|
| 42 |
|
| 43 |
// points
|
| 44 |
$data['userpoints']['points'] = array(
|
| 45 |
'title' => t('Points'),
|
| 46 |
'help' => t("A User's current points."), // The help that appears on the UI,
|
| 47 |
'field' => array(
|
| 48 |
'handler' => 'views_handler_field',
|
| 49 |
'click sortable' => TRUE,
|
| 50 |
),
|
| 51 |
'argument' => array(
|
| 52 |
'handler' => 'views_handler_argument_numeric',
|
| 53 |
// 'name field' => 'name', // display this field in the summary
|
| 54 |
),
|
| 55 |
'filter' => array(
|
| 56 |
'handler' => 'views_handler_filter_numeric',
|
| 57 |
),
|
| 58 |
'sort' => array(
|
| 59 |
'handler' => 'views_handler_sort',
|
| 60 |
),
|
| 61 |
);
|
| 62 |
|
| 63 |
return $data;
|
| 64 |
}
|