WordPress.org

Make WordPress Core

Changeset 8864


Ignore:
Timestamp:
09/11/08 17:18:26 (6 years ago)
Author:
ryan
Message:

Reorder comment actions. see #7552

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r8863 r8864  
    12801280 
    12811281    if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    1282         $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . "</a> | "; 
    1283         $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . "</a> | "; 
    1284         $actions['edit']      = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a> | '; 
    1285         if ( 'spam' != $the_comment_status ) 
    1286             $actions['spam']      = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | '; 
    1287         $actions['delete']    = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>'; 
    1288  
     1282        $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 
     1283        $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 
    12891284        if ( $comment_status ) { // not looking at all comments 
    12901285            if ( 'approved' == $the_comment_status ) { 
    1291                 $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment vim-u vim-destructive' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
     1286                $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment vim-u vim-destructive' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 
    12921287                unset($actions['approve']); 
    12931288            } else { 
    1294                 $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment vim-a vim-destructive' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
     1289                $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment vim-a vim-destructive' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 
    12951290                unset($actions['unapprove']); 
    12961291            } 
    12971292        } 
    1298  
    12991293        if ( 'spam' != $the_comment_status ) 
    1300             $actions['reply'] = '<span class="hide-if-no-js"> | <a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',this);return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a></span>'; 
     1294            $actions['spam']      = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a>'; 
     1295        $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>'; 
     1296        $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>'; 
     1297        if ( 'spam' != $the_comment_status ) 
     1298            $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',this);return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>'; 
    13011299 
    13021300        $actions = apply_filters( 'comment_row_actions', $actions, $comment ); 
    13031301 
    1304         foreach ( $actions as $action => $link ) 
    1305             echo "<span class='$action'>$link</span>\n"; 
     1302        $action_count = count($actions); 
     1303        $i = 0; 
     1304        foreach ( $actions as $action => $link ) { 
     1305            ++$i; 
     1306            ( $i == $action_count ) ? $sep = '' : $sep = ' | '; 
     1307            // The action before reply shouldn't output a sep 
     1308            if ( 'edit' == $action ) 
     1309                $sep = ''; 
     1310            // Reply needs a hide-if-no-js span 
     1311            if ( 'reply' == $action ) 
     1312                echo "<span class='$action'><span class='hide-if-no-js'> | $link</span>$sep</span>"; 
     1313            else 
     1314                echo "<span class='$action'>$link$sep</span>"; 
     1315        } 
    13061316    } 
    13071317    ?> 
Note: See TracChangeset for help on using the changeset viewer.