/[drupal]/contributions/modules/ad_views/ad_views.views-ad_flash.inc
ViewVC logotype

Contents of /contributions/modules/ad_views/ad_views.views-ad_flash.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Thu Sep 10 12:19:45 2009 UTC (2 months, 2 weeks ago) by milesgillham
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-ALPHA5, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.1: +6 -1 lines
File MIME type: text/x-php
Fixed #570892: Ad Flash support
1 <?php
2 // $Id: ad_views.views-ad_flash.inc,v 1.1 2009/09/10 12:06:32 milesgillham Exp $
3 /*
4 * @file
5 *
6 * This file provides ad_flash module Views interface:
7 * Ad Flash (ad_flash)
8 * {ad_flash}
9 *
10 */
11
12 function get_ad_flash_views_data() {
13 $data = array();
14 if (db_table_exists('ad_flash')) {
15 // All ads are in a single table group
16 $data['ad_flash']['table']['group'] = t('Ad Flash');
17 // ad_flash is a related table to ads
18 $data['ad_flash']['table']['join']['ads'] = array(
19 'left_field' => 'aid',
20 'field' => 'aid'
21 );
22
23 // Ad flash - 'fid' relationship
24 $data['ad_flash']['fid'] = array(
25 'title' => t('Fid'),
26 // The help that appears on the UI
27 'help' => t('The {files}.fid File ID that this ad relates to.'),
28 // Table relationship
29 'relationship' => array(
30 'label' => t('Files'),
31 'base' => 'files',
32 'base field' => 'fid',
33 // This allows us to not show this relationship if the base is already
34 // files so files won't create circular relationships.
35 'skip base' => array('files')
36 )
37 );
38 // Ad flash - 'url'
39 $data['ad_flash']['url'] = array(
40 'title' => t('URL'),
41 // The help that appears on the UI
42 'help' => t('The ad URL.'),
43 // Information for displaying
44 'field' => array(
45 'handler' => 'views_handler_field_url',
46 'click sortable' => TRUE
47 ),
48 // Information for accepting as an argument
49 'argument' => array(
50 'handler' => 'views_handler_argument_string',
51 'name field' => 'title',
52 'numeric' => FALSE,
53 ),
54 // Information for accepting as a filter
55 'filter' => array(
56 'handler' => 'views_handler_filter_string'
57 ),
58 // Information for sorting
59 'sort' => array(
60 'handler' => 'views_handler_sort'
61 )
62 );
63 // Ad flash - 'width'
64 $data['ad_flash']['width'] = array(
65 'title' => t('Width'),
66 // The help that appears on the UI
67 'help' => t('Ad width.'),
68 // Information for displaying
69 'field' => array(
70 'handler' => 'views_handler_field_numeric',
71 'click sortable' => TRUE
72 ),
73 // Information for accepting as an argument
74 'argument' => array(
75 'handler' => 'views_handler_argument_numeric',
76 'name field' => 'title',
77 'numeric' => TRUE
78 ),
79 // Information for accepting as a filter
80 'filter' => array(
81 'handler' => 'views_handler_filter_numeric'
82 ),
83 // Information for sorting
84 'sort' => array(
85 'handler' => 'views_handler_sort'
86 )
87 );
88 // Ad flash - 'height'
89 $data['ad_flash']['height'] = array(
90 'title' => t('Height'),
91 // The help that appears on the UI
92 'help' => t('Ad height.'),
93 // Information for displaying
94 'field' => array(
95 'handler' => 'views_handler_field_numeric',
96 'click sortable' => TRUE
97 ),
98 // Information for accepting as an argument
99 'argument' => array(
100 'handler' => 'views_handler_argument_numeric',
101 'name field' => 'title',
102 'numeric' => TRUE
103 ),
104 // Information for accepting as a filter
105 'filter' => array(
106 'handler' => 'views_handler_filter_numeric'
107 ),
108 // Information for sorting
109 'sort' => array(
110 'handler' => 'views_handler_sort'
111 )
112 );
113 }
114
115 if (db_table_exists('ad_flash_format')) {
116 // All ads are in a single table group
117 $data['ad_flash_format']['table']['group'] = t('Ad Flash Format');
118 $data['ad_flash_format']['table']['base'] = array(
119 'field' => 'gid',
120 'title' => t('Ad Flash Format'),
121 'help' => t('Flash module ad formats.')
122 );
123
124 // Ad flash format gid - 'gid'
125 $data['ad_flash_format']['gid'] = array(
126 'title' => t('Gid'),
127 // The help that appears on the UI
128 'help' => t('The Ad Flash Format ID.'),
129 // Information for displaying
130 'field' => array(
131 'handler' => 'views_handler_field_numeric',
132 'click sortable' => TRUE
133 ),
134 // Information for accepting as an argument
135 'argument' => array(
136 'handler' => 'views_handler_argument_numeric',
137 'name field' => 'title',
138 'numeric' => TRUE
139 ),
140 // Information for accepting as a filter
141 'filter' => array(
142 'handler' => 'views_handler_filter_numeric'
143 ),
144 // Information for sorting
145 'sort' => array(
146 'handler' => 'views_handler_sort'
147 )
148 );
149 // Ad flash format - 'min_width'
150 $data['ad_flash_format']['min_width'] = array(
151 'title' => t('Min width'),
152 // The help that appears on the UI
153 'help' => t('Ad minimum width.'),
154 // Information for displaying
155 'field' => array(
156 'handler' => 'views_handler_field_numeric',
157 'click sortable' => TRUE
158 ),
159 // Information for accepting as an argument
160 'argument' => array(
161 'handler' => 'views_handler_argument_numeric',
162 'name field' => 'title',
163 'numeric' => TRUE
164 ),
165 // Information for accepting as a filter
166 'filter' => array(
167 'handler' => 'views_handler_filter_numeric'
168 ),
169 // Information for sorting
170 'sort' => array(
171 'handler' => 'views_handler_sort'
172 )
173 );
174 // Ad flash format - 'min_height'
175 $data['ad_flash_format']['min_height'] = array(
176 'title' => t('Minimum height'),
177 // The help that appears on the UI
178 'help' => t('Ad minimum height.'),
179 // Information for displaying
180 'field' => array(
181 'handler' => 'views_handler_field_numeric',
182 'click sortable' => TRUE
183 ),
184 // Information for accepting as an argument
185 'argument' => array(
186 'handler' => 'views_handler_argument_numeric',
187 'name field' => 'title',
188 'numeric' => TRUE
189 ),
190 // Information for accepting as a filter
191 'filter' => array(
192 'handler' => 'views_handler_filter_numeric'
193 ),
194 // Information for sorting
195 'sort' => array(
196 'handler' => 'views_handler_sort'
197 )
198 );
199 // Ad flash format - 'max_width'
200 $data['ad_flash_format']['max_width'] = array(
201 'title' => t('Max width'),
202 // The help that appears on the UI
203 'help' => t('Ad maximum width.'),
204 // Information for displaying
205 'field' => array(
206 'handler' => 'views_handler_field_numeric',
207 'click sortable' => TRUE
208 ),
209 // Information for accepting as an argument
210 'argument' => array(
211 'handler' => 'views_handler_argument_numeric',
212 'name field' => 'title',
213 'numeric' => TRUE
214 ),
215 // Information for accepting as a filter
216 'filter' => array(
217 'handler' => 'views_handler_filter_numeric'
218 ),
219 // Information for sorting
220 'sort' => array(
221 'handler' => 'views_handler_sort'
222 )
223 );
224 // Ad flash format - 'max_height'
225 $data['ad_flash_format']['max_height'] = array(
226 'title' => t('Maximum height'),
227 // The help that appears on the UI
228 'help' => t('Ad maximum height.'),
229 // Information for displaying
230 'field' => array(
231 'handler' => 'views_handler_field_numeric',
232 'click sortable' => TRUE
233 ),
234 // Information for accepting as an argument
235 'argument' => array(
236 'handler' => 'views_handler_argument_numeric',
237 'name field' => 'title',
238 'numeric' => TRUE
239 ),
240 // Information for accepting as a filter
241 'filter' => array(
242 'handler' => 'views_handler_filter_numeric'
243 ),
244 // Information for sorting
245 'sort' => array(
246 'handler' => 'views_handler_sort'
247 )
248 );
249 }
250
251 return $data;
252 }
253

  ViewVC Help
Powered by ViewVC 1.1.2