Bulk delete: only delete when Apply button is clicked, move Advanced Options to separate form

git-svn-id: https://develop.svn.wordpress.org/trunk@8948 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2008-09-22 03:27:48 +00:00
parent 33488ea2c5
commit e66bb35982
8 changed files with 44 additions and 45 deletions

View File

@ -133,8 +133,8 @@ $messages[5] = __('Category not updated.');
endif; ?>
<div class="wrap">
<form id="posts-filter" action="" method="get">
<form id="adv-settings" action="" method="get">
<div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a>
<a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div>
@ -145,12 +145,14 @@ endif; ?>
<?php manage_columns_prefs('category') ?>
<br class="clear" />
</div></div>
</div>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</div></form>
<h2><?php printf( current_user_can('manage_categories') ? __('Categories (<a href="%s">Add New</a>)') : __('Manage Tags'), '#addcat' ); ?></h2>
<br class="clear" />
<form id="posts-filter" action="" method="get">
<div class="tablenav">
<?php
@ -198,8 +200,6 @@ cat_rows(0, 0, 0, $pagenum, $catsperpage);
</tbody>
</table>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</form>
<div class="tablenav">

View File

@ -74,8 +74,7 @@ endif; ?>
<div class="wrap">
<form id="posts-filter" action="" method="get">
<form id="adv-settings" action="" method="get">
<div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a>
<a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div>
@ -86,12 +85,14 @@ endif; ?>
<?php manage_columns_prefs('link-category') ?>
<br class="clear" />
</div></div>
</div>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</div></form>
<h2><?php printf( current_user_can('manage_categories') ? __('Link Categories (<a href="%s">Add New</a>)') : __('Manage Tags'), '#addcat' ); ?></h2>
<br class="clear" />
<form id="posts-filter" action="" method="get">
<div class="tablenav">
<?php
@ -155,8 +156,6 @@ if ( $categories ) {
</tbody>
</table>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</form>
<div class="tablenav">

View File

@ -10,10 +10,10 @@
require_once('admin.php');
// Handle bulk deletes
if ( isset($_GET['action']) && isset($_GET['delete']) ) {
if ( isset($_GET['action']) && isset($_GET['post']) && isset($_GET['doaction']) ) {
check_admin_referer('bulk-pages');
if ( $_GET['action'] == 'delete' ) {
foreach( (array) $_GET['delete'] as $post_id_del ) {
foreach( (array) $_GET['post'] as $post_id_del ) {
$post_del = & get_post($post_id_del);
if ( !current_user_can('delete_page', $post_id_del) )
@ -86,8 +86,7 @@ require_once('admin-header.php');
</form>
<div class="wrap">
<form id="posts-filter" action="" method="get">
<form id="adv-settings" action="" method="get">
<div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a>
<a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div>
@ -98,7 +97,8 @@ require_once('admin-header.php');
<?php manage_columns_prefs('page') ?>
<br class="clear" />
</div></div>
</div>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</div></form>
<h2><?php
// Use $_GET instead of is_ since they can override each other
@ -111,6 +111,7 @@ if ( isset($_GET['author']) && $_GET['author'] ) {
printf( _c( '%1$s%2$s%3$s (<a href="%4$s">Add New</a>)|You can reorder these: 1: Pages, 2: by {s}, 3: matching {s}' ), $post_status_label, $h2_author, $h2_search, 'page-new.php' );
?></h2>
<form id="posts-filter" action="" method="get">
<ul class="subsubsub">
<?php
@ -139,8 +140,8 @@ unset($status_links);
<?php if ( isset($_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']);
@ -170,7 +171,7 @@ if ( $page_links )
<div class="alignleft">
<select name="action">
<option value="" selected><?php _e('Actions'); ?></option>
<option value="-1" selected><?php _e('Actions'); ?></option>
<option value="edit"><?php _e('Edit'); ?></option>
<option value="delete"><?php _e('Delete'); ?></option>
</select>
@ -200,9 +201,6 @@ if ($posts) {
<?php page_rows($posts, $pagenum, $per_page); ?>
</tbody>
</table>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</form>
<div id="ajax-response"></div>

View File

@ -140,8 +140,7 @@ endif; ?>
<div class="wrap">
<form id="posts-filter" action="" method="get">
<form id="adv-settings" action="" method="get">
<div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a>
<a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div>
@ -152,12 +151,14 @@ endif; ?>
<?php manage_columns_prefs('tag') ?>
<br class="clear" />
</div></div>
</div>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</div></form>
<h2><?php printf( current_user_can('manage_categories') ? __('Tags (<a href="%s">Add New</a>)') : __('Manage Tags'), '#addtag' ); ?></h2>
<br class="clear" />
<form id="posts-filter" action="" method="get">
<div class="tablenav">
<?php
@ -207,7 +208,7 @@ $count = tag_rows( $pagenum, $tagsperpage, $searchterms );
?>
</tbody>
</table>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</form>
<div class="tablenav">

View File

@ -10,7 +10,7 @@
require_once('admin.php');
// Handle bulk actions
if ( !empty($_GET['action']) && $_GET['action'] != 'Actions' ) {
if ( isset($_GET['action']) && $_GET['action'] != -1 && isset($_GET['doaction']) ) {
switch ( $_GET['action'] ) {
case 'delete':
if ( isset($_GET['post']) ) {
@ -81,8 +81,7 @@ else
<div class="wrap">
<form id="posts-filter" action="" method="get">
<form id="adv-settings" action="" method="get">
<div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a>
<a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div>
@ -93,7 +92,8 @@ else
<?php manage_columns_prefs('post') ?>
<br class="clear" />
</div></div>
</div>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</div></form>
<h2><?php
if ( is_single() ) {
@ -126,6 +126,7 @@ if ( is_single() ) {
}
?></h2>
<form id="posts-filter" action="" method="get">
<ul class="subsubsub">
<?php
$status_links = array();
@ -153,8 +154,7 @@ unset( $status_links );
<?php if ( isset($_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 post has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit post'); ?></a></p></div>
@ -185,7 +185,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>
<option value="edit"><?php _e('Edit'); ?></option>
<option value="delete"><?php _e('Delete'); ?></option>
</select>
@ -241,8 +241,6 @@ do_action('restrict_manage_posts');
<?php include( 'edit-post-rows.php' ); ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</form>
<div id="ajax-response"></div>

View File

@ -10,7 +10,7 @@
require_once ('admin.php');
// Handle bulk deletes
if ( isset($_GET['action']) && isset($_GET['linkcheck']) ) {
if ( isset($_GET['action']) && isset($_GET['linkcheck']) && isset($_GET['doaction']) ) {
check_admin_referer('bulk-bookmarks');
if ( ! current_user_can('manage_links') )
@ -94,8 +94,7 @@ if ( isset($_GET['deleted']) ) {
<div class="wrap">
<form id="links-filter" action="" method="get">
<form id="adv-settings" action="" method="get">
<div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a>
<a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div>
@ -106,12 +105,14 @@ if ( isset($_GET['deleted']) ) {
<?php manage_columns_prefs('link') ?>
<br class="clear" />
</div></div>
</div>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</div></form>
<h2><?php printf( __('Links (<a href="%s">Add New</a>)' ), 'link-add.php' ); ?></h2>
<br class="clear" />
<form id="posts-filter" action="" method="get">
<div class="tablenav">
<div class="alignleft">
@ -256,7 +257,7 @@ if ( $links ) {
<?php } else { ?>
<p><?php _e('No links found.') ?></p>
<?php } ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</form>
<div id="ajax-response"></div>

View File

@ -62,7 +62,7 @@ if ( isset($_GET['find_detached'] ) ) {
$_GET['detached'] = 1;
} elseif ( isset($_GET['action']) && isset($_GET['media']) ) {
} elseif ( isset($_GET['action']) && isset($_GET['media']) && isset($_GET['doaction']) ) {
check_admin_referer('bulk-media');
if ( $_GET['action'] == 'delete' ) {
foreach( (array) $_GET['media'] as $post_id_del ) {
@ -147,8 +147,7 @@ require_once('admin-header.php'); ?>
<div class="wrap">
<form id="posts-filter" action="" method="get">
<form id="adv-settings" action="" method="get">
<div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a>
<a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div>
@ -159,7 +158,8 @@ require_once('admin-header.php'); ?>
<?php manage_columns_prefs('media') ?>
<br class="clear" />
</div></div>
</div>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</div></form>
<h2><?php
if ( isset($_GET['detached']) ) {
@ -194,6 +194,7 @@ if ( isset($_GET['detached']) ) {
}
?></h2>
<form id="posts-filter" action="" method="get">
<ul class="subsubsub">
<?php
$type_links = array();
@ -317,7 +318,6 @@ foreach ($arc_result as $arc_row) {
</div>
<br class="clear" />
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
<?php if ( isset($orphans) ) { ?>
<table class="widefat">

View File

@ -262,6 +262,7 @@ if ( ! empty($messages) ) {
<div class="wrap">
<form id="adv-settings" action="" method="get">
<div id="show-settings"><a href="#edit_settings" id="show-settings-link" class="hide-if-no-js"><?php _e('Advanced Options') ?></a>
<a href="#edit_settings" id="hide-settings-link" class="hide-if-js hide-if-no-js"><?php _e('Hide Options') ?></a></div>
@ -272,7 +273,8 @@ if ( ! empty($messages) ) {
<?php manage_columns_prefs('user') ?>
<br class="clear" />
</div></div>
</div>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</div></form>
<form id="posts-filter" action="" method="get">
<?php if ( $wp_user_search->is_search() ) : ?>
@ -390,7 +392,7 @@ foreach ( $wp_user_search->get_results() as $userid ) {
</div>
<?php endif; ?>
<?php wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false ); ?>
</form>
</div>