Changeset 523:015af077c7fa for admin
- Timestamp:
- 07/06/11 13:47:44 (14 years ago)
- Branch:
- formfilters
- Parents:
- 522:d3f4ee32b4a4 (diff), 517:7a334cf98e87 (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. - Location:
- admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/comments.php
r517 r523 27 27 ); 28 28 29 $sortby_combo = array( 30 __('Date') => 'comment_dt', 31 __('Entry title') => 'post_title', 32 __('Author') => 'comment_author', 33 __('Status') => 'comment_status' 34 ); 29 $comment_list = new adminCommentList($core); 35 30 36 $order_combo = array( 37 __('Descending') => 'desc', 38 __('Ascending') => 'asc' 39 ); 31 $params = new ArrayObject(); 32 $params['no_content'] = true; 40 33 41 42 43 $page = !empty($_GET['page']) ? (integer) $_GET['page'] : 1; 44 $nb_per_page = 30; 45 46 if (!empty($_GET['nb']) && (integer) $_GET['nb'] > 0) { 47 if ($nb_per_page != $_GET['nb']) { 48 $show_filters = true; 49 } 50 $nb_per_page = (integer) $_GET['nb']; 51 } 52 $params = new ArrayObject(); 53 $params['limit'] = array((($page-1)*$nb_per_page),$nb_per_page); 54 $params['no_content'] = true; 34 # - Limit, sortby and order filter 35 $params = $comment_list->applyFilters($params); 55 36 56 37 # Actions combo box … … 106 87 } 107 88 108 $comment_list = new adminCommentList($core,$comments,$counter->f(0));89 $comment_list->setItems($comments,$counter->f(0)); 109 90 } catch (Exception $e) { 110 91 $core->error->add($e->getMessage()); … … 126 107 { 127 108 # Filters 128 if (!$show_filters) {129 echo '<p><a id="filter-control" class="form-control" href="#">'.130 __('Filters').'</a></p>';131 }132 109 $filterSet->display(); 133 110 … … 144 121 145 122 # Show comments 146 $comment_list->display($page,$nb_per_page, 147 '<form action="comments_actions.php" method="post" id="form-comments">'. 123 $comment_list->display('<form action="comments_actions.php" method="post" id="form-comments">'. 148 124 149 125 '%s'. … … 157 133 '<input type="submit" value="'.__('ok').'" /></p>'. 158 134 form::hidden(array('type'),$type). 159 form::hidden(array('sortby'),$sortby).160 form::hidden(array('order'),$order).161 135 form::hidden(array('author'),preg_replace('/%/','%%',$author)). 162 136 form::hidden(array('status'),$status). 163 137 form::hidden(array('ip'),preg_replace('/%/','%%',$ip)). 164 form::hidden(array('page'),$page). 165 form::hidden(array('nb'),$nb_per_page). 138 $comment_list->getFormFieldsAsHidden(). 166 139 '</div>'. 167 140 -
admin/comments.php
r520 r523 55 55 56 56 $authorFilter = new textFilter( 57 'author',__('Author'), 'q_author',20,255);57 'author',__('Author'), __('Author'),'q_author',20,255); 58 58 $filterSet 59 59 ->addFilter(new comboFilter( 60 'status',__('Status'), 'comment_status', $status_combo))60 'status',__('Status'), __('Status'), 'comment_status', $status_combo)) 61 61 ->addFilter(new booleanFilter( 62 'type',__('Type'), 'comment_trackback', $type_combo))62 'type',__('Type'), __('Type'), 'comment_trackback', $type_combo)) 63 63 ->addFilter($authorFilter) 64 64 ->addFilter(new textFilter( 65 'ip',__('IP address'), 'comment_ip',20,39));65 'ip',__('IP address'), __('IP address'), 'comment_ip',20,39)); 66 66 67 67 $core->callBehavior('adminCommentsFilters',$filterSet); -
admin/posts.php
r517 r523 119 119 /* Get posts 120 120 -------------------------------------------------------- */ 121 $page = !empty($_GET['page']) ? (integer) $_GET['page'] : 1; 122 $nb_per_page = 30; 123 124 if (!empty($_GET['nb']) && (integer) $_GET['nb'] > 0) { 125 if ($nb_per_page != $_GET['nb']) { 126 $show_filters = true; 127 } 128 $nb_per_page = (integer) $_GET['nb']; 129 } 121 $post_list = new adminPostList($core); 130 122 131 123 $params = new ArrayObject(); 132 $params['limit'] = array((($page-1)*$nb_per_page),$nb_per_page);133 124 $params['no_content'] = true; 134 125 135 # - Sortby and order filter 136 $sortby = !empty($_GET['sortby']) ? $_GET['sortby'] : 'post_dt'; 137 $order = !empty($_GET['order']) ? $_GET['order'] : 'desc'; 138 if ($sortby !== '') { 139 if ($order !== '') { 140 $params['order'] = $sortby.' '.$order; 141 } 142 } 126 # - Limit, sortby and order filter 127 $params = $post_list->applyFilters($params); 143 128 144 129 $filterSet = new dcFilterSet('posts','posts.php'); … … 181 166 $page_title = __('Entries'); 182 167 } 183 $post_list = new adminPostList($core,$posts,$counter->f(0));168 $post_list->setItems($posts,$counter->f(0)); 184 169 } catch (Exception $e) { 185 170 $core->error->add($e->getMessage()); … … 205 190 206 191 # Show posts 207 $post_list->display($page,$nb_per_page, 208 '<form action="posts_actions.php" method="post" id="form-entries">'. 192 $post_list->display('<form action="posts_actions.php" method="post" id="form-entries">'. 209 193 210 194 '%s'. … … 217 201 '<input type="submit" value="'.__('ok').'" /></p>'. 218 202 $filterSet->getFormFieldsAsHidden(). 203 $post_list->getFormFieldsAsHidden(). 219 204 $core->formNonce(). 220 205 '</div>'. -
admin/posts.php
r520 r523 137 137 $filterSet 138 138 ->addFilter(new comboFilter( 139 'users',__('Author'), 'user_id', $users_combo))140 ->addFilter(new comboFilter( 141 'category',__('Category'), 'cat_id', $categories_combo))142 ->addFilter(new comboFilter( 143 'post_status',__('Status'), 'post_status', $status_combo))139 'users',__('Author'), __('Author'), 'user_id', $users_combo)) 140 ->addFilter(new comboFilter( 141 'category',__('Category'), __('Category'), 'cat_id', $categories_combo)) 142 ->addFilter(new comboFilter( 143 'post_status',__('Status'), __('Status'), 'post_status', $status_combo)) 144 144 ->addFilter(new booleanFilter( 145 'post_selected',__(' The post :'),'post_selected', $selected_combo))146 ->addFilter(new comboFilter( 147 'lang',__('Lang'), 'post_lang', $lang_combo))145 'post_selected',__('Selected'), __('The post : '),'post_selected', $selected_combo)) 146 ->addFilter(new comboFilter( 147 'lang',__('Lang'), __('Lang'), 'post_lang', $lang_combo)) 148 148 ->addFilter(new monthComboFilter( 149 'month',__('Month'), 'post_month', $dt_m_combo,array('singleval' => 1)));149 'month',__('Month'),__('Month'), 'post_month', $dt_m_combo,array('singleval' => 1))); 150 150 151 151 $core->callBehavior('adminPostsFilters',$filterSet);
Note: See TracChangeset
for help on using the changeset viewer.