/[drupal]/contributions/modules/facebook_status/facebook_status_tags.views_default.inc
ViewVC logotype

Contents of /contributions/modules/facebook_status/facebook_status_tags.views_default.inc

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


Revision 1.1 - (show annotations) (download) (as text)
Sun May 17 04:02:11 2009 UTC (6 months, 1 week ago) by icecreamyou
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--2
File MIME type: text/x-php
#437522 form wasn't cached with caching turned off on site (thanks katbailey)
Changed help text for some settings
Moved maximum status length setting from Advanced to General settings page
Added an open API for users with the 'view all statuses' permission in XML, JSON, and REST
Documented open API
Added submodule that allows referencing users with @username and taxonomy terms (including creation of new ones) with #termname.
Documented submodule
Added Views integration for submodule
1 <?php
2 // $Id$
3
4 /**
5 * @file
6 * Provides a default View for the Facebook-style Statuses Tags module.
7 */
8
9 /**
10 * Implementation of hook_views_default_views().
11 */
12 function facebook_status_tags_views_default_views() {
13 $view = new view;
14 $view->name = 'facebook_status_tags';
15 $view->description = t('Facebook-style Statuses Tags');
16 $view->tag = 'facebook_status';
17 $view->view_php = '';
18 $view->base_table = 'facebook_status';
19 $view->is_cacheable = FALSE;
20 $view->api_version = 2;
21 $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
22 $handler = $view->new_display('default', 'Tag Reference', 'default');
23 $handler->override_option('fields', array(
24 'name' => array(
25 'label' => t('Name'),
26 'alter' => array(
27 'alter_text' => 0,
28 'text' => '',
29 'make_link' => 0,
30 'path' => '',
31 'alt' => '',
32 'prefix' => '',
33 'suffix' => '',
34 'help' => '',
35 'trim' => 0,
36 'max_length' => '',
37 'word_boundary' => 1,
38 'ellipsis' => 1,
39 'strip_tags' => 0,
40 'html' => 0,
41 ),
42 'link_to_user' => 1,
43 'overwrite_anonymous' => 0,
44 'anonymous_text' => '',
45 'exclude' => 1,
46 'id' => 'name',
47 'table' => 'users',
48 'field' => 'name',
49 'relationship' => 'none',
50 ),
51 'status' => array(
52 'label' => t('Status'),
53 'alter' => array(
54 'alter_text' => 0,
55 'text' => '',
56 'make_link' => 0,
57 'path' => '',
58 'alt' => '',
59 'prefix' => '',
60 'suffix' => '',
61 'help' => '',
62 'trim' => 0,
63 'max_length' => '',
64 'word_boundary' => 1,
65 'ellipsis' => 1,
66 'strip_tags' => 0,
67 'html' => 0,
68 ),
69 'exclude' => 1,
70 'id' => 'status',
71 'table' => 'facebook_status',
72 'field' => 'status',
73 'relationship' => 'none',
74 ),
75 'status_time' => array(
76 'label' => '',
77 'alter' => array(
78 'alter_text' => 1,
79 'text' => '[name] [status] <em>[status_time]</em>',
80 'make_link' => 0,
81 'path' => '',
82 'alt' => '',
83 'prefix' => '',
84 'suffix' => '',
85 'help' => '',
86 'trim' => 0,
87 'max_length' => '',
88 'word_boundary' => 1,
89 'ellipsis' => 1,
90 'strip_tags' => 0,
91 'html' => 0,
92 ),
93 'date_format' => 'time ago',
94 'custom_date_format' => '',
95 'exclude' => 0,
96 'id' => 'status_time',
97 'table' => 'facebook_status',
98 'field' => 'status_time',
99 'relationship' => 'none',
100 ),
101 ));
102 $handler->override_option('sorts', array(
103 'sid' => array(
104 'order' => 'DESC',
105 'id' => 'sid',
106 'table' => 'facebook_status',
107 'field' => 'sid',
108 'relationship' => 'none',
109 ),
110 ));
111 $handler->override_option('arguments', array(
112 'rid' => array(
113 'default_action' => 'ignore',
114 'style_plugin' => 'default_summary',
115 'style_options' => array(
116 'count' => 1,
117 'override' => 0,
118 'items_per_page' => '25',
119 ),
120 'wildcard' => 'all',
121 'wildcard_substitution' => 'All',
122 'title' => '',
123 'default_argument_type' => 'fixed',
124 'default_argument' => '',
125 'validate_type' => 'none',
126 'validate_fail' => 'not found',
127 'break_phrase' => 1,
128 'not' => 0,
129 'id' => 'rid',
130 'table' => 'facebook_status_tags',
131 'field' => 'rid',
132 'validate_user_argument_type' => 'uid',
133 'validate_user_roles' => array(
134 '2' => 0,
135 '3' => 0,
136 '4' => 0,
137 ),
138 'relationship' => 'none',
139 'default_options_div_prefix' => '',
140 'default_argument_user' => 0,
141 'default_argument_fixed' => '',
142 'default_argument_php' => '',
143 'validate_argument_node_type' => array(
144 'page' => 0,
145 ),
146 'validate_argument_node_access' => 0,
147 'validate_argument_nid_type' => 'nid',
148 'validate_argument_vocabulary' => array(
149 '1' => 0,
150 ),
151 'validate_argument_type' => 'rid',
152 'validate_argument_transform' => 0,
153 'validate_user_restrict_roles' => 0,
154 'validate_argument_node_flag_name' => '*relationship*',
155 'validate_argument_node_flag_test' => 'flaggable',
156 'validate_argument_node_flag_id_type' => 'id',
157 'validate_argument_user_flag_name' => '*relationship*',
158 'validate_argument_user_flag_test' => 'flaggable',
159 'validate_argument_user_flag_id_type' => 'id',
160 'validate_argument_php' => '',
161 'override' => array(
162 'button' => t('Override'),
163 ),
164 ),
165 ));
166 $handler->override_option('filters', array(
167 'sid_extra' => array(
168 'operator' => '=',
169 'value' => '0',
170 'group' => '0',
171 'exposed' => FALSE,
172 'expose' => array(
173 'operator' => FALSE,
174 'label' => '',
175 ),
176 'id' => 'sid_extra',
177 'table' => 'facebook_status',
178 'field' => 'sid_extra',
179 'relationship' => 'none',
180 ),
181 'type' => array(
182 'operator' => '=',
183 'value' => 'term',
184 'group' => '0',
185 'exposed' => FALSE,
186 'expose' => array(
187 'operator' => FALSE,
188 'label' => '',
189 ),
190 'case' => 1,
191 'id' => 'type',
192 'table' => 'facebook_status_tags',
193 'field' => 'type',
194 'relationship' => 'none',
195 ),
196 ));
197 $handler->override_option('access', array(
198 'type' => 'perm',
199 'perm' => 'view all statuses',
200 ));
201 $handler->override_option('title', 'Latest Status Updates');
202 $handler->override_option('use_ajax', TRUE);
203 $handler->override_option('use_pager', 'mini');
204 $handler->override_option('style_plugin', 'list');
205 $handler->override_option('style_options', array(
206 'type' => 'ul',
207 ));
208 $handler = $view->new_display('page', 'Page', 'page_1');
209 $handler->override_option('style_plugin', 'table');
210 $handler->override_option('style_options', array(
211 'grouping' => '',
212 'override' => 0,
213 'sticky' => 0,
214 'order' => 'desc',
215 'columns' => array(
216 'name' => 'name',
217 'status' => 'status',
218 'status_time' => 'status_time',
219 ),
220 'info' => array(
221 'name' => array(
222 'sortable' => 0,
223 'separator' => '',
224 ),
225 'status' => array(
226 'sortable' => 0,
227 'separator' => '',
228 ),
229 'status_time' => array(
230 'sortable' => 0,
231 'separator' => '',
232 ),
233 ),
234 'default' => '-1',
235 ));
236 $handler->override_option('path', 'statuses/term');
237 $handler->override_option('menu', array(
238 'type' => 'none',
239 'title' => '',
240 'description' => '',
241 'weight' => 0,
242 'name' => 'navigation',
243 ));
244 $handler->override_option('tab_options', array(
245 'type' => 'none',
246 'title' => '',
247 'description' => '',
248 'weight' => 0,
249 ));
250 $views[$view->name] = $view;
251
252 $view = new view;
253 $view->name = 'facebook_status_userref';
254 $view->description = t('Facebook-style Statuses User Reference');
255 $view->tag = 'facebook_status';
256 $view->view_php = '';
257 $view->base_table = 'facebook_status';
258 $view->is_cacheable = FALSE;
259 $view->api_version = 2;
260 $view->disabled = FALSE;
261 $handler = $view->new_display('default', 'User Reference', 'default');
262 $handler->override_option('fields', array(
263 'name' => array(
264 'label' => t('Name'),
265 'alter' => array(
266 'alter_text' => 0,
267 'text' => '',
268 'make_link' => 0,
269 'path' => '',
270 'alt' => '',
271 'prefix' => '',
272 'suffix' => '',
273 'help' => '',
274 'trim' => 0,
275 'max_length' => '',
276 'word_boundary' => 1,
277 'ellipsis' => 1,
278 'strip_tags' => 0,
279 'html' => 0,
280 ),
281 'link_to_user' => 1,
282 'overwrite_anonymous' => 0,
283 'anonymous_text' => '',
284 'exclude' => 1,
285 'id' => 'name',
286 'table' => 'users',
287 'field' => 'name',
288 'relationship' => 'none',
289 ),
290 'status' => array(
291 'label' => t('Status'),
292 'alter' => array(
293 'alter_text' => 0,
294 'text' => '',
295 'make_link' => 0,
296 'path' => '',
297 'alt' => '',
298 'prefix' => '',
299 'suffix' => '',
300 'help' => '',
301 'trim' => 0,
302 'max_length' => '',
303 'word_boundary' => 1,
304 'ellipsis' => 1,
305 'strip_tags' => 0,
306 'html' => 0,
307 ),
308 'exclude' => 1,
309 'id' => 'status',
310 'table' => 'facebook_status',
311 'field' => 'status',
312 'relationship' => 'none',
313 ),
314 'status_time' => array(
315 'label' => '',
316 'alter' => array(
317 'alter_text' => 1,
318 'text' => '[name] [status] <em>[status_time]</em>',
319 'make_link' => 0,
320 'path' => '',
321 'alt' => '',
322 'prefix' => '',
323 'suffix' => '',
324 'help' => '',
325 'trim' => 0,
326 'max_length' => '',
327 'word_boundary' => 1,
328 'ellipsis' => 1,
329 'strip_tags' => 0,
330 'html' => 0,
331 ),
332 'date_format' => 'time ago',
333 'custom_date_format' => '',
334 'exclude' => 0,
335 'id' => 'status_time',
336 'table' => 'facebook_status',
337 'field' => 'status_time',
338 'relationship' => 'none',
339 ),
340 ));
341 $handler->override_option('sorts', array(
342 'sid' => array(
343 'order' => 'DESC',
344 'id' => 'sid',
345 'table' => 'facebook_status',
346 'field' => 'sid',
347 'relationship' => 'none',
348 ),
349 ));
350 $handler->override_option('arguments', array(
351 'rid' => array(
352 'default_action' => 'ignore',
353 'style_plugin' => 'default_summary',
354 'style_options' => array(
355 'count' => 1,
356 'override' => 0,
357 'items_per_page' => '25',
358 ),
359 'wildcard' => 'all',
360 'wildcard_substitution' => 'All',
361 'title' => '',
362 'default_argument_type' => 'fixed',
363 'default_argument' => '',
364 'validate_type' => 'none',
365 'validate_fail' => 'not found',
366 'break_phrase' => 1,
367 'not' => 0,
368 'id' => 'rid',
369 'table' => 'facebook_status_tags',
370 'field' => 'rid',
371 'validate_user_argument_type' => 'uid',
372 'validate_user_roles' => array(
373 '2' => 0,
374 '3' => 0,
375 '4' => 0,
376 ),
377 'relationship' => 'none',
378 'default_options_div_prefix' => '',
379 'default_argument_user' => 0,
380 'default_argument_fixed' => '',
381 'default_argument_php' => '',
382 'validate_argument_node_type' => array(
383 'page' => 0,
384 ),
385 'validate_argument_node_access' => 0,
386 'validate_argument_nid_type' => 'nid',
387 'validate_argument_vocabulary' => array(
388 '1' => 0,
389 ),
390 'validate_argument_type' => 'rid',
391 'validate_argument_transform' => 0,
392 'validate_user_restrict_roles' => 0,
393 'validate_argument_node_flag_name' => '*relationship*',
394 'validate_argument_node_flag_test' => 'flaggable',
395 'validate_argument_node_flag_id_type' => 'id',
396 'validate_argument_user_flag_name' => '*relationship*',
397 'validate_argument_user_flag_test' => 'flaggable',
398 'validate_argument_user_flag_id_type' => 'id',
399 'validate_argument_php' => '',
400 'override' => array(
401 'button' => t('Override'),
402 ),
403 ),
404 ));
405 $handler->override_option('filters', array(
406 'sid_extra' => array(
407 'operator' => '=',
408 'value' => '0',
409 'group' => '0',
410 'exposed' => FALSE,
411 'expose' => array(
412 'operator' => FALSE,
413 'label' => '',
414 ),
415 'id' => 'sid_extra',
416 'table' => 'facebook_status',
417 'field' => 'sid_extra',
418 'relationship' => 'none',
419 ),
420 'type' => array(
421 'operator' => '=',
422 'value' => 'user',
423 'group' => '0',
424 'exposed' => FALSE,
425 'expose' => array(
426 'operator' => FALSE,
427 'label' => '',
428 ),
429 'case' => 1,
430 'id' => 'type',
431 'table' => 'facebook_status_tags',
432 'field' => 'type',
433 'relationship' => 'none',
434 ),
435 ));
436 $handler->override_option('access', array(
437 'type' => 'perm',
438 'perm' => 'view all statuses',
439 ));
440 $handler->override_option('title', 'Latest Status Updates');
441 $handler->override_option('use_ajax', TRUE);
442 $handler->override_option('use_pager', 'mini');
443 $handler->override_option('style_plugin', 'list');
444 $handler->override_option('style_options', array(
445 'type' => 'ul',
446 ));
447 $handler = $view->new_display('page', 'Page', 'page_1');
448 $handler->override_option('style_plugin', 'table');
449 $handler->override_option('style_options', array(
450 'grouping' => '',
451 'override' => 0,
452 'sticky' => 0,
453 'order' => 'desc',
454 'columns' => array(
455 'name' => 'name',
456 'status' => 'status',
457 'status_time' => 'status_time',
458 ),
459 'info' => array(
460 'name' => array(
461 'sortable' => 0,
462 'separator' => '',
463 ),
464 'status' => array(
465 'sortable' => 0,
466 'separator' => '',
467 ),
468 'status_time' => array(
469 'sortable' => 0,
470 'separator' => '',
471 ),
472 ),
473 'default' => '-1',
474 ));
475 $handler->override_option('path', 'statuses/userref');
476 $handler->override_option('menu', array(
477 'type' => 'none',
478 'title' => '',
479 'description' => '',
480 'weight' => 0,
481 'name' => 'navigation',
482 ));
483 $handler->override_option('tab_options', array(
484 'type' => 'none',
485 'title' => '',
486 'description' => '',
487 'weight' => 0,
488 ));
489 $views[$view->name] = $view;
490
491 return $views;
492 }

  ViewVC Help
Powered by ViewVC 1.1.2