Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/modules/aggregator.views.inc | ||
---|---|---|
12 | 12 |
*/ |
13 | 13 |
function aggregator_views_data() { |
14 | 14 |
// ---------------------------------------------------------------------- |
15 |
// Main Aggregator Item base table |
|
16 |
|
|
17 |
// Define the base group of this table. Fields that don't |
|
18 |
// have a group defined will go into this field by default. |
|
15 |
// Main Aggregator Item base table. |
|
16 |
// Define the base group of this table. Fields that don't have a group |
|
17 |
// defined will go into this field by default. |
|
19 | 18 |
$data['aggregator_item']['table']['group'] = t('Aggregator'); |
20 | 19 |
|
21 |
// Advertise this table as a possible base table |
|
20 |
// Advertise this table as a possible base table.
|
|
22 | 21 |
$data['aggregator_item']['table']['base'] = array( |
23 | 22 |
'field' => 'iid', |
24 | 23 |
'title' => t('Aggregator item'), |
... | ... | |
27 | 26 |
|
28 | 27 |
// ---------------------------------------------------------------- |
29 | 28 |
// Fields |
30 |
|
|
31 |
// item id. |
|
32 |
$data['aggregator_item']['iid'] = array( |
|
33 |
'title' => t('Feed Item ID'), |
|
34 |
'help' => t('The unique ID of the aggregator item.'), |
|
35 |
'field' => array( |
|
36 |
'handler' => 'views_handler_field_numeric', |
|
37 |
'click sortable' => TRUE, |
|
38 |
), |
|
39 |
'argument' => array( |
|
40 |
'handler' => 'views_handler_argument_numeric', |
|
41 |
'numeric' => TRUE, |
|
42 |
), |
|
43 |
'filter' => array( |
|
44 |
'handler' => 'views_handler_filter_numeric', |
|
45 |
), |
|
46 |
'sort' => array( |
|
47 |
'handler' => 'views_handler_sort', |
|
48 |
), |
|
49 |
); |
|
50 |
|
|
51 |
// iid |
|
29 |
// Item ID / 'iid'. |
|
52 | 30 |
$data['aggregator_item']['iid'] = array( |
31 |
// The item it appears as on the UI, |
|
53 | 32 |
'title' => t('Item ID'), |
54 |
'help' => t('The unique ID of the aggregator item.'), // The help that appears on the UI, |
|
55 |
// Information for displaying the iid |
|
33 |
// The help that appears on the UI, |
|
34 |
'help' => t('The unique ID of the aggregator item.'), |
|
35 |
// Information for displaying the iid. |
|
56 | 36 |
'field' => array( |
57 | 37 |
'handler' => 'views_handler_field_numeric', |
58 | 38 |
'click sortable' => TRUE, |
59 | 39 |
), |
60 |
// Information for accepting a iid as an argument |
|
40 |
// Information for accepting a iid as an argument.
|
|
61 | 41 |
'argument' => array( |
62 | 42 |
'handler' => 'views_handler_argument_aggregator_iid', |
63 |
'name field' => 'title', // the field to display in the summary. |
|
43 |
'name field' => 'title', |
|
44 |
// The field to display in the summary. |
|
64 | 45 |
'numeric' => TRUE, |
65 | 46 |
), |
66 |
// Information for accepting a nid as a filter |
|
47 |
// Information for accepting a nid as a filter.
|
|
67 | 48 |
'filter' => array( |
68 | 49 |
'handler' => 'views_handler_filter_numeric', |
69 | 50 |
), |
... | ... | |
73 | 54 |
), |
74 | 55 |
); |
75 | 56 |
|
76 |
// title
|
|
57 |
// Title.
|
|
77 | 58 |
$data['aggregator_item']['title'] = array( |
78 |
'title' => t('Title'), // The item it appears as on the UI, |
|
59 |
// The item it appears as on the UI, |
|
60 |
'title' => t('Title'), |
|
79 | 61 |
'help' => t('The title of the aggregator item.'), |
80 |
// Information for displaying a title as a field
|
|
62 |
// Information for displaying a title as a field.
|
|
81 | 63 |
'field' => array( |
82 | 64 |
'handler' => 'views_handler_field_aggregator_title_link', |
83 | 65 |
'extra' => array('link'), |
84 | 66 |
'click sortable' => TRUE, |
85 |
),
|
|
67 |
), |
|
86 | 68 |
'sort' => array( |
87 | 69 |
'handler' => 'views_handler_sort', |
88 | 70 |
), |
89 |
// Information for accepting a title as a filter |
|
71 |
// Information for accepting a title as a filter.
|
|
90 | 72 |
'filter' => array( |
91 | 73 |
'handler' => 'views_handler_filter_string', |
92 | 74 |
), |
93 | 75 |
); |
94 | 76 |
|
95 |
// link
|
|
77 |
// Link.
|
|
96 | 78 |
$data['aggregator_item']['link'] = array( |
97 |
'title' => t('Link'), // The item it appears as on the UI, |
|
79 |
// The item it appears as on the UI, |
|
80 |
'title' => t('Link'), |
|
98 | 81 |
'help' => t('The link to the original source URL of the item.'), |
99 | 82 |
'field' => array( |
100 | 83 |
'handler' => 'views_handler_field_url', |
101 | 84 |
'click sortable' => TRUE, |
102 |
),
|
|
85 |
), |
|
103 | 86 |
'sort' => array( |
104 | 87 |
'handler' => 'views_handler_sort', |
105 | 88 |
), |
106 |
// Information for accepting a title as a filter |
|
89 |
// Information for accepting a title as a filter.
|
|
107 | 90 |
'filter' => array( |
108 | 91 |
'handler' => 'views_handler_filter_string', |
109 | 92 |
), |
110 | 93 |
); |
111 | 94 |
|
112 |
// author
|
|
95 |
// Author.
|
|
113 | 96 |
$data['aggregator_item']['author'] = array( |
114 |
'title' => t('Author'), // The item it appears as on the UI, |
|
97 |
// The item it appears as on the UI, |
|
98 |
'title' => t('Author'), |
|
115 | 99 |
'help' => t('The author of the original imported item.'), |
116 |
// Information for displaying a title as a field
|
|
100 |
// Information for displaying a title as a field.
|
|
117 | 101 |
'field' => array( |
118 | 102 |
'handler' => 'views_handler_field_aggregator_xss', |
119 | 103 |
'click sortable' => TRUE, |
120 |
),
|
|
104 |
), |
|
121 | 105 |
'sort' => array( |
122 | 106 |
'handler' => 'views_handler_sort', |
123 | 107 |
), |
124 |
// Information for accepting a title as a filter |
|
108 |
// Information for accepting a title as a filter.
|
|
125 | 109 |
'filter' => array( |
126 | 110 |
'handler' => 'views_handler_filter_string', |
127 | 111 |
), |
... | ... | |
130 | 114 |
), |
131 | 115 |
); |
132 | 116 |
|
133 |
// guid
|
|
117 |
// 'guid'.
|
|
134 | 118 |
$data['aggregator_item']['guid'] = array( |
135 |
'title' => t('GUID'), // The item it appears as on the UI, |
|
119 |
// The item it appears as on the UI, |
|
120 |
'title' => t('GUID'), |
|
136 | 121 |
'help' => t('The guid of the original imported item.'), |
137 |
// Information for displaying a title as a field
|
|
122 |
// Information for displaying a title as a field.
|
|
138 | 123 |
'field' => array( |
139 | 124 |
'handler' => 'views_handler_field_xss', |
140 | 125 |
'click sortable' => TRUE, |
141 |
),
|
|
126 |
), |
|
142 | 127 |
'sort' => array( |
143 | 128 |
'handler' => 'views_handler_sort', |
144 | 129 |
), |
145 |
// Information for accepting a title as a filter |
|
130 |
// Information for accepting a title as a filter.
|
|
146 | 131 |
'filter' => array( |
147 | 132 |
'handler' => 'views_handler_filter_string', |
148 | 133 |
), |
... | ... | |
151 | 136 |
), |
152 | 137 |
); |
153 | 138 |
|
154 |
// feed body
|
|
139 |
// Feed body.
|
|
155 | 140 |
$data['aggregator_item']['description'] = array( |
156 |
'title' => t('Body'), // The item it appears as on the UI, |
|
141 |
// The item it appears as on the UI, |
|
142 |
'title' => t('Body'), |
|
157 | 143 |
'help' => t('The actual content of the imported item.'), |
158 |
// Information for displaying a title as a field
|
|
144 |
// Information for displaying a title as a field.
|
|
159 | 145 |
'field' => array( |
160 | 146 |
'handler' => 'views_handler_field_aggregator_xss', |
161 | 147 |
'click sortable' => FALSE, |
162 |
),
|
|
163 |
// Information for accepting a title as a filter |
|
148 |
), |
|
149 |
// Information for accepting a title as a filter.
|
|
164 | 150 |
'filter' => array( |
165 | 151 |
'handler' => 'views_handler_filter_string', |
166 | 152 |
), |
167 | 153 |
); |
168 | 154 |
|
169 |
// item timestamp
|
|
155 |
// Item timestamp.
|
|
170 | 156 |
$data['aggregator_item']['timestamp'] = array( |
171 |
'title' => t('Timestamp'), // The item it appears as on the UI, |
|
157 |
// The item it appears as on the UI, |
|
158 |
'title' => t('Timestamp'), |
|
172 | 159 |
'help' => t('The date the original feed item was posted. (With some feeds, this will be the date it was imported.)'), |
173 |
// Information for displaying a title as a field
|
|
160 |
// Information for displaying a title as a field.
|
|
174 | 161 |
'field' => array( |
175 | 162 |
'handler' => 'views_handler_field_date', |
176 | 163 |
'click sortable' => TRUE, |
177 |
),
|
|
164 |
), |
|
178 | 165 |
'sort' => array( |
179 | 166 |
'handler' => 'views_handler_sort_date', |
180 | 167 |
), |
181 |
// Information for accepting a title as a filter |
|
168 |
// Information for accepting a title as a filter.
|
|
182 | 169 |
'filter' => array( |
183 | 170 |
'handler' => 'views_handler_filter_date', |
184 | 171 |
), |
... | ... | |
187 | 174 |
), |
188 | 175 |
); |
189 | 176 |
|
190 |
|
|
191 | 177 |
// ---------------------------------------------------------------------- |
192 |
// Aggregator feed table |
|
193 |
|
|
178 |
// Aggregator feed table. |
|
194 | 179 |
$data['aggregator_feed']['table']['group'] = t('Aggregator feed'); |
195 | 180 |
|
196 | 181 |
// Explain how this table joins to others. |
... | ... | |
201 | 186 |
), |
202 | 187 |
); |
203 | 188 |
|
204 |
// fid
|
|
189 |
// Feed ID / 'fid'.
|
|
205 | 190 |
$data['aggregator_feed']['fid'] = array( |
191 |
// The item it appears as on the UI, |
|
206 | 192 |
'title' => t('Feed ID'), |
207 |
'help' => t('The unique ID of the aggregator feed.'), // The help that appears on the UI, |
|
208 |
// Information for displaying the fid |
|
193 |
// The help that appears on the UI, |
|
194 |
'help' => t('The unique ID of the aggregator feed.'), |
|
195 |
// Information for displaying the fid. |
|
209 | 196 |
'field' => array( |
210 | 197 |
'handler' => 'views_handler_field_numeric', |
211 | 198 |
'click sortable' => TRUE, |
212 | 199 |
), |
213 |
// Information for accepting a fid as an argument |
|
200 |
// Information for accepting a fid as an argument.
|
|
214 | 201 |
'argument' => array( |
215 | 202 |
'handler' => 'views_handler_argument_aggregator_fid', |
216 |
'name field' => 'title', // the field to display in the summary. |
|
203 |
'name field' => 'title', |
|
204 |
// The field to display in the summary. |
|
217 | 205 |
'numeric' => TRUE, |
218 | 206 |
), |
219 |
// Information for accepting a nid as a filter |
|
207 |
// Information for accepting a nid as a filter.
|
|
220 | 208 |
'filter' => array( |
221 | 209 |
'handler' => 'views_handler_filter_numeric', |
222 | 210 |
), |
... | ... | |
226 | 214 |
), |
227 | 215 |
); |
228 | 216 |
|
229 |
// title
|
|
217 |
// Title.
|
|
230 | 218 |
$data['aggregator_feed']['title'] = array( |
231 |
'title' => t('Title'), // The item it appears as on the UI, |
|
219 |
// The item it appears as on the UI, |
|
220 |
'title' => t('Title'), |
|
221 |
// The help that appears on the UI, |
|
232 | 222 |
'help' => t('The title of the aggregator feed.'), |
233 |
// Information for displaying a title as a field
|
|
223 |
// Information for displaying a title as a field.
|
|
234 | 224 |
'field' => array( |
235 | 225 |
'handler' => 'views_handler_field_aggregator_title_link', |
236 | 226 |
'extra' => array('link'), |
237 | 227 |
'click sortable' => TRUE, |
238 |
),
|
|
228 |
), |
|
239 | 229 |
'sort' => array( |
240 | 230 |
'handler' => 'views_handler_sort', |
241 | 231 |
), |
242 |
// Information for accepting a title as a filter |
|
232 |
// Information for accepting a title as a filter.
|
|
243 | 233 |
'filter' => array( |
244 | 234 |
'handler' => 'views_handler_filter_string', |
245 | 235 |
), |
... | ... | |
248 | 238 |
), |
249 | 239 |
); |
250 | 240 |
|
251 |
// link
|
|
241 |
// Link.
|
|
252 | 242 |
$data['aggregator_feed']['link'] = array( |
253 |
'title' => t('Link'), // The item it appears as on the UI, |
|
243 |
// The item it appears as on the UI, |
|
244 |
'title' => t('Link'), |
|
254 | 245 |
'help' => t('The link to the source URL of the feed.'), |
255 |
// Information for displaying a title as a field
|
|
246 |
// Information for displaying a title as a field.
|
|
256 | 247 |
'field' => array( |
257 | 248 |
'handler' => 'views_handler_field_url', |
258 | 249 |
'click sortable' => TRUE, |
259 |
),
|
|
250 |
), |
|
260 | 251 |
'sort' => array( |
261 | 252 |
'handler' => 'views_handler_sort', |
262 | 253 |
), |
... | ... | |
265 | 256 |
), |
266 | 257 |
); |
267 | 258 |
|
268 |
// feed last updated
|
|
259 |
// Feed last updated.
|
|
269 | 260 |
$data['aggregator_feed']['checked'] = array( |
270 |
'title' => t('Last checked'), // The item it appears as on the UI, |
|
261 |
// The item it appears as on the UI, |
|
262 |
'title' => t('Last checked'), |
|
271 | 263 |
'help' => t('The date the feed was last checked for new content.'), |
272 |
// Information for displaying a title as a field
|
|
264 |
// Information for displaying a title as a field.
|
|
273 | 265 |
'field' => array( |
274 | 266 |
'handler' => 'views_handler_field_date', |
275 | 267 |
'click sortable' => TRUE, |
276 |
),
|
|
268 |
), |
|
277 | 269 |
'sort' => array( |
278 | 270 |
'handler' => 'views_handler_sort_date', |
279 | 271 |
), |
... | ... | |
285 | 277 |
), |
286 | 278 |
); |
287 | 279 |
|
288 |
// feed description
|
|
280 |
// Feed description.
|
|
289 | 281 |
$data['aggregator_feed']['description'] = array( |
290 |
'title' => t('Description'), // The item it appears as on the UI, |
|
282 |
// The item it appears as on the UI, |
|
283 |
'title' => t('Description'), |
|
291 | 284 |
'help' => t('The description of the aggregator feed.'), |
292 |
// Information for displaying a title as a field
|
|
285 |
// Information for displaying a title as a field.
|
|
293 | 286 |
'field' => array( |
294 | 287 |
'handler' => 'views_handler_field_xss', |
295 | 288 |
'click sortable' => FALSE, |
296 |
),
|
|
289 |
), |
|
297 | 290 |
'filter' => array( |
298 | 291 |
'handler' => 'views_handler_filter_string', |
299 | 292 |
), |
300 | 293 |
); |
301 | 294 |
|
302 |
// feed last updated
|
|
295 |
// Feed last updated.
|
|
303 | 296 |
$data['aggregator_feed']['modified'] = array( |
304 |
'title' => t('Last modified'), // The item it appears as on the UI, |
|
297 |
// The item it appears as on the UI, |
|
298 |
'title' => t('Last modified'), |
|
305 | 299 |
'help' => t('The date of the most recent new content on the feed.'), |
306 |
// Information for displaying a title as a field
|
|
300 |
// Information for displaying a title as a field.
|
|
307 | 301 |
'field' => array( |
308 | 302 |
'handler' => 'views_handler_field_date', |
309 | 303 |
'click sortable' => TRUE, |
310 |
),
|
|
304 |
), |
|
311 | 305 |
'sort' => array( |
312 | 306 |
'handler' => 'views_handler_sort_date', |
313 | 307 |
), |
314 |
// Information for accepting a title as a filter |
|
308 |
// Information for accepting a title as a filter.
|
|
315 | 309 |
'filter' => array( |
316 | 310 |
'handler' => 'views_handler_filter_date', |
317 | 311 |
), |
... | ... | |
321 | 315 |
); |
322 | 316 |
|
323 | 317 |
// ---------------------------------------------------------------------- |
324 |
// Aggregator category feed table |
|
325 |
|
|
318 |
// Aggregator category feed table. |
|
326 | 319 |
$data['aggregator_category_feed']['table']['join'] = array( |
327 | 320 |
'aggregator_item' => array( |
328 | 321 |
'left_field' => 'fid', |
... | ... | |
331 | 324 |
); |
332 | 325 |
|
333 | 326 |
// ---------------------------------------------------------------------- |
334 |
// Aggregator category table |
|
335 |
|
|
327 |
// Aggregator category table. |
|
336 | 328 |
$data['aggregator_category']['table']['group'] = t('Aggregator category'); |
337 | 329 |
|
338 | 330 |
$data['aggregator_category']['table']['join'] = array( |
... | ... | |
343 | 335 |
), |
344 | 336 |
); |
345 | 337 |
|
346 |
// cid
|
|
338 |
// Category ID / 'cid'.
|
|
347 | 339 |
$data['aggregator_category']['cid'] = array( |
348 | 340 |
'title' => t('Category ID'), |
349 | 341 |
'help' => t('The unique ID of the aggregator category.'), |
... | ... | |
364 | 356 |
), |
365 | 357 |
); |
366 | 358 |
|
367 |
// title
|
|
359 |
// Title.
|
|
368 | 360 |
$data['aggregator_category']['title'] = array( |
369 | 361 |
'title' => t('Category'), |
370 | 362 |
'help' => t('The title of the aggregator category.'), |
371 | 363 |
'field' => array( |
372 | 364 |
'handler' => 'views_handler_field_aggregator_category', |
373 | 365 |
'click sortable' => TRUE, |
374 |
),
|
|
366 |
), |
|
375 | 367 |
'sort' => array( |
376 | 368 |
'handler' => 'views_handler_sort', |
377 | 369 |
), |
... | ... | |
388 | 380 |
*/ |
389 | 381 |
function aggregator_views_plugins() { |
390 | 382 |
return array( |
391 |
'module' => 'views', // This just tells our themes are elsewhere. |
|
383 |
'module' => 'views', |
|
384 |
// This just tells our themes are elsewhere. |
|
392 | 385 |
'row' => array( |
393 | 386 |
'aggregator_rss' => array( |
394 | 387 |
'title' => t('Aggregator item'), |
395 | 388 |
'help' => t('Display the aggregator item using the data from the original source.'), |
396 | 389 |
'handler' => 'views_plugin_row_aggregator_rss', |
397 |
'path' => drupal_get_path('module', 'views') . '/modules/node', // not necessary for most modules |
|
390 |
'path' => drupal_get_path('module', 'views') . '/modules/node', |
|
391 |
// Not necessary for most modules. |
|
398 | 392 |
'theme' => 'views_view_row_rss', |
399 |
'base' => array('aggregator_item'), // only works with 'node' as base. |
|
393 |
'base' => array('aggregator_item'), |
|
394 |
// Only works with 'node' as base. |
|
400 | 395 |
'uses options' => TRUE, |
401 | 396 |
'type' => 'feed', |
402 | 397 |
'help topic' => 'style-aggregator-rss', |
Formats disponibles : Unified diff
Weekly update of contrib modules