| 1 |
<?php
|
| 2 |
/**
|
| 3 |
* Implementation of hook_views_data()
|
| 4 |
* (see Views module - Views 2 - let me know if when they document this properly!)
|
| 5 |
*/
|
| 6 |
|
| 7 |
function authorship_views_data() {
|
| 8 |
// Define the base group of this table. Fields that don't
|
| 9 |
// have a group defined will go into this field by default.
|
| 10 |
$data['node_authorship']['table']['group'] = t('Node');
|
| 11 |
|
| 12 |
$data['node_authorship']['table']['base'] = array(
|
| 13 |
'field' => 'authorship',
|
| 14 |
'title' => t('Authorship'),
|
| 15 |
'help' => t("Display the authorship setting for the node."),
|
| 16 |
);
|
| 17 |
|
| 18 |
//joins
|
| 19 |
$data['node_authorship']['table']['join'] = array(
|
| 20 |
//...to the node table
|
| 21 |
'node' => array(
|
| 22 |
'left_field' => 'nid',
|
| 23 |
'field' => 'nid',
|
| 24 |
),
|
| 25 |
);
|
| 26 |
|
| 27 |
// ----------------------------------------------------------------
|
| 28 |
// Fields
|
| 29 |
|
| 30 |
// subject
|
| 31 |
$data['node_authorship']['authorship'] = array(
|
| 32 |
'title' => t('Authorship'),
|
| 33 |
'help' => t('Display the author setting for the node.'),
|
| 34 |
'field' => array(
|
| 35 |
'handler' => 'views_handler_field',
|
| 36 |
'click sortable' => TRUE,
|
| 37 |
),
|
| 38 |
'filter' => array(
|
| 39 |
'handler' => 'views_handler_filter_string',
|
| 40 |
),
|
| 41 |
'sort' => array(
|
| 42 |
'handler' => 'views_handler_sort',
|
| 43 |
),
|
| 44 |
'argument' => array(
|
| 45 |
'handler' => 'views_handler_argument_string',
|
| 46 |
),
|
| 47 |
);
|
| 48 |
return $data;
|
| 49 |
}
|
| 50 |
?>
|