Add table footers and action selects at the bottom

git-svn-id: http://svn.automattic.com/wordpress/trunk@9028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-09-29 09:26:21 +00:00
parent 902f570a18
commit 6cd6f6d9f8
17 changed files with 338 additions and 140 deletions

View File

@ -87,7 +87,7 @@ if ( 'index.php' == $pagenow ) {
$breadcrumb = '<a href="index.php">' . __('Dashboard') . '</a> &rsaquo; ' . $title; $breadcrumb = '<a href="index.php">' . __('Dashboard') . '</a> &rsaquo; ' . $title;
} }
?> ?>
<img id="logo50" src="images/logo50.png" /> <h1><?php if ( '' == get_bloginfo('name', 'display') ) echo '&nbsp;'; else echo get_bloginfo('name', 'display'); ?><span id="breadcrumb"><?php echo $breadcrumb ?></span></h1> <img id="logo50" src="images/logo50.png" alt="" /> <h1><?php if ( '' == get_bloginfo('name', 'display') ) echo '&nbsp;'; else echo get_bloginfo('name', 'display'); ?><span id="breadcrumb"><?php echo $breadcrumb ?></span></h1>
</div> </div>
<?php <?php

View File

@ -11,9 +11,9 @@ require_once('admin.php');
$title = __('Categories'); $title = __('Categories');
wp_reset_vars(array('action', 'cat')); wp_reset_vars( array('action', 'cat') );
if ( isset( $_GET['action'] ) && $_GET['action'] == 'delete' && isset($_GET['delete']) ) if ( isset( $_GET['action'] ) && isset($_GET['delete']) && ( 'delete' == $_GET['action'] || 'delete' == $_GET['action2'] ) )
$action = 'bulk-delete'; $action = 'bulk-delete';
switch($action) { switch($action) {
@ -102,8 +102,8 @@ break;
default: default:
if ( !empty($_GET['_wp_http_referer']) ) { if ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
exit; exit;
} }
@ -183,6 +183,13 @@ if ( $page_links )
<?php print_column_headers('category'); ?> <?php print_column_headers('category'); ?>
</tr> </tr>
</thead> </thead>
<tfoot>
<tr>
<?php print_column_headers('category', false); ?>
</tr>
</tfoot>
<tbody id="the-list" class="list:cat"> <tbody id="the-list" class="list:cat">
<?php <?php
cat_rows(0, 0, 0, $pagenum, $catsperpage); cat_rows(0, 0, 0, $pagenum, $catsperpage);
@ -190,17 +197,26 @@ cat_rows(0, 0, 0, $pagenum, $catsperpage);
</tbody> </tbody>
</table> </table>
</form>
<div class="tablenav"> <div class="tablenav">
<?php <?php
if ( $page_links ) if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>"; echo "<div class='tablenav-pages'>$page_links</div>";
?> ?>
<div class="alignleft">
<select name="action2">
<option value="" selected><?php _e('Actions'); ?></option>
<option value="delete"><?php _e('Delete'); ?></option>
</select>
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
<?php wp_nonce_field('bulk-categories'); ?>
</div>
<br class="clear" /> <br class="clear" />
</div> </div>
<br class="clear" /> <br class="clear" />
</form>
</div> </div>

View File

@ -321,7 +321,12 @@ div.dashboard-widget-submit input,
} }
.widefat thead, .widefat thead,
.widefat tfoot,
.thead, .thead,
.tfoot,
h3.dashboard-widget-title,
h3.dashboard-widget-title span,
h3.dashboard-widget-title small,
.find-box-head { .find-box-head {
background-color: #464646; background-color: #464646;
color: #d7d7d7; color: #d7d7d7;

View File

@ -315,7 +315,9 @@ div.dashboard-widget-submit input,
} }
.widefat thead, .widefat thead,
.widefat tfoot,
.thead, .thead,
.tfoot,
h3.dashboard-widget-title, h3.dashboard-widget-title,
h3.dashboard-widget-title span, h3.dashboard-widget-title span,
h3.dashboard-widget-title small, h3.dashboard-widget-title small,

View File

@ -14,6 +14,13 @@ if ( ! defined('ABSPATH') ) die();
<?php print_column_headers('media'); ?> <?php print_column_headers('media'); ?>
</tr> </tr>
</thead> </thead>
<tfoot>
<tr>
<?php print_column_headers('media', false); ?>
</tr>
</tfoot>
<tbody id="the-list" class="list:post"> <tbody id="the-list" class="list:post">
<?php <?php
if ( have_posts() ) { if ( have_posts() ) {

View File

@ -21,30 +21,39 @@ if ( isset( $_POST['delete_all_spam'] ) ) {
wp_redirect('edit-comments.php?deleted=' . (int) $deleted_spam); wp_redirect('edit-comments.php?deleted=' . (int) $deleted_spam);
} }
if ( !empty( $_REQUEST['delete_comments'] ) && isset($_REQUEST['action']) ) { if ( isset($_REQUEST['delete_comments']) && isset($_REQUEST['action']) && ( -1 != $_REQUEST['action'] || -1 != $_REQUEST['action2'] ) ) {
check_admin_referer('bulk-comments'); check_admin_referer('bulk-comments');
$doaction = ( -1 != $_REQUEST['action'] ) ? $_REQUEST['action'] : $_REQUEST['action2'];
$deleted = $approved = $unapproved = $spammed = 0;
foreach ( (array) $_REQUEST['delete_comments'] as $comment_id) : // Check the permissions on each
$comment_id = (int) $comment_id;
$post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment_id) );
$comments_deleted = $comments_approved = $comments_unapproved = $comments_spammed = 0;
foreach ($_REQUEST['delete_comments'] as $comment) : // Check the permissions on each
$comment = (int) $comment;
$post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment) );
if ( !current_user_can('edit_post', $post_id) ) if ( !current_user_can('edit_post', $post_id) )
continue; continue;
if ( $_REQUEST['action'] == 'markspam' ) {
wp_set_comment_status($comment, 'spam'); switch( $doaction ) {
$comments_spammed++; case 'markspam' :
} elseif ( $_REQUEST['action'] == 'delete' ) { wp_set_comment_status($comment_id, 'spam');
wp_set_comment_status($comment, 'delete'); $spammed++;
$comments_deleted++; break;
} elseif ( $_REQUEST['action'] == 'approve' ) { case 'delete' :
wp_set_comment_status($comment, 'approve'); wp_set_comment_status($comment_id, 'delete');
$comments_approved++; $deleted++;
} elseif ( $_REQUEST['action'] == 'unapprove' ) { break;
wp_set_comment_status($comment, 'hold'); case 'approve' :
$comments_unapproved++; wp_set_comment_status($comment_id, 'approve');
$approved++;
break;
case 'unapprove' :
wp_set_comment_status($comment_id, 'hold');
$unapproved++;
break;
} }
endforeach; endforeach;
$redirect_to = basename( __FILE__ ) . '?deleted=' . $comments_deleted . '&approved=' . $comments_approved . '&spam=' . $comments_spammed . '&unapproved=' . $comments_unapproved;
$redirect_to = 'edit-comments.php?deleted=' . $deleted . '&approved=' . $approved . '&spam=' . $spammed . '&unapproved=' . $unapproved;
if ( isset($_REQUEST['apage']) ) if ( isset($_REQUEST['apage']) )
$redirect_to = add_query_arg( 'apage', absint($_REQUEST['apage']), $redirect_to ); $redirect_to = add_query_arg( 'apage', absint($_REQUEST['apage']), $redirect_to );
if ( !empty($_REQUEST['mode']) ) if ( !empty($_REQUEST['mode']) )
@ -54,8 +63,8 @@ if ( !empty( $_REQUEST['delete_comments'] ) && isset($_REQUEST['action']) ) {
if ( !empty($_REQUEST['s']) ) if ( !empty($_REQUEST['s']) )
$redirect_to = add_query_arg('s', $_REQUEST['s'], $redirect_to); $redirect_to = add_query_arg('s', $_REQUEST['s'], $redirect_to);
wp_redirect( $redirect_to ); wp_redirect( $redirect_to );
} elseif ( !empty($_GET['_wp_http_referer']) ) { } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
exit; exit;
} }
@ -111,6 +120,7 @@ if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['sp
} }
} }
?> ?>
<div class="wrap"> <div class="wrap">
<h2><?php _e('Manage Comments'); ?></h2> <h2><?php _e('Manage Comments'); ?></h2>
@ -143,7 +153,6 @@ unset($status_links);
</ul> </ul>
<?php <?php
$comments_per_page = apply_filters('comments_per_page', 20, $comment_status); $comments_per_page = apply_filters('comments_per_page', 20, $comment_status);
if ( isset( $_GET['apage'] ) ) if ( isset( $_GET['apage'] ) )
@ -180,7 +189,7 @@ if ( $page_links )
<div class="alignleft"> <div class="alignleft">
<select name="action"> <select name="action">
<option value="" selected="selected"><?php _e('Actions') ?></option> <option value="-1" selected="selected"><?php _e('Actions') ?></option>
<?php if ( empty($comment_status) || 'approved' == $comment_status ): ?> <?php if ( empty($comment_status) || 'approved' == $comment_status ): ?>
<option value="unapprove"><?php _e('Unapprove'); ?></option> <option value="unapprove"><?php _e('Unapprove'); ?></option>
<?php endif; ?> <?php endif; ?>
@ -210,15 +219,21 @@ if ( 'spam' == $comment_status ) {
</div> </div>
<br class="clear" /> <br class="clear" />
<?php
if ($comments) { <?php if ( $comments ) { ?>
?>
<table class="widefat"> <table class="widefat">
<thead> <thead>
<tr> <tr>
<?php print_column_headers('comment'); ?> <?php print_column_headers('comment'); ?>
</tr> </tr>
</thead> </thead>
<tfoot>
<tr>
<?php print_column_headers('comment', false); ?>
</tr>
</tfoot>
<tbody id="the-comment-list" class="list:comment"> <tbody id="the-comment-list" class="list:comment">
<?php <?php
foreach ($comments as $comment) foreach ($comments as $comment)
@ -233,6 +248,37 @@ if ($comments) {
</tbody> </tbody>
</table> </table>
<div class="tablenav">
<?php
if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>";
?>
<div class="alignleft">
<select name="action2">
<option value="-1" selected="selected"><?php _e('Actions') ?></option>
<?php if ( empty($comment_status) || 'approved' == $comment_status ): ?>
<option value="unapprove"><?php _e('Unapprove'); ?></option>
<?php endif; ?>
<?php if ( empty($comment_status) || 'moderated' == $comment_status ): ?>
<option value="approve"><?php _e('Approve'); ?></option>
<?php endif; ?>
<?php if ( 'spam' != $comment_status ): ?>
<option value="markspam"><?php _e('Mark as Spam'); ?></option>
<?php endif; ?>
<option value="delete"><?php _e('Delete'); ?></option>
</select>
<input type="submit" name="doaction2" id="doaction2" value="<?php _e('Apply'); ?>" class="button-secondary apply" />
<?php if ( 'spam' == $comment_status ) { ?>
<input type="submit" name="delete_all_spam2" value="<?php _e('Delete All Spam'); ?>" class="button-secondary apply" />
<?php } ?>
<?php do_action('manage_comments_nav', $comment_status); ?>
</div>
<br class="clear" />
</div>
</form> </form>
<form id="get-extra-comments" method="post" action="" class="add:the-extra-comment-list:" style="display: none;"> <form id="get-extra-comments" method="post" action="" class="add:the-extra-comment-list:" style="display: none;">
@ -259,13 +305,6 @@ if ($comments) {
<?php <?php
} }
?> ?>
<div class="tablenav">
<?php
if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>";
?>
<br class="clear" />
</div>
</div> </div>

View File

@ -12,11 +12,12 @@ require_once('admin.php');
// Handle bulk actions // Handle bulk actions
if ( isset($_GET['action']) && isset($_GET['delete']) ) { if ( isset($_GET['action']) && isset($_GET['delete']) ) {
check_admin_referer('bulk-link-categories'); check_admin_referer('bulk-link-categories');
$doaction = $_GET['action'] ? $_GET['action'] : $_GET['action2'];
if ( !current_user_can('manage_categories') ) if ( !current_user_can('manage_categories') )
wp_die(__('Cheatin&#8217; uh?')); wp_die(__('Cheatin&#8217; uh?'));
if ( $_GET['action'] == 'delete' ) { if ( 'delete' == $doaction ) {
foreach( (array) $_GET['delete'] as $cat_ID ) { foreach( (array) $_GET['delete'] as $cat_ID ) {
$cat_name = get_term_field('name', $cat_ID, 'link_category'); $cat_name = get_term_field('name', $cat_ID, 'link_category');
$default_cat_id = get_option('default_link_category'); $default_cat_id = get_option('default_link_category');
@ -38,8 +39,8 @@ if ( isset($_GET['action']) && isset($_GET['delete']) ) {
wp_redirect($location); wp_redirect($location);
exit(); exit();
} }
} elseif ( !empty($_GET['_wp_http_referer']) ) { } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
exit; exit;
} }
@ -120,6 +121,13 @@ if ( $page_links )
<?php print_column_headers('link-category'); ?> <?php print_column_headers('link-category'); ?>
</tr> </tr>
</thead> </thead>
<tfoot>
<tr>
<?php print_column_headers('link-category', false); ?>
</tr>
</tfoot>
<tbody id="the-list" class="list:link-cat"> <tbody id="the-list" class="list:link-cat">
<?php <?php
$start = ($pagenum - 1) * $catsperpage; $start = ($pagenum - 1) * $catsperpage;
@ -143,17 +151,24 @@ if ( $categories ) {
</tbody> </tbody>
</table> </table>
</form>
<div class="tablenav"> <div class="tablenav">
<?php <?php
if ( $page_links ) if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>"; echo "<div class='tablenav-pages'>$page_links</div>";
?> ?>
<div class="alignleft">
<select name="action2">
<option value="" selected><?php _e('Actions'); ?></option>
<option value="delete"><?php _e('Delete'); ?></option>
</select>
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
</div>
<br class="clear" /> <br class="clear" />
</div> </div>
<br class="clear" /> <br class="clear" />
</form>
</div> </div>

View File

@ -10,8 +10,10 @@
require_once('admin.php'); require_once('admin.php');
// Handle bulk actions // Handle bulk actions
if ( isset($_GET['action']) && $_GET['action'] != -1 ) { if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
switch ( $_GET['action'] ) { $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
switch ( $doaction ) {
case 'delete': case 'delete':
if ( isset($_GET['post']) && isset($_GET['doaction']) ) { if ( isset($_GET['post']) && isset($_GET['doaction']) ) {
check_admin_referer('bulk-pages'); check_admin_referer('bulk-pages');
@ -55,8 +57,8 @@ if ( isset($_GET['action']) && $_GET['action'] != -1 ) {
} }
wp_redirect($sendback); wp_redirect($sendback);
exit(); exit();
} elseif ( !empty($_GET['_wp_http_referer']) ) { } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
exit; exit;
} }
@ -107,19 +109,26 @@ require_once('admin-header.php'); ?>
</div></form> </div></form>
</div></div> </div></div>
<?php if ( isset($_GET['upd']) && (int) $_GET['upd'] ) { ?> <div class="wrap">
<div id="message" class="updated fade"><p>
<?php printf( __ngettext( '%d page updated.', '%d pages updated.', $_GET['upd'] ), number_format_i18n( $_GET['upd'] ) );
unset($_GET['upd']);
if ( isset($_GET['skip']) && (int) $_GET['skip'] ) { <?php if ( isset($_GET['upd']) || isset($_GET['skip']) ) { ?>
<div id="message" class="updated fade"><p>
<?php if ( (int) $_GET['upd'] ) {
printf( __ngettext( '%d page updated.', '%d pages updated.', $_GET['upd'] ), number_format_i18n( $_GET['upd'] ) );
unset($_GET['upd']);
}
if ( (int) $_GET['skip'] ) {
printf( __ngettext( ' %d page not updated. Somebody is editing it.', ' %d pages not updated. Somebody is editing them.', $_GET['skip'] ), number_format_i18n( $_GET['skip'] ) ); printf( __ngettext( ' %d page not updated. Somebody is editing it.', ' %d pages not updated. Somebody is editing them.', $_GET['skip'] ), number_format_i18n( $_GET['skip'] ) );
unset($_GET['skip']); unset($_GET['skip']);
} ?> } ?>
</p></div> </p></div>
<?php } ?> <?php } ?>
<div class="wrap"> <?php if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
<div id="message" class="updated fade"><p><strong><?php _e('Your page has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View page'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit page'); ?></a></p></div>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
endif; ?>
<h2><?php <h2><?php
// Use $_GET instead of is_ since they can override each other // Use $_GET instead of is_ since they can override each other
@ -158,15 +167,11 @@ unset($status_links);
?> ?>
</ul> </ul>
<form id="posts-filter" action="" method="get">
<?php if ( isset($_GET['post_status'] ) ) : ?> <?php if ( isset($_GET['post_status'] ) ) : ?>
<input type="hidden" name="post_status" value="<?php echo attribute_escape($_GET['post_status']) ?>" /> <input type="hidden" name="post_status" value="<?php echo attribute_escape($_GET['post_status']) ?>" />
<?php endif; <?php endif; ?>
if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
<div id="message" class="updated fade"><p><strong><?php _e('Your page has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View page'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit page'); ?></a></p></div>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
endif;
?>
<div class="tablenav"> <div class="tablenav">
@ -189,11 +194,9 @@ if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>"; echo "<div class='tablenav-pages'>$page_links</div>";
?> ?>
<form id="posts-filter" action="" method="get">
<div class="alignleft"> <div class="alignleft">
<select name="action"> <select name="action">
<option value="-1" selected><?php _e('Actions'); ?></option> <option value="-1" selected="selected"><?php _e('Actions'); ?></option>
<option value="edit"><?php _e('Edit'); ?></option> <option value="edit"><?php _e('Edit'); ?></option>
<option value="delete"><?php _e('Delete'); ?></option> <option value="delete"><?php _e('Delete'); ?></option>
</select> </select>
@ -218,10 +221,36 @@ if ($posts) {
<?php print_column_headers('page'); ?> <?php print_column_headers('page'); ?>
</tr> </tr>
</thead> </thead>
<tfoot>
<tr>
<?php print_column_headers('page', false); ?>
</tr>
</tfoot>
<tbody> <tbody>
<?php page_rows($posts, $pagenum, $per_page); ?> <?php page_rows($posts, $pagenum, $per_page); ?>
</tbody> </tbody>
</table> </table>
<div class="tablenav">
<?php
if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>";
?>
<div class="alignleft">
<select name="action2">
<option value="-1" selected="selected"><?php _e('Actions'); ?></option>
<option value="edit"><?php _e('Edit'); ?></option>
<option value="delete"><?php _e('Delete'); ?></option>
</select>
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
</div>
<br class="clear" />
</div>
</form> </form>
<?php inline_edit_row( 'page' ) ?> <?php inline_edit_row( 'page' ) ?>
@ -237,13 +266,6 @@ if ($posts) {
} // end if ($posts) } // end if ($posts)
?> ?>
<div class="tablenav">
<?php
if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>";
?>
<br class="clear" />
</div>
<?php <?php

View File

@ -14,8 +14,14 @@ if ( ! defined('ABSPATH') ) die();
<?php print_column_headers('post'); ?> <?php print_column_headers('post'); ?>
</tr> </tr>
</thead> </thead>
<tbody>
<tfoot>
<tr>
<?php print_column_headers('post', false); ?>
</tr>
</tfoot>
<tbody>
<?php <?php
if ( have_posts() ) { if ( have_posts() ) {
post_rows(); post_rows();
@ -28,9 +34,4 @@ if ( have_posts() ) {
} // end if ( have_posts() ) } // end if ( have_posts() )
?> ?>
</tbody> </tbody>
<thead>
<tr>
<?php print_column_headers('post'); ?>
</tr>
</thead>
</table> </table>

View File

@ -11,9 +11,9 @@ require_once('admin.php');
$title = __('Tags'); $title = __('Tags');
wp_reset_vars(array('action', 'tag')); wp_reset_vars( array('action', 'tag') );
if ( isset( $_GET['action'] ) && $_GET['action'] == 'delete' && isset($_GET['delete_tags']) ) if ( isset( $_GET['action'] ) && isset($_GET['delete_tags']) && ( 'delete' == $_GET['action'] || 'delete' == $_GET['action2'] ) )
$action = 'bulk-delete'; $action = 'bulk-delete';
switch($action) { switch($action) {
@ -107,8 +107,8 @@ break;
default: default:
if ( !empty($_GET['_wp_http_referer']) ) { if ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
exit; exit;
} }
@ -187,6 +187,13 @@ if ( $page_links )
<?php print_column_headers('tag'); ?> <?php print_column_headers('tag'); ?>
</tr> </tr>
</thead> </thead>
<tfoot>
<tr>
<?php print_column_headers('tag', false); ?>
</tr>
</tfoot>
<tbody id="the-list" class="list:tag"> <tbody id="the-list" class="list:tag">
<?php <?php
@ -197,17 +204,25 @@ $count = tag_rows( $pagenum, $tagsperpage, $searchterms );
</tbody> </tbody>
</table> </table>
</form>
<div class="tablenav"> <div class="tablenav">
<?php <?php
if ( $page_links ) if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>"; echo "<div class='tablenav-pages'>$page_links</div>";
?> ?>
<div class="alignleft">
<select name="action2">
<option value="" selected><?php _e('Actions'); ?></option>
<option value="delete"><?php _e('Delete'); ?></option>
</select>
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
</div>
<br class="clear" /> <br class="clear" />
</div> </div>
<br class="clear" /> <br class="clear" />
</form>
</div> </div>

View File

@ -9,15 +9,11 @@
/** WordPress Administration Bootstrap */ /** WordPress Administration Bootstrap */
require_once('admin.php'); require_once('admin.php');
$action = -1;
if ( isset($_GET['action2']) && $_GET['action2'] != -1 )
$action = $_GET['action2'];
if ( isset($_GET['action']) && $_GET['action'] != -1 )
$action = $_GET['action'];
// Handle bulk actions // Handle bulk actions
if ( $action != -1 ) { if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
switch ( $action ) { $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
switch ( $doaction ) {
case 'delete': case 'delete':
if ( isset($_GET['post']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) { if ( isset($_GET['post']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
check_admin_referer('bulk-posts'); check_admin_referer('bulk-posts');
@ -51,8 +47,8 @@ if ( $action != -1 ) {
} }
$sendback = wp_get_referer(); $sendback = wp_get_referer();
if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('post-new.php'); if ( strpos($sendback, 'post.php') !== false ) $sendback = admin_url('post-new.php');
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); elseif ( strpos($sendback, 'attachments.php') !== false ) $sendback = admin_url('attachments.php');
$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
if ( isset($done) ) { if ( isset($done) ) {
$done['upd'] = count( $done['upd'] ); $done['upd'] = count( $done['upd'] );
@ -62,8 +58,8 @@ if ( $action != -1 ) {
} }
wp_redirect($sendback); wp_redirect($sendback);
exit(); exit();
} elseif ( !empty($_GET['_wp_http_referer']) ) { } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
exit; exit;
} }
@ -176,7 +172,7 @@ foreach ( $post_stati as $status => $label ) {
$status_links[] = "<li><a href='edit.php?post_status=$status' $class>" . $status_links[] = "<li><a href='edit.php?post_status=$status' $class>" .
sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>'; sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
} }
echo implode( ' |</li>', $status_links ) . '</li>'; echo implode( ' | </li>', $status_links ) . '</li>';
unset( $status_links ); unset( $status_links );
endif; endif;
?> ?>
@ -319,6 +315,15 @@ if ( 1 == count($posts) && is_singular() ) :
<th scope="col"><?php _e('Submitted') ?></th> <th scope="col"><?php _e('Submitted') ?></th>
</tr> </tr>
</thead> </thead>
<tfoot>
<tr>
<th scope="col"><?php _e('Comment') ?></th>
<th scope="col"><?php _e('Author') ?></th>
<th scope="col"><?php _e('Submitted') ?></th>
</tr>
</tfoot>
<tbody id="the-comment-list" class="list:comment"> <tbody id="the-comment-list" class="list:comment">
<?php <?php
foreach ($comments as $comment) foreach ($comments as $comment)

View File

@ -212,6 +212,17 @@ function display_plugins_table($plugins, $page = 1, $totalpages = 1){
<th scope="col" class="action-links"><?php _e('Actions'); ?></th> <th scope="col" class="action-links"><?php _e('Actions'); ?></th>
</tr> </tr>
</thead> </thead>
<tfoot>
<tr>
<th scope="col" class="name"><?php _e('Name'); ?></th>
<th scope="col" class="num"><?php _e('Version'); ?></th>
<th scope="col" class="num"><?php _e('Rating'); ?></th>
<th scope="col" class="desc"><?php _e('Description'); ?></th>
<th scope="col" class="action-links"><?php _e('Actions'); ?></th>
</tr>
</tfoot>
<tbody class="plugins"> <tbody class="plugins">
<?php <?php
if( empty($plugins) ) if( empty($plugins) )
@ -264,6 +275,13 @@ function display_plugins_table($plugins, $page = 1, $totalpages = 1){
?> ?>
</tbody> </tbody>
</table> </table>
<div class="tablenav">
<?php if ( $page_links )
echo "\t\t<div class='tablenav-pages'>$page_links</div>"; ?>
</div>
<br class="clear" />
<?php <?php
} }

View File

@ -582,7 +582,7 @@ function get_column_headers($page) {
return $columns; return $columns;
} }
function print_column_headers( $type ) { function print_column_headers( $type, $id = true ) {
$columns = get_column_headers( $type ); $columns = get_column_headers( $type );
$hidden = (array) get_user_option( "manage-$type-columns-hidden" ); $hidden = (array) get_user_option( "manage-$type-columns-hidden" );
$styles = array(); $styles = array();
@ -614,7 +614,7 @@ function print_column_headers( $type ) {
$style .= ' ' . $styles[$type][$column_key]; $style .= ' ' . $styles[$type][$column_key];
$style = ' style="' . $style . '"'; $style = ' style="' . $style . '"';
?> ?>
<th scope="col" <?php echo "id=\"$column_key\""; echo $class; echo $style?>><?php echo $column_display_name; ?></th> <th scope="col" <?php echo $id ? "id=\"$column_key\"" : ""; echo $class; echo $style; ?>><?php echo $column_display_name; ?></th>
<?php } <?php }
} }

View File

@ -10,14 +10,15 @@
require_once ('admin.php'); require_once ('admin.php');
// Handle bulk deletes // Handle bulk deletes
if ( isset($_GET['action']) && isset($_GET['linkcheck']) && isset($_GET['doaction']) ) { if ( isset($_GET['action']) && isset($_GET['linkcheck']) ) {
check_admin_referer('bulk-bookmarks'); check_admin_referer('bulk-bookmarks');
$doaction = $_GET['action'] ? $_GET['action'] : $_GET['action2'];
if ( ! current_user_can('manage_links') ) if ( ! current_user_can('manage_links') )
wp_die( __('You do not have sufficient permissions to edit the links for this blog.') ); wp_die( __('You do not have sufficient permissions to edit the links for this blog.') );
if ( $_GET['action'] == 'delete' ) { if ( 'delete' == $doaction ) {
foreach ( (array) $_GET['linkcheck'] as $link_id) { foreach ( (array) $_GET['linkcheck'] as $link_id ) {
$link_id = (int) $link_id; $link_id = (int) $link_id;
wp_delete_link($link_id); wp_delete_link($link_id);
@ -28,8 +29,8 @@ if ( isset($_GET['action']) && isset($_GET['linkcheck']) && isset($_GET['doactio
wp_redirect($sendback); wp_redirect($sendback);
exit; exit;
} }
} elseif ( !empty($_GET['_wp_http_referer']) ) { } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
exit; exit;
} }
@ -38,10 +39,10 @@ wp_enqueue_script('links');
wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]')); wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]'));
if (empty ($cat_id)) if ( empty($cat_id) )
$cat_id = 'all'; $cat_id = 'all';
if (empty ($order_by)) if ( empty($order_by) )
$order_by = 'order_name'; $order_by = 'order_name';
$title = __('Manage Links'); $title = __('Manage Links');
@ -158,6 +159,13 @@ if ( $links ) {
<?php print_column_headers('link'); ?> <?php print_column_headers('link'); ?>
</tr> </tr>
</thead> </thead>
<tfoot>
<tr>
<?php print_column_headers('link', false); ?>
</tr>
</tfoot>
<tbody> <tbody>
<?php <?php
$alt = 0; $alt = 0;
@ -248,15 +256,23 @@ if ( $links ) {
<p><?php _e('No links found.') ?></p> <p><?php _e('No links found.') ?></p>
<?php } ?> <?php } ?>
<div class="tablenav">
<div class="alignleft">
<select name="action2">
<option value="" selected><?php _e('Actions'); ?></option>
<option value="delete"><?php _e('Delete'); ?></option>
</select>
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
</div>
<br class="clear" />
</div>
</form> </form>
<div id="ajax-response"></div> <div id="ajax-response"></div>
<div class="tablenav">
<br class="clear" />
</div>
</div> </div>
<?php include('admin-footer.php'); ?> <?php include('admin-footer.php'); ?>

View File

@ -279,6 +279,17 @@ function print_plugins_table($plugins, $context = '') {
<th scope="col" class="action-links"><?php _e('Action'); ?></th> <th scope="col" class="action-links"><?php _e('Action'); ?></th>
</tr> </tr>
</thead> </thead>
<tfoot>
<tr>
<th scope="col" class="check-column"><input type="checkbox" /></th>
<th scope="col"><?php _e('Plugin'); ?></th>
<th scope="col" class="num"><?php _e('Version'); ?></th>
<th scope="col"><?php _e('Description'); ?></th>
<th scope="col" class="action-links"><?php _e('Action'); ?></th>
</tr>
</tfoot>
<tbody class="plugins"> <tbody class="plugins">
<?php <?php

View File

@ -399,8 +399,6 @@ if ( $page_links )
include( 'edit-attachment-rows.php' ); include( 'edit-attachment-rows.php' );
} ?> } ?>
</form>
<div id="ajax-response"></div> <div id="ajax-response"></div>
<div class="tablenav"> <div class="tablenav">
@ -410,8 +408,20 @@ if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>"; echo "<div class='tablenav-pages'>$page_links</div>";
?> ?>
<div class="alignleft">
<select name="action2" id="select-action">
<option value="" selected><?php _e('Actions'); ?></option>
<option value="delete"><?php _e('Delete'); ?></option>
<?php if ( isset($orphans) ) { ?>
<option value="attach"><?php _e('Attach to a post'); ?></option>
<?php } ?>
</select>
<input type="submit" id="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
</div> </div>
<br class="clear" />
</div>
</form>
<br class="clear" /> <br class="clear" />
<?php <?php

View File

@ -18,12 +18,13 @@ if ( !current_user_can('edit_users') )
$title = __('Users'); $title = __('Users');
$parent_file = 'users.php'; $parent_file = 'users.php';
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; $update = $doaction = '';
$update = ''; if ( isset($_REQUEST['action']) )
$doaction = $_REQUEST['action'] ? $_REQUEST['action'] : $_REQUEST['action2'];
if ( empty($action) ) { if ( empty($doaction) ) {
if ( isset($_GET['changeit']) && !empty($_GET['new_role']) ) if ( isset($_GET['changeit']) && !empty($_GET['new_role']) )
$action = 'promote'; $doaction = 'promote';
} }
if ( empty($_REQUEST) ) { if ( empty($_REQUEST) ) {
@ -36,7 +37,7 @@ if ( empty($_REQUEST) ) {
$referer = ''; $referer = '';
} }
switch ($action) { switch ($doaction) {
case 'promote': case 'promote':
check_admin_referer('bulk-users'); check_admin_referer('bulk-users');
@ -358,6 +359,13 @@ unset($role_links);
<?php print_column_headers('user') ?> <?php print_column_headers('user') ?>
</tr> </tr>
</thead> </thead>
<tfoot>
<tr class="thead">
<?php print_column_headers('user', false) ?>
</tr>
</tfoot>
<tbody id="users" class="list:user user-list"> <tbody id="users" class="list:user user-list">
<?php <?php
$style = ''; $style = '';
@ -379,6 +387,14 @@ foreach ( $wp_user_search->get_results() as $userid ) {
<div class="tablenav-pages"><?php $wp_user_search->page_links(); ?></div> <div class="tablenav-pages"><?php $wp_user_search->page_links(); ?></div>
<?php endif; ?> <?php endif; ?>
<div class="alignleft">
<select name="action2">
<option value="" selected><?php _e('Actions'); ?></option>
<option value="delete"><?php _e('Delete'); ?></option>
</select>
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
</div>
<br class="clear" /> <br class="clear" />
</div> </div>
@ -474,7 +490,7 @@ foreach ( $wp_user_search->get_results() as $userid ) {
} }
break; break;
} // end of the $action switch } // end of the $doaction switch
include('admin-footer.php'); include('admin-footer.php');
?> ?>