Changeset 417:876968254009 for inc/admin
- Timestamp:
- 06/27/11 11:09:30 (14 years ago)
- Branch:
- formfilters
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/class.dc.filter.php
r242 r417 52 52 $this->hideform=false; 53 53 } 54 if (isset($form_data['add_filter']) && isset($this->filters[$form_data['add_filter']])) { 54 if (isset($form_data['apply']) && (trim($form_data['apply']) == '+') 55 && isset($form_data['add_filter']) && isset($this->filters[$form_data['add_filter']])) { 55 56 $this->filters[$form_data['add_filter']]->add(); 57 $this->hideform=false; 56 58 } 57 59 } … … 72 74 public function getForm($action,$extra_content,$method="get",$nb_cols=3) { 73 75 $ret = ''; 74 /*if ($this->hideform) { 75 $ret .= '<p><a id="filter-control" class="form-control" href="#">'. 76 __('Filters').'</a></p>'; 77 }*/ 78 $ret .= '<p><img alt="" src="minus.png"/> <a href="#" id="toggle-filters">'.__('Toggle filters and display options').'</a></p>'; 76 77 if ($this->hideform) { 78 $formclass = ' class="hidden"'; 79 } else { 80 $formclass=''; 81 } 82 $ret .= '<p><img alt="" src="images/minus.png" /> <a href="#" id="toggle-filters">'.__('Toggle filters and display options').'</a></p>'; 79 83 $ret .= 80 84 '<div class="two-cols">'. 81 '<form id="filters" action="'.$this->action.'" method="get" id="filters-form" >'.85 '<form id="filters" action="'.$this->action.'" method="get" id="filters-form"'.$formclass.'>'. 82 86 '<div class="col70">'. 83 87 '<h3>'.__('Entries filters').'</h3>'; … … 242 246 parent::setValues($form_data); 243 247 if (isset($form_data[$this->field_id."_v"])) { 244 $this->verb = $form_data[$this->field_id."_v"] == 'is'? 'is' : 'isnot';248 $this->verb = ($form_data[$this->field_id."_v"] == 'is') ? 'is' : 'isnot'; 245 249 } 246 250 } … … 259 263 $labelclass = ' class="or"'; 260 264 }; 261 return '<label for="'.$this->getFieldId($pos).'"'.$labelclass.'>'.$desc.'</label>'. 262 (($pos == 0) ?form::combo($this->field_id.'_v',array(__('is')=>'is',__('is not')=>'isnot'),$this->verb) : ''). 263 form::combo($this->getFieldId($pos),$this->options,$this->values[$pos]); 265 return '<span class="filter-title">'.$desc.'</span>'. 266 (($pos == 0) 267 ?form::combo($this->field_id.'_v', 268 array(__('is')=>'is',__('is not')=>'isnot'),$this->verb,'','', 269 false,'title="'.sprintf(__('%s is or is not'),$this->desc).'"') 270 :''). 271 form::combo($this->getFieldId($pos),$this->options,$this->values[$pos], 272 '','',false,'title="'.__('Choose an option').'"'); 264 273 } 265 274 266 275 public function applyFilter($params) { 276 $attr = $this->request_param; 277 if ($this->verb != "is") { 278 $params[$attr."_not"] = true; 279 } 267 280 if (isset($this->extra['singleval'])) 268 $params[$ this->request_param]=$this->values[0];281 $params[$attr]=$this->values[0]; 269 282 else 270 $params[$ this->request_param]=$this->values;283 $params[$attr]=$this->values; 271 284 } 272 285 }
Note: See TracChangeset
for help on using the changeset viewer.