From 9811ed02cd670369c54bceedaa4423cdd181dac9 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 14 Nov 2008 19:40:24 +0000 Subject: [PATCH] Fix row alternation for media library screen git-svn-id: http://svn.automattic.com/wordpress/trunk@9690 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-attachment-rows.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-admin/edit-attachment-rows.php b/wp-admin/edit-attachment-rows.php index a71b6a45e2..e825f22245 100644 --- a/wp-admin/edit-attachment-rows.php +++ b/wp-admin/edit-attachment-rows.php @@ -27,13 +27,13 @@ if ( have_posts() ) { $bgcolor = ''; add_filter('the_title','wp_specialchars'); while (have_posts()) : the_post(); -$class = 'alternate' == $class ? '' : 'alternate'; +$alt = ( 'alternate' == $alt ) ? '' : 'alternate'; global $current_user; $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); $att_title = _draft_or_post_title(); ?> - post_status ); ?>' valign="top"> + post_status ); ?>' valign="top"> $column_display_name ) {

ID, true) . '">' . __('Edit') . ''; - $actions['delete'] = "ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . ""; + if ( current_user_can('edit_post', $post->ID) ) + $actions['edit'] = '' . __('Edit') . ''; + if ( current_user_can('delete_post', $post->ID) ) + $actions['delete'] = "ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . ""; $actions['view'] = '' . __('View') . ''; $action_count = count($actions); $i = 0;