Dotclear

Changeset 523:015af077c7fa for admin


Ignore:
Timestamp:
07/06/11 13:47:44 (14 years ago)
Author:
Tomtom33 <tbouron@…>
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.
Message:

Merge with previous commits

Location:
admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • admin/comments.php

    r517 r523  
    2727); 
    2828 
    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); 
    3530 
    36 $order_combo = array( 
    37 __('Descending') => 'desc', 
    38 __('Ascending') => 'asc' 
    39 ); 
     31$params = new ArrayObject(); 
     32$params['no_content'] = true; 
    4033 
    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); 
    5536 
    5637# Actions combo box 
     
    10687     } 
    10788 
    108      $comment_list = new adminCommentList($core,$comments,$counter->f(0)); 
     89     $comment_list->setItems($comments,$counter->f(0)); 
    10990} catch (Exception $e) { 
    11091     $core->error->add($e->getMessage()); 
     
    126107{ 
    127108     # Filters 
    128      if (!$show_filters) { 
    129           echo '<p><a id="filter-control" class="form-control" href="#">'. 
    130           __('Filters').'</a></p>'; 
    131      } 
    132109     $filterSet->display(); 
    133110      
     
    144121      
    145122     # 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">'. 
    148124      
    149125     '%s'. 
     
    157133     '<input type="submit" value="'.__('ok').'" /></p>'. 
    158134     form::hidden(array('type'),$type). 
    159      form::hidden(array('sortby'),$sortby). 
    160      form::hidden(array('order'),$order). 
    161135     form::hidden(array('author'),preg_replace('/%/','%%',$author)). 
    162136     form::hidden(array('status'),$status). 
    163137     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(). 
    166139     '</div>'. 
    167140      
  • admin/comments.php

    r520 r523  
    5555 
    5656$authorFilter = new textFilter( 
    57           'author',__('Author'),'q_author',20,255); 
     57          'author',__('Author'), __('Author'),'q_author',20,255); 
    5858$filterSet 
    5959     ->addFilter(new comboFilter( 
    60           'status',__('Status'), 'comment_status', $status_combo)) 
     60          'status',__('Status'), __('Status'), 'comment_status', $status_combo)) 
    6161     ->addFilter(new booleanFilter( 
    62           'type',__('Type'), 'comment_trackback', $type_combo)) 
     62          'type',__('Type'), __('Type'), 'comment_trackback', $type_combo)) 
    6363     ->addFilter($authorFilter) 
    6464     ->addFilter(new textFilter( 
    65           'ip',__('IP address'),'comment_ip',20,39)); 
     65          'ip',__('IP address'), __('IP address'), 'comment_ip',20,39)); 
    6666           
    6767$core->callBehavior('adminCommentsFilters',$filterSet); 
  • admin/posts.php

    r517 r523  
    119119/* Get posts 
    120120-------------------------------------------------------- */ 
    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); 
    130122 
    131123$params = new ArrayObject(); 
    132 $params['limit'] = array((($page-1)*$nb_per_page),$nb_per_page); 
    133124$params['no_content'] = true; 
    134125 
    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); 
    143128 
    144129$filterSet = new dcFilterSet('posts','posts.php'); 
     
    181166          $page_title = __('Entries'); 
    182167     } 
    183      $post_list = new adminPostList($core,$posts,$counter->f(0)); 
     168     $post_list->setItems($posts,$counter->f(0)); 
    184169} catch (Exception $e) { 
    185170     $core->error->add($e->getMessage()); 
     
    205190 
    206191     # 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">'. 
    209193      
    210194     '%s'. 
     
    217201     '<input type="submit" value="'.__('ok').'" /></p>'. 
    218202     $filterSet->getFormFieldsAsHidden(). 
     203     $post_list->getFormFieldsAsHidden(). 
    219204     $core->formNonce(). 
    220205     '</div>'. 
  • admin/posts.php

    r520 r523  
    137137$filterSet 
    138138     ->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)) 
    144144     ->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)) 
    148148     ->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))); 
    150150 
    151151$core->callBehavior('adminPostsFilters',$filterSet); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map