| [ Index ] |
PHP Cross Reference of MantisBT |
[Summary view] [Print] [Text view]
1 <?php 2 # MantisBT - A PHP based bugtracking system 3 4 # Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge. 5 6 # MantisBT is free software: you can redistribute it and/or modify 7 # it under the terms of the GNU General Public License as published by 8 # the Free Software Foundation, either version 2 of the License, or 9 # (at your option) any later version. 10 # 11 # MantisBT is distributed in the hope that it will be useful, 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 # GNU General Public License for more details. 15 # 16 # You should have received a copy of the GNU General Public License 17 # along with MantisBT. If not, see <http://www.gnu.org/licenses/>. 18 19 /** 20 * Base class that implements basic filter functionality 21 * and integration with MantisBT. 22 * @package MantisBT 23 * @subpackage classes 24 */ 25 abstract class MantisFilter { 26 27 /** 28 * Field name, as used in the form element and processing. 29 */ 30 public $field = null; 31 32 /** 33 * Filter title, as displayed to the user. 34 */ 35 public $title = null; 36 37 /** 38 * Filter type, as defined in core/constant_inc.php 39 */ 40 public $type = null; 41 42 /** 43 * Default filter value, used for non-list filter types. 44 */ 45 public $default = null; 46 47 /** 48 * Form element size, used for non-boolean filter types. 49 */ 50 public $size = null; 51 52 /** 53 * Number of columns to use in the bug filter. 54 */ 55 public $colspan = 1; 56 57 /** 58 * Validate the filter input, returning true if input is 59 * valid, or returning false if invalid. Invalid inputs will 60 * be replaced with the filter's default value. 61 * @param multi Filter field input 62 * @return boolean Input valid (true) or invalid (false) 63 */ 64 public function validate( $p_filter_input ) { 65 return true; 66 } 67 68 /** 69 * Build the SQL query elements 'join', 'where', and 'params' 70 * as used by core/filter_api.php to create the filter query. 71 * @param multi Filter field input 72 * @return array Keyed-array with query elements; see developer guide 73 */ 74 abstract function query( $p_filter_input ); 75 76 /** 77 * Display the current value of the filter field. 78 * @param multi Filter field input 79 * @return string Current value output 80 */ 81 abstract function display( $p_filter_value ); 82 83 /** 84 * For list type filters, define a keyed-array of possible 85 * filter options, not including an 'any' value. 86 * @return array Filter options keyed by value=>display 87 */ 88 public function options() {} 89 } 90
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Jul 28 15:48:31 2011 | Cross-referenced by PHPXref 0.7 |