| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Provide views data and handlers for the Facebook-style Statuses module.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* @defgroup views_facebook_status_module facebook_status.module handlers
|
| 11 |
*
|
| 12 |
* Includes the ability to create views of just the facebook_status table.
|
| 13 |
* @{
|
| 14 |
*/
|
| 15 |
|
| 16 |
/**
|
| 17 |
* Implementation of hook_views_data()
|
| 18 |
*/
|
| 19 |
function facebook_status_views_data() {
|
| 20 |
//Basic table information.
|
| 21 |
|
| 22 |
$data['facebook_status']['table']['group'] = t('Facebook-style Statuses');
|
| 23 |
|
| 24 |
$data['users']['table']['join'] = array(
|
| 25 |
'facebook_status' => array(
|
| 26 |
'left_field' => 'uid',
|
| 27 |
'field' => 'uid',
|
| 28 |
),
|
| 29 |
);
|
| 30 |
|
| 31 |
//Advertise this table as a possible base table.
|
| 32 |
$data['facebook_status']['table']['base'] = array(
|
| 33 |
'field' => 'sid',
|
| 34 |
'title' => t('Facebook-style Statuses Updates'),
|
| 35 |
'help' => t('Stores status updates.'),
|
| 36 |
'weight' => 10,
|
| 37 |
);
|
| 38 |
|
| 39 |
//Declares the Status ID column.
|
| 40 |
$data['facebook_status']['sid'] = array(
|
| 41 |
'title' => t('Status ID'),
|
| 42 |
'help' => t('The ID of the status update.'),
|
| 43 |
'field' => array(
|
| 44 |
'handler' => 'views_handler_field',
|
| 45 |
'click sortable' => TRUE,
|
| 46 |
),
|
| 47 |
'filter' => array(
|
| 48 |
'handler' => 'views_handler_filter_numeric',
|
| 49 |
),
|
| 50 |
'sort' => array(
|
| 51 |
'handler' => 'views_handler_sort',
|
| 52 |
),
|
| 53 |
'argument' => array(
|
| 54 |
'handler' => 'views_handler_argument_numeric',
|
| 55 |
),
|
| 56 |
);
|
| 57 |
|
| 58 |
//Declares the User ID column.
|
| 59 |
$data['facebook_status']['uid'] = array(
|
| 60 |
'title' => t('User ID'),
|
| 61 |
'help' => t('The User ID of the owner of the status.'),
|
| 62 |
'field' => array(
|
| 63 |
'handler' => 'views_handler_field',
|
| 64 |
'click sortable' => TRUE,
|
| 65 |
),
|
| 66 |
'filter' => array(
|
| 67 |
'handler' => 'views_handler_filter_numeric',
|
| 68 |
),
|
| 69 |
'sort' => array(
|
| 70 |
'handler' => 'views_handler_sort',
|
| 71 |
),
|
| 72 |
'argument' => array(
|
| 73 |
'handler' => 'views_handler_argument_numeric',
|
| 74 |
),
|
| 75 |
);
|
| 76 |
|
| 77 |
//Declares the status message timestamp column.
|
| 78 |
$data['facebook_status']['status_time'] = array(
|
| 79 |
'title' => t('Created time'),
|
| 80 |
'help' => t('The time the status message was posted.'),
|
| 81 |
'field' => array(
|
| 82 |
'handler' => 'views_handler_field_date',
|
| 83 |
'click sortable' => TRUE,
|
| 84 |
),
|
| 85 |
'sort' => array(
|
| 86 |
'handler' => 'views_handler_sort',
|
| 87 |
),
|
| 88 |
'filter' => array(
|
| 89 |
'handler' => 'views_handler_filter_date',
|
| 90 |
),
|
| 91 |
);
|
| 92 |
|
| 93 |
//Declares the status text column.
|
| 94 |
$data['facebook_status']['status'] = array(
|
| 95 |
'title' => t('Status text'),
|
| 96 |
'help' => t('The text of the status update.'),
|
| 97 |
'field' => array(
|
| 98 |
'handler' => 'views_handler_field',
|
| 99 |
'click sortable' => TRUE,
|
| 100 |
),
|
| 101 |
'filter' => array(
|
| 102 |
'handler' => 'views_handler_filter_string',
|
| 103 |
),
|
| 104 |
);
|
| 105 |
|
| 106 |
return $data;
|
| 107 |
}
|