From 8368df8c17179ede54f856bc1f0448b72fb85309 Mon Sep 17 00:00:00 2001 From: azaozz Date: Thu, 31 Dec 2009 02:37:56 +0000 Subject: [PATCH] Add AYS popup when deleting media, fixes #11673 git-svn-id: http://svn.automattic.com/wordpress/trunk@12591 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-attachment-rows.php | 6 ++++-- wp-admin/upload.php | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/wp-admin/edit-attachment-rows.php b/wp-admin/edit-attachment-rows.php index eef8f0cf85..1b972a9f94 100644 --- a/wp-admin/edit-attachment-rows.php +++ b/wp-admin/edit-attachment-rows.php @@ -96,8 +96,10 @@ foreach ($posts_columns as $column_name => $column_display_name ) { $actions['untrash'] = "ID) . "'>" . __('Restore') . ""; elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) $actions['trash'] = "ID) . "'>" . __('Trash') . ""; - if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) - $actions['delete'] = "ID) . "'>" . __('Delete Permanently') . ""; + if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) { + $delete_ays = (!$is_trash && !MEDIA_TRASH) ? " onclick='return showNotice.warn();'" : ''; + $actions['delete'] = "ID) . "'>" . __('Delete Permanently') . ""; + } } if ( !$is_trash ) $actions['view'] = '' . __('View') . ''; diff --git a/wp-admin/upload.php b/wp-admin/upload.php index f0c9635c37..58c3a72a9f 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -392,10 +392,12 @@ foreach ($arc_result as $arc_row) { if ( current_user_can('edit_post', $post->ID) ) $actions['edit'] = '' . __('Edit') . ''; if ( current_user_can('delete_post', $post->ID) ) - if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) + if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) { $actions['trash'] = "ID) . "'>" . __('Trash') . ""; - else - $actions['delete'] = "ID) . "'>" . __('Delete Permanently') . ""; + } else { + $delete_ays = !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : ''; + $actions['delete'] = "ID) . "'>" . __('Delete Permanently') . ""; + } $actions['view'] = '' . __('View') . ''; if ( current_user_can('edit_post', $post->ID) ) $actions['attach'] = ''.__('Attach').'';