Make WordPress Core

Changeset 1747


Ignore:
Timestamp:
10/05/2004 08:27:13 AM (20 years ago)
Author:
saxmatt
Message:

Pages update and tweaks.

Location:
trunk
Files:
7 edited

Legend:

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

    r1715 r1747  
    708708}
    709709
     710function parent_dropdown($parent = 0, $level = 0) {
     711    global $wpdb;
     712    $items = $wpdb->get_results("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = $parent AND post_status = 'static' ORDER BY menu_order");
     713    if ($items) {
     714        foreach ($items as $item) {
     715            $pad = str_repeat(' ', $level * 3);
     716            if ($item->ID == $current)
     717                $current = ' selected="selected"';
     718            else
     719                $current = '';
     720
     721            echo "\n\t<option value='$item->ID'$current>$pad $item->post_title</a></option>";
     722                parent_dropdown($item->ID, $level + 1);
     723        }
     724    } else {
     725        return false;
     726    }
     727}
     728
    710729?>
  • trunk/wp-admin/edit-page-form.php

    r1633 r1747  
    11
    22<div class="wrap">
    3 
     3<h2><?php _e('New Page'); ?></h2>
    44<?php
    55if (0 == $post_ID) {
     
    3333//-->
    3434</script>
    35 
    36 <div id="poststuff">
    3735    <fieldset id="titlediv">
    38       <legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend>
     36      <legend><?php _e('Page Title') ?></legend>
    3937      <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $edited_post_title; ?>" id="title" /></div>
    4038    </fieldset>
    41 
    42 <br />
     39<fieldset id="commentstatusdiv">
     40      <legend><?php _e('Discussion') ?></legend>
     41      <div><label for="comment_status" class="selectit">
     42          <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($comment_status, 'open'); ?> />
     43         <?php _e('Allow Comments') ?></label>
     44         <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label>
     45    </div>
     46</fieldset>
     47    <fieldset id="postpassworddiv">
     48      <legend><?php _e('Page Password') ?></legend>
     49      <div><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post_password ?>" /></div>
     50    </fieldset>
     51    <fieldset id="pageparent">
     52      <legend><?php _e('Page Parent') ?></a></legend>
     53      <div><select name="parent_id">
     54        <option value='0'>Main Page (no parent)</option>
     55            <?php parent_dropdown(); ?>
     56        </select>
     57      </div>
     58    </fieldset>
    4359<fieldset id="postdiv">
    44     <legend><a href="http://wordpress.org/docs/reference/post/#post" title="<?php _e('Help with page field') ?>"><?php _e('Page') ?></a></legend>
     60    <legend><?php _e('Page Content') ?></legend>
    4561<?php the_quicktags(); ?>
    4662<?php
     
    6177
    6278<p class="submit">
    63   <input name="savepage" type="submit" id="savepage" tabindex="6" style="font-weight: bold;" value="<?php _e('Save') ?>" />
     79  <input name="savepage" type="submit" id="savepage" tabindex="6" value="<?php _e('Create New Page') ?> &raquo;" />
    6480  <input name="referredby" type="hidden" id="referredby" value="<?php if (isset($_SERVER['HTTP_REFERER'])) echo htmlspecialchars($_SERVER['HTTP_REFERER']); ?>" />
    6581</p>
    6682<?php do_action('edit_page_form', ''); ?>
    67 </div>
    6883</form>
    6984
  • trunk/wp-admin/edit-pages.php

    r1551 r1747  
    99?>
    1010
    11 <div class="wrap">
    12     <?php echo "<p> <a href='post.php?action=createpage' title='" . __('Create a new page') . "'>Create New Page</a></p>";  ?>
    13 </div>
     11<div class="wrap">
     12<h2><?php _e('Page Management'); ?></h2>
    1413
    15 <div class="wrap">
    16 <form name="searchform" action="" method="get" style="float: left; width: 20em;">
    17   <fieldset>
    18   <legend><?php _e('Show Pages That Contain...') ?></legend>
    19   <input type="text" name="s" value="<?php if (isset($s)) echo $s; ?>" size="17" />
    20   <input type="submit" name="submit" value="<?php _e('Search') ?>"  />
    21   </fieldset>
    22 </form>
    23 
    24 <br style="clear:both;" />
    25 
    26 <table width="100%" cellpadding="3" cellspacing="3">
    27   <tr>
    28     <th scope="col"><?php _e('ID') ?></th>
    29     <th scope="col"><?php _e('When') ?></th>
    30     <th scope="col"><?php _e('Title') ?></th>
    31     <th scope="col"><?php _e('Author') ?></th>
    32     <th scope="col"></th>
    33     <th scope="col"></th>
    34     <th scope="col"></th>
    35   </tr>
    3614<?php
    37 
    38 include(ABSPATH.'wp-blog-header.php');
    39 
    4015if (isset($user_ID) && ('' != intval($user_ID))) {
    4116    $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_status = 'static' AND post_author = $user_ID");
     
    4520
    4621if ($posts) {
     22?>
     23<table width="100%" cellpadding="3" cellspacing="3">
     24  <tr>
     25    <th scope="col"><?php _e('ID') ?></th>
     26    <th scope="col"><?php _e('Title') ?></th>
     27    <th scope="col"><?php _e('Owner') ?></th>
     28    <th scope="col"><?php _e('Updated') ?></th>
     29    <th scope="col"></th>
     30    <th scope="col"></th>
     31    <th scope="col"></th>
     32  </tr>
     33<?php
    4734$bgcolor = '';
    48 foreach ($posts as $post) { start_wp();
     35foreach ($posts as $post) : start_wp();
    4936$class = ('alternate' == $class) ? '' : 'alternate';
    5037?>
    5138  <tr class='<?php echo $class; ?>'>
    5239    <th scope="row"><?php echo $id ?></th>
    53     <td><?php the_time('Y-m-d \<\b\r \/\> g:i:s a'); ?></td>
    5440    <td>
    5541      <?php the_title() ?>
    5642    </td>
    57     <td><?php the_author() ?></td>
     43    <td><?php the_author() ?></td>
     44    <td><?php the_time('Y-m-d g:i a'); ?></td>
    5845    <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit">View</a></td>
    5946    <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
    6047    <td><?php if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { 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>
    6148  </tr>
     49<?php endforeach; ?>
     50</table>
    6251<?php
    63 }
    6452} else {
    6553?>
    66   <tr style='background-color: <?php echo $bgcolor; ?>'>
    67     <td colspan="8"><?php _e('No pages found.') ?></td>
    68   </tr>
     54<p><?php _e('No pages yet.') ?></p>
    6955<?php
    7056} // end if ($posts)
    7157?>
    72 </table>
     58
     59</div>
     60
    7361<?php
    74 if ( 1 == count($posts) ) {
     62if ($user_level > 0) {
     63    $action = 'post';
     64    get_currentuserinfo();
     65    //set defaults
     66    $post_status = 'static';
     67    $comment_status = get_settings('default_comment_status');
     68    $ping_status = get_settings('default_ping_status');
     69    $post_pingback = get_settings('default_pingback_flag');
    7570
    76     $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id ORDER BY comment_date");
    77     if ($comments) {
    78     ?>
    79 <h3><?php _e('Comments') ?></h3>
    80 <ol id="comments">
    81 <?php
    82 foreach ($comments as $comment) {
    83 $comment_status = wp_get_comment_status($comment->comment_ID);
    84 ?>
     71    include('edit-page-form.php');
     72}
     73?>
    8574
    86 <li <?php if ("unapproved" == $comment_status) echo "class='unapproved'"; ?> >
    87   <?php comment_date('Y-n-j') ?>
    88   @
    89   <?php comment_time('g:m:s a') ?>
    90   <?php
    91             if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) {
    92                 echo "[ <a href=\"post.php?action=editcomment&amp;comment=".$comment->comment_ID."\">" .  __('Edit') . "</a>";
    93                 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> ";
    94                 if ( ('none' != $comment_status) && ($user_level >= 3) ) {
    95                     if ('approved' == wp_get_comment_status($comment->comment_ID)) {
    96                         echo " - <a href=\"post.php?action=unapprovecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\">" . __('Unapprove') . "</a> ";
    97                     } else {
    98                         echo " - <a href=\"post.php?action=approvecomment&amp;p=".$post->ID."&amp;comment=".$comment->comment_ID."\">" . __('Approve') . "</a> ";
    99                     }
    100                 }
    101                 echo "]";
    102             } // end if any comments to show
    103             ?>
    104   <br />
    105   <strong>
    106   <?php comment_author() ?>
    107   (
    108   <?php comment_author_email_link() ?>
    109   /
    110   <?php comment_author_url_link() ?>
    111   )</strong> (IP:
    112   <?php comment_author_IP() ?>
    113   )
    114   <?php comment_text() ?>
    115 
    116 </li>
    117 <!-- /comment -->
    118 <?php //end of the loop, don't delete
    119         } // end foreach
    120     echo '</ol>';
    121     }//end if comments
    122     ?>
    123 <?php } ?>
    124 </div>
    125 <?php
    126  include('admin-footer.php');
    127 ?>
     75<?php include('admin-footer.php'); ?>
  • trunk/wp-admin/post.php

    r1688 r1747  
    692692    do_action('edit_comment', $comment_ID);
    693693    break;
    694 
    695  case 'createpage':
    696     $standalone = 0;
    697     $title = __('Create New Page');
    698     require_once ('./admin-header.php');
    699 
    700     if ($user_level > 0) {
    701         $action = 'post';
    702         get_currentuserinfo();
    703         //set defaults
    704         $post_status = 'static';
    705         $comment_status = get_settings('default_comment_status');
    706         $ping_status = get_settings('default_ping_status');
    707         $post_pingback = get_settings('default_pingback_flag');
    708 
    709         include('edit-page-form.php');
    710     } else {
    711 ?>
    712 <div class="wrap">
    713         <p><?php printf(__('Since you&#8217;re a newcomer, you&#8217;ll have to wait for an admin to raise your level to 1, in order to be authorized to post.<br />
    714 You can also <a href="mailto:%s?subject=Promotion?">e-mail the admin</a> to ask for a promotion.<br />
    715 When you&#8217;re promoted, just reload this page and you&#8217;ll be able to blog. :)'), get_settings('admin_email')); ?>
    716         </p>
    717 </div>
    718 <?php
    719 
    720     }
    721 
    722      break;
    723694
    724695default:
  • trunk/wp-admin/upgrade-schema.php

    r1737 r1747  
    118118  post_parent int(11) NOT NULL default '0',
    119119  guid varchar(255) NOT NULL default '',
     120  menu_order int(11) NOT NULL default '0',
    120121  PRIMARY KEY  (ID),
    121   KEY post_date_gmt (post_date_gmt),
    122122  KEY post_name (post_name),
    123   KEY post_status (post_status)
    124123);
    125124CREATE TABLE $wpdb->users (
  • trunk/wp-admin/wp-admin.css

    r1744 r1747  
    4848fieldset {
    4949    border: 1px solid #ddd;
    50     padding: 2px;
     50    padding: 3px;
     51    -moz-border-radius: 5px;
    5152}
    5253
     
    468469}
    469470
    470 #titlediv, #poststatusdiv, #commentstatusdiv, #slugdiv, #postpassworddiv, #namediv, #uridiv, #emaildiv {
     471#titlediv, #poststatusdiv, #commentstatusdiv, #slugdiv, #postpassworddiv, #namediv, #uridiv, #emaildiv, #pageparent {
    471472    float: left;
    472473    height: 6em;
  • trunk/wp-includes/version.php

    r1600 r1747  
    33// This just holds the version number, in a separate file so we can bump it without cluttering the CVS
    44
    5 $wp_version = '1.3-alpha-3';
     5$wp_version = '1.3-alpha-4';
    66
    77?>
Note: See TracChangeset for help on using the changeset viewer.