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;
}
?>
<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>
<?php

View File

@ -11,9 +11,9 @@ require_once('admin.php');
$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';
switch($action) {
@ -102,8 +102,8 @@ break;
default:
if ( !empty($_GET['_wp_http_referer']) ) {
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
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']) ) );
exit;
}
@ -183,6 +183,13 @@ if ( $page_links )
<?php print_column_headers('category'); ?>
</tr>
</thead>
<tfoot>
<tr>
<?php print_column_headers('category', false); ?>
</tr>
</tfoot>
<tbody id="the-list" class="list:cat">
<?php
cat_rows(0, 0, 0, $pagenum, $catsperpage);
@ -190,17 +197,26 @@ cat_rows(0, 0, 0, $pagenum, $catsperpage);
</tbody>
</table>
</form>
<div class="tablenav">
<?php
if ( $page_links )
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" />
</div>
<br class="clear" />
</form>
</div>

View File

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

View File

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

View File

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

View File

@ -16,35 +16,44 @@ wp_enqueue_script( 'jquery-table-hotkeys' );
if ( isset( $_POST['delete_all_spam'] ) ) {
check_admin_referer('bulk-spam-delete');
$deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = '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');
$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) )
continue;
if ( $_REQUEST['action'] == 'markspam' ) {
wp_set_comment_status($comment, 'spam');
$comments_spammed++;
} elseif ( $_REQUEST['action'] == 'delete' ) {
wp_set_comment_status($comment, 'delete');
$comments_deleted++;
} elseif ( $_REQUEST['action'] == 'approve' ) {
wp_set_comment_status($comment, 'approve');
$comments_approved++;
} elseif ( $_REQUEST['action'] == 'unapprove' ) {
wp_set_comment_status($comment, 'hold');
$comments_unapproved++;
switch( $doaction ) {
case 'markspam' :
wp_set_comment_status($comment_id, 'spam');
$spammed++;
break;
case 'delete' :
wp_set_comment_status($comment_id, 'delete');
$deleted++;
break;
case 'approve' :
wp_set_comment_status($comment_id, 'approve');
$approved++;
break;
case 'unapprove' :
wp_set_comment_status($comment_id, 'hold');
$unapproved++;
break;
}
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']) )
$redirect_to = add_query_arg( 'apage', absint($_REQUEST['apage']), $redirect_to );
if ( !empty($_REQUEST['mode']) )
@ -54,8 +63,8 @@ if ( !empty( $_REQUEST['delete_comments'] ) && isset($_REQUEST['action']) ) {
if ( !empty($_REQUEST['s']) )
$redirect_to = add_query_arg('s', $_REQUEST['s'], $redirect_to);
wp_redirect( $redirect_to );
} elseif ( !empty($_GET['_wp_http_referer']) ) {
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
} 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']) ) );
exit;
}
@ -111,6 +120,7 @@ if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['sp
}
}
?>
<div class="wrap">
<h2><?php _e('Manage Comments'); ?></h2>
@ -143,7 +153,6 @@ unset($status_links);
</ul>
<?php
$comments_per_page = apply_filters('comments_per_page', 20, $comment_status);
if ( isset( $_GET['apage'] ) )
@ -180,7 +189,7 @@ if ( $page_links )
<div class="alignleft">
<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 ): ?>
<option value="unapprove"><?php _e('Unapprove'); ?></option>
<?php endif; ?>
@ -198,7 +207,7 @@ if ( $page_links )
<input type="hidden" name="apage" value="<?php echo absint( $_GET['apage'] ); ?>" />
<?php }
if ( 'spam' == $comment_status ) {
if ( 'spam' == $comment_status ) {
wp_nonce_field('bulk-spam-delete'); ?>
<input type="submit" name="delete_all_spam" value="<?php _e('Delete All Spam'); ?>" class="button-secondary apply" />
<?php } ?>
@ -210,15 +219,21 @@ if ( 'spam' == $comment_status ) {
</div>
<br class="clear" />
<?php
if ($comments) {
?>
<?php if ( $comments ) { ?>
<table class="widefat">
<thead>
<tr>
<?php print_column_headers('comment'); ?>
</tr>
</thead>
<tfoot>
<tr>
<?php print_column_headers('comment', false); ?>
</tr>
</tfoot>
<tbody id="the-comment-list" class="list:comment">
<?php
foreach ($comments as $comment)
@ -233,6 +248,37 @@ if ($comments) {
</tbody>
</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 id="get-extra-comments" method="post" action="" class="add:the-extra-comment-list:" style="display: none;">
@ -251,7 +297,7 @@ if ($comments) {
<?php _e('No comments awaiting moderation&hellip; yet.') ?>
</p>
<?php
} else {
} else {
?>
<p>
<?php _e('No results found.') ?>
@ -259,13 +305,6 @@ if ($comments) {
<?php
}
?>
<div class="tablenav">
<?php
if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>";
?>
<br class="clear" />
</div>
</div>

View File

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

View File

@ -10,17 +10,19 @@
require_once('admin.php');
// Handle bulk actions
if ( isset($_GET['action']) && $_GET['action'] != -1 ) {
switch ( $_GET['action'] ) {
if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
$doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
switch ( $doaction ) {
case 'delete':
if ( isset($_GET['post']) && isset($_GET['doaction']) ) {
check_admin_referer('bulk-pages');
foreach( (array) $_GET['post'] as $post_id_del ) {
$post_del = & get_post($post_id_del);
if ( !current_user_can('delete_page', $post_id_del) )
wp_die( __('You are not allowed to delete this page.') );
if ( $post_del->post_type == 'attachment' ) {
if ( ! wp_delete_attachment($post_id_del) )
wp_die( __('Error in deleting...') );
@ -35,10 +37,10 @@ if ( isset($_GET['action']) && $_GET['action'] != -1 ) {
if ( isset($_GET['post']) ) {
check_admin_referer('bulk-pages');
$_GET['post_status'] = $_GET['_status'];
if ( -1 == $_GET['post_author'] )
unset($_GET['post_author']);
$done = bulk_edit_posts($_GET);
}
break;
@ -55,8 +57,8 @@ if ( isset($_GET['action']) && $_GET['action'] != -1 ) {
}
wp_redirect($sendback);
exit();
} elseif ( !empty($_GET['_wp_http_referer']) ) {
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
} 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']) ) );
exit;
}
@ -107,19 +109,26 @@ require_once('admin-header.php'); ?>
</div></form>
</div></div>
<?php if ( isset($_GET['upd']) && (int) $_GET['upd'] ) { ?>
<div class="wrap">
<?php if ( isset($_GET['upd']) || isset($_GET['skip']) ) { ?>
<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'] ) {
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']);
} ?>
<?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'] ) );
unset($_GET['skip']);
} ?>
</p></div>
<?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
// Use $_GET instead of is_ since they can override each other
@ -158,15 +167,11 @@ unset($status_links);
?>
</ul>
<form id="posts-filter" action="" method="get">
<?php if ( isset($_GET['post_status'] ) ) : ?>
<input type="hidden" name="post_status" value="<?php echo attribute_escape($_GET['post_status']) ?>" />
<?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;
?>
<?php endif; ?>
<div class="tablenav">
@ -189,11 +194,9 @@ if ( $page_links )
echo "<div class='tablenav-pages'>$page_links</div>";
?>
<form id="posts-filter" action="" method="get">
<div class="alignleft">
<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="delete"><?php _e('Delete'); ?></option>
</select>
@ -218,10 +221,36 @@ if ($posts) {
<?php print_column_headers('page'); ?>
</tr>
</thead>
<tfoot>
<tr>
<?php print_column_headers('page', false); ?>
</tr>
</tfoot>
<tbody>
<?php page_rows($posts, $pagenum, $per_page); ?>
</tbody>
</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>
<?php inline_edit_row( 'page' ) ?>
@ -237,13 +266,6 @@ 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

View File

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

View File

@ -11,9 +11,9 @@ require_once('admin.php');
$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';
switch($action) {
@ -107,8 +107,8 @@ break;
default:
if ( !empty($_GET['_wp_http_referer']) ) {
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
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']) ) );
exit;
}
@ -187,6 +187,13 @@ if ( $page_links )
<?php print_column_headers('tag'); ?>
</tr>
</thead>
<tfoot>
<tr>
<?php print_column_headers('tag', false); ?>
</tr>
</tfoot>
<tbody id="the-list" class="list:tag">
<?php
@ -197,17 +204,25 @@ $count = tag_rows( $pagenum, $tagsperpage, $searchterms );
</tbody>
</table>
</form>
<div class="tablenav">
<?php
if ( $page_links )
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" />
</div>
<br class="clear" />
</form>
</div>

View File

@ -9,15 +9,11 @@
/** WordPress Administration Bootstrap */
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
if ( $action != -1 ) {
switch ( $action ) {
if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
$doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
switch ( $doaction ) {
case 'delete':
if ( isset($_GET['post']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
check_admin_referer('bulk-posts');
@ -41,18 +37,18 @@ if ( $action != -1 ) {
if ( isset($_GET['post']) ) {
check_admin_referer('bulk-posts');
$_GET['post_status'] = $_GET['_status'];
if ( -1 == $_GET['post_author'] )
unset($_GET['post_author']);
$done = bulk_edit_posts($_GET);
}
break;
}
$sendback = wp_get_referer();
if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('post-new.php');
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
if ( strpos($sendback, 'post.php') !== false ) $sendback = admin_url('post-new.php');
elseif ( strpos($sendback, 'attachments.php') !== false ) $sendback = admin_url('attachments.php');
$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
if ( isset($done) ) {
$done['upd'] = count( $done['upd'] );
@ -62,8 +58,8 @@ if ( $action != -1 ) {
}
wp_redirect($sendback);
exit();
} elseif ( !empty($_GET['_wp_http_referer']) ) {
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
} 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']) ) );
exit;
}
@ -114,7 +110,7 @@ endif; ?>
<div id="message" class="updated fade"><p>
<?php printf( __ngettext( '%d post updated.', '%d posts updated.', $_GET['upd'] ), number_format_i18n( $_GET['upd'] ) );
unset($_GET['upd']);
if ( isset($_GET['skip']) && (int) $_GET['skip'] ) {
printf( __ngettext( ' %d post not updated. Somebody is editing it.', ' %d posts not updated. Somebody is editing them.', $_GET['skip'] ), number_format_i18n( $_GET['skip'] ) );
unset($_GET['skip']);
@ -132,7 +128,7 @@ if ( is_single() ) {
if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) )
$post_status_label = $post_stati[$_GET['post_status']][1];
//TODO: Unreachable code: $post_listing_pageable is undefined, Similar code in upload.php
//if ( $post_listing_pageable && !is_archive() && !is_search() )
//if ( $post_listing_pageable && !is_archive() && !is_search() )
// $h2_noun = is_paged() ? sprintf(__( 'Previous %s' ), $post_status_label) : sprintf(__('Latest %s'), $post_status_label);
//else
$h2_noun = $post_status_label;
@ -176,7 +172,7 @@ foreach ( $post_stati as $status => $label ) {
$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>';
}
echo implode( ' |</li>', $status_links ) . '</li>';
echo implode( ' | </li>', $status_links ) . '</li>';
unset( $status_links );
endif;
?>
@ -319,6 +315,15 @@ if ( 1 == count($posts) && is_singular() ) :
<th scope="col"><?php _e('Submitted') ?></th>
</tr>
</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">
<?php
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>
</tr>
</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">
<?php
if( empty($plugins) )
@ -264,6 +275,13 @@ function display_plugins_table($plugins, $page = 1, $totalpages = 1){
?>
</tbody>
</table>
<div class="tablenav">
<?php if ( $page_links )
echo "\t\t<div class='tablenav-pages'>$page_links</div>"; ?>
</div>
<br class="clear" />
<?php
}

View File

@ -582,7 +582,7 @@ function get_column_headers($page) {
return $columns;
}
function print_column_headers( $type ) {
function print_column_headers( $type, $id = true ) {
$columns = get_column_headers( $type );
$hidden = (array) get_user_option( "manage-$type-columns-hidden" );
$styles = array();
@ -614,7 +614,7 @@ function print_column_headers( $type ) {
$style .= ' ' . $styles[$type][$column_key];
$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 }
}

View File

@ -10,14 +10,15 @@
require_once ('admin.php');
// 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');
$doaction = $_GET['action'] ? $_GET['action'] : $_GET['action2'];
if ( ! current_user_can('manage_links') )
wp_die( __('You do not have sufficient permissions to edit the links for this blog.') );
if ( $_GET['action'] == 'delete' ) {
foreach ( (array) $_GET['linkcheck'] as $link_id) {
if ( 'delete' == $doaction ) {
foreach ( (array) $_GET['linkcheck'] as $link_id ) {
$link_id = (int) $link_id;
wp_delete_link($link_id);
@ -28,8 +29,8 @@ if ( isset($_GET['action']) && isset($_GET['linkcheck']) && isset($_GET['doactio
wp_redirect($sendback);
exit;
}
} elseif ( !empty($_GET['_wp_http_referer']) ) {
wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
} 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']) ) );
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[]'));
if (empty ($cat_id))
if ( empty($cat_id) )
$cat_id = 'all';
if (empty ($order_by))
if ( empty($order_by) )
$order_by = 'order_name';
$title = __('Manage Links');
@ -158,6 +159,13 @@ if ( $links ) {
<?php print_column_headers('link'); ?>
</tr>
</thead>
<tfoot>
<tr>
<?php print_column_headers('link', false); ?>
</tr>
</tfoot>
<tbody>
<?php
$alt = 0;
@ -248,15 +256,23 @@ if ( $links ) {
<p><?php _e('No links found.') ?></p>
<?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>
<div id="ajax-response"></div>
<div class="tablenav">
<br class="clear" />
</div>
</div>
<?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>
</tr>
</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">
<?php

View File

@ -399,8 +399,6 @@ if ( $page_links )
include( 'edit-attachment-rows.php' );
} ?>
</form>
<div id="ajax-response"></div>
<div class="tablenav">
@ -410,8 +408,20 @@ if ( $page_links )
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>
<br class="clear" />
</div>
</form>
<br class="clear" />
<?php

View File

@ -18,12 +18,13 @@ if ( !current_user_can('edit_users') )
$title = __('Users');
$parent_file = 'users.php';
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
$update = '';
$update = $doaction = '';
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']) )
$action = 'promote';
$doaction = 'promote';
}
if ( empty($_REQUEST) ) {
@ -36,7 +37,7 @@ if ( empty($_REQUEST) ) {
$referer = '';
}
switch ($action) {
switch ($doaction) {
case 'promote':
check_admin_referer('bulk-users');
@ -207,10 +208,10 @@ default:
$usersearch = isset($_GET['usersearch']) ? $_GET['usersearch'] : null;
$userspage = isset($_GET['userspage']) ? $_GET['userspage'] : null;
$role = isset($_GET['role']) ? $_GET['role'] : null;
// Query the users
$wp_user_search = new WP_User_Search($usersearch, $userspage, $role);
$messages = array();
if ( isset($_GET['update']) ) :
switch($_GET['update']) {
@ -258,7 +259,7 @@ default:
?>
</ul>
</div>
<?php endif;
<?php endif;
if ( ! empty($messages) ) {
foreach ( $messages as $msg )
@ -358,6 +359,13 @@ unset($role_links);
<?php print_column_headers('user') ?>
</tr>
</thead>
<tfoot>
<tr class="thead">
<?php print_column_headers('user', false) ?>
</tr>
</tfoot>
<tbody id="users" class="list:user user-list">
<?php
$style = '';
@ -379,6 +387,14 @@ foreach ( $wp_user_search->get_results() as $userid ) {
<div class="tablenav-pages"><?php $wp_user_search->page_links(); ?></div>
<?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" />
</div>
@ -474,7 +490,7 @@ foreach ( $wp_user_search->get_results() as $userid ) {
}
break;
} // end of the $action switch
} // end of the $doaction switch
include('admin-footer.php');
?>