Changeset 851:0993f64c4809 for admin/posts.php
- Timestamp:
- 07/31/12 13:52:11 (13 years ago)
- Branch:
- sexy
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/posts.php
r796 r851 15 15 dcPage::check('usage,contentadmin'); 16 16 17 # Getting categories18 try {19 $categories = $core->blog->getCategories(array('post_type'=>'post'));20 } catch (Exception $e) {21 $core->error->add($e->getMessage());22 }23 24 17 # Getting authors 25 18 try { … … 47 40 { 48 41 # Filter form we'll put in html_block 49 $users_combo = $categories_combo =array();50 $users_combo['-'] = $categories_combo['-'] ='';42 $users_combo = array(); 43 $users_combo['-'] = ''; 51 44 while ($users->fetch()) 52 45 { … … 61 54 } 62 55 63 $categories_combo[__('None')] = 'NULL';64 while ($categories->fetch()) {65 $categories_combo[str_repeat(' ',$categories->level-1).($categories->level-1 == 0 ? '' : '• ').66 html::escapeHTML($categories->cat_title).67 ' ('.$categories->nb_post.')'] = $categories->cat_id;68 }69 70 56 $status_combo = array( 71 57 '-' => '' … … 95 81 __('Date') => 'post_dt', 96 82 __('Title') => 'post_title', 97 __('Category') => 'cat_title',98 83 __('Author') => 'user_id', 99 84 __('Status') => 'post_status', … … 122 107 __('Mark as unselected') => 'unselected' 123 108 ); 124 $combo_action[__('Change')] = array( __('Change category') => 'category');109 $combo_action[__('Change')] = array(); 125 110 if ($core->auth->check('admin',$core->blog->id)) 126 111 { … … 139 124 -------------------------------------------------------- */ 140 125 $user_id = !empty($_GET['user_id']) ? $_GET['user_id'] : ''; 141 $cat_id = !empty($_GET['cat_id']) ? $_GET['cat_id'] : '';142 126 $status = isset($_GET['status']) ? $_GET['status'] : ''; 143 127 $selected = isset($_GET['selected']) ? $_GET['selected'] : ''; … … 168 152 } else { 169 153 $user_id=''; 170 }171 172 # - Categories filter173 if ($cat_id !== '' && in_array($cat_id,$categories_combo)) {174 $params['cat_id'] = $cat_id;175 $show_filters = true;176 } else {177 $cat_id='';178 154 } 179 155 … … 263 239 '<label for="user_id">'.__('Author:'). 264 240 form::combo('user_id',$users_combo,$user_id).'</label> '. 265 '<label for="cat_id">'.__('Category:').266 form::combo('cat_id',$categories_combo,$cat_id).'</label> '.267 241 '<label for="status">'.__('Status:'). 268 242 form::combo('status',$status_combo,$status).'</label> '. … … 305 279 '<input type="submit" value="'.__('ok').'" /></p>'. 306 280 form::hidden(array('user_id'),$user_id). 307 form::hidden(array('cat_id'),$cat_id).308 281 form::hidden(array('status'),$status). 309 282 form::hidden(array('selected'),$selected).
Note: See TracChangeset
for help on using the changeset viewer.