| 1 |
<?php
|
| 2 |
// $Id: quotes.views.inc,v 1.2 2009/08/28 16:28:01 nancyw Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* The quotes module allows users to maintain a list of quotes that
|
| 7 |
* can be displayed in any number of administrator-defined quote
|
| 8 |
* blocks.
|
| 9 |
*/
|
| 10 |
|
| 11 |
/**
|
| 12 |
* Implements hook_views_data().
|
| 13 |
*/
|
| 14 |
function quotes_views_data() {
|
| 15 |
// Basic table information.
|
| 16 |
// ----------------------------------------------------------------
|
| 17 |
// quotes table
|
| 18 |
$data['quotes']['table']['group'] = t('Quotes');
|
| 19 |
$data['quotes']['table']['join'] = array(
|
| 20 |
// ...to the node table
|
| 21 |
'node' => array(
|
| 22 |
'left_field' => 'vid',
|
| 23 |
'field' => 'vid',
|
| 24 |
),
|
| 25 |
);
|
| 26 |
|
| 27 |
$data['quotes_authors']['table']['group'] = t('Quotes');
|
| 28 |
$data['quotes_authors']['table']['join'] = array(
|
| 29 |
// ...to the quotes table
|
| 30 |
'node' => array(
|
| 31 |
'left_table' => 'quotes',
|
| 32 |
'left_field' => 'aid',
|
| 33 |
'field' => 'aid',
|
| 34 |
),
|
| 35 |
);
|
| 36 |
|
| 37 |
// Citation.
|
| 38 |
$data['quotes']['citation'] = array(
|
| 39 |
'title' => t('Citation'),
|
| 40 |
'help' => t('The source of the quote.'),
|
| 41 |
'field' => array(
|
| 42 |
// 'handler' => 'views_handler_field_quotes',
|
| 43 |
'click sortable' => TRUE,
|
| 44 |
),
|
| 45 |
'sort' => array(
|
| 46 |
'handler' => 'views_handler_sort',
|
| 47 |
),
|
| 48 |
);
|
| 49 |
|
| 50 |
// Author.
|
| 51 |
$data['quotes_authors']['name'] = array(
|
| 52 |
'title' => t('Author'),
|
| 53 |
'help' => t('The name of the quote\'s author.'),
|
| 54 |
'field' => array(
|
| 55 |
'handler' => 'views_handler_field_quotes',
|
| 56 |
'click sortable' => TRUE,
|
| 57 |
),
|
| 58 |
'sort' => array(
|
| 59 |
'handler' => 'views_handler_sort',
|
| 60 |
),
|
| 61 |
'skip base' => 'quotes',
|
| 62 |
);
|
| 63 |
|
| 64 |
// Bio.
|
| 65 |
$data['quotes_authors']['bio'] = array(
|
| 66 |
'title' => t('Biography'),
|
| 67 |
'help' => t('The biography of the quote\'s author.'),
|
| 68 |
'field' => array(
|
| 69 |
// 'handler' => 'views_handler_field_quotes',
|
| 70 |
'click sortable' => TRUE,
|
| 71 |
),
|
| 72 |
'sort' => array(
|
| 73 |
'handler' => 'views_handler_sort',
|
| 74 |
),
|
| 75 |
'skip base' => 'quotes',
|
| 76 |
);
|
| 77 |
|
| 78 |
return $data;
|
| 79 |
}
|