Changeset 1328

Show
Ignore:
Timestamp:
06/13/08 17:21:00 (3 months ago)
Author:
donncha
Message:

WP Merge with revision 8075

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/index.php

    r810 r1328  
    11<?php 
    2 /* Short and sweet */ 
     2/** 
     3 * Front to the WordPress application. This file doesn't do anything, but loads 
     4 * wp-blog-header.php which does and tells WordPress to load the theme. 
     5 * 
     6 * @package WordPress 
     7 */ 
     8 
     9/** 
     10 * Tells WordPress to load the WordPress theme and output it. 
     11 * 
     12 * @var bool 
     13 */ 
    314define('WP_USE_THEMES', true); 
     15 
     16/** Loads the WordPress Environment and Template */ 
    417require('./wp-blog-header.php'); 
    518?> 
  • trunk/wp-activate.php

    r1327 r1328  
    11<?php 
    22define( "WP_INSTALLING", true ); 
    3 require ('wp-config.php'); 
     3 
     4/** Sets up the WordPress Environment. */ 
     5require( dirname(__FILE__) . '/wp-load.php' ); 
     6 
    47require( 'wp-blog-header.php' ); 
    58require_once( ABSPATH . WPINC . '/registration.php'); 
  • trunk/wp-admin/admin-ajax.php

    r1299 r1328  
    22define('DOING_AJAX', true); 
    33 
    4 require_once('../wp-config.php'); 
     4require_once('../wp-load.php'); 
    55require_once('includes/admin.php'); 
    66 
     
    1616        if ( strstr( $s, ',' ) ) 
    1717                die; // it's a multiple tag insert, we won't find anything 
    18         $results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%$s%')" ); 
     18        $results = $wpdb->get_col( $wpdb->prepare("SELECT name FROM $wpdb->terms WHERE name LIKE (%s)", '%' . $s . '%') ); 
    1919        echo join( $results, "\n" ); 
    2020        die; 
     
    463463        break; 
    464464case 'autosave' : // The name of this action is hardcoded in edit_post() 
    465         $nonce_age = check_ajax_referer( 'autosave', 'autosavenonce'); 
     465        define( 'DOING_AUTOSAVE', true ); 
     466 
     467        $nonce_age = check_ajax_referer( 'autosave', 'autosavenonce' ); 
    466468        global $current_user; 
    467469 
    468         $_POST['post_status'] = 'draft'; 
    469470        $_POST['post_category'] = explode(",", $_POST['catslist']); 
    470471        $_POST['tags_input'] = explode(",", $_POST['tags_input']); 
     
    480481        $supplemental = array(); 
    481482 
    482         $id = 0; 
     483        $id = $revision_id = 0; 
    483484        if($_POST['post_ID'] < 0) { 
     485                $_POST['post_status'] = 'draft'; 
    484486                $_POST['temp_ID'] = $_POST['post_ID']; 
    485487                if ( $do_autosave ) { 
     
    512514                                die(__('You are not allowed to edit this post.')); 
    513515                } 
     516 
    514517                if ( $do_autosave ) { 
    515                         $id = edit_post(); 
     518                        // Drafts are just overwritten by autosave 
     519                        if ( 'draft' == $post->post_status ) { 
     520                                $id = edit_post(); 
     521                        } else { // Non drafts are not overwritten.  The autosave is stored in a special post revision. 
     522                                $revision_id = wp_create_post_autosave( $post->ID ); 
     523                                if ( is_wp_error($revision_id) ) 
     524                                        $id = $revision_id; 
     525                                else 
     526                                        $id = $post->ID; 
     527                        } 
    516528                        $data = $message; 
    517529                } else { 
  • trunk/wp-admin/admin-header.php

    r1218 r1328  
    66                wp_enqueue_script( 'wp_tiny_mce' ); 
    77} 
     8wp_enqueue_script( 'wp-gears' ); 
    89 
    910$min_width_pages = array( 'post.php', 'post-new.php', 'page.php', 'page-new.php', 'widgets.php', 'comment.php', 'link.php' ); 
     
    2930<title><?php bloginfo('name') ?> &rsaquo; <?php echo wp_specialchars( strip_tags( $title ) ); ?> &#8212; WordPress</title> 
    3031<?php 
     32 
    3133wp_admin_css( 'css/global' ); 
    3234wp_admin_css(); 
    3335wp_admin_css( 'css/colors' ); 
     36wp_admin_css( 'css/ie' ); 
     37 
    3438?> 
    35 <!--[if gte IE 6]> 
    36 <?php wp_admin_css( 'css/ie' ); 
    37 ?> 
    38 <![endif]--> 
    3939<script type="text/javascript"> 
    4040//<![CDATA[ 
     
    4545<style type="text/css">* html { overflow-x: hidden; }</style> 
    4646<?php endif; 
    47 if ( isset($page_hook) ) 
    48         do_action('admin_print_scripts-' . $page_hook); 
    49 else if ( isset($plugin_page) ) 
    50         do_action('admin_print_scripts-' . $plugin_page); 
    51 do_action('admin_print_scripts'); 
     47 
     48$hook_suffixes = array(); 
    5249 
    5350if ( isset($page_hook) ) 
    54         do_action('admin_head-' . $page_hook)
     51        $hook_suffixes[] = "-$page_hook"
    5552else if ( isset($plugin_page) ) 
    56         do_action('admin_head-' . $plugin_page); 
    57 do_action('admin_head'); 
     53        $hook_suffixes[] = "-$plugin_page"; 
     54else if ( isset($pagenow) ) 
     55        $hook_suffixes[] = "-$pagenow"; 
     56 
     57$hook_suffixes[] = ''; 
     58 
     59foreach ( $hook_suffixes as $hook_suffix ) 
     60        do_action("admin_print_styles$hook_suffix"); // do_action( 'admin_print_styles-XXX' ); do_action( 'admin_print_styles' ); 
     61foreach ( $hook_suffixes as $hook_suffix ) 
     62        do_action("admin_print_scripts$hook_suffix"); // do_action( 'admin_print_scripts-XXX' ); do_action( 'admin_print_scripts' ); 
     63foreach ( $hook_suffixes as $hook_suffix ) 
     64        do_action("admin_head$hook_suffix"); // do_action( 'admin_head-XXX' ); do_action( 'admin_head' ); 
     65unset($hook_suffixes, $hook_suffix); 
     66 
    5867?> 
    5968</head> 
     
    6271<div id="wpcontent"> 
    6372<div id="wphead"> 
    64 <h1><?php bloginfo('name'); ?><span id="viewsite"><a href="<?php echo trailingslashit( get_option('home') ); ?>"><?php _e('Visit Site') ?></a></span></h1> 
     73<h1><?php if ( '' == get_bloginfo('name') ) echo '&nbsp;'; else echo get_bloginfo('name'); ?><span id="viewsite"><a href="<?php echo trailingslashit( get_option('home') ); ?>"><?php _e('Visit Site') ?></a></span></h1> 
    6574</div> 
    66 <div id="user_info"><p><?php printf(__('Howdy, <a href="%1$s">%2$s</a>!'), 'profile.php', $user_identity) ?> | <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a> | <?php _e('<a href="http://codex.wordpress.org/">Help</a>') ?> | <?php _e('<a href="http://wordpress.org/support/">Forums</a>') ?></p></div> 
     75 
     76<?php 
     77$gears_compat = false; 
     78 
     79if ( ($is_gecko || $is_winIE) && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'webkit') === false ) {  
     80        $gears_compat = true; 
     81?> 
     82        <div id="gears-info-box" class="info-box" style="display:none;"> 
     83        <img src="images/gear.png" title="Gear" alt="" class="gears-img" /> 
     84        <div id="gears-msg1"> 
     85        <h3 class="info-box-title"><?php _e('Speed up WordPress'); ?></h3> 
     86        <p><?php _e('WordPress has support for Gears that adds new features to your web browser.'); ?><br /> 
     87        <a href="http://gears.google.com/" target="_blank" style="font-weight:normal;"><?php _e('More information...'); ?></a></p> 
     88        <p><?php _e('After installing and enabling it, most of the WordPress images, scripts and CSS files will be stored on this computer. This will speed up page loading.'); ?></p> 
     89        <p><strong><?php _e('Please make sure you are not using a public or shared computer.'); ?></strong></p> 
     90        <div class="submit"><button onclick="window.location = 'http://gears.google.com/?action=install&amp;return=<?php echo urlencode( admin_url() ); ?>';" class="button"><?php _e('Install Now'); ?></button> 
     91        <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';">Cancel</button></div> 
     92        </div> 
     93 
     94        <div id="gears-msg2" style="display:none;"> 
     95        <h3 class="info-box-title"><?php _e('Gears Status'); ?></h3> 
     96        <p><?php _e('Gears is installed on this computer but is not enabled for use with WordPress.'); ?></p>  
     97        <p><?php _e('To enable it, make sure this web site is not on the denied list in Gears Settings under your browser\'s Tools menu, then click the button below.'); ?></p> 
     98        <p><strong><?php _e('However if this is a public or shared computer, Gears should not be enabled.'); ?></strong></p> 
     99        <div class="submit"><button class="button" onclick="wpGears.getPermission();"><?php _e('Enable Gears'); ?></button> 
     100        <button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';">Cancel</button></div> 
     101        </div> 
     102 
     103        <div id="gears-msg3" style="display:none;"> 
     104        <h3 class="info-box-title"><?php _e('Gears Status'); ?></h3> 
     105        <p><?php _e('Gears is installed and enabled on this computer. You can disable it from your browser Tools menu.'); ?></p> 
     106        <p><?php _e('If there are any errors, try disabling Gears, then reload the page and enable it again.'); ?></p> 
     107        <p><?php _e('Local storage status:'); ?> <span id="gears-wait"><span style="color:#f00;"><?php _e('Please wait! Updating files:'); ?></span> <span id="gears-upd-number"></span></span></p> 
     108        <div class="submit"><button class="button" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Close'); ?></button></div> 
     109        </div> 
     110        </div> 
     111 
     112<?php } ?> 
     113 
     114<div id="user_info"><p><?php printf(__('Howdy, <a href="%1$s">%2$s</a>!'), 'profile.php', $user_identity) ?> | <a href="<?php echo site_url('wp-login.php?action=logout', 'login') ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a> | <?php _e('<a href="http://codex.wordpress.org/">Help</a>') ?> | <?php _e('<a href="http://wordpress.org/support/">Forums</a>') ?> | <?php if ( $gears_compat ) { ?><span id="gears-menu"><a href="#" onclick="wpGears.message(1);return false;"><?php _e('Speed up!') ?></a></span><?php } ?></p></div> 
    67115 
    68116<?php 
  • trunk/wp-admin/admin.php

    r1293 r1328  
    33 
    44if ( defined('ABSPATH') ) 
    5         require_once( ABSPATH . 'wp-config.php'); 
     5        require_once(ABSPATH . 'wp-load.php'); 
    66else 
    7     require_once('../wp-config.php'); 
     7       require_once('../wp-load.php'); 
    88 
    99if ( get_option('db_version') != $wp_db_version ) { 
     
    2828wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback')); 
    2929 
    30 wp_admin_css_color('classic', __('Classic'), get_option( 'siteurl' ) . "/wp-admin/css/colors-classic.css", array('#07273E', '#14568A', '#D54E21', '#2683AE')); 
    31 wp_admin_css_color('fresh', __('Fresh'), get_option( 'siteurl' ) . "/wp-admin/css/colors-fresh.css", array('#464646', '#CEE1EF', '#D54E21', '#2683AE')); 
     30wp_admin_css_color('classic', __('Classic'), admin_url("css/colors-classic.css"), array('#07273E', '#14568A', '#D54E21', '#2683AE')); 
     31wp_admin_css_color('fresh', __('Fresh'), admin_url("css/colors-fresh.css"), array('#464646', '#CEE1EF', '#D54E21', '#2683AE')); 
    3232 
    3333wp_enqueue_script( 'common' ); 
  • trunk/wp-admin/async-upload.php

    r1324 r1328  
    66 
    77if ( defined('ABSPATH') ) 
    8         require_once( ABSPATH . 'wp-config.php'); 
     8        require_once(ABSPATH . 'wp-load.php'); 
    99else 
    10     require_once('../wp-config.php'); 
     10       require_once('../wp-load.php'); 
    1111 
    1212// Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead 
  • trunk/wp-admin/categories.php

    r1218 r1328  
    127127 
    128128<p id="post-search"> 
     129        <label class="hidden" for="post-search-input"><?php _e('Search Categories'); ?>:</label> 
    129130        <input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" /> 
    130131        <input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" /> 
     
    148149        <thead> 
    149150        <tr> 
    150                 <th scope="col" class="check-column"><input type="checkbox" onclick="checkAll(document.getElementById('posts-filter'));" /></th> 
     151                <th scope="col" class="check-column"><input type="checkbox" /></th> 
    151152        <th scope="col"><?php _e('Name') ?></th> 
    152153        <th scope="col"><?php _e('Description') ?></th> 
  • trunk/wp-admin/comment.php

    r1324 r1328  
    2222 
    2323        wp_enqueue_script('comment'); 
    24         //wp_enqueue_script('thickbox'); 
     24 
    2525        require_once('admin-header.php'); 
    2626 
     
    7979<table width="100%"> 
    8080<tr> 
    81 <td><input type='button' class="button" value='<?php _e('No'); ?>' onclick="self.location='<?php echo get_option('siteurl'); ?>/wp-admin/edit-comments.php';" /></td> 
     81<td><input type='button' class="button" value='<?php _e('No'); ?>' onclick="self.location='<?php echo admin_url('edit-comments.php'); ?>" /></td> 
    8282<td class="textright"><input type='submit' class="button" value='<?php echo $button; ?>' /></td> 
    8383</tr> 
     
    147147                wp_redirect( wp_get_original_referer() ); 
    148148        else 
    149                 wp_redirect( get_option('siteurl') . '/wp-admin/edit-comments.php' ); 
     149                wp_redirect( admin_url('edit-comments.php') ); 
    150150 
    151151        die; 
     
    172172                wp_redirect( wp_get_referer() ); 
    173173        else 
    174                 wp_redirect( get_option('siteurl') . '/wp-admin/edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments' ); 
     174                wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') ); 
    175175 
    176176        exit(); 
     
    197197                wp_redirect( wp_get_referer() ); 
    198198        else 
    199                 wp_redirect( get_option('siteurl') . '/wp-admin/edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments' ); 
     199                wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') ); 
    200200 
    201201        exit(); 
  • trunk/wp-admin/css/colors-classic.css

    r1266 r1328  
    33} 
    44 
    5 body   
     5body, .form-table .pre
    66        background-color: #fff; 
    77        color: #333; 
     
    3838} 
    3939 
    40 ul#category-tabs li.ui-tabs-selected, li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form
     40ul#category-tabs li.ui-tabs-selected, li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form, h3.info-box-title
    4141        background-color: #cfebf7; 
    4242} 
     
    6464} 
    6565 
    66 ul.widget-control-list .sorthelper { 
     66.sorthelper { 
    6767        background-color: #ccf3fa; 
    6868} 
     
    205205} 
    206206 
    207 .submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover
     207.submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover, #media-upload a.del-link:hover
    208208        color: #d54e21; 
    209209} 
    210210 
    211 #adminmenu a:hover, #sidemenu a:hover
     211#adminmenu a:hover, #sidemenu a:hover, .ui-tabs-nav a:hover
    212212        color: #97c4d8; 
    213213} 
     
    240240} 
    241241 
    242 .submitbox .submitdelete:hover { 
     242.submitbox .submitdelete:hover, 
     243#media-upload a.delete:hover { 
    243244        color: #fff; 
    244245        background-color: #f00; 
     
    292293} 
    293294 
    294 #poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, a { 
     295#poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, #media-upload a.del-link, #media-upload a.delete, a { 
    295296        color: #2e7ca0; 
    296297} 
    297298 
    298 #adminmenu a
     299#adminmenu a, .ui-tabs-nav a
    299300        color: #cfebf6; 
    300301} 
     
    304305} 
    305306/* Because we don't want visited on these links */ 
    306 #adminmenu a.current, #sidemenu a.current
     307#adminmenu a.current, #sidemenu a.current, body.press-this .ui-tabs-selected a, body.press-this .ui-tabs-selected a:hover
    307308        background-color: #fff; 
    308309        border-color: #07273e; 
     
    415416} 
    416417 
    417 #plugins .active { 
     418.plugins .active { 
    418419        background-color: #BBEEBB; 
    419420} 
    420421 
    421 #plugins .togl { 
     422.plugins .togl { 
    422423        border-right-color: #ccc; 
    423424} 
     
    427428} 
    428429 
    429 #plugins tr { 
     430.plugins tr { 
    430431        background-color: #fff; 
    431432} 
     
    550551        color: #f00; 
    551552} 
    552  
    553 #media-upload a.delete {  
    554         color: #888;  
    555 } 
    556  
    557553 
    558554/* TinyMCE */ 
     
    566562 
    567563/* Containers */ 
    568 .wp_themeSkin table
     564.wp_themeSkin table, #wp_editbtns
    569565        background: #83B4D5; 
    570566} 
     
    718714        color: #333; 
    719715} 
     716 
     717/* Diff */ 
     718 
     719table.diff .diff-deletedline { 
     720        background-color: #ffdddd; 
     721} 
     722table.diff .diff-deletedline del { 
     723        background-color: #ff9999; 
     724} 
     725table.diff .diff-addedline { 
     726        background-color: #ddffdd; 
     727} 
     728table.diff .diff-addedline ins { 
     729        background-color: #99ff99; 
     730} 
  • trunk/wp-admin/css/colors-fresh.css

    r1266 r1328  
    33} 
    44 
    5 body   
     5body, .form-table .pre
    66        background-color: #fff; 
    77        color: #333; 
     
    4242} 
    4343 
    44 li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form
     44li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form, h3.info-box-title
    4545        background-color: #eaf3fa; 
    4646} 
     
    6464} 
    6565 
    66 ul.widget-control-list .sorthelper { 
     66.sorthelper { 
    6767        background-color: #ccf3fa; 
    6868} 
     
    197197} 
    198198 
    199 .submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #adminmenu a:hover, #sidemenu a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rig