Make WordPress Core


Ignore:
Timestamp:
03/29/2006 01:51:55 AM (19 years ago)
Author:
ryan
Message:

AJAX, cause you love it. Props mdawaffe. fixes #2561

File:
1 edited

Legend:

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

    r3564 r3660  
    115115
    116116<?php
    117 
    118117// define the columns to display, the syntax is 'internal name' => 'display name'
    119118$posts_columns = array(
     
    134133?>
    135134
    136 <table id="the-list-x" width="100%" cellpadding="3" cellspacing="3">
     135<table width="100%" cellpadding="3" cellspacing="3">
     136    <thead>
    137137    <tr>
    138138
     
    142142
    143143    </tr>
     144    </thead>
     145    <tbody id="the-list">
    144146<?php
    145147if ($posts) {
    146148$bgcolor = '';
    147149foreach ($posts as $post) { start_wp();
     150add_filter('the_title','wp_specialchars');
    148151$class = ('alternate' == $class) ? '' : 'alternate';
    149152?>
     
    208211    case 'control_delete':
    209212        ?>
    210         <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='post.php?action=delete&amp;post=$id' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . sprintf(__("You are about to delete this post &quot;%s&quot;.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), wp_specialchars(get_the_title('', ''), 1) ) . "' );\">" . __('Delete') . "</a>"; } ?></td>
     213        <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='post.php?action=delete&amp;post=$id' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . sprintf(__("You are about to delete this post &quot;%s&quot;.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), addslashes(wp_specialchars(get_the_title(),'double')) ) . "' );\">" . __('Delete') . "</a>"; } ?></td>
    211214        <?php
    212215        break;
     
    230233<?php
    231234} // end if ($posts)
    232 ?>
     235?>
     236    </tbody>
    233237</table>
    234238
     
    247251    ?>
    248252<h3><?php _e('Comments') ?></h3>
    249 <ol id="comments">
    250 <?php
     253<ol id="the-list">
     254<?php
     255$i = 0;
    251256foreach ($comments as $comment) {
    252 $comment_status = wp_get_comment_status($comment->comment_ID);
     257$class = ( ++$i % 2 ) ? array('alternate') : array();
     258if ( 'unapproved' == $comment_status = wp_get_comment_status($comment->comment_ID) )
     259    $class[] = 'unapproved';
    253260?>
    254261
    255 <li <?php if ("unapproved" == $comment_status) echo "class='unapproved'"; ?> >
     262<li id='comment-<?php echo $comment->comment_ID; ?>'<?php if ( $class ) echo " class='" . join(' ', $class) . "'"; ?>>
    256263  <?php comment_date('Y-n-j') ?>
    257264  @
     
    259266  <?php
    260267            if ( current_user_can('edit_post', $post->ID) ) {
    261                 echo "[ <a href=\"post.php?action=editcomment&amp;comment=".$comment->comment_ID."\">" .  __('Edit') . "</a>";
    262                 echo " - <a href=\"post.php?action=deletecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n  \'OK\' to delete, \'Cancel\' to stop."), $comment->comment_author) . "')\">" . __('Delete') . "</a> ";
     268                echo "[ <a href='post.php?action=editcomment&amp;comment=".$comment->comment_ID."\'>" .  __('Edit') . '</a>';
     269                echo ' - <a href="post.php?action=deletecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by &quot;%s&quot;.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), wp_specialchars($comment->comment_author, 1)) . "' );\">" . __('Delete') . '</a> ';
    263270                if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
    264                     if ('approved' == wp_get_comment_status($comment->comment_ID)) {
    265                         echo " - <a href=\"post.php?action=unapprovecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\">" . __('Unapprove') . "</a> ";
    266                     } else {
    267                         echo " - <a href=\"post.php?action=approvecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\">" . __('Approve') . "</a> ";
    268                     }
     271                    echo '<span class="unapprove"> - <a href="comment.php?action=unapprovecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Unapprove') . '</a> </span>';
     272                    echo '<span class="approve"> - <a href="comment.php?action=approvecomment&amp;p=' . $post->ID . '&amp;comment=' . $comment->comment_ID . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\' );">' . __('Approve') . '</a> </span>';
    269273                }
    270274                echo "]";
Note: See TracChangeset for help on using the changeset viewer.