| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
/*
|
| 4 |
* @file
|
| 5 |
*
|
| 6 |
* This file provides ad_text module Views interface:
|
| 7 |
* Ad Text (ad_text)
|
| 8 |
* {ad_text}
|
| 9 |
*
|
| 10 |
*/
|
| 11 |
|
| 12 |
function get_ad_text_views_data() {
|
| 13 |
$data = array();
|
| 14 |
if (db_table_exists('ad_text')) {
|
| 15 |
// All ads are in a single table group
|
| 16 |
$data['ad_text']['table']['group'] = t('Ad Text');
|
| 17 |
// ad_text is a related table to ads
|
| 18 |
$data['ad_text']['table']['join']['ads'] = array(
|
| 19 |
'left_field' => 'aid',
|
| 20 |
'field' => 'aid'
|
| 21 |
);
|
| 22 |
// Ad URL - 'url'
|
| 23 |
$data['ad_text']['url'] = array(
|
| 24 |
'title' => t('URL'),
|
| 25 |
// The help that appears on the UI
|
| 26 |
'help' => t('The ad URL.'),
|
| 27 |
// Information for displaying
|
| 28 |
'field' => array(
|
| 29 |
'handler' => 'views_handler_field_url',
|
| 30 |
'click sortable' => TRUE
|
| 31 |
),
|
| 32 |
// Information for accepting as an argument
|
| 33 |
'argument' => array(
|
| 34 |
'handler' => 'views_handler_argument_string',
|
| 35 |
'name field' => 'title',
|
| 36 |
'numeric' => FALSE,
|
| 37 |
),
|
| 38 |
// Information for accepting as a filter
|
| 39 |
'filter' => array(
|
| 40 |
'handler' => 'views_handler_filter_string'
|
| 41 |
),
|
| 42 |
// Information for sorting
|
| 43 |
'sort' => array(
|
| 44 |
'handler' => 'views_handler_sort'
|
| 45 |
)
|
| 46 |
);
|
| 47 |
}
|
| 48 |
// Ad AdHeader - 'adheader'
|
| 49 |
$data['ad_text']['adheader'] = array(
|
| 50 |
'title' => t('Ad Header'),
|
| 51 |
// The help that appears on the UI
|
| 52 |
'help' => t('The ad header.'),
|
| 53 |
// Information for displaying
|
| 54 |
'field' => array(
|
| 55 |
'handler' => 'views_handler_field',
|
| 56 |
'click sortable' => TRUE
|
| 57 |
),
|
| 58 |
// Information for accepting as an argument
|
| 59 |
'argument' => array(
|
| 60 |
'handler' => 'views_handler_argument_string',
|
| 61 |
'name field' => 'title',
|
| 62 |
'numeric' => FALSE,
|
| 63 |
),
|
| 64 |
// Information for accepting as a filter
|
| 65 |
'filter' => array(
|
| 66 |
'handler' => 'views_handler_filter_string'
|
| 67 |
),
|
| 68 |
// Information for sorting
|
| 69 |
'sort' => array(
|
| 70 |
'handler' => 'views_handler_sort'
|
| 71 |
)
|
| 72 |
);
|
| 73 |
// Ad AdBody - 'adbody'
|
| 74 |
$data['ad_text']['adbody'] = array(
|
| 75 |
'title' => t('Ad Body'),
|
| 76 |
// The help that appears on the UI
|
| 77 |
'help' => t('The ad body.'),
|
| 78 |
// Information for displaying
|
| 79 |
'field' => array(
|
| 80 |
'handler' => 'views_handler_field',
|
| 81 |
'click sortable' => TRUE
|
| 82 |
),
|
| 83 |
// Information for accepting as an argument
|
| 84 |
'argument' => array(
|
| 85 |
'handler' => 'views_handler_argument_string',
|
| 86 |
'name field' => 'title',
|
| 87 |
'numeric' => FALSE,
|
| 88 |
),
|
| 89 |
// Information for accepting as a filter
|
| 90 |
'filter' => array(
|
| 91 |
'handler' => 'views_handler_filter_string'
|
| 92 |
),
|
| 93 |
// Information for sorting
|
| 94 |
'sort' => array(
|
| 95 |
'handler' => 'views_handler_sort'
|
| 96 |
)
|
| 97 |
);
|
| 98 |
return $data;
|
| 99 |
}
|
| 100 |
|