Make WordPress Core

Changeset 799


Ignore:
Timestamp:
01/27/2004 08:31:17 AM (22 years ago)
Author:
saxmatt
Message:

Sub-categories interface improvements.

Location:
trunk
Files:
3 edited

Legend:

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

    r798 r799  
    33require_once('../wp-config.php');
    44require_once(ABSPATH.'/wp-admin/auth.php');
     5require(ABSPATH.'/wp-admin/admin-functions.php');
    56
    67function gethelp_link($this_file, $helptag) {
  • trunk/wp-admin/categories.php

    r798 r799  
    9393        <input type="text" name="cat_name" value="<?php echo $cat_name; ?>" /></p>
    9494        <p>Category parent:<br />
    95         <?php dropdown_cats(FALSE, '', 'name', 'asc', FALSE, FALSE, FALSE, TRUE, $category->category_parent, $HTTP_GET_VARS['cat_ID']); ?></p>
     95        <select name='cat' class='postform'>
     96        <?php wp_dropdown_cats($category->cat_ID, $category->category_parent); ?></p>
     97        </select>
     98        </p>
    9699        <p>Description:<br />
    97100        <textarea name="category_description" rows="5" cols="50" style="width: 97%;"><?php echo htmlentities($category->category_description); ?></textarea></p>
     
    133136
    134137<div class="wrap">
    135     <h2>Current Categories</h2>
    136     <table width="100%" cellpadding="3" cellspacing="3">
    137     <tr>
    138         <th scope="col">Name</th>
    139         <th scope="col">Parent</th>
    140         <th scope="col">Description</th>
    141         <th scope="col"># Posts</th>
    142         <th colspan="2">Action</th>
    143     </tr>
    144     <?php
    145     $categories = $wpdb->get_results("SELECT * FROM $tablecategories ORDER BY cat_name");
    146     foreach ($categories as $category) {
    147         $parent = "None";
    148         if ($category->category_parent) $parent = $wpdb->get_var("SELECT cat_name FROM $tablecategories WHERE cat_ID = $category->category_parent");
    149         $count = $wpdb->get_var("SELECT COUNT(post_id) FROM $tablepost2cat WHERE category_id = $category->cat_ID");
    150         $bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee';
    151         echo "<tr style='background-color: $bgcolor'><td>$category->cat_name</td>
    152         <td>$parent</td>
    153         <td>$category->category_description</td>
    154         <td>$count</td>
    155         <td><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('You are about to delete the category \'". addslashes($category->cat_name) ."\' and all its posts will go to the default category.\\n  \'OK\' to delete, \'Cancel\' to stop.')\" class='delete'>Delete</a></td>
    156         </tr>";
    157     }
    158     ?>
     138<h2>Current Categories</h2>
     139<table width="100%" cellpadding="3" cellspacing="3">
     140    <tr>
     141        <th scope="col">Name</th>
     142        <th scope="col">Description</th>
     143        <th scope="col"># Posts</th>
     144        <th colspan="2">Action</th>
     145    </tr>
     146<?php
     147cat_rows();
     148?>
    159149    </table>
    160150
     
    167157        <input type="text" name="cat_name" value="" /></p>
    168158        <p>Category parent:<br />
    169         <?php dropdown_cats(FALSE, '', 'name', 'asc', FALSE, FALSE, FALSE, TRUE); ?></p>
     159        <select name='cat' class='postform'>
     160        <?php wp_dropdown_cats(); ?></p>
     161        </select>
    170162        <p>Description: (optional) <br />
    171163        <textarea name="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p>
  • trunk/wp-includes/template-functions.php

    r798 r799  
    14611461function get_category_children($id, $before=' / ', $after='') {
    14621462    global $tablecategories, $cache_categories;
    1463     $c_cache=$cache_categories;#can't do recursive foreach on a global, have to make a copy
     1463    $c_cache=$cache_categories; // Can't do recursive foreach on a global, have to make a copy
    14641464    $chain = "";
    14651465    foreach ($c_cache as $category){
Note: See TracChangeset for help on using the changeset viewer.