Changeset 1107:3943962d69b8 for admin/posts.php
- Timestamp:
- 02/27/13 11:48:32 (13 years ago)
- Branch:
- sexy
- Parents:
- 880:02c78f56f430 (diff), 1105:ce855d61f9ce (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 2 edited
-
admin/posts.php (modified) (1 diff)
-
admin/posts.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
admin/posts.php
r873 r1107 108 108 ); 109 109 $combo_action[__('Change')] = array(); 110 110 111 if ($core->auth->check('admin',$core->blog->id)) 111 112 { -
admin/posts.php
r1102 r1107 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['-'] ='';51 while ($users->fetch())42 $users_combo = array(); 43 $users_combo['-'] = ''; 44 foreach ($users as $user) 52 45 { 53 $user_cn = dcUtils::getUserCN($user s->user_id,$users->user_name,54 $user s->user_firstname,$users->user_displayname);46 $user_cn = dcUtils::getUserCN($user->user_id,$user->user_name, 47 $user->user_firstname,$user->user_displayname); 55 48 56 if ($user_cn != $user s->user_id) {57 $user_cn .= ' ('.$user s->user_id.')';49 if ($user_cn != $user->user_id) { 50 $user_cn .= ' ('.$user->user_id.')'; 58 51 } 59 52 60 $users_combo[$user_cn] = $users->user_id; 61 } 62 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; 53 $users_combo[$user_cn] = $user->user_id; 68 54 } 69 55 … … 83 69 # Months array 84 70 $dt_m_combo['-'] = ''; 85 while ($dates->fetch()) {86 $dt_m_combo[dt::str('%B %Y',$d ates->ts())] = $dates->year().$dates->month();71 foreach($dates as $d) { 72 $dt_m_combo[dt::str('%B %Y',$d->ts())] = $d->year().$d->month(); 87 73 } 88 74 89 75 $lang_combo['-'] = ''; 90 while ($langs->fetch()) {91 $lang_combo[$l angs->post_lang] = $langs->post_lang;76 foreach($langs as $l) { 77 $lang_combo[$l->post_lang] = $l->post_lang; 92 78 } 93 79 … … 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( 125 __('Change category') => 'category', 126 __('Change language') => 'lang'); 109 $combo_action[__('Change')] = array(); 110 127 111 if ($core->auth->check('admin',$core->blog->id)) 128 112 { … … 141 125 -------------------------------------------------------- */ 142 126 $user_id = !empty($_GET['user_id']) ? $_GET['user_id'] : ''; 143 $cat_id = !empty($_GET['cat_id']) ? $_GET['cat_id'] : '';144 127 $status = isset($_GET['status']) ? $_GET['status'] : ''; 145 128 $selected = isset($_GET['selected']) ? $_GET['selected'] : ''; … … 170 153 } else { 171 154 $user_id=''; 172 }173 174 # - Categories filter175 if ($cat_id !== '' && in_array($cat_id,$categories_combo)) {176 $params['cat_id'] = $cat_id;177 $show_filters = true;178 } else {179 $cat_id='';180 155 } 181 156 … … 265 240 '<label for="user_id">'.__('Author:'). 266 241 form::combo('user_id',$users_combo,$user_id).'</label> '. 267 '<label for="cat_id">'.__('Category:').268 form::combo('cat_id',$categories_combo,$cat_id).'</label> '.269 242 '<label for="status">'.__('Status:'). 270 243 form::combo('status',$status_combo,$status).'</label> '. … … 307 280 '<input type="submit" value="'.__('ok').'" /></p>'. 308 281 form::hidden(array('user_id'),$user_id). 309 form::hidden(array('cat_id'),$cat_id).310 282 form::hidden(array('status'),$status). 311 283 form::hidden(array('selected'),$selected).
Note: See TracChangeset
for help on using the changeset viewer.
