Make WordPress Core


Ignore:
Timestamp:
11/14/2008 07:40:24 PM (18 years ago)
Author:
ryan
Message:

Fix row alternation for media library screen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-attachment-rows.php

    r9506 r9690  
    2828add_filter('the_title','wp_specialchars');
    2929while (have_posts()) : the_post();
    30 $class = 'alternate' == $class ? '' : 'alternate';
     30$alt = ( 'alternate' == $alt ) ? '' : 'alternate';
    3131global $current_user;
    3232$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
     
    3434
    3535?>
    36     <tr id='post-<?php echo $id; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
     36    <tr id='post-<?php echo $id; ?>' class='<?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
    3737
    3838<?php
     
    8181        <?php
    8282        $actions = array();
    83         $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
    84         $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->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') . "</a>";
     83        if ( current_user_can('edit_post', $post->ID) )
     84            $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
     85        if ( current_user_can('delete_post', $post->ID) )
     86            $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->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') . "</a>";
    8587        $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attribute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';
    8688        $action_count = count($actions);
Note: See TracChangeset for help on using the changeset viewer.