WordPress.org

Make WordPress Core

Changeset 2730


Ignore:
Timestamp:
07/23/2005 06:22:48 AM (16 years ago)
Author:
matt
Message:

A few CSS polishes

Location:
trunk/wp-admin
Files:
6 edited

Legend:

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

    r2723 r2730  
    364364}
    365365
    366 function return_categories_list( $parent = 0, $sortbyname = FALSE )
    367 {
    368         /*
    369          * This function returns an list of all categories
    370          * that have $parent as their parent
    371          * if no parent is specified we will assume top level caegories
    372          * are required.
    373          */
    374         global $wpdb;
    375 
    376         // select sort order
    377         $sort = "cat_id";
    378         if( TRUE == $sortbyname )
    379         {
    380                 $sort = "cat_name";
    381         }
    382 
    383         // First query the database
    384         $cats_tmp = $wpdb->get_results("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY $sort");
    385 
    386         // Now strip this down to a simple array of IDs
    387         $cats = array();
    388         if( count($cats_tmp) > 0 )
    389         {
    390                 foreach( $cats_tmp as $cat )
    391                 {
    392                         $cats[] = $cat->cat_ID;
    393                 }
    394         }
    395 
    396         // Return the list of categories
    397         return $cats;
     366function return_categories_list( $parent = 0 ) {
     367    global $wpdb;
     368    return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY category_count DESC");
    398369}
    399370
     
    418389 }
    419390
    420  $cats = return_categories_list($parent, TRUE);
     391 $cats = return_categories_list($parent);
    421392 $result = array();
    422393
    423  foreach($cats as $cat)
    424  {
     394 foreach($cats as $cat) {
    425395   $result[$cat]['children'] = get_nested_categories($default, $cat);
    426396   $result[$cat]['cat_ID'] = $cat;
  • trunk/wp-admin/edit-form-advanced.php

    r2729 r2730  
    8686<fieldset id="categorydiv" class="dbx-box">
    8787<h3 class="dbx-handle"><?php _e('Categories') ?></h3>
    88 <div class="dbx-content"><?php dropdown_categories(get_settings('default_category')); ?></div>
     88<div class="dbx-content"><div><?php dropdown_categories(get_settings('default_category')); ?></div>
     89<p id="ajaxcat">
     90  <input type="text" name="newcat" id="newcat" size="16" />
     91  <input type="button" name="Button" value="+">
     92</p>
     93</div>
    8994</fieldset>
    9095
  • trunk/wp-admin/edit-page-form.php

    r2702 r2730  
    4040//-->
    4141</script>
    42     <fieldset id="titlediv">
    43       <legend><?php _e('Page Title') ?></legend>
    44       <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
    45     </fieldset>
    46 <fieldset id="commentstatusdiv">
    47       <legend><?php _e('Discussion') ?></legend>
    48       <div>
    49       <input name="advanced_view" type="hidden" value="1" />
    50       <label for="comment_status" class="selectit">
    51           <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
    52          <?php _e('Allow Comments') ?></label>
    53          <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label>
    54     </div>
     42<div id="poststuff">
     43
     44<div id="moremeta">
     45<div id="grabit" class="dbx-group">
     46<fieldset id="commentstatusdiv" class="dbx-box">
     47<h3 class="dbx-handle"><?php _e('Discussion') ?></h3>
     48<div class="dbx-content">
     49<input name="advanced_view" type="hidden" value="1" />
     50<label for="comment_status" class="selectit">
     51<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
     52<?php _e('Allow Comments') ?></label>
     53<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label>
     54</div>
    5555</fieldset>
    56     <fieldset id="postpassworddiv">
    57       <legend><?php _e('Page Password') ?></legend>
    58       <div><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
    59     </fieldset>
    60     <fieldset id="pageparent">
    61       <legend><?php _e('Page Parent') ?></legend>
    62       <div><select name="parent_id">
    63       <option value='0'><?php _e('Main Page (no parent)'); ?></option>
    64             <?php parent_dropdown($post->post_parent); ?>
    65         </select>
    66       </div>
    67     </fieldset>
     56
     57<fieldset id="passworddiv" class="dbx-box">
     58<h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3>
     59<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
     60</fieldset>
     61
     62<fieldset id="pageparent" class="dbx-box">
     63<h3 class="dbx-handle"><?php _e('Page Parent') ?></h3>
     64<div class="dbx-content"><p><select name="parent_id">
     65<option value='0'><?php _e('Main Page (no parent)'); ?></option>
     66<?php parent_dropdown($post->post_parent); ?>
     67</select></p>
     68</div>
     69</fieldset>
     70
     71<?php if ( 0 != count( get_page_templates() ) ) { ?>
     72<fieldset id="pageparent" class="dbx-box">
     73<h3 class="dbx-handle"><?php _e('Page Template:') ?></h3>
     74<div class="dbx-content"><p><select name="page_template">
     75        <option value='default'><?php _e('Default Template'); ?></option>
     76        <?php page_template_dropdown($post->page_template); ?>
     77        </select></p>
     78</div>
     79</fieldset>
     80<?php } ?>
     81
     82<fieldset id="slugdiv" class="dbx-box">
     83<h3 class="dbx-handle"><?php _e('Post slug') ?></h3>
     84<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div>
     85</fieldset>
     86
     87<?php if ( $authors = get_editable_authors( $current_user->ID ) ) : // TODO: ROLE SYSTEM ?>
     88<fieldset id="authordiv" class="dbx-box">
     89<h3 class="dbx-handle"><?php _e('Post author'); ?>:</h3>
     90<div class="dbx-content">
     91<select name="post_author_override" id="post_author_override">
     92<?php
     93foreach ($authors as $o) :
     94$o = get_userdata( $o->ID );
     95if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"';
     96else $selected = '';
     97echo "<option value='$o->ID' $selected>$o->display_name</option>";
     98endforeach;
     99?>
     100</select>
     101</div>
     102</fieldset>
     103<?php endif; ?>
     104
     105<fieldset id="pageorder" class="dbx-box">
     106<h3 class="dbx-handle"><?php _e('Page Order') ?></h3>
     107<div class="dbx-content"><p><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p></div>
     108</fieldset>
     109
     110</div>
     111</div>
     112
     113<fieldset id="titlediv">
     114  <legend><?php _e('Page Title') ?></legend>
     115  <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
     116</fieldset>
     117
     118
    68119<fieldset id="postdiv">
    69120    <legend><?php _e('Page Content') ?></legend>
     
    90141</p>
    91142
    92 <fieldset id="pageoptions">
    93      <legend><?php _e('Page Options') ?></legend>
    94 <table width="100%" cellspacing="2" cellpadding="5" class="editform">
    95 <?php if ( 0 != count( get_page_templates() ) ) { ?>
    96     <tr valign="top">
    97         <th scope="row" width="30%"><?php _e('Page Template:') ?></th>
    98         <td><div><select name="page_template">
    99         <option value='default'><?php _e('Default Template'); ?></option>
    100         <?php page_template_dropdown($post->page_template); ?>
    101         </select>
    102        
    103         </div>
    104         </td>
    105     </tr>
    106 <?php } ?>
    107     <tr valign="top">
    108         <th scope="row" width="30%"><?php _e('Page slug') ?>:</th>
    109         <td><input name="post_name" type="text" size="25" id="post_name" value="<?php echo $post->post_name ?>" /></td>
    110     </tr>
    111 <?php if ( $authors = get_editable_authors( $current_user->ID ) ) : // TODO: ROLE SYSTEM ?>
    112     <tr>
    113         <th scope="row" width="30%"><?php _e('Page owner'); ?>:</th>
    114         <td>
    115         <select name="post_author" id="post_author">
    116         <?php
    117         foreach ($authors as $o) :
    118             $o = get_userdata( $o->ID );
    119             if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"';
    120             else $selected = '';
    121             echo "<option value='$o->ID' $selected>$o->user_login ($o->first_name $o->last_name)</option>";
    122         endforeach;
    123         ?>
    124         </select>
    125         </td>
    126     </tr>
    127 <?php endif; ?>
    128     <tr>
    129         <th scope="row" width="25%"><?php _e('Page Order') ?>:</th>
    130         <td><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></td>
    131     </tr>
    132     <tr>
    133         <th scope="row"><?php _e('Delete'); ?>:</th>
    134         <td><?php if ('edit' == $action) : ?>
    135         <input name="deletepost" class="delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"return confirm('" . sprintf(__("You are about to delete this page \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), $wpdb->escape($post->post_title) ) . "')\""; ?> />
    136 <?php endif; ?></td>
    137     </tr>
    138 </table>
    139 </fieldset>
    140143
    141 <fieldset id="postcustom">
    142 <legend><?php _e('Custom Fields') ?> <script type="text/javascript">customToggleLink();</script></legend>
    143 <div id="postcustomstuff">
     144<div id="advancedstuff" class="dbx-group">
     145
     146<fieldset id="postcustom" class="dbx-box">
     147<h3 class="dbx-handle"><?php _e('Custom Fields') ?></h3>
     148<div id="postcustomstuff" class="dbx-content">
    144149<?php
    145150if($metadata = has_meta($post_ID)) {
     
    155160</fieldset>
    156161
     162</div>
     163
     164<?php if ('edit' == $action) : ?>
     165        <input name="deletepost" class="delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"return confirm('" . sprintf(__("You are about to delete this page \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), $wpdb->escape($post->post_title) ) . "')\""; ?> />
     166<?php endif; ?>
     167
    157168<?php do_action('edit_page_form', ''); ?>
    158169</form>
    159170
    160171</div>
     172
     173</div>
  • trunk/wp-admin/page-new.php

    r2714 r2730  
    33$title = __('New Page');
    44$parent_file = 'post.php';
     5$editing = true;
    56require_once('admin-header.php');
    67?>
  • trunk/wp-admin/upgrade-functions.php

    r2727 r2730  
    267267        $wpdb->query("ALTER TABLE $wpdb->users DROP $old");
    268268    $wpdb->show_errors();
     269   
     270    if ( 0 == $wpdb->get_var("SELECT SUM(category_count) FROM $wpdb->categories") ) { // Create counts
     271        $categories = $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories");
     272        foreach ( $categories as $cat_id ) {
     273            $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->post2cat WHERE category_id = '$cat_id'");
     274            $wpdb->query("UPDATE $wpdb->categories SET category_count = '$count' WHERE cat_ID = '$cat_id'");
     275        }
     276    }
    269277}
    270278
  • trunk/wp-admin/wp-admin.css

    r2704 r2730  
    364364#quicktags #ed_code {
    365365    font-family: "Courier New", Courier, mono;
     366}
     367
     368#title {
     369    font-size: 1.5em;
    366370}
    367371
     
    619623}
    620624
     625#categorydiv div div {
     626    height: 12em;
     627    overflow: auto;
     628}
     629
     630#ajaxcat input {
     631    border: 1px solid #ccc;
     632}
     633
    621634/* default box styles */
    622635.dbx-box {
     636background: #fff;
    623637}
    624638
Note: See TracChangeset for help on using the changeset viewer.