Changeset 228:60c89f303f41
- Timestamp:
- 05/09/11 13:55:42 (14 years ago)
- Branch:
- formfilters
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/posts.php
r225 r228 167 167 'lang',__('Lang'), 'post_lang', $lang_combo)) 168 168 ->addFilter(new monthComboFilter( 169 'month',__('Month'), 'post_month', $dt_m_combo,array('singleval' => 1))) 170 ->addFilter(new valueFilter( 171 'title',__('Title contains'),"post_title",25,100)); 169 'month',__('Month'), 'post_month', $dt_m_combo,array('singleval' => 1))); 172 170 $filterSet->setValues($_GET); 173 171 -
inc/admin/class.dc.filter.php
r225 r228 220 220 $this->options = $options; 221 221 $this->extra = $extra; 222 /*$this->default = $default;223 $this->no_value = $no_value;*/224 222 $this->desc = $desc; 225 223 $this->verb = "is"; … … 270 268 } 271 269 } 272 273 class booleanFilter extends Filter {274 public function getType() {275 return "boolean";276 }277 }278 279 class valueFilter extends Filter {280 protected $size;281 protected $max;282 protected $default;283 protected $no_value;284 285 public function __construct($id,$desc,$request_param,$size, $max, $no_value='',$default=null) {286 parent::__construct($id,$desc,$request_param);287 $this->size = $size;288 $this->max = $max;289 $this->default_value = $default;290 $this->no_value = $no_value;291 }292 293 public function getType() {294 return "value";295 }296 297 298 public function getFormFields() {299 return '<label for="'.$this->field_id.'">'.$this->desc.'</label>'.300 form::field($this->field_id,$this->size,$this->max,$this->value);301 302 }303 304 public function setValues($form_data) {305 parent::setValues($form_data);306 if ($this->enabled && $this->value==$this->no_value) {307 $this->enabled = false;308 $this->value=null;309 }310 }311 }312 313 270 ?>
Note: See TracChangeset
for help on using the changeset viewer.