Manage Tags design update. Column spacing and justification need fixing.
git-svn-id: https://develop.svn.wordpress.org/trunk@6800 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b446d77af9
commit
79060b868b
@ -101,16 +101,46 @@ $messages[6] = __('Tags deleted.');
|
||||
|
||||
<div class="wrap">
|
||||
|
||||
<form id="tags-filter" action="" method="get">
|
||||
<form id="posts-filter" action="" method="get">
|
||||
<?php if ( current_user_can('manage_categories') ) : ?>
|
||||
<h2><?php printf(__('Tags (<a href="%s">add new</a>)'), '#addtag') ?> </h2>
|
||||
<h2><?php printf(__('Manage Tags (<a href="%s">add new</a>)'), '#addtag') ?> </h2>
|
||||
<?php else : ?>
|
||||
<h2><?php _e('Tags') ?> </h2>
|
||||
<h2><?php _e('Manage Tags') ?> </h2>
|
||||
<?php endif; ?>
|
||||
<p id="tag-search">
|
||||
<input type="text" id="tag-search-input" name="s" value="<?php echo attribute_escape( stripslashes( $_GET[ 's' ]) ); ?>" />
|
||||
<input type="submit" value="<?php _e( 'Search Tags' ); ?>" />
|
||||
</p>
|
||||
|
||||
<p id="post-search">
|
||||
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
|
||||
<input type="submit" value="<?php _e( 'Search Tags' ); ?>" />
|
||||
</p>
|
||||
|
||||
<br style="clear:both;" />
|
||||
|
||||
<div class="tablenav">
|
||||
|
||||
<?php
|
||||
$pagenum = absint( $_GET['pagenum'] );
|
||||
if ( empty($pagenum) )
|
||||
$pagenum = 1;
|
||||
if( !$tagsperpage || $tagsperpage < 0 )
|
||||
$tagsperpage = 20;
|
||||
|
||||
$page_links = paginate_links( array(
|
||||
'base' => add_query_arg( 'pagenum', '%#%' ),
|
||||
'format' => '',
|
||||
'total' => ceil(wp_count_terms('post_tag') / $tagsperpage),
|
||||
'current' => $pagenum
|
||||
));
|
||||
|
||||
if ( $page_links )
|
||||
echo "<div class='tablenav-pages'>$page_links</div>";
|
||||
?>
|
||||
|
||||
<div style="float: left">
|
||||
<input type="button" value="<?php _e('Delete'); ?>" name="deleteit" />
|
||||
</div>
|
||||
|
||||
<br style="clear:both;" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<br style="clear:both;" />
|
||||
@ -122,18 +152,13 @@ $messages[6] = __('Tags deleted.');
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById('deletetags'));" /></th>
|
||||
<th scope="col" style="text-align: center"><?php _e('ID') ?></th>
|
||||
<th scope="col"><?php _e('Name') ?></th>
|
||||
<th scope="col" width="90" style="text-align: center"><?php _e('Posts') ?></th>
|
||||
<th colspan="2" style="text-align: center"><?php _e('Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="the-list" class="list:tag">
|
||||
<?php
|
||||
$pagenum = absint( $_GET['pagenum'] );
|
||||
if( !$tagsperpage || $tagsperpage < 0 ) {
|
||||
$tagsperpage = 20;
|
||||
}
|
||||
|
||||
$searchterms = trim( $_GET['s'] );
|
||||
|
||||
$count = tag_rows( $pagenum, $tagsperpage, $searchterms );
|
||||
@ -142,22 +167,15 @@ $count = tag_rows( $pagenum, $tagsperpage, $searchterms );
|
||||
</table>
|
||||
<p class="submit"><input type="submit" class="button" name="deletetags" id="deletetags" value="<?php _e('Delete Checked Tags »') ?>" onclick="return confirm('<?php echo js_escape(__("You are about to delete these tags permanently.\n'Cancel' to stop, 'OK' to delete.")); ?>')" /></p>
|
||||
</form>
|
||||
|
||||
<div class="tablenav">
|
||||
|
||||
<?php
|
||||
|
||||
$baseurl = get_bloginfo( 'wpurl' ) . '/wp-admin/edit-tags.php?pagenum=';
|
||||
if( $pagenum >= 1 ) {
|
||||
echo '<a href="' . $baseurl . ($pagenum - 1 ) . '"><<' . __('Previous Tags') . '</a>';
|
||||
if( $count == $tagsperpage ) {
|
||||
echo ' | ';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( $count == $tagsperpage ) {
|
||||
echo '<a href="' . $baseurl . ($pagenum + 1 ) . '">' . __('Next Tags') . '>></a>';
|
||||
}
|
||||
|
||||
if ( $page_links )
|
||||
echo "<div class='tablenav-pages'>$page_links</div>";
|
||||
?>
|
||||
<br style="clear:both;" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -242,17 +242,10 @@ function _tag_row( $tag, $class = '' ) {
|
||||
$out = '';
|
||||
$out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>';
|
||||
$out .= '<td style="text-align: center"> <input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" /></td>';
|
||||
$out .= '<th scope="row">' . $tag->term_id . '</th>';
|
||||
|
||||
$out .= '<td>' . apply_filters( 'term_name', $tag->name ) . '</td>';
|
||||
$out .= '<td><a href="edit-tags.php?action=edit&tag_ID=' . $tag->term_id . '">' .
|
||||
apply_filters( 'term_name', $tag->name ) . '</td>';
|
||||
|
||||
$out .= "<td>$count</td>";
|
||||
$out .= '<td><a href="edit-tags.php?action=edit&tag_ID=' . $tag->term_id . '" class="edit">' .
|
||||
__( 'Edit' ) . "</a></td>" .
|
||||
'<td><a href="' . wp_nonce_url( "edit-tags.php?action=delete&tag_ID=$tag->term_id",
|
||||
'delete-tag_' . $tag->term_id ) .
|
||||
'" class="delete:the-list:tag-' . $tag->term_id . ' delete">' .
|
||||
__( 'Delete' ) . "</a></td>";
|
||||
$out .= '</tr>';
|
||||
|
||||
return $out;
|
||||
@ -261,15 +254,15 @@ function _tag_row( $tag, $class = '' ) {
|
||||
// Outputs appropriate rows for the Nth page of the Tag Management screen,
|
||||
// assuming M tags displayed at a time on the page
|
||||
// Returns the number of tags displayed
|
||||
function tag_rows( $page = 0, $pagesize = 20, $searchterms = '' ) {
|
||||
function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) {
|
||||
|
||||
// Get a page worth of tags
|
||||
$start = $page * $pagesize;
|
||||
$start = ($page - 1) * $pagesize;
|
||||
|
||||
$args = array('offset' => $start, 'number' => $pagesize, 'hide_empty' => 0);
|
||||
|
||||
if ( !empty( $searchterms ) ) {
|
||||
$args['name__like'] = '%' . like_escape( $searchterms );
|
||||
$args['search'] = $searchterms;
|
||||
}
|
||||
|
||||
$tags = get_terms( 'post_tag', $args );
|
||||
|
Loading…
Reference in New Issue
Block a user