Changeset 1360

Show
Ignore:
Timestamp:
07/09/08 10:00:15 (5 months ago)
Author:
donncha
Message:

WP Merge with revision 8300

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/admin-ajax.php

    r1344 r1360  
    3131        check_ajax_referer( "delete-comment_$id" ); 
    3232        if ( !$comment = get_comment( $id ) ) 
    33                 die('0'); 
     33                die('1'); 
    3434        if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) 
    3535                die('-1'); 
    3636 
    37         if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) 
     37        if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) { 
     38                if ( 'spam' == wp_get_comment_status( $comment->comment_ID ) ) 
     39                        die('1'); 
    3840                $r = wp_set_comment_status( $comment->comment_ID, 'spam' ); 
    39         else 
     41        } else { 
    4042                $r = wp_delete_comment( $comment->comment_ID ); 
     43        } 
    4144 
    4245        die( $r ? '1' : '0' ); 
     
    4750                die('-1'); 
    4851 
     52        $cat = get_category( $id ); 
     53        if ( !$cat || is_wp_error( $cat ) ) 
     54                die('1'); 
     55 
    4956        if ( wp_delete_category( $id ) ) 
    5057                die('1'); 
    51         else    die('0'); 
     58        else 
     59                die('0'); 
    5260        break; 
    5361case 'delete-tag' : 
     
    5664                die('-1'); 
    5765 
     66        $tag = get_term( $id, 'post_tag' ); 
     67        if ( !$tag || is_wp_error( $tag ) ) 
     68                die('1'); 
     69 
    5870        if ( wp_delete_term($id, 'post_tag')) 
    5971                die('1'); 
    60         else    die('0'); 
     72        else 
     73                die('0'); 
    6174        break; 
    6275case 'delete-link-cat' : 
     
    6477        if ( !current_user_can( 'manage_categories' ) ) 
    6578                die('-1'); 
     79 
     80        $cat = get_term( $id, 'link_category' ); 
     81        if ( !$cat || is_wp_error( $cat ) ) 
     82                die('1'); 
    6683 
    6784        $cat_name = get_term_field('name', $id, 'link_category'); 
     
    95112                die('-1'); 
    96113 
     114        $link = get_bookmark( $id ); 
     115        if ( !$link || is_wp_error( $link ) ) 
     116                die('1'); 
     117 
    97118        if ( wp_delete_link( $id ) ) 
    98119                die('1'); 
    99         else    die('0'); 
     120        else 
     121                die('0'); 
    100122        break; 
    101123case 'delete-meta' : 
    102124        check_ajax_referer( "delete-meta_$id" ); 
    103125        if ( !$meta = get_post_meta_by_id( $id ) ) 
    104                 die('0'); 
     126                die('1'); 
     127 
    105128        if ( !current_user_can( 'edit_post', $meta->post_id ) ) 
    106129                die('-1'); 
     
    114137                die('-1'); 
    115138 
     139        if ( !get_post( $id ) ) 
     140                die('1'); 
     141 
    116142        if ( wp_delete_post( $id ) ) 
    117143                die('1'); 
     
    124150                die('-1'); 
    125151 
     152        if ( !get_page( $id ) ) 
     153                die('1'); 
     154 
    126155        if ( wp_delete_post( $id ) ) 
    127156                die('1'); 
    128         else    die('0'); 
     157        else 
     158                die('0'); 
    129159        break; 
    130160case 'dim-comment' : 
    131161        if ( !$comment = get_comment( $id ) ) 
    132162                die('0'); 
     163 
    133164        if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) 
    134165                die('-1'); 
     
    136167                die('-1'); 
    137168 
    138         if ( 'unapproved' == wp_get_comment_status($comment->comment_ID) ) { 
     169        $current = wp_get_comment_status( $comment->comment_ID ); 
     170        if ( $_POST['new'] == $current ) 
     171                die('1'); 
     172 
     173        if ( 'unapproved' == $current ) { 
    139174                check_ajax_referer( "approve-comment_$id" ); 
    140175                if ( wp_set_comment_status( $comment->comment_ID, 'approve' ) ) 
  • trunk/wp-admin/css/install.css

    r1218 r1360  
    3838#logo { margin: 6px 0 14px 0px; border-bottom: none;} 
    3939 
    40 .step a, .step input { font-size: 2em; } 
     40.step { 
     41        font-size: 2.2em; 
     42
     43 
     44.step input { font-size: 2em; } 
    4145 
    4246td input { font-size: 1.5em; } 
     
    4650.submit input, .button, .button-secondary { 
    4751        font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; 
    48         padding: 6px; 
    49         border: none
     52        padding: 5px 7px 7px; 
     53        border: 1px solid #a3a3a3
    5054        margin-left: 0; 
    51         font-size: 13px !important; 
    52         -moz-border-radius: 2px; 
    53         -khtml-border-radius: 2px; 
    54         -webkit-border-radius: 2px; 
    55         border-radius: 2px; 
     55        -moz-border-radius: 3px; 
     56        -khtml-border-radius: 3px; 
     57        -webkit-border-radius: 3px; 
     58        border-radius: 3px; 
    5659        color: #246; 
    5760        background: #e5e5e5; 
     
    6467.submit input:hover, .button:hover, .button-secondary:hover { 
    6568        color: #d54e21; 
     69        border-color: #535353; 
    6670} 
    6771 
  • trunk/wp-admin/gears-manifest.php

    r1355 r1360  
    146146{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" }, 
    147147{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" }, 
    148 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311" }, 
     148{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311b" }, 
    149149{ "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" }, 
    150150 
     
    159159{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" }, 
    160160{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" }, 
    161 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311" }, 
     161{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311b" }, 
    162162{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" }, 
    163163{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" }, 
  • trunk/wp-admin/includes/template.php

    r1347 r1360  
    769769 
    770770        if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    771                 $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
    772                 $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
     771                $actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
     772                $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
    773773 
    774774                // we're looking at list of only approved or only unapproved comments 
    775775                if ( 'moderated' == $comment_status ) { 
    776                         $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
     776                        $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 
    777777                        unset($actions['unapprove']); 
    778778                } elseif ( 'approved' == $comment_status ) { 
    779                         $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
     779                        $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 
    780780                        unset($actions['approve']); 
    781781                } 
  • trunk/wp-admin/upgrade.php

    r1328 r1360  
    2626<h2><?php _e('No Upgrade Required'); ?></h2> 
    2727<p><?php _e('Your WordPress database is already up-to-date!'); ?></p> 
    28 <h2 class="step"><a href="<?php echo get_option('home'); ?>/"><?php _e('Continue'); ?></a></h2
     28<p class="step"><a class="button" href="<?php echo get_option('home'); ?>/"><?php _e('Continue'); ?></a></p
    2929 
    3030<?php else : 
     
    3838<p><?php _e('Your WordPress database is out-of-date, and must be upgraded before you can continue.'); ?></p> 
    3939<p><?php _e('The upgrade process may take a while, so please be patient.'); ?></p> 
    40 <h2 class="step"><a href="upgrade.php?step=1&amp;backto=<?php echo $goback; ?>"><?php _e('Upgrade WordPress'); ?></a></h2
     40<p class="step"><a class="button" href="upgrade.php?step=1&amp;backto=<?php echo $goback; ?>"><?php _e('Upgrade WordPress'); ?></a></p
    4141<?php 
    4242                break; 
     
    5858<h2><?php _e('Upgrade Complete'); ?></h2> 
    5959        <p><?php _e('Your WordPress database has been successfully upgraded!'); ?></p> 
    60         <h2 class="step"><a href="<?php echo $backto; ?>"><?php _e('Continue'); ?></a></h2
     60        <p class="step"><a class="button" href="<?php echo $backto; ?>"><?php _e('Continue'); ?></a></p
    6161 
    6262<!-- 
  • trunk/wp-content/themes/classic/style.css

    r1347 r1360  
    323323/* Captions & aligment */ 
    324324.aligncenter, 
    325 dl.aligncenter { 
     325div.aligncenter { 
    326326        display: block; 
    327327        margin-left: auto; 
     
    337337} 
    338338 
    339 .wp_caption { 
     339.wp-caption { 
    340340        border: 1px solid #ddd; 
    341341        text-align: center; 
     
    349349} 
    350350 
    351 .wp_caption img { 
     351.wp-caption img { 
    352352        margin: 0; 
    353353        padding: 0; 
     
    355355} 
    356356 
    357 .wp_caption_dd
     357.wp-caption p.wp-caption-text
    358358        font-size: 11px; 
    359359        line-height: 17px; 
  • trunk/wp-content/themes/default/style.css

    r1347 r1360  
    641641/* Captions */ 
    642642.aligncenter, 
    643 dl.aligncenter { 
     643div.aligncenter { 
    644644        display: block; 
    645645        margin-left: auto; 
     
    647647} 
    648648 
    649 .wp_caption { 
     649.wp-caption { 
    650650        border: 1px solid #ddd; 
    651651        text-align: center; 
     
    659659} 
    660660 
    661 .wp_caption img { 
     661.wp-caption img { 
    662662        margin: 0; 
    663663        padding: 0; 
     
    665665} 
    666666 
    667 .wp_caption_dd
     667.wp-caption p.wp-caption-text
    668668        font-size: 11px; 
    669669        line-height: 17px; 
  • trunk/wp-includes/category-template.php

    r1356 r1360  
    11<?php 
    22 
    3 function get_category_children($id, $before = '/', $after = '') { 
     3function get_category_children($id, $before = '/', $after = '', $visited=array()) { 
    44        if ( 0 == $id ) 
    55                return ''; 
     
    1515                if ( is_wp_error( $category ) ) 
    1616                        return $category; 
    17                 if ( $category->parent == $id ) { 
     17                if ( $category->parent == $id && !in_array($category->term_id, $visited) ) { 
     18                        $visited[] = $category->term_id; 
    1819                        $chain .= $before.$category->term_id.$after; 
    1920                        $chain .= get_category_children($category->term_id, $before, $after); 
     
    4546} 
    4647 
    47 function get_category_parents($id, $link = FALSE, $separator = '/', $nicename = FALSE){ 
     48function get_category_parents($id, $link = FALSE, $separator = '/', $nicename = FALSE, $visited = array()){ 
    4849        $chain = ''; 
    4950        $parent = &get_category($id); 
     
    5657                $name = $parent->cat_name; 
    5758 
    58         if ( $parent->parent && ($parent->parent != $parent->term_id) ) 
    59                 $chain .= get_category_parents($parent->parent, $link, $separator, $nicename); 
     59        if ( $parent->parent && ($parent->parent != $parent->term_id) && !in_array($parent->parent, $visited) ) { 
     60                $visited[] = $parent->parent; 
     61                $chain .= get_category_parents($parent->parent, $link, $separator, $nicename, $visited); 
     62        } 
    6063 
    6164        if ( $link ) 
  • trunk/wp-includes/deprecated.php

    r1218 r1360  
    10651065 * @author Dougal 
    10661066 * @since 1.0.1 
    1067  * @deprecated Use get_categories() 
    1068  * @see get_categories() 
     1067 * @deprecated Use wp_list_bookmarks() 
     1068 * @see wp_list_bookmarks() 
    10691069 * 
    10701070 * @param string $order Sort link categories by 'name' or 'id' 
     
    10721072 */ 
    10731073function get_links_list($order = 'name', $deprecated = '') { 
    1074         _deprecated_function(__FUNCTION__, '0.0', 'get_categories()'); 
     1074        _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()'); 
    10751075 
    10761076        $order = strtolower($order); 
  • trunk/wp-includes/formatting.php

    r1328 r1360  
    44        global $wp_cockneyreplace; 
    55        $next = true; 
     6        $has_pre_parent = false; 
    67        $output = ''; 
    78        $curl = ''; 
     
    2728                $curl = $textarr[$i]; 
    2829 
    29                 if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next) { // If it's not a tag 
     30                if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next && !$has_pre_parent) { // If it's not a tag 
    3031                        // static strings 
    3132                        $curl = str_replace($static_characters, $static_replacements, $curl); 
    3233                        // regular expressions 
    3334                        $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); 
    34                 } elseif (strpos($curl, '<code') !== false || strpos($curl, '<pre') !== false || strpos($curl, '<kbd') !== false || strpos($curl, '<style') !== false || strpos($curl, '<script') !== false) { 
     35                } elseif (strpos($curl, '<code') !== false || strpos($curl, '<kbd') !== false || strpos($curl, '<style') !== false || strpos($curl, '<script') !== false) { 
    3536                        $next = false; 
     37                } elseif (strpos($curl, '<pre') !== false) { 
     38                        $has_pre_parent = true; 
     39                } elseif (strpos($curl, '</pre>') !== false) { 
     40                        $has_pre_parent = false; 
    3641                } else { 
    3742                        $next = true; 
     
    11251130        if ( empty($text) ) return apply_filters('richedit_pre', ''); 
    11261131 
    1127         $output = $text; 
    1128         $output = convert_chars($output); 
     1132        $output = convert_chars($text); 
    11291133        $output = wpautop($output); 
    1130  
    1131         // These must be double-escaped or planets will collide. 
    1132         $output = str_replace('&lt;', '&amp;lt;', $output); 
    1133         $output = str_replace('&gt;', '&amp;gt;', $output); 
    1134  
    1135         // These should be entities too 
    1136         $output = str_replace('<', '&lt;', $output); 
    1137         $output = str_replace('>', '&gt;', $output); 
    1138          
     1134        $output = htmlspecialchars($output, ENT_NOQUOTES); 
     1135 
    11391136        return apply_filters('richedit_pre', $output); 
    11401137} 
  • trunk/wp-includes/js/tinymce/langs/wp-langs.php

    r1347 r1360  
    435435s120:"' . mce_escape( __('120%') ) . '", 
    436436s130:"' . mce_escape( __('130%') ) . '", 
    437 caption:"' . mce_escape( __('Caption') ) . '" 
     437img_title:"' . mce_escape( __('Edit Image Title') ) . '", 
     438caption:"' . mce_escape( __('Edit Image Caption') ) . '" 
    438439}); 
    439440'; 
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css

    r1336 r1360  
    6363} 
    6464 
     65#media-upload #basic th.label { 
     66        padding: 5px 5px 5px 0; 
     67} 
     68 
    6569.show-align { 
    6670        height: 200px; 
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html

    r1344 r1360  
    88<script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script> 
    99 
    10 <link rel="stylesheet" href="css/editimage.css?ver=311" type="text/css" media="all" /> 
     10<link rel="stylesheet" href="css/editimage.css?ver=311b" type="text/css" media="all" /> 
    1111<link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta1" type="text/css" media="all" /> 
    1212<script type="text/javascript"> 
     
    7878                        <th valign="top" scope="row" class="label"> 
    7979                                <label for="img_title"> 
    80                                 <span class="alignleft">{#advanced_dlg.link_titlefield}</span> 
    81                                 <span class="alignright"><abbr title="required" class="required">*</abbr></span> 
     80                                <span class="alignleft">{#wpeditimage.img_title}</span> 
    8281                                </label> 
    8382                        </th> 
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js

    r1355 r1360  
    1616                                        return; 
    1717 
    18                                 tb_show('', url + '/editimage.html?TB_iframe=true'); 
     18                                tb_show('', url + '/editimage.html?ver=311b&TB_iframe=true'); 
    1919                                tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); 
    2020                        }); 
     
    7575                _do_shcode : function(co) { 
    7676                        return co.replace(/\[wp_caption([^\]]+)\]([\s\S]+?)\[\/wp_caption\][\s\u00a0]*/g, function(a,b,c){ 
     77                                b = b.replace(/\\'|\\&#39;|\\&#039;/g, '&#39;').replace(/\\"|\\&quot;/g, '&quot;'); 
     78                                c = c.replace(/\\&#39;|\\&#039;/g, '&#39;').replace(/\\&quot;/g, '&quot;'); 
    7779                                var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/align=['"]([^'"]+)/i); 
    7880                                var w = b.match(/width=['"]([0-9]+)/), cap = b.match(/caption=['"]([^'"]+)/i); 
     
    9294 
    9395                _get_shcode : function(co) { 
    94                         return co.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>([^<]+)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi, function(a,b,c,cap){ 
     96                        return co.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi, function(a,b,c,cap){ 
    9597                                var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/class=['"]([^'"]+)/i); 
    9698                                var w = c.match(/width=['"]([0-9]+)/); 
     
    102104                                if ( ! w || ! cap ) return c; 
    103105                                cls = cls.match(/align[^ '"]+/) || 'alignnone'; 
     106                                cap = cap.replace(/<\S[^<>]*>/gi, '').replace(/'/g, '&#39;').replace(/"/g, '&quot;'); 
    104107 
    105108                                return '[wp_caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/wp_caption]'; 
  • trunk/wp-includes/js/tinymce/tiny_mce_config.php

    r1355 r1360  
    223223if ( $disk_cache ) { 
    224224 
    225         $cacheKey = apply_filters('tiny_mce_version', '20080706'); 
     225        $cacheKey = apply_filters('tiny_mce_version', '20080708'); 
    226226 
    227227        foreach ( $initArray as $v ) 
  • trunk/wp-includes/media.php

    r1355 r1360  
    351351} 
    352352 
    353 add_shortcode('wp_caption', 'wp_caption_shortcode'); 
    354  
    355 function wp_caption_shortcode($attr, $content = null) { 
     353add_shortcode('wp_caption', 'img_caption_shortcode'); 
     354 
     355function img_caption_shortcode($attr, $content = null) { 
    356356         
    357357        // Allow plugins/themes to override the default caption template. 
    358         $output = apply_filters('wp_caption_shortcode', '', $attr, $content); 
     358        $output = apply_filters('img_caption_shortcode', '', $attr, $content); 
    359359        if ( $output != '' ) 
    360360                return $output; 
     
    372372        if ( $id ) $id = 'id="' . $id . '" '; 
    373373         
    374         return '<dl ' . $id . 'class="wp_caption ' . $align . '" style="width: ' . (10 + (int) $width) . 'px">' 
    375         . '<dt class="wp_caption_dt">' . $content . '</dt><dd class="wp_caption_dd">' . $caption . '</dd></dl>'; 
     374        return '<div ' . $id . 'class="wp-caption ' . $align . '" style="width: ' . (10 + (int) $width) . 'px">' 
     375        . $content . '<p class="wp-caption-text">' . $caption . '</p></div>'; 
    376376} 
    377377 
  • trunk/wp-includes/script-loader.php

    r1355 r1360  
    3838 
    3939        // Modify this version when tinyMCE plugins are changed. 
    40         $mce_version = apply_filters('tiny_mce_version', '20080706'); 
     40        $mce_version = apply_filters('tiny_mce_version', '20080708'); 
    4141        $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); 
    4242 
     
    228228        $styles->add( 'widgets', '/wp-admin/css/widgets.css' ); 
    229229        $styles->add( 'dashboard', '/wp-admin/css/dashboard.css' ); 
    230         $styles->add( 'install', '/wp-admin/css/install.css' ); 
     230        $styles->add( 'install', '/wp-admin/css/install.css', array(), '20080708' ); 
    231231        $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css' ); 
    232232        $styles->add( 'press-this', '/wp-admin/css/press-this.css', array(), '20080704' ); 
  • trunk/wp-includes/version.php

    r1358 r1360  
    1818$wp_db_version = 8201; 
    1919 
    20 $wpmu_version = '2.6.beta1'; 
     20$wpmu_version = '2.6-beta1'; 
    2121?>