Changeset 25744


Ignore:
Timestamp:
11/28/13 14:06:31 (6 years ago)
Author:
plg
Message:

feature 2920: add a navigation bar for long list of comments

Location:
trunk/admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/comments.php

    r25084 r25744  
    2929include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 
    3030 
     31if (isset($_GET['start']) and is_numeric($_GET['start'])) 
     32{ 
     33  $page['start'] = $_GET['start']; 
     34} 
     35else 
     36{ 
     37  $page['start'] = 0; 
     38} 
     39 
    3140// +-----------------------------------------------------------------------+ 
    3241// | Check Access and exit when user status is not ok                      | 
    3342// +-----------------------------------------------------------------------+ 
     43 
    3444check_status(ACCESS_ADMINISTRATOR); 
    3545 
     
    166176  WHERE '.implode(' AND ', $where_clauses).' 
    167177  ORDER BY c.date DESC 
     178  LIMIT '.$page['start'].', '.$conf['comments_page_nb_comments'].' 
    168179;'; 
    169180$result = pwg_query($query); 
     
    201212 
    202213// +-----------------------------------------------------------------------+ 
     214// |                            navigation bar                             | 
     215// +-----------------------------------------------------------------------+ 
     216 
     217$navbar = create_navigation_bar( 
     218  get_root_url().'admin.php'.get_query_string_diff(array('start')), 
     219  ('pending' == $page['filter'] ? $nb_pending : $nb_total), 
     220  $page['start'], 
     221  $conf['comments_page_nb_comments'] 
     222  ); 
     223 
     224$template->assign('navbar', $navbar); 
     225 
     226// +-----------------------------------------------------------------------+ 
    203227// |                           sending html code                           | 
    204228// +-----------------------------------------------------------------------+ 
  • trunk/admin/themes/default/template/comments.tpl

    r25084 r25744  
    4646<h2>{'User comments'|@translate} {$TABSHEET_TITLE}</h2> 
    4747 
    48 <p style="text-align:left;margin-left:1em;"> 
     48<div class="commentFilter"> 
    4949  <a href="{$F_ACTION}&amp;filter=all" class="{if $filter == 'all'}commentFilterSelected{/if}">{'All'|@translate}</a> ({$nb_total}) 
    5050  | <a href="{$F_ACTION}&amp;filter=pending" class="{if $filter == 'pending'}commentFilterSelected{/if}">{'Waiting'|@translate}</a> ({$nb_pending}) 
    51 </p> 
     51{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if} 
     52</div> 
     53 
     54 
    5255 
    5356{if !empty($comments) } 
  • trunk/admin/themes/default/theme.css

    r25502 r25744  
    10451045} 
    10461046 
     1047.commentFilter {text-align:left;margin:5px 1em;} 
     1048.commentFilter .navigationBar {float:right; margin:0;} 
     1049 
    10471050FORM#categoryOrdering p.albumTitle {margin:0;} 
    10481051FORM#categoryOrdering p.albumActions {visibility:hidden; margin:0} 
Note: See TracChangeset for help on using the changeset viewer.