/[drupal]/contributions/modules/hidden/hidden.views.inc
ViewVC logotype

Contents of /contributions/modules/hidden/hidden.views.inc

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


Revision 1.4 - (show annotations) (download) (as text)
Wed Dec 10 23:03:47 2008 UTC (11 months, 2 weeks ago) by ekes
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +18 -18 lines
File MIME type: text/x-php
Continuing migration to D6 [#276732]
 started to break up into different include files
 hide and report form now works without error, but redirects incorrectly
1 <?php
2 // $Id: hidden.views.inc,v 1.3 2008/07/01 13:12:15 ekes Exp $
3
4 /**
5 * @file hidden.views.inc
6 * Provides support for the Views module.
7 */
8
9 /**
10 * Implementation of hook_views_tables().
11 */
12 function hidden_views_tables() {
13 $tables['hidden_node'] = array(
14 // join table
15 'name' => 'hidden_node',
16 'join' => array(
17 'left' => array(
18 'table' => 'node',
19 'field' => 'nid'
20 ),
21 'right' => array(
22 'field' => 'nid'
23 ),
24 ),
25 // fields
26 'fields' => array(
27 'publicnote' => array(
28 'name' => t('Hidden: Node - Public note'),
29 'handler' => 'hidden_handler_field_note',
30 'option' => 'string',
31 'help' => t('Display the public reason given for hiding content.').' '.
32 t('Use the options field for empty text message if required'),
33 ),
34 'privatenote' => array(
35 'name' => t('Hidden: Node - Private note'),
36 'handler' => 'hidden_handler_field_note',
37 'option' => 'string',
38 'help' => t('Display the private reason given for hiding content.').' ',
39 t('Use the options field for empty text message if required'),
40 ),
41 'rid' => array(
42 'name' => t('Hidden: Node - Reason'),
43 'sortable' => TRUE,
44 'handler' => array (
45 'hidden_handler_field_reason_title' => t('Title'),
46 'hidden_handler_field_reason_description' => t('Description'),
47 ),
48 'option' => 'string',
49 'help' => t('Display the standard reason given for hiding content.').' '.
50 t('Use the options field for empty text message if required'),
51 ),
52 'created' => array(
53 'name' => t('Hidden: Node - Time'),
54 'sortable' => TRUE,
55 'handler' => views_handler_field_dates(),
56 'option' => 'string',
57 'help' => t('Display the post time of the node was hidden.').' '.
58 t('The option field may be used to specify the custom date format as it\'s required by the date() function or if "as time ago" has been chosen to customize the granularity of the time interval.'),
59 ),
60 'hide' => array(
61 'name' => t('Node: hide/unhide link'),
62 'handler' => 'hidden_handler_hide_link',
63 'notafield' => TRUE,
64 'addlfields' => array('delay'),
65 'help' => t('A hide/unhide link displayed as appropriate'),
66 ),
67 'report' => array(
68 'name' => t('Node: report for hiding link'),
69 'handler' => 'hidden_handler_report_link',
70 'notafield' => TRUE,
71 'addlfields' => array('delay'),
72 'help' => t('A report for hiding link displayed as appropriate'),
73 ),
74 ),
75 // filters
76 'filters' => array(
77 'delay' => array(
78 'name' => t("Node: Hidden"),
79 'value' => array(
80 '#type' => 'select',
81 '#options' => 'views_handler_operator_yesno',
82 ),
83 'operator' => array('=' => t('Equals')),
84 'handler' => 'hidden_handler_filter_hidden_node',
85 'option' => hidden_options_filter_hidden_form(),
86 'help' => t('Filter on if a node is hidden.'),
87 ),
88 'rid' => array (
89 'name' => t("Hidden: Node - Reason"),
90 'value' => hidden_options_filter_reasons_form(),
91 'operator' => 'views_handler_operator_or',
92 'value-type' => 'array',
93 'help' => t('Select by the reason for hiding'),
94 ),
95 ),
96 // sorts
97 'sorts' => array(
98 'created' => array(
99 'name' => t('Hidden: Node - Time'),
100 'handler' => 'views_handler_sort_date',
101 'option' => views_handler_sort_date_options(),
102 'help' => t('Sort by the date of hiding.'),
103 ),
104 ),
105 );
106
107 // base table left is always node (for Views 1.x)
108 $tables['hidden_comment'] = array(
109 'name' => 'hidden_comment',
110 'join' => array(
111 'left' => array(
112 'table' => 'comments',
113 'field' => 'cid',
114 ),
115 'right' => array (
116 'field' => 'cid',
117 ),
118 ),
119 'fields' => array(
120 'publicnote' => array(
121 'name' => t('Hidden: Comment - Public note'),
122 'handler' => 'hidden_handler_field_note',
123 'option' => 'string',
124 'help' => t('Display the public reason given for hiding content.').' '.
125 t('Use the options field for empty text message if required'),
126 ),
127 'privatenote' => array(
128 'name' => t('Hidden: Comment - Private note'),
129 'handler' => 'hidden_handler_field_note',
130 'option' => 'string',
131 'help' => t('Display the private reason given for hiding content.').' ',
132 t('Use the options field for empty text message if required'),
133 ),
134 'rid' => array(
135 'name' => t('Hidden: Comment - Reason'),
136 'sortable' => TRUE,
137 'handler' => array (
138 'hidden_handler_field_reason_title' => t('Title'),
139 'hidden_handler_field_reason_description' => t('Description'),
140 ),
141 'option' => 'string',
142 'help' => t('Display the standard reason given for hiding content.').' '.
143 t('Use the options field for empty text message if required'),
144 ),
145 'created' => array(
146 'name' => t('Hidden: Comment - Time'),
147 'sortable' => TRUE,
148 'handler' => views_handler_field_dates(),
149 'option' => 'string',
150 'help' => t('Display the post time of the comment was hidden.').' '.
151 t('The option field may be used to specify the custom date format as it\'s required by the date() function or if "as time ago" has been chosen to customize the granularity of the time interval.'),
152 ),
153 'hide' => array(
154 'name' => t('Comment: hide/unhide link'),
155 'handler' => 'hidden_handler_hide_link',
156 'notafield' => TRUE,
157 'addlfields' => array('delay'),
158 'help' => t('A hide/unhide link displayed as appropriate'),
159 ),
160 'report' => array(
161 'name' => t('Comment: report for hiding link'),
162 'handler' => 'hidden_handler_report_link',
163 'notafield' => TRUE,
164 'addlfields' => array('delay'),
165 'help' => t('A report for hiding link displayed as appropriate'),
166 ),
167 ),
168 'filters' => array (
169 'delay' => array(
170 'name' => t('Comment: Hidden'),
171 'value' => array(
172 '#type' => 'select',
173 '#options' => 'views_handler_operator_yesno',
174 ),
175 'operator' => array('=' => t('Equals')),
176 'handler' => 'hidden_handler_filter_hidden_comment',
177 'option' => hidden_options_filter_hidden_form(),
178 'help' => t('Filter on if a comment is hidden.'),
179 ),
180 'rid' => array (
181 'name' => t('Hidden: Comment - Reason'),
182 'value' => hidden_options_filter_reasons_form(),
183 'operator' => 'views_handler_operator_or',
184 'value-type' => 'array',
185 'help' => t('Select by the reason for hiding'),
186 ),
187 ),
188 'sorts' => array(
189 'created' => array(
190 'name' => t('Hidden: Comment - Time'),
191 'handler' => 'views_handler_sort_date',
192 'option' => views_handler_sort_date_options(),
193 'help' => t('Sort by the date of hiding.'),
194 ),
195 ),
196 );
197
198 // reported nodes
199 $tables['hidden_reported_node'] = array(
200 'name' => 'hidden_reported_node',
201 'join' => array(
202 'left' => array(
203 'table' => 'node',
204 'field' => 'nid'
205 ),
206 'right' => array(
207 'field' => 'nid'
208 ),
209 ),
210 'fields' => array(
211 'publicnote' => array(
212 'name' => t('Hidden: Reported Node - Public note'),
213 'handler' => 'hidden_handler_field_note',
214 'option' => 'string',
215 'help' => t('Display the public reason given for hiding content.').' '.
216 t('Use the options field for empty text message if required'),
217 ),
218 'privatenote' => array(
219 'name' => t('Hidden: Reported Node - Private note'),
220 'handler' => 'hidden_handler_field_note',
221 'option' => 'string',
222 'help' => t('Display the private reason given for hiding content.').' ',
223 t('Use the options field for empty text message if required'),
224 ),
225 'rid' => array(
226 'name' => t('Hidden: Reported Node - Reason'),
227 'sortable' => TRUE,
228 'handler' => array (
229 'hidden_handler_field_reason_title' => t('Title'),
230 'hidden_handler_field_reason_description' => t('Description'),
231 ),
232 'option' => 'string',
233 'help' => t('Display the standard reason given for hiding content.').' '.
234 t('Use the options field for empty text message if required'),
235 ),
236 'created' => array(
237 'name' => t('Hidden: Reported Node - Time'),
238 'sortable' => TRUE,
239 'handler' => views_handler_field_dates(),
240 'option' => 'string',
241 'help' => t('Display the post time of the node was reported.').' '.
242 t('The option field may be used to specify the custom date format as it\'s required by the date() function or if "as time ago" has been chosen to customize the granularity of the time interval.'),
243 ),
244 ),
245 'filters' => array (
246 'repid' => array(
247 'name' => t('Node: Reported'),
248 'value' => array(
249 '#type' => 'select',
250 '#options' => 'views_handler_operator_yesno',
251 ),
252 'operator' => array('=' => t('Equals')),
253 'handler' => 'hidden_handler_filter_reported_node',
254 'help' => t('Filter on if the node has been reported for hiding.'),
255 ),
256 'seen' => array(
257 'name' => t('Node: Reported - Seen'),
258 'value' => array(
259 '#type' => 'select',
260 '#options' => 'views_handler_operator_yesno',
261 ),
262 'operator' => array('=' => t('Equals')),
263 'handler' => 'hidden_handler_filter_reported_node_seen',
264 'help' => t('Filter on if the node has been recorded as seen by a moderator.'),
265 ),
266 'rid' => array (
267 'name' => t('Hidden: Reported Node - Reason'),
268 'value' => hidden_options_filter_reasons_form(),
269 'operator' => 'views_handler_operator_or',
270 'value-type' => 'array',
271 'help' => t('Select by the reason given for hiding'),
272 ),
273 ),
274 'sorts' => array(
275 'created' => array(
276 'name' => t('Hidden: Reported node - Time'),
277 'handler' => 'views_handler_sort_date',
278 'option' => views_handler_sort_date_options(),
279 'help' => t('Sort by the date of reporting.'),
280 ),
281 ),
282 );
283
284 // reported comments
285 $tables['hidden_reported_comment'] = array(
286 'name' => 'hidden_reported_comment',
287 'join' => array(
288 'left' => array(
289 'table' => 'comments',
290 'field' => 'cid'
291 ),
292 'right' => array(
293 'field' => 'cid'
294 ),
295 ),
296 'fields' => array(
297 'publicnote' => array(
298 'name' => t('Hidden: Reported Comment - Public note'),
299 'handler' => 'hidden_handler_field_note',
300 'option' => 'string',
301 'help' => t('Display the public reason given for hiding content.').' '.
302 t('Use the options field for empty text message if required'),
303 ),
304 'privatenote' => array(
305 'name' => t('Hidden: Reported Comment - Private note'),
306 'handler' => 'hidden_handler_field_note',
307 'option' => 'string',
308 'help' => t('Display the private reason given for hiding content.').' ',
309 t('Use the options field for empty text message if required'),
310 ),
311 'rid' => array(
312 'name' => t('Hidden: Reported Comment - Reason'),
313 'sortable' => TRUE,
314 'handler' => array (
315 'hidden_handler_field_reason_title' => t('Title'),
316 'hidden_handler_field_reason_description' => t('Description'),
317 ),
318 'option' => 'string',
319 'help' => t('Display the standard reason given for hiding content.').' '.
320 t('Use the options field for empty text message if required'),
321 ),
322 'created' => array(
323 'name' => t('Hidden: Reported Comment - Time'),
324 'sortable' => TRUE,
325 'handler' => views_handler_field_dates(),
326 'option' => 'string',
327 'help' => t('Display the post time of the comment was reported.').' '.
328 t('The option field may be used to specify the custom date format as it\'s required by the date() function or if "as time ago" has been chosen to customize the granularity of the time interval.'),
329 ),
330 ),
331 'filters' => array (
332 'repid' => array(
333 'name' => t('Comment: Reported'),
334 'value' => array(
335 '#type' => 'select',
336 '#options' => 'views_handler_operator_yesno',
337 ),
338 'operator' => array('=' => t('Equals')),
339 'handler' => 'hidden_handler_filter_reported_comment',
340 'help' => t('Filter on if the comment has been reported for hiding.'),
341 ),
342 'seen' => array(
343 'name' => t('Comment: Reported - Seen'),
344 'value' => array(
345 '#type' => 'select',
346 '#options' => 'views_handler_operator_yesno',
347 ),
348 'operator' => array('=' => t('Equals')),
349 'handler' => 'hidden_handler_filter_reported_comment_seen',
350 'help' => t('Filter on if the comment has been recorded as seen by a moderator.'),
351 ),
352 'rid' => array (
353 'name' => t('Hidden: Reported Comment - Reason'),
354 'value' => hidden_options_filter_reasons_form(),
355 'operator' => 'views_handler_operator_or',
356 'value-type' => 'array',
357 'help' => t('Select by the reason given for hiding'),
358 ),
359 ),
360 'sorts' => array(
361 'created' => array(
362 'name' => t('Hidden: Reported comment - Time'),
363 'handler' => 'views_handler_sort_date',
364 'option' => views_handler_sort_date_options(),
365 'help' => t('Sort by the date of reporting.'),
366 ),
367 ),
368 );
369
370 // user table joins
371 $tables['hidden_node_users'] = _hidden_views_user_tables('hidden_node', 'uid', t('Hidden: Node - by User'), t('Display the user who hid the node'));
372 $tables['hidden_comment_users'] = _hidden_views_user_tables('hidden_comment', 'uid', t('Hidden: comment - by User'), t('Display the user who hid the comment'));
373 $tables['hidden_reported_node_byuser'] = _hidden_views_user_tables('hidden_reported_node', 'uid', t('Hidden: Reported Node - by User'), t('Display the user who submitted the report about a node'));
374 $tables['hidden_reported_node_seenuser'] = _hidden_views_user_tables('hidden_reported_node', 'suid', t('Hidden: Reported Node - seen by User'), t('Display the user who has seen the reported node'));
375 $tables['hidden_reported_comment_byuser'] = _hidden_views_user_tables('hidden_reported_comment', 'uid', t('Hidden: Reported Comment - by User'), t('Display the user who submitted the report about a comment'));
376 $tables['hidden_reported_comment_seenuser'] = _hidden_views_user_tables('hidden_reported_comment', 'suid', t('Hidden: Reported Comment - seen by User'), t('Display the user who has seen the reported node'));
377
378 return $tables;
379 }
380 function _hidden_views_user_tables($table, $uid, $name, $description) {
381 return array(
382 'name' => 'users',
383 'join' => array(
384 'type' => 'inner',
385 'left' => array(
386 'table' => $table,
387 'field' => $uid,
388 ),
389 'right' => array(
390 'field' => 'uid',
391 ),
392 ),
393 'fields' => array(
394 'name' => array(
395 'name' => $name,
396 'sortable' => TRUE,
397 'handler' => 'views_handler_field_username',
398 'uid' => 'uid',
399 'addlfields' => array('uid'),
400 'help' => $description,
401 ),
402 ),
403 );
404 }
405
406 /**
407 * Implementation of hook_views_arguments().
408 */
409 function hidden_views_arguments() {
410 $arguments = array(
411 'node' => array(
412 'name' => t("Hidden: Node hidden reason ID"),
413 'handler' => "hidden_handler_arg_node",
414 'help' => t('Use the reason ID that content was hidden for.'),
415 ),
416 'comment' => array(
417 'name' => t("Hidden: Comment hidden reason ID"),
418 'handler' => "hidden_handler_arg_comment",
419 'help' => t('Use the reason ID that content was hidden for.'),
420 ),
421 'reportednode' => array(
422 'name' => t("Hidden: Reported node reason ID"),
423 'handler' => "hidden_handler_arg_reportednode",
424 'help' => t('Use the reason ID given for hiding content.'),
425 ),
426 'reportedcomment' => array(
427 'name' => t("Hidden: Reported comment reason ID"),
428 'handler' => "hidden_handler_arg_reportedcomment",
429 'help' => t('Use the reason ID given for hiding content.'),
430 ),
431 );
432 return $arguments;
433 }
434
435 /**
436 * Handlers: notafield.
437 */
438 function hidden_handler_hide_link($fieldinfo, $fielddata, $value, $data) {
439 if (! user_access('mark as hidden')) { return; }
440
441 if ($data->comments_cid > 0) {
442 $delay = 'hidden_comment_delay';
443 $type = 'comment';
444 $target = $data->comments_cid;
445 }
446 else {
447 $delay = 'hidden_node_delay';
448 $type = 'node';
449 $target = $data->nid;
450 }
451
452 if ($data->$delay == NULL) { // NOT HIDDEN
453 return l(t('hide'), "hidden/$type/$target/hide", NULL, drupal_get_destination());
454 }
455 elseif ($data->$delay == 0) { // HIDDEN
456 return l(t('unhide'), "hidden/$type/$target/unhide", NULL, drupal_get_destination());
457 }
458 else { // DELAYED HIDE
459 return l(t('hide now'), "hidden/$type/$target/hide", NULL, drupal_get_destination());
460 }
461 }
462
463 function hidden_handler_report_link($fieldinfo, $fielddata, $value, $data) {
464 if (! user_access('report for hiding')) { return; }
465
466 if ($data->comments_cid > 0) {
467 $delay = 'hidden_comment_delay';
468 $type = 'comment';
469 $target = $data->comments_cid;
470 }
471 else {
472 $delay = 'hidden_node_delay';
473 $type = 'node';
474 $target = $data->nid;
475 }
476
477 if ($data->delay == NULL || $data->delay > 0) { // NOT YET HIDDEN
478 return l(t('report for hiding'), "hidden/$type/$target/report", NULL, drupal_get_destination());
479 }
480 }
481
482 /**
483 * Options: filters.
484 */
485 function hidden_options_filter_reasons_form() {
486 $reasons = hidden_reason_get();
487
488 $options = array( 0 => '<'. t('none') .'>');
489 foreach ($reasons as $reason) {
490 $options[$reason->rid] = $reason->title;
491 }
492
493 return array(
494 '#type' => 'select',
495 '#options' => $options,
496 '#multiple' => TRUE,
497 );
498 }
499
500 function hidden_options_filter_hidden_form() {
501 return array(
502 '#type' => 'select',
503 '#default_value' => 1,
504 '#options' => array(
505 1 => t('Already hidden'),
506 2 => t('Already hidden and delayed filter hides'),
507 3 => t('Delayed filter hides'),
508 ),
509 );
510 }
511
512 /**
513 * Handlers: fields.
514 */
515
516 /* publicnote and privatenote */
517 function hidden_handler_field_note($fieldinfo, $fielddata, $value, $data) {
518 $reason = $value;
519 if (! $reason) {
520 $reason = $fielddata['options'];
521 }
522
523 return check_markup($reason, FILTER_HTML_STRIP, FALSE);
524 }
525
526 /* rid */
527 function hidden_handler_field_reason_title($fieldinfo, $fielddata, $value, $data) {
528 return _hidden_handler_field_reason('title', $fieldinfo, $fielddata, $value, $data);
529 }
530 function hidden_handler_field_reason_description($fieldinfo, $fielddata, $value, $data) {
531 return _hidden_handler_field_reason('description', $fieldinfo, $fielddata, $value, $data);
532 }
533 function _hidden_handler_field_reason($field, $fieldinfo, $fielddata, $value, $data) {
534 $reason = hidden_reason_get($value);
535 if (! $reason->$field) {
536 $output = $fielddata['options'];
537 }
538 else {
539 $output = $reason->$field;
540 }
541
542 return check_markup($output, FILTER_HTML_STRIP, FALSE);
543 }
544
545 /**
546 * Handlers: filters.
547 */
548
549 /* hidden content */
550 function hidden_handler_filter_hidden_node($op, $filter, $filterdata, &$query) {
551 return _hidden_handler_filter_hidden('hidden_node', $op, $filter, $filterdata, $query);
552 }
553 function hidden_handler_filter_hidden_comment($op, $filter, $filterdata, &$query) {
554 return _hidden_handler_filter_hidden('hidden_comment', $op, $filter, $filterdata, $query);
555 }
556 function _hidden_handler_filter_hidden($table, $op, $filter, $filterdata, &$query) {
557 switch ($op) {
558 case 'handler':
559 $query->ensure_table($table);
560 switch ($filter['options']) {
561 case '1': // Already hidden
562 if ($filter['value']) {
563 $query->add_where("$table.delay = 0");
564 }
565 else {
566 $query->add_where("ISNULL($table.delay) OR ($table.delay > 0)");
567 }
568 break;
569 case '2': // Already hidden and delayed filter hides
570 if ($filter['value']) {
571 $query->add_where("$table.delay");
572 }
573 else {
574 $query->add_where("ISNULL($table.delay)");
575 }
576 break;
577 case '3': // Only delayed filter hides
578 if ($filter['value']) {
579 $query->add_where("$table.delay > 0");
580 }
581 else {
582 $query->add_where("ISNULL($table.delay) OR ($table.delay = 0)");
583 }
584 }
585 }
586 }
587
588 /* reported content */
589 function hidden_handler_filter_reported_node($op, $filter, $filterdata, &$query) {
590 return _hidden_handler_filter_reported('hidden_reported_node', $op, $filter, $filterdata, $query);
591 }
592 function hidden_handler_filter_reported_comment($op, $filter, $filterdata, &$query) {
593 return _hidden_handler_filter_reported('hidden_reported_comment', $op, $filter, $filterdata, $query);
594 }
595 function _hidden_handler_filter_reported($table, $op, $filter, $filterdata, &$query) {
596 switch ($op) {
597 case 'handler':
598 $query->ensure_table($table);
599 if ($filter['value']) {
600 $query->add_where("$table.repid");
601 }
602 else {
603 $query->add_where("ISNULL($table.repid)");
604 }
605 }
606 }
607
608 /* seen reported content */
609 function hidden_handler_filter_reported_node_seen($op, $filter, $filterdata, &$query) {
610 return _hidden_handler_filter_reported_seen('hidden_reported_node', $op, $filter, $filterdata, &$query);
611 }
612 function hidden_handler_filter_reported_comment_seen($op, $filter, $filterdata, &$query) {
613 return _hidden_handler_filter_reported_seen('hidden_reported_comment', $op, $filter, $filterdata, &$query);
614 }
615 function _hidden_handler_filter_reported_seen($table, $op, $filter, $filterdata, &$query) {
616 switch ($op) {
617 case 'handler':
618 $query->ensure_table($table);
619 if ($filter['value']) { // future proofing presently NULL or 1
620 $query->add_where("$table.seen = 1");
621 }
622 else {
623 $query->add_where("ISNULL($table.seen) OR ($table.seen = 0)");
624 }
625 }
626 }
627
628 /**
629 * Handlers: arguments
630 */
631 function hidden_handler_arg_node($op, &$query, $argtype, $arg = '') {
632 return _hidden_handler_arg_rid('hidden_node', $op, $query, $argtype, $arg);
633 }
634 function hidden_handler_arg_comment($op, &$query, $argtype, $arg = '') {
635 return _hidden_handler_arg_rid('hidden_comment', $op, $query, $argtype, $arg);
636 }
637 function hidden_handler_arg_reportednode($op, &$query, $argtype, $arg = '') {
638 return _hidden_handler_arg_rid('hidden_reported_node', $op, $query, $argtype, $arg);
639 }
640 function hidden_handler_arg_reportedcomment($op, &$query, $argtype, $arg = '') {
641 return _hidden_handler_arg_rid('hidden_reported_comment', $op, $query, $argtype, $arg);
642 }
643 function _hidden_handler_arg_rid($table, $op, &$query, $argtype, $arg) {
644 switch($op) {
645 case 'summary':
646 $query->ensure_table($table);
647 $reasonsjoin = array(
648 'left' => array(
649 'table' => $table,
650 'field' => 'rid',
651 ),
652 'right' => array(
653 'field' => 'rid',
654 ),
655 );
656 $query->add_table('hidden_reasons', FALSE, 1, $reasonsjoin);
657 $query->add_field('title', 'hidden_reasons');
658 $query->add_field('rid', 'hidden_reasons');
659 $query->add_field('rid', $table);
660 $query->add_where("$table.rid > 0"); // TODO when 0 reason sorted
661 // $query->add_groupby("$table.rid");
662 $fieldinfo['field'] = "hidden_reasons.title";
663 return $fieldinfo;
664 break;
665 case 'sort':
666 $query->add_orderby($table, 'rid', $argtype);
667 break;
668 case 'filter':
669 $rid = (int) $arg;
670 $query->ensure_table($table);
671 $query->add_field('rid', $table);
672 $query->add_where("$table.rid = %d", $rid);
673 break;
674 case 'link':
675 return l($query->title, "$arg/". $query->rid);
676 case 'title':
677 $reason = hidden_reason_get((int) $arg);
678 return check_plain($reason->title);
679 }
680 }

  ViewVC Help
Powered by ViewVC 1.1.2