Changeset 417:876968254009
- Timestamp:
- 06/27/11 11:09:30 (14 years ago)
- Branch:
- formfilters
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/filters.js
r226 r417 1 1 $(function() { 2 2 $('#toggle-filters').click(function(e) { 3 $('#filters').toggle ('slow');3 $('#filters').toggleClass('hidden'); 4 4 }); 5 5 }); -
admin/posts.php
r276 r417 157 157 $filterSet 158 158 ->addFilter(new comboFilter( 159 'users',__('Author'), 'user ', $users_combo))159 'users',__('Author'), 'user_id', $users_combo)) 160 160 ->addFilter(new comboFilter( 161 161 'category',__('Category'), 'cat_id', $categories_combo)) … … 214 214 '<p class="col checkboxes-helpers"></p>'. 215 215 216 '<p class="col right">< label for="action" class="classic">'.__('Selected entries action:').'</label> '.216 '<p class="col right"><span class="filter-title">'.__('Selected entries action:').'</span> '. 217 217 form::combo('action',$combo_action). 218 218 '<input type="submit" value="'.__('ok').'" /></p>'. -
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 } -
inc/core/class.dc.blog.php
r191 r417 736 736 737 737 if (!empty($params['user_id'])) { 738 $strReq .= "AND U.user_id = '".$this->con->escape($params['user_id'])."' "; 738 if (!empty($params['user_id_not'])) { 739 $not = "NOT "; 740 } else { 741 $not = ""; 742 } 743 $strReq .= "AND U.user_id ".$not.$this->con->in($params['user_id'])." "; 739 744 } 740 745
Note: See TracChangeset
for help on using the changeset viewer.