| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Provide views data and handlers for the Facebook-style Statuses Tags module.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Implementation of hook_views_data().
|
| 11 |
*/
|
| 12 |
function facebook_status_tags_views_data() {
|
| 13 |
$data['facebook_status_tags']['table']['group'] = t('Facebook-style Statuses');
|
| 14 |
|
| 15 |
$data['facebook_status']['table']['join'] = array(
|
| 16 |
'facebook_status_tags' => array(
|
| 17 |
'left_field' => 'sid',
|
| 18 |
'field' => 'sid',
|
| 19 |
),
|
| 20 |
);
|
| 21 |
$data['facebook_status_tags']['table']['join'] = array(
|
| 22 |
'facebook_status' => array(
|
| 23 |
'left_field' => 'sid',
|
| 24 |
'field' => 'sid',
|
| 25 |
),
|
| 26 |
);
|
| 27 |
|
| 28 |
//Declares the Status ID column.
|
| 29 |
$data['facebook_status_tags']['sid'] = array(
|
| 30 |
'title' => t('Status ID'),
|
| 31 |
'help' => t('The ID of the status update.'),
|
| 32 |
);
|
| 33 |
|
| 34 |
//Declares the Tag ID column.
|
| 35 |
$data['facebook_status_tags']['rid'] = array(
|
| 36 |
'title' => t('Tag ID'),
|
| 37 |
'help' => t('The Tag ID of the status - either a UID or Term ID depending on the reference type.'),
|
| 38 |
'field' => array(
|
| 39 |
'handler' => 'views_handler_field',
|
| 40 |
'click sortable' => TRUE,
|
| 41 |
),
|
| 42 |
'filter' => array(
|
| 43 |
'handler' => 'views_handler_filter_numeric',
|
| 44 |
),
|
| 45 |
'sort' => array(
|
| 46 |
'handler' => 'views_handler_sort',
|
| 47 |
),
|
| 48 |
'argument' => array(
|
| 49 |
'handler' => 'views_handler_argument_numeric',
|
| 50 |
),
|
| 51 |
);
|
| 52 |
|
| 53 |
//Defines the Type column.
|
| 54 |
$data['facebook_status_tags']['type'] = array(
|
| 55 |
'title' => t('Tag type'),
|
| 56 |
'help' => t('The type of tag - User or Taxonomy Term.'),
|
| 57 |
'field' => array(
|
| 58 |
'handler' => 'views_handler_field',
|
| 59 |
'click sortable' => TRUE,
|
| 60 |
),
|
| 61 |
'filter' => array(
|
| 62 |
'handler' => 'facebook_status_views_handler_filter_string_type',
|
| 63 |
),
|
| 64 |
);
|
| 65 |
|
| 66 |
return $data;
|
| 67 |
}
|
| 68 |
|
| 69 |
/**
|
| 70 |
* Implementation of hook_views_handlers().
|
| 71 |
*/
|
| 72 |
function facebook_status_tags_views_handlers() {
|
| 73 |
return array(
|
| 74 |
'info' => array(
|
| 75 |
'path' => drupal_get_path('module', 'facebook_status'),
|
| 76 |
),
|
| 77 |
'handlers' => array(
|
| 78 |
'facebook_status_views_handler_filter_string_type' => array(
|
| 79 |
'parent' => 'views_handler_filter_string',
|
| 80 |
),
|
| 81 |
),
|
| 82 |
);
|
| 83 |
}
|