Make WordPress Core

Ticket #1105: link-categories.diff

File link-categories.diff, 1.9 KB (added by kim, 19 years ago)
  • wp-admin/link-categories.php

     
    66$this_file='link-categories.php';
    77$parent_file = 'link-manager.php';
    88
    9 $wpvarstoreset = array('action', 'cat', 'auto_toggle');
     9$wpvarstoreset = array('action', 'cat', 'auto_toggle', 'orderby');
    1010for ($i=0; $i<count($wpvarstoreset); $i += 1) {
    1111    $wpvar = $wpvarstoreset[$i];
    1212    if (!isset($$wpvar)) {
     
    279279            <h2><?php _e('Link Categories:') ?></h2>
    280280            <table width="100%" cellpadding="5" cellspacing="0" border="0">
    281281              <tr>
    282                 <th rowspan="2" valign="bottom"><?php _e('Name') ?></th>
    283                 <th rowspan="2" valign="bottom"><?php _e('ID') ?></th>
     282                <th rowspan="2" valign="bottom"><a href="?orderby=name"><?php _e('Name') ?></a></th>
     283                <th rowspan="2" valign="bottom"><a href="?orderby=id"><?php _e('ID') ?></a></th>
    284284                <th rowspan="2" valign="bottom"><?php _e('Toggle?') ?></th>
    285285                <th colspan="4" valign="bottom" class="alternate"><?php _e('Show') ?></th>
    286286                <th rowspan="2" valign="bottom"><?php _e('Sort Order') ?></th>
     
    299299                <th valign="top"><?php _e('After') ?></th>
    300300              </tr>
    301301<?php
     302        switch ($orderby) {
     303                case 'id':
     304                        $orderby = 'cat_id';
     305                        break;
     306                case 'name':
     307                default:
     308                        $orderby = 'cat_name';
     309                        break;
     310        }
    302311$results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle, show_images, show_description, "
    303312         . " show_rating, show_updated, sort_order, sort_desc, text_before_link, text_after_link, "
    304          . " text_after_all, list_limit FROM $wpdb->linkcategories ORDER BY cat_id");
     313         . " text_after_all, list_limit FROM $wpdb->linkcategories ORDER BY $orderby");
    305314$i = 1;
    306315foreach ($results as $row) {
    307316    if ($row->list_limit == -1) {