diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-12-07 10:17:25 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-12-07 10:17:25 +0000 |
commit | e7b243973132b555e66a0517e25232ba213bc35e (patch) | |
tree | ff9d04034493cc544d1064e56a1c8b8265d63b3f | |
parent | f57c5009b529dcc2494fc719f605ef64b7f9b4c7 (diff) | |
download | wordpress-mu-e7b243973132b555e66a0517e25232ba213bc35e.tar.gz wordpress-mu-e7b243973132b555e66a0517e25232ba213bc35e.tar.xz wordpress-mu-e7b243973132b555e66a0517e25232ba213bc35e.zip |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@819 7be80a69-a1ef-0310-a953-fb0f7c49ff36
42 files changed, 326 insertions, 197 deletions
diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index c5d48b9..67fe5a9 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -147,7 +147,7 @@ case 'add-cat' : // From Manage->Categories 'what' => 'cat', 'id' => $cat->cat_ID, 'data' => _cat_row( $cat, $level, $cat_full_name ), - 'supplemental' => array('name' => $cat_full_name) + 'supplemental' => array('name' => $cat_full_name, 'show-link' => sprintf(__( 'Category <a href="#%s">%s</a> added' ), "cat-$cat->cat_ID", $cat_full_name)) ) ); $x->send(); break; @@ -211,10 +211,12 @@ case 'add-user' : echo "<p>$message<p>"; exit; } + $user_object = new WP_User( $user_id ); $x = new WP_Ajax_Response( array( 'what' => 'user', 'id' => $user_id, - 'data' => user_row( $user_id ) + 'data' => user_row( $user_object ), + 'supplemental' => array('show-link' => sprintf(__( 'User <a href="#%s">%s</a> added' ), "user-$user_id", $user_object->user_login)) ) ); $x->send(); break; diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 624b693..160dcc7 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -722,6 +722,7 @@ function cat_rows( $parent = 0, $level = 0, $categories = 0 ) { $categories = get_categories( 'hide_empty=0' ); if ( $categories ) { + ob_start(); foreach ( $categories as $category ) { if ( $category->cat_ID == 0 ) { // HACK, added 2006-05-13 $wpdb->query("DELETE FROM $wpdb->categories WHERE cat_ID = 0"); @@ -732,6 +733,12 @@ function cat_rows( $parent = 0, $level = 0, $categories = 0 ) { cat_rows( $category->cat_ID, $level +1, $categories ); } } + $output = ob_get_contents(); + ob_end_clean(); + + $output = apply_filters('cat_rows', $output); + + echo $output; } else { return false; } @@ -826,11 +833,13 @@ function user_row( $user_object, $style = '' ) { if ( $numposts > 0 ) { $r .= "<a href='edit.php?author=$user_object->ID' title='" . __( 'View posts by this author' ) . "' class='edit'>"; $r .= sprintf( __('View %1$s %2$s' ), $numposts, __ngettext( 'post', 'posts', $numposts )); + $r .= '</a>'; } $r .= "</td>\n\t\t<td>"; - $edit_link = add_query_arg( 'wp_http_referer', wp_specialchars( urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$user_object->ID" ); - if ( ( is_site_admin() || $current_user->ID == $user_object->ID ) && current_user_can('edit_user', $user_object->ID) ) + if ( ( is_site_admin() || $current_user->ID == $user_object->ID ) && current_user_can( 'edit_user', $user_object->ID ) ) { + $edit_link = wp_specialchars( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), "user-edit.php?user_id=$user_object->ID" ) ); $r .= "<a href='$edit_link' class='edit'>".__( 'Edit' )."</a>"; + } $r .= "</td>\n\t</tr>"; return $r; } @@ -1296,8 +1305,8 @@ function get_page_templates() { if ( is_array( $templates ) ) { foreach ( $templates as $template ) { $template_data = implode( '', file( ABSPATH.$template )); - preg_match( "|Template Name:(.* )|i", $template_data, $name ); - preg_match( "|Description:(.* )|i", $template_data, $description ); + preg_match( "|Template Name:(.*)|i", $template_data, $name ); + preg_match( "|Description:(.*)|i", $template_data, $description ); $name = $name[1]; $description = $description[1]; @@ -2020,7 +2029,7 @@ function the_attachment_links( $id = false ) { return false; $icon = get_attachment_icon( $post->ID ); - $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); + $attachment_data = wp_get_attachment_metadata( $id ); $thumb = isset( $attachment_data['thumb'] ); ?> <form id="the-attachment-links"> @@ -2037,7 +2046,7 @@ function the_attachment_links( $id = false ) { <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid; ?>"><?php echo $icon ?></a></textarea></td> </tr> <tr> - <th scope="row"><?php $thumb ? _e( 'Thumbnail linked to page' ) : _e( 'Image linked to file' ); ?></th> + <th scope="row"><?php $thumb ? _e( 'Thumbnail linked to page' ) : _e( 'Image linked to page' ); ?></th> <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link( $post->ID ) ?>" rel="attachment wp-att-<?php echo $post->ID; ?>"><?php echo $icon ?></a></textarea></td> </tr> <?php else : ?> diff --git a/wp-admin/cat-js.php b/wp-admin/cat-js.php index 35df2c8..399aace 100644 --- a/wp-admin/cat-js.php +++ b/wp-admin/cat-js.php @@ -8,7 +8,7 @@ function newCatAddIn() { var jaxcat = $('jaxcat'); if ( !jaxcat ) return false; - jaxcat.update('<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="<?php echo js_escape(__('Add')); ?>"/><span id="howto"><?php js_escape(__('Separate multiple categories with commas.')); ?></span></span>'); + jaxcat.update('<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" id="catadd" value="<?php echo js_escape(__('Add')); ?>"/><span id="howto"><?php echo js_escape(__('Separate multiple categories with commas.')); ?></span></span>'); $('newcat').onkeypress = function(e) { return killSubmit("catList.ajaxAdder('category','jaxcat');", e); }; $('catadd').onclick = function() { catList.ajaxAdder('category', 'jaxcat'); }; } diff --git a/wp-admin/edit-category-form.php b/wp-admin/edit-category-form.php index fece01f..44328fa 100644 --- a/wp-admin/edit-category-form.php +++ b/wp-admin/edit-category-form.php @@ -5,17 +5,20 @@ if ( ! empty($cat_ID) ) { $form = '<form name="editcat" id="editcat" method="post" action="categories.php">'; $action = 'editedcat'; $nonce_action = 'update-category_' . $cat_ID; + do_action('edit_category_form_pre', $category); } else { $heading = __('Add Category'); $submit_text = __('Add Category »'); $form = '<form name="addcat" id="addcat" method="post" action="categories.php">'; $action = 'addcat'; $nonce_action = 'add-category'; + do_action('add_category_form_pre', $category); } ?> <div class="wrap"> <h2><?php echo $heading ?></h2> +<div id="ajax-response"></div> <?php echo $form ?> <input type="hidden" name="action" value="<?php echo $action ?>" /> <input type="hidden" name="cat_ID" value="<?php echo $category->cat_ID ?>" /> @@ -39,7 +42,6 @@ if ( ! empty($cat_ID) ) { </table> <?php autocomplete_textbox( "wpmu-edit.php?action=searchcategories&search=", "cat_name", "searchresults" ); ?> <p class="submit"><input type="submit" name="submit" value="<?php echo $submit_text ?>" /></p> -<div id="ajax-response"></div> <?php do_action('edit_category_form', $category); ?> </form> </div> diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index fda618c..e48cdb9 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -223,14 +223,14 @@ $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { echo "<a href='comment.php?action=editcomment&c=$comment->comment_ID' class='edit'>" . __('Edit') . "</a>"; } ?></td> <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { - echo "<a href=\"comment.php?action=deletecomment&p=".$comment->comment_post_ID."&c=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), $comment->comment_author )) . "', theCommentList );\" class='delete'>" . __('Delete') . "</a> "; + echo "<a href=\"comment.php?action=deletecomment&p=".$comment->comment_post_ID."&c=".$comment->comment_ID."\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . js_escape(sprintf(__("You are about to delete this comment by '%s'. \n 'Cancel' to stop, 'OK' to delete."), $comment->comment_author )) . "', theCommentList );\" class='delete'>" . __('Delete') . "</a> "; } ?></td> </tr> <?php } // end foreach ?></table> -<p class="submit"><input type="submit" name="delete_button" class="delete" value="<?php _e('Delete Checked Comments »') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php echo js_escape(__("Please select some comments to delete")); ?>'); return false } return confirm('<?php echo js_escape(sprintf(__("You are about to delete %s comments permanently \\n \'Cancel\' to stop, \'OK\' to delete.")), "' + numchecked + '"); ?>')" /> - <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam »') ?>" onclick="return confirm('<?php echo js_escape(__("You are about to mark these comments as spam \\n \'Cancel\' to stop, \'OK\' to mark as spam.")); ?>')" /></p> +<p class="submit"><input type="submit" name="delete_button" class="delete" value="<?php _e('Delete Checked Comments »') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php echo js_escape(__("Please select some comments to delete")); ?>'); return false } return confirm('<?php echo sprintf(js_escape(__("You are about to delete %s comments permanently \n 'Cancel' to stop, 'OK' to delete.")), "' + numchecked + '"); ?>')" /> + <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam »') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php echo js_escape(__("Please select some comments to mark as spam")); ?>'); return false } return confirm('<?php echo sprintf(js_escape(__("You are about to mark %s comments as spam \n 'Cancel' to stop, 'OK' to mark as spam.")), "' + numchecked + '"); ?>')" /></p> </form> <div id="ajax-response"></div> <?php diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 2b18d8e..2c1c23e 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -249,7 +249,7 @@ list_meta($metadata); </div> <?php if ('edit' == $action) : $delete_nonce = wp_create_nonce( 'delete-post_' . $post_ID ); ?> -<input name="deletepost" class="button delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this post') ?>" <?php echo "onclick=\"if ( confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n \'Cancel\' to stop, \'OK\' to delete."), js_escape($post->post_title) ) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> /> +<input name="deletepost" class="button delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this post') ?>" <?php echo "onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> /> <?php endif; ?> </div> diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php index ac20ed7..0cc2a37 100644 --- a/wp-admin/edit-form-comment.php +++ b/wp-admin/edit-form-comment.php @@ -30,7 +30,7 @@ addLoadEvent(focusit); </div> </fieldset> <fieldset id="uridiv"> - <legend><label for="URL"><?php _e('URL:') ?></label></legend> + <legend><label for="newcomment_author_url"><?php _e('URL:') ?></label></legend> <div> <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="35" value="<?php echo $comment->comment_author_url ?>" tabindex="3" id="URL" /> </div> diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 529ca15..c044879 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -282,13 +282,13 @@ foreach ($comments as $comment) { <p><?php comment_date('M j, g:i A'); ?> — [ <?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { - echo " <a href='comment.php?action=editcomment&c=".$comment->comment_ID."\'>" . __('Edit') . '</a>'; - echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; + echo " <a href='comment.php?action=editcomment&c=".$comment->comment_ID."'>" . __('Edit') . '</a>'; + echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&p=' . $post->ID . '&c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { - echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>'; - echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; + echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&p=' . $post->ID . '&c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>'; + echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $post->ID . '&c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; } - echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&dt=spam&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), js_escape( $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . "</a> ]"; + echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&dt=spam&p=".$comment->comment_post_ID."&c=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), js_escape( $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . "</a> ]"; } // end if any comments to show ?> </p> diff --git a/wp-admin/export.php b/wp-admin/export.php index 1a49700..32de2bb 100644 --- a/wp-admin/export.php +++ b/wp-admin/export.php @@ -12,8 +12,9 @@ require_once ('admin-header.php'); <div class="wrap">
<h2><?php _e('Export'); ?></h2>
<div class="narrow">
-<p><?php _e('When you click the button below WordPress will create a XML file for you to save to your computer.'); ?></p>
+<p><?php _e('When you click the button below WordPress will create an XML file for you to save to your computer.'); ?></p>
<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, comments, custom fields, and categories.'); ?></p>
+<p><?php _e('Once you\'ve saved the download file, you can use the Import function on another WordPress blog to import this blog.'); ?></p>
<form action="" method="get">
<h3><?php _e('Optional options'); ?></h3>
diff --git a/wp-admin/import.php b/wp-admin/import.php index 99f8d39..e808c92 100644 --- a/wp-admin/import.php +++ b/wp-admin/import.php @@ -7,7 +7,7 @@ require_once ('admin-header.php'); <div class="wrap">
<h2><?php _e('Import'); ?></h2>
-<p><?php _e('If you have posts or comments in another system WordPress can import them into your current blog. To get started, choose a system to import from below:'); ?></p>
+<p><?php _e('If you have posts or comments in another system, WordPress can import those into this blog. To get started, choose a system to import from below:'); ?></p>
<?php
diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php index 060a5e9..6ba0a16 100644 --- a/wp-admin/import/blogger.php +++ b/wp-admin/import/blogger.php @@ -7,7 +7,7 @@ class Blogger_Import { // Shows the welcome screen and the magic iframe.
function greet() {
- $title = __('Import Blogger');
+ $title = __('Import Blogger or Blogspot');
$welcome = __('Howdy! This importer allows you to import posts and comments from your Blogger account into your WordPress blog.');
$noiframes = __('This feature requires iframe support.');
$warning = js_escape(__('This will delete everything saved by the Blogger importer except your posts and comments. Are you sure you want to do this?'));
@@ -670,6 +670,6 @@ class Blogger_Import { $blogger_import = new Blogger_Import();
-register_importer('blogger', __('Blogger and Blogspot'), __('Import <strong>posts and comments</strong> from your Blogger account'), array ($blogger_import, 'start'));
+register_importer('blogger', __('Blogger or Blog*Spot'), __('Import posts, comments, and users from a Blogger or Blog*Spot blog'), array ($blogger_import, 'start'));
?>
diff --git a/wp-admin/import/dotclear.php b/wp-admin/import/dotclear.php index 02c030f..0eb092b 100644 --- a/wp-admin/import/dotclear.php +++ b/wp-admin/import/dotclear.php @@ -1,6 +1,6 @@ <?php /* - * Dotclear import plugin + * DotClear import plugin * by Thomas Quinot - http://thomas.quinot.org/ */ @@ -296,7 +296,7 @@ class Dotclear_Import { } $dcid2wpid[$user_id] = $ret_id; - // Set Dotclear-to-WordPress permissions translation + // Set DotClear-to-WordPress permissions translation // Update Usermeta Data $user = new WP_User($ret_id); @@ -345,7 +345,7 @@ class Dotclear_Import { $count++; extract($post); - // Set Dotclear-to-WordPress status translation + // Set DotClear-to-WordPress status translation $stattrans = array(0 => 'draft', 1 => 'publish'); $comment_status_map = array (0 => 'closed', 1 => 'open'); @@ -647,9 +647,9 @@ class Dotclear_Import { function db_form() { echo '<table class="editform">'; - printf('<tr><th><label for="dbuser">%s</label></th><td><input type="text" name="dbuser" id="dbuser" /></td></tr>', __('Dotclear Database User:')); + printf('<tr><th><label for="dbuser">%s</label></th><td><input type="text" name="dbuser" id="dbuser" /></td></tr>', __('DotClear Database User:')); printf('<tr><th><label for="dbpass">%s</label></th><td><input type="password" name="dbpass" id="dbpass" /></td></tr>', __('DotClear Database Password:')); - printf('<tr><th><label for="dbname">%s</label></th><td><input type="text" name="dbname" id="dbname" /></td></tr>', __('Dotclear Database Name:')); + printf('<tr><th><label for="dbname">%s</label></th><td><input type="text" name="dbname" id="dbname" /></td></tr>', __('DotClear Database Name:')); printf('<tr><th><label for="dbhost">%s</label></th><td><input type="text" name="dbhost" nameid="dbhost" value="localhost" /></td></tr>', __('DotClear Database Host:')); printf('<tr><th><label for="dbprefix">%s</label></th><td><input type="text" name="dbprefix" id="dbprefix" value="dc_"/></td></tr>', __('DotClear Table prefix:')); printf('<tr><th><label for="dccharset">%s</label></th><td><input type="text" name="dccharset" id="dccharset" value="ISO-8859-15"/></td></tr>', __('Originating character set:')); @@ -744,5 +744,5 @@ class Dotclear_Import { } $dc_import = new Dotclear_Import(); -register_importer('dotclear', __('DotClear'), __('Import posts from a DotClear Blog'), array ($dc_import, 'dispatch')); +register_importer('dotclear', __('DotClear'), __('Import categories, users, posts, comments, and links from a DotClear blog'), array ($dc_import, 'dispatch')); ?> diff --git a/wp-admin/import/greymatter.php b/wp-admin/import/greymatter.php index ea05ff2..7332937 100644 --- a/wp-admin/import/greymatter.php +++ b/wp-admin/import/greymatter.php @@ -6,7 +6,7 @@ class GM_Import { function header() { echo '<div class="wrap">'; - echo '<h2>'.__('Import Greymatter').'</h2>'; + echo '<h2>'.__('Import GreyMatter').'</h2>'; } function footer() { @@ -281,7 +281,7 @@ class GM_Import { ?> </ul><strong><?php _e('Done') ?></strong></li></ul> <p> </p> -<p><?php _e('Completed Greymatter import!') ?></p> +<p><?php _e('Completed GreyMatter import!') ?></p> <?php $this->footer(); } diff --git a/wp-admin/import/livejournal.php b/wp-admin/import/livejournal.php index 2d770ec..e1389cd 100644 --- a/wp-admin/import/livejournal.php +++ b/wp-admin/import/livejournal.php @@ -21,7 +21,8 @@ class LJ_Import { function greet() { echo '<div class="narrow">'; - echo '<p>'.__('Howdy! This importer allows you to extract posts from LiveJournal XML export file into your blog. Pick a LiveJournal file to upload and click Import.').'</p>'; + echo '<p>'.__('Howdy! Upload your LiveJournal XML export file and we’ll import the posts into this blog.').'</p>'; + echo '<p>'.__('Choose a LiveJournal XML file to upload, then click Upload file and import.').'</p>'; wp_import_upload_form("admin.php?import=livejournal&step=1"); echo '</div>'; } @@ -166,5 +167,5 @@ class LJ_Import { $livejournal_import = new LJ_Import(); -register_importer('livejournal', __('LiveJournal'), __('Import posts from LiveJournal'), array ($livejournal_import, 'dispatch')); +register_importer('livejournal', __('LiveJournal'), __('Import posts from a LiveJournal XML export file'), array ($livejournal_import, 'dispatch')); ?> diff --git a/wp-admin/import/mt.php b/wp-admin/import/mt.php index ffb869b..733c7fa 100644 --- a/wp-admin/import/mt.php +++ b/wp-admin/import/mt.php @@ -11,7 +11,7 @@ class MT_Import { function header() { echo '<div class="wrap">'; - echo '<h2>'.__('Import Movable Type and TypePad').'</h2>'; + echo '<h2>'.__('Import Movable Type or TypePad').'</h2>'; } function footer() { @@ -22,7 +22,7 @@ class MT_Import { $this->header(); ?> <div class="narrow"> -<p><?php _e('Howdy! We’re about to begin the process to import all of your Movable Type entries into WordPress. To begin, select a file to upload and click Import.'); ?></p> +<p><?php _e('Howdy! We’re about to begin importing all of your Movable Type or Typepad entries into WordPress. To begin, choose a file to upload and click Upload file and import.'); ?></p> <?php wp_import_upload_form( add_query_arg('step', 1) ); ?> <p><?php _e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if—for whatever reason—it doesn\'t finish. If you get an <strong>out of memory</strong> error try splitting up the import file into pieces.'); ?> </p> </div> @@ -95,6 +95,13 @@ class MT_Import { $formnames = array (); $selectnames = array (); + foreach ($_POST['user'] as $key => $line) { + $newname = trim(stripslashes($line)); + if ($newname == '') + $newname = 'left_blank'; //passing author names from step 1 to step 2 is accomplished by using POST. left_blank denotes an empty entry in the form. + array_push($formnames, "$newname"); + } // $formnames is the array with the form entered names + foreach ($_POST['userselect'] as $user => $key) { $selected = trim(stripslashes($key)); array_push($selectnames, "$selected"); @@ -131,7 +138,7 @@ class MT_Import { echo '</li>'; } - echo '<input type="submit" value="Submit">'.'<br/>'; + echo '<input type="submit" value="'.__('Submit').'">'.'<br/>'; echo '</form>'; echo '</ol></div>'; @@ -408,5 +415,5 @@ class MT_Import { $mt_import = new MT_Import(); -register_importer('mt', __('Movable Type and TypePad'), __('Imports <strong>posts and comments</strong> from your Movable Type or TypePad blog'), array ($mt_import, 'dispatch')); +register_importer('mt', __('Movable Type and TypePad'), __('Import posts and comments from a Movable Type or Typepad blog'), array ($mt_import, 'dispatch')); ?> diff --git a/wp-admin/import/rss.php b/wp-admin/import/rss.php index 8a9b9a6..944b297 100644 --- a/wp-admin/import/rss.php +++ b/wp-admin/import/rss.php @@ -22,7 +22,7 @@ class RSS_Import { function greet() { echo '<div class="narrow">'; - echo '<p>'.__('Howdy! This importer allows you to extract posts from any RSS 2.0 file into your blog. This is useful if you want to import your posts from a system that is not handled by a custom import tool. Pick an RSS file to upload and click Import.').'</p>'; + echo '<p>'.__('Howdy! This importer allows you to extract posts from an RSS 2.0 file into your blog. This is useful if you want to import your posts from a system that is not handled by a custom import tool. Pick an RSS file to upload and click Import.').'</p>'; wp_import_upload_form("admin.php?import=rss&step=1"); echo '</div>'; } diff --git a/wp-admin/import/textpattern.php b/wp-admin/import/textpattern.php index 435a588..db60e15 100644 --- a/wp-admin/import/textpattern.php +++ b/wp-admin/import/textpattern.php @@ -52,7 +52,8 @@ class Textpattern_Import { function greet() { echo '<div class="narrow">'; - echo '<p>'.__('Howdy! This importer allows you to extract posts from any Textpattern 4.0.2+ into your blog. This has not been tested on previous versions of Textpattern. Mileage may vary.').'</p>'; + echo '<p>'.__('Howdy! This imports categories, users, posts, comments, and links from any Textpattern 4.0.2+ into this blog.').'</p>'; + echo '<p>'.__('This has not been tested on previous versions of Textpattern. Mileage may vary.').'</p>'; echo '<p>'.__('Your Textpattern Configuration settings are as follows:').'</p>'; echo '<form action="admin.php?import=textpattern&step=1" method="post">'; $this->db_form(); @@ -660,5 +661,5 @@ class Textpattern_Import { } $txp_import = new Textpattern_Import(); -register_importer('textpattern', __('Textpattern'), __('Import posts from a Textpattern Blog'), array ($txp_import, 'dispatch')); +register_importer('textpattern', __('Textpattern'), __('Import categories, users, posts, comments, and links from a Textpattern blog'), array ($txp_import, 'dispatch')); ?> diff --git a/wp-admin/import/wordpress.php b/wp-admin/import/wordpress.php index 109d0a7..028cbf0 100644 --- a/wp-admin/import/wordpress.php +++ b/wp-admin/import/wordpress.php @@ -27,6 +27,7 @@ class WP_Import { function greet() {
echo '<div class="narrow">';
echo '<p>'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts, comments, custom fields, and categories into this blog.').'</p>';
+ echo '<p>'.__('Choose a WordPress WXR file to upload, then click Upload file and import.').'</p>';
wp_import_upload_form("admin.php?import=wordpress&step=1");
echo '</div>';
}
@@ -323,6 +324,6 @@ class WP_Import { $wp_import = new WP_Import();
-register_importer('wordpress', 'WordPress', __('Import <strong>posts, comments, custom fields, and categories</strong> from a WordPress export file'), array ($wp_import, 'dispatch'));
+register_importer('wordpress', 'WordPress', __('Import <strong>posts, comments, custom fields, pages, and categories</strong> from a WordPress export file'), array ($wp_import, 'dispatch'));
?>
diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php index 0a4d4e8..562e2e5 100644 --- a/wp-admin/link-manager.php +++ b/wp-admin/link-manager.php @@ -73,7 +73,7 @@ if ( isset($_GET['deleted']) ) { <div class="wrap"> <h2><?php _e('Blogroll Management'); ?></h2> -<p><?php _e('Here you add links to sites that you visit often and share them on your blog. When you have a list of links in your sidebar to other blogs, it’s called a “blogroll.”'); ?></p> +<p><?php _e('Here you <a href="link-add.php">add links</a> to sites that you visit often and share them on your blog. When you have a list of links in your sidebar to other blogs, it’s called a “blogroll.”'); ?></p> <form id="cats" method="get" action=""> <p><?php $categories = get_categories("hide_empty=1&type=link"); @@ -93,6 +93,24 @@ printf(__('Currently showing %1$s links ordered by %2$s'), $select_cat, $select_ ?> <input type="submit" name="action" value="<?php _e('Update »') ?>" /></p> </form> +<?php +$link_columns = array( + 'name' => '<th width="15%">' . __('Name') . '</th>', + 'url' => '<th>' . __('URL') . '</th>', + 'categories' => '<th>' . __('Categories') . '</th>', + 'rel' => '<th style="text-align: center">' . __('rel') . '</th>', + 'visible' => '<th style="text-align: center">' . __('Visible') . '</th>', + 'action' => '<th colspan="2" style="text-align: center">' . __('Action') . '</th>', +); +$link_columns = apply_filters('manage_link_columns', $link_columns); +?> + +<?php +if ( 'all' == $cat_id ) + $cat_id = ''; +$links = get_bookmarks( "category=$cat_id&hide_invisible=0&orderby=$sqlorderby&hide_empty=0" ); +if ( $links ) { +?> <form id="links" method="post" action="link.php"> <?php wp_nonce_field('bulk-bookmarks') ?> @@ -103,21 +121,14 @@ printf(__('Currently showing %1$s links ordered by %2$s'), $select_cat, $select_ <table class="widefat"> <thead> <tr> - <th width="15%"><?php _e('Name') ?></th> - <th><?php _e('URL') ?></th> - <th><?php _e('Categories') ?></th> - <th style="text-align: center"><?php _e('rel') ?></th> - <th style="text-align: center"><?php _e('Visible') ?></th> - <th colspan="2" style="text-align: center"><?php _e('Action') ?></th> - <th style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById('links'));" /></th> +<?php foreach($link_columns as $column_display_name) { + echo $column_display_name; +} ?> + <th style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById('links'));" /></th> </tr> </thead> <tbody id="the-list"> <?php -if ( 'all' == $cat_id ) - $cat_id = ''; -$links = get_bookmarks("category=$cat_id&hide_invisible=0&orderby=$sqlorderby&hide_empty=0"); -if ($links) foreach ($links as $link) { $link->link_name = wp_specialchars($link->link_name); $link->link_description = wp_specialchars($link->link_description); @@ -133,47 +144,59 @@ if ($links) $visible = ($link->link_visible == 'Y') ? __('Yes') : __('No'); ++ $i; $style = ($i % 2) ? '' : ' class="alternate"'; -?> - <tr id="link-<?php echo $link->link_id; ?>" valign="middle" <?php echo $style; ?>> - <td><strong><?php echo $link->link_name; ?></strong><br /> - <?php - - - echo $link->link_description . "</td>"; - echo "<td><a href=\"$link->link_url\" title=\"".sprintf(__('Visit %s'), $link->link_name)."\">$short_url</a></td>"; - ?> - <td> - <?php - - $cat_names = array(); - foreach ($link->link_category as $category) { - $cat_name = get_the_category_by_ID($category); - $cat_name = wp_specialchars($cat_name); - if ( $cat_id != $category ) - $cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>"; - $cat_names[] = $cat_name; - } - echo implode(', ', $cat_names); - ?> - </td> - <td><?php echo $link->link_rel; ?></td> - <td align='center'><?php echo $visible; ?></td> -<?php + ?><tr id="link-<?php echo $link->link_id; ?>" valign="middle" <?php echo $style; ?>><?php + foreach($link_columns as $column_name=>$column_display_name) { + switch($column_name) { + case 'name': + ?><td><strong><?php echo $link->link_name; ?></strong><br /><?php + echo $link->link_description . "</td>"; + break; + case 'url': + echo "<td><a href='$link->link_url' title='".sprintf(__('Visit %s'), $link->link_name)."'>$short_url</a></td>"; + break; + case 'categories': + ?><td><?php + $cat_names = array(); + foreach ($link->link_category as $category) { + $cat_name = get_the_category_by_ID($category); + $cat_name = wp_specialchars($cat_name); + if ( $cat_id != $category ) + $cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>"; + $cat_names[] = $cat_name; + } + echo implode(', ', $cat_names); + ?> </td><?php + break; + case 'rel': + ?><td><?php echo $link->link_rel; ?></td><?php + break; + case 'visible': + ?><td align='center'><?php echo $visible; ?></td><?php + break; + case 'action': + echo '<td><a href="link.php?link_id='.$link->link_id.'&action=edit" class="edit">'.__('Edit').'</a></td>'; + echo '<td><a href="' . wp_nonce_url('link.php?link_id='.$link->link_id.'&action=delete', 'delete-bookmark_' . $link->link_id ) . '"'." onclick=\"return deleteSomething( 'link', $link->link_id , '".js_escape(sprintf(__("You are about to delete the "%s" link to %s.\n"Cancel" to stop, "OK" to delete."), $link->link_name, $link->link_url )).'\' );" class="delete">'.__('Delete').'</a></td>'; + break; + default: + ?> + <td><?php do_action('manage_link_custom_column', $column_name, $id); ?></td> + <?php + break; - echo '<td><a href="link.php?link_id='.$link->link_id.'&action=edit" class="edit">'.__('Edit').'</a></td>'; - echo '<td><a href="' . wp_nonce_url('link.php?link_id='.$link->link_id.'&action=delete', 'delete-bookmark_' . $link->link_id ) . '"'." onclick=\"return deleteSomething( 'link', $link->link_id , '".js_escape(sprintf(__("You are about to delete the "%s" link to %s.\\n"Cancel" to stop, "OK" to delete."), $link->link_name, $link->link_url )).'\' );" class="delete">'.__('Delete').'</a></td>'; + } + } echo '<td align="center"><input type="checkbox" name="linkcheck[]" value="'.$link->link_id.'" /></td>'; echo "\n </tr>\n"; } +} ?> </tbody> </table> <div id="ajax-response"></div> -<p class="submit"><input type="submit" class="button" name="deletebookmarks" id="deletebookmarks" value="<?php _e('Delete Checked Links') ?> »" onclick="return confirm('<?php echo js_escape(__("You are about to delete these links permanently \\n \'Cancel\' to stop, \'OK\' to delete.")); ?>')" /></p> +<p class="submit"><input type="submit" class="button" name="deletebookmarks" id="deletebookmarks" value="<?php _e('Delete Checked Links') ?> »" onclick="return confirm('<?php echo js_escape(__("You are about to delete these links permanently.\n'Cancel' to stop, 'OK' to delete.")); ?>')" /></p> </form> -</div> <?php if( wp_cache_get( "checked_bookmarks_table", "options" ) == false ) { @@ -187,8 +210,8 @@ if( wp_cache_get( "checked_bookmarks_table", "options" ) == false ) { } } wp_cache_set( "checked_bookmarks_table", "1", "options" ); -} +} ?> -?> +</div> <?php include('admin-footer.php'); ?> diff --git a/wp-admin/page.php b/wp-admin/page.php index 4728b5d..0e523e2 100644 --- a/wp-admin/page.php +++ b/wp-admin/page.php @@ -76,13 +76,10 @@ case 'editattachment': $_POST['post_type'] = 'attachment'; // Update the thumbnail filename - $oldmeta = $newmeta = get_post_meta($page_id, '_wp_attachment_metadata', true); + $newmeta = wp_get_attachment_metadata( $page_id, true ); $newmeta['thumb'] = $_POST['thumb']; - if ( '' !== $oldmeta ) - update_post_meta($page_id, '_wp_attachment_metadata', $newmeta, $oldmeta); - else - add_post_meta($page_id, '_wp_attachment_metadata', $newmeta); + wp_update_attachment_metadata( $newmeta ); case 'editpost': $page_ID = (int) $_POST['post_ID']; diff --git a/wp-admin/post.php b/wp-admin/post.php index 31d16bd..b35ff33 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -78,13 +78,10 @@ case 'editattachment': $_POST['post_type'] = 'attachment'; // Update the thumbnail filename - $oldmeta = $newmeta = get_post_meta($post_id, '_wp_attachment_metadata', true); + $newmeta = wp_get_attachment_metadata( $post_id, true ); $newmeta['thumb'] = $_POST['thumb']; - if ( '' !== $oldmeta ) - update_post_meta($post_id, '_wp_attachment_metadata', $newmeta, $oldmeta); - else - add_post_meta($post_id, '_wp_attachment_metadata', $newmeta); + wp_update_attachment_metadata( $post_id, $newmeta ); case 'editpost': $post_ID = (int) $_POST['post_ID']; diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php index 2349dca..ce4e62c 100644 --- a/wp-admin/upgrade-functions.php +++ b/wp-admin/upgrade-functions.php @@ -475,7 +475,7 @@ function upgrade_160() { $meta = get_post_meta($object->ID, 'imagedata', true); if ( ! empty($meta['file']) ) - add_post_meta($object->ID, '_wp_attached_file', $meta['file']); + update_attached_file( $object->ID, $meta['file'] ); } } } @@ -556,6 +556,13 @@ function upgrade_210() { } } +function upgrade_old_slugs() { + // upgrade people who were using the Redirect Old Slugs plugin + global $wpdb; + $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_wp_old_slug' WHERE meta_key = 'old_slug'"); +} + + // The functions we use to actually do stuff // General diff --git a/wp-admin/upload-functions.php b/wp-admin/upload-functions.php index 3900c6e..11f3b77 100644 --- a/wp-admin/upload-functions.php +++ b/wp-admin/upload-functions.php @@ -2,7 +2,7 @@ function wp_upload_display( $dims = false, $href = '' ) { global $post; $id = get_the_ID(); - $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); + $attachment_data = wp_get_attachment_metadata( $id ); if ( isset($attachment_data['width']) ) list($width,$height) = wp_shrink_dimensions($attachment_data['width'], $attachment_data['height'], 171, 128); ob_start(); @@ -57,7 +57,7 @@ function wp_upload_display( $dims = false, $href = '' ) { function wp_upload_view() { global $style, $post_id, $style; $id = get_the_ID(); - $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); + $attachment_data = wp_get_attachment_metadata( $id ); ?> <div id="upload-file"> <div id="file-title"> @@ -98,7 +98,7 @@ function wp_upload_form() { <?php if ( $id ) : $attachment = get_post_to_edit( $id ); - $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); + $attachment_data = wp_get_attachment_metadata( $id ); ?> <div id="file-title"> <h2><?php if ( !isset($attachment_data['width']) && 'inline' != $style ) @@ -229,7 +229,7 @@ function wp_upload_tab_upload_action() { $imagedata['hwstring_small'] = "height='$uheight' width='$uwidth'"; $imagedata['file'] = $file; - add_post_meta($id, '_wp_attachment_metadata', $imagedata); + wp_update_attachment_metadata( $id, $imagedata ); if ( $imagedata['width'] * $imagedata['height'] < 3 * 1024 * 1024 ) { if ( $imagedata['width'] > 128 && $imagedata['width'] >= $imagedata['height'] * 4 / 3 ) @@ -240,13 +240,13 @@ function wp_upload_tab_upload_action() { if ( @file_exists($thumb) ) { $newdata = $imagedata; $newdata['thumb'] = basename($thumb); - update_post_meta($id, '_wp_attachment_metadata', $newdata, $imagedata); + wp_update_attachment_metadata( $id, $newdata ); } else { $error = $thumb; } } } else { - add_post_meta($id, '_wp_attachment_metadata', array()); + wp_update_attachment_metadata( $id, array() ); } wp_redirect( get_option('siteurl') . "/wp-admin/upload.php?style=$style&tab=browse&action=view&ID=$id&post_id=$post_id"); diff --git a/wp-admin/upload-js.php b/wp-admin/upload-js.php index 5ee62c1..c0a7a1b 100644 --- a/wp-admin/upload-js.php +++ b/wp-admin/upload-js.php @@ -72,22 +72,22 @@ addLoadEvent( function() { var params = $H(this.params); params.ID = ''; params.action = ''; - h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='Browse your files' class='back'>« Back</a>"; + h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='<?php echo wp_specialchars(__('Browse your files'), 1); ?>' class='back'><?php echo wp_specialchars(__('« Back'), 1); ?></a>"; } else { - h += "<a href='#' onclick='return theFileList.cancelView();' title='Browse your files' class='back'>« Back</a>"; + h += "<a href='#' onclick='return theFileList.cancelView();' title='<?php echo wp_specialchars(__('Browse your files'), 1); ?>' class='back'><?php echo wp_specialchars(__('« Back'), 1) ?></a>"; } h += "<div id='file-title'>" if ( !this.currentImage.isImage ) - h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>" + this.currentImage.title + "</a></h2>"; + h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo wp_specialchars(__('Direct link to file'), 1); ?>'>" + this.currentImage.title + "</a></h2>"; else h += "<h2>" + this.currentImage.title + "</h2>"; h += " — <span>"; - h += "<a href='#' onclick='return theFileList.editView(" + id + ");'>Edit</a>" + h += "<a href='#' onclick='return theFileList.editView(" + id + ");'><?php echo wp_specialchars(__('Edit'), 1); ?></a>" h += "</span>"; h += '</div>' h += "<div id='upload-file-view' class='alignleft'>"; if ( this.currentImage.isImage ) { - h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>"; + h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo wp_specialchars(__('Direct link to file'), 1); ?>'>"; h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />"; h += "</a>"; } else @@ -97,20 +97,20 @@ addLoadEvent( function() { h += "<form name='uploadoptions' id='uploadoptions' class='alignleft'>"; h += "<table>"; if ( this.currentImage.thumb ) { - h += "<tr><th style='padding-bottom:.5em'><?php echo js_escape(__('Show:')); ?></th><td style='padding-bottom:.5em'>"; - h += "<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' checked='checked' /> <?php echo js_escape(__('Thumbnail')); ?></label><br />"; - h += "<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> <?php echo js_escape(__('Full size')); ?></label>"; + h += "<tr><th style='padding-bottom:.5em'><?php echo wp_specialchars(__('Show:'), 1); ?></th><td style='padding-bottom:.5em'>"; + h += "<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' checked='checked' /> <?php echo wp_specialchars(__('Thumbnail'), 1); ?></label><br />"; + h += "<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> <?php echo wp_specialchars(__('Full size'), 1); ?></label>"; h += "</td></tr>"; } - h += "<tr><th><?php echo js_escape(__('Link to:')); ?></th><td>"; - h += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' checked='checked'/> <?php echo js_escape(__('File')); ?></label><br />"; - h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> <?php echo js_escape(__('Page')); ?></label><br />"; - h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> <?php echo js_escape(__('None')); ?></label>"; + h += "<tr><th><?php echo wp_specialchars(__('Link to:'), 1); ?></th><td>"; + h += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' checked='checked'/> <?php echo wp_specialchars(__('File'), 1); ?></label><br />"; + h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> <?php echo wp_specialchars(__('Page'), 1); ?></label><br />"; + h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> <?php echo wp_specialchars(__('None'), 1); ?></label>"; h += "</td></tr>"; h += "<tr><td colspan='2'><p class='submit'>"; - h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='<?php echo js_escape(__('Send to editor »')); ?>' />"; + h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='<?php echo wp_specialchars(__('Send to editor »'), 1); ?>' />"; h += "</p></td></tr></table>"; h += "</form>"; @@ -134,22 +134,22 @@ addLoadEvent( function() { var params = $H(this.params); params.ID = ''; params.action = ''; - h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='<?php echo js_escape(__('Browse your files')); ?>' class='back'>« <?php echo js_escape(__('Back')); ?></a>"; + h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='<?php echo wp_specialchars(__('Browse your files'), 1); ?>' class='back'><?php echo wp_specialchars(__('« Back'), 1); ?></a>"; } else { - h += "<a href='#' onclick='return theFileList.cancelView();' title='<?php echo js_escape(__('Browse your files')); ?>' class='back'>« <?php echo js_escape(__('Back')); ?></a>"; + h += "<a href='#' onclick='return theFileList.cancelView();' title='<?php echo wp_specialchars(__('Browse your files'), 1); ?>' class='back'><?php echo wp_specialchars(__('« Back'), 1); ?></a>"; } h += "<div id='file-title'>" if ( !this.currentImage.isImage ) - h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo js_escape(__('Direct link to file')); ?>'>" + this.currentImage.title + "</a></h2>"; + h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo wp_specialchars(__('Direct link to file'), 1); ?>'>" + this.currentImage.title + "</a></h2>"; else h += "<h2>" + this.currentImage.title + "</h2>"; h += " — <span>"; - h += "<a href='#' onclick='return theFileList.imageView(" + id + ");'><?php js_escape(__('Insert')); ?></a>" + h += "<a href='#' onclick='return theFileList.imageView(" + id + ");'><?php wp_specialchars(__('Insert'), 1); ?></a>" h += "</span>"; h += '</div>' h += "<div id='upload-file-view' class='alignleft'>"; if ( this.currentImage.isImage ) { - h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo js_escape(__('Direct link to file')); ?>'>"; + h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='<?php echo wp_specialchars(__('Direct link to file')); ?>'>"; h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />"; h += "</a>"; } else @@ -158,20 +158,20 @@ addLoadEvent( function() { h += "<table><col /><col class='widefat' /><tr>" - h += "<th scope='row'><label for='url'><?php echo js_escape(__('URL')); ?></label></th>"; + h += "<th scope='row'><label for='url'><?php echo wp_specialchars(__('URL'), 1); ?></label></th>"; h += "<td><input type='text' id='url' class='readonly' value='" + this.currentImage.srcBase + this.currentImage.src + "' readonly='readonly' /></td>"; h += "</tr><tr>"; - h += "<th scope='row'><label for='post_title'><?php echo js_escape(__('Title')); ?></label></th>"; + h += "<th scope='row'><label for='post_title'><?php echo wp_specialchars(__('Title'), 1); ?></label></th>"; h += "<td><input type='text' id='post_title' name='post_title' value='" + this.currentImage.title + "' /></td>"; h += "</tr><tr>"; - h += "<th scope='row'><label for='post_content'><?php echo js_escape(__('Description')); ?></label></th>"; + h += "<th scope='row'><label for='post_content'><?php echo wp_specialchars(__('Description'), 1); ?></label></th>"; h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>"; - h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='<?php echo js_escape(__('Delete File')); ?>' onclick='theFileList.deleteFile(" + id + ");' />"; + h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='<?php echo wp_specialchars(__('Delete File'), 1); ?>' onclick='theFileList.deleteFile(" + id + ");' />"; h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />"; h += "<input type='hidden' name='action' id='action-value' value='save' />"; h += "<input type='hidden' name='ID' value='" + id + "' />"; h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />"; - h += "<div class='submit'><input type='submit' value='<?php echo js_escape(__('Save »')); ?>' /></div>"; + h += "<div class='submit'><input type='submit' value='<?php echo wp_specialchars(__('Save »'), 1); ?>' /></div>"; h += "</td></tr></table></form>"; new Insertion.Top('upload-content', h); diff --git a/wp-admin/upload.php b/wp-admin/upload.php index 53d1e56..b2977c7 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -8,6 +8,14 @@ if (!current_user_can('upload_files')) wp_reset_vars(array('action', 'tab', 'from_tab', 'style', 'post_id', 'ID', 'paged', 'post_title', 'post_content', 'delete')); +// IDs should be integers +$ID = (int) $ID; +$post_id = (int) $post_id; + +// Require an ID for the edit screen +if ( $action == 'edit' && !$ID ) + wp_die(__("You are not allowed to be here")); + require_once('upload-functions.php'); if ( !$tab ) $tab = 'browse-all'; diff --git a/wp-admin/users.js b/wp-admin/users.js index 5e40418..f249f65 100644 --- a/wp-admin/users.js +++ b/wp-admin/users.js @@ -2,7 +2,8 @@ addLoadEvent(function() { theListEls = document.getElementsByTagName('tbody'); theUserLists = new Array(); for ( var l = 0; l < theListEls.length; l++ ) { - theUserLists[theListEls[l].id] = new listMan(theListEls[l].id); + if ( theListEls[l].id ) + theUserLists[theListEls[l].id] = new listMan(theListEls[l].id); } addUserInputs = document.getElementById('adduser').getElementsByTagName('input'); for ( var i = 0; i < addUserInputs.length; i++ ) { diff --git a/wp-admin/users.php b/wp-admin/users.php index 3c260ab..ca49c24 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -506,7 +506,7 @@ default: foreach($roleclasses as $role => $roleclass) { uksort($roleclass, "strnatcasecmp"); ?> - +<tbody> <tr> <?php if ( !empty($role) ) : ?> <th colspan="7"><h3><?php echo $wp_roles->role_names[$role]; ?></h3></th> @@ -522,7 +522,7 @@ foreach($roleclasses as $role => $roleclass) { <th><?php _e('Website') ?></th> <th colspan="2" style="text-align: center"><?php _e('Actions') ?></th> </tr> -</thead> +</tbody> <tbody id="role-<?php echo $role; ?>"><?php $style = ''; foreach ( (array) $roleclass as $user_object ) { diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index 010dc60..e31c000 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -46,6 +46,10 @@ a.delete:hover { overflow: hidden; } +#planetnews cite { + font-size: 11px; +} + #planetnews li .post { font-family: Georgia, "Times New Roman", Times, serif; font-size: 18px; @@ -824,6 +828,7 @@ input.delete:hover { margin: 0; font-size: 15px; } + .plugins p { } diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 359f04a..1ac742e 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -183,7 +183,7 @@ function wp_dropdown_categories($args = '') { $output = ''; if ( ! empty($categories) ) { - $output = "<select name='$name' class='$class'>\n"; + $output = "<select name='$name' id='$name' class='$class'>\n"; if ( $show_option_all ) { $show_option_all = apply_filters('list_cats', $show_option_all); diff --git a/wp-includes/classes.php b/wp-includes/classes.php index f8bb896..fb3110a 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -575,13 +575,14 @@ class Walker_Category extends Walker { function start_el($output, $category, $depth, $args) { extract($args); - $link = '<a href="' . get_category_link($category->cat_ID) . '" '; + $cat_name = wp_specialchars( $category->cat_name, 1 ); + $link = '<a href="' . get_category_link( $category->cat_ID ) . '" '; if ( $use_desc_for_title == 0 || empty($category->category_description) ) - $link .= 'title="'. sprintf(__("View all posts filed under %s"), wp_specialchars($category->cat_name, 1)) . '"'; + $link .= 'title="' . sprintf(__( 'View all posts filed under %s' ), $cat_name) . '"'; else - $link .= 'title="' . wp_specialchars(apply_filters('category_description',$category->category_description,$category),1) . '"'; + $link .= 'title="' . wp_specialchars( apply_filters( 'category_description', $category->category_description, $category ), 1 ) . '"'; $link .= '>'; - $link .= apply_filters('list_cats', $category->cat_name, $category).'</a>'; + $link .= apply_filters( 'list_cats', $category->cat_name, $category ).'</a>'; if ( (! empty($feed_image)) || (! empty($feed)) ) { $link .= ' '; @@ -589,9 +590,11 @@ class Walker_Category extends Walker { if ( empty($feed_image) ) $link .= '('; - $link .= '<a href="' . get_category_rss_link(0, $category->cat_ID, $category->category_nicename) . '"'; + $link .= '<a href="' . get_category_rss_link( 0, $category->cat_ID, $category->category_nicename ) . '"'; - if ( !empty($feed) ) { + if ( empty($feed) ) + $alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"'; + else { $title = ' title="' . $feed . '"'; $alt = ' alt="' . $feed . '"'; $name = $feed; @@ -600,17 +603,17 @@ class Walker_Category extends Walker { $link .= '>'; - if ( !empty($feed_image) ) - $link .= "<img src='$feed_image' $alt$title" . ' />'; - else + if ( empty($feed_image) ) $link .= $name; + else + $link .= "<img src='$feed_image'$alt$title" . ' />'; $link .= '</a>'; - if (empty($feed_image)) + if ( empty($feed_image) ) $link .= ')'; } if ( isset($show_count) && $show_count ) - $link .= ' ('.intval($category->category_count).')'; + $link .= ' (' . intval($category->category_count) . ')'; if ( isset($show_date) && $show_date ) { $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp); diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 14b3fce..cef58dd 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -1068,7 +1068,7 @@ function wp_richedit_pre($text) { function clean_url( $url ) { if ('' == $url) return $url; - $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $url); + $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%]|i', '', $url); $strip = array('%0d', '%0a'); $url = str_replace($strip, '', $url); $url = str_replace(';//', '://', $url); diff --git a/wp-includes/js/autosave.js.php b/wp-includes/js/autosave.js.php index 934bfa0..67fcde7 100644 --- a/wp-includes/js/autosave.js.php +++ b/wp-includes/js/autosave.js.php @@ -13,9 +13,10 @@ function autosave_start_timer() { form.addEventListener("submit", function () { autosavePeriodical.currentlyExecuting = true; }, false); } if(form.attachEvent) { - $('save').attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }); - $('publish').attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }); - $('deletepost').attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }); + form.save ? form.save.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; + form.submit ? form.submit.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; + form.publish ? form.publish.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; + form.deletepost ? form.deletepost.attachEvent("onclick", function () { autosavePeriodical.currentlyExecuting = true; }) : null; } } addLoadEvent(autosave_start_timer) @@ -38,9 +39,9 @@ function autosave_update_post_ID() { var message; if(isNaN(res)) { - message = "<?php js_escape(__('Error: ')); ?>" + response; + message = "<?php echo js_escape(__('Error: ')); ?>" + response; } else { - message = "<?php js_escape(__('Saved at ')); ?>" + autosave_cur_time(); + message = "<?php echo js_escape(__('Saved at ')); ?>" + autosave_cur_time(); $('post_ID').name = "post_ID"; $('post_ID').value = res; // We need new nonces @@ -57,10 +58,11 @@ function autosave_update_post_ID() { $('hiddenaction').value = 'editpost'; } $('autosave').innerHTML = message; + autosave_enable_buttons(); } function autosave_loading() { - $('autosave').innerHTML = "<?php js_escape(__('Saving Draft...')); ?>"; + $('autosave').innerHTML = "<?php echo js_escape(__('Saving Draft...')); ?>"; } function autosave_saved() { @@ -69,13 +71,30 @@ function autosave_saved() { var message; if(isNaN(res)) { - message = "<?php js_escape(__('Error: ')); ?>" + response; + message = "<?php echo js_escape(__('Error: ')); ?>" + response; } else { - message = "<?php js_escape(__('Saved at ')); ?>" + autosave_cur_time() + "."; + message = "<?php echo js_escape(__('Saved at ')); ?>" + autosave_cur_time() + "."; } $('autosave').innerHTML = message; + autosave_enable_buttons(); } - + +function autosave_disable_buttons() { + var form = $('post'); + form.save ? form.save.disabled = 'disabled' : null; + form.submit ? form.submit.disabled = 'disabled' : null; + form.publish ? form.publish.disabled = 'disabled' : null; + form.deletepost ? form.deletepost.disabled = 'disabled' : null; +} + +function autosave_enable_buttons() { + var form = $('post'); + form.save ? form.save.disabled = '' : null; + form.submit ? form.submit.disabled = '' : null; + form.publish ? form.publish.disabled = '' : null; + form.deletepost ? form.deletepost.disabled = '' : null; +} + function autosave() { var form = $('post'); var rich = ((typeof tinyMCE != "undefined") && tinyMCE.getInstanceById('content')) ? true : false; @@ -95,6 +114,8 @@ function autosave() { if(form.post_title.value.length==0 || form.content.value.length==0 || form.post_title.value+form.content.value == autosaveLast) return; + autosave_disable_buttons(); + autosaveLast = form.post_title.value+form.content.value; cats = document.getElementsByName("post_category[]"); diff --git a/wp-includes/js/list-manipulation-js.php b/wp-includes/js/list-manipulation-js.php index eb67077..8787210 100644 --- a/wp-includes/js/list-manipulation-js.php +++ b/wp-includes/js/list-manipulation-js.php @@ -37,6 +37,8 @@ Object.extend(listMan.prototype, { ajaxAdd.addOnComplete( function(transport) { var newItems = $A(transport.responseXML.getElementsByTagName(what)); if ( newItems ) { + var showLinkMessage = ''; + var m = ''; newItems.each( function(i) { var id = i.getAttribute('id'); var exists = $(what+'-'+id); @@ -44,10 +46,15 @@ Object.extend(listMan.prototype, { tempObj.replaceListItem( exists, getNodeValue(i,'response_data'), update ); else tempObj.addListItem( getNodeValue(i, 'response_data') ); - if ( tempObj.showLink ) - tempObj.showLink = id; + m = getNodeValue(i, 'show-link'); + showLinkMessage += showLinkMessage ? "<br />\n" : ''; + if ( m ) + showLinkMessage += m; + else + showLinkMessage += "<a href='#" + what + '-' + id + "'><?php echo js_escape(__('Jump to new item')); ?>"; }); - ajaxAdd.myResponseElement.update(tempObj.showLink ? ( "<div id='jumplink' class='updated fade'><p><a href='#" + what + '-' + tempObj.showLink + "'><?php js_escape(__('Jump to new item')); ?></a></p></div>" ) : ''); + if ( tempObj.showLink && showLinkMessage ) + ajaxAdd.myResponseElement.update("<div id='jumplink' class='updated fade'><p>" + showLinkMessage + "</p></div>"); } if ( tempObj.addComplete && typeof tempObj.addComplete == 'function' ) tempObj.addComplete( what, where, update, transport ); diff --git a/wp-includes/js/prototype.compressed.js b/wp-includes/js/prototype.compressed.js deleted file mode 100644 index a2ab35a..0000000 --- a/wp-includes/js/prototype.compressed.js +++ /dev/null @@ -1 +0,0 @@ -var Prototype={Version:"1.5.0_rc0",ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){},K:function(x){return x;}};var Class={create:function(){return function(){this.initialize.apply(this,arguments);};}};var Abstract=new Object();Object.extend=function(_2,_3){for(var _4 in _3){_2[_4]=_3[_4];}return _2;};Object.inspect=function(_5){try{if(_5==undefined){return "undefined";}if(_5==null){return "null";}return _5.inspect?_5.inspect():_5.toString();}catch(e){if(e instanceof RangeError){return "...";}throw e;}};Function.prototype.bind=function(){var _6=this,args=$A(arguments),object=args.shift();return function(){return _6.apply(object,args.concat($A(arguments)));};};Function.prototype.bindAsEventListener=function(_7){var _8=this;return function(_9){return _8.call(_7,_9||window.event);};};Object.extend(Number.prototype,{toColorPart:function(){var _a=this.toString(16);if(this<16){return "0"+_a;}return _a;},succ:function(){return this+1;},times:function(_b){$R(0,this,true).each(_b);return this;}});var Try={these:function(){var _c;for(var i=0;i<arguments.length;i++){var _e=arguments[i];try{_c=_e();break;}catch(e){}}return _c;}};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(_f,_10){this.callback=_f;this.frequency=_10;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback();}finally{this.currentlyExecuting=false;}}}};Object.extend(String.prototype,{gsub:function(_11,_12){var _13="",source=this,match;_12=arguments.callee.prepareReplacement(_12);while(source.length>0){if(match=source.match(_11)){_13+=source.slice(0,match.index);_13+=(_12(match)||"").toString();source=source.slice(match.index+match[0].length);}else{_13+=source,source="";}}return _13;},sub:function(_14,_15,_16){_15=this.gsub.prepareReplacement(_15);_16=_16===undefined?1:_16;return this.gsub(_14,function(_17){if(--_16<0){return _17[0];}return _15(_17);});},scan:function(_18,_19){this.gsub(_18,_19);return this;},truncate:function(_1a,_1b){_1a=_1a||30;_1b=_1b===undefined?"...":_1b;return this.length>_1a?this.slice(0,_1a-_1b.length)+_1b:this;},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"");},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"");},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");},extractScripts:function(){var _1c=new RegExp(Prototype.ScriptFragment,"img");var _1d=new RegExp(Prototype.ScriptFragment,"im");return (this.match(_1c)||[]).map(function(_1e){return (_1e.match(_1d)||["",""])[1];});},evalScripts:function(){return this.extractScripts().map(function(_1f){return eval(_1f);});},escapeHTML:function(){var div=document.createElement("div");var _21=document.createTextNode(this);div.appendChild(_21);return div.innerHTML;},unescapeHTML:function(){var div=document.createElement("div");div.innerHTML=this.stripTags();return div.childNodes[0]?div.childNodes[0].nodeValue:"";},toQueryParams:function(){var _23=this.match(/^\??(.*)$/)[1].split("&");return _23.inject({},function(_24,_25){var _26=_25.split("=");_24[_26[0]]=_26[1];return _24;});},toArray:function(){return this.split("");},camelize:function(){var _27=this.split("-");if(_27.length==1){return _27[0];}var _28=this.indexOf("-")==0?_27[0].charAt(0).toUpperCase()+_27[0].substring(1):_27[0];for(var i=1,len=_27.length;i<len;i++){var s=_27[i];_28+=s.charAt(0).toUpperCase()+s.substring(1);}return _28;},inspect:function(){return "'"+this.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'";}});String.prototype.gsub.prepareReplacement=function(_2b){if(typeof _2b=="function"){return _2b;}var _2c=new Template(_2b);return function(_2d){return _2c.evaluate(_2d);};};String.prototype.parseQuery=String.prototype.toQueryParams;var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(_2e,_2f){this.template=_2e.toString();this.pattern=_2f||Template.Pattern;},evaluate:function(_30){return this.template.gsub(this.pattern,function(_31){var _32=_31[1];if(_32=="\\"){return _31[2];}return _32+(_30[_31[3]]||"").toString();});}};var $break=new Object();var $continue=new Object();var Enumerable={each:function(_33){var _34=0;try{this._each(function(_35){try{_33(_35,_34++);}catch(e){if(e!=$continue){throw e;}}});}catch(e){if(e!=$break){throw e;}}},all:function(_36){var _37=true;this.each(function(_38,_39){_37=_37&&!!(_36||Prototype.K)(_38,_39);if(!_37){throw $break;}});return _37;},any:function(_3a){var _3b=true;this.each(function(_3c,_3d){if(_3b=!!(_3a||Prototype.K)(_3c,_3d)){throw $break;}});return _3b;},collect:function(_3e){var _3f=[];this.each(function(_40,_41){_3f.push(_3e(_40,_41));});return _3f;},detect:function(_42){var _43;this.each(function(_44,_45){if(_42(_44,_45)){_43=_44;throw $break;}});return _43;},findAll:function(_46){var _47=[];this.each(function(_48,_49){if(_46(_48,_49)){_47.push(_48);}});return _47;},grep:function(_4a,_4b){var _4c=[];this.each(function(_4d,_4e){var _4f=_4d.toString();if(_4f.match(_4a)){_4c.push((_4b||Prototype.K)(_4d,_4e));}});return _4c;},include:function(_50){var _51=false;this.each(function(_52){if(_52==_50){_51=true;throw $break;}});return _51;},inject:function(_53,_54){this.each(function(_55,_56){_53=_54(_53,_55,_56);});return _53;},invoke:function(_57){var _58=$A(arguments).slice(1);return this.collect(function(_59){return _59[_57].apply(_59,_58);});},max:function(_5a){var _5b;this.each(function(_5c,_5d){_5c=(_5a||Prototype.K)(_5c,_5d);if(_5b==undefined||_5c>=_5b){_5b=_5c;}});return _5b;},min:function(_5e){var _5f;this.each(function(_60,_61){_60=(_5e||Prototype.K)(_60,_61);if(_5f==undefined||_60<_5f){_5f=_60;}});return _5f;},partition:function(_62){var _63=[],falses=[];this.each(function(_64,_65){((_62||Prototype.K)(_64,_65)?_63:falses).push(_64);});return [_63,falses];},pluck:function(_66){var _67=[];this.each(function(_68,_69){_67.push(_68[_66]);});return _67;},reject:function(_6a){var _6b=[];this.each(function(_6c,_6d){if(!_6a(_6c,_6d)){_6b.push(_6c);}});return _6b;},sortBy:function(_6e){return this.collect(function(_6f,_70){return {value:_6f,criteria:_6e(_6f,_70)};}).sort(function(_71,_72){var a=_71.criteria,b=_72.criteria;return a<b?-1:a>b?1:0;}).pluck("value");},toArray:function(){return this.collect(Prototype.K);},zip:function(){var _74=Prototype.K,args=$A(arguments);if(typeof args.last()=="function"){_74=args.pop();}var _75=[this].concat(args).map($A);return this.map(function(_76,_77){return _74(_75.pluck(_77));});},inspect:function(){return "#<Enumerable:"+this.toArray().inspect()+">";}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(_78){if(!_78){return [];}if(_78.toArray){return _78.toArray();}else{var _79=[];for(var i=0;i<_78.length;i++){_79.push(_78[i]);}return _79;}};Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse;}Object.extend(Array.prototype,{_each:function(_7b){for(var i=0;i<this.length;i++){_7b(this[i]);}},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(_7d){return _7d!=undefined||_7d!=null;});},flatten:function(){return this.inject([],function(_7e,_7f){return _7e.concat(_7f&&_7f.constructor==Array?_7f.flatten():[_7f]);});},without:function(){var _80=$A(arguments);return this.select(function(_81){return !_80.include(_81);});},indexOf:function(_82){for(var i=0;i<this.length;i++){if(this[i]==_82){return i;}}return -1;},reverse:function(_84){return (_84!==false?this:this.toArray())._reverse();},inspect:function(){return "["+this.map(Object.inspect).join(", ")+"]";}});var Hash={_each:function(_85){for(var key in this){var _87=this[key];if(typeof _87=="function"){continue;}var _88=[key,_87];_88.key=key;_88.value=_87;_85(_88);}},keys:function(){return this.pluck("key");},values:function(){return this.pluck("value");},merge:function(_89){return $H(_89).inject($H(this),function(_8a,_8b){_8a[_8b.key]=_8b.value;return _8a;});},toQueryString:function(){return this.map(function(_8c){return _8c.map(encodeURIComponent).join("=");}).join("&");},inspect:function(){return "#<Hash:{"+this.map(function(_8d){return _8d.map(Object.inspect).join(": ");}).join(", ")+"}>";}};function $H(_8e){var _8f=Object.extend({},_8e||{});Object.extend(_8f,Enumerable);Object.extend(_8f,Hash);return _8f;}ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(_90,end,_92){this.start=_90;this.end=end;this.exclusive=_92;},_each:function(_93){var _94=this.start;do{_93(_94);_94=_94.succ();}while(this.include(_94));},include:function(_95){if(_95<this.start){return false;}if(this.exclusive){return _95<this.end;}return _95<=this.end;}});var $R=function(_96,end,_98){return new ObjectRange(_96,end,_98);};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");})||false;},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(_99){this.responders._each(_99);},register:function(_9a){if(!this.include(_9a)){this.responders.push(_9a);}},unregister:function(_9b){this.responders=this.responders.without(_9b);},dispatch:function(_9c,_9d,_9e,_9f){this.each(function(_a0){if(_a0[_9c]&&typeof _a0[_9c]=="function"){try{_a0[_9c].apply(_a0,[_9d,_9e,_9f]);}catch(e){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++;},onComplete:function(){Ajax.activeRequestCount--;}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(_a1){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",parameters:""};Object.extend(this.options,_a1||{});},responseIsSuccess:function(){return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300);},responseIsFailure:function(){return !this.responseIsSuccess();}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(url,_a3){this.transport=Ajax.getTransport();this.setOptions(_a3);this.request(url);},request:function(url){var _a5=this.options.parameters||"";if(_a5.length>0){_a5+="&_=";}try{this.url=url;if(this.options.method=="get"&&_a5.length>0){this.url+=(this.url.match(/\?/)?"&":"?")+_a5;}Ajax.Responders.dispatch("onCreate",this,this.transport);this.transport.open(this.options.method,this.url,this.options.asynchronous);if(this.options.asynchronous){this.transport.onreadystatechange=this.onStateChange.bind(this);setTimeout((function(){this.respondToReadyState(1);}).bind(this),10);}this.setRequestHeaders();var _a6=this.options.postBody?this.options.postBody:_a5;this.transport.send(this.options.method=="post"?_a6:null);}catch(e){this.dispatchException(e);}},setRequestHeaders:function(){var _a7=["X-Requested-With","XMLHttpRequest","X-Prototype-Version",Prototype.Version,"Accept","text/javascript, text/html, application/xml, text/xml, */*"];if(this.options.method=="post"){_a7.push("Content-type",this.options.contentType);if(this.transport.overrideMimeType){_a7.push("Connection","close");}}if(this.options.requestHeaders){_a7.push.apply(_a7,this.options.requestHeaders);}for(var i=0;i<_a7.length;i+=2){this.transport.setRequestHeader(_a7[i],_a7[i+1]);}},onStateChange:function(){var _a9=this.transport.readyState;if(_a9!=1){this.respondToReadyState(this.transport.readyState);}},header:function(_aa){try{return this.transport.getResponseHeader(_aa);}catch(e){}},evalJSON:function(){try{return eval("("+this.header("X-JSON")+")");}catch(e){}},evalResponse:function(){try{return eval(this.transport.responseText);}catch(e){this.dispatchException(e);}},respondToReadyState:function(_ab){var _ac=Ajax.Request.Events[_ab];var _ad=this.transport,json=this.evalJSON();if(_ac=="Complete"){try{(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(_ad,json);}catch(e){this.dispatchException(e);}if((this.header("Content-type")||"").match(/^text\/javascript/i)){this.evalResponse();}}try{(this.options["on"+_ac]||Prototype.emptyFunction)(_ad,json);Ajax.Responders.dispatch("on"+_ac,this,_ad,json);}catch(e){this.dispatchException(e);}if(_ac=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction;}},dispatchException:function(_ae){(this.options.onException||Prototype.emptyFunction)(this,_ae);Ajax.Responders.dispatch("onException",this,_ae);}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_af,url,_b1){this.containers={success:_af.success?$(_af.success):$(_af),failure:_af.failure?$(_af.failure):(_af.success?null:$(_af))};this.transport=Ajax.getTransport();this.setOptions(_b1);var _b2=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(_b3,_b4){this.updateContent();_b2(_b3,_b4);}).bind(this);this.request(url);},updateContent:function(){var _b5=this.responseIsSuccess()?this.containers.success:this.containers.failure;var _b6=this.transport.responseText;if(!this.options.evalScripts){_b6=_b6.stripScripts();}if(_b5){if(this.options.insertion){new this.options.insertion(_b5,_b6);}else{Element.update(_b5,_b6);}}if(this.responseIsSuccess()){if(this.onComplete){setTimeout(this.onComplete.bind(this),10);}}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(_b7,url,_b9){this.setOptions(_b9);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=_b7;this.url=url;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(_ba){if(this.options.decay){this.decay=(_ba.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=_ba.responseText;}this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});function $(){var _bb=[],element;for(var i=0;i<arguments.length;i++){element=arguments[i];if(typeof element=="string"){element=document.getElementById(element);}_bb.push(Element.extend(element));}return _bb.length<2?_bb[0]:_bb;}document.getElementsByClassName=function(_bd,_be){var _bf=($(_be)||document.body).getElementsByTagName("*");return $A(_bf).inject([],function(_c0,_c1){if(_c1.className.match(new RegExp("(^|\\s)"+_bd+"(\\s|$)"))){_c0.push(Element.extend(_c1));}return _c0;});};if(!window.Element){var Element=new Object();}Element.extend=function(_c2){if(!_c2){return;}if(_nativeExtensions){return _c2;}if(!_c2._extended&&_c2.tagName&&_c2!=window){var _c3=Element.Methods,cache=Element.extend.cache;for(property in _c3){var _c4=_c3[property];if(typeof _c4=="function"){_c2[property]=cache.findOrStore(_c4);}}}_c2._extended=true;return _c2;};Element.extend.cache={findOrStore:function(_c5){return this[_c5]=this[_c5]||function(){return _c5.apply(null,[this].concat($A(arguments)));};}};Element.Methods={visible:function(_c6){return $(_c6).style.display!="none";},toggle:function(){for(var i=0;i<arguments.length;i++){var _c8=$(arguments[i]);Element[Element.visible(_c8)?"hide":"show"](_c8);}},hide:function(){for(var i=0;i<arguments.length;i++){var _ca=$(arguments[i]);_ca.style.display="none";}},show:function(){for(var i=0;i<arguments.length;i++){var _cc=$(arguments[i]);_cc.style.display="";}},remove:function(_cd){_cd=$(_cd);_cd.parentNode.removeChild(_cd);},update:function(_ce,_cf){$(_ce).innerHTML=_cf.stripScripts();setTimeout(function(){_cf.evalScripts();},10);},replace:function(_d0,_d1){_d0=$(_d0);if(_d0.outerHTML){_d0.outerHTML=_d1.stripScripts();}else{var _d2=_d0.ownerDocument.createRange();_d2.selectNodeContents(_d0);_d0.parentNode.replaceChild(_d2.createContextualFragment(_d1.stripScripts()),_d0);}setTimeout(function(){_d1.evalScripts();},10);},getHeight:function(_d3){_d3=$(_d3);return _d3.offsetHeight;},classNames:function(_d4){return new Element.ClassNames(_d4);},hasClassName:function(_d5,_d6){if(!(_d5=$(_d5))){return;}return Element.classNames(_d5).include(_d6);},addClassName:function(_d7,_d8){if(!(_d7=$(_d7))){return;}return Element.classNames(_d7).add(_d8);},removeClassName:function(_d9,_da){if(!(_d9=$(_d9))){return;}return Element.classNames(_d9).remove(_da);},cleanWhitespace:function(_db){_db=$(_db);for(var i=0;i<_db.childNodes.length;i++){var _dd=_db.childNodes[i];if(_dd.nodeType==3&&!/\S/.test(_dd.nodeValue)){Element.remove(_dd);}}},empty:function(_de){return $(_de).innerHTML.match(/^\s*$/);},childOf:function(_df,_e0){_df=$(_df),_e0=$(_e0);while(_df=_df.parentNode){if(_df==_e0){return true;}}return false;},scrollTo:function(_e1){_e1=$(_e1);var x=_e1.x?_e1.x:_e1.offsetLeft,y=_e1.y?_e1.y:_e1.offsetTop;window.scrollTo(x,y);},getStyle:function(_e3,_e4){_e3=$(_e3);var _e5=_e3.style[_e4.camelize()];if(!_e5){if(document.defaultView&&document.defaultView.getComputedStyle){var css=document.defaultView.getComputedStyle(_e3,null);_e5=css?css.getPropertyValue(_e4):null;}else{if(_e3.currentStyle){_e5=_e3.currentStyle[_e4.camelize()];}}}if(window.opera&&["left","top","right","bottom"].include(_e4)){if(Element.getStyle(_e3,"position")=="static"){_e5="auto";}}return _e5=="auto"?null:_e5;},setStyle:function(_e7,_e8){_e7=$(_e7);for(var _e9 in _e8){_e7.style[_e9.camelize()]=_e8[_e9];}},getDimensions:function(_ea){_ea=$(_ea);if(Element.getStyle(_ea,"display")!="none"){return {width:_ea.offsetWidth,height:_ea.offsetHeight};}var els=_ea.style;var _ec=els.visibility;var _ed=els.position;els.visibility="hidden";els.position="absolute";els.display="";var _ee=_ea.clientWidth;var _ef=_ea.clientHeight;els.display="none";els.position=_ed;els.visibility=_ec;return {width:_ee,height:_ef};},makePositioned:function(_f0){_f0=$(_f0);var pos=Element.getStyle(_f0,"position");if(pos=="static"||!pos){_f0._madePositioned=true;_f0.style.position="relative";if(window.opera){_f0.style.top=0;_f0.style.left=0;}}},undoPositioned:function(_f2){_f2=$(_f2);if(_f2._madePositioned){_f2._madePositioned=undefined;_f2.style.position=_f2.style.top=_f2.style.left=_f2.style.bottom=_f2.style.right="";}},makeClipping:function(_f3){_f3=$(_f3);if(_f3._overflow){return;}_f3._overflow=_f3.style.overflow;if((Element.getStyle(_f3,"overflow")||"visible")!="hidden"){_f3.style.overflow="hidden";}},undoClipping:function(_f4){_f4=$(_f4);if(_f4._overflow){return;}_f4.style.overflow=_f4._overflow;_f4._overflow=undefined;}};Object.extend(Element,Element.Methods);var _nativeExtensions=false;if(!HTMLElement&&/Konqueror|Safari|KHTML/.test(navigator.userAgent)){var HTMLElement={};HTMLElement.prototype=document.createElement("div").__proto__;}Element.addMethods=function(_f5){Object.extend(Element.Methods,_f5||{});if(typeof HTMLElement!="undefined"){var _f6=Element.Methods,cache=Element.extend.cache;for(property in _f6){var _f7=_f6[property];if(typeof _f7=="function"){HTMLElement.prototype[property]=cache.findOrStore(_f7);}}_nativeExtensions=true;}};Element.addMethods();var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(_f8){this.adjacency=_f8;};Abstract.Insertion.prototype={initialize:function(_f9,_fa){this.element=$(_f9);this.content=_fa.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content);}catch(e){var _fb=this.element.tagName.toLowerCase();if(_fb=="tbody"||_fb=="tr"){this.insertContent(this.contentFromAnonymousTable());}else{throw e;}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange){this.initializeRange();}this.insertContent([this.range.createContextualFragment(this.content)]);}setTimeout(function(){_fa.evalScripts();},10);},contentFromAnonymousTable:function(){var div=document.createElement("div");div.innerHTML="<table><tbody>"+this.content+"</tbody></table>";return $A(div.childNodes[0].childNodes[0].childNodes);}};var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){this.range.setStartBefore(this.element);},insertContent:function(_fd){_fd.each((function(_fe){this.element.parentNode.insertBefore(_fe,this.element);}).bind(this));}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true);},insertContent:function(_ff){_ff.reverse(false).each((function(_100){this.element.insertBefore(_100,this.element.firstChild);}).bind(this));}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element);},insertContent:function(_101){_101.each((function(_102){this.element.appendChild(_102);}).bind(this));}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){this.range.setStartAfter(this.element);},insertContent:function(_103){_103.each((function(_104){this.element.parentNode.insertBefore(_104,this.element.nextSibling);}).bind(this));}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(_105){this.element=$(_105);},_each:function(_106){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(_106);},set:function(_108){this.element.className=_108;},add:function(_109){if(this.include(_109)){return;}this.set(this.toArray().concat(_109).join(" "));},remove:function(_10a){if(!this.include(_10a)){return;}this.set(this.select(function(_10b){return _10b!=_10a;}).join(" "));},toString:function(){return this.toArray().join(" ");}};Object.extend(Element.ClassNames.prototype,Enumerable);var Selector=Class.create();Selector.prototype={initialize:function(_10c){this.params={classNames:[]};this.expression=_10c.toString().strip();this.parseExpression();this.compileMatcher();},parseExpression:function(){function abort(_10d){throw "Parse error in selector: "+_10d;}if(this.expression==""){abort("empty expression");}var _10e=this.params,expr=this.expression,match,modifier,clause,rest;while(match=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){_10e.attributes=_10e.attributes||[];_10e.attributes.push({name:match[2],operator:match[3],value:match[4]||match[5]||""});expr=match[1];}if(expr=="*"){return this.params.wildcard=true;}while(match=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){modifier=match[1],clause=match[2],rest=match[3];switch(modifier){case "#":_10e.id=clause;break;case ".":_10e.classNames.push(clause);break;case "":case undefined:_10e.tagName=clause.toUpperCase();break;default:abort(expr.inspect());}expr=rest;}if(expr.length>0){abort(expr.inspect());}},buildMatchExpression:function(){var _10f=this.params,conditions=[],clause;if(_10f.wildcard){conditions.push("true");}if(clause=_10f.id){conditions.push("element.id == "+clause.inspect());}if(clause=_10f.tagName){conditions.push("element.tagName.toUpperCase() == "+clause.inspect());}if((clause=_10f.classNames).length>0){for(var i=0;i<clause.length;i++){conditions.push("Element.hasClassName(element, "+clause[i].inspect()+")");}}if(clause=_10f.attributes){clause.each(function(_111){var _112="element.getAttribute("+_111.name.inspect()+")";var _113=function(_114){return _112+" && "+_112+".split("+_114.inspect()+")";};switch(_111.operator){case "=":conditions.push(_112+" == "+_111.value.inspect());break;case "~=":conditions.push(_113(" ")+".include("+_111.value.inspect()+")");break;case "|=":conditions.push(_113("-")+".first().toUpperCase() == "+_111.value.toUpperCase().inspect());break;case "!=":conditions.push(_112+" != "+_111.value.inspect());break;case "":case undefined:conditions.push(_112+" != null");break;default:throw "Unknown operator "+_111.operator+" in selector";}});}return conditions.join(" && ");},compileMatcher:function(){this.match=new Function("element","if (!element.tagName) return false; return "+this.buildMatchExpression());},findElements:function(_115){var _116;if(_116=$(this.params.id)){if(this.match(_116)){if(!_115||Element.childOf(_116,_115)){return [_116];}}}_115=(_115||document).getElementsByTagName(this.params.tagName||"*");var _117=[];for(var i=0;i<_115.length;i++){if(this.match(_116=_115[i])){_117.push(Element.extend(_116));}}return _117;},toString:function(){return this.expression;}};function $$(){return $A(arguments).map(function(_119){return _119.strip().split(/\s+/).inject([null],function(_11a,expr){var _11c=new Selector(expr);return _11a.map(_11c.findElements.bind(_11c)).flatten();});}).flatten();}var Field={clear:function(){for(var i=0;i<arguments.length;i++){$(arguments[i]).value="";}},focus:function(_11e){$(_11e).focus();},present:function(){for(var i=0;i<arguments.length;i++){if($(arguments[i]).value==""){return false;}}return true;},select:function(_120){$(_120).select();},activate:function(_121){_121=$(_121);_121.focus();if(_121.select){_121.select();}}};var Form={serialize:function(form){var _123=Form.getElements($(form));var _124=new Array();for(var i=0;i<_123.length;i++){var _126=Form.Element.serialize(_123[i]);if(_126){_124.push(_126);}}return _124.join("&");},getElements:function(form){form=$(form);var _128=new Array();for(var _129 in Form.Element.Serializers){var _12a=form.getElementsByTagName(_129);for(var j=0;j<_12a.length;j++){_128.push(_12a[j]);}}return _128;},getInputs:function(form,_12d,name){form=$(form);var _12f=form.getElementsByTagName("input");if(!_12d&&!name){return _12f;}var _130=new Array();for(var i=0;i<_12f.length;i++){var _132=_12f[i];if((_12d&&_132.type!=_12d)||(name&&_132.name!=name)){continue;}_130.push(_132);}return _130;},disable:function(form){var _134=Form.getElements(form);for(var i=0;i<_134.length;i++){var _136=_134[i];_136.blur();_136.disabled="true";}},enable:function(form){var _138=Form.getElements(form);for(var i=0;i<_138.length;i++){var _13a=_138[i];_13a.disabled="";}},findFirstElement:function(form){return Form.getElements(form).find(function(_13c){return _13c.type!="hidden"&&!_13c.disabled&&["input","select","textarea"].include(_13c.tagName.toLowerCase());});},focusFirstElement:function(form){Field.activate(Form.findFirstElement(form));},reset:function(form){$(form).reset();}};Form.Element={serialize:function(_13f){_13f=$(_13f);var _140=_13f.tagName.toLowerCase();var _141=Form.Element.Serializers[_140](_13f);if(_141){var key=encodeURIComponent(_141[0]);if(key.length==0){return;}if(_141[1].constructor!=Array){_141[1]=[_141[1]];}return _141[1].map(function(_143){return key+"="+encodeURIComponent(_143);}).join("&");}},getValue:function(_144){_144=$(_144);var _145=_144.tagName.toLowerCase();var _146=Form.Element.Serializers[_145](_144);if(_146){return _146[1];}}};Form.Element.Serializers={input:function(_147){switch(_147.type.toLowerCase()){case "submit":case "hidden":case "password":case "text":return Form.Element.Serializers.textarea(_147);case "checkbox":case "radio":return Form.Element.Serializers.inputSelector(_147);}return false;},inputSelector:function(_148){if(_148.checked){return [_148.name,_148.value];}},textarea:function(_149){return [_149.name,_149.value];},select:function(_14a){return Form.Element.Serializers[_14a.type=="select-one"?"selectOne":"selectMany"](_14a);},selectOne:function(_14b){var _14c="",opt,index=_14b.selectedIndex;if(index>=0){opt=_14b.options[index];_14c=opt.value||opt.text;}return [_14b.name,_14c];},selectMany:function(_14d){var _14e=[];for(var i=0;i<_14d.length;i++){var opt=_14d.options[i];if(opt.selected){_14e.push(opt.value||opt.text);}}return [_14d.name,_14e];}};var $F=Form.Element.getValue;Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(_151,_152,_153){this.frequency=_152;this.element=$(_151);this.callback=_153;this.lastValue=this.getValue();this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){var _154=this.getValue();if(this.lastValue!=_154){this.callback(this.element,_154);this.lastValue=_154;}}};Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=function(){};Abstract.EventObserver.prototype={initialize:function(_155,_156){this.element=$(_155);this.callback=_156;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks();}else{this.registerCallback(this.element);}},onElementEvent:function(){var _157=this.getValue();if(this.lastValue!=_157){this.callback(this.element,_157);this.lastValue=_157;}},registerFormCallbacks:function(){var _158=Form.getElements(this.element);for(var i=0;i<_158.length;i++){this.registerCallback(_158[i]);}},registerCallback:function(_15a){if(_15a.type){switch(_15a.type.toLowerCase()){case "checkbox":case "radio":Event.observe(_15a,"click",this.onElementEvent.bind(this));break;case "password":case "text":case "textarea":case "select-one":case "select-multiple":Event.observe(_15a,"change",this.onElementEvent.bind(this));break;}}}};Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element);}});if(!window.Event){var Event=new Object();}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(_15b){return _15b.target||_15b.srcElement;},isLeftClick:function(_15c){return (((_15c.which)&&(_15c.which==1))||((_15c.button)&&(_15c.button==1)));},pointerX:function(_15d){return _15d.pageX||(_15d.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));},pointerY:function(_15e){return _15e.pageY||(_15e.clientY+(document.documentElement.scrollTop||document.body.scrollTop));},stop:function(_15f){if(_15f.preventDefault){_15f.preventDefault();_15f.stopPropagation();}else{_15f.returnValue=false;_15f.cancelBubble=true;}},findElement:function(_160,_161){var _162=Event.element(_160);while(_162.parentNode&&(!_162.tagName||(_162.tagName.toUpperCase()!=_161.toUpperCase()))){_162=_162.parentNode;}return _162;},observers:false,_observeAndCache:function(_163,name,_165,_166){if(!this.observers){this.observers=[];}if(_163.addEventListener){this.observers.push([_163,name,_165,_166]);_163.addEventListener(name,_165,_166);}else{if(_163.attachEvent){this.observers.push([_163,name,_165,_166]);_163.attachEvent("on"+name,_165);}}},unloadCache:function(){if(!Event.observers){return;}for(var i=0;i<Event.observers.length;i++){Event.stopObserving.apply(this,Event.observers[i]);Event.observers[i][0]=null;}Event.observers=false;},observe:function(_168,name,_16a,_16b){var _16c=$(_16c);_16b=_16b||false;if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_16c.attachEvent)){name="keydown";}this._observeAndCache(_16c,name,_16a,_16b);},stopObserving:function(_16d,name,_16f,_170){var _171=$(_171);_170=_170||false;if(name=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||_171.detachEvent)){name="keydown";}if(_171.removeEventListener){_171.removeEventListener(name,_16f,_170);}else{if(_171.detachEvent){try{_171.detachEvent("on"+name,_16f);}catch(e){}}}}});if(navigator.appVersion.match(/\bMSIE\b/)){Event.observe(window,"unload",Event.unloadCache,false);}var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},realOffset:function(_172){var _173=0,valueL=0;do{_173+=_172.scrollTop||0;valueL+=_172.scrollLeft||0;_172=_172.parentNode;}while(_172);return [valueL,_173];},cumulativeOffset:function(_174){var _175=0,valueL=0;do{_175+=_174.offsetTop||0;valueL+=_174.offsetLeft||0;_174=_174.offsetParent;}while(_174);return [valueL,_175];},positionedOffset:function(_176){var _177=0,valueL=0;do{_177+=_176.offsetTop||0;valueL+=_176.offsetLeft||0;_176=_176.offsetParent;if(_176){p=Element.getStyle(_176,"position");if(p=="relative"||p=="absolute"){break;}}}while(_176);return [valueL,_177];},offsetParent:function(_178){if(_178.offsetParent){return _178.offsetParent;}if(_178==document.body){return _178;}while((_178=_178.parentNode)&&_178!=document.body){if(Element.getStyle(_178,"position")!="static"){return _178;}}return document.body;},within:function(_179,x,y){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(_179,x,y);}this.xcomp=x;this.ycomp=y;this.offset=this.cumulativeOffset(_179);return (y>=this.offset[1]&&y<this.offset[1]+_179.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_179.offsetWidth);},withinIncludingScrolloffsets:function(_17c,x,y){var _17f=this.realOffset(_17c);this.xcomp=x+_17f[0]-this.deltaX;this.ycomp=y+_17f[1]-this.deltaY;this.offset=this.cumulativeOffset(_17c);return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_17c.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_17c.offsetWidth);},overlap:function(mode,_181){if(!mode){return 0;}if(mode=="vertical"){return ((this.offset[1]+_181.offsetHeight)-this.ycomp)/_181.offsetHeight;}if(mode=="horizontal"){return ((this.offset[0]+_181.offsetWidth)-this.xcomp)/_181.offsetWidth;}},clone:function(_182,_183){_182=$(_182);_183=$(_183);_183.style.position="absolute";var _184=this.cumulativeOffset(_182);_183.style.top=_184[1]+"px";_183.style.left=_184[0]+"px";_183.style.width=_182.offsetWidth+"px";_183.style.height=_182.offsetHeight+"px";},page:function(_185){var _186=0,valueL=0;var _187=_185;do{_186+=_187.offsetTop||0;valueL+=_187.offsetLeft||0;if(_187.offsetParent==document.body){if(Element.getStyle(_187,"position")=="absolute"){break;}}}while(_187=_187.offsetParent);_187=_185;do{_186-=_187.scrollTop||0;valueL-=_187.scrollLeft||0;}while(_187=_187.parentNode);return [valueL,_186];},clone:function(_188,_189){var _18a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});_188=$(_188);var p=Position.page(_188);_189=$(_189);var _18c=[0,0];var _18d=null;if(Element.getStyle(_189,"position")=="absolute"){_18d=Position.offsetParent(_189);_18c=Position.page(_18d);}if(_18d==document.body){_18c[0]-=document.body.offsetLeft;_18c[1]-=document.body.offsetTop;}if(_18a.setLeft){_189.style.left=(p[0]-_18c[0]+_18a.offsetLeft)+"px";}if(_18a.setTop){_189.style.top=(p[1]-_18c[1]+_18a.offsetTop)+"px";}if(_18a.setWidth){_189.style.width=_188.offsetWidth+"px";}if(_18a.setHeight){_189.style.height=_188.offsetHeight+"px";}},absolutize:function(_18e){_18e=$(_18e);if(_18e.style.position=="absolute"){return;}Position.prepare();var _18f=Position.positionedOffset(_18e);var top=_18f[1];var left=_18f[0];var _192=_18e.clientWidth;var _193=_18e.clientHeight;_18e._originalLeft=left-parseFloat(_18e.style.left||0);_18e._originalTop=top-parseFloat(_18e.style.top||0);_18e._originalWidth=_18e.style.width;_18e._originalHeight=_18e.style.height;_18e.style.position="absolute";_18e.style.top=top+"px";_18e.style.left=left+"px";_18e.style.width=_192+"px";_18e.style.height=_193+"px";},relativize:function(_194){_194=$(_194);if(_194.style.position=="relative"){return;}Position.prepare();_194.style.position="relative";var top=parseFloat(_194.style.top||0)-(_194._originalTop||0);var left=parseFloat(_194.style.left||0)-(_194._originalLeft||0);_194.style.top=top+"px";_194.style.left=left+"px";_194.style.height=_194._originalHeight;_194.style.width=_194._originalWidth;}};if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(_197){var _198=0,valueL=0;do{_198+=_197.offsetTop||0;valueL+=_197.offsetLeft||0;if(_197.offsetParent==document.body){if(Element.getStyle(_197,"position")=="absolute"){break;}}_197=_197.offsetParent;}while(_197);return [valueL,_198];};}
\ No newline at end of file diff --git a/wp-includes/js/tinymce/themes/advanced/jscripts/link.js b/wp-includes/js/tinymce/themes/advanced/jscripts/link.js index 31b3878..74045bd 100644 --- a/wp-includes/js/tinymce/themes/advanced/jscripts/link.js +++ b/wp-includes/js/tinymce/themes/advanced/jscripts/link.js @@ -25,7 +25,7 @@ function init() { option.selected = true; } - document.forms[0].href.value = tinyMCE.getWindowArg('href'); + document.forms[0].href.value = tinyMCE.getWindowArg('href') || 'http://'; document.forms[0].linktitle.value = tinyMCE.getWindowArg('title'); document.forms[0].insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true); diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index b536b92..7408e17 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -3,7 +3,7 @@ function get_locale() { global $locale; if (isset($locale)) - return $locale; + return apply_filters( 'locale', $locale ); // WPLANG is defined in wp-config. if (defined('WPLANG')) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 5c51359..e1d83c5 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -158,7 +158,7 @@ function wp_link_pages($args = '') { if ( '' == get_option('permalink_structure') ) $output .= '<a href="' . get_permalink() . '&page=' . $i . '">'; else - $output .= '<a href="' . trailingslashit( get_permalink() ) . $i . '/">'; + $output .= '<a href="' . trailingslashit(get_permalink()) . $i . '/">'; } $output .= $j; if ( ($i != $page) || ((!$more) && ($page==1)) ) @@ -171,16 +171,16 @@ function wp_link_pages($args = '') { $i = $page - 1; if ( $i && $more ) { if ( '' == get_option('permalink_structure') ) - $output .= '<a href="' . get_permalink() . '&page=' . $i . '">'.$previouspagelink.'</a>'; + $output .= '<a href="' . get_permalink() . '&page=' . $i . '">' . $previouspagelink . '</a>'; else $output .= '<a href="' . get_permalink() . $i . '/">'.$previouspagelink.'</a>'; } $i = $page + 1; if ( $i <= $numpages && $more ) { if ( '' == get_option('permalink_structure') ) - $output .= '<a href="'.get_permalink() . '&page=' . $i . '">'.$nextpagelink.'</a>'; + $output .= '<a href="' . get_permalink() . '&page=' . $i . '">'.$nextpagelink.'</a>'; else - $output .= '<a href="'.get_permalink().$i.'/">'.$nextpagelink.'</a>'; + $output .= '<a href="' . trailingslashit(get_permalink()) . $i . '/">' . $nextpagelink . '</a>'; } $output .= $after; } @@ -269,11 +269,17 @@ function wp_list_pages($args = '') { parse_str($args, $r); $defaults = array('depth' => 0, 'show_date' => '', 'date_format' => get_option('date_format'), - 'child_of' => 0, 'title_li' => __('Pages'), 'echo' => 1, 'authors' => ''); + 'child_of' => 0, 'exclude' => '', 'title_li' => __('Pages'), 'echo' => 1, 'authors' => ''); $r = array_merge($defaults, $r); $output = ''; + // sanitize, mostly to keep spaces out + $r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']); + + // Allow plugins to filter an array of excluded pages + $r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude']))); + // Query pages. $pages = get_pages($r); @@ -347,12 +353,11 @@ function get_attachment_icon($id = 0, $fullsize = false, $max_dims = false) { $mime = $post->post_mime_type; - $imagedata = get_post_meta($post->ID, '_wp_attachment_metadata', true); + $imagedata = wp_get_attachment_metadata( $post->ID ); - $file = get_post_meta($post->ID, '_wp_attached_file', true); + $file = get_attached_file( $post->ID ); $exts = array('jpg', 'gif', 'png'); - if ( !$fullsize && !empty($imagedata['thumb']) && ($thumbfile = str_replace(basename($file), $imagedata['thumb'], $file)) && file_exists($thumbfile) ) { diff --git a/wp-includes/post.php b/wp-includes/post.php index 5202c4c..0e9110e 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4,8 +4,25 @@ // Post functions // -function get_attached_file($attachment_id) { - return get_post_meta($attachment_id, '_wp_attached_file', true); +function get_attached_file( $attachment_id, $unfiltered = false ) { + $file = get_post_meta( $attachment_id, '_wp_attached_file', true ); + if ( $unfiltered ) + return $file; + return apply_filters( 'get_attached_file', $file, $attachment_id ); +} + +function update_attached_file( $attachment_id, $file ) { + if ( !get_post( $attachment_id ) ) + return false; + + $old_file = get_attached_file( $attachment_id, true ); + + $file = apply_filters( 'update_attached_file', $file, $attachment_id ); + + if ( $old_file ) + return update_post_meta( $attachment_id, '_wp_attached_file', $file, $old_file ); + else + return add_post_meta( $attachment_id, '_wp_attached_file', $file ); } function &get_children($args = '', $output = OBJECT) { @@ -410,6 +427,8 @@ function wp_delete_post($postid = 0) { if ( 'page' == $post->post_type ) $wpdb->query("UPDATE $wpdb->posts SET post_parent = $post->post_parent WHERE post_parent = $postid AND post_type = 'page'"); + $wpdb->query("UPDATE $wpdb->posts SET post_parent = $post->post_parent WHERE post_parent = $postid AND post_type = 'attachment'"); + $wpdb->query("DELETE FROM $wpdb->posts WHERE ID = $postid"); $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_post_ID = $postid"); @@ -429,22 +448,12 @@ function wp_delete_post($postid = 0) { return $post; } -function wp_get_post_categories($post_ID = 0) { - global $wpdb; - - $post_ID = (int) $post_ID; - - $sql = "SELECT category_id - FROM $wpdb->post2cat - WHERE post_id = '$post_ID' - ORDER BY category_id"; - - $result = $wpdb->get_col($sql); - - if ( !$result ) - $result = array(); - - return array_unique($result); +function wp_get_post_categories($post_id = 0) { + $cats = &get_the_category($post_id); + $cat_ids = array(); + foreach ( $cats as $cat ) + $cat_ids[] = (int) $cat->cat_ID; + return array_unique($cat_ids); } function wp_get_recent_posts($num = 10) { @@ -1346,7 +1355,7 @@ function wp_insert_attachment($object, $file = false, $post_parent = 0) { wp_set_post_categories($post_ID, $post_category); if ( $file ) - add_post_meta($post_ID, '_wp_attached_file', $file); + update_attached_file( $post_ID, $file ); clean_post_cache($post_ID); @@ -1369,8 +1378,8 @@ function wp_delete_attachment($postid) { if ( 'attachment' != $post->post_type ) return false; - $meta = get_post_meta($postid, '_wp_attachment_metadata', true); - $file = get_post_meta($postid, '_wp_attached_file', true); + $meta = wp_get_attachment_metadata( $postid ); + $file = get_attached_file( $postid ); $wpdb->query("DELETE FROM $wpdb->posts WHERE ID = '$postid'"); @@ -1399,4 +1408,27 @@ function wp_delete_attachment($postid) { return $post; } +function wp_get_attachment_metadata( $post_id, $unfiltered = false ) { + $post_id = (int) $post_id; + + $data = get_post_meta( $post_id, '_wp_attachment_metadata', true ); + if ( $unfiltered ) + return $data; + return apply_filters( 'wp_get_attachment_metadata', $data, $post_id ); +} + +function wp_update_attachment_metadata( $post_id, $data ) { + if ( !get_post( $post_id ) ) + return false; + + $old_data = wp_get_attachment_metadata( $post_id, true ); + + $data = apply_filters( 'wp_update_attachment_metadata', $data, $post_id ); + + if ( $old_data ) + return update_post_meta( $post_id, '_wp_attachment_metadata', $data, $old_data ); + else + return add_post_meta( $post_id, '_wp_attachment_metadata', $data ); +} + ?> diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 0c33252..e0923fc 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -10,10 +10,10 @@ class WP_Scripts { } function default_scripts() { - $this->add( 'dbx', '/wp-includes/js/dbx.js', false, '2.05' ); - $this->add( 'fat', '/wp-includes/js/fat.js', false, '1.0-RC1_3660' ); - $this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' ); - $this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3517' ); + $this->add( 'dbx', '/wp-includes/js/dbx.compressed.js', false, '2.05' ); + $this->add( 'fat', '/wp-includes/js/fat.compressed.js', false, '1.0-RC1_3660' ); + $this->add( 'sack', '/wp-includes/js/tw-sack.compressed.js', false, '1.6.1' ); + $this->add( 'quicktags', '/wp-includes/js/quicktags.compressed.js', false, '3517' ); $this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' ); $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20061113' ); $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php'); @@ -21,16 +21,16 @@ class WP_Scripts { $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.0'); $this->add( 'autosave', '/wp-includes/js/autosave.js.php', array('prototype', 'sack'), '4508'); $this->add( 'wp-ajax', '/wp-includes/js/wp-ajax-js.php', array('prototype'), '4459'); - $this->add( 'listman', '/wp-includes/js/list-manipulation-js.php', array('wp-ajax', 'fat'), '4459'); + $this->add( 'listman', '/wp-includes/js/list-manipulation-js.php', array('wp-ajax', 'fat'), '4583'); if ( is_admin() ) { $this->add( 'dbx-admin-key', '/wp-admin/dbx-admin-key-js.php', array('dbx'), '3651' ); $this->add( 'ajaxcat', '/wp-admin/cat-js.php', array('listman'), '3684' ); $this->add( 'admin-categories', '/wp-admin/categories.js', array('listman'), '3684' ); $this->add( 'admin-custom-fields', '/wp-admin/custom-fields.js', array('listman'), '3733' ); $this->add( 'admin-comments', '/wp-admin/edit-comments.js', array('listman'), '3847' ); - $this->add( 'admin-users', '/wp-admin/users.js', array('listman'), '3684' ); + $this->add( 'admin-users', '/wp-admin/users.js', array('listman'), '4583' ); $this->add( 'xfn', '/wp-admin/xfn.js', false, '3517' ); - $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '4466b' ); + $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '4535' ); } } diff --git a/wp-includes/user.php b/wp-includes/user.php index e1f9770..4d202a6 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -81,7 +81,7 @@ function get_usermeta( $user_id, $meta_key = '') { $user_id = (int) $user_id; if ( !empty($meta_key) ) { - $meta_key = preg_replace('|a-z0-9_|i', '', $meta_key); + $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); $metas = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'"); } else { $metas = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user_id'"); diff --git a/wp-login.php b/wp-login.php index d0deaae..abb85e1 100644 --- a/wp-login.php +++ b/wp-login.php @@ -166,7 +166,7 @@ break; case 'resetpass' : case 'rp' : - $key = preg_replace('/a-z0-9/i', '', $_GET['key']); + $key = preg_replace('/[^a-z0-9]/i', '', $_GET['key']); if ( empty( $key ) ) { wp_redirect('wp-login.php?action=lostpassword&error=invalidkey'); exit(); @@ -881,8 +881,8 @@ class wp_xmlrpc_server extends IXR_Server { 'guid' => $upload[ 'url' ] ); // Save the data - $id = wp_insert_attachment($attachment, $upload[ 'file' ], $post_id); - add_post_meta($id, '_wp_attachment_metadata', array()); + $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id ); + wp_update_attachment_metadata( $id, array() ); return apply_filters( 'wp_handle_upload', array( 'file' => $upload[ 'file' ], 'url' => $upload[ 'url' ], 'type' => $type ) ); } |