Add check for bulk-edit when deleting posts/pages, see #8135

git-svn-id: http://svn.automattic.com/wordpress/trunk@9607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-11-11 11:34:08 +00:00
parent b756fbabcd
commit 3f5a70545d
5 changed files with 24 additions and 19 deletions

View File

@ -278,19 +278,21 @@ ul#widget-list li.widget-list-item h4.widget-title {
text-shadow: #FFF 0 1px 0;
}
.button-secondary {
border-color: #CFE1EF;
color: #464646;
text-shadow: #FFF, 0 1px 0;
}
.button,
.submit input,
.button-secondary {
background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
}
.button-primary {
.button-secondary,
.submit .button-secondary {
border-color: #CFE1EF;
color: #464646;
text-shadow: #FFF, 0 1px 0;
}
.button-primary,
.submit .button-primary {
border-color: #21759B;
color: #FFF;
background: #21759B url(../images/button-grad.png) repeat-x scroll left top;
@ -299,6 +301,7 @@ ul#widget-list li.widget-list-item h4.widget-title {
.button[disabled],
.button:disabled {
background-color: #999;
background-image: none;
}
.button:hover,

View File

@ -15,7 +15,7 @@ if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2']
switch ( $doaction ) {
case 'delete':
if ( isset($_GET['post']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
check_admin_referer('bulk-pages');
foreach( (array) $_GET['post'] as $post_id_del ) {
$post_del = & get_post($post_id_del);
@ -34,7 +34,7 @@ if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2']
}
break;
case 'edit':
if ( isset($_GET['post']) ) {
if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) {
check_admin_referer('bulk-pages');
if ( -1 == $_GET['_status'] ) {
@ -48,6 +48,7 @@ if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2']
}
break;
}
$sendback = wp_get_referer();
if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php');
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
@ -120,7 +121,9 @@ if ( (int) $_GET['skipped'] ) {
if ( (int) $_GET['locked'] ) {
printf( __ngettext( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) );
unset($_GET['locked']);
} ?>
}
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated'), $_SERVER['REQUEST_URI'] );
?>
</p></div>
<?php } ?>

View File

@ -15,7 +15,7 @@ if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2']
switch ( $doaction ) {
case 'delete':
if ( isset($_GET['post']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
check_admin_referer('bulk-posts');
foreach( (array) $_GET['post'] as $post_id_del ) {
$post_del = & get_post($post_id_del);
@ -34,7 +34,7 @@ if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2']
}
break;
case 'edit':
if ( isset($_GET['post']) ) {
if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) {
check_admin_referer('bulk-posts');
if ( -1 == $_GET['_status'] ) {
@ -114,7 +114,9 @@ if ( (int) $_GET['skipped'] )
if ( (int) $_GET['locked'] ) {
printf( __ngettext( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) );
unset($_GET['locked']);
} ?>
}
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated'), $_SERVER['REQUEST_URI'] );
?>
</p></div>
<?php } ?>

View File

@ -1121,10 +1121,12 @@ function inline_edit_row( $type ) {
?>
<p class="submit inline-edit-save">
<a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="button-secondary cancel alignleft"><?php _e('Cancel'); ?></a>
<a accesskey="s" href="#inline-edit" title="<?php _e('Save'); ?>" class="button-primary save alignright"><?php _e('Save'); ?></a>
<?php if ( ! $bulk ) {
wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ); ?>
<a accesskey="s" href="#inline-edit" title="<?php _e('Save'); ?>" class="button-primary save alignright"><?php _e('Save'); ?></a>
<img class="waiting" style="display:none;" src="images/loading.gif" alt="" />
<?php } else { ?>
<input accesskey="s" class="button-primary alignright" type="submit" name="bulk_edit" value="<?php _e('Save'); ?>" />
<?php } ?>
<input type="hidden" name="post_view" value="<?php echo $m; ?>" />
<br class="clear" />

View File

@ -23,7 +23,6 @@ inlineEditPost = {
$('input, select', qeRow).keydown(function(e) { if(e.which == 13) return inlineEditPost.save(this); });
$('a.cancel', bulkRow).click(function() { return inlineEditPost.revert(); });
$('a.save', bulkRow).click(function() { return inlineEditPost.saveBulk(); });
// add events
// t.rows.dblclick(function() { inlineEditPost.toggle(this); });
@ -227,10 +226,6 @@ inlineEditPost = {
return false;
},
saveBulk : function() {
$('form#posts-filter').submit();
},
revert : function() {
var id;