Make WordPress Core

Changeset 2832


Ignore:
Timestamp:
08/31/2005 02:39:17 AM (20 years ago)
Author:
ryan
Message:

On the fly list manipulation. Delete in style. Mad props to mdawaffe. Applies to #1634

Location:
trunk/wp-admin
Files:
2 added
9 edited

Legend:

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

    r2830 r2832  
    443443                $pad = str_repeat('— ', $level);
    444444                if ( current_user_can('manage_categories') )
    445                     $edit = "<a href='categories.php?action=edit&amp;cat_ID=$category->cat_ID' class='edit'>" . __('Edit') . "</a></td><td><a href='categories.php?action=delete&amp;cat_ID=$category->cat_ID' onclick=\"return confirm('".  sprintf(__("You are about to delete the category \'%s\'.  All of its posts will go to the default category.\\n  \'OK\' to delete, \'Cancel\' to stop."), $wpdb->escape($category->cat_name)) . "')\" class='delete'>" .  __('Delete') . "</a>";
     445                    $edit = "<a href='categories.php?action=edit&amp;cat_ID=$category->cat_ID' class='edit'>" . __('Edit') . "</a></td><td><a href='categories.php?action=delete&amp;cat_ID=$category->cat_ID' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . sprintf(__("You are about to delete the category &quot;%s&quot;.  All of its posts will go to the default category.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), wp_specialchars($category->cat_name, 1))  . "' );\" class='delete'>" .  __('Delete') . "</a>";
    446446                else
    447447                    $edit = '';
    448448               
    449449                $class = ('alternate' == $class) ? '' : 'alternate';
    450                 echo "<tr class='$class'><th scope='row'>$category->cat_ID</th><td>$pad $category->cat_name</td>
     450                echo "<tr id='cat-$category->cat_ID' class='$class'><th scope='row'>$category->cat_ID</th><td>$pad $category->cat_name</td>
    451451                <td>$category->category_description</td>
    452452                <td>$count</td>
     
    474474                $class = ('alternate' == $class) ? '' : 'alternate';
    475475?>
    476   <tr class='<?php echo $class; ?>'>
     476  <tr id='page-<?php echo $id; ?>' class='<?php echo $class; ?>'>
    477477    <th scope="row"><?php echo $post->ID; ?></th>
    478478    <td>
     
    483483    <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td>
    484484    <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
    485     <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='post.php?action=delete&amp;post=$id' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'OK\' to delete, \'Cancel\' to stop."), the_title('','',0)) . "')\">" . __('Delete') . "</a>"; } ?></td>
     485    <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='post.php?action=delete&amp;post=$id' class='delete' onclick=\"return deleteSomething( 'page', " . $id . ", '" . sprintf(__("You are about to delete the &quot;%s&quot; page.\\n&quot;OK&quot; to delete, &quot;Cancel&quot; to stop."), wp_specialchars(get_the_title('','',0), 1)) . "' );\">" . __('Delete') . "</a>"; } ?></td>
    486486  </tr>
    487487
  • trunk/wp-admin/admin-header.php

    r2820 r2832  
    7777</script>
    7878<script type="text/javascript" src="../wp-includes/js/fat.js"></script>
     79<script type="text/javascript" src="../wp-includes/js/tw-sack.js"></script>
     80<script type="text/javascript" src="list-manipulation.js"></script>
    7981<?php if ( isset( $editing ) ) : ?>
    8082<?php if ( 'true' == get_user_option('rich_editing') ) :?>
     
    105107
    106108<?php if ( current_user_can('manage_categories') ) : ?>
    107 <script type="text/javascript" src="../wp-includes/js/tw-sack.js"></script>
    108109<script type="text/javascript">
    109110var ajaxCat = new sack();
  • trunk/wp-admin/categories.php

    r2762 r2832  
    121121    <h2><?php _e('Categories') ?> </h2>
    122122<?php endif; ?>
    123 <table width="100%" cellpadding="3" cellspacing="3">
     123<table id="the-list-x" width="100%" cellpadding="3" cellspacing="3">
    124124    <tr>
    125125        <th scope="col"><?php _e('ID') ?></th>
     
    133133?>
    134134</table>
     135
     136<div id="ajax-response"></div>
    135137
    136138</div>
  • trunk/wp-admin/edit-comments.php

    r2756 r2832  
    7777            $start = '';
    7878
    79         echo "<ol class='commentlist' $start>";
     79        echo "<ol id='the-list' class='commentlist' $start>";
    8080        $i = 0;
    8181        foreach ($comments as $comment) {
     
    8787            if ($i % 2)
    8888                $class .= ' alternate';
    89             echo "<li class='$class'>";
     89            echo "<li id='comment-$comment->comment_ID' class='$class'>";
    9090?>     
    9191        <p><strong><?php _e('Name:') ?></strong> <?php comment_author() ?> <?php if ($comment->comment_author_email) { ?>| <strong><?php _e('E-mail:') ?></strong> <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url ) { ?> | <strong><?php _e('URI:') ?></strong> <?php comment_author_url_link() ?> <?php } ?>| <strong><?php _e('IP:') ?></strong> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p>
     
    9898            }
    9999            if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
    100                 echo " | <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), $comment->comment_author) . "')\">" . __('Delete Comment') . "</a> &#8212; ";
     100                echo " | <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_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 Comment') . "</a> &#8212; ";
    101101            } // end if any comments to show
    102102            // Get post title
     
    111111<?php } // end foreach ?>
    112112</ol>
     113
     114<div id="ajax-response"></div>
    113115
    114116<?php
  • trunk/wp-admin/edit-pages.php

    r2763 r2832  
    1515if ($posts) {
    1616?>
    17 <table width="100%" cellpadding="3" cellspacing="3">
     17<table id="the-list-x" width="100%" cellpadding="3" cellspacing="3">
    1818  <tr>
    1919    <th scope="col"><?php _e('ID') ?></th>
     
    2727<?php page_rows(); ?>
    2828</table>
     29
     30<div id="ajax-response"></div>
     31
    2932<?php
    3033} else {
  • trunk/wp-admin/edit.php

    r2720 r2832  
    129129?>
    130130
    131 <table width="100%" cellpadding="3" cellspacing="3">
     131<table id="the-list-x" width="100%" cellpadding="3" cellspacing="3">
    132132    <tr>
    133133
     
    143143$class = ('alternate' == $class) ? '' : 'alternate';
    144144?>
    145     <tr class='<?php echo $class; ?>'>
     145    <tr id='post-<?php echo $id; ?>' class='<?php echo $class; ?>'>
    146146
    147147<?php
     
    203203    case 'control_delete':
    204204        ?>
    205         <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=delete&amp;post=$id' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'OK\' to delete, \'Cancel\' to stop."), wp_specialchars(get_the_title('', ''), 1) ) . "')\">" . __('Delete') . "</a>"; } ?></td>
     205        <td><?php if ( current_user_can('edit_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>
    206206        <?php
    207207        break;
     
    226226} // end if ($posts)
    227227?>
    228 </table>
     228</table>
     229
     230<div id="ajax-response"></div>
    229231
    230232<div class="navigation">
  • trunk/wp-admin/link-categories.php

    r2714 r2832  
    277277<div class="wrap">
    278278            <h2><?php _e('Link Categories:') ?></h2>
    279             <table width="100%" cellpadding="5" cellspacing="0" border="0">
     279            <table id="the-list" width="100%" cellpadding="5" cellspacing="0" border="0">
    280280              <tr>
    281281            <th rowspan="2" valign="bottom"><?php _e('Name') ?></th>
     
    335335    }
    336336?>
    337               <tr valign="middle" align="center" <?php echo $style ?> style="border-bottom: 1px dotted #9C9A9C;">
     337              <tr id="link-category-<?php echo $row->cat_id; ?>" valign="middle" align="center" <?php echo $style ?> style="border-bottom: 1px dotted #9C9A9C;">
    338338                <td><?php echo wp_specialchars($row->cat_name)?></td>
    339339                <td ><?php echo $row->cat_id?></td>
     
    350350                <td><?php echo $row->list_limit ?></td>
    351351                <td><a href="link-categories.php?cat_id=<?php echo $row->cat_id?>&amp;action=Edit" class="edit"><?php _e('Edit') ?></a></td>
    352                 <td><a href="link-categories.php?cat_id=<?php echo $row->cat_id?>&amp;action=Delete" onclick="return confirm('<?php _e("You are about to delete this category.\\n  \'Cancel\' to stop, \'OK\' to delete.") ?>');" class="delete"><?php _e('Delete') ?></a></td>
     352                <td><a href="link-categories.php?cat_id=<?php echo $row->cat_id?>&amp;action=Delete" onclick="return deleteSomething( 'link category', <?php echo $row->cat_id . ", '" . sprintf(__("You are about to delete the &quot;%s&quot; link category.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), wp_specialchars($row->cat_name,1)); ?>' );" class="delete"><?php _e('Delete') ?></a></td>
    353353              </tr>
    354354<?php
     
    358358            </table>
    359359<p><?php _e('These are the defaults for when you call a link category with no additional arguments. All of these settings may be overwritten.') ?></p>
     360
     361<div id="ajax-response"></div>
    360362
    361363</div>
  • trunk/wp-admin/link-manager.php

    r2714 r2832  
    630630    <input type="hidden" name="order_by" value="<?php echo wp_specialchars($order_by, 1); ?>" />
    631631    <input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
    632   <table width="100%" cellpadding="3" cellspacing="3">
     632  <table id="the-list-x" width="100%" cellpadding="3" cellspacing="3">
    633633    <tr>
    634634      <th width="15%"><?php _e('Name') ?></th>
     
    672672            $visible = ($link->link_visible == 'Y') ? __('Yes') : __('No');
    673673            ++$i;
    674             $style = ($i % 2) ? ' class="alternate"' : '';
    675 ?>
    676     <tr valign="middle" <?php echo $style; ?>>
     674            $style = ($i % 2) ? '' : ' class="alternate"';
     675?>
     676    <tr id="link-<?php echo $link->link_id; ?>" valign="middle" <?php echo $style; ?>>
    677677        <td><strong><?php echo $link->link_name; ?></strong><br />
    678678<?php           
     
    689689            if ($show_buttons) {
    690690        echo '<td><a href="link-manager.php?link_id=' . $link->link_id . '&amp;action=linkedit" class="edit">' . __('Edit') . '</a></td>';
    691         echo '<td><a href="link-manager.php?link_id=' . $link->link_id . '&amp;action=Delete"' .  " onclick=\"return confirm('" . __("You are about to delete this link.\\n  \'Cancel\' to stop, \'OK\' to delete.") .  "');" . '" class="delete">' . __('Delete') . '</a></td>';
     691        echo '<td><a href="link-manager.php?link_id=' . $link->link_id . '&amp;action=Delete"' .  " onclick=\"return deleteSomething( 'link', $link->link_id , '" . sprintf(__("You are about to delete the &quot;%s&quot; link to %s.\\n&quot;Cancel&quot; to stop, &quot;OK&quot; to delete."), wp_specialchars($link->link_name,1), wp_specialchars($link->link_url)) . '\' );" class="delete">' . __('Delete') . '</a></td>';
    692692        echo '<td><input type="checkbox" name="linkcheck[]" value="' . $link->link_id . '" /></td>';
    693693            } else {
    694694              echo "<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>\n";
    695695            }
    696         echo "\n\t</tr>";
     696        echo "\n    </tr>\n";
    697697        }
    698698    }
    699699?>
    700700</table>
     701
     702<div id="ajax-response"></div>
    701703
    702704</div>
  • trunk/wp-admin/moderation.php

    r2782 r2832  
    131131    <form name="approval" action="moderation.php" method="post">
    132132    <input type="hidden" name="action" value="update" />
    133     <ol id="comments" class="commentlist">
     133    <ol id="the-list" class="commentlist">
    134134<?php
    135135$i = 0;
     
    148148<a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php _e('View Post') ?></a> |
    149149<?php
    150 echo " <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), $comment->comment_author) . "')\">" . __('Delete just this comment') . "</a> | "; ?>  <?php _e('Bulk action:') ?>
     150echo " <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_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 just this comment') . "</a> | "; ?>  <?php _e('Bulk action:') ?>
    151151    <input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment[<?php echo $comment->comment_ID; ?>]-approve" value="approve" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-approve"><?php _e('Approve') ?></label>
    152152    <input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment[<?php echo $comment->comment_ID; ?>]-spam" value="spam" /> <label for="comment[<?php echo $comment->comment_ID; ?>]-spam"><?php _e('Spam') ?></label>
     
    160160?>
    161161    </ol>
     162
     163<div id="ajax-response"></div>
    162164
    163165    <p class="submit"><input type="submit" name="submit" value="<?php _e('Moderate Comments &raquo;') ?>" /></p>
Note: See TracChangeset for help on using the changeset viewer.