WordPress.org

Make WordPress Core

Changeset 6800


Ignore:
Timestamp:
02/12/08 09:25:19 (6 years ago)
Author:
ryan
Message:

Manage Tags design update. Column spacing and justification need fixing.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-tags.php

    r6759 r6800  
    102102<div class="wrap"> 
    103103 
    104 <form id="tags-filter" action="" method="get"> 
     104<form id="posts-filter" action="" method="get"> 
    105105<?php if ( current_user_can('manage_categories') ) : ?> 
    106     <h2><?php printf(__('Tags (<a href="%s">add new</a>)'), '#addtag') ?> </h2> 
     106    <h2><?php printf(__('Manage Tags (<a href="%s">add new</a>)'), '#addtag') ?> </h2> 
    107107<?php else : ?> 
    108     <h2><?php _e('Tags') ?> </h2> 
     108    <h2><?php _e('Manage Tags') ?> </h2> 
    109109<?php endif; ?> 
    110     <p id="tag-search"> 
    111         <input type="text" id="tag-search-input" name="s" value="<?php echo attribute_escape( stripslashes( $_GET[ 's' ]) ); ?>" /> 
    112         <input type="submit" value="<?php _e( 'Search Tags' ); ?>" /> 
    113     </p> 
     110 
     111<p id="post-search"> 
     112    <input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" /> 
     113    <input type="submit" value="<?php _e( 'Search Tags' ); ?>" /> 
     114</p> 
     115 
     116<br style="clear:both;" /> 
     117 
     118<div class="tablenav"> 
     119 
     120<?php 
     121$pagenum = absint( $_GET['pagenum'] ); 
     122if ( empty($pagenum) ) 
     123    $pagenum = 1; 
     124if( !$tagsperpage || $tagsperpage < 0 ) 
     125    $tagsperpage = 20; 
     126 
     127$page_links = paginate_links( array( 
     128    'base' => add_query_arg( 'pagenum', '%#%' ), 
     129    'format' => '', 
     130    'total' => ceil(wp_count_terms('post_tag') / $tagsperpage), 
     131    'current' => $pagenum 
     132)); 
     133 
     134if ( $page_links ) 
     135    echo "<div class='tablenav-pages'>$page_links</div>"; 
     136?> 
     137 
     138<div style="float: left"> 
     139<input type="button" value="<?php _e('Delete'); ?>" name="deleteit" /> 
     140</div> 
     141 
     142<br style="clear:both;" /> 
     143</div> 
    114144</form> 
    115145 
     
    123153    <tr> 
    124154        <th scope="col" style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById('deletetags'));" /></th> 
    125         <th scope="col" style="text-align: center"><?php _e('ID') ?></th> 
    126155        <th scope="col"><?php _e('Name') ?></th> 
    127156        <th scope="col" width="90" style="text-align: center"><?php _e('Posts') ?></th> 
    128         <th colspan="2" style="text-align: center"><?php _e('Action') ?></th> 
    129157    </tr> 
    130158    </thead> 
    131159    <tbody id="the-list" class="list:tag"> 
    132160<?php 
    133 $pagenum = absint( $_GET['pagenum'] ); 
    134 if( !$tagsperpage || $tagsperpage < 0 ) { 
    135     $tagsperpage = 20; 
    136 } 
     161 
    137162$searchterms = trim( $_GET['s'] ); 
    138163 
     
    143168<p class="submit"><input type="submit" class="button" name="deletetags" id="deletetags" value="<?php _e('Delete Checked Tags &raquo;') ?>" onclick="return confirm('<?php echo js_escape(__("You are about to delete these tags permanently.\n'Cancel' to stop, 'OK' to delete.")); ?>')" /></p> 
    144169</form> 
     170 
     171<div class="tablenav"> 
     172 
    145173<?php 
    146  
    147 $baseurl = get_bloginfo( 'wpurl' ) . '/wp-admin/edit-tags.php?pagenum='; 
    148 if( $pagenum >= 1 ) { 
    149     echo '<a href="' . $baseurl . ($pagenum - 1 ) . '">&lt;&lt;' . __('Previous Tags') . '</a>'; 
    150     if( $count == $tagsperpage ) { 
    151         echo ' | '; 
    152     } 
    153 } 
    154  
    155  
    156 if( $count == $tagsperpage ) { 
    157     echo '<a href="' . $baseurl . ($pagenum + 1 ) . '">' . __('Next Tags') . '&gt;&gt;</a>'; 
    158 } 
    159  
     174if ( $page_links ) 
     175    echo "<div class='tablenav-pages'>$page_links</div>"; 
    160176?> 
     177<br style="clear:both;" /> 
     178</div> 
    161179 
    162180</div> 
  • trunk/wp-admin/includes/template.php

    r6799 r6800  
    243243        $out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>'; 
    244244        $out .= '<td style="text-align: center"> <input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" /></td>'; 
    245         $out .= '<th scope="row">' . $tag->term_id . '</th>'; 
    246  
    247         $out .= '<td>' . apply_filters( 'term_name', $tag->name ) . '</td>'; 
     245        $out .= '<td><a href="edit-tags.php?action=edit&amp;tag_ID=' . $tag->term_id . '">' . 
     246            apply_filters( 'term_name', $tag->name ) . '</td>'; 
    248247 
    249248        $out .= "<td>$count</td>"; 
    250         $out .= '<td><a href="edit-tags.php?action=edit&amp;tag_ID=' . $tag->term_id . '" class="edit">' . 
    251             __( 'Edit' ) . "</a></td>" . 
    252             '<td><a href="' . wp_nonce_url( "edit-tags.php?action=delete&amp;tag_ID=$tag->term_id", 
    253                     'delete-tag_' . $tag->term_id ) . 
    254                 '" class="delete:the-list:tag-' . $tag->term_id . ' delete">' . 
    255                 __( 'Delete' ) . "</a></td>"; 
    256249        $out .= '</tr>'; 
    257250 
     
    262255// assuming M tags displayed at a time on the page 
    263256// Returns the number of tags displayed 
    264 function tag_rows( $page = 0, $pagesize = 20, $searchterms = '' ) { 
     257function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) { 
    265258 
    266259    // Get a page worth of tags 
    267     $start = $page * $pagesize; 
     260    $start = ($page - 1) * $pagesize; 
    268261 
    269262    $args = array('offset' => $start, 'number' => $pagesize, 'hide_empty' => 0); 
    270263 
    271264    if ( !empty( $searchterms ) ) { 
    272         $args['name__like'] = '%' . like_escape( $searchterms ); 
     265        $args['search'] = $searchterms; 
    273266    } 
    274267 
Note: See TracChangeset for help on using the changeset viewer.