]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/comment.php
WordPress 4.2.1-scripts
[autoinstalls/wordpress.git] / wp-admin / comment.php
index c2d57f08d99db614f0c46815f1bf2befc175e768..c2487335b892c40058019a8e71bfb56cbae152c3 100644 (file)
@@ -12,6 +12,7 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
 $parent_file = 'edit-comments.php';
 $submenu_file = 'edit-comments.php';
 
+global $action;
 wp_reset_vars( array('action') );
 
 if ( isset( $_POST['deletecomment'] ) )
@@ -55,8 +56,8 @@ case 'editcomment' :
 
        get_current_screen()->set_help_sidebar(
        '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
-       '<p>' . __( '<a href="http://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
-       '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
+       '<p>' . __( '<a href="https://codex.wordpress.org/Administration_Screens#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
+       '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
        );
 
        wp_enqueue_script('comment');
@@ -111,22 +112,19 @@ case 'spam'    :
        $nonce_action .= $comment_id;
 
 ?>
-<div class='wrap'>
+<div class="wrap">
 
-<div class="narrow">
-
-<?php screen_icon(); ?>
 <h2><?php echo esc_html( $title ); ?></h2>
 
 <?php
 switch ( $action ) {
        case 'spam' :
                $caution_msg = __('You are about to mark the following comment as spam:');
-               $button      = __('Spam Comment');
+               $button      = __('Mark as Spam');
                break;
        case 'trash' :
                $caution_msg = __('You are about to move the following comment to the Trash:');
-               $button      = __('Trash Comment');
+               $button      = __('Move to Trash');
                break;
        case 'delete' :
                $caution_msg = __('You are about to delete the following comment:');
@@ -151,14 +149,15 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
                        $message  = __('This comment is currently in the Trash.');
                        break;
        }
-       if ( $message )
-               echo '<div class="updated"><p>' . $message . '</p></div>';
+       if ( $message ) {
+               echo '<div class="notice notice-info"><p>' . $message . '</p></div>';
+       }
 }
 ?>
 <p><strong><?php _e('Caution:'); ?></strong> <?php echo $caution_msg; ?></p>
 
 <table class="form-table comment-ays">
-<tr class="alt">
+<tr>
 <th scope="row"><?php _e('Author'); ?></th>
 <td><?php echo $comment->comment_author; ?></td>
 </tr>
@@ -175,29 +174,60 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
 </tr>
 <?php } ?>
 <tr>
-<th scope="row" valign="top"><?php /* translators: field name in comment form */ _ex('Comment', 'noun'); ?></th>
+       <th scope="row"><?php _e( 'In Response To' ); ?></th>
+       <td>
+       <?php
+               $post_id = $comment->comment_post_ID;
+               if ( current_user_can( 'edit_post', $post_id ) ) {
+                       $post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
+                       $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
+               } else {
+                       $post_link = esc_html( get_the_title( $post_id ) );
+               }
+               echo $post_link;
+
+               if ( $comment->comment_parent ) {
+                       $parent      = get_comment( $comment->comment_parent );
+                       $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
+                       $name        = get_comment_author( $parent->comment_ID );
+                       printf( ' | ' . __( 'In reply to <a href="%1$s">%2$s</a>.' ), $parent_link, $name );
+               }
+       ?>
+       </td>
+</tr>
+<tr>
+       <th scope="row"><?php _e( 'Submitted on' ); ?></th>
+       <td>
+       <?php
+               /* translators: 2: comment date, 3: comment time */
+               printf( __( '<a href="%1$s">%2$s at %3$s</a>' ),
+                       esc_url( get_comment_link( $comment->comment_ID ) ),
+                       /* translators: comment date format. See http://php.net/date */
+                       get_comment_date( __( 'Y/m/d' ) ),
+                       get_comment_date( get_option( 'time_format' ) )
+               );
+       ?>
+       </td>
+</tr>
+<tr>
+<th scope="row"><?php /* translators: field name in comment form */ _ex('Comment', 'noun'); ?></th>
 <td><?php echo $comment->comment_content; ?></td>
 </tr>
 </table>
 
-<p><?php _e('Are you sure you want to do this?'); ?></p>
+<form action="comment.php" method="get" class="comment-ays-submit">
 
-<form action='comment.php' method='get'>
-
-<table width="100%">
-<tr>
-<td><a class="button" href="<?php echo admin_url('edit-comments.php'); ?>"><?php esc_attr_e('No'); ?></a></td>
-<td class="textright"><?php submit_button( $button, 'button' ); ?></td>
-</tr>
-</table>
+<p>
+       <?php submit_button( $button, 'primary', 'submit', false ); ?>
+       <a href="<?php echo admin_url('edit-comments.php'); ?>" class="button-cancel"><?php esc_attr_e( 'Cancel' ); ?></a></td>
+</p>
 
 <?php wp_nonce_field( $nonce_action ); ?>
-<input type='hidden' name='action' value='<?php echo esc_attr($formaction); ?>' />
-<input type='hidden' name='c' value='<?php echo esc_attr($comment->comment_ID); ?>' />
-<input type='hidden' name='noredir' value='1' />
+<input type="hidden" name="action" value="<?php echo esc_attr($formaction); ?>" />
+<input type="hidden" name="c" value="<?php echo esc_attr($comment->comment_ID); ?>" />
+<input type="hidden" name="noredir" value="1" />
 </form>
 
-</div>
 </div>
 <?php
        break;
@@ -267,7 +297,6 @@ case 'unapprovecomment' :
 
        wp_redirect( $redir );
        die;
-       break;
 
 case 'editedcomment' :
 
@@ -292,11 +321,9 @@ case 'editedcomment' :
        wp_redirect( $location );
 
        exit();
-       break;
 
 default:
        wp_die( __('Unknown action.') );
-       break;
 
 } // end switch