From 310940b824eff4a116dcd72ccd339bb602021981 Mon Sep 17 00:00:00 2001 From: donncha Date: Tue, 10 Jun 2008 14:08:54 +0000 Subject: Merge with branches/2.5 in WordPress, revision 8066 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1324 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/async-upload.php | 4 +++- wp-admin/comment.php | 4 ---- wp-admin/css/media.css | 20 ++++++++++++++++++++ wp-admin/css/widgets-rtl.css | 9 ++++----- wp-admin/css/widgets.css | 28 ++++++++++------------------ wp-admin/edit-comments.php | 2 +- wp-admin/includes/dashboard.php | 4 +++- wp-admin/includes/media.php | 13 +++++++++---- wp-admin/includes/upgrade.php | 9 +++++++++ wp-admin/includes/widgets.php | 3 ++- wp-admin/js/link.js | 3 +++ wp-admin/js/media-upload.js | 35 +++++++++++++++++++++++++++++++---- wp-admin/js/widgets.js | 8 ++++---- wp-admin/media.php | 2 +- wp-admin/menu.php | 2 +- wp-admin/plugins.php | 4 ++-- wp-admin/update.php | 2 +- wp-admin/user-edit.php | 2 +- wp-admin/widgets.php | 2 ++ 19 files changed, 107 insertions(+), 49 deletions(-) (limited to 'wp-admin') diff --git a/wp-admin/async-upload.php b/wp-admin/async-upload.php index 1a37dce..c1c0f0d 100644 --- a/wp-admin/async-upload.php +++ b/wp-admin/async-upload.php @@ -15,7 +15,7 @@ if ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) unset($current_user); require_once('admin.php'); -header('Content-Type: text/plain'); +header('Content-Type: text/plain; charset=' . get_option('blog_charset')); if ( !current_user_can('upload_files') ) wp_die(__('You do not have permission to upload files.')); @@ -26,6 +26,8 @@ if ( ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) { exit; } +check_admin_referer('media-form'); + $id = media_handle_upload('async-upload', $_REQUEST['post_id']); if (is_wp_error($id)) { echo '
'.wp_specialchars($id->get_error_message()).'
'; diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 6691456..4aa9749 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -193,10 +193,6 @@ case 'approvecomment' : wp_set_comment_status( $comment->comment_ID, 'approve' ); - if ( true == get_option('comments_notify') ) - wp_notify_postauthor( $comment->comment_ID ); - - if ( '' != wp_get_referer() && false == $noredir ) wp_redirect( wp_get_referer() ); else diff --git a/wp-admin/css/media.css b/wp-admin/css/media.css index c77a069..7d46c1c 100644 --- a/wp-admin/css/media.css +++ b/wp-admin/css/media.css @@ -196,6 +196,11 @@ abbr.required { #media-upload .media-upload-form p { margin: 0 1em 1em 0; } + +#media-upload .media-upload-form p.ml-submit { + padding: 1em 0; +} + #media-upload p.help { font-style: italic; font-weight: normal; @@ -240,3 +245,18 @@ abbr.required { margin-bottom: 1em; height: 3em; } + +#media-upload #filter { + width: 623px; +} + +#media-upload #filter .subsubsub { + margin: 8px 0; +} + +#filter .tablenav select { + border-style:solid; + border-width:1px; + padding:2px; + vertical-align:top; +} diff --git a/wp-admin/css/widgets-rtl.css b/wp-admin/css/widgets-rtl.css index 89ff4b6..ece02b5 100644 --- a/wp-admin/css/widgets-rtl.css +++ b/wp-admin/css/widgets-rtl.css @@ -38,13 +38,12 @@ li.widget-list-control-item h4.widget-title a, #dragHelper li.widget-list-contro left:1em; } -li.widget-list-control-item div.widget-control { - padding:0 0 0 10px; -} ul.widget-control-list div.widget-control-actions { margin-right:0; margin-left:-10px; } -ul.widget-control-list .widget-title { - text-align:right; +ul.widget-control-list h4.widget-title, +#dragHelper h4.widget-title { + text-align: right; + padding: 0.4em 0.8em 0.4em 2.5em; } diff --git a/wp-admin/css/widgets.css b/wp-admin/css/widgets.css index 5d044cf..baeb851 100644 --- a/wp-admin/css/widgets.css +++ b/wp-admin/css/widgets.css @@ -74,7 +74,6 @@ ul#widget-list li.widget-list-item div.widget-description { font-size: 11px; } - ul#widget-list li.widget-list-item ul.widget-control-info { display: none; } @@ -91,27 +90,26 @@ ul.widget-control-list { padding: 0 1em; } -ul.widget-control-list li { - position: relative; -} - div#current-widgets p.submit { padding: 1em; } li.widget-list-control-item { - margin: 0 0 1em; + margin: 1em 0; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } -li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4, li.widget-sortable h4 { +li.widget-list-control-item h4, +#dragHelper li.widget-list-control-item h4, +li.widget-sortable h4 { margin: 0; - padding: 0.4em 2.5em 0.4em 0.8em; cursor: move; font-size: 13px; + padding: 0.4em 2.5em 0.4em 0.8em; + position: relative; -moz-border-radius: 3px; -khtml-border-radius: 3px; -webkit-border-radius: 3px; @@ -143,16 +141,16 @@ li.widget-list-control-item h4.widget-title a, } li.widget-list-control-item h4.widget-title a:hover { - text-decoration: none; border-bottom: none; } li.widget-list-control-item div.widget-control { display: none; - margin: 1em; - padding: 0 10px 0 7px; /* Correction for padding, margin, border of inputs */ + padding: 15px; font-size: 11px; + position: relative; + background-color: #CFEBF7; } li.widget-list-control-item div.widget-control p { @@ -161,15 +159,9 @@ li.widget-list-control-item div.widget-control p { } ul.widget-control-list div.widget-control-actions { - margin-right: -10px; /* Correction for padding, margin, border of inputs */ - margin-left: -6px; border-top-width: 1px; border-top-style: solid; - padding: 0.5em 0 0.8em; -} - -ul.widget-control-list .widget-title { - + padding: 0.5em 0 0; } .widget-control-edit { diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index bc62681..c756efe 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -97,7 +97,7 @@ if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['sp sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', $num_comments->moderated), "$num_comments->moderated"), 'approved' => _c('Approved|plural')); +$stati = array('moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments->moderated) ), "" . number_format_i18n($num_comments->moderated) . ""), 'approved' => _c('Approved|plural')); $class = ( '' === $comment_status ) ? ' class="current"' : ''; $status_links[] = "
  • ".__('Show All Comments').""; foreach ( $stati as $status => $label ) { diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index ea88ee4..97fd26a 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -23,7 +23,9 @@ function wp_dashboard_setup() { /* Register Widgets and Controls */ // Recent Comments Widget - if ( current_user_can( 'moderate_comments' ) && $mod_comments = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'") ) { + $mod_comments = wp_count_comments(); + $mod_comments = $mod_comments->moderated; + if ( current_user_can( 'moderate_comments' ) && $mod_comments ) { $notice = sprintf( __ngettext( '%d comment awaiting moderation', '%d comments awaiting moderation', $mod_comments ), $mod_comments ); $notice = "$notice"; } else { diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index be70d92..0fb84bb 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -55,7 +55,7 @@ function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = fal $rel = $rel ? ' rel="attachment wp-att-'.attribute_escape($id).'"' : ''; if ( $url ) - $html = "$html"; + $html = '$html"; $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size ); @@ -180,7 +180,7 @@ add_action( 'media_buttons', 'media_buttons' ); function media_buttons_head() { $siteurl = get_option('siteurl'); echo "\n"; } @@ -791,6 +794,7 @@ jQuery(function($){ post_params : { "post_id" : "", "auth_cookie" : "", + "_wpnonce" : "", "type" : "", "tab" : "", "short" : "1" @@ -815,6 +819,7 @@ jQuery(function($){ //--> +

    @@ -959,7 +964,6 @@ function media_upload_library_form($errors) {
    -

    -

    @@ -1066,8 +1069,10 @@ jQuery(function($){
    +

    +

    flush_rules(); @@ -747,6 +750,12 @@ function upgrade_251() { update_option('secret', wp_generate_password(64)); } +function upgrade_252() { + global $wpdb; + + $wpdb->query("UPDATE $wpdb->users SET user_activation_key = ''"); +} + // The functions we use to actually do stuff // General diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php index 641f80f..09936b7 100644 --- a/wp-admin/includes/widgets.php +++ b/wp-admin/includes/widgets.php @@ -227,6 +227,7 @@ function wp_widget_control( $sidebar_args ) { if ( empty($sidebar_args['_display']) || 'template' != $sidebar_args['_display'] ) echo $sidebar_args['before_widget']; ?> +

    @@ -239,7 +240,7 @@ function wp_widget_control( $sidebar_args ) { -

    +
    > diff --git a/wp-admin/js/link.js b/wp-admin/js/link.js index cfc0f94..2b3fa65 100644 --- a/wp-admin/js/link.js +++ b/wp-admin/js/link.js @@ -1,4 +1,7 @@ jQuery(document).ready( function() { + // close postboxes that should be closed + jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); + jQuery('#link_name').focus(); // postboxes add_postbox_toggles('link'); diff --git a/wp-admin/js/media-upload.js b/wp-admin/js/media-upload.js index b8c615d..506faf8 100644 --- a/wp-admin/js/media-upload.js +++ b/wp-admin/js/media-upload.js @@ -1,12 +1,39 @@ // send html to the post editor function send_to_editor(h) { - var win = window.opener ? window.opener : window.dialogArguments; - if ( !win ) - win = top; + var win = window.dialogArguments || opener || parent || top; + tinyMCE = win.tinyMCE; if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.getInstanceById('content') ) && !ed.isHidden() ) { tinyMCE.selectedInstance.getWin().focus(); tinyMCE.execCommand('mceInsertContent', false, h); } else win.edInsertContent(win.edCanvas, h); -} \ No newline at end of file +} + +// thickbox settings +jQuery(function($) { + tb_position = function() { + var tbWindow = $('#TB_window'); + var width = $(window).width(); + var H = $(window).height(); + var W = ( 720 < width ) ? 720 : width; + + if ( tbWindow.size() ) { + tbWindow.width( W - 50 ).height( H - 45 ); + $('#TB_iframeContent').width( W - 50 ).height( H - 75 ); + tbWindow.css({marginLeft: '-' + parseInt((( W - 50 ) / 2),10) + 'px'}); + }; + + return $('a.thickbox').each( function() { + var href = $(this).attr('href'); + if ( ! href ) return; + href = href.replace(/&width=[0-9]+/g, ''); + href = href.replace(/&height=[0-9]+/g, ''); + $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) ); + }); + }; + + $(window).resize( function() { tb_position() } ); + $(document).ready( function() { tb_position() } ); +}); + diff --git a/wp-admin/js/widgets.js b/wp-admin/js/widgets.js index 4eb37ee..b42812f 100644 --- a/wp-admin/js/widgets.js +++ b/wp-admin/js/widgets.js @@ -13,12 +13,12 @@ jQuery(function($) { if ( t.is(':visible') ) { if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); } li.css( 'marginLeft', 0 ); - t.siblings('h4').children('a').text( widgetsL10n.edit ); + t.siblings('div').children('h4').children('a').text( widgetsL10n.edit ); } else { t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open if ( width > 250 ) li.css( 'marginLeft', ( width - 250 ) * -1 ); - t.siblings('h4').children('a').text( widgetsL10n.cancel ); + t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel ); } t.toggle(); } : function() { @@ -28,12 +28,12 @@ jQuery(function($) { if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); } if ( width > 250 ) li.animate( { marginLeft: 0 } ); - t.siblings('h4').children('a').text( widgetsL10n.edit ); + t.siblings('div').children('h4').children('a').text( widgetsL10n.edit ); } else { t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open if ( width > 250 ) li.animate( { marginLeft: ( width - 250 ) * -1 } ); - t.siblings('h4').children('a').text( widgetsL10n.cancel ); + t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel ); } t.animate( { height: 'toggle' } ); }; diff --git a/wp-admin/media.php b/wp-admin/media.php index 2508810..03b3749 100644 --- a/wp-admin/media.php +++ b/wp-admin/media.php @@ -92,7 +92,7 @@ case 'edit' :

    - +
    diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 3db528f..81f9b33 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -23,7 +23,7 @@ else $awaiting_mod = wp_count_comments(); $awaiting_mod = $awaiting_mod->moderated; $menu[15] = array(__('Design'), 'switch_themes', 'themes.php'); -$menu[20] = array( sprintf( __('Comments %s'), "$awaiting_mod" ), 'edit_posts', 'edit-comments.php'); +$menu[20] = array( sprintf( __('Comments %s'), "" . number_format_i18n($awaiting_mod) . "" ), 'edit_posts', 'edit-comments.php'); $menu[30] = array(__('Settings'), 'manage_options', 'options-general.php'); $menu[35] = array(__('Plugins'), 'activate_plugins', 'plugins.php'); if ( current_user_can('edit_users') ) diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php index 1cd1a89..8e6b707 100644 --- a/wp-admin/plugins.php +++ b/wp-admin/plugins.php @@ -93,11 +93,11 @@ if (empty($plugins)) { $inactive = get_option('deactivated_plugins'); if ( !empty($active) ) { ?> - + - + diff --git a/wp-admin/update.php b/wp-admin/update.php index 34e9380..be95102 100644 --- a/wp-admin/update.php +++ b/wp-admin/update.php @@ -22,7 +22,7 @@ function request_filesystem_credentials($form_post, $type = '', $error = false) $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? $_POST['hostname'] : $credentials['hostname']); $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username'] : $credentials['username']); $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password'] : $credentials['password']); - $credentials['ssl'] = defined('FTP_SSL') ? FTP_SSL : (!empty($_POST['ssl']) ? $_POST['ssl'] : $credentials['ssl']); + $credentials['ssl'] = defined('FTP_SSL') ? FTP_SSL : ( isset($_POST['ssl']) ? $_POST['ssl'] : $credentials['ssl']); if ( ! $error && !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) { $stored_credentials = $credentials; diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index 8ee9c05..b01c3a8 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -171,7 +171,7 @@ include ('admin-header.php'); $color_info ): ?> diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php index 83264e4..5e4659e 100644 --- a/wp-admin/widgets.php +++ b/wp-admin/widgets.php @@ -134,7 +134,9 @@ if ( isset($_GET['add']) && $_GET['add'] ) {
    • +

      +