From: Edward Z. Yang Date: Sat, 19 Jun 2010 09:15:44 +0000 (-0700) Subject: Wordpress 3.0 X-Git-Tag: wordpress-3.0 X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/commitdiff_plain/699231ae09f7057a4d0000cdf32e50a3df6a04ca Wordpress 3.0 Signed-off-by: Edward Z. Yang --- diff --git a/readme.html b/readme.html index f9b926f0..9b731ae4 100644 --- a/readme.html +++ b/readme.html @@ -2,90 +2,108 @@ - WordPress › ReadMe - + WordPress › ReadMe + -

- WordPress -
Version 2.9.2 +

+ WordPress +
Version 3.0

Semantic Personal Publishing Platform

First Things First

Welcome. WordPress is a very special project to me. Every developer and contributor adds something unique to the mix, and together we create something beautiful that I'm proud to be a part of. Thousands of hours have gone into WordPress, and we're dedicated to making it better every day. Thank you for making it part of your world.

-

— Matt Mullenweg

+

— Matt Mullenweg

Installation: Famous 5-minute install

    -
  1. Unzip the package in an empty directory.
  2. -
  3. Open up wp-config-sample.php with a text editor like WordPad or similar and fill in your database connection details.
  4. -
  5. Save the file as wp-config.php
  6. -
  7. Upload everything.
  8. -
  9. Open /wp-admin/install.php in your browser. This should setup the tables needed for your blog. If there is an error, double check your wp-config.php file, and try again. If it fails again, please go to the support forums with as much data as you can gather.
  10. -
  11. Note the password given to you.
  12. -
  13. The install script should then send you to the login page. Sign in with the username admin and the password generated during the installation. You can then click on 'Profile' to change the password.
  14. +
  15. Unzip the package in an empty directory and upload everything.
  16. +
  17. Open wp-admin/install.php in your browser. It will take you through the process to set up a wp-config.php file with your database connection details. +
      +
    1. If for some reason this doesn't work, don't worry. It doesn't work on all web hosts. Open up wp-config-sample.php with a text editor like WordPad or similar and fill in your database connection details.
    2. +
    3. Save the file as wp-config.php and upload it.
    4. +
    5. Open wp-admin/install.php in your browser.
    6. +
    +
  18. +
  19. Once the configuration file is set up, the installer will set up the tables needed for your blog. If there is an error, double check your wp-config.php file, and try again. If it fails again, please go to the support forums with as much data as you can gather.
  20. +
  21. If you did not enter a password, note the password given to you. If you did not provide a username, it will be admin.
  22. +
  23. The installer should then send you to the login page. Sign in with the username and password you chose during the installation. If a password was generated for you, you can then click on 'Profile' to change the password.

Upgrading

-

Before you upgrade anything, make sure you have backup copies of any files you may have modified such as index.php.

-

Upgrading from any previous WordPress to 2.9.2:

+

Using the Automatic Upgrader

+

If you are upgrading from version 2.7 or higher, you can use the automatic upgrader:

    -
  1. Delete your old WP files, saving ones you've modified.
  2. +
  3. Open the wp-admin/update-core.php in your browser and follow the instructions.
  4. +
  5. You wanted more, perhaps? That's it!
  6. +
+ +

Upgrading Manually

+
    +
  1. Before you upgrade anything, make sure you have backup copies of any files you may have modified such as index.php.
  2. +
  3. Delete your old WordPress files, saving ones you've modified.
  4. Upload the new files.
  5. Point your browser to /wp-admin/upgrade.php.
  6. -
  7. You wanted more, perhaps? That's it!
-

Template Changes

-

If you have customized your templates you will probably have to make some changes to them. If you're converting your 1.2 or earlier templates, we've created a special guide for you.

+ +

Theme Template Changes

+

If you have customized your theme templates, you may have to make some changes across major versions.

+ +

Migrating from other systems

+

WordPress can import from a number of systems. First you need to get WordPress installed and working as described above, before using our import tools.

+ +

System Requirements

+ + +

System Recommendations

+

Online Resources

If you have any questions that aren't addressed in this document, please take advantage of WordPress' numerous online resources:

-
The WordPress Codex
+
The WordPress Codex
The Codex is the encyclopedia of all things WordPress. It is the most comprehensive source of information for WordPress available.
-
The Development Blog
-
This is where you'll find the latest updates and news related to WordPress. Bookmark and check often.
-
WordPress Planet
+
The WordPress Blog
+
This is where you'll find the latest updates and news related to WordPress. Recent WordPress news appears in your administrative dashboard by default.
+
WordPress Planet
The WordPress Planet is a news aggregator that brings together posts from WordPress blogs around the web.
WordPress Support Forums
If you've looked everywhere and still can't find an answer, the support forums are very active and have a large community ready to help. To help them help you be sure to use a descriptive thread title and describe your question in as much detail as possible.
-
WordPress IRC Channel
-
Finally, there is an online chat channel that is used for discussion among people who use WordPress and occasionally support topics. The above wiki page should point you in the right direction. (irc.freenode.net #wordpress)
+
WordPress IRC Channel
+
There is an online chat channel that is used for discussion among people who use WordPress and occasionally support topics. The above wiki page should point you in the right direction. (irc.freenode.net #wordpress)
-

System Recommendations

- -

WordPress is the official continuation of b2/cafélog, which came from Michel V. The work has been continued by the WordPress developers. If you would like to support WordPress, please consider donating.

- -

Upgrading from another system

-

WordPress can import from a number of systems. First you need to get WordPress installed and working as described above.

- -

XML-RPC and Atom Interface

-

You can now post to your WordPress blog with tools like Windows Live Writer, Ecto, Bloggar, Radio Userland (which means you can use Radio's email-to-blog feature), NewzCrawler, and other tools that support the Blogging APIs! :) You can read more about XML-RPC support on the Codex.

+

XML-RPC and Atom Interface

+

You can post to your WordPress blog with tools like Windows Live Writer, Ecto, w.bloggar, Radio Userland (which means you can use Radio's email-to-blog feature), NewzCrawler, and other tools that support the blogging APIs! :) You can read more about XML-RPC support on the Codex.

Post via Email

-

You can post from an email client! To set this up go to your "Writing" options screen and fill in the connection details for your secret POP3 account. Then you need to set up wp-mail.php to execute periodically to check the mailbox for new posts. You can do it with Cron-jobs, or if your host doesn't support it you can look into the various website-monitoring services, and make them check your wp-mail.php URL.

+

You can post from an email client! To set this up go to your "Writing" options screen and fill in the connection details for your secret POP3 account. Then you need to set up wp-mail.php to execute periodically to check the mailbox for new posts. You can do it with cron-jobs, or if your host doesn't support it you can look into the various website-monitoring services, and make them check your wp-mail.php URL.

Posting is easy: Any email sent to the address you specify will be posted, with the subject as the title. It is best to keep the address discrete. The script will delete emails that are successfully posted.

User Roles

-

We've eliminated user levels in order to make way for the much more flexible roles system introduced in 2.0. You can read more about Roles and Capabilities on the Codex.

+

We introduced a very flexible roles system in version 2.0. You can read more about Roles and Capabilities on the Codex.

-

Final notes

+

Final Notes

Share the Love

WordPress has no multi-million dollar marketing campaign or celebrity sponsors, but we do have something even better—you. If you enjoy WordPress please consider telling a friend, setting it up for someone less knowledgable than yourself, or writing the author of a media article that overlooks us.

+

WordPress is the official continuation of b2/cafélog, which came from Michel V. The work has been continued by the WordPress developers. If you would like to support WordPress, please consider donating.

+

Copyright

-

WordPress is released under the GPL (see license.txt).

+

WordPress is released under the GPLv2 (see license.txt).

+ diff --git a/wp-activate.php b/wp-activate.php new file mode 100644 index 00000000..b9e77070 --- /dev/null +++ b/wp-activate.php @@ -0,0 +1,104 @@ +cache_enabled = false; + +do_action("activate_header"); + +function do_activate_header() { + do_action("activate_wp_head"); +} +add_action( 'wp_head', 'do_activate_header' ); + +function wpmu_activate_stylesheet() { + ?> + + + +
+ + +

+
+

+ +
+

+

+ +

+
+ + get_error_code() || 'blog_taken' == $result->get_error_code() ) { + $signup = $result->get_error_data(); + ?> +

+ '; + if ( $signup->domain . $signup->path == '' ) { + printf( __('Your account has been activated. You may now login to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) ); + } else { + printf( __('Your site at %2$s is active. You may now log in to your site using your chosen username of “%3$s”. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword' ) ); + } + echo '

'; + } else { + ?> +

+ '.$result->get_error_message().'

'; + } + } else { + extract($result); + $url = get_blogaddress_by_id( (int) $blog_id); + $user = new WP_User( (int) $user_id); + ?> +

+ +
+

user_login ?>

+

+
+ + +

View your site or Login'), $url, $url . 'wp-login.php' ); ?>

+ +

Login or go back to the homepage.' ), network_site_url('wp-login.php', 'login'), network_home_url() ); ?>

+ +
+ + \ No newline at end of file diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 5778a12e..a4ba6e1d 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -15,29 +15,34 @@ define('DOING_AJAX', true); define('WP_ADMIN', true); require_once('../wp-load.php'); -require_once('includes/admin.php'); + +if ( ! isset( $_REQUEST['action'] ) ) + die('-1'); + +require_once('./includes/admin.php'); @header('Content-Type: text/html; charset=' . get_option('blog_charset')); +send_nosniff_header(); do_action('admin_init'); if ( ! is_user_logged_in() ) { - if ( $_POST['action'] == 'autosave' ) { + if ( isset( $_POST['action'] ) && $_POST['action'] == 'autosave' ) { $id = isset($_POST['post_ID'])? (int) $_POST['post_ID'] : 0; if ( ! $id ) die('-1'); - $message = sprintf( __('ALERT: You are logged out! Could not save draft. Please log in again.'), wp_login_url() ); - $x = new WP_Ajax_Response( array( - 'what' => 'autosave', - 'id' => $id, - 'data' => $message - ) ); - $x->send(); + $message = sprintf( __('ALERT: You are logged out! Could not save draft. Please log in again.'), wp_login_url() ); + $x = new WP_Ajax_Response( array( + 'what' => 'autosave', + 'id' => $id, + 'data' => $message + ) ); + $x->send(); } - if ( !empty( $_REQUEST['action']) ) + if ( !empty( $_REQUEST['action'] ) ) do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] ); die('-1'); @@ -93,10 +98,10 @@ case 'wp-compression-test' : } elseif ( 2 == $_GET['test'] ) { if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) die('-1'); - if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) { + if ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) { header('Content-Encoding: deflate'); $out = gzdeflate( $test_str, 1 ); - } elseif ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) { + } elseif ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) { header('Content-Encoding: gzip'); $out = gzencode( $test_str, 1 ); } else { @@ -121,11 +126,21 @@ case 'imgedit-preview' : check_ajax_referer( "image_editor-$post_id" ); include_once( ABSPATH . 'wp-admin/includes/image-edit.php' ); - if ( !stream_preview_image($post_id) ) + if ( ! stream_preview_image($post_id) ) die('-1'); die(); break; +case 'menu-quick-search': + if ( ! current_user_can( 'edit_theme_options' ) ) + die('-1'); + + require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; + + _wp_ajax_menu_quick_search( $_REQUEST ); + + exit; + break; case 'oembed-cache' : $return = ( $wp_embed->cache_oembed( $_GET['post'] ) ) ? '1' : '0'; die( $return ); @@ -200,6 +215,84 @@ function _wp_ajax_delete_comment_response( $comment_id ) { $x->send(); } +function _wp_ajax_add_hierarchical_term() { + $action = $_POST['action']; + $taxonomy = get_taxonomy(substr($action, 4)); + check_ajax_referer( $action, '_ajax_nonce-add-' . $taxonomy->name ); + if ( !current_user_can( $taxonomy->cap->edit_terms ) ) + die('-1'); + $names = explode(',', $_POST['new'.$taxonomy->name]); + $parent = isset($_POST['new'.$taxonomy->name.'_parent']) ? (int) $_POST['new'.$taxonomy->name.'_parent'] : 0; + if ( 0 > $parent ) + $parent = 0; + if ( $taxonomy->name == 'category' ) + $post_category = isset($_POST['post_category']) ? (array) $_POST['post_category'] : array(); + else + $post_category = ( isset($_POST['tax_input']) && isset($_POST['tax_input'][$taxonomy->name]) ) ? (array) $_POST['tax_input'][$taxonomy->name] : array(); + $checked_categories = array_map( 'absint', (array) $post_category ); + $popular_ids = wp_popular_terms_checklist($taxonomy->name, 0, 10, false); + + foreach ( $names as $cat_name ) { + $cat_name = trim($cat_name); + $category_nicename = sanitize_title($cat_name); + if ( '' === $category_nicename ) + continue; + if ( !($cat_id = term_exists($cat_name, $taxonomy->name, $parent)) ) { + $new_term = wp_insert_term($cat_name, $taxonomy->name, array('parent' => $parent)); + $cat_id = $new_term['term_id']; + } + $checked_categories[] = $cat_id; + if ( $parent ) // Do these all at once in a second + continue; + $category = get_term( $cat_id, $taxonomy->name ); + ob_start(); + wp_terms_checklist( 0, array( 'taxonomy' => $taxonomy->name, 'descendants_and_self' => $cat_id, 'selected_cats' => $checked_categories, 'popular_cats' => $popular_ids )); + $data = ob_get_contents(); + ob_end_clean(); + $add = array( + 'what' => $taxonomy->name, + 'id' => $cat_id, + 'data' => str_replace( array("\n", "\t"), '', $data), + 'position' => -1 + ); + } + + if ( $parent ) { // Foncy - replace the parent and all its children + $parent = get_term( $parent, $taxonomy->name ); + $term_id = $parent->term_id; + + while ( $parent->parent ) { // get the top parent + $parent = &get_term( $parent->parent, $taxonomy->name ); + if ( is_wp_error( $parent ) ) + break; + $term_id = $parent->term_id; + } + + ob_start(); + wp_terms_checklist( 0, array('taxonomy' => $taxonomy->name, 'descendants_and_self' => $term_id, 'selected_cats' => $checked_categories, 'popular_cats' => $popular_ids)); + $data = ob_get_contents(); + ob_end_clean(); + $add = array( + 'what' => $taxonomy->name, + 'id' => $term_id, + 'data' => str_replace( array("\n", "\t"), '', $data), + 'position' => -1 + ); + } + + ob_start(); + wp_dropdown_categories( array( + 'taxonomy' => $taxonomy->name, 'hide_empty' => 0, 'name' => 'new'.$taxonomy->name.'_parent', 'orderby' => 'name', + 'hierarchical' => 1, 'show_option_none' => '— '.$taxonomy->labels->parent_item.' —' + ) ); + $sup = ob_get_contents(); + ob_end_clean(); + $add['supplemental'] = array( 'newcat_parent' => $sup ); + + $x = new WP_Ajax_Response( $add ); + $x->send(); +} + $id = isset($_POST['id'])? (int) $_POST['id'] : 0; switch ( $action = $_POST['action'] ) : case 'delete-comment' : // On success, die with time() instead of 1 @@ -237,27 +330,15 @@ case 'delete-comment' : // On success, die with time() instead of 1 _wp_ajax_delete_comment_response( $comment->comment_ID ); die( '0' ); break; -case 'delete-cat' : - check_ajax_referer( "delete-category_$id" ); - if ( !current_user_can( 'manage_categories' ) ) - die('-1'); - - $cat = get_category( $id ); - if ( !$cat || is_wp_error( $cat ) ) - die('1'); - - if ( wp_delete_category( $id ) ) - die('1'); - else - die('0'); - break; case 'delete-tag' : $tag_id = (int) $_POST['tag_ID']; check_ajax_referer( "delete-tag_$tag_id" ); - if ( !current_user_can( 'manage_categories' ) ) - die('-1'); $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag'; + $tax = get_taxonomy($taxonomy); + + if ( !current_user_can( $tax->cap->delete_terms ) ) + die('-1'); $tag = get_term( $tag_id, $taxonomy ); if ( !$tag || is_wp_error( $tag ) ) @@ -409,70 +490,6 @@ case 'dim-comment' : // On success, die with time() instead of 1 _wp_ajax_delete_comment_response( $comment->comment_ID ); die( '0' ); break; -case 'add-category' : // On the Fly - check_ajax_referer( $action ); - if ( !current_user_can( 'manage_categories' ) ) - die('-1'); - $names = explode(',', $_POST['newcat']); - if ( 0 > $parent = (int) $_POST['newcat_parent'] ) - $parent = 0; - $post_category = isset($_POST['post_category'])? (array) $_POST['post_category'] : array(); - $checked_categories = array_map( 'absint', (array) $post_category ); - $popular_ids = wp_popular_terms_checklist('category', 0, 10, false); - - foreach ( $names as $cat_name ) { - $cat_name = trim($cat_name); - $category_nicename = sanitize_title($cat_name); - if ( '' === $category_nicename ) - continue; - $cat_id = wp_create_category( $cat_name, $parent ); - $checked_categories[] = $cat_id; - if ( $parent ) // Do these all at once in a second - continue; - $category = get_category( $cat_id ); - ob_start(); - wp_category_checklist( 0, $cat_id, $checked_categories, $popular_ids ); - $data = ob_get_contents(); - ob_end_clean(); - $add = array( - 'what' => 'category', - 'id' => $cat_id, - 'data' => str_replace( array("\n", "\t"), '', $data), - 'position' => -1 - ); - } - if ( $parent ) { // Foncy - replace the parent and all its children - $parent = get_category( $parent ); - $term_id = $parent->term_id; - - while ( $parent->parent ) { // get the top parent - $parent = &get_category( $parent->parent ); - if ( is_wp_error( $parent ) ) - break; - $term_id = $parent->term_id; - } - - ob_start(); - wp_category_checklist( 0, $term_id, $checked_categories, $popular_ids, null, false ); - $data = ob_get_contents(); - ob_end_clean(); - $add = array( - 'what' => 'category', - 'id' => $term_id, - 'data' => str_replace( array("\n", "\t"), '', $data), - 'position' => -1 - ); - } - - ob_start(); - wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category') ) ); - $sup = ob_get_contents(); - ob_end_clean(); - $add['supplemental'] = array( 'newcat_parent' => $sup ); - - $x = new WP_Ajax_Response( $add ); - $x->send(); - break; case 'add-link-category' : // On the Fly check_ajax_referer( $action ); if ( !current_user_can( 'manage_categories' ) ) @@ -484,7 +501,7 @@ case 'add-link-category' : // On the Fly $slug = sanitize_title($cat_name); if ( '' === $slug ) continue; - if ( !$cat_id = is_term( $cat_name, 'link_category' ) ) { + if ( !$cat_id = term_exists( $cat_name, 'link_category' ) ) { $cat_id = wp_insert_term( $cat_name, 'link_category' ); } $cat_id = $cat_id['term_id']; @@ -498,59 +515,6 @@ case 'add-link-category' : // On the Fly } $x->send(); break; -case 'add-cat' : // From Manage->Categories - check_ajax_referer( 'add-category' ); - if ( !current_user_can( 'manage_categories' ) ) - die('-1'); - - if ( '' === trim($_POST['cat_name']) ) { - $x = new WP_Ajax_Response( array( - 'what' => 'cat', - 'id' => new WP_Error( 'cat_name', __('You did not enter a category name.') ) - ) ); - $x->send(); - } - - if ( category_exists( trim( $_POST['cat_name'] ), $_POST['category_parent'] ) ) { - $x = new WP_Ajax_Response( array( - 'what' => 'cat', - 'id' => new WP_Error( 'cat_exists', __('The category you are trying to create already exists.'), array( 'form-field' => 'cat_name' ) ), - ) ); - $x->send(); - } - - $cat = wp_insert_category( $_POST, true ); - - if ( is_wp_error($cat) ) { - $x = new WP_Ajax_Response( array( - 'what' => 'cat', - 'id' => $cat - ) ); - $x->send(); - } - - if ( !$cat || (!$cat = get_category( $cat )) ) - die('0'); - - $level = 0; - $cat_full_name = $cat->name; - $_cat = $cat; - while ( $_cat->parent ) { - $_cat = get_category( $_cat->parent ); - $cat_full_name = $_cat->name . ' — ' . $cat_full_name; - $level++; - } - $cat_full_name = esc_attr($cat_full_name); - - $x = new WP_Ajax_Response( array( - 'what' => 'cat', - 'id' => $cat->term_id, - 'position' => -1, - 'data' => _cat_row( $cat, $level, $cat_full_name ), - 'supplemental' => array('name' => $cat_full_name, 'show-link' => sprintf(__( 'Category %s added' ), "cat-$cat->term_id", $cat_full_name)) - ) ); - $x->send(); - break; case 'add-link-cat' : // From Blogroll -> Categories check_ajax_referer( 'add-link-category' ); if ( !current_user_can( 'manage_categories' ) ) @@ -588,19 +552,57 @@ case 'add-link-cat' : // From Blogroll -> Categories break; case 'add-tag' : // From Manage->Tags check_ajax_referer( 'add-tag' ); - if ( !current_user_can( 'manage_categories' ) ) - die('-1'); $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag'; + $tax = get_taxonomy($taxonomy); + + $x = new WP_Ajax_Response(); + + if ( !current_user_can( $tax->cap->edit_terms ) ) + die('-1'); + $tag = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST ); if ( !$tag || is_wp_error($tag) || (!$tag = get_term( $tag['term_id'], $taxonomy )) ) { - echo '

' . __('An error has occured. Please reload the page and try again.') . '

'; - exit; + $message = __('An error has occured. Please reload the page and try again.'); + if ( is_wp_error($tag) && $tag->get_error_message() ) + $message = $tag->get_error_message(); + + $x->add( array( + 'what' => 'taxonomy', + 'data' => new WP_Error('error', $message ) + ) ); + $x->send(); } - echo _tag_row( $tag, '', $taxonomy ); - exit; + if ( isset($_POST['screen']) ) + set_current_screen($_POST['screen']); + + $level = 0; + $tag_full_name = false; + $tag_full_name = $tag->name; + if ( is_taxonomy_hierarchical($taxonomy) ) { + $_tag = $tag; + while ( $_tag->parent ) { + $_tag = get_term( $_tag->parent, $taxonomy ); + $tag_full_name = $_tag->name . ' — ' . $tag_full_name; + $level++; + } + $noparents = _tag_row( $tag, $level, $taxonomy ); + } + $tag->name = $tag_full_name; + $parents = _tag_row( $tag, 0, $taxonomy); + + $x->add( array( + 'what' => 'taxonomy', + 'supplemental' => compact('parents', 'noparents') + ) ); + $x->add( array( + 'what' => 'term', + 'position' => $level, + 'supplemental' => get_term( $tag->term_id, $taxonomy, ARRAY_A ) //Refetch as $tag has been contaminated by the full name. + ) ); + $x->send(); break; case 'get-tagcloud' : if ( !current_user_can( 'edit_posts' ) ) @@ -613,8 +615,10 @@ case 'get-tagcloud' : $tags = get_terms( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) ); - if ( empty( $tags ) ) - die( __('No tags found!') ); + if ( empty( $tags ) ) { + $tax = get_taxonomy( $taxonomy ); + die( isset( $tax->no_tagcloud ) ? $tax->no_tagcloud : __('No tags found!') ); + } if ( is_wp_error($tags) ) die($tags->get_error_message()); @@ -701,7 +705,7 @@ case 'get-comments' : $x->send(); break; case 'replyto-comment' : - check_ajax_referer( $action ); + check_ajax_referer( $action, '_ajax_nonce-replyto-comment' ); $comment_post_ID = (int) $_POST['comment_post_ID']; if ( !current_user_can( 'edit_post', $comment_post_ID ) ) @@ -770,7 +774,7 @@ case 'replyto-comment' : $x->send(); break; case 'edit-comment' : - check_ajax_referer( 'replyto-comment' ); + check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' ); $comment_post_ID = (int) $_POST['comment_post_ID']; if ( ! current_user_can( 'edit_post', $comment_post_ID ) ) @@ -807,20 +811,60 @@ case 'edit-comment' : $x->send(); break; +case 'add-menu-item' : + if ( ! current_user_can( 'edit_theme_options' ) ) + die('-1'); + + check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' ); + + require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; + + $item_ids = wp_save_nav_menu_items( 0, $_POST['menu-item'] ); + if ( is_wp_error( $item_ids ) ) + die('-1'); + + foreach ( (array) $item_ids as $menu_item_id ) { + $menu_obj = get_post( $menu_item_id ); + if ( ! empty( $menu_obj->ID ) ) { + $menu_obj = wp_setup_nav_menu_item( $menu_obj ); + $menu_obj->label = $menu_obj->title; // don't show "(pending)" in ajax-added items + $menu_items[] = $menu_obj; + } + } + + if ( ! empty( $menu_items ) ) { + $args = array( + 'after' => '', + 'before' => '', + 'link_after' => '', + 'link_before' => '', + 'walker' => new Walker_Nav_Menu_Edit, + ); + echo walk_nav_menu_tree( $menu_items, 0, (object) $args ); + } + break; case 'add-meta' : - check_ajax_referer( 'add-meta' ); + check_ajax_referer( 'add-meta', '_ajax_nonce-add-meta' ); $c = 0; $pid = (int) $_POST['post_id']; + $post = get_post( $pid ); + if ( isset($_POST['metakeyselect']) || isset($_POST['metakeyinput']) ) { if ( !current_user_can( 'edit_post', $pid ) ) die('-1'); if ( isset($_POST['metakeyselect']) && '#NONE#' == $_POST['metakeyselect'] && empty($_POST['metakeyinput']) ) die('1'); - if ( $pid < 0 ) { + if ( $post->post_status == 'auto-draft' ) { + $save_POST = $_POST; // Backup $_POST + $_POST = array(); // Make it empty for edit_post() + $_POST['action'] = 'draft'; // Warning fix + $_POST['post_ID'] = $pid; + $_POST['post_type'] = $post->post_type; + $_POST['post_status'] = 'draft'; $now = current_time('timestamp', 1); - if ( $pid = wp_insert_post( array( - 'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now)) - ) ) ) { + $_POST['post_title'] = sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now)); + + if ( $pid = edit_post() ) { if ( is_wp_error( $pid ) ) { $x = new WP_Ajax_Response( array( 'what' => 'meta', @@ -828,6 +872,7 @@ case 'add-meta' : ) ); $x->send(); } + $_POST = $save_POST; // Now we can restore original $_POST again if ( !$mid = add_meta( $pid ) ) die(__('Please provide a custom field value.')); } else { @@ -847,15 +892,19 @@ case 'add-meta' : 'position' => 1, 'supplemental' => array('postid' => $pid) ) ); - } else { + } else { // Update? $mid = (int) array_pop(array_keys($_POST['meta'])); $key = $_POST['meta'][$mid]['key']; $value = $_POST['meta'][$mid]['value']; + if ( '' == trim($key) ) + die(__('Please provide a custom field name.')); + if ( '' == trim($value) ) + die(__('Please provide a custom field value.')); if ( !$meta = get_post_meta_by_id( $mid ) ) die('0'); // if meta doesn't exist if ( !current_user_can( 'edit_post', $meta->post_id ) ) die('-1'); - if ( $meta->meta_value != stripslashes($value) ) { + if ( $meta->meta_value != stripslashes($value) || $meta->meta_key != stripslashes($key) ) { if ( !$u = update_meta( $mid, $key, $value ) ) die('0'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems). } @@ -910,7 +959,7 @@ case 'autosave' : // The name of this action is hardcoded in edit_post() global $current_user; $_POST['post_category'] = explode(",", $_POST['catslist']); - if($_POST['post_type'] == 'page' || empty($_POST['post_category'])) + if ( $_POST['post_type'] == 'page' || empty($_POST['post_category']) ) unset($_POST['post_category']); $do_autosave = (bool) $_POST['autosave']; @@ -919,64 +968,62 @@ case 'autosave' : // The name of this action is hardcoded in edit_post() $data = ''; /* translators: draft saved date format, see http://php.net/date */ $draft_saved_date_format = __('g:i:s a'); - $message = sprintf( __('Draft Saved at %s.'), date_i18n( $draft_saved_date_format ) ); + /* translators: %s: date and time */ + $message = sprintf( __('Draft saved at %s.'), date_i18n( $draft_saved_date_format ) ); $supplemental = array(); if ( isset($login_grace_period) ) $supplemental['session_expired'] = add_query_arg( 'interim-login', 1, wp_login_url() ); $id = $revision_id = 0; - if($_POST['post_ID'] < 0) { + + $post_ID = (int) $_POST['post_ID']; + $_POST['ID'] = $post_ID; + $post = get_post($post_ID); + if ( 'auto-draft' == $post->post_status ) $_POST['post_status'] = 'draft'; - $_POST['temp_ID'] = $_POST['post_ID']; - if ( $do_autosave ) { - $id = wp_write_post(); - $data = $message; - } - } else { - $post_ID = (int) $_POST['post_ID']; - $_POST['ID'] = $post_ID; - $post = get_post($post_ID); - if ( $last = wp_check_post_lock( $post->ID ) ) { - $do_autosave = $do_lock = false; + if ( $last = wp_check_post_lock( $post->ID ) ) { + $do_autosave = $do_lock = false; - $last_user = get_userdata( $last ); - $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' ); - $data = new WP_Error( 'locked', sprintf( - $_POST['post_type'] == 'page' ? __( 'Autosave disabled: %s is currently editing this page.' ) : __( 'Autosave disabled: %s is currently editing this post.' ), - esc_html( $last_user_name ) - ) ); + $last_user = get_userdata( $last ); + $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' ); + $data = new WP_Error( 'locked', sprintf( + $_POST['post_type'] == 'page' ? __( 'Autosave disabled: %s is currently editing this page.' ) : __( 'Autosave disabled: %s is currently editing this post.' ), + esc_html( $last_user_name ) + ) ); - $supplemental['disable_autosave'] = 'disable'; - } + $supplemental['disable_autosave'] = 'disable'; + } - if ( 'page' == $post->post_type ) { - if ( !current_user_can('edit_page', $post_ID) ) - die(__('You are not allowed to edit this page.')); - } else { - if ( !current_user_can('edit_post', $post_ID) ) - die(__('You are not allowed to edit this post.')); - } + if ( 'page' == $post->post_type ) { + if ( !current_user_can('edit_page', $post_ID) ) + die(__('You are not allowed to edit this page.')); + } else { + if ( !current_user_can('edit_post', $post_ID) ) + die(__('You are not allowed to edit this post.')); + } - if ( $do_autosave ) { - // Drafts are just overwritten by autosave - if ( 'draft' == $post->post_status ) { - $id = edit_post(); - } else { // Non drafts are not overwritten. The autosave is stored in a special post revision. - $revision_id = wp_create_post_autosave( $post->ID ); - if ( is_wp_error($revision_id) ) - $id = $revision_id; - else - $id = $post->ID; - } - $data = $message; - } else { - $id = $post->ID; + if ( $do_autosave ) { + // Drafts and auto-drafts are just overwritten by autosave + if ( 'auto-draft' == $post->post_status || 'draft' == $post->post_status ) { + $id = edit_post(); + } else { // Non drafts are not overwritten. The autosave is stored in a special post revision. + $revision_id = wp_create_post_autosave( $post->ID ); + if ( is_wp_error($revision_id) ) + $id = $revision_id; + else + $id = $post->ID; } + $data = $message; + } else { + if ( isset( $_POST['auto_draft'] ) && '1' == $_POST['auto_draft'] ) + $id = 0; // This tells us it didn't actually save + else + $id = $post->ID; } - if ( $do_lock && $id && is_numeric($id) ) + if ( $do_lock && ( isset( $_POST['auto_draft'] ) && ( $_POST['auto_draft'] != '1' ) ) && $id && is_numeric($id) ) wp_set_post_lock( $id ); if ( $nonce_age == 2 ) { @@ -1000,21 +1047,14 @@ case 'autosave' : // The name of this action is hardcoded in edit_post() ) ); $x->send(); break; -case 'autosave-generate-nonces' : - check_ajax_referer( 'autosave', 'autosavenonce' ); - $ID = (int) $_POST['post_ID']; - $post_type = ( 'page' == $_POST['post_type'] ) ? 'page' : 'post'; - if ( current_user_can( "edit_{$post_type}", $ID ) ) - die( json_encode( array( 'updateNonce' => wp_create_nonce( "update-{$post_type}_{$ID}" ), 'deleteURL' => str_replace( '&', '&', wp_nonce_url( admin_url( $post_type . '.php?action=trash&post=' . $ID ), "trash-{$post_type}_{$ID}" ) ) ) ) ); - do_action('autosave_generate_nonces'); - die('0'); -break; case 'closed-postboxes' : check_ajax_referer( 'closedpostboxes', 'closedpostboxesnonce' ); - $closed = isset( $_POST['closed'] ) ? $_POST['closed'] : ''; - $closed = explode( ',', $_POST['closed'] ); - $hidden = isset( $_POST['hidden'] ) ? $_POST['hidden'] : ''; - $hidden = explode( ',', $_POST['hidden'] ); + $closed = isset( $_POST['closed'] ) ? explode( ',', $_POST['closed']) : array(); + $closed = array_filter($closed); + + $hidden = isset( $_POST['hidden'] ) ? explode( ',', $_POST['hidden']) : array(); + $hidden = array_filter($hidden); + $page = isset( $_POST['page'] ) ? $_POST['page'] : ''; if ( !preg_match( '/^[a-z_-]+$/', $page ) ) @@ -1024,11 +1064,11 @@ case 'closed-postboxes' : die('-1'); if ( is_array($closed) ) - update_usermeta($user->ID, 'closedpostboxes_'.$page, $closed); + update_user_option($user->ID, "closedpostboxes_$page", $closed, true); if ( is_array($hidden) ) { - $hidden = array_diff( $hidden, array('submitdiv', 'linksubmitdiv') ); // postboxes that are always shown - update_usermeta($user->ID, 'meta-box-hidden_'.$page, $hidden); + $hidden = array_diff( $hidden, array('submitdiv', 'linksubmitdiv', 'manage-menu', 'create-menu') ); // postboxes that are always shown + update_user_option($user->ID, "metaboxhidden_$page", $hidden, true); } die('1'); @@ -1046,8 +1086,66 @@ case 'hidden-columns' : die('-1'); if ( is_array($hidden) ) - update_usermeta($user->ID, "manage-$page-columns-hidden", $hidden); + update_user_option($user->ID, "manage{$page}columnshidden", $hidden, true); + + die('1'); + break; +case 'menu-get-metabox' : + if ( ! current_user_can( 'edit_theme_options' ) ) + die('-1'); + + require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; + + if ( isset( $_POST['item-type'] ) && 'post_type' == $_POST['item-type'] ) { + $type = 'posttype'; + $callback = 'wp_nav_menu_item_post_type_meta_box'; + $items = (array) get_post_types( array( 'show_in_nav_menus' => true ), 'object' ); + } elseif ( isset( $_POST['item-type'] ) && 'taxonomy' == $_POST['item-type'] ) { + $type = 'taxonomy'; + $callback = 'wp_nav_menu_item_taxonomy_meta_box'; + $items = (array) get_taxonomies( array( 'show_ui' => true ), 'object' ); + } + + if ( ! empty( $_POST['item-object'] ) && isset( $items[$_POST['item-object']] ) ) { + $item = apply_filters( 'nav_menu_meta_box_object', $items[ $_POST['item-object'] ] ); + ob_start(); + call_user_func_array($callback, array( + null, + array( + 'id' => 'add-' . $item->name, + 'title' => $item->labels->name, + 'callback' => $callback, + 'args' => $item, + ) + )); + + $markup = ob_get_clean(); + + echo json_encode(array( + 'replace-id' => $type . '-' . $item->name, + 'markup' => $markup, + )); + } + + exit; + break; +case 'menu-quick-search': + if ( ! current_user_can( 'edit_theme_options' ) ) + die('-1'); + + require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; + _wp_ajax_menu_quick_search( $_REQUEST ); + + exit; + break; +case 'menu-locations-save': + if ( ! current_user_can( 'edit_theme_options' ) ) + die('-1'); + check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' ); + if ( ! isset( $_POST['menu-locations'] ) ) + die('0'); + set_theme_mod( 'nav_menu_locations', $_POST['menu-locations'] ); die('1'); break; case 'meta-box-order': @@ -1063,10 +1161,10 @@ case 'meta-box-order': die('-1'); if ( $order ) - update_user_option($user->ID, "meta-box-order_$page", $order); + update_user_option($user->ID, "meta-box-order_$page", $order, true); if ( $page_columns ) - update_usermeta($user->ID, "screen_layout_$page", $page_columns); + update_user_option($user->ID, "screen_layout_$page", $page_columns, true); die('1'); break; @@ -1079,7 +1177,7 @@ case 'sample-permalink': check_ajax_referer( 'samplepermalink', 'samplepermalinknonce' ); $post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0; $title = isset($_POST['new_title'])? $_POST['new_title'] : ''; - $slug = isset($_POST['new_slug'])? $_POST['new_slug'] : ''; + $slug = isset($_POST['new_slug'])? $_POST['new_slug'] : null; die(get_sample_permalink_html($post_id, $title, $slug)); break; case 'inline-save': @@ -1096,6 +1194,9 @@ case 'inline-save': die( __('You are not allowed to edit this post.') ); } + if ( isset($_POST['screen']) ) + set_current_screen($_POST['screen']); + if ( $last = wp_check_post_lock( $post_ID ) ) { $last_user = get_userdata( $last ); $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' ); @@ -1135,7 +1236,7 @@ case 'inline-save': if ( 'page' == $_POST['post_type'] ) { $post[] = get_post($_POST['post_ID']); page_rows($post); - } elseif ( 'post' == $_POST['post_type'] ) { + } elseif ( 'post' == $_POST['post_type'] || in_array($_POST['post_type'], get_post_types( array('public' => true) ) ) ) { $mode = $_POST['post_view']; $post[] = get_post($_POST['post_ID']); post_rows($post); @@ -1146,32 +1247,18 @@ case 'inline-save': case 'inline-save-tax': check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' ); - if ( ! current_user_can('manage_categories') ) + $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : false; + if ( ! $taxonomy ) + die( __('Cheatin’ uh?') ); + $tax = get_taxonomy($taxonomy); + + if ( ! current_user_can( $tax->cap->edit_terms ) ) die( __('Cheatin’ uh?') ); if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) ) die(-1); switch ($_POST['tax_type']) { - case 'cat' : - $data = array(); - $data['cat_ID'] = $id; - $data['cat_name'] = $_POST['name']; - $data['category_nicename'] = $_POST['slug']; - if ( isset($_POST['parent']) && (int) $_POST['parent'] > 0 ) - $data['category_parent'] = $_POST['parent']; - - $cat = get_category($id, ARRAY_A); - $data['category_description'] = $cat['category_description']; - - $updated = wp_update_category($data); - - if ( $updated && !is_wp_error($updated) ) - echo _cat_row( $updated, 0 ); - else - die( __('Category not updated.') ); - - break; case 'link-cat' : $updated = wp_update_term($id, 'link_category', $_POST); @@ -1190,12 +1277,19 @@ case 'inline-save-tax': $updated = wp_update_term($id, $taxonomy, $_POST); if ( $updated && !is_wp_error($updated) ) { $tag = get_term( $updated['term_id'], $taxonomy ); - if ( !$tag || is_wp_error( $tag ) ) - die( __('Tag not updated.') ); + if ( !$tag || is_wp_error( $tag ) ) { + if ( is_wp_error($tag) && $tag->get_error_message() ) + die( $tag->get_error_message() ); + die( __('Item not updated.') ); + } + + set_current_screen( 'edit-' . $taxonomy ); - echo _tag_row($tag, '', $taxonomy); + echo _tag_row($tag, 0, $taxonomy); } else { - die( __('Tag not updated.') ); + if ( is_wp_error($updated) && $updated->get_error_message() ) + die( $updated->get_error_message() ); + die( __('Item not updated.') ); } break; @@ -1209,7 +1303,11 @@ case 'find_posts': if ( empty($_POST['ps']) ) exit; - $what = isset($_POST['pages']) ? 'page' : 'post'; + if ( !empty($_POST['post_type']) && in_array( $_POST['post_type'], get_post_types() ) ) + $what = $_POST['post_type']; + else + $what = 'post'; + $s = stripslashes($_POST['ps']); preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches); $search_terms = array_map('_search_terms_tidy', $matches[0]); @@ -1226,8 +1324,10 @@ case 'find_posts': $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50" ); - if ( ! $posts ) - exit( __('No posts found.') ); + if ( ! $posts ) { + $posttype = get_post_type_object($what); + exit($posttype->labels->not_found); + } $html = ''; foreach ( $posts as $post ) { @@ -1284,7 +1384,7 @@ case 'lj-importer' : case 'widgets-order' : check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' ); - if ( !current_user_can('switch_themes') ) + if ( !current_user_can('edit_theme_options') ) die('-1'); unset( $_POST['savewidgets'], $_POST['action'] ); @@ -1314,7 +1414,7 @@ case 'widgets-order' : case 'save-widget' : check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' ); - if ( !current_user_can('switch_themes') || !isset($_POST['id_base']) ) + if ( !current_user_can('edit_theme_options') || !isset($_POST['id_base']) ) die('-1'); unset( $_POST['savewidgets'], $_POST['action'] ); @@ -1406,24 +1506,27 @@ case 'image-editor': die(); break; case 'set-post-thumbnail': - $post_id = intval( $_POST['post_id'] ); - if ( !current_user_can( 'edit_post', $post_id ) ) + $post_ID = intval( $_POST['post_id'] ); + if ( !current_user_can( 'edit_post', $post_ID ) ) die( '-1' ); $thumbnail_id = intval( $_POST['thumbnail_id'] ); + check_ajax_referer( "set_post_thumbnail-$post_ID" ); + if ( $thumbnail_id == '-1' ) { - delete_post_meta( $post_id, '_thumbnail_id' ); + delete_post_meta( $post_ID, '_thumbnail_id' ); die( _wp_post_thumbnail_html() ); } if ( $thumbnail_id && get_post( $thumbnail_id ) ) { $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' ); if ( !empty( $thumbnail_html ) ) { - update_post_meta( $post_id, '_thumbnail_id', $thumbnail_id ); + update_post_meta( $post_ID, '_thumbnail_id', $thumbnail_id ); die( _wp_post_thumbnail_html( $thumbnail_id ) ); } } die( '0' ); + break; default : do_action( 'wp_ajax_' . $_POST['action'] ); die('0'); diff --git a/wp-admin/admin-footer.php b/wp-admin/admin-footer.php index a43a4e45..c43ef2e8 100644 --- a/wp-admin/admin-footer.php +++ b/wp-admin/admin-footer.php @@ -22,14 +22,13 @@ do_action( 'in_admin_footer' ); $upgrade = apply_filters( 'update_footer', '' ); echo apply_filters( 'admin_footer_text', '' . __('Thank you for creating with WordPress.').' | '.__('Documentation').' | '.__('Feedback') ); ?>

-
@@ -90,6 +94,7 @@ if ( '' == $blog_name ) { if ( $blog_name != $blog_name_excerpt ) $blog_name_excerpt = trim($blog_name_excerpt) . '…'; $blog_name = $blog_name_excerpt; + unset($blog_name_excerpt); } $title_class = ''; if ( function_exists('mb_strlen') ) { @@ -101,28 +106,52 @@ if ( function_exists('mb_strlen') ) { } ?> -

>

+ +

> + + + + + + +

+ +
-

%2$s'), 'profile.php', $user_identity) ?> - | -

+

%2$s'), 'profile.php', $user_identity); +$links[15] = '| ' . __('Log Out') . ''; + +$links = apply_filters('admin_user_info_links', $links, $current_user); +ksort($links); + +echo implode(' ', $links); +?>

- +
- +parent_file = $parent_file; +$current_screen->parent_base = preg_replace('/\?.*$/', '', $parent_file); +$current_screen->parent_base = str_replace('.php', '', $current_screen->parent_base); +?>
flush_rules(); @@ -30,8 +30,25 @@ if ( get_option('db_upgraded') ) { */ do_action('after_db_upgrade'); } elseif ( get_option('db_version') != $wp_db_version ) { - wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI'])))); - exit; + if ( !is_multisite() ) { + wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI'])))); + exit; + } elseif ( apply_filters( 'do_mu_upgrade', true ) ) { + /** + * On really small MU installs run the upgrader every time, + * else run it less often to reduce load. + * + * @since 2.8.4b + */ + $c = get_blog_count(); + if ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int)( $c / 50 ) ) == 1 ) ) { + require_once( ABSPATH . WPINC . '/http.php' ); + $response = wp_remote_get( admin_url( 'upgrade.php?step=1' ), array( 'timeout' => 120, 'httpversion' => '1.1' ) ); + do_action( 'after_mu_upgrade', $response ); + unset($response); + } + unset($c); + } } require_once(ABSPATH . 'wp-admin/includes/admin.php'); @@ -48,32 +65,44 @@ if ( !wp_next_scheduled('wp_scheduled_delete') && !defined('WP_INSTALLING') ) set_screen_options(); -$posts_per_page = get_option('posts_per_page'); $date_format = get_option('date_format'); $time_format = get_option('time_format'); wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'text', 'trackback', 'pingback')); -wp_admin_css_color('classic', __('Blue'), admin_url("css/colors-classic.css"), array('#073447', '#21759B', '#EAF3FA', '#BBD8E7')); -wp_admin_css_color('fresh', __('Gray'), admin_url("css/colors-fresh.css"), array('#464646', '#6D6D6D', '#F1F1F1', '#DFDFDF')); - wp_enqueue_script( 'common' ); wp_enqueue_script( 'jquery-color' ); $editing = false; -if (isset($_GET['page'])) { +if ( isset($_GET['page']) ) { $plugin_page = stripslashes($_GET['page']); $plugin_page = plugin_basename($plugin_page); } +if ( isset($_GET['post_type']) ) + $typenow = sanitize_key($_GET['post_type']); +else + $typenow = ''; + +if ( isset($_GET['taxonomy']) ) + $taxnow = sanitize_key($_GET['taxonomy']); +else + $taxnow = ''; + require(ABSPATH . 'wp-admin/menu.php'); +if ( current_user_can( 'manage_options' ) ) + @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', '256M' ) ); + do_action('admin_init'); -// Handle plugin admin pages. -if (isset($plugin_page)) { - if( ! $page_hook = get_plugin_page_hook($plugin_page, $pagenow) ) { +if ( isset($plugin_page) ) { + if ( !empty($typenow) ) + $the_parent = $pagenow . '?post_type=' . $typenow; + else + $the_parent = $pagenow; + if ( ! $page_hook = get_plugin_page_hook($plugin_page, $the_parent) ) { $page_hook = get_plugin_page_hook($plugin_page, $plugin_page); // backwards compatibility for plugins using add_management_page if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook($plugin_page, 'tools.php') ) { @@ -86,7 +115,21 @@ if (isset($plugin_page)) { exit; } } + unset($the_parent); +} + +$hook_suffix = ''; +if ( isset($page_hook) ) + $hook_suffix = $page_hook; +else if ( isset($plugin_page) ) + $hook_suffix = $plugin_page; +else if ( isset($pagenow) ) + $hook_suffix = $pagenow; + +set_current_screen(); +// Handle plugin admin pages. +if ( isset($plugin_page) ) { if ( $page_hook ) { do_action('load-' . $page_hook); if (! isset($_GET['noheader'])) @@ -94,19 +137,22 @@ if (isset($plugin_page)) { do_action($page_hook); } else { - if ( validate_file($plugin_page) ) { + if ( validate_file($plugin_page) ) wp_die(__('Invalid plugin page')); - } - if (! ( file_exists(WP_PLUGIN_DIR . "/$plugin_page") && is_file(WP_PLUGIN_DIR . "/$plugin_page") ) ) + + if ( !( file_exists(WP_PLUGIN_DIR . "/$plugin_page") && is_file(WP_PLUGIN_DIR . "/$plugin_page") ) && !( file_exists(WPMU_PLUGIN_DIR . "/$plugin_page") && is_file(WPMU_PLUGIN_DIR . "/$plugin_page") ) ) wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page))); do_action('load-' . $plugin_page); - if (! isset($_GET['noheader'])) + if ( !isset($_GET['noheader'])) require_once(ABSPATH . 'wp-admin/admin-header.php'); - include(WP_PLUGIN_DIR . "/$plugin_page"); + if ( file_exists(WPMU_PLUGIN_DIR . "/$plugin_page") ) + include(WPMU_PLUGIN_DIR . "/$plugin_page"); + else + include(ABSPATH . PLUGINDIR . "/$plugin_page"); } include(ABSPATH . 'wp-admin/admin-footer.php'); @@ -119,17 +165,13 @@ if (isset($plugin_page)) { if ( ! current_user_can('import') ) wp_die(__('You are not allowed to import.')); - if ( validate_file($importer) ) { - wp_die(__('Invalid importer.')); - } + if ( validate_file($importer) ) + wp_redirect( admin_url( 'import.php?invalid=' . $importer ) ); // Allow plugins to define importers as well - if ( !isset($wp_importers) || !isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2])) - { + if ( !isset($wp_importers) || !isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2])) { if (! file_exists(ABSPATH . "wp-admin/import/$importer.php")) - { - wp_die(__('Cannot load importer.')); - } + wp_redirect( admin_url( 'import.php?invalid=' . $importer ) ); include(ABSPATH . "wp-admin/import/$importer.php"); } @@ -144,6 +186,9 @@ if (isset($plugin_page)) { define('WP_IMPORTING', true); + if ( is_multisite() ) + kses_init_filters(); // Always filter imported data with kses. + call_user_func($wp_importers[$importer][2]); include(ABSPATH . 'wp-admin/admin-footer.php'); diff --git a/wp-admin/async-upload.php b/wp-admin/async-upload.php index a384453a..4210b0e0 100644 --- a/wp-admin/async-upload.php +++ b/wp-admin/async-upload.php @@ -21,7 +21,7 @@ elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) ) if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) ) $_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie']; unset($current_user); -require_once('admin.php'); +require_once('./admin.php'); header('Content-Type: text/plain; charset=' . get_option('blog_charset')); @@ -43,16 +43,18 @@ if ( isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id check_admin_referer('media-form'); $id = media_handle_upload('async-upload', $_REQUEST['post_id']); -if (is_wp_error($id)) { - echo '
'.esc_html($id->get_error_message()).'
'; +if ( is_wp_error($id) ) { + echo '
+ ' . __('Dismiss') . ' + ' . sprintf(__('“%s” has failed to upload due to an error'), esc_html($_FILES['async-upload']['name']) ) . '
' . + esc_html($id->get_error_message()) . '
'; exit; } if ( $_REQUEST['short'] ) { // short form response - attachment ID only echo $id; -} -else { +} else { // long form response - big chunk o html $type = $_REQUEST['type']; echo apply_filters("async_upload_{$type}", $id); diff --git a/wp-admin/categories.php b/wp-admin/categories.php deleted file mode 100644 index 9639281f..00000000 --- a/wp-admin/categories.php +++ /dev/null @@ -1,311 +0,0 @@ -%s category: this is the default one"), get_cat_name($cat_ID) ) ); - - wp_delete_category($cat_ID); - - wp_safe_redirect( add_query_arg( 'message', 2, wp_get_referer() ) ); - exit; - -break; - -case 'bulk-delete': - check_admin_referer('bulk-categories'); - - if ( !current_user_can('manage_categories') ) - wp_die( __('You are not allowed to delete categories.') ); - - $cats = (array) $_GET['delete']; - $default_cat = get_option('default_category'); - foreach ( $cats as $cat_ID ) { - $cat_ID = (int) $cat_ID; - - // Don't delete the default cat. - if ( $cat_ID == $default_cat ) - wp_die( sprintf( __("Can’t delete the %s category: this is the default one"), get_cat_name($cat_ID) ) ); - - wp_delete_category($cat_ID); - } - - wp_safe_redirect( wp_get_referer() ); - exit; - -break; -case 'edit': - - $title = __('Edit Category'); - - require_once ('admin-header.php'); - $cat_ID = (int) $_GET['cat_ID']; - $category = get_category_to_edit($cat_ID); - include('edit-category-form.php'); - -break; - -case 'editedcat': - $cat_ID = (int) $_POST['cat_ID']; - check_admin_referer('update-category_' . $cat_ID); - - if ( !current_user_can('manage_categories') ) - wp_die(__('Cheatin’ uh?')); - - $location = 'categories.php'; - if ( $referer = wp_get_original_referer() ) { - if ( false !== strpos($referer, 'categories.php') ) - $location = $referer; - } - - if ( wp_update_category($_POST) ) - $location = add_query_arg('message', 3, $location); - else - $location = add_query_arg('message', 5, $location); - - wp_redirect($location); - - exit; -break; - -default: - -if ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { - wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); - exit; -} - -wp_enqueue_script('admin-categories'); -if ( current_user_can('manage_categories') ) - wp_enqueue_script('inline-edit-tax'); - -require_once ('admin-header.php'); - -$messages[1] = __('Category added.'); -$messages[2] = __('Category deleted.'); -$messages[3] = __('Category updated.'); -$messages[4] = __('Category not added.'); -$messages[5] = __('Category not updated.'); -?> - -
- -

' . __('Search results for “%s”') . '', esc_html( stripslashes($_GET['s']) ) ); ?> -

- - -

- - -
- - -
- -
- -
-
-
-
- - 0, 'search' => $_GET['s']))); -else - $num_cats = wp_count_terms('category'); - -$page_links = paginate_links( array( - 'base' => add_query_arg( 'pagenum', '%#%' ), - 'format' => '', - 'prev_text' => __('«'), - 'next_text' => __('»'), - 'total' => ceil($num_cats / $cats_per_page), - 'current' => $pagenum -)); - -if ( $page_links ) - echo "
$page_links
"; -?> - -
- - - -
- -
-
- -
- -

'.__('Title').''.__('Date').''.__('Status').'
- - - - - - - - - - - - - - - -
- -
-$page_links
"; -?> - -
- - - -
- -
- - - - -
-

Note:
Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?>

-

category to tag converter.'), 'admin.php?import=wp-cat2tag') ?>

-
- - - - -
-
- - -parent = 0; do_action('add_category_form_pre', $category); ?> - -
-

-
-
- - - -
- - -

-
- -
- - -

-
- -
- - 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?> -

-
- -
- - -

-
- -

- -
- - - -
-
- - - - - diff --git a/wp-admin/comment.php b/wp-admin/comment.php index 8b63a57a..58d6e326 100644 --- a/wp-admin/comment.php +++ b/wp-admin/comment.php @@ -7,7 +7,7 @@ */ /** Load WordPress Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); $parent_file = 'edit-comments.php'; $submenu_file = 'edit-comments.php'; @@ -36,7 +36,7 @@ if ( isset( $_GET['dt'] ) ) { */ function comment_footer_die( $msg ) { echo "

$msg

"; - include('admin-footer.php'); + include('./admin-footer.php'); die; } @@ -45,8 +45,15 @@ switch( $action ) { case 'editcomment' : $title = __('Edit Comment'); + add_contextual_help( $current_screen, '

' . __( 'You can edit the information left in a comment if needed. This is often useful when you notice that a commenter has made a typographical error.' ) . '

' . + '

' . __( 'You can also moderate the comment from this screen using the Status box, where you can also change the timestamp of the comment.' ) . '

' . + '

' . __( 'For more information:' ) . '

' . + '

' . __( 'Comments Documentation' ) . '

' . + '

' . __( 'Support Forums' ) . '

' + ); + wp_enqueue_script('comment'); - require_once('admin-header.php'); + require_once('./admin-header.php'); $comment_id = absint( $_GET['c'] ); @@ -61,7 +68,7 @@ case 'editcomment' : $comment = get_comment_to_edit( $comment_id ); - include('edit-form-comment.php'); + include('./edit-form-comment.php'); break; @@ -70,22 +77,38 @@ case 'approve' : case 'trash' : case 'spam' : - require_once('admin-header.php'); - $comment_id = absint( $_GET['c'] ); + + if ( !$comment = get_comment_to_edit( $comment_id ) ) { + wp_redirect( admin_url('edit-comments.php?error=1') ); + die(); + } + + if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) { + wp_redirect( admin_url('edit-comments.php?error=2') ); + die(); + } + + // No need to re-approve/re-trash/re-spam a comment. + if ( $action == str_replace( '1', 'approve', $comment->comment_approved ) ) { + wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) ); + die(); + } + + require_once('./admin-header.php'); + $formaction = $action . 'comment'; $nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_'; $nonce_action .= $comment_id; - if ( !$comment = get_comment_to_edit( $comment_id ) ) - comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' '.__('Go back').'!', 'edit.php') ); - - if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) - comment_footer_die( 'approve' != $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); ?>
+ + +

+ +if ( $comment->comment_approved != '0' ) { // if not unapproved + $message = ''; + switch ( $comment->comment_approved ) { + case '1' : + $message = __('This comment is currently approved.'); + break; + case 'spam' : + $message = __('This comment is currently marked as spam.'); + break; + case 'trash' : + $message = __('This comment is currently in the Trash.'); + break; + } + if ( $message ) + echo '

' . $message . '

'; +} +?>

@@ -127,12 +166,12 @@ switch ( $action ) { - +
comment_content; ?>
-

+

@@ -155,13 +194,19 @@ switch ( $action ) { comment_post_ID ) ) comment_footer_die( __('You are not allowed to edit comments on this post.') ); - if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php') ) + if ( '' != wp_get_referer() && ! $noredir && false === strpos(wp_get_referer(), 'comment.php') ) $redir = wp_get_referer(); - elseif ( '' != wp_get_original_referer() && false == $noredir ) + elseif ( '' != wp_get_original_referer() && ! $noredir ) $redir = wp_get_original_referer(); + elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) ) + $redir = admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) ); else $redir = admin_url('edit-comments.php'); - $redir = remove_query_arg( array('spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids'), $redir ); + $redir = remove_query_arg( array('spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids', 'approved', 'unapproved'), $redir ); switch ( $action ) { case 'deletecomment' : @@ -200,48 +247,20 @@ case 'unspamcomment' : wp_unspam_comment($comment_id); $redir = add_query_arg( array('unspammed' => '1'), $redir ); break; + case 'approvecomment' : + wp_set_comment_status( $comment_id, 'approve' ); + $redir = add_query_arg( array( 'approved' => 1 ), $redir ); + break; + case 'unapprovecomment' : + wp_set_comment_status( $comment_id, 'hold' ); + $redir = add_query_arg( array( 'unapproved' => 1 ), $redir ); + break; } wp_redirect( $redir ); - die; break; -case 'approvecomment' : -case 'unapprovecomment' : - $comment_id = absint( $_GET['c'] ); - check_admin_referer( 'approve-comment_' . $comment_id ); - - $noredir = isset( $_GET['noredir'] ); - - if ( !$comment = get_comment( $comment_id ) ) - comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' '.__('Go back').'!', 'edit.php') ); - - if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) { - if ( 'approvecomment' == $action ) - comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); - else - comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') ); - } - - if ( '' != wp_get_referer() && false == $noredir ) - $redir = remove_query_arg( array('approved', 'unapproved'), wp_get_referer() ); - else - $redir = admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) ); - - if ( 'approvecomment' == $action ) { - wp_set_comment_status( $comment_id, 'approve' ); - $redir = add_query_arg( array( 'approved' => 1 ), $redir ); - } else { - wp_set_comment_status( $comment_id, 'hold' ); - $redir = add_query_arg( array( 'unapproved' => 1 ), $redir ); - } - - wp_redirect( $redir ); - - exit(); - break; - case 'editedcomment' : $comment_id = absint( $_POST['comment_ID'] ); @@ -264,6 +283,6 @@ default: } // end switch -include('admin-footer.php'); +include('./admin-footer.php'); ?> diff --git a/wp-admin/css/colors-classic-rtl.css b/wp-admin/css/colors-classic-rtl.css index 99239be4..8cd8ec83 100644 --- a/wp-admin/css/colors-classic-rtl.css +++ b/wp-admin/css/colors-classic-rtl.css @@ -1,80 +1 @@ -.bar { - border-right-color: transparent; - border-left-color: #99d; -} - -.plugins .togl { - border-right-color: transparent; - border-left-color: #ccc; -} - -.post-com-count { - background-image: url(../images/bubble_bg-rtl.gif); -} -.tablenav .tablenav-pages a { - background: #eee url('../images/menu-bits-rtl-vs.gif') repeat-x scroll right -379px; -} -#upload-menu li.current { - border-right-color: transparent; - border-left-color: #448abd; -} - -#adminmenu .wp-submenu .current a.current { - background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -289px; -} - -#adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px; -} - -.folded #adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px; -} - -#adminmenu li.wp-has-current-submenu .wp-menu-toggle, -#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { - background: transparent url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -207px; -} - -#adminmenu .wp-has-current-submenu ul li a.current { - background: url(../images/menu-dark-rtl.gif) top right no-repeat !important; -} - -#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, -#adminmenu .menu-top .current { - background: url(../images/menu-bits-rtl-vs.gif) top right repeat-x; -} - -#adminmenu li.wp-has-current-submenu ul li a { - background: url(../images/menu-dark-rtl.gif) bottom right no-repeat !important; -} - -#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { - background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat right -207px; -} - -#adminmenu .wp-has-submenu:hover .wp-menu-toggle, -#adminmenu .wp-menu-open .wp-menu-toggle { - background: transparent url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -109px; -} - -#adminmenu a.wp-has-submenu { - background: #f1f1f1 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -379px; -} - -#adminmenu .wp-submenu a { - background: #FFFFFF url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -310px; -} - -#adminmenu li.current a, -#adminmenu .wp-submenu a:hover { - background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -289px; -} - -#adminmenu li.wp-has-current-submenu a.wp-has-submenu { - background: #b5b5b5 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right top; -} - -.meta-box-sortables .postbox:hover .handlediv { - background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -111px; -} +.bar{border-right-color:transparent;border-left-color:#99d;}.plugins .togl{border-right-color:transparent;border-left-color:#ccc;}.post-com-count{background-image:url(../images/bubble_bg-rtl.gif);}.tablenav .tablenav-pages a{background:#eee url('../images/menu-bits-rtl-vs.gif') repeat-x scroll right -379px;}#upload-menu li.current{border-right-color:transparent;border-left-color:#448abd;}#adminmenu .wp-submenu .current a.current{background:transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -289px;}#adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;}.folded #adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;}#adminmenu li.wp-has-current-submenu .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -207px;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark-rtl.gif) top right no-repeat!important;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu .menu-top .current{background:url(../images/menu-bits-rtl-vs.gif) top right repeat-x;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark-rtl.gif) bottom right no-repeat!important;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits-rtl-vs.gif) no-repeat right -207px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -109px;}#adminmenu a.wp-has-submenu{background:#f1f1f1 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -379px;}#adminmenu .wp-submenu a{background:#fff url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -310px;}#adminmenu li.wp-has-current-submenu a.wp-has-submenu{background:#b5b5b5 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right top;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -111px;}#favorite-toggle{background:transparent url(../images/fav-arrow-vs-rtl.gif?ver=20100531) no-repeat right -4px;} \ No newline at end of file diff --git a/wp-admin/css/colors-classic-rtl.dev.css b/wp-admin/css/colors-classic-rtl.dev.css new file mode 100644 index 00000000..38b070cd --- /dev/null +++ b/wp-admin/css/colors-classic-rtl.dev.css @@ -0,0 +1,79 @@ +.bar { + border-right-color: transparent; + border-left-color: #99d; +} + +.plugins .togl { + border-right-color: transparent; + border-left-color: #ccc; +} + +.post-com-count { + background-image: url(../images/bubble_bg-rtl.gif); +} +.tablenav .tablenav-pages a { + background: #eee url('../images/menu-bits-rtl-vs.gif') repeat-x scroll right -379px; +} +#upload-menu li.current { + border-right-color: transparent; + border-left-color: #448abd; +} + +#adminmenu .wp-submenu .current a.current { + background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -289px; +} + +#adminmenu li.wp-menu-separator { + background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px; +} + +.folded #adminmenu li.wp-menu-separator { + background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px; +} + +#adminmenu li.wp-has-current-submenu .wp-menu-toggle, +#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { + background: transparent url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -207px; +} + +#adminmenu .wp-has-current-submenu ul li a.current { + background: url(../images/menu-dark-rtl.gif) top right no-repeat !important; +} + +#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, +#adminmenu .menu-top .current { + background: url(../images/menu-bits-rtl-vs.gif) top right repeat-x; +} + +#adminmenu li.wp-has-current-submenu ul li a { + background: url(../images/menu-dark-rtl.gif) bottom right no-repeat !important; +} + +#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { + background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat right -207px; +} + +#adminmenu .wp-has-submenu:hover .wp-menu-toggle, +#adminmenu .wp-menu-open .wp-menu-toggle { + background: transparent url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -109px; +} + +#adminmenu a.wp-has-submenu { + background: #f1f1f1 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -379px; +} + +#adminmenu .wp-submenu a { + background: #fff url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -310px; +} + +#adminmenu li.wp-has-current-submenu a.wp-has-submenu { + background: #b5b5b5 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right top; +} + +.meta-box-sortables .postbox:hover .handlediv { + background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -111px; +} + +#favorite-toggle { + background: transparent url(../images/fav-arrow-vs-rtl.gif?ver=20100531) no-repeat right -4px; +} \ No newline at end of file diff --git a/wp-admin/css/colors-classic.css b/wp-admin/css/colors-classic.css index 427f262b..abacd39f 100644 --- a/wp-admin/css/colors-classic.css +++ b/wp-admin/css/colors-classic.css @@ -1 +1 @@ -html{background-color:#f7f6f1;}* html input,* html .widget{border-color:#8cbdd5;}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-color:#dfdfdf;background-color:#fff;}kbd,code{background:#eaeaea;}input[readonly]{background-color:#eee;}.find-box-search{border-color:#dfdfdf;background-color:#f1f1f1;}.find-box{background-color:#f1f1f1;}.find-box-inside{background-color:#fff;}a.page-numbers:hover{border-color:#999;}body,#wpbody,.form-table .pre{color:#333;}body>#upload-menu{border-bottom-color:#fff;}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links,#replyrow #ed_reply_toolbar input{border-color:#ccc;}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red;}#poststuff .inside label.waiting{color:orange;}#poststuff .inside label.approved{color:green;}#postcustomstuff table{border-color:#dfdfdf;background-color:#f9f9f9;}#postcustomstuff thead th{background-color:#f1f1f1;}#postcustomstuff table input,#postcustomstuff table textarea{border-color:#dfdfdf;background-color:#fff;}.widefat{border-color:#dfdfdf;background-color:#fff;}div.dashboard-widget-error{background-color:#c43;}div.dashboard-widget-notice{background-color:#cfe1ef;}div.dashboard-widget-submit{border-top-color:#ccc;}div.tabs-panel,ul#category-tabs li.tabs{border-color:#dfdfdf;}ul#category-tabs li.tabs{background-color:#f1f1f1;}input.disabled,textarea.disabled{background-color:#ccc;}.login #backtoblog a:hover,#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff;}.widget .widget-top,.postbox h3,.stuffbox h3{background:#d5e6f2 url("../images/blue-grad.png") repeat-x left top;text-shadow:#fff 0 1px 0;}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0;}.description,.form-wrap p{color:#666;}strong .post-com-count span{background-color:#21759b;}.sorthelper{background-color:#ccf3fa;}.ac_match,.subsubsub a.current{color:#000;}.wrap h2{color:#093e56;}.ac_over{background-color:#f0f0b8;}.ac_results{background-color:#fff;border-color:#808080;}.ac_results li{color:#101010;}.alt .alternate{background-color:#edfbfc;}.available-theme a.screenshot{background-color:#f1f1f1;border-color:#ddd;}.bar{background-color:#e8e8e8;border-right-color:#99d;}#media-upload,#media-upload .media-item .slidetoggle{background:#fff;}#media-upload .slidetoggle{border-top-color:#dfdfdf;}.error,.login #login_error{background-color:#ffebe8;border-color:#c00;}.error a{color:#c00;}.form-invalid{background-color:#ffebe8!important;}.form-invalid input,.form-invalid select{border-color:#c00!important;}.submit{border-color:#8cbdd5;}.highlight{background-color:#e4f2fd;color:#d54e21;}.howto,.nonessential,#edit-slug-box,.form-input-tip,.rss-widget span.rss-date,.subsubsub{color:#666;}.media-item{border-bottom-color:#dfdfdf;}#wpbody-content #media-items .describe{border-top-color:#dfdfdf;}.media-upload-form label.form-help,td.help{color:#9a9a9a;}.post-com-count{background-image:url(../images/bubble_bg.gif);color:#fff;}.post-com-count span{background-color:#bbb;color:#fff;}.post-com-count:hover span{background-color:#d54e21;}.quicktags,.search{background-color:#ccc;color:#000;}.side-info h5{border-bottom-color:#dadada;}.side-info ul{color:#666;}.button,.button-secondary,.submit input,input[type=button],input[type=submit]{border-color:#dfdfdf;color:#464646;}.button:hover,.button-secondary:hover,.submit input:hover,input[type=button]:hover,input[type=submit]:hover{color:#000;border-color:#adaca7;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;text-shadow:rgba(255,255,255,1) 0 1px 0;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}input.button-primary,button.button-primary,a.button-primary{border-color:#5b86ab;font-weight:bold;color:#fff;background:#5580a6 url(../images/button-grad-vs.png) repeat-x scroll left top;text-shadow:rgba(0,0,0,0.3) 0 -1px 0;}input.button-primary:active,button.button-primary:active,a.button-primary:active{background:#21759b url(../images/button-grad-active-vs.png) repeat-x scroll left top;color:#eaf2fa;}input.button-primary:hover,button.button-primary:hover,a.button-primary:hover,a.button-primary:focus,a.button-primary:active{border-color:#2e5475;color:#eaf2fa;}.button-disabled,.button[disabled],.button:disabled,.button-secondary[disabled],.button-secondary:disabled,a.button.disabled{color:#aaa!important;border-color:#ddd!important;}.button-primary-disabled,.button-primary[disabled],.button-primary:disabled{color:#B0C3E2!important;background:#6590A6!important;}a:hover,a:active,a:focus{color:#d54e21;}#wphead #viewsite a:hover,#adminmenu a:hover,#adminmenu ul.wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21;}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf;}#dashboard_right_now .table{background:#faf9f7!important;}#side-sortables #category-tabs .tabs a{color:#333;}#rightnow .rbutton{background-color:#ebebeb;color:#264761;}.submitbox .submit{background-color:#464646;color:#ccc;}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00;}.submitbox .submitdelete:hover,#media-items a.delete:hover{color:#fff;background-color:#f00;border-bottom-color:#f00;}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00;}.tablenav .dots{border-color:transparent;}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b;}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21;}.updated,.login .message{background-color:#ffffe0;border-color:#e6db55;}.update-message{color:#000;}a.page-numbers{border-bottom-color:#b8d3e2;}.commentlist li{border-bottom-color:#ccc;}.widefat td,.widefat th,#install-plugins .plugins td,#install-plugins .plugins th{border-color:#dfdfdf;}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0;}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head{color:#333;background:#d5e6f2 url(../images/blue-grad.png) repeat-x scroll left top;}h3.dashboard-widget-title small a{color:#d7d7d7;}h3.dashboard-widget-title small a:hover{color:#fff;}a,#adminmenu a,#poststuff #edButtonPreview,#poststuff #edButtonHTML,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,.plugins a.delete,.ui-tabs-nav a{color:#1c6280;}body.press-this .tabs a,body.press-this .tabs a:hover{background-color:#fff;border-color:#c6d9e9;border-bottom-color:#fff;color:#d54e21;}#adminmenu #awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow,#plugin-information .action-button{background-color:#d54e21;color:#fff;}#adminmenu li a:hover #awaiting-mod,#adminmenu li a:hover .update-plugins,#sidemenu li a:hover .update-plugins{background-color:#264761;color:#fff;}#adminmenu li.current a #awaiting-mod,#adminmenu li.current a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins{background-color:#ddd;color:#000;text-shadow:none;-moz-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-khtml-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-webkit-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;box-shadow:rgba(0,0,0,0.2) 0 -1px 0;}#adminmenu li.current a:hover #awaiting-mod,#adminmenu li.current a:hover .update-plugins,#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod,#adminmenu li.wp-has-current-submenu a:hover .update-plugins{background-color:#264761;color:#fff;}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf;}#currenttheme img{border-color:#666;}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9;}input.readonly,textarea.readonly{background-color:#ddd;}#ed_toolbar input,#ed_reply_toolbar input{background:#fff url("../images/fade-butt.png") repeat-x 0 -2px;}#editable-post-name{background-color:#fffbcc;}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on{color:#777;}.login #nav a{color:#21759b!important;}.login #nav a:hover{color:#d54e21!important;}#footer,#footer-upgrade{background:#1d507d;color:#b6d1e4;}#media-items,.imgedit-group{border-color:#dfdfdf;}.checkbox,.side-info,.plugins tr,.postbox,#your-profile #rich_editing{background-color:#fff;}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#ebeeef;}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf;}.plugins .active,.plugins .active th,.plugins .active td{color:#000;}.plugins .inactive a{color:#579;}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4;}#the-comment-list .unapproved{background-color:#ffffe0;}#the-comment-list .approve a{color:#006505;}#the-comment-list .unapprove a{color:#d98500;}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b;}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#dfdfdf;}.widget,.postbox{background-color:#fff;}.ui-sortable .postbox h3{color:#093e56;}.widget .widget-top,.ui-sortable .postbox h3:hover{color:#000;}.curtime #timestamp{background-image:url(../images/date-button.gif);}#quicktags #ed_link{color:#00f;}#rightnow .youhave{background-color:#f0f6fb;}#rightnow a{color:#448abd;}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat;}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0;}#update-nag{background-color:#fffeeb;border-color:#ccc;color:#555;}.login #backtoblog a{color:#ccc;}#wphead{background-color:#1d507d;}body.login{border-top-color:#093e56;}#wphead h1 a{color:#fff;}#user_info{color:#b6d1e4;}#user_info a:link,#user_info a:visited,#footer a:link,#footer a:visited{color:#fff;text-decoration:none;}#user_info a:hover,#user_info a:active,#footer a:hover,#footer a:active{text-decoration:underline;}div#media-upload-error,.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover,#dashboard_recent_comments .spam a:hover{color:#f00;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}#quicktags{border-color:#dfdfdf;background-color:#dfdfdf;}#ed_toolbar input{border-color:#c3c3c3;}#ed_toolbar input:hover{border-color:#aaa;background:#ddd;}#poststuff .wp_themeSkin .mceStatusbar{border-color:#ededed;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{background-color:#f2f1eb;border-color:#dfdfdf;color:#999;}#poststuff #editor-toolbar .active{border-bottom-color:#e3eef7;background-color:#e3eef7;color:#333;}#post-status-info{background-color:#ededed;}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#000;}.wp_themeSkin iframe{background:#fff;}.wp_themeSkin .mceStatusbar{color:#000;background-color:#f5f5f5;}.wp_themeSkin .mceButton{background-color:#e9e8e8;border-color:#b2b2b2;}.wp_themeSkin a.mceButtonEnabled:hover,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonSelected{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceButtonDisabled{border-color:#ccc!important;}.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen{border-color:#b2b2b2;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin .mceListBoxSelected .mceText{border-color:#777!important;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceText,.wp_themeSkin .mceListBoxHover .mceText{border-color:#777!important;}.wp_themeSkin select.mceListBox{border-color:#b2b2b2;background-color:#fff;}.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen{border-color:#b2b2b2;}.wp_themeSkin .mceSplitButton a.mceOpen:hover,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,.wp_themeSkin .mceSplitButton a.mceAction:hover{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceSplitButtonActive{background-color:#b2b2b2;}.wp_themeSkin div.mceColorSplitMenu table{background-color:#ebebeb;border-color:#b2b2b2;}.wp_themeSkin .mceColorSplitMenu a{border-color:#b2b2b2;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors{border-color:#fff;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover{border-color:#0a246a;background-color:#b6bdd2;}.wp_themeSkin a.mceMoreColors:hover{border-color:#0a246a;}.wp_themeSkin .mceMenu{border-color:#ddd;}.wp_themeSkin .mceMenu table{background-color:#ebeaeb;}.wp_themeSkin .mceMenu .mceText{color:#000;}.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,.wp_themeSkin .mceMenu .mceMenuItemActive{background-color:#f5f5f5;}.wp_themeSkin td.mceMenuItemSeparator{background-color:#aaa;}.wp_themeSkin .mceMenuItemTitle a{background-color:#ccc;border-bottom-color:#aaa;}.wp_themeSkin .mceMenuItemTitle span.mceText{color:#000;}.wp_themeSkin .mceMenuItemDisabled .mceText{color:#888;}#quicktags,.wp_themeSkin tr.mceFirst td.mceToolbar{background:#e3eef7 url("../images/ed-bg-vs.gif") repeat-x scroll left top;}.wp_themeSkin tr.mceFirst td.mceToolbar{border-color:#dfdfdf;}.wp-admin #mceModalBlocker{background:#000;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-moz-border-radius:4px 0 0 0;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;border-top-right-radius:4px;-khtml-border-top-right-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius:0 4px 0 0;}.wp-admin .clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceFocus .mceTop span{color:#e5e5e5;}#editorcontainer,#post-status-info,#titlediv #title,.editwidget .widget-inside{border-color:#dfdfdf;}#titlediv #title{background-color:#fff;}#tTips p#tTips_inside{background-color:#ddd;color:#333;}#timestampdiv input,#namediv input,#poststuff .inside .the-tagcloud{border-color:#dfdfdf;}#adminmenu *{border-color:#dfdfdf;}#adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;}.folded #adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -207px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px;}#adminmenu a.menu-top{background:#eaf3fa url(../images/menu-bits-vs.gif) repeat-x scroll left -379px;}#adminmenu .wp-submenu a{background:#fff url(../images/menu-bits-vs.gif) no-repeat scroll 0 -310px;}#adminmenu .wp-has-current-submenu ul li a{background:none;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark.gif) top left no-repeat!important;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu .menu-top .current{background:#3c6b95 url(../images/menu-bits-vs.gif) top left repeat-x;border-color:#1d507d;color:#fff;text-shadow:rgba(0,0,0,0.4) 0 -1px 0;}#adminmenu li.wp-has-current-submenu .wp-submenu,#adminmenu li.wp-has-current-submenu ul li a{border-color:#aaa!important;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark.gif) bottom left no-repeat!important;}#adminmenu li.wp-has-current-submenu ul{border-bottom-color:#aaa;}#adminmenu li.menu-top .current:hover{border-color:#6583c0;}#adminmenu .wp-submenu .current a.current{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll 0 -289px;}#adminmenu .wp-submenu a:hover{background-color:#eaf2fa!important;color:#333!important;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333;background-color:#f5f5f5;background-image:none;border-color:#e3e3e3;text-shadow:rgba(255,255,255,1) 0 1px 0;}#adminmenu .wp-submenu ul{background-color:#fff;}.folded #adminmenu li.menu-top,#adminmenu .wp-submenu .wp-submenu-head{background-color:#eaf2fa;}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.menu-top.current{background-color:#bbd8e7;}#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background-color:#bbd8e7;border-color:#8cbdd5;}#adminmenu div.wp-submenu{background-color:transparent;}#adminmenu #menu-dashboard div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -61px -33px;}#adminmenu #menu-dashboard:hover div.wp-menu-image,#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu #menu-dashboard.current div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -61px -1px;}#adminmenu #menu-posts div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -272px -33px;}#adminmenu #menu-posts:hover div.wp-menu-image,#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -272px -1px;}#adminmenu #menu-media div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -121px -33px;}#adminmenu #menu-media:hover div.wp-menu-image,#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -121px -1px;}#adminmenu #menu-links div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -91px -33px;}#adminmenu #menu-links:hover div.wp-menu-image,#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -91px -1px;}#adminmenu #menu-pages div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -151px -33px;}#adminmenu #menu-pages:hover div.wp-menu-image,#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -151px -1px;}#adminmenu #menu-comments div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -31px -33px;}#adminmenu #menu-comments:hover div.wp-menu-image,#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu #menu-comments.current div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -31px -1px;}#adminmenu #menu-appearance div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -1px -33px;}#adminmenu #menu-appearance:hover div.wp-menu-image,#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -1px -1px;}#adminmenu #menu-plugins div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -181px -33px;}#adminmenu #menu-plugins:hover div.wp-menu-image,#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -181px -1px;}#adminmenu #menu-users div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -301px -33px;}#adminmenu #menu-users:hover div.wp-menu-image,#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -301px -1px;}#adminmenu #menu-tools div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -211px -33px;}#adminmenu #menu-tools:hover div.wp-menu-image,#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -211px -1px;}#adminmenu #menu-settings div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -241px -33px;}#adminmenu #menu-settings:hover div.wp-menu-image,#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu-vs.png") no-repeat scroll -241px -1px;}table.diff .diff-deletedline{background-color:#fdd;}table.diff .diff-deletedline del{background-color:#f99;}table.diff .diff-addedline{background-color:#dfd;}table.diff .diff-addedline ins{background-color:#9f9;}#att-info{background-color:#e4f2fd;}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf;}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#d54e21;}#screen-options-wrap,#contextual-help-wrap{background-color:#eae9e4;border-color:#dfdfdf;}#screen-meta-links a.show-settings{color:#606060;}#screen-meta-links a.show-settings:hover{color:#000;}#replysubmit{background-color:#f1f1f1;border-top-color:#ddd;}#replyerror{border-color:#ddd;background-color:#f9f9f9;}#edithead,#replyhead{background-color:#f1f1f1;}#ed_reply_toolbar{background-color:#e9e9e9;}.vim-current,.vim-current th,.vim-current td{background-color:#e4f2fd!important;}.star-average,.star.star-rating{background-color:#fc0;}div.star.select:hover{background-color:#d00;}#plugin-information .fyi ul{background-color:#eaf3fa;}#plugin-information .fyi h2.mainheader{background-color:#cee1ef;}#plugin-information pre,#plugin-information code{background-color:#ededff;}#plugin-information pre{border:1px solid #ccc;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea,#bulk-titles,#replyrow input{border-color:#ddd;}.inline-editor div.title{background-color:#eaf3fa;}.inline-editor ul.cat-checklist{background-color:#fff;border-color:#ddd;}.inline-editor .categories .catshow,.inline-editor .categories .cathide{color:#21759b;}.inline-editor .quick-edit-save{background-color:#f1f1f1;}#replyrow #ed_reply_toolbar input:hover{border-color:#aaa;background:#ddd;}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf;}.attention{color:#d54e21;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;}#major-publishing-actions{background:#eaf2fa;}.tablenav .tablenav-pages{color:#555;}.tablenav .tablenav-pages a{border-color:#e3e3e3;background:#eee url('../images/menu-bits-vs.gif') repeat-x scroll left -379px;}.tablenav .tablenav-pages a:hover{color:#d54e21;border-color:#d54321;}.tablenav .tablenav-pages a:active{color:#fff!important;}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3;}#availablethemes,#availablethemes td{border-color:#ddd;}#current-theme img{border-color:#999;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999;}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc;}.misc-pub-section{border-bottom-color:#eee;}#minor-publishing{border-bottom-color:#ddd;}#post-body .misc-pub-section{border-right-color:#eee;}.post-com-count span{background-color:#bbb;}.form-table .color-palette td{border-color:#fff;}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;}#post-body ul#category-tabs li.tabs a{color:#333;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{border-color:#999;background-color:#eee;}#wp_editimgbtn:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_delgallery:hover{border-color:#555;background-color:#ccc;}#favorite-first{background:#5580a6 url(../images/fav-vs.png) repeat-x 0 center;border-color:#517ea5!important;border-bottom-color:#416686!important;}#favorite-actions .slide-down{background-image:url(../images/fav-top-vs.gif);background-position:0 0;background-repeat:repeat-x;}#favorite-inside{border-color:#5b86ac;background-color:#5580a6;}#favorite-toggle{background:transparent url(../images/fav-arrow-vs.gif) no-repeat 0 -4px;}#favorite-actions a{color:#ddd;}#favorite-actions a:hover{color:#fff;}#favorite-inside a:hover{text-decoration:underline;}#favorite-actions .slide-down{border-bottom-color:#626262;}#screen-meta a.show-settings{background-color:transparent;text-shadow:rgba(255,255,255,0.7) 0 1px 0;}#icon-edit,#icon-post{background:transparent url(../images/icons32-vs.png) no-repeat -552px -5px;}#icon-index{background:transparent url(../images/icons32-vs.png) no-repeat -137px -5px;}#icon-upload{background:transparent url(../images/icons32-vs.png) no-repeat -251px -5px;}#icon-link-manager,#icon-link,#icon-link-category{background:transparent url(../images/icons32-vs.png) no-repeat -190px -5px;}#icon-edit-pages,#icon-page{background:transparent url(../images/icons32-vs.png) no-repeat -312px -5px;}#icon-edit-comments{background:transparent url(../images/icons32-vs.png) no-repeat -72px -5px;}#icon-themes{background:transparent url(../images/icons32-vs.png) no-repeat -11px -5px;}#icon-plugins{background:transparent url(../images/icons32-vs.png) no-repeat -370px -5px;}#icon-users,#icon-profile,#icon-user-edit{background:transparent url(../images/icons32-vs.png) no-repeat -600px -5px;}#icon-tools,#icon-admin{background:transparent url(../images/icons32-vs.png) no-repeat -432px -5px;}#icon-options-general{background:transparent url(../images/icons32-vs.png) no-repeat -492px -5px;}.view-switch #view-switch-list{background:transparent url(../images/list-vs.png) no-repeat 0 0;}.view-switch #view-switch-list.current{background:transparent url(../images/list-vs.png) no-repeat -40px 0;}.view-switch #view-switch-excerpt{background:transparent url(../images/list-vs.png) no-repeat -20px 0;}.view-switch #view-switch-excerpt.current{background:transparent url(../images/list-vs.png) no-repeat -60px 0;}#header-logo{background:transparent url(../images/wp-logo-vs.gif) no-repeat scroll center center;}#wphead #site-visit-button{background-color:#3c6b95;background-image:url(../images/visit-site-button-grad-vs.gif);color:#b6d1e4;text-shadow:#3f3f3f 0 -1px 0;}#wphead a:hover #site-visit-button{color:#fff;}#wphead a:focus #site-visit-button,#wphead a:active #site-visit-button{background-position:0 -27px;}.popular-tags,.feature-filter{background-color:#fff;border-color:#dfdfdf;}#theme-information .action-button{border-top-color:#dfdfdf;}.theme-listing br.line{border-bottom-color:#ccc;}div.widgets-sortables,#widgets-left .inactive{background-color:#f1f1f1;border-color:#ddd;}#available-widgets .widget-holder{background-color:#fff;border-color:#ddd;}#widgets-left .sidebar-name{background-color:#aaa;background-image:url(../images/ed-bg-vs.gif);text-shadow:#FFF 0 1px 0;border-color:#dfdfdf;}#widgets-right .sidebar-name{background-image:url(../images/fav-vs.png);text-shadow:#3f3f3f 0 -1px 0;background-color:#636363;border-color:#636363;color:#fff;}.sidebar-name:hover,#removing-widget{color:#d54e21;}#removing-widget span{color:black;}#widgets-left .sidebar-name-arrow{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px;}#widgets-right .sidebar-name-arrow{background:transparent url(../images/fav-arrow-vs.gif) no-repeat scroll 0 -1px;}.in-widget-title{color:#606060;}.deleting .widget-title *{color:#aaa;}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1;}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea;}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5;}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf;}.comment-ays,.comment-ays th{border-color:#ddd;}.comment-ays th{background-color:#f1f1f1;} \ No newline at end of file +html{background-color:#f7f6f1;}* html input,* html .widget{border-color:#8cbdd5;}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-color:#dfdfdf;background-color:#fff;}kbd,code{background:#eaeaea;}input[readonly]{background-color:#eee;}.find-box-search{border-color:#dfdfdf;background-color:#f1f1f1;}.find-box{background-color:#f1f1f1;}.find-box-inside{background-color:#fff;}a.page-numbers:hover{border-color:#999;}body,#wpbody,.form-table .pre{color:#333;}body>#upload-menu{border-bottom-color:#fff;}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links,#replyrow #ed_reply_toolbar input{border-color:#ccc;}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red;}#poststuff .inside label.waiting{color:orange;}#poststuff .inside label.approved{color:green;}#postcustomstuff table{border-color:#dfdfdf;background-color:#f9f9f9;}#postcustomstuff thead th{background-color:#f1f1f1;}#postcustomstuff table input,#postcustomstuff table textarea{border-color:#dfdfdf;background-color:#fff;}.widefat{border-color:#dfdfdf;background-color:#fff;}div.dashboard-widget-error{background-color:#c43;}div.dashboard-widget-notice{background-color:#cfe1ef;}div.dashboard-widget-submit{border-top-color:#ccc;}div.tabs-panel,ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs{border-color:#dfdfdf;}ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs{background-color:#f1f1f1;}input.disabled,textarea.disabled{background-color:#ccc;}.login #backtoblog a:hover,#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff;}.widget .widget-top,.postbox h3,.stuffbox h3{background:#d5e6f2 url("../images/blue-grad.png") repeat-x left top;text-shadow:#fff 0 1px 0;}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0;}.description,.form-wrap p{color:#666;}strong .post-com-count span{background-color:#21759b;}.sorthelper{background-color:#ccf3fa;}.ac_match,.subsubsub a.current{color:#000;}.wrap h2{color:#093e56;}.ac_over{background-color:#f0f0b8;}.ac_results{background-color:#fff;border-color:#808080;}.ac_results li{color:#101010;}.alt .alternate{background-color:#edfbfc;}.available-theme a.screenshot{background-color:#f1f1f1;border-color:#ddd;}.bar{background-color:#e8e8e8;border-right-color:#99d;}#media-upload,#media-upload .media-item .slidetoggle{background:#fff;}#media-upload .slidetoggle{border-top-color:#dfdfdf;}.error,.login #login_error{background-color:#ffebe8;border-color:#c00;}.error a{color:#c00;}.form-invalid{background-color:#ffebe8!important;}.form-invalid input,.form-invalid select{border-color:#c00!important;}.submit{border-color:#8cbdd5;}.highlight{background-color:#e4f2fd;color:#d54e21;}.howto,.nonessential,#edit-slug-box,.form-input-tip,.rss-widget span.rss-date,.subsubsub{color:#666;}.media-item{border-bottom-color:#dfdfdf;}#wpbody-content #media-items .describe{border-top-color:#dfdfdf;}.media-upload-form label.form-help,td.help{color:#9a9a9a;}.post-com-count{background-image:url(../images/bubble_bg.gif);color:#fff;}.post-com-count span{background-color:#bbb;color:#fff;}.post-com-count:hover span{background-color:#d54e21;}.quicktags,.search{background-color:#ccc;color:#000;}.side-info h5{border-bottom-color:#dadada;}.side-info ul{color:#666;}.button,.button-secondary,.submit input,input[type=button],input[type=submit]{border-color:#dfdfdf;color:#464646;}.button:hover,.button-secondary:hover,.submit input:hover,input[type=button]:hover,input[type=submit]:hover{color:#000;border-color:#adaca7;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;text-shadow:rgba(255,255,255,1) 0 1px 0;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}input.button-primary,button.button-primary,a.button-primary{border-color:#5b86ab;font-weight:bold;color:#fff;background:#5580a6 url(../images/button-grad-vs.png) repeat-x scroll left top;text-shadow:rgba(0,0,0,0.3) 0 -1px 0;}input.button-primary:active,button.button-primary:active,a.button-primary:active{background:#21759b url(../images/button-grad-active-vs.png) repeat-x scroll left top;color:#eaf2fa;}input.button-primary:hover,button.button-primary:hover,a.button-primary:hover,a.button-primary:focus,a.button-primary:active{border-color:#2e5475;color:#eaf2fa;}.button-disabled,.button[disabled],.button:disabled,.button-secondary[disabled],.button-secondary:disabled,a.button.disabled{color:#aaa!important;border-color:#ddd!important;}.button-primary-disabled,.button-primary[disabled],.button-primary:disabled{color:#B0C3E2!important;background:#6590A6!important;}a:hover,a:active,a:focus{color:#d54e21;}#wphead #viewsite a:hover,#adminmenu a:hover,#adminmenu ul.wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21;}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf;}#side-sortables .category-tabs .tabs a,#side-sortables .add-menu-item-tabs .tabs a{color:#333;}#rightnow .rbutton{background-color:#ebebeb;color:#264761;}.submitbox .submit{background-color:#464646;color:#ccc;}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00;}.submitbox .submitdelete:hover,#media-items a.delete:hover{color:#fff;background-color:#f00;border-bottom-color:#f00;}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00;}.tablenav .dots{border-color:transparent;}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b;}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21;}.updated,.login .message{background-color:#ffffe0;border-color:#e6db55;}.update-message{color:#000;}a.page-numbers{border-bottom-color:#b8d3e2;}.commentlist li{border-bottom-color:#ccc;}.widefat td,.widefat th,#install-plugins .plugins td,#install-plugins .plugins th{border-color:#dfdfdf;}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0;}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head{color:#333;background:#d5e6f2 url(../images/blue-grad.png) repeat-x scroll left top;}h3.dashboard-widget-title small a{color:#d7d7d7;}h3.dashboard-widget-title small a:hover{color:#fff;}a,#adminmenu a,#poststuff #edButtonPreview,#poststuff #edButtonHTML,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,.plugins a.delete,.ui-tabs-nav a{color:#1c6280;}body.press-this .tabs a,body.press-this .tabs a:hover{border-color:#c6d9e9;border-bottom-color:#fff;color:#d54e21;}#adminmenu #awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow,#plugin-information .action-button{background-color:#d54e21;color:#fff;}#adminmenu li a:hover #awaiting-mod,#adminmenu li a:hover .update-plugins,#sidemenu li a:hover .update-plugins{background-color:#264761;color:#fff;}#adminmenu li.current a #awaiting-mod,#adminmenu li.current a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins{background-color:#ddd;color:#000;text-shadow:none;-moz-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-khtml-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-webkit-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;box-shadow:rgba(0,0,0,0.2) 0 -1px 0;}#adminmenu li.current a:hover #awaiting-mod,#adminmenu li.current a:hover .update-plugins,#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod,#adminmenu li.wp-has-current-submenu a:hover .update-plugins{background-color:#264761;color:#fff;}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf;}#currenttheme img{border-color:#666;}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9;}input.readonly,textarea.readonly{background-color:#ddd;}#ed_toolbar input,#ed_reply_toolbar input{background:#fff url("../images/fade-butt.png") repeat-x 0 -2px;}#editable-post-name{background-color:#fffbcc;}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on{color:#777;}.login #nav a{color:#21759b!important;}.login #nav a:hover{color:#d54e21!important;}#footer,#footer-upgrade{background:#1d507d;color:#b6d1e4;}#media-items,.imgedit-group{border-color:#dfdfdf;}.checkbox,.side-info,.plugins tr,.postbox,#your-profile #rich_editing{background-color:#fff;}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#ebeeef;}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf;}.plugins .active,.plugins .active th,.plugins .active td{color:#000;}.plugins .inactive a{color:#579;}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4;}#the-comment-list .unapproved{background-color:#ffffe0;}#the-comment-list .approve a{color:#006505;}#the-comment-list .unapprove a{color:#d98500;}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b;}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#dfdfdf;}.widget,.postbox{background-color:#fff;}.ui-sortable .postbox h3{color:#093e56;}.widget .widget-top,.ui-sortable .postbox h3:hover{color:#000;}.curtime #timestamp{background-image:url(../images/date-button.gif);}#quicktags #ed_link{color:#00f;}#rightnow .youhave{background-color:#f0f6fb;}#rightnow a{color:#448abd;}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat;}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0;}#update-nag,.update-nag{background-color:#FFFBCC;border-color:#E6DB55;color:#555;}.login #backtoblog a{color:#ccc;}#wphead{background-color:#1d507d;}body.login{border-top-color:#093e56;}#wphead h1 a{color:#fff;}#user_info{color:#b6d1e4;}#user_info a:link,#user_info a:visited,#footer a:link,#footer a:visited{color:#fff;text-decoration:none;}#user_info a:hover,#user_info a:active,#footer a:hover,#footer a:active{text-decoration:underline;}div#media-upload-error,.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover,#dashboard_recent_comments .spam a:hover{color:#f00;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}#quicktags{border-color:#dfdfdf;background-color:#dfdfdf;}#ed_toolbar input{border-color:#c3c3c3;}#ed_toolbar input:hover{border-color:#aaa;background:#ddd;}#poststuff .wp_themeSkin .mceStatusbar{border-color:#ededed;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{background-color:#f2f1eb;border-color:#dfdfdf;color:#999;}#poststuff #editor-toolbar .active{border-bottom-color:#e3eef7;background-color:#e3eef7;color:#333;}#post-status-info{background-color:#ededed;}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#000;}.wp_themeSkin iframe{background:#fff;}.wp_themeSkin .mceStatusbar{color:#000;background-color:#f5f5f5;}.wp_themeSkin .mceButton{background-color:#e9e8e8;border-color:#b2b2b2;}.wp_themeSkin a.mceButtonEnabled:hover,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonSelected{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceButtonDisabled{border-color:#ccc!important;}.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen{border-color:#b2b2b2;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin .mceListBoxSelected .mceText{border-color:#777!important;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceText,.wp_themeSkin .mceListBoxHover .mceText{border-color:#777!important;}.wp_themeSkin select.mceListBox{border-color:#b2b2b2;background-color:#fff;}.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen{border-color:#b2b2b2;}.wp_themeSkin .mceSplitButton a.mceOpen:hover,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,.wp_themeSkin .mceSplitButton a.mceAction:hover{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceSplitButtonActive{background-color:#b2b2b2;}.wp_themeSkin div.mceColorSplitMenu table{background-color:#ebebeb;border-color:#b2b2b2;}.wp_themeSkin .mceColorSplitMenu a{border-color:#b2b2b2;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors{border-color:#fff;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover{border-color:#0a246a;background-color:#b6bdd2;}.wp_themeSkin a.mceMoreColors:hover{border-color:#0a246a;}.wp_themeSkin .mceMenu{border-color:#ddd;}.wp_themeSkin .mceMenu table{background-color:#ebeaeb;}.wp_themeSkin .mceMenu .mceText{color:#000;}.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,.wp_themeSkin .mceMenu .mceMenuItemActive{background-color:#f5f5f5;}.wp_themeSkin td.mceMenuItemSeparator{background-color:#aaa;}.wp_themeSkin .mceMenuItemTitle a{background-color:#ccc;border-bottom-color:#aaa;}.wp_themeSkin .mceMenuItemTitle span.mceText{color:#000;}.wp_themeSkin .mceMenuItemDisabled .mceText{color:#888;}#quicktags,.wp_themeSkin tr.mceFirst td.mceToolbar{background:#d5e6f2 url("../images/ed-bg-vs.gif") repeat-x scroll left top;}.wp_themeSkin tr.mceFirst td.mceToolbar{border-color:#dfdfdf;}.wp-admin #mceModalBlocker{background:#000;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-moz-border-radius:4px 0 0 0;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;border-top-right-radius:4px;-khtml-border-top-right-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius:0 4px 0 0;}.wp-admin .clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceFocus .mceTop span{color:#e5e5e5;}#editorcontainer,#post-status-info,#titlediv #title,.editwidget .widget-inside{border-color:#dfdfdf;}#titlediv #title{background-color:#fff;}#tTips p#tTips_inside{background-color:#ddd;color:#333;}#timestampdiv input,#namediv input,#poststuff .inside .the-tagcloud{border-color:#dfdfdf;}#adminmenu *{border-color:#dfdfdf;}#adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;}.folded #adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -207px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px;}#adminmenu a.menu-top{background:#eaf3fa url(../images/menu-bits-vs.gif) repeat-x scroll left -379px;}#adminmenu .wp-submenu a{background:#fff url(../images/menu-bits-vs.gif) no-repeat scroll 0 -310px;}#adminmenu .wp-has-current-submenu ul li a{background:none;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark.gif) top left no-repeat!important;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu .menu-top .current{background:#3c6b95 url(../images/menu-bits-vs.gif) top left repeat-x;border-color:#1d507d;color:#fff;text-shadow:rgba(0,0,0,0.4) 0 -1px 0;}#adminmenu li.wp-has-current-submenu .wp-submenu,#adminmenu li.wp-has-current-submenu ul li a{border-color:#aaa!important;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark.gif) bottom left no-repeat!important;}#adminmenu li.wp-has-current-submenu ul{border-bottom-color:#aaa;}#adminmenu li.menu-top .current:hover{border-color:#6583c0;}#adminmenu .wp-submenu .current a.current{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll 0 -289px;}#adminmenu .wp-submenu a:hover{background-color:#eaf2fa!important;color:#333!important;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333;background-color:#f5f5f5;background-image:none;border-color:#e3e3e3;text-shadow:rgba(255,255,255,1) 0 1px 0;}#adminmenu .wp-submenu ul{background-color:#fff;}.folded #adminmenu li.menu-top,#adminmenu .wp-submenu .wp-submenu-head{background-color:#eaf2fa;}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.menu-top.current{background-color:#bbd8e7;}#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background-color:#bbd8e7;border-color:#8cbdd5;}#adminmenu div.wp-submenu{background-color:transparent;}#adminmenu .menu-icon-dashboard div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -61px -33px;}#adminmenu .menu-icon-dashboard:hover div.wp-menu-image,#adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-dashboard.current div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -61px -1px;}#adminmenu .menu-icon-post div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -272px -33px;}#adminmenu .menu-icon-post:hover div.wp-menu-image,#adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -272px -1px;}#adminmenu .menu-icon-media div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -121px -33px;}#adminmenu .menu-icon-media:hover div.wp-menu-image,#adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -121px -1px;}#adminmenu .menu-icon-links div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -91px -33px;}#adminmenu .menu-icon-links:hover div.wp-menu-image,#adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -91px -1px;}#adminmenu .menu-icon-page div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -151px -33px;}#adminmenu .menu-icon-page:hover div.wp-menu-image,#adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -151px -1px;}#adminmenu .menu-icon-comments div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -31px -33px;}#adminmenu .menu-icon-comments:hover div.wp-menu-image,#adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-comments.current div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -31px -1px;}#adminmenu .menu-icon-appearance div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -1px -33px;}#adminmenu .menu-icon-appearance:hover div.wp-menu-image,#adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -1px -1px;}#adminmenu .menu-icon-plugins div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -181px -33px;}#adminmenu .menu-icon-plugins:hover div.wp-menu-image,#adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -181px -1px;}#adminmenu .menu-icon-users div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -301px -33px;}#adminmenu .menu-icon-users:hover div.wp-menu-image,#adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -301px -1px;}#adminmenu .menu-icon-tools div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -211px -33px;}#adminmenu .menu-icon-tools:hover div.wp-menu-image,#adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -211px -1px;}#adminmenu .menu-icon-settings div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -241px -33px;}#adminmenu .menu-icon-settings:hover div.wp-menu-image,#adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -241px -1px;}#adminmenu .menu-icon-site div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -361px -33px;}#adminmenu .menu-icon-site:hover div.wp-menu-image,#adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -361px -1px;}table.diff .diff-deletedline{background-color:#fdd;}table.diff .diff-deletedline del{background-color:#f99;}table.diff .diff-addedline{background-color:#dfd;}table.diff .diff-addedline ins{background-color:#9f9;}#att-info{background-color:#e4f2fd;}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf;}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#d54e21;}#screen-options-wrap,#contextual-help-wrap{background-color:#eae9e4;border-color:#dfdfdf;}#screen-meta-links a.show-settings{color:#606060;}#screen-meta-links a.show-settings:hover{color:#000;}#replysubmit{background-color:#f1f1f1;border-top-color:#ddd;}#replyerror{border-color:#ddd;background-color:#f9f9f9;}#edithead,#replyhead{background-color:#f1f1f1;}#ed_reply_toolbar{background-color:#e9e9e9;}.vim-current,.vim-current th,.vim-current td{background-color:#e4f2fd!important;}.star-average,.star.star-rating{background-color:#fc0;}div.star.select:hover{background-color:#d00;}#plugin-information .fyi ul{background-color:#eaf3fa;}#plugin-information .fyi h2.mainheader{background-color:#cee1ef;}#plugin-information pre,#plugin-information code{background-color:#ededff;}#plugin-information pre{border:1px solid #ccc;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea,#bulk-titles,#replyrow input{border-color:#ddd;}.inline-editor div.title{background-color:#eaf3fa;}.inline-editor ul.cat-checklist{background-color:#fff;border-color:#ddd;}.inline-editor .categories .catshow,.inline-editor .categories .cathide{color:#21759b;}.inline-editor .quick-edit-save{background-color:#f1f1f1;}#replyrow #ed_reply_toolbar input:hover{border-color:#aaa;background:#ddd;}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf;}.attention{color:#d54e21;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;}#major-publishing-actions{background:#eaf2fa;}.tablenav .tablenav-pages{color:#555;}.tablenav .tablenav-pages a{border-color:#e3e3e3;background:#eee url('../images/menu-bits-vs.gif') repeat-x scroll left -379px;}.tablenav .tablenav-pages a:hover{color:#d54e21;border-color:#d54321;}.tablenav .tablenav-pages a:active{color:#fff!important;}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3;}#availablethemes,#availablethemes td{border-color:#ddd;}#current-theme img{border-color:#999;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999;}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc;}.misc-pub-section{border-bottom-color:#eee;}#minor-publishing{border-bottom-color:#ddd;}#post-body .misc-pub-section{border-right-color:#eee;}.post-com-count span{background-color:#bbb;}.form-table .color-palette td{border-color:#fff;}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;}#post-body ul.category-tabs li.tabs a,#post-body ul.add-menu-item-tabs li.tabs a{color:#333;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{border-color:#999;background-color:#eee;}#wp_editimgbtn:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_delgallery:hover{border-color:#555;background-color:#ccc;}#favorite-first{background:#5580a6 url(../images/fav-vs.png) repeat-x 0 center;border-color:#517ea5!important;border-bottom-color:#416686!important;}#favorite-actions .slide-down{background-image:url(../images/fav-top-vs.gif);background-position:0 0;background-repeat:repeat-x;}#favorite-inside{border-color:#5b86ac;background-color:#5580a6;}#favorite-toggle{background:transparent url(../images/fav-arrow-vs.gif) no-repeat 0 -4px;}#favorite-actions a{color:#ddd;}#favorite-actions a:hover{color:#fff;}#favorite-inside a:hover{text-decoration:underline;}#favorite-actions .slide-down{border-bottom-color:#626262;}#screen-meta a.show-settings{background-color:transparent;text-shadow:rgba(255,255,255,0.7) 0 1px 0;}#icon-edit,#icon-post{background:transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -552px -5px;}#icon-index{background:transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -137px -5px;}#icon-upload{background:transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -251px -5px;}#icon-link-manager,#icon-link,#icon-link-category{background:transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -190px -5px;}#icon-edit-pages,#icon-page{background:transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -312px -5px;}#icon-edit-comments{background:transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -72px -5px;}#icon-themes{background:transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -11px -5px;}#icon-plugins{background:transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -370px -5px;}#icon-users,#icon-profile,#icon-user-edit{background:transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -600px -5px;}#icon-tools,#icon-admin{background:transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -432px -5px;}#icon-options-general{background:transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -492px -5px;}#icon-ms-admin{background:transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -659px -5px;}.view-switch #view-switch-list{background:transparent url(../images/list-vs.png) no-repeat 0 0;}.view-switch #view-switch-list.current{background:transparent url(../images/list-vs.png) no-repeat -40px 0;}.view-switch #view-switch-excerpt{background:transparent url(../images/list-vs.png) no-repeat -20px 0;}.view-switch #view-switch-excerpt.current{background:transparent url(../images/list-vs.png) no-repeat -60px 0;}#header-logo{background:transparent url(../images/wp-logo-vs.png) no-repeat scroll center center;}#wphead #site-visit-button{background-color:#3c6b95;background-image:url(../images/visit-site-button-grad-vs.gif);color:#b6d1e4;text-shadow:#3f3f3f 0 -1px 0;}#wphead a:hover #site-visit-button{color:#fff;}#wphead a:focus #site-visit-button,#wphead a:active #site-visit-button{background-position:0 -27px;}.popular-tags,.feature-filter{background-color:#fff;border-color:#dfdfdf;}#theme-information .action-button{border-top-color:#dfdfdf;}.theme-listing br.line{border-bottom-color:#ccc;}div.widgets-sortables,#widgets-left .inactive{background-color:#f1f1f1;border-color:#ddd;}#available-widgets .widget-holder{background-color:#fff;border-color:#ddd;}#widgets-left .sidebar-name{background-color:#aaa;background-image:url(../images/ed-bg-vs.gif);text-shadow:#fff 0 1px 0;border-color:#dfdfdf;}#widgets-right .sidebar-name{background-image:url(../images/fav-vs.png);text-shadow:#3f3f3f 0 -1px 0;background-color:#636363;border-color:#636363;color:#fff;}.sidebar-name:hover,#removing-widget{color:#d54e21;}#removing-widget span{color:black;}#widgets-left .sidebar-name-arrow{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px;}#widgets-right .sidebar-name-arrow{background:transparent url(../images/fav-arrow-vs.gif) no-repeat scroll 0 -1px;}.in-widget-title{color:#606060;}.deleting .widget-title *{color:#aaa;}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1;}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea;}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5;}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf;}.comment-ays,.comment-ays th{border-color:#ddd;}.comment-ays th{background-color:#f1f1f1;}#nav-menu-header,.menu-item-handle{background:url("../images/blue-grad.png") repeat-x scroll left top #d5e6f2;}#menu-management .nav-tab-active{background:#eaf3fa;border-bottom-color:#eaf3fa;} \ No newline at end of file diff --git a/wp-admin/css/colors-classic.dev.css b/wp-admin/css/colors-classic.dev.css index 9f244186..3d9924f7 100644 --- a/wp-admin/css/colors-classic.dev.css +++ b/wp-admin/css/colors-classic.dev.css @@ -4,7 +4,7 @@ html { * html input, * html .widget { - border-color: #8cbdd5; + border-color: #8cbdd5; } textarea, @@ -110,11 +110,13 @@ div.dashboard-widget-submit { } div.tabs-panel, -ul#category-tabs li.tabs { +ul.category-tabs li.tabs, +ul.add-menu-item-tabs li.tabs { border-color: #dfdfdf; } -ul#category-tabs li.tabs { +ul.category-tabs li.tabs, +ul.add-menu-item-tabs li.tabs { background-color: #f1f1f1; } @@ -380,11 +382,8 @@ div.dashboard-widget-submit input:hover, border-color: #dfdfdf; } -#dashboard_right_now .table { - background:#faf9f7 !important; -} - -#side-sortables #category-tabs .tabs a { +#side-sortables .category-tabs .tabs a, +#side-sortables .add-menu-item-tabs .tabs a { color: #333; } @@ -442,7 +441,7 @@ div.dashboard-widget-submit input:hover, } .update-message { - color: #000000; + color: #000; } a.page-numbers { @@ -497,7 +496,6 @@ a, /* Because we don't want visited on these links */ body.press-this .tabs a, body.press-this .tabs a:hover { - background-color: #fff; border-color: #c6d9e9; border-bottom-color: #fff; color: #d54e21; @@ -697,9 +695,9 @@ table.widefat span.spam a, background: url(../images/xit.gif) no-repeat -10px 0; } -#update-nag { - background-color: #fffeeb; - border-color: #ccc; +#update-nag, .update-nag { + background-color: #FFFBCC; + border-color: #E6DB55; color: #555; } @@ -949,7 +947,7 @@ table.widefat .spam a:hover, #quicktags, .wp_themeSkin tr.mceFirst td.mceToolbar { - background: #e3eef7 url("../images/ed-bg-vs.gif") repeat-x scroll left top; + background: #d5e6f2 url("../images/ed-bg-vs.gif") repeat-x scroll left top; } .wp_themeSkin tr.mceFirst td.mceToolbar { border-color: #dfdfdf; @@ -1145,105 +1143,114 @@ table.widefat .spam a:hover, } /* menu icons */ -#adminmenu #menu-dashboard div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -61px -33px; +#adminmenu .menu-icon-dashboard div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -61px -33px; +} + +#adminmenu .menu-icon-dashboard:hover div.wp-menu-image, +#adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image, +#adminmenu .menu-icon-dashboard.current div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -61px -1px; +} + +#adminmenu .menu-icon-post div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -272px -33px; } -#adminmenu #menu-dashboard:hover div.wp-menu-image, -#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image, -#adminmenu #menu-dashboard.current div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -61px -1px; +#adminmenu .menu-icon-post:hover div.wp-menu-image, +#adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -272px -1px; } -#adminmenu #menu-posts div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -272px -33px; +#adminmenu .menu-icon-media div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -121px -33px; } -#adminmenu #menu-posts:hover div.wp-menu-image, -#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -272px -1px; +#adminmenu .menu-icon-media:hover div.wp-menu-image, +#adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -121px -1px; } -#adminmenu #menu-media div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -121px -33px; +#adminmenu .menu-icon-links div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -91px -33px; } -#adminmenu #menu-media:hover div.wp-menu-image, -#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -121px -1px; +#adminmenu .menu-icon-links:hover div.wp-menu-image, +#adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -91px -1px; } -#adminmenu #menu-links div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -91px -33px; +#adminmenu .menu-icon-page div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -151px -33px; } -#adminmenu #menu-links:hover div.wp-menu-image, -#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -91px -1px; +#adminmenu .menu-icon-page:hover div.wp-menu-image, +#adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -151px -1px; } -#adminmenu #menu-pages div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -151px -33px; +#adminmenu .menu-icon-comments div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -31px -33px; } -#adminmenu #menu-pages:hover div.wp-menu-image, -#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -151px -1px; +#adminmenu .menu-icon-comments:hover div.wp-menu-image, +#adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image, +#adminmenu .menu-icon-comments.current div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -31px -1px; } -#adminmenu #menu-comments div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -31px -33px; +#adminmenu .menu-icon-appearance div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -1px -33px; } -#adminmenu #menu-comments:hover div.wp-menu-image, -#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image, -#adminmenu #menu-comments.current div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -31px -1px; +#adminmenu .menu-icon-appearance:hover div.wp-menu-image, +#adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -1px -1px; } -#adminmenu #menu-appearance div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -1px -33px; +#adminmenu .menu-icon-plugins div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -181px -33px; } -#adminmenu #menu-appearance:hover div.wp-menu-image, -#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -1px -1px; +#adminmenu .menu-icon-plugins:hover div.wp-menu-image, +#adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -181px -1px; } -#adminmenu #menu-plugins div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -181px -33px; +#adminmenu .menu-icon-users div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -301px -33px; } -#adminmenu #menu-plugins:hover div.wp-menu-image, -#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -181px -1px; +#adminmenu .menu-icon-users:hover div.wp-menu-image, +#adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -301px -1px; } -#adminmenu #menu-users div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -301px -33px; +#adminmenu .menu-icon-tools div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -211px -33px; } -#adminmenu #menu-users:hover div.wp-menu-image, -#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -301px -1px; +#adminmenu .menu-icon-tools:hover div.wp-menu-image, +#adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -211px -1px; } -#adminmenu #menu-tools div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -211px -33px; +#adminmenu .menu-icon-settings div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -241px -33px; } -#adminmenu #menu-tools:hover div.wp-menu-image, -#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -211px -1px; +#adminmenu .menu-icon-settings:hover div.wp-menu-image, +#adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -241px -1px; } -#adminmenu #menu-settings div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -241px -33px; +#adminmenu .menu-icon-site div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -361px -33px; } -#adminmenu #menu-settings:hover div.wp-menu-image, -#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.png") no-repeat scroll -241px -1px; +#adminmenu .menu-icon-site:hover div.wp-menu-image, +#adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu-vs.png?ver=20100531') no-repeat scroll -361px -1px; } /* end menu */ @@ -1463,7 +1470,8 @@ fieldset.inline-edit-col-right .inline-edit-col { background-color: #f5f5f5; } -#post-body ul#category-tabs li.tabs a { +#post-body ul.category-tabs li.tabs a, +#post-body ul.add-menu-item-tabs li.tabs a { color: #333; } @@ -1527,53 +1535,57 @@ fieldset.inline-edit-col-right .inline-edit-col { #icon-edit, #icon-post { - background: transparent url(../images/icons32-vs.png) no-repeat -552px -5px; + background: transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -552px -5px; } #icon-index { - background: transparent url(../images/icons32-vs.png) no-repeat -137px -5px; + background: transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -137px -5px; } #icon-upload { - background: transparent url(../images/icons32-vs.png) no-repeat -251px -5px; + background: transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -251px -5px; } #icon-link-manager, #icon-link, #icon-link-category { - background: transparent url(../images/icons32-vs.png) no-repeat -190px -5px; + background: transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -190px -5px; } #icon-edit-pages, #icon-page { - background: transparent url(../images/icons32-vs.png) no-repeat -312px -5px; + background: transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -312px -5px; } #icon-edit-comments { - background: transparent url(../images/icons32-vs.png) no-repeat -72px -5px; + background: transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -72px -5px; } #icon-themes { - background: transparent url(../images/icons32-vs.png) no-repeat -11px -5px; + background: transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -11px -5px; } #icon-plugins { - background: transparent url(../images/icons32-vs.png) no-repeat -370px -5px; + background: transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -370px -5px; } #icon-users, #icon-profile, #icon-user-edit { - background: transparent url(../images/icons32-vs.png) no-repeat -600px -5px; + background: transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -600px -5px; } #icon-tools, #icon-admin { - background: transparent url(../images/icons32-vs.png) no-repeat -432px -5px; + background: transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -432px -5px; } #icon-options-general { - background: transparent url(../images/icons32-vs.png) no-repeat -492px -5px; + background: transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -492px -5px; +} + +#icon-ms-admin { + background: transparent url(../images/icons32-vs.png?ver=20100531) no-repeat -659px -5px; } .view-switch #view-switch-list { @@ -1593,7 +1605,7 @@ fieldset.inline-edit-col-right .inline-edit-col { } #header-logo { - background: transparent url(../images/wp-logo-vs.gif) no-repeat scroll center center; + background: transparent url(../images/wp-logo-vs.png) no-repeat scroll center center; } #wphead #site-visit-button { @@ -1629,18 +1641,18 @@ fieldset.inline-edit-col-right .inline-edit-col { div.widgets-sortables, #widgets-left .inactive { background-color: #f1f1f1; - border-color: #ddd; + border-color: #ddd; } #available-widgets .widget-holder { - background-color: #fff; - border-color: #ddd; + background-color: #fff; + border-color: #ddd; } #widgets-left .sidebar-name { background-color: #aaa; background-image: url(../images/ed-bg-vs.gif); - text-shadow: #FFFFFF 0 1px 0; + text-shadow: #fff 0 1px 0; border-color: #dfdfdf; } @@ -1706,3 +1718,12 @@ div.widgets-sortables, .comment-ays th { background-color: #f1f1f1; } + +#nav-menu-header, .menu-item-handle { + background: url("../images/blue-grad.png") repeat-x scroll left top #d5e6f2; +} + +#menu-management .nav-tab-active { + background: #eaf3fa; + border-bottom-color: #eaf3fa; +} \ No newline at end of file diff --git a/wp-admin/css/colors-fresh-rtl.css b/wp-admin/css/colors-fresh-rtl.css index b6d88bb2..18930fdc 100644 --- a/wp-admin/css/colors-fresh-rtl.css +++ b/wp-admin/css/colors-fresh-rtl.css @@ -1,83 +1 @@ -.bar { - border-right-color: transparent; - border-left-color: #99d; -} - -.plugins .togl { - border-right-color: transparent; - border-left-color: #ccc; -} - -.post-com-count { - background-image: url(../images/bubble_bg-rtl.gif); -} -.tablenav .tablenav-pages a { - background: #eee url('../images/menu-bits-rtl.gif') repeat-x scroll right -379px; -} -#upload-menu li.current { - border-right-color: transparent; - border-left-color: #448abd; -} - -#adminmenu .wp-submenu .current a.current { - background: transparent url(../images/menu-bits-rtl.gif) no-repeat scroll right -289px; -} - -#adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px; -} - -.folded #adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px; -} - -#adminmenu li.wp-has-current-submenu .wp-menu-toggle, -#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { - background: transparent url(../images/menu-bits-rtl.gif) repeat-x scroll right -207px; -} - -#adminmenu .wp-has-current-submenu ul li a.current { - background: url(../images/menu-dark-rtl.gif) top right no-repeat !important; -} - -#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, -#adminmenu .menu-top .current { - background: url(../images/menu-bits-rtl.gif) top right repeat-x; -} - -#adminmenu li.wp-has-current-submenu ul li a { - background: url(../images/menu-dark-rtl.gif) bottom right no-repeat !important; -} - -#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { - background: transparent url(../images/menu-bits-rtl.gif) no-repeat right -207px; -} - -#adminmenu .wp-has-submenu:hover .wp-menu-toggle, -#adminmenu .wp-menu-open .wp-menu-toggle { - background: transparent url(../images/menu-bits-rtl.gif) repeat-x scroll right -109px; -} - -#adminmenu a.wp-has-submenu { - background: #f1f1f1 url(../images/menu-bits-rtl.gif) repeat-x scroll right -379px; -} - -#adminmenu .wp-submenu a { - background: #FFFFFF url(../images/menu-bits-rtl.gif) no-repeat scroll right -310px; -} - -#adminmenu li.current a, -#adminmenu .wp-submenu a:hover { - background: transparent url(../images/menu-bits-rtl.gif) no-repeat scroll right -289px; -} - -#adminmenu li.wp-has-current-submenu a.wp-has-submenu { - background: #b5b5b5 url(../images/menu-bits-rtl.gif) repeat-x scroll right top; -} - -.meta-box-sortables .postbox:hover .handlediv { - background: transparent url(../images/menu-bits-rtl.gif) no-repeat scroll right -111px; -} -#favorite-toggle { - background: transparent url(../images/fav-arrow-rtl.gif) no-repeat right -4px; -} +.bar{border-right-color:transparent;border-left-color:#99d;}.plugins .togl{border-right-color:transparent;border-left-color:#ccc;}.post-com-count{background-image:url(../images/bubble_bg-rtl.gif);}.tablenav .tablenav-pages a{background:#eee url('../images/menu-bits-rtl.gif?ver=20100531') repeat-x scroll right -379px;}#upload-menu li.current{border-right-color:transparent;border-left-color:#448abd;}#adminmenu .wp-submenu .current a.current{background:transparent url(../images/menu-bits-rtl.gif?ver=20100531) no-repeat scroll right -289px;}#adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;}.folded #adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;}#adminmenu li.wp-has-current-submenu .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits-rtl.gif?ver=20100531) repeat-x scroll right -207px;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark-rtl.gif) top right no-repeat!important;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu .menu-top .current{background:url(../images/menu-bits-rtl.gif?ver=20100531) top right repeat-x;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark-rtl.gif) bottom right no-repeat!important;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits-rtl.gif?ver=20100531) no-repeat right -207px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/menu-bits-rtl.gif?ver=20100531) repeat-x scroll right -109px;}#adminmenu a.wp-has-submenu{background:#f1f1f1 url(../images/menu-bits-rtl.gif?ver=20100531) repeat-x scroll right -379px;}#adminmenu .wp-submenu a{background:#fff url(../images/menu-bits-rtl.gif?ver=20100531) no-repeat scroll right -310px;}#adminmenu li.wp-has-current-submenu a.wp-has-submenu{background:#b5b5b5 url(../images/menu-bits-rtl.gif?ver=20100531) repeat-x scroll right top;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits-rtl.gif?ver=20100531) no-repeat scroll right -111px;}#favorite-toggle{background:transparent url(../images/fav-arrow-rtl.gif?ver=20100531) no-repeat right -4px;} \ No newline at end of file diff --git a/wp-admin/css/colors-fresh-rtl.dev.css b/wp-admin/css/colors-fresh-rtl.dev.css new file mode 100644 index 00000000..8071127d --- /dev/null +++ b/wp-admin/css/colors-fresh-rtl.dev.css @@ -0,0 +1,78 @@ +.bar { + border-right-color: transparent; + border-left-color: #99d; +} + +.plugins .togl { + border-right-color: transparent; + border-left-color: #ccc; +} + +.post-com-count { + background-image: url(../images/bubble_bg-rtl.gif); +} +.tablenav .tablenav-pages a { + background: #eee url('../images/menu-bits-rtl.gif?ver=20100531') repeat-x scroll right -379px; +} +#upload-menu li.current { + border-right-color: transparent; + border-left-color: #448abd; +} + +#adminmenu .wp-submenu .current a.current { + background: transparent url(../images/menu-bits-rtl.gif?ver=20100531) no-repeat scroll right -289px; +} + +#adminmenu li.wp-menu-separator { + background: transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px; +} + +.folded #adminmenu li.wp-menu-separator { + background: transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px; +} + +#adminmenu li.wp-has-current-submenu .wp-menu-toggle, +#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { + background: transparent url(../images/menu-bits-rtl.gif?ver=20100531) repeat-x scroll right -207px; +} + +#adminmenu .wp-has-current-submenu ul li a.current { + background: url(../images/menu-dark-rtl.gif) top right no-repeat !important; +} + +#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, +#adminmenu .menu-top .current { + background: url(../images/menu-bits-rtl.gif?ver=20100531) top right repeat-x; +} + +#adminmenu li.wp-has-current-submenu ul li a { + background: url(../images/menu-dark-rtl.gif) bottom right no-repeat !important; +} + +#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { + background: transparent url(../images/menu-bits-rtl.gif?ver=20100531) no-repeat right -207px; +} + +#adminmenu .wp-has-submenu:hover .wp-menu-toggle, +#adminmenu .wp-menu-open .wp-menu-toggle { + background: transparent url(../images/menu-bits-rtl.gif?ver=20100531) repeat-x scroll right -109px; +} + +#adminmenu a.wp-has-submenu { + background: #f1f1f1 url(../images/menu-bits-rtl.gif?ver=20100531) repeat-x scroll right -379px; +} + +#adminmenu .wp-submenu a { + background: #fff url(../images/menu-bits-rtl.gif?ver=20100531) no-repeat scroll right -310px; +} + +#adminmenu li.wp-has-current-submenu a.wp-has-submenu { + background: #b5b5b5 url(../images/menu-bits-rtl.gif?ver=20100531) repeat-x scroll right top; +} + +.meta-box-sortables .postbox:hover .handlediv { + background: transparent url(../images/menu-bits-rtl.gif?ver=20100531) no-repeat scroll right -111px; +} +#favorite-toggle { + background: transparent url(../images/fav-arrow-rtl.gif?ver=20100531) no-repeat right -4px; +} diff --git a/wp-admin/css/colors-fresh.css b/wp-admin/css/colors-fresh.css index f9448c8d..6937d35b 100644 --- a/wp-admin/css/colors-fresh.css +++ b/wp-admin/css/colors-fresh.css @@ -1 +1 @@ -html{background-color:#f9f9f9;}* html input,* html .widget{border-color:#dfdfdf;}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-color:#dfdfdf;background-color:#fff;}kbd,code{background:#eaeaea;}input[readonly]{background-color:#eee;}.find-box-search{border-color:#dfdfdf;background-color:#f1f1f1;}.find-box{background-color:#f1f1f1;}.find-box-inside{background-color:#fff;}a.page-numbers:hover{border-color:#999;}body,#wpbody,.form-table .pre{color:#333;}body>#upload-menu{border-bottom-color:#fff;}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links,#replyrow #ed_reply_toolbar input{border-color:#ccc;}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red;}#poststuff .inside label.waiting{color:orange;}#poststuff .inside label.approved{color:green;}#postcustomstuff table{border-color:#dfdfdf;background-color:#F9F9F9;}#postcustomstuff thead th{background-color:#F1F1F1;}#postcustomstuff table input,#postcustomstuff table textarea{border-color:#dfdfdf;background-color:#fff;}.widefat{border-color:#dfdfdf;background-color:#fff;}div.dashboard-widget-error{background-color:#c43;}div.dashboard-widget-notice{background-color:#cfe1ef;}div.dashboard-widget-submit{border-top-color:#ccc;}div.tabs-panel,ul#category-tabs li.tabs{border-color:#dfdfdf;}ul#category-tabs li.tabs{background-color:#f1f1f1;}input.disabled,textarea.disabled{background-color:#ccc;}.login #backtoblog a:hover,#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff;}.widget .widget-top,.postbox h3,.stuffbox h3{background:#dfdfdf url("../images/gray-grad.png") repeat-x left top;text-shadow:#fff 0 1px 0;}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0;}.description,.form-wrap p{color:#666;}strong .post-com-count span{background-color:#21759b;}.sorthelper{background-color:#ccf3fa;}.ac_match,.subsubsub a.current{color:#000;}.wrap h2{color:#464646;}.ac_over{background-color:#f0f0b8;}.ac_results{background-color:#fff;border-color:#808080;}.ac_results li{color:#101010;}.alternate,.alt{background-color:#f9f9f9;}.available-theme a.screenshot{background-color:#f1f1f1;border-color:#ddd;}.bar{background-color:#e8e8e8;border-right-color:#99d;}#media-upload,#media-upload .media-item .slidetoggle{background:#fff;}#media-upload .slidetoggle{border-top-color:#dfdfdf;}.error,.login #login_error{background-color:#ffebe8;border-color:#c00;}.error a{color:#c00;}.form-invalid{background-color:#ffebe8!important;}.form-invalid input,.form-invalid select{border-color:#c00!important;}.submit{border-color:#DFDFDF;}.highlight{background-color:#e4f2fd;color:#d54e21;}.howto,.nonessential,#edit-slug-box,.form-input-tip,.rss-widget span.rss-date,.subsubsub{color:#666;}.media-item{border-bottom-color:#dfdfdf;}#wpbody-content #media-items .describe{border-top-color:#dfdfdf;}.media-upload-form label.form-help,td.help{color:#9a9a9a;}.post-com-count{background-image:url(../images/bubble_bg.gif);color:#fff;}.post-com-count span{background-color:#bbb;color:#fff;}.post-com-count:hover span{background-color:#d54e21;}.quicktags,.search{background-color:#ccc;color:#000;}.side-info h5{border-bottom-color:#dadada;}.side-info ul{color:#666;}.button,.button-secondary,.submit input,input[type=button],input[type=submit]{border-color:#bbb;color:#464646;}.button:hover,.button-secondary:hover,.submit input:hover,input[type=button]:hover,input[type=submit]:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;text-shadow:rgba(255,255,255,1) 0 1px 0;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}input.button-primary,button.button-primary,a.button-primary{border-color:#298cba;font-weight:bold;color:#fff;background:#21759B url(../images/button-grad.png) repeat-x scroll left top;text-shadow:rgba(0,0,0,0.3) 0 -1px 0;}input.button-primary:active,button.button-primary:active,a.button-primary:active{background:#21759b url(../images/button-grad-active.png) repeat-x scroll left top;color:#eaf2fa;}input.button-primary:hover,button.button-primary:hover,a.button-primary:hover,a.button-primary:focus,a.button-primary:active{border-color:#13455b;color:#eaf2fa;}.button-disabled,.button[disabled],.button:disabled,.button-secondary[disabled],.button-secondary:disabled,a.button.disabled{color:#aaa!important;border-color:#ddd!important;}.button-primary-disabled,.button-primary[disabled],.button-primary:disabled{color:#9FD0D5!important;background:#298CBA!important;}a:hover,a:active,a:focus{color:#d54e21;}#wphead #viewsite a:hover,#adminmenu a:hover,#adminmenu ul.wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21;}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf;}#side-sortables #category-tabs .tabs a{color:#333;}#rightnow .rbutton{background-color:#ebebeb;color:#264761;}.submitbox .submit{background-color:#464646;color:#ccc;}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00;}.submitbox .submitdelete:hover,#media-items a.delete:hover{color:#fff;background-color:#f00;border-bottom-color:#f00;}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00;}.tablenav .dots{border-color:transparent;}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b;}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21;}.updated,.login .message{background-color:#ffffe0;border-color:#e6db55;}.update-message{color:#000;}a.page-numbers{border-bottom-color:#B8D3E2;}.commentlist li{border-bottom-color:#ccc;}.widefat td,.widefat th,#install-plugins .plugins td,#install-plugins .plugins th{border-color:#dfdfdf;}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0;}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head{color:#333;background:#dfdfdf url(../images/gray-grad.png) repeat-x scroll left top;}h3.dashboard-widget-title small a{color:#d7d7d7;}h3.dashboard-widget-title small a:hover{color:#fff;}a,#adminmenu a,#poststuff #edButtonPreview,#poststuff #edButtonHTML,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,.plugins a.delete,.ui-tabs-nav a{color:#21759b;}body.press-this .tabs a,body.press-this .tabs a:hover{background-color:#fff;border-color:#c6d9e9;border-bottom-color:#fff;color:#d54e21;}#adminmenu #awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow,#plugin-information .action-button{background-color:#d54e21;color:#fff;}#adminmenu li a:hover #awaiting-mod,#adminmenu li a:hover .update-plugins,#sidemenu li a:hover .update-plugins{background-color:#264761;color:#fff;}#adminmenu li.current a #awaiting-mod,#adminmenu li.current a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins,#adminmenu li.wp-has-current-submenu a .update-plugins{background-color:#ddd;color:#000;text-shadow:none;-moz-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-khtml-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;-webkit-box-shadow:rgba(0,0,0,0.2) 0 -1px 0;box-shadow:rgba(0,0,0,0.2) 0 -1px 0;}#adminmenu li.current a:hover #awaiting-mod,#adminmenu li.current a:hover .update-plugins,#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod,#adminmenu li.wp-has-current-submenu a:hover .update-plugins{background-color:#264761;color:#fff;}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf;}#currenttheme img{border-color:#666;}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9;}input.readonly,textarea.readonly{background-color:#ddd;}#ed_toolbar input,#ed_reply_toolbar input{background:#fff url("../images/fade-butt.png") repeat-x 0 -2px;}#editable-post-name{background-color:#fffbcc;}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on{color:#777;}.login #nav a{color:#21759b!important;}.login #nav a:hover{color:#d54e21!important;}#footer,#footer-upgrade{background:#464646;color:#999;}#media-items,.imgedit-group{border-color:#dfdfdf;}.checkbox,.side-info,.plugins tr,#your-profile #rich_editing{background-color:#fff;}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#eee;}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf;}.plugins .active,.plugins .active th,.plugins .active td{color:#000;}.plugins .inactive a{color:#579;}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4;}#the-comment-list .unapproved{background-color:#ffffe0;}#the-comment-list .approve a{color:#006505;}#the-comment-list .unapprove a{color:#d98500;}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b;}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#dfdfdf;}.widget,.postbox{background-color:#fff;}.ui-sortable .postbox h3{color:#464646;}.widget .widget-top,.ui-sortable .postbox h3:hover{color:#000;}.curtime #timestamp{background-image:url(../images/date-button.gif);}#quicktags #ed_link{color:#00f;}#rightnow .youhave{background-color:#f0f6fb;}#rightnow a{color:#448abd;}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat;}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0;}#update-nag{background-color:#fffeeb;border-color:#ccc;color:#555;}.login #backtoblog a{color:#ccc;}#wphead{background-color:#464646;}body.login{border-top-color:#464646;}#wphead h1 a{color:#fff;}#user_info{color:#999;}#user_info a:link,#user_info a:visited,#footer a:link,#footer a:visited{color:#ccc;text-decoration:none;}#user_info a:hover,#footer a:hover{color:#fff;text-decoration:underline!important;}#user_info a:active,#footer a:active{color:#ccc!important;}div#media-upload-error,.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover #dashboard_recent_comments .spam a:hover{color:#f00;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}#quicktags{border-color:#dfdfdf;background-color:#dfdfdf;}#ed_toolbar input{border-color:#C3C3C3;}#ed_toolbar input:hover{border-color:#aaa;background:#ddd;}#poststuff .wp_themeSkin .mceStatusbar{border-color:#EDEDED;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{background-color:#f1f1f1;border-color:#dfdfdf;color:#999;}#poststuff #editor-toolbar .active{border-bottom-color:#e9e9e9;background-color:#e9e9e9;color:#333;}#post-status-info{background-color:#EDEDED;}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#000;}.wp_themeSkin iframe{background:#fff;}.wp_themeSkin .mceStatusbar{color:#000;background-color:#f5f5f5;}.wp_themeSkin .mceButton{background-color:#e9e8e8;border-color:#B2B2B2;}.wp_themeSkin a.mceButtonEnabled:hover,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonSelected{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceButtonDisabled{border-color:#ccc!important;}.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen{border-color:#B2B2B2;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin .mceListBoxSelected .mceText{border-color:#777!important;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceText,.wp_themeSkin .mceListBoxHover .mceText{border-color:#777!important;}.wp_themeSkin select.mceListBox{border-color:#B2B2B2;background-color:#fff;}.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen{border-color:#B2B2B2;}.wp_themeSkin .mceSplitButton a.mceOpen:hover,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,.wp_themeSkin .mceSplitButton a.mceAction:hover{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceSplitButtonActive{background-color:#B2B2B2;}.wp_themeSkin div.mceColorSplitMenu table{background-color:#ebebeb;border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a{border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors{border-color:#fff;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover{border-color:#0A246A;background-color:#B6BDD2;}.wp_themeSkin a.mceMoreColors:hover{border-color:#0A246A;}.wp_themeSkin .mceMenu{border-color:#ddd;}.wp_themeSkin .mceMenu table{background-color:#ebeaeb;}.wp_themeSkin .mceMenu .mceText{color:#000;}.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,.wp_themeSkin .mceMenu .mceMenuItemActive{background-color:#f5f5f5;}.wp_themeSkin td.mceMenuItemSeparator{background-color:#aaa;}.wp_themeSkin .mceMenuItemTitle a{background-color:#ccc;border-bottom-color:#aaa;}.wp_themeSkin .mceMenuItemTitle span.mceText{color:#000;}.wp_themeSkin .mceMenuItemDisabled .mceText{color:#888;}.wp_themeSkin tr.mceFirst td.mceToolbar{background:#dfdfdf url("../images/ed-bg.gif") repeat-x scroll left top;border-color:#dfdfdf;}.wp-admin #mceModalBlocker{background:#000;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-moz-border-radius:4px 0 0 0;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;border-top-right-radius:4px;-khtml-border-top-right-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius:0 4px 0 0;}.wp-admin .clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceFocus .mceTop span{color:#e5e5e5;}#editorcontainer,#post-status-info,#titlediv #title,.editwidget .widget-inside{border-color:#dfdfdf;}#titlediv #title{background-color:#fff;}#tTips p#tTips_inside{background-color:#ddd;color:#333;}#timestampdiv input,#namediv input,#poststuff .inside .the-tagcloud{border-color:#ddd;}#adminmenu *{border-color:#e3e3e3;}#adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;}.folded #adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -207px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;}#adminmenu a.menu-top{background:#f1f1f1 url(../images/menu-bits.gif) repeat-x scroll left -379px;}#adminmenu .wp-submenu a{background:#FFF url(../images/menu-bits.gif) no-repeat scroll 0 -310px;}#adminmenu .wp-has-current-submenu ul li a{background:none;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark.gif) top left no-repeat!important;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu .menu-top .current{background:#6d6d6d url(../images/menu-bits.gif) top left repeat-x;border-color:#6d6d6d;color:#fff;text-shadow:rgba(0,0,0,0.4) 0 -1px 0;}#adminmenu li.wp-has-current-submenu .wp-submenu,#adminmenu li.wp-has-current-submenu ul li a{border-color:#aaa!important;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark.gif) bottom left no-repeat!important;}#adminmenu li.wp-has-current-submenu ul{border-bottom-color:#aaa;}#adminmenu li.menu-top .current:hover{border-color:#B5B5B5;}#adminmenu .wp-submenu .current a.current{background:transparent url(../images/menu-bits.gif) no-repeat scroll 0 -289px;}#adminmenu .wp-submenu a:hover{background-color:#EAF2FA!important;color:#333!important;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333;background-color:#f5f5f5;background-image:none;border-color:#e3e3e3;text-shadow:rgba(255,255,255,1) 0 1px 0;}#adminmenu .wp-submenu ul{background-color:#fff;}.folded #adminmenu li.menu-top,#adminmenu .wp-submenu .wp-submenu-head{background-color:#F1F1F1;}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.menu-top.current{background-color:#e6e6e6;}#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background-color:#EAEAEA;border-color:#aaa;}#adminmenu div.wp-submenu{background-color:transparent;}#adminmenu #menu-dashboard div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -61px -33px;}#adminmenu #menu-dashboard:hover div.wp-menu-image,#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu #menu-dashboard.current div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -61px -1px;}#adminmenu #menu-posts div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -272px -33px;}#adminmenu #menu-posts:hover div.wp-menu-image,#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -272px -1px;}#adminmenu #menu-media div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -121px -33px;}#adminmenu #menu-media:hover div.wp-menu-image,#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -121px -1px;}#adminmenu #menu-links div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -91px -33px;}#adminmenu #menu-links:hover div.wp-menu-image,#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -91px -1px;}#adminmenu #menu-pages div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -151px -33px;}#adminmenu #menu-pages:hover div.wp-menu-image,#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -151px -1px;}#adminmenu #menu-comments div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -31px -33px;}#adminmenu #menu-comments:hover div.wp-menu-image,#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu #menu-comments.current div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -31px -1px;}#adminmenu #menu-appearance div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -1px -33px;}#adminmenu #menu-appearance:hover div.wp-menu-image,#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -1px -1px;}#adminmenu #menu-plugins div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -181px -33px;}#adminmenu #menu-plugins:hover div.wp-menu-image,#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -181px -1px;}#adminmenu #menu-users div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -301px -33px;}#adminmenu #menu-users:hover div.wp-menu-image,#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -301px -1px;}#adminmenu #menu-tools div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -211px -33px;}#adminmenu #menu-tools:hover div.wp-menu-image,#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -211px -1px;}#adminmenu #menu-settings div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -241px -33px;}#adminmenu #menu-settings:hover div.wp-menu-image,#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image{background:transparent url("../images/menu.png") no-repeat scroll -241px -1px;}table.diff .diff-deletedline{background-color:#fdd;}table.diff .diff-deletedline del{background-color:#f99;}table.diff .diff-addedline{background-color:#dfd;}table.diff .diff-addedline ins{background-color:#9f9;}#att-info{background-color:#E4F2FD;}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf;}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#D54E21;}#screen-options-wrap,#contextual-help-wrap{background-color:#f1f1f1;border-color:#dfdfdf;}#screen-meta-links a.show-settings{color:#606060;}#screen-meta-links a.show-settings:hover{color:#000;}#replysubmit{background-color:#f1f1f1;border-top-color:#ddd;}#replyerror{border-color:#ddd;background-color:#f9f9f9;}#edithead,#replyhead{background-color:#f1f1f1;}#ed_reply_toolbar{background-color:#e9e9e9;}.vim-current,.vim-current th,.vim-current td{background-color:#E4F2FD!important;}.star-average,.star.star-rating{background-color:#fc0;}div.star.select:hover{background-color:#d00;}#plugin-information .fyi ul{background-color:#eaf3fa;}#plugin-information .fyi h2.mainheader{background-color:#cee1ef;}#plugin-information pre,#plugin-information code{background-color:#ededff;}#plugin-information pre{border:1px solid #ccc;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea,#bulk-titles,#replyrow input{border-color:#ddd;}.inline-editor div.title{background-color:#EAF3FA;}.inline-editor ul.cat-checklist{background-color:#FFF;border-color:#ddd;}.inline-editor .categories .catshow,.inline-editor .categories .cathide{color:#21759b;}.inline-editor .quick-edit-save{background-color:#f1f1f1;}#replyrow #ed_reply_toolbar input:hover{border-color:#aaa;background:#ddd;}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf;}.attention{color:#D54E21;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -111px;}#major-publishing-actions{background:#eaf2fa;}.tablenav .tablenav-pages{color:#555;}.tablenav .tablenav-pages a{border-color:#e3e3e3;background:#eee url('../images/menu-bits.gif') repeat-x scroll left -379px;}.tablenav .tablenav-pages a:hover{color:#d54e21;border-color:#d54321;}.tablenav .tablenav-pages a:active{color:#fff!important;}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3;}#availablethemes,#availablethemes td{border-color:#ddd;}#current-theme img{border-color:#999;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999;}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc;}.misc-pub-section{border-bottom-color:#eee;}#minor-publishing{border-bottom-color:#ddd;}#post-body .misc-pub-section{border-right-color:#eee;}.post-com-count span{background-color:#bbb;}.form-table .color-palette td{border-color:#fff;}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;}#post-body ul#category-tabs li.tabs a{color:#333;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{border-color:#999;background-color:#eee;}#wp_editimgbtn:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_delgallery:hover{border-color:#555;background-color:#ccc;}#favorite-first{background:#797979 url(../images/fav.png) repeat-x left center;border-color:#777!important;border-bottom-color:#666!important;}#favorite-inside{border-color:#797979;background-color:#797979;}#favorite-toggle{background:transparent url(../images/fav-arrow.gif) no-repeat 0 -4px;}#favorite-actions a{color:#ddd;}#favorite-actions a:hover{color:#fff;}#favorite-inside a:hover{text-decoration:underline;}#favorite-actions .slide-down{border-bottom-color:#626262;}#screen-meta a.show-settings{background-color:transparent;text-shadow:rgba(255,255,255,0.7) 0 1px 0;}#icon-edit,#icon-post{background:transparent url(../images/icons32.png) no-repeat -552px -5px;}#icon-index{background:transparent url(../images/icons32.png) no-repeat -137px -5px;}#icon-upload{background:transparent url(../images/icons32.png) no-repeat -251px -5px;}#icon-link-manager,#icon-link,#icon-link-category{background:transparent url(../images/icons32.png) no-repeat -190px -5px;}#icon-edit-pages,#icon-page{background:transparent url(../images/icons32.png) no-repeat -312px -5px;}#icon-edit-comments{background:transparent url(../images/icons32.png) no-repeat -72px -5px;}#icon-themes{background:transparent url(../images/icons32.png) no-repeat -11px -5px;}#icon-plugins{background:transparent url(../images/icons32.png) no-repeat -370px -5px;}#icon-users,#icon-profile,#icon-user-edit{background:transparent url(../images/icons32.png) no-repeat -600px -5px;}#icon-tools,#icon-admin{background:transparent url(../images/icons32.png) no-repeat -432px -5px;}#icon-options-general{background:transparent url(../images/icons32.png) no-repeat -492px -5px;}.view-switch #view-switch-list{background:transparent url(../images/list.png) no-repeat 0 0;}.view-switch #view-switch-list.current{background:transparent url(../images/list.png) no-repeat -40px 0;}.view-switch #view-switch-excerpt{background:transparent url(../images/list.png) no-repeat -20px 0;}.view-switch #view-switch-excerpt.current{background:transparent url(../images/list.png) no-repeat -60px 0;}#header-logo{background:transparent url(../images/wp-logo.gif) no-repeat scroll center center;}#wphead #site-visit-button{background-color:#585858;background-image:url(../images/visit-site-button-grad.gif);color:#aaa;text-shadow:#3F3F3F 0 -1px 0;}#wphead a:hover #site-visit-button{color:#fff;}#wphead a:focus #site-visit-button,#wphead a:active #site-visit-button{background-position:0 -27px;}.popular-tags,.feature-filter{background-color:#FFF;border-color:#DFDFDF;}#theme-information .action-button{border-top-color:#DFDFDF;}.theme-listing br.line{border-bottom-color:#ccc;}div.widgets-sortables,#widgets-left .inactive{background-color:#f1f1f1;border-color:#ddd;}#available-widgets .widget-holder{background-color:#fff;border-color:#ddd;}#widgets-left .sidebar-name{background-color:#aaa;background-image:url(../images/ed-bg.gif);text-shadow:#FFF 0 1px 0;border-color:#dfdfdf;}#widgets-right .sidebar-name{background-image:url(../images/fav.png);text-shadow:#3f3f3f 0 -1px 0;background-color:#636363;border-color:#636363;color:#fff;}.sidebar-name:hover,#removing-widget{color:#d54e21;}#removing-widget span{color:black;}#widgets-left .sidebar-name-arrow{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;}#widgets-right .sidebar-name-arrow{background:transparent url(../images/fav-arrow.gif) no-repeat scroll 0 -1px;}.in-widget-title{color:#606060;}.deleting .widget-title *{color:#aaa;}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1;}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea;}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5;}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf;}.comment-ays,.comment-ays th{border-color:#ddd;}.comment-ays th{background-color:#f1f1f1;} \ No newline at end of file +html{background-color:#f9f9f9;}* html input,* html .widget{border-color:#dfdfdf;}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-color:#dfdfdf;background-color:#fff;}kbd,code{background:#eaeaea;}input[readonly]{background-color:#eee;}.find-box-search{border-color:#dfdfdf;background-color:#f1f1f1;}.find-box{background-color:#f1f1f1;}.find-box-inside{background-color:#fff;}a.page-numbers:hover{border-color:#999;}body,#wpbody,.form-table .pre{color:#333;}body>#upload-menu{border-bottom-color:#fff;}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links,#replyrow #ed_reply_toolbar input{border-color:#ccc;}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red;}#poststuff .inside label.waiting{color:orange;}#poststuff .inside label.approved{color:green;}#postcustomstuff table{border-color:#dfdfdf;background-color:#F9F9F9;}#postcustomstuff thead th{background-color:#F1F1F1;}#postcustomstuff table input,#postcustomstuff table textarea{border-color:#dfdfdf;background-color:#fff;}.widefat{border-color:#dfdfdf;background-color:#fff;}div.dashboard-widget-error{background-color:#c43;}div.dashboard-widget-notice{background-color:#cfe1ef;}div.dashboard-widget-submit{border-top-color:#ccc;}div.tabs-panel,ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs{border-color:#dfdfdf;}ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs{background-color:#f1f1f1;}input.disabled,textarea.disabled{background-color:#ccc;}#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff;}.widget .widget-top,.postbox h3,.stuffbox h3{background:#dfdfdf url("../images/gray-grad.png") repeat-x left top;text-shadow:#fff 0 1px 0;}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0;}.description,.form-wrap p{color:#666;}strong .post-com-count span{background-color:#21759b;}.sorthelper{background-color:#ccf3fa;}.ac_match,.subsubsub a.current{color:#000;}.wrap h2{color:#464646;}.ac_over{background-color:#f0f0b8;}.ac_results{background-color:#fff;border-color:#808080;}.ac_results li{color:#101010;}.alternate,.alt{background-color:#f9f9f9;}.available-theme a.screenshot{background-color:#f1f1f1;border-color:#ddd;}.bar{background-color:#e8e8e8;border-right-color:#99d;}#media-upload,#media-upload .media-item .slidetoggle{background:#fff;}#media-upload .slidetoggle{border-top-color:#dfdfdf;}.error,.login #login_error{background-color:#ffebe8;border-color:#c00;}.error a{color:#c00;}.form-invalid{background-color:#ffebe8!important;}.form-invalid input,.form-invalid select{border-color:#c00!important;}.submit{border-color:#DFDFDF;}.highlight{background-color:#e4f2fd;color:#d54e21;}.howto,.nonessential,#edit-slug-box,.form-input-tip,.rss-widget span.rss-date,.subsubsub{color:#666;}.media-item{border-bottom-color:#dfdfdf;}#wpbody-content #media-items .describe{border-top-color:#dfdfdf;}.media-upload-form label.form-help,td.help{color:#9a9a9a;}.post-com-count{background-image:url(../images/bubble_bg.gif);color:#fff;}.post-com-count span{background-color:#bbb;color:#fff;}.post-com-count:hover span{background-color:#d54e21;}.quicktags,.search{background-color:#ccc;color:#000;}.side-info h5{border-bottom-color:#dadada;}.side-info ul{color:#666;}.button,.button-secondary,.submit input,input[type=button],input[type=submit]{border-color:#bbb;color:#464646;}.button:hover,.button-secondary:hover,.submit input:hover,input[type=button]:hover,input[type=submit]:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;text-shadow:rgba(255,255,255,1) 0 1px 0;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}input.button-primary,button.button-primary,a.button-primary{border-color:#298cba;font-weight:bold;color:#fff;background:#21759B url(../images/button-grad.png) repeat-x scroll left top;text-shadow:rgba(0,0,0,0.3) 0 -1px 0;}input.button-primary:active,button.button-primary:active,a.button-primary:active{background:#21759b url(../images/button-grad-active.png) repeat-x scroll left top;color:#eaf2fa;}input.button-primary:hover,button.button-primary:hover,a.button-primary:hover,a.button-primary:focus,a.button-primary:active{border-color:#13455b;color:#eaf2fa;}.button-disabled,.button[disabled],.button:disabled,.button-secondary[disabled],.button-secondary:disabled,a.button.disabled{color:#aaa!important;border-color:#ddd!important;}.button-primary-disabled,.button-primary[disabled],.button-primary:disabled{color:#9FD0D5!important;background:#298CBA!important;}a:hover,a:active,a:focus{color:#d54e21;}#wphead #viewsite a:hover,#adminmenu a:hover,#adminmenu ul.wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21;}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf;}#side-sortables .category-tabs .tabs a,#side-sortables .add-menu-item-tabs .tabs a{color:#333;}#rightnow .rbutton{background-color:#ebebeb;color:#264761;}.submitbox .submit{background-color:#464646;color:#ccc;}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00;}.submitbox .submitdelete:hover,#media-items a.delete:hover{color:#fff;background-color:#f00;border-bottom-color:#f00;}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00;}.tablenav .dots{border-color:transparent;}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b;}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21;}.updated,.login .message{background-color:#ffffe0;border-color:#e6db55;}.update-message{color:#000;}a.page-numbers{border-bottom-color:#B8D3E2;}.commentlist li{border-bottom-color:#ccc;}.widefat td,.widefat th,#install-plugins .plugins td,#install-plugins .plugins th{border-color:#dfdfdf;}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0;}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.find-box-head{color:#333;background:#dfdfdf url(../images/gray-grad.png) repeat-x scroll left top;}h3.dashboard-widget-title small a{color:#d7d7d7;}h3.dashboard-widget-title small a:hover{color:#fff;}a,#adminmenu a,#poststuff #edButtonPreview,#poststuff #edButtonHTML,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,.plugins a.delete,.ui-tabs-nav a{color:#21759b;}body.press-this .tabs a,body.press-this .tabs a:hover{background-color:#fff;border-color:#c6d9e9;border-bottom-color:#fff;color:#d54e21;}#adminmenu #awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow{background-color:#464646;color:#fff;-moz-box-shadow:#fff 0 -1px 0;-khtml-box-shadow:#fff 0 -1px 0;-webkit-box-shadow:#fff 0 -1px 0;box-shadow:#fff 0 -1px 0;}#plugin-information .action-button{background-color:#d54e21;color:#fff;}#adminmenu li.current a #awaiting-mod,#adminmenu li a.wp-has-current-submenu .update-plugins{background-color:#464646;color:#fff;-moz-box-shadow:#fff 0 -1px 0;-khtml-box-shadow:#fff 0 -1px 0;-webkit-box-shadow:#fff 0 -1px 0;box-shadow:#fff 0 -1px 0;}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf;}#currenttheme img{border-color:#666;}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9;}input.readonly,textarea.readonly{background-color:#ddd;}#ed_toolbar input,#ed_reply_toolbar input{background:#fff url("../images/fade-butt.png") repeat-x 0 -2px;}#editable-post-name{background-color:#fffbcc;}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on{color:#777;}.login #nav a{color:#21759b!important;}.login #nav a:hover{color:#d54e21!important;}#footer{color:#777;border-color:#d1d1d1;background:#d9d9d9;background:-moz-linear-gradient(bottom,#d7d7d7,#e4e4e4);background:-webkit-gradient(linear,left bottom,left top,from(#d7d7d7),to(#e4e4e4));}#media-items,.imgedit-group{border-color:#dfdfdf;}.checkbox,.side-info,.plugins tr,#your-profile #rich_editing{background-color:#fff;}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#eee;}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf;}.plugins .active,.plugins .active th,.plugins .active td{color:#000;}.plugins .inactive a{color:#579;}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4;}#the-comment-list .unapproved{background-color:#ffffe0;}#the-comment-list .approve a{color:#006505;}#the-comment-list .unapprove a{color:#d98500;}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b;}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#dfdfdf;}.widget,.postbox{background-color:#fff;}.ui-sortable .postbox h3{color:#464646;}.widget .widget-top,.ui-sortable .postbox h3:hover{color:#000;}.curtime #timestamp{background-image:url(../images/date-button.gif);}#quicktags #ed_link{color:#00f;}#rightnow .youhave{background-color:#f0f6fb;}#rightnow a{color:#448abd;}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat;}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0;}#update-nag,.update-nag{background-color:#FFFBCC;border-color:#E6DB55;color:#555;}.login #backtoblog a{color:#464646;}#wphead{border-bottom:#c6c6c6 1px solid;background:#d9d9d9;background:-moz-linear-gradient(bottom,#d7d7d7,#e4e4e4);background:-webkit-gradient(linear,left bottom,left top,from(#d7d7d7),to(#e4e4e4));}#wphead h1 a{color:#464646;}#user_info{color:#777;}#user_info a:link,#user_info a:visited,#footer a:link,#footer a:visited{color:#222;text-decoration:none;}#user_info a:hover,#footer a:hover{color:#000;text-decoration:underline!important;}#user_info a:active,#footer a:active{color:#ccc!important;}div#media-upload-error,.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover #dashboard_recent_comments .spam a:hover{color:#f00;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}#quicktags{border-color:#dfdfdf;background-color:#dfdfdf;}#ed_toolbar input{border-color:#C3C3C3;}#ed_toolbar input:hover{border-color:#aaa;background:#ddd;}#poststuff .wp_themeSkin .mceStatusbar{border-color:#EDEDED;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{background-color:#f1f1f1;border-color:#dfdfdf;color:#999;}#poststuff #editor-toolbar .active{border-bottom-color:#e9e9e9;background-color:#e9e9e9;color:#333;}#post-status-info{background-color:#EDEDED;}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#000;}.wp_themeSkin iframe{background:#fff;}.wp_themeSkin .mceStatusbar{color:#000;background-color:#f5f5f5;}.wp_themeSkin .mceButton{background-color:#e9e8e8;border-color:#B2B2B2;}.wp_themeSkin a.mceButtonEnabled:hover,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonSelected{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceButtonDisabled{border-color:#ccc!important;}.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen{border-color:#B2B2B2;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin .mceListBoxSelected .mceText{border-color:#777!important;background-color:#d5d5d5;}.wp_themeSkin table.mceListBoxEnabled:hover .mceText,.wp_themeSkin .mceListBoxHover .mceText{border-color:#777!important;}.wp_themeSkin select.mceListBox{border-color:#B2B2B2;background-color:#fff;}.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen{border-color:#B2B2B2;}.wp_themeSkin .mceSplitButton a.mceOpen:hover,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,.wp_themeSkin .mceSplitButton a.mceAction:hover{background-color:#d5d5d5;border-color:#777!important;}.wp_themeSkin .mceSplitButtonActive{background-color:#B2B2B2;}.wp_themeSkin div.mceColorSplitMenu table{background-color:#ebebeb;border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a{border-color:#B2B2B2;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors{border-color:#fff;}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover{border-color:#0A246A;background-color:#B6BDD2;}.wp_themeSkin a.mceMoreColors:hover{border-color:#0A246A;}.wp_themeSkin .mceMenu{border-color:#ddd;}.wp_themeSkin .mceMenu table{background-color:#ebeaeb;}.wp_themeSkin .mceMenu .mceText{color:#000;}.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,.wp_themeSkin .mceMenu .mceMenuItemActive{background-color:#f5f5f5;}.wp_themeSkin td.mceMenuItemSeparator{background-color:#aaa;}.wp_themeSkin .mceMenuItemTitle a{background-color:#ccc;border-bottom-color:#aaa;}.wp_themeSkin .mceMenuItemTitle span.mceText{color:#000;}.wp_themeSkin .mceMenuItemDisabled .mceText{color:#888;}.wp_themeSkin tr.mceFirst td.mceToolbar{background:#dfdfdf url("../images/ed-bg.gif") repeat-x scroll left top;border-color:#dfdfdf;}.wp-admin #mceModalBlocker{background:#000;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-moz-border-radius:4px 0 0 0;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px;}.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;border-top-right-radius:4px;-khtml-border-top-right-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius:0 4px 0 0;}.wp-admin .clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999;}.wp-admin .clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999;}.wp-admin .clearlooks2 .mceFocus .mceTop span{color:#e5e5e5;}#editorcontainer,#post-status-info,#titlediv #title,.editwidget .widget-inside{border-color:#dfdfdf;}#titlediv #title{background-color:#fff;}#tTips p#tTips_inside{background-color:#ddd;color:#333;}#timestampdiv input,#namediv input,#poststuff .inside .the-tagcloud{border-color:#ddd;}#adminmenu *{border-color:#e3e3e3;}#adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll left 5px;}.folded #adminmenu li.wp-menu-separator{background:transparent url(../images/menu-arrows.gif) no-repeat scroll right -34px;}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle{background:transparent url(../images/menu-bits.gif?ver=20100610) no-repeat scroll left -207px;}#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle{background:transparent url(../images/menu-bits.gif?ver=20100610) no-repeat scroll left -109px;}#adminmenu a.menu-top{background:#f1f1f1 url(../images/menu-bits.gif?ver=20100610) repeat-x scroll left -379px;}#adminmenu .wp-submenu a{background:#fff url(../images/menu-bits.gif?ver=20100610) no-repeat scroll 0 -310px;}#adminmenu .wp-has-current-submenu ul li a{background:none;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark.gif) top left no-repeat!important;}.wp-has-current-submenu .wp-submenu{border-top:none!important;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu{border-bottom:#aaa 1px solid;}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top{background:#e0e0e0 url(../images/menu-bits.gif?ver=20100610) top left repeat-x;border:#aaa 1px solid;color:#000;}#adminmenu li.wp-has-current-submenu .wp-submenu,#adminmenu li.wp-has-current-submenu ul li a{border-right-color:#aaa!important;border-left-color:#aaa!important;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark.gif) bottom left no-repeat!important;}#adminmenu li.wp-has-current-submenu ul{border-bottom-color:#aaa;}#adminmenu .wp-submenu .current a.current{background:transparent url(../images/menu-bits.gif?ver=20100610) no-repeat scroll 0 -289px;}#adminmenu .wp-submenu a:hover{background-color:#EAF2FA!important;color:#333!important;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333;background-color:#f5f5f5;background-image:none;border-color:#e3e3e3;}#adminmenu .wp-submenu ul{background-color:#fff;}.folded #adminmenu li.menu-top,#adminmenu .wp-submenu .wp-submenu-head{background-color:#F1F1F1;}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.menu-top.current{background-color:#e6e6e6;}#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background-color:#EAEAEA;border-color:#aaa;}#adminmenu div.wp-submenu{background-color:transparent;}#adminmenu .menu-icon-dashboard div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -61px -33px;}#adminmenu .menu-icon-dashboard:hover div.wp-menu-image,#adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-dashboard.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -61px -1px;}#adminmenu .menu-icon-post div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -272px -33px;}#adminmenu .menu-icon-post:hover div.wp-menu-image,#adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -272px -1px;}#adminmenu .menu-icon-media div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -121px -33px;}#adminmenu .menu-icon-media:hover div.wp-menu-image,#adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -121px -1px;}#adminmenu .menu-icon-links div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -91px -33px;}#adminmenu .menu-icon-links:hover div.wp-menu-image,#adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -91px -1px;}#adminmenu .menu-icon-page div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -151px -33px;}#adminmenu .menu-icon-page:hover div.wp-menu-image,#adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -151px -1px;}#adminmenu .menu-icon-comments div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -31px -33px;}#adminmenu .menu-icon-comments:hover div.wp-menu-image,#adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-comments.current div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -31px -1px;}#adminmenu .menu-icon-appearance div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -1px -33px;}#adminmenu .menu-icon-appearance:hover div.wp-menu-image,#adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -1px -1px;}#adminmenu .menu-icon-plugins div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -181px -33px;}#adminmenu .menu-icon-plugins:hover div.wp-menu-image,#adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -181px -1px;}#adminmenu .menu-icon-users div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -301px -33px;}#adminmenu .menu-icon-users:hover div.wp-menu-image,#adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -301px -1px;}#adminmenu .menu-icon-tools div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -211px -33px;}#adminmenu .menu-icon-tools:hover div.wp-menu-image,#adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -211px -1px;}#adminmenu .menu-icon-settings div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -241px -33px;}#adminmenu .menu-icon-settings:hover div.wp-menu-image,#adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -241px -1px;}#adminmenu .menu-icon-site div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -361px -33px;}#adminmenu .menu-icon-site:hover div.wp-menu-image,#adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image{background:transparent url('../images/menu.png?ver=20100531') no-repeat scroll -361px -1px;}table.diff .diff-deletedline{background-color:#fdd;}table.diff .diff-deletedline del{background-color:#f99;}table.diff .diff-addedline{background-color:#dfd;}table.diff .diff-addedline ins{background-color:#9f9;}#att-info{background-color:#E4F2FD;}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf;}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#D54E21;}#screen-options-wrap,#contextual-help-wrap{background-color:#f1f1f1;border-color:#dfdfdf;}#screen-meta-links a.show-settings{color:#606060;}#screen-meta-links a.show-settings:hover{color:#000;}#replysubmit{background-color:#f1f1f1;border-top-color:#ddd;}#replyerror{border-color:#ddd;background-color:#f9f9f9;}#edithead,#replyhead{background-color:#f1f1f1;}#ed_reply_toolbar{background-color:#e9e9e9;}.vim-current,.vim-current th,.vim-current td{background-color:#E4F2FD!important;}.star-average,.star.star-rating{background-color:#fc0;}div.star.select:hover{background-color:#d00;}#plugin-information .fyi ul{background-color:#eaf3fa;}#plugin-information .fyi h2.mainheader{background-color:#cee1ef;}#plugin-information pre,#plugin-information code{background-color:#ededff;}#plugin-information pre{border:1px solid #ccc;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea,#bulk-titles,#replyrow input{border-color:#ddd;}.inline-editor div.title{background-color:#EAF3FA;}.inline-editor ul.cat-checklist{background-color:#fff;border-color:#ddd;}.inline-editor .categories .catshow,.inline-editor .categories .cathide{color:#21759b;}.inline-editor .quick-edit-save{background-color:#f1f1f1;}#replyrow #ed_reply_toolbar input:hover{border-color:#aaa;background:#ddd;}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf;}.attention{color:#D54E21;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits.gif?ver=20100610) no-repeat scroll left -111px;}#major-publishing-actions{background:#eaf2fa;}.tablenav .tablenav-pages{color:#555;}.tablenav .tablenav-pages a{border-color:#e3e3e3;background:#eee url('../images/menu-bits.gif?ver=20100610') repeat-x scroll left -379px;}.tablenav .tablenav-pages a:hover{color:#d54e21;border-color:#d54321;}.tablenav .tablenav-pages a:active{color:#fff!important;}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3;}#availablethemes,#availablethemes td{border-color:#ddd;}#current-theme img{border-color:#999;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999;}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc;}.misc-pub-section{border-bottom-color:#eee;}#minor-publishing{border-bottom-color:#ddd;}#post-body .misc-pub-section{border-right-color:#eee;}.post-com-count span{background-color:#bbb;}.form-table .color-palette td{border-color:#fff;}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;}#post-body ul.category-tabs li.tabs a,#post-body ul.add-menu-item-tabs li.tabs a{color:#333;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{border-color:#999;background-color:#eee;}#wp_editimgbtn:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_delgallery:hover{border-color:#555;background-color:#ccc;}#favorite-first{border-color:#c0c0c0;background:#f1f1f1;background:-moz-linear-gradient(bottom,#e7e7e7,#fff);background:-webkit-gradient(linear,left bottom,left top,from(#e7e7e7),to(#fff));}#favorite-inside{border-color:#c0c0c0;background-color:#fff;}#favorite-toggle{background:transparent url(../images/fav-arrow.gif?ver=20100531) no-repeat 0 -4px;}#favorite-actions a{color:#464646;}#favorite-actions a:hover{color:#000;}#favorite-inside a:hover{text-decoration:underline;}#screen-meta a.show-settings{background-color:transparent;text-shadow:rgba(255,255,255,0.7) 0 1px 0;}#icon-edit,#icon-post{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -552px -5px;}#icon-index{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -137px -5px;}#icon-upload{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -251px -5px;}#icon-link-manager,#icon-link,#icon-link-category{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -190px -5px;}#icon-edit-pages,#icon-page{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -312px -5px;}#icon-edit-comments{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -72px -5px;}#icon-themes{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -11px -5px;}#icon-plugins{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -370px -5px;}#icon-users,#icon-profile,#icon-user-edit{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -600px -5px;}#icon-tools,#icon-admin{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -432px -5px;}#icon-options-general{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -492px -5px;}#icon-ms-admin{background:transparent url(../images/icons32.png?ver=20100531) no-repeat -659px -5px;}.view-switch #view-switch-list{background:transparent url(../images/list.png) no-repeat 0 0;}.view-switch #view-switch-list.current{background:transparent url(../images/list.png) no-repeat -40px 0;}.view-switch #view-switch-excerpt{background:transparent url(../images/list.png) no-repeat -20px 0;}.view-switch #view-switch-excerpt.current{background:transparent url(../images/list.png) no-repeat -60px 0;}#header-logo{background:transparent url(../images/wp-logo.png?ver=20100531) no-repeat scroll center center;}.popular-tags,.feature-filter{background-color:#fff;border-color:#DFDFDF;}#theme-information .action-button{border-top-color:#DFDFDF;}.theme-listing br.line{border-bottom-color:#ccc;}div.widgets-sortables,#widgets-left .inactive{background-color:#f1f1f1;border-color:#ddd;}#available-widgets .widget-holder{background-color:#fff;border-color:#ddd;}#widgets-left .sidebar-name{background-color:#aaa;background-image:url(../images/ed-bg.gif);text-shadow:#fff 0 1px 0;border-color:#dfdfdf;}#widgets-right .sidebar-name{background-image:url(../images/fav.png);text-shadow:#3f3f3f 0 -1px 0;background-color:#636363;border-color:#636363;color:#fff;}.sidebar-name:hover,#removing-widget{color:#d54e21;}#removing-widget span{color:black;}#widgets-left .sidebar-name-arrow{background:transparent url(../images/menu-bits.gif?ver=20100610) no-repeat scroll left -109px;}#widgets-right .sidebar-name-arrow{background:transparent url(../images/widgets-arrow.gif?ver=20100531) no-repeat scroll 0 -1px;}.in-widget-title{color:#606060;}.deleting .widget-title *{color:#aaa;}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1;}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea;}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5;}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf;}.comment-ays,.comment-ays th{border-color:#ddd;}.comment-ays th{background-color:#f1f1f1;}#nav-menu-header,.menu-item-handle{background:url("../images/gray-grad.png") repeat-x scroll left top #dfdfdf;}#menu-management .nav-tab-active{background:#ececec;border-bottom-color:#ececec;} \ No newline at end of file diff --git a/wp-admin/css/colors-fresh.dev.css b/wp-admin/css/colors-fresh.dev.css index 41a86aed..f7790130 100644 --- a/wp-admin/css/colors-fresh.dev.css +++ b/wp-admin/css/colors-fresh.dev.css @@ -4,7 +4,7 @@ html { * html input, * html .widget { - border-color: #dfdfdf; + border-color: #dfdfdf; } textarea, @@ -110,11 +110,13 @@ div.dashboard-widget-submit { } div.tabs-panel, -ul#category-tabs li.tabs { +ul.category-tabs li.tabs, +ul.add-menu-item-tabs li.tabs { border-color: #dfdfdf; } -ul#category-tabs li.tabs { +ul.category-tabs li.tabs, +ul.add-menu-item-tabs li.tabs { background-color: #f1f1f1; } @@ -123,7 +125,6 @@ textarea.disabled { background-color: #ccc; } /* #upload-menu li a.upload-tab-link, */ -.login #backtoblog a:hover, #plugin-information .action-button a, #plugin-information .action-button a:hover, #plugin-information .action-button a:visited { @@ -380,7 +381,8 @@ div.dashboard-widget-submit input:hover, border-color: #dfdfdf; } -#side-sortables #category-tabs .tabs a { +#side-sortables .category-tabs .tabs a, +#side-sortables .add-menu-item-tabs .tabs a { color: #333; } @@ -438,7 +440,7 @@ div.dashboard-widget-submit input:hover, } .update-message { - color: #000000; + color: #000; } a.page-numbers { @@ -502,38 +504,27 @@ body.press-this .tabs a:hover { #adminmenu #awaiting-mod, #adminmenu .update-plugins, #sidemenu a .update-plugins, -#rightnow .reallynow, -#plugin-information .action-button { - background-color: #d54e21; +#rightnow .reallynow { + background-color: #464646; color: #fff; + -moz-box-shadow: #fff 0 -1px 0; + -khtml-box-shadow: #fff 0 -1px 0; + -webkit-box-shadow: #fff 0 -1px 0; + box-shadow: #fff 0 -1px 0; } - -#adminmenu li a:hover #awaiting-mod, -#adminmenu li a:hover .update-plugins, -#sidemenu li a:hover .update-plugins { - background-color: #264761; +#plugin-information .action-button { + background-color: #d54e21; color: #fff; } #adminmenu li.current a #awaiting-mod, -#adminmenu li.current a .update-plugins, -#adminmenu li.wp-has-current-submenu a .update-plugins, -#adminmenu li.wp-has-current-submenu a .update-plugins { - background-color: #ddd; - color: #000; - text-shadow: none; - -moz-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; - -khtml-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; - -webkit-box-shadow: rgba(0,0,0,0.2) 0 -1px 0; - box-shadow: rgba(0,0,0,0.2) 0 -1px 0; -} - -#adminmenu li.current a:hover #awaiting-mod, -#adminmenu li.current a:hover .update-plugins, -#adminmenu li.wp-has-current-submenu a:hover #awaiting-mod, -#adminmenu li.wp-has-current-submenu a:hover .update-plugins { - background-color: #264761; +#adminmenu li a.wp-has-current-submenu .update-plugins{ + background-color: #464646; color: #fff; + -moz-box-shadow: #fff 0 -1px 0; + -khtml-box-shadow: #fff 0 -1px 0; + -webkit-box-shadow: #fff 0 -1px 0; + box-shadow: #fff 0 -1px 0; } div#media-upload-header, @@ -577,10 +568,12 @@ input.readonly, textarea.readonly { color: #d54e21 !important; } -#footer, -#footer-upgrade { - background: #464646; - color: #999; +#footer { + color: #777; + border-color: #d1d1d1; + background: #d9d9d9; /* fallback color */ + background:-moz-linear-gradient(bottom, #d7d7d7, #e4e4e4); + background:-webkit-gradient(linear, left bottom, left top, from(#d7d7d7), to(#e4e4e4)); } #media-items, @@ -692,43 +685,42 @@ table.widefat span.spam a, background: url(../images/xit.gif) no-repeat -10px 0; } -#update-nag { - background-color: #fffeeb; - border-color: #ccc; +#update-nag, .update-nag { + background-color: #FFFBCC; + border-color: #E6DB55; color: #555; } .login #backtoblog a { - color: #ccc; + color: #464646; } #wphead { - background-color: #464646; -} - -body.login { - border-top-color: #464646; + border-bottom:#c6c6c6 1px solid; + background: #d9d9d9; /* fallback color */ + background:-moz-linear-gradient(bottom, #d7d7d7, #e4e4e4); + background:-webkit-gradient(linear, left bottom, left top, from(#d7d7d7), to(#e4e4e4)); } #wphead h1 a { - color: #fff; + color: #464646; } #user_info { - color: #999; + color: #777; } #user_info a:link, #user_info a:visited, #footer a:link, #footer a:visited { - color: #ccc; + color: #222; text-decoration: none; } #user_info a:hover, #footer a:hover { - color: #fff; + color: #000; text-decoration: underline !important; } @@ -1048,20 +1040,20 @@ table.widefat .spam a:hover, #adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle { - background: transparent url(../images/menu-bits.gif) no-repeat scroll left -207px; + background: transparent url(../images/menu-bits.gif?ver=20100610) no-repeat scroll left -207px; } #adminmenu .wp-has-submenu:hover .wp-menu-toggle, #adminmenu .wp-menu-open .wp-menu-toggle { - background: transparent url(../images/menu-bits.gif) no-repeat scroll left -109px; + background: transparent url(../images/menu-bits.gif?ver=20100610) no-repeat scroll left -109px; } #adminmenu a.menu-top { - background: #f1f1f1 url(../images/menu-bits.gif) repeat-x scroll left -379px; + background: #f1f1f1 url(../images/menu-bits.gif?ver=20100610) repeat-x scroll left -379px; } #adminmenu .wp-submenu a { - background: #FFFFFF url(../images/menu-bits.gif) no-repeat scroll 0 -310px; + background: #fff url(../images/menu-bits.gif?ver=20100610) no-repeat scroll 0 -310px; } #adminmenu .wp-has-current-submenu ul li a { @@ -1072,17 +1064,25 @@ table.widefat .spam a:hover, background: url(../images/menu-dark.gif) top left no-repeat !important; } +.wp-has-current-submenu .wp-submenu { + border-top: none !important; +} + +#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu { + border-bottom: #aaa 1px solid; +} + #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, -#adminmenu .menu-top .current { - background: #6d6d6d url(../images/menu-bits.gif) top left repeat-x; - border-color: #6d6d6d; - color: #fff; - text-shadow: rgba(0,0,0,0.4) 0px -1px 0px; +#adminmenu li.current a.menu-top { + background: #e0e0e0 url(../images/menu-bits.gif?ver=20100610) top left repeat-x; + border: #aaa 1px solid; + color: #000; } #adminmenu li.wp-has-current-submenu .wp-submenu, #adminmenu li.wp-has-current-submenu ul li a { - border-color: #aaa !important; + border-right-color: #aaa !important; + border-left-color: #aaa !important; } #adminmenu li.wp-has-current-submenu ul li a { @@ -1093,12 +1093,8 @@ table.widefat .spam a:hover, border-bottom-color: #aaa; } -#adminmenu li.menu-top .current:hover { - border-color: #B5B5B5; -} - #adminmenu .wp-submenu .current a.current { - background: transparent url(../images/menu-bits.gif) no-repeat scroll 0 -289px; + background: transparent url(../images/menu-bits.gif?ver=20100610) no-repeat scroll 0 -289px; } #adminmenu .wp-submenu a:hover { @@ -1113,7 +1109,6 @@ table.widefat .spam a:hover, background-color: #f5f5f5; background-image: none; border-color: #e3e3e3; - text-shadow: rgba(255,255,255,1) 0px 1px 0px; } #adminmenu .wp-submenu ul { @@ -1140,124 +1135,133 @@ table.widefat .spam a:hover, } /* menu icons */ -#adminmenu #menu-dashboard div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -61px -33px; +#adminmenu .menu-icon-dashboard div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -61px -33px; +} + +#adminmenu .menu-icon-dashboard:hover div.wp-menu-image, +#adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image, +#adminmenu .menu-icon-dashboard.current div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -61px -1px; +} + +#adminmenu .menu-icon-post div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -272px -33px; } -#adminmenu #menu-dashboard:hover div.wp-menu-image, -#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image, -#adminmenu #menu-dashboard.current div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -61px -1px; +#adminmenu .menu-icon-post:hover div.wp-menu-image, +#adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -272px -1px; } -#adminmenu #menu-posts div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -272px -33px; +#adminmenu .menu-icon-media div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -121px -33px; } -#adminmenu #menu-posts:hover div.wp-menu-image, -#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -272px -1px; +#adminmenu .menu-icon-media:hover div.wp-menu-image, +#adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -121px -1px; } -#adminmenu #menu-media div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -121px -33px; +#adminmenu .menu-icon-links div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -91px -33px; } -#adminmenu #menu-media:hover div.wp-menu-image, -#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -121px -1px; +#adminmenu .menu-icon-links:hover div.wp-menu-image, +#adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -91px -1px; } -#adminmenu #menu-links div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -91px -33px; +#adminmenu .menu-icon-page div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -151px -33px; } -#adminmenu #menu-links:hover div.wp-menu-image, -#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -91px -1px; +#adminmenu .menu-icon-page:hover div.wp-menu-image, +#adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -151px -1px; } -#adminmenu #menu-pages div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -151px -33px; +#adminmenu .menu-icon-comments div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -31px -33px; } -#adminmenu #menu-pages:hover div.wp-menu-image, -#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -151px -1px; +#adminmenu .menu-icon-comments:hover div.wp-menu-image, +#adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image, +#adminmenu .menu-icon-comments.current div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -31px -1px; } -#adminmenu #menu-comments div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -31px -33px; +#adminmenu .menu-icon-appearance div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -1px -33px; } -#adminmenu #menu-comments:hover div.wp-menu-image, -#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image, -#adminmenu #menu-comments.current div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -31px -1px; +#adminmenu .menu-icon-appearance:hover div.wp-menu-image, +#adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -1px -1px; } -#adminmenu #menu-appearance div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -1px -33px; +#adminmenu .menu-icon-plugins div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -181px -33px; } -#adminmenu #menu-appearance:hover div.wp-menu-image, -#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -1px -1px; +#adminmenu .menu-icon-plugins:hover div.wp-menu-image, +#adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -181px -1px; } -#adminmenu #menu-plugins div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -181px -33px; +#adminmenu .menu-icon-users div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -301px -33px; } -#adminmenu #menu-plugins:hover div.wp-menu-image, -#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -181px -1px; +#adminmenu .menu-icon-users:hover div.wp-menu-image, +#adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -301px -1px; } -#adminmenu #menu-users div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -301px -33px; +#adminmenu .menu-icon-tools div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -211px -33px; } -#adminmenu #menu-users:hover div.wp-menu-image, -#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -301px -1px; +#adminmenu .menu-icon-tools:hover div.wp-menu-image, +#adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -211px -1px; } -#adminmenu #menu-tools div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -211px -33px; +#adminmenu .menu-icon-settings div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -241px -33px; } -#adminmenu #menu-tools:hover div.wp-menu-image, -#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -211px -1px; +#adminmenu .menu-icon-settings:hover div.wp-menu-image, +#adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -241px -1px; } -#adminmenu #menu-settings div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -241px -33px; +#adminmenu .menu-icon-site div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -361px -33px; } -#adminmenu #menu-settings:hover div.wp-menu-image, -#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.png") no-repeat scroll -241px -1px; +#adminmenu .menu-icon-site:hover div.wp-menu-image, +#adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image { + background: transparent url('../images/menu.png?ver=20100531') no-repeat scroll -361px -1px; } /* end menu */ /* Diff */ table.diff .diff-deletedline { - background-color: #ffdddd; + background-color: #fdd; } table.diff .diff-deletedline del { - background-color: #ff9999; + background-color: #f99; } table.diff .diff-addedline { - background-color: #ddffdd; + background-color: #dfd; } table.diff .diff-addedline ins { - background-color: #99ff99; + background-color: #9f9; } #att-info { @@ -1357,7 +1361,7 @@ div.star.select:hover { } .inline-editor ul.cat-checklist { - background-color: #FFFFFF; + background-color: #fff; border-color: #ddd; } @@ -1384,7 +1388,7 @@ fieldset.inline-edit-col-right .inline-edit-col { } .meta-box-sortables .postbox:hover .handlediv { - background: transparent url(../images/menu-bits.gif) no-repeat scroll left -111px; + background: transparent url(../images/menu-bits.gif?ver=20100610) no-repeat scroll left -111px; } #major-publishing-actions { @@ -1397,7 +1401,7 @@ fieldset.inline-edit-col-right .inline-edit-col { .tablenav .tablenav-pages a { border-color: #e3e3e3; - background: #eee url('../images/menu-bits.gif') repeat-x scroll left -379px; + background: #eee url('../images/menu-bits.gif?ver=20100610') repeat-x scroll left -379px; } .tablenav .tablenav-pages a:hover { @@ -1458,7 +1462,8 @@ fieldset.inline-edit-col-right .inline-edit-col { background-color: #f5f5f5; } -#post-body ul#category-tabs li.tabs a { +#post-body ul.category-tabs li.tabs a, +#post-body ul.add-menu-item-tabs li.tabs a { color: #333; } @@ -1479,36 +1484,33 @@ fieldset.inline-edit-col-right .inline-edit-col { } #favorite-first { - background: #797979 url(../images/fav.png) repeat-x left center; - border-color: #777 !important; - border-bottom-color: #666 !important; + border-color: #c0c0c0; + background: #f1f1f1; /* fallback color */ + background:-moz-linear-gradient(bottom, #e7e7e7, #fff); + background:-webkit-gradient(linear, left bottom, left top, from(#e7e7e7), to(#fff)); } #favorite-inside { - border-color: #797979; - background-color: #797979; + border-color: #c0c0c0; + background-color: #fff; } #favorite-toggle { - background: transparent url(../images/fav-arrow.gif) no-repeat 0 -4px; + background: transparent url(../images/fav-arrow.gif?ver=20100531) no-repeat 0 -4px; } #favorite-actions a { - color: #ddd; + color: #464646; } #favorite-actions a:hover { - color: #fff; + color: #000; } #favorite-inside a:hover { text-decoration: underline; } -#favorite-actions .slide-down { - border-bottom-color: #626262; -} - #screen-meta a.show-settings { background-color: transparent; text-shadow: rgba(255,255,255,0.7) 0 1px 0; @@ -1516,53 +1518,57 @@ fieldset.inline-edit-col-right .inline-edit-col { #icon-edit, #icon-post { - background: transparent url(../images/icons32.png) no-repeat -552px -5px; + background: transparent url(../images/icons32.png?ver=20100531) no-repeat -552px -5px; } #icon-index { - background: transparent url(../images/icons32.png) no-repeat -137px -5px; + background: transparent url(../images/icons32.png?ver=20100531) no-repeat -137px -5px; } #icon-upload { - background: transparent url(../images/icons32.png) no-repeat -251px -5px; + background: transparent url(../images/icons32.png?ver=20100531) no-repeat -251px -5px; } #icon-link-manager, #icon-link, #icon-link-category { - background: transparent url(../images/icons32.png) no-repeat -190px -5px; + background: transparent url(../images/icons32.png?ver=20100531) no-repeat -190px -5px; } #icon-edit-pages, #icon-page { - background: transparent url(../images/icons32.png) no-repeat -312px -5px; + background: transparent url(../images/icons32.png?ver=20100531) no-repeat -312px -5px; } #icon-edit-comments { - background: transparent url(../images/icons32.png) no-repeat -72px -5px; + background: transparent url(../images/icons32.png?ver=20100531) no-repeat -72px -5px; } #icon-themes { - background: transparent url(../images/icons32.png) no-repeat -11px -5px; + background: transparent url(../images/icons32.png?ver=20100531) no-repeat -11px -5px; } #icon-plugins { - background: transparent url(../images/icons32.png) no-repeat -370px -5px; + background: transparent url(../images/icons32.png?ver=20100531) no-repeat -370px -5px; } #icon-users, #icon-profile, #icon-user-edit { - background: transparent url(../images/icons32.png) no-repeat -600px -5px; + background: transparent url(../images/icons32.png?ver=20100531) no-repeat -600px -5px; } #icon-tools, #icon-admin { - background: transparent url(../images/icons32.png) no-repeat -432px -5px; + background: transparent url(../images/icons32.png?ver=20100531) no-repeat -432px -5px; } #icon-options-general { - background: transparent url(../images/icons32.png) no-repeat -492px -5px; + background: transparent url(../images/icons32.png?ver=20100531) no-repeat -492px -5px; +} + +#icon-ms-admin { + background: transparent url(../images/icons32.png?ver=20100531) no-repeat -659px -5px; } .view-switch #view-switch-list { @@ -1582,28 +1588,12 @@ fieldset.inline-edit-col-right .inline-edit-col { } #header-logo { - background: transparent url(../images/wp-logo.gif) no-repeat scroll center center; -} - -#wphead #site-visit-button { - background-color:#585858; - background-image: url(../images/visit-site-button-grad.gif); - color:#aaa; - text-shadow: #3F3F3F 0 -1px 0; -} - -#wphead a:hover #site-visit-button { - color:#fff; -} - -#wphead a:focus #site-visit-button, -#wphead a:active #site-visit-button { - background-position:0 -27px; + background: transparent url(../images/wp-logo.png?ver=20100531) no-repeat scroll center center; } .popular-tags, .feature-filter { - background-color: #FFFFFF; + background-color: #fff; border-color: #DFDFDF; } @@ -1618,18 +1608,18 @@ fieldset.inline-edit-col-right .inline-edit-col { div.widgets-sortables, #widgets-left .inactive { background-color: #f1f1f1; - border-color: #ddd; + border-color: #ddd; } #available-widgets .widget-holder { - background-color: #fff; - border-color: #ddd; + background-color: #fff; + border-color: #ddd; } #widgets-left .sidebar-name { background-color: #aaa; background-image: url(../images/ed-bg.gif); - text-shadow: #FFFFFF 0 1px 0; + text-shadow: #fff 0 1px 0; border-color: #dfdfdf; } @@ -1651,11 +1641,11 @@ div.widgets-sortables, } #widgets-left .sidebar-name-arrow { - background: transparent url(../images/menu-bits.gif) no-repeat scroll left -109px; + background: transparent url(../images/menu-bits.gif?ver=20100610) no-repeat scroll left -109px; } #widgets-right .sidebar-name-arrow { - background: transparent url(../images/fav-arrow.gif) no-repeat scroll 0 -1px; + background: transparent url(../images/widgets-arrow.gif?ver=20100531) no-repeat scroll 0 -1px; } .in-widget-title { @@ -1695,3 +1685,12 @@ div.widgets-sortables, .comment-ays th { background-color: #f1f1f1; } + +#nav-menu-header, .menu-item-handle { + background: url("../images/gray-grad.png") repeat-x scroll left top #dfdfdf; +} + +#menu-management .nav-tab-active { + background: #ececec; + border-bottom-color: #ececec; +} \ No newline at end of file diff --git a/wp-admin/css/dashboard-rtl.css b/wp-admin/css/dashboard-rtl.css index 60a97baf..8b6f73a3 100644 --- a/wp-admin/css/dashboard-rtl.css +++ b/wp-admin/css/dashboard-rtl.css @@ -1,93 +1 @@ -#dashboard-widgets-wrap .has-sidebar { - margin-right: 0; - margin-left: -51%; -} -#dashboard-widgets-wrap .has-sidebar .has-sidebar-content { - margin-right: 0; - margin-left: 51%; -} -.view-all { - right: auto; - left: 0; -} -#dashboard_right_now p.sub, #dashboard-widgets h4, #dashboard_quick_press h4, a.rsswidget, #dashboard_plugins h4, #dashboard_plugins h5, #dashboard_recent_comments .comment-meta .approve { - font-family: Tahoma, Arial; -} -#dashboard_right_now td.b { - padding-right: 0; - padding-left: 6px; - text-align: left; - font-family: Tahoma, Arial; -} -#dashboard_right_now .t { - padding-right: 0; - padding-left: 12px; -} -#dashboard_right_now .versions a { - font-family: Tahoma, Arial; -} -#dashboard_right_now a.button { - float: left; - clear: left; -} -#dashboard-widgets h3 .postbox-title-action { - right: auto; - left: 30px; -} -#the-comment-list .pingback { - padding-left: 0 !important; - padding-right: 9px !important; -} -/* Recent Comments */ -#the-comment-list .comment-item { - padding: 1em 70px 1em 10px; -} -#the-comment-list .comment-item .avatar { - float: right; - margin-left: 0; - margin-right: -60px; -} -/* Feeds */ -.rss-widget cite { - text-align: left; -} -.rss-widget span.rss-date { - font-family: Tahoma, Arial; - margin-left: 0; - margin-right: 3px; -} -/* QuickPress */ -#dashboard_quick_press h4 { - float: right; - text-align: left; -} -#dashboard_quick_press h4 label { - margin-right: 0; - margin-left: 10px; -} -#dashboard_quick_press .input-text-wrap, #dashboard_quick_press .textarea-wrap { - margin: 0 5em 1em 0; -} -#dashboard_quick_press #media-buttons { - margin: 0 5em .5em 0; - padding: 0 10px 0 0; -} -#dashboard-widgets #dashboard_quick_press form p.submit { - margin-left: 0; - margin-right: 4.6em; -} -#dashboard-widgets #dashboard_quick_press form p.submit input { - float: right; -} -#dashboard-widgets #dashboard_quick_press form p.submit #save-post { - margin: 0 10px 0 1em; -} -#dashboard-widgets #dashboard_quick_press form p.submit #publish { - float: left; -} -/* Recent Drafts */ -#dashboard_recent_drafts h4 abbr { - font-family: Tahoma, Arial; - margin-left:0; - margin-right: 3px; -} +#dashboard-widgets-wrap .has-sidebar{margin-right:0;margin-left:-51%;}#dashboard-widgets-wrap .has-sidebar .has-sidebar-content{margin-right:0;margin-left:51%;}.view-all{right:auto;left:0;}#dashboard_right_now p.sub,#dashboard-widgets h4,#dashboard_quick_press h4,a.rsswidget,#dashboard_plugins h4,#dashboard_plugins h5,#dashboard_recent_comments .comment-meta .approve{font-family:Tahoma,Arial;}#dashboard_right_now p.sub{font-style:normal;left:auto;right:15px;}#dashboard_right_now td.b{padding-right:0;padding-left:6px;text-align:left;font-family:Tahoma,Arial;}#dashboard_right_now .t{padding-right:0;padding-left:12px;}#dashboard_right_now .table_content{float:right;}#dashboard_right_now .table_discussion{float:left;}#dashboard_right_now .versions{clear:right;}#dashboard_right_now .versions a{font-family:Tahoma,Arial;}#dashboard_right_now a.button{float:left;clear:left;}#dashboard-widgets h3 .postbox-title-action{right:auto;left:30px;}#the-comment-list .pingback{padding-left:0!important;padding-right:9px!important;}#the-comment-list .comment-item{padding:1em 70px 1em 10px;}#the-comment-list .comment-item .avatar{float:right;margin-left:0;margin-right:-60px;}.rss-widget cite{text-align:left;}.rss-widget span.rss-date{font-family:Tahoma,Arial;margin-left:0;margin-right:3px;}#dashboard_quick_press h4{float:right;text-align:left;}#dashboard_quick_press h4 label{margin-right:0;margin-left:10px;}#dashboard_quick_press .input-text-wrap,#dashboard_quick_press .textarea-wrap{margin:0 5em 1em 0;}#dashboard_quick_press #media-buttons{margin:0 5em .5em 0;padding:0 10px 0 0;}#dashboard-widgets #dashboard_quick_press form p.submit{margin-left:0;margin-right:4.6em;}#dashboard-widgets #dashboard_quick_press form p.submit input{float:right;}#dashboard-widgets #dashboard_quick_press form p.submit #save-post{margin:0 10px 0 1em;}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:left;}#dashboard-widgets #dashboard_quick_press form p.submit img.waiting{margin:4px 0 0 6px;}#dashboard_recent_drafts h4 abbr{font-family:Tahoma,Arial;margin-left:0;margin-right:3px;} \ No newline at end of file diff --git a/wp-admin/css/dashboard-rtl.dev.css b/wp-admin/css/dashboard-rtl.dev.css new file mode 100644 index 00000000..78f2e879 --- /dev/null +++ b/wp-admin/css/dashboard-rtl.dev.css @@ -0,0 +1,110 @@ +#dashboard-widgets-wrap .has-sidebar { + margin-right: 0; + margin-left: -51%; +} +#dashboard-widgets-wrap .has-sidebar .has-sidebar-content { + margin-right: 0; + margin-left: 51%; +} +.view-all { + right: auto; + left: 0; +} +#dashboard_right_now p.sub, #dashboard-widgets h4, #dashboard_quick_press h4, a.rsswidget, #dashboard_plugins h4, #dashboard_plugins h5, #dashboard_recent_comments .comment-meta .approve { + font-family: Tahoma, Arial; +} +#dashboard_right_now p.sub { + font-style:normal; + left:auto; + right:15px; +} +#dashboard_right_now td.b { + padding-right: 0; + padding-left: 6px; + text-align: left; + font-family: Tahoma, Arial; +} +#dashboard_right_now .t { + padding-right: 0; + padding-left: 12px; +} +#dashboard_right_now .table_content { + float:right; +} +#dashboard_right_now .table_discussion { + float:left; +} +#dashboard_right_now .versions { + clear:right; +} +#dashboard_right_now .versions a { + font-family: Tahoma, Arial; +} +#dashboard_right_now a.button { + float: left; + clear: left; +} +#dashboard-widgets h3 .postbox-title-action { + right: auto; + left: 30px; +} +#the-comment-list .pingback { + padding-left: 0 !important; + padding-right: 9px !important; +} +/* Recent Comments */ +#the-comment-list .comment-item { + padding: 1em 70px 1em 10px; +} +#the-comment-list .comment-item .avatar { + float: right; + margin-left: 0; + margin-right: -60px; +} +/* Feeds */ +.rss-widget cite { + text-align: left; +} +.rss-widget span.rss-date { + font-family: Tahoma, Arial; + margin-left: 0; + margin-right: 3px; +} +/* QuickPress */ +#dashboard_quick_press h4 { + float: right; + text-align: left; +} +#dashboard_quick_press h4 label { + margin-right: 0; + margin-left: 10px; +} +#dashboard_quick_press .input-text-wrap, #dashboard_quick_press .textarea-wrap { + margin: 0 5em 1em 0; +} +#dashboard_quick_press #media-buttons { + margin: 0 5em .5em 0; + padding: 0 10px 0 0; +} +#dashboard-widgets #dashboard_quick_press form p.submit { + margin-left: 0; + margin-right: 4.6em; +} +#dashboard-widgets #dashboard_quick_press form p.submit input { + float: right; +} +#dashboard-widgets #dashboard_quick_press form p.submit #save-post { + margin: 0 10px 0 1em; +} +#dashboard-widgets #dashboard_quick_press form p.submit #publish { + float: left; +} +#dashboard-widgets #dashboard_quick_press form p.submit img.waiting { + margin: 4px 0 0 6px; +} +/* Recent Drafts */ +#dashboard_recent_drafts h4 abbr { + font-family: Tahoma, Arial; + margin-left:0; + margin-right: 3px; +} \ No newline at end of file diff --git a/wp-admin/css/dashboard.css b/wp-admin/css/dashboard.css index 51a8ea9d..e87fec52 100644 --- a/wp-admin/css/dashboard.css +++ b/wp-admin/css/dashboard.css @@ -1 +1 @@ -.postbox p,.postbox ul,.postbox ol,.postbox blockquote,#wp-version-message{font-size:11px;}.edit-box{display:none;}h3:hover .edit-box{display:inline;}form .input-text-wrap{border-style:solid;border-width:1px;padding:2px 3px;border-color:#ccc;}#dashboard-widgets form .input-text-wrap input{border:0 none;outline:none;margin:0;padding:0;width:99%;color:#333;}form .textarea-wrap{border-style:solid;border-width:1px;padding:2px;border-color:#ccc;}#dashboard-widgets form .textarea-wrap textarea{border:0 none;padding:0;outline:none;width:99%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;}#dashboard-widgets .postbox form .submit{float:none;margin:.5em 0 0;padding:0;border:none;}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input{margin:0;}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish{min-width:0;}div.postbox div.inside{margin:10px;position:relative;}#dashboard-widgets a{text-decoration:none;}#dashboard-widgets h3 a{text-decoration:underline;}#dashboard-widgets h3 .postbox-title-action{position:absolute;right:30px;padding:0;}#dashboard-widgets h4{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:13px;margin:0 0 .2em;padding:0;}#dashboard_right_now p.sub,#dashboard_right_now .table,#dashboard_right_now .versions{margin:-12px;}#dashboard_right_now .inside{font-size:12px;}#dashboard_right_now p.sub{font-style:italic;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:5px 10px 15px;color:#777;font-size:13px;}#dashboard_right_now .table{background:#f9f9f9;border-top:#ececec 1px solid;border-bottom:#ececec 1px solid;margin:0 -9px 10px;padding:0 10px;}#dashboard_right_now table{width:100%;}#dashboard_right_now table td{border-top:#ececec 1px solid;padding:3px 0;white-space:nowrap;}#dashboard_right_now table tr.first td{border-top:none;}#dashboard_right_now td.b{padding-right:6px;text-align:right;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:14px;}#dashboard_right_now td.b a{font-size:18px;}#dashboard_right_now td.b a:hover{color:#d54e21;}#dashboard_right_now .t{font-size:12px;padding-right:12px;padding-top:6px;color:#777;}#dashboard_right_now .t a{white-space:nowrap;}#dashboard_right_now td.first,#dashboard_right_now td.last{width:1%;}#dashboard_right_now .spam{color:red;}#dashboard_right_now .waiting{color:#e66f00;}#dashboard_right_now .approved{color:green;}#dashboard_right_now .versions{padding:6px 10px 12px;}#dashboard_right_now .versions .b{font-weight:bold;}#dashboard_right_now a.button{float:right;clear:right;position:relative;top:-5px;}#dashboard_recent_comments h3{margin-bottom:0;}#dashboard_recent_comments .inside{margin-top:0;}#dashboard_recent_comments .comment-meta .approve{font-style:italic;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:10px;}#the-comment-list{position:relative;}#the-comment-list .comment-item{padding:1em 10px;border-top:1px solid;}#the-comment-list .pingback{padding-left:9px!important;}#the-comment-list .comment-item,#the-comment-list #replyrow{margin:0 -10px;}#the-comment-list .comment-item:first-child{border-top:none;}#the-comment-list .comment-item .avatar{float:left;margin:0 10px 5px 0;}#the-comment-list .comment-item h4{line-height:1.4;margin-top:-.2em;font-weight:normal;color:#999;}#the-comment-list .comment-item h4 cite{font-style:normal;font-weight:normal;}#the-comment-list .comment-item blockquote,#the-comment-list .comment-item blockquote p{margin:0;padding:0;display:inline;}#dashboard_recent_comments #the-comment-list .trackback blockquote,#dashboard_recent_comments #the-comment-list .pingback blockquote{display:block;}#the-comment-list .comment-item p.row-actions{margin:3px 0 0;padding:0;font-size:10px;}#dashboard_quick_press h4{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;float:left;width:5.5em;clear:both;font-weight:normal;text-align:right;padding-top:5px;font-size:12px;}#dashboard_quick_press h4 label{margin-right:10px;}#dashboard_quick_press .input-text-wrap,#dashboard_quick_press .textarea-wrap{margin:0 0 1em 5em;}#dashboard_quick_press #media-buttons{margin:0 0 .5em 5em;padding:0 0 0 10px;font-size:11px;}#dashboard_quick_press #media-buttons a{vertical-align:bottom;}#dashboard-widgets #dashboard_quick_press form p.submit{margin-left:4.6em;}#dashboard-widgets #dashboard_quick_press form p.submit input{float:left;}#dashboard-widgets #dashboard_quick_press form p.submit #save-post{margin:0 1em 0 10px;}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:right;}#dashboard_recent_drafts ul{margin:0;padding:0;list-style:none;}#dashboard_recent_drafts ul li{margin-bottom:.6em;}#dashboard_recent_drafts h4{font-weight:normal;}#dashboard_recent_drafts h4 abbr{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:11px;color:#999;margin-left:3px;}#dashboard_recent_drafts p{margin:0;padding:0;}.rss-widget ul{margin:0;padding:0;list-style:none;}a.rsswidget{font-size:13px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;line-height:1.7em;}.rss-widget ul li{line-height:1.5em;margin-bottom:12px;}.rss-widget span.rss-date{margin-left:3px;}.rss-widget cite{display:block;text-align:right;margin:0 0 1em;padding:0;}.rss-widget cite:before{content:'\2014';}#dashboard_plugins h4{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}#dashboard_plugins h5{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:13px!important;margin:0;display:inline;line-height:1.4em;}#dashboard_plugins h5 a{font-weight:normal;line-height:1.7em;}#dashboard_plugins p{margin:0 0 1.4em;line-height:1.4em;}.dashboard-comment-wrap{overflow:hidden;word-wrap:break-word;} \ No newline at end of file +.postbox p,.postbox ul,.postbox ol,.postbox blockquote,#wp-version-message{font-size:11px;}.edit-box{display:none;}h3:hover .edit-box{display:inline;}form .input-text-wrap{border-style:solid;border-width:1px;padding:2px 3px;border-color:#ccc;}#dashboard-widgets form .input-text-wrap input{border:0 none;outline:none;margin:0;padding:0;width:99%;color:#333;}form .textarea-wrap{border-style:solid;border-width:1px;padding:2px;border-color:#ccc;}#dashboard-widgets form .textarea-wrap textarea{border:0 none;padding:0;outline:none;width:99%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;}#dashboard-widgets .postbox form .submit{float:none;margin:.5em 0 0;padding:0;border:none;}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input{margin:0;}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish{min-width:0;}div.postbox div.inside{margin:10px;position:relative;}#dashboard-widgets a{text-decoration:none;}#dashboard-widgets h3 a{text-decoration:underline;}#dashboard-widgets h3 .postbox-title-action{position:absolute;right:30px;padding:0;}#dashboard-widgets h4{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:13px;margin:0 0 .2em;padding:0;}#dashboard_right_now p.sub,#dashboard_right_now .table,#dashboard_right_now .versions{margin:-12px;}#dashboard_right_now .inside{font-size:12px;padding-top:20px;}#dashboard_right_now p.sub{font-style:italic;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:5px 10px 15px;color:#777;font-size:13px;position:absolute;top:-17px;left:15px;}#dashboard_right_now .table{margin:0 -9px;padding:0 10px;position:relative;}#dashboard_right_now .table_content{float:left;border-top:#ececec 1px solid;width:45%;}#dashboard_right_now .table_discussion{float:right;border-top:#ececec 1px solid;width:45%;}#dashboard_right_now table td{padding:3px 0;white-space:nowrap;}#dashboard_right_now table tr.first td{border-top:none;}#dashboard_right_now td.b{padding-right:6px;text-align:right;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:14px;width:1%;}#dashboard_right_now td.b a{font-size:18px;}#dashboard_right_now td.b a:hover{color:#d54e21;}#dashboard_right_now .t{font-size:12px;padding-right:12px;padding-top:6px;color:#777;}#dashboard_right_now .t a{white-space:nowrap;}#dashboard_right_now .spam{color:red;}#dashboard_right_now .waiting{color:#e66f00;}#dashboard_right_now .approved{color:green;}#dashboard_right_now .versions{padding:6px 10px 12px;clear:left;}#dashboard_right_now .versions .b{font-weight:bold;}#dashboard_right_now a.button{float:right;clear:right;position:relative;top:-5px;}#dashboard_recent_comments h3{margin-bottom:0;}#dashboard_recent_comments .inside{margin-top:0;}#dashboard_recent_comments .comment-meta .approve{font-style:italic;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:10px;}#the-comment-list{position:relative;}#the-comment-list .comment-item{padding:1em 10px;border-top:1px solid;}#the-comment-list .pingback{padding-left:9px!important;}#the-comment-list .comment-item,#the-comment-list #replyrow{margin:0 -10px;}#the-comment-list .comment-item:first-child{border-top:none;}#the-comment-list .comment-item .avatar{float:left;margin:0 10px 5px 0;}#the-comment-list .comment-item h4{line-height:1.4;margin-top:-.2em;font-weight:normal;color:#999;}#the-comment-list .comment-item h4 cite{font-style:normal;font-weight:normal;}#the-comment-list .comment-item blockquote,#the-comment-list .comment-item blockquote p{margin:0;padding:0;display:inline;}#dashboard_recent_comments #the-comment-list .trackback blockquote,#dashboard_recent_comments #the-comment-list .pingback blockquote{display:block;}#the-comment-list .comment-item p.row-actions{margin:3px 0 0;padding:0;font-size:10px;}#dashboard_quick_press h4{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;float:left;width:5.5em;clear:both;font-weight:normal;text-align:right;padding-top:5px;font-size:12px;}#dashboard_quick_press h4 label{margin-right:10px;}#dashboard_quick_press .input-text-wrap,#dashboard_quick_press .textarea-wrap{margin:0 0 1em 5em;}#dashboard_quick_press #media-buttons{margin:0 0 .5em 5em;padding:0 0 0 10px;font-size:11px;}#dashboard_quick_press #media-buttons a{vertical-align:bottom;}#dashboard-widgets #dashboard_quick_press form p.submit{margin-left:4.6em;}#dashboard-widgets #dashboard_quick_press form p.submit input{float:left;}#dashboard-widgets #dashboard_quick_press form p.submit #save-post{margin:0 1em 0 10px;}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:right;}#dashboard-widgets #dashboard_quick_press form p.submit img.waiting{vertical-align:middle;visibility:hidden;margin:4px 6px 0 0;}#dashboard_recent_drafts ul{margin:0;padding:0;list-style:none;}#dashboard_recent_drafts ul li{margin-bottom:.6em;}#dashboard_recent_drafts h4{font-weight:normal;}#dashboard_recent_drafts h4 abbr{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:11px;color:#999;margin-left:3px;}#dashboard_recent_drafts p{margin:0;padding:0;}.rss-widget ul{margin:0;padding:0;list-style:none;}a.rsswidget{font-size:13px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;line-height:1.7em;}.rss-widget ul li{line-height:1.5em;margin-bottom:12px;}.rss-widget span.rss-date{margin-left:3px;}.rss-widget cite{display:block;text-align:right;margin:0 0 1em;padding:0;}.rss-widget cite:before{content:'\2014';}#dashboard_plugins h4{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}#dashboard_plugins h5{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:13px!important;margin:0;display:inline;line-height:1.4em;}#dashboard_plugins h5 a{font-weight:normal;line-height:1.7em;}#dashboard_plugins p{margin:0 0 1.4em;line-height:1.4em;}.dashboard-comment-wrap{overflow:hidden;word-wrap:break-word;} \ No newline at end of file diff --git a/wp-admin/css/dashboard.dev.css b/wp-admin/css/dashboard.dev.css index fe477b1c..d8ae32e2 100644 --- a/wp-admin/css/dashboard.dev.css +++ b/wp-admin/css/dashboard.dev.css @@ -91,6 +91,7 @@ div.postbox div.inside { #dashboard_right_now .inside { font-size: 12px; + padding-top: 20px; } #dashboard_right_now p.sub { @@ -99,22 +100,30 @@ div.postbox div.inside { padding: 5px 10px 15px; color: #777; font-size: 13px; + position: absolute; + top: -17px; + left: 15px; } #dashboard_right_now .table { - background: #f9f9f9; - border-top: #ececec 1px solid; - border-bottom: #ececec 1px solid; - margin: 0 -9px 10px; + margin: 0 -9px; padding: 0 10px; + position: relative; } -#dashboard_right_now table { - width: 100%; +#dashboard_right_now .table_content { + float: left; + border-top: #ececec 1px solid; + width: 45%; } -#dashboard_right_now table td { +#dashboard_right_now .table_discussion { + float: right; border-top: #ececec 1px solid; + width: 45%; +} + +#dashboard_right_now table td { padding: 3px 0; white-space: nowrap; } @@ -128,6 +137,7 @@ div.postbox div.inside { text-align: right; font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; font-size: 14px; + width: 1%; } #dashboard_right_now td.b a { @@ -149,11 +159,6 @@ div.postbox div.inside { white-space: nowrap; } -#dashboard_right_now td.first, -#dashboard_right_now td.last { - width: 1%; -} - #dashboard_right_now .spam { color: red; } @@ -168,6 +173,7 @@ div.postbox div.inside { #dashboard_right_now .versions { padding: 6px 10px 12px; + clear: left; } #dashboard_right_now .versions .b { @@ -302,6 +308,12 @@ div.postbox div.inside { float: right; } +#dashboard-widgets #dashboard_quick_press form p.submit img.waiting { + vertical-align: middle; + visibility: hidden; + margin: 4px 6px 0 0; +} + /* Recent Drafts */ #dashboard_recent_drafts ul { margin: 0; @@ -391,4 +403,3 @@ a.rsswidget { overflow: hidden; word-wrap: break-word; } - diff --git a/wp-admin/css/global-rtl.css b/wp-admin/css/global-rtl.css index f5f7632e..d7a34800 100644 --- a/wp-admin/css/global-rtl.css +++ b/wp-admin/css/global-rtl.css @@ -1,82 +1 @@ -/* 2 column liquid layout */ -#adminmenu { - float: right; - clear: right; - margin-right:-160px; - margin-left: 5px; -} -body.folded #adminmenu { - margin-left: 0; - margin-right: -45px; -} -/* inner 2 column liquid layout */ -.inner-sidebar { - float: left; - clear: left; -} - -.has-right-sidebar #post-body { - clear:right; - float:right; - margin-right:0; - margin-left:-340px; -} - -.has-right-sidebar #post-body-content { - margin-left: 300px; - margin-right:0; -} - -#wpbody { - margin-left:0; - margin-right: 175px; -} -.folded #wpbody { - margin-left: 0; - margin-right: 60px; -} -#wpbody-content { - float: right; -} -/* 2 columns main area */ -#col-right { - float: left; - clear: left; -} -.wrap { - margin: 0 5px 0 15px; -} -/* styles for use by people extending the WordPress interface */ -body, td, textarea, input, select { - font-family: Tahoma, arial; -} -.alignleft { - float: right; -} -.alignright { - float: left; -} -.subsubsub { - float: right; -} -.widefat th { - text-align: right; -} -.widefat th input { - margin: 0 8px 0 0; -} -.wrap h2 { - font-family: arial; - padding: 14px 0 3px 15px; -} -.wrap h2.long-header { - padding-left: 0; -} -.updated, .error { - clear: both; -} - -.screen-reader-text, .screen-reader-text span { - left:auto; - text-indent:-1000em; -} \ No newline at end of file +#adminmenu{float:right;clear:right;margin-right:-160px;margin-left:5px;}body.folded #adminmenu{margin-left:0;margin-right:-45px;}.inner-sidebar{float:left;clear:left;}.has-right-sidebar #post-body{clear:right;float:right;margin-right:0;margin-left:-340px;}.has-right-sidebar #post-body-content{margin-left:300px;margin-right:0;}#wpbody{margin-left:0;margin-right:175px;}.folded #wpbody{margin-left:0;margin-right:60px;}#wpbody-content{float:right;}#col-right{float:left;clear:left;}.wrap{margin:0 5px 0 15px;}body,td,textarea,input,select{font-family:Tahoma,arial;}.alignleft{float:right;}.alignright{float:left;}.subsubsub{float:right;}.widefat th{text-align:right;}.widefat th input{margin:0 8px 0 0;}.wrap h2{font-family:arial;padding:14px 0 3px 15px;font-style:normal;}.wrap h2.long-header{padding-left:0;}.updated,.error{clear:both;}.screen-reader-text,.screen-reader-text span{left:auto;text-indent:-1000em;} \ No newline at end of file diff --git a/wp-admin/css/global-rtl.dev.css b/wp-admin/css/global-rtl.dev.css new file mode 100644 index 00000000..85d21c32 --- /dev/null +++ b/wp-admin/css/global-rtl.dev.css @@ -0,0 +1,83 @@ +/* 2 column liquid layout */ +#adminmenu { + float: right; + clear: right; + margin-right:-160px; + margin-left: 5px; +} +body.folded #adminmenu { + margin-left: 0; + margin-right: -45px; +} +/* inner 2 column liquid layout */ +.inner-sidebar { + float: left; + clear: left; +} + +.has-right-sidebar #post-body { + clear:right; + float:right; + margin-right:0; + margin-left:-340px; +} + +.has-right-sidebar #post-body-content { + margin-left: 300px; + margin-right:0; +} + +#wpbody { + margin-left:0; + margin-right: 175px; +} +.folded #wpbody { + margin-left: 0; + margin-right: 60px; +} +#wpbody-content { + float: right; +} +/* 2 columns main area */ +#col-right { + float: left; + clear: left; +} +.wrap { + margin: 0 5px 0 15px; +} +/* styles for use by people extending the WordPress interface */ +body, td, textarea, input, select { + font-family: Tahoma, arial; +} +.alignleft { + float: right; +} +.alignright { + float: left; +} +.subsubsub { + float: right; +} +.widefat th { + text-align: right; +} +.widefat th input { + margin: 0 8px 0 0; +} +.wrap h2 { + font-family: arial; + padding: 14px 0 3px 15px; + font-style: normal; +} +.wrap h2.long-header { + padding-left: 0; +} +.updated, .error { + clear: both; +} + +.screen-reader-text, .screen-reader-text span { + left:auto; + text-indent:-1000em; +} \ No newline at end of file diff --git a/wp-admin/css/global.css b/wp-admin/css/global.css index 30fd194e..3729410f 100644 --- a/wp-admin/css/global.css +++ b/wp-admin/css/global.css @@ -1 +1 @@ -html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;background:transparent;}body{line-height:1;}ol,ul{list-style:none;}blockquote,q{quotes:none;}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;}ins{text-decoration:none;}del{text-decoration:line-through;}#wpwrap{height:auto;min-height:100%;width:100%;}#wpcontent{height:100%;padding-bottom:50px;}#wpbody{clear:both;margin-left:175px;}.folded #wpbody{margin-left:60px;}#wpbody-content{float:left;width:100%;}#adminmenu{float:left;clear:left;width:145px;margin-top:15px;margin-right:5px;margin-bottom:15px;margin-left:-160px;position:relative;padding:0;list-style:none;}.folded #adminmenu{margin-left:-45px;}.folded #adminmenu,.folded #adminmenu li.menu-top{width:28px;}#footer{clear:both;position:relative;width:100%;}.inner-sidebar{float:right;clear:right;display:none;width:281px;position:relative;}.inner-sidebar #side-sortables{width:280px;min-height:300px;}.has-right-sidebar .inner-sidebar{display:block;}.has-right-sidebar #post-body{float:left;clear:left;width:100%;margin-right:-340px;}.has-right-sidebar #post-body-content{margin-right:300px;}#col-container{overflow:hidden;padding:0;margin:0;}#col-left{padding:0;margin:0;overflow:hidden;width:39%;}#col-right{float:right;clear:right;overflow:hidden;padding:0;margin:0;width:59%;}.alignleft{float:left;}.alignright{float:right;}.textleft{text-align:left;}.textright{text-align:right;}.clear{clear:both;}.screen-reader-text,.screen-reader-text span{position:absolute;left:-1000em;height:1px;width:1px;overflow:hidden;}.hidden,.js .closed .inside,.js .hide-if-js,.no-js .hide-if-no-js{display:none;}input[type="text"],input[type="password"],textarea{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}input[type="checkbox"],input[type="radio"]{vertical-align:middle;}html,body{height:100%;}body,td,textarea,input,select{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:13px;}body,textarea{line-height:1.4em;}input,select{line-height:1em;}p{margin:1em 0;}blockquote{margin:1em;}label{cursor:pointer;}li,dd{margin-bottom:6px;}p,li,dl,dd,dt{line-height:140%;}textarea,input,select{margin:1px;padding:3px;}h1{display:block;font-size:2em;font-weight:bold;margin:.67em 0;}h2{display:block;font-size:1.5em;font-weight:bold;margin:.83em 0;}h3{display:block;font-size:1.17em;font-weight:bold;margin:1em 0;}h4{display:block;font-size:1em;font-weight:bold;margin:1.33em 0;}h5{display:block;font-size:.83em;font-weight:bold;margin:1.67em 0;}h6{display:block;font-size:.67em;font-weight:bold;margin:2.33em 0;}ul.ul-disc{list-style:disc outside;}ul.ul-square{list-style:square outside;}ol.ol-decimal{list-style:decimal outside;}ul.ul-disc,ul.ul-square,ol.ol-decimal{margin-left:1.8em;}ul.ul-disc>li,ul.ul-square>li,ol.ol-decimal>li{margin:0 0 .5em;}.subsubsub{list-style:none;margin:8px 0 5px;padding:0;white-space:nowrap;font-size:11px;float:left;}.subsubsub a{line-height:2;padding:.2em;text-decoration:none;}.subsubsub a .count,.subsubsub a.current .count{color:#999;font-weight:normal;}.subsubsub a.current{font-weight:bold;background:none;border:none;}.subsubsub li{display:inline;margin:0;padding:0;}.widefat{border-width:1px;border-style:solid;border-spacing:0;width:100%;clear:both;margin:0;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.widefat *{word-wrap:break-word;}.widefat a{text-decoration:none;}.widefat td,.widefat th{border-bottom-width:1px;border-bottom-style:solid;font-size:11px;}.widefat td{padding:3px 7px;vertical-align:top;}.widefat td p,.widefat td ol,.widefat td ul{font-size:11px;}.widefat th{padding:7px 7px 8px;text-align:left;line-height:1.3em;}.widefat th input{margin:0 0 0 8px;padding:0;vertical-align:text-top;}.widefat .check-column{width:2.2em;padding:0;}.widefat tbody th.check-column{padding:7px 0 22px;vertical-align:top;}.widefat .num,.column-comments,.column-links,.column-posts{text-align:center;}.widefat th#comments{vertical-align:middle;}.wrap{margin:0 15px 0 5px;}.updated,.error{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 15px 2px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.updated p,.error p{margin:.5em 0;line-height:1;padding:2px;}.wrap .updated,.wrap .error{margin:5px 0 15px;}.wrap h2{font:italic normal normal 24px/29px Georgia,"Times New Roman","Bitstream Charter",Times,serif;margin:0;padding:14px 15px 3px 0;line-height:35px;text-shadow:rgba(255,255,255,1) 0 1px 0;}.wrap h2.long-header{padding-right:0;} \ No newline at end of file +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;background:transparent;}body{line-height:1;}ol,ul{list-style:none;}blockquote,q{quotes:none;}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;}ins{text-decoration:none;}del{text-decoration:line-through;}#wpwrap{height:auto;min-height:100%;width:100%;}#wpcontent{height:100%;padding-bottom:50px;}#wpbody{clear:both;margin-left:175px;}.folded #wpbody{margin-left:60px;}#wpbody-content{float:left;width:100%;}#adminmenu{float:left;clear:left;width:145px;margin-top:15px;margin-right:5px;margin-bottom:15px;margin-left:-160px;position:relative;padding:0;list-style:none;}.folded #adminmenu{margin-left:-45px;}.folded #adminmenu,.folded #adminmenu li.menu-top{width:28px;}#footer{clear:both;position:relative;width:100%;}.inner-sidebar{float:right;clear:right;display:none;width:281px;position:relative;}.inner-sidebar #side-sortables{width:280px;min-height:300px;}.has-right-sidebar .inner-sidebar{display:block;}.has-right-sidebar #post-body{float:left;clear:left;width:100%;margin-right:-340px;}.has-right-sidebar #post-body-content{margin-right:300px;}#col-container{overflow:hidden;padding:0;margin:0;}#col-left{padding:0;margin:0;overflow:hidden;width:39%;}#col-right{float:right;clear:right;overflow:hidden;padding:0;margin:0;width:59%;}.alignleft{float:left;}.alignright{float:right;}.textleft{text-align:left;}.textright{text-align:right;}.clear{clear:both;}.screen-reader-text,.screen-reader-text span{position:absolute;left:-1000em;height:1px;width:1px;overflow:hidden;}.hidden,.js .closed .inside,.js .hide-if-js,.no-js .hide-if-no-js{display:none;}input[type="text"],input[type="password"],textarea{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}input[type="checkbox"],input[type="radio"]{vertical-align:middle;}html,body{height:100%;}body,td,textarea,input,select{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:13px;}body,textarea{line-height:1.4em;}input,select{line-height:15px;}p{margin:1em 0;}blockquote{margin:1em;}label{cursor:pointer;}li,dd{margin-bottom:6px;}p,li,dl,dd,dt{line-height:140%;}textarea,input,select{margin:1px;padding:3px;}h1{display:block;font-size:2em;font-weight:bold;margin:.67em 0;}h2{display:block;font-size:1.5em;font-weight:bold;margin:.83em 0;}h3{display:block;font-size:1.17em;font-weight:bold;margin:1em 0;}h4{display:block;font-size:1em;font-weight:bold;margin:1.33em 0;}h5{display:block;font-size:.83em;font-weight:bold;margin:1.67em 0;}h6{display:block;font-size:.67em;font-weight:bold;margin:2.33em 0;}ul.ul-disc{list-style:disc outside;}ul.ul-square{list-style:square outside;}ol.ol-decimal{list-style:decimal outside;}ul.ul-disc,ul.ul-square,ol.ol-decimal{margin-left:1.8em;}ul.ul-disc>li,ul.ul-square>li,ol.ol-decimal>li{margin:0 0 .5em;}.subsubsub{list-style:none;margin:8px 0 5px;padding:0;white-space:nowrap;font-size:11px;float:left;}.subsubsub a{line-height:2;padding:.2em;text-decoration:none;}.subsubsub a .count,.subsubsub a.current .count{color:#999;font-weight:normal;}.subsubsub a.current{font-weight:bold;background:none;border:none;}.subsubsub li{display:inline;margin:0;padding:0;}.widefat{border-width:1px;border-style:solid;border-spacing:0;width:100%;clear:both;margin:0;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.widefat *{word-wrap:break-word;}.widefat a{text-decoration:none;}.widefat td,.widefat th{border-bottom-width:1px;border-bottom-style:solid;font-size:11px;}.widefat td{padding:3px 7px;vertical-align:top;}.widefat td p,.widefat td ol,.widefat td ul{font-size:11px;}.widefat th{padding:7px 7px 8px;text-align:left;line-height:1.3em;}.widefat th input{margin:0 0 0 8px;padding:0;vertical-align:text-top;}.widefat .check-column{width:2.2em;padding:0;}.widefat tbody th.check-column{padding:7px 0 22px;vertical-align:top;}.widefat .num,.column-comments,.column-links,.column-posts{text-align:center;}.widefat th#comments{vertical-align:middle;}.wrap{margin:0 15px 0 5px;}.updated,.error{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 15px 2px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.updated p,.error p{margin:.5em 0;line-height:1;padding:2px;}.wrap .updated,.wrap .error{margin:5px 0 15px;}.wrap h2{font:italic normal normal 24px/29px Georgia,"Times New Roman","Bitstream Charter",Times,serif;margin:0;padding:14px 15px 3px 0;line-height:35px;text-shadow:rgba(255,255,255,1) 0 1px 0;}.wrap h2.long-header{padding-right:0;} \ No newline at end of file diff --git a/wp-admin/css/global.dev.css b/wp-admin/css/global.dev.css index d4802441..35f69c51 100644 --- a/wp-admin/css/global.dev.css +++ b/wp-admin/css/global.dev.css @@ -239,7 +239,7 @@ textarea { input, select { - line-height: 1em; + line-height: 15px; } p { @@ -478,7 +478,7 @@ ol.ol-decimal > li { margin: 0; padding: 14px 15px 3px 0; line-height: 35px; - text-shadow: rgba(255,255,255,1) 0px 1px 0px; + text-shadow: rgba(255,255,255,1) 0 1px 0; } .wrap h2.long-header { diff --git a/wp-admin/css/ie-rtl.css b/wp-admin/css/ie-rtl.css index 067f59a0..40f5b76b 100644 --- a/wp-admin/css/ie-rtl.css +++ b/wp-admin/css/ie-rtl.css @@ -1,95 +1 @@ -* html #wpcontent #adminmenu .wp-has-submenu .wp-menu-toggle { - background: url(../images/menu-bits-rtl.gif) no-repeat scroll right -109px; -} - -* html #wpcontent #adminmenu li.wp-has-current-submenu .wp-menu-toggle { - background: url(../images/menu-bits-rtl.gif) no-repeat scroll right -206px; -} -* html #adminmenu { - margin-left:0; - margin-right: -80px; -} -* html div.folded #adminmenu { - margin-left: 0; - margin-right: -22px; -} -#wpcontent #adminmenu .wp-submenu li.wp-submenu-head { - padding: 3px 10px 4px 4px; -} -.inline-edit-row fieldset label span.title { - float: right; -} -.inline-edit-row fieldset label span.input-text-wrap { - margin-right: 0; -} -p.search-box { - float: left; -} -* html #poststuff h2 { - margin-right: 0; -} -#bh { - margin: 7px 10px 0 0; - float: left; -} -#user_info + div#favorite-actions { - right: auto; - left: 15px; -} -#wphead-info { - float: left; -} -/* without this dashboard widgets appear in one column for some screen widths */ -div#dashboard-widgets { - padding-right: 0; - padding-left: 1px; -} -.tagchecklist span a { - margin: 4px -9px 0 0; -} -.widefat th input { - margin: 0 5px 0 0; -} -/* ---------- add by navid */ -#TB_window { - width: 670px; - position: absolute; - top: 50%; - left: 50%; - margin-right: 335px !important; -} -#dashboard_plugins { - direction: ltr; -} -#dashboard_plugins h3.hndle { - direction: rtl; -} -#dashboard_incoming_links ul li, -#dashboard_secondary ul li, -#dashboard_primary ul li, -p.row-actions { - width: 100%; -} -#favorite-inside { - position: absolute; - right:0; -} -#post-status-info { - height: 25px; -} -#screen-meta { - position: static; -} -p.submit { /* quick edit and reply in edit-comments.php */ - height:22px; -} -.inner-sidebar { /* fix edit single comment */ - position: static; -} -form#widgets-filter { /* fix widget page */ - position: static; -} - -* html .meta-box-sortables .postbox .handlediv { - background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -111px; -} +html{direction:ltr;}body{direction:rtl;}* html #wpcontent #adminmenu .wp-has-submenu .wp-menu-toggle{background:url(../images/menu-bits-rtl.gif?ver=20100531) no-repeat scroll right -109px;}* html #wpcontent #adminmenu li.wp-has-current-submenu .wp-menu-toggle{background:url(../images/menu-bits-rtl.gif?ver=20100531) no-repeat scroll right -206px;}* html #adminmenu{margin-left:0;margin-right:-80px;}* html div.folded #adminmenu{margin-left:0;margin-right:-22px;}#wpcontent #adminmenu .wp-submenu li.wp-submenu-head{padding:3px 10px 4px 4px;}.inline-edit-row fieldset label span.title{float:right;}.inline-edit-row fieldset label span.input-text-wrap{margin-right:0;}p.search-box{float:left;}* html #poststuff h2{margin-right:0;}#bh{margin:7px 10px 0 0;float:left;}#user_info+div#favorite-actions{right:auto;left:15px;}#wphead-info{float:left;}div#dashboard-widgets{padding-right:0;padding-left:1px;}.tagchecklist span a{margin:4px -9px 0 0;}.widefat th input{margin:0 5px 0 0;}#TB_window{width:670px;position:absolute;top:50%;left:50%;margin-right:335px!important;}#dashboard_plugins{direction:ltr;}#dashboard_plugins h3.hndle{direction:rtl;}#dashboard_incoming_links ul li,#dashboard_secondary ul li,#dashboard_primary ul li,p.row-actions{width:100%;}#favorite-inside{position:absolute;right:0;}#post-status-info{height:25px;}#screen-meta{position:static;}p.submit{height:22px;}.inner-sidebar{position:static;}form#widgets-filter{position:static;}* html .meta-box-sortables .postbox .handlediv{background:transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -111px;}.menu-max-depth-0 #menu-management{width:460px;}.menu-max-depth-1 #menu-management{width:490px;}.menu-max-depth-2 #menu-management{width:520px;}.menu-max-depth-3 #menu-management{width:550px;}.menu-max-depth-4 #menu-management{width:580px;}.menu-max-depth-5 #menu-management{width:610px;}.menu-max-depth-6 #menu-management{width:640px;}.menu-max-depth-7 #menu-management{width:670px;}.menu-max-depth-8 #menu-management{width:700px;}.menu-max-depth-9 #menu-management{width:730px;}.menu-max-depth-10 #menu-management{width:760px;}.menu-max-depth-11 #menu-management{width:790px;}.menu-item-depth-0{margin-left:0;}.menu-item-depth-1{margin-left:-30px;}.menu-item-depth-2{margin-left:-60px;}.menu-item-depth-3{margin-left:-90px;}.menu-item-depth-4{margin-left:-120px;}.menu-item-depth-5{margin-left:-150px;}.menu-item-depth-6{margin-left:-180px;}.menu-item-depth-7{margin-left:-210px;}.menu-item-depth-8{margin-left:-240px;}.menu-item-depth-9{margin-left:-270px;}.menu-item-depth-10{margin-left:-300px;}.menu-item-depth-11{margin-left:-330px;}#menu-to-edit li dl{padding:0!important;margin:0!important;}.ui-sortable-helper .menu-item-transport{margin-top:13px;}.ui-sortable-helper .menu-item-transport .menu-item-transport{margin-top:0;}.sortable-placeholder{margin-top:0!important;margin-left:0!important;margin-bottom:13px!important;padding:0!important;}.auto-add-pages{clear:both;float:none;}#nav-menus-frame .open-label span{float:none;display:inline-block;}#nav-menus-frame .delete-action{float:none;} \ No newline at end of file diff --git a/wp-admin/css/ie-rtl.dev.css b/wp-admin/css/ie-rtl.dev.css new file mode 100644 index 00000000..c35fc894 --- /dev/null +++ b/wp-admin/css/ie-rtl.dev.css @@ -0,0 +1,156 @@ +html { + direction: ltr; +} +body { + direction: rtl; +} +* html #wpcontent #adminmenu .wp-has-submenu .wp-menu-toggle { + background: url(../images/menu-bits-rtl.gif?ver=20100531) no-repeat scroll right -109px; +} + +* html #wpcontent #adminmenu li.wp-has-current-submenu .wp-menu-toggle { + background: url(../images/menu-bits-rtl.gif?ver=20100531) no-repeat scroll right -206px; +} +* html #adminmenu { + margin-left:0; + margin-right: -80px; +} +* html div.folded #adminmenu { + margin-left: 0; + margin-right: -22px; +} +#wpcontent #adminmenu .wp-submenu li.wp-submenu-head { + padding: 3px 10px 4px 4px; +} +.inline-edit-row fieldset label span.title { + float: right; +} +.inline-edit-row fieldset label span.input-text-wrap { + margin-right: 0; +} +p.search-box { + float: left; +} +* html #poststuff h2 { + margin-right: 0; +} +#bh { + margin: 7px 10px 0 0; + float: left; +} +#user_info + div#favorite-actions { + right: auto; + left: 15px; +} +#wphead-info { + float: left; +} +/* without this dashboard widgets appear in one column for some screen widths */ +div#dashboard-widgets { + padding-right: 0; + padding-left: 1px; +} +.tagchecklist span a { + margin: 4px -9px 0 0; +} +.widefat th input { + margin: 0 5px 0 0; +} +/* ---------- add by navid */ +#TB_window { + width: 670px; + position: absolute; + top: 50%; + left: 50%; + margin-right: 335px !important; +} +#dashboard_plugins { + direction: ltr; +} +#dashboard_plugins h3.hndle { + direction: rtl; +} +#dashboard_incoming_links ul li, +#dashboard_secondary ul li, +#dashboard_primary ul li, +p.row-actions { + width: 100%; +} +#favorite-inside { + position: absolute; + right:0; +} +#post-status-info { + height: 25px; +} +#screen-meta { + position: static; +} +p.submit { /* quick edit and reply in edit-comments.php */ + height:22px; +} +.inner-sidebar { /* fix edit single comment */ + position: static; +} +form#widgets-filter { /* fix widget page */ + position: static; +} + +* html .meta-box-sortables .postbox .handlediv { + background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -111px; +} + +/* nav menus */ +.menu-max-depth-0 #menu-management { width: 460px; } +.menu-max-depth-1 #menu-management { width: 490px; } +.menu-max-depth-2 #menu-management { width: 520px; } +.menu-max-depth-3 #menu-management { width: 550px; } +.menu-max-depth-4 #menu-management { width: 580px; } +.menu-max-depth-5 #menu-management { width: 610px; } +.menu-max-depth-6 #menu-management { width: 640px; } +.menu-max-depth-7 #menu-management { width: 670px; } +.menu-max-depth-8 #menu-management { width: 700px; } +.menu-max-depth-9 #menu-management { width: 730px; } +.menu-max-depth-10 #menu-management { width: 760px; } +.menu-max-depth-11 #menu-management { width: 790px; } + +.menu-item-depth-0 { margin-left: 0px; } +.menu-item-depth-1 { margin-left: -30px; } +.menu-item-depth-2 { margin-left: -60px; } +.menu-item-depth-3 { margin-left: -90px; } +.menu-item-depth-4 { margin-left: -120px; } +.menu-item-depth-5 { margin-left: -150px; } +.menu-item-depth-6 { margin-left: -180px; } +.menu-item-depth-7 { margin-left: -210px; } +.menu-item-depth-8 { margin-left: -240px; } +.menu-item-depth-9 { margin-left: -270px; } +.menu-item-depth-10 { margin-left: -300px; } +.menu-item-depth-11 { margin-left: -330px; } + +#menu-to-edit li dl { + padding: 0 !important; + margin: 0 !important; +} +.ui-sortable-helper .menu-item-transport { + margin-top: 13px; +} + .ui-sortable-helper .menu-item-transport .menu-item-transport { + margin-top: 0; + } +.sortable-placeholder { + margin-top: 0 !important; + margin-left: 0 !important; + margin-bottom: 13px !important; + padding: 0 !important; +} +.auto-add-pages { + clear: both; + float: none; +} +#nav-menus-frame .open-label span { + float: none; + display: inline-block; +} +#nav-menus-frame .delete-action { + float: none; +} diff --git a/wp-admin/css/ie.css b/wp-admin/css/ie.css index 7e84e0c5..bacde291 100644 --- a/wp-admin/css/ie.css +++ b/wp-admin/css/ie.css @@ -1,444 +1 @@ -/* Fixes for IE bugs */ - -input.button, -input.button-secondary, -input.button-highlighted { - padding: 0; -} - -#minor-publishing-actions input, -#major-publishing-actions input { - min-width: auto; - padding-left: 0; - padding-right: 0; -} - -#wpbody-content .postbox { - border: 1px solid #dfdfdf; -} - -#wpbody-content .postbox h3 { - margin-bottom: -1px; -} - -* html .meta-box-sortables .postbox .handlediv { - background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px; -} - -* html .edit-box { - display: inline; -} - -* html .inner-sidebar #side-sortables, -* html .postbox-container .meta-box-sortables { - height: 300px; -} - -* html #wpbody-content #screen-options-link-wrap { - display: inline-block; - width: 150px; - text-align: center; -} - -* html #wpbody-content #contextual-help-link-wrap { - display: inline-block; - width: 100px; - text-align: center; -} - -* html #adminmenu { - margin-left: -80px; -} - -* html .folded #adminmenu { - margin-left: -22px; -} - -* html #wpcontent #adminmenu li.menu-top { - display: inline; - padding: 0; - margin: 0; -} - -* html #footer { - margin: 0; -} - -.folded #adminmenu li.menu-top { - display: block; - zoom: 100%; -} - -ul#adminmenu { - z-index: 99; -} - -#adminmenu li.menu-top a.menu-top { - min-width: auto; - width: auto; -} - -#wpcontent #adminmenu li.wp-has-current-submenu a.wp-has-submenu { - font-style: normal; -} - -* html #wpcontent #adminmenu .wp-menu-open .wp-menu-toggle { - background: none; -} - -* html #wpcontent #adminmenu .wp-has-submenu .wp-menu-toggle { - background: url(../images/menu-bits.gif) no-repeat scroll left -109px; -} - -* html #wpcontent #adminmenu li.wp-has-current-submenu .wp-menu-toggle { - background: url(../images/menu-bits.gif) no-repeat scroll left -206px; -} - -* html #adminmenu div.wp-menu-image { - height: 29px; -} - -#wpcontent #adminmenu .wp-submenu li { - padding: 0; -} - -#adminmenu, -.wp-submenu, -.wp-submenu li, -.wp-menu-toggle { - zoom: 100%; -} - -.folded #adminmenu li.wp-menu-separator { - width: 28px; -} - -#wpcontent #adminmenu .wp-submenu li.wp-submenu-head { - padding: 3px 4px 4px 10px; - zoom: 100%; -} - -.folded #adminmenu .menu-top { - height: 30px; -} - -.folded #adminmenu .wp-submenu { - margin: -1px 0 0 0; -} - -#template, -#template div, -#editcat, -#addcat, -* html .stuffbox h3 { - zoom: 100%; -} - -.submitbox { - margin-top: 10px; -} - -/* Inline Editor */ -#wpbody-content .quick-edit-row-post .inline-edit-col-left { - width: 39%; -} - -#wpbody-content .inline-edit-row-post .inline-edit-col-center { - width: 19%; -} - -#wpbody-content .quick-edit-row-page .inline-edit-col-left { - width: 49%; -} - -#wpbody-content .bulk-edit-row .inline-edit-col-left { - width: 29%; -} - -.inline-edit-row p.submit { - zoom: 100%; -} - -.inline-edit-row fieldset label span.title { - display: block; - float: left; - width: 5em; -} - -.inline-edit-row fieldset label span.input-text-wrap { - margin-left: 0; - zoom: 100%; -} - -#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input { - line-height: 130%; -} - -#wpbody-content .inline-edit-row .input-text-wrap input { - width: 95%; -} - -#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input { - width: 8em; -} -/* end Inline Editor */ - -input { - line-height: 1; -} - -* html .row-actions { - visibility: visible; -} - -#dashboard-widgets h3 a { - height: 20px; - line-height: 20px; -} - -#wphead-info { - float: right; -} - -#titlediv #title { - width: 98%; -} - -a.button { - line-height: 1.4em; - margin: 1px; - padding: 4px 6px; -} - -* html div.widget-liquid-left, -* html div.widget-liquid-right { - display: block; - position: relative; -} - -#screen-options-wrap { - overflow: hidden; -} - -#favorite-actions { - z-index: 12; -} - -#favorite-inside, -#favorite-inside a, -.favorite-action { - zoom: 100%; -} - -#the-comment-list .comment-item, -#post-status-info, -#wpwrap, -#wpcontent, -#wrap, -#postdivrich, -#postdiv, -#poststuff, -.metabox-holder, -#titlediv, -#post-body, -#editorcontainer, -.tablenav, -.widget-liquid-left, -.widget-liquid-right, -#widgets-left, -.widgets-sortables, -#dragHelper, -.widget .widget-top, -.widget, -.widget-control-actions, -.tagchecklist, -#col-container, -#col-left, -#col-right, -.fileedit-sub { - display: block; - zoom: 100%; -} - -p.search-box { - position: static; - float: right; - margin: -3px 0 4px; -} - -* html #editorcontainer { - padding: 0; -} - -#editorcontainer #content { - overflow: auto; - margin: auto; - width: 98%; -} - -form#template div { - width: 100%; -} - -#ed_toolbar input, -#ed_reply_toolbar input { - overflow: visible; - padding: 0 4px; -} - -#poststuff h2 { - font-size: 1.6em; -} - -* html #poststuff h2 { - margin-left: 0; -} - -#bh { - margin: 7px 10px 0 0; - float: right; -} - -/* without this dashboard widgets appear in one column for some screen widths */ -div#dashboard-widgets { - padding-right: 1px; -} - -.tagchecklist span, .tagchecklist span a { - display: inline-block; - display: block; -} - -.tagchecklist span a { - margin: 4px 0 0 -9px; -} - -.tablenav .button-secondary, .nav .button-secondary { - padding: 0 1px; - vertical-align: middle; -} - -.tablenav select { - font-size: 13px; - display: inline-block; - vertical-align: top; - margin-top: 2px; -} - -.tablenav .actions select { - width: 155px; -} - -table.ie-fixed { - table-layout: fixed; -} - -.widefat tr, .widefat th { - margin-bottom: 0; - border-spacing: 0; -} - -.widefat th input { - margin: 0 0 0 5px; -} - -.widefat .check-column { - padding: 6px 0 2px; -} - -.widefat tbody th.check-column { - padding: 4px 0 22px; -} - -.widefat { - empty-cells: show; - border-collapse: collapse; -} - -.tablenav a.button-secondary { - display: inline-block; - padding: 2px 5px; -} - -* html .stuffbox, -* html .stuffbox input, -* html .stuffbox textarea { - border: 1px solid #DFDFDF; -} - -* html .feature-filter .feature-group li { - width: 145px; -} - -* html .widget-top .widget-title-action a { - background: url("../images/menu-bits.gif") no-repeat scroll 0 -110px; -} - -* html div.widget-liquid-left { - width: 99%; -} - -#wp_inactive_widgets { - padding-bottom: 8px; -} - -* html .widgets-sortables { - height: 50px; -} - -* html a#content_resize { - right: -2px; -} - -* html .widget-title h4 { - width: 205px; -} - -* html #removing-widget .in-widget-title { - display: none; -} - -#available-widgets .widget-holder { - padding-bottom: 65px; -} - -#widgets-left .inactive { - padding-bottom: 10px; -} - -.widget-liquid-right .widget, -#wp_inactive_widgets .widget { - position: relative; -} - -* html .media-item .pinkynail { - height: 32px; - width: 40px; -} - -#wpcontent .button-primary-disabled { - color: #9FD0D5; - background: #298CBA; -} - -#wpcontent #ajax-loading { - vertical-align: baseline; -} - -* html .describe .field input.text, -* html .describe .field textarea { - width: 440px; -} - -#the-comment-list .unapproved tr, -#the-comment-list .unapproved td { - background-color: #ffffe0; -} - -.imgedit-submit { - width: 300px; -} - -* html input { - border: 1px solid #dfdfdf; -} +#wpbody-content input.button,#wpbody-content input.button-secondary,#wpbody-content input.button-highlighted{padding:2px 3px;}#minor-publishing-actions input,#major-publishing-actions input{min-width:auto;padding-left:0;padding-right:0;}#wpbody-content .postbox{border:1px solid #dfdfdf;}#wpbody-content .postbox h3{margin-bottom:-1px;}* html .meta-box-sortables .postbox .handlediv{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;}* html .edit-box{display:inline;}* html .inner-sidebar #side-sortables,* html .postbox-container .meta-box-sortables{height:300px;}* html #wpbody-content #screen-options-link-wrap{display:inline-block;width:150px;text-align:center;}* html #wpbody-content #contextual-help-link-wrap{display:inline-block;width:100px;text-align:center;}* html #adminmenu{margin-left:-80px;}* html .folded #adminmenu{margin-left:-22px;}* html #wpcontent #adminmenu li.menu-top{display:inline;padding:0;margin:0;}* html #footer{margin:0;}.folded #adminmenu li.menu-top{display:block;zoom:100%;}ul#adminmenu{z-index:99;}#adminmenu li.menu-top a.menu-top{min-width:auto;width:auto;}#wpcontent #adminmenu li.wp-has-current-submenu a.wp-has-submenu{font-style:normal;}* html #wpcontent #adminmenu .wp-menu-open .wp-menu-toggle{background:none;}* html #wpcontent #adminmenu .wp-has-submenu .wp-menu-toggle{background:url(../images/menu-bits.gif?ver=20100610) no-repeat scroll left -109px;}* html #wpcontent #adminmenu li.wp-has-current-submenu .wp-menu-toggle{background:url(../images/menu-bits.gif?ver=20100610) no-repeat scroll left -206px;}* html #adminmenu div.wp-menu-image{height:29px;}#wpcontent #adminmenu .wp-submenu li{padding:0;}#adminmenu,.major-publishing-actions,.wp-submenu,.wp-submenu li,.wp-menu-toggle{zoom:100%;}.folded #adminmenu li.wp-menu-separator{width:28px;}#wpcontent #adminmenu .wp-submenu li.wp-submenu-head{padding:3px 4px 4px 10px;zoom:100%;}.folded #adminmenu .menu-top{height:30px;}.folded #adminmenu .wp-submenu{margin:-1px 0 0 0;}#template,#template div,#editcat,#addcat,* html .stuffbox h3{zoom:100%;}.submitbox{margin-top:10px;}#wpbody-content .quick-edit-row-post .inline-edit-col-left{width:39%;}#wpbody-content .inline-edit-row-post .inline-edit-col-center{width:19%;}#wpbody-content .quick-edit-row-page .inline-edit-col-left{width:49%;}#wpbody-content .bulk-edit-row .inline-edit-col-left{width:29%;}.inline-edit-row p.submit{zoom:100%;}.inline-edit-row fieldset label span.title{display:block;float:left;width:5em;}.inline-edit-row fieldset label span.input-text-wrap{margin-left:0;zoom:100%;}#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input{line-height:130%;}#wpbody-content .inline-edit-row .input-text-wrap input{width:95%;}#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input{width:8em;}input{line-height:1;}* html .row-actions{visibility:visible;}#dashboard-widgets h3 a{height:20px;line-height:20px;}#wphead-info{float:right;}#titlediv #title{width:98%;}a.button{line-height:1.4em;margin:1px;padding:2px 6px;}* html div.widget-liquid-left,* html div.widget-liquid-right{display:block;position:relative;}#screen-options-wrap{overflow:hidden;}#favorite-actions{z-index:12;}#favorite-inside,#favorite-inside a,.favorite-action{zoom:100%;}#the-comment-list .comment-item,#post-status-info,#wpwrap,#wpcontent,#wrap,#postdivrich,#postdiv,#poststuff,.metabox-holder,#titlediv,#post-body,#editorcontainer,.tablenav,.widget-liquid-left,.widget-liquid-right,#widgets-left,.widgets-sortables,#dragHelper,.widget .widget-top,.widget,.widget-control-actions,.tagchecklist,#col-container,#col-left,#col-right,.fileedit-sub{display:block;zoom:100%;}p.search-box{position:static;float:right;margin:-3px 0 4px;}* html #editorcontainer{padding:0;}#editorcontainer #content{overflow:auto;margin:auto;width:98%;}form#template div{width:100%;}#ed_toolbar input,#ed_reply_toolbar input{overflow:visible;padding:0 4px;}#poststuff h2{font-size:1.6em;}* html #poststuff h2{margin-left:0;}#bh{margin:7px 10px 0 0;float:right;}div#dashboard-widgets{padding-right:1px;}.tagchecklist span,.tagchecklist span a{display:inline-block;display:block;}.tagchecklist span a{margin:4px 0 0 -9px;}.tablenav .button-secondary,.nav .button-secondary{padding:0 1px;vertical-align:middle;}.tablenav select{font-size:13px;display:inline-block;vertical-align:top;margin-top:2px;}.tablenav .actions select{width:155px;}table.ie-fixed{table-layout:fixed;}.widefat tr,.widefat th{margin-bottom:0;border-spacing:0;}.widefat th input{margin:0 0 0 5px;}.widefat .check-column{padding:6px 0 2px;}.widefat tbody th.check-column{padding:4px 0 22px;}.widefat{empty-cells:show;border-collapse:collapse;}.tablenav a.button-secondary{display:inline-block;padding:2px 5px;}* html .stuffbox,* html .stuffbox input,* html .stuffbox textarea{border:1px solid #DFDFDF;}* html .feature-filter .feature-group li{width:145px;}* html .widget-top .widget-title-action a{background:url("../images/menu-bits.gif?ver=20100610") no-repeat scroll 0 -110px;}* html div.widget-liquid-left{width:99%;}#wp_inactive_widgets{padding-bottom:8px;}* html .widgets-sortables{height:50px;}* html a#content_resize{right:-2px;}* html .widget-title h4{width:205px;}* html #removing-widget .in-widget-title{display:none;}#available-widgets .widget-holder{padding-bottom:65px;}#widgets-left .inactive{padding-bottom:10px;}.widget-liquid-right .widget,#wp_inactive_widgets .widget{position:relative;}* html .media-item .pinkynail{height:32px;width:40px;}#wpcontent .button-primary-disabled{color:#9FD0D5;background:#298CBA;}#wpcontent #ajax-loading{vertical-align:baseline;}* html .describe .field input.text,* html .describe .field textarea{width:440px;}#the-comment-list .unapproved tr,#the-comment-list .unapproved td{background-color:#ffffe0;}.imgedit-submit{width:300px;}* html input{border:1px solid #dfdfdf;}#nav-menu-header,#nav-menus-frame,#wpbody,.menu li{zoom:100%;}#update-nav-menu #post-body{overflow:hidden;}.menu li{min-width:100%;}.menu li.sortable-placeholder{min-width:400px;} \ No newline at end of file diff --git a/wp-admin/css/ie.dev.css b/wp-admin/css/ie.dev.css new file mode 100644 index 00000000..2e81461d --- /dev/null +++ b/wp-admin/css/ie.dev.css @@ -0,0 +1,464 @@ +/* Fixes for IE bugs */ + +#wpbody-content input.button, +#wpbody-content input.button-secondary, +#wpbody-content input.button-highlighted { + padding: 2px 3px; +} + +#minor-publishing-actions input, +#major-publishing-actions input { + min-width: auto; + padding-left: 0; + padding-right: 0; +} + +#wpbody-content .postbox { + border: 1px solid #dfdfdf; +} + +#wpbody-content .postbox h3 { + margin-bottom: -1px; +} + +* html .meta-box-sortables .postbox .handlediv { + background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px; +} + +* html .edit-box { + display: inline; +} + +* html .inner-sidebar #side-sortables, +* html .postbox-container .meta-box-sortables { + height: 300px; +} + +* html #wpbody-content #screen-options-link-wrap { + display: inline-block; + width: 150px; + text-align: center; +} + +* html #wpbody-content #contextual-help-link-wrap { + display: inline-block; + width: 100px; + text-align: center; +} + +* html #adminmenu { + margin-left: -80px; +} + +* html .folded #adminmenu { + margin-left: -22px; +} + +* html #wpcontent #adminmenu li.menu-top { + display: inline; + padding: 0; + margin: 0; +} + +* html #footer { + margin: 0; +} + +.folded #adminmenu li.menu-top { + display: block; + zoom: 100%; +} + +ul#adminmenu { + z-index: 99; +} + +#adminmenu li.menu-top a.menu-top { + min-width: auto; + width: auto; +} + +#wpcontent #adminmenu li.wp-has-current-submenu a.wp-has-submenu { + font-style: normal; +} + +* html #wpcontent #adminmenu .wp-menu-open .wp-menu-toggle { + background: none; +} + +* html #wpcontent #adminmenu .wp-has-submenu .wp-menu-toggle { + background: url(../images/menu-bits.gif?ver=20100610) no-repeat scroll left -109px; +} + +* html #wpcontent #adminmenu li.wp-has-current-submenu .wp-menu-toggle { + background: url(../images/menu-bits.gif?ver=20100610) no-repeat scroll left -206px; +} + +* html #adminmenu div.wp-menu-image { + height: 29px; +} + +#wpcontent #adminmenu .wp-submenu li { + padding: 0; +} + +#adminmenu, +.major-publishing-actions, +.wp-submenu, +.wp-submenu li, +.wp-menu-toggle { + zoom: 100%; +} + +.folded #adminmenu li.wp-menu-separator { + width: 28px; +} + +#wpcontent #adminmenu .wp-submenu li.wp-submenu-head { + padding: 3px 4px 4px 10px; + zoom: 100%; +} + +.folded #adminmenu .menu-top { + height: 30px; +} + +.folded #adminmenu .wp-submenu { + margin: -1px 0 0 0; +} + +#template, +#template div, +#editcat, +#addcat, +* html .stuffbox h3 { + zoom: 100%; +} + +.submitbox { + margin-top: 10px; +} + +/* Inline Editor */ +#wpbody-content .quick-edit-row-post .inline-edit-col-left { + width: 39%; +} + +#wpbody-content .inline-edit-row-post .inline-edit-col-center { + width: 19%; +} + +#wpbody-content .quick-edit-row-page .inline-edit-col-left { + width: 49%; +} + +#wpbody-content .bulk-edit-row .inline-edit-col-left { + width: 29%; +} + +.inline-edit-row p.submit { + zoom: 100%; +} + +.inline-edit-row fieldset label span.title { + display: block; + float: left; + width: 5em; +} + +.inline-edit-row fieldset label span.input-text-wrap { + margin-left: 0; + zoom: 100%; +} + +#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input { + line-height: 130%; +} + +#wpbody-content .inline-edit-row .input-text-wrap input { + width: 95%; +} + +#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input { + width: 8em; +} +/* end Inline Editor */ + +input { + line-height: 1; +} + +* html .row-actions { + visibility: visible; +} + +#dashboard-widgets h3 a { + height: 20px; + line-height: 20px; +} + +#wphead-info { + float: right; +} + +#titlediv #title { + width: 98%; +} + +a.button { + line-height: 1.4em; + margin: 1px; + padding: 2px 6px; +} + +* html div.widget-liquid-left, +* html div.widget-liquid-right { + display: block; + position: relative; +} + +#screen-options-wrap { + overflow: hidden; +} + +#favorite-actions { + z-index: 12; +} + +#favorite-inside, +#favorite-inside a, +.favorite-action { + zoom: 100%; +} + +#the-comment-list .comment-item, +#post-status-info, +#wpwrap, +#wpcontent, +#wrap, +#postdivrich, +#postdiv, +#poststuff, +.metabox-holder, +#titlediv, +#post-body, +#editorcontainer, +.tablenav, +.widget-liquid-left, +.widget-liquid-right, +#widgets-left, +.widgets-sortables, +#dragHelper, +.widget .widget-top, +.widget, +.widget-control-actions, +.tagchecklist, +#col-container, +#col-left, +#col-right, +.fileedit-sub { + display: block; + zoom: 100%; +} + +p.search-box { + position: static; + float: right; + margin: -3px 0 4px; +} + +* html #editorcontainer { + padding: 0; +} + +#editorcontainer #content { + overflow: auto; + margin: auto; + width: 98%; +} + +form#template div { + width: 100%; +} + +#ed_toolbar input, +#ed_reply_toolbar input { + overflow: visible; + padding: 0 4px; +} + +#poststuff h2 { + font-size: 1.6em; +} + +* html #poststuff h2 { + margin-left: 0; +} + +#bh { + margin: 7px 10px 0 0; + float: right; +} + +/* without this dashboard widgets appear in one column for some screen widths */ +div#dashboard-widgets { + padding-right: 1px; +} + +.tagchecklist span, .tagchecklist span a { + display: inline-block; + display: block; +} + +.tagchecklist span a { + margin: 4px 0 0 -9px; +} + +.tablenav .button-secondary, .nav .button-secondary { + padding: 0 1px; + vertical-align: middle; +} + +.tablenav select { + font-size: 13px; + display: inline-block; + vertical-align: top; + margin-top: 2px; +} + +.tablenav .actions select { + width: 155px; +} + +table.ie-fixed { + table-layout: fixed; +} + +.widefat tr, .widefat th { + margin-bottom: 0; + border-spacing: 0; +} + +.widefat th input { + margin: 0 0 0 5px; +} + +.widefat .check-column { + padding: 6px 0 2px; +} + +.widefat tbody th.check-column { + padding: 4px 0 22px; +} + +.widefat { + empty-cells: show; + border-collapse: collapse; +} + +.tablenav a.button-secondary { + display: inline-block; + padding: 2px 5px; +} + +* html .stuffbox, +* html .stuffbox input, +* html .stuffbox textarea { + border: 1px solid #DFDFDF; +} + +* html .feature-filter .feature-group li { + width: 145px; +} + +* html .widget-top .widget-title-action a { + background: url("../images/menu-bits.gif?ver=20100610") no-repeat scroll 0 -110px; +} + +* html div.widget-liquid-left { + width: 99%; +} + +#wp_inactive_widgets { + padding-bottom: 8px; +} + +* html .widgets-sortables { + height: 50px; +} + +* html a#content_resize { + right: -2px; +} + +* html .widget-title h4 { + width: 205px; +} + +* html #removing-widget .in-widget-title { + display: none; +} + +#available-widgets .widget-holder { + padding-bottom: 65px; +} + +#widgets-left .inactive { + padding-bottom: 10px; +} + +.widget-liquid-right .widget, +#wp_inactive_widgets .widget { + position: relative; +} + +* html .media-item .pinkynail { + height: 32px; + width: 40px; +} + +#wpcontent .button-primary-disabled { + color: #9FD0D5; + background: #298CBA; +} + +#wpcontent #ajax-loading { + vertical-align: baseline; +} + +* html .describe .field input.text, +* html .describe .field textarea { + width: 440px; +} + +#the-comment-list .unapproved tr, +#the-comment-list .unapproved td { + background-color: #ffffe0; +} + +.imgedit-submit { + width: 300px; +} + +* html input { + border: 1px solid #dfdfdf; +} + +#nav-menu-header, +#nav-menus-frame, +#wpbody, +.menu li { + zoom:100%; +} + +#update-nav-menu #post-body { + overflow:hidden; +} + +.menu li { + min-width:100%; +} + +.menu li.sortable-placeholder { + min-width:400px; +} diff --git a/wp-admin/css/install-rtl.css b/wp-admin/css/install-rtl.css index f44484f7..e422eced 100644 --- a/wp-admin/css/install-rtl.css +++ b/wp-admin/css/install-rtl.css @@ -1,16 +1 @@ -body { - font-family: Tahoma, arial; -} -h1 { - font-family: arial; - margin: 5px -4px 0 0; -} -ul, ol { padding: 5px 22px 5px 5px; } -.step, th { text-align: right; } -.submit input, .button, .button-secondary { - font-family: Tahoma, arial; - margin-right:0; -} -.form-table th { - text-align: right; -} +body{font-family:Tahoma,arial;}h1{font-family:arial;margin:5px -4px 0 0;}ul,ol{padding:5px 22px 5px 5px;}.step,th{text-align:right;}.submit input,.button,.button-secondary{font-family:Tahoma,arial;margin-right:0;}.form-table th{text-align:right;}#user_login,#admin_email,#pass1,#pass2{direction:ltr;} \ No newline at end of file diff --git a/wp-admin/css/install-rtl.dev.css b/wp-admin/css/install-rtl.dev.css new file mode 100644 index 00000000..9e0be997 --- /dev/null +++ b/wp-admin/css/install-rtl.dev.css @@ -0,0 +1,23 @@ +body { + font-family: Tahoma, arial; +} +h1 { + font-family: arial; + margin: 5px -4px 0 0; +} +ul, ol { + padding: 5px 22px 5px 5px; +} +.step, th { + text-align: right; +} +.submit input, .button, .button-secondary { + font-family: Tahoma, arial; + margin-right: 0; +} +.form-table th { + text-align: right; +} +#user_login, #admin_email, #pass1, #pass2 { + direction: ltr; +} \ No newline at end of file diff --git a/wp-admin/css/install.css b/wp-admin/css/install.css index 834a3b18..3655b405 100644 --- a/wp-admin/css/install.css +++ b/wp-admin/css/install.css @@ -1 +1 @@ -html{background:#f7f7f7;}body{background:#fff;color:#333;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;margin:2em auto 0 auto;width:700px;padding:1em 2em;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;border:1px solid #dfdfdf;}a{color:#2583ad;text-decoration:none;}a:hover{color:#d54e21;}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,"Times New Roman",Times,serif;margin:5px 0 0 -4px;padding:0;padding-bottom:7px;}h2{font-size:16px;}p,li{padding-bottom:2px;font-size:12px;line-height:18px;}code{font-size:13px;}ul,ol{padding:5px 5px 5px 22px;}#logo{margin:6px 0 14px 0;border-bottom:none;}.step{margin:20px 0 15px;}.step,th{text-align:left;padding:0;}.submit input,.button,.button-secondary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-moz-border-radius:15px;-khtml-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}.button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}.form-table{border-collapse:collapse;margin-top:1em;width:100%;}.form-table td{margin-bottom:9px;padding:10px;border-bottom:8px solid #fff;font-size:12px;}.form-table th{font-size:13px;text-align:left;padding:16px 10px 10px 10px;border-bottom:8px solid #fff;width:110px;vertical-align:top;}.form-table tr{background:#f3f3f3;}.form-table code{line-height:18px;font-size:18px;}.form-table p{margin:4px 0 0 0;font-size:11px;}.form-table input{line-height:20px;font-size:15px;padding:2px;}#error-page{margin-top:50px;}#error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}#error-page code{font-family:Consolas,Monaco,Courier,monospace;} \ No newline at end of file +html{background:#f9f9f9;}body{background:#fff;color:#333;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;margin:2em auto;width:700px;padding:1em 2em;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;border:1px solid #dfdfdf;}a{color:#2583ad;text-decoration:none;}a:hover{color:#d54e21;}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,"Times New Roman",Times,serif;margin:5px 0 0 -4px;padding:0;padding-bottom:7px;}h2{font-size:16px;}p,li,dd,dt{padding-bottom:2px;font-size:12px;line-height:18px;}code,.code{font-size:13px;}ul,ol,dl{padding:5px 5px 5px 22px;}a img{border:0;}abbr{border:0;font-variant:normal;}#logo{margin:6px 0 14px 0;border-bottom:none;text-align:center;}.step{margin:20px 0 15px;}.step,th{text-align:left;padding:0;}.submit input,.button,.button-secondary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-moz-border-radius:15px;-khtml-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}.button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}textarea{border:1px solid #bbb;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.form-table{border-collapse:collapse;margin-top:1em;width:100%;}.form-table td{margin-bottom:9px;padding:10px;border-bottom:8px solid #fff;font-size:12px;}.form-table th{font-size:13px;text-align:left;padding:16px 10px 10px 10px;border-bottom:8px solid #fff;width:130px;vertical-align:top;}.form-table tr{background:#f3f3f3;}.form-table code{line-height:18px;font-size:18px;}.form-table p{margin:4px 0 0 0;font-size:11px;}.form-table input{line-height:20px;font-size:15px;padding:2px;}.form-table th p{font-weight:normal;}#error-page{margin-top:50px;}#error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}#error-page code,.code{font-family:Consolas,Monaco,Courier,monospace;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;border-style:solid;border-width:1px;margin:5px 5px 5px 1px;padding:5px;text-align:center;width:200px;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}.message{border:1px solid #e6db55;padding:.3em .6em;margin:5px 0 15px;background-color:#ffffe0;} \ No newline at end of file diff --git a/wp-admin/css/install.dev.css b/wp-admin/css/install.dev.css index 6be5ba75..672c011b 100644 --- a/wp-admin/css/install.dev.css +++ b/wp-admin/css/install.dev.css @@ -1,10 +1,12 @@ -html { background: #f7f7f7; } +html { + background: #f9f9f9; +} body { background: #fff; color: #333; font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - margin: 2em auto 0 auto; + margin: 2em auto; width: 700px; padding: 1em 2em; -moz-border-radius: 11px; @@ -14,9 +16,14 @@ body { border: 1px solid #dfdfdf; } -a { color: #2583ad; text-decoration: none; } +a { + color: #2583ad; + text-decoration: none; +} -a:hover { color: #d54e21; } +a:hover { + color: #d54e21; +} h1 { border-bottom: 1px solid #dadada; @@ -28,25 +35,43 @@ h1 { padding-bottom: 7px; } -h2 { font-size: 16px; } +h2 { + font-size: 16px; +} -p, li { +p, li, dd, dt { padding-bottom: 2px; font-size: 12px; line-height: 18px; } -code { font-size: 13px; } - -ul, ol { padding: 5px 5px 5px 22px; } +code, .code { + font-size: 13px; +} -#logo { margin: 6px 0 14px 0; border-bottom: none;} +ul, ol, dl { + padding: 5px 5px 5px 22px; +} +a img { + border:0 +} +abbr { + border: 0; + font-variant: normal; +} +#logo { + margin: 6px 0 14px 0; + border-bottom: none; + text-align:center +} .step { margin: 20px 0 15px; } - -.step, th { text-align: left; padding: 0; } +.step, th { + text-align: left; + padding: 0; +} .submit input, .button, .button-secondary { font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; @@ -80,6 +105,14 @@ ul, ol { padding: 5px 5px 5px 22px; } background: #eee url(../images/white-grad-active.png) repeat-x scroll left top; } +textarea { + border: 1px solid #bbb; + -moz-border-radius: 4px; + -khtml-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} + .form-table { border-collapse: collapse; margin-top: 1em; @@ -98,7 +131,7 @@ ul, ol { padding: 5px 5px 5px 22px; } text-align: left; padding: 16px 10px 10px 10px; border-bottom: 8px solid #fff; - width: 110px; + width: 130px; vertical-align: top; } @@ -122,7 +155,13 @@ ul, ol { padding: 5px 5px 5px 22px; } padding: 2px; } -#error-page { margin-top: 50px; } +.form-table th p { + font-weight: normal; +} + +#error-page { + margin-top: 50px; +} #error-page p { font-size: 12px; @@ -130,4 +169,44 @@ ul, ol { padding: 5px 5px 5px 22px; } margin: 25px 0 20px; } -#error-page code { font-family: Consolas, Monaco, Courier, monospace; } +#error-page code, .code { + font-family: Consolas, Monaco, Courier, monospace; +} + +#pass-strength-result { + background-color: #eee; + border-color: #ddd !important; + border-style: solid; + border-width: 1px; + margin: 5px 5px 5px 1px; + padding: 5px; + text-align: center; + width: 200px; +} + +#pass-strength-result.bad { + background-color: #ffb78c; + border-color: #ff853c !important; +} + +#pass-strength-result.good { + background-color: #ffec8b; + border-color: #ffcc00 !important; +} + +#pass-strength-result.short { + background-color: #ffa0a0; + border-color: #f04040 !important; +} + +#pass-strength-result.strong { + background-color: #c3ff88; + border-color: #8dff1c !important; +} + +.message { + border: 1px solid #e6db55; + padding: 0.3em 0.6em; + margin: 5px 0 15px; + background-color: #ffffe0; +} diff --git a/wp-admin/css/login-rtl.css b/wp-admin/css/login-rtl.css index 4a5c5f0a..11040fae 100644 --- a/wp-admin/css/login-rtl.css +++ b/wp-admin/css/login-rtl.css @@ -1,30 +1 @@ -body { - font-family: Tahoma, arial; -} -form { - margin-right: 8px; - margin-left: 0; -} -form .forgetmenot { - float: right; -} -#login form .submit input { - font-family: Tahoma, arial; -} -form .submit { float: left; } -#backtoblog a { - left: auto; - right: 15px; -} -#login_error, .message { - margin: 0 8px 16px 0; -} -#nav { margin: 0 8px 0 0; } -#user_pass, #user_login, #user_email { - margin-left: 6px; - margin-right: 0; - direction:ltr; -} -h1 a { - text-decoration: none; -} +body{font-family:Tahoma,arial;}form{margin-right:8px;margin-left:0;}form .forgetmenot{float:right;}#login form .submit input{font-family:Tahoma,arial;}form .submit{float:left;}#backtoblog a{padding:8px 15px 0 0;}#login_error,.message{margin:0 8px 16px 0;}#nav{margin:0 8px 0 0;}#user_pass,#user_login,#user_email{margin-left:6px;margin-right:0;direction:ltr;}h1 a{text-decoration:none;} \ No newline at end of file diff --git a/wp-admin/css/login-rtl.dev.css b/wp-admin/css/login-rtl.dev.css new file mode 100644 index 00000000..954b320a --- /dev/null +++ b/wp-admin/css/login-rtl.dev.css @@ -0,0 +1,29 @@ +body { + font-family: Tahoma, arial; +} +form { + margin-right: 8px; + margin-left: 0; +} +form .forgetmenot { + float: right; +} +#login form .submit input { + font-family: Tahoma, arial; +} +form .submit { float: left; } +#backtoblog a { + padding: 8px 15px 0 0; +} +#login_error, .message { + margin: 0 8px 16px 0; +} +#nav { margin: 0 8px 0 0; } +#user_pass, #user_login, #user_email { + margin-left: 6px; + margin-right: 0; + direction:ltr; +} +h1 a { + text-decoration: none; +} diff --git a/wp-admin/css/login.css b/wp-admin/css/login.css index a880c037..c5920596 100644 --- a/wp-admin/css/login.css +++ b/wp-admin/css/login.css @@ -1 +1 @@ -*{margin:0;padding:0;}body{border-top-width:30px;border-top-style:solid;font:11px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}form{margin-left:8px;padding:16px 16px 40px 16px;font-weight:normal;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:5px;background:#fff;border:1px solid #e5e5e5;-moz-box-shadow:rgba(200,200,200,1) 0 4px 18px;-webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px;-khtml-box-shadow:rgba(200,200,200,1) 0 4px 18px;box-shadow:rgba(200,200,200,1) 0 4px 18px;}form .forgetmenot{font-weight:normal;float:left;margin-bottom:0;}.button-primary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;padding:3px 10px;border:none;font-size:12px;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;cursor:pointer;text-decoration:none;margin-top:-3px;}#login form p{margin-bottom:0;}label{color:#777;font-size:13px;}form .forgetmenot label{font-size:11px;line-height:19px;}form .submit,.alignright{float:right;}form p{margin-bottom:24px;}h1 a{background:url(../images/logo-login.gif) no-repeat top center;width:326px;height:67px;text-indent:-9999px;overflow:hidden;padding-bottom:15px;display:block;}#nav{text-shadow:rgba(255,255,255,1) 0 1px 0;}#backtoblog a{position:absolute;top:7px;left:15px;text-decoration:none;}#login{width:320px;margin:7em auto;}#login_error,.message{margin:0 0 16px 8px;border-width:1px;border-style:solid;padding:12px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}#nav{margin:0 0 0 8px;padding:16px;}#user_pass,#user_login,#user_email{font-size:24px;width:97%;padding:3px;margin-top:2px;margin-right:6px;margin-bottom:16px;border:1px solid #e5e5e5;background:#fbfbfb;}input{color:#555;}.clear{clear:both;} \ No newline at end of file +*{margin:0;padding:0;}body{padding-top:30px;font:11px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}form{margin-left:8px;padding:16px 16px 40px 16px;font-weight:normal;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:5px;background:#fff;border:1px solid #e5e5e5;-moz-box-shadow:rgba(200,200,200,1) 0 4px 18px;-webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px;-khtml-box-shadow:rgba(200,200,200,1) 0 4px 18px;box-shadow:rgba(200,200,200,1) 0 4px 18px;}form .forgetmenot{font-weight:normal;float:left;margin-bottom:0;}.button-primary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;padding:3px 10px;border:none;font-size:12px;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;cursor:pointer;text-decoration:none;margin-top:-3px;}#login form p{margin-bottom:0;}label{color:#777;font-size:13px;}form .forgetmenot label{font-size:11px;line-height:19px;}form .submit,.alignright{float:right;}form p{margin-bottom:24px;}h1 a{background:url(../images/logo-login.gif) no-repeat top center;width:326px;height:67px;text-indent:-9999px;overflow:hidden;padding-bottom:15px;display:block;}#nav{text-shadow:rgba(255,255,255,1) 0 1px 0;}#backtoblog{position:absolute;top:0;left:0;border-bottom:#c6c6c6 1px solid;background:#d9d9d9;background:-moz-linear-gradient(bottom,#d7d7d7,#e4e4e4);background:-webkit-gradient(linear,left bottom,left top,from(#d7d7d7),to(#e4e4e4));height:30px;width:100%;}#backtoblog a{text-decoration:none;display:block;padding:8px 0 0 15px;}#login{width:320px;margin:7em auto;}#login_error,.message{margin:0 0 16px 8px;border-width:1px;border-style:solid;padding:12px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}#nav{margin:0 0 0 8px;padding:16px;}#user_pass,#user_login,#user_email{font-size:24px;width:97%;padding:3px;margin-top:2px;margin-right:6px;margin-bottom:16px;border:1px solid #e5e5e5;background:#fbfbfb;}input{color:#555;}.clear{clear:both;} \ No newline at end of file diff --git a/wp-admin/css/login.dev.css b/wp-admin/css/login.dev.css index 842debc1..b2a1f559 100644 --- a/wp-admin/css/login.dev.css +++ b/wp-admin/css/login.dev.css @@ -1,8 +1,7 @@ * { margin: 0; padding: 0; } body { - border-top-width: 30px; - border-top-style: solid; + padding-top: 30px; font: 11px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; } @@ -81,11 +80,22 @@ h1 a { text-shadow: rgba(255,255,255,1) 0 1px 0; } -#backtoblog a { +#backtoblog { position: absolute; - top: 7px; - left: 15px; + top: 0; + left: 0; + border-bottom: #c6c6c6 1px solid; + background: #d9d9d9; /* fallback color */ + background: -moz-linear-gradient(bottom, #d7d7d7, #e4e4e4); + background: -webkit-gradient(linear, left bottom, left top, from(#d7d7d7), to(#e4e4e4)); + height: 30px; + width: 100%; +} + +#backtoblog a { text-decoration: none; + display: block; + padding: 8px 0 0 15px; } #login { width: 320px; margin: 7em auto; } diff --git a/wp-admin/css/media-rtl.css b/wp-admin/css/media-rtl.css index fed86444..5b9e9414 100644 --- a/wp-admin/css/media-rtl.css +++ b/wp-admin/css/media-rtl.css @@ -1,85 +1 @@ -body#media-upload ul#sidemenu { - left: auto; - right: 0; -} -#search-filter { - text-align: left; -} -/* specific to the image upload form */ -.align .field label { - padding: 0 28px 0 0; - margin: 0 0 0 1em; -} -.image-align-none-label, .image-align-left-label, .image-align-center-label, .image-align-right-label { - background-position: center right; -} -tr.image-size div.image-size-item { - float: right; -} -tr.image-size label { - margin: 0 1em 0 0; -} -.filename.original { - float: right; -} -.crunching { - text-align: left; - margin-right: 0; - margin-left: 5px; -} -button.dismiss { - right: auto; - left: 5px; -} -.file-error { - margin: 0 50px 5px 0; -} -.progress { - left: auto; - right: 0; -} -.describe td { - padding: 0 0 0 5px; -} -.bar { - border-right-width: 0; - border-left-width: 3px; - border-right-style: none; - border-left-style: solid; -} - -/* Specific to Uploader */ -#media-upload .media-upload-form p { - margin: 0 0 1em 1em; -} -.filename { - float: right; - margin-left: 0; - margin-right: 10px; -} -#media-upload .describe th.label { - text-align: right; -} -.menu_order { - float: left; -} -.media-upload-form label.form-help, td.help, #media-upload p.help, #media-upload label.help { - font-family: Tahoma, Arial; -} -#gallery-settings #basic th.label { - padding: 5px 0 5px 5px; -} -#gallery-settings .title, h3.media-title { - font-family: Tahoma, Arial; -} -#gallery-settings .describe th.label { - text-align: right; -} -#gallery-settings label, -#gallery-settings legend { - margin-right: 0; - margin-left: 15px; -} -#gallery-settings .align .field label { - margin: 0 0 0 1.5em; -} +body#media-upload ul#sidemenu{left:auto;right:0;}#search-filter{text-align:left;}.align .field label{padding:0 28px 0 0;margin:0 0 0 1em;}.image-align-none-label,.image-align-left-label,.image-align-center-label,.image-align-right-label{background-position:center right;}tr.image-size div.image-size-item{float:right;}tr.image-size label{margin:0 1em 0 0;}.filename.original{float:right;}.crunching{text-align:left;margin-right:0;margin-left:5px;}button.dismiss{right:auto;left:5px;}.file-error{margin:0 50px 5px 0;}.progress{left:auto;right:0;}.describe td{padding:0 0 0 5px;}.bar{border-right-width:0;border-left-width:3px;border-right-style:none;border-left-style:solid;}#media-upload .media-upload-form p{margin:0 0 1em 1em;}.filename{float:right;margin-left:0;margin-right:10px;}#media-upload .describe th.label{text-align:right;}.menu_order{float:left;}.media-upload-form label.form-help,td.help,#media-upload p.help,#media-upload label.help{font-family:Tahoma,Arial;}#gallery-settings #basic th.label{padding:5px 0 5px 5px;}#gallery-settings .title,h3.media-title{font-family:Tahoma,Arial;}#gallery-settings .describe th.label{text-align:right;}#gallery-settings label,#gallery-settings legend{margin-right:0;margin-left:15px;}#gallery-settings .align .field label{margin:0 0 0 1.5em;} \ No newline at end of file diff --git a/wp-admin/css/media-rtl.dev.css b/wp-admin/css/media-rtl.dev.css new file mode 100644 index 00000000..fed86444 --- /dev/null +++ b/wp-admin/css/media-rtl.dev.css @@ -0,0 +1,85 @@ +body#media-upload ul#sidemenu { + left: auto; + right: 0; +} +#search-filter { + text-align: left; +} +/* specific to the image upload form */ +.align .field label { + padding: 0 28px 0 0; + margin: 0 0 0 1em; +} +.image-align-none-label, .image-align-left-label, .image-align-center-label, .image-align-right-label { + background-position: center right; +} +tr.image-size div.image-size-item { + float: right; +} +tr.image-size label { + margin: 0 1em 0 0; +} +.filename.original { + float: right; +} +.crunching { + text-align: left; + margin-right: 0; + margin-left: 5px; +} +button.dismiss { + right: auto; + left: 5px; +} +.file-error { + margin: 0 50px 5px 0; +} +.progress { + left: auto; + right: 0; +} +.describe td { + padding: 0 0 0 5px; +} +.bar { + border-right-width: 0; + border-left-width: 3px; + border-right-style: none; + border-left-style: solid; +} + +/* Specific to Uploader */ +#media-upload .media-upload-form p { + margin: 0 0 1em 1em; +} +.filename { + float: right; + margin-left: 0; + margin-right: 10px; +} +#media-upload .describe th.label { + text-align: right; +} +.menu_order { + float: left; +} +.media-upload-form label.form-help, td.help, #media-upload p.help, #media-upload label.help { + font-family: Tahoma, Arial; +} +#gallery-settings #basic th.label { + padding: 5px 0 5px 5px; +} +#gallery-settings .title, h3.media-title { + font-family: Tahoma, Arial; +} +#gallery-settings .describe th.label { + text-align: right; +} +#gallery-settings label, +#gallery-settings legend { + margin-right: 0; + margin-left: 15px; +} +#gallery-settings .align .field label { + margin: 0 0 0 1.5em; +} diff --git a/wp-admin/css/media.css b/wp-admin/css/media.css index 3ab802f9..bfb35fc4 100644 --- a/wp-admin/css/media.css +++ b/wp-admin/css/media.css @@ -1 +1 @@ -div#media-upload-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em;}body#media-upload ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px;}div#media-upload-error{margin:1em;font-weight:bold;}form{margin:1em;}#search-filter{text-align:right;}th{position:relative;}.media-upload-form label.form-help,td.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}.media-upload-form p.help{margin:0;padding:0;}.media-upload-form fieldset{width:100%;border:none;text-align:justify;margin:0 0 1em 0;padding:0;}.image-align-none-label{background:url(../images/align-none.png) no-repeat center left;}.image-align-left-label{background:url(../images/align-left.png) no-repeat center left;}.image-align-center-label{background:url(../images/align-center.png) no-repeat center left;}.image-align-right-label{background:url(../images/align-right.png) no-repeat center left;}tr.image-size td{width:460px;}tr.image-size div.image-size-item{float:left;width:25%;margin:0;}#library-form .progress,#gallery-form .progress,#flash-upload-ui,.insert-gallery,.describe.startopen,.describe.startclosed{display:none;}.media-item .thumbnail{max-width:128px;max-height:128px;}thead.media-item-info tr{background-color:transparent;}thead.media-item-info th,thead.media-item-info td{border:none;margin:0;}.form-table thead.media-item-info{border:8px solid #fff;}abbr.required{text-decoration:none;border:none;}.describe label{display:inline;}.describe td{vertical-align:middle;padding:0 5px 8px 0;}.describe td.error{padding:2px 8px;}.describe td.A1{width:132px;}.describe input[type="text"],.describe textarea{width:460px;border-width:1px;border-style:solid;}.hidden{height:0;width:0;overflow:hidden;border:none;}#media-upload p.ml-submit{padding:1em 0;}#media-upload p.help,#media-upload label.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}#media-upload tr.image-size td.field{text-align:center;}#media-upload #media-items{border-width:1px;border-style:solid;border-bottom:none;width:623px;}#media-upload .media-item{border-bottom-width:1px;border-bottom-style:solid;min-height:36px;width:100%;}#media-upload .ui-sortable .media-item{cursor:move;}.filename{line-height:36px;padding:0 10px;overflow:hidden;}#media-upload .describe{padding:5px;width:100%;clear:both;cursor:default;}#media-upload .slidetoggle{border-top-width:1px;border-top-style:solid;}#media-upload .describe th.label{padding-top:.2em;text-align:left;min-width:120px;}#media-upload tr.align td.field{text-align:center;}#media-upload tr.image-size{margin-bottom:1em;height:3em;}#media-upload #filter{width:623px;}#media-upload #filter .subsubsub{margin:8px 0;}#filter .tablenav select{border-style:solid;border-width:1px;padding:2px;vertical-align:top;width:auto;}#media-upload .del-attachment{display:none;margin:5px 0;}.menu_order{float:right;font-size:11px;margin:10px 10px 0;}.menu_order_input{border:1px solid #ddd;font-size:10px;padding:1px;width:23px;}.ui-sortable-helper{background-color:#fff;border:1px solid #aaa;opacity:.6;filter:alpha(opacity=60);}#media-upload th.order-head{width:20%;text-align:center;}#media-upload th.actions-head{width:25%;text-align:center;}#media-upload a.wp-post-thumbnail{margin:0 20px;}#media-items a.delete{display:block;float:right;}#media-upload .widefat{width:626px;border-style:solid solid none;}.sorthelper{height:37px;width:623px;display:block;}#gallery-settings th.label{width:160px;}#gallery-settings #basic th.label{padding:5px 5px 5px 0;}#gallery-settings .title{clear:both;padding:0 0 3px;font-size:1.6em;border-bottom:1px solid #DADADA;}h3.media-title{font-size:1.6em;}h4.media-sub-title{border-bottom:1px solid #DADADA;font-size:1.3em;margin:12px;padding:0 0 3px;}#gallery-settings .title,h3.media-title,h4.media-sub-title{font-family:Georgia,"Times New Roman",Times,serif;font-weight:normal;color:#5A5A5A;}#gallery-settings .describe td{vertical-align:middle;height:3em;}#gallery-settings .describe th.label{padding-top:.5em;text-align:left;}#gallery-settings .describe{padding:5px;width:615px;clear:both;cursor:default;}#gallery-settings .describe select{width:15em;}#gallery-settings .describe select option,#gallery-settings .describe td{padding:0;}#gallery-settings label,#gallery-settings legend{font-size:13px;color:#464646;margin-right:15px;}#gallery-settings .align .field label{margin:0 1.5em 0 0;}#gallery-settings p.ml-submit{border-top:1px solid #dfdfdf;}#gallery-settings select#columns{width:6em;}#sort-buttons{font-size:.8em;margin:3px 25px -8px 0;text-align:right;max-width:625px;}#sort-buttons a{text-decoration:none;}#sort-buttons #asc,#sort-buttons #showall{padding-left:5px;}#sort-buttons span{margin-right:25px;} \ No newline at end of file +div#media-upload-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;}body#media-upload ul#sidemenu{font-weight:normal;margin:0 5px;left:0;bottom:-1px;float:none;overflow:hidden;}div#media-upload-error{margin:1em;font-weight:bold;}form{margin:1em;}#search-filter{text-align:right;}th{position:relative;}.media-upload-form label.form-help,td.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}.media-upload-form p.help{margin:0;padding:0;}.media-upload-form fieldset{width:100%;border:none;text-align:justify;margin:0 0 1em 0;padding:0;}.image-align-none-label{background:url(../images/align-none.png) no-repeat center left;}.image-align-left-label{background:url(../images/align-left.png) no-repeat center left;}.image-align-center-label{background:url(../images/align-center.png) no-repeat center left;}.image-align-right-label{background:url(../images/align-right.png) no-repeat center left;}tr.image-size td{width:460px;}tr.image-size div.image-size-item{float:left;width:25%;margin:0;}#library-form .progress,#gallery-form .progress,#flash-upload-ui,.insert-gallery,.describe.startopen,.describe.startclosed{display:none;}.media-item .thumbnail{max-width:128px;max-height:128px;}thead.media-item-info tr{background-color:transparent;}thead.media-item-info th,thead.media-item-info td{border:none;margin:0;}.form-table thead.media-item-info{border:8px solid #fff;}abbr.required{text-decoration:none;border:none;}.describe label{display:inline;}.describe td{vertical-align:middle;padding:0 5px 8px 0;}.describe td.error{padding:2px 8px;}.describe td.A1{width:132px;}.describe input[type="text"],.describe textarea{width:460px;border-width:1px;border-style:solid;}.hidden{height:0;width:0;overflow:hidden;border:none;}#media-upload p.ml-submit{padding:1em 0;}#media-upload p.help,#media-upload label.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}#media-upload tr.image-size td.field{text-align:center;}#media-upload #media-items{border-width:1px;border-style:solid;border-bottom:none;width:623px;}#media-upload .media-item{border-bottom-width:1px;border-bottom-style:solid;min-height:36px;width:100%;}#media-upload .ui-sortable .media-item{cursor:move;}.filename{line-height:36px;padding:0 10px;overflow:hidden;}#media-upload .describe{width:100%;clear:both;cursor:default;}#media-upload .slidetoggle{border-top-width:1px;border-top-style:solid;}#media-upload .describe th.label{padding-top:.2em;text-align:left;min-width:120px;}#media-upload tr.align td.field{text-align:center;}#media-upload tr.image-size{margin-bottom:1em;height:3em;}#media-upload #filter{width:623px;}#media-upload #filter .subsubsub{margin:8px 0;}#filter .tablenav select{border-style:solid;border-width:1px;padding:2px;vertical-align:top;width:auto;}#media-upload .del-attachment{display:none;margin:5px 0;}.menu_order{float:right;font-size:11px;margin:10px 10px 0;}.menu_order_input{border:1px solid #ddd;font-size:10px;padding:1px;width:23px;}.ui-sortable-helper{background-color:#fff;border:1px solid #aaa;opacity:.6;filter:alpha(opacity=60);}#media-upload th.order-head{width:20%;text-align:center;}#media-upload th.actions-head{width:25%;text-align:center;}#media-upload a.wp-post-thumbnail{margin:0 20px;}#media-items a.delete{display:block;float:right;}#media-upload .widefat{width:626px;border-style:solid solid none;}.sorthelper{height:37px;width:623px;display:block;}#gallery-settings th.label{width:160px;}#gallery-settings #basic th.label{padding:5px 5px 5px 0;}#gallery-settings .title{clear:both;padding:0 0 3px;font-size:1.6em;border-bottom:1px solid #DADADA;}h3.media-title{font-size:1.6em;}h4.media-sub-title{border-bottom:1px solid #DADADA;font-size:1.3em;margin:12px;padding:0 0 3px;}#gallery-settings .title,h3.media-title,h4.media-sub-title{font-family:Georgia,"Times New Roman",Times,serif;font-weight:normal;color:#5A5A5A;}#gallery-settings .describe td{vertical-align:middle;height:3em;}#gallery-settings .describe th.label{padding-top:.5em;text-align:left;}#gallery-settings .describe{padding:5px;width:615px;clear:both;cursor:default;}#gallery-settings .describe select{width:15em;}#gallery-settings .describe select option,#gallery-settings .describe td{padding:0;}#gallery-settings label,#gallery-settings legend{font-size:13px;color:#464646;margin-right:15px;}#gallery-settings .align .field label{margin:0 1.5em 0 0;}#gallery-settings p.ml-submit{border-top:1px solid #dfdfdf;}#gallery-settings select#columns{width:6em;}#sort-buttons{font-size:.8em;margin:3px 25px -8px 0;text-align:right;max-width:625px;}#sort-buttons a{text-decoration:none;}#sort-buttons #asc,#sort-buttons #showall{padding-left:5px;}#sort-buttons span{margin-right:25px;} \ No newline at end of file diff --git a/wp-admin/css/media.dev.css b/wp-admin/css/media.dev.css index 1c5e6921..297005c2 100644 --- a/wp-admin/css/media.dev.css +++ b/wp-admin/css/media.dev.css @@ -5,15 +5,15 @@ div#media-upload-header { position: relative; border-bottom-width: 1px; border-bottom-style: solid; - height: 2.5em; } body#media-upload ul#sidemenu { font-weight: normal; margin: 0 5px; - position: absolute; - left: 0px; + left: 0; bottom: -1px; + float: none; + overflow: hidden; } div#media-upload-error { @@ -187,7 +187,6 @@ abbr.required { } #media-upload .describe { - padding: 5px; width: 100%; clear: both; cursor: default; diff --git a/wp-admin/css/ms.css b/wp-admin/css/ms.css new file mode 100644 index 00000000..48152598 --- /dev/null +++ b/wp-admin/css/ms.css @@ -0,0 +1 @@ +#dashboard_right_now p.musub{margin-top:12px;border-top:1px solid #ececec;padding-left:16px;position:static;}#dashboard_right_now td.b a.musublink{font-size:16px;}#dashboard_right_now div.musubtable{border-top:none;}#dashboard_right_now div.musubtable .t{white-space:normal;}.ms-sites-php .postbox h3{cursor:auto;}.ms-sites-php .postbox .description{margin:10px 0 0;padding:0 10px 10px;border-bottom:1px solid #DFDFDF;}tr.site-deleted{background:#ff8573;}tr.site-spammed{background:#faa;}tr.site-archived{background:#ffebe8;}tr.site-mature{background:#fecac2;} \ No newline at end of file diff --git a/wp-admin/css/ms.dev.css b/wp-admin/css/ms.dev.css new file mode 100644 index 00000000..738c834c --- /dev/null +++ b/wp-admin/css/ms.dev.css @@ -0,0 +1,44 @@ +/* Dashboard: MS Specific Data */ +#dashboard_right_now p.musub { + margin-top: 12px; + border-top: 1px solid #ececec; + padding-left: 16px; + position: static; +} + +#dashboard_right_now td.b a.musublink { + font-size: 16px; +} + +#dashboard_right_now div.musubtable { + border-top: none; +} + +#dashboard_right_now div.musubtable .t { + white-space: normal; +} + +/* No drag and drop on ms-sites.php */ +.ms-sites-php .postbox h3 { + cursor: auto; +} + +.ms-sites-php .postbox .description { + margin:10px 0 0px; + padding:0px 10px 10px; + border-bottom:1px solid #DFDFDF; +} + +/* Background Color for Site Status */ +tr.site-deleted { + background: #ff8573; +} +tr.site-spammed { + background: #faa; +} +tr.site-archived { + background:#ffebe8; +} +tr.site-mature { + background: #fecac2; +} diff --git a/wp-admin/css/nav-menu-rtl.css b/wp-admin/css/nav-menu-rtl.css new file mode 100644 index 00000000..9d24ddda --- /dev/null +++ b/wp-admin/css/nav-menu-rtl.css @@ -0,0 +1 @@ +#nav-menus-frame{margin-right:300px;margin-left:0;}#wpbody-content #menu-settings-column{margin-right:-300px;margin-left:0;float:right;}#menu-management-liquid{float:right;}#menu-management{margin-left:20px;margin-right:0;}#post-body{padding:0 10px 10px 0;}.post-body-plain{padding:10px 0 0 10px;}#menu-management .nav-tabs-arrow-left{right:0;left:auto;}#menu-management .nav-tabs-arrow-right{left:0;right:auto;text-align:left;}#menu-management .nav-tabs{padding-right:20px;padding-left:10px;}.js #menu-management .nav-tabs{float:right;margin-right:0;margin-left:-400px;}#select-nav-menu-container{text-align:left;}#wpbody .open-label{float:right;}#wpbody .open-label span{padding-left:10px;padding-right:0;}.js .input-with-default-title{font-style:normal;font-weight:bold;}.postbox .howto input{float:left;}#nav-menu-theme-locations .button-controls{text-align:left;}.meta-sep,.submitdelete,.submitcancel{float:right;}#cancel-save{margin-right:20px;margin-left:0;}.list-controls{float:right;}.add-to-menu{float:left;}#add-custom-link label span{float:right;padding-left:5px;padding-right:0;}.howto span{float:right;}.list li .menu-item-title input{margin-left:3px;margin-right:0;}.menu-item-handle{padding-right:10px;padding-left:0;}.menu-item-edit-active .menu-item-handle{-moz-border-radius:6px 6px 0 0;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0;}.menu-item-handle .item-title{margin-left:13em;margin-right:0;}.menu-item-depth-0{margin-right:0;margin-left:0;}.menu-item-depth-1{margin-right:30px;margin-left:0;}.menu-item-depth-2{margin-right:60px;margin-left:0;}.menu-item-depth-3{margin-right:90px;margin-left:0;}.menu-item-depth-4{margin-right:120px;margin-left:0;}.menu-item-depth-5{margin-right:150px;margin-left:0;}.menu-item-depth-6{margin-right:180px;margin-left:0;}.menu-item-depth-7{margin-right:210px;margin-left:0;}.menu-item-depth-8{margin-right:240px;margin-left:0;}.menu-item-depth-9{margin-right:270px;margin-left:0;}.menu-item-depth-10{margin-right:300px;margin-left:0;}.menu-item-depth-11{margin-right:330px;margin-left:0;}.menu-item-depth-0 .menu-item-transport{margin-right:0;margin-left:0;}.menu-item-depth-1 .menu-item-transport{margin-right:-30px;margin-left:0;}.menu-item-depth-2 .menu-item-transport{margin-right:-60px;margin-left:0;}.menu-item-depth-3 .menu-item-transport{margin-right:-90px;margin-left:0;}.menu-item-depth-4 .menu-item-transport{margin-right:-120px;margin-left:0;}.menu-item-depth-5 .menu-item-transport{margin-right:-150px;margin-left:0;}.menu-item-depth-6 .menu-item-transport{margin-right:-180px;margin-left:0;}.menu-item-depth-7 .menu-item-transport{margin-right:-210px;margin-left:0;}.menu-item-depth-8 .menu-item-transport{margin-right:-240px;margin-left:0;}.menu-item-depth-9 .menu-item-transport{margin-right:-270px;margin-left:0;}.menu-item-depth-10 .menu-item-transport{margin-right:-300px;margin-left:0;}.menu-item-depth-11 .menu-item-transport{margin-right:-330px;margin-left:0;}.item-type{padding-left:10px;padding-right:0;}.item-controls{left:20px;right:auto;}.item-controls .item-order{padding-left:10px;padding-right:0;}.item-edit{background-image:url("../images/menu-bits-rtl.gif?ver=20100531");background-position:100% -105px;left:-20px;right:auto;-moz-border-radius-bottomright:3px;-moz-border-radius-bottomleft:0;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:3px;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:0;}.menu-item-settings{padding:10px 10px 10px 0;border-width:0 1px 1px 1px;}.link-to-original{font-style:normal;font-weight:bold;}.link-to-original a{padding-right:4px;padding-left:0;}.menu-item-settings .description-thin,.menu-item-settings .description-wide{margin-left:10px;margin-right:0;float:right;}.major-publishing-actions .publishing-action{text-align:left;float:left;}.major-publishing-actions .delete-action{text-align:right;float:right;padding-left:15px;padding-right:0;}.menu-name-label{margin-left:15px;margin-right:0;}.auto-add-pages{float:right;} \ No newline at end of file diff --git a/wp-admin/css/nav-menu-rtl.dev.css b/wp-admin/css/nav-menu-rtl.dev.css new file mode 100644 index 00000000..523e2165 --- /dev/null +++ b/wp-admin/css/nav-menu-rtl.dev.css @@ -0,0 +1,206 @@ +#nav-menus-frame { + margin-right: 300px; + margin-left: 0; +} + +#wpbody-content #menu-settings-column { + margin-right: -300px; + margin-left: 0; + float: right; +} + +/* Menu Container */ +#menu-management-liquid { + float: right; +} +#menu-management { + margin-left: 20px; + margin-right: 0; +} + + + #post-body { + padding:0 10px 10px 0; + } + + .post-body-plain { + padding: 10px 0 0 10px; + } + +/* Menu Tabs */ + + #menu-management .nav-tabs-arrow-left { + right: 0; + left:auto; + } + #menu-management .nav-tabs-arrow-right { + left: 0; + right:auto; + text-align: left; + } + +#menu-management .nav-tabs { + padding-right: 20px; + padding-left: 10px; +} +.js #menu-management .nav-tabs { + float: right; + margin-right: 0px; + margin-left: -400px; +} + +#select-nav-menu-container { + text-align: left; +} + +#wpbody .open-label { + float:right; +} + +#wpbody .open-label span { + padding-left: 10px; + padding-right:0; +} + + .js .input-with-default-title { + font-style: normal; + font-weight:bold; + } + +/* Add Menu Item Boxes */ +.postbox .howto input { + float: left; +} +#nav-menu-theme-locations .button-controls { + text-align: left; +} + +/* Button Primary Actions */ + +.meta-sep, +.submitdelete, +.submitcancel { + float:right; +} + +#cancel-save { margin-right: 20px; margin-left: 0; } + +/* Button Secondary Actions */ +.list-controls { float: right; } +.add-to-menu { + float: left; +} + +/* Custom Links */ +#add-custom-link label span { float: right; padding-left: 5px; padding-right:0;} +.howto span { float: right; } + +.list li .menu-item-title input { margin-left: 3px; margin-right: 0 } + +/* Nav Menu */ +.menu-item-handle { + padding-right: 10px; + padding-left: 0; +} +.menu-item-edit-active .menu-item-handle { + -moz-border-radius: 6px 6px 0 0; + -webkit-border-bottom-left-radius: 0; + -webkit-border-bottom-right-radius: 0; + -khtml-border-bottom-left-radius: 0; + -khtml-border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} +.menu-item-handle .item-title { + margin-left:13em; + margin-right:0; +} + + +/* WARNING: The factor of 30px is hardcoded into the nav-menus javascript. */ +.menu-item-depth-0 { margin-right: 0px; margin-left:0;} +.menu-item-depth-1 { margin-right: 30px; margin-left:0;} +.menu-item-depth-2 { margin-right: 60px; margin-left:0;} +.menu-item-depth-3 { margin-right: 90px; margin-left:0;} +.menu-item-depth-4 { margin-right: 120px; margin-left:0;} +.menu-item-depth-5 { margin-right: 150px; margin-left:0;} +.menu-item-depth-6 { margin-right: 180px; margin-left:0;} +.menu-item-depth-7 { margin-right: 210px; margin-left:0;} +.menu-item-depth-8 { margin-right: 240px; margin-left:0;} +.menu-item-depth-9 { margin-right: 270px; margin-left:0;} +.menu-item-depth-10 { margin-right: 300px; margin-left:0;} +.menu-item-depth-11 { margin-right: 330px; margin-left:0;} + +.menu-item-depth-0 .menu-item-transport { margin-right: 0px; margin-left:0;} +.menu-item-depth-1 .menu-item-transport { margin-right: -30px; margin-left:0;} +.menu-item-depth-2 .menu-item-transport { margin-right: -60px; margin-left:0;} +.menu-item-depth-3 .menu-item-transport { margin-right: -90px; margin-left:0;} +.menu-item-depth-4 .menu-item-transport { margin-right: -120px; margin-left:0;} +.menu-item-depth-5 .menu-item-transport { margin-right: -150px; margin-left:0;} +.menu-item-depth-6 .menu-item-transport { margin-right: -180px; margin-left:0;} +.menu-item-depth-7 .menu-item-transport { margin-right: -210px; margin-left:0;} +.menu-item-depth-8 .menu-item-transport { margin-right: -240px; margin-left:0;} +.menu-item-depth-9 .menu-item-transport { margin-right: -270px; margin-left:0;} +.menu-item-depth-10 .menu-item-transport { margin-right: -300px; margin-left:0;} +.menu-item-depth-11 .menu-item-transport { margin-right: -330px; margin-left:0;} + +/* Menu item controls */ +.item-type { padding-left: 10px; padding-right:0;} +.item-controls { left: 20px; right: auto;} +.item-controls .item-order { padding-left: 10px; padding-right: 0;} + +.item-edit { + background-image: url("../images/menu-bits-rtl.gif?ver=20100531"); + background-position: 100% -105px; + left: -20px; + right:auto; + -moz-border-radius-bottomright: 3px; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-right-radius: 3px; + -webkit-border-bottom-left-radius: 0; + -khtml-border-bottom-right-radius: 3px; + -khtml-border-bottom-left-radius: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 0; +} + +/* Menu editing */ +.menu-item-settings { + padding: 10px 10px 10px 0; + border-width: 0 1px 1px 1px; +} + +.link-to-original { + font-style: normal; + font-weight: bold; +} + .link-to-original a { + padding-right: 4px; + padding-left:0; + } + +.menu-item-settings .description-thin, +.menu-item-settings .description-wide { + margin-left: 10px; + margin-right:0; + float: right; +} + +/* Major/minor publishing actions (classes) */ +.major-publishing-actions .publishing-action { + text-align: left; + float: left; +} +.major-publishing-actions .delete-action { + text-align: right; + float: right; + padding-left: 15px; + padding-right:0; +} +.menu-name-label { + margin-left: 15px; + margin-right:0; +} +.auto-add-pages { + float: right; +} \ No newline at end of file diff --git a/wp-admin/css/nav-menu.css b/wp-admin/css/nav-menu.css new file mode 100644 index 00000000..d1714c3c --- /dev/null +++ b/wp-admin/css/nav-menu.css @@ -0,0 +1 @@ +html,body{min-width:950px;}#nav-menus-frame{margin-left:300px;}#wpbody-content #menu-settings-column{display:inline;width:281px;margin-left:-300px;clear:both;float:left;padding-top:24px;}.no-js #wpbody-content #menu-settings-column{padding-top:31px;}#menu-settings-column .inside{clear:both;padding:0 10px;}.metabox-holder-disabled .postbox{opacity:.5;filter:alpha(opacity=50);}.metabox-holder-disabled .button-controls .select-all{display:none;}#wpbody{position:relative;}#menu-management-liquid{float:left;min-width:100%;}#menu-management{position:relative;margin-right:20px;margin-top:-3px;width:100%;}#menu-management .menu-edit{margin-bottom:20px;}#nav-menu-header,#post-body{border-color:#ccc;border-style:solid;}#nav-menu-header{border-width:1px 1px 0 1px;-moz-border-radius-topleft:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-topright:6px;-webkit-border-top-right-radius:6px;-khtml-border-top-right-radius:6px;border-top-right-radius:6px;}#post-body{background:#fff;padding:10px;border-width:0 1px 1px 1px;-moz-border-radius-bottomleft:6px;-webkit-border-bottom-left-radius:6px;-khtml-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-moz-border-radius-bottomright:6px;-webkit-border-bottom-right-radius:6px;-khtml-border-bottom-right-radius:6px;border-bottom-right-radius:6px;}#post-body div.updated{margin:0;}#post-body-content{position:relative;}#menu-management .menu-add-new abbr{font-weight:bold;}#menu-management .nav-tabs-nav{margin:0 20px;}#menu-management .nav-tabs-arrow{width:10px;padding:0 5px 4px;cursor:pointer;position:absolute;top:0;line-height:22px;font-size:18px;text-shadow:0 1px 0 #fff;}#menu-management .nav-tabs-arrow a{color:#C1C1C1;}#menu-management .nav-tabs-arrow a:hover{color:#D54E21;}#menu-management .nav-tabs-arrow a:active{color:#464646;}#menu-management .nav-tabs-arrow-left{left:0;}#menu-management .nav-tabs-arrow-right{right:0;text-align:right;}#menu-management .nav-tabs-wrapper{width:100%;height:28px;margin-bottom:-1px;overflow:hidden;}#menu-management .nav-tabs{padding-left:20px;padding-right:10px;}.js #menu-management .nav-tabs{float:left;margin-left:0;margin-right:-400px;}#menu-management .nav-tab{margin-bottom:0;background:#f4f4f4;font-weight:bold;border-color:#dfdfdf;}#menu-management .nav-tab-active{border-color:#ccc;}#select-nav-menu-container{text-align:right;padding:0 10px 3px 10px;margin-bottom:5px;}#select-nav-menu{width:100px;display:inline;}#menu-name-label{margin-top:-2px;}#wpbody .open-label{display:block;float:left;}#wpbody .open-label span{padding-right:10px;}.js .input-with-default-title{color:#aaa;font-style:italic;}#menu-management .inside{padding:0 10px;}.postbox .howto input{width:180px;float:right;}.customlinkdiv .howto input{width:210px;}#nav-menu-theme-locations .howto select{width:100%;}#nav-menu-theme-locations .button-controls{text-align:right;}.add-menu-item-view-all{height:400px;}#menu-container .submit{margin:0 0 10px;padding:0;}.meta-sep,.submitdelete,.submitcancel{display:block;float:left;font-size:11px;margin:4px 0;line-height:15px;}.meta-sep{padding:0 2px;}#cancel-save{color:#f00;text-decoration:underline;font-size:11px;margin-left:20px;margin-top:5px;}#cancel-save:hover{background-color:#F00;color:#fff;}.list-controls{float:left;margin-top:5px;}.add-to-menu{float:right;}.postbox img.waiting{display:none;vertical-align:middle;}.button-controls{clear:both;margin:10px 0;}.show-all,.hide-all{cursor:pointer;}.hide-all{display:none;}#menu-name{width:270px;}#manage-menu .inside{padding:0;}#available-links dt{display:block;}#add-custom-link .howto{font-size:11px;}#add-custom-link label span{display:block;float:left;margin-top:5px;padding-right:5px;}.menu-item-textbox{width:180px;}.howto span{margin-top:4px;display:block;float:left;}.quick-search{width:190px;}.list-wrap{display:none;clear:both;margin-bottom:10px;}.list-container{max-height:200px;overflow-y:auto;padding:10px 10px 5px;border:1px solid #DFDFDF;-moz-border-radius:4px;}.postbox p.submit{margin-bottom:0;}.list li{display:none;margin:0;margin-bottom:5px;}.list li .menu-item-title{cursor:pointer;display:block;}.list li .menu-item-title input{margin-right:3px;margin-top:-3px;}#menu-container .inside{padding-bottom:10px;}.menu{padding-top:1em;}#menu-to-edit{padding:1em 0;}.menu ul{width:100%;}.menu li{margin-bottom:0;position:relative;}.menu-item-bar{clear:both;line-height:1.5em;position:relative;margin-top:13px;}.menu-item-handle{border:1px solid #E6E6E6;position:relative;padding-left:10px;height:auto;width:400px;line-height:35px;text-shadow:0 1px 0 #FFF;font-weight:bold;overflow:hidden;border-radius:6px;-webkit-border-radius:6px;-moz-border-radius:6px;-khtml-border-radius:6px;word-wrap:break-word;}.menu-item-edit-active .menu-item-handle{-moz-border-radius:6px 6px 0 0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;}.no-js .menu-item-edit-active .item-edit{display:none;}.js .menu-item-handle{cursor:move;}.menu li.deleting .menu-item-handle{background-color:#f66;background-image:none;text-shadow:0 0 0 #ccc;}.menu-item-handle .item-title{padding:7px 0;line-height:20px;display:block;margin-right:13em;}li.menu-item.ui-sortable-helper dl{margin-top:0;}li.menu-item.ui-sortable-helper .menu-item-transport dl{margin-top:13px;}.menu .sortable-placeholder{height:35px;width:410px;margin-top:13px;}.menu-item-depth-0{margin-left:0;}.menu-item-depth-1{margin-left:30px;}.menu-item-depth-2{margin-left:60px;}.menu-item-depth-3{margin-left:90px;}.menu-item-depth-4{margin-left:120px;}.menu-item-depth-5{margin-left:150px;}.menu-item-depth-6{margin-left:180px;}.menu-item-depth-7{margin-left:210px;}.menu-item-depth-8{margin-left:240px;}.menu-item-depth-9{margin-left:270px;}.menu-item-depth-10{margin-left:300px;}.menu-item-depth-11{margin-left:330px;}.menu-item-depth-0 .menu-item-transport{margin-left:0;}.menu-item-depth-1 .menu-item-transport{margin-left:-30px;}.menu-item-depth-2 .menu-item-transport{margin-left:-60px;}.menu-item-depth-3 .menu-item-transport{margin-left:-90px;}.menu-item-depth-4 .menu-item-transport{margin-left:-120px;}.menu-item-depth-5 .menu-item-transport{margin-left:-150px;}.menu-item-depth-6 .menu-item-transport{margin-left:-180px;}.menu-item-depth-7 .menu-item-transport{margin-left:-210px;}.menu-item-depth-8 .menu-item-transport{margin-left:-240px;}.menu-item-depth-9 .menu-item-transport{margin-left:-270px;}.menu-item-depth-10 .menu-item-transport{margin-left:-300px;}.menu-item-depth-11 .menu-item-transport{margin-left:-330px;}body.menu-max-depth-0{min-width:950px!important;}body.menu-max-depth-1{min-width:980px!important;}body.menu-max-depth-2{min-width:1010px!important;}body.menu-max-depth-3{min-width:1040px!important;}body.menu-max-depth-4{min-width:1070px!important;}body.menu-max-depth-5{min-width:1100px!important;}body.menu-max-depth-6{min-width:1130px!important;}body.menu-max-depth-7{min-width:1160px!important;}body.menu-max-depth-8{min-width:1190px!important;}body.menu-max-depth-9{min-width:1220px!important;}body.menu-max-depth-10{min-width:1250px!important;}body.menu-max-depth-11{min-width:1280px!important;}.item-type{text-transform:uppercase;font-size:11px;color:#999;padding-right:10px;}.item-controls{font-size:11px;position:absolute;right:20px;top:-1px;}.item-controls a{text-decoration:none;}.item-controls a:hover{cursor:pointer;}.item-controls .item-order{padding-right:10px;}.item-controls .item-order a{font-weight:bold;}body.js .item-order{display:none;}.item-controls .menu-item-delete:hover{color:#f00;}.item-edit{background:url("../images/menu-bits.gif?ver=20100610") no-repeat scroll 0 -105px;position:absolute;right:-20px;top:0;display:block;width:23px;height:36px;overflow:hidden;text-indent:-999em;border-bottom:1px solid #eee;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}.menu-instructions-inactive{display:none;}.menu-item-settings{background:#F9F9F9;display:block;width:400px;padding:10px 0 10px 10px;border:solid #E6E6E6;border-width:0 1px 1px 1px;-moz-border-radius:0 0 6px 6px;-webkit-border-bottom-right-radius:6px;-webkit-border-bottom-left-radius:6px;-khtml-border-bottom-right-radius:6px;-khtml-border-bottom-left-radius:6px;}.menu-item-edit-active .menu-item-settings{display:block;}.menu-item-edit-inactive .menu-item-settings{display:none;}.add-menu-item-pagelinks{margin:.5em auto;text-align:center;}.link-to-original{display:block;margin:0 0 10px;padding:3px 5px 5px;font-size:11px;color:#777;font-style:italic;border:1px solid #dfdfdf;border-radius:6px;-webkit-border-radius:6px;-moz-border-radius:6px;-khtml-border-radius:6px;}.link-to-original a{padding-left:4px;font-style:normal;}.hidden-field{display:none;}.menu-item-settings .description-thin,.menu-item-settings .description-wide{margin-right:10px;float:left;}.description-thin{width:190px;height:40px;}.description-wide{width:390px;}.menu-item-actions{padding-top:15px;}#cancel-save{cursor:pointer;}#cancel-save:hover{color:#fff!important;}#update-menu-item{color:#fff!important;}#update-menu-item:hover,#update-menu-item:active,#update-menu-item:focus{color:#eaf2fa!important;border-color:#13455b!important;}.major-publishing-actions{clear:both;padding:5px 10px;}.major-publishing-actions .publishing-action{text-align:right;float:right;line-height:23px;margin:5px 0 1px;}.major-publishing-actions .delete-action{vertical-align:middle;text-align:left;float:left;padding-right:15px;margin-top:5px;}.menu-name-label span,.auto-add-pages label{font-size:11px;font-style:normal;}.menu-name-label{margin-right:15px;}.auto-add-pages input{margin-top:0;}.auto-add-pages{margin-top:4px;float:left;}.submitbox .submitcancel{color:#21759B;border-bottom:1px solid #21759B;padding:1px 2px;text-decoration:none;}.submitbox .submitcancel:hover{background:#21759B;color:#fff;}.major-publishing-actions .form-invalid{border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;-khtml-border-radius:4px;padding-left:4px;margin-left:-4px;}#menu-item-name-wrap:after,#menu-item-url-wrap:after,#menu-name-label:after,#menu-settings-column .inside:after,#nav-menus-frame:after,#post-body-content:after,.button-controls:after,.major-publishing-actions:after,.menu-item-settings:after{clear:both;content:".";display:block;height:0;visibility:hidden;}#nav-menus-frame,.button-controls,#menu-item-url-wrap,#menu-item-name-wrap{display:block;} \ No newline at end of file diff --git a/wp-admin/css/nav-menu.dev.css b/wp-admin/css/nav-menu.dev.css new file mode 100644 index 00000000..f1490f7d --- /dev/null +++ b/wp-admin/css/nav-menu.dev.css @@ -0,0 +1,570 @@ +/** + * WordPress Administration Custom Navigation + * Interface CSS + * + * @version 2.0.0 + * + * @package WordPress + * @subpackage Administration + */ + +html, +body { + min-width: 950px; +} + +#nav-menus-frame { + margin-left: 300px; +} + +#wpbody-content #menu-settings-column { + display:inline; + width:281px; + margin-left: -300px; + clear: both; + float: left; + padding-top: 24px; +} + .no-js #wpbody-content #menu-settings-column { + padding-top: 31px; + } + +#menu-settings-column .inside { + clear: both; + padding:0 10px; +} + +.metabox-holder-disabled .postbox { + opacity: 0.5; + filter: alpha(opacity=50); +} + +.metabox-holder-disabled .button-controls .select-all { + display: none; +} +#wpbody { + position: relative; +} + +/* Menu Container */ +#menu-management-liquid { + float: left; + min-width: 100%; +} +#menu-management { + position: relative; + margin-right: 20px; + margin-top: -3px; + width: 100%; +} + #menu-management .menu-edit { + margin-bottom: 20px; + } + + #nav-menu-header, #post-body { + border-color: #ccc; + border-style: solid; + } + + #nav-menu-header { + border-width: 1px 1px 0 1px; + -moz-border-radius-topleft: 6px; + -webkit-border-top-left-radius: 6px; + -khtml-border-top-left-radius: 6px; + border-top-left-radius: 6px; + -moz-border-radius-topright: 6px; + -webkit-border-top-right-radius: 6px; + -khtml-border-top-right-radius: 6px; + border-top-right-radius: 6px; + } + + #post-body { + background: #fff; + padding: 10px; + border-width: 0 1px 1px 1px; + -moz-border-radius-bottomleft: 6px; + -webkit-border-bottom-left-radius: 6px; + -khtml-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -moz-border-radius-bottomright: 6px; + -webkit-border-bottom-right-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + } + + #post-body div.updated { + margin: 0; + } + + #post-body-content { + position: relative; + } + + #menu-management .menu-add-new abbr { + font-weight:bold; + } + +/* Menu Tabs */ + +#menu-management .nav-tabs-nav { + margin: 0 20px; +} + +#menu-management .nav-tabs-arrow { + width: 10px; + padding: 0 5px 4px; + cursor: pointer; + position: absolute; + top: 0; + line-height: 22px; + font-size: 18px; + text-shadow: 0 1px 0 #fff; +} + #menu-management .nav-tabs-arrow a { color: #C1C1C1; } + #menu-management .nav-tabs-arrow a:hover { color: #D54E21; } + #menu-management .nav-tabs-arrow a:active { color: #464646; } + #menu-management .nav-tabs-arrow-left { + left: 0; + } + #menu-management .nav-tabs-arrow-right { + right: 0; + text-align: right; + } + + +#menu-management .nav-tabs-wrapper { + width: 100%; + height: 28px; + margin-bottom: -1px; + overflow: hidden; +} + +#menu-management .nav-tabs { + padding-left: 20px; + padding-right: 10px; +} +.js #menu-management .nav-tabs { + float: left; + margin-left: 0px; + margin-right: -400px; +} + +#menu-management .nav-tab { + margin-bottom: 0; + background: #f4f4f4; + font-weight: bold; + border-color: #dfdfdf; +} + +#menu-management .nav-tab-active { + border-color:#ccc; +} + +#select-nav-menu-container { + text-align: right; + padding: 0 10px 3px 10px; + margin-bottom: 5px; +} + #select-nav-menu { + width: 100px; + display: inline; + } + +#menu-name-label { + margin-top: -2px; +} + +#wpbody .open-label { + display: block; + float:left; +} +#wpbody .open-label span { + padding-right: 10px; +} + + .js .input-with-default-title { + color: #aaa; + font-style: italic; + } + +#menu-management .inside { padding: 0 10px; } + +/* Add Menu Item Boxes */ +.postbox .howto input { + width: 180px; + float: right; +} +.customlinkdiv .howto input { + width: 210px; +} +#nav-menu-theme-locations .howto select { + width: 100%; +} +#nav-menu-theme-locations .button-controls { + text-align: right; +} +.add-menu-item-view-all { + height: 400px; +} + +/* Button Primary Actions */ +#menu-container .submit { margin: 0px 0px 10px; padding: 0px; } + +.meta-sep, +.submitdelete, +.submitcancel { + display:block; + float:left; + font-size: 11px; + margin: 4px 0; + line-height: 15px; +} +.meta-sep { + padding: 0 2px; +} + +#cancel-save { color: #ff0000; text-decoration: underline; font-size: 11px; margin-left: 20px; margin-top: 5px; } +#cancel-save:hover { background-color: #FF0000; color: #fff; } + +/* Button Secondary Actions */ +.list-controls { float: left; margin-top: 5px; } +.add-to-menu { + float: right; +} + +.postbox img.waiting { + display: none; + vertical-align: middle; +} + +.button-controls { + clear:both; + margin: 10px 0; +} +.show-all, .hide-all { cursor: pointer; } +.hide-all { display: none; } + +/* Create Menu */ +#menu-name { width: 270px; } +#manage-menu .inside { padding: 0px 0px; } + +/* Custom Links */ +#available-links dt { display: block; } +#add-custom-link .howto { font-size: 11px; } +#add-custom-link label span { display: block; float: left; margin-top: 5px; padding-right: 5px; } +.menu-item-textbox { width: 180px; } +.howto span { margin-top: 4px; display: block; float: left; } + +/* Menu item types */ +.quick-search { width: 190px; } +.list-wrap { display: none; clear: both; margin-bottom: 10px; } +.list-container { max-height: 200px; overflow-y: auto; padding: 10px 10px 5px; border: 1px solid #DFDFDF; -moz-border-radius: 4px; } +.postbox p.submit { margin-bottom: 0; } + +/* Listings */ +.list li { display: none; margin: 0; margin-bottom: 5px; } + +.list li .menu-item-title { cursor: pointer; display: block; } +.list li .menu-item-title input { margin-right: 3px; margin-top: -3px; } + +/* Nav Menu */ +#menu-container .inside { padding-bottom: 10px; } + +.menu { + padding-top:1em; +} + +#menu-to-edit { + padding: 1em 0; +} + +.menu ul { + width: 100%; +} +.menu ul.sub-menu { +} +.menu li { + margin-bottom: 0; + position:relative; +} +.menu-item-bar { + clear:both; + line-height:1.5em; + position:relative; + margin-top: 13px; +} +.menu-item-handle { + border: 1px solid #E6E6E6; + position: relative; + padding-left: 10px; + height: auto; + width: 400px; + line-height: 35px; + text-shadow: 0 1px 0 #FFFFFF; + font-weight:bold; + overflow: hidden; + border-radius: 6px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + -khtml-border-radius: 6px; + word-wrap: break-word; +} +.menu-item-edit-active .menu-item-handle { + -moz-border-radius: 6px 6px 0 0; + -webkit-border-bottom-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -khtml-border-bottom-right-radius: 0; + -khtml-border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.no-js .menu-item-edit-active .item-edit { + display: none; +} +.js .menu-item-handle { + cursor: move; +} +.menu li.deleting .menu-item-handle { + background-color: #f66; + background-image: none; + text-shadow: 0 0 0 #ccc; +} + +.menu-item-handle .item-title { + padding: 7px 0; + line-height: 20px; + display:block; + margin-right:13em; +} + +/* Sortables */ +li.menu-item.ui-sortable-helper dl { + margin-top: 0; +} + li.menu-item.ui-sortable-helper .menu-item-transport dl { + margin-top: 13px; + } +.menu .sortable-placeholder { + height: 35px; + width: 410px; + margin-top: 13px; +} + +/* WARNING: The factor of 30px is hardcoded into the nav-menus javascript. */ +.menu-item-depth-0 { margin-left: 0px; } +.menu-item-depth-1 { margin-left: 30px; } +.menu-item-depth-2 { margin-left: 60px; } +.menu-item-depth-3 { margin-left: 90px; } +.menu-item-depth-4 { margin-left: 120px; } +.menu-item-depth-5 { margin-left: 150px; } +.menu-item-depth-6 { margin-left: 180px; } +.menu-item-depth-7 { margin-left: 210px; } +.menu-item-depth-8 { margin-left: 240px; } +.menu-item-depth-9 { margin-left: 270px; } +.menu-item-depth-10 { margin-left: 300px; } +.menu-item-depth-11 { margin-left: 330px; } + +.menu-item-depth-0 .menu-item-transport { margin-left: 0px; } +.menu-item-depth-1 .menu-item-transport { margin-left: -30px; } +.menu-item-depth-2 .menu-item-transport { margin-left: -60px; } +.menu-item-depth-3 .menu-item-transport { margin-left: -90px; } +.menu-item-depth-4 .menu-item-transport { margin-left: -120px; } +.menu-item-depth-5 .menu-item-transport { margin-left: -150px; } +.menu-item-depth-6 .menu-item-transport { margin-left: -180px; } +.menu-item-depth-7 .menu-item-transport { margin-left: -210px; } +.menu-item-depth-8 .menu-item-transport { margin-left: -240px; } +.menu-item-depth-9 .menu-item-transport { margin-left: -270px; } +.menu-item-depth-10 .menu-item-transport { margin-left: -300px; } +.menu-item-depth-11 .menu-item-transport { margin-left: -330px; } + +body.menu-max-depth-0 { min-width: 950px !important; } +body.menu-max-depth-1 { min-width: 980px !important; } +body.menu-max-depth-2 { min-width: 1010px !important; } +body.menu-max-depth-3 { min-width: 1040px !important; } +body.menu-max-depth-4 { min-width: 1070px !important; } +body.menu-max-depth-5 { min-width: 1100px !important; } +body.menu-max-depth-6 { min-width: 1130px !important; } +body.menu-max-depth-7 { min-width: 1160px !important; } +body.menu-max-depth-8 { min-width: 1190px !important; } +body.menu-max-depth-9 { min-width: 1220px !important; } +body.menu-max-depth-10 { min-width: 1250px !important; } +body.menu-max-depth-11 { min-width: 1280px !important; } + +/* Menu item controls */ +.item-type { text-transform: uppercase; font-size: 11px; color: #999999; padding-right: 10px; } +.item-controls { font-size: 11px; position: absolute; right: 20px; top: -1px; } +.item-controls a { text-decoration: none; } +.item-controls a:hover { cursor: pointer; } +.item-controls .item-order { padding-right: 10px;} +.item-controls .item-order a { + font-weight:bold; +} + +body.js .item-order { + display:none; +} + +.item-controls .menu-item-delete:hover { color: #ff0000; } + +.item-edit { + background: url("../images/menu-bits.gif?ver=20100610") no-repeat scroll 0 -105px; + position: absolute; + right: -20px; + top: 0; + display: block; + width: 23px; + height: 36px; + overflow: hidden; + text-indent:-999em; + border-bottom: 1px solid #eee; + -moz-border-radius-bottomleft: 3px; + -webkit-border-bottom-left-radius: 3px; + -khtml-border-bottom-left-radius: 3px; + border-bottom-left-radius: 3px; +} + +/* Menu editing */ +.menu-instructions-inactive { + display: none; +} +.menu-item-settings { + background: #F9F9F9; + display:block; + width: 400px; + padding: 10px 0 10px 10px; + border: solid #E6E6E6; + border-width: 0 1px 1px 1px; + -moz-border-radius: 0 0 6px 6px; + -webkit-border-bottom-right-radius: 6px; + -webkit-border-bottom-left-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + -khtml-border-bottom-left-radius: 6px; +} +.menu-item-edit-active .menu-item-settings { + display:block; +} + +.menu-item-edit-inactive .menu-item-settings { + display:none; +} + +.add-menu-item-pagelinks { + margin:.5em auto; + text-align:center; +} + +.link-to-original { + display: block; + margin: 0 0 10px; + padding: 3px 5px 5px; + font-size: 11px; + color: #777; + font-style: italic; + border: 1px solid #dfdfdf; + border-radius: 6px; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + -khtml-border-radius: 6px; +} + .link-to-original a { + padding-left: 4px; + font-style: normal; + } + +.hidden-field { + display: none; +} + +.menu-item-settings .description-thin, +.menu-item-settings .description-wide { + margin-right: 10px; + float: left; +} +.description-thin { + width: 190px; + height: 40px; +} +.description-wide { + width: 390px; +} + +.menu-item-actions { + padding-top: 15px; +} + +#cancel-save { cursor: pointer; } +#cancel-save:hover { color: #fff !important; } +#update-menu-item { color: #fff !important; } +#update-menu-item:hover, +#update-menu-item:active, +#update-menu-item:focus { color: #eaf2fa !important; border-color: #13455b !important; } + +/* Major/minor publishing actions (classes) */ +.major-publishing-actions { + clear:both; + padding: 5px 10px; +} +.major-publishing-actions .publishing-action { + text-align: right; + float: right; + line-height: 23px; + margin: 5px 0 1px; +} +.major-publishing-actions .delete-action { + vertical-align: middle; + text-align: left; + float: left; + padding-right: 15px; + margin-top: 5px; +} +.menu-name-label span, .auto-add-pages label { + font-size: 11px; + font-style: normal; +} +.menu-name-label { + margin-right: 15px; +} +.auto-add-pages input { + margin-top: 0; +} +.auto-add-pages { + margin-top: 4px; + float: left; +} +.submitbox .submitcancel { + color: #21759B; + border-bottom: 1px solid #21759B; + padding: 1px 2px; + text-decoration: none; +} +.submitbox .submitcancel:hover { + background: #21759B; + color: #fff; +} + +.major-publishing-actions .form-invalid { + border-radius: 4px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -khtml-border-radius: 4px; + padding-left: 4px; + margin-left: -4px; +} + +/* Clearfix */ +#menu-item-name-wrap:after, +#menu-item-url-wrap:after, +#menu-name-label:after, +#menu-settings-column .inside:after, +#nav-menus-frame:after, +#post-body-content:after, +.button-controls:after, +.major-publishing-actions:after, +.menu-item-settings:after { + clear: both; + content: "."; + display: block; + height: 0; + visibility: hidden; +} +#nav-menus-frame, .button-controls, #menu-item-url-wrap, #menu-item-name-wrap { display: block; } diff --git a/wp-admin/css/plugin-install-rtl.css b/wp-admin/css/plugin-install-rtl.css index 9a6dd11d..f1ade77e 100644 --- a/wp-admin/css/plugin-install-rtl.css +++ b/wp-admin/css/plugin-install-rtl.css @@ -1,43 +1 @@ -div.star { - left: auto; - right: 0; - letter-spacing: 0; -} -.star img, div.star a, div.star a:hover, div.star a:visited { - right: auto; - left: 0; -} -#plugin-information ul#sidemenu { - left: auto; - right: 0; -} -#plugin-information h2 { - margin-right: 0; - margin-left: 200px; -} -#plugin-information .fyi { - margin-left: 5px; - margin-right: 20px; -} -#plugin-information .fyi h2 { - margin-left: 0; -} -#plugin-information .fyi ul { - padding: 10px 7px 10px 5px; -} -#plugin-information #section-screenshots li p { - padding-left: 0; - padding-right: 20px; -} -#plugin-information .updated, -#plugin-information pre { - margin-right: 0; - margin-left: 215px; -} -#plugin-information .updated, #plugin-information .error { - clear: none; - direction: rtl; -} -#section-description { - direction: ltr; -} +div.star{left:auto;right:0;letter-spacing:0;}.star img,div.star a,div.star a:hover,div.star a:visited{right:auto;left:0;}#plugin-information ul#sidemenu{left:auto;right:0;}#plugin-information h2{margin-right:0;margin-left:200px;}#plugin-information .fyi{margin-left:5px;margin-right:20px;}#plugin-information .fyi h2{margin-left:0;}#plugin-information .fyi ul{padding:10px 7px 10px 5px;}#plugin-information #section-screenshots li p{padding-left:0;padding-right:20px;}#plugin-information .updated,#plugin-information pre{margin-right:0;margin-left:215px;}#plugin-information .updated,#plugin-information .error{clear:none;direction:rtl;}#section-description{direction:ltr;} \ No newline at end of file diff --git a/wp-admin/css/plugin-install-rtl.dev.css b/wp-admin/css/plugin-install-rtl.dev.css new file mode 100644 index 00000000..9a6dd11d --- /dev/null +++ b/wp-admin/css/plugin-install-rtl.dev.css @@ -0,0 +1,43 @@ +div.star { + left: auto; + right: 0; + letter-spacing: 0; +} +.star img, div.star a, div.star a:hover, div.star a:visited { + right: auto; + left: 0; +} +#plugin-information ul#sidemenu { + left: auto; + right: 0; +} +#plugin-information h2 { + margin-right: 0; + margin-left: 200px; +} +#plugin-information .fyi { + margin-left: 5px; + margin-right: 20px; +} +#plugin-information .fyi h2 { + margin-left: 0; +} +#plugin-information .fyi ul { + padding: 10px 7px 10px 5px; +} +#plugin-information #section-screenshots li p { + padding-left: 0; + padding-right: 20px; +} +#plugin-information .updated, +#plugin-information pre { + margin-right: 0; + margin-left: 215px; +} +#plugin-information .updated, #plugin-information .error { + clear: none; + direction: rtl; +} +#section-description { + direction: ltr; +} diff --git a/wp-admin/css/plugin-install.css b/wp-admin/css/plugin-install.css index defbb4f2..a5c27825 100644 --- a/wp-admin/css/plugin-install.css +++ b/wp-admin/css/plugin-install.css @@ -1 +1 @@ -div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.star{height:100%;position:absolute;top:0;left:0;background-color:transparent;letter-spacing:1ex;border:none;}.star1{width:20%;}.star2{width:40%;}.star3{width:60%;}.star4{width:80%;}.star5{width:100%;}.star img,div.star a,div.star a:hover,div.star a:visited{display:block;position:absolute;right:0;border:none;text-decoration:none;}div.star img{width:19px;height:19px;border-left:1px solid #fff;border-right:1px solid #fff;}#plugin-information-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em;}#plugin-information ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px;}#plugin-information p.action-button{width:100%;padding-bottom:0;margin-bottom:0;margin-top:10px;-moz-border-radius:3px 0 0 3px;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}#plugin-information .action-button a{text-align:center;font-weight:bold;text-decoration:none;display:block;line-height:2em;}#plugin-information h2{clear:none!important;margin-right:200px;}#plugin-information .fyi{margin:0 10px 50px;width:210px;}#plugin-information .fyi h2{font-size:.9em;margin-bottom:0;margin-right:0;}#plugin-information .fyi h2.mainheader{padding:5px;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;}#plugin-information .fyi ul{padding:10px 5px 10px 7px;margin:0;list-style:none;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}#plugin-information .fyi li{margin-right:0;}#plugin-information #section-holder{padding:10px;}#plugin-information .section ul,#plugin-information .section ol{margin-left:16px;list-style-type:square;list-style-image:none;}#plugin-information #section-screenshots li img{vertical-align:text-top;}#plugin-information #section-screenshots li p{font-style:italic;padding-left:20px;padding-bottom:2em;}#plugin-information .updated,#plugin-information pre{margin-right:215px;}#plugin-information pre{padding:7px;} \ No newline at end of file +div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.action-links{font-weight:normal;margin:6px 0 0;}div.star{height:100%;position:absolute;top:0;left:0;background-color:transparent;letter-spacing:1ex;border:none;}.star1{width:20%;}.star2{width:40%;}.star3{width:60%;}.star4{width:80%;}.star5{width:100%;}.star img,div.star a,div.star a:hover,div.star a:visited{display:block;position:absolute;right:0;border:none;text-decoration:none;}div.star img{width:19px;height:19px;border-left:1px solid #fff;border-right:1px solid #fff;}table#install-plugins th.num{white-space:nowrap;}#plugin-information-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em;}#plugin-information ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px;}#plugin-information p.action-button{width:100%;padding-bottom:0;margin-bottom:0;margin-top:10px;-moz-border-radius:3px 0 0 3px;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}#plugin-information .action-button a{text-align:center;font-weight:bold;text-decoration:none;display:block;line-height:2em;}#plugin-information h2{clear:none!important;margin-right:200px;}#plugin-information .fyi{margin:0 10px 50px;width:210px;}#plugin-information .fyi h2{font-size:.9em;margin-bottom:0;margin-right:0;}#plugin-information .fyi h2.mainheader{padding:5px;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;}#plugin-information .fyi ul{padding:10px 5px 10px 7px;margin:0;list-style:none;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}#plugin-information .fyi li{margin-right:0;}#plugin-information #section-holder{padding:10px;}#plugin-information .section ul,#plugin-information .section ol{margin-left:16px;list-style-type:square;list-style-image:none;}#plugin-information #section-screenshots li img{vertical-align:text-top;}#plugin-information #section-screenshots li p{font-style:italic;padding-left:20px;padding-bottom:2em;}#plugin-information .updated,#plugin-information pre{margin-right:215px;}#plugin-information pre{padding:7px;} \ No newline at end of file diff --git a/wp-admin/css/plugin-install.dev.css b/wp-admin/css/plugin-install.dev.css index 87fc417c..368f953c 100644 --- a/wp-admin/css/plugin-install.dev.css +++ b/wp-admin/css/plugin-install.dev.css @@ -6,6 +6,11 @@ div.star-holder { font-size: 19px; } +div.action-links { + font-weight: normal; + margin: 6px 0 0; +} + div.star { height: 100%; position: absolute; @@ -37,7 +42,11 @@ div.star img { border-right: 1px solid #fff; } -/* Start custom CSS */ +/* Table layout CSS */ +table#install-plugins th.num { + white-space: nowrap; /* Prevents long plugin titles from causing the version column to wrap */ +} + /* Header on thickbox */ #plugin-information-header { margin: 0; diff --git a/wp-admin/css/press-this-rtl.css b/wp-admin/css/press-this-rtl.css index 9f4a37ef..0f378c62 100644 --- a/wp-admin/css/press-this-rtl.css +++ b/wp-admin/css/press-this-rtl.css @@ -1,128 +1 @@ -body { - font-family: Tahoma, Arial; -} - -#poststuff #edButtonPreview, -#poststuff #edButtonHTML { - margin: 0 0 0 5px; - float: right; -} - -/* Editor/Main Column */ -div#poststuff { - padding-left: 0; - padding-right: 10px; -} - -.posting { - margin-right: 0; - margin-left: 228px; - left: auto; - right: 0; -} - -#side-info-column { - float: left; - right: auto; - left: 0; - margin-right: 0; - margin-left: 10px; -} - -#side-info-column .sleeve { - padding-left: 0; - padding-right: 10px; -} - -h3.tb { - margin-left: 0; - margin-right: 5px; -} - -#actions { - float: left; -} - -#extra_fields #actions { - right: auto; - left: 4px; -} - -#actions li { - float: right; - margin-right: 0; - margin-left: 10px; -} - -#extra_fields .button { - margin-right: 0; - margin-left: 5px; -} - -/* Photo Styles */ -#img_container a { - float: right; -} - -#category-add input, #category-add select { - font-family: Tahoma, Arial; -} - -#categorydiv ul.categorychecklist ul { - margin-left: 0; - margin-right: 18px; -} - -/* Tags */ -#tagsdiv #newtag { - margin-right: 0; - margin-left: 5px; -} - -#tagadd { - margin-left: 0; - margin-right: 3px; -} - -#tagchecklist span { - margin-left: .5em; - margin-right: 10px; - float: right; -} -#tagchecklist span a { - margin: 6px -9px 0 0; - float: right; -} - -#content { - margin-left: 0; - margin-right: 1%; -} - -.submit input, -.button, -.button-primary, -.button-secondary, -.button-highlighted, -#postcustomstuff .submit input { - font-family: Tahoma, Arial, sans-serif; -} - -.ac_results li { - text-align: right; -} - -#TB_ajaxContent #options { - right: auto; - left: 25px; -} - -#post_status { - margin-left: 0; - margin-right: 10px; -} - -/* Footer */ -#footer { - padding: 10px 60px 0 0; -} +body{font-family:Tahoma,Arial;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{margin:0 0 0 5px;float:right;}div#poststuff{padding-left:0;padding-right:10px;}.posting{margin-right:0;margin-left:228px;left:auto;right:0;}#side-info-column{float:left;right:auto;left:0;margin-right:0;margin-left:10px;}#side-info-column .sleeve{padding-left:0;padding-right:10px;}h3.tb{margin-left:0;margin-right:5px;}#actions{float:left;}#extra_fields #actions{right:auto;left:4px;}#actions li{float:right;margin-right:0;margin-left:10px;}#extra_fields .button{margin-right:0;margin-left:5px;}#img_container a{float:right;}#category-add input,#category-add select{font-family:Tahoma,Arial;}.inline-editor ul.cat-checklist ul,.categorydiv ul.categorychecklist ul,#linkcategorydiv ul.categorychecklist ul{margin-left:0;margin-right:18px;}#tagsdiv #newtag{margin-right:0;margin-left:5px;}#tagadd{margin-left:0;margin-right:3px;}#tagchecklist span{margin-left:.5em;margin-right:10px;float:right;}#tagchecklist span a{margin:6px -9px 0 0;float:right;}#content{margin-left:0;margin-right:1%;}.submit input,.button,.button-primary,.button-secondary,.button-highlighted,#postcustomstuff .submit input{font-family:Tahoma,Arial,sans-serif;}.ac_results li{text-align:right;}#TB_ajaxContent #options{right:auto;left:25px;}#post_status{margin-left:0;margin-right:10px;}#footer{padding:10px 60px 0 0;} \ No newline at end of file diff --git a/wp-admin/css/press-this-rtl.dev.css b/wp-admin/css/press-this-rtl.dev.css new file mode 100644 index 00000000..b056591c --- /dev/null +++ b/wp-admin/css/press-this-rtl.dev.css @@ -0,0 +1,130 @@ +body { + font-family: Tahoma, Arial; +} + +#poststuff #edButtonPreview, +#poststuff #edButtonHTML { + margin: 0 0 0 5px; + float: right; +} + +/* Editor/Main Column */ +div#poststuff { + padding-left: 0; + padding-right: 10px; +} + +.posting { + margin-right: 0; + margin-left: 228px; + left: auto; + right: 0; +} + +#side-info-column { + float: left; + right: auto; + left: 0; + margin-right: 0; + margin-left: 10px; +} + +#side-info-column .sleeve { + padding-left: 0; + padding-right: 10px; +} + +h3.tb { + margin-left: 0; + margin-right: 5px; +} + +#actions { + float: left; +} + +#extra_fields #actions { + right: auto; + left: 4px; +} + +#actions li { + float: right; + margin-right: 0; + margin-left: 10px; +} + +#extra_fields .button { + margin-right: 0; + margin-left: 5px; +} + +/* Photo Styles */ +#img_container a { + float: right; +} + +#category-add input, #category-add select { + font-family: Tahoma, Arial; +} + +.inline-editor ul.cat-checklist ul, +.categorydiv ul.categorychecklist ul, +#linkcategorydiv ul.categorychecklist ul { + margin-left: 0; + margin-right: 18px; +} + +/* Tags */ +#tagsdiv #newtag { + margin-right: 0; + margin-left: 5px; +} + +#tagadd { + margin-left: 0; + margin-right: 3px; +} + +#tagchecklist span { + margin-left: .5em; + margin-right: 10px; + float: right; +} +#tagchecklist span a { + margin: 6px -9px 0 0; + float: right; +} + +#content { + margin-left: 0; + margin-right: 1%; +} + +.submit input, +.button, +.button-primary, +.button-secondary, +.button-highlighted, +#postcustomstuff .submit input { + font-family: Tahoma, Arial, sans-serif; +} + +.ac_results li { + text-align: right; +} + +#TB_ajaxContent #options { + right: auto; + left: 25px; +} + +#post_status { + margin-left: 0; + margin-right: 10px; +} + +/* Footer */ +#footer { + padding: 10px 60px 0 0; +} diff --git a/wp-admin/css/press-this.css b/wp-admin/css/press-this.css index 46590f3c..8c72aa77 100644 --- a/wp-admin/css/press-this.css +++ b/wp-admin/css/press-this.css @@ -1 +1 @@ -body{font:13px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;color:#333;margin:0;padding:0;min-width:675px;min-height:400px;}img{border:none;}#wphead{border-top:none;padding-top:4px;background:#444!important;}.tagchecklist span a{background:transparent url(../images/xit.gif) no-repeat 0 0;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;border-style:solid;border-width:1px;cursor:pointer;display:block;height:18px;margin:0 5px 0 0;padding:0 5px 0;font-size:10px;line-height:18px;float:left;}.howto{margin-top:2px;margin-bottom:3px;font-size:11px;font-style:italic;display:block;}input.text{outline-color:-moz-use-text-color;outline-style:none;outline-width:medium;width:100%;}#message{-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}div#poststuff{margin:10px;}div.zerosize{border:0 none;height:0;margin:0;overflow:hidden;padding:0;width:0;}#poststuff #edButtonPreview.active,#poststuff #edButtonHTML.active{display:none;}.posting{margin-right:212px;position:relative;}#side-info-column{float:right;width:200px;position:relative;right:0;}#side-info-column .sleeve{padding-top:5px;}#poststuff .inside{font-size:11px;margin:8px;}#poststuff h2,#poststuff h3{font-size:12px;font-weight:bold;line-height:1;margin:0;padding:7px 9px;}#tagsdiv-post_tag h3,#categorydiv h3{cursor:pointer;}h3.tb{text-shadow:0 1px 0 #fff;font-weight:bold;font-size:12px;margin-left:5px;}#TB_window{border:1px solid #333;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.postbox,.stuffbox{margin-bottom:10px;border-width:1px;border-style:solid;line-height:1;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.stuffbox:hover .handlediv{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;}.handlediv{float:right;height:26px;width:23px;}#title,.tbtitle{-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border-style:solid;border-width:1px;font-size:1.7em;outline:none;padding:3px 4px;border-color:#dfdfdf;}.tbtitle{font-size:12px;padding:3px;}#title{width:97%;}.editor-container{-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:1px solid #dfdfdf;background-color:#fff;}.postdivrich{padding-top:25px;position:relative;}.actions{float:right;margin:-19px 0 0;}#extra-fields .actions{margin:-15px -5px 0 0;}.actions li{float:left;list-style:none;margin-right:10px;}#extra-fields .button{margin-right:5px;padding:3px 6px;border-radius:10px;-webkit-border-radius:10px;-khtml-border-radius:10px;-moz-border-radius:10px;}.photolist{margin-top:-10px;}#photo_saving{margin:0 8px 8px;vertical-align:middle;}#img_container{background-color:#fff;}#img_container_container{overflow:auto;}#extra-fields{margin-top:10px;position:relative;}#waiting{margin-top:10px;}#extra-fields .postbox{margin-bottom:5px;}#extra-fields .titlewrap{padding:0;overflow:auto;height:100px;}#img_container a{display:block;float:left;overflow:hidden;vertical-align:center;}#img_container img,#img_container a{width:68px;height:68px;}#img_container img{border:none;background-color:#f4f4f4;cursor:pointer;}#img_container a,#img_container a:link,#img_container a:visited{border:1px solid #ccc;display:block;position:relative;}#img_container a:hover,#img_container a:active{border-color:#000;z-index:1000;border-width:2px;margin:-1px;}#embed-code{width:100%;height:98px;}#viewsite{padding:0;margin:0 0 20px 5px;font-size:10px;clear:both;}.wp-hidden-children .wp-hidden-child{display:none;}#category-adder{padding:4px 0;}#category-adder h4{margin:0 0 8px;}#category-add input{width:94%;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13px;margin:1px;padding:3px;}#category-add select{width:70%;-x-system-font:none;border-style:solid;border-width:1px;font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-size:12px;height:2em;line-height:20px;padding:2px;margin:1px;vertical-align:top;}#category-add input,#category-add-sumbit{width:auto;}#categorydiv ul,#linkcategorydiv ul{list-style:none;padding:0;margin:0;}#categorydiv ul.categorychecklist ul{margin-left:18px;}#categorydiv div.tabs-panel{height:140px;overflow:auto;}ul.categorychecklist li{margin:0;padding:0;line-height:19px;}.screen-reader-text{display:none;}.tagsdiv .newtag{margin-right:5px;}.jaxtag{clear:both;margin:0;}.tagadd{margin-left:3px;}.tagchecklist{margin-top:3px;margin-bottom:1em;font-size:12px;overflow:auto;}.tagchecklist strong{position:absolute;font-size:.75em;}.tagchecklist span{margin-right:.5em;margin-left:10px;display:block;float:left;font-size:11px;line-height:1.8em;white-space:nowrap;cursor:default;}.tagchecklist span a{margin:6px 0 0 -9px;cursor:pointer;width:10px;height:10px;display:block;float:left;text-indent:-9999px;overflow:hidden;position:absolute;}#content{margin:5px 0;padding:0 5px;border:0 none;height:365px;width:97%!important;}* html .postdivrich{zoom:1;}#saving{display:inline;vertical-align:middle;}.submit input,.button,.button-primary,.button-secondary,.button-highlighted,#postcustomstuff .submit input{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;text-decoration:none;font-size:11px!important;line-height:16px;padding:2px 8px;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;}.button-primary{background:#21759B url(../images/button-grad.png) repeat-x scroll left top;border-color:#21759B;color:#fff;}.ac_results{padding:0;margin:0;list-style:none;position:absolute;z-index:10000;display:none;border-width:1px;border-style:solid;}.ac_results li{padding:2px 5px;white-space:nowrap;text-align:left;}.ac_over{cursor:pointer;}.ac_match{text-decoration:underline;}#TB_ajaxContent #options{position:absolute;top:20px;right:25px;padding:5px;}#TB_ajaxContent h3{margin-bottom:.25em;}.updated{margin:10px 0;padding:0;border-width:1px;border-style:solid;width:99%;}.updated p,.error p{margin:.6em 0;padding:0 .6em;}.error a{text-decoration:underline;}.updated a{text-decoration:none;padding-bottom:2px;}#post_status{margin-left:10px;margin-bottom:1em;display:block;}#footer{height:65px;display:block;width:640px;padding:10px 0 0 60px;margin:0;position:absolute;bottom:0;font-size:12px;}#footer p{margin:0;padding:7px 0;}#footer p a{text-decoration:none;}#footer p a:hover{text-decoration:underline;}.centered{text-align:center;}.hidden{display:none;}.postbox input[type="text"],.postbox textarea,.stuffbox input[type="text"],.stuffbox textarea{border-width:1px;border-style:solid;}.taghint{color:#aaa;margin:-17px 0 0 7px;visibility:hidden;}input.newtag ~ div.taghint{visibility:visible;}input.newtag:focus ~ div.taghint{visibility:hidden;} \ No newline at end of file +body{font:13px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;color:#333;margin:0;padding:0;min-width:675px;min-height:400px;}img{border:none;}#wphead{border-top:none;padding-top:4px;background:#444!important;}.tagchecklist span a{background:transparent url(../images/xit.gif) no-repeat 0 0;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;border-style:solid;border-width:1px;cursor:pointer;display:block;height:18px;margin:0 5px 0 0;padding:0 5px 0;font-size:10px;line-height:18px;float:left;}.howto{margin-top:2px;margin-bottom:3px;font-size:11px;font-style:italic;display:block;}input.text{outline-color:-moz-use-text-color;outline-style:none;outline-width:medium;width:100%;}#message{-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}div#poststuff{margin:10px;}div.zerosize{border:0 none;height:0;margin:0;overflow:hidden;padding:0;width:0;}#poststuff #edButtonPreview.active,#poststuff #edButtonHTML.active{display:none;}.posting{margin-right:212px;position:relative;}#side-info-column{float:right;width:200px;position:relative;right:0;}#side-info-column .sleeve{padding-top:5px;}#poststuff .inside{font-size:11px;margin:8px;}#poststuff h2,#poststuff h3{font-size:12px;font-weight:bold;line-height:1;margin:0;padding:7px 9px;}#tagsdiv-post_tag h3,#categorydiv h3{cursor:pointer;}h3.tb{text-shadow:0 1px 0 #fff;font-weight:bold;font-size:12px;margin-left:5px;}#TB_window{border:1px solid #333;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.postbox,.stuffbox{margin-bottom:10px;border-width:1px;border-style:solid;line-height:1;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.postbox:hover .handlediv,.stuffbox:hover .handlediv{background:transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;}.handlediv{float:right;height:26px;width:23px;}#title,.tbtitle{-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border-style:solid;border-width:1px;font-size:1.7em;outline:none;padding:3px 4px;border-color:#dfdfdf;}.tbtitle{font-size:12px;padding:3px;}#title{width:97%;}.editor-container{-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:1px solid #dfdfdf;background-color:#fff;}.postdivrich{padding-top:25px;position:relative;}.actions{float:right;margin:-19px 0 0;}#extra-fields .actions{margin:-15px -5px 0 0;}.actions li{float:left;list-style:none;margin-right:10px;}#extra-fields .button{margin-right:5px;padding:3px 6px;border-radius:10px;-webkit-border-radius:10px;-khtml-border-radius:10px;-moz-border-radius:10px;}.photolist{margin-top:-10px;}#photo_saving{margin:0 8px 8px;vertical-align:middle;}#img_container{background-color:#fff;}#img_container_container{overflow:auto;}#extra-fields{margin-top:10px;position:relative;}#waiting{margin-top:10px;}#extra-fields .postbox{margin-bottom:5px;}#extra-fields .titlewrap{padding:0;overflow:auto;height:100px;}#img_container a{display:block;float:left;overflow:hidden;vertical-align:center;}#img_container img,#img_container a{width:68px;height:68px;}#img_container img{border:none;background-color:#f4f4f4;cursor:pointer;}#img_container a,#img_container a:link,#img_container a:visited{border:1px solid #ccc;display:block;position:relative;}#img_container a:hover,#img_container a:active{border-color:#000;z-index:1000;border-width:2px;margin:-1px;}#embed-code{width:100%;height:98px;}#viewsite{padding:0;margin:0 0 20px 5px;font-size:10px;clear:both;}.wp-hidden-children .wp-hidden-child{display:none;}.category-add input{width:94%;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:12px;margin:1px;}.category-add select{width:100%;-x-system-font:none;border-style:solid;border-width:1px;font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-size:11px;height:2em;line-height:20px;padding:2px;margin:1px;vertical-align:top;}.category-add input.category-add-sumbit{width:auto;}.categorydiv div.tabs-panel,#linkcategorydiv div.tabs-panel{height:100px;overflow:auto;padding:.5em .9em;border-style:solid;border-width:1px;}.category-tabs li{display:inline;padding-right:8px;}.category-tabs a{text-decoration:none;}.categorydiv ul,#linkcategorydiv ul{list-style:none;padding:0;margin:0;}.inline-editor ul.cat-checklist ul,.categorydiv ul.categorychecklist ul,#linkcategorydiv ul.categorychecklist ul{margin-left:18px;}ul.categorychecklist li{margin:0;padding:0;line-height:19px;}.categorydiv .tabs-panel{border-width:3px;border-style:solid;}ul.category-tabs{margin-top:12px;margin-bottom:6px;}ul.category-tabs li.tabs{border-style:solid solid none;border-width:1px 1px 0;}ul.category-tabs li{padding:5px 8px;-moz-border-radius:3px 3px 0 0;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px;}.screen-reader-text{display:none;}.tagsdiv .newtag{margin-right:5px;}.jaxtag{clear:both;margin:0;}.tagadd{margin-left:3px;}.tagchecklist{margin-top:3px;margin-bottom:1em;font-size:12px;overflow:auto;}.tagchecklist strong{position:absolute;font-size:.75em;}.tagchecklist span{margin-right:.5em;margin-left:10px;display:block;float:left;font-size:11px;line-height:1.8em;white-space:nowrap;cursor:default;}.tagchecklist span a{margin:6px 0 0 -9px;cursor:pointer;width:10px;height:10px;display:block;float:left;text-indent:-9999px;overflow:hidden;position:absolute;}#content{margin:5px 0;padding:0 5px;border:0 none;height:365px;width:97%!important;}* html .postdivrich{zoom:1;}#saving{display:inline;vertical-align:middle;}.submit input,.button,.button-primary,.button-secondary,.button-highlighted,#postcustomstuff .submit input{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;text-decoration:none;font-size:11px!important;line-height:16px;padding:2px 8px;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;}.button-primary{background:#21759B url(../images/button-grad.png) repeat-x scroll left top;border-color:#21759B;color:#fff;}.ac_results{padding:0;margin:0;list-style:none;position:absolute;z-index:10000;display:none;border-width:1px;border-style:solid;}.ac_results li{padding:2px 5px;white-space:nowrap;text-align:left;}.ac_over{cursor:pointer;}.ac_match{text-decoration:underline;}#TB_ajaxContent #options{position:absolute;top:20px;right:25px;padding:5px;}#TB_ajaxContent h3{margin-bottom:.25em;}.updated{margin:10px 0;padding:0;border-width:1px;border-style:solid;width:99%;}.updated p,.error p{margin:.6em 0;padding:0 .6em;}.error a{text-decoration:underline;}.updated a{text-decoration:none;padding-bottom:2px;}#post_status{margin-left:10px;margin-bottom:1em;display:block;}#footer{height:65px;display:block;width:640px;padding:10px 0 0 60px;margin:0;position:absolute;bottom:0;font-size:12px;}#footer p{margin:0;padding:7px 0;}#footer p a{text-decoration:none;}#footer p a:hover{text-decoration:underline;}.centered{text-align:center;}.hidden{display:none;}.postbox input[type="text"],.postbox textarea,.stuffbox input[type="text"],.stuffbox textarea{border-width:1px;border-style:solid;}.taghint{color:#aaa;margin:-17px 0 0 7px;visibility:hidden;}input.newtag ~ div.taghint{visibility:visible;}input.newtag:focus ~ div.taghint{visibility:hidden;} \ No newline at end of file diff --git a/wp-admin/css/press-this.dev.css b/wp-admin/css/press-this.dev.css index 4bb4d5c1..a72ea3e6 100644 --- a/wp-admin/css/press-this.dev.css +++ b/wp-admin/css/press-this.dev.css @@ -1,4 +1,3 @@ - body { font: 13px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; color: #333; @@ -146,8 +145,9 @@ h3.tb { border-radius: 6px; } +.postbox:hover .handlediv, .stuffbox:hover .handlediv { - background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px; + background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px; } .handlediv { @@ -308,29 +308,22 @@ h3.tb { display: none; } -#category-adder { - padding: 4px 0; -} - -#category-adder h4 { - margin: 0 0 8px; -} +/* Categories */ -#category-add input { +.category-add input { width: 94%; - font-family: Verdana,Arial,Helvetica,sans-serif; - font-size: 13px; + font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif; + font-size: 12px; margin: 1px; - padding: 3px; } -#category-add select { - width: 70%; +.category-add select { + width: 100%; -x-system-font: none; border-style: solid; border-width: 1px; font-family: "Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif; - font-size: 12px; + font-size: 11px; height: 2em; line-height: 20px; padding: 2px; @@ -338,34 +331,73 @@ h3.tb { vertical-align: top; } -#category-add input, -#category-add-sumbit { +.category-add input.category-add-sumbit { width: auto; } -/* Categories */ -#categorydiv ul, +.categorydiv div.tabs-panel, +#linkcategorydiv div.tabs-panel { + height: 100px; + overflow: auto; + padding: 0.5em 0.9em; + border-style: solid; + border-width: 1px; +} + +.category-tabs li { + display: inline; + padding-right: 8px; +} + +.category-tabs a { + text-decoration: none; +} + +.categorydiv ul, #linkcategorydiv ul { list-style: none; padding: 0; margin: 0; } -#categorydiv ul.categorychecklist ul { +.inline-editor ul.cat-checklist ul, +.categorydiv ul.categorychecklist ul, +#linkcategorydiv ul.categorychecklist ul { margin-left: 18px; } -#categorydiv div.tabs-panel { - height: 140px; - overflow: auto; -} - ul.categorychecklist li { margin: 0; padding: 0; line-height: 19px; } +.categorydiv .tabs-panel { + border-width: 3px; + border-style: solid; +} + +ul.category-tabs { + margin-top: 12px; + margin-bottom: 6px; +} + +ul.category-tabs li.tabs { + border-style: solid solid none; + border-width: 1px 1px 0; +} + +ul.category-tabs li { + padding: 5px 8px; + -moz-border-radius: 3px 3px 0 0; + -webkit-border-top-left-radius: 3px; + -webkit-border-top-right-radius: 3px; + -khtml-border-top-left-radius: 3px; + -khtml-border-top-right-radius: 3px; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} + /* Tags */ .screen-reader-text { display: none; diff --git a/wp-admin/css/theme-editor-rtl.css b/wp-admin/css/theme-editor-rtl.css index a4dcb46e..23023dff 100644 --- a/wp-admin/css/theme-editor-rtl.css +++ b/wp-admin/css/theme-editor-rtl.css @@ -1,3 +1 @@ -#templateside { - float: left; -} +#templateside{float: left;} diff --git a/wp-admin/css/theme-editor-rtl.dev.css b/wp-admin/css/theme-editor-rtl.dev.css new file mode 100644 index 00000000..a4dcb46e --- /dev/null +++ b/wp-admin/css/theme-editor-rtl.dev.css @@ -0,0 +1,3 @@ +#templateside { + float: left; +} diff --git a/wp-admin/css/theme-editor.css b/wp-admin/css/theme-editor.css index c0bb2dcb..fdfdbbee 100644 --- a/wp-admin/css/theme-editor.css +++ b/wp-admin/css/theme-editor.css @@ -1 +1 @@ -#template textarea{font-family:Consolas,Monaco,Courier,monospace;font-size:12px;width:97%;}#template p{width:97%;}#templateside{float:right;width:190px;word-wrap:break-word;}#templateside h3,#postcustomstuff p.submit{margin:0;}#templateside h4{margin:1em 0 0;}#templateside ol,#templateside ul{margin:.5em;padding:0;}#templateside li{margin:4px 0;}.nonessential{font-size:small;}.highlight{padding:1px;}div.tablenav{margin-right:210px;}#documentation{margin-top:10px;}#documentation label{line-height:22px;vertical-align:top;font-weight:bold;}.fileedit-sub{padding:10px 0 8px;line-height:180%;} \ No newline at end of file +#template textarea{font-family:Consolas,Monaco,Courier,monospace;font-size:12px;width:97%;}#template p{width:97%;}#templateside{float:right;width:190px;word-wrap:break-word;}#templateside h3,#postcustomstuff p.submit{margin:0;}#templateside h4{margin:1em 0 0;}#templateside ol,#templateside ul{margin:.5em;padding:0;}#templateside li{margin:4px 0;}#templateside ul li a span.highlight{display:block;}.nonessential{font-size:11px;font-style:italic;padding-left:12px;}.highlight{padding:3px 3px 3px 12px;margin-left:-12px;font-weight:bold;-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;}div.tablenav{margin-right:210px;}#documentation{margin-top:10px;}#documentation label{line-height:22px;vertical-align:top;font-weight:bold;}.fileedit-sub{padding:10px 0 8px;line-height:180%;} \ No newline at end of file diff --git a/wp-admin/css/theme-editor.dev.css b/wp-admin/css/theme-editor.dev.css index 0a2a554e..17546493 100644 --- a/wp-admin/css/theme-editor.dev.css +++ b/wp-admin/css/theme-editor.dev.css @@ -33,12 +33,24 @@ margin: 4px 0; } +#templateside ul li a span.highlight { + display:block; +} + .nonessential { - font-size: small; + font-size: 11px; + font-style: italic; + padding-left: 12px; } .highlight { - padding: 1px; + padding: 3px 3px 3px 12px; + margin-left: -12px; + font-weight: bold; + -moz-border-radius: 8px; + -khtml-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; } div.tablenav { diff --git a/wp-admin/css/theme-install.css b/wp-admin/css/theme-install.css index 6ce9918b..a54afc74 100644 --- a/wp-admin/css/theme-install.css +++ b/wp-admin/css/theme-install.css @@ -1 +1 @@ -div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.star{height:100%;position:absolute;top:0;left:0;background-color:transparent;letter-spacing:1ex;border:none;}.star1{width:20%;}.star2{width:40%;}.star3{width:60%;}.star4{width:80%;}.star5{width:100%;}.star img,div.star a,div.star a:hover,div.star a:visited{display:block;position:absolute;right:0;border:none;text-decoration:none;}div.star img{width:19px;height:19px;border-left:1px solid #fff;border-right:1px solid #fff;}.theme-listing .theme-item{display:inline-block;width:200px;border:thin solid #ccc;vertical-align:top;}.theme-listing .theme-item h3{text-align:center;font-size:14px;font-style:italic;margin:0;padding:0;}.theme-listing .theme-item img{max-width:150px;max-height:150px;}.theme-listing .theme-item-info span{display:none;}.theme-listing .theme-item:hover .theme-item-info span{display:inline;}.theme-listing .theme-item:hover .theme-item-info span.dots{display:none;}.theme-listing .theme-item-info span.action-links{font-weight:bold;text-align:center;}.theme-listing br.line{border-bottom-width:1px;border-bottom-style:solid;margin-bottom:3px;}.available-theme{padding:20px 15px;}#theme-information .theme-preview-img{float:left;margin:5px 25px 10px 15px;width:300px;}#theme-information .action-button{border-top-width:1px;border-top-style:solid;margin:10px 5px 20px;}#theme-information .action-button #cancel{float:left;margin:10px 15px;}#theme-information .action-button #install{float:right;margin:10px 15px;}#theme-information .available-theme h3{margin:1em 0;}body#theme-information{height:auto;}.feature-filter{-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;border-width:1px;border-style:solid;padding:8px 12px 0;}.feature-filter .feature-group{float:left;margin-bottom:20px;width:695px;}.feature-filter .feature-name{float:left;text-align:right;width:95px;}.feature-filter .feature-group li{display:inline;float:left;list-style-type:none;padding-right:25px;min-width:145px;} \ No newline at end of file +div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.star{height:100%;position:absolute;top:0;left:0;background-color:transparent;letter-spacing:1ex;border:none;}.star1{width:20%;}.star2{width:40%;}.star3{width:60%;}.star4{width:80%;}.star5{width:100%;}.star img,div.star a,div.star a:hover,div.star a:visited{display:block;position:absolute;right:0;border:none;text-decoration:none;}div.star img{width:19px;height:19px;border-left:1px solid #fff;border-right:1px solid #fff;}.theme-listing .theme-item{display:inline-block;width:200px;border:thin solid #ccc;vertical-align:top;}.theme-listing .theme-item h3{text-align:center;font-size:14px;font-style:italic;margin:0;padding:0;}.theme-listing .theme-item img{max-width:150px;max-height:150px;}.theme-listing .theme-item-info span{display:none;}.theme-listing .theme-item:hover .theme-item-info span{display:inline;}.theme-listing .theme-item:hover .theme-item-info span.dots{display:none;}.theme-listing .theme-item-info span.action-links{font-weight:bold;text-align:center;}.theme-listing br.line{border-bottom-width:1px;border-bottom-style:solid;margin-bottom:3px;}.available-theme{padding:20px 15px;}#theme-information .theme-preview-img{float:left;margin:5px 25px 10px 15px;width:300px;}#theme-information .action-button{border-top-width:1px;border-top-style:solid;margin:10px 5px 0;}#theme-information .action-button #cancel{float:left;margin:10px 15px;}#theme-information .action-button #install{float:right;margin:10px 15px;}#theme-information .available-theme h3{margin:1em 0;}body#theme-information{height:auto;}.feature-filter{-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;border-width:1px;border-style:solid;padding:8px 12px 0;}.feature-filter .feature-group{float:left;margin-bottom:20px;width:695px;}.feature-filter .feature-name{float:left;text-align:right;width:95px;}.feature-filter .feature-group li{display:inline;float:left;list-style-type:none;padding-right:25px;min-width:145px;} \ No newline at end of file diff --git a/wp-admin/css/theme-install.dev.css b/wp-admin/css/theme-install.dev.css index 576dec4b..12f0579e 100644 --- a/wp-admin/css/theme-install.dev.css +++ b/wp-admin/css/theme-install.dev.css @@ -60,12 +60,15 @@ div.star img { .theme-listing .theme-item-info span { display: none; } + .theme-listing .theme-item:hover .theme-item-info span { display: inline; } + .theme-listing .theme-item:hover .theme-item-info span.dots { display: none; } + .theme-listing .theme-item-info span.action-links { font-weight: bold; text-align: center; @@ -90,7 +93,7 @@ div.star img { #theme-information .action-button { border-top-width: 1px; border-top-style: solid; - margin: 10px 5px 20px; + margin: 10px 5px 0; } #theme-information .action-button #cancel { diff --git a/wp-admin/css/widgets-rtl.css b/wp-admin/css/widgets-rtl.css index b3499722..4825066c 100644 --- a/wp-admin/css/widgets-rtl.css +++ b/wp-admin/css/widgets-rtl.css @@ -1,11 +1 @@ - -ul#widget-list li.widget-list-item div.widget-description { - margin: 0 200px 0 0; - padding: 0 4em 0 0; -} -.widget-control-save, -.widget-control-remove { - margin-right: 0; - margin-left: 8px; - float: right; -} +ul#widget-list li.widget-list-item div.widget-description{margin:0 200px 0 0;padding:0 4em 0 0;}.widget-control-save,.widget-control-remove{margin-right:0;margin-left:8px;float:right;} \ No newline at end of file diff --git a/wp-admin/css/widgets-rtl.dev.css b/wp-admin/css/widgets-rtl.dev.css new file mode 100644 index 00000000..ffb266d0 --- /dev/null +++ b/wp-admin/css/widgets-rtl.dev.css @@ -0,0 +1,10 @@ +ul#widget-list li.widget-list-item div.widget-description { + margin: 0 200px 0 0; + padding: 0 4em 0 0; +} +.widget-control-save, +.widget-control-remove { + margin-right: 0; + margin-left: 8px; + float: right; +} diff --git a/wp-admin/css/widgets.css b/wp-admin/css/widgets.css index bd15ffa4..44eb420e 100644 --- a/wp-admin/css/widgets.css +++ b/wp-admin/css/widgets.css @@ -1 +1 @@ -html,body{min-width:950px;}div.widget-liquid-left{float:left;clear:left;width:100%;margin-right:-325px;}div#widgets-left{margin-left:5px;margin-right:325px;}div#widgets-right{width:285px;margin:0 auto;}div.widget-liquid-right{float:right;clear:right;width:300px;}.widget-liquid-right .widget,#wp_inactive_widgets .widget,.widget-liquid-right .sidebar-description{width:250px;margin:0 auto 20px;overflow:hidden;}.widget-liquid-right .sidebar-description{margin-bottom:10px;}#wp_inactive_widgets .widget{margin:0 10px 20px;float:left;}div.sidebar-name h3{margin:0;padding:5px 12px;font-size:13px;height:19px;overflow:hidden;white-space:nowrap;}div.sidebar-name{background-repeat:repeat-x;background-position:0 0;cursor:pointer;font-size:13px;border-width:1px;border-style:solid;-moz-border-radius-topleft:8px;-moz-border-radius-topright:8px;-webkit-border-top-right-radius:8px;-webkit-border-top-left-radius:8px;-khtml-border-top-right-radius:8px;-khtml-border-top-left-radius:8px;border-top-right-radius:8px;border-top-left-radius:8px;}.js .closed .sidebar-name{-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;-webkit-border-bottom-right-radius:8px;-webkit-border-bottom-left-radius:8px;-khtml-border-bottom-right-radius:8px;-khtml-border-bottom-left-radius:8px;border-bottom-right-radius:8px;border-bottom-left-radius:8px;}.widget-liquid-right .widgets-sortables,#widgets-left .widget-holder{border-width:0 1px 1px;border-style:none solid solid;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;-webkit-border-bottom-right-radius:8px;-webkit-border-bottom-left-radius:8px;-khtml-border-bottom-right-radius:8px;-khtml-border-bottom-left-radius:8px;border-bottom-right-radius:8px;border-bottom-left-radius:8px;}.js .closed .widgets-sortables,.js .closed .widget-holder{display:none;}.widget-liquid-right .widgets-sortables{padding:15px 0 0;}#available-widgets .widget-holder{padding:7px 5px 0;}#wp_inactive_widgets{padding:5px 5px 0;}#widget-list .widget{width:250px;margin:0 10px 15px;border:0 none;float:left;}#widget-list .widget-description{padding:5px 8px;}#widget-list .widget-top{border-width:1px;border-style:solid;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.widget-placeholder{border-width:1px;border-style:dashed;margin:0 auto 20px;height:26px;width:250px;}#wp_inactive_widgets .widget-placeholder{margin:0 10px 20px;float:left;}div.widgets-holder-wrap{padding:0;margin:10px 0 20px;}#widgets-left #available-widgets{background-color:transparent;border:0 none;}ul#widget-list{list-style:none;margin:0;padding:0;min-height:100px;}.widget .widget-top{font-size:12px;font-weight:bold;height:26px;overflow:hidden;}.widget-top .widget-title{padding:5px 9px;}.widget-top .widget-title-action{float:right;}a.widget-action{display:block;width:24px;height:26px;}#available-widgets a.widget-action{display:none;}.widget-top a.widget-action{background:url("../images/menu-bits.gif") no-repeat scroll 0 -110px;}.widget .widget-inside,.widget .widget-description{padding:12px 12px 10px;font-size:11px;line-height:16px;}.widget-inside,.widget-description{display:none;}#available-widgets .widget-description{display:block;}.widget .widget-inside p{margin:0 0 1em;padding:0;}.widget-title h4{margin:0;line-height:1.3;overflow:hidden;white-space:nowrap;}.widgets-sortables{min-height:90px;}.widget-control-actions{margin-top:8px;}.widget-control-actions a{text-decoration:none;}.widget-control-actions a:hover{text-decoration:underline;}.widget-control-actions .ajax-feedback{padding-bottom:3px;}.widget-control-actions div.alignleft{margin-top:6px;}div#sidebar-info{padding:0 1em;margin-bottom:1em;font-size:11px;}.widget-title a,.widget-title a:hover{text-decoration:none;border-bottom:none;}.widget-control-edit{display:block;font-size:11px;font-weight:normal;line-height:26px;padding:0 8px 0 0;}a.widget-control-edit{text-decoration:none;}.widget-control-edit .add,.widget-control-edit .edit{display:none;}#available-widgets .widget-control-edit .add,#widgets-right .widget-control-edit .edit,#wp_inactive_widgets .widget-control-edit .edit{display:inline;}.editwidget{margin:0 auto 15px;}.editwidget .widget-inside{display:block;border-width:1px;border-style:solid;padding:10px;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.inactive p.description{margin:5px 15px 8px;}#available-widgets p.description{margin:0 12px 12px;}.widget-position{margin-top:8px;}.inactive{padding-top:2px;}.sidebar-name-arrow{float:right;height:29px;width:26px;}.widget-title .in-widget-title{font-size:11px;white-space:nowrap;}#removing-widget{display:none;font-weight:normal;padding-left:15px;font-size:12px;}.widget-control-noform,#access-off,.widgets_access .widget-action,.widgets_access .sidebar-name-arrow,.widgets_access #access-on,.widgets_access .widget-holder .description{display:none;}.widgets_access .widget-holder,.widgets_access #widget-list{padding-top:10px;}.widgets_access #access-off{display:inline;}.widgets_access #wpbody-content .widget-title-action,.widgets_access #wpbody-content .widget-control-edit,.widgets_access .closed .widgets-sortables,.widgets_access .closed .widget-holder{display:block;}.widgets_access .closed .sidebar-name{-moz-border-radius-bottomleft:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;}.widgets_access .sidebar-name,.widgets_access .widget .widget-top{cursor:default;} \ No newline at end of file +html,body{min-width:950px;}div.widget-liquid-left{float:left;clear:left;width:100%;margin-right:-325px;}div#widgets-left{margin-left:5px;margin-right:325px;}div#widgets-right{width:285px;margin:0 auto;}div.widget-liquid-right{float:right;clear:right;width:300px;}.widget-liquid-right .widget,#wp_inactive_widgets .widget,.widget-liquid-right .sidebar-description{width:250px;margin:0 auto 20px;overflow:hidden;}.widget-liquid-right .sidebar-description{margin-bottom:10px;}#wp_inactive_widgets .widget{margin:0 10px 20px;float:left;}div.sidebar-name h3{margin:0;padding:5px 12px;font-size:13px;height:19px;overflow:hidden;white-space:nowrap;}div.sidebar-name{background-repeat:repeat-x;background-position:0 0;cursor:pointer;font-size:13px;border-width:1px;border-style:solid;-moz-border-radius-topleft:8px;-moz-border-radius-topright:8px;-webkit-border-top-right-radius:8px;-webkit-border-top-left-radius:8px;-khtml-border-top-right-radius:8px;-khtml-border-top-left-radius:8px;border-top-right-radius:8px;border-top-left-radius:8px;}.js .closed .sidebar-name{-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;-webkit-border-bottom-right-radius:8px;-webkit-border-bottom-left-radius:8px;-khtml-border-bottom-right-radius:8px;-khtml-border-bottom-left-radius:8px;border-bottom-right-radius:8px;border-bottom-left-radius:8px;}.widget-liquid-right .widgets-sortables,#widgets-left .widget-holder{border-width:0 1px 1px;border-style:none solid solid;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;-webkit-border-bottom-right-radius:8px;-webkit-border-bottom-left-radius:8px;-khtml-border-bottom-right-radius:8px;-khtml-border-bottom-left-radius:8px;border-bottom-right-radius:8px;border-bottom-left-radius:8px;}.js .closed .widgets-sortables,.js .closed .widget-holder{display:none;}.widget-liquid-right .widgets-sortables{padding:15px 0 0;}#available-widgets .widget-holder{padding:7px 5px 0;}#wp_inactive_widgets{padding:5px 5px 0;}#widget-list .widget{width:250px;margin:0 10px 15px;border:0 none;float:left;}#widget-list .widget-description{padding:5px 8px;}#widget-list .widget-top{border-width:1px;border-style:solid;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.widget-placeholder{border-width:1px;border-style:dashed;margin:0 auto 20px;height:26px;width:250px;}#wp_inactive_widgets .widget-placeholder{margin:0 10px 20px;float:left;}div.widgets-holder-wrap{padding:0;margin:10px 0 20px;}#widgets-left #available-widgets{background-color:transparent;border:0 none;}ul#widget-list{list-style:none;margin:0;padding:0;min-height:100px;}.widget .widget-top{font-size:12px;font-weight:bold;height:26px;overflow:hidden;}.widget-top .widget-title{padding:5px 9px;}.widget-top .widget-title-action{float:right;}a.widget-action{display:block;width:24px;height:26px;}#available-widgets a.widget-action{display:none;}.widget-top a.widget-action{background:url("../images/menu-bits.gif?ver=20100610") no-repeat scroll 0 -110px;}.widget .widget-inside,.widget .widget-description{padding:12px 12px 10px;font-size:11px;line-height:16px;}.widget-inside,.widget-description{display:none;}#available-widgets .widget-description{display:block;}.widget .widget-inside p{margin:0 0 1em;padding:0;}.widget-title h4{margin:0;line-height:1.3;overflow:hidden;white-space:nowrap;}.widgets-sortables{min-height:90px;}.widget-control-actions{margin-top:8px;}.widget-control-actions a{text-decoration:none;}.widget-control-actions a:hover{text-decoration:underline;}.widget-control-actions .ajax-feedback{padding-bottom:3px;}.widget-control-actions div.alignleft{margin-top:6px;}div#sidebar-info{padding:0 1em;margin-bottom:1em;font-size:11px;}.widget-title a,.widget-title a:hover{text-decoration:none;border-bottom:none;}.widget-control-edit{display:block;font-size:11px;font-weight:normal;line-height:26px;padding:0 8px 0 0;}a.widget-control-edit{text-decoration:none;}.widget-control-edit .add,.widget-control-edit .edit{display:none;}#available-widgets .widget-control-edit .add,#widgets-right .widget-control-edit .edit,#wp_inactive_widgets .widget-control-edit .edit{display:inline;}.editwidget{margin:0 auto 15px;}.editwidget .widget-inside{display:block;border-width:1px;border-style:solid;padding:10px;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.inactive p.description{margin:5px 15px 8px;}#available-widgets p.description{margin:0 12px 12px;}.widget-position{margin-top:8px;}.inactive{padding-top:2px;}.sidebar-name-arrow{float:right;height:29px;width:26px;}.widget-title .in-widget-title{font-size:11px;white-space:nowrap;}#removing-widget{display:none;font-weight:normal;padding-left:15px;font-size:12px;}.widget-control-noform,#access-off,.widgets_access .widget-action,.widgets_access .sidebar-name-arrow,.widgets_access #access-on,.widgets_access .widget-holder .description{display:none;}.widgets_access .widget-holder,.widgets_access #widget-list{padding-top:10px;}.widgets_access #access-off{display:inline;}.widgets_access #wpbody-content .widget-title-action,.widgets_access #wpbody-content .widget-control-edit,.widgets_access .closed .widgets-sortables,.widgets_access .closed .widget-holder{display:block;}.widgets_access .closed .sidebar-name{-moz-border-radius-bottomleft:0;-moz-border-radius-bottomright:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;}.widgets_access .sidebar-name,.widgets_access .widget .widget-top{cursor:default;} \ No newline at end of file diff --git a/wp-admin/css/widgets.dev.css b/wp-admin/css/widgets.dev.css index 4fa2f7d9..0ce9fd3c 100644 --- a/wp-admin/css/widgets.dev.css +++ b/wp-admin/css/widgets.dev.css @@ -151,8 +151,8 @@ div.widgets-holder-wrap { } #widgets-left #available-widgets { - background-color: transparent; - border: 0 none; + background-color: transparent; + border: 0 none; } ul#widget-list { @@ -178,9 +178,9 @@ ul#widget-list { } a.widget-action { - display: block; - width: 24px; - height: 26px; + display: block; + width: 24px; + height: 26px; } #available-widgets a.widget-action { @@ -188,7 +188,7 @@ a.widget-action { } .widget-top a.widget-action { - background: url("../images/menu-bits.gif") no-repeat scroll 0 -110px; + background: url("../images/menu-bits.gif?ver=20100610") no-repeat scroll 0 -110px; } .widget .widget-inside, @@ -220,11 +220,11 @@ a.widget-action { } .widgets-sortables { - min-height: 90px; + min-height: 90px; } .widget-control-actions { - margin-top: 8px; + margin-top: 8px; } .widget-control-actions a { diff --git a/wp-admin/css/wp-admin-rtl.css b/wp-admin/css/wp-admin-rtl.css new file mode 100644 index 00000000..8f3c6dae --- /dev/null +++ b/wp-admin/css/wp-admin-rtl.css @@ -0,0 +1 @@ +td.available-theme{text-align:right;}#current-theme img{float:right;margin-right:0;margin-left:1em;}.quicktags,.search{font-family:Tahoma,Arial,sans-serif;}#save-post{float:right;}.preview{float:left;}#sticky-span{margin-left:0;margin-right:18px;}#post-body .misc-pub-section{border-right-width:0;border-left-width:1px;border-right-style:none;border-left-style:solid;float:right;}#post-body .misc-pub-section-last{border-left:0;}#delete-action{text-align:right;float:right;}#publishing-action{text-align:left;float:left;}.side-info ul{padding-left:0;padding-right:18px;}.submit input,.button,.button-primary,.button-secondary,.button-highlighted,#postcustomstuff .submit input{font-family:Tahoma,Arial,sans-serif;}#wpcontent select{font-family:Tahoma,Arial,sans-serif;}#quicktags{background-position:right top;}#template div{margin-right:0;margin-left:190px;}* html #template div{margin-left:0;}#your-profile legend{font-family:Tahoma,Arial,sans-serif;}#ajax-response.alignleft{margin-left:0;margin-right:2em;}.page-numbers{margin-right:0;margin-left:1px;}.column-author img,.column-username img{float:right;margin-right:0;margin-left:10px;}.tablenav a.button-secondary{margin:8px 0 0 8px;}.tablenav .tablenav-pages{float:left;}.tablenav .displaying-num{margin-right:0;margin-left:10px;font-family:Tahoma,Arial,sans-serif;}#postcustomstuff table input,#postcustomstuff table select,#postcustomstuff table textarea{margin:8px 8px 8px 0;}#pass-strength-result{float:right;margin:12px 1px 5px 5px;}#user_info{float:left;}#header-logo{float:right;margin:7px 15px 0 0;}#wphead h1{font-family:Tahoma,Arial,sans-serif;float:right;}#wphead h1.long-title{font-family:Tahoma,Arial,sans-serif;}#adminmenu .wp-submenu a{padding-left:0;padding-right:12px;border-width:0 0 0 1px;border-style:none none none solid;font-family:Tahoma,Arial,sans-serif;}#adminmenu a.menu-top,#adminmenu .wp-submenu-head{font-family:Tahoma,Arial,sans-serif;}#adminmenu img.wp-menu-image{float:right;}.folded #adminmenu img.wp-menu-image{padding:7px 6px 0 0;}#adminmenu a.separator{cursor:e-resize;}.folded #adminmenu a.separator{cursor:w-resize;}#adminmenu .wp-submenu .wp-submenu-head{padding:6px 10px 6px 4px;}.folded #adminmenu .wp-submenu{margin:-1px 28px 0 0;}.folded #adminmenu .wp-submenu a{padding-left:0;padding-right:10px;}.folded #adminmenu a.wp-has-submenu{margin-left:0;margin-right:40px;}#adminmenu .wp-menu-toggle{float:left;padding:1px 0 0 2px;clear:left;}#adminmenu div.wp-menu-image{float:right;}#wphead-info{margin:0 15px 0 0;padding-right:0;padding-left:15px;}#adminmenu #awaiting-mod,#adminmenu span.update-plugins,#sidemenu li a span.update-plugins{font-family:Tahoma,Arial,sans-serif;margin-left:0;margin-right:7px;}.post-com-count-wrapper{font-family:Tahoma,Arial,sans-serif;}.column-response .post-com-count{float:right;margin-right:0;margin-left:5px;}.form-table th{text-align:right;}.form-table input.tog{margin-right:0;margin-left:2px;float:right;}.form-table table.color-palette{float:right;}#profile-page .form-table #rich_editing{margin-right:0;margin-left:5px;}#normal-sortables .postbox .submit{float:left;}#post-body .tagsdiv #newtag{margin-right:0;margin-left:5px;}#post-status-info{padding:0 7px 0 15px;}#comment-status-radio input{margin:2px 0 5px 3px;}.tagchecklist{margin-left:0;margin-right:10px;}.tagchecklist strong{margin-left:0;margin-right:-8px;}.tagchecklist span{float:right;}.tagchecklist span a{margin:6px -9px 0 0;float:right;}.ac_results li{text-align:right;}#poststuff h2{clear:right;}.description,.form-wrap p{font-family:Tahoma,Arial,sans-serif;}.autosave-info{padding:2px 2px 2px 15px;text-align:left;}.meta-box-sortables .postbox .handlediv{float:left;}.howto{font-family:Tahoma,Arial,sans-serif;}.postarea h3 label{float:right;}.postarea #add-media-button{float:left;right:auto;left:10px;}.wp_themeSkin tr.mceFirst td.mceToolbar{background-position:right top;}#poststuff #edButtonPreview,#poststuff #edButtonHTML{margin:5px 0 0 5px;float:left;}#poststuff #edButtonHTML{margin-right:0;margin-left:15px;}#media-buttons a{padding:0 10px 5px 0;}.submitbox .submit{text-align:right;}.inside-submitbox #post_status{margin:2px -2px 2px 0;}.submitbox .submit input{margin-right:0;margin-left:4px;}.category-adder{margin-left:0;margin-right:120px;}#post-body ul.category-tabs li.tabs,#post-body ul.add-menu-item-tabs li.tabs{-moz-border-radius:0 3px 3px 0;-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:3px;border-top-left-radius:0;border-top-right-radius:3px;border-bottom-left-radius:0;border-bottom-right-radius:3px;}#post-body ul.category-tabs,#post-body ul.add-menu-item-tabs{float:right;text-align:left;margin:0 0 0 -120px;}#post-body .categorydiv div.tabs-panel,#post-body .taxonomy div.tabs-panel,#post-body #linkcategorydiv div.tabs-panel{margin:0 120px 0 5px;}#front-page-warning,#front-static-pages ul,.inline-editor ul.cat-checklist ul,.categorydiv ul.categorychecklist ul,.customlinkdiv ul.categorychecklist ul,.posttypediv ul.categorychecklist ul,.taxonomydiv ul.categorychecklist ul,#linkcategorydiv ul.categorychecklist ul{margin-left:0;margin-right:18px;}p.search-box{float:left;}#posts-filter fieldset{float:right;margin:0 0 1em 1.5ex;}#posts-filter fieldset legend{padding:0 1px .2em 0;}.view-switch{float:left;}.filter{float:right;margin:-5px 10px 0 0;}#the-comment-list td.comment p.comment-author{margin-right:0;}#the-comment-list p.comment-author img{float:right;margin-right:0;margin-left:8px;}.tablenav .delete{margin-right:0;margin-left:20px;}td.action-links,th.action-links{text-align:left;}.filter .subsubsub{margin-left:0;margin-right:-10px;}#wp-word-count{margin-right:10px;}.tool-box .title{font-family:Tahoma,Arial,sans-serif;}.settings-toggle{text-align:left;margin:5px 0 15px 7px;}.curtime #timestamp{background-position:right top;padding-left:0;padding-right:18px;}#sidemenu{margin:-30px 315px 0 15px;float:left;padding-left:0;padding-right:10px;}#sidemenu a{float:right;}#replysubmit .button{margin-right:0;margin-left:5px;}#edithead .inside{float:right;margin:3px 5px 2px 0;}#replyrow #ed_reply_toolbar input{margin:1px 1px 1px 2px;}#screen-meta-links{margin:0 0 0 18px;}#screen-options-link-wrap,#contextual-help-link-wrap{float:left;font-family:Tahoma,Arial,sans-serif;margin:0 0 0 6px;}#screen-meta a.show-settings{padding:0 6px 0 16px;background-position:left bottom;}.metabox-prefs label{padding-right:0;padding-left:15px;}.metabox-prefs label input{margin:0 2px 0 5px;}.inline-editor .save,.inline-editor .cancel{margin-right:0;margin-left:5px;}#replysubmit img.waiting,.inline-edit-save img.waiting{float:left;}#bulk-titles div a{float:right;margin:3px -2px 0 3px;}#wpbody-content .filename{margin-left:0;margin-right:10px;}#wpbody-content .inline-edit-row fieldset{float:right;}#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col{border-left:0 none;border-right:1px solid;}#wpbody-content .bulk-edit-row .inline-edit-col-bottom{float:left;}.inline-edit-row fieldset label span.title{float:right;}.inline-edit-row fieldset label span.input-text-wrap{margin-left:0;margin-right:5em;}.quick-edit-row-post fieldset.inline-edit-col-right label span.title{padding-right:0;padding-left:.5em;}#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child{margin-right:0;margin-left:.5em;}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{font-family:Tahoma,Arial,sans-serif;}.inline-edit-row fieldset .inline-edit-date{float:right;}.inline-edit-row fieldset ul.cat-checklist label,.inline-edit-row .catshow,.inline-edit-row .cathide,.inline-edit-row #bulk-titles div{font-family:Tahoma,Arial,sans-serif;}.quick-edit-row-post fieldset label.inline-edit-status{float:right;}.describe-toggle-on,.describe-toggle-off{float:left;margin-right:0;margin-left:20px;}#wpbody-content #media-items .filename{float:right;margin-left:0;margin-right:10px;}.media-item .pinkynail{float:right;}#find-posts-response .found-radio{padding:8px 8px 0 0;}.find-box-buttons{left:auto;right:12px;}.find-box-search label{padding-right:0;padding-left:6px;}#favorite-actions{float:left;}#favorite-first{padding:3px 12px 4px 30px;}#favorite-inside a{padding:3px 10px 3px 5px;}#favorite-toggle{right:auto;left:0;background:transparent url(../images/fav-arrow-rtl.gif?ver=20100531) no-repeat 10px -4px;}#utc-time,#local-time{padding-left:0;padding-right:25px;font-family:Tahoma,Arial;}.icon32{float:right;margin:14px 0 0 6px;}.subtitle{padding-left:0;padding-right:25px;}ol{list-style-type:decimal;margin-left:0;margin-right:2em;}.postbox-container{float:right;padding-left:.5%;padding-right:0;}#wpbody-content .describe th{text-align:right;}.describe .media-item-info .A1B1{padding:0 10px 0 0;}.media-upload-form td label{margin-left:6px;margin-right:2px;}.media-upload-form .align .field label{padding:0 22px 0 0;margin:0 0 0 1em;}.media-upload-form tr.image-size label{margin:0 3px 0 0;}#wpbody-content .describe p.help{padding:0 5px 0 0;}.describe-toggle-on,.describe-toggle-off{float:left;margin-left:20px;margin-right:0;}.media-item .pinkynail{float:right;}.crunching{text-align:left;margin-left:5px;margin-right:0;}button.dismiss{right:auto;left:5px;}.file-error{float:right;}.bar{border-left-width:3px;border-left-style:solid;border-right:none;}.clearlooks2 .mceTop .mceLeft{width:100%!important;}.taghint{margin:15px 12px -24px 0;}#poststuff .tagsdiv .howto{margin:0 8px 6px 0;}#broken-themes{text-align:right;}.describe .del-link{padding-right:5px;padding-left:0;}.comment-ays th{border-left-style:solid;border-left-width:1px;}table#available-headers td{padding:0 0 10px 20px;}table#available-headers label input{margin-right:0;margin-left:8px;}#author-email,#author-url,#rss-url-1,#edit-slug-box,#post_name,#trackback_url,#metakeyinput,#post_password,#slug,#category_nicename,#link_url,#link_image,#rss_uri,#menu_order,#email,#newcomment_author_url,#pages-exclude,#template textarea,#user_login,#url,#pass1,#pass2,#aim,#yim,#jabber,#siteurl,#home,#admin_email,#gmt_offset,#default_post_edit_rows,#mailserver_url,#mailserver_login,#mailserver_pass,#mailserver_port,#ping_sites,#posts_per_page,#posts_per_rss,#blog_charset,#close_comments_days_old,#comments_per_page,#comment_max_links,#moderation_keys,#blacklist_keys,#thumbnail_size_w,#thumbnail_size_h,#medium_size_w,#medium_size_h,#large_size_w,#large_size_h,#permalink_structure,#category_base,#tag_base,#upload_path,#upload_url_path,#rules{direction:ltr;}#quicktags #ed_em,#ed_reply_toolbar #ed_reply_em,.tablenav .displaying-num,#footer,#footer a,p.help,p.description,span.description,.form-wrap p,#side-sortables .comments-box thead th,#normal-sortables .comments-box thead th,.howto,.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title,#utc-time,#local-time,form.upgrade .hint,p.install-help,.imgedit-help{font-style:normal;} \ No newline at end of file diff --git a/wp-admin/rtl.dev.css b/wp-admin/css/wp-admin-rtl.dev.css similarity index 76% rename from wp-admin/rtl.dev.css rename to wp-admin/css/wp-admin-rtl.dev.css index 9e988b53..156c14f9 100644 --- a/wp-admin/rtl.dev.css +++ b/wp-admin/css/wp-admin-rtl.dev.css @@ -9,7 +9,7 @@ td.available-theme { margin-left: 1em; } .quicktags, .search { - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; } /* 200 - 500 =================================== */ @@ -25,7 +25,7 @@ td.available-theme { } #post-body .misc-pub-section { border-right-width: 0; - border-left-width: 1; + border-left-width: 1px; border-right-style: none; border-left-style: solid; float: right; @@ -51,10 +51,10 @@ td.available-theme { .button-secondary, .button-highlighted, #postcustomstuff .submit input { - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; } #wpcontent select { - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; } #quicktags { background-position: right top; @@ -69,7 +69,7 @@ td.available-theme { margin-left: 0; } #your-profile legend { - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; } #ajax-response.alignleft { margin-left: 0; @@ -93,7 +93,7 @@ td.available-theme { .tablenav .displaying-num { margin-right: 0; margin-left: 10px; - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; } #postcustomstuff table input, #postcustomstuff table select, @@ -115,22 +115,22 @@ td.available-theme { margin: 7px 15px 0 0; } #wphead h1 { - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; float: right; } #wphead h1.long-title { - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; } #adminmenu .wp-submenu a { padding-left: 0; padding-right: 12px; border-width: 0 0 0 1px; border-style: none none none solid; - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; } #adminmenu a.menu-top, #adminmenu .wp-submenu-head { - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; } #adminmenu img.wp-menu-image { float: right; @@ -177,17 +177,12 @@ td.available-theme { #adminmenu #awaiting-mod, #adminmenu span.update-plugins, #sidemenu li a span.update-plugins { - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; margin-left: 0; - margin-right: 2px; -} -#adminmenu li #awaiting-mod span, -#adminmenu li span.update-plugins span, -#sidemenu li a span.update-plugins span { - float: right; + margin-right: 7px; } .post-com-count-wrapper { - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; } .column-response .post-com-count { float: right; @@ -195,8 +190,7 @@ td.available-theme { margin-left: 5px; } /* Tables used on comment.php and option/setting pages */ -.form-table th, -#wpbody-content .describe th { +.form-table th { text-align: right; } .form-table input.tog { @@ -249,15 +243,19 @@ td.available-theme { clear: right; } .description, .form-wrap p { - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; } /* 1500 - 1800 =================================== */ +.autosave-info { + padding: 2px 2px 2px 15px; + text-align: left; +} .meta-box-sortables .postbox .handlediv { float: left; } .howto { - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; } .postarea h3 label { float: right; @@ -294,11 +292,12 @@ td.available-theme { margin-left: 4px; } /* Categories */ -#category-adder { +.category-adder { margin-left: 0; margin-right: 120px; } -#post-body ul#category-tabs li.tabs { +#post-body ul.category-tabs li.tabs, +#post-body ul.add-menu-item-tabs li.tabs { -moz-border-radius: 0 3px 3px 0; -webkit-border-top-left-radius: 0; -webkit-border-top-right-radius: 3px; @@ -309,23 +308,27 @@ td.available-theme { border-bottom-left-radius: 0; border-bottom-right-radius: 3px; } -#post-body ul#category-tabs { +#post-body ul.category-tabs, +#post-body ul.add-menu-item-tabs { float: right; text-align: left; margin: 0 0 0 -120px; } -#post-body #categorydiv div.tabs-panel, +#post-body .categorydiv div.tabs-panel, +#post-body .taxonomy div.tabs-panel, #post-body #linkcategorydiv div.tabs-panel { margin: 0 120px 0 5px; } /* 1800 - 2000 =================================== */ -#side-sortables #category-tabs li { - padding-right: 0; - padding-left: 8px; -} -#categorydiv ul.categorychecklist ul, -#linkcategorydiv ul.categorychecklist ul { +#front-page-warning, +#front-static-pages ul, +.inline-editor ul.cat-checklist ul, +.categorydiv ul.categorychecklist ul, +.customlinkdiv ul.categorychecklist ul, +.posttypediv ul.categorychecklist ul, +.taxonomydiv ul.categorychecklist ul, +#linkcategorydiv ul.categorychecklist ul{ margin-left: 0; margin-right: 18px; } @@ -372,7 +375,7 @@ td.action-links, th.action-links { margin-right: 10px; } .tool-box .title { - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; } .settings-toggle { text-align: left; @@ -408,14 +411,18 @@ td.action-links, th.action-links { } /* show/hide settings */ #screen-meta-links { - margin: 0 0 0 9px; + margin: 0 0 0 18px; } #screen-options-link-wrap, #contextual-help-link-wrap { float: left; - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; margin: 0 0 0 6px; } +#screen-meta a.show-settings { + padding: 0 6px 0 16px; + background-position: left bottom; +} .metabox-prefs label { padding-right: 0; padding-left: 15px; @@ -428,6 +435,10 @@ td.action-links, th.action-links { margin-right: 0; margin-left: 5px; } +#replysubmit img.waiting, +.inline-edit-save img.waiting { + float: left; +} /* 2500 - 2700 =================================== */ #bulk-titles div a { @@ -476,7 +487,7 @@ td.action-links, th.action-links { .inline-edit-row .catshow, .inline-edit-row .cathide, .inline-edit-row #bulk-titles div { - font-family: Tahoma, Arial, sans-serif; + font-family: Tahoma, Arial, sans-serif; } .quick-edit-row-post fieldset label.inline-edit-status { float: right; @@ -520,7 +531,7 @@ td.action-links, th.action-links { #favorite-toggle { right: auto; left: 0; - background:transparent url(images/fav-arrow-rtl.gif) no-repeat 10px -4px; + background:transparent url(../images/fav-arrow-rtl.gif?ver=20100531) no-repeat 10px -4px; } #utc-time, #local-time { padding-left: 0; @@ -548,13 +559,114 @@ ol { padding-right: 0; } +/* Media library */ +#wpbody-content .describe th { + text-align: right; +} + +.describe .media-item-info .A1B1 { + padding: 0 10px 0 0; +} + +.media-upload-form td label { + margin-left: 6px; + margin-right: 2px; +} + +.media-upload-form .align .field label { + padding: 0 22px 0 0; + margin: 0 0 0 1em; +} + +.media-upload-form tr.image-size label { + margin: 0 3px 0 0 ; +} + +#wpbody-content .describe p.help { + padding: 0 5px 0 0 ; +} + +.describe-toggle-on, +.describe-toggle-off { + float: left; + margin-left: 20px; + margin-right: 0; +} + +.media-item .pinkynail { + float: right; +} + +.crunching { + text-align: left; + margin-left: 5px; + margin-right: 0; +} + +button.dismiss { + right: auto; + left: 5px; +} + +.file-error { + float: right; +} + +.bar { + border-left-width: 3px; + border-left-style: solid; + border-right: none; +} + + /* TinyMCE =================================== */ .clearlooks2 .mceTop .mceLeft { width:100% !important; } + +/* tag hints */ +.taghint { + margin: 15px 12px -24px 0; +} + +#poststuff .tagsdiv .howto { + margin: 0 8px 6px 0; +} + +#broken-themes { + text-align: right; +} + +.describe .del-link { + padding-right: 5px; + padding-left: 0; +} + +.comment-ays th { + border-left-style: solid; + border-left-width: 1px; +} + +/* Custom Header */ +table#available-headers td { + padding: 0 0 10px 20px; +} +table#available-headers label input { + margin-right: 0; + margin-left: 8px; +} + /* ltr =================================== */ #author-email, #author-url, #rss-url-1, #edit-slug-box, #post_name, #trackback_url, #metakeyinput, #post_password, #slug, #category_nicename, #link_url, #link_image, #rss_uri, #menu_order, #email, #newcomment_author_url, #pages-exclude, #template textarea, #user_login, #url, #pass1, #pass2, #aim, #yim, #jabber, #siteurl, #home, #admin_email, #gmt_offset, #default_post_edit_rows, #mailserver_url, #mailserver_login, #mailserver_pass, #mailserver_port, #ping_sites, #posts_per_page, #posts_per_rss, #blog_charset, #close_comments_days_old, #comments_per_page, #comment_max_links, #moderation_keys, #blacklist_keys, #thumbnail_size_w, #thumbnail_size_h, #medium_size_w, #medium_size_h, #large_size_w, #large_size_h, #permalink_structure, #category_base, #tag_base, #upload_path, #upload_url_path, #rules { direction: ltr; } + +/* no italic +=================================== */ + +#quicktags #ed_em, #ed_reply_toolbar #ed_reply_em, .tablenav .displaying-num, #footer, #footer a, p.help, p.description, span.description, .form-wrap p, #side-sortables .comments-box thead th, +#normal-sortables .comments-box thead th, .howto, .inline-edit-row fieldset span.title, .inline-edit-row fieldset span.checkbox-title, #utc-time, #local-time, form.upgrade .hint, p.install-help, .imgedit-help { + font-style: normal; +} diff --git a/wp-admin/css/wp-admin.css b/wp-admin/css/wp-admin.css new file mode 100644 index 00000000..a7a2dbf9 --- /dev/null +++ b/wp-admin/css/wp-admin.css @@ -0,0 +1 @@ +textarea,input[type="text"],input[type="password"],input[type="file"],input[type="button"],input[type="submit"],input[type="reset"],select{border-width:1px;border-style:solid;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}p,ul,ol,blockquote,input,select{font-size:12px;}select option{padding:2px;}.plugins .name,#pass-strength-result.strong,#pass-strength-result.short,.button-highlighted,input.button-highlighted,#quicktags #ed_strong,#ed_reply_toolbar #ed_reply_strong{font-weight:bold;}.plugins p{margin:0 4px;padding:0;}.plugins .desc p{margin:0 0 8px;}.plugins td.desc{line-height:1.5em;}.plugins .desc ul,.plugins .desc ol{margin:0 0 0 2em;}.plugins .desc ul{list-style-type:disc;}.plugins .action-links{white-space:nowrap;}.plugins .row-actions-visible{padding:0;}.widefat tbody.plugins th.check-column{padding:7px 0;}.widefat .plugins td,.widefat .plugins th{border-bottom:0 none;}#install-plugins .plugins td,#install-plugins .plugins th{border-bottom-style:solid;border-bottom-width:1px;}.plugins .inactive td,.plugins .inactive th,.plugins .active td,.plugins .active th{border-top-style:solid;border-top-width:1px;padding:5px 7px 0;}#wpbody-content .plugins .plugin-title{padding-right:12px;}.plugins .second td,.plugins .second th{border-top:0 none;padding:0 7px 5px;}.plugins-php .widefat tfoot th,.plugins-php .widefat tfoot td{border-top-style:solid;border-top-width:1px;}.import-system{font-size:16px;}.anchors{margin:10px 20px 10px 20px;}table#availablethemes{border-spacing:0;border-width:1px 0;border-style:solid none;margin:10px auto;width:100%;}td.available-theme{vertical-align:top;width:240px;margin:0;padding:20px;text-align:left;}table#availablethemes td{border-width:0 1px 1px;border-style:none solid solid;}table#availablethemes td.right,table#availablethemes td.left{border-right:0 none;border-left:0 none;}table#availablethemes td.bottom{border-bottom:0 none;}.available-theme a.screenshot{width:240px;height:180px;display:block;border-width:1px;border-style:solid;margin-bottom:10px;overflow:hidden;}.available-theme img{width:240px;}.available-theme h3{margin:15px 0 5px;}#current-theme{margin:1em 0 1.5em;}#current-theme a{border-bottom:none;}#current-theme h3{font-size:17px;font-weight:normal;margin:0;}#current-theme .theme-description{margin-top:5px;}#current-theme img{float:left;border-width:1px;border-style:solid;margin-right:1em;margin-bottom:1.5em;width:150px;}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{font-weight:bold;text-decoration:none;}#TB_window #TB_title{background-color:#222;color:#cfcfcf;}.checkbox{border:none;margin:0;padding:0;}.code,code{font-family:Consolas,Monaco,Courier,monospace;}kbd,code{padding:1px 3px;margin:0 1px;font-size:11px;}.commentlist li{padding:1em 1em .2em;margin:0;border-bottom-width:1px;border-bottom-style:solid;}.commentlist li li{border-bottom:0;padding:0;}.commentlist p{padding:0;margin:0 0 .8em;}.post-categories{display:inline;margin:0;padding:0;}.post-categories li{display:inline;}.quicktags,.search{font:12px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}.submit{padding:1.5em 0;margin:5px 0;-moz-border-radius:0 0 3px 3px;-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;-khtml-border-bottom-left-radius:3px;-khtml-border-bottom-right-radius:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px;}form p.submit a.cancel:hover{text-decoration:none;}#submitdiv h3{margin-bottom:0!important;}#misc-publishing-actions{padding:6px 0 16px 0;}.misc-pub-section{padding:6px;border-bottom-width:1px;border-bottom-style:solid;}.misc-pub-section-last{border-bottom:0 none;}#minor-publishing-actions{padding:6px;text-align:right;}#minor-publishing{border-bottom-width:1px;border-bottom-style:solid;}#save-post{float:left;}.preview{float:right;}#major-publishing-actions{padding:6px;clear:both;border-top:none;}#minor-publishing-actions input,#major-publishing-actions input,#minor-publishing-actions .preview{min-width:80px;text-align:center;}#delete-action{line-height:25px;vertical-align:middle;text-align:left;float:left;}#publishing-action{text-align:right;float:right;line-height:23px;}#post-body #minor-publishing{padding-bottom:10px;}#post-body #misc-publishing-actions{padding:0;}#post-body .misc-pub-section{border-right-width:1px;border-right-style:solid;border-bottom:0 none;min-height:30px;float:left;max-width:32%;}#post-body .misc-pub-section-last{border-right:0;}#sticky-span{margin-left:18px;}#post-status-display,#post-visibility-display{font-weight:bold;}.side-info{margin:0;padding:4px;font-size:11px;}.side-info h5{padding-bottom:7px;font-size:14px;margin:12px 2px 5px;border-bottom-width:1px;border-bottom-style:solid;}.side-info ul{margin:0;padding-left:18px;list-style:square;}.submit input,.button,input.button,.button-primary,input.button-primary,.button-secondary,input.button-secondary,.button-highlighted,input.button-highlighted,#postcustomstuff .submit input{text-decoration:none;font-size:11px!important;line-height:13px;padding:3px 8px;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}a.button,a.button-primary,a.button-secondary{line-height:15px;padding:3px 10px;white-space:nowrap;-webkit-border-radius:10px;}#doaction,#doaction2,#post-query-submit{margin-right:8px;}.tablenav select[name="action"],.tablenav select[name="action2"]{width:130px;}.tablenav select[name="m"]{width:155px;}.tablenav select#cat{width:170px;}#wpcontent select{padding:2px;height:2em;font-size:11px;}#wpcontent option{padding:2px;}#timezone_string option{margin-left:1em;}.approve{display:none;}.unapproved .approve,.spam .approve,.trash .approve{display:inline;}.unapproved .unapprove{display:none;}.narrow{width:70%;margin-bottom:40px;}.narrow p{line-height:150%;}textarea.all-options,input.all-options{width:250px;}#namediv table{width:100%;}#namediv td.first{width:10px;white-space:nowrap;}#namediv input{width:98%;}#namediv p{margin:10px 0;}#wpbody-content .metabox-holder{padding-top:10px;}#content{margin:0;width:100%;}#editorcontainer #content{padding:6px;line-height:150%;border:0 none;outline:none;resize:vertical;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-khtml-box-sizing:border-box;box-sizing:border-box;}#editorcontainer,#quicktags{border-style:solid;border-width:1px;border-collapse:separate;-moz-border-radius:6px 6px 0 0;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-right-radius:6px;-khtml-border-top-left-radius:6px;border-top-right-radius:6px;border-top-left-radius:6px;}#quicktags{padding:0;margin-bottom:-3px;border-bottom-width:3px;background-image:url("../images/ed-bg.gif");background-position:left top;background-repeat:repeat-x;}#quicktags #ed_toolbar{padding:2px 4px 0;}#ed_toolbar input,#ed_reply_toolbar input{margin:3px 1px 4px;line-height:18px;display:inline-block;min-width:26px;padding:2px 4px;font-size:12px;}#ed_reply_toolbar input{margin:1px 2px 1px 1px;}#quicktags #ed_link,#ed_reply_toolbar #ed_reply_link{text-decoration:underline;}#quicktags #ed_del,#ed_reply_toolbar #ed_reply_del{text-decoration:line-through;}#quicktags #ed_em,#ed_reply_toolbar #ed_reply_em{font-style:italic;}#excerpt,.attachmentlinks{margin:0;height:4em;width:98%;}#postcustomstuff table,#postcustomstuff input,#postcustomstuff textarea{border-width:1px;border-style:solid;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}#postcustomstuff .updatemeta,#postcustomstuff .deletemeta{margin:auto;}#postcustomstuff thead th{padding:5px 8px 8px;}#postcustom #postcustomstuff .submit{border:0 none;float:none;padding:5px 8px;}#side-sortables #postcustom #postcustomstuff .submit{padding:0 5px;}#side-sortables #postcustom #postcustomstuff td.left input{margin:3px 3px 0;}#side-sortables #postcustom #postcustomstuff #the-list textarea{height:85px;margin:3px;}#postcustomstuff table{margin:0;width:100%;border-width:1px;border-style:solid;border-spacing:0;}#postcustomstuff table input,#postcustomstuff table select,#postcustomstuff table textarea{width:95%;margin:8px 0 8px 8px;}#postcustomstuff th.left,#postcustomstuff td.left{width:38%;}#postcustomstuff .submit input{width:auto;}#postcustomstuff #newmeta .submit{padding:0 8px;}#postcustomstuff table #addmetasub{width:auto;}#postcustomstuff #newmetaleft{vertical-align:top;}#postcustomstuff #newmetaleft a{padding:0 10px;text-decoration:none;}#save{width:15em;}#template div{margin-right:190px;}* html #template div{margin-right:0;}.zerosize{height:0;width:0;margin:0;border:0;padding:0;overflow:hidden;position:absolute;}* html #themeselect{padding:0 3px;height:22px;}#your-profile legend{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:22px;}#your-profile #rich_editing{border:none;}#howto{font-size:11px;margin:0 5px;display:block;}#ajax-response.alignleft{margin-left:2em;}div.nav{height:2em;padding:7px 10px;vertical-align:text-top;margin:5px 0;}.nav .button-secondary{padding:2px 4px;}a.page-numbers{border-bottom-style:solid;border-bottom-width:2px;font-weight:bold;margin-right:1px;padding:0 2px;}p.pagenav{margin:0;display:inline;}.pagenav span{font-weight:bold;margin:0 6px;}.row-title{font-size:12px!important;font-weight:bold;}.widefat .column-comment p{margin:.6em 0;}.column-author img,.column-username img{float:left;margin-right:10px;margin-top:3px;}.tablenav a.button-secondary{display:block;margin:3px 8px 0 0;}.tablenav{clear:both;height:30px;margin:6px 0 4px;vertical-align:middle;}.tablenav .tablenav-pages{float:right;display:block;cursor:default;height:30px;line-height:30px;font-size:11px;}.tablenav .tablenav-pages a,.tablenav-pages span.current{text-decoration:none;border:none;padding:3px 6px;border-width:1px;border-style:solid;-moz-border-radius:5px;-khtml-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;}.tablenav .displaying-num{margin-right:10px;font-size:12px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-style:italic;}.tablenav .actions{padding:2px 8px 0 0;}td.media-icon{text-align:center;width:80px;padding-top:8px;padding-bottom:8px;}td.media-icon img{max-width:80px;max-height:60px;}#update-nag,.update-nag{line-height:19px;padding:5px 0;font-size:12px;text-align:center;margin:0 15px;border-width:1px;border-style:solid;border-top-width:0;border-top-style:none;-moz-border-radius:0 0 6px 6px;-webkit-border-bottom-right-radius:6px;-webkit-border-bottom-left-radius:6px;-khtml-border-bottom-right-radius:6px;-khtml-border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-bottom-left-radius:6px;}.plugins .plugin-update{padding:0;}.plugin-update .update-message{margin:0 10px 8px 31px;font-weight:bold;}#pass-strength-result{border-style:solid;border-width:1px;float:left;margin:12px 5px 5px 1px;padding:3px 5px;text-align:center;width:200px;}.row-actions{visibility:hidden;padding:2px 0 0;}tr:hover .row-actions,div.comment-item:hover .row-actions{visibility:visible;}.row-actions-visible{padding:2px 0 0;}#wphead-info{margin:0 0 0 15px;padding-right:15px;}#user_info{float:right;font-size:12px;line-height:46px;height:46px;}#user_info p{margin:0;padding:0;line-height:46px;}#wphead{height:46px;}#wphead a,#adminmenu a,#sidemenu a,#taglist a,#catlist a,#show-settings a{text-decoration:none;}#header-logo{float:left;margin:7px 0 0 15px;}#wphead h1{font:normal 22px Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:10px 8px 5px;margin:0;float:left;}#wphead h1.long-title{font:normal 18px Georgia,"Times New Roman","Bitstream Charter",Times,serif;padding:12px 10px 5px;}#wphead #privacy-on-link{font-size:50%;font-style:normal;line-height:17px;padding:0 6px;vertical-align:middle;}#wphead h1 a:hover{text-decoration:none;}#wphead h1 a:hover #site-title,#wphead h1 a#privacy-on-link:hover{text-decoration:underline;}#adminmenu *{-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;user-select:none;}#adminmenu .wp-submenu{display:none;list-style:none;padding:0;margin:0;position:relative;z-index:2;border-width:1px 0 0;border-style:solid none none;}#adminmenu .wp-submenu a{font:normal 11px/18px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{font-weight:bold;}#adminmenu a.menu-top,#adminmenu .wp-submenu-head{font:normal 13px/18px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}#adminmenu div.wp-submenu-head{display:none;}.folded #adminmenu div.wp-submenu-head,.folded #adminmenu li.wp-has-submenu div.sub-open{display:block;}.folded #adminmenu a.menu-top,.folded #adminmenu .wp-submenu,.folded #adminmenu li.wp-menu-open .wp-submenu,.folded #adminmenu div.wp-menu-toggle{display:none;}#adminmenu li.wp-menu-open .wp-submenu,.no-js #adminmenu .open-if-no-js .wp-submenu{display:block;}#adminmenu div.wp-menu-image{float:left;width:28px;height:28px;}#adminmenu li{margin:0;padding:0;cursor:pointer;}#adminmenu a{display:block;line-height:18px;padding:1px 5px 3px;}#adminmenu li.menu-top{min-height:26px;}#adminmenu a.menu-top{line-height:18px;min-width:10em;padding:5px 5px;border-width:1px 1px 0;border-style:solid solid none;}#adminmenu .wp-submenu a{margin:0;padding-left:12px;border-width:0 1px 0 0;border-style:none solid none none;}#adminmenu .menu-top-last ul.wp-submenu{border-width:0 0 1px;border-style:none none solid;}#adminmenu .wp-submenu li{padding:0;margin:0;}.folded #adminmenu li.menu-top{width:28px;height:30px;overflow:hidden;border-width:1px 1px 0;border-style:solid solid none;}#adminmenu .menu-top-first a.menu-top,.folded #adminmenu li.menu-top-first,#adminmenu .wp-submenu .wp-submenu-head{border-width:1px 1px 0;border-style:solid solid none;-moz-border-radius-topleft:6px;-moz-border-radius-topright:6px;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-right-radius:6px;-khtml-border-top-left-radius:6px;border-top-right-radius:6px;border-top-left-radius:6px;}#adminmenu .menu-top-last a.menu-top,.folded #adminmenu li.menu-top-last{border-width:1px;border-style:solid;-moz-border-radius-bottomleft:6px;-moz-border-radius-bottomright:6px;-webkit-border-bottom-right-radius:6px;-webkit-border-bottom-left-radius:6px;-khtml-border-bottom-right-radius:6px;-khtml-border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-bottom-left-radius:6px;}#adminmenu li.wp-menu-open a.menu-top-last{border-bottom:0 none;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;}#adminmenu .wp-menu-image img{float:left;padding:8px 6px 0;opacity:.6;filter:alpha(opacity=60);}#adminmenu li.menu-top:hover .wp-menu-image img,#adminmenu li.wp-has-current-submenu .wp-menu-image img{opacity:1;filter:alpha(opacity=100);}#adminmenu li.wp-menu-separator{height:21px;padding:0;margin:0;}#adminmenu a.separator{cursor:w-resize;height:20px;padding:0;}.folded #adminmenu a.separator{cursor:e-resize;}#adminmenu .wp-menu-separator-last{height:10px;width:1px;}#adminmenu .wp-submenu .wp-submenu-head{border-width:1px;border-style:solid;padding:6px 4px 6px 10px;cursor:default;}.folded #adminmenu .wp-submenu{position:absolute;margin:-1px 0 0 28px;padding:0 8px 8px;z-index:999;border:0 none;}.folded #adminmenu .wp-submenu ul{width:140px;border-width:0 0 1px;border-style:none none solid;}.folded #adminmenu .wp-submenu li.wp-first-item{border-top:0 none;}.folded #adminmenu .wp-submenu a{padding-left:10px;}.folded #adminmenu a.wp-has-submenu{margin-left:40px;}#adminmenu li.menu-top-last .wp-submenu ul{border-width:0 0 1px;border-style:none none solid;}#adminmenu .wp-menu-toggle{width:22px;clear:right;float:right;margin:1px 0 0;height:27px;padding:1px 2px 0 0;cursor:default;}#adminmenu li.wp-has-current-submenu ul{border-bottom-width:1px;border-bottom-style:solid;}#adminmenu .wp-menu-image a{height:24px;}#adminmenu .wp-menu-image img{padding:6px 0 0 1px;}#adminmenu #awaiting-mod,#adminmenu span.update-plugins,#sidemenu li a span.update-plugins{position:absolute;font-family:Helvetica,Arial,sans-serif;font-size:9px;line-height:17px;font-weight:bold;margin-top:1px;margin-left:7px;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;}#adminmenu li #awaiting-mod span,#adminmenu li span.update-plugins span,#sidemenu li a span.update-plugins span{display:block;padding:0 6px;}#adminmenu li span.count-0,#sidemenu li a .count-0{display:none;}.post-com-count-wrapper{min-width:22px;font-family:Helvetica,Arial,sans-serif;}.post-com-count{height:1.3em;line-height:1.1em;display:block;text-decoration:none;padding:0 0 6px;cursor:pointer;background-position:center -80px;background-repeat:no-repeat;}.post-com-count span{font-size:9px;font-weight:bold;height:1.7em;line-height:1.70em;min-width:.7em;padding:0 6px;display:inline-block;cursor:pointer;-moz-border-radius:5px;-khtml-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;}strong .post-com-count{background-position:center -55px;}.post-com-count:hover{background-position:center -3px;}.column-response .post-com-count{float:left;margin-right:5px;text-align:center;}.response-links{float:left;}#the-comment-list .attachment-80x60{padding:4px 8px;}#footer{margin-top:-46px;border-top:1px;border-style:solid;}#footer,#footer a{font-size:12px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-style:italic;}#footer p{margin:0;padding:15px;line-height:15px;}#footer a{text-decoration:none;}#footer a:hover{text-decoration:underline;}.form-table{border-collapse:collapse;margin-top:.5em;width:100%;margin-bottom:-8px;clear:both;}.form-table td{margin-bottom:9px;padding:8px 10px;line-height:20px;font-size:11px;}.form-table th,.form-wrap label{font-weight:normal;text-shadow:rgba(255,255,255,1) 0 1px 0;}.form-table th{vertical-align:top;text-align:left;padding:10px;width:200px;}.form-table th.th-full{width:auto;}.form-table div.color-option{display:block;clear:both;margin-top:12px;}.form-table input.tog{margin-top:2px;margin-right:2px;float:left;}.form-table table.color-palette{vertical-align:bottom;float:left;margin:-12px 3px 11px;}.form-table .color-palette td{border-width:1px 1px 0;border-style:solid solid none;height:10px;line-height:20px;width:10px;}input.large-text,textarea.large-text{width:99%;}.form-table input.regular-text,#adduser .form-field input{width:25em;}.form-table input.small-text{width:50px;}#profile-page .form-table textarea{width:500px;margin-bottom:6px;}#profile-page .form-table #rich_editing{margin-right:5px;}.form-table .pre{padding:8px;margin:0;}.pre{white-space:pre-wrap;white-space:-moz-pre-wrap!important;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;}table.form-table td .updated{font-size:13px;}.form-wrap{margin:10px 0;width:97%;}.form-wrap p,.form-wrap label{font-size:11px;}.form-wrap label{display:block;padding:2px;font-size:12px;}.form-field input,.form-field textarea{border-style:solid;border-width:1px;width:95%;}p.description,.form-wrap p{margin:2px 0 5px;}p.help,p.description,span.description,.form-wrap p{font-size:12px;font-style:italic;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}.form-wrap .form-field{margin:0 0 10px;padding:8px;}.col-wrap h3{margin:12px 0;font-size:1.1em;}.col-wrap p.submit{margin-top:-10px;}.tagcloud{width:97%;margin:0 0 40px;text-align:justify;}.tagcloud h3{margin:2px 0 12px;}#post-body #normal-sortables{min-height:50px;}#post-body #advanced-sortables{min-height:20px;}.postbox{position:relative;min-width:255px;width:99.5%;}#trackback_url{width:99%;}#normal-sortables .postbox .submit{background:transparent none;border:0 none;float:right;padding:0 12px;margin:0;}#normal-sortables .postbox #replyrow .submit{float:none;margin:0;padding:3px 7px;}#side-sortables .submitbox .submit input,#side-sortables .submitbox .submit .preview,#side-sortables .submitbox .submit a.preview:hover{border:0 none;}#side-sortables .inside-submitbox .insidebox,.stuffbox .insidebox{margin:11px 0;}#side-sortables .comments-box,#normal-sortables .comments-box{border:0 none;}#side-sortables .comments-box thead th,#normal-sortables .comments-box thead th{background:transparent;padding:0 7px 4px;font-style:italic;}#commentsdiv img.waiting{padding-left:5px;vertical-align:middle;}#post-body .tagsdiv #newtag{margin-right:5px;width:16em;}#side-sortables input#post_password{width:94%;}#side-sortables .tagsdiv #newtag{width:68%;}#post-status-info{border-width:0 1px 1px;border-style:none solid solid;width:100%;-moz-border-radius:0 0 6px 6px;-webkit-border-bottom-left-radius:6px;-webkit-border-bottom-right-radius:6px;-khtml-border-bottom-left-radius:6px;-khtml-border-bottom-right-radius:6px;border-bottom-left-radius:6px;border-bottom-right-radius:6px;}#post-status-info td{font-size:11px;}.autosave-info{padding:2px 15px 2px 2px;text-align:right;}#editorcontent #post-status-info{border:none;}#post-body .wp_themeSkin .mceStatusbar a.mceResize{display:block;background:transparent url(../images/resize.gif) no-repeat scroll right bottom;width:12px;cursor:se-resize;margin:0 2px;position:relative;top:22px;}#linksubmitdiv div.inside,div.inside{padding:0;margin:0;}#comment-status-radio p{margin:3px 0 5px;}#comment-status-radio input{margin:2px 3px 5px 0;vertical-align:middle;}#comment-status-radio label{padding:5px 0;}.tagchecklist{margin-left:14px;font-size:12px;overflow:auto;}.tagchecklist strong{margin-left:-8px;position:absolute;}.tagchecklist span{margin-right:25px;display:block;float:left;font-size:11px;line-height:1.8em;white-space:nowrap;cursor:default;}.tagchecklist span a{margin:6px 0 0 -9px;cursor:pointer;width:10px;height:10px;display:block;float:left;text-indent:-9999px;overflow:hidden;position:absolute;}.howto{font-style:italic;display:block;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}.ac_results{padding:0;margin:0;list-style:none;position:absolute;z-index:10000;display:none;border-width:1px;border-style:solid;}.ac_results li{padding:2px 5px;white-space:nowrap;text-align:left;}.ac_over{cursor:pointer;}.ac_match{text-decoration:underline;}#poststuff h2{margin-top:20px;font-size:1.5em;margin-bottom:15px;padding:0 0 3px;clear:left;}.widget .widget-top,.postbox h3{cursor:move;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;user-select:none;}.postbox .hndle span{padding:6px 0;}.postbox .hndle{cursor:move;}.hndle a{font-size:11px;font-weight:normal;}#dashboard-widgets .meta-box-sortables{margin:0 5px;}.postbox .handlediv{float:right;width:23px;height:26px;}.sortable-placeholder{border-width:1px;border-style:dashed;margin-bottom:20px;}#poststuff h3,.metabox-holder h3{font-size:12px;font-weight:bold;padding:7px 9px;margin:0;line-height:1;}.widget,.postbox,.stuffbox{margin-bottom:20px;border-width:1px;border-style:solid;line-height:1;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}.widget .widget-top,.postbox h3,.postbox h3,.stuffbox h3{-moz-border-radius:6px 6px 0 0;-webkit-border-top-right-radius:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-right-radius:6px;-khtml-border-top-left-radius:6px;border-top-right-radius:6px;border-top-left-radius:6px;}.postbox.closed h3{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;-khtml-border-bottom-right-radius:4px;border-bottom-right-radius:4px;}.postbox table.form-table{margin-bottom:0;}.postbox input[type="text"],.postbox textarea,.stuffbox input[type="text"],.stuffbox textarea{border-width:1px;border-style:solid;}#poststuff .inside,#poststuff .inside p{font-size:11px;margin:6px 6px 8px;}#poststuff .inside .submitbox p{margin:1em 0;}#post-visibility-select{line-height:1.5em;margin-top:3px;}#poststuff #submitdiv .inside{margin:0;}#titlediv,#poststuff .postarea{margin-bottom:20px;}#titlediv{position:relative;margin-bottom:20px;}#titlediv label{cursor:text;}#titlediv div.inside{margin:0;}#poststuff #titlewrap{border:0;padding:0;}#titlediv #title{padding:3px 4px;border-width:1px;border-style:solid;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;font-size:1.7em;line-height:100%;width:100%;outline:none;}#titlediv #title-prompt-text{color:#bbb;position:absolute;font-size:1.7em;padding:8px;}#poststuff .inside-submitbox,#side-sortables .inside-submitbox{margin:0 3px;font-size:11px;}input#link_description,input#link_url{width:98%;}#pending{background:0 none;border:0 none;padding:0;font-size:11px;margin-top:-1px;}#edit-slug-box{height:1em;margin-top:8px;padding:0 7px;}#editable-post-name-full{display:none;}#editable-post-name input{width:16em;}.postarea h3 label{float:left;}.postarea #add-media-button{float:right;margin:7px 0 0;position:relative;right:10px;}#poststuff #editor-toolbar{height:30px;}.wp_themeSkin tr.mceFirst td.mceToolbar{border-width:0 0 1px;border-style:none none solid;}#edButtonPreview,#edButtonHTML{height:18px;margin:5px 5px 0 0;padding:4px 5px 2px;float:right;cursor:pointer;border-width:1px;border-style:solid;-moz-border-radius:3px 3px 0 0;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;}.js .theEditor{color:white;}#poststuff #edButtonHTML{margin-right:15px;}#media-buttons{cursor:default;padding:8px 8px 0;}#media-buttons a{cursor:pointer;padding:0 0 5px 10px;}#media-buttons img,#submitpost #ajax-loading{vertical-align:middle;}.submitbox .submit{text-align:left;padding:12px 10px 10px;font-size:11px;}.submitbox .submitdelete{border-bottom-width:1px;border-bottom-style:solid;text-decoration:none;padding:1px 2px;}.inside-submitbox #post_status{margin:2px 0 2px -2px;}.submitbox .submit a:hover{border-bottom-width:1px;border-bottom-style:solid;}.submitbox .submit input{margin-bottom:8px;margin-right:4px;padding:6px;}#post-status-select{line-height:2.5em;margin-top:3px;}.category-adder{margin-left:120px;padding:4px 0;}.category-adder h4{margin:0 0 8px;}#side-sortables .category-adder{margin:0;}#post-body .category-add input,.category-add select{width:30%;}#side-sortables .category-add input{width:94%;}#side-sortables .category-add select{width:100%;}#side-sortables .category-add input.category-add-sumbit,#post-body .category-add input.category-add input.category-add-sumbit{width:auto;}#post-body ul.category-tabs,#post-body ul.add-menu-item-tabs{float:left;width:120px;text-align:right;margin:0 -120px 0 5px;padding:0;}#post-body ul.category-tabs li,#post-body ul.add-menu-item-tabs li{padding:8px;}#post-body ul.category-tabs li.tabs,#post-body ul.add-menu-item-tabs li.tabs{-moz-border-radius:3px 0 0 3px;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-top-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-top-left-radius:3px;border-bottom-left-radius:3px;}#post-body ul.category-tabs li.tabs a,#post-body ul.add-menu-item-tabs li.tabs a{font-weight:bold;text-decoration:none;}.categorydiv div.tabs-panel,.customlinkdiv div.tabs-panel,.posttypediv div.tabs-panel,.taxonomydiv div.tabs-panel,#linkcategorydiv div.tabs-panel{height:200px;overflow:auto;padding:.5em .9em;border-style:solid;border-width:1px;}.nav-menus-php .customlinkdiv div.tabs-panel,.nav-menus-php .posttypediv div.tabs-panel,.nav-menus-php .taxonomydiv div.tabs-panel{height:auto;max-height:205px;}div.tabs-panel-active{display:block;}div.tabs-panel-inactive{display:none;}#post-body .categorydiv div.tabs-panel,.taxonomy div.tabs-panel,#post-body #linkcategorydiv div.tabs-panel{margin:0 5px 0 125px;}#side-sortables .category-tabs li,#side-sortables .add-menu-item-tabs li{display:inline;}#side-sortables .category-tabs a,#side-sortables .add-menu-item-tabs a{text-decoration:none;}#side-sortables .category-tabs,#side-sortables .add-menu-item-tabs{margin-bottom:3px;}.categorydiv ul,.customlinkdiv ul,.posttypediv ul,.taxonomydiv ul,#linkcategorydiv ul{list-style:none;padding:0;margin:0;}#front-page-warning,#front-static-pages ul,.inline-editor ul.cat-checklist ul,.categorydiv ul.categorychecklist ul,.customlinkdiv ul.categorychecklist ul,.posttypediv ul.categorychecklist ul,.taxonomydiv ul.categorychecklist ul,#linkcategorydiv ul.categorychecklist ul{margin-left:18px;}ul.categorychecklist li{margin:0;padding:0;line-height:19px;word-wrap:break-word;}.category-adder h4{margin-top:4px;margin-bottom:0;}.categorydiv .tabs-panel,.customlinkdiv .tabs-panel,.posttypediv .tabs-panel,.taxonomydiv .tabs-panel{border-width:3px;border-style:solid;}ul.category-tabs,ul.add-menu-item-tabs{margin-top:12px;}ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs{border-style:solid solid none;border-width:1px 1px 0;}#post-body .category-tabs li.tabs,#post-body .add-menu-item-tabs li.tabs{border-style:solid none solid solid;border-width:1px 0 1px 1px;margin-right:-1px;}ul.category-tabs li,ul.add-menu-item-tabs li{padding:5px;-moz-border-radius:3px 3px 0 0;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;-khtml-border-top-left-radius:3px;-khtml-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px;}form#tags-filter{position:relative;}p.search-box{float:right;margin:-5px 0 0;}.screen-per-page{width:3em;}#posts-filter fieldset{float:left;margin:0 1.5ex 1em 0;padding:0;}#posts-filter fieldset legend{padding:0 0 .2em 1px;}td.post-title strong,td.plugin-title strong{display:block;margin-bottom:.2em;}td.post-title p,td.plugin-title p{margin:6px 0;}td.plugin-title{white-space:nowrap;}.wp-hidden-children .wp-hidden-child,.ui-tabs-hide{display:none;}.commentlist .avatar{vertical-align:text-top;}.defaultavatarpicker .avatar{margin:2px 0;vertical-align:middle;}body.wp-admin{min-width:785px;}.view-switch{float:right;margin:6px 8px 0;}.view-switch a{text-decoration:none;}.filter{float:left;margin:-5px 0 0 10px;}.filter .subsubsub{margin-left:-10px;margin-top:13px;}#the-comment-list td.comment p.comment-author{margin-top:0;margin-left:0;}#the-comment-list p.comment-author img{float:left;margin-right:8px;}#the-comment-list p.comment-author strong a{border:none;}#the-comment-list td{vertical-align:top;}#the-comment-list td.comment{word-wrap:break-word;}#the-comment-list .check-column{padding-top:8px;}#templateside ul li a{text-decoration:none;}.indicator-hint{padding-top:8px;}#display_name{width:15em;}.tablenav .delete{margin-right:20px;}td.action-links,th.action-links{text-align:right;}table.diff{width:100%;}table.diff col.content{width:50%;}table.diff tr{background-color:transparent;}table.diff td,table.diff th{padding:.5em;font-family:Consolas,Monaco,Courier,monospace;border:none;}table.diff .diff-deletedline del,table.diff .diff-addedline ins{text-decoration:none;}#wp-word-count{display:block;padding:2px 7px;}fieldset{border:0;padding:0;margin:0;}.tool-box{margin:15px 0 35px;}.tool-box .buttons{margin:15px 0;}.tool-box .title{margin:8px 0;font:18px/24px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}.pressthis a{font-size:1.2em;}#wp_editbtns,#wp_gallerybtns{padding:2px;position:absolute;display:none;z-index:999998;}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{margin:2px;padding:2px;border-width:1px;border-style:solid;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.settings-toggle{text-align:right;margin:5px 7px 15px 0;font-size:12px;}.settings-toggle h3{margin:0;}#timestampdiv select{height:20px;line-height:14px;padding:0;vertical-align:top;}#jj,#hh,#mn{width:2em;padding:1px;font-size:12px;}#aa{width:3.4em;padding:1px;font-size:12px;}.curtime #timestamp{background-repeat:no-repeat;background-position:left top;padding-left:18px;}#timestampdiv{padding-top:5px;line-height:23px;}#timestampdiv p{margin:8px 0 6px;}#timestampdiv input{border-width:1px;border-style:solid;}#sidemenu{margin:-30px 15px 0 315px;list-style:none;position:relative;float:right;padding-left:10px;font-size:12px;}#sidemenu a{padding:0 7px;display:block;float:left;line-height:28px;border-top-width:1px;border-top-style:solid;border-bottom-width:1px;border-bottom-style:solid;}#sidemenu li{display:inline;line-height:200%;list-style:none;text-align:center;white-space:nowrap;margin:0;padding:0;}#sidemenu a.current{font-weight:normal;padding-left:6px;padding-right:6px;-moz-border-radius:4px 4px 0 0;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-khtml-border-top-left-radius:4px;-khtml-border-top-right-radius:4px;border-top-left-radius:4px;border-top-right-radius:4px;border-width:1px;border-style:solid;}#sidemenu{margin:-30px 15px 0 315px;list-style:none;position:relative;float:right;padding-left:10px;font-size:12px;}#sidemenu a{padding:0 7px;display:block;float:left;line-height:28px;border-top-width:1px;border-top-style:solid;border-bottom-width:1px;border-bottom-style:solid;}#sidemenu li a .count-0{display:none;}#replyrow{font-size:11px;}#replyrow input{border-width:1px;border-style:solid;}#replyrow td{padding:2px;}#replyrow #editorcontainer{border:0 none;}#replysubmit{margin:0;padding:3px 7px;}#replysubmit img.waiting,.inline-edit-save img.waiting{padding:4px 10px 0;vertical-align:top;float:right;}#replysubmit .button{margin-right:5px;}#replyrow #editor-toolbar{display:none;}#replyhead{font-size:12px;font-weight:bold;padding:2px 10px 4px;}#edithead .inside{float:left;padding:3px 0 2px 5px;margin:0;text-align:center;font-size:11px;}#edithead .inside input{width:180px;font-size:11px;}#edithead label{padding:2px 0;}#replycontainer{padding:5px;border:0 none;height:120px;overflow:hidden;position:relative;}#replycontent{resize:none;margin:0;width:100%;height:100%;padding:0;line-height:150%;border:0 none;outline:none;font-size:12px;}#replyrow #ed_reply_toolbar{margin:0;padding:2px 3px;}#screen-meta{position:relative;clear:both;}#screen-meta-links{margin:0 18px 0 0;}#screen-meta .screen-reader-text{visibility:hidden;}#screen-options-link-wrap,#contextual-help-link-wrap{float:right;height:22px;padding:0;margin:0 6px 0 0;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;background:#e3e3e3;-moz-border-radius-bottomleft:3px;-moz-border-radius-bottomright:3px;-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;}#contextual-help-wrap li{list-style-type:disc;margin-left:18px;}#screen-meta a.show-settings{text-decoration:none;z-index:1;padding:0 16px 0 6px;height:22px;line-height:22px;font-size:10px;display:block;background-repeat:no-repeat;background-position:right bottom;}#screen-meta a.show-settings{background-image:url(../images/screen-options-right.gif?ver=20100531);}#screen-meta a.show-settings:hover{text-decoration:none;}#screen-options-wrap h5,#contextual-help-wrap h5{margin:8px 0;font-size:13px;}#screen-options-wrap,#contextual-help-wrap{border-style:none solid solid;border-top:0 none;border-width:0 1px 1px;margin:0 15px;padding:8px 12px 12px;-moz-border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-radius:4px;}.metabox-prefs label{padding-right:15px;white-space:nowrap;line-height:30px;}.metabox-prefs label input{margin:0 5px 0 2px;}.metabox-prefs label a{display:none;}tr.inline-edit-row td{padding:0 .5em;}#wpbody-content .inline-edit-row fieldset{font-size:12px;float:left;margin:0;padding:0;width:100%;}#wpbody-content .inline-edit-row fieldset .inline-edit-col{padding:0 .5em;}#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col{border-width:0 0 0 1px;border-style:none none none solid;}#wpbody-content .quick-edit-row-post .inline-edit-col-left{width:40%;}#wpbody-content .quick-edit-row-post .inline-edit-col-right{width:39%;}#wpbody-content .inline-edit-row-post .inline-edit-col-center{width:20%;}#wpbody-content .quick-edit-row-page .inline-edit-col-left{width:50%;}#wpbody-content .quick-edit-row-page .inline-edit-col-right,#wpbody-content .bulk-edit-row-post .inline-edit-col-right{width:49%;}#wpbody-content .bulk-edit-row .inline-edit-col-left{width:30%;}#wpbody-content .bulk-edit-row-page .inline-edit-col-right{width:69%;}#wpbody-content .bulk-edit-row .inline-edit-col-bottom{float:right;width:69%;}#wpbody-content .inline-edit-row-page .inline-edit-col-right,#owpbody-content .bulk-edit-row-post .inline-edit-col-right{margin-top:27px;}.inline-edit-row fieldset .inline-edit-group{clear:both;}.inline-edit-row fieldset .inline-edit-group:after{content:".";display:block;height:0;clear:both;visibility:hidden;}.inline-edit-row p.submit{clear:both;padding:.5em;margin:.5em 0 0;}.inline-edit-row span.error{line-height:22px;margin:0 15px;padding:3px 5px;}.inline-edit-row h4{margin:.2em 0;padding:0;line-height:23px;}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{margin:0;padding:0;line-height:27px;}.inline-edit-row fieldset label,.inline-edit-row fieldset span.inline-edit-categories-label{display:block;margin:.2em 0;}.inline-edit-row fieldset label.inline-edit-tags{margin-top:0;}.inline-edit-row fieldset label.inline-edit-tags span.title{margin:.2em 0;}.inline-edit-row fieldset label span.title{display:block;float:left;width:5em;}.inline-edit-row fieldset label span.input-text-wrap{display:block;margin-left:5em;}.quick-edit-row-post fieldset.inline-edit-col-right label span.title{width:auto;padding-right:.5em;}.inline-edit-row .input-text-wrap input[type=text]{width:100%;}.inline-edit-row fieldset label input[type=checkbox]{vertical-align:text-bottom;}.inline-edit-row fieldset label textarea{width:100%;height:4em;}#wpbody-content .bulk-edit-row fieldset .inline-edit-group label{max-width:50%;}#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child{margin-right:.5em;}.inline-edit-row h4{text-transform:uppercase;}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-style:italic;line-height:1.8em;}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea{border-style:solid;border-width:1px;}.inline-edit-row fieldset .inline-edit-date{float:left;}.inline-edit-row fieldset input[name=jj],.inline-edit-row fieldset input[name=hh],.inline-edit-row fieldset input[name=mn]{font-size:12px;width:2.1em;}.inline-edit-row fieldset input[name=aa]{font-size:12px;width:3.5em;}.inline-edit-row fieldset label input.inline-edit-password-input{width:8em;}.inline-edit-row .catshow,.inline-edit-row .cathide{cursor:pointer;}ul.cat-checklist{height:12em;border-style:solid;border-width:1px;overflow-y:scroll;padding:0 5px;margin:0;}#bulk-titles{display:block;height:12em;border-style:solid;border-width:1px;overflow-y:scroll;padding:0 5px;margin:0 0 5px;}.inline-edit-row fieldset ul.cat-checklist li,.inline-edit-row fieldset ul.cat-checklist input{margin:0;}.inline-edit-row fieldset ul.cat-checklist label,.inline-edit-row .catshow,.inline-edit-row .cathide,.inline-edit-row #bulk-titles div{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-style:normal;font-size:11px;}table .inline-edit-row fieldset ul.cat-hover{height:auto;max-height:30em;overflow-y:auto;position:absolute;}.inline-edit-row fieldset label input.inline-edit-menu-order-input{width:3em;}.inline-edit-row fieldset label input.inline-edit-slug-input{width:75%;}.quick-edit-row-post fieldset label.inline-edit-status{float:left;}#bulk-titles{line-height:140%;}#bulk-titles div{margin:.2em .3em;}#bulk-titles div a{cursor:pointer;display:block;float:left;height:10px;margin:3px 3px 0 -2px;overflow:hidden;position:relative;text-indent:-9999px;width:10px;}#wpbody-content #media-items .describe{border-collapse:collapse;width:100%;border-top-style:solid;border-top-width:1px;clear:both;cursor:default;padding:5px;}#wpbody-content .describe th{vertical-align:top;text-align:left;padding:10px;width:140px;}#wpbody-content .describe .media-item-info tr{background-color:transparent;}#wpbody-content .describe .media-item-info td{padding:4px 10px 0;}.describe .media-item-info .A1B1{padding:0 0 0 10px;}#wpbody-content .filename{padding:0 10px;}#wpbody-content .media-item .thumbnail{max-height:128px;max-width:128px;}#wpbody-content #async-upload-wrap a{display:none;}.media-upload-form td label{margin-right:6px;margin-left:2px;}.media-upload-form .align .field label{display:inline;padding:0 0 0 22px;margin:0 1em 0 0;font-weight:bold;}.media-upload-form tr.image-size label{margin:0 0 0 3px;font-weight:bold;}.media-upload-form th.label label{font-weight:bold;margin:.5em;font-size:13px;}.media-upload-form th.label label span{padding:0 5px;}abbr.required{border:medium none;text-decoration:none;}#wpbody-content .describe input[type="text"],#wpbody-content .describe textarea{width:460px;}#wpbody-content .describe p.help{margin:0;padding:0 0 0 5px;}.media-item .error-div a.dismiss,.describe-toggle-on,.describe-toggle-off{display:block;line-height:36px;float:right;margin-right:20px;}.describe-toggle-off{display:none;}#wpbody-content .media-item{border-bottom-style:solid;border-bottom-width:1px;min-height:36px;position:relative;width:100%;}#wpbody-content .media-single .media-item{border-bottom-style:none;border-bottom-width:0;}#wpbody-content #media-items{border-style:solid solid none;border-width:1px;width:670px;}#wpbody-content #media-items .filename{line-height:36px;overflow:hidden;}.media-item .error-div{padding-left:10px;}.media-item .pinkynail{float:left;margin:2px;max-width:40px;max-height:32px;}.media-item .startopen,.media-item .startclosed{display:none;}.media-item .original{position:relative;height:34px;width:503px;}.media-item .percent{font-weight:bold;}.crunching{display:block;line-height:32px;text-align:right;margin-right:5px;}.progress{position:relative;margin-bottom:-36px;height:36px;}.bar{width:0;height:100%;border-right-width:3px;border-right-style:solid;}.upload-php .fixed .column-parent{width:25%;}.find-box{width:500px;height:300px;overflow:hidden;padding:33px 5px 40px;position:absolute;z-index:1000;}.find-box-head{cursor:move;font-weight:bold;height:2em;line-height:2em;padding:1px 12px;position:absolute;top:5px;width:100%;}.find-box-inside{overflow:auto;width:100%;height:100%;}.find-box-search{padding:12px;border-width:1px;border-style:none none solid;}#find-posts-response{margin:8px 0;padding:0 1px;}#find-posts-response table{width:100%;}#find-posts-response .found-radio{padding:5px 0 0 8px;width:15px;}.find-box-buttons{width:480px;margin:8px;}.find-box-search label{padding-right:6px;}.find-box #resize-se{position:absolute;right:1px;bottom:1px;}#favorite-actions{float:right;margin:11px 12px 0;min-width:130px;position:relative;}#favorite-first{-moz-border-radius:12px;-khtml-border-radius:12px;-webkit-border-radius:12px;border-radius:12px;line-height:15px;padding:3px 30px 4px 12px;border-width:1px;border-style:solid;}#favorite-inside{margin:0;padding:2px 1px;border-width:1px;border-style:solid;position:absolute;z-index:11;display:none;-moz-border-radius:0 0 12px 12px;-webkit-border-bottom-right-radius:12px;-webkit-border-bottom-left-radius:12px;-khtml-border-bottom-right-radius:12px;-khtml-border-bottom-left-radius:12px;border-bottom-right-radius:12px;border-bottom-left-radius:12px;}#favorite-actions a{display:block;text-decoration:none;font-size:11px;}#favorite-inside a{padding:3px 5px 3px 10px;}#favorite-toggle{height:22px;position:absolute;right:0;top:1px;width:28px;}#favorite-actions .slide-down{-moz-border-radius:12px 12px 0 0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-khtml-border-bottom-right-radius:0;-khtml-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;border-bottom:none;}#utc-time,#local-time{padding-left:25px;font-style:italic;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}ul#dismissed-updates{display:none;}form.upgrade{margin-top:8px;}form.upgrade .hint{font-style:italic;font-size:85%;margin:-0.5em 0 2em 0;}#poststuff .inside .the-tagcloud{margin:5px 0 10px;padding:8px;border-width:1px;border-style:solid;line-height:1.8em;word-spacing:3px;-moz-border-radius:6px;-khtml-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}br.clear{height:2px;line-height:2px;}.swfupload{margin:5px 10px;vertical-align:middle;}table.fixed{table-layout:fixed;}.fixed .column-rating,.fixed .column-visible{width:8%;}.fixed .column-date,.fixed .column-parent,.fixed .column-links{width:10%;}.fixed .column-response,.fixed .column-author,.fixed .column-categories,.fixed .column-tags,.fixed .column-rel,.fixed .column-role{width:15%;}.fixed .column-comments{width:4em;padding-top:8px;}.fixed .column-slug{width:25%;}.fixed .column-posts{width:10%;}.fixed .column-icon{width:80px;}#commentsdiv .fixed .column-author,#comments-form .fixed .column-author{width:20%;}.widefat th,.widefat td{overflow:hidden;}.widefat td p{margin:2px 0 .8em;}table .vers,table .column-visible,table .column-rating{text-align:center;}.icon32{float:left;height:36px;margin:14px 6px 0 0;width:36px;}.key-labels label{line-height:24px;}.subtitle{font-size:.75em;line-height:1;padding-left:25px;}ol{list-style-type:decimal;margin-left:2em;}.postbox-container{float:left;padding-right:.5%;}.postbox-container .meta-box-sortables{min-height:300px;}.temp-border{border:1px dotted #ccc;}.columns-prefs label{padding:0 5px;}.theme-install-php h4,.plugin-install-php h4{margin:2.5em 0 8px;}p.install-help{margin:8px 0;font-style:italic;}p.popular-tags{-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;border-width:1px;border-style:solid;line-height:2em;padding:8px 12px 12px;text-align:justify;}p.popular-tags a{padding:0 3px;}.stuffbox .editcomment{clear:none;}.ajax-feedback{visibility:hidden;vertical-align:bottom;}.tagsdiv .newtag{width:180px;}.tagsdiv .the-tags{display:block;height:60px;margin:0 auto;overflow:auto;width:260px;}#post-body-content .tagsdiv .the-tags{margin:0 5px;}label,#your-profile label+a{vertical-align:middle;}#misc-publishing-actions label{vertical-align:baseline;}.plugin-update-tr .update-message{margin:5px;padding:3px 5px;border-width:1px;border-style:solid;-moz-border-radius:5px;-khtml-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;}.add-new-h2{font-style:normal;margin:0 6px;position:relative;top:-3px;}.describe .image-editor{vertical-align:top;}.imgedit-wrap{position:relative;}.imgedit-settings p{margin:8px 0;}.describe .imgedit-wrap table td{vertical-align:top;padding-top:0;}.imgedit-wrap p,.describe .imgedit-wrap table td{font-size:11px;line-height:18px;}.describe .imgedit-wrap table td.imgedit-settings{padding:0 5px;}td.imgedit-settings input{vertical-align:middle;}.imgedit-wait{position:absolute;top:0;background:#FFF url(../images/wpspin_light.gif) no-repeat scroll 22px 10px;opacity:.7;filter:alpha(opacity=70);width:100%;height:500px;display:none;}.media-disabled,.imgedit-settings .disabled{color:grey;}.imgedit-wait-spin{padding:0 4px 4px;vertical-align:bottom;visibility:hidden;}.imgedit-menu{margin:0 0 12px;min-width:300px;}.imgedit-menu div{float:left;width:32px;height:32px;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;border-width:1px;border-style:solid;}.imgedit-crop-wrap{position:relative;}.imgedit-crop{background:transparent url(../images/imgedit-icons.png) no-repeat scroll -9px -31px;margin:0 8px 0 0;}.imgedit-crop.disabled:hover{background-position:-9px -31px;}.imgedit-crop:hover{background-position:-9px -1px;}.imgedit-rleft{background:transparent url(../images/imgedit-icons.png) no-repeat scroll -46px -31px;margin:0 3px;}.imgedit-rleft.disabled:hover{background-position:-46px -31px;}.imgedit-rleft:hover{background-position:-46px -1px;}.imgedit-rright{background:transparent url(../images/imgedit-icons.png) no-repeat scroll -77px -31px;margin:0 8px 0 3px;}.imgedit-rright.disabled:hover{background-position:-77px -31px;}.imgedit-rright:hover{background-position:-77px -1px;}.imgedit-flipv{background:transparent url(../images/imgedit-icons.png) no-repeat scroll -115px -31px;margin:0 3px;}.imgedit-flipv.disabled:hover{background-position:-115px -31px;}.imgedit-flipv:hover{background-position:-115px -1px;}.imgedit-fliph{background:transparent url(../images/imgedit-icons.png) no-repeat scroll -147px -31px;margin:0 8px 0 3px;}.imgedit-fliph.disabled:hover{background-position:-147px -31px;}.imgedit-fliph:hover{background-position:-147px -1px;}.imgedit-undo{background:transparent url(../images/imgedit-icons.png) no-repeat scroll -184px -31px;margin:0 3px;}.imgedit-undo.disabled:hover{background-position:-184px -31px;}.imgedit-undo:hover{background-position:-184px -1px;}.imgedit-redo{background:transparent url(../images/imgedit-icons.png) no-repeat scroll -215px -31px;margin:0 8px 0 3px;}.imgedit-redo.disabled:hover{background-position:-215px -31px;}.imgedit-redo:hover{background-position:-215px -1px;}.imgedit-applyto img{margin:0 8px 0 0;}.imgedit-group-top{margin:5px 0;}.imgedit-applyto .imgedit-label{padding:2px 0 0;display:block;}.imgedit-help{display:none;font-style:italic;margin-bottom:8px;}.imgedit-help ul li{font-size:11px;}a.imgedit-help-toggle{text-decoration:none;}#wpbody-content .imgedit-response div{width:600px;margin:8px;}.form-table td.imgedit-response{padding:0;}.imgedit-submit{margin:8px 0;}.imgedit-submit-btn{margin-left:20px;}.imgedit-wrap .nowrap{white-space:nowrap;}span.imgedit-scale-warn{color:red;font-size:20px;font-style:normal;visibility:hidden;vertical-align:middle;}.imgedit-group{border-width:1px;border-style:solid;-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;margin-bottom:8px;padding:2px 10px;}#dashboard_recent_comments div.undo{border-top-style:solid;border-top-width:1px;margin:0 -10px;padding:3px 8px;font-size:11px;}.trash-undo-inside,.spam-undo-inside{margin:1px 8px 1px 0;line-height:16px;}.spam-undo-inside .avatar,.trash-undo-inside .avatar{height:20px;width:20px;margin-right:8px;vertical-align:middle;}.taghint{color:#aaa;margin:15px 0 -24px 12px;}#poststuff .tagsdiv .howto{margin:0 0 6px 8px;}.ajaxtag .newtag{background:transparent;position:relative;}#broken-themes{text-align:left;width:50%;border-spacing:3px;padding:3px;}.describe .del-link{padding-left:5px;}.comment-ays{margin-bottom:0;border-style:solid;border-width:1px;}.comment-ays th{border-right-style:solid;border-right-width:1px;}div#custom-background-image{min-height:100px;border:1px solid #dfdfdf;}div#custom-background-image img{max-width:400px;max-height:300px;}#custom-background label{padding-right:15px;}.appearance_page_custom-header #headimg{border:1px solid #DFDFDF;min-height:100px;width:100%;}.appearance_page_custom-header #upload-form p label{font-size:11px;}.appearance_page_custom-header #available-headers .default-header{float:left;margin:0 20px 20px 0;}.appearance_page_custom-header #available-headers label input{margin-right:10px;}.appearance_page_custom-header #available-headers label img{vertical-align:middle;}.nav-tab{border-style:solid;border-color:#ccc #ccc #f9f9f9;border-width:1px 1px 0;color:#c1c1c1;text-shadow:rgba(255,255,255,1) 0 1px 0;font-size:12px;line-height:16px;display:inline-block;padding:4px 14px 6px;text-decoration:none;margin:0 6px -1px 0;-moz-border-radius:5px 5px 0 0;-webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;-khtml-border-top-left-radius:5px;-khtml-border-top-right-radius:5px;border-top-left-radius:5px;border-top-right-radius:5px;}.nav-tab-active{border-width:1px;color:#464646;}.themes-php .wrap h2,.theme-install-php .wrap h2{border-bottom:1px solid #ccc;padding-bottom:0;}h2 .nav-tab{padding:4px 20px 6px;font:italic normal normal 24px/35px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}body.update-php{height:98%;} \ No newline at end of file diff --git a/wp-admin/wp-admin.dev.css b/wp-admin/css/wp-admin.dev.css similarity index 89% rename from wp-admin/wp-admin.dev.css rename to wp-admin/css/wp-admin.dev.css index 4813e8f4..cb84cc33 100644 --- a/wp-admin/wp-admin.dev.css +++ b/wp-admin/css/wp-admin.dev.css @@ -389,8 +389,8 @@ input.button-highlighted, #postcustomstuff .submit input { text-decoration: none; font-size: 11px !important; - line-height: 14px; - padding: 2px 8px; + line-height: 13px; + padding: 3px 8px; cursor: pointer; border-width: 1px; border-style: solid; @@ -504,6 +504,7 @@ textarea.all-options, input.all-options { line-height: 150%; border: 0 none; outline: none; + resize: vertical; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -khtml-box-sizing: border-box; @@ -528,7 +529,7 @@ textarea.all-options, input.all-options { padding: 0; margin-bottom: -3px; border-bottom-width: 3px; - background-image: url("images/ed-bg.gif"); + background-image: url("../images/ed-bg.gif"); background-position: left top; background-repeat: repeat-x; } @@ -795,6 +796,7 @@ td.media-icon { text-align: center; width: 80px; padding-top: 8px; + padding-bottom: 8px; } td.media-icon img { @@ -802,15 +804,23 @@ td.media-icon img { max-height: 60px; } -#update-nag { - line-height: 29px; +#update-nag, .update-nag { + line-height: 19px; + padding: 5px 0; font-size: 12px; text-align: center; -} - -#update-nag { - border-width: 1px 0; - border-style: solid none; + margin: 0 15px; + border-width: 1px; + border-style: solid; + border-top-width: 0; + border-top-style: none; + -moz-border-radius: 0 0 6px 6px; + -webkit-border-bottom-right-radius: 6px; + -webkit-border-bottom-left-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + -khtml-border-bottom-left-radius: 6px; + border-bottom-right-radius: 6px; + border-bottom-left-radius: 6px; } .plugins .plugin-update { @@ -844,7 +854,6 @@ div.comment-item:hover .row-actions { .row-actions-visible { padding: 2px 0 0; - cursor: pointer; } /* Admin Header */ @@ -896,28 +905,19 @@ div.comment-item:hover .row-actions { padding: 12px 10px 5px; } -#wphead #site-visit-button { - background-repeat:repeat-x; - background-position:0 0; - -moz-border-radius:3px; - -webkit-border-radius:3px; - -khtml-border-radius:3px; - border-radius:3px; - cursor:pointer; /* to keep IE happy */ - display:-moz-inline-stack; /* to keep FF2 happy */ - display:inline-block; +#wphead #privacy-on-link { font-size: 50%; - font-style:normal; - line-height:17px; - margin-left:5px; - padding:0 6px; - vertical-align:middle; + font-style: normal; + line-height: 17px; + padding: 0 6px; + vertical-align: middle; } #wphead h1 a:hover { text-decoration:none; } -#wphead h1 a:hover #site-title { +#wphead h1 a:hover #site-title, +#wphead h1 a#privacy-on-link:hover { text-decoration:underline; } @@ -1175,23 +1175,21 @@ div.comment-item:hover .row-actions { #sidemenu li a span.update-plugins { position: absolute; font-family: Helvetica, Arial, sans-serif; - font-size: 7pt; + font-size: 9px; + line-height: 17px; font-weight: bold; - margin-top: 2px; - margin-left: 2px; - -moz-border-radius: 7px; - -khtml-border-radius: 7px; - -webkit-border-radius: 7px; - border-radius: 7px; + margin-top: 1px; + margin-left: 7px; + -moz-border-radius: 10px; + -khtml-border-radius: 10px; + -webkit-border-radius: 10px; + border-radius: 10px; } #adminmenu li #awaiting-mod span, #adminmenu li span.update-plugins span, #sidemenu li a span.update-plugins span { - float: left; display: block; - height: 1.6em; - line-height: 1.6em; padding: 0 6px; } @@ -1257,7 +1255,9 @@ strong .post-com-count { /* Admin Footer */ #footer { - margin-top: -45px; + margin-top: -46px; + border-top: 1px; + border-style: solid; } #footer, @@ -1341,6 +1341,7 @@ strong .post-com-count { width: 10px; } +input.large-text, textarea.large-text { width: 99%; } @@ -1546,7 +1547,7 @@ span.description, #post-body .wp_themeSkin .mceStatusbar a.mceResize { display: block; - background: transparent url(images/resize.gif) no-repeat scroll right bottom; + background: transparent url(../images/resize.gif) no-repeat scroll right bottom; width: 12px; cursor: se-resize; margin: 0 2px; @@ -1719,11 +1720,11 @@ div.inside { } .postbox.closed h3 { - -moz-border-radius-bottomleft:4px; + -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; - -moz-border-radius-bottomright:4px; + -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; @@ -1765,6 +1766,7 @@ div.inside { } #titlediv { + position: relative; margin-bottom: 20px; } #titlediv label { cursor: text; } @@ -1788,10 +1790,18 @@ div.inside { -webkit-border-radius: 6px; border-radius: 6px; font-size: 1.7em; + line-height: 100%; width: 100%; outline: none; } +#titlediv #title-prompt-text { + color: #bbb; + position: absolute; + font-size: 1.7em; + padding: 8px; +} + #poststuff .inside-submitbox, #side-sortables .inside-submitbox { margin: 0 3px; @@ -1921,36 +1931,37 @@ input#link_url { /* Categories */ -#category-adder { +.category-adder { margin-left: 120px; padding: 4px 0; } -#category-adder h4 { +.category-adder h4 { margin: 0 0 8px; } -#side-sortables #category-adder { +#side-sortables .category-adder { margin: 0; } -#post-body #category-add input, #category-add select { +#post-body .category-add input, .category-add select { width: 30%; } -#side-sortables #category-add input { +#side-sortables .category-add input { width: 94%; } -#side-sortables #category-add select { +#side-sortables .category-add select { width: 100%; } -#category-add input#category-add-sumbit { +#side-sortables .category-add input.category-add-sumbit, #post-body .category-add input.category-add input.category-add-sumbit { width: auto; } -#post-body ul#category-tabs { +#post-body ul.category-tabs, +#post-body ul.add-menu-item-tabs { float: left; width: 120px; text-align: right; @@ -1959,11 +1970,13 @@ input#link_url { padding: 0; } -#post-body ul#category-tabs li { +#post-body ul.category-tabs li, +#post-body ul.add-menu-item-tabs li { padding: 8px; } -#post-body ul#category-tabs li.tabs { +#post-body ul.category-tabs li.tabs, +#post-body ul.add-menu-item-tabs li.tabs { -moz-border-radius: 3px 0 0 3px; -webkit-border-top-left-radius: 3px; -webkit-border-bottom-left-radius: 3px; @@ -1973,12 +1986,16 @@ input#link_url { border-bottom-left-radius: 3px; } -#post-body ul#category-tabs li.tabs a { +#post-body ul.category-tabs li.tabs a, +#post-body ul.add-menu-item-tabs li.tabs a { font-weight: bold; text-decoration: none; } -#categorydiv div.tabs-panel, +.categorydiv div.tabs-panel, +.customlinkdiv div.tabs-panel, +.posttypediv div.tabs-panel, +.taxonomydiv div.tabs-panel, #linkcategorydiv div.tabs-panel { height: 200px; overflow: auto; @@ -1987,32 +2004,59 @@ input#link_url { border-width: 1px; } -#post-body #categorydiv div.tabs-panel, +.nav-menus-php .customlinkdiv div.tabs-panel, +.nav-menus-php .posttypediv div.tabs-panel, +.nav-menus-php .taxonomydiv div.tabs-panel { + height: auto; + max-height: 205px; +} + +div.tabs-panel-active { + display:block; +} + +div.tabs-panel-inactive { + display:none; +} + +#post-body .categorydiv div.tabs-panel, +.taxonomy div.tabs-panel, #post-body #linkcategorydiv div.tabs-panel { margin: 0 5px 0 125px; } -#side-sortables #category-tabs li { +#side-sortables .category-tabs li, +#side-sortables .add-menu-item-tabs li { display: inline; - padding-right: 8px; } -#side-sortables #category-tabs a { +#side-sortables .category-tabs a, +#side-sortables .add-menu-item-tabs a { text-decoration: none; } -#side-sortables #category-tabs { +#side-sortables .category-tabs, +#side-sortables .add-menu-item-tabs { margin-bottom: 3px; } -#categorydiv ul, +.categorydiv ul, +.customlinkdiv ul, +.posttypediv ul, +.taxonomydiv ul, #linkcategorydiv ul { list-style: none; padding: 0; margin: 0; } -#categorydiv ul.categorychecklist ul, +#front-page-warning, +#front-static-pages ul, +.inline-editor ul.cat-checklist ul, +.categorydiv ul.categorychecklist ul, +.customlinkdiv ul.categorychecklist ul, +.posttypediv ul.categorychecklist ul, +.taxonomydiv ul.categorychecklist ul, #linkcategorydiv ul.categorychecklist ul { margin-left: 18px; } @@ -2021,35 +2065,43 @@ ul.categorychecklist li { margin: 0; padding: 0; line-height: 19px; + word-wrap: break-word; } -#category-adder h4 { +.category-adder h4 { margin-top: 4px; margin-bottom: 0px; } -#categorydiv .tabs-panel { +.categorydiv .tabs-panel, +.customlinkdiv .tabs-panel, +.posttypediv .tabs-panel, +.taxonomydiv .tabs-panel { border-width: 3px; border-style: solid; } -ul#category-tabs { +ul.category-tabs, +ul.add-menu-item-tabs { margin-top: 12px; } -ul#category-tabs li.tabs { +ul.category-tabs li.tabs, +ul.add-menu-item-tabs li.tabs { border-style: solid solid none; border-width: 1px 1px 0; } -#post-body #category-tabs li.tabs { +#post-body .category-tabs li.tabs, +#post-body .add-menu-item-tabs li.tabs { border-style: solid none solid solid; border-width: 1px 0 1px 1px; margin-right: -1px; } -ul#category-tabs li { - padding: 5px 8px; +ul.category-tabs li, +ul.add-menu-item-tabs li { + padding: 5px; -moz-border-radius: 3px 3px 0 0; -webkit-border-top-left-radius: 3px; -webkit-border-top-right-radius: 3px; @@ -2102,8 +2154,7 @@ td.plugin-title { /* Global classes */ .wp-hidden-children .wp-hidden-child, -.ui-tabs-hide, -#codepress-off { +.ui-tabs-hide { display: none; } @@ -2404,8 +2455,9 @@ fieldset { #replysubmit img.waiting, .inline-edit-save img.waiting { - padding: 2px 10px 0; + padding: 4px 10px 0; vertical-align: top; + float: right; } #replysubmit .button { @@ -2471,7 +2523,7 @@ fieldset { } #screen-meta-links { - margin: 0 9px 0 0; + margin: 0 18px 0 0; } #screen-meta .screen-reader-text { @@ -2481,11 +2533,20 @@ fieldset { #screen-options-link-wrap, #contextual-help-link-wrap { float: right; - background: transparent url( images/screen-options-left.gif ) no-repeat 0 0; - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; height: 22px; padding: 0; margin: 0 6px 0 0; + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; + background: #e3e3e3; + -moz-border-radius-bottomleft: 3px; + -moz-border-radius-bottomright: 3px; + -webkit-border-bottom-left-radius: 3px; + -webkit-border-bottom-right-radius: 3px; +} + +#contextual-help-wrap li { + list-style-type: disc; + margin-left: 18px; } #screen-meta a.show-settings { @@ -2501,7 +2562,7 @@ fieldset { } #screen-meta a.show-settings { - background-image: url( images/screen-options-right.gif ); + background-image: url( ../images/screen-options-right.gif?ver=20100531 ); } #screen-meta a.show-settings:hover { @@ -2837,7 +2898,7 @@ table .inline-edit-row fieldset ul.cat-hover { } .describe .media-item-info .A1B1 { - padding: 0 15px 8px 0; + padding: 0 0 0 10px; } #wpbody-content .filename { @@ -2895,6 +2956,7 @@ abbr.required { padding: 0 0 0 5px; } +.media-item .error-div a.dismiss, .describe-toggle-on, .describe-toggle-off { display: block; @@ -2931,6 +2993,10 @@ abbr.required { overflow: hidden; } +.media-item .error-div { + padding-left: 10px; +} + .media-item .pinkynail { float: left; margin: 2px; @@ -2946,7 +3012,7 @@ abbr.required { .media-item .original { position: relative; height: 34px; - text-align: center; + width: 503px; } .media-item .percent { @@ -2960,20 +3026,6 @@ abbr.required { margin-right: 5px; } -button.dismiss { - position: absolute; - top: 7px; - right: 5px; - z-index: 4; - width: 8em; -} - -.file-error { - float: left; - font-weight: bold; - padding: 10px; -} - .progress { position: relative; margin-bottom: -36px; @@ -3074,7 +3126,7 @@ button.dismiss { #favorite-inside { margin: 0 0 0 0px; - padding: 0 1px 6px 1px; + padding: 2px 1px; border-width: 1px; border-style: solid; position: absolute; @@ -3115,8 +3167,7 @@ button.dismiss { -khtml-border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0; - border-bottom-width: 1px; - border-bottom-style: solid; + border-bottom: none; } #utc-time, #local-time { @@ -3374,7 +3425,7 @@ td.imgedit-settings input { .imgedit-wait { position: absolute; top: 0; - background: #FFFFFF url(images/wpspin_light.gif) no-repeat scroll 22px 10px; + background: #FFFFFF url(../images/wpspin_light.gif) no-repeat scroll 22px 10px; opacity: 0.7; filter: alpha(opacity=70); width: 100%; @@ -3415,7 +3466,7 @@ td.imgedit-settings input { } .imgedit-crop { - background: transparent url(images/imgedit-icons.png) no-repeat scroll -9px -31px; + background: transparent url(../images/imgedit-icons.png) no-repeat scroll -9px -31px; margin: 0 8px 0 0; } @@ -3428,7 +3479,7 @@ td.imgedit-settings input { } .imgedit-rleft { - background: transparent url(images/imgedit-icons.png) no-repeat scroll -46px -31px; + background: transparent url(../images/imgedit-icons.png) no-repeat scroll -46px -31px; margin: 0 3px; } @@ -3441,7 +3492,7 @@ td.imgedit-settings input { } .imgedit-rright { - background: transparent url(images/imgedit-icons.png) no-repeat scroll -77px -31px; + background: transparent url(../images/imgedit-icons.png) no-repeat scroll -77px -31px; margin: 0 8px 0 3px; } @@ -3454,7 +3505,7 @@ td.imgedit-settings input { } .imgedit-flipv { - background: transparent url(images/imgedit-icons.png) no-repeat scroll -115px -31px; + background: transparent url(../images/imgedit-icons.png) no-repeat scroll -115px -31px; margin: 0 3px; } @@ -3467,7 +3518,7 @@ td.imgedit-settings input { } .imgedit-fliph { - background: transparent url(images/imgedit-icons.png) no-repeat scroll -147px -31px; + background: transparent url(../images/imgedit-icons.png) no-repeat scroll -147px -31px; margin: 0 8px 0 3px; } @@ -3480,7 +3531,7 @@ td.imgedit-settings input { } .imgedit-undo { - background: transparent url(images/imgedit-icons.png) no-repeat scroll -184px -31px; + background: transparent url(../images/imgedit-icons.png) no-repeat scroll -184px -31px; margin: 0 3px; } @@ -3493,7 +3544,7 @@ td.imgedit-settings input { } .imgedit-redo { - background: transparent url(images/imgedit-icons.png) no-repeat scroll -215px -31px; + background: transparent url(../images/imgedit-icons.png) no-repeat scroll -215px -31px; margin: 0 8px 0 3px; } @@ -3597,7 +3648,7 @@ span.imgedit-scale-warn { /* tag hints */ .taghint { color: #aaa; - margin: 14px 0 -17px 8px; + margin: 15px 0 -24px 12px; } #poststuff .tagsdiv .howto { @@ -3630,3 +3681,86 @@ span.imgedit-scale-warn { border-right-style: solid; border-right-width: 1px; } + +/* Custom Background */ + +div#custom-background-image { + min-height: 100px; + border: 1px solid #dfdfdf; +} + +div#custom-background-image img { + max-width: 400px; + max-height: 300px; +} + +#custom-background label { + padding-right: 15px; +} + +/* Custom Header */ +.appearance_page_custom-header #headimg { + border: 1px solid #DFDFDF; + min-height: 100px; + width: 100%; +} + +.appearance_page_custom-header #upload-form p label { + font-size: 11px; +} + +.appearance_page_custom-header #available-headers .default-header { + float: left; + margin: 0 20px 20px 0; +} + +.appearance_page_custom-header #available-headers label input { + margin-right: 10px; +} + +.appearance_page_custom-header #available-headers label img { + vertical-align: middle; +} + +/* Tab Interface */ + +.nav-tab { + border-style: solid; + border-color: #ccc #ccc #f9f9f9; + border-width: 1px 1px 0; + color: #c1c1c1; + text-shadow: rgba(255,255,255,1) 0 1px 0; + font-size: 12px; + line-height: 16px; + display: inline-block; + padding: 4px 14px 6px; + text-decoration: none; + margin: 0 6px -1px 0; + -moz-border-radius: 5px 5px 0 0; + -webkit-border-top-left-radius: 5px; + -webkit-border-top-right-radius: 5px; + -khtml-border-top-left-radius: 5px; + -khtml-border-top-right-radius: 5px; + border-top-left-radius: 5px; + border-top-right-radius: 5px; +} + +.nav-tab-active { + border-width: 1px; + color: #464646; +} + +.themes-php .wrap h2, .theme-install-php .wrap h2 { + border-bottom: 1px solid #ccc; + padding-bottom: 0; +} + +h2 .nav-tab { + padding: 4px 20px 6px; + font: italic normal normal 24px/35px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; +} + +/* Scrollbar fix for bulk upgrade iframe */ +body.update-php { + height: 98%; +} diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php new file mode 100644 index 00000000..413c564f --- /dev/null +++ b/wp-admin/custom-background.php @@ -0,0 +1,359 @@ +admin_header_callback = $admin_header_callback; + $this->admin_image_div_callback = $admin_image_div_callback; + } + + /** + * Set up the hooks for the Custom Background admin page. + * + * @since 3.0.0 + */ + function init() { + if ( ! current_user_can('edit_theme_options') ) + return; + + $this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array(&$this, 'admin_page')); + + add_action("load-$page", array(&$this, 'admin_load')); + add_action("load-$page", array(&$this, 'take_action'), 49); + add_action("load-$page", array(&$this, 'handle_upload'), 49); + + if ( $this->admin_header_callback ) + add_action("admin_head-$page", $this->admin_header_callback, 51); + } + + /** + * Set up the enqueue for the CSS & JavaScript files. + * + * @since 3.0.0 + */ + function admin_load() { + add_contextual_help( $this->page, '

' . __( 'You can customize the look of your site without touching any of your theme’s code by using a custom background. Your background can be an image or a color.' ) . '

' . + '

' . __( 'To use a background image, simply upload it, then choose your display options below. You can display a single instance of your image, or tile it to fill the screen. You can have your background fixed in place, so your site content moves on top of it, or you can have it scroll with your site.' ) . '

' . + '

' . __( 'You can also choose a background color. If you know the hexadecimal code for the color you want, enter it in the Color field. If not, click on the Select a Color link, and a color picker will allow you to choose the exact shade you want.' ) . '

' . + '

' . __( 'Don’t forget to click on the Save Changes button when you are finished.' ) . '

' . + '

' . __( 'For more information:' ) . '

' . + '

' . __( 'Documentation on Custom Background' ) . '

' . + '

' . __( 'Support Forums' ) . '

' ); + wp_enqueue_script('custom-background'); + wp_enqueue_style('farbtastic'); + } + + /** + * Execute custom background modification. + * + * @since 3.0.0 + */ + function take_action() { + + if ( empty($_POST) ) + return; + + if ( isset($_POST['reset-background']) ) { + check_admin_referer('custom-background-reset', '_wpnonce-custom-background-reset'); + remove_theme_mod('background_image'); + remove_theme_mod('background_image_thumb'); + $this->updated = true; + return; + } + + if ( isset($_POST['remove-background']) ) { + // @TODO: Uploaded files are not removed here. + check_admin_referer('custom-background-remove', '_wpnonce-custom-background-remove'); + set_theme_mod('background_image', ''); + set_theme_mod('background_image_thumb', ''); + $this->updated = true; + return; + } + + if ( isset($_POST['background-repeat']) ) { + check_admin_referer('custom-background'); + if ( in_array($_POST['background-repeat'], array('repeat', 'no-repeat', 'repeat-x', 'repeat-y')) ) + $repeat = $_POST['background-repeat']; + else + $repeat = 'repeat'; + set_theme_mod('background_repeat', $repeat); + } + + if ( isset($_POST['background-position-x']) ) { + check_admin_referer('custom-background'); + if ( in_array($_POST['background-position-x'], array('center', 'right', 'left')) ) + $position = $_POST['background-position-x']; + else + $position = 'left'; + set_theme_mod('background_position_x', $position); + } + + if ( isset($_POST['background-attachment']) ) { + check_admin_referer('custom-background'); + if ( in_array($_POST['background-attachment'], array('fixed', 'scroll')) ) + $attachment = $_POST['background-attachment']; + else + $attachment = 'fixed'; + set_theme_mod('background_attachment', $attachment); + } + + if ( isset($_POST['background-color']) ) { + check_admin_referer('custom-background'); + $color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['background-color']); + if ( strlen($color) == 6 || strlen($color) == 3 ) + set_theme_mod('background_color', $color); + else + set_theme_mod('background_color', ''); + } + + $this->updated = true; + } + + /** + * Display the custom background page. + * + * @since 3.0.0 + */ + function admin_page() { +?> +
+ +

+updated) ) { ?> +
+

Visit your site to see how it looks.' ), home_url( '/' ) ); ?>

+
+admin_image_div_callback ) { + call_user_func($this->admin_image_div_callback); + } else { +?> +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + +
+ +
+ + +
+ + +
+
+ +
+ +
+
+
+ + + +

+
+
+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ + +
+ + + +
+ + +

+
+ +
+ false); + $file = wp_handle_upload($_FILES['import'], $overrides); + + if ( isset($file['error']) ) + wp_die( $file['error'] ); + + $url = $file['url']; + $type = $file['type']; + $file = $file['file']; + $filename = basename($file); + + // Construct the object array + $object = array( + 'post_title' => $filename, + 'post_content' => $url, + 'post_mime_type' => $type, + 'guid' => $url + ); + + // Save the data + $id = wp_insert_attachment($object, $file); + + // Add the meta-data + wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); + + set_theme_mod('background_image', esc_url($url)); + + $thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' ); + set_theme_mod('background_image_thumb', esc_url( $thumbnail[0] ) ); + + do_action('wp_create_file_in_uploads', $file, $id); // For replication + $this->updated = true; + } + +} +?> diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index fb07fe80..7e889f5b 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -9,7 +9,7 @@ /** * The custom header image class. * - * @since unknown + * @since 2.1.0 * @package WordPress * @subpackage Administration */ @@ -19,41 +19,88 @@ class Custom_Image_Header { * Callback for administration header. * * @var callback - * @since unknown + * @since 2.1.0 * @access private */ var $admin_header_callback; + /** + * Callback for header div. + * + * @var callback + * @since 3.0.0 + * @access private + */ + var $admin_image_div_callback; + + /** + * Holds default headers. + * + * @var array + * @since 3.0.0 + * @access private + */ + var $default_headers = array(); + + /** + * Holds the page menu hook. + * + * @var string + * @since 3.0.0 + * @access private + */ + var $page = ''; + /** * PHP4 Constructor - Register administration header callback. * - * @since unknown + * @since 2.1.0 * @param callback $admin_header_callback + * @param callback $admin_image_div_callback Optional custom image div output callback. * @return Custom_Image_Header */ - function Custom_Image_Header($admin_header_callback) { + function Custom_Image_Header($admin_header_callback, $admin_image_div_callback = '') { $this->admin_header_callback = $admin_header_callback; + $this->admin_image_div_callback = $admin_image_div_callback; } /** - * Setup the hooks for the Custom Header admin page. + * Set up the hooks for the Custom Header admin page. * - * @since unknown + * @since 2.1.0 */ function init() { - $page = add_theme_page(__('Custom Header'), __('Custom Header'), 'edit_themes', 'custom-header', array(&$this, 'admin_page')); + if ( ! current_user_can('edit_theme_options') ) + return; + + $this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array(&$this, 'admin_page')); add_action("admin_print_scripts-$page", array(&$this, 'js_includes')); add_action("admin_print_styles-$page", array(&$this, 'css_includes')); + add_action("admin_head-$page", array(&$this, 'help') ); add_action("admin_head-$page", array(&$this, 'take_action'), 50); add_action("admin_head-$page", array(&$this, 'js'), 50); add_action("admin_head-$page", $this->admin_header_callback, 51); } + /** + * Adds contextual help. + * + * @since 3.0.0 + */ + function help() { + add_contextual_help( $this->page, '

' . __( 'You can set a custom image header for your site. Simply upload the image and crop it, and the new header will go live immediately.' ) . '

' . + '

' . __( 'If you want to discard your custom header and go back to the default included in your theme, click on the buttons to remove the custom image and restore the original header image.' ) . '

' . + '

' . __( 'Some themes come with additional header images bundled. If you see multiple images displayed, select the one you’d like and click the Save Changes button.' ) . '

' . + '

' . __( 'For more information:' ) . '

' . + '

' . __( 'Documentation on Custom Header' ) . '

' . + '

' . __( 'Support Forums' ) . '

' ); + } + /** * Get the current step. * - * @since unknown + * @since 2.6.0 * * @return int Current step */ @@ -69,142 +116,238 @@ class Custom_Image_Header { } /** - * Setup the enqueue for the JavaScript files. + * Set up the enqueue for the JavaScript files. * - * @since unknown + * @since 2.1.0 */ function js_includes() { $step = $this->step(); - if ( 1 == $step ) + if ( ( 1 == $step || 3 == $step ) && $this->header_text() ) wp_enqueue_script('farbtastic'); elseif ( 2 == $step ) - wp_enqueue_script('jcrop'); + wp_enqueue_script('imgareaselect'); } /** - * Setup the enqueue for the CSS files + * Set up the enqueue for the CSS files * * @since 2.7 */ function css_includes() { $step = $this->step(); - if ( 1 == $step ) + if ( ( 1 == $step || 3 == $step ) && $this->header_text() ) wp_enqueue_style('farbtastic'); elseif ( 2 == $step ) - wp_enqueue_style('jcrop'); + wp_enqueue_style('imgareaselect'); + } + + /** + * Check if header text is allowed + * + * @since 3.0.0 + */ + function header_text() { + if ( defined( 'NO_HEADER_TEXT' ) && NO_HEADER_TEXT ) + return false; + + return true; } /** * Execute custom header modification. * - * @since unknown + * @since 2.6.0 */ function take_action() { - if ( isset( $_POST['textcolor'] ) ) { - check_admin_referer('custom-header'); - if ( 'blank' == $_POST['textcolor'] ) { - set_theme_mod('header_textcolor', 'blank'); + if ( ! current_user_can('edit_theme_options') ) + return; + + if ( empty( $_POST ) ) + return; + + $this->updated = true; + + if ( isset( $_POST['resetheader'] ) ) { + check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' ); + remove_theme_mod( 'header_image' ); + return; + } + + if ( isset( $_POST['resettext'] ) ) { + check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' ); + remove_theme_mod('header_textcolor'); + return; + } + + if ( isset( $_POST['removeheader'] ) ) { + check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' ); + set_theme_mod( 'header_image', '' ); + return; + } + + if ( isset( $_POST['text-color'] ) ) { + check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' ); + $_POST['text-color'] = str_replace( '#', '', $_POST['text-color'] ); + if ( 'blank' == $_POST['text-color'] ) { + set_theme_mod( 'header_textcolor', 'blank' ); } else { - $color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['textcolor']); + $color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['text-color']); if ( strlen($color) == 6 || strlen($color) == 3 ) set_theme_mod('header_textcolor', $color); } } - if ( isset($_POST['resetheader']) ) { - check_admin_referer('custom-header'); - remove_theme_mods(); + + if ( isset($_POST['default-header']) ) { + check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' ); + $this->process_default_headers(); + if ( isset($this->default_headers[$_POST['default-header']]) ) + set_theme_mod('header_image', esc_url($this->default_headers[$_POST['default-header']]['url'])); + } + } + + /** + * Process the default headers + * + * @since 3.0.0 + */ + function process_default_headers() { + global $_wp_default_headers; + + if ( !empty($this->headers) ) + return; + + if ( !isset($_wp_default_headers) ) + return; + + $this->default_headers = $_wp_default_headers; + foreach ( array_keys($this->default_headers) as $header ) { + $this->default_headers[$header]['url'] = sprintf( $this->default_headers[$header]['url'], get_template_directory_uri(), get_stylesheet_directory_uri() ); + $this->default_headers[$header]['thumbnail_url'] = sprintf( $this->default_headers[$header]['thumbnail_url'], get_template_directory_uri(), get_stylesheet_directory_uri() ); + } + } + + /** + * Display UI for selecting one of several default headers. + * + * @since 3.0.0 + */ + function show_default_header_selector() { + echo '
'; + foreach ( $this->default_headers as $header_key => $header ) { + $header_thumbnail = $header['thumbnail_url']; + $header_url = $header['url']; + $header_desc = $header['description']; + echo '
'; + echo ''; + echo '
'; } + echo '
'; } /** * Execute Javascript depending on step. * - * @since unknown + * @since 2.1.0 */ function js() { $step = $this->step(); - if ( 1 == $step ) + if ( ( 1 == $step || 3 == $step ) && $this->header_text() ) $this->js_1(); elseif ( 2 == $step ) $this->js_2(); } /** - * Display Javascript based on Step 1. + * Display Javascript based on Step 1 and 3. * - * @since unknown + * @since 2.6.0 */ function js_1() { ?> -
-

-
- + $this->process_default_headers(); +?>
-

-

+

-
-

-
+updated ) ) { ?> +
+

Visit your site to see how it looks.' ), home_url( '/' ) ); ?>

- -
- - - -
- -
-
-

-

%1$d x %2$d pixels will be used as-is.'), HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT); ?>

- -
-
- - -

- -

-
+

+ + - - -
-

-

-
- - +
+ + + + + + + + + +
+ admin_image_div_callback ) { + call_user_func( $this->admin_image_div_callback ); + } else { + ?> +
+ header_text() ) + $style = ' style="display:none;"'; + else + $style = ' style="color:#' . get_theme_mod( 'header_textcolor', HEADER_TEXTCOLOR ) . ';"'; + ?> +

onclick="return false;" href="">

+
>
+
+ +
+


+ %1$d × %2$d pixels will be used as-is.' ), HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT ); ?>

+ +

+
+ + + + +

+ +
+ +
+ + + default_headers ) ) : ?> + + + + + + + + + + + + + + + + +
+

+ show_default_header_selector(); + ?> +
+

+ +
+

+ +
+ + header_text() ) : ?> +

+ + + + + + + + + + + + + + + + + + + + +
+

+ + + +

+
+

+ + #blank as text color.' );?> + +

+ +
+

+ +
+ +

- false); $file = wp_handle_upload($_FILES['import'], $overrides); if ( isset($file['error']) ) - die( $file['error'] ); + wp_die( $file['error'], __( 'Image Upload Error' ) ); $url = $file['url']; $type = $file['type']; @@ -360,6 +601,9 @@ class Custom_Image_Header { } elseif ( $width > HEADER_IMAGE_WIDTH ) { $oitar = $width / HEADER_IMAGE_WIDTH; $image = wp_crop_image($file, 0, 0, $width, $height, HEADER_IMAGE_WIDTH, $height / $oitar, false, str_replace(basename($file), 'midsize-'.basename($file), $file)); + if ( is_wp_error( $image ) ) + wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) ); + $image = apply_filters('wp_create_file_in_uploads', $image, $id); // For replication $url = str_replace(basename($url), basename($image), $url); @@ -371,27 +615,27 @@ class Custom_Image_Header { ?>
- -
- -

-
- -
- -

- - - - - - - - - - -

- + +

+ + +

+

+ +
+ +
+ +

+ + + + + + + + +

1 ) { $_POST['x1'] = $_POST['x1'] * $_POST['oitar']; $_POST['y1'] = $_POST['y1'] * $_POST['oitar']; @@ -414,6 +658,9 @@ class Custom_Image_Header { $original = get_attached_file( $_POST['attachment_id'] ); $cropped = wp_crop_image($_POST['attachment_id'], $_POST['x1'], $_POST['y1'], $_POST['width'], $_POST['height'], HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT); + if ( is_wp_error( $cropped ) ) + wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) ); + $cropped = apply_filters('wp_create_file_in_uploads', $cropped, $_POST['attachment_id']); // For replication $parent = get_post($_POST['attachment_id']); @@ -446,25 +693,21 @@ class Custom_Image_Header { /** * Display last step of custom header image page. * - * @since unknown + * @since 2.1.0 */ function finished() { - ?> -
-

- -

- -
- updated = true; + $this->step_1(); } /** * Display the page based on the current step. * - * @since unknown + * @since 2.1.0 */ function admin_page() { + if ( ! current_user_can('edit_theme_options') ) + wp_die(__('You do not have permission to customize headers.')); $step = $this->step(); if ( 1 == $step ) $this->step_1(); diff --git a/wp-admin/edit-attachment-rows.php b/wp-admin/edit-attachment-rows.php index 1b972a9f..0014d720 100644 --- a/wp-admin/edit-attachment-rows.php +++ b/wp-admin/edit-attachment-rows.php @@ -71,7 +71,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) { if ( $is_trash ) echo $thumb; else { ?> - + @@ -84,25 +84,33 @@ foreach ($posts_columns as $column_name => $column_display_name ) { case 'media': ?> - >
- ID))); ?> + >

ID ), $matches ) ) + echo esc_html( strtoupper( $matches[1] ) ); + else + echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) ); + ?> +

+ ID) && !$is_trash ) $actions['edit'] = '' . __('Edit') . ''; if ( current_user_can('delete_post', $post->ID) ) { if ( $is_trash ) - $actions['untrash'] = "ID) . "'>" . __('Restore') . ""; + $actions['untrash'] = "ID) . "'>" . __('Restore') . ""; elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) - $actions['trash'] = "ID) . "'>" . __('Trash') . ""; + $actions['trash'] = "ID) . "'>" . __('Trash') . ""; if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) { $delete_ays = (!$is_trash && !MEDIA_TRASH) ? " onclick='return showNotice.warn();'" : ''; - $actions['delete'] = "ID) . "'>" . __('Delete Permanently') . ""; + $actions['delete'] = "ID) . "'>" . __('Delete Permanently') . ""; } } - if ( !$is_trash ) + if ( !$is_trash ) { + $title =_draft_or_post_title($post->post_parent); $actions['view'] = '' . __('View') . ''; + } $actions = apply_filters( 'media_row_actions', $actions, $post ); $action_count = count($actions); $i = 0; @@ -113,7 +121,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) { echo "$link$sep"; } echo '
'; - ?>

+ ?> name ) ) - $category->name = ''; - - if ( ! isset( $category->slug ) ) - $category->slug = ''; - - if ( ! isset( $category->parent ) ) - $category->parent = ''; - - if ( ! isset( $category->description ) ) - $category->description = ''; -} - -do_action('edit_category_form_pre', $category); - -_fill_empty_category($category); -?> - -
- -

-
-
- - - - - - - - - - - - - - - - - - - - - -

-
- 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'exclude' => $category->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?>
- -

-
-

- -
-
diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index ee23b3e3..7f11bef4 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -7,7 +7,7 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); if ( !current_user_can('edit_posts') ) wp_die(__('Cheatin’ uh?')); @@ -32,10 +32,11 @@ if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_R $comment_ids = array_map( 'absint', explode(',', $_REQUEST['ids']) ); $doaction = $_REQUEST['action']; } else { - wp_redirect($_SERVER['HTTP_REFERER']); + wp_redirect( wp_get_referer() ); } $approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0; + $redirect_to = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids'), wp_get_referer() ); foreach ($comment_ids as $comment_id) { // Check the permissions on each $_post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment_id) ); @@ -75,8 +76,6 @@ if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_R } } - $redirect_to = 'edit-comments.php'; - if ( $approved ) $redirect_to = add_query_arg( 'approved', $approved, $redirect_to ); if ( $unapproved ) @@ -94,30 +93,33 @@ if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_R if ( $trashed || $spammed ) $redirect_to = add_query_arg( 'ids', join(',', $comment_ids), $redirect_to ); - if ( $post_id ) - $redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to ); - if ( isset($_REQUEST['apage']) ) - $redirect_to = add_query_arg( 'apage', absint($_REQUEST['apage']), $redirect_to ); - if ( !empty($_REQUEST['mode']) ) - $redirect_to = add_query_arg('mode', $_REQUEST['mode'], $redirect_to); - if ( !empty($_REQUEST['comment_status']) ) - $redirect_to = add_query_arg('comment_status', $_REQUEST['comment_status'], $redirect_to); - if ( !empty($_REQUEST['s']) ) - $redirect_to = add_query_arg('s', $_REQUEST['s'], $redirect_to); wp_redirect( $redirect_to ); -} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { + exit; +} elseif ( ! empty($_GET['_wp_http_referer']) ) { wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); exit; } if ( $post_id ) - $title = sprintf(__('Edit Comments on “%s”'), wp_html_excerpt(_draft_or_post_title($post_id), 50)); + $title = sprintf(__('Comments on “%s”'), wp_html_excerpt(_draft_or_post_title($post_id), 50)); else - $title = __('Edit Comments'); - -require_once('admin-header.php'); - -$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : esc_attr($_GET['mode']); + $title = __('Comments'); + +add_contextual_help( $current_screen, '

' . __('You can manage comments made on your site similar to the way you manage Posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the Bulk Actions.') . '

' . + '

' . __('A yellow row means the comment is waiting for you to moderate it.') . '

' . + '

' . __('In the Author column, in addition to the author’s name, email address, and blog URL, the commenter’s IP address is shown. Clicking on this link will show you all the comments made from this IP address.') . '

' . + '

' . __('In the Comment column, above each comment it says “Submitted on,” followed by the date and time the comment was left on your site. Clicking on the date/time link will take you to that comment on your live site.') . '

' . + '

' . __('In the In Response To column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The “#” permalink symbol below leads to that post on your live site. The small bubble with the number in it shows how many comments that post has received. If the bubble is gray, you have moderated all comments for that post. If it is blue, there are pending comments. Clicking the bubble will filter the comments screen to show only comments on that post.') . '

' . + '

' . __('Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link below to learn more.') . '

' . + '

' . __( 'For more information:' ) . '

' . + '

' . __( 'Comments Documentation' ) . '

' . + '

' . __( 'Comment Spam Documentation') . '

' . + '

' . __( 'Keyboard Shortcuts Documentation') . '

' . + '

' . __( 'Support Forums') . '

' +); +require_once('./admin-header.php'); + +$mode = ( empty($_GET['mode']) ) ? 'detail' : esc_attr($_GET['mode']); $comment_status = isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all'; if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam', 'trash')) ) @@ -136,45 +138,68 @@ if ( isset($_GET['s']) && $_GET['s'] ) 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 ) { - echo '

'; - - if ( $approved > 0 ) { - printf( _n( '%s comment approved', '%s comments approved', $approved ), $approved ); - echo '
'; - } +if ( isset( $_GET['error'] ) ) { + $error = (int) $_GET['error']; + $error_msg = ''; + switch ( $error ) { + case 1 : + $error_msg = __( 'Oops, no comment with this ID.' ); + break; + case 2 : + $error_msg = __( 'You are not allowed to edit comments on this post.' ); + break; + } + if ( $error_msg ) + echo '

' . $error_msg . '

'; +} + +if ( isset($_GET['approved']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) || isset($_GET['spammed']) || isset($_GET['unspammed']) || isset($_GET['same']) ) { + $approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0; + $deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0; + $trashed = isset( $_GET['trashed'] ) ? (int) $_GET['trashed'] : 0; + $untrashed = isset( $_GET['untrashed'] ) ? (int) $_GET['untrashed'] : 0; + $spammed = isset( $_GET['spammed'] ) ? (int) $_GET['spammed'] : 0; + $unspammed = isset( $_GET['unspammed'] ) ? (int) $_GET['unspammed'] : 0; + $same = isset( $_GET['same'] ) ? (int) $_GET['same'] : 0; + + if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) { + if ( $approved > 0 ) + $messages[] = sprintf( _n( '%s comment approved', '%s comments approved', $approved ), $approved ); + if ( $spammed > 0 ) { - printf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ); $ids = isset($_GET['ids']) ? $_GET['ids'] : 0; - echo ' ' . __('Undo') . '
'; - } - if ( $unspammed > 0 ) { - printf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed ); - echo '
'; + $messages[] = sprintf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ) . ' ' . __('Undo') . '
'; } + + if ( $unspammed > 0 ) + $messages[] = sprintf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed ); + if ( $trashed > 0 ) { - printf( _n( '%s comment moved to the trash.', '%s comments moved to the trash.', $trashed ), $trashed ); $ids = isset($_GET['ids']) ? $_GET['ids'] : 0; - echo ' ' . __('Undo') . '
'; - } - if ( $untrashed > 0 ) { - printf( _n( '%s comment restored from the trash', '%s comments restored from the trash', $untrashed ), $untrashed ); - echo '
'; + $messages[] = sprintf( _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), $trashed ) . ' ' . __('Undo') . '
'; } - if ( $deleted > 0 ) { - printf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted ); - echo '
'; + + if ( $untrashed > 0 ) + $messages[] = sprintf( _n( '%s comment restored from the Trash', '%s comments restored from the Trash', $untrashed ), $untrashed ); + + if ( $deleted > 0 ) + $messages[] = sprintf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted ); + + if ( $same > 0 && $comment = get_comment( $same ) ) { + switch ( $comment->comment_approved ) { + case '1' : + $messages[] = __('This comment is already approved.') . ' ' . __( 'Edit comment' ) . ''; + break; + case 'trash' : + $messages[] = __( 'This comment is already in the Trash.' ) . ' ' . __( 'View Trash' ) . ''; + break; + case 'spam' : + $messages[] = __( 'This comment is already marked as spam.' ) . ' ' . __( 'Edit comment' ) . ''; + break; + } } - echo '

'; + echo '

' . implode( "
\n", $messages ) . '

'; } } ?> @@ -187,7 +212,7 @@ $num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments //, number_format_i18n($num_comments->moderated) ), "" . number_format_i18n($num_comments->moderated) . ""), //, number_format_i18n($num_comments->spam) ), "" . number_format_i18n($num_comments->spam) . "") $stati = array( - 'all' => _n_noop('All', 'All'), // singular not used + 'all' => _nx_noop('All', 'All', 'comments'), // singular not used 'moderated' => _n_noop('Pending (%s)', 'Pending (%s)'), 'approved' => _n_noop('Approved', 'Approved'), // singular not used 'spam' => _n_noop('Spam (%s)', 'Spam (%s)'), @@ -202,10 +227,8 @@ if ( !empty($comment_type) && 'all' != $comment_type ) $link = add_query_arg( 'comment_type', $comment_type, $link ); foreach ( $stati as $status => $label ) { - $class = ''; + $class = ( $status == $comment_status ) ? ' class="current"' : ''; - if ( $status == $comment_status ) - $class = ' class="current"'; if ( !isset( $num_comments->$status ) ) $num_comments->$status = 10; $link = add_query_arg( 'comment_status', $status, $link ); @@ -236,7 +259,7 @@ unset($status_links);

comment_post_ID; } -$_comment_pending_count_temp = (array) get_pending_comments_num($_comment_post_ids); -foreach ( (array) $_comment_post_ids as $_cpid ) - $_comment_pending_count[$_cpid] = isset( $_comment_pending_count_temp[$_cpid] ) ? $_comment_pending_count_temp[$_cpid] : 0; -if ( empty($_comment_pending_count) ) - $_comment_pending_count = array(); + +$_comment_pending_count = get_pending_comments_num($_comment_post_ids); $comments = array_slice($_comments, 0, $comments_per_page); $extra_comments = array_slice($_comments, $comments_per_page); @@ -295,6 +315,7 @@ $page_links = paginate_links( array( +
+ + "; +$form_extra = ''; +if ( 'auto-draft' == $post->post_status ) { + if ( 'edit' == $action ) + $post->post_title = ''; $autosave = false; + $form_extra .= ""; } else { - $form_action = 'editpost'; - $form_extra = ""; $autosave = wp_get_post_autosave( $post_ID ); +} + +$form_action = 'editpost'; +$nonce_action = 'update-' . $post_type . '_' . $post_ID; +$form_extra .= ""; - // Detect if there exists an autosave newer than the post and if that autosave is different than the post - if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) { - foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) { - if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) { - $notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. View the autosave.' ), get_edit_post_link( $autosave->ID ) ); - break; - } +// Detect if there exists an autosave newer than the post and if that autosave is different than the post +if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) { + foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) { + if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) { + $notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. View the autosave' ), get_edit_post_link( $autosave->ID ) ); + break; } - unset($autosave_field, $_autosave_field); } + unset($autosave_field, $_autosave_field); } +$post_type_object = get_post_type_object($post_type); + // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action). -require_once('includes/meta-boxes.php'); +require_once('./includes/meta-boxes.php'); -add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'post', 'side', 'core'); +add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', $post_type, 'side', 'core'); -// all tag-style post taxonomies -foreach ( get_object_taxonomies('post') as $tax_name ) { - if ( !is_taxonomy_hierarchical($tax_name) ) { - $taxonomy = get_taxonomy($tax_name); - $label = isset($taxonomy->label) ? esc_attr($taxonomy->label) : $tax_name; +// all taxonomies +foreach ( get_object_taxonomies($post_type) as $tax_name ) { + $taxonomy = get_taxonomy($tax_name); + if ( ! $taxonomy->show_ui ) + continue; - add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', 'post', 'side', 'core'); - } + $label = $taxonomy->labels->name; + + if ( !is_taxonomy_hierarchical($tax_name) ) + add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', $post_type, 'side', 'core', array( 'taxonomy' => $tax_name )); + else + add_meta_box($tax_name . 'div', $label, 'post_categories_meta_box', $post_type, 'side', 'core', array( 'taxonomy' => $tax_name )); } -add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'side', 'core'); -if ( current_theme_supports( 'post-thumbnails', 'post' ) ) - add_meta_box('postimagediv', __('Post Thumbnail'), 'post_thumbnail_meta_box', 'post', 'side', 'low'); -add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'normal', 'core'); -add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', 'post', 'normal', 'core'); -add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'normal', 'core'); -do_action('dbx_post_advanced'); -add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'post', 'normal', 'core'); +if ( post_type_supports($post_type, 'page-attributes') ) + add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', $post_type, 'side', 'core'); + +if ( current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ) + && ( ! is_multisite() || ( ( $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ) ) && ! empty( $mu_media_buttons['image'] ) ) ) ) + add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', $post_type, 'side', 'low'); + +if ( post_type_supports($post_type, 'excerpt') ) + add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $post_type, 'normal', 'core'); -if ( 'publish' == $post->post_status || 'private' == $post->post_status ) - add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', 'post', 'normal', 'core'); +if ( post_type_supports($post_type, 'trackbacks') ) + add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', $post_type, 'normal', 'core'); -if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) ) - add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'normal', 'core'); +if ( post_type_supports($post_type, 'custom-fields') ) + add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', $post_type, 'normal', 'core'); -$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM -if ( $post->post_author && !in_array($post->post_author, $authors) ) - $authors[] = $post->post_author; -if ( $authors && count( $authors ) > 1 ) - add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'normal', 'core'); +do_action('dbx_post_advanced'); +if ( post_type_supports($post_type, 'comments') ) + add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', $post_type, 'normal', 'core'); + +if ( ('publish' == $post->post_status || 'private' == $post->post_status) && post_type_supports($post_type, 'comments') ) + add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', $post_type, 'normal', 'core'); -if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) - add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'normal', 'core'); +if ( !( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) + add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', $post_type, 'normal', 'core'); -do_action('do_meta_boxes', 'post', 'normal', $post); -do_action('do_meta_boxes', 'post', 'advanced', $post); -do_action('do_meta_boxes', 'post', 'side', $post); +if ( post_type_supports($post_type, 'author') ) { + $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM + if ( $post->post_author && !in_array($post->post_author, $authors) ) + $authors[] = $post->post_author; + if ( ( $authors && count( $authors ) > 1 ) || is_super_admin() ) + add_meta_box('authordiv', __('Author'), 'post_author_meta_box', $post_type, 'normal', 'core'); +} -require_once('admin-header.php'); +if ( post_type_supports($post_type, 'revisions') && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) + add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', $post_type, 'normal', 'core'); + +do_action('add_meta_boxes', $post_type, $post); +do_action('add_meta_boxes_' . $post_type, $post); + +do_action('do_meta_boxes', $post_type, 'normal', $post); +do_action('do_meta_boxes', $post_type, 'advanced', $post); +do_action('do_meta_boxes', $post_type, 'side', $post); + +if ( 'post' == $post_type ) { + add_contextual_help($current_screen, + '

' . __('The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes that allow you to add metadata to your post using drag and drop, and can minimize or expand them by clicking the title bar of the box. You can also hide any of the boxes by using the Screen Options tab, where you can also choose a 1- or 2-column layout for this screen.') . '

' . + '

' . __('Title - Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '

' . + '

' . __('Post editor - Enter the text for your post. There are two modes of editing: Visual and HTML. Choose the mode by clicking on the appropriate tab. Visual mode gives you a WYSIWYG editor. Click the last icon in the row to get a second row of controls. The HTML mode allows you to enter raw HTML along with your post text. You can insert media files by clicking the icons above the post editor and following the directions.') . '

' . + '

' . __('Publish - You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.') . '

' . + '

' . __('Featured Image - This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the featured image as a post thumbnail on the home page, a custom header, etc.') . '

' . + '

' . __('Send Trackbacks - Trackbacks are a way to notify legacy blog systems that you’ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they’ll be notified automatically using pingbacks, and this field is unnecessary.') . '

' . + '

' . __('Discussion - You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.') . '

' . + '

' . sprintf(__('You can also create posts with the Press This bookmarklet.'), 'options-writing.php') . '

' . + '

' . __('For more information:') . '

' . + '

' . __('Documentation on Writing Posts') . '

' . + '

' . __('Support Forums') . '

' + ); +} elseif ( 'page' == $post_type ) { + add_contextual_help($current_screen, '

' . __('Pages are similar to Posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest Pages under other Pages by making one the “Parent” of the other, creating a group of Pages.') . '

' . + '

' . __('Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. The Page editor mostly works the same Post editor, but there are some Page-specific features in the Page Attributes box:') . '

' . + '

' . __('Parent - You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how many levels you can nest pages.') . '

' . + '

' . __('Template - Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them in this dropdown menu.') . '

' . + '

' . __('Order - Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.') . '

' . + '

' . __('For more information:') . '

' . + '

' . __('Page Creation Documentation') . '

' . + '

' . __('Support Forums') . '

' + ); +} +require_once('./admin-header.php'); ?>
@@ -136,61 +202,70 @@ require_once('admin-header.php');

-

+

-
- - +> + - + - + post_status ) wp_original_referer_field(true, 'previous'); -echo $form_extra ?> +echo $form_extra; + +wp_nonce_field( 'autosave', 'autosavenonce', false ); +wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); +wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); +?>
- - - +
+
- +
ID); -if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) ) { ?> +$shortlink = wp_get_shortlink($post->ID, 'post'); +if ( !empty($shortlink) ) + $sample_permalink_html .= '' . __('Get Shortlink') . ''; + +if ( !( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>
-ID) && ! empty($sample_permalink_html) ) : - echo $sample_permalink_html; -endif; ?> + ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status ) + echo $sample_permalink_html; + ?>
+} +?>
+
+ +
post_content); ?> @@ -200,7 +275,7 @@ endif; ?>   post_status ) { echo ''; if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) { $last_user = get_userdata($last_id); @@ -213,21 +288,16 @@ endif; ?> -
diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php index 552d3c74..42f3e9d8 100644 --- a/wp-admin/edit-form-comment.php +++ b/wp-admin/edit-form-comment.php @@ -47,9 +47,9 @@ $comment->comment_author_email = esc_attr($comment->comment_author_email);
-
-
- +
+
+
@@ -124,8 +124,12 @@ $date = date_i18n( $datef, strtotime( $comment->comment_date ) );
- + diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php index 90dcce66..711121be 100644 --- a/wp-admin/edit-link-categories.php +++ b/wp-admin/edit-link-categories.php @@ -7,7 +7,7 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); // Handle bulk actions if ( isset($_GET['action']) && isset($_GET['delete']) ) { @@ -40,7 +40,7 @@ if ( isset($_GET['action']) && isset($_GET['delete']) ) { wp_redirect($location); exit(); } -} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { +} elseif ( ! empty($_GET['_wp_http_referer']) ) { wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); exit; } @@ -51,6 +51,13 @@ wp_enqueue_script('admin-categories'); if ( current_user_can('manage_categories') ) wp_enqueue_script('inline-edit-tax'); +add_contextual_help($current_screen, '

' . __('You can create groups of links by using link categories. Link category names must be unique and link categories are separate from the categories you use for posts.') . '

' . + '

' . __('You can delete link categories, but that action does not delete the links within the category. Instead, it moves them to the default link category.') . '

' . + '

' . __('For more information:') . '

' . + '

' . __('Link Categories Documentation') . '

' . + '

' . __('Support Forums') . '

' +); + require_once ('admin-header.php'); $messages[1] = __('Category added.'); @@ -68,7 +75,7 @@ if ( isset($_GET['s']) && $_GET['s'] ) -

+

@@ -92,7 +99,7 @@ endif; ?> $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0; if ( empty($pagenum) ) $pagenum = 1; -if( ! isset( $catsperpage ) || $catsperpage < 0 ) +if ( ! isset( $catsperpage ) || $catsperpage < 0 ) $catsperpage = 20; $page_links = paginate_links( array( @@ -198,18 +205,18 @@ if ( $page_links )
- +
- +
- +

- +
- +

@@ -226,5 +233,5 @@ if ( $page_links )
- - + + diff --git a/wp-admin/edit-link-category-form.php b/wp-admin/edit-link-category-form.php index 17db6ef6..7e7c004c 100644 --- a/wp-admin/edit-link-category-form.php +++ b/wp-admin/edit-link-category-form.php @@ -11,7 +11,7 @@ if ( !defined('ABSPATH') ) die('-1'); if ( !current_user_can('manage_categories') ) - wp_die(__('You do not have sufficient permissions to edit link categories for this blog.')); + wp_die(__('You do not have sufficient permissions to edit link categories for this site.')); /** * @var object @@ -72,11 +72,13 @@ _fill_empty_link_category($category); +
+
diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index 7d0c3edc..29e28623 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -22,7 +22,7 @@ if ( ! empty($link_id) ) { $nonce_action = 'add-bookmark'; } -require_once('includes/meta-boxes.php'); +require_once('./includes/meta-boxes.php'); add_meta_box('linksubmitdiv', __('Save'), 'link_submit_meta_box', 'link', 'side', 'core'); add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', 'link', 'normal', 'core'); @@ -30,10 +30,22 @@ add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'nor add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'normal', 'core'); add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core'); +do_action('add_meta_boxes', 'link', $link); +do_action('add_meta_boxes_link', $link); + do_action('do_meta_boxes', 'link', 'normal', $link); do_action('do_meta_boxes', 'link', 'advanced', $link); do_action('do_meta_boxes', 'link', 'side', $link); +add_contextual_help($current_screen, + '

' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link’s web address and name (the text you want to display on your site as the link) are required fields.' ) . '

' . + '

' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don’t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '

' . + '

' . __( 'XFN stands for XHTML Friends Network, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '

' . + '

' . __( 'For more information:' ) . '

' . + '

' . __( 'Documentation on Creating Links' ) . '

' . + '

' . __( 'Support Forums' ) . '

' +); + require_once ('admin-header.php'); ?> @@ -42,7 +54,7 @@ require_once ('admin-header.php');

-

+

View page'), get_permalink($post_ID) ); - break; - case 2: - $message = __('Custom field updated.'); - break; - case 3: - $message = __('Custom field deleted.'); - break; - case 4: - $message = sprintf( __('Page published. View page'), get_permalink($post_ID) ); - break; - case 5: - if ( isset($_GET['revision']) ) - $message = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ); - break; - case 6: - $message = sprintf( __('Page submitted. Preview page'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); - break; - case 7: - // translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php - $message = sprintf( __('Page scheduled for: %1$s. Preview page'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) ); - break; - case 8: - $message = sprintf( __('Page draft updated. Preview page'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ); - break; - } -} - -$notice = false; -if ( 0 == $post_ID) { - $form_action = 'post'; - $nonce_action = 'add-page'; - $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() - $form_extra = ""; -} else { - $post_ID = (int) $post_ID; - $form_action = 'editpost'; - $nonce_action = 'update-page_' . $post_ID; - $form_extra = ""; - $autosave = wp_get_post_autosave( $post_ID ); - if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) - $notice = sprintf( __( 'There is an autosave of this page that is more recent than the version below. View the autosave.' ), get_edit_post_link( $autosave->ID ) ); -} - -$temp_ID = (int) $temp_ID; -$user_ID = (int) $user_ID; - -require_once('includes/meta-boxes.php'); - -add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'page', 'side', 'core'); -add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', 'page', 'side', 'core'); -add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'page', 'normal', 'core'); -add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'page', 'normal', 'core'); -add_meta_box('slugdiv', __('Page Slug'), 'post_slug_meta_box', 'page', 'normal', 'core'); -if ( current_theme_supports( 'post-thumbnails', 'page' ) ) - add_meta_box('postimagediv', __('Page Image'), 'post_thumbnail_meta_box', 'page', 'side', 'low'); - -$authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM -if ( $post->post_author && !in_array($post->post_author, $authors) ) - $authors[] = $post->post_author; -if ( $authors && count( $authors ) > 1 ) - add_meta_box('pageauthordiv', __('Page Author'), 'post_author_meta_box', 'page', 'normal', 'core'); - -if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) - add_meta_box('revisionsdiv', __('Page Revisions'), 'post_revisions_meta_box', 'page', 'normal', 'core'); - -do_action('do_meta_boxes', 'page', 'normal', $post); -do_action('do_meta_boxes', 'page', 'advanced', $post); -do_action('do_meta_boxes', 'page', 'side', $post); - -require_once('admin-header.php'); -?> - -
- -

- - - -

- - -

- - - - - - - - - - - - -post_status ) wp_original_referer_field(true, 'previous'); ?> - -
- -
- -
- -
-
-
-
- - -
-
-ID); ?> -
-ID) && ! empty($sample_permalink_html) ) : - echo $sample_permalink_html; -endif; ?> -
-
-
- -
- -post_content); ?> - - - -
-   - -display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); - } else { - printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); - } - } -?> -
- - -
- - - -
-
-
- - -
- - diff --git a/wp-admin/edit-pages.php b/wp-admin/edit-pages.php deleted file mode 100644 index afab9553..00000000 --- a/wp-admin/edit-pages.php +++ /dev/null @@ -1,384 +0,0 @@ -get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status = %s", $post_status ) ); - $doaction = 'delete'; - } elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['post']) || isset($_GET['ids']) ) ) { - $post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']); - $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2']; - } else { - wp_redirect( admin_url('edit-pages.php') ); - } - - switch ( $doaction ) { - case 'trash': - $trashed = 0; - foreach( (array) $post_ids as $post_id ) { - if ( !current_user_can('delete_page', $post_id) ) - wp_die( __('You are not allowed to move this page to the trash.') ); - - if ( !wp_trash_post($post_id) ) - wp_die( __('Error in moving to trash...') ); - - $trashed++; - } - $sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids)), $sendback ); - break; - case 'untrash': - $untrashed = 0; - foreach( (array) $post_ids as $post_id ) { - if ( !current_user_can('delete_page', $post_id) ) - wp_die( __('You are not allowed to restore this page from the trash.') ); - - if ( !wp_untrash_post($post_id) ) - wp_die( __('Error in restoring from trash...') ); - - $untrashed++; - } - $sendback = add_query_arg('untrashed', $untrashed, $sendback); - break; - case 'delete': - $deleted = 0; - foreach( (array) $post_ids as $post_id ) { - $post_del = & get_post($post_id); - - if ( !current_user_can('delete_page', $post_id) ) - wp_die( __('You are not allowed to delete this page.') ); - - if ( $post_del->post_type == 'attachment' ) { - if ( ! wp_delete_attachment($post_id) ) - wp_die( __('Error in deleting...') ); - } else { - if ( !wp_delete_post($post_id) ) - wp_die( __('Error in deleting...') ); - } - $deleted++; - } - $sendback = add_query_arg('deleted', $deleted, $sendback); - break; - case 'edit': - $_GET['post_type'] = 'page'; - $done = bulk_edit_posts($_GET); - - if ( is_array($done) ) { - $done['updated'] = count( $done['updated'] ); - $done['skipped'] = count( $done['skipped'] ); - $done['locked'] = count( $done['locked'] ); - $sendback = add_query_arg( $done, $sendback ); - } - break; - } - - if ( isset($_GET['action']) ) - $sendback = remove_query_arg( array('action', 'action2', 'post_parent', 'page_template', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view', 'post_type'), $sendback ); - - wp_redirect($sendback); - exit(); -} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { - wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); - exit; -} - -if ( empty($title) ) - $title = __('Edit Pages'); -$parent_file = 'edit-pages.php'; -wp_enqueue_script('inline-edit-post'); - -$post_stati = array( // array( adj, noun ) - 'publish' => array(_x('Published', 'page'), __('Published pages'), _nx_noop('Published (%s)', 'Published (%s)', 'page')), - 'future' => array(_x('Scheduled', 'page'), __('Scheduled pages'), _nx_noop('Scheduled (%s)', 'Scheduled (%s)', 'page')), - 'pending' => array(_x('Pending Review', 'page'), __('Pending pages'), _nx_noop('Pending Review (%s)', 'Pending Review (%s)', 'page')), - 'draft' => array(_x('Draft', 'page'), _x('Drafts', 'manage posts header'), _nx_noop('Draft (%s)', 'Drafts (%s)', 'page')), - 'private' => array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private (%s)', 'Private (%s)', 'page')), - 'trash' => array(_x('Trash', 'page'), __('Trash pages'), _nx_noop('Trash (%s)', 'Trash (%s)', 'page')) - ); - -if ( !EMPTY_TRASH_DAYS ) - unset($post_stati['trash']); - -$post_stati = apply_filters('page_stati', $post_stati); - -$query = array('post_type' => 'page', 'orderby' => 'menu_order title', - 'posts_per_page' => -1, 'posts_per_archive_page' => -1, 'order' => 'asc'); - -$post_status_label = __('Pages'); -if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) { - $post_status_label = $post_stati[$_GET['post_status']][1]; - $query['post_status'] = $_GET['post_status']; - $query['perm'] = 'readable'; -} - -$query = apply_filters('manage_pages_query', $query); -wp($query); - -if ( is_singular() ) { - wp_enqueue_script( 'admin-comments' ); - enqueue_comment_hotkeys_js(); -} - -require_once('admin-header.php'); ?> - -
- -

' . __('Search results for “%s”') . '', esc_html( get_search_query() ) ); ?> -

- - -

-' . __('Undo') . '
'; - unset($_GET['trashed']); -} -if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) { - printf( _n( 'Page restored from the trash.', '%s pages restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) ); - unset($_GET['untrashed']); -} -$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] ); -?> -

- - - -

|

- - -
- - - - - - - - -
- -post_count / $per_page); -$page_links = paginate_links( array( - 'base' => add_query_arg( 'pagenum', '%#%' ), - 'format' => '', - 'prev_text' => __('«'), - 'next_text' => __('»'), - 'total' => $num_pages, - 'current' => $pagenum -)); - -$is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash'; - -if ( $page_links ) : ?> -
' . __( 'Displaying %s–%s of %s' ) . '%s', - number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ), - number_format_i18n( min( $pagenum * $per_page, $wp_query->post_count ) ), - number_format_i18n( $wp_query->post_count ), - $page_links -); echo $page_links_text; ?>
- - -
- - - - - - -
- -
-
- -
- - - - - - - - - - - - - - - - - -
- -
-$page_links_text
"; -?> - -
- - - - - -
- -
-
- - -
-

- - - - - - -
- - -get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) ); - if ( $comments ) : - // Make sure comments, post, and post_author are cached - update_comment_cache($comments); - $post = get_post($id); - $authordata = get_userdata($post->post_author); - ?> - -
- - - - - - - - - - -comment_ID, 'single', false, false ); -?> - -
- -
- - - -
- - - +
- + - + - +hierarchical ) + page_rows($posts, $pagenum, $per_page); +else + post_rows(); +?>
\ No newline at end of file diff --git a/wp-admin/edit-tag-form.php b/wp-admin/edit-tag-form.php index 31f60942..56674de0 100644 --- a/wp-admin/edit-tag-form.php +++ b/wp-admin/edit-tag-form.php @@ -10,20 +10,21 @@ if ( !defined('ABSPATH') ) die('-1'); -if ( !current_user_can('manage_categories') ) - wp_die(__('You do not have sufficient permissions to edit tags for this blog.')); - if ( empty($tag_ID) ) { ?> -

+

+if ( 'category' == $taxonomy ) + do_action('edit_category_form_pre', $tag ); +else + do_action('edit_tag_form_pre', $tag); +do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>
-

+

labels->edit_item; ?>

@@ -32,22 +33,48 @@ do_action('edit_tag_form_pre', $tag); ?> - - + + + - + +

+ + + + + + + - + + - +
+

-

+ 0, 'hide_if_empty' => false, 'name' => 'parent', 'orderby' => 'name', 'taxonomy' => $taxonomy, 'selected' => $tag->parent, 'exclude' => $tag->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?>
+ + + +

-
-

- + +

diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index 44b7a8b8..19912705 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -7,20 +7,30 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); -$title = __('Tags'); - -wp_reset_vars( array('action', 'tag', 'taxonomy') ); +wp_reset_vars( array('action', 'tag', 'taxonomy', 'post_type') ); if ( empty($taxonomy) ) $taxonomy = 'post_tag'; -if ( !is_taxonomy($taxonomy) ) +if ( !taxonomy_exists($taxonomy) ) wp_die(__('Invalid taxonomy')); -$parent_file = 'edit.php'; -$submenu_file = "edit-tags.php?taxonomy=$taxonomy"; +$tax = get_taxonomy($taxonomy); + +$title = $tax->labels->name; + +if ( empty($post_type) || !in_array( $post_type, get_post_types( array('public' => true) ) ) ) + $post_type = 'post'; + +if ( 'post' != $post_type ) { + $parent_file = "edit.php?post_type=$post_type"; + $submenu_file = "edit-tags.php?taxonomy=$taxonomy&post_type=$post_type"; +} else { + $parent_file = 'edit.php'; + $submenu_file = "edit-tags.php?taxonomy=$taxonomy"; +} if ( isset( $_GET['action'] ) && isset($_GET['delete_tags']) && ( 'delete' == $_GET['action'] || 'delete' == $_GET['action2'] ) ) $action = 'bulk-delete'; @@ -31,38 +41,49 @@ case 'add-tag': check_admin_referer('add-tag'); - if ( !current_user_can('manage_categories') ) + if ( !current_user_can($tax->cap->edit_terms) ) wp_die(__('Cheatin’ uh?')); $ret = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST); - if ( $ret && !is_wp_error( $ret ) ) { - wp_redirect('edit-tags.php?message=1#addtag'); - } else { - wp_redirect('edit-tags.php?message=4#addtag'); + $location = 'edit-tags.php?taxonomy=' . $taxonomy; + if ( 'post' != $post_type ) + $location .= '&post_type=' . $post_type; + + if ( $referer = wp_get_original_referer() ) { + if ( false !== strpos($referer, 'edit-tags.php') ) + $location = $referer; } + + if ( $ret && !is_wp_error( $ret ) ) + $location = add_query_arg('message', 1, $location); + else + $location = add_query_arg('message', 4, $location); + wp_redirect($location); exit; break; case 'delete': + $location = 'edit-tags.php?taxonomy=' . $taxonomy; + if ( 'post' != $post_type ) + $location .= '&post_type=' . $post_type; + if ( $referer = wp_get_referer() ) { + if ( false !== strpos($referer, 'edit-tags.php') ) + $location = $referer; + } + if ( !isset( $_GET['tag_ID'] ) ) { - wp_redirect("edit-tags.php?taxonomy=$taxonomy"); + wp_redirect($location); exit; } $tag_ID = (int) $_GET['tag_ID']; check_admin_referer('delete-tag_' . $tag_ID); - if ( !current_user_can('manage_categories') ) + if ( !current_user_can($tax->cap->delete_terms) ) wp_die(__('Cheatin’ uh?')); wp_delete_term( $tag_ID, $taxonomy); - $location = 'edit-tags.php'; - if ( $referer = wp_get_referer() ) { - if ( false !== strpos($referer, 'edit-tags.php') ) - $location = $referer; - } - $location = add_query_arg('message', 2, $location); wp_redirect($location); exit; @@ -72,7 +93,7 @@ break; case 'bulk-delete': check_admin_referer('bulk-tags'); - if ( !current_user_can('manage_categories') ) + if ( !current_user_can($tax->cap->delete_terms) ) wp_die(__('Cheatin’ uh?')); $tags = (array) $_GET['delete_tags']; @@ -80,7 +101,9 @@ case 'bulk-delete': wp_delete_term( $tag_ID, $taxonomy); } - $location = 'edit-tags.php'; + $location = 'edit-tags.php?taxonomy=' . $taxonomy; + if ( 'post' != $post_type ) + $location .= '&post_type=' . $post_type; if ( $referer = wp_get_referer() ) { if ( false !== strpos($referer, 'edit-tags.php') ) $location = $referer; @@ -93,13 +116,13 @@ case 'bulk-delete': break; case 'edit': - $title = __('Edit Tag'); + $title = $tax->labels->edit_item; require_once ('admin-header.php'); $tag_ID = (int) $_GET['tag_ID']; $tag = get_term($tag_ID, $taxonomy, OBJECT, 'edit'); - include('edit-tag-form.php'); + include('./edit-tag-form.php'); break; @@ -107,12 +130,15 @@ case 'editedtag': $tag_ID = (int) $_POST['tag_ID']; check_admin_referer('update-tag_' . $tag_ID); - if ( !current_user_can('manage_categories') ) + if ( !current_user_can($tax->cap->edit_terms) ) wp_die(__('Cheatin’ uh?')); $ret = wp_update_term($tag_ID, $taxonomy, $_POST); - $location = 'edit-tags.php'; + $location = 'edit-tags.php?taxonomy=' . $taxonomy; + if ( 'post' != $post_type ) + $location .= '&post_type=' . $post_type; + if ( $referer = wp_get_original_referer() ) { if ( false !== strpos($referer, 'edit-tags.php') ) $location = $referer; @@ -129,45 +155,83 @@ break; default: -if ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { +if ( ! empty($_GET['_wp_http_referer']) ) { wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); exit; } -$can_manage = current_user_can('manage_categories'); - wp_enqueue_script('admin-tags'); -if ( $can_manage ) +if ( current_user_can($tax->cap->edit_terms) ) wp_enqueue_script('inline-edit-tax'); +if ( 'category' == $taxonomy || 'post_tag' == $taxonomy ) { + if ( 'category' == $taxonomy ) + $help = '

' . sprintf(__('You can use categories to define sections of your site and group related posts. The default category is “Uncategorized” until you change it in your writing settings.'), 'options-writing.php') . '

'; + else + $help = '

' . __('You can assign keywords to your posts using Post Tags. Unlike categories, tags have no hierarchy, meaning there’s no relationship from one tag to another.') . '

'; + + $help .='

' . __('What’s the difference between categories and tags? Normally, tags are ad-hoc keywords that identify important information in your post (names, subjects, etc) that may or may not recur in other posts, while categories are pre-determined sections. If you think of your site like a book, the categories are like the Table of Contents and the tags are like the terms in the index.') . '

'; + + if ( 'category' == $taxonomy ) + $help .= '

' . __('When adding a new category on this screen, you’ll fill in the following fields:') . '

'; + else + $help .= '

' . __('When adding a new tag on this screen, you’ll fill in the following fields:') . '

'; + + $help .= '
    ' . + '
  • ' . __('Name - The name is how it appears on your site.') . '
  • '; + if ( ! global_terms_enabled() ) + $help .= '
  • ' . __('Slug - The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.') . '
  • '; + + if ( 'category' == $taxonomy ) + $help .= '
  • ' . __('Parent - Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional. To create a subcategory, just choose another category from the Parent dropdown.') . '
  • '; + + $help .= '
  • ' . __('Description - The description is not prominent by default; however, some themes may display it.') . '
  • ' . + '
' . + '

' . __('You can change the display of this screen using the Screen Options tab to set how many items are displayed per screen and to display/hide columns in the table.') . '

' . + '

' . __('For more information:') . '

'; + + if ( 'category' == $taxonomy ) + $help .= '

' . __('Categories Documentation') . '

'; + else + $help .= '

' . __('Tags Documentation') . '

'; + + $help .= '

' . __('Support Forums') . '

'; + + add_contextual_help($current_screen, $help); + unset($help); +} + require_once ('admin-header.php'); -$messages[1] = __('Tag added.'); -$messages[2] = __('Tag deleted.'); -$messages[3] = __('Tag updated.'); -$messages[4] = __('Tag not added.'); -$messages[5] = __('Tag not updated.'); -$messages[6] = __('Tags deleted.'); ?> +$messages[1] = __('Item added.'); +$messages[2] = __('Item deleted.'); +$messages[3] = __('Item updated.'); +$messages[4] = __('Item not added.'); +$messages[5] = __('Item not updated.'); +$messages[6] = __('Items deleted.'); + +?>

' . __('Search results for “%s”') . '', esc_html( stripslashes($_GET['s']) ) ); ?>

-

+

+

@@ -178,24 +242,35 @@ endif; ?>
+
add_query_arg( 'pagenum', '%#%' ), 'format' => '', 'prev_text' => __('«'), 'next_text' => __('»'), - 'total' => ceil(wp_count_terms($taxonomy) / $tags_per_page), + 'total' => ceil(wp_count_terms($taxonomy, array('search' => $searchterms)) / $tags_per_page), 'current' => $pagenum )); @@ -216,27 +291,21 @@ if ( $page_links )
- - + - + - +
@@ -259,52 +328,102 @@ if ( $page_links )
+ + +
+

Note:
Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?>

+ +

category to tag converter.'), 'import.php') ?>

+ +
+ +
+

tag to category converter'), 'import.php') ;?>.

+
+ +
-
-

$taxonomy, 'link' => 'edit')); -else - wp_tag_cloud(array('taxonomy' => $taxonomy)); -?> + +if ( !is_taxonomy_hierarchical($taxonomy) ) { + if ( current_user_can( $tax->cap->edit_terms ) ) + $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false, 'link' => 'edit' ) ); + else + $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false ) ); + + if ( $tag_cloud ) : + ?> +
+

labels->popular_items; ?>

+
+ +if ( current_user_can($tax->cap->edit_terms) ) { + if ( 'category' == $taxonomy ) + do_action('add_category_form_pre', (object)array('parent' => 0) ); // Back compat hook. Deprecated in preference to $taxonomy_pre_add_form + else + do_action('add_tag_form_pre', $taxonomy); // Back compat hook. Applies to all Taxonomies -not- categories + do_action($taxonomy . '_pre_add_form', $taxonomy); +?>
-

+

labels->add_new_item; ?>

+
- + -

+

- +
- - + +

- + +
- - -

+ + 0, 'hide_if_empty' => false, 'taxonomy' => $taxonomy, 'name' => 'parent', 'orderby' => 'name', 'hierarchical' => true, 'show_option_none' => __('None'))); ?> + +

+ +
+ +
+ + +

-

- + +

+ 0) ); // Back compat hook. Deprecated in preference to $taxonomy_add_form +else + do_action('add_tag_form', $taxonomy); // Back compat hook. Applies to all Taxonomies -not- categories +do_action($taxonomy . '_add_form', $taxonomy); +?>
@@ -314,12 +433,12 @@ else
- + diff --git a/wp-admin/edit.php b/wp-admin/edit.php index dc0d3f2d..e141d56e 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -7,9 +7,19 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); -if ( !current_user_can('edit_posts') ) +if ( !isset($_GET['post_type']) ) + $post_type = 'post'; +elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) ) + $post_type = $_GET['post_type']; +else + wp_die( __('Invalid post type') ); +$_GET['post_type'] = $post_type; + +$post_type_object = get_post_type_object($post_type); + +if ( !current_user_can($post_type_object->cap->edit_posts) ) wp_die(__('Cheatin’ uh?')); // Back-compat for viewing comments of an entry @@ -20,34 +30,54 @@ if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['pag unset( $_redirect ); } +if ( 'post' != $post_type ) { + $parent_file = "edit.php?post_type=$post_type"; + $submenu_file = "edit.php?post_type=$post_type"; + $post_new_file = "post-new.php?post_type=$post_type"; +} else { + $parent_file = 'edit.php'; + $submenu_file = 'edit.php'; + $post_new_file = 'post-new.php'; +} + +$pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0; +if ( empty($pagenum) ) + $pagenum = 1; +$per_page = 'edit_' . $post_type . '_per_page'; +$per_page = (int) get_user_option( $per_page ); +if ( empty( $per_page ) || $per_page < 1 ) + $per_page = 20; +// @todo filter based on type +$per_page = apply_filters( 'edit_posts_per_page', $per_page ); + // Handle bulk actions if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) { check_admin_referer('bulk-posts'); $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() ); if ( strpos($sendback, 'post.php') !== false ) - $sendback = admin_url('post-new.php'); + $sendback = admin_url($post_new_file); if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) { $post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_GET['post_status']); - $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='post' AND post_status = %s", $post_status ) ); + $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s", $post_type, $post_status ) ); $doaction = 'delete'; } elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['post']) || isset($_GET['ids']) ) ) { $post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']); $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2']; } else { - wp_redirect( admin_url('edit.php') ); + wp_redirect( admin_url("edit.php?post_type=$post_type") ); } switch ( $doaction ) { case 'trash': $trashed = 0; foreach( (array) $post_ids as $post_id ) { - if ( !current_user_can('delete_post', $post_id) ) - wp_die( __('You are not allowed to move this post to the trash.') ); + if ( !current_user_can($post_type_object->cap->delete_post, $post_id) ) + wp_die( __('You are not allowed to move this item to the Trash.') ); if ( !wp_trash_post($post_id) ) - wp_die( __('Error in moving to trash...') ); + wp_die( __('Error in moving to Trash.') ); $trashed++; } @@ -56,11 +86,11 @@ if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delet case 'untrash': $untrashed = 0; foreach( (array) $post_ids as $post_id ) { - if ( !current_user_can('delete_post', $post_id) ) - wp_die( __('You are not allowed to restore this post from the trash.') ); + if ( !current_user_can($post_type_object->cap->delete_post, $post_id) ) + wp_die( __('You are not allowed to restore this item from the Trash.') ); if ( !wp_untrash_post($post_id) ) - wp_die( __('Error in restoring from trash...') ); + wp_die( __('Error in restoring from Trash.') ); $untrashed++; } @@ -71,8 +101,8 @@ if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delet foreach( (array) $post_ids as $post_id ) { $post_del = & get_post($post_id); - if ( !current_user_can('delete_post', $post_id) ) - wp_die( __('You are not allowed to delete this post.') ); + if ( !current_user_can($post_type_object->cap->delete_post, $post_id) ) + wp_die( __('You are not allowed to delete this item.') ); if ( $post_del->post_type == 'attachment' ) { if ( ! wp_delete_attachment($post_id) ) @@ -98,34 +128,67 @@ if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delet } if ( isset($_GET['action']) ) - $sendback = remove_query_arg( array('action', 'action2', 'cat', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view', 'post_type'), $sendback ); + $sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback ); wp_redirect($sendback); exit(); -} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { +} elseif ( ! empty($_GET['_wp_http_referer']) ) { wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); exit; } -if ( empty($title) ) - $title = __('Edit Posts'); -$parent_file = 'edit.php'; wp_enqueue_script('inline-edit-post'); $user_posts = false; -if ( !current_user_can('edit_others_posts') ) { - $user_posts_count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(1) FROM $wpdb->posts WHERE post_type = 'post' AND post_status != 'trash' AND post_author = %d", $current_user->ID) ); +if ( !current_user_can($post_type_object->cap->edit_others_posts) ) { + $user_posts_count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(1) FROM $wpdb->posts WHERE post_type = '%s' AND post_status NOT IN ('trash', 'auto-draft') AND post_author = %d", $post_type, $current_user->ID) ); $user_posts = true; if ( $user_posts_count && empty($_GET['post_status']) && empty($_GET['all_posts']) && empty($_GET['author']) ) $_GET['author'] = $current_user->ID; } -list($post_stati, $avail_post_stati) = wp_edit_posts_query(); +$avail_post_stati = wp_edit_posts_query(); -require_once('admin-header.php'); +if ( $post_type_object->hierarchical ) + $num_pages = ceil($wp_query->post_count / $per_page); +else + $num_pages = $wp_query->max_num_pages; + +$title = $post_type_object->labels->name; + +if ( 'post' == $post_type ) { + add_contextual_help($current_screen, + '

' . __('You can customize the display of this screen in a number of ways:') . '

' . + '
    ' . + '
  • ' . __('You can hide/display columns based on your needs and decide how many posts to list per screen using the Screen Options tab.') . '
  • ' . + '
  • ' . __('You can filter the list of posts by post status using the text links in the upper left to show All, Published, Draft, or Trashed posts. The default view is to show all posts.') . '
  • ' . + '
  • ' . __('You can view posts in a simple title list or with an excerpt. Choose the view you prefer by clicking on the icons at the top of the list on the right.') . '
  • ' . + '
  • ' . __('You can refine the list to show only posts in a specific category or from a specific month by using the dropdown menus above the posts list. Click the Filter button after making your selection. You also can refine the list by clicking on the post author, category or tag in the posts list.') . '
  • ' . + '
' . + '

' . __('Hovering over a row in the posts list will display action links that allow you to manage your post. You can perform the following actions:') . '

' . + '
    ' . + '
  • ' . __('Edit takes you to the editing screen for that post. You can also reach that screen by clicking on the post title.') . '
  • ' . + '
  • ' . __('Quick Edit provides inline access to the metadata of your post, allowing you to update post details without leaving this screen.') . '
  • ' . + '
  • ' . __('Trash removes your post from this list and places it in the trash, from which you can permanently delete it.') . '
  • ' . + '
  • ' . __('Preview will show you what your draft post will look like if you publish it. View will take you to your live site to view the post. Which link is available depends on your post’s status.') . '
  • ' . + '
' . + '

' . __('You can also edit multiple posts at once. Select the posts you want to edit using the checkboxes, select Edit from the Bulk Actions menu and click Apply. You will be able to change the metadata (categories, author, etc.) for all selected posts at once. To remove a post from the grouping, just click the x next to its name in the Bulk Edit area that appears.') . '

' . + '

' . __('For more information:') . '

' . + '

' . __('Edit Posts Documentation') . '

' . + '

' . __('Support Forums') . '

' + ); +} elseif ( 'page' == $post_type ) { + add_contextual_help($current_screen, + '

' . __('Pages are similar to to Posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest Pages under other Pages by making one the “Parent” of the other, creating a group of Pages.') . '

' . + '

' . __('Managing Pages is very similar to managing Posts, and the screens can be customized in the same way.') . '

' . + '

' . __('You can also perform the same types of actions, including narrowing the list by using the filters, acting on a Page using the action links that appear when you hover over a row, or using the Bulk Actions menu to edit the metadata for multiple Pages at once.') . '

' . + '

' . __('For more information:') . '

' . + '

' . __('Page Management Documentation') . '

' . + '

' . __('Support Forums') . '

' + ); +} -if ( !isset( $_GET['paged'] ) ) - $_GET['paged'] = 1; +require_once('./admin-header.php'); if ( empty($_GET['mode']) ) $mode = 'list'; @@ -134,19 +197,19 @@ else
-

labels->name ); ?> labels->add_new); ?> ' . __('Search results for “%s”') . '', esc_html( get_search_query() ) ); ?> + printf( '' . __('Search results for “%s”') . '', get_search_query() ); ?>

-

|

+

|

-

+

' . __('Undo') . '
'; + echo ' ' . __('Undo') . '
'; unset($_GET['trashed']); } if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) { - printf( _n( 'Post restored from the trash.', '%s posts restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) ); + printf( _n( 'Item restored from the Trash.', '%s items restored from the Trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) ); unset($_GET['undeleted']); } @@ -188,34 +251,41 @@ $_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated' ID ) ) $class = ' class="current"'; - $status_links[] = "

  • " . sprintf( _nx( 'My Posts (%s)', 'My Posts (%s)', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . ''; - $allposts = '?all_posts=1'; + $status_links[] = "
  • " . sprintf( _nx( 'Mine (%s)', 'Mine (%s)', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . ''; + $allposts = '&all_posts=1'; } -$total_posts = array_sum( (array) $num_posts ) - $num_posts->trash; +$total_posts = array_sum( (array) $num_posts ); + +// Subtract post types that are not included in the admin all list. +foreach ( get_post_stati( array('show_in_admin_all_list' => false) ) as $state ) + $total_posts -= $num_posts->$state; + $class = empty($class) && empty($_GET['post_status']) ? ' class="current"' : ''; -$status_links[] = "
  • " . sprintf( _nx( 'All (%s)', 'All (%s)', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . ''; +$status_links[] = "
  • " . sprintf( _nx( 'All (%s)', 'All (%s)', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . ''; -foreach ( $post_stati as $status => $label ) { +foreach ( get_post_stati(array('show_in_admin_status_list' => true), 'objects') as $status ) { $class = ''; - if ( !in_array( $status, $avail_post_stati ) ) + $status_name = $status->name; + + if ( !in_array( $status_name, $avail_post_stati ) ) continue; - if ( empty( $num_posts->$status ) ) + if ( empty( $num_posts->$status_name ) ) continue; - if ( isset($_GET['post_status']) && $status == $_GET['post_status'] ) + if ( isset($_GET['post_status']) && $status_name == $_GET['post_status'] ) $class = ' class="current"'; - $status_links[] = "
  • " . sprintf( _n( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . ''; + $status_links[] = "
  • " . sprintf( _n( $status->label_count[0], $status->label_count[1], $num_posts->$status_name ), number_format_i18n( $num_posts->$status_name ) ) . ''; } echo implode( " |
  • \n", $status_links ) . ''; unset( $status_links ); @@ -224,12 +294,13 @@ endif; + @@ -241,8 +312,8 @@ $page_links = paginate_links( array( 'format' => '', 'prev_text' => __('«'), 'next_text' => __('»'), - 'total' => $wp_query->max_num_pages, - 'current' => $_GET['paged'] + 'total' => $num_pages, + 'current' => $pagenum )); $is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash'; @@ -267,7 +338,7 @@ $is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash'; posts WHERE post_type = 'post' ORDER BY post_date DESC"; +$arc_query = $wpdb->prepare("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = %s ORDER BY post_date DESC", $post_type); $arc_result = $wpdb->get_results( $arc_query ); @@ -298,39 +369,50 @@ foreach ($arc_result as $arc_row) { __('View all categories'), 'hide_empty' => 0, 'hierarchical' => 1, - 'show_count' => 0, 'orderby' => 'name', 'selected' => $cat); -wp_dropdown_categories($dropdown_options); +if ( is_object_in_taxonomy($post_type, 'category') ) { + $dropdown_options = array('show_option_all' => __('View all categories'), 'hide_empty' => 0, 'hierarchical' => 1, + 'show_count' => 0, 'orderby' => 'name', 'selected' => $cat); + wp_dropdown_categories($dropdown_options); +} do_action('restrict_manage_posts'); ?> +if ( $is_trash && current_user_can($post_type_object->cap->edit_others_posts) ) { ?>
    -
    ' . __( 'Displaying %s–%s of %s' ) . '%s', - number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ), - number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ), - number_format_i18n( $wp_query->found_posts ), - $page_links -); echo $page_links_text; ?>
    - +
    hierarchical ? $wp_query->post_count : $wp_query->found_posts; + $page_links_text = sprintf( '' . __( 'Displaying %s–%s of %s' ) . '%s', + number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ), + number_format_i18n( min( $pagenum * $per_page, $count_posts ) ), + number_format_i18n( $count_posts ), + $page_links + ); + echo $page_links_text; + ?>
    +hierarchical ) { +?> +
    - +
    @@ -353,7 +435,7 @@ if ( $page_links ) - +cap->edit_others_posts) ) { ?>
    @@ -365,19 +447,19 @@ if ( $page_links )

    labels->not_found_in_trash; else - _e('No posts found'); + echo $post_type_object->labels->not_found; ?>

    - +

    ' . __('You can export a file of your site’s content in order to import it into another installation or platform. The export file will be an XML file format called WXR. Posts, pages, comments, custom fields, categories, and tags can be included. You can set filters to have the WXR file only include a certain date, author, category, tag, all posts or all pages, certain publishing statuses.') . '

    ' . + '

    ' . __('Once generated, your WXR file can be imported by another WordPress site or by another blogging platform able to access this format.') . '

    ' . + '

    ' . __('For more information:') . '

    ' . + '

    ' . __('Export Documentation') . '

    ' . + '

    ' . __('Support Forums') . '

    ' +); + if ( isset( $_GET['download'] ) ) { - $author = isset($_GET['author']) ? $_GET['author'] : 'all'; - export_wp( $author ); + $author = isset($_GET['author']) ? $_GET['author'] : 'all'; + $taxonomy = array(); + foreach ( get_taxonomies( array( 'show_ui' => true ) ) as $tax ) + $taxonomy[ $tax ] = ! empty( $_GET['taxonomy'][ $tax ] ) ? $_GET['taxonomy'][ $tax ] : 'all'; + $post_type = isset($_GET['post_type']) ? stripslashes_deep($_GET['post_type']) : 'all'; + $status = isset($_GET['status']) ? stripslashes_deep($_GET['status']) : 'all'; + $mm_start = isset($_GET['mm_start']) ? $_GET['mm_start'] : 'all'; + $mm_end = isset($_GET['mm_end']) ? $_GET['mm_end'] : 'all'; + if( $mm_start != 'all' ) { + $start_date = sprintf( "%04d-%02d-%02d", substr( $mm_start, 0, 4 ), substr( $mm_start, 5, 2 ), 1 ); + } else { + $start_date = 'all'; + } + if( $mm_end != 'all' ) { + $end_date = sprintf( "%04d-%02d-%02d", substr( $mm_end, 0, 4 ), substr( $mm_end, 5, 2 ), 1 ); + } else { + $end_date = 'all'; + } + + export_wp( array( 'author' => $author, 'taxonomy' => $taxonomy, 'post_type' => $post_type, 'post_status' => $status, 'start_date' => $start_date, 'end_date' => $end_date ) ); die(); } require_once ('admin-header.php'); + +$dateoptions = $edateoptions = ''; +$types = "'" . implode("', '", get_post_types( array( 'public' => true, 'can_export' => true ), 'names' )) . "'"; +$stati = "'" . implode("', '", get_post_stati( array( 'internal' => false ), 'names' )) . "'"; +if ( $monthyears = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, YEAR(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `eyear`, MONTH(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `emonth` FROM $wpdb->posts WHERE post_type IN ($types) AND post_status IN ($stati) ORDER BY post_date ASC ") ) { + foreach ( $monthyears as $k => $monthyear ) + $monthyears[$k]->lmonth = $wp_locale->get_month( $monthyear->month, 2 ); + for( $s = 0, $e = count( $monthyears ) - 1; $e >= 0; $s++, $e-- ) { + $dateoptions .= "\t\n"; + $edateoptions .= "\t\n"; + } +} + ?>
    @@ -31,26 +70,71 @@ require_once ('admin-header.php');

    -

    +

    -

    +

    - + + + + + + + + + + true ), 'objects' ) as $tax_obj ) { + $term_dropdown = wp_dropdown_categories( array( 'taxonomy' => $tax_obj->name, 'hide_if_empty' => true, 'show_option_all' => __( 'All Terms' ), 'name' => 'taxonomy[' . $tax_obj->name . ']', 'id' => 'taxonomy-' . $tax_obj->name, 'class' => '', 'echo' => false ) ); + if ( $term_dropdown ) + echo ''; +} +?> + + + + + + + +
    + +
    + +
    ' . $term_dropdown . '
    + +
    + +

    diff --git a/wp-admin/gears-manifest.php b/wp-admin/gears-manifest.php index 6bd926b8..8feb485f 100644 --- a/wp-admin/gears-manifest.php +++ b/wp-admin/gears-manifest.php @@ -34,15 +34,15 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' ); $entries = ''; foreach ( $files as $file ) { + // Set ignoreQuery, defaulting to true + $ignore_query = ( isset($file[2]) && !$file[2] ) ? '' : ', "ignoreQuery" : true '; + // If version is not set, just output the file if ( !isset($file[1]) ) - $entries .= '{ "url" : "' . $file[0] . '" },' . "\n"; - // If ver is set but ignoreQuery is not, output file with ver tacked on - elseif ( !isset($file[2]) ) - $entries .= '{ "url" : "' . $file[0] . '?' . $file[1] . '" },' . "\n"; - // Output url, src, and ignoreQuery + $entries .= '{ "url" : "' . $file[0] . '"' . $ignore_query . ' }' . "\n"; + // Output url and src else - $entries .= '{ "url" : "' . $file[0] . '", "src" : "' . $file[0] . '?' . $file[1] . '", "ignoreQuery" : true },' . "\n"; + $entries .= '{ "url" : "' . $file[0] . '", "src" : "' . $file[0] . '?' . $file[1] . '"' . $ignore_query . ' },' . "\n"; } echo trim( trim($entries), ',' ); diff --git a/wp-admin/images/browse-happy.gif b/wp-admin/images/browse-happy.gif deleted file mode 100644 index c5b64a5e..00000000 Binary files a/wp-admin/images/browse-happy.gif and /dev/null differ diff --git a/wp-admin/images/fav-arrow-rtl.gif b/wp-admin/images/fav-arrow-rtl.gif index 9c9fd15a..e9aeba05 100644 Binary files a/wp-admin/images/fav-arrow-rtl.gif and b/wp-admin/images/fav-arrow-rtl.gif differ diff --git a/wp-admin/images/fav-arrow-vs-rtl.gif b/wp-admin/images/fav-arrow-vs-rtl.gif new file mode 100644 index 00000000..a9c0721c Binary files /dev/null and b/wp-admin/images/fav-arrow-vs-rtl.gif differ diff --git a/wp-admin/images/fav-arrow.gif b/wp-admin/images/fav-arrow.gif index 69e03524..28fc6bbe 100644 Binary files a/wp-admin/images/fav-arrow.gif and b/wp-admin/images/fav-arrow.gif differ diff --git a/wp-admin/images/fav-top.png b/wp-admin/images/fav-top.png deleted file mode 100644 index 85a68529..00000000 Binary files a/wp-admin/images/fav-top.png and /dev/null differ diff --git a/wp-admin/images/icons32-vs.png b/wp-admin/images/icons32-vs.png index 46831747..d910bc1b 100644 Binary files a/wp-admin/images/icons32-vs.png and b/wp-admin/images/icons32-vs.png differ diff --git a/wp-admin/images/icons32.png b/wp-admin/images/icons32.png index 6677d1ce..d94e38af 100644 Binary files a/wp-admin/images/icons32.png and b/wp-admin/images/icons32.png differ diff --git a/wp-admin/images/media-button-image.gif b/wp-admin/images/media-button-image.gif index 11278c85..5e7e4265 100644 Binary files a/wp-admin/images/media-button-image.gif and b/wp-admin/images/media-button-image.gif differ diff --git a/wp-admin/images/media-button-music.gif b/wp-admin/images/media-button-music.gif index f85cd434..0254a088 100644 Binary files a/wp-admin/images/media-button-music.gif and b/wp-admin/images/media-button-music.gif differ diff --git a/wp-admin/images/media-button-other.gif b/wp-admin/images/media-button-other.gif index f3f2f8ae..414a9578 100644 Binary files a/wp-admin/images/media-button-other.gif and b/wp-admin/images/media-button-other.gif differ diff --git a/wp-admin/images/media-button-video.gif b/wp-admin/images/media-button-video.gif index ceb27341..50ac6e02 100644 Binary files a/wp-admin/images/media-button-video.gif and b/wp-admin/images/media-button-video.gif differ diff --git a/wp-admin/images/menu-bits-rtl.gif b/wp-admin/images/menu-bits-rtl.gif index 3765bfb8..b193af0d 100644 Binary files a/wp-admin/images/menu-bits-rtl.gif and b/wp-admin/images/menu-bits-rtl.gif differ diff --git a/wp-admin/images/menu-bits.gif b/wp-admin/images/menu-bits.gif index 9a10a9a1..218e184d 100644 Binary files a/wp-admin/images/menu-bits.gif and b/wp-admin/images/menu-bits.gif differ diff --git a/wp-admin/images/menu-vs.png b/wp-admin/images/menu-vs.png index eb53fe8d..76372bc3 100644 Binary files a/wp-admin/images/menu-vs.png and b/wp-admin/images/menu-vs.png differ diff --git a/wp-admin/images/menu.png b/wp-admin/images/menu.png index cc299fc6..fa6ed84b 100644 Binary files a/wp-admin/images/menu.png and b/wp-admin/images/menu.png differ diff --git a/wp-admin/images/screen-options-left.gif b/wp-admin/images/screen-options-left.gif deleted file mode 100644 index d692d864..00000000 Binary files a/wp-admin/images/screen-options-left.gif and /dev/null differ diff --git a/wp-admin/images/screen-options-right-up.gif b/wp-admin/images/screen-options-right-up.gif index 908e37fd..6556aeed 100644 Binary files a/wp-admin/images/screen-options-right-up.gif and b/wp-admin/images/screen-options-right-up.gif differ diff --git a/wp-admin/images/screen-options-right.gif b/wp-admin/images/screen-options-right.gif index e2508a05..8fcf2548 100644 Binary files a/wp-admin/images/screen-options-right.gif and b/wp-admin/images/screen-options-right.gif differ diff --git a/wp-admin/images/widgets-arrow.gif b/wp-admin/images/widgets-arrow.gif new file mode 100644 index 00000000..69e03524 Binary files /dev/null and b/wp-admin/images/widgets-arrow.gif differ diff --git a/wp-admin/images/wp-logo-vs.gif b/wp-admin/images/wp-logo-vs.gif deleted file mode 100644 index 7154d49a..00000000 Binary files a/wp-admin/images/wp-logo-vs.gif and /dev/null differ diff --git a/wp-admin/images/wp-logo-vs.png b/wp-admin/images/wp-logo-vs.png new file mode 100644 index 00000000..793f54cd Binary files /dev/null and b/wp-admin/images/wp-logo-vs.png differ diff --git a/wp-admin/images/wp-logo.gif b/wp-admin/images/wp-logo.gif deleted file mode 100644 index 42bc6767..00000000 Binary files a/wp-admin/images/wp-logo.gif and /dev/null differ diff --git a/wp-admin/images/wp-logo.png b/wp-admin/images/wp-logo.png new file mode 100644 index 00000000..81e7d599 Binary files /dev/null and b/wp-admin/images/wp-logo.png differ diff --git a/wp-admin/import.php b/wp-admin/import.php index 86dcb147..d3ade57a 100644 --- a/wp-admin/import.php +++ b/wp-admin/import.php @@ -6,13 +6,42 @@ * @subpackage Administration */ +define('WP_LOAD_IMPORTERS', true); + /** Load WordPress Bootstrap */ require_once ('admin.php'); -if ( !current_user_can('edit_files') ) - wp_die(__('You do not have sufficient permissions to import content in this blog.')); +if ( !current_user_can('import') ) + wp_die(__('You do not have sufficient permissions to import content in this site.')); $title = __('Import'); + +add_contextual_help($current_screen, + '

    ' . __('This screen lists links to plugins to import data from blogging/content management platforms. Choose the platform you want to import from, and click Install Now when you are prompted in the popup window. If your platform is not listed, click the link to search the plugin directory for other importer plugins to see if there is one for your platform.') . '

    ' . + '

    ' . __('In previous versions of WordPress, all the importers were built-in, but they have been turned into plugins as of version 3.0 since most people only use them once or infrequently.') . '

    ' . + '

    ' . __('For more information:') . '

    ' . + '

    ' . __('Import Documentation') . '

    ' . + '

    ' . __('Support Forums') . '

    ' +); + +$popular_importers = array(); +if ( current_user_can('install_plugins') ) + $popular_importers = array( + 'blogger' => array( __('Blogger'), __('Install the Blogger importer to import posts, comments, and users from a Blogger blog.'), 'install' ), + 'wpcat2tag' => array(__('Categories and Tags Converter'), __('Install the category/tag converter to convert existing categories to tags or tags to categories, selectively.'), 'install', 'wp-cat2tag' ), + 'livejournal' => array( __( 'LiveJournal' ), __( 'Install the LiveJournal importer to import posts from LiveJournal using their API.' ), 'install' ), + 'movabletype' => array( __('Movable Type and TypePad'), __('Install the Movable Type importer to import posts and comments from a Movable Type or TypePad blog.'), 'install', 'mt' ), + 'opml' => array( __('Blogroll'), __('Install the blogroll importer to import links in OPML format.'), 'install' ), + 'rss' => array( __('RSS'), __('Install the RSS importer to import posts from an RSS feed.'), 'install' ), + 'wordpress' => array( 'WordPress', __('Install the WordPress importer to import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.'), 'install' ) + ); + +if ( ! empty( $_GET['invalid'] ) && !empty($popular_importers[$_GET['invalid']][3]) ) { + wp_redirect("import.php?import=" . $popular_importers[$_GET['invalid']][3]); + exit; +} + +add_thickbox(); require_once ('admin-header.php'); $parent_file = 'tools.php'; ?> @@ -20,7 +49,10 @@ $parent_file = 'tools.php';

    -

    + +

    %s importer is invalid or is not installed.'), esc_html( $_GET['invalid'] ) ); ?>

    + +

    $pop_data ) { + if ( isset($importers[$pop_importer] ) ) + continue; + if ( isset( $pop_data[3] ) && isset( $importers[ $pop_data[3] ] ) ) + continue; + + $importers[$pop_importer] = $popular_importers[$pop_importer]; +} + if (empty ($importers)) { echo '

    '.__('No importers are available.').'

    '; // TODO: make more helpful } else { + uasort($importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);')); ?> @@ -51,7 +94,26 @@ if (empty ($importers)) { $style = ''; foreach ($importers as $id => $data) { $style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate'; - $action = "{$data[0]}"; + $action = ''; + if ( 'install' == $data[2] ) { + $plugin_slug = $id . '-importer'; + if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_slug ) ) { + // Looks like Importer is installed, But not active + $plugins = get_plugins( '/' . $plugin_slug ); + if ( !empty($plugins) ) { + $keys = array_keys($plugins); + $plugin_file = $plugin_slug . '/' . $keys[0]; + $action = '' . $data[0] . ''; + } + } + if ( empty($action) ) + $action = '' . $data[0] . ''; + } else { + $action = "{$data[0]}"; + } if ($style != '') $style = 'class="'.$style.'"'; @@ -66,6 +128,9 @@ if (empty ($importers)) {
    ' . sprintf('If the importer you need is not listed, search the plugins directory to see if an importer is available.', esc_url(admin_url('plugin-install.php?tab=search&type=tag&s=importer')) ) . '

    '; ?>
    @@ -74,4 +139,3 @@ if (empty ($importers)) { include ('admin-footer.php'); ?> - diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php deleted file mode 100644 index 58aa684b..00000000 --- a/wp-admin/import/blogger.php +++ /dev/null @@ -1,1077 +0,0 @@ - - ".screen_icon()." -

    $title

    -

    $welcome

    $prereqs

    $stepone

    - -

    - - - - - -

    -
    -
    \n"; - } - - function uh_oh($title, $message, $info) { - echo "
    "; - screen_icon(); - echo "

    $title

    $message

    $info
    "; - } - - function auth() { - // We have a single-use token that must be upgraded to a session token. - $token = preg_replace( '/[^-_0-9a-zA-Z]/', '', $_GET['token'] ); - $headers = array( - "GET /accounts/AuthSubSessionToken HTTP/1.0", - "Authorization: AuthSub token=\"$token\"" - ); - $request = join( "\r\n", $headers ) . "\r\n\r\n"; - $sock = $this->_get_auth_sock( ); - if ( ! $sock ) return false; - $response = $this->_txrx( $sock, $request ); - preg_match( '/token=([-_0-9a-z]+)/i', $response, $matches ); - if ( empty( $matches[1] ) ) { - $this->uh_oh( - __( 'Authorization failed' ), - __( 'Something went wrong. If the problem persists, send this info to support:' ), - htmlspecialchars($response) - ); - return false; - } - $this->token = $matches[1]; - - wp_redirect( remove_query_arg( array( 'token', 'noheader' ) ) ); - } - - function get_token_info() { - $headers = array( - "GET /accounts/AuthSubTokenInfo HTTP/1.0", - "Authorization: AuthSub token=\"$this->token\"" - ); - $request = join( "\r\n", $headers ) . "\r\n\r\n"; - $sock = $this->_get_auth_sock( ); - if ( ! $sock ) return; - $response = $this->_txrx( $sock, $request ); - return $this->parse_response($response); - } - - function token_is_valid() { - $info = $this->get_token_info(); - - if ( $info['code'] == 200 ) - return true; - - return false; - } - - function show_blogs($iter = 0) { - if ( empty($this->blogs) ) { - $headers = array( - "GET /feeds/default/blogs HTTP/1.0", - "Host: www.blogger.com", - "Authorization: AuthSub token=\"$this->token\"" - ); - $request = join( "\r\n", $headers ) . "\r\n\r\n"; - $sock = $this->_get_blogger_sock( ); - if ( ! $sock ) return; - $response = $this->_txrx( $sock, $request ); - - // Quick and dirty XML mining. - list( $headers, $xml ) = explode( "\r\n\r\n", $response ); - $p = xml_parser_create(); - xml_parse_into_struct($p, $xml, $vals, $index); - xml_parser_free($p); - - $this->title = $vals[$index['TITLE'][0]]['value']; - - // Give it a few retries... this step often flakes out the first time. - if ( empty( $index['ENTRY'] ) ) { - if ( $iter < 3 ) { - return $this->show_blogs($iter + 1); - } else { - $this->uh_oh( - __('Trouble signing in'), - __('We were not able to gain access to your account. Try starting over.'), - '' - ); - return false; - } - } - - foreach ( $index['ENTRY'] as $i ) { - $blog = array(); - while ( ( $tag = $vals[$i] ) && ! ( $tag['tag'] == 'ENTRY' && $tag['type'] == 'close' ) ) { - if ( $tag['tag'] == 'TITLE' ) { - $blog['title'] = $tag['value']; - } elseif ( $tag['tag'] == 'SUMMARY' ) { - $blog['summary'] == $tag['value']; - } elseif ( $tag['tag'] == 'LINK' ) { - if ( $tag['attributes']['REL'] == 'alternate' && $tag['attributes']['TYPE'] == 'text/html' ) { - $parts = parse_url( $tag['attributes']['HREF'] ); - $blog['host'] = $parts['host']; - } elseif ( $tag['attributes']['REL'] == 'edit' ) - $blog['gateway'] = $tag['attributes']['HREF']; - } - ++$i; - } - if ( ! empty ( $blog ) ) { - $blog['total_posts'] = $this->get_total_results('posts', $blog['host']); - $blog['total_comments'] = $this->get_total_results('comments', $blog['host']); - $blog['mode'] = 'init'; - $this->blogs[] = $blog; - } - } - - if ( empty( $this->blogs ) ) { - $this->uh_oh( - __('No blogs found'), - __('We were able to log in but there were no blogs. Try a different account next time.'), - '' - ); - return false; - } - } -//echo '
    '.print_r($this,1).'
    '; - $start = esc_js( __('Import') ); - $continue = esc_js( __('Continue') ); - $stop = esc_js( __('Importing...') ); - $authors = esc_js( __('Set Authors') ); - $loadauth = esc_js( __('Preparing author mapping form...') ); - $authhead = esc_js( __('Final Step: Author Mapping') ); - $nothing = esc_js( __('Nothing was imported. Had you already imported this blog?') ); - $stopping = ''; //Missing String used below. - $title = __('Blogger Blogs'); - $name = __('Blog Name'); - $url = __('Blog URL'); - $action = __('The Magic Button'); - $posts = __('Posts'); - $comments = __('Comments'); - $noscript = __('This feature requires Javascript but it seems to be disabled. Please enable Javascript and then reload this page. Don’t worry, you can turn it back off when you’re done.'); - - $interval = STATUS_INTERVAL * 1000; - - foreach ( $this->blogs as $i => $blog ) { - if ( $blog['mode'] == 'init' ) - $value = $start; - elseif ( $blog['mode'] == 'posts' || $blog['mode'] == 'comments' ) - $value = $continue; - else - $value = $authors; - $value = esc_attr($value); - $blogtitle = esc_js( $blog['title'] ); - $pdone = isset($blog['posts_done']) ? (int) $blog['posts_done'] : 0; - $cdone = isset($blog['comments_done']) ? (int) $blog['comments_done'] : 0; - $init .= "blogs[$i]=new blog($i,'$blogtitle','{$blog['mode']}'," . $this->get_js_status($i) . ');'; - $pstat = "
     
    $pdone/{$blog['total_posts']}
    "; - $cstat = "
     
    $cdone/{$blog['total_comments']}
    "; - $rows .= "$blogtitle{$blog['host']}$pstat$cstat\n"; - } - - echo "

    $title

    \n$rows
    $name$url$posts$comments$action
    "; - echo " - \n"; - } - - // Handy function for stopping the script after a number of seconds. - function have_time() { - global $importer_started; - if ( time() - $importer_started > MAX_EXECUTION_TIME ) - die('continue'); - return true; - } - - function get_total_results($type, $host) { - $headers = array( - "GET /feeds/$type/default?max-results=1&start-index=2 HTTP/1.0", - "Host: $host", - "Authorization: AuthSub token=\"$this->token\"" - ); - $request = join( "\r\n", $headers ) . "\r\n\r\n"; - $sock = $this->_get_blogger_sock( $host ); - if ( ! $sock ) return; - $response = $this->_txrx( $sock, $request ); - $response = $this->parse_response( $response ); - $parser = xml_parser_create(); - xml_parse_into_struct($parser, $response['body'], $struct, $index); - xml_parser_free($parser); - $total_results = $struct[$index['OPENSEARCH:TOTALRESULTS'][0]]['value']; - return (int) $total_results; - } - - function import_blog($blogID) { - global $importing_blog; - $importing_blog = $blogID; - - if ( isset($_GET['authors']) ) - return print($this->get_author_form()); - - header('Content-Type: text/plain'); - - if ( isset($_GET['status']) ) - die($this->get_js_status()); - - if ( isset($_GET['saveauthors']) ) - die($this->save_authors()); - - $blog = $this->blogs[$blogID]; - $total_results = $this->get_total_results('posts', $blog['host']); - $this->blogs[$importing_blog]['total_posts'] = $total_results; - - $start_index = $total_results - MAX_RESULTS + 1; - - if ( isset( $this->blogs[$importing_blog]['posts_start_index'] ) ) - $start_index = (int) $this->blogs[$importing_blog]['posts_start_index']; - elseif ( $total_results > MAX_RESULTS ) - $start_index = $total_results - MAX_RESULTS + 1; - else - $start_index = 1; - - // This will be positive until we have finished importing posts - if ( $start_index > 0 ) { - // Grab all the posts - $this->blogs[$importing_blog]['mode'] = 'posts'; - $query = "start-index=$start_index&max-results=" . MAX_RESULTS; - do { - $index = $struct = $entries = array(); - $headers = array( - "GET /feeds/posts/default?$query HTTP/1.0", - "Host: {$blog['host']}", - "Authorization: AuthSub token=\"$this->token\"" - ); - $request = join( "\r\n", $headers ) . "\r\n\r\n"; - $sock = $this->_get_blogger_sock( $blog['host'] ); - if ( ! $sock ) return; // TODO: Error handling - $response = $this->_txrx( $sock, $request ); - - $response = $this->parse_response( $response ); - - // Extract the entries and send for insertion - preg_match_all( '/]*>.*?<\/entry>/s', $response['body'], $matches ); - if ( count( $matches[0] ) ) { - $entries = array_reverse($matches[0]); - foreach ( $entries as $entry ) { - $entry = "$entry"; - $AtomParser = new AtomParser(); - $AtomParser->parse( $entry ); - $result = $this->import_post($AtomParser->entry); - if ( is_wp_error( $result ) ) - return $result; - unset($AtomParser); - } - } else break; - - // Get the 'previous' query string which we'll use on the next iteration - $query = ''; - $links = preg_match_all('/]*)>/', $response['body'], $matches); - if ( count( $matches[1] ) ) - foreach ( $matches[1] as $match ) - if ( preg_match('/rel=.previous./', $match) ) - $query = @html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match), ENT_COMPAT, get_option('blog_charset') ); - - if ( $query ) { - parse_str($query, $q); - $this->blogs[$importing_blog]['posts_start_index'] = (int) $q['start-index']; - } else - $this->blogs[$importing_blog]['posts_start_index'] = 0; - $this->save_vars(); - } while ( !empty( $query ) && $this->have_time() ); - } - - $total_results = $this->get_total_results( 'comments', $blog['host'] ); - $this->blogs[$importing_blog]['total_comments'] = $total_results; - - if ( isset( $this->blogs[$importing_blog]['comments_start_index'] ) ) - $start_index = (int) $this->blogs[$importing_blog]['comments_start_index']; - elseif ( $total_results > MAX_RESULTS ) - $start_index = $total_results - MAX_RESULTS + 1; - else - $start_index = 1; - - if ( $start_index > 0 ) { - // Grab all the comments - $this->blogs[$importing_blog]['mode'] = 'comments'; - $query = "start-index=$start_index&max-results=" . MAX_RESULTS; - do { - $index = $struct = $entries = array(); - $headers = array( - "GET /feeds/comments/default?$query HTTP/1.0", - "Host: {$blog['host']}", - "Authorization: AuthSub token=\"$this->token\"" - ); - $request = join( "\r\n", $headers ) . "\r\n\r\n"; - $sock = $this->_get_blogger_sock( $blog['host'] ); - if ( ! $sock ) return; // TODO: Error handling - $response = $this->_txrx( $sock, $request ); - - $response = $this->parse_response( $response ); - - // Extract the comments and send for insertion - preg_match_all( '/]*>.*?<\/entry>/s', $response['body'], $matches ); - if ( count( $matches[0] ) ) { - $entries = array_reverse( $matches[0] ); - foreach ( $entries as $entry ) { - $entry = "$entry"; - $AtomParser = new AtomParser(); - $AtomParser->parse( $entry ); - $this->import_comment($AtomParser->entry); - unset($AtomParser); - } - } - - // Get the 'previous' query string which we'll use on the next iteration - $query = ''; - $links = preg_match_all('/]*)>/', $response['body'], $matches); - if ( count( $matches[1] ) ) - foreach ( $matches[1] as $match ) - if ( preg_match('/rel=.previous./', $match) ) - $query = @html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match), ENT_COMPAT, get_option('blog_charset') ); - - parse_str($query, $q); - - $this->blogs[$importing_blog]['comments_start_index'] = (int) $q['start-index']; - $this->save_vars(); - } while ( !empty( $query ) && $this->have_time() ); - } - $this->blogs[$importing_blog]['mode'] = 'authors'; - $this->save_vars(); - if ( !$this->blogs[$importing_blog]['posts_done'] && !$this->blogs[$importing_blog]['comments_done'] ) - die('nothing'); - do_action('import_done', 'blogger'); - die('done'); - } - - function convert_date( $date ) { - preg_match('#([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.[0-9]+)?(Z|[\+|\-][0-9]{2,4}){0,1}#', $date, $date_bits); - $offset = iso8601_timezone_to_offset( $date_bits[7] ); - $timestamp = gmmktime($date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1]); - $timestamp -= $offset; // Convert from Blogger local time to GMT - $timestamp += get_option('gmt_offset') * 3600; // Convert from GMT to WP local time - return gmdate('Y-m-d H:i:s', $timestamp); - } - - function no_apos( $string ) { - return str_replace( ''', "'", $string); - } - - function min_whitespace( $string ) { - return preg_replace( '|\s+|', ' ', $string ); - } - - function _normalize_tag( $matches ) { - return '<' . strtolower( $matches[1] ); - } - - function import_post( $entry ) { - global $importing_blog; - - // The old permalink is all Blogger gives us to link comments to their posts. - if ( isset( $entry->draft ) ) - $rel = 'self'; - else - $rel = 'alternate'; - foreach ( $entry->links as $link ) { - if ( $link['rel'] == $rel ) { - $parts = parse_url( $link['href'] ); - $entry->old_permalink = $parts['path']; - break; - } - } - - $post_date = $this->convert_date( $entry->published ); - $post_content = trim( addslashes( $this->no_apos( @html_entity_decode( $entry->content, ENT_COMPAT, get_option('blog_charset') ) ) ) ); - $post_title = trim( addslashes( $this->no_apos( $this->min_whitespace( $entry->title ) ) ) ); - $post_status = isset( $entry->draft ) ? 'draft' : 'publish'; - - // Clean up content - $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content); - $post_content = str_replace('
    ', '
    ', $post_content); - $post_content = str_replace('
    ', '
    ', $post_content); - - // Checks for duplicates - if ( isset( $this->blogs[$importing_blog]['posts'][$entry->old_permalink] ) ) { - ++$this->blogs[$importing_blog]['posts_skipped']; - } elseif ( $post_id = post_exists( $post_title, $post_content, $post_date ) ) { - $this->blogs[$importing_blog]['posts'][$entry->old_permalink] = $post_id; - ++$this->blogs[$importing_blog]['posts_skipped']; - } else { - $post = compact('post_date', 'post_content', 'post_title', 'post_status'); - - $post_id = wp_insert_post($post); - if ( is_wp_error( $post_id ) ) - return $post_id; - - wp_create_categories( array_map( 'addslashes', $entry->categories ), $post_id ); - - $author = $this->no_apos( strip_tags( $entry->author ) ); - - add_post_meta( $post_id, 'blogger_blog', $this->blogs[$importing_blog]['host'], true ); - add_post_meta( $post_id, 'blogger_author', $author, true ); - add_post_meta( $post_id, 'blogger_permalink', $entry->old_permalink, true ); - - $this->blogs[$importing_blog]['posts'][$entry->old_permalink] = $post_id; - ++$this->blogs[$importing_blog]['posts_done']; - } - $this->save_vars(); - return; - } - - function import_comment( $entry ) { - global $importing_blog; - - // Drop the #fragment and we have the comment's old post permalink. - foreach ( $entry->links as $link ) { - if ( $link['rel'] == 'alternate' ) { - $parts = parse_url( $link['href'] ); - $entry->old_permalink = $parts['fragment']; - $entry->old_post_permalink = $parts['path']; - break; - } - } - - $comment_post_ID = (int) $this->blogs[$importing_blog]['posts'][$entry->old_post_permalink]; - preg_match('#(.+?).*(?:\(.+?))?#', $entry->author, $matches); - $comment_author = addslashes( $this->no_apos( strip_tags( (string) $matches[1] ) ) ); - $comment_author_url = addslashes( $this->no_apos( strip_tags( (string) $matches[2] ) ) ); - $comment_date = $this->convert_date( $entry->updated ); - $comment_content = addslashes( $this->no_apos( @html_entity_decode( $entry->content, ENT_COMPAT, get_option('blog_charset') ) ) ); - - // Clean up content - $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content); - $comment_content = str_replace('
    ', '
    ', $comment_content); - $comment_content = str_replace('
    ', '
    ', $comment_content); - - // Checks for duplicates - if ( - isset( $this->blogs[$importing_blog]['comments'][$entry->old_permalink] ) || - comment_exists( $comment_author, $comment_date ) - ) { - ++$this->blogs[$importing_blog]['comments_skipped']; - } else { - $comment = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_date', 'comment_content'); - - $comment = wp_filter_comment($comment); - $comment_id = wp_insert_comment($comment); - - $this->blogs[$importing_blog]['comments'][$entry->old_permalink] = $comment_id; - - ++$this->blogs[$importing_blog]['comments_done']; - } - $this->save_vars(); - } - - function get_js_status($blog = false) { - global $importing_blog; - if ( $blog === false ) - $blog = $this->blogs[$importing_blog]; - else - $blog = $this->blogs[$blog]; - $p1 = isset( $blog['posts_done'] ) ? (int) $blog['posts_done'] : 0; - $p2 = isset( $blog['total_posts'] ) ? (int) $blog['total_posts'] : 0; - $c1 = isset( $blog['comments_done'] ) ? (int) $blog['comments_done'] : 0; - $c2 = isset( $blog['total_comments'] ) ? (int) $blog['total_comments'] : 0; - return "{p1:$p1,p2:$p2,c1:$c1,c2:$c2}"; - } - - function get_author_form($blog = false) { - global $importing_blog, $wpdb, $current_user; - if ( $blog === false ) - $blog = & $this->blogs[$importing_blog]; - else - $blog = & $this->blogs[$blog]; - - if ( !isset( $blog['authors'] ) ) { - $post_ids = array_values($blog['posts']); - $authors = (array) $wpdb->get_col("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_author' AND post_id IN (" . join( ',', $post_ids ) . ")"); - $blog['authors'] = array_map(null, $authors, array_fill(0, count($authors), $current_user->ID)); - $this->save_vars(); - } - - $directions = __('All posts were imported with the current user as author. Use this form to move each Blogger user’s posts to a different WordPress user. You may add users and then return to this page and complete the user mapping. This form may be used as many times as you like until you activate the “Restart” function below.'); - $heading = __('Author mapping'); - $blogtitle = "{$blog['title']} ({$blog['host']})"; - $mapthis = __('Blogger username'); - $tothis = __('WordPress login'); - $submit = esc_js( __('Save Changes') ); - - foreach ( $blog['authors'] as $i => $author ) - $rows .= ""; - - return "

    $heading

    $blogtitle

    $directions

    $rows
    $mapthis$tothis
    "; - } - - function get_user_options($current) { - global $importer_users; - if ( ! isset( $importer_users ) ) - $importer_users = (array) get_users_of_blog(); - - foreach ( $importer_users as $user ) { - $sel = ( $user->user_id == $current ) ? " selected='selected'" : ''; - $options .= ""; - } - - return $options; - } - - function save_authors() { - global $importing_blog, $wpdb; - $authors = (array) $_POST['authors']; - - $host = $this->blogs[$importing_blog]['host']; - - // Get an array of posts => authors - $post_ids = (array) $wpdb->get_col( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = %s", $host) ); - $post_ids = join( ',', $post_ids ); - $results = (array) $wpdb->get_results("SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_author' AND post_id IN ($post_ids)"); - foreach ( $results as $row ) - $authors_posts[$row->post_id] = $row->meta_value; - - foreach ( $authors as $author => $user_id ) { - $user_id = (int) $user_id; - - // Skip authors that haven't been changed - if ( $user_id == $this->blogs[$importing_blog]['authors'][$author][1] ) - continue; - - // Get a list of the selected author's posts - $post_ids = (array) array_keys( $authors_posts, $this->blogs[$importing_blog]['authors'][$author][0] ); - $post_ids = join( ',', $post_ids); - - $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE id IN ($post_ids)", $user_id) ); - $this->blogs[$importing_blog]['authors'][$author][1] = $user_id; - } - $this->save_vars(); - - wp_redirect('edit.php'); - } - - function _get_auth_sock() { - // Connect to https://www.google.com - if ( !$sock = @ fsockopen('ssl://www.google.com', 443, $errno, $errstr) ) { - $this->uh_oh( - __('Could not connect to https://www.google.com'), - __('There was a problem opening a secure connection to Google. This is what went wrong:'), - "$errstr ($errno)" - ); - return false; - } - return $sock; - } - - function _get_blogger_sock($host = 'www2.blogger.com') { - if ( !$sock = @ fsockopen($host, 80, $errno, $errstr) ) { - $this->uh_oh( - sprintf( __('Could not connect to %s'), $host ), - __('There was a problem opening a connection to Blogger. This is what went wrong:'), - "$errstr ($errno)" - ); - return false; - } - return $sock; - } - - function _txrx( $sock, $request ) { - fwrite( $sock, $request ); - while ( ! feof( $sock ) ) - $response .= @ fread ( $sock, 8192 ); - fclose( $sock ); - return $response; - } - - function revoke($token) { - $headers = array( - "GET /accounts/AuthSubRevokeToken HTTP/1.0", - "Authorization: AuthSub token=\"$token\"" - ); - $request = join( "\r\n", $headers ) . "\r\n\r\n"; - $sock = $this->_get_auth_sock( ); - if ( ! $sock ) return false; - $this->_txrx( $sock, $request ); - } - - function restart() { - global $wpdb; - $options = get_option( 'blogger_importer' ); - - if ( isset( $options['token'] ) ) - $this->revoke( $options['token'] ); - - delete_option('blogger_importer'); - $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = 'blogger_author'"); - wp_redirect('?import=blogger'); - } - - // Returns associative array of code, header, cookies, body. Based on code from php.net. - function parse_response($this_response) { - // Split response into header and body sections - list($response_headers, $response_body) = explode("\r\n\r\n", $this_response, 2); - $response_header_lines = explode("\r\n", $response_headers); - - // First line of headers is the HTTP response code - $http_response_line = array_shift($response_header_lines); - if(preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; } - - // put the rest of the headers in an array - $response_header_array = array(); - foreach($response_header_lines as $header_line) { - list($header,$value) = explode(': ', $header_line, 2); - $response_header_array[$header] .= $value."\n"; - } - - $cookie_array = array(); - $cookies = explode("\n", $response_header_array["Set-Cookie"]); - foreach($cookies as $this_cookie) { array_push($cookie_array, "Cookie: ".$this_cookie); } - - return array("code" => $response_code, "header" => $response_header_array, "cookies" => $cookie_array, "body" => $response_body); - } - - // Step 9: Congratulate the user - function congrats() { - $blog = (int) $_GET['blog']; - echo '

    '.__('Congratulations!').'

    '.__('Now that you have imported your Blogger blog into WordPress, what are you going to do? Here are some suggestions:').'

    • '.__('That was hard work! Take a break.').'
    • '; - if ( count($this->import['blogs']) > 1 ) - echo '
    • '.__('In case you haven’t done it already, you can import the posts from your other blogs:'). $this->show_blogs() . '
    • '; - if ( $n = count($this->import['blogs'][$blog]['newusers']) ) - echo '
    • '.sprintf(__('Go to Authors & Users, where you can modify the new user(s) or delete them. If you want to make all of the imported posts yours, you will be given that option when you delete the new authors.'), 'users.php', '_parent').'
    • '; - echo '
    • '.__('For security, click the link below to reset this importer.').'
    • '; - echo '
    '; - } - - // Figures out what to do, then does it. - function start() { - if ( isset($_POST['restart']) ) - $this->restart(); - - $options = get_option('blogger_importer'); - - if ( is_array($options) ) - foreach ( $options as $key => $value ) - $this->$key = $value; - - if ( isset( $_REQUEST['blog'] ) ) { - $blog = is_array($_REQUEST['blog']) ? array_shift( $keys = array_keys( $_REQUEST['blog'] ) ) : $_REQUEST['blog']; - $blog = (int) $blog; - $result = $this->import_blog( $blog ); - if ( is_wp_error( $result ) ) - echo $result->get_error_message(); - } elseif ( isset($_GET['token']) ) - $this->auth(); - elseif ( isset($this->token) && $this->token_is_valid() ) - $this->show_blogs(); - else - $this->greet(); - - $saved = $this->save_vars(); - - if ( $saved && !isset($_GET['noheader']) ) { - $restart = __('Restart'); - $message = __('We have saved some information about your Blogger account in your WordPress database. Clearing this information will allow you to start over. Restarting will not affect any posts you have already imported. If you attempt to re-import a blog, duplicate posts and comments will be skipped.'); - $submit = esc_attr__('Clear account information'); - echo "

    $restart

    $message

    "; - } - } - - function save_vars() { - $vars = get_object_vars($this); - update_option( 'blogger_importer', $vars ); - - return !empty($vars); - } - - function admin_head() { -?> - -entry = new AtomEntry(); - } - - function _map_attrs_func( $k, $v ) { - return "$k=\"$v\""; - } - - function _map_xmlns_func( $p, $n ) { - $xd = "xmlns"; - if ( strlen( $n[0] ) > 0 ) - $xd .= ":{$n[0]}"; - - return "{$xd}=\"{$n[1]}\""; - } - - function parse($xml) { - - global $app_logging; - array_unshift($this->ns_contexts, array()); - - $parser = xml_parser_create_ns(); - xml_set_object($parser, $this); - xml_set_element_handler($parser, "start_element", "end_element"); - xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); - xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,0); - xml_set_character_data_handler($parser, "cdata"); - xml_set_default_handler($parser, "_default"); - xml_set_start_namespace_decl_handler($parser, "start_ns"); - xml_set_end_namespace_decl_handler($parser, "end_ns"); - - $contents = ""; - - xml_parse($parser, $xml); - - xml_parser_free($parser); - - return true; - } - - function start_element($parser, $name, $attrs) { - - $tag = array_pop(split(":", $name)); - - array_unshift($this->ns_contexts, $this->ns_decls); - - $this->depth++; - - if(!empty($this->in_content)) { - $attrs_prefix = array(); - - // resolve prefixes for attributes - foreach($attrs as $key => $value) { - $attrs_prefix[$this->ns_to_prefix($key)] = $this->xml_escape($value); - } - $attrs_str = join(' ', array_map( array( &$this, '_map_attrs_func' ), array_keys($attrs_prefix), array_values($attrs_prefix))); - if(strlen($attrs_str) > 0) { - $attrs_str = " " . $attrs_str; - } - - $xmlns_str = join(' ', array_map( array( &$this, '_map_xmlns_func' ), array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0]))); - if(strlen($xmlns_str) > 0) { - $xmlns_str = " " . $xmlns_str; - } - - // handle self-closing tags (case: a new child found right-away, no text node) - if(count($this->in_content) == 2) { - array_push($this->in_content, ">"); - } - - array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}"); - } else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) { - $this->in_content = array(); - $this->is_xhtml = $attrs['type'] == 'xhtml'; - array_push($this->in_content, array($tag,$this->depth)); - } else if($tag == 'link') { - array_push($this->entry->links, $attrs); - } else if($tag == 'category') { - array_push($this->entry->categories, $attrs['term']); - } - - $this->ns_decls = array(); - } - - function end_element($parser, $name) { - - $tag = array_pop(split(":", $name)); - - if(!empty($this->in_content)) { - if($this->in_content[0][0] == $tag && - $this->in_content[0][1] == $this->depth) { - array_shift($this->in_content); - if($this->is_xhtml) { - $this->in_content = array_slice($this->in_content, 2, count($this->in_content)-3); - } - $this->entry->$tag = join('',$this->in_content); - $this->in_content = array(); - } else { - $endtag = $this->ns_to_prefix($name); - if (strpos($this->in_content[count($this->in_content)-1], '<' . $endtag) !== false) { - array_push($this->in_content, "/>"); - } else { - array_push($this->in_content, ""); - } - } - } - - array_shift($this->ns_contexts); - - #print str_repeat(" ", $this->depth * $this->indent) . "end_element('$name')" ."\n"; - - $this->depth--; - } - - function start_ns($parser, $prefix, $uri) { - #print str_repeat(" ", $this->depth * $this->indent) . "starting: " . $prefix . ":" . $uri . "\n"; - array_push($this->ns_decls, array($prefix,$uri)); - } - - function end_ns($parser, $prefix) { - #print str_repeat(" ", $this->depth * $this->indent) . "ending: #" . $prefix . "#\n"; - } - - function cdata($parser, $data) { - #print str_repeat(" ", $this->depth * $this->indent) . "data: #" . $data . "#\n"; - if(!empty($this->in_content)) { - // handle self-closing tags (case: text node found, need to close element started) - if (strpos($this->in_content[count($this->in_content)-1], '<') !== false) { - array_push($this->in_content, ">"); - } - array_push($this->in_content, $this->xml_escape($data)); - } - } - - function _default($parser, $data) { - # when does this gets called? - } - - - function ns_to_prefix($qname) { - $components = split(":", $qname); - $name = array_pop($components); - - if(!empty($components)) { - $ns = join(":",$components); - foreach($this->ns_contexts as $context) { - foreach($context as $mapping) { - if($mapping[1] == $ns && strlen($mapping[0]) > 0) { - return "$mapping[0]:$name"; - } - } - } - } - return $name; - } - - function xml_escape($string) - { - return str_replace(array('&','"',"'",'<','>'), - array('&','"',''','<','>'), - $string ); - } -} - -?> diff --git a/wp-admin/import/blogware.php b/wp-admin/import/blogware.php deleted file mode 100644 index 531ceddc..00000000 --- a/wp-admin/import/blogware.php +++ /dev/null @@ -1,219 +0,0 @@ -'; - screen_icon(); - echo '

    '.__('Import Blogware').'

    '; - } - - function footer() { - echo '
    '; - } - - function unhtmlentities($string) { // From php.net for < 4.3 compat - $trans_tbl = get_html_translation_table(HTML_ENTITIES); - $trans_tbl = array_flip($trans_tbl); - return strtr($string, $trans_tbl); - } - - function greet() { - echo '
    '; - echo '

    '.__('Howdy! This importer allows you to extract posts from Blogware XML export file into your blog. Pick a Blogware file to upload and click Import.').'

    '; - wp_import_upload_form("admin.php?import=blogware&step=1"); - echo '
    '; - } - - function _normalize_tag( $matches ) { - return '<' . strtolower( $matches[1] ); - } - - function import_posts() { - global $wpdb, $current_user; - - set_magic_quotes_runtime(0); - $importdata = file($this->file); // Read the file into an array - $importdata = implode('', $importdata); // squish it - $importdata = str_replace(array ("\r\n", "\r"), "\n", $importdata); - - preg_match_all('|(]+>(.*?))|is', $importdata, $posts); - $posts = $posts[1]; - unset($importdata); - echo '
      '; - foreach ($posts as $post) { - flush(); - preg_match('||is', $post, $post_type); - $post_type = $post_type[1]; - if($post_type == "photo") { - preg_match('|(.*?)|is', $post, $post_title); - } else { - preg_match('|(.*?)|is', $post, $post_title); - } - $post_title = $wpdb->escape(trim($post_title[1])); - - preg_match('|(.*?)|is', $post, $post_date); - $post_date = strtotime($post_date[1]); - $post_date = gmdate('Y-m-d H:i:s', $post_date); - - preg_match_all('|(.*?)|is', $post, $categories); - $categories = $categories[1]; - - $cat_index = 0; - foreach ($categories as $category) { - $categories[$cat_index] = $wpdb->escape($this->unhtmlentities($category)); - $cat_index++; - } - - if(strcasecmp($post_type, "photo") === 0) { - preg_match('|(.*?)|is', $post, $post_content); - $post_content = ''; - $post_content = $this->unhtmlentities($post_content); - } else { - preg_match('|(.*?)|is', $post, $post_content); - $post_content = str_replace(array (''), '', trim($post_content[1])); - $post_content = $this->unhtmlentities($post_content); - } - - // Clean up content - $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content); - $post_content = str_replace('
      ', '
      ', $post_content); - $post_content = str_replace('
      ', '
      ', $post_content); - $post_content = $wpdb->escape($post_content); - - $post_author = $current_user->ID; - preg_match('|(.*?)|is', $post, $post_status); - $post_status = trim($post_status[1]); - - echo '
    1. '; - if ($post_id = post_exists($post_title, $post_content, $post_date)) { - printf(__('Post %s already exists.'), stripslashes($post_title)); - } else { - printf(__('Importing post %s...'), stripslashes($post_title)); - $postdata = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status'); - $post_id = wp_insert_post($postdata); - if ( is_wp_error( $post_id ) ) { - return $post_id; - } - if (!$post_id) { - _e('Couldn’t get post ID'); - echo '
    2. '; - break; - } - if(0 != count($categories)) - wp_create_categories($categories, $post_id); - } - - preg_match_all('|(.*?)|is', $post, $comments); - $comments = $comments[1]; - - if ( $comments ) { - $comment_post_ID = (int) $post_id; - $num_comments = 0; - foreach ($comments as $comment) { - preg_match('|(.*?)|is', $comment, $comment_content); - $comment_content = str_replace(array (''), '', trim($comment_content[1])); - $comment_content = $this->unhtmlentities($comment_content); - - // Clean up content - $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content); - $comment_content = str_replace('
      ', '
      ', $comment_content); - $comment_content = str_replace('
      ', '
      ', $comment_content); - $comment_content = $wpdb->escape($comment_content); - - preg_match('|(.*?)|is', $comment, $comment_date); - $comment_date = trim($comment_date[1]); - $comment_date = date('Y-m-d H:i:s', strtotime($comment_date)); - - preg_match('|(.*?)|is', $comment, $comment_author); - $comment_author = $wpdb->escape(trim($comment_author[1])); - - $comment_author_email = NULL; - - $comment_approved = 1; - // Check if it's already there - if (!comment_exists($comment_author, $comment_date)) { - $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_date', 'comment_content', 'comment_approved'); - $commentdata = wp_filter_comment($commentdata); - wp_insert_comment($commentdata); - $num_comments++; - } - } - } - if ( $num_comments ) { - echo ' '; - printf( _n('%s comment', '%s comments', $num_comments), $num_comments ); - } - echo ''; - flush(); - ob_flush(); - } - echo '
    '; - } - - function import() { - $file = wp_import_handle_upload(); - if ( isset($file['error']) ) { - echo $file['error']; - return; - } - - $this->file = $file['file']; - $result = $this->import_posts(); - if ( is_wp_error( $result ) ) - return $result; - wp_import_cleanup($file['id']); - do_action('import_done', 'blogware'); - echo '

    '; - printf(__('All done. Have fun!'), get_option('home')); - echo '

    '; - } - - function dispatch() { - if (empty ($_GET['step'])) - $step = 0; - else - $step = (int) $_GET['step']; - - $this->header(); - - switch ($step) { - case 0 : - $this->greet(); - break; - case 1 : - $result = $this->import(); - if ( is_wp_error( $result ) ) - $result->get_error_message(); - break; - } - - $this->footer(); - } - - function BW_Import() { - // Nothing. - } -} - -$blogware_import = new BW_Import(); - -register_importer('blogware', __('Blogware'), __('Import posts from Blogware.'), array ($blogware_import, 'dispatch')); -?> diff --git a/wp-admin/import/dotclear.php b/wp-admin/import/dotclear.php deleted file mode 100644 index fcde9b17..00000000 --- a/wp-admin/import/dotclear.php +++ /dev/null @@ -1,718 +0,0 @@ -get_var( $wpdb->prepare("SELECT count(*) FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) ); - } -} - -if(!function_exists('link_exists')) -{ - /** - * Check whether link already exists. - * - * @package WordPress - * @subpackage Dotclear_Import - * - * @param string $linkname - * @return int - */ - function link_exists($linkname) - { - global $wpdb; - return $wpdb->get_var( $wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_name = %s", $linkname) ); - } -} - -/** - * Convert from dotclear charset to utf8 if required - * - * @package WordPress - * @subpackage Dotclear_Import - * - * @param string $s - * @return string - */ -function csc ($s) { - if (seems_utf8 ($s)) { - return $s; - } else { - return iconv(get_option ("dccharset"),"UTF-8",$s); - } -} - -/** - * @package WordPress - * @subpackage Dotclear_Import - * - * @param string $s - * @return string - */ -function textconv ($s) { - return csc (preg_replace ('|(?)\s*\n|', ' ', $s)); -} - -/** - * Dotclear Importer class - * - * Will process the WordPress eXtended RSS files that you upload from the export - * file. - * - * @package WordPress - * @subpackage Importer - * - * @since unknown - */ -class Dotclear_Import { - - function header() - { - echo '
    '; - screen_icon(); - echo '

    '.__('Import DotClear').'

    '; - echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; - } - - function footer() - { - echo '
    '; - } - - function greet() - { - echo '

    '.__('Howdy! This importer allows you to extract posts from a DotClear database into your blog. Mileage may vary.').'

    '; - echo '

    '.__('Your DotClear Configuration settings are as follows:').'

    '; - echo '
    '; - wp_nonce_field('import-dotclear'); - $this->db_form(); - echo '

    '; - echo '
    '; - } - - function get_dc_cats() - { - global $wpdb; - // General Housekeeping - $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); - set_magic_quotes_runtime(0); - $dbprefix = get_option('dcdbprefix'); - - // Get Categories - return $dcdb->get_results('SELECT * FROM '.$dbprefix.'categorie', ARRAY_A); - } - - function get_dc_users() - { - global $wpdb; - // General Housekeeping - $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); - set_magic_quotes_runtime(0); - $dbprefix = get_option('dcdbprefix'); - - // Get Users - - return $dcdb->get_results('SELECT * FROM '.$dbprefix.'user', ARRAY_A); - } - - function get_dc_posts() - { - // General Housekeeping - $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); - set_magic_quotes_runtime(0); - $dbprefix = get_option('dcdbprefix'); - - // Get Posts - return $dcdb->get_results('SELECT '.$dbprefix.'post.*, '.$dbprefix.'categorie.cat_libelle_url AS post_cat_name - FROM '.$dbprefix.'post INNER JOIN '.$dbprefix.'categorie - ON '.$dbprefix.'post.cat_id = '.$dbprefix.'categorie.cat_id', ARRAY_A); - } - - function get_dc_comments() - { - global $wpdb; - // General Housekeeping - $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); - set_magic_quotes_runtime(0); - $dbprefix = get_option('dcdbprefix'); - - // Get Comments - return $dcdb->get_results('SELECT * FROM '.$dbprefix.'comment', ARRAY_A); - } - - function get_dc_links() - { - //General Housekeeping - $dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost')); - set_magic_quotes_runtime(0); - $dbprefix = get_option('dcdbprefix'); - - return $dcdb->get_results('SELECT * FROM '.$dbprefix.'link ORDER BY position', ARRAY_A); - } - - function cat2wp($categories='') - { - // General Housekeeping - global $wpdb; - $count = 0; - $dccat2wpcat = array(); - // Do the Magic - if(is_array($categories)) - { - echo '

    '.__('Importing Categories...').'

    '; - foreach ($categories as $category) - { - $count++; - extract($category); - - // Make Nice Variables - $name = $wpdb->escape($cat_libelle_url); - $title = $wpdb->escape(csc ($cat_libelle)); - $desc = $wpdb->escape(csc ($cat_desc)); - - if($cinfo = category_exists($name)) - { - $ret_id = wp_insert_category(array('cat_ID' => $cinfo, 'category_nicename' => $name, 'cat_name' => $title, 'category_description' => $desc)); - } - else - { - $ret_id = wp_insert_category(array('category_nicename' => $name, 'cat_name' => $title, 'category_description' => $desc)); - } - $dccat2wpcat[$id] = $ret_id; - } - - // Store category translation for future use - add_option('dccat2wpcat',$dccat2wpcat); - echo '

    '.sprintf(_n('Done! %1$s category imported.', 'Done! %1$s categories imported.', $count), $count).'

    '; - return true; - } - echo __('No Categories to Import!'); - return false; - } - - function users2wp($users='') - { - // General Housekeeping - global $wpdb; - $count = 0; - $dcid2wpid = array(); - - // Midnight Mojo - if(is_array($users)) - { - echo '

    '.__('Importing Users...').'

    '; - foreach($users as $user) - { - $count++; - extract($user); - - // Make Nice Variables - $name = $wpdb->escape(csc ($name)); - $RealName = $wpdb->escape(csc ($user_pseudo)); - - if($uinfo = get_userdatabylogin($name)) - { - - $ret_id = wp_insert_user(array( - 'ID' => $uinfo->ID, - 'user_login' => $user_id, - 'user_nicename' => $Realname, - 'user_email' => $user_email, - 'user_url' => 'http://', - 'display_name' => $Realname) - ); - } - else - { - $ret_id = wp_insert_user(array( - 'user_login' => $user_id, - 'user_nicename' => csc ($user_pseudo), - 'user_email' => $user_email, - 'user_url' => 'http://', - 'display_name' => $Realname) - ); - } - $dcid2wpid[$user_id] = $ret_id; - - // Set DotClear-to-WordPress permissions translation - - // Update Usermeta Data - $user = new WP_User($ret_id); - $wp_perms = $user_level + 1; - if(10 == $wp_perms) { $user->set_role('administrator'); } - else if(9 == $wp_perms) { $user->set_role('editor'); } - else if(5 <= $wp_perms) { $user->set_role('editor'); } - else if(4 <= $wp_perms) { $user->set_role('author'); } - else if(3 <= $wp_perms) { $user->set_role('contributor'); } - else if(2 <= $wp_perms) { $user->set_role('contributor'); } - else { $user->set_role('subscriber'); } - - update_usermeta( $ret_id, 'wp_user_level', $wp_perms); - update_usermeta( $ret_id, 'rich_editing', 'false'); - update_usermeta( $ret_id, 'first_name', csc ($user_prenom)); - update_usermeta( $ret_id, 'last_name', csc ($user_nom)); - }// End foreach($users as $user) - - // Store id translation array for future use - add_option('dcid2wpid',$dcid2wpid); - - - echo '

    '.sprintf(__('Done! %1$s users imported.'), $count).'

    '; - return true; - }// End if(is_array($users) - - echo __('No Users to Import!'); - return false; - - }// End function user2wp() - - function posts2wp($posts='') - { - // General Housekeeping - global $wpdb; - $count = 0; - $dcposts2wpposts = array(); - $cats = array(); - - // Do the Magic - if(is_array($posts)) - { - echo '

    '.__('Importing Posts...').'

    '; - foreach($posts as $post) - { - $count++; - extract($post); - - // Set DotClear-to-WordPress status translation - $stattrans = array(0 => 'draft', 1 => 'publish'); - $comment_status_map = array (0 => 'closed', 1 => 'open'); - - //Can we do this more efficiently? - $uinfo = ( get_userdatabylogin( $user_id ) ) ? get_userdatabylogin( $user_id ) : 1; - $authorid = ( is_object( $uinfo ) ) ? $uinfo->ID : $uinfo ; - - $Title = $wpdb->escape(csc ($post_titre)); - $post_content = textconv ($post_content); - $post_excerpt = ""; - if ($post_chapo != "") { - $post_excerpt = textconv ($post_chapo); - $post_content = $post_excerpt ."\n\n".$post_content; - } - $post_excerpt = $wpdb->escape ($post_excerpt); - $post_content = $wpdb->escape ($post_content); - $post_status = $stattrans[$post_pub]; - - // Import Post data into WordPress - - if($pinfo = post_exists($Title,$post_content)) - { - $ret_id = wp_insert_post(array( - 'ID' => $pinfo, - 'post_author' => $authorid, - 'post_date' => $post_dt, - 'post_date_gmt' => $post_dt, - 'post_modified' => $post_upddt, - 'post_modified_gmt' => $post_upddt, - 'post_title' => $Title, - 'post_content' => $post_content, - 'post_excerpt' => $post_excerpt, - 'post_status' => $post_status, - 'post_name' => $post_titre_url, - 'comment_status' => $comment_status_map[$post_open_comment], - 'ping_status' => $comment_status_map[$post_open_tb], - 'comment_count' => $post_nb_comment + $post_nb_trackback) - ); - if ( is_wp_error( $ret_id ) ) - return $ret_id; - } - else - { - $ret_id = wp_insert_post(array( - 'post_author' => $authorid, - 'post_date' => $post_dt, - 'post_date_gmt' => $post_dt, - 'post_modified' => $post_modified_gmt, - 'post_modified_gmt' => $post_modified_gmt, - 'post_title' => $Title, - 'post_content' => $post_content, - 'post_excerpt' => $post_excerpt, - 'post_status' => $post_status, - 'post_name' => $post_titre_url, - 'comment_status' => $comment_status_map[$post_open_comment], - 'ping_status' => $comment_status_map[$post_open_tb], - 'comment_count' => $post_nb_comment + $post_nb_trackback) - ); - if ( is_wp_error( $ret_id ) ) - return $ret_id; - } - $dcposts2wpposts[$post_id] = $ret_id; - - // Make Post-to-Category associations - $cats = array(); - $category1 = get_category_by_slug($post_cat_name); - $category1 = $category1->term_id; - - if($cat1 = $category1) { $cats[1] = $cat1; } - - if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); } - } - } - // Store ID translation for later use - add_option('dcposts2wpposts',$dcposts2wpposts); - - echo '

    '.sprintf(__('Done! %1$s posts imported.'), $count).'

    '; - return true; - } - - function comments2wp($comments='') - { - // General Housekeeping - global $wpdb; - $count = 0; - $dccm2wpcm = array(); - $postarr = get_option('dcposts2wpposts'); - - // Magic Mojo - if(is_array($comments)) - { - echo '

    '.__('Importing Comments...').'

    '; - foreach($comments as $comment) - { - $count++; - extract($comment); - - // WordPressify Data - $comment_ID = (int) ltrim($comment_id, '0'); - $comment_post_ID = (int) $postarr[$post_id]; - $comment_approved = "$comment_pub"; - $name = $wpdb->escape(csc ($comment_auteur)); - $email = $wpdb->escape($comment_email); - $web = "http://".$wpdb->escape($comment_site); - $message = $wpdb->escape(textconv ($comment_content)); - - $comment = array( - 'comment_post_ID' => $comment_post_ID, - 'comment_author' => $name, - 'comment_author_email' => $email, - 'comment_author_url' => $web, - 'comment_author_IP' => $comment_ip, - 'comment_date' => $comment_dt, - 'comment_date_gmt' => $comment_dt, - 'comment_content' => $message, - 'comment_approved' => $comment_approved); - $comment = wp_filter_comment($comment); - - if ( $cinfo = comment_exists($name, $comment_dt) ) { - // Update comments - $comment['comment_ID'] = $cinfo; - $ret_id = wp_update_comment($comment); - } else { - // Insert comments - $ret_id = wp_insert_comment($comment); - } - $dccm2wpcm[$comment_ID] = $ret_id; - } - // Store Comment ID translation for future use - add_option('dccm2wpcm', $dccm2wpcm); - - // Associate newly formed categories with posts - get_comment_count($ret_id); - - - echo '

    '.sprintf(__('Done! %1$s comments imported.'), $count).'

    '; - return true; - } - echo __('No Comments to Import!'); - return false; - } - - function links2wp($links='') - { - // General Housekeeping - global $wpdb; - $count = 0; - - // Deal with the links - if(is_array($links)) - { - echo '

    '.__('Importing Links...').'

    '; - foreach($links as $link) - { - $count++; - extract($link); - - if ($title != "") { - if ($cinfo = is_term(csc ($title), 'link_category')) { - $category = $cinfo['term_id']; - } else { - $category = wp_insert_term($wpdb->escape (csc ($title)), 'link_category'); - $category = $category['term_id']; - } - } else { - $linkname = $wpdb->escape(csc ($label)); - $description = $wpdb->escape(csc ($title)); - - if($linfo = link_exists($linkname)) { - $ret_id = wp_insert_link(array( - 'link_id' => $linfo, - 'link_url' => $href, - 'link_name' => $linkname, - 'link_category' => $category, - 'link_description' => $description) - ); - } else { - $ret_id = wp_insert_link(array( - 'link_url' => $url, - 'link_name' => $linkname, - 'link_category' => $category, - 'link_description' => $description) - ); - } - $dclinks2wplinks[$link_id] = $ret_id; - } - } - add_option('dclinks2wplinks',$dclinks2wplinks); - echo '

    '; - printf(_n('Done! %s link or link category imported.', 'Done! %s links or link categories imported.', $count), $count); - echo '

    '; - return true; - } - echo __('No Links to Import!'); - return false; - } - - function import_categories() - { - // Category Import - $cats = $this->get_dc_cats(); - $this->cat2wp($cats); - add_option('dc_cats', $cats); - - - - echo '
    '; - wp_nonce_field('import-dotclear'); - printf('

    ', esc_attr__('Import Users')); - echo '
    '; - - } - - function import_users() - { - // User Import - $users = $this->get_dc_users(); - $this->users2wp($users); - - echo '
    '; - wp_nonce_field('import-dotclear'); - printf('

    ', esc_attr__('Import Posts')); - echo '
    '; - } - - function import_posts() - { - // Post Import - $posts = $this->get_dc_posts(); - $result = $this->posts2wp($posts); - if ( is_wp_error( $result ) ) - return $result; - - echo '
    '; - wp_nonce_field('import-dotclear'); - printf('

    ', esc_attr__('Import Comments')); - echo '
    '; - } - - function import_comments() - { - // Comment Import - $comments = $this->get_dc_comments(); - $this->comments2wp($comments); - - echo '
    '; - wp_nonce_field('import-dotclear'); - printf('

    ', esc_attr__('Import Links')); - echo '
    '; - } - - function import_links() - { - //Link Import - $links = $this->get_dc_links(); - $this->links2wp($links); - add_option('dc_links', $links); - - echo '
    '; - wp_nonce_field('import-dotclear'); - printf('

    ', esc_attr__('Finish')); - echo '
    '; - } - - function cleanup_dcimport() - { - delete_option('dcdbprefix'); - delete_option('dc_cats'); - delete_option('dcid2wpid'); - delete_option('dccat2wpcat'); - delete_option('dcposts2wpposts'); - delete_option('dccm2wpcm'); - delete_option('dclinks2wplinks'); - delete_option('dcuser'); - delete_option('dcpass'); - delete_option('dcname'); - delete_option('dchost'); - delete_option('dccharset'); - do_action('import_done', 'dotclear'); - $this->tips(); - } - - function tips() - { - echo '

    '.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from DotClear, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'

    '; - echo '

    '.__('Users').'

    '; - echo '

    '.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in DotClear, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and DotClear uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. Every user has the same username, but their passwords are reset to password123. So Log in and change it.'), '/wp-login.php').'

    '; - echo '

    '.__('Preserving Authors').'

    '; - echo '

    '.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'

    '; - echo '

    '.__('Textile').'

    '; - echo '

    '.__('Also, since you’re coming from DotClear, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing Textile for WordPress. Trust me… You’ll want it.').'

    '; - echo '

    '.__('WordPress Resources').'

    '; - echo '

    '.__('Finally, there are numerous WordPress resources around the internet. Some of them are:').'

    '; - echo ''; - echo '

    '.sprintf(__('That’s it! What are you waiting for? Go log in!'), '../wp-login.php').'

    '; - } - - function db_form() - { - echo ''; - printf('', __('DotClear Database User:')); - printf('', __('DotClear Database Password:')); - printf('', __('DotClear Database Name:')); - printf('', __('DotClear Database Host:')); - printf('', __('DotClear Table prefix:')); - printf('', __('Originating character set:')); - echo '
    '; - } - - function dispatch() - { - - if (empty ($_GET['step'])) - $step = 0; - else - $step = (int) $_GET['step']; - $this->header(); - - if ( $step > 0 ) - { - check_admin_referer('import-dotclear'); - - if($_POST['dbuser']) - { - if(get_option('dcuser')) - delete_option('dcuser'); - add_option('dcuser', sanitize_user($_POST['dbuser'], true)); - } - if($_POST['dbpass']) - { - if(get_option('dcpass')) - delete_option('dcpass'); - add_option('dcpass', sanitize_user($_POST['dbpass'], true)); - } - - if($_POST['dbname']) - { - if(get_option('dcname')) - delete_option('dcname'); - add_option('dcname', sanitize_user($_POST['dbname'], true)); - } - if($_POST['dbhost']) - { - if(get_option('dchost')) - delete_option('dchost'); - add_option('dchost', sanitize_user($_POST['dbhost'], true)); - } - if($_POST['dccharset']) - { - if(get_option('dccharset')) - delete_option('dccharset'); - add_option('dccharset', sanitize_user($_POST['dccharset'], true)); - } - if($_POST['dbprefix']) - { - if(get_option('dcdbprefix')) - delete_option('dcdbprefix'); - add_option('dcdbprefix', sanitize_user($_POST['dbprefix'], true)); - } - - - } - - switch ($step) - { - default: - case 0 : - $this->greet(); - break; - case 1 : - $this->import_categories(); - break; - case 2 : - $this->import_users(); - break; - case 3 : - $result = $this->import_posts(); - if ( is_wp_error( $result ) ) - echo $result->get_error_message(); - break; - case 4 : - $this->import_comments(); - break; - case 5 : - $this->import_links(); - break; - case 6 : - $this->cleanup_dcimport(); - break; - } - - $this->footer(); - } - - function Dotclear_Import() - { - // Nothing. - } -} - -$dc_import = new Dotclear_Import(); - -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 deleted file mode 100644 index 47c15d4b..00000000 --- a/wp-admin/import/greymatter.php +++ /dev/null @@ -1,334 +0,0 @@ -'; - screen_icon(); - echo '

    '.__('Import GreyMatter').'

    '; - } - - function footer() { - echo '
    '; - } - - function greet() { - $this->header(); -?> -

    -

    -
      -
    • -
    • If authors are found not to be in gm-authors.cgi, imports them at level 0.') ?>
    • -
    • -
    -

    -
      -
    • -
    • -
    • -
    -

     

    - -
    - - - -

    - - - - - - - - - - - - - -

    - so you need to enter the number of the last GM post here.
    (if you don’t know that number, just log in to your FTP and look it out
    in the entries’ folder)') ?>
    -

    -
    -footer(); - } - - - - function gm2autobr($string) { // transforms GM's |*| into b2's
    \n - $string = str_replace("|*|","
    \n",$string); - return($string); - } - - function import() { - global $wpdb; - - $wpvarstoreset = array('gmpath', 'archivespath', 'lastentry'); - for ($i=0; $iheader(); -?> -

    -
      -
      • escape($userdata[0]); - $pass1=$wpdb->escape($userdata[1]); - $user_nickname=$wpdb->escape($userdata[0]); - $user_email=$wpdb->escape($userdata[2]); - $user_url=$wpdb->escape($userdata[3]); - $user_joindate=$wpdb->escape($user_joindate); - - $user_id = username_exists($user_login); - if ($user_id) { - printf('
      • '.__('user %s').''.__('Already exists').'
      • ', "$user_login"); - $this->gmnames[$userdata[0]] = $user_id; - continue; - } - - $user_info = array("user_login"=>"$user_login", "user_pass"=>"$pass1", "user_nickname"=>"$user_nickname", "user_email"=>"$user_email", "user_url"=>"$user_url", "user_ip"=>"$user_ip", "user_domain"=>"$user_domain", "user_browser"=>"$user_browser", "dateYMDhour"=>"$user_joindate", "user_level"=>"1", "user_idmode"=>"nickname"); - $user_id = wp_insert_user($user_info); - $this->gmnames[$userdata[0]] = $user_id; - - printf('
      • '.__('user %s...').' '.__('Done').'
      • ', "$user_login"); - } - -?>
    • -

      • gm2autobr($entry[2]); - $postmorecontent=$this->gm2autobr($entry[3]); - - $post_author=trim($wpdb->escape($postinfo[1])); - - $post_title=$this->gm2autobr($postinfo[2]); - printf('
      • '.__('entry # %s : %s : by %s'), $entryfile, $post_title, $postinfo[1]); - $post_title=$wpdb->escape($post_title); - - $postyear=$postinfo[6]; - $postmonth=zeroise($postinfo[4],2); - $postday=zeroise($postinfo[5],2); - $posthour=zeroise($postinfo[7],2); - $postminute=zeroise($postinfo[8],2); - $postsecond=zeroise($postinfo[9],2); - - if (($postinfo[10]=="PM") && ($posthour!="12")) - $posthour=$posthour+12; - - $post_date="$postyear-$postmonth-$postday $posthour:$postminute:$postsecond"; - - $post_content=$postmaincontent; - if (strlen($postmorecontent)>3) - $post_content .= "

        ".$postmorecontent; - $post_content=$wpdb->escape($post_content); - - $post_karma=$postinfo[12]; - - $post_status = 'publish'; //in greymatter, there are no drafts - $comment_status = 'open'; - $ping_status = 'closed'; - - if ($post_ID = post_exists($post_title, '', $post_date)) { - echo ' '; - _e('(already exists)'); - } else { - //just so that if a post already exists, new users are not created by checkauthor - // we'll check the author is registered, or if it's a deleted author - $user_id = username_exists($post_author); - if (!$user_id) { // if deleted from GM, we register the author as a level 0 user - $user_ip="127.0.0.1"; - $user_domain="localhost"; - $user_browser="server"; - $user_joindate="1979-06-06 00:41:00"; - $user_login=$wpdb->escape($post_author); - $pass1=$wpdb->escape("password"); - $user_nickname=$wpdb->escape($post_author); - $user_email=$wpdb->escape("user@deleted.com"); - $user_url=$wpdb->escape(""); - $user_joindate=$wpdb->escape($user_joindate); - - $user_info = array("user_login"=>$user_login, "user_pass"=>$pass1, "user_nickname"=>$user_nickname, "user_email"=>$user_email, "user_url"=>$user_url, "user_ip"=>$user_ip, "user_domain"=>$user_domain, "user_browser"=>$user_browser, "dateYMDhour"=>$user_joindate, "user_level"=>0, "user_idmode"=>"nickname"); - $user_id = wp_insert_user($user_info); - $this->gmnames[$postinfo[1]] = $user_id; - - echo ': '; - printf(__('registered deleted user %s at level 0 '), "$user_login"); - } - - if (array_key_exists($postinfo[1], $this->gmnames)) { - $post_author = $this->gmnames[$postinfo[1]]; - } else { - $post_author = $user_id; - } - - $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt'); - $post_ID = wp_insert_post($postdata); - if ( is_wp_error( $post_ID ) ) - return $post_ID; - } - - $c=count($entry); - if ($c>4) { - $numAddedComments = 0; - $numComments = 0; - for ($j=4;$j<$c;$j++) { - $entry[$j]=$this->gm2autobr($entry[$j]); - $commentinfo=explode("|",$entry[$j]); - $comment_post_ID=$post_ID; - $comment_author=$wpdb->escape($commentinfo[0]); - $comment_author_email=$wpdb->escape($commentinfo[2]); - $comment_author_url=$wpdb->escape($commentinfo[3]); - $comment_author_IP=$wpdb->escape($commentinfo[1]); - - $commentyear=$commentinfo[7]; - $commentmonth=zeroise($commentinfo[5],2); - $commentday=zeroise($commentinfo[6],2); - $commenthour=zeroise($commentinfo[8],2); - $commentminute=zeroise($commentinfo[9],2); - $commentsecond=zeroise($commentinfo[10],2); - if (($commentinfo[11]=="PM") && ($commenthour!="12")) - $commenthour=$commenthour+12; - $comment_date="$commentyear-$commentmonth-$commentday $commenthour:$commentminute:$commentsecond"; - - $comment_content=$wpdb->escape($commentinfo[12]); - - if (!comment_exists($comment_author, $comment_date)) { - $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_content', 'comment_approved'); - $commentdata = wp_filter_comment($commentdata); - wp_insert_comment($commentdata); - $numAddedComments++; - } - $numComments++; - } - if ($numAddedComments > 0) { - echo ': '; - printf( _n('imported %s comment', 'imported %s comments', $numAddedComments) , $numAddedComments); - } - $preExisting = $numComments - numAddedComments; - if ($preExisting > 0) { - echo ' '; - printf( _n( 'ignored %s pre-existing comment', 'ignored %s pre-existing comments', $preExisting ) , $preExisting); - } - } - echo '... '.__('Done').'
      • '; - } - } - do_action('import_done', 'greymatter'); - ?> -
    -

     

    -

    -footer(); - return; - } - - function dispatch() { - if (empty ($_GET['step'])) - $step = 0; - else - $step = (int) $_GET['step']; - - switch ($step) { - case 0 : - $this->greet(); - break; - case 1: - check_admin_referer('import-greymatter'); - $result = $this->import(); - if ( is_wp_error( $result ) ) - echo $result->get_error_message(); - break; - } - } - - function GM_Import() { - // Nothing. - } -} - -$gm_import = new GM_Import(); - -register_importer('greymatter', __('GreyMatter'), __('Import users, posts, and comments from a Greymatter blog.'), array ($gm_import, 'dispatch')); -?> diff --git a/wp-admin/import/livejournal.php b/wp-admin/import/livejournal.php deleted file mode 100644 index 7acfaa5f..00000000 --- a/wp-admin/import/livejournal.php +++ /dev/null @@ -1,1059 +0,0 @@ - 'aggravated', - '10' => 'discontent', - '100' => 'rushed', - '101' => 'contemplative', - '102' => 'nerdy', - '103' => 'geeky', - '104' => 'cynical', - '105' => 'quixotic', - '106' => 'crazy', - '107' => 'creative', - '108' => 'artistic', - '109' => 'pleased', - '11' => 'energetic', - '110' => 'bitchy', - '111' => 'guilty', - '112' => 'irritated', - '113' => 'blank', - '114' => 'apathetic', - '115' => 'dorky', - '116' => 'impressed', - '117' => 'naughty', - '118' => 'predatory', - '119' => 'dirty', - '12' => 'enraged', - '120' => 'giddy', - '121' => 'surprised', - '122' => 'shocked', - '123' => 'rejected', - '124' => 'numb', - '125' => 'cheerful', - '126' => 'good', - '127' => 'distressed', - '128' => 'intimidated', - '129' => 'crushed', - '13' => 'enthralled', - '130' => 'devious', - '131' => 'thankful', - '132' => 'grateful', - '133' => 'jealous', - '134' => 'nervous', - '14' => 'exhausted', - '15' => 'happy', - '16' => 'high', - '17' => 'horny', - '18' => 'hungry', - '19' => 'infuriated', - '2' => 'angry', - '20' => 'irate', - '21' => 'jubilant', - '22' => 'lonely', - '23' => 'moody', - '24' => 'pissed off', - '25' => 'sad', - '26' => 'satisfied', - '27' => 'sore', - '28' => 'stressed', - '29' => 'thirsty', - '3' => 'annoyed', - '30' => 'thoughtful', - '31' => 'tired', - '32' => 'touched', - '33' => 'lazy', - '34' => 'drunk', - '35' => 'ditzy', - '36' => 'mischievous', - '37' => 'morose', - '38' => 'gloomy', - '39' => 'melancholy', - '4' => 'anxious', - '40' => 'drained', - '41' => 'excited', - '42' => 'relieved', - '43' => 'hopeful', - '44' => 'amused', - '45' => 'determined', - '46' => 'scared', - '47' => 'frustrated', - '48' => 'indescribable', - '49' => 'sleepy', - '5' => 'bored', - '51' => 'groggy', - '52' => 'hyper', - '53' => 'relaxed', - '54' => 'restless', - '55' => 'disappointed', - '56' => 'curious', - '57' => 'mellow', - '58' => 'peaceful', - '59' => 'bouncy', - '6' => 'confused', - '60' => 'nostalgic', - '61' => 'okay', - '62' => 'rejuvenated', - '63' => 'complacent', - '64' => 'content', - '65' => 'indifferent', - '66' => 'silly', - '67' => 'flirty', - '68' => 'calm', - '69' => 'refreshed', - '7' => 'crappy', - '70' => 'optimistic', - '71' => 'pessimistic', - '72' => 'giggly', - '73' => 'pensive', - '74' => 'uncomfortable', - '75' => 'lethargic', - '76' => 'listless', - '77' => 'recumbent', - '78' => 'exanimate', - '79' => 'embarrassed', - '8' => 'cranky', - '80' => 'envious', - '81' => 'sympathetic', - '82' => 'sick', - '83' => 'hot', - '84' => 'cold', - '85' => 'worried', - '86' => 'loved', - '87' => 'awake', - '88' => 'working', - '89' => 'productive', - '9' => 'depressed', - '90' => 'accomplished', - '91' => 'busy', - '92' => 'blah', - '93' => 'full', - '95' => 'grumpy', - '96' => 'weird', - '97' => 'nauseated', - '98' => 'ecstatic', - '99' => 'chipper' ); - - function header() { - echo '
    '; - screen_icon(); - echo '

    ' . __( 'Import LiveJournal' ) . '

    '; - } - - function footer() { - echo '
    '; - } - - function greet() { - ?> -
    -
    - - - -

    -

    - -

    -

    -

    - - - -

    -

    - - - - - - - - - - - - - -
    - -

    -

    -

    - - - - - - - -
    - -

    WARNING: This can take a really long time if you have a lot of entries in your LiveJournal, or a lot of comments. Ideally, you should only start this process if you can leave your computer alone while it finishes the import." ) ?>

    - -

    - -

    - -

    NOTE: If the import process is interrupted for any reason, come back to this page and it will continue from where it stopped automatically.' ) ?>

    - - - -
    -
    - lj_ixr( 'syncitems', array( 'ver' => 1, 'lastsync' => $lastsync ) ); - if ( is_wp_error( $synclist ) ) - return $synclist; - - // Keep track of if we've downloaded everything - $total = $synclist['total']; - $count = $synclist['count']; - - foreach ( $synclist['syncitems'] as $event ) { - if ( substr( $event['item'], 0, 2 ) == 'L-' ) { - $sync_item_times[ str_replace( 'L-', '', $event['item'] ) ] = $event['time']; - if ( $event['time'] > $lastsync ) { - $lastsync = $event['time']; - update_option( 'ljapi_lastsync', $lastsync ); - } - } - } - } while ( $total > $count ); - // endwhile - all post meta is cached locally - unset( $synclist ); - update_option( 'ljapi_sync_item_times', $sync_item_times ); - update_option( 'ljapi_total', $total ); - update_option( 'ljapi_count', $count ); - - echo '

    ' . __( 'Post metadata has been downloaded, proceeding with posts...' ) . '

    '; - } - - function download_post_bodies() { - $imported_count = (int) get_option( 'ljapi_imported_count' ); - $sync_item_times = get_option( 'ljapi_sync_item_times' ); - $lastsync = get_option( 'ljapi_lastsync_posts' ); - if ( !$lastsync ) - update_option( 'ljapi_lastsync_posts', date( 'Y-m-d H:i:s', 0 ) ); - - $count = 0; - echo '
      '; - do { - $lastsync = date( 'Y-m-d H:i:s', strtotime( get_option( 'ljapi_lastsync_posts' ) ) ); - - // Get the batch of items that match up with the syncitems list - $itemlist = $this->lj_ixr( 'getevents', array( 'ver' => 1, - 'selecttype' => 'syncitems', - 'lineendings' => 'pc', - 'lastsync' => $lastsync ) ); - if ( is_wp_error( $itemlist ) ) - return $itemlist; - - if ( $num = count( $itemlist['events'] ) ) { - for ( $e = 0; $e < count( $itemlist['events'] ); $e++ ) { - $event = $itemlist['events'][$e]; - $imported_count++; - $inserted = $this->import_post( $event ); - if ( is_wp_error( $inserted ) ) - return $inserted; - if ( $sync_item_times[ $event['itemid'] ] > $lastsync ) - $lastsync = $sync_item_times[ $event['itemid'] ]; - wp_cache_flush(); - } - update_option( 'ljapi_lastsync_posts', $lastsync ); - update_option( 'ljapi_imported_count', $imported_count ); - update_option( 'ljapi_last_sync_count', $num ); - } - $count++; - } while ( $num > 0 && $count < 3 ); // Doing up to 3 requests at a time to avoid memory problems - - // Used so that step1 knows when to stop posting back on itself - update_option( 'ljapi_last_sync_count', $num ); - - // Counter just used to show progress to user - update_option( 'ljapi_post_batch', ( (int) get_option( 'ljapi_post_batch' ) + 1 ) ); - - echo '
    '; - } - - function _normalize_tag( $matches ) { - return '<' . strtolower( $matches[1] ); - } - - function import_post( $post ) { - global $wpdb; - - // Make sure we haven't already imported this one - if ( $this->get_wp_post_ID( $post['itemid'] ) ) - return; - - $user = wp_get_current_user(); - $post_author = $user->ID; - $post['security'] = !empty( $post['security'] ) ? $post['security'] : ''; - $post_status = ( 'private' == trim( $post['security'] ) ) ? 'private' : 'publish'; // Only me - $post_password = ( 'usemask' == trim( $post['security'] ) ) ? $this->protected_password : ''; // "Friends" via password - - // For some reason, LJ sometimes sends a date as "2004-04-1408:38:00" (no space btwn date/time) - $post_date = $post['eventtime']; - if ( 18 == strlen( $post_date ) ) - $post_date = substr( $post_date, 0, 10 ) . ' ' . substr( $post_date, 10 ); - - // Cleaning up and linking the title - $post_title = isset( $post['subject'] ) ? trim( $post['subject'] ) : ''; - $post_title = $this->translate_lj_user( $post_title ); // Translate it, but then we'll strip the link - $post_title = strip_tags( $post_title ); // Can't have tags in the title in WP - $post_title = $wpdb->escape( $post_title ); - - // Clean up content - $post_content = $post['event']; - $post_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content ); - // XHTMLize some tags - $post_content = str_replace( '
    ', '
    ', $post_content ); - $post_content = str_replace( '
    ', '
    ', $post_content ); - // lj-cut ==> - $post_content = preg_replace( '||is', '', $post_content ); - $post_content = str_replace( array( '', '' ), array( '', '' ), $post_content ); - $first = strpos( $post_content, '|sUi', '', substr( $post_content, $first + 1 ) ); - // lj-user ==> a href - $post_content = $this->translate_lj_user( $post_content ); - //$post_content = force_balance_tags( $post_content ); - $post_content = $wpdb->escape( $post_content ); - - // Handle any tags associated with the post - $tags_input = !empty( $post['props']['taglist'] ) ? $post['props']['taglist'] : ''; - - // Check if comments are closed on this post - $comment_status = !empty( $post['props']['opt_nocomments'] ) ? 'closed' : 'open'; - - echo '
  • '; - if ( $post_id = post_exists( $post_title, $post_content, $post_date ) ) { - printf( __( 'Post %s already exists.' ), stripslashes( $post_title ) ); - } else { - printf( __( 'Imported post %s...' ), stripslashes( $post_title ) ); - $postdata = compact( 'post_author', 'post_date', 'post_content', 'post_title', 'post_status', 'post_password', 'tags_input', 'comment_status' ); - $post_id = wp_insert_post( $postdata, true ); - if ( is_wp_error( $post_id ) ) { - if ( 'empty_content' == $post_id->get_error_code() ) - return; // Silent skip on "empty" posts - return $post_id; - } - if ( !$post_id ) { - _e( 'Couldn’t get post ID (creating post failed!)' ); - echo '
  • '; - return new WP_Error( 'insert_post_failed', __( 'Failed to create post.' ) ); - } - - // Handle all the metadata for this post - $this->insert_postmeta( $post_id, $post ); - } - echo ''; - } - - // Convert lj-user tags to links to that user - function translate_lj_user( $str ) { - return preg_replace( '||', '$1', $str ); - } - - function insert_postmeta( $post_id, $post ) { - // Need the original LJ id for comments - add_post_meta( $post_id, 'lj_itemid', $post['itemid'] ); - - // And save the permalink on LJ in case we want to link back or something - add_post_meta( $post_id, 'lj_permalink', $post['url'] ); - - // Supports the following "props" from LJ, saved as lj_ in wp_postmeta - // Adult Content - adult_content - // Location - current_coords + current_location - // Mood - current_mood (translated from current_moodid) - // Music - current_music - // Userpic - picture_keyword - foreach ( array( 'adult_content', 'current_coords', 'current_location', 'current_moodid', 'current_music', 'picture_keyword' ) as $prop ) { - if ( !empty( $post['props'][$prop] ) ) { - if ( 'current_moodid' == $prop ) { - $prop = 'current_mood'; - $val = $this->moods[ $post['props']['current_moodid'] ]; - } else { - $val = $post['props'][$prop]; - } - add_post_meta( $post_id, 'lj_' . $prop, $val ); - } - } - } - - // Set up a session (authenticate) with LJ - function get_session() { - // Get a session via XMLRPC - $cookie = $this->lj_ixr( 'sessiongenerate', array( 'ver' => 1, 'expiration' => 'short' ) ); - if ( is_wp_error( $cookie ) ) - return new WP_Error( 'cookie', __( 'Could not get a cookie from LiveJournal. Please try again soon.' ) ); - return new WP_Http_Cookie( array( 'name' => 'ljsession', 'value' => $cookie['ljsession'] ) ); - } - - // Loops through and gets comment meta from LJ in batches - function download_comment_meta() { - $cookie = $this->get_session(); - if ( is_wp_error( $cookie ) ) - return $cookie; - - // Load previous state (if any) - $this->usermap = (array) get_option( 'ljapi_usermap' ); - $maxid = get_option( 'ljapi_maxid' ) ? get_option( 'ljapi_maxid' ) : 1; - $highest_id = get_option( 'ljapi_highest_id' ) ? get_option( 'ljapi_highest_id' ) : 0; - - // We need to loop over the metadata request until we have it all - while ( $maxid > $highest_id ) { - // Now get the meta listing - $results = wp_remote_get( $this->comments_url . '?get=comment_meta&startid=' . ( $highest_id + 1 ), - array( 'cookies' => array( $cookie ), 'timeout' => 20 ) ); - if ( is_wp_error( $results ) ) - return new WP_Error( 'comment_meta', __( 'Failed to retrieve comment meta information from LiveJournal. Please try again soon.' ) ); - - $results = wp_remote_retrieve_body( $results ); - - // Get the maxid so we know if we have them all yet - preg_match( '|(\d+)|', $results, $matches ); - if ( 0 == $matches[1] ) { - // No comment meta = no comments for this journal - echo '

    ' . __( 'You have no comments to import!' ) . '

    '; - update_option( 'ljapi_highest_id', 1 ); - update_option( 'ljapi_highest_comment_id', 1 ); - return false; // Bail out of comment importing entirely - } - $maxid = !empty( $matches[1] ) ? $matches[1] : $maxid; - - // Parse comments and get highest id available - preg_match_all( '| $highest_id ) - $highest_id = $id; - } - - // Parse out the list of user mappings, and add it to the known list - preg_match_all( '||', $results, $matches ); - foreach ( $matches[1] as $count => $userid ) - $this->usermap[$userid] = $matches[2][$count]; // need this in memory for translating ids => names - - wp_cache_flush(); - } - // endwhile - should have seen all comment meta at this point - - update_option( 'ljapi_usermap', $this->usermap ); - update_option( 'ljapi_maxid', $maxid ); - update_option( 'ljapi_highest_id', $highest_id ); - - echo '

    ' . __( ' Comment metadata downloaded successfully, proceeding with comment bodies...' ) . '

    '; - - return true; - } - - // Downloads actual comment bodies from LJ - // Inserts them all directly to the DB, with additional info stored in "spare" fields - function download_comment_bodies() { - global $wpdb; - $cookie = $this->get_session(); - if ( is_wp_error( $cookie ) ) - return $cookie; - - // Load previous state (if any) - $this->usermap = (array) get_option( 'ljapi_usermap' ); - $maxid = get_option( 'ljapi_maxid' ) ? (int) get_option( 'ljapi_maxid' ) : 1; - $highest_id = (int) get_option( 'ljapi_highest_comment_id' ); - $loop = 0; - while ( $maxid > $highest_id && $loop < 5 ) { // We do 5 loops per call to avoid memory limits - $loop++; - - // Get a batch of comments, using the highest_id we've already got as a starting point - $results = wp_remote_get( $this->comments_url . '?get=comment_body&startid=' . ( $highest_id + 1 ), - array( 'cookies' => array( $cookie ), 'timeout' => 20 ) ); - if ( is_wp_error( $results ) ) - return new WP_Error( 'comment_bodies', __( 'Failed to retrieve comment bodies from LiveJournal. Please try again soon.' ) ); - - $results = wp_remote_retrieve_body( $results ); - - // Parse out each comment and insert directly - preg_match_all( '||iUs', $results, $matches ); - for ( $c = 0; $c < count( $matches[0] ); $c++ ) { - // Keep track of highest id seen - if ( $matches[1][$c] > $highest_id ) { - $highest_id = $matches[1][$c]; - update_option( 'ljapi_highest_comment_id', $highest_id ); - } - - $comment = $matches[0][$c]; - - // Filter out any captured, deleted comments (nothing useful to import) - $comment = preg_replace( '||is', '', $comment ); - - // Parse this comment into an array and insert - $comment = $this->parse_comment( $comment ); - $comment = wp_filter_comment( $comment ); - $id = wp_insert_comment( $comment ); - - // Clear cache - clean_comment_cache( $id ); - } - - // Clear cache to preseve memory - wp_cache_flush(); - } - // endwhile - all comments downloaded and ready for bulk processing - - // Counter just used to show progress to user - update_option( 'ljapi_comment_batch', ( (int) get_option( 'ljapi_comment_batch' ) + 1 ) ); - - return true; - } - - // Takes a block of XML and parses out all the elements of the comment - function parse_comment( $comment ) { - global $wpdb; - - // Get the top-level attributes - preg_match( '|]+)>|i', $comment, $attribs ); - preg_match( '| id=\'(\d+)\'|i', $attribs[1], $matches ); - $lj_comment_ID = $matches[1]; - preg_match( '| jitemid=\'(\d+)\'|i', $attribs[1], $matches ); - $lj_comment_post_ID = $matches[1]; - preg_match( '| posterid=\'(\d+)\'|i', $attribs[1], $matches ); - $comment_author_ID = isset( $matches[1] ) ? $matches[1] : 0; - preg_match( '| parentid=\'(\d+)\'|i', $attribs[1], $matches ); // optional - $lj_comment_parent = isset( $matches[1] ) ? $matches[1] : 0; - preg_match( '| state=\'([SDFA])\'|i', $attribs[1], $matches ); // optional - $lj_comment_state = isset( $matches[1] ) ? $matches[1] : 'A'; - - // Clean up "subject" - this will become the first line of the comment in WP - preg_match( '|(.*)|is', $comment, $matches ); - if ( isset( $matches[1] ) ) { - $comment_subject = $wpdb->escape( trim( $matches[1] ) ); - if ( 'Re:' == $comment_subject ) - $comment_subject = ''; - } - - // Get the body and HTMLize it - preg_match( '|(.*)|is', $comment, $matches ); - $comment_content = !empty( $comment_subject ) ? $comment_subject . "\n\n" . $matches[1] : $matches[1]; - $comment_content = @html_entity_decode( $comment_content, ENT_COMPAT, get_option('blog_charset') ); - $comment_content = str_replace( ''', "'", $comment_content ); - $comment_content = wpautop( $comment_content ); - $comment_content = str_replace( '
    ', '
    ', $comment_content ); - $comment_content = str_replace( '
    ', '
    ', $comment_content ); - $comment_content = preg_replace_callback( '|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content ); - $comment_content = $wpdb->escape( trim( $comment_content ) ); - - // Get and convert the date - preg_match( '|(.*)|i', $comment, $matches ); - $comment_date = trim( str_replace( array( 'T', 'Z' ), ' ', $matches[1] ) ); - - // Grab IP if available - preg_match( '|(.*)|i', $comment, $matches ); // optional - $comment_author_IP = isset( $matches[1] ) ? $matches[1] : ''; - - // Try to get something useful for the comment author, especially if it was "my" comment - $author = ( empty( $comment_author_ID ) || empty( $this->usermap[$comment_author_ID] ) || substr( $this->usermap[$comment_author_ID], 0, 4 ) == 'ext_' ) ? __( 'Anonymous' ) : $this->usermap[$comment_author_ID]; - if ( get_option( 'ljapi_username' ) == $author ) { - $user = wp_get_current_user(); - $user_id = $user->ID; - $author = $user->display_name; - $url = trailingslashit( get_option( 'home' ) ); - } else { - $user_id = 0; - $url = ( __( 'Anonymous' ) == $author ) ? '' : 'http://' . $author . '.livejournal.com/'; - } - - // Send back the array of details - return array( 'lj_comment_ID' => $lj_comment_ID, - 'lj_comment_post_ID' => $lj_comment_post_ID, - 'lj_comment_parent' => ( !empty( $lj_comment_parent ) ? $lj_comment_parent : 0 ), - 'lj_comment_state' => $lj_comment_state, - 'comment_post_ID' => $this->get_wp_post_ID( $lj_comment_post_ID ), - 'comment_author' => $author, - 'comment_author_url' => $url, - 'comment_author_email' => '', - 'comment_content' => $comment_content, - 'comment_date' => $comment_date, - 'comment_author_IP' => ( !empty( $comment_author_IP ) ? $comment_author_IP : '' ), - 'comment_approved' => ( in_array( $lj_comment_state, array( 'A', 'F' ) ) ? 1 : 0 ), - 'comment_karma' => $lj_comment_ID, // Need this and next value until rethreading is done - 'comment_agent' => $lj_comment_parent, - 'comment_type' => 'livejournal', // Custom type, so we can find it later for processing - 'user_ID' => $user_id - ); - } - - - // Gets the post_ID that a LJ post has been saved as within WP - function get_wp_post_ID( $post ) { - global $wpdb; - - if ( empty( $this->postmap[$post] ) ) - $this->postmap[$post] = (int) $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'lj_itemid' AND meta_value = %d", $post ) ); - - return $this->postmap[$post]; - } - - // Gets the comment_ID that a LJ comment has been saved as within WP - function get_wp_comment_ID( $comment ) { - global $wpdb; - if ( empty( $this->commentmap[$comment] ) ) - $this->commentmap[$comment] = $wpdb->get_var( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_karma = %d", $comment ) ); - return $this->commentmap[$comment]; - } - - function lj_ixr() { - if ( $challenge = $this->ixr->query( 'LJ.XMLRPC.getchallenge' ) ) { - $challenge = $this->ixr->getResponse(); - } - if ( isset( $challenge['challenge'] ) ) { - $params = array( 'username' => $this->username, - 'auth_method' => 'challenge', - 'auth_challenge' => $challenge['challenge'], - 'auth_response' => md5( $challenge['challenge'] . md5( $this->password ) ) ); - } else { - return new WP_Error( 'IXR', __( 'LiveJournal is not responding to authentication requests. Please wait a while and then try again.' ) ); - } - - $args = func_get_args(); - $method = array_shift( $args ); - if ( isset( $args[0] ) ) - $params = array_merge( $params, $args[0] ); - if ( $this->ixr->query( 'LJ.XMLRPC.' . $method, $params ) ) { - return $this->ixr->getResponse(); - } else { - return new WP_Error( 'IXR', __( 'XML-RPC Request Failed -- ' ) . $this->ixr->getErrorCode() . ': ' . $this->ixr->getErrorMessage() ); - } - } - - function dispatch() { - if ( empty( $_REQUEST['step'] ) ) - $step = 0; - else - $step = (int) $_REQUEST['step']; - - $this->header(); - - switch ( $step ) { - case -1 : - $this->cleanup(); - // Intentional no break - case 0 : - $this->greet(); - break; - case 1 : - case 2 : - case 3 : - check_admin_referer( 'lj-api-import' ); - $result = $this->{ 'step' . $step }(); - if ( is_wp_error( $result ) ) { - $this->throw_error( $result, $step ); - } - break; - } - - $this->footer(); - } - - // Technically the first half of step 1, this is separated to allow for AJAX - // calls. Sets up some variables and options and confirms authentication. - function setup() { - global $verified; - // Get details from form or from DB - if ( !empty( $_POST['lj_username'] ) && !empty( $_POST['lj_password'] ) ) { - // Store details for later - $this->username = $_POST['lj_username']; - $this->password = $_POST['lj_password']; - update_option( 'ljapi_username', $this->username ); - update_option( 'ljapi_password', $this->password ); - } else { - $this->username = get_option( 'ljapi_username' ); - $this->password = get_option( 'ljapi_password' ); - } - - // This is the password to set on protected posts - if ( !empty( $_POST['protected_password'] ) ) { - $this->protected_password = $_POST['protected_password']; - update_option( 'ljapi_protected_password', $this->protected_password ); - } else { - $this->protected_password = get_option( 'ljapi_protected_password' ); - } - - // Log in to confirm the details are correct - if ( empty( $this->username ) || empty( $this->password ) ) { - ?> -

    and password so we can download your posts and comments.' ) ?>

    -

    - lj_ixr( 'login' ); - if ( is_wp_error( $verified ) ) { - if ( 100 == $this->ixr->getErrorCode() || 101 == $this->ixr->getErrorCode() ) { - delete_option( 'ljapi_username' ); - delete_option( 'ljapi_password' ); - delete_option( 'ljapi_protected_password' ); - ?> -

    -

    - ixr ) $this->ixr = new IXR_Client( $this->ixr_url, false, 80, 30 ); - if ( empty( $_POST['login'] ) ) { - // We're looping -- load some details from DB - $this->username = get_option( 'ljapi_username' ); - $this->password = get_option( 'ljapi_password' ); - $this->protected_password = get_option( 'ljapi_protected_password' ); - } else { - // First run (non-AJAX) - $setup = $this->setup(); - if ( !$setup ) { - return false; - } else if ( is_wp_error( $setup ) ) { - $this->throw_error( $setup, 1 ); - return false; - } - } - - echo '
    '; - echo '

    ' . __( 'Importing Posts' ) . '

    '; - echo '

    ' . __( 'We’re downloading and importing your LiveJournal posts...' ) . '

    '; - if ( get_option( 'ljapi_post_batch' ) && count( get_option( 'ljapi_sync_item_times' ) ) ) { - $batch = count( get_option( 'ljapi_sync_item_times' ) ); - $batch = $count > 300 ? ceil( $batch / 300 ) : 1; - echo '

    ' . sprintf( __( 'Imported post batch %d of approximately %d' ), ( get_option( 'ljapi_post_batch' ) + 1 ), $batch ) . '

    '; - } - ob_flush(); flush(); - - if ( !get_option( 'ljapi_lastsync' ) || '1900-01-01 00:00:00' == get_option( 'ljapi_lastsync' ) ) { - // We haven't downloaded meta yet, so do that first - $result = $this->download_post_meta(); - if ( is_wp_error( $result ) ) { - $this->throw_error( $result, 1 ); - return false; - } - } - - // Download a batch of actual posts - $result = $this->download_post_bodies(); - if ( is_wp_error( $result ) ) { - if ( 406 == $this->ixr->getErrorCode() ) { - ?> -

    -

    - next_step( 1, __( 'Try Again' ) ); - return false; - } else { - $this->throw_error( $result, 1 ); - return false; - } - } - - if ( get_option( 'ljapi_last_sync_count' ) > 0 ) { - ?> -
    - - -

    -
    - auto_ajax( 'ljapi-auto-repost', 'auto-message', 0 ); ?> - ' . __( 'Your posts have all been imported, but wait – there’s more! Now we need to download & import your comments.' ) . '

    '; - echo $this->next_step( 2, __( 'Download my comments »' ) ); - $this->auto_submit(); - } - echo '
    '; - } - - // Download comments to local XML - function step2() { - set_time_limit( 0 ); - update_option( 'ljapi_step', 2 ); - $this->username = get_option( 'ljapi_username' ); - $this->password = get_option( 'ljapi_password' ); - $this->ixr = new IXR_Client( $this->ixr_url, false, 80, 30 ); - - echo '
    '; - echo '

    ' . __( 'Downloading Comments' ) . '

    '; - echo '

    ' . __( 'Now we will download your comments so we can import them (this could take a long time if you have lots of comments)...' ) . '

    '; - ob_flush(); flush(); - - if ( !get_option( 'ljapi_usermap' ) ) { - // We haven't downloaded meta yet, so do that first - $result = $this->download_comment_meta(); - if ( is_wp_error( $result ) ) { - $this->throw_error( $result, 2 ); - return false; - } - } - - // Download a batch of actual comments - $result = $this->download_comment_bodies(); - if ( is_wp_error( $result ) ) { - $this->throw_error( $result, 2 ); - return false; - } - - $maxid = get_option( 'ljapi_maxid' ) ? (int) get_option( 'ljapi_maxid' ) : 1; - $highest_id = (int) get_option( 'ljapi_highest_comment_id' ); - if ( $maxid > $highest_id ) { - $batch = $maxid > 5000 ? ceil( $maxid / 5000 ) : 1; - ?> -
    -

    approximately %d' ), get_option( 'ljapi_comment_batch' ), $batch ) ?>

    - - -

    -
    - auto_ajax( 'ljapi-auto-repost', 'auto-message', 0 ); ?> - ' . __( 'Your comments have all been imported now, but we still need to rebuild your conversation threads.' ) . '

    '; - echo $this->next_step( 3, __( 'Rebuild my comment threads »' ) ); - $this->auto_submit(); - } - echo '
    '; - } - - // Re-thread comments already in the DB - function step3() { - global $wpdb; - set_time_limit( 0 ); - update_option( 'ljapi_step', 3 ); - - echo '
    '; - echo '

    ' . __( 'Threading Comments' ) . '

    '; - echo '

    ' . __( 'We are now re-building the threading of your comments (this can also take a while if you have lots of comments)...' ) . '

    '; - ob_flush(); flush(); - - // Only bother adding indexes if they have over 5000 comments (arbitrary number) - $imported_comments = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->comments} WHERE comment_type = 'livejournal'" ); - $added_indices = false; - if ( 5000 < $imported_comments ) { - include_once(ABSPATH . 'wp-admin/includes/upgrade.php'); - $added_indices = true; - add_clean_index( $wpdb->comments, 'comment_type' ); - add_clean_index( $wpdb->comments, 'comment_karma' ); - add_clean_index( $wpdb->comments, 'comment_agent' ); - } - - // Get LJ comments, which haven't been threaded yet, 5000 at a time and thread them - while ( $comments = $wpdb->get_results( "SELECT comment_ID, comment_agent FROM {$wpdb->comments} WHERE comment_type = 'livejournal' AND comment_agent != '0' LIMIT 5000", OBJECT ) ) { - foreach ( $comments as $comment ) { - $wpdb->update( $wpdb->comments, - array( 'comment_parent' => $this->get_wp_comment_ID( $comment->comment_agent ), 'comment_type' => 'livejournal-done' ), - array( 'comment_ID' => $comment->comment_ID ) ); - } - wp_cache_flush(); - $wpdb->flush(); - } - - // Revert the comments table back to normal and optimize it to reclaim space - if ( $added_indices ) { - drop_index( $wpdb->comments, 'comment_type' ); - drop_index( $wpdb->comments, 'comment_karma' ); - drop_index( $wpdb->comments, 'comment_agent' ); - $wpdb->query( "OPTIMIZE TABLE {$wpdb->comments}" ); - } - - // Clean up database and we're out - $this->cleanup(); - do_action( 'import_done', 'livejournal' ); - if ( $imported_comments > 1 ) - echo '

    ' . sprintf( __( "Successfully re-threaded %s comments." ), number_format( $imported_comments ) ) . '

    '; - echo '

    '; - printf( __( 'All done. Have fun!' ), get_option( 'home' ) ); - echo '

    '; - echo '
    '; - } - - // Output an error message with a button to try again. - function throw_error( $error, $step ) { - echo '

    ' . $error->get_error_message() . '

    '; - echo $this->next_step( $step, __( 'Try Again' ) ); - } - - // Returns the HTML for a link to the next page - function next_step( $next_step, $label, $id = 'ljapi-next-form' ) { - $str = '
    '; - $str .= wp_nonce_field( 'lj-api-import', '_wpnonce', true, false ); - $str .= wp_referer_field( false ); - $str .= ''; - $str .= '

    '; - $str .= '
    '; - - return $str; - } - - // Automatically submit the specified form after $seconds - // Include a friendly countdown in the element with id=$msg - function auto_submit( $id = 'ljapi-next-form', $msg = 'auto-message', $seconds = 10 ) { - ?>update( $wpdb->comments, - array( 'comment_karma' => 0, 'comment_agent' => 'WP LJ Importer', 'comment_type' => '' ), - array( 'comment_type' => 'livejournal-done' ) ); - $wpdb->update( $wpdb->comments, - array( 'comment_karma' => 0, 'comment_agent' => 'WP LJ Importer', 'comment_type' => '' ), - array( 'comment_type' => 'livejournal' ) ); - } - - function LJ_API_Import() { - $this->__construct(); - } - - function __construct() { - // Nothing - } -} - -$lj_api_import = new LJ_API_Import(); - -register_importer( 'livejournal', __( 'LiveJournal' ), __( 'Import posts from LiveJournal using their API.' ), array( $lj_api_import, 'dispatch' ) ); -?> diff --git a/wp-admin/import/mt.php b/wp-admin/import/mt.php deleted file mode 100644 index 548e9ede..00000000 --- a/wp-admin/import/mt.php +++ /dev/null @@ -1,514 +0,0 @@ -'; - screen_icon(); - echo '

    '.__('Import Movable Type or TypePad').'

    '; - } - - function footer() { - echo '
    '; - } - - function greet() { - $this->header(); -?> -
    -

    mt-export.txt in your /wp-content/ directory and then click "Import mt-export.txt"'); ?>

    - - -
    - - -

    - -mt-export.txt in your /wp-content/ directory'); ?>

    -

    - -

    -
    -

    out of memory error try splitting up the import file into pieces.'); ?>

    -
    -footer(); - } - - function users_form($n) { - global $wpdb; - $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY ID"); -?> - has_gzip() ) - return gzopen($filename, $mode); - return fopen($filename, $mode); - } - - function feof($fp) { - if ( $this->has_gzip() ) - return gzeof($fp); - return feof($fp); - } - - function fgets($fp, $len=8192) { - if ( $this->has_gzip() ) - return gzgets($fp, $len); - return fgets($fp, $len); - } - - function fclose($fp) { - if ( $this->has_gzip() ) - return gzclose($fp); - return fclose($fp); - } - - //function to check the authorname and do the mapping - function checkauthor($author) { - //mtnames is an array with the names in the mt import file - $pass = wp_generate_password(); - if (!(in_array($author, $this->mtnames))) { //a new mt author name is found - ++ $this->j; - $this->mtnames[$this->j] = $author; //add that new mt author name to an array - $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user - if (!$user_id) { //banging my head against the desk now. - if ($this->newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname - $user_id = wp_create_user($author, $pass); - $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank. - } else { - $user_id = wp_create_user($this->newauthornames[$this->j], $pass); - } - } else { - return $user_id; // return pre-existing wp username if it exists - } - } else { - $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array - $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames - } - - return $user_id; - } - - function get_mt_authors() { - $temp = array(); - $authors = array(); - - $handle = $this->fopen($this->file, 'r'); - if ( $handle == null ) - return false; - - $in_comment = false; - while ( $line = $this->fgets($handle) ) { - $line = trim($line); - - if ( 'COMMENT:' == $line ) - $in_comment = true; - else if ( '-----' == $line ) - $in_comment = false; - - if ( $in_comment || 0 !== strpos($line,"AUTHOR:") ) - continue; - - $temp[] = trim( substr($line, strlen("AUTHOR:")) ); - } - - //we need to find unique values of author names, while preserving the order, so this function emulates the unique_value(); php function, without the sorting. - $authors[0] = array_shift($temp); - $y = count($temp) + 1; - for ($x = 1; $x < $y; $x ++) { - $next = array_shift($temp); - if (!(in_array($next, $authors))) - array_push($authors, "$next"); - } - - $this->fclose($handle); - - return $authors; - } - - function get_authors_from_post() { - $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"); - } - - $count = count($formnames); - for ($i = 0; $i < $count; $i ++) { - if ($selectnames[$i] != '#NONE#') { //if no name was selected from the select menu, use the name entered in the form - array_push($this->newauthornames, "$selectnames[$i]"); - } else { - array_push($this->newauthornames, "$formnames[$i]"); - } - } - } - - function mt_authors_form() { -?> -
    - -

    -

    -

    italics. For each of these names, you can either pick an author in your WordPress installation from the menu, or enter a name for the author in the textbox.'); ?>

    -

    - get_mt_authors(); - echo '
      '; - echo '
      '; - wp_nonce_field('import-mt'); - $j = -1; - foreach ($authors as $author) { - ++ $j; - echo '
    1. '; - } - - echo '

      '.'
      '; - echo '
      '; - echo '
    '; - - } - - function select_authors() { - if ( $_POST['upload_type'] === 'ftp' ) { - $file['file'] = WP_CONTENT_DIR . '/mt-export.txt'; - if ( !file_exists($file['file']) ) - $file['error'] = __('mt-export.txt does not exist'); - } else { - $file = wp_import_handle_upload(); - } - if ( isset($file['error']) ) { - $this->header(); - echo '

    '.__('Sorry, there has been an error').'.

    '; - echo '

    ' . $file['error'] . '

    '; - $this->footer(); - return; - } - $this->file = $file['file']; - $this->id = (int) $file['id']; - - $this->mt_authors_form(); - } - - function save_post(&$post, &$comments, &$pings) { - // Reset the counter - set_time_limit(30); - $post = get_object_vars($post); - $post = add_magic_quotes($post); - $post = (object) $post; - - if ( $post_id = post_exists($post->post_title, '', $post->post_date) ) { - echo '
  • '; - printf(__('Post %s already exists.'), stripslashes($post->post_title)); - } else { - echo '
  • '; - printf(__('Importing post %s...'), stripslashes($post->post_title)); - - if ( '' != trim( $post->extended ) ) - $post->post_content .= "\n\n$post->extended"; - - $post->post_author = $this->checkauthor($post->post_author); //just so that if a post already exists, new users are not created by checkauthor - $post_id = wp_insert_post($post); - if ( is_wp_error( $post_id ) ) - return $post_id; - - // Add categories. - if ( 0 != count($post->categories) ) { - wp_create_categories($post->categories, $post_id); - } - - // Add tags or keywords - if ( 1 < strlen($post->post_keywords) ) { - // Keywords exist. - printf(__('
    Adding tags %s...'), stripslashes($post->post_keywords)); - wp_add_post_tags($post_id, $post->post_keywords); - } - } - - $num_comments = 0; - foreach ( $comments as $comment ) { - $comment = get_object_vars($comment); - $comment = add_magic_quotes($comment); - - if ( !comment_exists($comment['comment_author'], $comment['comment_date'])) { - $comment['comment_post_ID'] = $post_id; - $comment = wp_filter_comment($comment); - wp_insert_comment($comment); - $num_comments++; - } - } - - if ( $num_comments ) - printf(' '._n('(%s comment)', '(%s comments)', $num_comments), $num_comments); - - $num_pings = 0; - foreach ( $pings as $ping ) { - $ping = get_object_vars($ping); - $ping = add_magic_quotes($ping); - - if ( !comment_exists($ping['comment_author'], $ping['comment_date'])) { - $ping['comment_content'] = "{$ping['title']}\n\n{$ping['comment_content']}"; - $ping['comment_post_ID'] = $post_id; - $ping = wp_filter_comment($ping); - wp_insert_comment($ping); - $num_pings++; - } - } - - if ( $num_pings ) - printf(' '._n('(%s ping)', '(%s pings)', $num_pings), $num_pings); - - echo "
  • "; - //ob_flush();flush(); - } - - function process_posts() { - global $wpdb; - - $handle = $this->fopen($this->file, 'r'); - if ( $handle == null ) - return false; - - $context = ''; - $post = new StdClass(); - $comment = new StdClass(); - $comments = array(); - $ping = new StdClass(); - $pings = array(); - - echo "
      "; - - while ( $line = $this->fgets($handle) ) { - $line = trim($line); - - if ( '-----' == $line ) { - // Finishing a multi-line field - if ( 'comment' == $context ) { - $comments[] = $comment; - $comment = new StdClass(); - } else if ( 'ping' == $context ) { - $pings[] = $ping; - $ping = new StdClass(); - } - $context = ''; - } else if ( '--------' == $line ) { - // Finishing a post. - $context = ''; - $result = $this->save_post($post, $comments, $pings); - if ( is_wp_error( $result ) ) - return $result; - $post = new StdClass; - $comment = new StdClass(); - $ping = new StdClass(); - $comments = array(); - $pings = array(); - } else if ( 'BODY:' == $line ) { - $context = 'body'; - } else if ( 'EXTENDED BODY:' == $line ) { - $context = 'extended'; - } else if ( 'EXCERPT:' == $line ) { - $context = 'excerpt'; - } else if ( 'KEYWORDS:' == $line ) { - $context = 'keywords'; - } else if ( 'COMMENT:' == $line ) { - $context = 'comment'; - } else if ( 'PING:' == $line ) { - $context = 'ping'; - } else if ( 0 === strpos($line, "AUTHOR:") ) { - $author = trim( substr($line, strlen("AUTHOR:")) ); - if ( '' == $context ) - $post->post_author = $author; - else if ( 'comment' == $context ) - $comment->comment_author = $author; - } else if ( 0 === strpos($line, "TITLE:") ) { - $title = trim( substr($line, strlen("TITLE:")) ); - if ( '' == $context ) - $post->post_title = $title; - else if ( 'ping' == $context ) - $ping->title = $title; - } else if ( 0 === strpos($line, "STATUS:") ) { - $status = trim( strtolower( substr($line, strlen("STATUS:")) ) ); - if ( empty($status) ) - $status = 'publish'; - $post->post_status = $status; - } else if ( 0 === strpos($line, "ALLOW COMMENTS:") ) { - $allow = trim( substr($line, strlen("ALLOW COMMENTS:")) ); - if ( $allow == 1 ) - $post->comment_status = 'open'; - else - $post->comment_status = 'closed'; - } else if ( 0 === strpos($line, "ALLOW PINGS:") ) { - $allow = trim( substr($line, strlen("ALLOW PINGS:")) ); - if ( $allow == 1 ) - $post->ping_status = 'open'; - else - $post->ping_status = 'closed'; - } else if ( 0 === strpos($line, "CATEGORY:") ) { - $category = trim( substr($line, strlen("CATEGORY:")) ); - if ( '' != $category ) - $post->categories[] = $category; - } else if ( 0 === strpos($line, "PRIMARY CATEGORY:") ) { - $category = trim( substr($line, strlen("PRIMARY CATEGORY:")) ); - if ( '' != $category ) - $post->categories[] = $category; - } else if ( 0 === strpos($line, "DATE:") ) { - $date = trim( substr($line, strlen("DATE:")) ); - $date = strtotime($date); - $date = date('Y-m-d H:i:s', $date); - $date_gmt = get_gmt_from_date($date); - if ( '' == $context ) { - $post->post_modified = $date; - $post->post_modified_gmt = $date_gmt; - $post->post_date = $date; - $post->post_date_gmt = $date_gmt; - } else if ( 'comment' == $context ) { - $comment->comment_date = $date; - } else if ( 'ping' == $context ) { - $ping->comment_date = $date; - } - } else if ( 0 === strpos($line, "EMAIL:") ) { - $email = trim( substr($line, strlen("EMAIL:")) ); - if ( 'comment' == $context ) - $comment->comment_author_email = $email; - else - $ping->comment_author_email = ''; - } else if ( 0 === strpos($line, "IP:") ) { - $ip = trim( substr($line, strlen("IP:")) ); - if ( 'comment' == $context ) - $comment->comment_author_IP = $ip; - else - $ping->comment_author_IP = $ip; - } else if ( 0 === strpos($line, "URL:") ) { - $url = trim( substr($line, strlen("URL:")) ); - if ( 'comment' == $context ) - $comment->comment_author_url = $url; - else - $ping->comment_author_url = $url; - } else if ( 0 === strpos($line, "BLOG NAME:") ) { - $blog = trim( substr($line, strlen("BLOG NAME:")) ); - $ping->comment_author = $blog; - } else { - // Processing multi-line field, check context. - - if( !empty($line) ) - $line .= "\n"; - - if ( 'body' == $context ) { - $post->post_content .= $line; - } else if ( 'extended' == $context ) { - $post->extended .= $line; - } else if ( 'excerpt' == $context ) { - $post->post_excerpt .= $line; - } else if ( 'keywords' == $context ) { - $post->post_keywords .= $line; - } else if ( 'comment' == $context ) { - $comment->comment_content .= $line; - } else if ( 'ping' == $context ) { - $ping->comment_content .= $line; - } - } - } - - $this->fclose($handle); - - echo '
    '; - - wp_import_cleanup($this->id); - do_action('import_done', 'mt'); - - echo '

    '.sprintf(__('All done. Have fun!'), get_option('home')).'

    '; - } - - function import() { - $this->id = (int) $_GET['id']; - if ( $this->id == 0 ) - $this->file = WP_CONTENT_DIR . '/mt-export.txt'; - else - $this->file = get_attached_file($this->id); - $this->get_authors_from_post(); - $result = $this->process_posts(); - if ( is_wp_error( $result ) ) - return $result; - } - - function dispatch() { - if (empty ($_GET['step'])) - $step = 0; - else - $step = (int) $_GET['step']; - - switch ($step) { - case 0 : - $this->greet(); - break; - case 1 : - check_admin_referer('import-upload'); - $this->select_authors(); - break; - case 2: - check_admin_referer('import-mt'); - $result = $this->import(); - if ( is_wp_error( $result ) ) - echo $result->get_error_message(); - break; - } - } - - function MT_Import() { - // Nothing. - } -} - -$mt_import = new MT_Import(); - -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/opml.php b/wp-admin/import/opml.php deleted file mode 100644 index 7f2e1dc1..00000000 --- a/wp-admin/import/opml.php +++ /dev/null @@ -1,156 +0,0 @@ - - * @author Mike Little - * @package WordPress - * @subpackage Administration - */ - -/** Load WordPress Administration Bootstrap */ -$parent_file = 'tools.php'; -$submenu_file = 'import.php'; -$title = __('Import Blogroll'); - -class OPML_Import { - - function dispatch() { - global $wpdb, $user_ID; -$step = $_POST['step']; -if (!$step) $step = 0; -?> - - -
    - -

    -
    - - -

    -
    - - -
    -

    - -
    - -
    -

    - -
    - -
    - -


    -

    - -

    -
    - -
    - -
    - -

    - false, 'test_type' => false); - $_FILES['userfile']['name'] .= '.txt'; - $file = wp_handle_upload($_FILES['userfile'], $overrides); - - if ( isset($file['error']) ) - wp_die($file['error']); - - $url = $file['url']; - $opml_url = $file['file']; - $blogrolling = false; - } - - global $opml, $updated_timestamp, $all_links, $map, $names, $urls, $targets, $descriptions, $feeds; - if ( isset($opml_url) && $opml_url != '' ) { - if ( $blogrolling === true ) { - $opml = wp_remote_fopen($opml_url); - } else { - $opml = file_get_contents($opml_url); - } - - /** Load OPML Parser */ - include_once('link-parse-opml.php'); - - $link_count = count($names); - for ( $i = 0; $i < $link_count; $i++ ) { - if ('Last' == substr($titles[$i], 0, 4)) - $titles[$i] = ''; - if ( 'http' == substr($titles[$i], 0, 4) ) - $titles[$i] = ''; - $link = array( 'link_url' => $urls[$i], 'link_name' => $wpdb->escape($names[$i]), 'link_category' => array($cat_id), 'link_description' => $wpdb->escape($descriptions[$i]), 'link_owner' => $user_ID, 'link_rss' => $feeds[$i]); - wp_insert_link($link); - echo sprintf('

    '.__('Inserted %s').'

    ', $names[$i]); - } -?> - -

    manage those links.'), $link_count, $cat_id, 'link-manager.php') ?>

    - -" . __("You need to supply your OPML url. Press back on your browser and try again") . "

    \n"; -} // end else - -if ( ! $blogrolling ) - do_action( 'wp_delete_file', $opml_url); - @unlink($opml_url); -?> -
    - diff --git a/wp-admin/import/rss.php b/wp-admin/import/rss.php deleted file mode 100644 index 0e0928cc..00000000 --- a/wp-admin/import/rss.php +++ /dev/null @@ -1,202 +0,0 @@ -'; - screen_icon(); - echo '

    '.__('Import RSS').'

    '; - } - - function footer() { - echo '
    '; - } - - function unhtmlentities($string) { // From php.net for < 4.3 compat - $trans_tbl = get_html_translation_table(HTML_ENTITIES); - $trans_tbl = array_flip($trans_tbl); - return strtr($string, $trans_tbl); - } - - function greet() { - echo '
    '; - echo '

    '.__('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.').'

    '; - wp_import_upload_form("admin.php?import=rss&step=1"); - echo '
    '; - } - - function _normalize_tag( $matches ) { - return '<' . strtolower( $matches[1] ); - } - - function get_posts() { - global $wpdb; - - set_magic_quotes_runtime(0); - $datalines = file($this->file); // Read the file into an array - $importdata = implode('', $datalines); // squish it - $importdata = str_replace(array ("\r\n", "\r"), "\n", $importdata); - - preg_match_all('|(.*?)|is', $importdata, $this->posts); - $this->posts = $this->posts[1]; - $index = 0; - foreach ($this->posts as $post) { - preg_match('|(.*?)|is', $post, $post_title); - $post_title = str_replace(array(''), '', $wpdb->escape( trim($post_title[1]) )); - - preg_match('|(.*?)|is', $post, $post_date_gmt); - - if ($post_date_gmt) { - $post_date_gmt = strtotime($post_date_gmt[1]); - } else { - // if we don't already have something from pubDate - preg_match('|(.*?)|is', $post, $post_date_gmt); - $post_date_gmt = preg_replace('|([-+])([0-9]+):([0-9]+)$|', '\1\2\3', $post_date_gmt[1]); - $post_date_gmt = str_replace('T', ' ', $post_date_gmt); - $post_date_gmt = strtotime($post_date_gmt); - } - - $post_date_gmt = gmdate('Y-m-d H:i:s', $post_date_gmt); - $post_date = get_date_from_gmt( $post_date_gmt ); - - preg_match_all('|(.*?)|is', $post, $categories); - $categories = $categories[1]; - - if (!$categories) { - preg_match_all('|(.*?)|is', $post, $categories); - $categories = $categories[1]; - } - - $cat_index = 0; - foreach ($categories as $category) { - $categories[$cat_index] = $wpdb->escape($this->unhtmlentities($category)); - $cat_index++; - } - - preg_match('|(.*?)|is', $post, $guid); - if ($guid) - $guid = $wpdb->escape(trim($guid[1])); - else - $guid = ''; - - preg_match('|(.*?)|is', $post, $post_content); - $post_content = str_replace(array (''), '', $wpdb->escape(trim($post_content[1]))); - - if (!$post_content) { - // This is for feeds that put content in description - preg_match('|(.*?)|is', $post, $post_content); - $post_content = $wpdb->escape($this->unhtmlentities(trim($post_content[1]))); - } - - // Clean up content - $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content); - $post_content = str_replace('
    ', '
    ', $post_content); - $post_content = str_replace('
    ', '
    ', $post_content); - - $post_author = 1; - $post_status = 'publish'; - $this->posts[$index] = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_status', 'guid', 'categories'); - $index++; - } - } - - function import_posts() { - echo '
      '; - - foreach ($this->posts as $post) { - echo "
    1. ".__('Importing post...'); - - extract($post); - - if ($post_id = post_exists($post_title, $post_content, $post_date)) { - _e('Post already imported'); - } else { - $post_id = wp_insert_post($post); - if ( is_wp_error( $post_id ) ) - return $post_id; - if (!$post_id) { - _e('Couldn’t get post ID'); - return; - } - - if (0 != count($categories)) - wp_create_categories($categories, $post_id); - _e('Done !'); - } - echo '
    2. '; - } - - echo '
    '; - - } - - function import() { - $file = wp_import_handle_upload(); - if ( isset($file['error']) ) { - echo $file['error']; - return; - } - - $this->file = $file['file']; - $this->get_posts(); - $result = $this->import_posts(); - if ( is_wp_error( $result ) ) - return $result; - wp_import_cleanup($file['id']); - do_action('import_done', 'rss'); - - echo '

    '; - printf(__('All done. Have fun!'), get_option('home')); - echo '

    '; - } - - function dispatch() { - if (empty ($_GET['step'])) - $step = 0; - else - $step = (int) $_GET['step']; - - $this->header(); - - switch ($step) { - case 0 : - $this->greet(); - break; - case 1 : - check_admin_referer('import-upload'); - $result = $this->import(); - if ( is_wp_error( $result ) ) - echo $result->get_error_message(); - break; - } - - $this->footer(); - } - - function RSS_Import() { - // Nothing. - } -} - -$rss_import = new RSS_Import(); - -register_importer('rss', __('RSS'), __('Import posts from an RSS feed.'), array ($rss_import, 'dispatch')); -?> diff --git a/wp-admin/import/stp.php b/wp-admin/import/stp.php deleted file mode 100644 index 4568428c..00000000 --- a/wp-admin/import/stp.php +++ /dev/null @@ -1,170 +0,0 @@ -'; - screen_icon(); - echo '

    '.__('Import Simple Tagging').'

    '; - echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; - } - - function footer() { - echo '
    '; - } - - function greet() { - echo '
    '; - echo '

    '.__('Howdy! This imports tags from Simple Tagging 1.6.2 into WordPress tags.').'

    '; - echo '

    '.__('This has not been tested on any other versions of Simple Tagging. Mileage may vary.').'

    '; - echo '

    '.__('To accommodate larger databases for those tag-crazy authors out there, we have made this into an easy 4-step program to help you kick that nasty Simple Tagging habit. Just keep clicking along and we will let you know when you are in the clear!').'

    '; - echo '

    '.__('Don’t be stupid - backup your database before proceeding!').'

    '; - echo '
    '; - wp_nonce_field('import-stp'); - echo '

    '; - echo '
    '; - echo '
    '; - } - - function dispatch () { - if ( empty( $_GET['step'] ) ) { - $step = 0; - } else { - $step = (int) $_GET['step']; - } - // load the header - $this->header(); - switch ( $step ) { - case 0 : - $this->greet(); - break; - case 1 : - check_admin_referer('import-stp'); - $this->import_posts(); - break; - case 2: - check_admin_referer('import-stp'); - $this->import_t2p(); - break; - case 3: - check_admin_referer('import-stp'); - $this->cleanup_import(); - break; - } - // load the footer - $this->footer(); - } - - - function import_posts ( ) { - echo '
    '; - echo '

    '.__('Reading STP Post Tags…').'

    '; - - // read in all the STP tag -> post settings - $posts = $this->get_stp_posts(); - - // if we didn't get any tags back, that's all there is folks! - if ( !is_array($posts) ) { - echo '

    ' . __('No posts were found to have tags!') . '

    '; - return false; - } - else { - // if there's an existing entry, delete it - if ( get_option('stpimp_posts') ) { - delete_option('stpimp_posts'); - } - - add_option('stpimp_posts', $posts); - $count = count($posts); - echo '

    ' . sprintf( _n('Done! %s tag to post relationships were read.', 'Done! %s tags to post relationships were read.', $count), $count ) . '

    '; - } - - echo '
    '; - wp_nonce_field('import-stp'); - echo '

    '; - echo '
    '; - echo '
    '; - } - - - function import_t2p ( ) { - echo '
    '; - echo '

    '.__('Adding Tags to Posts…').'

    '; - - // run that funky magic! - $tags_added = $this->tag2post(); - - echo '

    ' . sprintf( _n('Done! %s tag was added!', 'Done! %s tags were added!', $tags_added), $tags_added ) . '

    '; - echo '
    '; - wp_nonce_field('import-stp'); - echo '

    '; - echo '
    '; - echo '
    '; - } - - function get_stp_posts ( ) { - global $wpdb; - // read in all the posts from the STP post->tag table: should be wp_post2tag - $posts_query = "SELECT post_id, tag_name FROM " . $wpdb->prefix . "stp_tags"; - $posts = $wpdb->get_results($posts_query); - return $posts; - } - - function tag2post ( ) { - global $wpdb; - - // get the tags and posts we imported in the last 2 steps - $posts = get_option('stpimp_posts'); - - // null out our results - $tags_added = 0; - - // loop through each post and add its tags to the db - foreach ( $posts as $this_post ) { - $the_post = (int) $this_post->post_id; - $the_tag = $wpdb->escape($this_post->tag_name); - // try to add the tag - wp_add_post_tags($the_post, $the_tag); - $tags_added++; - } - - // that's it, all posts should be linked to their tags properly, pending any errors we just spit out! - return $tags_added; - } - - function cleanup_import ( ) { - delete_option('stpimp_posts'); - $this->done(); - } - - function done ( ) { - echo '
    '; - echo '

    '.__('Import Complete!').'

    '; - echo '

    ' . __('OK, so we lied about this being a 4-step program! You’re done!') . '

    '; - echo '

    ' . __('Now wasn’t that easy?') . '

    '; - echo '
    '; - } - - function STP_Import ( ) { - // Nothing. - } -} - -// create the import object -$stp_import = new STP_Import(); - -// add it to the import page! -register_importer('stp', 'Simple Tagging', __('Import Simple Tagging tags into WordPress tags.'), array($stp_import, 'dispatch')); -?> diff --git a/wp-admin/import/textpattern.php b/wp-admin/import/textpattern.php deleted file mode 100644 index fb472139..00000000 --- a/wp-admin/import/textpattern.php +++ /dev/null @@ -1,691 +0,0 @@ -get_var( $wpdb->prepare("SELECT count(*) FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) ); - } -} - -if(!function_exists('link_exists')) -{ - /** - * Check whether link already exists. - * - * @package WordPress - * @subpackage Textpattern_Import - * - * @param string $linkname - * @return int - */ - function link_exists($linkname) - { - global $wpdb; - return $wpdb->get_var( $wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_name = %s", $linkname) ); - } -} - -/** - * TextPattern Importer Class - * - * @since unknown - */ -class Textpattern_Import { - - function header() - { - echo '
    '; - screen_icon(); - echo '

    '.__('Import Textpattern').'

    '; - echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; - } - - function footer() - { - echo '
    '; - } - - function greet() { - echo '
    '; - echo '

    '.__('Howdy! This imports categories, users, posts, comments, and links from any Textpattern 4.0.2+ into this blog.').'

    '; - echo '

    '.__('This has not been tested on previous versions of Textpattern. Mileage may vary.').'

    '; - echo '

    '.__('Your Textpattern Configuration settings are as follows:').'

    '; - echo '
    '; - wp_nonce_field('import-textpattern'); - $this->db_form(); - echo '

    '; - echo '
    '; - echo '
    '; - } - - function get_txp_cats() - { - global $wpdb; - // General Housekeeping - $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); - set_magic_quotes_runtime(0); - $prefix = get_option('tpre'); - - // Get Categories - return $txpdb->get_results('SELECT - id, - name, - title - FROM '.$prefix.'txp_category - WHERE type = "article"', - ARRAY_A); - } - - function get_txp_users() - { - global $wpdb; - // General Housekeeping - $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); - set_magic_quotes_runtime(0); - $prefix = get_option('tpre'); - - // Get Users - - return $txpdb->get_results('SELECT - user_id, - name, - RealName, - email, - privs - FROM '.$prefix.'txp_users', ARRAY_A); - } - - function get_txp_posts() - { - // General Housekeeping - $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); - set_magic_quotes_runtime(0); - $prefix = get_option('tpre'); - - // Get Posts - return $txpdb->get_results('SELECT - ID, - Posted, - AuthorID, - LastMod, - Title, - Body, - Excerpt, - Category1, - Category2, - Status, - Keywords, - url_title, - comments_count - FROM '.$prefix.'textpattern - ', ARRAY_A); - } - - function get_txp_comments() - { - global $wpdb; - // General Housekeeping - $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); - set_magic_quotes_runtime(0); - $prefix = get_option('tpre'); - - // Get Comments - return $txpdb->get_results('SELECT * FROM '.$prefix.'txp_discuss', ARRAY_A); - } - - function get_txp_links() - { - //General Housekeeping - $txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost')); - set_magic_quotes_runtime(0); - $prefix = get_option('tpre'); - - return $txpdb->get_results('SELECT - id, - date, - category, - url, - linkname, - description - FROM '.$prefix.'txp_link', - ARRAY_A); - } - - function cat2wp($categories='') - { - // General Housekeeping - global $wpdb; - $count = 0; - $txpcat2wpcat = array(); - // Do the Magic - if(is_array($categories)) - { - echo '

    '.__('Importing Categories...').'

    '; - foreach ($categories as $category) - { - $count++; - extract($category); - - - // Make Nice Variables - $name = $wpdb->escape($name); - $title = $wpdb->escape($title); - - if($cinfo = category_exists($name)) - { - $ret_id = wp_insert_category(array('cat_ID' => $cinfo, 'category_nicename' => $name, 'cat_name' => $title)); - } - else - { - $ret_id = wp_insert_category(array('category_nicename' => $name, 'cat_name' => $title)); - } - $txpcat2wpcat[$id] = $ret_id; - } - - // Store category translation for future use - add_option('txpcat2wpcat',$txpcat2wpcat); - echo '

    '.sprintf(_n('Done! %1$s category imported.', 'Done! %1$s categories imported.', $count), $count).'

    '; - return true; - } - echo __('No Categories to Import!'); - return false; - } - - function users2wp($users='') - { - // General Housekeeping - global $wpdb; - $count = 0; - $txpid2wpid = array(); - - // Midnight Mojo - if(is_array($users)) - { - echo '

    '.__('Importing Users...').'

    '; - foreach($users as $user) - { - $count++; - extract($user); - - // Make Nice Variables - $name = $wpdb->escape($name); - $RealName = $wpdb->escape($RealName); - - if($uinfo = get_userdatabylogin($name)) - { - - $ret_id = wp_insert_user(array( - 'ID' => $uinfo->ID, - 'user_login' => $name, - 'user_nicename' => $RealName, - 'user_email' => $email, - 'user_url' => 'http://', - 'display_name' => $name) - ); - } - else - { - $ret_id = wp_insert_user(array( - 'user_login' => $name, - 'user_nicename' => $RealName, - 'user_email' => $email, - 'user_url' => 'http://', - 'display_name' => $name) - ); - } - $txpid2wpid[$user_id] = $ret_id; - - // Set Textpattern-to-WordPress permissions translation - $transperms = array(1 => '10', 2 => '9', 3 => '5', 4 => '4', 5 => '3', 6 => '2', 7 => '0'); - - // Update Usermeta Data - $user = new WP_User($ret_id); - if('10' == $transperms[$privs]) { $user->set_role('administrator'); } - if('9' == $transperms[$privs]) { $user->set_role('editor'); } - if('5' == $transperms[$privs]) { $user->set_role('editor'); } - if('4' == $transperms[$privs]) { $user->set_role('author'); } - if('3' == $transperms[$privs]) { $user->set_role('contributor'); } - if('2' == $transperms[$privs]) { $user->set_role('contributor'); } - if('0' == $transperms[$privs]) { $user->set_role('subscriber'); } - - update_usermeta( $ret_id, 'wp_user_level', $transperms[$privs] ); - update_usermeta( $ret_id, 'rich_editing', 'false'); - }// End foreach($users as $user) - - // Store id translation array for future use - add_option('txpid2wpid',$txpid2wpid); - - - echo '

    '.sprintf(__('Done! %1$s users imported.'), $count).'

    '; - return true; - }// End if(is_array($users) - - echo __('No Users to Import!'); - return false; - - }// End function user2wp() - - function posts2wp($posts='') - { - // General Housekeeping - global $wpdb; - $count = 0; - $txpposts2wpposts = array(); - $cats = array(); - - // Do the Magic - if(is_array($posts)) - { - echo '

    '.__('Importing Posts...').'

    '; - foreach($posts as $post) - { - $count++; - extract($post); - - // Set Textpattern-to-WordPress status translation - $stattrans = array(1 => 'draft', 2 => 'private', 3 => 'draft', 4 => 'publish', 5 => 'publish'); - - //Can we do this more efficiently? - $uinfo = ( get_userdatabylogin( $AuthorID ) ) ? get_userdatabylogin( $AuthorID ) : 1; - $authorid = ( is_object( $uinfo ) ) ? $uinfo->ID : $uinfo ; - - $Title = $wpdb->escape($Title); - $Body = $wpdb->escape($Body); - $Excerpt = $wpdb->escape($Excerpt); - $post_status = $stattrans[$Status]; - - // Import Post data into WordPress - - if($pinfo = post_exists($Title,$Body)) - { - $ret_id = wp_insert_post(array( - 'ID' => $pinfo, - 'post_date' => $Posted, - 'post_date_gmt' => $post_date_gmt, - 'post_author' => $authorid, - 'post_modified' => $LastMod, - 'post_modified_gmt' => $post_modified_gmt, - 'post_title' => $Title, - 'post_content' => $Body, - 'post_excerpt' => $Excerpt, - 'post_status' => $post_status, - 'post_name' => $url_title, - 'comment_count' => $comments_count) - ); - if ( is_wp_error( $ret_id ) ) - return $ret_id; - } - else - { - $ret_id = wp_insert_post(array( - 'post_date' => $Posted, - 'post_date_gmt' => $post_date_gmt, - 'post_author' => $authorid, - 'post_modified' => $LastMod, - 'post_modified_gmt' => $post_modified_gmt, - 'post_title' => $Title, - 'post_content' => $Body, - 'post_excerpt' => $Excerpt, - 'post_status' => $post_status, - 'post_name' => $url_title, - 'comment_count' => $comments_count) - ); - if ( is_wp_error( $ret_id ) ) - return $ret_id; - } - $txpposts2wpposts[$ID] = $ret_id; - - // Make Post-to-Category associations - $cats = array(); - $category1 = get_category_by_slug($Category1); - $category1 = $category1->term_id; - $category2 = get_category_by_slug($Category2); - $category2 = $category2->term_id; - if($cat1 = $category1) { $cats[1] = $cat1; } - if($cat2 = $category2) { $cats[2] = $cat2; } - - if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); } - } - } - // Store ID translation for later use - add_option('txpposts2wpposts',$txpposts2wpposts); - - echo '

    '.sprintf(__('Done! %1$s posts imported.'), $count).'

    '; - return true; - } - - function comments2wp($comments='') - { - // General Housekeeping - global $wpdb; - $count = 0; - $txpcm2wpcm = array(); - $postarr = get_option('txpposts2wpposts'); - - // Magic Mojo - if(is_array($comments)) - { - echo '

    '.__('Importing Comments...').'

    '; - foreach($comments as $comment) - { - $count++; - extract($comment); - - // WordPressify Data - $comment_ID = ltrim($discussid, '0'); - $comment_post_ID = $postarr[$parentid]; - $comment_approved = (1 == $visible) ? 1 : 0; - $name = $wpdb->escape($name); - $email = $wpdb->escape($email); - $web = $wpdb->escape($web); - $message = $wpdb->escape($message); - - $comment = array( - 'comment_post_ID' => $comment_post_ID, - 'comment_author' => $name, - 'comment_author_IP' => $ip, - 'comment_author_email' => $email, - 'comment_author_url' => $web, - 'comment_date' => $posted, - 'comment_content' => $message, - 'comment_approved' => $comment_approved); - $comment = wp_filter_comment($comment); - - if ( $cinfo = comment_exists($name, $posted) ) { - // Update comments - $comment['comment_ID'] = $cinfo; - $ret_id = wp_update_comment($comment); - } else { - // Insert comments - $ret_id = wp_insert_comment($comment); - } - $txpcm2wpcm[$comment_ID] = $ret_id; - } - // Store Comment ID translation for future use - add_option('txpcm2wpcm', $txpcm2wpcm); - - // Associate newly formed categories with posts - get_comment_count($ret_id); - - - echo '

    '.sprintf(__('Done! %1$s comments imported.'), $count).'

    '; - return true; - } - echo __('No Comments to Import!'); - return false; - } - - function links2wp($links='') - { - // General Housekeeping - global $wpdb; - $count = 0; - - // Deal with the links - if(is_array($links)) - { - echo '

    '.__('Importing Links...').'

    '; - foreach($links as $link) - { - $count++; - extract($link); - - // Make nice vars - $category = $wpdb->escape($category); - $linkname = $wpdb->escape($linkname); - $description = $wpdb->escape($description); - - if($linfo = link_exists($linkname)) - { - $ret_id = wp_insert_link(array( - 'link_id' => $linfo, - 'link_url' => $url, - 'link_name' => $linkname, - 'link_category' => $category, - 'link_description' => $description, - 'link_updated' => $date) - ); - } - else - { - $ret_id = wp_insert_link(array( - 'link_url' => $url, - 'link_name' => $linkname, - 'link_category' => $category, - 'link_description' => $description, - 'link_updated' => $date) - ); - } - $txplinks2wplinks[$link_id] = $ret_id; - } - add_option('txplinks2wplinks',$txplinks2wplinks); - echo '

    '; - printf(_n('Done! %s link imported', 'Done! %s links imported', $count), $count); - echo '

    '; - return true; - } - echo __('No Links to Import!'); - return false; - } - - function import_categories() - { - // Category Import - $cats = $this->get_txp_cats(); - $this->cat2wp($cats); - add_option('txp_cats', $cats); - - - - echo '
    '; - wp_nonce_field('import-textpattern'); - printf('

    ', esc_attr__('Import Users')); - echo '
    '; - - } - - function import_users() - { - // User Import - $users = $this->get_txp_users(); - $this->users2wp($users); - - echo '
    '; - wp_nonce_field('import-textpattern'); - printf('

    ', esc_attr__('Import Posts')); - echo '
    '; - } - - function import_posts() - { - // Post Import - $posts = $this->get_txp_posts(); - $result = $this->posts2wp($posts); - if ( is_wp_error( $result ) ) - return $result; - - echo '
    '; - wp_nonce_field('import-textpattern'); - printf('

    ', esc_attr__('Import Comments')); - echo '
    '; - } - - function import_comments() - { - // Comment Import - $comments = $this->get_txp_comments(); - $this->comments2wp($comments); - - echo '
    '; - wp_nonce_field('import-textpattern'); - printf('

    ', esc_attr__('Import Links')); - echo '
    '; - } - - function import_links() - { - //Link Import - $links = $this->get_txp_links(); - $this->links2wp($links); - add_option('txp_links', $links); - - echo '
    '; - wp_nonce_field('import-textpattern'); - printf('

    ', esc_attr__('Finish')); - echo '
    '; - } - - function cleanup_txpimport() - { - delete_option('tpre'); - delete_option('txp_cats'); - delete_option('txpid2wpid'); - delete_option('txpcat2wpcat'); - delete_option('txpposts2wpposts'); - delete_option('txpcm2wpcm'); - delete_option('txplinks2wplinks'); - delete_option('txpuser'); - delete_option('txppass'); - delete_option('txpname'); - delete_option('txphost'); - do_action('import_done', 'textpattern'); - $this->tips(); - } - - function tips() - { - echo '

    '.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from Textpattern, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'

    '; - echo '

    '.__('Users').'

    '; - echo '

    '.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in Textpattern, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. Every user has the same username, but their passwords are reset to password123. So log in and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'

    '; - echo '

    '.__('Preserving Authors').'

    '; - echo '

    '.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'

    '; - echo '

    '.__('Textile').'

    '; - echo '

    '.__('Also, since you’re coming from Textpattern, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing Textile for WordPress. Trust me... You’ll want it.').'

    '; - echo '

    '.__('WordPress Resources').'

    '; - echo '

    '.__('Finally, there are numerous WordPress resources around the internet. Some of them are:').'

    '; - echo ''; - echo '

    '.sprintf(__('That’s it! What are you waiting for? Go log in!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'

    '; - } - - function db_form() - { - echo ''; - printf('', __('Textpattern Database User:')); - printf('', __('Textpattern Database Password:')); - printf('', __('Textpattern Database Name:')); - printf('', __('Textpattern Database Host:')); - printf('', __('Textpattern Table prefix (if any):')); - echo '
    '; - } - - function dispatch() - { - - if (empty ($_GET['step'])) - $step = 0; - else - $step = (int) $_GET['step']; - $this->header(); - - if ( $step > 0 ) - { - check_admin_referer('import-textpattern'); - - if($_POST['dbuser']) - { - if(get_option('txpuser')) - delete_option('txpuser'); - add_option('txpuser', sanitize_user($_POST['dbuser'], true)); - } - if($_POST['dbpass']) - { - if(get_option('txppass')) - delete_option('txppass'); - add_option('txppass', sanitize_user($_POST['dbpass'], true)); - } - - if($_POST['dbname']) - { - if(get_option('txpname')) - delete_option('txpname'); - add_option('txpname', sanitize_user($_POST['dbname'], true)); - } - if($_POST['dbhost']) - { - if(get_option('txphost')) - delete_option('txphost'); - add_option('txphost', sanitize_user($_POST['dbhost'], true)); - } - if($_POST['dbprefix']) - { - if(get_option('tpre')) - delete_option('tpre'); - add_option('tpre', sanitize_user($_POST['dbprefix'])); - } - - - } - - switch ($step) - { - default: - case 0 : - $this->greet(); - break; - case 1 : - $this->import_categories(); - break; - case 2 : - $this->import_users(); - break; - case 3 : - $result = $this->import_posts(); - if ( is_wp_error( $result ) ) - echo $result->get_error_message(); - break; - case 4 : - $this->import_comments(); - break; - case 5 : - $this->import_links(); - break; - case 6 : - $this->cleanup_txpimport(); - break; - } - - $this->footer(); - } - - function Textpattern_Import() - { - // Nothing. - } -} - -$txp_import = new Textpattern_Import(); - -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/utw.php b/wp-admin/import/utw.php deleted file mode 100644 index 3add5b63..00000000 --- a/wp-admin/import/utw.php +++ /dev/null @@ -1,290 +0,0 @@ -'; - screen_icon(); - echo '

    '.__('Import Ultimate Tag Warrior').'

    '; - echo '

    '.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'

    '; - } - - function footer() { - echo '
    '; - } - - function greet() { - echo '
    '; - echo '

    '.__('Howdy! This imports tags from Ultimate Tag Warrior 3 into WordPress tags.').'

    '; - echo '

    '.__('This has not been tested on any other versions of Ultimate Tag Warrior. Mileage may vary.').'

    '; - echo '

    '.__('To accommodate larger databases for those tag-crazy authors out there, we have made this into an easy 5-step program to help you kick that nasty UTW habit. Just keep clicking along and we will let you know when you are in the clear!').'

    '; - echo '

    '.__('Don’t be stupid - backup your database before proceeding!').'

    '; - echo '
    '; - echo '

    '; - echo '
    '; - echo '
    '; - } - - - function dispatch () { - if ( empty( $_GET['step'] ) ) { - $step = 0; - } else { - $step = (int) $_GET['step']; - } - - if ( $step > 1 ) - check_admin_referer('import-utw'); - - // load the header - $this->header(); - - switch ( $step ) { - case 0 : - $this->greet(); - break; - case 1 : - $this->import_tags(); - break; - case 2 : - $this->import_posts(); - break; - case 3: - $this->import_t2p(); - break; - case 4: - $this->cleanup_import(); - break; - } - - // load the footer - $this->footer(); - } - - - function import_tags ( ) { - echo '
    '; - echo '

    '.__('Reading UTW Tags…').'

    '; - - $tags = $this->get_utw_tags(); - - // if we didn't get any tags back, that's all there is folks! - if ( !is_array($tags) ) { - echo '

    ' . __('No Tags Found!') . '

    '; - return false; - } - else { - - // if there's an existing entry, delete it - if ( get_option('utwimp_tags') ) { - delete_option('utwimp_tags'); - } - - add_option('utwimp_tags', $tags); - - - $count = count($tags); - - echo '

    ' . sprintf( _n('Done! %s tag were read.', 'Done! %s tags were read.', $count), $count ) . '

    '; - echo '

    ' . __('The following tags were found:') . '

    '; - - echo '
      '; - - foreach ( $tags as $tag_id => $tag_name ) { - - echo '
    • ' . $tag_name . '
    • '; - - } - - echo '
    '; - - echo '
    '; - - echo '

    ' . __('If you don’t want to import any of these tags, you should delete them from the UTW tag management page and then re-run this import.') . '

    '; - - - } - - echo '
    '; - wp_nonce_field('import-utw'); - echo '

    '; - echo '
    '; - echo '
    '; - } - - - function import_posts ( ) { - echo '
    '; - echo '

    '.__('Reading UTW Post Tags…').'

    '; - - // read in all the UTW tag -> post settings - $posts = $this->get_utw_posts(); - - // if we didn't get any tags back, that's all there is folks! - if ( !is_array($posts) ) { - echo '

    ' . __('No posts were found to have tags!') . '

    '; - return false; - } - else { - - // if there's an existing entry, delete it - if ( get_option('utwimp_posts') ) { - delete_option('utwimp_posts'); - } - - add_option('utwimp_posts', $posts); - - - $count = count($posts); - - echo '

    ' . sprintf( _n('Done! %s tag to post relationships were read.', 'Done! %s tags to post relationships were read.', $count), $count ) . '

    '; - - } - - echo '
    '; - wp_nonce_field('import-utw'); - echo '

    '; - echo '
    '; - echo '
    '; - - } - - - function import_t2p ( ) { - - echo '
    '; - echo '

    '.__('Adding Tags to Posts…').'

    '; - - // run that funky magic! - $tags_added = $this->tag2post(); - - echo '

    ' . sprintf( _n( 'Done! %s tag were added!', 'Done! %s tags were added!', $tags_added ), $tags_added ) . '

    '; - - echo '
    '; - wp_nonce_field('import-utw'); - echo '

    '; - echo '
    '; - echo '
    '; - - } - - - function get_utw_tags ( ) { - - global $wpdb; - - // read in all the tags from the UTW tags table: should be wp_tags - $tags_query = "SELECT tag_id, tag FROM " . $wpdb->prefix . "tags"; - - $tags = $wpdb->get_results($tags_query); - - // rearrange these tags into something we can actually use - foreach ( $tags as $tag ) { - - $new_tags[$tag->tag_id] = $tag->tag; - - } - - return $new_tags; - - } - - function get_utw_posts ( ) { - - global $wpdb; - - // read in all the posts from the UTW post->tag table: should be wp_post2tag - $posts_query = "SELECT tag_id, post_id FROM " . $wpdb->prefix . "post2tag"; - - $posts = $wpdb->get_results($posts_query); - - return $posts; - - } - - - function tag2post ( ) { - - // get the tags and posts we imported in the last 2 steps - $tags = get_option('utwimp_tags'); - $posts = get_option('utwimp_posts'); - - // null out our results - $tags_added = 0; - - // loop through each post and add its tags to the db - foreach ( $posts as $this_post ) { - - $the_post = (int) $this_post->post_id; - $the_tag = (int) $this_post->tag_id; - - // what's the tag name for that id? - $the_tag = $tags[$the_tag]; - - // screw it, just try to add the tag - wp_add_post_tags($the_post, $the_tag); - - $tags_added++; - - } - - // that's it, all posts should be linked to their tags properly, pending any errors we just spit out! - return $tags_added; - - - } - - - function cleanup_import ( ) { - - delete_option('utwimp_tags'); - delete_option('utwimp_posts'); - - $this->done(); - - } - - - function done ( ) { - - echo '
    '; - echo '

    '.__('Import Complete!').'

    '; - - echo '

    ' . __('OK, so we lied about this being a 5-step program! You’re done!') . '

    '; - - echo '

    ' . __('Now wasn’t that easy?') . '

    '; - - echo '
    '; - - } - - - function UTW_Import ( ) { - - // Nothing. - - } - -} - - -// create the import object -$utw_import = new UTW_Import(); - -// add it to the import page! -register_importer('utw', 'Ultimate Tag Warrior', __('Import Ultimate Tag Warrior tags into WordPress tags.'), array($utw_import, 'dispatch')); - -?> diff --git a/wp-admin/import/wordpress.php b/wp-admin/import/wordpress.php deleted file mode 100644 index 83c90acf..00000000 --- a/wp-admin/import/wordpress.php +++ /dev/null @@ -1,869 +0,0 @@ -'; - screen_icon(); - echo '

    '.__('Import WordPress').'

    '; - } - - function footer() { - echo '
    '; - } - - function unhtmlentities($string) { // From php.net for < 4.3 compat - $trans_tbl = get_html_translation_table(HTML_ENTITIES); - $trans_tbl = array_flip($trans_tbl); - return strtr($string, $trans_tbl); - } - - function greet() { - echo '
    '; - echo '

    '.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts, pages, comments, custom fields, categories, and tags into this blog.').'

    '; - echo '

    '.__('Choose a WordPress WXR file to upload, then click Upload file and import.').'

    '; - wp_import_upload_form("admin.php?import=wordpress&step=1"); - echo '
    '; - } - - function get_tag( $string, $tag ) { - global $wpdb; - preg_match("|<$tag.*?>(.*?)|is", $string, $return); - $return = preg_replace('|^$|s', '$1', $return[1]); - $return = $wpdb->escape( trim( $return ) ); - return $return; - } - - function has_gzip() { - return is_callable('gzopen'); - } - - function fopen($filename, $mode='r') { - if ( $this->has_gzip() ) - return gzopen($filename, $mode); - return fopen($filename, $mode); - } - - function feof($fp) { - if ( $this->has_gzip() ) - return gzeof($fp); - return feof($fp); - } - - function fgets($fp, $len=8192) { - if ( $this->has_gzip() ) - return gzgets($fp, $len); - return fgets($fp, $len); - } - - function fclose($fp) { - if ( $this->has_gzip() ) - return gzclose($fp); - return fclose($fp); - } - - function get_entries($process_post_func=NULL) { - set_magic_quotes_runtime(0); - - $doing_entry = false; - $is_wxr_file = false; - - $fp = $this->fopen($this->file, 'r'); - if ($fp) { - while ( !$this->feof($fp) ) { - $importline = rtrim($this->fgets($fp)); - - // this doesn't check that the file is perfectly valid but will at least confirm that it's not the wrong format altogether - if ( !$is_wxr_file && preg_match('|xmlns:wp="http://wordpress[.]org/export/\d+[.]\d+/"|', $importline) ) - $is_wxr_file = true; - - if ( false !== strpos($importline, '') ) { - preg_match('|(.*?)|is', $importline, $url); - $this->base_url = $url[1]; - continue; - } - if ( false !== strpos($importline, '') ) { - preg_match('|(.*?)|is', $importline, $category); - $this->categories[] = $category[1]; - continue; - } - if ( false !== strpos($importline, '') ) { - preg_match('|(.*?)|is', $importline, $tag); - $this->tags[] = $tag[1]; - continue; - } - if ( false !== strpos($importline, '') ) { - preg_match('|(.*?)|is', $importline, $term); - $this->terms[] = $term[1]; - continue; - } - if ( false !== strpos($importline, '') ) { - $this->post = ''; - $doing_entry = true; - continue; - } - if ( false !== strpos($importline, '') ) { - $doing_entry = false; - if ($process_post_func) - call_user_func($process_post_func, $this->post); - continue; - } - if ( $doing_entry ) { - $this->post .= $importline . "\n"; - } - } - - $this->fclose($fp); - } - - return $is_wxr_file; - - } - - function get_wp_authors() { - // We need to find unique values of author names, while preserving the order, so this function emulates the unique_value(); php function, without the sorting. - $temp = $this->allauthornames; - $authors[0] = array_shift($temp); - $y = count($temp) + 1; - for ($x = 1; $x < $y; $x ++) { - $next = array_shift($temp); - if (!(in_array($next, $authors))) - array_push($authors, "$next"); - } - - return $authors; - } - - function get_authors_from_post() { - global $current_user; - - // this will populate $this->author_ids with a list of author_names => user_ids - - foreach ( $_POST['author_in'] as $i => $in_author_name ) { - - if ( !empty($_POST['user_select'][$i]) ) { - // an existing user was selected in the dropdown list - $user = get_userdata( intval($_POST['user_select'][$i]) ); - if ( isset($user->ID) ) - $this->author_ids[$in_author_name] = $user->ID; - } - elseif ( $this->allow_create_users() ) { - // nothing was selected in the dropdown list, so we'll use the name in the text field - - $new_author_name = trim($_POST['user_create'][$i]); - // if the user didn't enter a name, assume they want to use the same name as in the import file - if ( empty($new_author_name) ) - $new_author_name = $in_author_name; - - $user_id = username_exists($new_author_name); - if ( !$user_id ) { - $user_id = wp_create_user($new_author_name, wp_generate_password()); - } - - $this->author_ids[$in_author_name] = $user_id; - } - - // failsafe: if the user_id was invalid, default to the current user - if ( empty($this->author_ids[$in_author_name]) ) { - $this->author_ids[$in_author_name] = intval($current_user->ID); - } - } - - } - - function wp_authors_form() { -?> -

    -

    admins entries.'); ?>

    -allow_create_users() ) { - echo '

    '.__('If a new user is created by WordPress, a password will be randomly generated. Manually change the user’s details if necessary.')."

    \n"; - } - - - $authors = $this->get_wp_authors(); - echo '
    '; - wp_nonce_field('import-wordpress'); -?> -
      -'.__('Import author:').' '.$author.'
      '; - $this->users_form($j, $author); - echo ''; - } - - if ( $this->allow_fetch_attachments() ) { -?> -
    -

    -

    - - -

    - -'; - echo ''.'
    '; - echo '

    '; - echo '
    '; - - } - - function users_form($n, $author) { - - if ( $this->allow_create_users() ) { - printf('
    '); - } - else { - echo __('Map to existing').'
    '; - } - - // keep track of $n => $author name - echo ''; - - $users = get_users_of_blog(); -?> - get_entries(array(&$this, 'process_author')); - if ( $is_wxr_file ) { - $this->wp_authors_form(); - } - else { - echo '

    '.__('Invalid file').'

    '; - echo '

    '.__('Please upload a valid WXR (WordPress eXtended RSS) export file.').'

    '; - } - } - - // fetch the user ID for a given author name, respecting the mapping preferences - function checkauthor($author) { - global $current_user; - - if ( !empty($this->author_ids[$author]) ) - return $this->author_ids[$author]; - - // failsafe: map to the current user - return $current_user->ID; - } - - - - function process_categories() { - global $wpdb; - - $cat_names = (array) get_terms('category', 'fields=names'); - - while ( $c = array_shift($this->categories) ) { - $cat_name = trim($this->get_tag( $c, 'wp:cat_name' )); - - // If the category exists we leave it alone - if ( in_array($cat_name, $cat_names) ) - continue; - - $category_nicename = $this->get_tag( $c, 'wp:category_nicename' ); - $category_description = $this->get_tag( $c, 'wp:category_description' ); - $posts_private = (int) $this->get_tag( $c, 'wp:posts_private' ); - $links_private = (int) $this->get_tag( $c, 'wp:links_private' ); - - $parent = $this->get_tag( $c, 'wp:category_parent' ); - - if ( empty($parent) ) - $category_parent = '0'; - else - $category_parent = category_exists($parent); - - $catarr = compact('category_nicename', 'category_parent', 'posts_private', 'links_private', 'posts_private', 'cat_name', 'category_description'); - - $cat_ID = wp_insert_category($catarr); - } - } - - function process_tags() { - global $wpdb; - - $tag_names = (array) get_terms('post_tag', 'fields=names'); - - while ( $c = array_shift($this->tags) ) { - $tag_name = trim($this->get_tag( $c, 'wp:tag_name' )); - - // If the category exists we leave it alone - if ( in_array($tag_name, $tag_names) ) - continue; - - $slug = $this->get_tag( $c, 'wp:tag_slug' ); - $description = $this->get_tag( $c, 'wp:tag_description' ); - - $tagarr = compact('slug', 'description'); - - $tag_ID = wp_insert_term($tag_name, 'post_tag', $tagarr); - } - } - - function process_terms() { - global $wpdb, $wp_taxonomies; - - $custom_taxonomies = $wp_taxonomies; - // get rid of the standard taxonomies - unset( $custom_taxonomies['category'] ); - unset( $custom_taxonomies['post_tag'] ); - unset( $custom_taxonomies['link_category'] ); - - $custom_taxonomies = array_keys( $custom_taxonomies ); - $current_terms = (array) get_terms( $custom_taxonomies, 'get=all' ); - $taxonomies = array(); - foreach ( $current_terms as $term ) { - if ( isset( $_terms[$term->taxonomy] ) ) { - $taxonomies[$term->taxonomy] = array_merge( $taxonomies[$term->taxonomy], array($term->name) ); - } else { - $taxonomies[$term->taxonomy] = array($term->name); - } - } - - while ( $c = array_shift($this->terms) ) { - $term_name = trim($this->get_tag( $c, 'wp:term_name' )); - $term_taxonomy = trim($this->get_tag( $c, 'wp:term_taxonomy' )); - - // If the term exists in the taxonomy we leave it alone - if ( isset($taxonomies[$term_taxonomy] ) && in_array( $term_name, $taxonomies[$term_taxonomy] ) ) - continue; - - $slug = $this->get_tag( $c, 'wp:term_slug' ); - $description = $this->get_tag( $c, 'wp:term_description' ); - - $termarr = compact('slug', 'description'); - - $term_ID = wp_insert_term($term_name, $this->get_tag( $c, 'wp:term_taxonomy' ), $termarr); - } - } - - function process_author($post) { - $author = $this->get_tag( $post, 'dc:creator' ); - if ($author) - $this->allauthornames[] = $author; - } - - function process_posts() { - echo '
      '; - - $this->get_entries(array(&$this, 'process_post')); - - echo '
    '; - - wp_import_cleanup($this->id); - do_action('import_done', 'wordpress'); - - echo '

    '.sprintf(__('All done.').' '.__('Have fun!').'', get_option('home')).'

    '; - } - - function _normalize_tag( $matches ) { - return '<' . strtolower( $matches[1] ); - } - - function process_post($post) { - global $wpdb; - - $post_ID = (int) $this->get_tag( $post, 'wp:post_id' ); - if ( $post_ID && !empty($this->post_ids_processed[$post_ID]) ) // Processed already - return 0; - - set_time_limit( 60 ); - - // There are only ever one of these - $post_title = $this->get_tag( $post, 'title' ); - $post_date = $this->get_tag( $post, 'wp:post_date' ); - $post_date_gmt = $this->get_tag( $post, 'wp:post_date_gmt' ); - $comment_status = $this->get_tag( $post, 'wp:comment_status' ); - $ping_status = $this->get_tag( $post, 'wp:ping_status' ); - $post_status = $this->get_tag( $post, 'wp:status' ); - $post_name = $this->get_tag( $post, 'wp:post_name' ); - $post_parent = $this->get_tag( $post, 'wp:post_parent' ); - $menu_order = $this->get_tag( $post, 'wp:menu_order' ); - $post_type = $this->get_tag( $post, 'wp:post_type' ); - $post_password = $this->get_tag( $post, 'wp:post_password' ); - $is_sticky = $this->get_tag( $post, 'wp:is_sticky' ); - $guid = $this->get_tag( $post, 'guid' ); - $post_author = $this->get_tag( $post, 'dc:creator' ); - - $post_excerpt = $this->get_tag( $post, 'excerpt:encoded' ); - $post_excerpt = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_excerpt); - $post_excerpt = str_replace('
    ', '
    ', $post_excerpt); - $post_excerpt = str_replace('
    ', '
    ', $post_excerpt); - - $post_content = $this->get_tag( $post, 'content:encoded' ); - $post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content); - $post_content = str_replace('
    ', '
    ', $post_content); - $post_content = str_replace('
    ', '
    ', $post_content); - - preg_match_all('|(.*?)|is', $post, $tags); - $tags = $tags[1]; - - $tag_index = 0; - foreach ($tags as $tag) { - $tags[$tag_index] = $wpdb->escape($this->unhtmlentities(str_replace(array (''), '', $tag))); - $tag_index++; - } - - preg_match_all('|(.*?)|is', $post, $categories); - $categories = $categories[1]; - - $cat_index = 0; - foreach ($categories as $category) { - $categories[$cat_index] = $wpdb->escape($this->unhtmlentities(str_replace(array (''), '', $category))); - $cat_index++; - } - - $post_exists = post_exists($post_title, '', $post_date); - - if ( $post_exists ) { - echo '
  • '; - printf(__('Post %s already exists.'), stripslashes($post_title)); - $comment_post_ID = $post_id = $post_exists; - } else { - - // If it has parent, process parent first. - $post_parent = (int) $post_parent; - if ($post_parent) { - // if we already know the parent, map it to the local ID - if ( $parent = $this->post_ids_processed[$post_parent] ) { - $post_parent = $parent; // new ID of the parent - } - else { - // record the parent for later - $this->orphans[intval($post_ID)] = $post_parent; - } - } - - echo '
  • '; - - $post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor - - $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_excerpt', 'post_title', 'post_status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 'menu_order', 'post_type', 'post_password'); - $postdata['import_id'] = $post_ID; - if ($post_type == 'attachment') { - $remote_url = $this->get_tag( $post, 'wp:attachment_url' ); - if ( !$remote_url ) - $remote_url = $guid; - - $comment_post_ID = $post_id = $this->process_attachment($postdata, $remote_url); - if ( !$post_id or is_wp_error($post_id) ) - return $post_id; - } - else { - printf(__('Importing post %s...'), stripslashes($post_title)); - $comment_post_ID = $post_id = wp_insert_post($postdata); - if ( $post_id && $is_sticky == 1 ) - stick_post( $post_id ); - - } - - if ( is_wp_error( $post_id ) ) - return $post_id; - - // Memorize old and new ID. - if ( $post_id && $post_ID ) { - $this->post_ids_processed[intval($post_ID)] = intval($post_id); - } - - // Add categories. - if (count($categories) > 0) { - $post_cats = array(); - foreach ($categories as $category) { - if ( '' == $category ) - continue; - $slug = sanitize_term_field('slug', $category, 0, 'category', 'db'); - $cat = get_term_by('slug', $slug, 'category'); - $cat_ID = 0; - if ( ! empty($cat) ) - $cat_ID = $cat->term_id; - if ($cat_ID == 0) { - $category = $wpdb->escape($category); - $cat_ID = wp_insert_category(array('cat_name' => $category)); - if ( is_wp_error($cat_ID) ) - continue; - } - $post_cats[] = $cat_ID; - } - wp_set_post_categories($post_id, $post_cats); - } - - // Add tags. - if (count($tags) > 0) { - $post_tags = array(); - foreach ($tags as $tag) { - if ( '' == $tag ) - continue; - $slug = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db'); - $tag_obj = get_term_by('slug', $slug, 'post_tag'); - $tag_id = 0; - if ( ! empty($tag_obj) ) - $tag_id = $tag_obj->term_id; - if ( $tag_id == 0 ) { - $tag = $wpdb->escape($tag); - $tag_id = wp_insert_term($tag, 'post_tag'); - if ( is_wp_error($tag_id) ) - continue; - $tag_id = $tag_id['term_id']; - } - $post_tags[] = intval($tag_id); - } - wp_set_post_tags($post_id, $post_tags); - } - } - - // Now for comments - preg_match_all('|(.*?)|is', $post, $comments); - $comments = $comments[1]; - $num_comments = 0; - $inserted_comments = array(); - if ( $comments) { - foreach ($comments as $comment) { - $comment_id = $this->get_tag( $comment, 'wp:comment_id'); - $newcomments[$comment_id]['comment_post_ID'] = $comment_post_ID; - $newcomments[$comment_id]['comment_author'] = $this->get_tag( $comment, 'wp:comment_author'); - $newcomments[$comment_id]['comment_author_email'] = $this->get_tag( $comment, 'wp:comment_author_email'); - $newcomments[$comment_id]['comment_author_IP'] = $this->get_tag( $comment, 'wp:comment_author_IP'); - $newcomments[$comment_id]['comment_author_url'] = $this->get_tag( $comment, 'wp:comment_author_url'); - $newcomments[$comment_id]['comment_date'] = $this->get_tag( $comment, 'wp:comment_date'); - $newcomments[$comment_id]['comment_date_gmt'] = $this->get_tag( $comment, 'wp:comment_date_gmt'); - $newcomments[$comment_id]['comment_content'] = $this->get_tag( $comment, 'wp:comment_content'); - $newcomments[$comment_id]['comment_approved'] = $this->get_tag( $comment, 'wp:comment_approved'); - $newcomments[$comment_id]['comment_type'] = $this->get_tag( $comment, 'wp:comment_type'); - $newcomments[$comment_id]['comment_parent'] = $this->get_tag( $comment, 'wp:comment_parent'); - } - // Sort by comment ID, to make sure comment parents exist (if there at all) - ksort($newcomments); - foreach ($newcomments as $key => $comment) { - // if this is a new post we can skip the comment_exists() check - if ( !$post_exists || !comment_exists($comment['comment_author'], $comment['comment_date']) ) { - if (isset($inserted_comments[$comment['comment_parent']])) - $comment['comment_parent'] = $inserted_comments[$comment['comment_parent']]; - $comment = wp_filter_comment($comment); - $inserted_comments[$key] = wp_insert_comment($comment); - $num_comments++; - } - } - } - - if ( $num_comments ) - printf(' '._n('(%s comment)', '(%s comments)', $num_comments), $num_comments); - - // Now for post meta - preg_match_all('|(.*?)|is', $post, $postmeta); - $postmeta = $postmeta[1]; - if ( $postmeta) { foreach ($postmeta as $p) { - $key = $this->get_tag( $p, 'wp:meta_key' ); - $value = $this->get_tag( $p, 'wp:meta_value' ); - $value = stripslashes($value); // add_post_meta() will escape. - - $this->process_post_meta($post_id, $key, $value); - - } } - - do_action('import_post_added', $post_id); - print "
  • \n"; - } - - function process_post_meta($post_id, $key, $value) { - // the filter can return false to skip a particular metadata key - $_key = apply_filters('import_post_meta_key', $key); - if ( $_key ) { - add_post_meta( $post_id, $_key, $value ); - do_action('import_post_meta', $post_id, $_key, $value); - } - } - - function process_attachment($postdata, $remote_url) { - if ($this->fetch_attachments and $remote_url) { - printf( __('Importing attachment %s... '), htmlspecialchars($remote_url) ); - - // If the URL is absolute, but does not contain http, upload it assuming the base_site_url variable - if ( preg_match('/^\/[\w\W]+$/', $remote_url) ) - $remote_url = rtrim($this->base_url,'/').$remote_url; - - $upload = $this->fetch_remote_file($postdata, $remote_url); - if ( is_wp_error($upload) ) { - printf( __('Remote file error: %s'), htmlspecialchars($upload->get_error_message()) ); - return $upload; - } - else { - print '('.size_format(filesize($upload['file'])).')'; - } - - if ( $info = wp_check_filetype($upload['file']) ) { - $postdata['post_mime_type'] = $info['type']; - } - else { - print __('Invalid file type'); - return; - } - - $postdata['guid'] = $upload['url']; - - // as per wp-admin/includes/upload.php - $post_id = wp_insert_attachment($postdata, $upload['file']); - wp_update_attachment_metadata( $post_id, wp_generate_attachment_metadata( $post_id, $upload['file'] ) ); - - // remap the thumbnail url. this isn't perfect because we're just guessing the original url. - if ( preg_match('@^image/@', $info['type']) && $thumb_url = wp_get_attachment_thumb_url($post_id) ) { - $parts = pathinfo($remote_url); - $ext = $parts['extension']; - $name = basename($parts['basename'], ".{$ext}"); - $this->url_remap[$parts['dirname'] . '/' . $name . '.thumbnail.' . $ext] = $thumb_url; - } - - return $post_id; - } - else { - printf( __('Skipping attachment %s'), htmlspecialchars($remote_url) ); - } - } - - function fetch_remote_file($post, $url) { - $upload = wp_upload_dir($post['post_date']); - - // extract the file name and extension from the url - $file_name = basename($url); - - // get placeholder file in the upload dir with a unique sanitized filename - $upload = wp_upload_bits( $file_name, 0, '', $post['post_date']); - if ( $upload['error'] ) { - echo $upload['error']; - return new WP_Error( 'upload_dir_error', $upload['error'] ); - } - - // fetch the remote url and write it to the placeholder file - $headers = wp_get_http($url, $upload['file']); - - //Request failed - if ( ! $headers ) { - @unlink($upload['file']); - return new WP_Error( 'import_file_error', __('Remote server did not respond') ); - } - - // make sure the fetch was successful - if ( $headers['response'] != '200' ) { - @unlink($upload['file']); - return new WP_Error( 'import_file_error', sprintf(__('Remote file returned error response %1$d %2$s'), $headers['response'], get_status_header_desc($headers['response']) ) ); - } - elseif ( isset($headers['content-length']) && filesize($upload['file']) != $headers['content-length'] ) { - @unlink($upload['file']); - return new WP_Error( 'import_file_error', __('Remote file is incorrect size') ); - } - - $max_size = $this->max_attachment_size(); - if ( !empty($max_size) and filesize($upload['file']) > $max_size ) { - @unlink($upload['file']); - return new WP_Error( 'import_file_error', sprintf(__('Remote file is too large, limit is %s', size_format($max_size))) ); - } - - // keep track of the old and new urls so we can substitute them later - $this->url_remap[$url] = $upload['url']; - // if the remote url is redirected somewhere else, keep track of the destination too - if ( $headers['x-final-location'] != $url ) - $this->url_remap[$headers['x-final-location']] = $upload['url']; - - return $upload; - - } - - // sort by strlen, longest string first - function cmpr_strlen($a, $b) { - return strlen($b) - strlen($a); - } - - // update url references in post bodies to point to the new local files - function backfill_attachment_urls() { - - // make sure we do the longest urls first, in case one is a substring of another - uksort($this->url_remap, array(&$this, 'cmpr_strlen')); - - global $wpdb; - foreach ($this->url_remap as $from_url => $to_url) { - // remap urls in post_content - $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, '%s', '%s')", $from_url, $to_url) ); - // remap enclosure urls - $result = $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, '%s', '%s') WHERE meta_key='enclosure'", $from_url, $to_url) ); - } - } - - // update the post_parent of orphans now that we know the local id's of all parents - function backfill_parents() { - global $wpdb; - - foreach ($this->orphans as $child_id => $parent_id) { - $local_child_id = $this->post_ids_processed[$child_id]; - $local_parent_id = $this->post_ids_processed[$parent_id]; - if ($local_child_id and $local_parent_id) { - $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_parent = %d WHERE ID = %d", $local_parent_id, $local_child_id)); - } - } - } - - function is_valid_meta_key($key) { - // skip attachment metadata since we'll regenerate it from scratch - if ( $key == '_wp_attached_file' || $key == '_wp_attachment_metadata' ) - return false; - return $key; - } - - // give the user the option of creating new users to represent authors in the import file? - function allow_create_users() { - return apply_filters('import_allow_create_users', true); - } - - // give the user the option of downloading and importing attached files - function allow_fetch_attachments() { - return apply_filters('import_allow_fetch_attachments', true); - } - - function max_attachment_size() { - // can be overridden with a filter - 0 means no limit - return apply_filters('import_attachment_size_limit', 0); - } - - function import_start() { - wp_defer_term_counting(true); - wp_defer_comment_counting(true); - do_action('import_start'); - } - - function import_end() { - do_action('import_end'); - - // clear the caches after backfilling - foreach ($this->post_ids_processed as $post_id) - clean_post_cache($post_id); - - wp_defer_term_counting(false); - wp_defer_comment_counting(false); - } - - function import($id, $fetch_attachments = false) { - $this->id = (int) $id; - $this->fetch_attachments = ($this->allow_fetch_attachments() && (bool) $fetch_attachments); - - add_filter('import_post_meta_key', array($this, 'is_valid_meta_key')); - $file = get_attached_file($this->id); - $this->import_file($file); - } - - function import_file($file) { - $this->file = $file; - - $this->import_start(); - $this->get_authors_from_post(); - wp_suspend_cache_invalidation(true); - $this->get_entries(); - $this->process_categories(); - $this->process_tags(); - $this->process_terms(); - $result = $this->process_posts(); - wp_suspend_cache_invalidation(false); - $this->backfill_parents(); - $this->backfill_attachment_urls(); - $this->import_end(); - - if ( is_wp_error( $result ) ) - return $result; - } - - function handle_upload() { - $file = wp_import_handle_upload(); - if ( isset($file['error']) ) { - echo '

    '.__('Sorry, there has been an error.').'

    '; - echo '

    ' . $file['error'] . '

    '; - return false; - } - $this->file = $file['file']; - $this->id = (int) $file['id']; - return true; - } - - function dispatch() { - if (empty ($_GET['step'])) - $step = 0; - else - $step = (int) $_GET['step']; - - $this->header(); - switch ($step) { - case 0 : - $this->greet(); - break; - case 1 : - check_admin_referer('import-upload'); - if ( $this->handle_upload() ) - $this->select_authors(); - break; - case 2: - check_admin_referer('import-wordpress'); - $result = $this->import( $_GET['id'], $_POST['attachments'] ); - if ( is_wp_error( $result ) ) - echo $result->get_error_message(); - break; - } - $this->footer(); - } - - function WP_Import() { - // Nothing. - } -} - -/** - * Register WordPress Importer - * - * @since unknown - * @var WP_Import - * @name $wp_import - */ -$wp_import = new WP_Import(); - -register_importer('wordpress', 'WordPress', __('Import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.'), array ($wp_import, 'dispatch')); - -?> diff --git a/wp-admin/import/wp-cat2tag.php b/wp-admin/import/wp-cat2tag.php deleted file mode 100644 index b4312b61..00000000 --- a/wp-admin/import/wp-cat2tag.php +++ /dev/null @@ -1,472 +0,0 @@ -'; - if ( ! current_user_can('manage_categories') ) { - echo '
    '; - echo '

    ' . __('Cheatin’ uh?') . '

    '; - echo '
    '; - } else { ?> -

    -

    -'; - } - - function populate_cats() { - - $categories = get_categories('get=all'); - foreach ( $categories as $category ) { - $this->all_categories[] = $category; - if ( is_term( $category->slug, 'post_tag' ) ) - $this->hybrids_ids[] = $category->term_id; - } - } - - function populate_tags() { - - $tags = get_terms( array('post_tag'), 'get=all' ); - foreach ( $tags as $tag ) { - $this->all_tags[] = $tag; - if ( is_term( $tag->slug, 'category' ) ) - $this->hybrids_ids[] = $tag->term_id; - } - } - - function categories_tab() { - $this->populate_cats(); - $cat_num = count($this->all_categories); - - echo '
    '; - - if ( $cat_num > 0 ) { - screen_icon(); - echo '

    ' . sprintf( _n( 'Convert Category to Tag.', 'Convert Categories (%d) to Tags.', $cat_num ), $cat_num ) . '

    '; - echo '
    '; - echo '

    ' . __('Hey there. Here you can selectively convert existing categories to tags. To get started, check the categories you wish to be converted, then click the Convert button.') . '

    '; - echo '

    ' . __('Keep in mind that if you convert a category with child categories, the children become top-level orphans.') . '

    '; - - $this->categories_form(); - } else { - echo '

    '.__('You have no categories to convert!').'

    '; - } - } - - function categories_form() { ?> - - - -
    -

    -

    -
      - -all_categories as $category) { - $category = sanitize_term( $category, 'category', 'display' ); - - if ( (int) $category->parent == 0 ) { ?> - -
    • term_id), $this->hybrids_ids ) ) - echo ' * '; - - if ( isset($hier[$category->term_id]) ) - $this->_category_children($category, $hier); ?>
    • - -
    - -hybrids_ids) ) - echo '

    ' . __('* This category is also a tag. Converting it will add that tag to all posts that are currently in the category.') . '

    '; ?> - -

    -
    - -populate_tags(); - $tags_num = count($this->all_tags); - - echo '
    '; - - if ( $tags_num > 0 ) { - screen_icon(); - echo '

    ' . sprintf( _n( 'Convert Tag to Category.', 'Convert Tags (%d) to Categories.', $tags_num ), $tags_num ) . '

    '; - echo '
    '; - echo '

    ' . __('Here you can selectively convert existing tags to categories. To get started, check the tags you wish to be converted, then click the Convert button.') . '

    '; - echo '

    ' . __('The newly created categories will still be associated with the same posts.') . '

    '; - - $this->tags_form(); - } else { - echo '

    '.__('You have no tags to convert!').'

    '; - } - } - - function tags_form() { ?> - - - -
    -

    -

    -
      - -all_tags as $tag ) { ?> -
    • term_id), $this->hybrids_ids ) ) echo ' * '; ?>
    • - - -
    - -hybrids_ids) ) - echo '

    ' . __('* This tag is also a category. When converted, all posts associated with the tag will also be in the category.') . '

    '; ?> - -

    -
    - - - -
      -term_id] as $child_id) { - $child =& get_category($child_id); ?> -
    • term_id), $this->hybrids_ids ) ) - echo ' * '; - - if ( isset($hier[$child->term_id]) ) - $this->_category_children($child, $hier); ?>
    • - -
    categories_to_convert)) { ?> -
    -

    try again.'), 'admin.php?import=wp-cat2tag'); ?>

    -
    -categories_to_convert) ) - $this->categories_to_convert = $_POST['cats_to_convert']; - - $hier = _get_term_hierarchy('category'); - $hybrid_cats = $clear_parents = $parents = false; - $clean_term_cache = $clean_cat_cache = array(); - $default_cat = get_option('default_category'); - - echo '
      '; - - foreach ( (array) $this->categories_to_convert as $cat_id) { - $cat_id = (int) $cat_id; - - if ( ! $this->_category_exists($cat_id) ) { - echo '
    • ' . sprintf( __('Category %s doesn’t exist!'), $cat_id ) . "
    • \n"; - } else { - $category =& get_category($cat_id); - echo '
    • ' . sprintf(__('Converting category %s ... '), $category->name); - - // If the category is the default, leave category in place and create tag. - if ( $default_cat == $category->term_id ) { - - if ( ! ($id = is_term( $category->slug, 'post_tag' ) ) ) - $id = wp_insert_term($category->name, 'post_tag', array('slug' => $category->slug)); - - $id = $id['term_taxonomy_id']; - $posts = get_objects_in_term($category->term_id, 'category'); - $term_order = 0; - - foreach ( $posts as $post ) { - $values[] = $wpdb->prepare( "(%d, %d, %d)", $post, $id, $term_order); - clean_post_cache($post); - } - - if ( $values ) { - $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)"); - - $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'post_tag'", $category->count, $category->term_id) ); - } - - echo __('Converted successfully.') . "
    • \n"; - continue; - } - - // if tag already exists, add it to all posts in the category - if ( $tag_ttid = $wpdb->get_var( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'", $category->term_id) ) ) { - $objects_ids = get_objects_in_term($category->term_id, 'category'); - $tag_ttid = (int) $tag_ttid; - $term_order = 0; - - foreach ( $objects_ids as $object_id ) - $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tag_ttid, $term_order); - - if ( $values ) { - $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)"); - - $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tag_ttid) ); - $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'post_tag'", $count, $category->term_id) ); - } - echo __('Tag added to all posts in this category.') . " *\n"; - - $hybrid_cats = true; - $clean_term_cache[] = $category->term_id; - $clean_cat_cache[] = $category->term_id; - - continue; - } - - $tt_ids = $wpdb->get_col( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'category'", $category->term_id) ); - if ( $tt_ids ) { - $posts = $wpdb->get_col("SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id IN (" . join(',', $tt_ids) . ") GROUP BY object_id"); - foreach ( (array) $posts as $post ) - clean_post_cache($post); - } - - // Change the category to a tag. - $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = %d AND taxonomy = 'category'", $category->term_id) ); - - // Set all parents to 0 (root-level) if their parent was the converted tag - $parents = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = %d AND taxonomy = 'category'", $category->term_id) ); - - if ( $parents ) $clear_parents = true; - $clean_cat_cache[] = $category->term_id; - echo __('Converted successfully.') . "\n"; - } - } - echo '
    '; - - if ( ! empty($clean_term_cache) ) { - $clean_term_cache = array_unique(array_values($clean_term_cache)); - clean_term_cache($clean_term_cache, 'post_tag'); - } - - if ( ! empty($clean_cat_cache) ) { - $clean_cat_cache = array_unique(array_values($clean_cat_cache)); - clean_term_cache($clean_cat_cache, 'category'); - } - - if ( $clear_parents ) delete_option('category_children'); - - if ( $hybrid_cats ) - echo '

    ' . sprintf( __('* This category is also a tag. The converter has added that tag to all posts currently in the category. If you want to remove it, please confirm that all tags were added successfully, then delete it from the Manage Categories page.'), 'categories.php') . '

    '; - echo '

    ' . sprintf( __('We’re all done here, but you can always convert more.'), 'admin.php?import=wp-cat2tag' ) . '

    '; - } - - function convert_tags() { - global $wpdb; - - if ( (!isset($_POST['tags_to_convert']) || !is_array($_POST['tags_to_convert'])) && empty($this->tags_to_convert)) { - echo '
    '; - echo '

    ' . sprintf(__('Uh, oh. Something didn’t work. Please try again.'), 'admin.php?import=wp-cat2tag&step=3') . '

    '; - echo '
    '; - return; - } - - if ( empty($this->tags_to_convert) ) - $this->tags_to_convert = $_POST['tags_to_convert']; - - $hybrid_tags = $clear_parents = false; - $clean_cat_cache = $clean_term_cache = array(); - $default_cat = get_option('default_category'); - echo '
      '; - - foreach ( (array) $this->tags_to_convert as $tag_id) { - $tag_id = (int) $tag_id; - - if ( $tag = get_term( $tag_id, 'post_tag' ) ) { - printf('
    • ' . __('Converting tag %s ... '), $tag->name); - - if ( $cat_ttid = $wpdb->get_var( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'category'", $tag->term_id) ) ) { - $objects_ids = get_objects_in_term($tag->term_id, 'post_tag'); - $cat_ttid = (int) $cat_ttid; - $term_order = 0; - - foreach ( $objects_ids as $object_id ) { - $values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $cat_ttid, $term_order); - clean_post_cache($object_id); - } - - if ( $values ) { - $wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)"); - - if ( $default_cat != $tag->term_id ) { - $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tag->term_id) ); - $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'category'", $count, $tag->term_id) ); - } - } - - $hybrid_tags = true; - $clean_term_cache[] = $tag->term_id; - $clean_cat_cache[] = $tag->term_id; - echo __('All posts were added to the category with the same name.') . " *
    • \n"; - - continue; - } - - // Change the tag to a category. - $parent = $wpdb->get_var( $wpdb->prepare("SELECT parent FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'", $tag->term_id) ); - if ( 0 == $parent || (0 < (int) $parent && $this->_category_exists($parent)) ) { - $reset_parent = ''; - $clear_parents = true; - } else - $reset_parent = ", parent = '0'"; - - $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET taxonomy = 'category' $reset_parent WHERE term_id = %d AND taxonomy = 'post_tag'", $tag->term_id) ); - - $clean_term_cache[] = $tag->term_id; - $clean_cat_cache[] = $cat['term_id']; - echo __('Converted successfully.') . "\n"; - - } else { - printf( '
    • ' . __('Tag #%s doesn’t exist!') . "
    • \n", $tag_id ); - } - } - - if ( ! empty($clean_term_cache) ) { - $clean_term_cache = array_unique(array_values($clean_term_cache)); - clean_term_cache($clean_term_cache, 'post_tag'); - } - - if ( ! empty($clean_cat_cache) ) { - $clean_cat_cache = array_unique(array_values($clean_cat_cache)); - clean_term_cache($clean_term_cache, 'category'); - } - - if ( $clear_parents ) delete_option('category_children'); - - echo '
    '; - if ( $hybrid_tags ) - echo '

    ' . sprintf( __('* This tag is also a category. The converter has added all posts from it to the category. If you want to remove it, please confirm that all posts were added successfully, then delete it from the Manage Tags page.'), 'edit-tags.php') . '

    '; - echo '

    ' . sprintf( __('We’re all done here, but you can always convert more.'), 'admin.php?import=wp-cat2tag&step=3' ) . '

    '; - } - - function init() { - - $step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1; - - $this->header(); - - if ( current_user_can('manage_categories') ) { - - switch ($step) { - case 1 : - $this->categories_tab(); - break; - - case 2 : - check_admin_referer('import-cat2tag'); - $this->convert_categories(); - break; - - case 3 : - $this->tags_tab(); - break; - - case 4 : - check_admin_referer('import-cat2tag'); - $this->convert_tags(); - break; - } - } - - $this->footer(); - } - - function WP_Categories_to_Tags() { - // Do nothing. - } -} - -$wp_cat2tag_importer = new WP_Categories_to_Tags(); - -register_importer('wp-cat2tag', __('Categories and Tags Converter'), __('Convert existing categories to tags or tags to categories, selectively.'), array(&$wp_cat2tag_importer, 'init')); - -?> diff --git a/wp-admin/includes/admin.php b/wp-admin/includes/admin.php index a75a1993..23c9ee2b 100644 --- a/wp-admin/includes/admin.php +++ b/wp-admin/includes/admin.php @@ -51,4 +51,13 @@ require_once(ABSPATH . 'wp-admin/includes/update.php'); /** WordPress Registration API */ require_once(ABSPATH . WPINC . '/registration.php'); -?> \ No newline at end of file +/** WordPress Deprecated Administration API */ +require_once(ABSPATH . 'wp-admin/includes/deprecated.php'); + +/** WordPress Multi-Site support API */ +if ( is_multisite() ) { + require_once(ABSPATH . 'wp-admin/includes/ms.php'); + require_once(ABSPATH . 'wp-admin/includes/ms-deprecated.php'); +} + +?> diff --git a/wp-admin/includes/bookmark.php b/wp-admin/includes/bookmark.php index 64621fdc..7dd8baf6 100644 --- a/wp-admin/includes/bookmark.php +++ b/wp-admin/includes/bookmark.php @@ -102,7 +102,7 @@ function wp_delete_link( $link_id ) { */ function wp_get_link_cats( $link_id = 0 ) { - $cats = wp_get_object_terms( $link_id, 'link_category', 'fields=ids' ); + $cats = wp_get_object_terms( $link_id, 'link_category', array('fields' => 'ids') ); return array_unique( $cats ); } @@ -186,19 +186,14 @@ function wp_insert_link( $linkdata, $wp_error = false ) { } if ( $update ) { - if ( false === $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->links SET link_url = %s, - link_name = %s, link_image = %s, link_target = %s, - link_visible = %s, link_description = %s, link_rating = %s, - link_rel = %s, link_notes = %s, link_rss = %s - WHERE link_id = %s", $link_url, $link_name, $link_image, $link_target, $link_visible, $link_description, $link_rating, $link_rel, $link_notes, $link_rss, $link_id ) ) ) { + if ( false === $wpdb->update( $wpdb->links, compact('link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_rating', 'link_rel', 'link_notes', 'link_rss'), compact('link_id') ) ) { if ( $wp_error ) return new WP_Error( 'db_update_error', __( 'Could not update link in the database' ), $wpdb->last_error ); else return 0; } } else { - if ( false === $wpdb->query( $wpdb->prepare( "INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", - $link_url,$link_name, $link_image, $link_target, $link_description, $link_visible, $link_owner, $link_rating, $link_rel, $link_notes, $link_rss ) ) ) { + if ( false === $wpdb->insert( $wpdb->links, compact('link_url', 'link_name', 'link_image', 'link_target', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_rel', 'link_notes', 'link_rss') ) ) { if ( $wp_error ) return new WP_Error( 'db_insert_error', __( 'Could not insert link into the database' ), $wpdb->last_error ); else @@ -251,7 +246,7 @@ function wp_set_link_cats( $link_id = 0, $link_categories = array() ) { function wp_update_link( $linkdata ) { $link_id = (int) $linkdata['link_id']; - $link = get_link( $link_id, ARRAY_A ); + $link = get_bookmark( $link_id, ARRAY_A ); // Escape data pulled from DB. $link = add_magic_quotes( $link ); diff --git a/wp-admin/includes/class-ftp.php b/wp-admin/includes/class-ftp.php index 80703a95..1e35e745 100644 --- a/wp-admin/includes/class-ftp.php +++ b/wp-admin/includes/class-ftp.php @@ -495,7 +495,7 @@ class ftp_base { $this->_features=array(); foreach($f as $k=>$v) { $v=explode(" ", trim($v)); - $this->_features[array_shift($v)]=$v;; + $this->_features[array_shift($v)]=$v; } return true; } diff --git a/wp-admin/includes/class-wp-filesystem-base.php b/wp-admin/includes/class-wp-filesystem-base.php index 6b0d0981..0aaadeba 100644 --- a/wp-admin/includes/class-wp-filesystem-base.php +++ b/wp-admin/includes/class-wp-filesystem-base.php @@ -13,7 +13,7 @@ */ class WP_Filesystem_Base { /** - * Whether to display debug data for the connection or not. + * Whether to display debug data for the connection. * * @since 2.5 * @access public @@ -142,6 +142,7 @@ class WP_Filesystem_Base { if ( defined($constant) && $folder === $dir ) return trailingslashit(constant($constant)); } elseif ( 'direct' == $this->method ) { + $folder = str_replace('\\', '/', $folder); //Windows path sanitiation return trailingslashit($folder); } @@ -156,7 +157,7 @@ class WP_Filesystem_Base { $this->cache[ $folder ] = $folder; return $folder; } - if( $return = $this->search_for_folder($folder) ) + if ( $return = $this->search_for_folder($folder) ) $this->cache[ $folder ] = $return; return $return; } @@ -288,8 +289,8 @@ class WP_Filesystem_Base { $legal = array('', 'w', 'r', 'x', '-'); $attarray = preg_split('//', $mode); - for($i=0; $i < count($attarray); $i++) - if($key = array_search($attarray[$i], $legal)) + for ($i=0; $i < count($attarray); $i++) + if ($key = array_search($attarray[$i], $legal)) $realmode .= $legal[$key]; $mode = str_pad($realmode, 9, '-'); diff --git a/wp-admin/includes/class-wp-filesystem-direct.php b/wp-admin/includes/class-wp-filesystem-direct.php index 88e4a902..538a683e 100644 --- a/wp-admin/includes/class-wp-filesystem-direct.php +++ b/wp-admin/includes/class-wp-filesystem-direct.php @@ -54,14 +54,13 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { /** * Write a string to a file * - * @param $file string Path to the file where to write the data. + * @param $file string Remote path to the file where to write the data. * @param $contents string The data to write. * @param $mode int (optional) The file permissions as octal number, usually 0644. - * @param $type string (optional) Specifies additional type of access you require to the file. * @return bool False upon failure. */ - function put_contents($file, $contents, $mode = false, $type = '') { - if ( ! ($fp = @fopen($file, 'w' . $type)) ) + function put_contents($file, $contents, $mode = false ) { + if ( ! ($fp = @fopen($file, 'w')) ) return false; @fwrite($fp, $contents); @fclose($fp); @@ -117,9 +116,6 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { * @return bool Returns true on success or false on failure. */ function chmod($file, $mode = false, $recursive = false) { - if ( ! $this->exists($file) ) - return false; - if ( ! $mode ) { if ( $this->is_file($file) ) $mode = FS_CHMOD_FILE; @@ -129,14 +125,12 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { return false; } - if ( ! $recursive ) - return @chmod($file, $mode); - if ( ! $this->is_dir($file) ) + if ( ! $recursive || ! $this->is_dir($file) ) return @chmod($file, $mode); //Is a directory, and we want recursive $file = trailingslashit($file); $filelist = $this->dirlist($file); - foreach ($filelist as $filename) + foreach ( (array)$filelist as $filename => $filemeta) $this->chmod($file . $filename, $mode, $recursive); return true; @@ -202,11 +196,18 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { function copy($source, $destination, $overwrite = false) { if ( ! $overwrite && $this->exists($destination) ) return false; + return copy($source, $destination); } function move($source, $destination, $overwrite = false) { - //Possible to use rename()? + if ( ! $overwrite && $this->exists($destination) ) + return false; + + // try using rename first. if that fails (for example, source is read only) try copy + if ( @rename($source, $destination) ) + return true; + if ( $this->copy($source, $destination, $overwrite) && $this->exists($destination) ) { $this->delete($source); return true; @@ -280,6 +281,11 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { } function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { + // safe mode fails with a trailing slash under certain PHP versions. + $path = untrailingslashit($path); + if ( empty($path) ) + $path = '/'; + if ( ! $chmod ) $chmod = FS_CHMOD_DIR; @@ -294,17 +300,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { } function rmdir($path, $recursive = false) { - //Currently unused and untested, Use delete() instead. - if ( ! $recursive ) - return @rmdir($path); - //recursive: - $filelist = $this->dirlist($path); - foreach ($filelist as $filename => $det) { - if ( '/' == substr($filename, -1, 1) ) - $this->rmdir($path . '/' . $filename, $recursive); - @rmdir($filename); - } - return @rmdir($path); + return $this->delete($path, $recursive); } function dirlist($path, $include_hidden = true, $recursive = false) { diff --git a/wp-admin/includes/class-wp-filesystem-ftpext.php b/wp-admin/includes/class-wp-filesystem-ftpext.php index b8d5c9ae..df4ce0ad 100644 --- a/wp-admin/includes/class-wp-filesystem-ftpext.php +++ b/wp-admin/includes/class-wp-filesystem-ftpext.php @@ -45,7 +45,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { else $this->options['hostname'] = $opt['hostname']; - if ( isset($opt['base']) && ! empty($opt['base']) ) + if ( ! empty($opt['base']) ) $this->wp_base = $opt['base']; // Check if the options provided are OK. @@ -92,7 +92,9 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { if ( empty($type) ) $type = FTP_BINARY; - $temp = tmpfile(); + $tempfile = wp_tempnam($file); + $temp = fopen($tempfile, 'w+'); + if ( ! $temp ) return false; @@ -106,25 +108,30 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { $contents .= fread($temp, 8192); fclose($temp); + unlink($tempfile); return $contents; } function get_contents_array($file) { return explode("\n", $this->get_contents($file)); } - function put_contents($file, $contents, $type = '' ) { - if ( empty($type) ) - $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII; - $temp = tmpfile(); + function put_contents($file, $contents, $mode = false ) { + $tempfile = wp_tempnam($file); + $temp = fopen($tempfile, 'w+'); if ( ! $temp ) return false; fwrite($temp, $contents); fseek($temp, 0); //Skip back to the start of the file being written to + $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII; $ret = @ftp_fput($this->link, $file, $temp, $type); fclose($temp); + unlink($tempfile); + + $this->chmod($file, $mode); + return $ret; } function cwd() { @@ -140,9 +147,6 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { return false; } function chmod($file, $mode = false, $recursive = false) { - if ( ! $this->exists($file) && ! $this->is_dir($file) ) - return false; - if ( ! $mode ) { if ( $this->is_file($file) ) $mode = FS_CHMOD_FILE; @@ -152,17 +156,17 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { return false; } - if ( ! $recursive || ! $this->is_dir($file) ) { - if ( ! function_exists('ftp_chmod') ) - return @ftp_site($this->link, sprintf('CHMOD %o %s', $mode, $file)); - return @ftp_chmod($this->link, $mode, $file); - } - //Is a directory, and we want recursive - $filelist = $this->dirlist($file); - foreach ( $filelist as $filename ) { - $this->chmod($file . '/' . $filename, $mode, $recursive); + // chmod any sub-objects if recursive. + if ( $recursive && $this->is_dir($file) ) { + $filelist = $this->dirlist($file); + foreach ( (array)$filelist as $filename => $filemeta ) + $this->chmod($file . '/' . $filename, $mode, $recursive); } - return true; + + // chmod the file or directory + if ( ! function_exists('ftp_chmod') ) + return (bool)@ftp_site($this->link, sprintf('CHMOD %o %s', $mode, $file)); + return (bool)@ftp_chmod($this->link, $mode, $file); } function chown($file, $owner, $recursive = false ) { return false; @@ -243,10 +247,8 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { return false; } function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { - if ( !ftp_mkdir($this->link, $path) ) + if ( !@ftp_mkdir($this->link, $path) ) return false; - if ( ! $chmod ) - $chmod = FS_CHMOD_DIR; $this->chmod($path, $chmod); if ( $chown ) $this->chown($path, $chown); @@ -261,12 +263,15 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { function parselisting($line) { static $is_windows; if ( is_null($is_windows) ) - $is_windows = strpos( strtolower(ftp_systype($this->link)), 'win') !== false; + $is_windows = stripos( ftp_systype($this->link), 'win') !== false; - if ( $is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|) +(.+)/", $line, $lucifer) ) { + if ( $is_windows && preg_match('/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|) +(.+)/', $line, $lucifer) ) { $b = array(); - if ( $lucifer[3] < 70 ) { $lucifer[3] +=2000; } else { $lucifer[3] += 1900; } // 4digit year fix - $b['isdir'] = ($lucifer[7]==""); + if ( $lucifer[3] < 70 ) + $lucifer[3] +=2000; + else + $lucifer[3] += 1900; // 4digit year fix + $b['isdir'] = ( $lucifer[7] == ''); if ( $b['isdir'] ) $b['type'] = 'd'; else @@ -277,16 +282,17 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { $b['year'] = $lucifer[3]; $b['hour'] = $lucifer[4]; $b['minute'] = $lucifer[5]; - $b['time'] = @mktime($lucifer[4]+(strcasecmp($lucifer[6],"PM")==0?12:0),$lucifer[5],0,$lucifer[1],$lucifer[2],$lucifer[3]); + $b['time'] = @mktime($lucifer[4] + (strcasecmp($lucifer[6], "PM") == 0 ? 12 : 0), $lucifer[5], 0, $lucifer[1], $lucifer[2], $lucifer[3]); $b['am/pm'] = $lucifer[6]; $b['name'] = $lucifer[8]; - } else if (!$is_windows && $lucifer=preg_split("/[ ]/",$line,9,PREG_SPLIT_NO_EMPTY)) { + } elseif ( !$is_windows && $lucifer = preg_split('/[ ]/', $line, 9, PREG_SPLIT_NO_EMPTY)) { //echo $line."\n"; - $lcount=count($lucifer); - if ($lcount<8) return ''; + $lcount = count($lucifer); + if ( $lcount < 8 ) + return ''; $b = array(); - $b['isdir'] = $lucifer[0]{0} === "d"; - $b['islink'] = $lucifer[0]{0} === "l"; + $b['isdir'] = $lucifer[0]{0} === 'd'; + $b['islink'] = $lucifer[0]{0} === 'l'; if ( $b['isdir'] ) $b['type'] = 'd'; elseif ( $b['islink'] ) @@ -298,15 +304,15 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { $b['owner'] = $lucifer[2]; $b['group'] = $lucifer[3]; $b['size'] = $lucifer[4]; - if ($lcount==8) { - sscanf($lucifer[5],"%d-%d-%d",$b['year'],$b['month'],$b['day']); - sscanf($lucifer[6],"%d:%d",$b['hour'],$b['minute']); - $b['time'] = @mktime($b['hour'],$b['minute'],0,$b['month'],$b['day'],$b['year']); + if ( $lcount == 8 ) { + sscanf($lucifer[5], '%d-%d-%d', $b['year'], $b['month'], $b['day']); + sscanf($lucifer[6], '%d:%d', $b['hour'], $b['minute']); + $b['time'] = @mktime($b['hour'], $b['minute'], 0, $b['month'], $b['day'], $b['year']); $b['name'] = $lucifer[7]; } else { $b['month'] = $lucifer[5]; $b['day'] = $lucifer[6]; - if (preg_match("/([0-9]{2}):([0-9]{2})/",$lucifer[7],$l2)) { + if ( preg_match('/([0-9]{2}):([0-9]{2})/', $lucifer[7], $l2) ) { $b['year'] = date("Y"); $b['hour'] = $l2[1]; $b['minute'] = $l2[2]; @@ -315,7 +321,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { $b['hour'] = 0; $b['minute'] = 0; } - $b['time'] = strtotime(sprintf("%d %s %d %02d:%02d",$b['day'],$b['month'],$b['year'],$b['hour'],$b['minute'])); + $b['time'] = strtotime( sprintf('%d %s %d %02d:%02d', $b['day'], $b['month'], $b['year'], $b['hour'], $b['minute']) ); $b['name'] = $lucifer[8]; } } @@ -331,9 +337,13 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { $limit_file = false; } - $list = @ftp_rawlist($this->link, '-a ' . $path, false); + $pwd = @ftp_pwd($this->link); + if ( ! @ftp_chdir($this->link, $path) ) // Cant change to folder = folder doesnt exist + return false; + $list = @ftp_rawlist($this->link, '-a', false); + @ftp_chdir($this->link, $pwd); - if ( $list === false ) + if ( empty($list) ) // Empty array = non-existent folder (real folder will show . at least) return false; $dirlist = array(); @@ -354,9 +364,6 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base { $dirlist[ $entry['name'] ] = $entry; } - if ( ! $dirlist ) - return false; - $ret = array(); foreach ( (array)$dirlist as $struc ) { if ( 'd' == $struc['type'] ) { diff --git a/wp-admin/includes/class-wp-filesystem-ftpsockets.php b/wp-admin/includes/class-wp-filesystem-ftpsockets.php index a72abaa7..efd19d1f 100644 --- a/wp-admin/includes/class-wp-filesystem-ftpsockets.php +++ b/wp-admin/includes/class-wp-filesystem-ftpsockets.php @@ -39,7 +39,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { else $this->options['hostname'] = $opt['hostname']; - if ( isset($opt['base']) && ! empty($opt['base']) ) + if ( ! empty($opt['base']) ) $this->wp_base = $opt['base']; // Check if the options provided are OK. @@ -115,14 +115,9 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { return explode("\n", $this->get_contents($file) ); } - function put_contents($file, $contents, $type = '' ) { - if ( empty($type) ) - $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII; - - $this->ftp->SetType($type); - + function put_contents($file, $contents, $mode = false ) { $temp = wp_tempnam( $file ); - if ( ! $temphandle = fopen($temp, 'w+') ) { + if ( ! $temphandle = @fopen($temp, 'w+') ) { unlink($temp); return false; } @@ -130,10 +125,16 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { fwrite($temphandle, $contents); fseek($temphandle, 0); //Skip back to the start of the file being written to + $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII; + $this->ftp->SetType($type); + $ret = $this->ftp->fput($file, $temphandle); fclose($temphandle); unlink($temp); + + $this->chmod($file, $mode); + return $ret; } @@ -153,7 +154,6 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { } function chmod($file, $mode = false, $recursive = false ) { - if ( ! $mode ) { if ( $this->is_file($file) ) $mode = FS_CHMOD_FILE; @@ -163,16 +163,15 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { return false; } - if ( ! $recursive || ! $this->is_dir($file) ) { - return $this->ftp->chmod($file, $mode); + // chmod any sub-objects if recursive. + if ( $recursive && $this->is_dir($file) ) { + $filelist = $this->dirlist($file); + foreach ( (array)$filelist as $filename => $filemeta ) + $this->chmod($file . '/' . $filename, $mode, $recursive); } - //Is a directory, and we want recursive - $filelist = $this->dirlist($file); - foreach ( $filelist as $filename ) - $this->chmod($file . '/' . $filename, $mode, $recursive); - - return true; + // chmod the file or directory + return $this->ftp->chmod($file, $mode); } function chown($file, $owner, $recursive = false ) { @@ -225,7 +224,11 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { } function is_file($file) { - return $this->is_dir($file) ? false : true; + if ( $this->is_dir($file) ) + return false; + if ( $this->exists($file) ) + return true; + return false; } function is_dir($path) { @@ -277,10 +280,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { } function rmdir($path, $recursive = false ) { - if ( ! $recursive ) - return $this->ftp->rmdir($path); - - return $this->ftp->mdel($path); + $this->delete($path, $recursive); } function dirlist($path = '.', $include_hidden = true, $recursive = false ) { @@ -292,7 +292,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { } $list = $this->ftp->dirlist($path); - if ( ! $list ) + if ( empty($list) && !$this->exists($path) ) return false; $ret = array(); diff --git a/wp-admin/includes/class-wp-filesystem-ssh2.php b/wp-admin/includes/class-wp-filesystem-ssh2.php index 0337658c..f5a64021 100644 --- a/wp-admin/includes/class-wp-filesystem-ssh2.php +++ b/wp-admin/includes/class-wp-filesystem-ssh2.php @@ -73,7 +73,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { else $this->options['hostname'] = $opt['hostname']; - if ( isset($opt['base']) && ! empty($opt['base']) ) + if ( ! empty($opt['base']) ) $this->wp_base = $opt['base']; // Check if the options provided are OK. @@ -160,14 +160,18 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { return file('ssh2.sftp://' . $this->sftp_link . '/' . $file); } - function put_contents($file, $contents, $type = '' ) { + function put_contents($file, $contents, $mode = false ) { $file = ltrim($file, '/'); - return false !== file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents); + $ret = file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents); + + $this->chmod($file, $mode); + + return false !== $ret; } function cwd() { $cwd = $this->run_command('pwd'); - if( $cwd ) + if ( $cwd ) $cwd = trailingslashit($cwd); return $cwd; } @@ -235,10 +239,10 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { } function copy($source, $destination, $overwrite = false ) { - if( ! $overwrite && $this->exists($destination) ) + if ( ! $overwrite && $this->exists($destination) ) return false; $content = $this->get_contents($source); - if( false === $content) + if ( false === $content) return false; return $this->put_contents($destination, $content); } diff --git a/wp-admin/includes/class-wp-importer.php b/wp-admin/includes/class-wp-importer.php new file mode 100644 index 00000000..5a7f0e47 --- /dev/null +++ b/wp-admin/includes/class-wp-importer.php @@ -0,0 +1,310 @@ +__construct(); + } + + /** + * Returns array with imported permalinks from WordPress database + * + * @param string $bid + * @return array + */ + function get_imported_posts( $importer_name, $bid ) { + global $wpdb; + + $hashtable = array(); + + $limit = 100; + $offset = 0; + + // Grab all posts in chunks + do { + $meta_key = $importer_name . '_' . $bid . '_permalink'; + $sql = $wpdb->prepare( "SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = '%s' LIMIT %d,%d", $meta_key, $offset, $limit ); + $results = $wpdb->get_results( $sql ); + + // Increment offset + $offset = ( $limit + $offset ); + + if ( !empty( $results ) ) { + foreach ( $results as $r ) { + // Set permalinks into array + $hashtable[$r->meta_value] = intval( $r->post_id ); + } + } + } while ( count( $results ) == $limit ); + + // unset to save memory + unset( $results, $r ); + + return $hashtable; + } + + /** + * Return count of imported permalinks from WordPress database + * + * @param string $bid + * @return int + */ + function count_imported_posts( $importer_name, $bid ) { + global $wpdb; + + $count = 0; + + // Get count of permalinks + $meta_key = $importer_name . '_' . $bid . '_permalink'; + $sql = $wpdb->prepare( "SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_key = '%s'", $meta_key ); + + $result = $wpdb->get_results( $sql ); + + if ( !empty( $result ) ) + $count = intval( $result[0]->cnt ); + + // unset to save memory + unset( $results ); + + return $count; + } + + /** + * Set array with imported comments from WordPress database + * + * @param string $bid + * @return array + */ + function get_imported_comments( $bid ) { + global $wpdb; + + $hashtable = array(); + + $limit = 100; + $offset = 0; + + // Grab all comments in chunks + do { + $sql = $wpdb->prepare( "SELECT comment_ID, comment_agent FROM $wpdb->comments LIMIT %d,%d", $offset, $limit ); + $results = $wpdb->get_results( $sql ); + + // Increment offset + $offset = ( $limit + $offset ); + + if ( !empty( $results ) ) { + foreach ( $results as $r ) { + // Explode comment_agent key + list ( $ca_bid, $source_comment_id ) = explode( '-', $r->comment_agent ); + $source_comment_id = intval( $source_comment_id ); + + // Check if this comment came from this blog + if ( $bid == $ca_bid ) { + $hashtable[$source_comment_id] = intval( $r->comment_ID ); + } + } + } + } while ( count( $results ) == $limit ); + + // unset to save memory + unset( $results, $r ); + + return $hashtable; + } + + function set_blog( $blog_id ) { + if ( is_numeric( $blog_id ) ) { + $blog_id = (int) $blog_id; + } else { + $blog = 'http://' . preg_replace( '#^https?://#', '', $blog_id ); + if ( ( !$parsed = parse_url( $blog ) ) || empty( $parsed['host'] ) ) { + fwrite( STDERR, "Error: can not determine blog_id from $blog_id\n" ); + exit(); + } + if ( empty( $parsed['path'] ) ) + $parsed['path'] = '/'; + if ( !$blog = get_blog_info( $parsed['host'], $parsed['path'] ) ) { + fwrite( STDERR, "Error: Could not find blog\n" ); + exit(); + } + $blog_id = (int) $blog->blog_id; + // Restore global $current_blog + global $current_blog; + $current_blog = $blog; + } + + if ( function_exists( 'is_multisite' ) ) { + if ( is_multisite() ) + switch_to_blog( $blog_id ); + } + + return $blog_id; + } + + function set_user( $user_id ) { + if ( is_numeric( $user_id ) ) { + $user_id = (int) $user_id; + } else { + $user_id = (int) username_exists( $user_id ); + } + + if ( !$user_id || !wp_set_current_user( $user_id ) ) { + fwrite( STDERR, "Error: can not find user\n" ); + exit(); + } + + return $user_id; + } + + /** + * Sort by strlen, longest string first + * + * @param string $a + * @param string $b + * @return int + */ + function cmpr_strlen( $a, $b ) { + return strlen( $b ) - strlen( $a ); + } + + /** + * GET URL + * + * @param string $url + * @param string $username + * @param string $password + * @param bool $head + * @return array + */ + function get_page( $url, $username = '', $password = '', $head = false ) { + // Increase the timeout + add_filter( 'http_request_timeout', array( &$this, 'bump_request_timeout' ) ); + + $headers = array(); + $args = array(); + if ( true === $head ) + $args['method'] = 'HEAD'; + if ( !empty( $username ) && !empty( $password ) ) + $headers['Authorization'] = 'Basic ' . base64_encode( "$username:$password" ); + + $args['headers'] = $headers; + + return wp_remote_request( $url, $args ); + } + + /** + * Bump up the request timeout for http requests + * + * @param int $val + * @return int + */ + function bump_request_timeout( $val ) { + return 60; + } + + /** + * Check if user has exceeded disk quota + * + * @return bool + */ + function is_user_over_quota() { + global $current_user, $current_blog; + + if ( function_exists( 'upload_is_user_over_quota' ) ) { + if ( upload_is_user_over_quota( 1 ) ) { + echo "Sorry, you have used your upload quota.\n"; + return true; + } + } + + return false; + } + + /** + * Replace newlines, tabs, and multiple spaces with a single space + * + * @param string $string + * @return string + */ + function min_whitespace( $string ) { + return preg_replace( '|[\r\n\t ]+|', ' ', $string ); + } + + /** + * Reset global variables that grow out of control during imports + * + * @return void + */ + function stop_the_insanity() { + global $wpdb, $wp_actions; + // Or define( 'WP_IMPORTING', true ); + $wpdb->queries = array(); + // Reset $wp_actions to keep it from growing out of control + $wp_actions = array(); + } +} + +/** + * Returns value of command line params. + * Exits when a required param is not set. + * + * @param string $param + * @param bool $required + * @return mixed + */ +function get_cli_args( $param, $required = false ) { + $args = $_SERVER['argv']; + + $out = array(); + + $last_arg = null; + $return = null; + + $il = sizeof( $args ); + + for ( $i = 1, $il; $i < $il; $i++ ) { + if ( (bool) preg_match( "/^--(.+)/", $args[$i], $match ) ) { + $parts = explode( "=", $match[1] ); + $key = preg_replace( "/[^a-z0-9]+/", "", $parts[0] ); + + if ( isset( $parts[1] ) ) { + $out[$key] = $parts[1]; + } else { + $out[$key] = true; + } + + $last_arg = $key; + } else if ( (bool) preg_match( "/^-([a-zA-Z0-9]+)/", $args[$i], $match ) ) { + for ( $j = 0, $jl = strlen( $match[1] ); $j < $jl; $j++ ) { + $key = $match[1]{$j}; + $out[$key] = true; + } + + $last_arg = $key; + } else if ( $last_arg !== null ) { + $out[$last_arg] = $args[$i]; + } + } + + // Check array for specified param + if ( isset( $out[$param] ) ) { + // Set return value + $return = $out[$param]; + } + + // Check for missing required param + if ( !isset( $out[$param] ) && $required ) { + // Display message and exit + echo "\"$param\" parameter is required but was not specified\n"; + exit(); + } + + return $return; +} diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 2be38f75..0c8577e8 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -43,21 +43,22 @@ class WP_Upgrader { function generic_strings() { $this->strings['bad_request'] = __('Invalid Data provided.'); $this->strings['fs_unavailable'] = __('Could not access filesystem.'); - $this->strings['fs_error'] = __('Filesystem error'); + $this->strings['fs_error'] = __('Filesystem error.'); $this->strings['fs_no_root_dir'] = __('Unable to locate WordPress Root directory.'); $this->strings['fs_no_content_dir'] = __('Unable to locate WordPress Content directory (wp-content).'); $this->strings['fs_no_plugins_dir'] = __('Unable to locate WordPress Plugin directory.'); $this->strings['fs_no_themes_dir'] = __('Unable to locate WordPress Theme directory.'); + /* translators: %s: directory name */ $this->strings['fs_no_folder'] = __('Unable to locate needed folder (%s).'); $this->strings['download_failed'] = __('Download failed.'); - $this->strings['installing_package'] = __('Installing the latest version.'); + $this->strings['installing_package'] = __('Installing the latest version…'); $this->strings['folder_exists'] = __('Destination folder already exists.'); $this->strings['mkdir_failed'] = __('Could not create directory.'); - $this->strings['bad_package'] = __('Incompatible Archive'); + $this->strings['bad_package'] = __('Incompatible Archive.'); - $this->strings['maintenance_start'] = __('Enabling Maintenance mode.'); - $this->strings['maintenance_end'] = __('Disabling Maintenance mode.'); + $this->strings['maintenance_start'] = __('Enabling Maintenance mode…'); + $this->strings['maintenance_end'] = __('Disabling Maintenance mode…'); } function fs_connect( $directories = array() ) { @@ -297,6 +298,7 @@ class WP_Upgrader { $download = $this->download_package( $package ); if ( is_wp_error($download) ) { $this->skin->error($download); + $this->skin->after(); return $download; } @@ -304,6 +306,7 @@ class WP_Upgrader { $working_dir = $this->unpack_package( $download ); if ( is_wp_error($working_dir) ) { $this->skin->error($working_dir); + $this->skin->after(); return $working_dir; } @@ -366,22 +369,22 @@ class Plugin_Upgrader extends WP_Upgrader { function upgrade_strings() { $this->strings['up_to_date'] = __('The plugin is at the latest version.'); $this->strings['no_package'] = __('Upgrade package not available.'); - $this->strings['downloading_package'] = __('Downloading update from %s.'); - $this->strings['unpack_package'] = __('Unpacking the update.'); - $this->strings['deactivate_plugin'] = __('Deactivating the plugin.'); - $this->strings['remove_old'] = __('Removing the old version of the plugin.'); + $this->strings['downloading_package'] = __('Downloading update from %s…'); + $this->strings['unpack_package'] = __('Unpacking the update…'); + $this->strings['deactivate_plugin'] = __('Deactivating the plugin…'); + $this->strings['remove_old'] = __('Removing the old version of the plugin…'); $this->strings['remove_old_failed'] = __('Could not remove the old plugin.'); - $this->strings['process_failed'] = __('Plugin upgrade Failed.'); + $this->strings['process_failed'] = __('Plugin upgrade failed.'); $this->strings['process_success'] = __('Plugin upgraded successfully.'); } function install_strings() { $this->strings['no_package'] = __('Install package not available.'); - $this->strings['downloading_package'] = __('Downloading install package from %s.'); - $this->strings['unpack_package'] = __('Unpacking the package.'); - $this->strings['installing_package'] = __('Installing the plugin.'); - $this->strings['process_failed'] = __('Plugin Install Failed.'); - $this->strings['process_success'] = __('Plugin Installed successfully.'); + $this->strings['downloading_package'] = __('Downloading install package from %s…'); + $this->strings['unpack_package'] = __('Unpacking the package…'); + $this->strings['installing_package'] = __('Installing the plugin…'); + $this->strings['process_failed'] = __('Plugin install failed.'); + $this->strings['process_success'] = __('Plugin installed successfully.'); } function install($package) { @@ -398,7 +401,7 @@ class Plugin_Upgrader extends WP_Upgrader { )); // Force refresh of plugin update information - delete_transient('update_plugins'); + delete_site_transient('update_plugins'); } @@ -407,8 +410,9 @@ class Plugin_Upgrader extends WP_Upgrader { $this->init(); $this->upgrade_strings(); - $current = get_transient( 'update_plugins' ); + $current = get_site_transient( 'update_plugins' ); if ( !isset( $current->response[ $plugin ] ) ) { + $this->skin->before(); $this->skin->set_result(false); $this->skin->error('up_to_date'); $this->skin->after(); @@ -440,7 +444,7 @@ class Plugin_Upgrader extends WP_Upgrader { return $this->result; // Force refresh of plugin update information - delete_transient('update_plugins'); + delete_site_transient('update_plugins'); } function bulk_upgrade($plugins) { @@ -449,7 +453,7 @@ class Plugin_Upgrader extends WP_Upgrader { $this->bulk = true; $this->upgrade_strings(); - $current = get_transient( 'update_plugins' ); + $current = get_site_transient( 'update_plugins' ); add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4); @@ -462,17 +466,21 @@ class Plugin_Upgrader extends WP_Upgrader { return false; } + $this->skin->bulk_header(); + $this->maintenance_mode(true); - $all = count($plugins); - $i = 1; - foreach ( $plugins as $plugin ) { + $results = array(); - $this->show_before = sprintf( '

    ' . __('Updating plugin %1$d of %2$d...') . '

    ', $i, $all ); - $i++; + $this->update_count = count($plugins); + $this->update_current = 0; + foreach ( $plugins as $plugin ) { + $this->update_current++; + $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true); if ( !isset( $current->response[ $plugin ] ) ) { $this->skin->set_result(false); + $this->skin->before(); $this->skin->error('up_to_date'); $this->skin->after(); $results[$plugin] = false; @@ -500,15 +508,19 @@ class Plugin_Upgrader extends WP_Upgrader { // Prevent credentials auth screen from displaying multiple times if ( false === $result ) break; - } + } //end foreach $plugins + $this->maintenance_mode(false); + + $this->skin->bulk_footer(); + $this->skin->footer(); // Cleanup our hooks, incase something else does a upgrade on this connection. remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin')); // Force refresh of plugin update information - delete_transient('update_plugins'); + delete_site_transient('update_plugins'); return $results; } @@ -592,21 +604,21 @@ class Theme_Upgrader extends WP_Upgrader { function upgrade_strings() { $this->strings['up_to_date'] = __('The theme is at the latest version.'); $this->strings['no_package'] = __('Upgrade package not available.'); - $this->strings['downloading_package'] = __('Downloading update from %s.'); - $this->strings['unpack_package'] = __('Unpacking the update.'); - $this->strings['remove_old'] = __('Removing the old version of the theme.'); + $this->strings['downloading_package'] = __('Downloading update from %s…'); + $this->strings['unpack_package'] = __('Unpacking the update…'); + $this->strings['remove_old'] = __('Removing the old version of the theme…'); $this->strings['remove_old_failed'] = __('Could not remove the old theme.'); - $this->strings['process_failed'] = __('Theme upgrade Failed.'); + $this->strings['process_failed'] = __('Theme upgrade failed.'); $this->strings['process_success'] = __('Theme upgraded successfully.'); } function install_strings() { $this->strings['no_package'] = __('Install package not available.'); - $this->strings['downloading_package'] = __('Downloading install package from %s.'); - $this->strings['unpack_package'] = __('Unpacking the package.'); - $this->strings['installing_package'] = __('Installing the theme.'); - $this->strings['process_failed'] = __('Theme Install Failed.'); - $this->strings['process_success'] = __('Theme Installed successfully.'); + $this->strings['downloading_package'] = __('Downloading install package from %s…'); + $this->strings['unpack_package'] = __('Unpacking the package…'); + $this->strings['installing_package'] = __('Installing the theme…'); + $this->strings['process_failed'] = __('Theme install failed.'); + $this->strings['process_success'] = __('Theme installed successfully.'); } function install($package) { @@ -627,7 +639,7 @@ class Theme_Upgrader extends WP_Upgrader { return $this->result; // Force refresh of theme update information - delete_transient('update_themes'); + delete_site_transient('update_themes'); if ( empty($result['destination_name']) ) return false; @@ -641,8 +653,9 @@ class Theme_Upgrader extends WP_Upgrader { $this->upgrade_strings(); // Is an update available? - $current = get_transient( 'update_themes' ); + $current = get_site_transient( 'update_themes' ); if ( !isset( $current->response[ $theme ] ) ) { + $this->skin->before(); $this->skin->set_result(false); $this->skin->error('up_to_date'); $this->skin->after(); @@ -671,11 +684,93 @@ class Theme_Upgrader extends WP_Upgrader { return $this->result; // Force refresh of theme update information - delete_transient('update_themes'); + delete_site_transient('update_themes'); return true; } + function bulk_upgrade($themes) { + + $this->init(); + $this->bulk = true; + $this->upgrade_strings(); + + $current = get_site_transient( 'update_themes' ); + + add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2); + add_filter('upgrader_post_install', array(&$this, 'current_after'), 10, 2); + add_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4); + + $this->skin->header(); + + // Connect to the Filesystem first. + $res = $this->fs_connect( array(WP_CONTENT_DIR) ); + if ( ! $res ) { + $this->skin->footer(); + return false; + } + + $this->skin->bulk_header(); + + $this->maintenance_mode(true); + + $results = array(); + + $this->update_count = count($themes); + $this->update_current = 0; + foreach ( $themes as $theme ) { + $this->update_current++; + + if ( !isset( $current->response[ $theme ] ) ) { + $this->skin->set_result(false); + $this->skin->before(); + $this->skin->error('up_to_date'); + $this->skin->after(); + $results[$theme] = false; + continue; + } + + $this->skin->theme_info = $this->theme_info($theme); + + // Get the URL to the zip file + $r = $current->response[ $theme ]; + + $options = array( + 'package' => $r['package'], + 'destination' => WP_CONTENT_DIR . '/themes', + 'clear_destination' => true, + 'clear_working' => true, + 'hook_extra' => array( + 'theme' => $theme + ) + ); + + $result = $this->run($options); + + $results[$theme] = $this->result; + + // Prevent credentials auth screen from displaying multiple times + if ( false === $result ) + break; + } //end foreach $plugins + + $this->maintenance_mode(false); + + $this->skin->bulk_footer(); + + $this->skin->footer(); + + // Cleanup our hooks, incase something else does a upgrade on this connection. + remove_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2); + remove_filter('upgrader_post_install', array(&$this, 'current_after'), 10, 2); + remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4); + + // Force refresh of theme update information + delete_site_transient('update_themes'); + + return $results; + } + function current_before($return, $theme) { if ( is_wp_error($return) ) @@ -686,7 +781,8 @@ class Theme_Upgrader extends WP_Upgrader { if ( $theme != get_stylesheet() ) //If not current return $return; //Change to maintainence mode now. - $this->maintenance_mode(true); + if ( ! $this->bulk ) + $this->maintenance_mode(true); return $return; } @@ -708,7 +804,8 @@ class Theme_Upgrader extends WP_Upgrader { } //Time to remove maintainence mode - $this->maintenance_mode(false); + if ( ! $this->bulk ) + $this->maintenance_mode(false); return $return; } @@ -727,10 +824,15 @@ class Theme_Upgrader extends WP_Upgrader { return true; } - function theme_info() { - if ( empty($this->result['destination_name']) ) - return false; - return get_theme_data(WP_CONTENT_DIR . '/themes/' . $this->result['destination_name'] . '/style.css'); + function theme_info($theme = null) { + + if ( empty($theme) ) { + if ( !empty($this->result['destination_name']) ) + $theme = $this->result['destination_name']; + else + return false; + } + return get_theme_data(WP_CONTENT_DIR . '/themes/' . $theme . '/style.css'); } } @@ -749,8 +851,8 @@ class Core_Upgrader extends WP_Upgrader { function upgrade_strings() { $this->strings['up_to_date'] = __('WordPress is at the latest version.'); $this->strings['no_package'] = __('Upgrade package not available.'); - $this->strings['downloading_package'] = __('Downloading update from %s.'); - $this->strings['unpack_package'] = __('Unpacking the update.'); + $this->strings['downloading_package'] = __('Downloading update from %s…'); + $this->strings['unpack_package'] = __('Unpacking the update…'); $this->strings['copy_failed'] = __('Could not copy files.'); } @@ -808,6 +910,7 @@ class WP_Upgrader_Skin { var $upgrader; var $done_header = false; + var $result = false; function WP_Upgrader_Skin($args = array()) { return $this->__construct($args); @@ -820,7 +923,12 @@ class WP_Upgrader_Skin { function set_upgrader(&$upgrader) { if ( is_object($upgrader) ) $this->upgrader =& $upgrader; + $this->add_strings(); } + + function add_strings() { + } + function set_result($result) { $this->result = $result; } @@ -891,6 +999,7 @@ class WP_Upgrader_Skin { class Plugin_Upgrader_Skin extends WP_Upgrader_Skin { var $plugin = ''; var $plugin_active = false; + var $plugin_network_active = false; function Plugin_Upgrader_Skin($args = array()) { return $this->__construct($args); @@ -902,19 +1011,17 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin { $this->plugin = $args['plugin']; - $this->plugin_active = is_plugin_active($this->plugin); + $this->plugin_active = is_plugin_active( $this->plugin ); + $this->plugin_network_active = is_plugin_active_for_network( $this->plugin ); parent::__construct($args); } function after() { - if ( $this->upgrader->bulk ) - return; - $this->plugin = $this->upgrader->plugin_info(); - if( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ){ - show_message(__('Attempting reactivation of the plugin')); - echo ''; + if ( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ){ + show_message(__('Reactivating the plugin…')); + echo ''; } $update_actions = array( @@ -939,6 +1046,185 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin { } } +/** + * Plugin Upgrader Skin for WordPress Plugin Upgrades. + * + * @package WordPress + * @subpackage Upgrader + * @since 3.0.0 + */ +class Bulk_Upgrader_Skin extends WP_Upgrader_Skin { + var $in_loop = false; + var $error = false; + + function Bulk_Upgrader_Skin($args = array()) { + return $this->__construct($args); + } + + function __construct($args = array()) { + $defaults = array( 'url' => '', 'nonce' => '' ); + $args = wp_parse_args($args, $defaults); + + parent::__construct($args); + } + + function add_strings() { + $this->upgrader->strings['skin_upgrade_start'] = __('The update process is starting. This process may take awhile on some hosts, so please be patient.'); + $this->upgrader->strings['skin_update_failed_error'] = __('An error occured while updating %1$s: %2$s.'); + $this->upgrader->strings['skin_update_failed'] = __('The update of %1$s failed.'); + $this->upgrader->strings['skin_update_successful'] = __('%1$s updated successfully.').' '.__('Show Details').'.'; + $this->upgrader->strings['skin_upgrade_end'] = __('All updates have been completed.'); + } + + function feedback($string) { + if ( isset( $this->upgrader->strings[$string] ) ) + $string = $this->upgrader->strings[$string]; + + if ( strpos($string, '%') !== false ) { + $args = func_get_args(); + $args = array_splice($args, 1); + if ( !empty($args) ) + $string = vsprintf($string, $args); + } + if ( empty($string) ) + return; + if ( $this->in_loop ) + echo "$string
    \n"; + else + echo "

    $string

    \n"; + } + + function header() { + // Nothing, This will be displayed within a iframe. + } + + function footer() { + // Nothing, This will be displayed within a iframe. + } + function error($error) { + if ( is_string($error) && isset( $this->upgrader->strings[$error] ) ) + $this->error = $this->upgrader->strings[$error]; + + if ( is_wp_error($error) ) { + foreach ( $error->get_error_messages() as $emessage ) { + if ( $error->get_error_data() ) + $messages[] = $emessage . ' ' . $error->get_error_data(); + else + $messages[] = $emessage; + } + $this->error = implode(', ', $messages); + } + echo ''; + } + + function bulk_header() { + $this->feedback('skin_upgrade_start'); + } + + function bulk_footer() { + $this->feedback('skin_upgrade_end'); + } + + function before($title = '') { + $this->in_loop = true; + printf( '

    ' . $this->upgrader->strings['skin_before_update_header'] . '

    ', $title, $this->upgrader->update_current, $this->upgrader->update_count); + echo ''; + echo '

    '; + $this->flush_output(); + } + + function after($title = '') { + echo '

    '; + if ( $this->error || ! $this->result ) { + if ( $this->error ) + echo '

    ' . sprintf($this->upgrader->strings['skin_update_failed_error'], $title, $this->error) . '

    '; + else + echo '

    ' . sprintf($this->upgrader->strings['skin_update_failed'], $title) . '

    '; + + echo ''; + } + if ( !empty($this->result) && !is_wp_error($this->result) ) { + echo '

    ' . sprintf($this->upgrader->strings['skin_update_successful'], $title, 'jQuery(\'#progress-' . esc_js($this->upgrader->update_current) . '\').toggle();jQuery(\'span\', this).toggle(); return false;') . '

    '; + echo ''; + } + + $this->reset(); + $this->flush_output(); + } + + function reset() { + $this->in_loop = false; + $this->error = false; + } + + function flush_output() { + wp_ob_end_flush_all(); + flush(); + } +} + +class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin { + var $plugin_info = array(); // Plugin_Upgrader::bulk() will fill this in. + function Plugin_Upgrader_Skin($args = array()) { + parent::__construct($args); + } + + function add_strings() { + parent::add_strings(); + $this->upgrader->strings['skin_before_update_header'] = __('Updating Plugin %1$s (%2$d/%3$d)'); + } + + function before() { + parent::before($this->plugin_info['Title']); + } + + function after() { + parent::after($this->plugin_info['Title']); + } + function bulk_footer() { + parent::bulk_footer(); + $update_actions = array( + 'plugins_page' => '' . __('Return to Plugins page') . '', + 'updates_page' => '' . __('Return to WordPress Updates') . '' + ); + + $update_actions = apply_filters('update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info); + if ( ! empty($update_actions) ) + $this->feedback('' . __('Actions:') . ' ' . implode(' | ', (array)$update_actions)); + } +} + +class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin { + var $theme_info = array(); // Theme_Upgrader::bulk() will fill this in. + function Theme_Upgrader_Skin($args = array()) { + parent::__construct($args); + } + + function add_strings() { + parent::add_strings(); + $this->upgrader->strings['skin_before_update_header'] = __('Updating Theme %1$s (%2$d/%3$d)'); + } + + function before() { + parent::before($this->theme_info['Name']); + } + + function after() { + parent::after($this->theme_info['Name']); + } + function bulk_footer() { + parent::bulk_footer(); + $update_actions = array( + 'themes_page' => '' . __('Return to Themes page') . '', + 'updates_page' => '' . __('Return to WordPress Updates') . '' + ); + + $update_actions = apply_filters('update_bulk_theme_complete_actions', $update_actions, $this->theme_info); + if ( ! empty($update_actions) ) + $this->feedback('' . __('Actions:') . ' ' . implode(' | ', (array)$update_actions)); + } +} + /** * Plugin Installer Skin for WordPress Plugin Installer. * @@ -975,19 +1261,30 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin { $plugin_file = $this->upgrader->plugin_info(); - $install_actions = array( - 'activate_plugin' => '' . __('Activate Plugin') . '', - ); + $install_actions = array(); - if ( $this->type == 'web' ) + $from = isset($_GET['from']) ? stripslashes($_GET['from']) : 'plugins'; + + if ( 'import' == $from ) + $install_actions['activate_plugin'] = '' . __('Activate Plugin & Run Importer') . ''; + else + $install_actions['activate_plugin'] = '' . __('Activate Plugin') . ''; + + if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) + $install_actions['network_activate'] = '' . __('Network Activate') . ''; + + if ( 'import' == $from ) + $install_actions['importers_page'] = '' . __('Return to Importers') . ''; + else if ( $this->type == 'web' ) $install_actions['plugins_page'] = '' . __('Return to Plugin Installer') . ''; else $install_actions['plugins_page'] = '' . __('Return to Plugins page') . ''; - if ( ! $this->result || is_wp_error($this->result) ) + if ( ! $this->result || is_wp_error($this->result) ) { unset( $install_actions['activate_plugin'] ); - + unset( $install_actions['network_activate'] ); + } $install_actions = apply_filters('install_plugin_complete_actions', $install_actions, $this->api, $plugin_file); if ( ! empty($install_actions) ) $this->feedback('' . __('Actions:') . ' ' . implode(' | ', (array)$install_actions)); @@ -1088,6 +1385,7 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin { function after() { + $update_actions = array(); if ( !empty($this->upgrader->result['destination_name']) && ($theme_info = $this->upgrader->theme_info()) && !empty($theme_info) ) { @@ -1099,10 +1397,9 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin { $preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), trailingslashit(esc_url(get_option('home'))) ) ); $activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template); - $update_actions = array( - 'preview' => '' . __('Preview') . '', - 'activate' => '' . __('Activate') . '', - ); + $update_actions['preview'] = '' . __('Preview') . ''; + $update_actions['activate'] = '' . __('Activate') . ''; + if ( ( ! $this->result || is_wp_error($this->result) ) || $stylesheet == get_stylesheet() ) unset($update_actions['preview'], $update_actions['activate']); } diff --git a/wp-admin/includes/comment.php b/wp-admin/includes/comment.php index 26f25564..185251a0 100644 --- a/wp-admin/includes/comment.php +++ b/wp-admin/includes/comment.php @@ -96,36 +96,45 @@ function get_comment_to_edit( $id ) { } /** - * {@internal Missing Short Description}} + * Get the number of pending comments on a post or posts * * @since unknown * @uses $wpdb * - * @param int $post_id Post ID - * @return unknown + * @param int|array $post_id Either a single Post ID or an array of Post IDs + * @return int|array Either a single Posts pending comments as an int or an array of ints keyed on the Post IDs */ function get_pending_comments_num( $post_id ) { global $wpdb; $single = false; if ( !is_array($post_id) ) { - $post_id = (array) $post_id; + $post_id_array = (array) $post_id; $single = true; + } else { + $post_id_array = $post_id; } - $post_id = array_map('intval', $post_id); - $post_id = "'" . implode("', '", $post_id) . "'"; - - $pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id ) AND comment_approved = '0' GROUP BY comment_post_ID", ARRAY_N ); + $post_id_array = array_map('intval', $post_id_array); + $post_id_in = "'" . implode("', '", $post_id_array) . "'"; - if ( empty($pending) ) - return 0; + $pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' GROUP BY comment_post_ID", ARRAY_A ); - if ( $single ) - return $pending[0][1]; + if ( $single ) { + if ( empty($pending) ) + return 0; + else + return absint($pending[0]['num_comments']); + } $pending_keyed = array(); - foreach ( $pending as $pend ) - $pending_keyed[$pend[0]] = $pend[1]; + + // Default to zero pending for all posts in request + foreach ( $post_id_array as $id ) + $pending_keyed[$id] = 0; + + if ( !empty($pending) ) + foreach ( $pending as $pend ) + $pending_keyed[$pend['comment_post_ID']] = absint($pend['num_comments']); return $pending_keyed; } @@ -133,7 +142,7 @@ function get_pending_comments_num( $post_id ) { /** * Add avatars to relevant places in admin, or try to. * - * @since unknown + * @since 2.5.0 * @uses $comment * * @param string $name User name. @@ -141,16 +150,7 @@ function get_pending_comments_num( $post_id ) { */ function floated_admin_avatar( $name ) { global $comment; - - $id = $avatar = false; - if ( $comment->comment_author_email ) - $id = $comment->comment_author_email; - if ( $comment->user_id ) - $id = $comment->user_id; - - if ( $id ) - $avatar = get_avatar( $id, 32 ); - + $avatar = get_avatar( $comment, 32 ); return "$avatar $name"; } diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 6137a93c..9b84e9fe 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -28,8 +28,14 @@ function wp_dashboard_setup() { wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' ); // Recent Comments Widget + if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) { + $update = true; + $widget_options['dashboard_recent_comments'] = array( + 'items' => 5, + ); + } $recent_comments_title = __( 'Recent Comments' ); - wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments' ); + wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments', 'wp_dashboard_recent_comments_control' ); // Incoming Links Widget if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) { @@ -46,7 +52,7 @@ function wp_dashboard_setup() { wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' ); // WP Plugins Widget - if ( current_user_can( 'activate_plugins' ) ) + if ( current_user_can( 'install_plugins' ) ) wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' ); // QuickPress Widget @@ -63,11 +69,11 @@ function wp_dashboard_setup() { $widget_options['dashboard_primary'] = array( 'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/development/' ) ), 'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/development/feed/' ) ), - 'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Development Blog' ) ), + 'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Blog' ) ), 'items' => 2, 'show_summary' => 1, 'show_author' => 0, - 'show_date' => 1 + 'show_date' => 1, ); } wp_add_dashboard_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_primary', 'wp_dashboard_primary_control' ); @@ -79,7 +85,10 @@ function wp_dashboard_setup() { 'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ), 'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ), 'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ), - 'items' => 5 + 'items' => 5, + 'show_summary' => 0, + 'show_author' => 0, + 'show_date' => 0, ); } wp_add_dashboard_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_secondary', 'wp_dashboard_secondary_control' ); @@ -206,8 +215,8 @@ function wp_dashboard_right_now() { $num_comm = wp_count_comments( ); - echo "\n\t".'

    ' . __('At a Glance') . '

    '; - echo "\n\t".'
    '."\n\t".''; + echo "\n\t".'
    '; + echo "\n\t".'

    ' . __('Content') . '

    '."\n\t".'
    '; echo "\n\t".''; // Posts @@ -219,6 +228,8 @@ function wp_dashboard_right_now() { } echo ''; echo ''; + + echo ''; /* TODO: Show status breakdown on hover if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can $post_type_texts[] = ''.sprintf( _n( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).''; @@ -236,31 +247,64 @@ function wp_dashboard_right_now() { } */ + // Pages + $num = number_format_i18n( $num_pages->publish ); + $text = _n( 'Page', 'Pages', $num_pages->publish ); + if ( current_user_can( 'edit_pages' ) ) { + $num = "$num"; + $text = "$text"; + } + echo ''; + echo ''; + + echo ''; + + // Categories + $num = number_format_i18n( $num_cats ); + $text = _n( 'Category', 'Categories', $num_cats ); + if ( current_user_can( 'manage_categories' ) ) { + $num = "$num"; + $text = "$text"; + } + echo ''; + echo ''; + + echo ''; + + // Tags + $num = number_format_i18n( $num_tags ); + $text = _n( 'Tag', 'Tags', $num_tags ); + if ( current_user_can( 'manage_categories' ) ) { + $num = "$num"; + $text = "$text"; + } + echo ''; + echo ''; + + echo ""; + do_action('right_now_content_table_end'); + echo "\n\t
    ' . $num . '' . $text . '
    ' . $num . '' . $text . '
    ' . $num . '' . $text . '
    ' . $num . '' . $text . '
    \n\t
    "; + + + echo "\n\t".'
    '; + echo "\n\t".'

    ' . __('Discussion') . '

    '."\n\t".''; + echo "\n\t".''; + // Total Comments $num = '' . number_format_i18n($num_comm->total_comments) . ''; $text = _n( 'Comment', 'Comments', $num_comm->total_comments ); if ( current_user_can( 'moderate_comments' ) ) { - $num = "$num"; - $text = "$text"; + $num = '' . $num . ''; + $text = '' . $text . ''; } echo ''; echo ''; echo ''; - // Pages - $num = number_format_i18n( $num_pages->publish ); - $text = _n( 'Page', 'Pages', $num_pages->publish ); - if ( current_user_can( 'edit_pages' ) ) { - $num = "$num"; - $text = "$text"; - } - echo ''; - echo ''; - // Approved Comments $num = '' . number_format_i18n($num_comm->approved) . ''; - $text = _nc( 'Approved|Right Now', 'Approved', $num_comm->approved ); + $text = _nx( 'Approved', 'Approved', $num_comm->approved, 'Right Now' ); if ( current_user_can( 'moderate_comments' ) ) { $num = "$num"; $text = "$text"; @@ -270,16 +314,6 @@ function wp_dashboard_right_now() { echo "\n\t"; - // Categories - $num = number_format_i18n( $num_cats ); - $text = _n( 'Category', 'Categories', $num_cats ); - if ( current_user_can( 'manage_categories' ) ) { - $num = "$num"; - $text = "$text"; - } - echo ''; - echo ''; - // Pending Comments $num = '' . number_format_i18n($num_comm->moderated) . ''; $text = _n( 'Pending', 'Pending', $num_comm->moderated ); @@ -292,19 +326,9 @@ function wp_dashboard_right_now() { echo "\n\t"; - // Tags - $num = number_format_i18n( $num_tags ); - $text = _n( 'Tag', 'Tags', $num_tags ); - if ( current_user_can( 'manage_categories' ) ) { - $num = "$num"; - $text = "$text"; - } - echo ''; - echo ''; - // Spam Comments $num = number_format_i18n($num_comm->spam); - $text = _n( 'Spam', 'Spam', $num_comm->spam ); + $text = _nx( 'Spam', 'Spam', $num_comm->spam, 'comment' ); if ( current_user_can( 'moderate_comments' ) ) { $num = "$num"; $text = "$text"; @@ -314,6 +338,7 @@ function wp_dashboard_right_now() { echo ""; do_action('right_now_table_end'); + do_action('right_now_discussion_table_end'); echo "\n\t
    ' . $num . '' . $text . '
    ' . $num . '' . $text . '
    ' . $num . '' . $text . '
    ' . $num . '' . $text . '
    \n\t
    "; echo "\n\t".'
    '; @@ -331,11 +356,15 @@ function wp_dashboard_right_now() { } $num = number_format_i18n( $num_widgets ); - if ( current_user_can( 'switch_themes' ) ) { + $switch_themes = $ct->title; + if ( current_user_can( 'switch_themes') ) { echo '' . __('Change Theme') . ''; - printf(_n('Theme %1$s with %2$s Widget', 'Theme %1$s with %2$s Widgets', $num_widgets), $ct->title, $num); + $switch_themes = '' . $switch_themes . ''; + } + if ( current_user_can( 'edit_theme_options' ) ) { + printf(_n('Theme %1$s with %2$s Widget', 'Theme %1$s with %2$s Widgets', $num_widgets), $switch_themes, $num); } else { - printf(_n('Theme %1$s with %2$s Widget', 'Theme %1$s with %2$s Widgets', $num_widgets), $ct->title, $num); + printf(_n('Theme %1$s with %2$s Widget', 'Theme %1$s with %2$s Widgets', $num_widgets), $switch_themes, $num); } } else { if ( current_user_can( 'switch_themes' ) ) { @@ -354,18 +383,20 @@ function wp_dashboard_right_now() { do_action( 'activity_box_end' ); } -function wp_dashboard_quick_press() { +function wp_dashboard_quick_press_output() { + global $post_ID; + $drafts = false; if ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['action'] ) && 0 === strpos( $_POST['action'], 'post-quickpress' ) && (int) $_POST['post_ID'] ) { $view = get_permalink( $_POST['post_ID'] ); $edit = esc_url( get_edit_post_link( $_POST['post_ID'] ) ); if ( 'post-quickpress-publish' == $_POST['action'] ) { if ( current_user_can('publish_posts') ) - printf( '

    ' . __( 'Post Published. View post | Edit post' ) . '

    ', esc_url( $view ), $edit ); + printf( '

    ' . __( 'Post published. View post | Edit post' ) . '

    ', esc_url( $view ), $edit ); else - printf( '

    ' . __( 'Post submitted. Preview post | Edit post' ) . '

    ', esc_url( add_query_arg( 'preview', 1, $view ) ), $edit ); + printf( '

    ' . __( 'Post submitted. Preview post | Edit post' ) . '

    ', esc_url( add_query_arg( 'preview', 1, $view ) ), $edit ); } else { - printf( '

    ' . __( 'Draft Saved. Preview post | Edit post' ) . '

    ', esc_url( add_query_arg( 'preview', 1, $view ) ), $edit ); + printf( '

    ' . __( 'Draft saved. Preview post | Edit post' ) . '

    ', esc_url( add_query_arg( 'preview', 1, $view ) ), $edit ); $drafts_query = new WP_Query( array( 'post_type' => 'post', 'post_status' => 'draft', @@ -378,11 +409,26 @@ function wp_dashboard_quick_press() { if ( $drafts_query->posts ) $drafts =& $drafts_query->posts; } - printf('

    ' . __('You can also try %s, easy blogging from anywhere on the Web.') . '

    ', '' . __('Press This') . '' ); + printf('

    ' . __('You can also try %s, easy blogging from anywhere on the Web.') . '

    ', '' . __('Press This') . '' ); $_REQUEST = array(); // hack for get_default_post_to_edit() } - $post = get_default_post_to_edit(); + /* Check if a new auto-draft (= no new post_ID) is needed or if the old can be used */ + $last_post_id = (int) get_user_option( 'dashboard_quick_press_last_post_id' ); // Get the last post_ID + if ( $last_post_id ) { + $post = get_post( $last_post_id ); + if ( empty( $post ) || $post->post_status != 'auto-draft' ) { // auto-draft doesn't exists anymore + $post = get_default_post_to_edit('post', true); + update_user_option( (int) $GLOBALS['current_user']->ID, 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID + } else { + $post->post_title = ''; // Remove the auto draft title + } + } else { + $post = get_default_post_to_edit('post', true); + update_user_option( (int) $GLOBALS['current_user']->ID, 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID + } + + $post_ID = (int) $post->ID; ?>
    @@ -411,15 +457,15 @@ function wp_dashboard_quick_press() {

    - + + - - - - - + + + +

    @@ -430,6 +476,10 @@ function wp_dashboard_quick_press() { wp_dashboard_recent_drafts( $drafts ); } +function wp_dashboard_quick_press() { + echo '

    ' . __( 'Loading…' ) . '

    ' . __('This widget requires JavaScript.') . '

    '; +} + function wp_dashboard_recent_drafts( $drafts = false ) { if ( !$drafts ) { $drafts_query = new WP_Query( array( @@ -481,12 +531,18 @@ function wp_dashboard_recent_comments() { $comments = array(); $start = 0; + $widgets = get_option( 'dashboard_widget_options' ); + if ( isset( $widgets['dashboard_recent_comments'] ) && isset( $widgets['dashboard_recent_comments']['items'] ) ) + $total_items = (int) $widgets['dashboard_recent_comments']['items']; + else + $total_items = 5; + while ( count( $comments ) < 5 && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50" ) ) { foreach ( $possible as $comment ) { - if ( count( $comments ) >= 5 ) + if ( count( $comments ) >= $total_items ) break; - if ( in_array( $comment->comment_approved, $allowed_states ) ) + if ( in_array( $comment->comment_approved, $allowed_states ) && current_user_can( 'read_post', $comment->comment_post_ID ) ) $comments[] = $comment; } @@ -582,7 +638,10 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
    -

    ' . get_comment_author_link() . '', $comment_post_link.' '.$comment_link, ' ' . __( '[Pending]' ) . '' ); ?>

    +

    + ' . get_comment_author_link() . '', $comment_post_link.' '.$comment_link, ' ' . __( '[Pending]' ) . '' ); ?> +

    30 ) + $number = 5; + $widget_options['dashboard_recent_comments']['items'] = $number; + update_option( 'dashboard_widget_options', $widget_options ); + } + + $number = isset( $widget_options['dashboard_recent_comments']['items'] ) ? (int) $widget_options['dashboard_recent_comments']['items'] : ''; + + echo '

    '; + echo ' ' . __( '(at most 30)' ) . '

    '; +} + function wp_dashboard_incoming_links() { echo '

    ' . __( 'Loading…' ) . '

    ' . __('This widget requires JavaScript.') . '

    '; } @@ -636,7 +721,7 @@ function wp_dashboard_incoming_links_output() { if ( !$rss->get_item_quantity() ) { echo '

    ' . __('This dashboard widget queries Google Blog Search so that when another blog links to your site it will show up here. It has found no incoming links… yet. It’s okay — there is no rush.') . "

    \n"; - $rss->__destruct(); + $rss->__destruct(); unset($rss); return; } @@ -691,7 +776,7 @@ function wp_dashboard_incoming_links_output() { } echo "\n"; - $rss->__destruct(); + $rss->__destruct(); unset($rss); } @@ -748,14 +833,14 @@ function wp_dashboard_secondary_output() { echo '

    '; } } elseif ( !$rss->get_item_quantity() ) { - $rss->__destruct(); + $rss->__destruct(); unset($rss); return false; } else { echo '
    '; wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] ); echo '
    '; - $rss->__destruct(); + $rss->__destruct(); unset($rss); } } @@ -839,7 +924,7 @@ function wp_dashboard_plugins_output() { echo "

    $label

    \n"; echo "
    $title
     (" . __( 'Install' ) . ")\n"; echo "

    $description

    \n"; - + $$feed->__destruct(); unset($$feed); } @@ -938,9 +1023,9 @@ function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) { if ( is_wp_error($rss) ) { $widget_options[$widget_id]['title'] = htmlentities(__('Unknown Feed')); } else { - $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title())); + $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title())); $rss->__destruct(); - unset($rss); + unset($rss); } } update_option( 'dashboard_widget_options', $widget_options ); diff --git a/wp-admin/includes/deprecated.php b/wp-admin/includes/deprecated.php new file mode 100644 index 00000000..653cd659 --- /dev/null +++ b/wp-admin/includes/deprecated.php @@ -0,0 +1,200 @@ + 0) ); + + if ( $categories ) { + foreach ( $categories as $category ) { + if ( $currentcat != $category->term_id && $parent == $category->parent) { + $pad = str_repeat( '– ', $level ); + $category->name = esc_html( $category->name ); + echo "\n\t"; + wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories ); + } + } + } else { + return false; + } +} + +/** + * Register a setting and its sanitization callback + * + * @since 2.7.0 + * @deprecated 3.0.0 + * @deprecated Use register_setting() + * @see register_setting() + * + * @param string $option_group A settings group name. Should correspond to a whitelisted option key name. + * Default whitelisted option key names include "general," "discussion," and "reading," among others. + * @param string $option_name The name of an option to sanitize and save. + * @param unknown_type $sanitize_callback A callback function that sanitizes the option's value. + * @return unknown + */ +function add_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) { + _deprecated_function( __FUNCTION__, '3.0', 'register_setting()' ); + return register_setting( $option_group, $option_name, $sanitize_callback ); +} + +/** + * Unregister a setting + * + * @since 2.7.0 + * @deprecated 3.0.0 + * @deprecated Use unregister_setting() + * @see unregister_setting() + * + * @param unknown_type $option_group + * @param unknown_type $option_name + * @param unknown_type $sanitize_callback + * @return unknown + */ +function remove_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) { + _deprecated_function( __FUNCTION__, '3.0', 'unregister_setting()' ); + return unregister_setting( $option_group, $option_name, $sanitize_callback ); +} + +/** + * Determines the language to use for CodePress syntax highlighting. + * + * @since 2.8.0 + * @deprecated 3.0.0 + * + * @param string $filename +**/ +function codepress_get_lang( $filename ) { + _deprecated_function( __FUNCTION__, '3.0' ); + return; +} + +/** + * Adds Javascript required to make CodePress work on the theme/plugin editors. + * + * @since 2.8.0 + * @deprecated 3.0.0 +**/ +function codepress_footer_js() { + _deprecated_function( __FUNCTION__, '3.0' ); + return; +} + +/** + * Determine whether to use CodePress. + * + * @since 2.8 + * @deprecated 3.0.0 +**/ +function use_codepress() { + _deprecated_function( __FUNCTION__, '3.0' ); + return; +} + +?> \ No newline at end of file diff --git a/wp-admin/includes/export.php b/wp-admin/includes/export.php index 921a2377..345eed20 100644 --- a/wp-admin/includes/export.php +++ b/wp-admin/includes/export.php @@ -21,235 +21,260 @@ define('WXR_VERSION', '1.0'); * * @since unknown * - * @param unknown_type $author + * @param unknown_type $args */ -function export_wp($author='') { -global $wpdb, $post_ids, $post, $wp_taxonomies; +function export_wp( $args = array() ) { + global $wpdb, $post_ids, $post, $wp_taxonomies; -do_action('export_wp'); + if ( ! is_array( $args ) ) + $args = array( 'author' => $args ); -$filename = 'wordpress.' . date('Y-m-d') . '.xml'; + $defaults = array( 'author' => null, 'taxonomy' => null, 'post_type' => null, 'post_status' => null, 'start_date' => null, 'end_date' => null ); + $args = wp_parse_args( $args, $defaults ); -header('Content-Description: File Transfer'); -header("Content-Disposition: attachment; filename=$filename"); -header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); + extract($args); -$where = ''; -if ( $author and $author != 'all' ) { - $author_id = (int) $author; - $where = $wpdb->prepare(" WHERE post_author = %d ", $author_id); -} - -// grab a snapshot of post IDs, just in case it changes during the export -$post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC"); - -$categories = (array) get_categories('get=all'); -$tags = (array) get_tags('get=all'); - -$custom_taxonomies = $wp_taxonomies; -unset($custom_taxonomies['category']); -unset($custom_taxonomies['post_tag']); -unset($custom_taxonomies['link_category']); -$custom_taxonomies = array_keys($custom_taxonomies); -$terms = (array) get_terms($custom_taxonomies, 'get=all'); - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $categories - */ -function wxr_missing_parents($categories) { - if ( !is_array($categories) || empty($categories) ) - return array(); - - foreach ( $categories as $category ) - $parents[$category->term_id] = $category->parent; - - $parents = array_unique(array_diff($parents, array_keys($parents))); + do_action('export_wp'); - if ( $zero = array_search('0', $parents) ) - unset($parents[$zero]); + if( strlen( $start_date ) > 4 && strlen( $end_date ) > 4 ) + $filename = 'wordpress.' . $start_date . '.' . $end_date . '.xml'; + else + $filename = 'wordpress.' . date( 'Y-m-d' ) . '.xml'; - return $parents; -} + header( 'Content-Description: File Transfer' ); + header( 'Content-Disposition: attachment; filename=' . $filename ); + header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true ); -while ( $parents = wxr_missing_parents($categories) ) { - $found_parents = get_categories("include=" . join(', ', $parents)); - if ( is_array($found_parents) && count($found_parents) ) - $categories = array_merge($categories, $found_parents); + if ( $post_type && $post_type != 'all' ) + $where = $wpdb->prepare("WHERE post_type = %s ", $post_type); else - break; -} + $where = "WHERE post_type != 'revision' "; -// Put them in order to be inserted with no child going before its parent -$pass = 0; -$passes = 1000 + count($categories); -while ( ( $cat = array_shift($categories) ) && ++$pass < $passes ) { - if ( $cat->parent == 0 || isset($cats[$cat->parent]) ) { - $cats[$cat->term_id] = $cat; - } else { - $categories[] = $cat; + if ( $author && $author != 'all' ) { + $author_id = (int) $author; + $where .= $wpdb->prepare( "AND post_author = %d ", $author_id ); } -} -unset($categories); -/** - * Place string in CDATA tag. - * - * @since unknown - * - * @param string $str String to place in XML CDATA tag. - */ -function wxr_cdata($str) { - if ( seems_utf8($str) == false ) - $str = utf8_encode($str); + if ( $start_date && $start_date != 'all' ) + $where .= $wpdb->prepare( "AND post_date >= %s ", $start_date ); - // $str = ent2ncr(esc_html($str)); + if ( $end_date && $end_date != 'all' ) + $where .= $wpdb->prepare( "AND post_date < %s ", $end_date ); - $str = ""; + if ( $taxonomy && is_array( $taxonomy ) ) { + foreach ( $taxonomy as $term_id ) { + if ( $term_id != 'all' ) + $where .= $wpdb->prepare( "AND ID IN (SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d) ", $term_id ); + } + } - return $str; -} + if ( $post_status && $post_status != 'all' ) + $where .= $wpdb->prepare( "AND post_status = %s", $status ); -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @return string Site URL. - */ -function wxr_site_url() { - global $current_site; + // grab a snapshot of post IDs, just in case it changes during the export + $post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC" ); - // mu: the base url - if ( isset($current_site->domain) ) { - return 'http://'.$current_site->domain.$current_site->path; - } - // wp: the blog url - else { - return get_bloginfo_rss('url'); - } -} + $categories = (array) get_categories( array( 'get' => 'all' ) ); + $tags = (array) get_tags( array( 'get' => 'all' ) ); -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param object $c Category Object - */ -function wxr_cat_name($c) { - if ( empty($c->name) ) - return; + $custom_taxonomies = $wp_taxonomies; + unset( $custom_taxonomies['category'] ); + unset( $custom_taxonomies['post_tag'] ); + unset( $custom_taxonomies['link_category'] ); + $custom_taxonomies = array_keys( $custom_taxonomies ); + $terms = (array) get_terms( $custom_taxonomies, array( 'get' => 'all' ) ); - echo '' . wxr_cdata($c->name) . ''; -} + /** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $categories + */ + function wxr_missing_parents( $categories ) { + if ( ! is_array( $categories ) || empty( $categories ) ) + return array(); -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param object $c Category Object - */ -function wxr_category_description($c) { - if ( empty($c->description) ) - return; + foreach ( $categories as $category ){ + $parents[$category->term_id] = $category->parent; + } - echo '' . wxr_cdata($c->description) . ''; -} + $parents = array_unique( array_diff( $parents, array_keys( $parents ) ) ); -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param object $t Tag Object - */ -function wxr_tag_name($t) { - if ( empty($t->name) ) - return; + if ( $zero = array_search( '0', $parents ) ) + unset( $parents[$zero] ); - echo '' . wxr_cdata($t->name) . ''; -} + return $parents; + } -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param object $t Tag Object - */ -function wxr_tag_description($t) { - if ( empty($t->description) ) - return; + while ( $parents = wxr_missing_parents( $categories ) ) { + $found_parents = get_categories( array( 'include' => join( ', ', $parents) ) ); + if ( is_array( $found_parents ) && count( $found_parents ) ) + $categories = array_merge( $categories, $found_parents ); + else + break; + } - echo '' . wxr_cdata($t->description) . ''; -} + // Put them in order to be inserted with no child going before its parent + $pass = 0; + $passes = 1000 + count( $categories ); + while ( ( $cat = array_shift( $categories ) ) && ++$pass < $passes ) { + if ( $cat->parent == 0 || isset( $cats[$cat->parent] ) ) + $cats[$cat->term_id] = $cat; + else + $categories[] = $cat; + } + unset( $categories ); + + /** + * Place string in CDATA tag. + * + * @since unknown + * + * @param string $str String to place in XML CDATA tag. + */ + function wxr_cdata( $str ) { + if ( seems_utf8( $str ) == false ) + $str = utf8_encode( $str ); + + // $str = ent2ncr(esc_html($str)); + $str = ""; + + return $str; + } -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param object $t Term Object - */ -function wxr_term_name($t) { - if ( empty($t->name) ) - return; + /** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @return string Site URL. + */ + function wxr_site_url() { + global $current_site; + + // mu: the base url + if ( isset( $current_site->domain ) ) + return network_home_url(); + // wp: the blog url + else + return get_bloginfo_rss( 'url' ); + } - echo '' . wxr_cdata($t->name) . ''; -} + /** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param object $c Category Object + */ + function wxr_cat_name( $c ) { + if ( empty( $c->name ) ) + return; + + echo '' . wxr_cdata( $c->name ) . ''; + } -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param object $t Term Object - */ -function wxr_term_description($t) { - if ( empty($t->description) ) - return; + /** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param object $c Category Object + */ + function wxr_category_description( $c ) { + if ( empty( $c->description ) ) + return; + + echo '' . wxr_cdata($c->description) . ''; + } - echo '' . wxr_cdata($t->description) . ''; -} + /** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param object $t Tag Object + */ + function wxr_tag_name( $t ) { + if ( empty( $t->name ) ) + return; + + echo '' . wxr_cdata($t->name) . ''; + } -/** - * {@internal Missing Short Description}} - * - * @since unknown - */ -function wxr_post_taxonomy() { - $categories = get_the_category(); - $tags = get_the_tags(); - $the_list = ''; - $filter = 'rss'; - - if ( !empty($categories) ) foreach ( (array) $categories as $category ) { - $cat_name = sanitize_term_field('name', $category->name, $category->term_id, 'category', $filter); - // for backwards compatibility - $the_list .= "\n\t\t\n"; - // forwards compatibility: use a unique identifier for each cat to avoid clashes - // http://trac.wordpress.org/ticket/5447 - $the_list .= "\n\t\tslug}\">\n"; + /** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param object $t Tag Object + */ + function wxr_tag_description( $t ) { + if ( empty( $t->description ) ) + return; + + echo '' . wxr_cdata($t->description) . ''; } - if ( !empty($tags) ) foreach ( (array) $tags as $tag ) { - $tag_name = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter); - $the_list .= "\n\t\t\n"; - // forwards compatibility as above - $the_list .= "\n\t\tslug}\">\n"; + /** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param object $t Term Object + */ + function wxr_term_name( $t ) { + if ( empty( $t->name ) ) + return; + + echo '' . wxr_cdata($t->name) . ''; } - echo $the_list; -} + /** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param object $t Term Object + */ + function wxr_term_description( $t ) { + if ( empty( $t->description ) ) + return; + + echo '' . wxr_cdata($t->description) . ''; + } -echo '\n"; + /** + * {@internal Missing Short Description}} + * + * @since unknown + */ + function wxr_post_taxonomy() { + global $post; + + $the_list = ''; + $filter = 'rss'; + + $taxonomies = get_object_taxonomies( 'post' ); + $terms = wp_get_post_terms( $post->ID, $taxonomies ); + foreach ( (array) $terms as $term ) { + $domain = ( 'post_tag' == $term->taxonomy ) ? 'tag' : $term->taxonomy; + $term_name = sanitize_term_field( 'name', $term->name, $term->term_id, $term->taxonomy, $filter ); + // Back compat. + if ( 'category' == $term->taxonomy ) + $the_list .= "\n\t\t\n"; + elseif ( 'post_tag' == $term->taxonomy ) + $the_list .= "\n\t\t\n"; + // forwards compatibility as above + $the_list .= "\n\t\tslug}\">\n"; + } + echo $the_list; + } -?> + echo '\n"; + + ?> @@ -266,7 +291,7 @@ echo '\n"; - + \n"; > - <?php bloginfo_rss('name'); ?> - - - - http://wordpress.org/?v= - + <?php bloginfo_rss( 'name' ); ?> + + + + http://wordpress.org/?v= + - - - slug; ?>parent ? $cats[$c->parent]->name : ''; ?> - - - slug; ?> - - - taxonomy; ?>slug; ?>parent ? $custom_taxonomies[$t->parent]->name : ''; ?> - - - in_the_loop = true; // Fake being in the loop. - // fetch 20 posts at a time rather than loading the entire table into memory - while ( $next_posts = array_splice($post_ids, 0, 20) ) { - $where = "WHERE ID IN (".join(',', $next_posts).")"; - $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC"); - foreach ($posts as $post) { - // Don't export revisions. They bloat the export. - if ( 'revision' == $post->post_type ) - continue; - setup_postdata($post); - - $is_sticky = 0; - if ( is_sticky( $post->ID ) ) - $is_sticky = 1; - -?> - -<?php echo apply_filters('the_title_rss', $post->post_title); ?> - - - - - - - -post_content) ); ?> -post_excerpt) ); ?> -ID; ?> -post_date; ?> -post_date_gmt; ?> -comment_status; ?> -ping_status; ?> -post_name; ?> -post_status; ?> -post_parent; ?> -menu_order; ?> -post_type; ?> -post_password; ?> - -post_type == 'attachment') { ?> -ID); ?> - -get_results( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID) ); -if ( $postmeta ) { -?> - - -meta_key; ?> -meta_value; ?> - - - -get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d", $post->ID) ); -if ( $comments ) { foreach ( $comments as $c ) { ?> - -comment_ID; ?> -comment_author); ?> -comment_author_email; ?> -comment_author_url ); ?> -comment_author_IP; ?> -comment_date; ?> -comment_date_gmt; ?> -comment_content) ?> -comment_approved; ?> -comment_type; ?> -comment_parent; ?> -user_id; ?> - - + + + slug; ?>parent ? $cats[$c->parent]->name : ''; ?> + + + slug; ?> + + + taxonomy; ?>slug; ?>parent ? $custom_taxonomies[$t->parent]->name : ''; ?> + + + + + in_the_loop = true; // Fake being in the loop. + + // fetch 20 posts at a time rather than loading the entire table into memory + while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) { + $where = "WHERE ID IN (" . join( ',', $next_posts ) . ")"; + $posts = $wpdb->get_results( "SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC" ); + + // Begin Loop + foreach ($posts as $post) { + setup_postdata( $post ); + + $is_sticky = 0; + if ( is_sticky( $post->ID ) ) + $is_sticky = 1; + + ?> + + <?php echo apply_filters( 'the_title_rss', $post->post_title ); ?> + + + + + + + + post_content ) ); ?> + post_excerpt ) ); ?> + ID; ?> + post_date; ?> + post_date_gmt; ?> + comment_status; ?> + ping_status; ?> + post_name; ?> + post_status; ?> + post_parent; ?> + menu_order; ?> + post_type; ?> + post_password; ?> + + post_type == 'attachment' ) { ?> + ID ); ?> + + get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) ); + if ( $postmeta ) { + ?> + + + meta_key; ?> + meta_value ); ?> + + + + get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d", $post->ID ) ); + if ( $comments ) { foreach ( $comments as $c ) { ?> + + comment_ID; ?> + comment_author ); ?> + comment_author_email; ?> + comment_author_url ); ?> + comment_author_IP; ?> + comment_date; ?> + comment_date_gmt; ?> + comment_content ) ?> + comment_approved; ?> + comment_type; ?> + comment_parent; ?> + user_id; ?> + + - + __( 'Main Index Template' ), 'style.css' => __( 'Stylesheet' ), + 'editor-style.css' => __( 'Visual Editor Stylesheet' ), 'rtl.css' => __( 'RTL Stylesheet' ), 'comments.php' => __( 'Comments' ), 'comments-popup.php' => __( 'Popup Comments' ), @@ -17,6 +18,8 @@ $wp_file_descriptions = array ( 'header.php' => __( 'Header' ), 'sidebar.php' => __( 'Sidebar' ), 'archive.php' => __( 'Archives' ), + 'author.php' => __( 'Author Template' ), + 'tag.php' => __( 'Tag Template' ), 'category.php' => __( 'Category Template' ), 'page.php' => __( 'Page Template' ), 'search.php' => __( 'Search Results' ), @@ -49,8 +52,8 @@ function get_file_description( $file ) { if ( isset( $wp_file_descriptions[basename( $file )] ) ) { return $wp_file_descriptions[basename( $file )]; } - elseif ( file_exists( WP_CONTENT_DIR . $file ) && is_file( WP_CONTENT_DIR . $file ) ) { - $template_data = implode( '', file( WP_CONTENT_DIR . $file ) ); + elseif ( file_exists( $file ) && is_file( $file ) ) { + $template_data = implode( '', file( $file ) ); if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name )) return _cleanup_header_comment($name[1]) . ' Page Template'; } @@ -109,10 +112,10 @@ function get_real_file_to_edit( $file ) { * @return bool|array False on failure, Else array of files */ function list_files( $folder = '', $levels = 100 ) { - if( empty($folder) ) + if ( empty($folder) ) return false; - if( ! $levels ) + if ( ! $levels ) return false; $files = array(); @@ -122,7 +125,7 @@ function list_files( $folder = '', $levels = 100 ) { continue; if ( is_dir( $folder . '/' . $file ) ) { $files2 = list_files( $folder . '/' . $file, $levels - 1); - if( $files2 ) + if ( $files2 ) $files = array_merge($files, $files2 ); else $files[] = $folder . '/' . $file . '/'; @@ -146,17 +149,29 @@ function list_files( $folder = '', $levels = 100 ) { * @return string Writable temporary directory */ function get_temp_dir() { + static $temp; if ( defined('WP_TEMP_DIR') ) return trailingslashit(WP_TEMP_DIR); + if ( $temp ) + return trailingslashit($temp); + $temp = WP_CONTENT_DIR . '/'; - if ( is_dir($temp) && is_writable($temp) ) + if ( is_dir($temp) && @is_writable($temp) ) return $temp; - if ( function_exists('sys_get_temp_dir') ) - return trailingslashit(sys_get_temp_dir()); + if ( function_exists('sys_get_temp_dir') ) { + $temp = sys_get_temp_dir(); + if ( @is_writable($temp) ) + return trailingslashit($temp); + } + + $temp = ini_get('upload_tmp_dir'); + if ( is_dir($temp) && @is_writable($temp) ) + return trailingslashit($temp); - return '/tmp/'; + $temp = '/tmp/'; + return $temp; } /** @@ -172,7 +187,7 @@ function get_temp_dir() { * @param string $dir (optional) Directory to store the file in * @return string a writable filename */ -function wp_tempnam($filename = '', $dir = ''){ +function wp_tempnam($filename = '', $dir = '') { if ( empty($dir) ) $dir = get_temp_dir(); $filename = basename($filename); @@ -223,7 +238,7 @@ function validate_file_to_edit( $file, $allowed_files = '' ) { */ function wp_handle_upload( &$file, $overrides = false, $time = null ) { // The default error handler. - if (! function_exists( 'wp_handle_upload_error' ) ) { + if ( ! function_exists( 'wp_handle_upload_error' ) ) { function wp_handle_upload_error( &$file, $message ) { return array( 'error'=>$message ); } @@ -258,6 +273,7 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) { // All tests are on by default. Most can be turned off by $override[{test_name}] = false; $test_form = true; $test_size = true; + $test_upload = true; // If you override this, you must provide $ext and $type!!!! $test_type = true; @@ -269,28 +285,37 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) { // A correct form post will pass this test. if ( $test_form && (!isset( $_POST['action'] ) || ($_POST['action'] != $action ) ) ) - return $upload_error_handler( $file, __( 'Invalid form submission.' )); + return call_user_func($upload_error_handler, $file, __( 'Invalid form submission.' )); // A successful upload will pass this test. It makes no sense to override this one. if ( $file['error'] > 0 ) - return $upload_error_handler( $file, $upload_error_strings[$file['error']] ); + return call_user_func($upload_error_handler, $file, $upload_error_strings[$file['error']] ); // A non-empty file will pass this test. - if ( $test_size && !($file['size'] > 0 ) ) - return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' )); + if ( $test_size && !($file['size'] > 0 ) ) { + if ( is_multisite() ) + $error_msg = __( 'File is empty. Please upload something more substantial.' ); + else + $error_msg = __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini.' ); + return call_user_func($upload_error_handler, $file, $error_msg); + } // A properly uploaded file will pass this test. There should be no reason to override this one. - if (! @ is_uploaded_file( $file['tmp_name'] ) ) - return $upload_error_handler( $file, __( 'Specified file failed upload test.' )); + if ( $test_upload && ! @ is_uploaded_file( $file['tmp_name'] ) ) + return call_user_func($upload_error_handler, $file, __( 'Specified file failed upload test.' )); // A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter. if ( $test_type ) { - $wp_filetype = wp_check_filetype( $file['name'], $mimes ); + $wp_filetype = wp_check_filetype_and_ext( $file['tmp_name'], $file['name'], $mimes ); extract( $wp_filetype ); + // Check to see if wp_check_filetype_and_ext() determined the filename was incorrect + if ( $proper_filename ) + $file['name'] = $proper_filename; + if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) - return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' )); + return call_user_func($upload_error_handler, $file, __( 'File type does not meet security guidelines. Try another.' )); if ( !$ext ) $ext = ltrim(strrchr($file['name'], '.'), '.'); @@ -303,15 +328,14 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) { // A writable uploads dir will pass this test. Again, there's no point overriding this one. if ( ! ( ( $uploads = wp_upload_dir($time) ) && false === $uploads['error'] ) ) - return $upload_error_handler( $file, $uploads['error'] ); + return call_user_func($upload_error_handler, $file, $uploads['error'] ); $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); // Move the file to the uploads dir $new_file = $uploads['path'] . "/$filename"; - if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) ) { + if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) ) return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) ); - } // Set correct file permissions $stat = stat( dirname( $new_file )); @@ -321,7 +345,10 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) { // Compute the URL $url = $uploads['url'] . "/$filename"; - return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) ); + if ( is_multisite() ) + delete_transient( 'dirsize_cache' ); + + return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'upload' ); } /** @@ -380,7 +407,7 @@ function wp_handle_sideload( &$file, $overrides = false ) { return $upload_error_handler( $file, __( 'Invalid form submission.' )); // A successful upload will pass this test. It makes no sense to override this one. - if ( $file['error'] > 0 ) + if ( ! empty( $file['error'] ) ) return $upload_error_handler( $file, $upload_error_strings[$file['error']] ); // A non-empty file will pass this test. @@ -393,10 +420,14 @@ function wp_handle_sideload( &$file, $overrides = false ) { // A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter. if ( $test_type ) { - $wp_filetype = wp_check_filetype( $file['name'], $mimes ); + $wp_filetype = wp_check_filetype_and_ext( $file['tmp_name'], $file['name'], $mimes ); extract( $wp_filetype ); + // Check to see if wp_check_filetype_and_ext() determined the filename was incorrect + if ( $proper_filename ) + $file['name'] = $proper_filename; + if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' )); @@ -431,7 +462,7 @@ function wp_handle_sideload( &$file, $overrides = false ) { // Compute the URL $url = $uploads['url'] . "/$filename"; - $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) ); + $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'sideload' ); return $return; } @@ -448,15 +479,15 @@ function wp_handle_sideload( &$file, $overrides = false ) { function download_url( $url ) { //WARNING: The file is not automatically deleted, The script must unlink() the file. if ( ! $url ) - return new WP_Error('http_no_url', __('Invalid URL Provided')); + return new WP_Error('http_no_url', __('Invalid URL Provided.')); $tmpfname = wp_tempnam($url); if ( ! $tmpfname ) - return new WP_Error('http_no_file', __('Could not create Temporary file')); + return new WP_Error('http_no_file', __('Could not create Temporary file.')); $handle = @fopen($tmpfname, 'wb'); if ( ! $handle ) - return new WP_Error('http_no_file', __('Could not create Temporary file')); + return new WP_Error('http_no_file', __('Could not create Temporary file.')); $response = wp_remote_get($url, array('timeout' => 300)); @@ -480,7 +511,7 @@ function download_url( $url ) { /** * Unzip's a specified ZIP file to a location on the Filesystem via the WordPress Filesystem Abstraction. - * Assumes that WP_Filesystem() has already been called and set up. + * Assumes that WP_Filesystem() has already been called and set up. Does not extract a root-level __MACOSX directory, if present. * * Attempts to increase the PHP Memory limit to 256M before uncompressing, * However, The most memory required shouldn't be much larger than the Archive itself. @@ -497,10 +528,140 @@ function unzip_file($file, $to) { if ( ! $wp_filesystem || !is_object($wp_filesystem) ) return new WP_Error('fs_unavailable', __('Could not access filesystem.')); - // Unzip uses a lot of memory, but not this much hopefully + // Unzip can use a lot of memory, but not this much hopefully @ini_set('memory_limit', '256M'); - $fs =& $wp_filesystem; + $needed_dirs = array(); + $to = trailingslashit($to); + + // Determine any parent dir's needed (of the upgrade directory) + if ( ! $wp_filesystem->is_dir($to) ) { //Only do parents if no children exist + $path = preg_split('![/\\\]!', untrailingslashit($to)); + for ( $i = count($path); $i >= 0; $i-- ) { + if ( empty($path[$i]) ) + continue; + + $dir = implode('/', array_slice($path, 0, $i+1) ); + if ( preg_match('!^[a-z]:$!i', $dir) ) // Skip it if it looks like a Windows Drive letter. + continue; + + if ( ! $wp_filesystem->is_dir($dir) ) + $needed_dirs[] = $dir; + else + break; // A folder exists, therefor, we dont need the check the levels below this + } + } + + if ( class_exists('ZipArchive') && apply_filters('unzip_file_use_ziparchive', true ) ) { + $result = _unzip_file_ziparchive($file, $to, $needed_dirs); + if ( true === $result ) { + return $result; + } elseif ( is_wp_error($result) ) { + if ( 'incompatible_archive' != $result->get_error_code() ) + return $result; + } + } + // Fall through to PclZip if ZipArchive is not available, or encountered an error opening the file. + return _unzip_file_pclzip($file, $to, $needed_dirs); +} + +/** + * This function should not be called directly, use unzip_file instead. Attempts to unzip an archive using the ZipArchive class. + * Assumes that WP_Filesystem() has already been called and set up. + * + * @since 3.0.0 + * @see unzip_file + * @access private + * + * @param string $file Full path and filename of zip archive + * @param string $to Full path on the filesystem to extract archive to + * @param array $needed_dirs A partial list of required folders needed to be created. + * @return mixed WP_Error on failure, True on success + */ +function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) { + global $wp_filesystem; + + $z = new ZipArchive(); + + // PHP4-compat - php4 classes can't contain constants + $zopen = $z->open($file, /* ZIPARCHIVE::CHECKCONS */ 4); + if ( true !== $zopen ) + return new WP_Error('incompatible_archive', __('Incompatible Archive.')); + + for ( $i = 0; $i < $z->numFiles; $i++ ) { + if ( ! $info = $z->statIndex($i) ) + return new WP_Error('stat_failed', __('Could not retrieve file from archive.')); + + if ( '__MACOSX/' === substr($info['name'], 0, 9) ) // Skip the OS X-created __MACOSX directory + continue; + + if ( '/' == substr($info['name'], -1) ) // directory + $needed_dirs[] = $to . untrailingslashit($info['name']); + else + $needed_dirs[] = $to . untrailingslashit(dirname($info['name'])); + } + + $needed_dirs = array_unique($needed_dirs); + foreach ( $needed_dirs as $dir ) { + // Check the parent folders of the folders all exist within the creation array. + if ( untrailingslashit($to) == $dir ) // Skip over the working directory, We know this exists (or will exist) + continue; + if ( strpos($dir, $to) === false ) // If the directory is not within the working directory, Skip it + continue; + + $parent_folder = dirname($dir); + while ( !empty($parent_folder) && untrailingslashit($to) != $parent_folder && !in_array($parent_folder, $needed_dirs) ) { + $needed_dirs[] = $parent_folder; + $parent_folder = dirname($parent_folder); + } + } + asort($needed_dirs); + + // Create those directories if need be: + foreach ( $needed_dirs as $_dir ) { + if ( ! $wp_filesystem->mkdir($_dir, FS_CHMOD_DIR) && ! $wp_filesystem->is_dir($_dir) ) // Only check to see if the Dir exists upon creation failure. Less I/O this way. + return new WP_Error('mkdir_failed', __('Could not create directory.'), $_dir); + } + unset($needed_dirs); + + for ( $i = 0; $i < $z->numFiles; $i++ ) { + if ( ! $info = $z->statIndex($i) ) + return new WP_Error('stat_failed', __('Could not retrieve file from archive.')); + + if ( '/' == substr($info['name'], -1) ) // directory + continue; + + if ( '__MACOSX/' === substr($info['name'], 0, 9) ) // Don't extract the OS X-created __MACOSX directory files + continue; + + $contents = $z->getFromIndex($i); + if ( false === $contents ) + return new WP_Error('extract_failed', __('Could not extract file from archive.'), $info['name']); + + if ( ! $wp_filesystem->put_contents( $to . $info['name'], $contents, FS_CHMOD_FILE) ) + return new WP_Error('copy_failed', __('Could not copy file.'), $to . $info['filename']); + } + + $z->close(); + + return true; +} + +/** + * This function should not be called directly, use unzip_file instead. Attempts to unzip an archive using the PclZip library. + * Assumes that WP_Filesystem() has already been called and set up. + * + * @since 3.0.0 + * @see unzip_file + * @access private + * + * @param string $file Full path and filename of zip archive + * @param string $to Full path on the filesystem to extract archive to + * @param array $needed_dirs A partial list of required folders needed to be created. + * @return mixed WP_Error on failure, True on success + */ +function _unzip_file_pclzip($file, $to, $needed_dirs = array()) { + global $wp_filesystem; require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php'); @@ -508,48 +669,52 @@ function unzip_file($file, $to) { // Is the archive valid? if ( false == ($archive_files = $archive->extract(PCLZIP_OPT_EXTRACT_AS_STRING)) ) - return new WP_Error('incompatible_archive', __('Incompatible archive'), $archive->errorInfo(true)); + return new WP_Error('incompatible_archive', __('Incompatible Archive.'), $archive->errorInfo(true)); if ( 0 == count($archive_files) ) - return new WP_Error('empty_archive', __('Empty archive')); - - $path = explode('/', untrailingslashit($to)); - for ( $i = count($path); $i > 0; $i-- ) { //>0 = first element is empty allways for paths starting with '/' - $tmppath = implode('/', array_slice($path, 0, $i) ); - if ( $fs->is_dir($tmppath) ) { //Found the highest folder that exists, Create from here(ie +1) - for ( $i = $i + 1; $i <= count($path); $i++ ) { - $tmppath = implode('/', array_slice($path, 0, $i) ); - if ( ! $fs->mkdir($tmppath, FS_CHMOD_DIR) ) - return new WP_Error('mkdir_failed', __('Could not create directory'), $tmppath); - } - break; //Exit main for loop - } + return new WP_Error('empty_archive', __('Empty archive.')); + + // Determine any children directories needed (From within the archive) + foreach ( $archive_files as $file ) { + if ( '__MACOSX/' === substr($file['filename'], 0, 9) ) // Skip the OS X-created __MACOSX directory + continue; + + $needed_dirs[] = $to . untrailingslashit( $file['folder'] ? $file['filename'] : dirname($file['filename']) ); } - $to = trailingslashit($to); - foreach ($archive_files as $file) { - $path = $file['folder'] ? $file['filename'] : dirname($file['filename']); - $path = explode('/', $path); - for ( $i = count($path); $i >= 0; $i-- ) { //>=0 as the first element contains data - if ( empty($path[$i]) ) - continue; - $tmppath = $to . implode('/', array_slice($path, 0, $i) ); - if ( $fs->is_dir($tmppath) ) {//Found the highest folder that exists, Create from here - for ( $i = $i + 1; $i <= count($path); $i++ ) { //< count() no file component please. - $tmppath = $to . implode('/', array_slice($path, 0, $i) ); - if ( ! $fs->is_dir($tmppath) && ! $fs->mkdir($tmppath, FS_CHMOD_DIR) ) - return new WP_Error('mkdir_failed', __('Could not create directory'), $tmppath); - } - break; //Exit main for loop - } + $needed_dirs = array_unique($needed_dirs); + foreach ( $needed_dirs as $dir ) { + // Check the parent folders of the folders all exist within the creation array. + if ( untrailingslashit($to) == $dir ) // Skip over the working directory, We know this exists (or will exist) + continue; + if ( strpos($dir, $to) === false ) // If the directory is not within the working directory, Skip it + continue; + + $parent_folder = dirname($dir); + while ( !empty($parent_folder) && untrailingslashit($to) != $parent_folder && !in_array($parent_folder, $needed_dirs) ) { + $needed_dirs[] = $parent_folder; + $parent_folder = dirname($parent_folder); } + } + asort($needed_dirs); - // We've made sure the folders are there, so let's extract the file now: - if ( ! $file['folder'] ) { - if ( !$fs->put_contents( $to . $file['filename'], $file['content']) ) - return new WP_Error('copy_failed', __('Could not copy file'), $to . $file['filename']); - $fs->chmod($to . $file['filename'], FS_CHMOD_FILE); - } + // Create those directories if need be: + foreach ( $needed_dirs as $_dir ) { + if ( ! $wp_filesystem->mkdir($_dir, FS_CHMOD_DIR) && ! $wp_filesystem->is_dir($_dir) ) // Only check to see if the dir exists upon creation failure. Less I/O this way. + return new WP_Error('mkdir_failed', __('Could not create directory.'), $_dir); + } + unset($needed_dirs); + + // Extract the files from the zip + foreach ( $archive_files as $file ) { + if ( $file['folder'] ) + continue; + + if ( '__MACOSX/' === substr($file['filename'], 0, 9) ) // Don't extract the OS X-created __MACOSX directory files + continue; + + if ( ! $wp_filesystem->put_contents( $to . $file['filename'], $file['content'], FS_CHMOD_FILE) ) + return new WP_Error('copy_failed', __('Could not copy file.'), $to . $file['filename']); } return true; } @@ -578,13 +743,13 @@ function copy_dir($from, $to) { // If copy failed, chmod file to 0644 and try again. $wp_filesystem->chmod($to . $filename, 0644); if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true) ) - return new WP_Error('copy_failed', __('Could not copy file'), $to . $filename); + return new WP_Error('copy_failed', __('Could not copy file.'), $to . $filename); } $wp_filesystem->chmod($to . $filename, FS_CHMOD_FILE); } elseif ( 'd' == $fileinfo['type'] ) { if ( !$wp_filesystem->is_dir($to . $filename) ) { if ( !$wp_filesystem->mkdir($to . $filename, FS_CHMOD_DIR) ) - return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $filename); + return new WP_Error('mkdir_failed', __('Could not create directory.'), $to . $filename); } $result = copy_dir($from . $filename, $to . $filename); if ( is_wp_error($result) ) @@ -618,7 +783,7 @@ function WP_Filesystem( $args = false, $context = false ) { if ( ! class_exists("WP_Filesystem_$method") ) { $abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method); - if( ! file_exists($abstraction_file) ) + if ( ! file_exists($abstraction_file) ) return; require_once($abstraction_file); @@ -667,7 +832,7 @@ function WP_Filesystem( $args = false, $context = false ) { function get_filesystem_method($args = array(), $context = false) { $method = defined('FS_METHOD') ? FS_METHOD : false; //Please ensure that this is either 'direct', 'ssh', 'ftpext' or 'ftpsockets' - if( ! $method && function_exists('getmyuid') && function_exists('fileowner') ){ + if ( ! $method && function_exists('getmyuid') && function_exists('fileowner') ){ if ( !$context ) $context = WP_CONTENT_DIR; $context = trailingslashit($context); @@ -701,10 +866,11 @@ function get_filesystem_method($args = array(), $context = false) { * @param string $type the chosen Filesystem method in use * @param boolean $error if the current request has failed to connect * @param string $context The directory which is needed access to, The write-test will be performed on this directory by get_filesystem_method() + * @param string $extra_fields Extra POST fields which should be checked for to be included in the post. * @return boolean False on failure. True on success. */ -function request_filesystem_credentials($form_post, $type = '', $error = false, $context = false) { - $req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error, $context); +function request_filesystem_credentials($form_post, $type = '', $error = false, $context = false, $extra_fields = null) { + $req_cred = apply_filters( 'request_filesystem_credentials', '', $form_post, $type, $error, $context, $extra_fields ); if ( '' !== $req_cred ) return $req_cred; @@ -714,6 +880,9 @@ function request_filesystem_credentials($form_post, $type = '', $error = false, if ( 'direct' == $type ) return true; + if ( is_null( $extra_fields ) ) + $extra_fields = array( 'version', 'locale' ); + $credentials = get_option('ftp_credentials', array( 'hostname' => '', 'username' => '')); // If defined, set it to that, Else, If POST'd, set it to that, If not, Set it to whatever it previously was(saved details in option) @@ -799,22 +968,39 @@ jQuery(function($){

    -

    - +

    - + - - + + - - + + @@ -824,7 +1010,7 @@ jQuery(function($){
    - @@ -834,12 +1020,10 @@ jQuery(function($){
    " size="40" />" size="40" />
    size="40" /> size="40" />
    size="40" /> size="40" />

    size="40" />
    size="40" /> +

    size="40" />
    size="40" />
    $text ) : ?> @@ -848,12 +1032,12 @@ jQuery(function($){
    - - - - - - +'; +} +?>

    diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index 457624ce..e871ae5e 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -39,7 +39,7 @@ function wp_image_editor($post_id, $msg = false) {
    , this)" class="imgedit-crop disabled" title="">
    , this)" title="">
    , this)" title="">
    @@ -96,10 +96,10 @@ function wp_image_editor($post_id, $msg = false) {
    -

    @@ -118,7 +118,7 @@ function wp_image_editor($post_id, $msg = false) {

    - +
    • @@ -453,7 +453,7 @@ function wp_restore_image($post_id) { $meta['file'] = _wp_relative_upload_path( $restored_file ); $meta['width'] = $data['width']; $meta['height'] = $data['height']; - list ( $uwidth, $uheight ) = wp_shrink_dimensions($meta['width'], $meta['height']); + list ( $uwidth, $uheight ) = wp_constrain_dimensions($meta['width'], $meta['height'], 128, 96); $meta['hwstring_small'] = "height='$uheight' width='$uwidth'"; } @@ -598,7 +598,7 @@ function wp_save_image($post_id) { $meta['width'] = imagesx($img); $meta['height'] = imagesy($img); - list ( $uwidth, $uheight ) = wp_shrink_dimensions($meta['width'], $meta['height']); + list ( $uwidth, $uheight ) = wp_constrain_dimensions($meta['width'], $meta['height'], 128, 96); $meta['hwstring_small'] = "height='$uheight' width='$uwidth'"; if ( $success && ('nothumb' == $target || 'all' == $target) ) { diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 903bd5fe..44329c01 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -17,9 +17,12 @@ * * @param mixed $file Filename of the original image, Or attachment id. * @param int $max_side Maximum length of a single side for the thumbnail. + * @param mixed $deprecated Never used. * @return string Thumbnail path on success, Error string on failure. */ function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { + if ( !empty( $deprecated ) ) + _deprecated_argument( __FUNCTION__, '1.2' ); $thumbpath = image_resize( $file, $max_side, $max_side ); return apply_filters( 'wp_create_thumbnail', $thumbpath ); } @@ -38,7 +41,7 @@ function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { * @param int $dst_h The destination height. * @param int $src_abs Optional. If the source crop points are absolute. * @param string $dst_file Optional. The destination file to write to. - * @return string New filepath on success, String error message on failure. + * @return string|WP_Error|false New filepath on success, WP_Error or false on failure. */ function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) { if ( is_numeric( $src_file ) ) // Handle int as attachment ID @@ -46,8 +49,8 @@ function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_ $src = wp_load_image( $src_file ); - if ( !is_resource( $src )) - return $src; + if ( !is_resource( $src ) ) + return new WP_Error( 'error_loading_image', $src, $src_file ); $dst = wp_imagecreatetruecolor( $dst_w, $dst_h ); @@ -91,7 +94,7 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) { $imagesize = getimagesize( $file ); $metadata['width'] = $imagesize[0]; $metadata['height'] = $imagesize[1]; - list($uwidth, $uheight) = wp_shrink_dimensions($metadata['width'], $metadata['height']); + list($uwidth, $uheight) = wp_constrain_dimensions($metadata['width'], $metadata['height'], 128, 96); $metadata['hwstring_small'] = "height='$uheight' width='$uwidth'"; // Make the file path relative to the upload dir @@ -99,13 +102,8 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) { // make thumbnails and other intermediate sizes global $_wp_additional_image_sizes; - $temp_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes - if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) ) - $temp_sizes = array_merge( $temp_sizes, array_keys( $_wp_additional_image_sizes ) ); - $temp_sizes = apply_filters( 'intermediate_image_sizes', $temp_sizes ); - - foreach ( $temp_sizes as $s ) { + foreach ( get_intermediate_image_sizes() as $s ) { $sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => FALSE ); if ( isset( $_wp_additional_image_sizes[$s]['width'] ) ) $sizes[$s]['width'] = intval( $_wp_additional_image_sizes[$s]['width'] ); // For theme-added sizes @@ -139,62 +137,18 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) { return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id ); } -/** - * Load an image from a string, if PHP supports it. - * - * @since 2.1.0 - * - * @param string $file Filename of the image to load. - * @return resource The resulting image resource on success, Error string on failure. - */ -function wp_load_image( $file ) { - if ( is_numeric( $file ) ) - $file = get_attached_file( $file ); - - if ( ! file_exists( $file ) ) - return sprintf(__('File “%s” doesn’t exist?'), $file); - - if ( ! function_exists('imagecreatefromstring') ) - return __('The GD image library is not installed.'); - - // Set artificially high because GD uses uncompressed images in memory - @ini_set('memory_limit', '256M'); - $image = imagecreatefromstring( file_get_contents( $file ) ); - - if ( !is_resource( $image ) ) - return sprintf(__('File “%s” is not an image.'), $file); - - return $image; -} - /** * Calculated the new dimentions for a downsampled image. * * @since 2.0.0 - * @see wp_shrink_dimensions() - * - * @param int $width Current width of the image - * @param int $height Current height of the image - * @return mixed Array(height,width) of shrunk dimensions. - */ -function get_udims( $width, $height) { - return wp_shrink_dimensions( $width, $height ); -} - -/** - * Calculates the new dimentions for a downsampled image. - * - * @since 2.0.0 * @see wp_constrain_dimensions() * * @param int $width Current width of the image * @param int $height Current height of the image - * @param int $wmax Maximum wanted width - * @param int $hmax Maximum wanted height * @return mixed Array(height,width) of shrunk dimensions. */ -function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) { - return wp_constrain_dimensions( $width, $height, $wmax, $hmax ); +function get_udims( $width, $height) { + return wp_constrain_dimensions( $width, $height, 128, 96 ); } /** @@ -244,10 +198,10 @@ function wp_exif_date2ts($str) { * @return bool|array False on failure. Image metadata array on success. */ function wp_read_image_metadata( $file ) { - if ( !file_exists( $file ) ) + if ( ! file_exists( $file ) ) return false; - list(,,$sourceImageType) = getimagesize( $file ); + list( , , $sourceImageType ) = getimagesize( $file ); // exif contains a bunch of data we'll probably never need formatted in ways // that are difficult to use. We'll normalize it and just extract the fields @@ -268,39 +222,83 @@ function wp_read_image_metadata( $file ) { // read iptc first, since it might contain data not available in exif such // as caption, description etc - if ( is_callable('iptcparse') ) { - getimagesize($file, $info); - if ( !empty($info['APP13']) ) { - $iptc = iptcparse($info['APP13']); - if ( !empty($iptc['2#110'][0]) ) // credit + if ( is_callable( 'iptcparse' ) ) { + getimagesize( $file, $info ); + + if ( ! empty( $info['APP13'] ) ) { + $iptc = iptcparse( $info['APP13'] ); + + // headline, "A brief synopsis of the caption." + if ( ! empty( $iptc['2#105'][0] ) ) + $meta['title'] = utf8_encode( trim( $iptc['2#105'][0] ) ); + // title, "Many use the Title field to store the filename of the image, though the field may be used in many ways." + elseif ( ! empty( $iptc['2#005'][0] ) ) + $meta['title'] = utf8_encode( trim( $iptc['2#005'][0] ) ); + + if ( ! empty( $iptc['2#120'][0] ) ) { // description / legacy caption + $caption = utf8_encode( trim( $iptc['2#120'][0] ) ); + if ( empty( $meta['title'] ) ) { + // Assume the title is stored in 2:120 if it's short. + if ( strlen( $caption ) < 80 ) + $meta['title'] = $caption; + else + $meta['caption'] = $caption; + } elseif ( $caption != $meta['title'] ) { + $meta['caption'] = $caption; + } + } + + if ( ! empty( $iptc['2#110'][0] ) ) // credit $meta['credit'] = utf8_encode(trim($iptc['2#110'][0])); - elseif ( !empty($iptc['2#080'][0]) ) // byline + elseif ( ! empty( $iptc['2#080'][0] ) ) // creator / legacy byline $meta['credit'] = utf8_encode(trim($iptc['2#080'][0])); - if ( !empty($iptc['2#055'][0]) and !empty($iptc['2#060'][0]) ) // created date and time - $meta['created_timestamp'] = strtotime($iptc['2#055'][0] . ' ' . $iptc['2#060'][0]); - if ( !empty($iptc['2#120'][0]) ) // caption - $meta['caption'] = utf8_encode(trim($iptc['2#120'][0])); - if ( !empty($iptc['2#116'][0]) ) // copyright - $meta['copyright'] = utf8_encode(trim($iptc['2#116'][0])); - if ( !empty($iptc['2#005'][0]) ) // title - $meta['title'] = utf8_encode(trim($iptc['2#005'][0])); + + if ( ! empty( $iptc['2#055'][0] ) and ! empty( $iptc['2#060'][0] ) ) // created date and time + $meta['created_timestamp'] = strtotime( $iptc['2#055'][0] . ' ' . $iptc['2#060'][0] ); + + if ( ! empty( $iptc['2#116'][0] ) ) // copyright + $meta['copyright'] = utf8_encode( trim( $iptc['2#116'][0] ) ); } } // fetch additional info from exif if available - if ( is_callable('exif_read_data') && in_array($sourceImageType, apply_filters('wp_read_image_metadata_types', array(IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM)) ) ) { + if ( is_callable( 'exif_read_data' ) && in_array( $sourceImageType, apply_filters( 'wp_read_image_metadata_types', array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) ) ) ) { $exif = @exif_read_data( $file ); - if (!empty($exif['FNumber'])) + + if ( !empty( $exif['Title'] ) ) + $meta['title'] = utf8_encode( trim( $exif['Title'] ) ); + + if ( ! empty( $exif['ImageDescription'] ) ) { + if ( empty( $meta['title'] ) && strlen( $exif['ImageDescription'] ) < 80 ) { + // Assume the title is stored in ImageDescription + $meta['title'] = utf8_encode( trim( $exif['ImageDescription'] ) ); + if ( ! empty( $exif['COMPUTED']['UserComment'] ) && trim( $exif['COMPUTED']['UserComment'] ) != $meta['title'] ) + $meta['caption'] = utf8_encode( trim( $exif['COMPUTED']['UserComment'] ) ); + } elseif ( trim( $exif['ImageDescription'] ) != $meta['title'] ) { + $meta['caption'] = utf8_encode( trim( $exif['ImageDescription'] ) ); + } + } elseif ( ! empty( $exif['Comments'] ) && trim( $exif['Comments'] ) != $meta['title'] ) { + $meta['caption'] = utf8_encode( trim( $exif['Comments'] ) ); + } + + if ( ! empty( $exif['Artist'] ) ) + $meta['credit'] = utf8_encode( trim( $exif['Artist'] ) ); + elseif ( ! empty($exif['Author'] ) ) + $meta['credit'] = utf8_encode( trim( $exif['Author'] ) ); + + if ( ! empty( $exif['Copyright'] ) ) + $meta['copyright'] = utf8_encode( trim( $exif['Copyright'] ) ); + if ( ! empty($exif['FNumber'] ) ) $meta['aperture'] = round( wp_exif_frac2dec( $exif['FNumber'] ), 2 ); - if (!empty($exif['Model'])) - $meta['camera'] = trim( $exif['Model'] ); - if (!empty($exif['DateTimeDigitized'])) - $meta['created_timestamp'] = wp_exif_date2ts($exif['DateTimeDigitized']); - if (!empty($exif['FocalLength'])) + if ( ! empty($exif['Model'] ) ) + $meta['camera'] = utf8_encode( trim( $exif['Model'] ) ); + if ( ! empty($exif['DateTimeDigitized'] ) ) + $meta['created_timestamp'] = wp_exif_date2ts($exif['DateTimeDigitized'] ); + if ( ! empty($exif['FocalLength'] ) ) $meta['focal_length'] = wp_exif_frac2dec( $exif['FocalLength'] ); - if (!empty($exif['ISOSpeedRatings'])) - $meta['iso'] = $exif['ISOSpeedRatings']; - if (!empty($exif['ExposureTime'])) + if ( ! empty($exif['ISOSpeedRatings'] ) ) + $meta['iso'] = utf8_encode( trim( $exif['ISOSpeedRatings'] ) ); + if ( ! empty($exif['ExposureTime'] ) ) $meta['shutter_speed'] = wp_exif_frac2dec( $exif['ExposureTime'] ); } diff --git a/wp-admin/includes/manifest.php b/wp-admin/includes/manifest.php index 6b763df4..45348765 100644 --- a/wp-admin/includes/manifest.php +++ b/wp-admin/includes/manifest.php @@ -11,7 +11,7 @@ $mce_ver = "ver=$tinymce_version"; /** * Retrieve list of all cacheable WP files * - * Array format: file, version (optional), bool (whether to use src and set ignoreQuery) + * Array format: file, version (optional), bool (whether to use src and set ignoreQuery, defaults to true) */ function &get_manifest() { global $mce_ver; @@ -23,7 +23,6 @@ function &get_manifest() { array('images/align-right.png'), array('images/archive-link.png'), array('images/blue-grad.png'), - array('images/browse-happy.gif'), array('images/bubble_bg.gif'), array('images/bubble_bg-rtl.gif'), array('images/button-grad.png'), @@ -35,7 +34,6 @@ function &get_manifest() { array('images/fav.png'), array('images/fav-arrow.gif'), array('images/fav-arrow-rtl.gif'), - array('images/fav-top.png'), array('images/generic.png'), array('images/gray-grad.png'), array('images/icons32.png'), @@ -61,7 +59,6 @@ function &get_manifest() { array('images/no.png'), array('images/required.gif'), array('images/resize.gif'), - array('images/screen-options-left.gif'), array('images/screen-options-right.gif'), array('images/screen-options-right-up.gif'), array('images/se.png'), @@ -71,7 +68,7 @@ function &get_manifest() { array('images/white-grad.png'), array('images/white-grad-active.png'), array('images/wordpress-logo.png'), - array('images/wp-logo.gif'), + array('images/wp-logo.png'), array('images/xit.gif'), array('images/yes.png'), array('../wp-includes/images/crystal/archive.png'), @@ -92,70 +89,70 @@ function &get_manifest() { if ( @is_file('../wp-includes/js/tinymce/tiny_mce.js') ) : $mce = array( - array('../wp-includes/js/tinymce/wp-tinymce.php', $mce_ver, true), - - array('../wp-includes/js/tinymce/tiny_mce.js', $mce_ver, true), - array('../wp-includes/js/tinymce/langs/wp-langs-en.js', $mce_ver, true), - array('../wp-includes/js/tinymce/utils/mctabs.js', $mce_ver, true), - array('../wp-includes/js/tinymce/utils/validate.js', $mce_ver, true), - array('../wp-includes/js/tinymce/utils/form_utils.js', $mce_ver, true), - array('../wp-includes/js/tinymce/utils/editable_selects.js', $mce_ver, true), - array('../wp-includes/js/tinymce/tiny_mce_popup.js', $mce_ver, true), - - array('../wp-includes/js/tinymce/themes/advanced/editor_template.js', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/source_editor.htm', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/anchor.htm', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/image.htm', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/link.htm', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/color_picker.htm', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/charmap.htm', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/js/color_picker.js', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/js/charmap.js', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/js/image.js', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/js/link.js', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/js/source_editor.js', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/js/anchor.js', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css', $mce_ver, true), - array('../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css', $mce_ver, true), - - array('../wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm', $mce_ver, true), - - array('../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/inlinepopups/template.htm', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css', $mce_ver, true), - - array('../wp-includes/js/tinymce/plugins/media/editor_plugin.js', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/media/js/media.js', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/media/media.htm', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/media/css/content.css', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/media/css/media.css', $mce_ver, true), - - array('../wp-includes/js/tinymce/plugins/paste/editor_plugin.js', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/paste/js/pasteword.js', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/paste/js/pastetext.js', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/paste/pasteword.htm', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/paste/blank.htm', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/paste/pastetext.htm', $mce_ver, true), - - array('../wp-includes/js/tinymce/plugins/safari/editor_plugin.js', $mce_ver, true), - - array('../wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/spellchecker/css/content.css', $mce_ver, true), - - array('../wp-includes/js/tinymce/plugins/tabfocus/editor_plugin.js', $mce_ver, true), - - array('../wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/wordpress/css/content.css', $mce_ver, true), - - array('../wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css', $mce_ver, true), - array('../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css', $mce_ver, true), - - array('../wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js', $mce_ver, true), + array('../wp-includes/js/tinymce/wp-tinymce.php', $mce_ver), + + array('../wp-includes/js/tinymce/tiny_mce.js', $mce_ver), + array('../wp-includes/js/tinymce/langs/wp-langs-en.js', $mce_ver), + array('../wp-includes/js/tinymce/utils/mctabs.js', $mce_ver), + array('../wp-includes/js/tinymce/utils/validate.js', $mce_ver), + array('../wp-includes/js/tinymce/utils/form_utils.js', $mce_ver), + array('../wp-includes/js/tinymce/utils/editable_selects.js', $mce_ver), + array('../wp-includes/js/tinymce/tiny_mce_popup.js', $mce_ver), + + array('../wp-includes/js/tinymce/themes/advanced/editor_template.js', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/source_editor.htm', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/anchor.htm', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/image.htm', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/link.htm', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/color_picker.htm', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/charmap.htm', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/js/color_picker.js', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/js/charmap.js', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/js/image.js', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/js/link.js', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/js/source_editor.js', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/js/anchor.js', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css', $mce_ver), + array('../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css', $mce_ver), + + array('../wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js', $mce_ver), + array('../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm', $mce_ver), + + array('../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js', $mce_ver), + array('../wp-includes/js/tinymce/plugins/inlinepopups/template.htm', $mce_ver), + array('../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css', $mce_ver), + + array('../wp-includes/js/tinymce/plugins/media/editor_plugin.js', $mce_ver), + array('../wp-includes/js/tinymce/plugins/media/js/media.js', $mce_ver), + array('../wp-includes/js/tinymce/plugins/media/media.htm', $mce_ver), + array('../wp-includes/js/tinymce/plugins/media/css/content.css', $mce_ver), + array('../wp-includes/js/tinymce/plugins/media/css/media.css', $mce_ver), + + array('../wp-includes/js/tinymce/plugins/paste/editor_plugin.js', $mce_ver), + array('../wp-includes/js/tinymce/plugins/paste/js/pasteword.js', $mce_ver), + array('../wp-includes/js/tinymce/plugins/paste/js/pastetext.js', $mce_ver), + array('../wp-includes/js/tinymce/plugins/paste/pasteword.htm', $mce_ver), + array('../wp-includes/js/tinymce/plugins/paste/blank.htm', $mce_ver), + array('../wp-includes/js/tinymce/plugins/paste/pastetext.htm', $mce_ver), + + array('../wp-includes/js/tinymce/plugins/safari/editor_plugin.js', $mce_ver), + + array('../wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js', $mce_ver), + array('../wp-includes/js/tinymce/plugins/spellchecker/css/content.css', $mce_ver), + + array('../wp-includes/js/tinymce/plugins/tabfocus/editor_plugin.js', $mce_ver), + + array('../wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js', $mce_ver), + array('../wp-includes/js/tinymce/plugins/wordpress/css/content.css', $mce_ver), + + array('../wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js', $mce_ver), + array('../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html', $mce_ver), + array('../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js', $mce_ver), + array('../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css', $mce_ver), + array('../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css', $mce_ver), + + array('../wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js', $mce_ver), array('../wp-includes/js/tinymce/themes/advanced/img/icons.gif'), array('../wp-includes/js/tinymce/themes/advanced/img/colorpicker.jpg'), diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 1bfe3e27..405ca9f2 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -177,13 +177,13 @@ win.send_to_editor(''); * * @since unknown * - * @param unknown_type $file_id - * @param unknown_type $post_id - * @param unknown_type $post_data - * @return unknown + * @param string $file_id Index into the {@link $_FILES} array of the upload + * @param int $post_id The post ID the media is associated with + * @param array $post_data allows you to overwrite some of the attachment + * @param array $overrides allows you to override the {@link wp_handle_upload()} behavior + * @return int the ID of the attachment */ -function media_handle_upload($file_id, $post_id, $post_data = array()) { - $overrides = array('test_form'=>false); +function media_handle_upload($file_id, $post_id, $post_data = array(), $overrides = array( 'test_form' => false )) { $time = current_time('mysql'); if ( $post = get_post($post_id) ) { @@ -208,9 +208,9 @@ function media_handle_upload($file_id, $post_id, $post_data = array()) { // use image exif/iptc data for title and caption defaults if possible if ( $image_meta = @wp_read_image_metadata($file) ) { - if ( trim($image_meta['title']) ) + if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) $title = $image_meta['title']; - if ( trim($image_meta['caption']) ) + if ( trim( $image_meta['caption'] ) ) $content = $image_meta['caption']; } @@ -259,9 +259,9 @@ function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = // use image exif/iptc data for title and caption defaults if possible if ( $image_meta = @wp_read_image_metadata($file) ) { - if ( trim($image_meta['title']) ) + if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) $title = $image_meta['title']; - if ( trim($image_meta['caption']) ) + if ( trim( $image_meta['caption'] ) ) $content = $image_meta['caption']; } @@ -306,7 +306,8 @@ function wp_iframe($content_func /* ... */) { wp_enqueue_style( 'global' ); wp_enqueue_style( 'wp-admin' ); wp_enqueue_style( 'colors' ); -if ( 0 === strpos( $content_func, 'media' ) ) +// Check callback name for 'media' +if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) ) || 0 === strpos( $content_func, 'media' ) ) wp_enqueue_style( 'media' ); wp_enqueue_style( 'ie' ); ?> @@ -350,29 +351,49 @@ if ( is_string($content_func) ) * @since unknown */ function media_buttons() { - global $post_ID, $temp_ID; - $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID); + $do_image = $do_audio = $do_video = true; + if ( is_multisite() ) { + $media_buttons = get_site_option( 'mu_media_buttons' ); + if ( empty($media_buttons['image']) ) + $do_image = false; + if ( empty($media_buttons['audio']) ) + $do_audio = false; + if ( empty($media_buttons['video']) ) + $do_video = false; + } + $out = ''; + + if ( $do_image ) + $out .= _media_button(__('Add an Image'), 'images/media-button-image.gif?ver=20100531', 'image'); + if ( $do_video ) + $out .= _media_button(__('Add Video'), 'images/media-button-video.gif?ver=20100531', 'video'); + if ( $do_audio ) + $out .= _media_button(__('Add Audio'), 'images/media-button-music.gif?ver=20100531', 'audio'); + + $out .= _media_button(__('Add Media'), 'images/media-button-other.gif?ver=20100531', 'media'); + $context = apply_filters('media_buttons_context', __('Upload/Insert %s')); - $media_upload_iframe_src = "media-upload.php?post_id=$uploading_iframe_ID"; - $media_title = __('Add Media'); - $image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src&type=image"); - $image_title = __('Add an Image'); - $video_upload_iframe_src = apply_filters('video_upload_iframe_src', "$media_upload_iframe_src&type=video"); - $video_title = __('Add Video'); - $audio_upload_iframe_src = apply_filters('audio_upload_iframe_src', "$media_upload_iframe_src&type=audio"); - $audio_title = __('Add Audio'); - $out = <<$image_title - $video_title - $audio_title - $media_title - -EOF; + printf($context, $out); } add_action( 'media_buttons', 'media_buttons' ); +function _media_button($title, $icon, $type) { + return "$title"; +} + +function get_upload_iframe_src($type) { + global $post_ID, $temp_ID; + $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID); + $upload_iframe_src = add_query_arg('post_id', $uploading_iframe_ID, 'media-upload.php'); + + if ( 'media' != $type ) + $upload_iframe_src = add_query_arg('type', $type, $upload_iframe_src); + $upload_iframe_src = apply_filters($type . '_upload_iframe_src', $upload_iframe_src); + + return add_query_arg('TB_iframe', true, $upload_iframe_src); +} + /** * {@internal Missing Short Description}} * @@ -408,7 +429,7 @@ function media_upload_form_handler() { $post = apply_filters('attachment_fields_to_save', $post, $attachment); - if ( isset($attachment['image_alt']) && !empty($attachment['image_alt']) ) { + if ( isset($attachment['image_alt']) ) { $image_alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true); if ( $image_alt != stripslashes($attachment['image_alt']) ) { $image_alt = wp_strip_all_tags( stripslashes($attachment['image_alt']), true ); @@ -447,8 +468,9 @@ function media_upload_form_handler() { $html = $attachment['post_title']; if ( !empty($attachment['url']) ) { - if ( strpos($attachment['url'], 'attachment_id') || false !== strpos($attachment['url'], get_permalink($_POST['post_id'])) ) - $rel = " rel='attachment wp-att-" . esc_attr($send_id)."'"; + $rel = ''; + if ( strpos($attachment['url'], 'attachment_id') || get_attachment_link($send_id) == $attachment['url'] ) + $rel = " rel='attachment wp-att-" . esc_attr($send_id) . "'"; $html = "$html"; } @@ -819,7 +841,7 @@ function image_align_input_fields( $post, $checked = '' ) { function image_size_input_fields( $post, $check = '' ) { // get a list of the actual pixel dimensions of each possible intermediate version of this image - $size_names = array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full size')); + $size_names = array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full Size')); if ( empty($check) ) $check = get_user_setting('imgsize', 'medium'); @@ -843,12 +865,12 @@ function image_size_input_fields( $post, $check = '' ) { $checked = " checked='checked'"; } - $html = "
      "; + $html = "
      "; $html .= ""; // only show the dimensions if that choice is available if ( $enabled ) - $html .= " "; + $html .= " "; $html .= '
      '; @@ -912,7 +934,7 @@ function image_attachment_fields_to_edit($form_fields, $post) { $form_fields['image_alt'] = array( 'value' => $alt, - 'label' => __('Alternate text'), + 'label' => __('Alternate Text'), 'helps' => __('Alt text for the image, e.g. “The Mona Lisa”') ); @@ -1019,6 +1041,8 @@ function get_attachment_fields_to_edit($post, $errors = null) { $edit_post = sanitize_post($post, 'edit'); + + $form_fields = array( 'post_title' => array( 'label' => __('Title'), @@ -1096,6 +1120,7 @@ function get_attachment_fields_to_edit($post, $errors = null) { * @return string */ function get_media_items( $post_id, $errors ) { + $attachments = array(); if ( $post_id ) { $post = get_post($post_id); if ( $post && $post->post_type == 'attachment' ) @@ -1131,38 +1156,38 @@ function get_media_items( $post_id, $errors ) { function get_media_item( $attachment_id, $args = null ) { global $redir_tab; - if ( ( $attachment_id = intval($attachment_id) ) && $thumb_url = get_attachment_icon_src( $attachment_id ) ) + if ( ( $attachment_id = intval( $attachment_id ) ) && $thumb_url = wp_get_attachment_image_src( $attachment_id, 'thumbnail', true ) ) $thumb_url = $thumb_url[0]; else - return false; + $thumb_url = false; + + $post = get_post( $attachment_id ); - $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true ); + $default_args = array( 'errors' => null, 'send' => post_type_supports(get_post_type($post->post_parent), 'editor'), 'delete' => true, 'toggle' => true, 'show_title' => true ); $args = wp_parse_args( $args, $default_args ); extract( $args, EXTR_SKIP ); - $toggle_on = __('Show'); - $toggle_off = __('Hide'); + $toggle_on = __( 'Show' ); + $toggle_off = __( 'Hide' ); - $post = get_post($attachment_id); + $filename = basename( $post->guid ); + $title = esc_attr( $post->post_title ); - $filename = basename($post->guid); - $title = esc_attr($post->post_title); - - if ( $_tags = get_the_tags($attachment_id) ) { + if ( $_tags = get_the_tags( $attachment_id ) ) { foreach ( $_tags as $tag ) $tags[] = $tag->name; - $tags = esc_attr(join(', ', $tags)); + $tags = esc_attr( join( ', ', $tags ) ); } $post_mime_types = get_post_mime_types(); - $keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type)); - $type = array_shift($keys); + $keys = array_keys( wp_match_mime_types( array_keys( $post_mime_types ), $post->post_mime_type ) ); + $type = array_shift( $keys ); $type_html = ""; - $form_fields = get_attachment_fields_to_edit($post, $errors); + $form_fields = get_attachment_fields_to_edit( $post, $errors ); if ( $toggle ) { - $class = empty($errors) ? 'startclosed' : 'startopen'; + $class = empty( $errors ) ? 'startclosed' : 'startopen'; $toggle_links = " $toggle_on $toggle_off"; @@ -1172,35 +1197,37 @@ function get_media_item( $attachment_id, $args = null ) { } $display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case - $display_title = $show_title ? "
      " . wp_html_excerpt($display_title, 60) . "
      " : ''; + $display_title = $show_title ? "
      " . wp_html_excerpt( $display_title, 60 ) . "
      " : ''; - $gallery = ( (isset($_REQUEST['tab']) && 'gallery' == $_REQUEST['tab']) || (isset($redir_tab) && 'gallery' == $redir_tab) ) ? true : false; + $gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' == $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' == $redir_tab ) ); $order = ''; foreach ( $form_fields as $key => $val ) { if ( 'menu_order' == $key ) { if ( $gallery ) - $order = ''; + $order = ""; else - $order = ''; + $order = ""; - unset($form_fields['menu_order']); + unset( $form_fields['menu_order'] ); break; } } $media_dims = ''; - $meta = wp_get_attachment_metadata($post->ID); - if ( is_array($meta) && array_key_exists('width', $meta) && array_key_exists('height', $meta) ) - $media_dims .= "{$meta['width']} × {$meta['height']} "; - $media_dims = apply_filters('media_meta', $media_dims, $post); + $meta = wp_get_attachment_metadata( $post->ID ); + if ( is_array( $meta ) && array_key_exists( 'width', $meta ) && array_key_exists( 'height', $meta ) ) + $media_dims .= "{$meta['width']} × {$meta['height']} "; + $media_dims = apply_filters( 'media_meta', $media_dims, $post ); $image_edit_button = ''; - if ( gd_edit_image_support($post->post_mime_type) ) { - $nonce = wp_create_nonce("image_editor-$post->ID"); - $image_edit_button = " "; + if ( gd_edit_image_support( $post->post_mime_type ) ) { + $nonce = wp_create_nonce( "image_editor-$post->ID" ); + $image_edit_button = " "; } + $attachment_url = get_permalink( $attachment_id ); + $item = " $type_html $toggle_links @@ -1208,18 +1235,23 @@ function get_media_item( $attachment_id, $args = null ) { $display_title - - - - - - \n"; + + + \n"; + - if ( !empty($media_dims) ) - $item .= "\n"; $item .= " - @@ -1234,13 +1266,18 @@ function get_media_item( $attachment_id, $args = null ) { if ( $send ) $send = ""; - if ( $delete && current_user_can('delete_post', $attachment_id) ) { + if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) { if ( !EMPTY_TRASH_DAYS ) { - $delete = "" . __('Delete Permanently') . ""; + $delete = "" . __( 'Delete Permanently' ) . ''; } elseif ( !MEDIA_TRASH ) { - $delete = "" . __('Delete') . "
      " . sprintf(__("You are about to delete %s."), $filename) . " " . __('Continue') . " " . __('Cancel') . "
      "; + $delete = "" . __( 'Delete' ) . " + "; } else { - $delete = "" . __('Move to Trash') . "" . __('Undo') . ""; + $delete = "" . __( 'Move to Trash' ) . " + "; } } else { $delete = ''; @@ -1249,14 +1286,16 @@ function get_media_item( $attachment_id, $args = null ) { $thumbnail = ''; $calling_post_id = 0; if ( isset( $_GET['post_id'] ) ) - $calling_post_id = $_GET['post_id']; + $calling_post_id = absint( $_GET['post_id'] ); elseif ( isset( $_POST ) && count( $_POST ) ) // Like for async-upload where $_GET['post_id'] isn't set $calling_post_id = $post->post_parent; - if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) - $thumbnail = "" . esc_html__( "Use as thumbnail" ) . ""; + if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) { + $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" ); + $thumbnail = "" . esc_html__( "Use as featured image" ) . ""; + } - if ( ( $send || $thumbnail || $delete ) && !isset($form_fields['buttons']) ) - $form_fields['buttons'] = array('tr' => "\t\t\n"); + if ( ( $send || $thumbnail || $delete ) && !isset( $form_fields['buttons'] ) ) + $form_fields['buttons'] = array( 'tr' => "\t\t\n" ); $hidden_fields = array(); @@ -1264,12 +1303,12 @@ function get_media_item( $attachment_id, $args = null ) { if ( $id{0} == '_' ) continue; - if ( !empty($field['tr']) ) { + if ( !empty( $field['tr'] ) ) { $item .= $field['tr']; continue; } - $field = array_merge($defaults, $field); + $field = array_merge( $defaults, $field ); $name = "attachments[$attachment_id][$id]"; if ( $field['input'] == 'hidden' ) { @@ -1277,30 +1316,30 @@ function get_media_item( $attachment_id, $args = null ) { continue; } - $required = $field['required'] ? '*' : ''; + $required = $field['required'] ? '*' : ''; $aria_required = $field['required'] ? " aria-required='true' " : ''; $class = $id; $class .= $field['required'] ? ' form-required' : ''; - $item .= "\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n"; $extra_rows = array(); - if ( !empty($field['errors']) ) - foreach ( array_unique((array) $field['errors']) as $error ) + if ( !empty( $field['errors'] ) ) + foreach ( array_unique( (array) $field['errors'] ) as $error ) $extra_rows['error'][] = $error; - if ( !empty($field['extra_rows']) ) + if ( !empty( $field['extra_rows'] ) ) foreach ( $field['extra_rows'] as $class => $rows ) foreach ( (array) $rows as $html ) $extra_rows[$class][] = $html; @@ -1310,7 +1349,7 @@ function get_media_item( $attachment_id, $args = null ) { $item .= "\t\t\n"; } - if ( !empty($form_fields['_final']) ) + if ( !empty( $form_fields['_final'] ) ) $item .= "\t\t\n"; $item .= "\t\n"; $item .= "\t
      " . __('File name:') . " $filename
      " . __('File type:') . " $post->post_mime_type
      " . __('Upload date:') . " " . mysql2date( get_option('date_format'), $post->post_date ) . "
      +

      +

      $image_edit_button

      +
      +

      " . __('File name:') . " $filename

      +

      " . __('File type:') . " $post->post_mime_type

      +

      " . __('Upload date:') . " " . mysql2date( get_option('date_format'), $post->post_date ). '

      '; + if ( !empty( $media_dims ) ) + $item .= "

      " . __('Dimensions:') . " $media_dims

      \n"; + + $item .= "
      " . __('Dimensions:') . " $media_dims
      $image_edit_button
      $send $thumbnail $delete
      $send $thumbnail $delete
      "; - if ( !empty($field[$field['input']]) ) - $item .= $field[$field['input']]; + $item .= "\t\t
      "; + if ( !empty( $field[ $field['input'] ] ) ) + $item .= $field[ $field['input'] ]; elseif ( $field['input'] == 'textarea' ) { - $item .= ""; + $item .= "'; } else { - $item .= ""; + $item .= ""; } - if ( !empty($field['helps']) ) - $item .= "

      " . join( "

      \n

      ", array_unique((array) $field['helps']) ) . '

      '; + if ( !empty( $field['helps'] ) ) + $item .= "

      " . join( "

      \n

      ", array_unique( (array) $field['helps'] ) ) . '

      '; $item .= "
      $html
      {$form_fields['_final']}
      \n"; @@ -1318,11 +1357,10 @@ function get_media_item( $attachment_id, $args = null ) { foreach ( $hidden_fields as $name => $value ) $item .= "\t\n"; - if ( $post->post_parent < 1 && isset($_REQUEST['post_id']) ) { + if ( $post->post_parent < 1 && isset( $_REQUEST['post_id'] ) ) { $parent = (int) $_REQUEST['post_id']; $parent_name = "attachments[$attachment_id][post_parent]"; - - $item .= "\t\n"; + $item .= "\t\n"; } return $item; @@ -1356,12 +1394,22 @@ function media_upload_form( $errors = null ) { // If Mac and mod_security, no Flash. :( $flash = true; - if ( false !== strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mac') && apache_mod_loaded('mod_security') ) + if ( false !== stripos($_SERVER['HTTP_USER_AGENT'], 'mac') && apache_mod_loaded('mod_security') ) $flash = false; $flash = apply_filters('flash_uploader', $flash); $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0; + $upload_size_unit = $max_upload_size = wp_max_upload_size(); + $sizes = array( 'KB', 'MB', 'GB' ); + for ( $u = -1; $upload_size_unit > 1024 && $u < count( $sizes ) - 1; $u++ ) + $upload_size_unit /= 1024; + if ( $u < 0 ) { + $upload_size_unit = 0; + $u = 0; + } else { + $upload_size_unit = (int) $upload_size_unit; + } ?> -
      +
      @@ -1443,6 +1497,7 @@ SWFUpload.onload = function() {
      +

      @@ -1455,6 +1510,7 @@ SWFUpload.onload = function() {

      +

      @@ -1476,7 +1532,7 @@ SWFUpload.onload = function() { function media_upload_type_form($type = 'file', $errors = null, $id = null) { media_upload_header(); - $post_id = intval($_REQUEST['post_id']); + $post_id = isset( $_REQUEST['post_id'] )? intval( $_REQUEST['post_id'] ) : 0; $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id"); $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type); @@ -1518,6 +1574,7 @@ if ( $id ) {

      + '; + else document.getElementById('status_img').innerHTML = ''; }, updateImageData : function() { @@ -1607,7 +1664,7 @@ var addExtImage = { t.width = t.preloadImg.width; t.height = t.preloadImg.height; document.getElementById('go_button').style.color = '#333'; - document.getElementById('status_img').innerHTML = ''; + document.getElementById('status_img').innerHTML = ''; }, getImageData : function() { @@ -1617,7 +1674,7 @@ var addExtImage = { t.resetImageData(); return false; } - document.getElementById('status_img').innerHTML = ''; + document.getElementById('status_img').innerHTML = ''; t.preloadImg = new Image(); t.preloadImg.onload = t.updateImageData; t.preloadImg.onerror = t.resetImageData; @@ -1677,7 +1734,7 @@ jQuery(function($){ | | - +
      @@ -1803,7 +1860,7 @@ function media_upload_library_form($errors) { $start = ( $_GET['paged'] - 1 ) * 10; if ( $start < 1 ) $start = 0; - add_filter( 'post_limits', $limit_filter = create_function( '$a', "return 'LIMIT $start, 10';" ) ); + add_filter( 'post_limits', create_function( '$a', "return 'LIMIT $start, 10';" ) ); list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query(); @@ -1950,7 +2007,6 @@ jQuery(function($){ * @return unknown */ function type_url_form_image() { - if ( !apply_filters( 'disable_captions', '' ) ) { $caption = ' @@ -2019,13 +2075,7 @@ function type_url_form_image() {

      ' . __('Enter a link URL or click above for presets.') . '

      - - - - - - - + ' . _insert_into_post_button('image') . ' '; @@ -2056,12 +2106,7 @@ function type_url_form_audio() { ' . __('Link text, e.g. “Still Alive by Jonathan Coulton”') . ' - - - - - - + ' . _insert_into_post_button('audio') . ' '; } @@ -2091,12 +2136,7 @@ function type_url_form_video() { ' . __('Link text, e.g. “Lucy on YouTube“') . ' - - - - - - + ' . _insert_into_post_button('video') . ' '; } @@ -2126,14 +2166,34 @@ function type_url_form_file() { ' . __('Link text, e.g. “Ransom Demands (PDF)”') . ' + ' . _insert_into_post_button('file') . ' + +'; +} + + +function _insert_into_post_button($type) { + if ( !post_type_supports(get_post_type($_GET['post_id']), 'editor') ) + return ''; + + if ( 'image' == $type ) + return ' + + + + + + + '; + + return ' - -'; + '; } /** @@ -2171,7 +2231,7 @@ function media_upload_flash_bypass() { * @since unknown */ function media_upload_html_bypass($flash = true) { - echo '

      '; + echo '

      '; _e('You are using the Browser uploader.'); if ( $flash ) { // the user manually selected the browser uploader, so let them switch back to Flash @@ -2215,4 +2275,3 @@ add_action('media_upload_file', 'media_upload_file'); add_filter('media_upload_gallery', 'media_upload_gallery'); add_filter('media_upload_library', 'media_upload_library'); - diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index d5e9cb7e..0f8b339b 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -13,7 +13,8 @@ function post_submit_meta_box($post) { global $action; $post_type = $post->post_type; - $can_publish = current_user_can("publish_${post_type}s"); + $post_type_object = get_post_type_object($post_type); + $can_publish = current_user_can($post_type_object->cap->publish_posts); ?>

      @@ -69,8 +70,12 @@ switch ( $post->post_status ) { _e('Pending Review'); break; case 'draft': + case 'auto-draft': _e('Draft'); break; + case 'auto-draft': + _e('Unsaved'); + break; } ?> @@ -78,7 +83,7 @@ switch ( $post->post_status ) { post_status ) { ?>style="display:none;" class="edit-post-status hide-if-no-js" tabindex='4'>
      - + @@ -184,20 +193,18 @@ if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
      ID ) ) { - if ( !EMPTY_TRASH_DAYS ) { - $delete_url = wp_nonce_url( add_query_arg( array('action' => 'delete', 'post' => $post->ID) ), "delete-${post_type}_{$post->ID}" ); +if ( current_user_can( "delete_post", $post->ID ) ) { + if ( !EMPTY_TRASH_DAYS ) $delete_text = __('Delete Permanently'); - } else { - $delete_url = wp_nonce_url( add_query_arg( array('action' => 'trash', 'post' => $post->ID) ), "trash-${post_type}_{$post->ID}" ); + else $delete_text = __('Move to Trash'); - } ?> -" href=""> +
      - + post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { if ( $can_publish ) : @@ -235,26 +242,38 @@ if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 * @param object $post */ function post_tags_meta_box($post, $box) { - $tax_name = esc_attr(substr($box['id'], 8)); - $taxonomy = get_taxonomy($tax_name); - $helps = isset($taxonomy->helps) ? esc_attr($taxonomy->helps) : __('Separate tags with commas.'); + $defaults = array('taxonomy' => 'post_tag'); + if ( !isset($box['args']) || !is_array($box['args']) ) + $args = array(); + else + $args = $box['args']; + extract( wp_parse_args($args, $defaults), EXTR_SKIP ); + $tax_name = esc_attr($taxonomy); + $taxonomy = get_taxonomy($taxonomy); + $disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : ''; ?>
      -

      -
      - +

      labels->add_or_remove_items; ?>

      +
      + cap->assign_terms) ) : ?>
      -
      - - -
      -

      +
      labels->add_new_item; ?>
      +

      +

      +
      +

      labels->separate_items_with_commas ); ?>

      + +
      -

      +cap->assign_terms) ) : ?> +

      labels->choose_from_most_used; ?>

      + +

      + -
        -
      • -
      • -
      - - - -
      -
        -ID, false, false, $popular_ids) ?> -
      -
      - - -
      -

      -

      - - 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category') ) ); ?> - - -

      -
      - 'category'); + if ( !isset($box['args']) || !is_array($box['args']) ) + $args = array(); + else + $args = $box['args']; + extract( wp_parse_args($args, $defaults), EXTR_SKIP ); + $tax = get_taxonomy($taxonomy); + + ?> +
      + + + + +
      + "; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. + ?> +
        + ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids ) ) ?> +
      +
      + cap->assign_terms) ) : ?> +

      + + cap->edit_terms) ) : ?> +
      +

      + + labels->add_new_item ); + ?> + +

      +

      + + + + $taxonomy, 'hide_empty' => 0, 'name' => 'new'.$taxonomy.'_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —', 'tab_index' => 3 ) ); ?> + + + +

      +
      + +
      +


      ()

      -

      pingbacks, no other action necessary.'); ?>

      +

      pingbacks, no other action necessary.'); ?>

      -
      - +
      +

      - - + -

      +

      post_type); + if ( $post_type_object->hierarchical ) { + $pages = wp_dropdown_pages(array('post_type' => $post->post_type, 'exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('(no parent)'), 'sort_column'=> 'menu_order, post_title', 'echo' => 0)); + if ( ! empty($pages) ) { ?> -
      - - $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?> -

      +

      + + -
      + } // end empty pages check + } // end hierarchical check. + if ( 'page' == $post->post_type && 0 != count( get_page_templates() ) ) { + $template = !empty($post->page_template) ? $post->page_template : false; + ?> +

      -

      -
      -

      -

      +

      +

      +

      post_type ) _e( 'Need help? Use the Help tab in the upper right of your screen.' ); ?>

      -
        +
        @@ -614,13 +678,13 @@ function link_target_meta_box($link) { ?>

        +_blank — new window or tab.'); ?>

        +_top — current window or tab, with no frames.'); ?>

        +_none — same window or tab.'); ?>

        * * @param string $class * @param string $value - * @param mixed $deprecated Not used. + * @param mixed $deprecated Never used. */ -function xfn_check($class, $value = '', $deprecated = '') { +function xfn_check( $class, $value = '', $deprecated = '' ) { global $link; + if ( !empty( $deprecated ) ) + _deprecated_argument( __FUNCTION__, '0.0' ); // Never implemented + $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; $rels = preg_split('/\s+/', $link_rel); @@ -684,13 +751,13 @@ function link_xfn_meta_box($link) {
        + /> + /> + /> + />
        @@ -716,13 +783,13 @@ function link_xfn_meta_box($link) {
        @@ -730,22 +797,22 @@ function link_xfn_meta_box($link) {
        diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 96bcab3e..1ecb3a05 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -120,12 +120,15 @@ function insert_with_markers( $filename, $marker, $insertion ) { * @since unknown */ function save_mod_rewrite_rules() { + if ( is_multisite() ) + return; + global $wp_rewrite; $home_path = get_home_path(); $htaccess_file = $home_path.'.htaccess'; - // If the file doesn't already exists check for write access to the directory and whether of not we have some rules. + // If the file doesn't already exist check for write access to the directory and whether we have some rules. // else check for write access to the file. if ((!file_exists($htaccess_file) && is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks()) || is_writable($htaccess_file)) { if ( got_mod_rewrite() ) { @@ -227,26 +230,28 @@ function url_shorten( $url ) { } /** - * {@internal Missing Short Description}} + * Resets global variables based on $_GET and $_POST + * + * This function resets global variables based on the names passed + * in the $vars array to the value of $_POST[$var] or $_GET[$var] or '' + * if neither is defined. * * @since unknown * - * @param unknown_type $vars + * @param array $vars An array of globals to reset. */ function wp_reset_vars( $vars ) { for ( $i=0; $iget_error_data() ) + if ( is_wp_error($message) ){ + if ( $message->get_error_data() ) $message = $message->get_error_message() . ': ' . $message->get_error_data(); else $message = $message->get_error_message(); } echo "

        $message

        \n"; + wp_ob_end_flush_all(); + flush(); } function wp_doc_link_parse( $content ) { @@ -305,76 +312,6 @@ function wp_doc_link_parse( $content ) { return $out; } -/** - * Determines the language to use for CodePress syntax highlighting, - * based only on a filename. - * - * @since 2.8 - * - * @param string $filename The name of the file to be highlighting -**/ -function codepress_get_lang( $filename ) { - $codepress_supported_langs = apply_filters( 'codepress_supported_langs', - array( '.css' => 'css', - '.js' => 'javascript', - '.php' => 'php', - '.html' => 'html', - '.htm' => 'html', - '.txt' => 'text' - ) ); - $extension = substr( $filename, strrpos( $filename, '.' ) ); - if ( $extension && array_key_exists( $extension, $codepress_supported_langs ) ) - return $codepress_supported_langs[$extension]; - - return 'generic'; -} - -/** - * Adds Javascript required to make CodePress work on the theme/plugin editors. - * - * This code is attached to the action admin_print_footer_scripts. - * - * @since 2.8 -**/ -function codepress_footer_js() { - // Script-loader breaks CP's automatic path-detection, thus CodePress.path - // CP edits in an iframe, so we need to grab content back into normal form - ?> -ID, $option, $value); + update_user_meta($user->ID, $option, $value); wp_redirect( remove_query_arg( array('pagenum', 'apage', 'paged'), wp_get_referer() ) ); exit; } @@ -474,7 +420,7 @@ function iis7_rewrite_rule_exists($filename) { if ( $doc->load($filename) === false ) return false; $xpath = new DOMXPath($doc); - $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[@name=\'wordpress\']'); + $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]'); if ( $rules->length == 0 ) return false; else @@ -503,7 +449,7 @@ function iis7_delete_rewrite_rule($filename) { if ( $doc -> load($filename) === false ) return false; $xpath = new DOMXPath($doc); - $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[@name=\'wordpress\']'); + $rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]'); if ( $rules->length > 0 ) { $child = $rules->item(0); $parent = $child->parentNode; @@ -543,7 +489,7 @@ function iis7_add_rewrite_rule($filename, $rewrite_rule) { $xpath = new DOMXPath($doc); // First check if the rule already exists as in that case there is no need to re-add it - $wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[@name=\'wordpress\']'); + $wordpress_rules = $xpath->query('/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')]'); if ( $wordpress_rules->length > 0 ) return true; @@ -639,4 +585,33 @@ function win_is_writable($path) { unlink($path); return true; } + +/** + * Display the default admin color scheme picker (Used in user-edit.php) + * + * @since 3.0.0 + */ +function admin_color_scheme_picker() { + global $_wp_admin_css_colors, $user_id; ?> +
        + $color_info ): ?> +
        /> + + + colors as $html_color ): ?> + + + +
         
        + + +
        + +
        + diff --git a/wp-admin/includes/ms-deprecated.php b/wp-admin/includes/ms-deprecated.php new file mode 100644 index 00000000..e7b017be --- /dev/null +++ b/wp-admin/includes/ms-deprecated.php @@ -0,0 +1,68 @@ + \ No newline at end of file diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php new file mode 100644 index 00000000..ae23b7f8 --- /dev/null +++ b/wp-admin/includes/ms.php @@ -0,0 +1,897 @@ + ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) ) + $file['error'] = sprintf(__('This file is too big. Files must be less than %1$s KB in size.'), get_site_option( 'fileupload_maxk', 1500 ) ); + if ( upload_is_user_over_quota( false ) ) { + $file['error'] = __( 'You have used your space quota. Please delete files before uploading.' ); + } + if ( $file['error'] != '0' && !isset($_POST['html-upload']) ) + wp_die( $file['error'] . ' ' . __( 'Back' ) . '' ); + + return $file; +} +add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' ); + +/** + * Delete a blog + * + * @since 3.0.0 + * + * @param int $blog_id Blog ID + * @param bool $drop True if blog's table should be dropped. Default is false. + * @return void + */ +function wpmu_delete_blog( $blog_id, $drop = false ) { + global $wpdb; + + $switch = false; + if ( $blog_id != $wpdb->blogid ) { + $switch = true; + switch_to_blog( $blog_id ); + } + + $blog_prefix = $wpdb->get_blog_prefix( $blog_id ); + + do_action( 'delete_blog', $blog_id, $drop ); + + $users = get_users_of_blog( $blog_id ); + + // Remove users from this blog. + if ( ! empty( $users ) ) { + foreach ( $users as $user ) { + remove_user_from_blog( $user->user_id, $blog_id) ; + } + } + + update_blog_status( $blog_id, 'deleted', 1 ); + + if ( $drop ) { + if ( substr( $blog_prefix, -1 ) == '_' ) + $blog_prefix = substr( $blog_prefix, 0, -1 ) . '\_'; + + $drop_tables = $wpdb->get_results( "SHOW TABLES LIKE '{$blog_prefix}%'", ARRAY_A ); + $drop_tables = apply_filters( 'wpmu_drop_tables', $drop_tables ); + + reset( $drop_tables ); + foreach ( (array) $drop_tables as $drop_table) { + $wpdb->query( "DROP TABLE IF EXISTS ". current( $drop_table ) ."" ); + } + $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->blogs WHERE blog_id = %d", $blog_id ) ); + $dir = apply_filters( 'wpmu_delete_blog_upload_dir', WP_CONTENT_DIR . "/blogs.dir/{$blog_id}/files/", $blog_id ); + $dir = rtrim( $dir, DIRECTORY_SEPARATOR ); + $top_dir = $dir; + $stack = array($dir); + $index = 0; + + while ( $index < count( $stack ) ) { + # Get indexed directory from stack + $dir = $stack[$index]; + + $dh = @opendir( $dir ); + if ( $dh ) { + while ( ( $file = @readdir( $dh ) ) !== false ) { + if ( $file == '.' || $file == '..' ) + continue; + + if ( @is_dir( $dir . DIRECTORY_SEPARATOR . $file ) ) + $stack[] = $dir . DIRECTORY_SEPARATOR . $file; + else if ( @is_file( $dir . DIRECTORY_SEPARATOR . $file ) ) + @unlink( $dir . DIRECTORY_SEPARATOR . $file ); + } + } + $index++; + } + + $stack = array_reverse( $stack ); // Last added dirs are deepest + foreach( (array) $stack as $dir ) { + if ( $dir != $top_dir) + @rmdir( $dir ); + } + } + + $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key = '{$blog_prefix}autosave_draft_ids'" ); + $blogs = get_site_option( 'blog_list' ); + if ( is_array( $blogs ) ) { + foreach ( $blogs as $n => $blog ) { + if ( $blog['blog_id'] == $blog_id ) + unset( $blogs[$n] ); + } + update_site_option( 'blog_list', $blogs ); + } + + if ( $switch === true ) + restore_current_blog(); +} + +// @todo Merge with wp_delete_user() ? +function wpmu_delete_user( $id ) { + global $wpdb; + + $id = (int) $id; + + do_action( 'wpmu_delete_user', $id ); + + $blogs = get_blogs_of_user( $id ); + + if ( ! empty( $blogs ) ) { + foreach ( $blogs as $blog ) { + switch_to_blog( $blog->userblog_id ); + remove_user_from_blog( $id, $blog->userblog_id ); + + $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id ) ); + foreach ( (array) $post_ids as $post_id ) { + wp_delete_post( $post_id ); + } + + // Clean links + $link_ids = $wpdb->get_col( $wpdb->prepare( "SELECT link_id FROM $wpdb->links WHERE link_owner = %d", $id ) ); + + if ( $link_ids ) { + foreach ( $link_ids as $link_id ) + wp_delete_link( $link_id ); + } + + restore_current_blog(); + } + } + + $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->users WHERE ID = %d", $id ) ); + $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id ) ); + + clean_user_cache( $id ); + + // allow for commit transaction + do_action( 'deleted_user', $id ); + + return true; +} + +function confirm_delete_users( $users ) { + global $current_user; + if ( !is_array( $users ) ) + return false; + + screen_icon(); + ?> +

        +

        +
        + + ID'>$current_user->user_login"; + + foreach ( ( $allusers = (array) $_POST['allusers'] ) as $key => $val ) { + if ( $val != '' && $val != '0' ) { + $delete_user = new WP_User( $val ); + + if ( in_array( $delete_user->user_login, $site_admins ) ) + wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a network admnistrator.' ), $delete_user->user_login ) ); + + echo "\n"; + $blogs = get_blogs_of_user( $val, true ); + + if ( !empty( $blogs ) ) { + ?> +

        %s?" ), $delete_user->user_login ); ?>

        + $details ) { + $blog_users = get_users_of_blog( $details->userblog_id ); + if ( is_array( $blog_users ) && !empty( $blog_users ) ) { + $user_site = "{$details->blogname}"; + $user_dropdown = "\n"; + ?> +
          +
        • +
        • +
        • +
        + "; + } + } + } + ?> +

        + + $theme ) { + $theme_key = esc_html( $theme['Stylesheet'] ); + if ( isset( $blog_allowed_themes[$key] ) == true ) { + $blog_allowedthemes[$theme_key] = 1; + } + } + $blog_allowed_themes = $blog_allowedthemes; + add_option( 'allowedthemes', $blog_allowed_themes ); + delete_option( 'allowed_themes' ); + } + } + + if ( $blog_id != 0 ) + restore_current_blog(); + + return $blog_allowed_themes; +} + +function update_option_new_admin_email( $old_value, $value ) { + $email = get_option( 'admin_email' ); + if ( $value == get_option( 'admin_email' ) || !is_email( $value ) ) + return; + + $hash = md5( $value. time() .mt_rand() ); + $new_admin_email = array( + 'hash' => $hash, + 'newemail' => $value + ); + update_option( 'adminhash', $new_admin_email ); + + $content = apply_filters( 'new_admin_email_content', __( "Dear user, + +You recently requested to have the administration email address on +your site changed. +If this is correct, please click on the following link to change it: +###ADMIN_URL### + +You can safely ignore and delete this email if you do not want to +take this action. + +This email has been sent to ###EMAIL### + +Regards, +All at ###SITENAME### +###SITEURL### "), $new_admin_email ); + + $content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'options.php?adminhash='.$hash ) ), $content ); + $content = str_replace( '###EMAIL###', $value, $content ); + $content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content ); + $content = str_replace( '###SITEURL###', network_home_url(), $content ); + + wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), get_option( 'blogname' ) ), $content ); +} +add_action( 'update_option_new_admin_email', 'update_option_new_admin_email', 10, 2 ); +add_action( 'add_option_new_admin_email', 'update_option_new_admin_email', 10, 2 ); + +function send_confirmation_on_profile_email() { + global $errors, $wpdb, $current_user; + if ( ! is_object($errors) ) + $errors = new WP_Error(); + + if ( $current_user->id != $_POST['user_id'] ) + return false; + + if ( $current_user->user_email != $_POST['email'] ) { + if ( !is_email( $_POST['email'] ) ) { + $errors->add( 'user_email', __( "ERROR: The e-mail address isn't correct." ), array( 'form-field' => 'email' ) ); + return; + } + + if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM {$wpdb->users} WHERE user_email=%s", $_POST['email'] ) ) ) { + $errors->add( 'user_email', __( "ERROR: The e-mail address is already used." ), array( 'form-field' => 'email' ) ); + delete_option( $current_user->ID . '_new_email' ); + return; + } + + $hash = md5( $_POST['email'] . time() . mt_rand() ); + $new_user_email = array( + 'hash' => $hash, + 'newemail' => $_POST['email'] + ); + update_option( $current_user->ID . '_new_email', $new_user_email ); + + $content = apply_filters( 'new_user_email_content', __( "Dear user, + +You recently requested to have the email address on your account changed. +If this is correct, please click on the following link to change it: +###ADMIN_URL### + +You can safely ignore and delete this email if you do not want to +take this action. + +This email has been sent to ###EMAIL### + +Regards, +All at ###SITENAME### +###SITEURL###" ), $new_user_email ); + + $content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'profile.php?newuseremail='.$hash ) ), $content ); + $content = str_replace( '###EMAIL###', $_POST['email'], $content); + $content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content ); + $content = str_replace( '###SITEURL###', network_home_url(), $content ); + + wp_mail( $_POST['email'], sprintf( __( '[%s] New Email Address' ), get_option( 'blogname' ) ), $content ); + $_POST['email'] = $current_user->user_email; + } +} +add_action( 'personal_options_update', 'send_confirmation_on_profile_email' ); + +function new_user_email_admin_notice() { + global $current_user; + if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET['updated'] ) && $email = get_option( $current_user->ID . '_new_email' ) ) + echo "
        " . sprintf( __( "Your email address has not been updated yet. Please check your inbox at %s for a confirmation email." ), $email['newemail'] ) . "
        "; +} +add_action( 'admin_notices', 'new_user_email_admin_notice' ); + +function get_site_allowed_themes() { + $themes = get_themes(); + $allowed_themes = get_site_option( 'allowedthemes' ); + if ( !is_array( $allowed_themes ) || empty( $allowed_themes ) ) { + $allowed_themes = get_site_option( 'allowed_themes' ); // convert old allowed_themes format + if ( !is_array( $allowed_themes ) ) { + $allowed_themes = array(); + } else { + foreach( (array) $themes as $key => $theme ) { + $theme_key = esc_html( $theme['Stylesheet'] ); + if ( isset( $allowed_themes[ $key ] ) == true ) { + $allowedthemes[ $theme_key ] = 1; + } + } + $allowed_themes = $allowedthemes; + } + } + return $allowed_themes; +} + +/** + * Determines if there is any upload space left in the current blog's quota. + * + * @since 3.0.0 + * @return bool True if space is available, false otherwise. + */ +function is_upload_space_available() { + if ( get_site_option( 'upload_space_check_disabled' ) ) + return true; + + if ( !( $space_allowed = get_upload_space_available() ) ) + return false; + + return true; +} + +/* + * @since 3.0.0 + * + * @return int of upload size limit in bytes + */ +function upload_size_limit_filter( $size ) { + $fileupload_maxk = 1024 * get_site_option( 'fileupload_maxk', 1500 ); + return min( $size, $fileupload_maxk, get_upload_space_available() ); +} +/** + * Determines if there is any upload space left in the current blog's quota. + * + * @return int of upload space available in bytes + */ +function get_upload_space_available() { + $space_allowed = get_space_allowed() * 1024 * 1024; + if ( get_site_option( 'upload_space_check_disabled' ) ) + return $space_allowed; + + $dir_name = trailingslashit( BLOGUPLOADDIR ); + if ( !( is_dir( $dir_name) && is_readable( $dir_name ) ) ) + return $space_allowed; + + $dir = dir( $dir_name ); + $size = 0; + + while ( $file = $dir->read() ) { + if ( $file != '.' && $file != '..' ) { + if ( is_dir( $dir_name . $file) ) { + $size += get_dirsize( $dir_name . $file ); + } else { + $size += filesize( $dir_name . $file ); + } + } + } + $dir->close(); + + if ( ( $space_allowed - $size ) <= 0 ) + return 0; + + return $space_allowed - $size; +} + +/** + * Returns the upload quota for the current blog. + * + * @return int Quota + */ +function get_space_allowed() { + $space_allowed = get_option( 'blog_upload_space' ); + if ( $space_allowed == false ) + $space_allowed = get_site_option( 'blog_upload_space' ); + if ( empty( $space_allowed ) || !is_numeric( $space_allowed ) ) + $space_allowed = 50; + + return $space_allowed; +} + +function display_space_usage() { + $space = get_space_allowed(); + $used = get_dirsize( BLOGUPLOADDIR ) / 1024 / 1024; + + $percentused = ( $used / $space ) * 100; + + if ( $space > 1000 ) { + $space = number_format( $space / 1024 ); + /* translators: Gigabytes */ + $space .= __( 'GB' ); + } else { + /* translators: Megabytes */ + $space .= __( 'MB' ); + } + ?> + + $quota ) + $percentused = '100'; + else + $percentused = ( $used / $quota ) * 100; + $used_color = ( $percentused < 70 ) ? ( ( $percentused >= 40 ) ? 'waiting' : 'approved' ) : 'spam'; + $used = round( $used, 2 ); + $percentused = number_format( $percentused ); + + ?> +

        +
        + + + + + +
        %2$sMB' ), esc_url( admin_url( 'upload.php' ) ), $quota ); ?>
        +
        +
        + + + + + +
        %2$sMB (%3$s%%)' ), esc_url( admin_url( 'upload.php' ) ), $used, $percentused ); ?>
        +
        +
        + + + + + + update( $wpdb->users, array( $pref => $value ), array( 'ID' => $id ) ); + + if ( $refresh == 1 ) + refresh_user_details( $id ); + + if ( $pref == 'spam' ) { + if ( $value == 1 ) + do_action( 'make_spam_user', $id ); + else + do_action( 'make_ham_user', $id ); + } + + return $value; +} + +function refresh_user_details( $id ) { + $id = (int) $id; + + if ( !$user = get_userdata( $id ) ) + return false; + + clean_user_cache( $id ); + + return $id; +} + +function format_code_lang( $code = '' ) { + $code = strtolower( substr( $code, 0, 2 ) ); + $lang_codes = array( + 'aa' => 'Afar', 'ab' => 'Abkhazian', 'af' => 'Afrikaans', 'ak' => 'Akan', 'sq' => 'Albanian', 'am' => 'Amharic', 'ar' => 'Arabic', 'an' => 'Aragonese', 'hy' => 'Armenian', 'as' => 'Assamese', 'av' => 'Avaric', 'ae' => 'Avestan', 'ay' => 'Aymara', 'az' => 'Azerbaijani', 'ba' => 'Bashkir', 'bm' => 'Bambara', 'eu' => 'Basque', 'be' => 'Belarusian', 'bn' => 'Bengali', + 'bh' => 'Bihari', 'bi' => 'Bislama', 'bs' => 'Bosnian', 'br' => 'Breton', 'bg' => 'Bulgarian', 'my' => 'Burmese', 'ca' => 'Catalan; Valencian', 'ch' => 'Chamorro', 'ce' => 'Chechen', 'zh' => 'Chinese', 'cu' => 'Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic', 'cv' => 'Chuvash', 'kw' => 'Cornish', 'co' => 'Corsican', 'cr' => 'Cree', + 'cs' => 'Czech', 'da' => 'Danish', 'dv' => 'Divehi; Dhivehi; Maldivian', 'nl' => 'Dutch; Flemish', 'dz' => 'Dzongkha', 'en' => 'English', 'eo' => 'Esperanto', 'et' => 'Estonian', 'ee' => 'Ewe', 'fo' => 'Faroese', 'fj' => 'Fijjian', 'fi' => 'Finnish', 'fr' => 'French', 'fy' => 'Western Frisian', 'ff' => 'Fulah', 'ka' => 'Georgian', 'de' => 'German', 'gd' => 'Gaelic; Scottish Gaelic', + 'ga' => 'Irish', 'gl' => 'Galician', 'gv' => 'Manx', 'el' => 'Greek, Modern', 'gn' => 'Guarani', 'gu' => 'Gujarati', 'ht' => 'Haitian; Haitian Creole', 'ha' => 'Hausa', 'he' => 'Hebrew', 'hz' => 'Herero', 'hi' => 'Hindi', 'ho' => 'Hiri Motu', 'hu' => 'Hungarian', 'ig' => 'Igbo', 'is' => 'Icelandic', 'io' => 'Ido', 'ii' => 'Sichuan Yi', 'iu' => 'Inuktitut', 'ie' => 'Interlingue', + 'ia' => 'Interlingua (International Auxiliary Language Association)', 'id' => 'Indonesian', 'ik' => 'Inupiaq', 'it' => 'Italian', 'jv' => 'Javanese', 'ja' => 'Japanese', 'kl' => 'Kalaallisut; Greenlandic', 'kn' => 'Kannada', 'ks' => 'Kashmiri', 'kr' => 'Kanuri', 'kk' => 'Kazakh', 'km' => 'Central Khmer', 'ki' => 'Kikuyu; Gikuyu', 'rw' => 'Kinyarwanda', 'ky' => 'Kirghiz; Kyrgyz', + 'kv' => 'Komi', 'kg' => 'Kongo', 'ko' => 'Korean', 'kj' => 'Kuanyama; Kwanyama', 'ku' => 'Kurdish', 'lo' => 'Lao', 'la' => 'Latin', 'lv' => 'Latvian', 'li' => 'Limburgan; Limburger; Limburgish', 'ln' => 'Lingala', 'lt' => 'Lithuanian', 'lb' => 'Luxembourgish; Letzeburgesch', 'lu' => 'Luba-Katanga', 'lg' => 'Ganda', 'mk' => 'Macedonian', 'mh' => 'Marshallese', 'ml' => 'Malayalam', + 'mi' => 'Maori', 'mr' => 'Marathi', 'ms' => 'Malay', 'mg' => 'Malagasy', 'mt' => 'Maltese', 'mo' => 'Moldavian', 'mn' => 'Mongolian', 'na' => 'Nauru', 'nv' => 'Navajo; Navaho', 'nr' => 'Ndebele, South; South Ndebele', 'nd' => 'Ndebele, North; North Ndebele', 'ng' => 'Ndonga', 'ne' => 'Nepali', 'nn' => 'Norwegian Nynorsk; Nynorsk, Norwegian', 'nb' => 'BokmÃ¥l, Norwegian, Norwegian BokmÃ¥l', + 'no' => 'Norwegian', 'ny' => 'Chichewa; Chewa; Nyanja', 'oc' => 'Occitan, Provençal', 'oj' => 'Ojibwa', 'or' => 'Oriya', 'om' => 'Oromo', 'os' => 'Ossetian; Ossetic', 'pa' => 'Panjabi; Punjabi', 'fa' => 'Persian', 'pi' => 'Pali', 'pl' => 'Polish', 'pt' => 'Portuguese', 'ps' => 'Pushto', 'qu' => 'Quechua', 'rm' => 'Romansh', 'ro' => 'Romanian', 'rn' => 'Rundi', 'ru' => 'Russian', + 'sg' => 'Sango', 'sa' => 'Sanskrit', 'sr' => 'Serbian', 'hr' => 'Croatian', 'si' => 'Sinhala; Sinhalese', 'sk' => 'Slovak', 'sl' => 'Slovenian', 'se' => 'Northern Sami', 'sm' => 'Samoan', 'sn' => 'Shona', 'sd' => 'Sindhi', 'so' => 'Somali', 'st' => 'Sotho, Southern', 'es' => 'Spanish; Castilian', 'sc' => 'Sardinian', 'ss' => 'Swati', 'su' => 'Sundanese', 'sw' => 'Swahili', + 'sv' => 'Swedish', 'ty' => 'Tahitian', 'ta' => 'Tamil', 'tt' => 'Tatar', 'te' => 'Telugu', 'tg' => 'Tajik', 'tl' => 'Tagalog', 'th' => 'Thai', 'bo' => 'Tibetan', 'ti' => 'Tigrinya', 'to' => 'Tonga (Tonga Islands)', 'tn' => 'Tswana', 'ts' => 'Tsonga', 'tk' => 'Turkmen', 'tr' => 'Turkish', 'tw' => 'Twi', 'ug' => 'Uighur; Uyghur', 'uk' => 'Ukrainian', 'ur' => 'Urdu', 'uz' => 'Uzbek', + 've' => 'Venda', 'vi' => 'Vietnamese', 'vo' => 'Volapük', 'cy' => 'Welsh','wa' => 'Walloon','wo' => 'Wolof', 'xh' => 'Xhosa', 'yi' => 'Yiddish', 'yo' => 'Yoruba', 'za' => 'Zhuang; Chuang', 'zu' => 'Zulu' ); + $lang_codes = apply_filters( 'lang_codes', $lang_codes, $code ); + return strtr( $code, $lang_codes ); +} + +function sync_category_tag_slugs( $term, $taxonomy ) { + if ( global_terms_enabled() && ( $taxonomy == 'category' || $taxonomy == 'post_tag' ) ) { + if ( is_object( $term ) ) { + $term->slug = sanitize_title( $term->name ); + } else { + $term['slug'] = sanitize_title( $term['name'] ); + } + } + return $term; +} +add_filter( 'get_term', 'sync_category_tag_slugs', 10, 2 ); + +function redirect_user_to_blog() { + global $current_user; + $c = 0; + if ( isset( $_GET['c'] ) ) + $c = (int) $_GET['c']; + + if ( $c >= 5 ) { + wp_die( __( "You don’t have permission to view this site. Please contact the system administrator." ) ); + } + $c ++; + + $blog = get_active_blog_for_user( $current_user->ID ); + $dashboard_blog = get_dashboard_blog(); + if ( is_object( $blog ) ) { + wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) ); // redirect and count to 5, "just in case" + exit; + } + + /* + If the user is a member of only 1 blog and the user's primary_blog isn't set to that blog, + then update the primary_blog record to match the user's blog + */ + $blogs = get_blogs_of_user( $current_user->ID ); + + if ( !empty( $blogs ) ) { + foreach( $blogs as $blogid => $blog ) { + if ( $blogid != $dashboard_blog->blog_id && get_user_meta( $current_user->ID , 'primary_blog', true ) == $dashboard_blog->blog_id ) { + update_user_meta( $current_user->ID, 'primary_blog', $blogid ); + continue; + } + } + $blog = get_blog_details( get_user_meta( $current_user->ID, 'primary_blog', true ) ); + wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) ); + exit; + } + wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); +} +add_action( 'admin_page_access_denied', 'redirect_user_to_blog', 99 ); + +function check_import_new_users( $permission ) { + if ( !is_super_admin() ) + return false; + return true; +} +add_filter( 'import_allow_create_users', 'check_import_new_users' ); +// See "import_allow_fetch_attachments" and "import_attachment_size_limit" filters too. + +function mu_dropdown_languages( $lang_files = array(), $current = '' ) { + $flag = false; + $output = array(); + + foreach ( (array) $lang_files as $val ) { + $code_lang = basename( $val, '.mo' ); + + if ( $code_lang == 'en_US' ) { // American English + $flag = true; + $ae = __( 'American English' ); + $output[$ae] = ''; + } elseif ( $code_lang == 'en_GB' ) { // British English + $flag = true; + $be = __( 'British English' ); + $output[$be] = ''; + } else { + $translated = format_code_lang( $code_lang ); + $output[$translated] = ''; + } + + } + + if ( $flag === false ) // WordPress english + $output[] = '"; + + // Order by name + uksort( $output, 'strnatcasecmp' ); + + $output = apply_filters( 'mu_dropdown_languages', $output, $lang_files, $current ); + echo implode( "\n\t", $output ); +} + +/* Warn the admin if SECRET SALT information is missing from wp-config.php */ +function secret_salt_warning() { + if ( !is_super_admin() ) + return; + $secret_keys = array( 'AUTH_KEY', 'SECURE_AUTH_KEY', 'LOGGED_IN_KEY', 'NONCE_KEY', 'AUTH_SALT', 'SECURE_AUTH_SALT', 'LOGGED_IN_SALT', 'NONCE_SALT' ); + $out = ''; + foreach( $secret_keys as $key ) { + if ( ! defined( $key ) ) + $out .= "define( '$key', '" . esc_html( wp_generate_password( 64, true, true ) ) . "' );
        "; + } + if ( $out != '' ) { + $msg = __( 'Warning! WordPress encrypts user cookies, but you must add the following lines to wp-config.php for it to be more secure.' ); + $msg .= '
        ' . __( "Before the line /* That's all, stop editing! Happy blogging. */ please add this code:" ); + $msg .= "

        $out"; + + echo "
        $msg
        "; + } +} +add_action( 'admin_notices', 'secret_salt_warning' ); + +function admin_notice_feed() { + global $current_user, $current_screen; + if ( $current_screen->id != 'dashboard' ) + return; + + if ( !empty( $_GET['feed_dismiss'] ) ) { + update_user_option( $current_user->id, 'admin_feed_dismiss', $_GET['feed_dismiss'], true ); + return; + } + + $url = get_site_option( 'admin_notice_feed' ); + if ( empty( $url ) ) + return; + + $rss = fetch_feed( $url ); + if ( ! is_wp_error( $rss ) && $item = $rss->get_item() ) { + $title = $item->get_title(); + if ( md5( $title ) == get_user_option( 'admin_feed_dismiss' ) ) + return; + $msg = "

        " . esc_html( $title ) . "

        \n"; + $content = $item->get_description(); + $content = $content ? wp_html_excerpt( $content, 200 ) . ' … ' : ''; + $link = esc_url( strip_tags( $item->get_link() ) ); + $msg .= "

        " . $content . "" . __( 'Read More' ) . " " . __( 'Dismiss' ) . "

        "; + echo "
        $msg
        "; + } elseif ( is_super_admin() ) { + printf( '
        ' . __( 'Your feed at %s is empty.' ) . '
        ', esc_html( $url ) ); + } +} +add_action( 'admin_notices', 'admin_notice_feed' ); + +function site_admin_notice() { + global $current_user, $wp_db_version; + if ( !is_super_admin() ) + return false; + if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version ) + echo "
        " . sprintf( __( 'Thank you for Updating! Please visit the Update Network page to update all your sites.' ), esc_url( admin_url( 'ms-upgrade-network.php' ) ) ) . "
        "; +} +add_action( 'admin_notices', 'site_admin_notice' ); + +function avoid_blog_page_permalink_collision( $data, $postarr ) { + if ( is_subdomain_install() ) + return $data; + if ( $data['post_type'] != 'page' ) + return $data; + if ( !isset( $data['post_name'] ) || $data['post_name'] == '' ) + return $data; + if ( !is_main_site() ) + return $data; + + $post_name = $data['post_name']; + $c = 0; + while( $c < 10 && get_id_from_blogname( $post_name ) ) { + $post_name .= mt_rand( 1, 10 ); + $c ++; + } + if ( $post_name != $data['post_name'] ) { + $data['post_name'] = $post_name; + } + return $data; +} +add_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 ); + +function choose_primary_blog() { + global $current_user; + ?> + + + + + + + + + + + +
        + ID ); + $primary_blog = get_user_meta( $current_user->ID, 'primary_blog', true ); + if ( count( $all_blogs ) > 1 ) { + $found = false; + ?> + + ID, 'primary_blog', $blog->userblog_id ); + } + } elseif ( count( $all_blogs ) == 1 ) { + $blog = array_shift( $all_blogs ); + echo $blog->domain; + if ( $primary_blog != $blog->userblog_id ) // Set the primary blog again if it's out of sync with blog list. + update_user_meta( $current_user->ID, 'primary_blog', $blog->userblog_id ); + } else { + echo "N/A"; + } + ?> +
        + +
        + " . sprintf( __( "Warning! The current theme supports Featured Images. You must enable image uploads on the options page for it to work." ), esc_url( admin_url( 'ms-options.php' ) ) ) . "
    "; + } +} +add_action( 'admin_notices', 'show_post_thumbnail_warning' ); + +function ms_deprecated_blogs_file() { + if ( ! is_super_admin() ) + return; + if ( ! file_exists( WP_CONTENT_DIR . '/blogs.php' ) ) + return; + echo '
    ' . sprintf( __( 'The %1$s file is deprecated. Please remove it and update your server rewrite rules to use %2$s instead.' ), 'wp-content/blogs.php', 'wp-includes/ms-files.php' ) . '
    '; +} +add_action( 'admin_notices', 'ms_deprecated_blogs_file' ); + +/** + * Outputs the notice message for multisite regarding activation of plugin page. + * + * @since 3.0.0 + * @return none + */ +function _admin_notice_multisite_activate_plugins_page() { + $message = sprintf( __( 'The plugins page is not visible to normal users. It must be activated first. %s' ), '' . __( 'Activate' ) . '' ); + echo "

    $message

    "; +} + +/** + * Grants super admin privileges. + * + * @since 3.0.0 + * @param $user_id + */ +function grant_super_admin( $user_id ) { + global $super_admins; + + // If global super_admins override is defined, there is nothing to do here. + if ( isset($super_admins) ) + return false; + + do_action( 'grant_super_admin', $user_id ); + + // Directly fetch site_admins instead of using get_super_admins() + $super_admins = get_site_option( 'site_admins', array( 'admin' ) ); + + $user = new WP_User( $user_id ); + if ( ! in_array( $user->user_login, $super_admins ) ) { + $super_admins[] = $user->user_login; + update_site_option( 'site_admins' , $super_admins ); + do_action( 'granted_super_admin', $user_id ); + return true; + } + return false; +} + +/** + * Revokes super admin privileges. + * + * @since 3.0.0 + * @param $user_id + */ +function revoke_super_admin( $user_id ) { + global $super_admins; + + // If global super_admins override is defined, there is nothing to do here. + if ( isset($super_admins) ) + return false; + + do_action( 'revoke_super_admin', $user_id ); + + // Directly fetch site_admins instead of using get_super_admins() + $super_admins = get_site_option( 'site_admins', array( 'admin' ) ); + + $user = new WP_User( $user_id ); + if ( $user->user_email != get_site_option( 'admin_email' ) ) { + if ( false !== ( $key = array_search( $user->user_login, $super_admins ) ) ) { + unset( $super_admins[$key] ); + update_site_option( 'site_admins', $super_admins ); + do_action( 'revoked_super_admin', $user_id ); + return true; + } + } + return false; +} +?> diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php new file mode 100644 index 00000000..e4675598 --- /dev/null +++ b/wp-admin/includes/nav-menu.php @@ -0,0 +1,1139 @@ + $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth; + + $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; + + ob_start(); + $item_id = esc_attr( $item->ID ); + $removed_args = array( + 'action', + 'customlink-tab', + 'edit-menu-item', + 'menu-item', + 'page-tab', + '_wpnonce', + ); + + $original_title = ''; + if ( 'taxonomy' == $item->type ) { + $original_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' ); + } elseif ( 'post_type' == $item->type ) { + $original_object = get_post( $item->object_id ); + $original_title = $original_object->post_title; + } + + $classes = array( + 'menu-item menu-item-depth-' . $depth, + 'menu-item-' . esc_attr( $item->object ), + 'menu-item-edit-' . ( ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? 'active' : 'inactive'), + ); + + $title = $item->title; + + if ( isset( $item->post_status ) && 'draft' == $item->post_status ) { + $classes[] = 'pending'; + /* translators: %s: title of menu item in draft status */ + $title = sprintf( __('%s (Pending)'), $item->title ); + } + + $title = empty( $item->label ) ? $title : $item->label; + + ?> +
  • '; + $output .= ''; + + // Menu item hidden fields + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + $output .= ''; + } +} + +/** + * Prints the appropriate response to a menu quick search. + * + * @since 3.0.0 + * + * @param array $request The unsanitized request values. + */ +function _wp_ajax_menu_quick_search( $request = array() ) { + $args = array(); + $type = isset( $request['type'] ) ? $request['type'] : ''; + $object_type = isset( $request['object_type'] ) ? $request['object_type'] : ''; + $query = isset( $request['q'] ) ? $request['q'] : ''; + $response_format = isset( $request['response-format'] ) && in_array( $request['response-format'], array( 'json', 'markup' ) ) ? $request['response-format'] : 'json'; + + if ( 'markup' == $response_format ) { + $args['walker'] = new Walker_Nav_Menu_Checklist; + } + + if ( 'get-post-item' == $type ) { + if ( post_type_exists( $object_type ) ) { + if ( isset( $request['ID'] ) ) { + $object_id = (int) $request['ID']; + if ( 'markup' == $response_format ) { + echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( $object_id ) ) ), 0, (object) $args ); + } elseif ( 'json' == $response_format ) { + $post_obj = get_post( $object_id ); + echo json_encode( + array( + 'ID' => $object_id, + 'post_title' => get_the_title( $object_id ), + 'post_type' => get_post_type( $object_id ), + ) + ); + echo "\n"; + } + } + } elseif ( taxonomy_exists( $object_type ) ) { + if ( isset( $request['ID'] ) ) { + $object_id = (int) $request['ID']; + if ( 'markup' == $response_format ) { + echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_term( $object_id, $object_type ) ) ), 0, (object) $args ); + } elseif ( 'json' == $response_format ) { + $post_obj = get_term( $object_id, $object_type ); + echo json_encode( + array( + 'ID' => $object_id, + 'post_title' => $post_obj->name, + 'post_type' => $object_type, + ) + ); + echo "\n"; + } + } + + } + + + } elseif ( preg_match('/quick-search-(posttype|taxonomy)-([a-zA-Z_-]*\b)/', $type, $matches) ) { + if ( 'posttype' == $matches[1] && get_post_type_object( $matches[2] ) ) { + query_posts(array( + 'posts_per_page' => 10, + 'post_type' => $matches[2], + 's' => $query, + )); + if ( ! have_posts() ) + return; + while ( have_posts() ) { + the_post(); + if ( 'markup' == $response_format ) { + echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( get_the_ID() ) ) ), 0, (object) $args ); + } elseif ( 'json' == $response_format ) { + echo json_encode( + array( + 'ID' => get_the_ID(), + 'post_title' => get_the_title(), + 'post_type' => get_post_type(), + ) + ); + echo "\n"; + } + } + } elseif ( 'taxonomy' == $matches[1] ) { + $terms = get_terms( $matches[2], array( + 'name__like' => $query, + 'number' => 10, + )); + if ( empty( $terms ) || is_wp_error( $terms ) ) + return; + foreach( (array) $terms as $term ) { + if ( 'markup' == $response_format ) { + echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( $term ) ), 0, (object) $args ); + } elseif ( 'json' == $response_format ) { + echo json_encode( + array( + 'ID' => $term->term_id, + 'post_title' => $term->name, + 'post_type' => $matches[2], + ) + ); + echo "\n"; + } + } + } + } +} + +/** + * Register nav menu metaboxes and advanced menu items + * + * @since 3.0.0 + **/ +function wp_nav_menu_setup() { + // Register meta boxes + if ( wp_get_nav_menus() ) + add_meta_box( 'nav-menu-theme-locations', __( 'Theme Locations' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' ); + add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' ); + wp_nav_menu_post_type_meta_boxes(); + wp_nav_menu_taxonomy_meta_boxes(); + + // Register advanced menu items (columns) + add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns'); + + // If first time editing, disable advanced items by default. + if( false === get_user_option( 'managenav-menuscolumnshidden' ) ) { + $user = wp_get_current_user(); + update_user_option($user->ID, 'managenav-menuscolumnshidden', + array( 0 => 'link-target', 1 => 'css-classes', 2 => 'xfn', 3 => 'description', ), + true); + } +} + +/** + * Limit the amount of meta boxes to just links, pages and cats for first time users. + * + * @since 3.0.0 + **/ +function wp_initial_nav_menu_meta_boxes() { + global $wp_meta_boxes; + + if ( get_user_option( 'metaboxhidden_nav-menus' ) !== false || ! is_array($wp_meta_boxes) ) + return; + + $initial_meta_boxes = array( 'nav-menu-theme-locations', 'add-custom-links', 'add-page', 'add-category' ); + $hidden_meta_boxes = array(); + + foreach ( array_keys($wp_meta_boxes['nav-menus']) as $context ) { + foreach ( array_keys($wp_meta_boxes['nav-menus'][$context]) as $priority ) { + foreach ( $wp_meta_boxes['nav-menus'][$context][$priority] as $box ) { + if ( in_array( $box['id'], $initial_meta_boxes ) ) { + unset( $box['id'] ); + } else { + $hidden_meta_boxes[] = $box['id']; + } + } + } + } + + $user = wp_get_current_user(); + update_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true ); +} + +/** + * Creates metaboxes for any post type menu item. + * + * @since 3.0.0 + */ +function wp_nav_menu_post_type_meta_boxes() { + $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'object' ); + + if ( ! $post_types ) + return; + + foreach ( $post_types as $post_type ) { + $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type ); + if ( $post_type ) { + $id = $post_type->name; + add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type ); + } + } +} + +/** + * Creates metaboxes for any taxonomy menu item. + * + * @since 3.0.0 + */ +function wp_nav_menu_taxonomy_meta_boxes() { + $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'object' ); + + if ( !$taxonomies ) + return; + + foreach ( $taxonomies as $tax ) { + $tax = apply_filters( 'nav_menu_meta_box_object', $tax ); + if ( $tax ) { + $id = $tax->name; + add_meta_box( "add-{$id}", $tax->labels->name, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax ); + } + } +} + +/** + * Displays a metabox for the nav menu theme locations. + * + * @since 3.0.0 + */ +function wp_nav_menu_locations_meta_box() { + global $nav_menu_selected_id; + + if ( ! current_theme_supports( 'menus' ) ) { + // We must only support widgets. Leave a message and bail. + echo '

    ' . __('The current theme does not natively support menus, but you can use the “Custom Menu” widget to add any menus you create here to the theme’s sidebar.') . '

    '; + return; + } + + $locations = get_registered_nav_menus(); + $menus = wp_get_nav_menus(); + $menu_locations = get_nav_menu_locations(); + $num_locations = count( array_keys($locations) ); + + echo '

    ' . sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n($num_locations) ) . '

    '; + + foreach ( $locations as $location => $description ) { + ?> +

    + +

    + +

    + + class="button-primary" name="nav-menu-locations" value="" /> +

    + $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1; + + $current_tab = 'create'; + if ( isset( $_REQUEST['customlink-tab'] ) && in_array( $_REQUEST['customlink-tab'], array('create', 'all') ) ) { + $current_tab = $_REQUEST['customlink-tab']; + } + + $removed_args = array( + 'action', + 'customlink-tab', + 'edit-menu-item', + 'menu-item', + 'page-tab', + '_wpnonce', + ); + + ?> +
    + + + + + + +

    + + + class="button-secondary submit-add-to-menu" value="" name="add-custom-menu-item" id="submit-customlinkdiv" /> + +

    + +
    + name; + + // paginate browsing for large numbers of post objects + $per_page = 50; + $pagenum = isset( $_REQUEST[$post_type_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1; + $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0; + + $args = array( + 'offset' => $offset, + 'order' => 'ASC', + 'orderby' => 'title', + 'posts_per_page' => $per_page, + 'post_type' => $post_type_name, + 'suppress_filters' => true, + 'update_post_term_cache' => false, + 'update_post_meta_cache' => false + ); + + if ( isset( $post_type['args']->_default_query ) ) + $args = array_merge($args, (array) $post_type['args']->_default_query ); + + // @todo transient caching of these results with proper invalidation on updating of a post of this type + $get_posts = new WP_Query; + $posts = $get_posts->query( $args ); + if ( ! $get_posts->post_count ) { + echo '

    ' . __( 'No items.' ) . '

    '; + return; + } + + $post_type_object = get_post_type_object($post_type_name); + + $num_pages = $get_posts->max_num_pages; + + $page_links = paginate_links( array( + 'base' => add_query_arg( + array( + $post_type_name . '-tab' => 'all', + 'paged' => '%#%', + 'item-type' => 'post_type', + 'item-object' => $post_type_name, + ) + ), + 'format' => '', + 'prev_text' => __('«'), + 'next_text' => __('»'), + 'total' => $num_pages, + 'current' => $pagenum + )); + + if ( !$posts ) + $error = '
  • '. $post_type['args']->labels->not_found .'
  • '; + + $walker = new Walker_Nav_Menu_Checklist; + + $current_tab = 'most-recent'; + if ( isset( $_REQUEST[$post_type_name . '-tab'] ) && in_array( $_REQUEST[$post_type_name . '-tab'], array('all', 'search') ) ) { + $current_tab = $_REQUEST[$post_type_name . '-tab']; + } + + if ( ! empty( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) { + $current_tab = 'search'; + } + + $removed_args = array( + 'action', + 'customlink-tab', + 'edit-menu-item', + 'menu-item', + 'page-tab', + '_wpnonce', + ); + + ?> +
    +
      +
    • >
    • +
    • >
    • +
    • >
    • +
    + +
    +
      + 'post_date', 'order' => 'DESC', 'showposts' => 15 ) ); + $most_recent = $get_posts->query( $recent_args ); + $args['walker'] = $walker; + echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $most_recent), 0, (object) $args ); + ?> +
    +
    + + + + +
    + + + +
      + _add_to_top = true; + $front_page_obj->label = sprintf( _x('Home: %s', 'nav menu front page title'), $front_page_obj->post_title ); + array_unshift( $posts, $front_page_obj ); + } else { + $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1; + array_unshift( $posts, (object) array( + '_add_to_top' => true, + 'ID' => 0, + 'object_id' => $_nav_menu_placeholder, + 'post_content' => '', + 'post_excerpt' => '', + 'post_title' => _x('Home', 'nav menu home label'), + 'post_type' => 'nav_menu_item', + 'type' => 'custom', + 'url' => home_url('/'), + ) ); + } + } + + $checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args ); + + if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) { + $checkbox_items = preg_replace('/(type=(.)checkbox(\2))/', '$1 checked=$2checked$2', $checkbox_items); + + } + + echo $checkbox_items; + ?> +
    + + + +
    + + +

    + + + + + + + class="button-secondary submit-add-to-menu" value="" name="add-post-type-menu-item" id="submit-posttype-" /> + +

    + +
    + name; + + // paginate browsing for large numbers of objects + $per_page = 50; + $pagenum = isset( $_REQUEST[$taxonomy_name . '-tab'] ) && isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1; + $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0; + + $args = array( + 'child_of' => 0, + 'exclude' => '', + 'hide_empty' => false, + 'hierarchical' => 1, + 'include' => '', + 'include_last_update_time' => false, + 'number' => $per_page, + 'offset' => $offset, + 'order' => 'ASC', + 'orderby' => 'name', + 'pad_counts' => false, + ); + + $terms = get_terms( $taxonomy_name, $args ); + + if ( ! $terms || is_wp_error($terms) ) { + echo '

    ' . __( 'No items.' ) . '

    '; + return; + } + + $num_pages = ceil( wp_count_terms( $taxonomy_name , array_merge( $args, array('number' => '', 'offset' => '') ) ) / $per_page ); + + $page_links = paginate_links( array( + 'base' => add_query_arg( + array( + $taxonomy_name . '-tab' => 'all', + 'paged' => '%#%', + 'item-type' => 'taxonomy', + 'item-object' => $taxonomy_name, + ) + ), + 'format' => '', + 'prev_text' => __('«'), + 'next_text' => __('»'), + 'total' => $num_pages, + 'current' => $pagenum + )); + + $walker = new Walker_Nav_Menu_Checklist; + + $current_tab = 'most-used'; + if ( isset( $_REQUEST[$taxonomy_name . '-tab'] ) && in_array( $_REQUEST[$taxonomy_name . '-tab'], array('all', 'most-used', 'search') ) ) { + $current_tab = $_REQUEST[$taxonomy_name . '-tab']; + } + + if ( ! empty( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ) ) { + $current_tab = 'search'; + } + + $removed_args = array( + 'action', + 'customlink-tab', + 'edit-menu-item', + 'menu-item', + 'page-tab', + '_wpnonce', + ); + + ?> +
    +
      +
    • >
    • +
    • >
    • +
    • >
    • +
    + +
    +
      + 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) ); + $args['walker'] = $walker; + echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $popular_terms), 0, (object) $args ); + ?> +
    +
    + +
    + + + +
      + +
    + + + +
    + +
    + $searched, 'fields' => 'all', 'orderby' => 'count', 'order' => 'DESC', 'hierarchical' => false ) ); + } else { + $searched = ''; + $search_results = array(); + } + ?> +

    + + + +

    + +
      + + + +
    • get_error_message(); ?>
    • + +
    • + +
    +
    + +

    + + + + + + + class="button-secondary submit-add-to-menu" value="" name="add-taxonomy-menu-item" id="submit-taxonomy-" /> + +

    + +
    + $_item_object_data ) { + if ( + empty( $_item_object_data['menu-item-object-id'] ) && // checkbox is not checked + ( + ! isset( $_item_object_data['menu-item-type'] ) || // and item type either isn't set + in_array( $_item_object_data['menu-item-url'], array( 'http://', '' ) ) || // or URL is the default + ! ( 'custom' == $_item_object_data['menu-item-type'] && ! isset( $_item_object_data['menu-item-db-id'] ) ) || // or it's not a custom menu item (but not the custom home page) + ! empty( $_item_object_data['menu-item-db-id'] ) // or it *is* a custom menu item that already exists + ) + ) { + continue; // then this potential menu item is not getting added to this menu + } + + // if this possible menu item doesn't actually have a menu database ID yet + if ( + empty( $_item_object_data['menu-item-db-id'] ) || + ( 0 > $_possible_db_id ) || + $_possible_db_id != $_item_object_data['menu-item-db-id'] + ) { + $_actual_db_id = 0; + } else { + $_actual_db_id = (int) $_item_object_data['menu-item-db-id']; + } + + $args = array( + 'menu-item-db-id' => ( isset( $_item_object_data['menu-item-db-id'] ) ? $_item_object_data['menu-item-db-id'] : '' ), + 'menu-item-object-id' => ( isset( $_item_object_data['menu-item-object-id'] ) ? $_item_object_data['menu-item-object-id'] : '' ), + 'menu-item-object' => ( isset( $_item_object_data['menu-item-object'] ) ? $_item_object_data['menu-item-object'] : '' ), + 'menu-item-parent-id' => ( isset( $_item_object_data['menu-item-parent-id'] ) ? $_item_object_data['menu-item-parent-id'] : '' ), + 'menu-item-position' => ( isset( $_item_object_data['menu-item-position'] ) ? $_item_object_data['menu-item-position'] : '' ), + 'menu-item-type' => ( isset( $_item_object_data['menu-item-type'] ) ? $_item_object_data['menu-item-type'] : '' ), + 'menu-item-title' => ( isset( $_item_object_data['menu-item-title'] ) ? $_item_object_data['menu-item-title'] : '' ), + 'menu-item-url' => ( isset( $_item_object_data['menu-item-url'] ) ? $_item_object_data['menu-item-url'] : '' ), + 'menu-item-description' => ( isset( $_item_object_data['menu-item-description'] ) ? $_item_object_data['menu-item-description'] : '' ), + 'menu-item-attr-title' => ( isset( $_item_object_data['menu-item-attr-title'] ) ? $_item_object_data['menu-item-attr-title'] : '' ), + 'menu-item-target' => ( isset( $_item_object_data['menu-item-target'] ) ? $_item_object_data['menu-item-target'] : '' ), + 'menu-item-classes' => ( isset( $_item_object_data['menu-item-classes'] ) ? $_item_object_data['menu-item-classes'] : '' ), + 'menu-item-xfn' => ( isset( $_item_object_data['menu-item-xfn'] ) ? $_item_object_data['menu-item-xfn'] : '' ), + ); + + $items_saved[] = wp_update_nav_menu_item( $menu_id, $_actual_db_id, $args ); + + } + } + return $items_saved; +} + +/** + * Adds custom arguments to some of the meta box object types. + * + * @since 3.0.0 + * + * @access private + * + * @param object $object The post type or taxonomy meta-object. + * @return object The post type of taxonomy object. + */ +function _wp_nav_menu_meta_box_object( $object = null ) { + if ( isset( $object->name ) ) { + + if ( 'page' == $object->name ) { + $object->_default_query = array( + 'orderby' => 'menu_order title', + 'post_status' => 'publish', + ); + + // posts should show only published items + } elseif ( 'post' == $object->name ) { + $object->_default_query = array( + 'post_status' => 'publish', + ); + + // cats should be in reverse chronological order + } elseif ( 'category' == $object->name ) { + $object->_default_query = array( + 'orderby' => 'id', + 'order' => 'DESC', + ); + + // custom post types should show only published items + } else { + $object->_default_query = array( + 'post_status' => 'publish', + ); + } + } + + return $object; +} + +/** + * Returns the menu formatted to edit. + * + * @since 3.0.0 + * + * @param string $menu_id The ID of the menu to format. + * @return string|WP_Error $output The menu formatted to edit or error object on failure. + */ +function wp_get_nav_menu_to_edit( $menu_id = 0 ) { + $menu = wp_get_nav_menu_object( $menu_id ); + + // If the menu exists, get its items. + if ( is_nav_menu( $menu ) ) { + $menu_items = wp_get_nav_menu_items( $menu->term_id, array('post_status' => 'any') ); + $result = '
    ' : '">'; + $result .= '

    ' . __('Select menu items (pages, categories, links) from the boxes at left to begin building your custom menu.') . '

    '; + $result .= '
    '; + + if( empty($menu_items) ) + return $result . ' '; + + $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id ); + + if ( class_exists( $walker_class_name ) ) + $walker = new $walker_class_name; + else + return new WP_Error( 'menu_walker_not_exist', sprintf( __('The Walker class named %s does not exist.'), $walker_class_name ) ); + + $some_pending_menu_items = false; + foreach( (array) $menu_items as $menu_item ) { + if ( isset( $menu_item->post_status ) && 'draft' == $menu_item->post_status ) + $some_pending_menu_items = true; + } + + if ( $some_pending_menu_items ) + $result .= '

    ' . __('Click Save Menu to make pending menu items public.') . '

    '; + + $result .= ' '; + return $result; + } elseif ( is_wp_error( $menu ) ) { + return $menu; + } + + +} + +/** + * Returns the columns for the nav menus page. + * + * @since 3.0.0 + * + * @param string $menu_item_id The ID of the menu item to format. + * @return string|WP_Error $output The menu formatted to edit or error object on failure. + */ +function wp_nav_menu_manage_columns() { + return array( + '_title' => __('Show advanced menu properties'), + 'cb' => '', + 'link-target' => __('Link Target'), + 'css-classes' => __('CSS Classes'), + 'xfn' => __('Link Relationship (XFN)'), + 'description' => __('Description'), + ); +} + +/** + * Deletes orphaned draft menu items + * + * @access private + * @since 3.0.0 + * + */ +function _wp_delete_orphaned_draft_menu_items() { + global $wpdb; + $delete_timestamp = time() - (60*60*24*EMPTY_TRASH_DAYS); + + // delete orphaned draft menu items + $menu_items_to_delete = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts AS p LEFT JOIN $wpdb->postmeta AS m ON p.ID = m.post_id WHERE post_type = 'nav_menu_item' AND post_status = 'draft' AND meta_key = '_menu_item_orphaned' AND meta_value < '%d'", $delete_timestamp ) ); + + foreach( (array) $menu_items_to_delete as $menu_item_id ) + wp_delete_post( $menu_item_id, true ); +} + +add_action('admin_head-nav-menus.php', '_wp_delete_orphaned_draft_menu_items'); + +?> diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index f81ecc82..f348e609 100644 --- a/wp-admin/includes/plugin-install.php +++ b/wp-admin/includes/plugin-install.php @@ -24,27 +24,30 @@ * * @param string $action * @param array|object $args Optional. Arguments to serialize for the Plugin Info API. - * @return mixed + * @return object plugins_api response object on success, WP_Error on failure. */ function plugins_api($action, $args = null) { - if( is_array($args) ) + if ( is_array($args) ) $args = (object)$args; if ( !isset($args->per_page) ) $args->per_page = 24; - $args = apply_filters('plugins_api_args', $args, $action); //NOTE: Ensure that an object is returned via this filter. - $res = apply_filters('plugins_api', false, $action, $args); //NOTE: Allows a plugin to completely override the builtin WordPress.org API. + // Allows a plugin to override the WordPress.org API entirely. + // Use the filter 'plugins_api_result' to mearly add results. + // Please ensure that a object is returned from the following filters. + $args = apply_filters('plugins_api_args', $args, $action); + $res = apply_filters('plugins_api', false, $action, $args); - if ( ! $res ) { - $request = wp_remote_post('http://api.wordpress.org/plugins/info/1.0/', array( 'body' => array('action' => $action, 'request' => serialize($args))) ); + if ( false === $res ) { + $request = wp_remote_post('http://api.wordpress.org/plugins/info/1.0/', array( 'timeout' => 15, 'body' => array('action' => $action, 'request' => serialize($args))) ); if ( is_wp_error($request) ) { - $res = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occurred during the API request.

    Try again'), $request->get_error_message() ); + $res = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occurred during the API request.'), $request->get_error_message() ); } else { $res = unserialize($request['body']); - if ( ! $res ) - $res = new WP_Error('plugins_api_failed', __('An unknown error occurred'), $request['body']); + if ( false === $res ) + $res = new WP_Error('plugins_api_failed', __('An unknown error occurred.'), $request['body']); } } elseif ( !is_wp_error($res) ) { $res->external = true; @@ -136,16 +139,20 @@ function install_dashboard() { $api_tags = install_popular_tags(); - //Set up the tags in a way which can be interprated by wp_generate_tag_cloud() - $tags = array(); - foreach ( (array)$api_tags as $tag ) - $tags[ $tag['name'] ] = (object) array( - 'link' => esc_url( admin_url('plugin-install.php?tab=search&type=tag&s=' . urlencode($tag['name'])) ), - 'name' => $tag['name'], - 'id' => sanitize_title_with_dashes($tag['name']), - 'count' => $tag['count'] ); echo '


    '; } @@ -162,7 +169,7 @@ function install_search_form(){ @@ -182,7 +189,7 @@ function install_featured($page = 1) { $args = array('browse' => 'featured', 'page' => $page); $api = plugins_api('query_plugins', $args); if ( is_wp_error($api) ) - wp_die($api); + wp_die($api->get_error_message() . '

    ' . __('Try again') . ''); display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']); } @@ -197,6 +204,8 @@ add_action('install_plugins_popular', 'install_popular', 10, 1); function install_popular($page = 1) { $args = array('browse' => 'popular', 'page' => $page); $api = plugins_api('query_plugins', $args); + if ( is_wp_error($api) ) + wp_die($api->get_error_message() . '

    ' . __('Try again') . ''); display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']); } @@ -210,7 +219,7 @@ add_action('install_plugins_upload', 'install_plugins_upload', 10, 1); function install_plugins_upload( $page = 1 ) { ?>

    -

    +

    @@ -232,7 +241,7 @@ function install_new($page = 1) { $args = array('browse' => 'new', 'page' => $page); $api = plugins_api('query_plugins', $args); if ( is_wp_error($api) ) - wp_die($api); + wp_die($api->get_error_message() . '

    ' . __('Try again') . ''); display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']); } add_action('install_plugins_updated', 'install_updated', 10, 1); @@ -248,6 +257,8 @@ add_action('install_plugins_updated', 'install_updated', 10, 1); function install_updated($page = 1) { $args = array('browse' => 'updated', 'page' => $page); $api = plugins_api('query_plugins', $args); + if ( is_wp_error($api) ) + wp_die($api->get_error_message() . '

    ' . __('Try again') . ''); display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']); } @@ -302,7 +313,6 @@ function display_plugins_table($plugins, $page = 1, $totalpages = 1){ - @@ -312,16 +322,15 @@ function display_plugins_table($plugins, $page = 1, $totalpages = 1){ - ', __('No plugins match your request.'), ''; - foreach( (array) $plugins as $plugin ){ + foreach ( (array) $plugins as $plugin ){ if ( is_object($plugin) ) $plugin = (array) $plugin; @@ -342,23 +351,41 @@ function display_plugins_table($plugins, $page = 1, $totalpages = 1){ $name = strip_tags($title . ' ' . $version); $author = $plugin['author']; - if( ! empty($plugin['author']) ) + if ( ! empty($plugin['author']) ) $author = ' ' . sprintf( __('By %s'), $author ) . '.'; $author = wp_kses($author, $plugins_allowedtags); - if( isset($plugin['homepage']) ) - $title = '' . $title . ''; - $action_links = array(); $action_links[] = '' . __('Install') . ''; + '&TB_iframe=true&width=600&height=550') . '" class="thickbox" title="' . + esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '">' . __('Details') . ''; + + if ( current_user_can('install_plugins') || current_user_can('update_plugins') ) { + $status = install_plugin_install_status($plugin); + + switch ( $status['status'] ) { + case 'install': + if ( $status['url'] ) + $action_links[] = '' . __('Install Now') . ''; + break; + case 'update_available': + if ( $status['url'] ) + $action_links[] = '' . sprintf( __('Update Now'), $status['version'] ) . ''; + break; + case 'latest_installed': + case 'newer_installed': + $action_links[] = '' . __('Installed') . ''; + break; + } + } - $action_links = apply_filters('plugin_install_action_links', $action_links, $plugin); + $action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin ); ?> - + +

    +
    @@ -371,7 +398,6 @@ function display_plugins_table($plugins, $page = 1, $totalpages = 1){
    - response as $file => $plugin ) { + if ( $plugin->slug === $api->slug ) { + $status = 'update_available'; + $update_file = $file; + $version = $plugin->new_version; + if ( current_user_can('update_plugins') ) + $url = wp_nonce_url(admin_url('update.php?action=upgrade-plugin&plugin=' . $update_file), 'upgrade-plugin_' . $update_file); + break; + } + } + } + + if ( 'install' == $status ) { + if ( is_dir( WP_PLUGIN_DIR . '/' . $api->slug ) ) { + $installed_plugin = get_plugins('/' . $api->slug); + if ( empty($installed_plugin) ) { + if ( current_user_can('install_plugins') ) + $url = wp_nonce_url(admin_url('update.php?action=install-plugin&plugin=' . $api->slug), 'install-plugin_' . $api->slug); + } else { + $key = array_shift( $key = array_keys($installed_plugin) ); //Use the first plugin regardless of the name, Could have issues for multiple-plugins in one directory if they share different version numbers + if ( version_compare($api->version, $installed_plugin[ $key ]['Version'], '=') ){ + $status = 'latest_installed'; + } elseif ( version_compare($api->version, $installed_plugin[ $key ]['Version'], '<') ) { + $status = 'newer_installed'; + $version = $installed_plugin[ $key ]['Version']; + } else { + //If the above update check failed, Then that probably means that the update checker has out-of-date information, force a refresh + if ( ! $loop ) { + delete_site_transient('update_plugins'); + wp_update_plugins(); + return install_plugin_install_status($api, true); + } + } + } + } else { + // "install" & no directory with that slug + if ( current_user_can('install_plugins') ) + $url = wp_nonce_url(admin_url('update.php?action=install-plugin&plugin=' . $api->slug), 'install-plugin_' . $api->slug); + } + } + if ( isset($_GET['from']) ) + $url .= '&from=' . urlencode(stripslashes($_GET['from'])); + + return compact('status', 'url', 'version'); +} + /** * Display plugin information in dialog box form. * @@ -416,7 +505,7 @@ function install_plugin_information() { $api->$key = wp_kses($api->$key, $plugins_allowedtags); $section = isset($_REQUEST['section']) ? stripslashes( $_REQUEST['section'] ) : 'description'; //Default to the Description tab, Do not translate, API returns English. - if( empty($section) || ! isset($api->sections[ $section ]) ) + if ( empty($section) || ! isset($api->sections[ $section ]) ) $section = array_shift( $section_titles = array_keys((array)$api->sections) ); iframe_header( __('Plugin Install') ); @@ -437,66 +526,30 @@ function install_plugin_information() { echo "
    \n"; ?>
    - download_link) ) : ?> + download_link) && ( current_user_can('install_plugins') || current_user_can('update_plugins') ) ) : ?>

    response as $file => $plugin ) { - if ( $plugin->slug === $api->slug ) { - $type = 'update_available'; - $update_file = $file; - break; - } - } - } - if ( 'install' == $type && is_dir( WP_PLUGIN_DIR . '/' . $api->slug ) ) { - $installed_plugin = get_plugins('/' . $api->slug); - if ( ! empty($installed_plugin) ) { - $key = array_shift( $key = array_keys($installed_plugin) ); //Use the first plugin regardless of the name, Could have issues for multiple-plugins in one directory if they share different version numbers - if ( version_compare($api->version, $installed_plugin[ $key ]['Version'], '=') ){ - $type = 'latest_installed'; - } elseif ( version_compare($api->version, $installed_plugin[ $key ]['Version'], '<') ) { - $type = 'newer_installed'; - $newer_version = $installed_plugin[ $key ]['Version']; - } else { - //If the above update check failed, Then that probably means that the update checker has out-of-date information, force a refresh - delete_transient('update_plugins'); - $update_file = $api->slug . '/' . $key; //This code branch only deals with a plugin which is in a folder the same name as its slug, Doesnt support plugins which have 'non-standard' names - $type = 'update_available'; - } - } - } - - switch ( $type ) : - default: - case 'install': - if ( current_user_can('install_plugins') ) : - ?>' . __('Install Now') . ''; break; - case 'update_available': - if ( current_user_can('update_plugins') ) : - ?>' . __('Install Update Now') .''; break; - case 'newer_installed': - if ( current_user_can('install_plugins') || current_user_can('update_plugins') ) : - ?>' . sprintf(__('Newer Version (%s) Installed'), $status['version']) . ''; break; - case 'latest_installed': - if ( current_user_can('install_plugins') || current_user_can('update_plugins') ) : - ?>' . __('Latest Version Installed') . ''; break; - endswitch; ?> + } + ?>

    -

    +

      version) ) : ?>
    • version ?>
    • diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index b09f6102..2ff21f8c 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -29,6 +29,9 @@ * located in the locale folder then Domain Path will be "/locale/" and * must have the first slash. Defaults to the base folder the plugin is * located in. + * Network: Optional. Specify "Network: true" to require that a plugin is activated + * across all sites in an installation. This will prevent a plugin from being + * activated on a single site when Multisite is enabled. * * / # Remove the space to close comment * * @@ -43,6 +46,7 @@ * 'PluginURI' - Plugin web site address. * 'TextDomain' - Plugin's text domain for localization. * 'DomainPath' - Plugin's relative directory path to .mo files. + * 'Network' - Boolean. Whether the plugin can only be activated network wide. * * Some users have issues with opening large files and manipulating the contents * for want is usually the first 1kiB or 2kiB. This function stops pulling in @@ -67,19 +71,30 @@ */ function get_plugin_data( $plugin_file, $markup = true, $translate = true ) { - $default_headers = array( - 'Name' => 'Plugin Name', - 'PluginURI' => 'Plugin URI', - 'Version' => 'Version', - 'Description' => 'Description', - 'Author' => 'Author', - 'AuthorURI' => 'Author URI', - 'TextDomain' => 'Text Domain', - 'DomainPath' => 'Domain Path' - ); + $default_headers = array( + 'Name' => 'Plugin Name', + 'PluginURI' => 'Plugin URI', + 'Version' => 'Version', + 'Description' => 'Description', + 'Author' => 'Author', + 'AuthorURI' => 'Author URI', + 'TextDomain' => 'Text Domain', + 'DomainPath' => 'Domain Path', + 'Network' => 'Network', + // Site Wide Only is deprecated in favor of Network. + '_sitewide' => 'Site Wide Only', + ); $plugin_data = get_file_data( $plugin_file, $default_headers, 'plugin' ); + // Site Wide Only is the old header for Network + if ( empty( $plugin_data['Network'] ) && ! empty( $plugin_data['_sitewide'] ) ) { + _deprecated_argument( __FUNCTION__, '3.0', sprintf( __( 'The %1$s plugin header is deprecated. Use %2$s instead.' ), 'Site Wide Only: true', 'Network: true' ) ); + $plugin_data['Network'] = $plugin_data['_sitewide']; + } + $plugin_data['Network'] = ( 'true' == strtolower( $plugin_data['Network'] ) ); + unset( $plugin_data['_sitewide'] ); + //For backward compatibility by default Title is the same as Name. $plugin_data['Title'] = $plugin_data['Name']; @@ -91,9 +106,9 @@ function get_plugin_data( $plugin_file, $markup = true, $translate = true ) { function _get_plugin_data_markup_translate($plugin_file, $plugin_data, $markup = true, $translate = true) { - //Translate fields - if( $translate && ! empty($plugin_data['TextDomain']) ) { - if( ! empty( $plugin_data['DomainPath'] ) ) + //Translate fields30 + if ( $translate && ! empty($plugin_data['TextDomain']) ) { + if ( ! empty( $plugin_data['DomainPath'] ) ) load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file). $plugin_data['DomainPath']); else load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file)); @@ -113,7 +128,7 @@ function _get_plugin_data_markup_translate($plugin_file, $plugin_data, $markup = $plugin_data['Author'] = '' . $plugin_data['Author'] . ''; $plugin_data['Description'] = wptexturize( $plugin_data['Description'] ); - if( ! empty($plugin_data['Author']) ) + if ( ! empty($plugin_data['Author']) ) $plugin_data['Description'] .= ' ' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.'; } @@ -198,7 +213,7 @@ function get_plugins($plugin_folder = '') { $wp_plugins = array (); $plugin_root = WP_PLUGIN_DIR; - if( !empty($plugin_folder) ) + if ( !empty($plugin_folder) ) $plugin_root .= $plugin_folder; // Files in wp-content/plugins directory @@ -223,11 +238,14 @@ function get_plugins($plugin_folder = '') { $plugin_files[] = $file; } } + } else { + return $wp_plugins; } + @closedir( $plugins_dir ); @closedir( $plugins_subdir ); - if ( !$plugins_dir || empty($plugin_files) ) + if ( empty($plugin_files) ) return $wp_plugins; foreach ( $plugin_files as $plugin_file ) { @@ -250,6 +268,126 @@ function get_plugins($plugin_folder = '') { return $wp_plugins; } +/** + * Check the mu-plugins directory and retrieve all mu-plugin files with any plugin data. + * + * WordPress only includes mu-plugin files in the base mu-plugins directory (wp-content/mu-plugins). + * + * @since 3.0.0 + * @return array Key is the mu-plugin file path and the value is an array of the mu-plugin data. + */ +function get_mu_plugins() { + $wp_plugins = array(); + // Files in wp-content/mu-plugins directory + $plugin_files = array(); + + if ( ! is_dir( WPMU_PLUGIN_DIR ) ) + return $wp_plugins; + if ( $plugins_dir = @ opendir( WPMU_PLUGIN_DIR ) ) { + while ( ( $file = readdir( $plugins_dir ) ) !== false ) { + if ( substr( $file, -4 ) == '.php' ) + $plugin_files[] = $file; + } + } else { + return $wp_plugins; + } + + @closedir( $plugins_dir ); + + if ( empty($plugin_files) ) + return $wp_plugins; + + foreach ( $plugin_files as $plugin_file ) { + if ( !is_readable( WPMU_PLUGIN_DIR . "/$plugin_file" ) ) + continue; + + $plugin_data = get_plugin_data( WPMU_PLUGIN_DIR . "/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached. + + if ( empty ( $plugin_data['Name'] ) ) + $plugin_data['Name'] = $plugin_file; + + $wp_plugins[ $plugin_file ] = $plugin_data; + } + + if ( isset( $wp_plugins['index.php'] ) && filesize( WPMU_PLUGIN_DIR . '/index.php') <= 30 ) // silence is golden + unset( $wp_plugins['index.php'] ); + + uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' )); + + return $wp_plugins; +} + +/** + * Check the wp-content directory and retrieve all drop-ins with any plugin data. + * + * @since 3.0.0 + * @return array Key is the file path and the value is an array of the plugin data. + */ +function get_dropins() { + $dropins = array(); + $plugin_files = array(); + + $_dropins = _get_dropins(); + + // These exist in the wp-content directory + if ( $plugins_dir = @ opendir( WP_CONTENT_DIR ) ) { + while ( ( $file = readdir( $plugins_dir ) ) !== false ) { + if ( isset( $_dropins[ $file ] ) ) + $plugin_files[] = $file; + } + } else { + return $dropins; + } + + @closedir( $plugins_dir ); + + if ( empty($plugin_files) ) + return $dropins; + + foreach ( $plugin_files as $plugin_file ) { + if ( !is_readable( WP_CONTENT_DIR . "/$plugin_file" ) ) + continue; + $plugin_data = get_plugin_data( WP_CONTENT_DIR . "/$plugin_file", false, false ); //Do not apply markup/translate as it'll be cached. + if ( empty( $plugin_data['Name'] ) ) + $plugin_data['Name'] = $plugin_file; + $dropins[ $plugin_file ] = $plugin_data; + } + + uksort( $dropins, create_function( '$a, $b', 'return strnatcasecmp( $a, $b );' )); + + return $dropins; +} + +/** + * Returns drop-ins that WordPress uses. + * + * Includes Multisite drop-ins only when is_multisite() + * + * @since 3.0.0 + * @return array Key is file name. The value is an array, with the first value the + * purpose of the drop-in and the second value the name of the constant that must be + * true for the drop-in to be used, or true if no constant is required. + */ +function _get_dropins() { + $dropins = array( + 'advanced-cache.php' => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ), // WP_CACHE + 'db.php' => array( __( 'Custom database class.' ), true ), // auto on load + 'db-error.php' => array( __( 'Custom database error message.' ), true ), // auto on error + 'install.php' => array( __( 'Custom install script.' ), true ), // auto on install + 'maintenance.php' => array( __( 'Custom maintenance message.' ), true ), // auto on maintenance + 'object-cache.php' => array( __( 'External object cache.' ), true ), // auto on load + ); + + if ( is_multisite() ) { + $dropins['sunrise.php' ] = array( __( 'Executed before Multisite is loaded.' ), 'SUNRISE' ); // SUNRISE + $dropins['blog-deleted.php' ] = array( __( 'Custom site deleted message.' ), true ); // auto on deleted blog + $dropins['blog-inactive.php' ] = array( __( 'Custom site inactive message.' ), true ); // auto on inactive blog + $dropins['blog-suspended.php'] = array( __( 'Custom site suspended message.' ), true ); // auto on archived or spammed blog + } + + return $dropins; +} + /** * Check whether the plugin is active by checking the active_plugins list. * @@ -258,8 +396,46 @@ function get_plugins($plugin_folder = '') { * @param string $plugin Base plugin path from plugins directory. * @return bool True, if in the active plugins list. False, not in the list. */ -function is_plugin_active($plugin) { - return in_array( $plugin, apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ); +function is_plugin_active( $plugin ) { + return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || is_plugin_active_for_network( $plugin ); +} + +/** + * Check whether the plugin is active for the entire network. + * + * @since 3.0.0 + * + * @param string $plugin Base plugin path from plugins directory. + * @return bool True, if active for the network, otherwise false. + */ +function is_plugin_active_for_network( $plugin ) { + if ( !is_multisite() ) + return false; + + $plugins = get_site_option( 'active_sitewide_plugins'); + if ( isset($plugins[$plugin]) ) + return true; + + return false; +} + +/** + * Checks for "Network: true" in the plugin header to see if this should + * be activated only as a network wide plugin. The plugin would also work + * when Multisite is not enabled. + * + * Checks for "Site Wide Only: true" for backwards compatibility. + * + * @since 3.0.0 + * + * @param $file Plugin to check + * $return bool True if plugin is network only, false otherwise. + */ +function is_network_only_plugin( $plugin ) { + $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); + if ( $plugin_data ) + return $plugin_data['Network']; + return false; } /** @@ -284,11 +460,18 @@ function is_plugin_active($plugin) { * * @param string $plugin Plugin path to main plugin file with plugin data. * @param string $redirect Optional. URL to redirect to. + * @param bool $network_wide Whether to enable the plugin for all sites in the network or just the current site. Multisite only. Default is false. * @return WP_Error|null WP_Error on invalid file or null on success. */ -function activate_plugin($plugin, $redirect = '') { - $current = get_option('active_plugins'); - $plugin = plugin_basename(trim($plugin)); +function activate_plugin( $plugin, $redirect = '', $network_wide = false) { + $plugin = plugin_basename( trim( $plugin ) ); + + if ( is_multisite() && ( $network_wide || is_network_only_plugin($plugin) ) ) { + $network_wide = true; + $current = get_site_option( 'active_sitewide_plugins', array() ); + } else { + $current = get_option( 'active_plugins', array() ); + } $valid = validate_plugin($plugin); if ( is_wp_error($valid) ) @@ -298,13 +481,22 @@ function activate_plugin($plugin, $redirect = '') { if ( !empty($redirect) ) wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error ob_start(); - @include(WP_PLUGIN_DIR . '/' . $plugin); - $current[] = $plugin; - sort($current); + include(WP_PLUGIN_DIR . '/' . $plugin); do_action( 'activate_plugin', trim( $plugin) ); - update_option('active_plugins', $current); + if ( $network_wide ) { + $current[$plugin] = time(); + update_site_option( 'active_sitewide_plugins', $current ); + } else { + $current[] = $plugin; + sort($current); + update_option('active_plugins', $current); + } do_action( 'activate_' . trim( $plugin ) ); do_action( 'activated_plugin', trim( $plugin) ); + if ( ob_get_length() > 0 ) { + $output = ob_get_clean(); + return new WP_Error('unexpected_output', __('The plugin generated unexpected output.'), $output); + } ob_end_clean(); } @@ -322,23 +514,30 @@ function activate_plugin($plugin, $redirect = '') { * @param string|array $plugins Single plugin or list of plugins to deactivate. * @param bool $silent Optional, default is false. Prevent calling deactivate hook. */ -function deactivate_plugins($plugins, $silent= false) { - $current = get_option('active_plugins'); +function deactivate_plugins( $plugins, $silent = false ) { + $network_current = get_site_option( 'active_sitewide_plugins', array() ); + $current = get_option( 'active_plugins', array() ); + $do_blog = $do_network = false; - if ( !is_array($plugins) ) - $plugins = array($plugins); - - foreach ( $plugins as $plugin ) { + foreach ( (array) $plugins as $plugin ) { $plugin = plugin_basename($plugin); - if( ! is_plugin_active($plugin) ) + if ( ! is_plugin_active($plugin) ) continue; if ( ! $silent ) do_action( 'deactivate_plugin', trim( $plugin ) ); - $key = array_search( $plugin, (array) $current ); - - if ( false !== $key ) - array_splice( $current, $key, 1 ); + if ( is_plugin_active_for_network($plugin) ) { + // Deactivate network wide + $do_network = true; + unset( $network_current[ $plugin ] ); + } else { + // Deactivate for this blog only + $key = array_search( $plugin, (array) $current ); + if ( false !== $key ) { + $do_blog = true; + array_splice( $current, $key, 1 ); + } + } //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output. if ( ! $silent ) { @@ -347,7 +546,10 @@ function deactivate_plugins($plugins, $silent= false) { } } - update_option('active_plugins', $current); + if ( $do_blog ) + update_option('active_plugins', $current); + if ( $do_network ) + update_site_option( 'active_sitewide_plugins', $network_current ); } /** @@ -362,9 +564,10 @@ function deactivate_plugins($plugins, $silent= false) { * * @param string|array $plugins * @param string $redirect Redirect to page after successful activation. + * @param bool $network_wide Whether to enable the plugin for all sites in the network. * @return bool|WP_Error True when finished or WP_Error if there were errors during a plugin activation. */ -function activate_plugins($plugins, $redirect = '') { +function activate_plugins($plugins, $redirect = '', $network_wide) { if ( !is_array($plugins) ) $plugins = array($plugins); @@ -372,7 +575,7 @@ function activate_plugins($plugins, $redirect = '') { foreach ( (array) $plugins as $plugin ) { if ( !empty($redirect) ) $redirect = add_query_arg('plugin', $plugin, $redirect); - $result = activate_plugin($plugin, $redirect); + $result = activate_plugin($plugin, $redirect, $network_wide); if ( is_wp_error($result) ) $errors[$plugin] = $result; } @@ -398,7 +601,7 @@ function activate_plugins($plugins, $redirect = '') { function delete_plugins($plugins, $redirect = '' ) { global $wp_filesystem; - if( empty($plugins) ) + if ( empty($plugins) ) return false; $checked = array(); @@ -410,7 +613,7 @@ function delete_plugins($plugins, $redirect = '' ) { if ( false === ($credentials = request_filesystem_credentials($url)) ) { $data = ob_get_contents(); ob_end_clean(); - if( ! empty($data) ){ + if ( ! empty($data) ){ include_once( ABSPATH . 'wp-admin/admin-header.php'); echo $data; include( ABSPATH . 'wp-admin/admin-footer.php'); @@ -423,7 +626,7 @@ function delete_plugins($plugins, $redirect = '' ) { request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again $data = ob_get_contents(); ob_end_clean(); - if( ! empty($data) ){ + if ( ! empty($data) ){ include_once( ABSPATH . 'wp-admin/admin-header.php'); echo $data; include( ABSPATH . 'wp-admin/admin-footer.php'); @@ -436,7 +639,7 @@ function delete_plugins($plugins, $redirect = '' ) { return new WP_Error('fs_unavailable', __('Could not access filesystem.')); if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() ) - return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors); + return new WP_Error('fs_error', __('Filesystem error.'), $wp_filesystem->errors); //Get the base plugin folder $plugins_dir = $wp_filesystem->wp_plugins_dir(); @@ -464,37 +667,50 @@ function delete_plugins($plugins, $redirect = '' ) { } if ( ! empty($errors) ) - return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s'), implode(', ', $errors)) ); + return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s.'), implode(', ', $errors)) ); // Force refresh of plugin update information - if ( $current = get_transient('update_plugins') ) { + if ( $current = get_site_transient('update_plugins') ) { unset( $current->response[ $plugin_file ] ); - set_transient('update_plugins', $current); + set_site_transient('update_plugins', $current); } return true; } +/** + * Validate active plugins + * + * Validate all active plugins, deactivates invalid and + * returns an array of deactivated ones. + * + * @since unknown + * @return array invalid plugins, plugin as key, error as value + */ function validate_active_plugins() { - $check_plugins = apply_filters( 'active_plugins', get_option('active_plugins') ); + $plugins = get_option( 'active_plugins', array() ); + // validate vartype: array + if ( ! is_array( $plugins ) ) { + update_option( 'active_plugins', array() ); + $plugins = array(); + } - // Sanity check. If the active plugin list is not an array, make it an - // empty array. - if ( !is_array($check_plugins) ) { - update_option('active_plugins', array()); - return; + if ( is_multisite() && is_super_admin() ) { + $network_plugins = (array) get_site_option( 'active_sitewide_plugins', array() ); + $plugins = array_merge( $plugins, array_keys( $network_plugins ) ); } - //Invalid is any plugin that is deactivated due to error. + if ( empty( $plugins ) ) + return; + $invalid = array(); - // If a plugin file does not exist, remove it from the list of active - // plugins. - foreach ( $check_plugins as $check_plugin ) { - $result = validate_plugin($check_plugin); + // invalid plugins get deactivated + foreach ( $plugins as $plugin ) { + $result = validate_plugin( $plugin ); if ( is_wp_error( $result ) ) { - $invalid[$check_plugin] = $result; - deactivate_plugins( $check_plugin, true); + $invalid[$plugin] = $result; + deactivate_plugins( $plugin, true ); } } return $invalid; @@ -583,67 +799,135 @@ function uninstall_plugin($plugin) { // Menu // -function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '', $position = NULL ) { - global $menu, $admin_page_hooks, $_registered_pages; +/** + * Add a top level menu page + * + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + * @param string $icon_url The url to the icon to be used for this menu + * @param int $position The position in the menu order this one should appear + */ +function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '', $position = NULL ) { + global $menu, $admin_page_hooks, $_registered_pages, $_parent_pages; + + $menu_slug = plugin_basename( $menu_slug ); - $file = plugin_basename( $file ); + $admin_page_hooks[$menu_slug] = sanitize_title( $menu_title ); - $admin_page_hooks[$file] = sanitize_title( $menu_title ); + $hookname = get_plugin_page_hookname( $menu_slug, '' ); - $hookname = get_plugin_page_hookname( $file, '' ); - if (!empty ( $function ) && !empty ( $hookname ) && current_user_can( $access_level ) ) + if ( !empty( $function ) && !empty( $hookname ) && current_user_can( $capability ) ) add_action( $hookname, $function ); - if ( empty($icon_url) ) { - $icon_url = 'images/generic.png'; - } elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') ) { + if ( empty($icon_url) ) + $icon_url = esc_url( admin_url( 'images/generic.png' ) ); + elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') ) $icon_url = 'https://' . substr($icon_url, 7); - } - $new_menu = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); + $new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); - if ( NULL === $position ) { + if ( null === $position ) $menu[] = $new_menu; - } else { + else $menu[$position] = $new_menu; - } $_registered_pages[$hookname] = true; + // No parent as top level + $_parent_pages[$menu_slug] = false; + return $hookname; } -function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') { +/** + * Add a top level menu page in the 'objects' section + * + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + * @param string $icon_url The url to the icon to be used for this menu + */ +function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') { global $_wp_last_object_menu; $_wp_last_object_menu++; - return add_menu_page($page_title, $menu_title, $access_level, $file, $function, $icon_url, $_wp_last_object_menu); + return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_object_menu); } -function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') { +/** + * Add a top level menu page in the 'utility' section + * + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + * @param string $icon_url The url to the icon to be used for this menu + */ +function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') { global $_wp_last_utility_menu; $_wp_last_utility_menu++; - return add_menu_page($page_title, $menu_title, $access_level, $file, $function, $icon_url, $_wp_last_utility_menu); + return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_utility_menu); } -function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function = '' ) { +/** + * Add a sub menu page + * + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $parent_slug The slug name for the parent menu (or the file name of a standard WordPress admin page) + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + */ +function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { global $submenu; global $menu; global $_wp_real_parent_file; global $_wp_submenu_nopriv; global $_registered_pages; + global $_parent_pages; - $file = plugin_basename( $file ); + $menu_slug = plugin_basename( $menu_slug ); + $parent_slug = plugin_basename( $parent_slug); - $parent = plugin_basename( $parent); - if ( isset( $_wp_real_parent_file[$parent] ) ) - $parent = $_wp_real_parent_file[$parent]; + if ( isset( $_wp_real_parent_file[$parent_slug] ) ) + $parent_slug = $_wp_real_parent_file[$parent_slug]; - if ( !current_user_can( $access_level ) ) { - $_wp_submenu_nopriv[$parent][$file] = true; + if ( !current_user_can( $capability ) ) { + $_wp_submenu_nopriv[$parent_slug][$menu_slug] = true; return false; } @@ -651,79 +935,272 @@ function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $fi // as the first item in the submenu. If the submenu file is the same as the // parent file someone is trying to link back to the parent manually. In // this case, don't automatically add a link back to avoid duplication. - if (!isset( $submenu[$parent] ) && $file != $parent ) { + if (!isset( $submenu[$parent_slug] ) && $menu_slug != $parent_slug ) { foreach ( (array)$menu as $parent_menu ) { - if ( $parent_menu[2] == $parent && current_user_can( $parent_menu[1] ) ) - $submenu[$parent][] = $parent_menu; + if ( $parent_menu[2] == $parent_slug && current_user_can( $parent_menu[1] ) ) + $submenu[$parent_slug][] = $parent_menu; } } - $submenu[$parent][] = array ( $menu_title, $access_level, $file, $page_title ); + $submenu[$parent_slug][] = array ( $menu_title, $capability, $menu_slug, $page_title ); - $hookname = get_plugin_page_hookname( $file, $parent); + $hookname = get_plugin_page_hookname( $menu_slug, $parent_slug); if (!empty ( $function ) && !empty ( $hookname )) add_action( $hookname, $function ); $_registered_pages[$hookname] = true; // backwards-compatibility for plugins using add_management page. See wp-admin/admin.php for redirect from edit.php to tools.php - if ( 'tools.php' == $parent ) - $_registered_pages[get_plugin_page_hookname( $file, 'edit.php')] = true; + if ( 'tools.php' == $parent_slug ) + $_registered_pages[get_plugin_page_hookname( $menu_slug, 'edit.php')] = true; + + // No parent as top level + $_parent_pages[$menu_slug] = $parent_slug; return $hookname; } /** * Add sub menu page to the tools main menu. +* + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. * - * @param string $page_title - * @param unknown_type $menu_title - * @param unknown_type $access_level - * @param unknown_type $file - * @param unknown_type $function - * @return unknown + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. */ -function add_management_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { - return add_submenu_page( 'tools.php', $page_title, $menu_title, $access_level, $file, $function ); +function add_management_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { + return add_submenu_page( 'tools.php', $page_title, $menu_title, $capability, $menu_slug, $function ); } -function add_options_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { - return add_submenu_page( 'options-general.php', $page_title, $menu_title, $access_level, $file, $function ); +/** + * Add sub menu page to the options main menu. +* + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + */ +function add_options_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { + return add_submenu_page( 'options-general.php', $page_title, $menu_title, $capability, $menu_slug, $function ); } -function add_theme_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { - return add_submenu_page( 'themes.php', $page_title, $menu_title, $access_level, $file, $function ); +/** + * Add sub menu page to the themes main menu. +* + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + */ +function add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { + return add_submenu_page( 'themes.php', $page_title, $menu_title, $capability, $menu_slug, $function ); +} + +/** + * Add sub menu page to the plugins main menu. +* + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + */ +function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { + return add_submenu_page( 'plugins.php', $page_title, $menu_title, $capability, $menu_slug, $function ); } -function add_users_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { +/** + * Add sub menu page to the Users/Profile main menu. +* + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + */ +function add_users_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { if ( current_user_can('edit_users') ) $parent = 'users.php'; else $parent = 'profile.php'; - return add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function ); + return add_submenu_page( $parent, $page_title, $menu_title, $capability, $menu_slug, $function ); +} +/** + * Add sub menu page to the Dashboard main menu. +* + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + */ +function add_dashboard_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { + return add_submenu_page( 'index.php', $page_title, $menu_title, $capability, $menu_slug, $function ); } -function add_dashboard_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { - return add_submenu_page( 'index.php', $page_title, $menu_title, $access_level, $file, $function ); +/** + * Add sub menu page to the posts main menu. +* + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + */ +function add_posts_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { + return add_submenu_page( 'edit.php', $page_title, $menu_title, $capability, $menu_slug, $function ); } -function add_posts_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { - return add_submenu_page( 'edit.php', $page_title, $menu_title, $access_level, $file, $function ); +/** + * Add sub menu page to the media main menu. +* + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + */ +function add_media_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { + return add_submenu_page( 'upload.php', $page_title, $menu_title, $capability, $menu_slug, $function ); } -function add_media_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { - return add_submenu_page( 'upload.php', $page_title, $menu_title, $access_level, $file, $function ); +/** + * Add sub menu page to the links main menu. +* + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + */ +function add_links_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { + return add_submenu_page( 'link-manager.php', $page_title, $menu_title, $capability, $menu_slug, $function ); } -function add_links_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { - return add_submenu_page( 'link-manager.php', $page_title, $menu_title, $access_level, $file, $function ); +/** + * Add sub menu page to the pages main menu. +* + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + */ +function add_pages_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { + return add_submenu_page( 'edit.php?post_type=page', $page_title, $menu_title, $capability, $menu_slug, $function ); } -function add_pages_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { - return add_submenu_page( 'edit-pages.php', $page_title, $menu_title, $access_level, $file, $function ); +/** + * Add sub menu page to the comments main menu. +* + * This function takes a capability which will be used to determine whether + * or not a page is included in the menu. + * + * The function which is hooked in to handle the output of the page must check + * that the user has the required capability as well. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + */ +function add_comments_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { + return add_submenu_page( 'edit-comments.php', $page_title, $menu_title, $capability, $menu_slug, $function ); } -function add_comments_page( $page_title, $menu_title, $access_level, $file, $function = '' ) { - return add_submenu_page( 'edit-comments.php', $page_title, $menu_title, $access_level, $file, $function ); +/** + * Get the url to access a particular menu page based on the slug it was registered with. + * + * If the slug hasn't been registered properly no url will be returned + * + * @since 3.0 + * + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param bool $echo Whether or not to echo the url - default is true + * @return string the url + */ +function menu_page_url($menu_slug, $echo = true) { + global $_parent_pages; + + if ( isset( $_parent_pages[$menu_slug] ) ) { + if ( $_parent_pages[$menu_slug] ) { + $url = admin_url( add_query_arg( 'page', $menu_slug, $_parent_pages[$menu_slug] ) ); + } else { + $url = admin_url('admin.php?page=' . $menu_slug); + } + } else { + $url = ''; + } + + $url = esc_url($url); + + if ( $echo ) + echo $url; + + return $url; } // @@ -735,6 +1212,7 @@ function get_admin_page_parent( $parent = '' ) { global $menu; global $submenu; global $pagenow; + global $typenow; global $plugin_page; global $_wp_real_parent_file; global $_wp_menu_nopriv; @@ -745,14 +1223,15 @@ function get_admin_page_parent( $parent = '' ) { $parent = $_wp_real_parent_file[$parent]; return $parent; } -/* + + /* if ( !empty ( $parent_file ) ) { if ( isset( $_wp_real_parent_file[$parent_file] ) ) $parent_file = $_wp_real_parent_file[$parent_file]; return $parent_file; } -*/ + */ if ( $pagenow == 'admin.php' && isset( $plugin_page ) ) { foreach ( (array)$menu as $parent_menu ) { @@ -782,7 +1261,10 @@ function get_admin_page_parent( $parent = '' ) { foreach ( $submenu[$parent] as $submenu_array ) { if ( isset( $_wp_real_parent_file[$parent] ) ) $parent = $_wp_real_parent_file[$parent]; - if ( $submenu_array[2] == $pagenow ) { + if ( !empty($typenow) && ($submenu_array[2] == "$pagenow?post_type=$typenow") ) { + $parent_file = $parent; + return $parent; + } elseif ( $submenu_array[2] == $pagenow && empty($typenow) && ( empty($parent_file) || false === strpos($parent_file, '?') ) ) { $parent_file = $parent; return $parent; } else @@ -804,10 +1286,10 @@ function get_admin_page_title() { global $submenu; global $pagenow; global $plugin_page; + global $typenow; - if ( isset( $title ) && !empty ( $title ) ) { + if ( ! empty ( $title ) ) return $title; - } $hook = get_plugin_page_hook( $plugin_page, $pagenow ); @@ -830,11 +1312,17 @@ function get_admin_page_title() { } } } else { - foreach (array_keys( $submenu ) as $parent) { + foreach ( array_keys( $submenu ) as $parent ) { foreach ( $submenu[$parent] as $submenu_array ) { if ( isset( $plugin_page ) && - ($plugin_page == $submenu_array[2] ) && - (($parent == $pagenow ) || ($parent == $plugin_page ) || ($plugin_page == $hook ) || (($pagenow == 'admin.php' ) && ($parent1 != $submenu_array[2] ) ) ) + ( $plugin_page == $submenu_array[2] ) && + ( + ( $parent == $pagenow ) || + ( $parent == $plugin_page ) || + ( $plugin_page == $hook ) || + ( $pagenow == 'admin.php' && $parent1 != $submenu_array[2] ) || + ( !empty($typenow) && $parent == $pagenow . '?post_type=' . $typenow) + ) ) { $title = $submenu_array[3]; return $submenu_array[3]; @@ -852,12 +1340,12 @@ function get_admin_page_title() { } } } - if ( !isset($title) || empty ( $title ) ) { + if ( empty ( $title ) ) { foreach ( $menu as $menu_array ) { if ( isset( $plugin_page ) && - ($plugin_page == $menu_array[2] ) && - ($pagenow == 'admin.php' ) && - ($parent1 == $menu_array[2] ) ) + ( $plugin_page == $menu_array[2] ) && + ( $pagenow == 'admin.php' ) && + ( $parent1 == $menu_array[2] ) ) { $title = $menu_array[3]; return $menu_array[3]; @@ -895,7 +1383,7 @@ function get_plugin_page_hookname( $plugin_page, $parent_page ) { $plugin_name = preg_replace( '!\.php!', '', $plugin_page ); - return $page_type.'_page_'.$plugin_name; + return $page_type . '_page_' . $plugin_name; } function user_can_access_admin_page() { @@ -917,6 +1405,7 @@ function user_can_access_admin_page() { return false; $hookname = get_plugin_page_hookname($plugin_page, $parent); + if ( !isset($_registered_pages[$hookname]) ) return false; } @@ -983,51 +1472,37 @@ function user_can_access_admin_page() { * @param unknown_type $sanitize_callback A callback function that sanitizes the option's value. * @return unknown */ -function register_setting($option_group, $option_name, $sanitize_callback = '') { - return add_option_update_handler($option_group, $option_name, $sanitize_callback); -} +function register_setting( $option_group, $option_name, $sanitize_callback = '' ) { + global $new_whitelist_options; -/** - * Unregister a setting - * - * @since 2.7.0 - * - * @param unknown_type $option_group - * @param unknown_type $option_name - * @param unknown_type $sanitize_callback - * @return unknown - */ -function unregister_setting($option_group, $option_name, $sanitize_callback = '') { - return remove_option_update_handler($option_group, $option_name, $sanitize_callback); -} + if ( 'misc' == $option_group ) { + _deprecated_argument( __FUNCTION__, '3.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) ); + $option_group = 'general'; + } -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $option_group - * @param unknown_type $option_name - * @param unknown_type $sanitize_callback - */ -function add_option_update_handler($option_group, $option_name, $sanitize_callback = '') { - global $new_whitelist_options; $new_whitelist_options[ $option_group ][] = $option_name; if ( $sanitize_callback != '' ) add_filter( "sanitize_option_{$option_name}", $sanitize_callback ); } /** - * {@internal Missing Short Description}} + * Unregister a setting * - * @since unknown + * @since 2.7.0 * * @param unknown_type $option_group * @param unknown_type $option_name * @param unknown_type $sanitize_callback + * @return unknown */ -function remove_option_update_handler($option_group, $option_name, $sanitize_callback = '') { +function unregister_setting( $option_group, $option_name, $sanitize_callback = '' ) { global $new_whitelist_options; + + if ( 'misc' == $option_group ) { + _deprecated_argument( __FUNCTION__, '3.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) ); + $option_group = 'general'; + } + $pos = array_search( $option_name, (array) $new_whitelist_options ); if ( $pos !== false ) unset( $new_whitelist_options[ $option_group ][ $pos ] ); @@ -1063,13 +1538,13 @@ add_filter( 'whitelist_options', 'option_update_filter' ); * @return unknown */ function add_option_whitelist( $new_options, $options = '' ) { - if( $options == '' ) { + if ( $options == '' ) global $whitelist_options; - } else { + else $whitelist_options = $options; - } - foreach( $new_options as $page => $keys ) { - foreach( $keys as $key ) { + + foreach ( $new_options as $page => $keys ) { + foreach ( $keys as $key ) { if ( !isset($whitelist_options[ $page ]) || !is_array($whitelist_options[ $page ]) ) { $whitelist_options[ $page ] = array(); $whitelist_options[ $page ][] = $key; @@ -1080,6 +1555,7 @@ function add_option_whitelist( $new_options, $options = '' ) { } } } + return $whitelist_options; } @@ -1093,20 +1569,21 @@ function add_option_whitelist( $new_options, $options = '' ) { * @return unknown */ function remove_option_whitelist( $del_options, $options = '' ) { - if( $options == '' ) { + if ( $options == '' ) global $whitelist_options; - } else { + else $whitelist_options = $options; - } - foreach( $del_options as $page => $keys ) { - foreach( $keys as $key ) { + + foreach ( $del_options as $page => $keys ) { + foreach ( $keys as $key ) { if ( isset($whitelist_options[ $page ]) && is_array($whitelist_options[ $page ]) ) { $pos = array_search( $key, $whitelist_options[ $page ] ); - if( $pos !== false ) + if ( $pos !== false ) unset( $whitelist_options[ $page ][ $pos ] ); } } } + return $whitelist_options; } diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index e5924f1d..5f8b6fd0 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -31,6 +31,9 @@ function _wp_translate_postdata( $update = false, $post_data = null ) { if ( isset($post_data['trackback_url']) ) $post_data['to_ping'] = $post_data['trackback_url']; + if ( !isset($post_data['user_ID']) ) + $post_data['user_ID'] = $GLOBALS['user_ID']; + if (!empty ( $post_data['post_author_override'] ) ) { $post_data['post_author'] = (int) $post_data['post_author_override']; } else { @@ -41,16 +44,15 @@ function _wp_translate_postdata( $update = false, $post_data = null ) { } } + $ptype = get_post_type_object( $post_data['post_type'] ); if ( isset($post_data['user_ID']) && ($post_data['post_author'] != $post_data['user_ID']) ) { - if ( 'page' == $post_data['post_type'] ) { - if ( !current_user_can( 'edit_others_pages' ) ) { + if ( !current_user_can( $ptype->cap->edit_others_posts ) ) { + if ( 'page' == $post_data['post_type'] ) { return new WP_Error( 'edit_others_pages', $update ? __( 'You are not allowed to edit pages as this user.' ) : __( 'You are not allowed to create pages as this user.' ) ); - } - } else { - if ( !current_user_can( 'edit_others_posts' ) ) { + } else { return new WP_Error( 'edit_others_posts', $update ? __( 'You are not allowed to edit posts as this user.' ) : __( 'You are not allowed to post as this user.' ) @@ -64,26 +66,23 @@ function _wp_translate_postdata( $update = false, $post_data = null ) { $post_data['post_status'] = 'draft'; if ( isset($post_data['saveasprivate']) && '' != $post_data['saveasprivate'] ) $post_data['post_status'] = 'private'; - if ( isset($post_data['publish']) && ( '' != $post_data['publish'] ) && ( $post_data['post_status'] != 'private' ) ) + if ( isset($post_data['publish']) && ( '' != $post_data['publish'] ) && ( !isset($post_data['post_status']) || $post_data['post_status'] != 'private' ) ) $post_data['post_status'] = 'publish'; if ( isset($post_data['advanced']) && '' != $post_data['advanced'] ) $post_data['post_status'] = 'draft'; if ( isset($post_data['pending']) && '' != $post_data['pending'] ) $post_data['post_status'] = 'pending'; - $previous_status = get_post_field('post_status', isset($post_data['ID']) ? $post_data['ID'] : $post_data['temp_ID']); + if ( isset( $post_data['ID'] ) ) + $post_id = $post_data['ID']; + else + $post_id = false; + $previous_status = $post_id ? get_post_field( 'post_status', $post_id ) : false; // Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published. // Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts. - if ( 'page' == $post_data['post_type'] ) { - $publish_cap = 'publish_pages'; - $edit_cap = 'edit_published_pages'; - } else { - $publish_cap = 'publish_posts'; - $edit_cap = 'edit_published_posts'; - } - if ( isset($post_data['post_status']) && ('publish' == $post_data['post_status'] && !current_user_can( $publish_cap )) ) - if ( $previous_status != 'publish' || !current_user_can( $edit_cap ) ) + if ( isset($post_data['post_status']) && ('publish' == $post_data['post_status'] && !current_user_can( $ptype->cap->publish_posts )) ) + if ( $previous_status != 'publish' || !current_user_can( 'edit_post', $post_id ) ) $post_data['post_status'] = 'pending'; if ( ! isset($post_data['post_status']) ) @@ -138,11 +137,11 @@ function edit_post( $post_data = null ) { $post_ID = (int) $post_data['post_ID']; - if ( 'page' == $post_data['post_type'] ) { - if ( !current_user_can( 'edit_page', $post_ID ) ) + $ptype = get_post_type_object($post_data['post_type']); + if ( !current_user_can( $ptype->cap->edit_post, $post_ID ) ) { + if ( 'page' == $post_data['post_type'] ) wp_die( __('You are not allowed to edit this page.' )); - } else { - if ( !current_user_can( 'edit_post', $post_ID ) ) + else wp_die( __('You are not allowed to edit this post.' )); } @@ -157,6 +156,8 @@ function edit_post( $post_data = null ) { } $post_data = _wp_translate_postdata( true, $post_data ); + if ( 'autosave' != $post_data['action'] && 'auto-draft' == $post_data['post_status'] ) + $post_data['post_status'] = 'draft'; if ( is_wp_error($post_data) ) wp_die( $post_data->get_error_message() ); @@ -189,6 +190,8 @@ function edit_post( $post_data = null ) { add_meta( $post_ID ); + update_post_meta( $post_ID, '_edit_last', $GLOBALS['current_user']->ID ); + wp_update_post( $post_data ); // Reunite any orphaned attachments with their parent @@ -213,13 +216,14 @@ function edit_post( $post_data = null ) { } /** - * {@internal Missing Short Description}} + * Process the post data for the bulk editing of posts. * * Updates all bulk edited posts/pages, adding (but not removing) tags and * categories. Skips pages when they would be their own parent or child. * - * @since unknown + * @since 2.7.0 * + * @param array $post_data Optional, the array of post data to process if not provided will use $_POST superglobal. * @return array */ function bulk_edit_posts( $post_data = null ) { @@ -228,12 +232,16 @@ function bulk_edit_posts( $post_data = null ) { if ( empty($post_data) ) $post_data = &$_POST; - if ( isset($post_data['post_type']) && 'page' == $post_data['post_type'] ) { - if ( ! current_user_can( 'edit_pages' ) ) - wp_die( __('You are not allowed to edit pages.') ); - } else { - if ( ! current_user_can( 'edit_posts' ) ) - wp_die( __('You are not allowed to edit posts.') ); + if ( isset($post_data['post_type']) ) + $ptype = get_post_type_object($post_data['post_type']); + else + $ptype = get_post_type_object('post'); + + if ( !current_user_can( $ptype->cap->edit_posts ) ) { + if ( 'page' == $ptype->name ) + wp_die( __('You are not allowed to edit pages.')); + else + wp_die( __('You are not allowed to edit posts.')); } if ( -1 == $post_data['_status'] ) { @@ -246,7 +254,7 @@ function bulk_edit_posts( $post_data = null ) { $post_IDs = array_map( 'intval', (array) $post_data['post'] ); - $reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private', 'tags_input', 'post_category', 'sticky' ); + $reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private', 'tax_input', 'post_category', 'sticky' ); foreach ( $reset as $field ) { if ( isset($post_data[$field]) && ( '' == $post_data[$field] || -1 == $post_data[$field] ) ) unset($post_data[$field]); @@ -259,9 +267,18 @@ function bulk_edit_posts( $post_data = null ) { unset($post_data['post_category']); } - if ( isset($post_data['tags_input']) ) { - $new_tags = preg_replace( '/\s*,\s*/', ',', rtrim( trim($post_data['tags_input']), ' ,' ) ); - $new_tags = explode(',', $new_tags); + $tax_input = array(); + if ( isset($post_data['tax_input'])) { + foreach ( $post_data['tax_input'] as $tax_name => $terms ) { + if ( empty($terms) ) + continue; + if ( is_taxonomy_hierarchical( $tax_name ) ) + $tax_input[$tax_name] = array_map( 'absint', $terms ); + else { + $tax_input[$tax_name] = preg_replace( '/\s*,\s*/', ',', rtrim( trim($terms), ' ,' ) ); + $tax_input[$tax_name] = explode(',', $tax_input[$tax_name]); + } + } } if ( isset($post_data['post_parent']) && ($parent = (int) $post_data['post_parent']) ) { @@ -282,8 +299,9 @@ function bulk_edit_posts( $post_data = null ) { $updated = $skipped = $locked = array(); foreach ( $post_IDs as $post_ID ) { + $post_type_object = get_post_type_object( get_post_type( $post_ID ) ); - if ( isset($children) && in_array($post_ID, $children) ) { + if ( !isset( $post_type_object ) || ( isset($children) && in_array($post_ID, $children) ) || !current_user_can( $post_type_object->cap->edit_post, $post_ID ) ) { $skipped[] = $post_ID; continue; } @@ -293,14 +311,26 @@ function bulk_edit_posts( $post_data = null ) { continue; } - if ( isset($new_cats) ) { - $cats = (array) wp_get_post_categories($post_ID); - $post_data['post_category'] = array_unique( array_merge($cats, $new_cats) ); + $tax_names = get_object_taxonomies( get_post($post_ID) ); + foreach ( $tax_names as $tax_name ) { + $taxonomy_obj = get_taxonomy($tax_name); + if ( isset( $tax_input[$tax_name]) && current_user_can( $taxonomy_obj->cap->assign_terms ) ) + $new_terms = $tax_input[$tax_name]; + else + $new_terms = array(); + + if ( $taxonomy_obj->hierarchical ) + $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'ids') ); + else + $current_terms = (array) wp_get_object_terms( $post_ID, $tax_name, array('fields' => 'names') ); + + $post_data['tax_input'][$tax_name] = array_merge( $current_terms, $new_terms ); } - if ( isset($new_tags) ) { - $tags = wp_get_post_tags($post_ID, array('fields' => 'names')); - $post_data['tags_input'] = array_unique( array_merge($tags, $new_tags) ); + if ( isset($new_cats) && in_array( 'category', $tax_names ) ) { + $cats = (array) wp_get_post_categories($post_ID); + $post_data['post_category'] = array_unique( array_merge($cats, $new_cats) ); + unset( $post_data['tax_input']['category'] ); } $post_data['ID'] = $post_ID; @@ -323,9 +353,11 @@ function bulk_edit_posts( $post_data = null ) { * * @since unknown * - * @return unknown + *@param string A post type string, defaults to 'post'. + * @return object stdClass object containing all the default post data as attributes */ -function get_default_post_to_edit() { +function get_default_post_to_edit( $post_type = 'post', $create_in_db = false ) { + global $wpdb; $post_title = ''; if ( !empty( $_REQUEST['post_title'] ) ) @@ -339,36 +371,45 @@ function get_default_post_to_edit() { if ( !empty( $_REQUEST['excerpt'] ) ) $post_excerpt = esc_html( stripslashes( $_REQUEST['excerpt'] )); - $post->ID = 0; + if ( $create_in_db ) { + // Cleanup old auto-drafts more than 7 days old + $old_posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'auto-draft' AND DATE_SUB( NOW(), INTERVAL 7 DAY ) > post_date" ); + foreach ( (array) $old_posts as $delete ) + wp_delete_post( $delete, true ); // Force delete + $post = get_post( wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) ) ); + } else { + $post->ID = 0; + $post->post_author = ''; + $post->post_date = ''; + $post->post_date_gmt = ''; + $post->post_password = ''; + $post->post_type = $post_type; + $post->post_status = 'draft'; + $post->to_ping = ''; + $post->pinged = ''; + $post->comment_status = get_option( 'default_comment_status' ); + $post->ping_status = get_option( 'default_ping_status' ); + $post->post_pingback = get_option( 'default_pingback_flag' ); + $post->post_category = get_option( 'default_category' ); + $post->page_template = 'default'; + $post->post_parent = 0; + $post->menu_order = 0; + } + + $post->post_content = apply_filters( 'default_content', $post_content, $post ); + $post->post_title = apply_filters( 'default_title', $post_title, $post ); + $post->post_excerpt = apply_filters( 'default_excerpt', $post_excerpt, $post ); $post->post_name = ''; - $post->post_author = ''; - $post->post_date = ''; - $post->post_date_gmt = ''; - $post->post_password = ''; - $post->post_status = 'draft'; - $post->post_type = 'post'; - $post->to_ping = ''; - $post->pinged = ''; - $post->comment_status = get_option( 'default_comment_status' ); - $post->ping_status = get_option( 'default_ping_status' ); - $post->post_pingback = get_option( 'default_pingback_flag' ); - $post->post_category = get_option( 'default_category' ); - $post->post_content = apply_filters( 'default_content', $post_content); - $post->post_title = apply_filters( 'default_title', $post_title ); - $post->post_excerpt = apply_filters( 'default_excerpt', $post_excerpt); - $post->page_template = 'default'; - $post->post_parent = 0; - $post->menu_order = 0; return $post; } /** - * {@internal Missing Short Description}} + * Get the default page information to use. * - * @since unknown + * @since 2.5.0 * - * @return unknown + * @return object stdClass object containing all the default post data as attributes */ function get_default_page_to_edit() { $page = get_default_post_to_edit(); @@ -445,16 +486,21 @@ function post_exists($title, $content = '', $date = '') { function wp_write_post() { global $user_ID; - if ( 'page' == $_POST['post_type'] ) { - if ( !current_user_can( 'edit_pages' ) ) - return new WP_Error( 'edit_pages', __( 'You are not allowed to create pages on this blog.' ) ); - } else { - if ( !current_user_can( 'edit_posts' ) ) - return new WP_Error( 'edit_posts', __( 'You are not allowed to create posts or drafts on this blog.' ) ); - } + if ( isset($_POST['post_type']) ) + $ptype = get_post_type_object($_POST['post_type']); + else + $ptype = get_post_type_object('post'); + + if ( !current_user_can( $ptype->cap->edit_posts ) ) { + if ( 'page' == $ptype->name ) + return new WP_Error( 'edit_pages', __( 'You are not allowed to create pages on this site.' ) ); + else + return new WP_Error( 'edit_posts', __( 'You are not allowed to create posts or drafts on this site.' ) ); + } // Check for autosave collisions + // Does this need to be updated? ~ Mark $temp_id = false; if ( isset($_POST['temp_ID']) ) { $temp_id = (int) $_POST['temp_ID']; @@ -502,7 +548,10 @@ function wp_write_post() { add_meta( $post_ID ); + add_post_meta( $post_ID, '_edit_last', $GLOBALS['current_user']->ID ); + // Reunite any orphaned attachments with their parent + // Does this need to be udpated? ~ Mark if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) ) $draft_ids = array(); if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) ) @@ -533,7 +582,7 @@ function wp_write_post() { */ function write_post() { $result = wp_write_post(); - if( is_wp_error( $result ) ) + if ( is_wp_error( $result ) ) wp_die( $result->get_error_message() ); else return $result; @@ -577,8 +626,7 @@ function add_meta( $post_ID ) { return false; wp_cache_delete($post_ID, 'post_meta'); - - $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->postmeta (post_id,meta_key,meta_value ) VALUES (%s, %s, %s)", $post_ID, $metakey, $metavalue) ); + $wpdb->insert( $wpdb->postmeta, array( 'post_id' => $post_ID, 'meta_key' => $metakey, 'meta_value' => $metavalue ) ); do_action( 'added_postmeta', $wpdb->insert_id, $post_ID, $metakey, $metavalue ); return $wpdb->insert_id; @@ -670,8 +718,8 @@ function has_meta( $postid ) { * @since unknown * * @param unknown_type $meta_id - * @param unknown_type $meta_key - * @param unknown_type $meta_value + * @param unknown_type $meta_key Expect Slashed + * @param unknown_type $meta_value Expect Slashed * @return unknown */ function update_meta( $meta_id, $meta_key, $meta_value ) { @@ -679,6 +727,8 @@ function update_meta( $meta_id, $meta_key, $meta_value ) { $protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' ); + $meta_key = stripslashes($meta_key); + if ( in_array($meta_key, $protected) ) return false; @@ -738,8 +788,8 @@ function _fix_attachment_links( $post_ID ) { if ( ! empty( $attachment) && ! is_object( get_post( $attachment['post_parent'] ) ) ) { $attachment['post_parent'] = $post_ID; // Escape data pulled from DB. - $attachment = add_magic_quotes( $attachment); - wp_update_post( $attachment); + $attachment = add_magic_quotes( $attachment ); + wp_update_post( $attachment ); } $post_search[$i] = $anchor; @@ -789,12 +839,12 @@ function _relocate_children( $old_ID, $new_ID ) { } /** - * {@internal Missing Short Description}} + * Get all the possible statuses for a post_type * - * @since unknown + * @since 2.5.0 * - * @param unknown_type $type - * @return unknown + * @param string $type The post_type you want the statuses for + * @return array As array of all the statuses for the supplied post type */ function get_available_post_statuses($type = 'post') { $stati = wp_count_posts($type); @@ -803,35 +853,30 @@ function get_available_post_statuses($type = 'post') { } /** - * {@internal Missing Short Description}} + * Run the wp query to fetch the posts for listing on the edit posts page * - * @since unknown + * @since 2.5.0 * - * @param unknown_type $q - * @return unknown + * @param array|bool $q Array of query variables to use to build the query or false to use $_GET superglobal. + * @return array */ function wp_edit_posts_query( $q = false ) { if ( false === $q ) $q = $_GET; - $q['m'] = isset($q['m']) ? (int) $q['m'] : 0; + $q['m'] = isset($q['m']) ? (int) $q['m'] : 0; $q['cat'] = isset($q['cat']) ? (int) $q['cat'] : 0; - $post_stati = array( // array( adj, noun ) - 'publish' => array(_x('Published', 'post'), __('Published posts'), _n_noop('Published (%s)', 'Published (%s)')), - 'future' => array(_x('Scheduled', 'post'), __('Scheduled posts'), _n_noop('Scheduled (%s)', 'Scheduled (%s)')), - 'pending' => array(_x('Pending Review', 'post'), __('Pending posts'), _n_noop('Pending Review (%s)', 'Pending Review (%s)')), - 'draft' => array(_x('Draft', 'post'), _x('Drafts', 'manage posts header'), _n_noop('Draft (%s)', 'Drafts (%s)')), - 'private' => array(_x('Private', 'post'), __('Private posts'), _n_noop('Private (%s)', 'Private (%s)')), - 'trash' => array(_x('Trash', 'post'), __('Trash posts'), _n_noop('Trash (%s)', 'Trash (%s)')), - ); - - $post_stati = apply_filters('post_stati', $post_stati); - - $avail_post_stati = get_available_post_statuses('post'); - - $post_status_q = ''; - if ( isset($q['post_status']) && in_array( $q['post_status'], array_keys($post_stati) ) ) { - $post_status_q = '&post_status=' . $q['post_status']; - $post_status_q .= '&perm=readable'; + $post_stati = get_post_stati(); + + if ( isset($q['post_type']) && in_array( $q['post_type'], get_post_types() ) ) + $post_type = $q['post_type']; + else + $post_type = 'post'; + + $avail_post_stati = get_available_post_statuses($post_type); + + if ( isset($q['post_status']) && in_array( $q['post_status'], $post_stati ) ) { + $post_status = $q['post_status']; + $perm = 'readable'; } if ( isset($q['post_status']) && 'pending' === $q['post_status'] ) { @@ -845,14 +890,26 @@ function wp_edit_posts_query( $q = false ) { $orderby = 'date'; } - $posts_per_page = (int) get_user_option( 'edit_per_page', 0, false ); + $per_page = 'edit_' . $post_type . '_per_page'; + $posts_per_page = (int) get_user_option( $per_page ); if ( empty( $posts_per_page ) || $posts_per_page < 1 ) $posts_per_page = 15; - $posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page ); + $posts_per_page = apply_filters( $per_page, $posts_per_page ); + - wp("post_type=post&$post_status_q&posts_per_page=$posts_per_page&order=$order&orderby=$orderby"); + $query = compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page'); - return array($post_stati, $avail_post_stati); + // Hierarchical types require special args. + if ( is_post_type_hierarchical( $post_type ) ) { + $query['orderby'] = 'menu_order title'; + $query['order'] = 'asc'; + $query['posts_per_page'] = -1; + $query['posts_per_archive_page'] = -1; + } + + wp( $query ); + + return $avail_post_stati; } /** @@ -903,7 +960,7 @@ function wp_edit_attachments_query( $q = false ) { $q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0; $q['post_type'] = 'attachment'; $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : 'inherit'; - $media_per_page = (int) get_user_option( 'upload_per_page', 0, false ); + $media_per_page = (int) get_user_option( 'upload_per_page' ); if ( empty( $media_per_page ) || $media_per_page < 1 ) $media_per_page = 20; $q['posts_per_page'] = apply_filters( 'upload_per_page', $media_per_page ); @@ -922,6 +979,7 @@ function wp_edit_attachments_query( $q = false ) { /** * {@internal Missing Short Description}} * + * @uses get_user_option() * @since unknown * * @param unknown_type $id @@ -931,9 +989,11 @@ function wp_edit_attachments_query( $q = false ) { function postbox_classes( $id, $page ) { if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id ) return ''; - $current_user = wp_get_current_user(); - if ( $closed = get_user_option('closedpostboxes_'.$page, 0, false ) ) { - if ( !is_array( $closed ) ) return ''; + + if ( $closed = get_user_option('closedpostboxes_'.$page ) ) { + if ( !is_array( $closed ) ) { + return ''; + } return in_array( $id, $closed )? 'closed' : ''; } else { return ''; @@ -945,47 +1005,51 @@ function postbox_classes( $id, $page ) { * * @since unknown * - * @param int|object $id Post ID or post object. - * @param string $title (optional) Title - * @param string $name (optional) Name - * @return array With two entries of type string + * @param int|object $id Post ID or post object. + * @param string $title (optional) Title + * @param string $name (optional) Name + * @return array With two entries of type string */ function get_sample_permalink($id, $title = null, $name = null) { $post = &get_post($id); - if (!$post->ID) { + if ( !$post->ID ) return array('', ''); - } + + $ptype = get_post_type_object($post->post_type); + $original_status = $post->post_status; $original_date = $post->post_date; $original_name = $post->post_name; // Hack: get_permalink would return ugly permalink for // drafts, so we will fake, that our post is published - if (in_array($post->post_status, array('draft', 'pending'))) { + if ( in_array($post->post_status, array('draft', 'pending')) ) { $post->post_status = 'publish'; $post->post_name = sanitize_title($post->post_name ? $post->post_name : $post->post_title, $post->ID); } - $post->post_name = wp_unique_post_slug($post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent); - // If the user wants to set a new name -- override the current one // Note: if empty name is supplied -- use the title instead, see #6072 - if (!is_null($name)) { + if ( !is_null($name) ) $post->post_name = sanitize_title($name ? $name : $title, $post->ID); - } + + $post->post_name = wp_unique_post_slug($post->post_name, $post->ID, $post->post_status, $post->post_type, $post->post_parent); $post->filter = 'sample'; $permalink = get_permalink($post, true); + // Replace custom post_type Token with generic pagename token for ease of use. + $permalink = str_replace("%$post->post_type%", '%pagename%', $permalink); + // Handle page hierarchy - if ( 'page' == $post->post_type ) { - $uri = get_page_uri($post->ID); + if ( $ptype->hierarchical ) { + $uri = get_page_uri($post); $uri = untrailingslashit($uri); $uri = strrev( stristr( strrev( $uri ), '/' ) ); $uri = untrailingslashit($uri); if ( !empty($uri) ) - $uri .='/'; + $uri .= '/'; $permalink = str_replace('%pagename%', "${uri}%pagename%", $permalink); } @@ -1002,20 +1066,23 @@ function get_sample_permalink($id, $title = null, $name = null) { * sample permalink html * * intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor. - * + * * @since unknown * - * @param int|object $id Post ID or post object. - * @param string $new_title (optional) New title - * @param string $new_slug (optional) New slug - * @return string intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor. + * @param int|object $id Post ID or post object. + * @param string $new_title (optional) New title + * @param string $new_slug (optional) New slug + * @return string intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor. */ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { + global $wpdb; $post = &get_post($id); + list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug); if ( 'publish' == $post->post_status ) { - $view_post = 'post' == $post->post_type ? __('View Post') : __('View Page'); + $ptype = get_post_type_object($post->post_type); + $view_post = $ptype->labels->view_item; $title = __('Click to edit this part of the permalink'); } else { $title = __('Temporary permalink. Click to edit this part.'); @@ -1050,7 +1117,9 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { $post_name_html = '' . $post_name_abridged . ''; $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink); $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink); - $return = '' . __('Permalink:') . "\n" . '' . $display_link . "\n"; + $return = '' . __('Permalink:') . "\n"; + $return .= '' . $display_link . "\n"; + $return .= '‎'; // Fix bi-directional text display defect in RTL languages. $return .= '' . __('Edit') . "\n"; $return .= '' . $post_name . "\n"; if ( isset($view_post) ) @@ -1070,8 +1139,9 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { * @return string html */ function _wp_post_thumbnail_html( $thumbnail_id = NULL ) { - global $content_width, $_wp_additional_image_sizes; - $content = '

      ' . esc_html__( 'Set thumbnail' ) . '

      '; + global $content_width, $_wp_additional_image_sizes, $post_ID; + $set_thumbnail_link = '

      %s

      '; + $content = sprintf($set_thumbnail_link, esc_html__( 'Set featured image' )); if ( $thumbnail_id && get_post( $thumbnail_id ) ) { $old_content_width = $content_width; @@ -1081,8 +1151,9 @@ function _wp_post_thumbnail_html( $thumbnail_id = NULL ) { else $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' ); if ( !empty( $thumbnail_html ) ) { - $content = '' . $thumbnail_html . ''; - $content .= '

      ' . esc_html__( 'Remove thumbnail' ) . '

      '; + $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$post_ID" ); + $content = sprintf($set_thumbnail_link, $thumbnail_html); + $content .= '

      ' . esc_html__( 'Remove featured image' ) . '

      '; } $content_width = $old_content_width; } @@ -1131,10 +1202,7 @@ function wp_set_post_lock( $post_id ) { $now = time(); - if ( !add_post_meta( $post->ID, '_edit_lock', $now, true ) ) - update_post_meta( $post->ID, '_edit_lock', $now ); - if ( !add_post_meta( $post->ID, '_edit_last', $current_user->ID, true ) ) - update_post_meta( $post->ID, '_edit_last', $current_user->ID ); + update_post_meta( $post->ID, '_edit_lock', $now ); } /** @@ -1172,6 +1240,8 @@ function _admin_notice_post_locked() { * * @uses _wp_translate_postdata() * @uses _wp_post_revision_fields() + * + * @return unknown */ function wp_create_post_autosave( $post_id ) { $translated = _wp_translate_postdata( true ); @@ -1198,7 +1268,7 @@ function wp_create_post_autosave( $post_id ) { * Save draft or manually autosave for showing preview. * * @package WordPress - * @since 2.7 + * @since 2.7.0 * * @uses wp_write_post() * @uses edit_post() @@ -1211,7 +1281,8 @@ function wp_create_post_autosave( $post_id ) { function post_preview() { $post_ID = (int) $_POST['post_ID']; - if ( $post_ID < 1 ) + $status = get_post_status( $post_ID ); + if ( 'auto-draft' == $status ) wp_die( __('Preview not available. Please save as a draft first.') ); if ( isset($_POST['catslist']) ) @@ -1259,7 +1330,7 @@ function post_preview() { * Adds the TinyMCE editor used on the Write and Edit screens. * * @package WordPress - * @since 2.7 + * @since 2.7.0 * * TinyMCE is loaded separately from other Javascript by using wp-tinymce.php. It outputs concatenated * and optionaly pre-compressed version of the core and all default plugins. Additional plugins are loaded @@ -1270,7 +1341,7 @@ function post_preview() { * @param mixed $settings optional An array that can add to or overwrite the default TinyMCE settings. */ function wp_tiny_mce( $teeny = false, $settings = false ) { - global $concatenate_scripts, $compress_scripts, $tinymce_version; + global $concatenate_scripts, $compress_scripts, $tinymce_version, $editor_styles; if ( ! user_can_richedit() ) return; @@ -1382,7 +1453,10 @@ function wp_tiny_mce( $teeny = false, $settings = false ) { $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' )); $mce_buttons = implode($mce_buttons, ','); - $mce_buttons_2 = apply_filters('mce_buttons_2', array('formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'media', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' )); + $mce_buttons_2 = array('formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'media', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' ); + if ( is_multisite() ) + unset( $mce_buttons_2[ array_search( 'media', $mce_buttons_2 ) ] ); + $mce_buttons_2 = apply_filters('mce_buttons_2', $mce_buttons_2); $mce_buttons_2 = implode($mce_buttons_2, ','); $mce_buttons_3 = apply_filters('mce_buttons_3', array()); @@ -1391,7 +1465,7 @@ function wp_tiny_mce( $teeny = false, $settings = false ) { $mce_buttons_4 = apply_filters('mce_buttons_4', array()); $mce_buttons_4 = implode($mce_buttons_4, ','); } - $no_captions = ( apply_filters( 'disable_captions', '' ) ) ? true : false; + $no_captions = (bool) apply_filters( 'disable_captions', '' ); // TinyMCE init settings $initArray = array ( @@ -1400,12 +1474,12 @@ function wp_tiny_mce( $teeny = false, $settings = false ) { 'width' => '100%', 'theme' => 'advanced', 'skin' => 'wp_theme', - 'theme_advanced_buttons1' => "$mce_buttons", - 'theme_advanced_buttons2' => "$mce_buttons_2", - 'theme_advanced_buttons3' => "$mce_buttons_3", - 'theme_advanced_buttons4' => "$mce_buttons_4", - 'language' => "$mce_locale", - 'spellchecker_languages' => "$mce_spellchecker_languages", + 'theme_advanced_buttons1' => $mce_buttons, + 'theme_advanced_buttons2' => $mce_buttons_2, + 'theme_advanced_buttons3' => $mce_buttons_3, + 'theme_advanced_buttons4' => $mce_buttons_4, + 'language' => $mce_locale, + 'spellchecker_languages' => $mce_spellchecker_languages, 'theme_advanced_toolbar_location' => 'top', 'theme_advanced_toolbar_align' => 'left', 'theme_advanced_statusbar_location' => 'bottom', @@ -1426,13 +1500,35 @@ function wp_tiny_mce( $teeny = false, $settings = false ) { 'paste_remove_spans' => true, 'paste_strip_class_attributes' => 'all', 'wpeditimage_disable_captions' => $no_captions, - 'plugins' => "$plugins" + 'plugins' => $plugins ); - $mce_css = trim(apply_filters('mce_css', ''), ' ,'); + if ( ! empty( $editor_styles ) && is_array( $editor_styles ) ) { + $mce_css = array(); + $style_uri = get_stylesheet_directory_uri(); + if ( TEMPLATEPATH == STYLESHEETPATH ) { + foreach ( $editor_styles as $file ) + $mce_css[] = "$style_uri/$file"; + } else { + $style_dir = get_stylesheet_directory(); + $template_uri = get_template_directory_uri(); + $template_dir = get_template_directory(); + foreach ( $editor_styles as $file ) { + if ( file_exists( "$style_dir/$file" ) ) + $mce_css[] = "$style_uri/$file"; + if ( file_exists( "$template_dir/$file" ) ) + $mce_css[] = "$template_uri/$file"; + } + } + $mce_css = implode( ',', $mce_css ); + } else { + $mce_css = ''; + } + + $mce_css = trim( apply_filters( 'mce_css', $mce_css ), ' ,' ); if ( ! empty($mce_css) ) - $initArray['content_css'] = "$mce_css"; + $initArray['content_css'] = $mce_css; if ( is_array($settings) ) $initArray = array_merge($initArray, $settings); @@ -1456,7 +1552,9 @@ function wp_tiny_mce( $teeny = false, $settings = false ) { script_concat_settings(); $language = $initArray['language']; - $zip = $compress_scripts ? 1 : 0; + + $compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING']) + && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip'); /** * Deprecated @@ -1490,8 +1588,8 @@ tinyMCEPreInit = { \n"; + if ( $compressed ) + echo "\n"; else echo "\n"; @@ -1504,7 +1602,7 @@ tinyMCEPreInit = { comments ( KEY comment_approved (comment_approved), KEY comment_post_ID (comment_post_ID), KEY comment_approved_date_gmt (comment_approved,comment_date_gmt), - KEY comment_date_gmt (comment_date_gmt) + KEY comment_date_gmt (comment_date_gmt), + KEY comment_parent (comment_parent) ) $charset_collate; CREATE TABLE $wpdb->links ( link_id bigint(20) unsigned NOT NULL auto_increment, @@ -145,7 +146,8 @@ CREATE TABLE $wpdb->posts ( PRIMARY KEY (ID), KEY post_name (post_name), KEY type_status_date (post_type,post_status,post_date,ID), - KEY post_parent (post_parent) + KEY post_parent (post_parent), + KEY post_author (post_author) ) $charset_collate; CREATE TABLE $wpdb->users ( ID bigint(20) unsigned NOT NULL auto_increment, @@ -180,7 +182,7 @@ CREATE TABLE $wpdb->usermeta ( * @uses $wp_db_version */ function populate_options() { - global $wpdb, $wp_db_version; + global $wpdb, $wp_db_version, $current_site; $guessurl = wp_guess_url(); @@ -195,8 +197,9 @@ function populate_options() { $options = array( 'siteurl' => $guessurl, - 'blogname' => __('My Blog'), - 'blogdescription' => __('Just another WordPress weblog'), + 'blogname' => __('My Site'), + /* translators: blog tagline */ + 'blogdescription' => __('Just another WordPress site'), 'users_can_register' => 0, 'admin_email' => 'you@example.com', 'start_of_week' => 1, @@ -243,9 +246,8 @@ function populate_options() { // 1.5 'default_email_category' => 1, 'recently_edited' => '', - 'use_linksupdate' => 0, - 'template' => 'default', - 'stylesheet' => 'default', + 'template' => WP_DEFAULT_THEME, + 'stylesheet' => WP_DEFAULT_THEME, 'comment_whitelist' => 1, 'blacklist_keys' => '', 'comment_registration' => 0, @@ -263,9 +265,6 @@ function populate_options() { 'uploads_use_yearmonth_folders' => $uploads_use_yearmonth_folders, 'upload_path' => '', - // 2.0.3 - 'secret' => wp_generate_password(64), - // 2.1 'blog_public' => '1', 'default_link_category' => 2, @@ -297,9 +296,9 @@ function populate_options() { 'image_default_align' => '', 'close_comments_for_old_posts' => 0, 'close_comments_days_old' => 14, - 'thread_comments' => 0, + 'thread_comments' => 1, 'thread_comments_depth' => 5, - 'page_comments' => 1, + 'page_comments' => 0, 'comments_per_page' => 50, 'default_comments_page' => 'newest', 'comment_order' => 'asc', @@ -315,8 +314,19 @@ function populate_options() { 'embed_autourls' => 1, 'embed_size_w' => '', 'embed_size_h' => 600, + + // 3.0 + 'page_for_posts' => 0, + 'page_on_front' => 0, ); + // 3.0 multisite + if ( is_multisite() ) { + /* translators: blog tagline */ + $options[ 'blogdescription' ] = sprintf(__('Just another %s site'), $current_site->site_name ); + $options[ 'permalink_structure' ] = '/%year%/%monthnum%/%day%/%postname%/'; + } + // Set autoload to no for these options $fat_options = array( 'moderation_keys', 'recently_edited', 'blacklist_keys' ); @@ -348,10 +358,10 @@ function populate_options() { // Delete unused options $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins', 'can_compress_scripts', - 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length'); + 'page_uris', 'update_core', 'update_plugins', 'update_themes', 'doing_cron', 'random_seed', 'rss_excerpt_length', 'secret', 'use_linksupdate', 'default_comment_status_page' ); foreach ($unusedoptions as $option) delete_option($option); - + // delete obsolete magpie stuff $wpdb->query("DELETE FROM $wpdb->options WHERE option_name REGEXP '^rss_[0-9a-f]{32}(_ts)?$'"); } @@ -369,6 +379,7 @@ function populate_roles() { populate_roles_260(); populate_roles_270(); populate_roles_280(); + populate_roles_300(); } /** @@ -590,4 +601,181 @@ function populate_roles_280() { } } +/** + * Create and modify WordPress roles for WordPress 3.0. + * + * @since 3.0.0 + */ +function populate_roles_300() { + $role =& get_role( 'administrator' ); + + if ( !empty( $role ) ) { + $role->add_cap( 'update_core' ); + $role->add_cap( 'list_users' ); + $role->add_cap( 'remove_users' ); + $role->add_cap( 'add_users' ); + $role->add_cap( 'promote_users' ); + $role->add_cap( 'edit_theme_options' ); + $role->add_cap( 'delete_themes' ); + $role->add_cap( 'export' ); + } +} + +/** + * populate network settings + * + * @since 3.0.0 + * + * @param int $network_id id of network to populate + * @return bool|WP_Error True on success, or WP_Error on warning (with the install otherwise successful, + * so the error code must be checked) or failure. + */ +function populate_network( $network_id = 1, $domain = '', $email = '', $site_name = '', $path = '/', $subdomain_install = false ) { + global $wpdb, $current_site, $wp_db_version, $wp_rewrite; + + $errors = new WP_Error(); + if ( '' == $domain ) + $errors->add( 'empty_domain', __( 'You must provide a domain name.' ) ); + if ( '' == $site_name ) + $errors->add( 'empty_sitename', __( 'You must provide a name for your network of sites.' ) ); + + // check for network collision + if ( $network_id == $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE id = %d", $network_id ) ) ) + $errors->add( 'siteid_exists', __( 'The network already exists.' ) ); + + $site_user = get_user_by_email( $email ); + if ( ! is_email( $email ) ) + $errors->add( 'invalid_email', __( 'You must provide a valid e-mail address.' ) ); + + if ( $errors->get_error_code() ) + return $errors; + + // set up site tables + $template = get_option( 'template' ); + $stylesheet = get_option( 'stylesheet' ); + $allowed_themes = array( $stylesheet => true ); + if ( $template != $stylesheet ) + $allowed_themes[ $template ] = true; + if ( WP_DEFAULT_THEME != $stylesheet && WP_DEFAULT_THEME != $template ) + $allowed_themes[ WP_DEFAULT_THEME ] = true; + + if ( 1 == $network_id ) { + $wpdb->insert( $wpdb->site, array( 'domain' => $domain, 'path' => $path ) ); + $network_id = $wpdb->insert_id; + } else { + $wpdb->insert( $wpdb->site, array( 'domain' => $domain, 'path' => $path, 'id' => $network_id ) ); + } + + if ( !is_multisite() ) { + $site_admins = array( $site_user->user_login ); + $users = get_users_of_blog(); + if ( $users ) { + foreach ( $users as $user ) { + if ( is_super_admin( $user->ID ) && !in_array( $user->user_login, $site_admins ) ) + $site_admins[] = $user->user_login; + } + } + } else { + $site_admins = get_site_option( 'site_admins' ); + } + + $welcome_email = __( 'Dear User, + +Your new SITE_NAME site has been successfully set up at: +BLOG_URL + +You can log in to the administrator account with the following information: +Username: USERNAME +Password: PASSWORD +Login Here: BLOG_URLwp-login.php + +We hope you enjoy your new site. +Thanks! + +--The Team @ SITE_NAME' ); + + $sitemeta = array( + 'site_name' => $site_name, + 'admin_email' => $site_user->user_email, + 'admin_user_id' => $site_user->ID, + 'registration' => 'none', + 'upload_filetypes' => 'jpg jpeg png gif mp3 mov avi wmv midi mid pdf', + 'blog_upload_space' => 10, + 'fileupload_maxk' => 1500, + 'site_admins' => $site_admins, + 'allowedthemes' => $allowed_themes, + 'illegal_names' => array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator', 'files' ), + 'wpmu_upgrade_site' => $wp_db_version, + 'welcome_email' => $welcome_email, + 'first_post' => __( 'Welcome to SITE_NAME. This is your first post. Edit or delete it, then start blogging!' ), + // @todo - network admins should have a method of editing the network siteurl (used for cookie hash) + 'siteurl' => get_option( 'siteurl' ) . '/', + 'add_new_users' => '0', + 'upload_space_check_disabled' => '0', + 'subdomain_install' => intval( $subdomain_install ), + 'global_terms_enabled' => global_terms_enabled() ? '1' : '0' + ); + if ( !intval( $subdomain_install ) ) + $sitemeta['illegal_names'][] = 'blog'; + + $insert = ''; + foreach ( $sitemeta as $meta_key => $meta_value ) { + $meta_key = $wpdb->escape( $meta_key ); + if ( is_array( $meta_value ) ) + $meta_value = serialize( $meta_value ); + $meta_value = $wpdb->escape( $meta_value ); + if ( !empty( $insert ) ) + $insert .= ', '; + $insert .= "( $network_id, '$meta_key', '$meta_value')"; + } + $wpdb->query( "INSERT INTO $wpdb->sitemeta ( site_id, meta_key, meta_value ) VALUES " . $insert ); + + $current_site->domain = $domain; + $current_site->path = $path; + $current_site->site_name = ucfirst( $domain ); + + if ( !is_multisite() ) { + $wpdb->insert( $wpdb->blogs, array( 'site_id' => $network_id, 'domain' => $domain, 'path' => $path, 'registered' => current_time( 'mysql' ) ) ); + $blog_id = $wpdb->insert_id; + update_user_meta( $site_user->ID, 'source_domain', $domain ); + update_user_meta( $site_user->ID, 'primary_blog', $blog_id ); + if ( !$upload_path = get_option( 'upload_path' ) ) { + $upload_path = substr( WP_CONTENT_DIR, strlen( ABSPATH ) ) . '/uploads'; + update_option( 'upload_path', $upload_path ); + } + update_option( 'fileupload_url', get_option( 'siteurl' ) . '/' . $upload_path ); + } + + if ( $subdomain_install ) + update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%postname%/'); + else + update_option( 'permalink_structure', '/blog/%year%/%monthnum%/%day%/%postname%/'); + + $wp_rewrite->flush_rules(); + + if ( $subdomain_install ) { + $vhost_ok = false; + $errstr = ''; + $hostname = substr( md5( time() ), 0, 6 ) . '.' . $domain; // Very random hostname! + $page = wp_remote_get( 'http://' . $hostname, array( 'timeout' => 5, 'httpversion' => '1.1' ) ); + if ( is_wp_error( $page ) ) + $errstr = $page->get_error_message(); + elseif ( 200 == $page['response']['code'] ) + $vhost_ok = true; + + if ( ! $vhost_ok ) { + $msg = '

      ' . __( 'Warning! Wildcard DNS may not be configured correctly!' ) . '

      '; + $msg .= '

      ' . sprintf( __( 'The installer attempted to contact a random hostname (%1$s) on your domain.' ), $hostname ); + if ( ! empty ( $errstr ) ) + $msg .= ' ' . sprintf( __( 'This resulted in an error message: %s' ), '' . $errstr . '' ); + $msg .= '

      '; + $msg .= '

      ' . _e( 'To use a subdomain configuration, you must have a wildcard entry in your DNS. This usually means adding a * hostname record pointing at your web server in your DNS configuration tool.' ) . '

      '; + $msg .= '

      ' . __( 'You can still use your site but any subdomain you create may not be accessible. If you know your DNS is correct, ignore this message.' ) . '

      '; + return new WP_Error( 'no_wildcard_dns', $msg ); + } + } + + return true; +} + ?> diff --git a/wp-admin/includes/taxonomy.php b/wp-admin/includes/taxonomy.php index 5f104d63..b371ec24 100644 --- a/wp-admin/includes/taxonomy.php +++ b/wp-admin/includes/taxonomy.php @@ -19,7 +19,7 @@ * @return unknown */ function category_exists($cat_name, $parent = 0) { - $id = is_term($cat_name, 'category', $parent); + $id = term_exists($cat_name, 'category', $parent); if ( is_array($id) ) $id = $id['term_id']; return $id; @@ -48,7 +48,7 @@ function get_category_to_edit( $id ) { * @return unknown */ function wp_create_category( $cat_name, $parent = 0 ) { - if ( $id = category_exists($cat_name) ) + if ( $id = category_exists($cat_name, $parent) ) return $id; return wp_insert_category( array('cat_name' => $cat_name, 'category_parent' => $parent) ); @@ -73,19 +73,19 @@ function wp_create_categories($categories, $post_id = '') { $cat_ids[] = $id; } - if ($post_id) + if ( $post_id ) wp_set_post_categories($post_id, $cat_ids); return $cat_ids; } /** - * {@internal Missing Short Description}} + * Deletes one existing category. * - * @since unknown + * @since 2.0.0 * - * @param unknown_type $cat_ID - * @return unknown + * @param int $cat_ID + * @return mixed Returns true if completes delete action; false if term doesnt exist; Zero on attempted deletion of default Category; WP_Error object is also a possibility. */ function wp_delete_category($cat_ID) { $cat_ID = (int) $cat_ID; @@ -99,16 +99,16 @@ function wp_delete_category($cat_ID) { } /** - * {@internal Missing Short Description}} + * Updates an existing Category or creates a new Category. * - * @since unknown + * @since 2.0.0 * - * @param unknown_type $catarr - * @param unknown_type $wp_error - * @return unknown + * @param mixed $catarr See defaults below. Set 'cat_ID' to a non-zero value to update an existing category. The 'taxonomy' key was added in 3.0.0. + * @param bool $wp_error Optional, since 2.5.0. Set this to true if the caller handles WP_Error return values. + * @return int|object The ID number of the new or updated Category on success. Zero or a WP_Error on failure, depending on param $wp_error. */ function wp_insert_category($catarr, $wp_error = false) { - $cat_defaults = array('cat_ID' => 0, 'cat_name' => '', 'category_description' => '', 'category_nicename' => '', 'category_parent' => ''); + $cat_defaults = array('cat_ID' => 0, 'taxonomy' => 'category', 'cat_name' => '', 'category_description' => '', 'category_nicename' => '', 'category_parent' => ''); $catarr = wp_parse_args($catarr, $cat_defaults); extract($catarr, EXTR_SKIP); @@ -142,9 +142,9 @@ function wp_insert_category($catarr, $wp_error = false) { $args = compact('name', 'slug', 'parent', 'description'); if ( $update ) - $cat_ID = wp_update_term($cat_ID, 'category', $args); + $cat_ID = wp_update_term($cat_ID, $taxonomy, $args); else - $cat_ID = wp_insert_term($cat_name, 'category', $args); + $cat_ID = wp_insert_term($cat_name, $taxonomy, $args); if ( is_wp_error($cat_ID) ) { if ( $wp_error ) @@ -157,12 +157,15 @@ function wp_insert_category($catarr, $wp_error = false) { } /** - * {@internal Missing Short Description}} + * Aliases wp_insert_category() with minimal args. * - * @since unknown + * If you want to update only some fields of an existing category, call this + * function with only the new values set inside $catarr. * - * @param unknown_type $catarr - * @return unknown + * @since 2.0.0 + * + * @param array $catarr The 'cat_ID' value is required. All other keys are optional. + * @return int|bool The ID number of the new or updated Category on success. Zero or FALSE on failure. */ function wp_update_category($catarr) { $cat_ID = (int) $catarr['cat_ID']; @@ -237,7 +240,7 @@ function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) { * @return unknown */ function tag_exists($tag_name) { - return is_term($tag_name, 'post_tag'); + return term_exists($tag_name, 'post_tag'); } /** @@ -261,7 +264,7 @@ function wp_create_tag($tag_name) { * @return unknown */ function wp_create_term($tag_name, $taxonomy = 'post_tag') { - if ( $id = is_term($tag_name, $taxonomy) ) + if ( $id = term_exists($tag_name, $taxonomy) ) return $id; return wp_insert_term($tag_name, $taxonomy); diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 39f703a2..e3981f22 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -8,215 +8,23 @@ * @subpackage Administration */ -// Ugly recursive category stuff. -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $parent - * @param unknown_type $level - * @param unknown_type $categories - * @param unknown_type $page - * @param unknown_type $per_page - */ -function cat_rows( $parent = 0, $level = 0, $categories = 0, $page = 1, $per_page = 20 ) { - - $count = 0; - - if ( empty($categories) ) { - - $args = array('hide_empty' => 0); - if ( !empty($_GET['s']) ) - $args['search'] = $_GET['s']; - - $categories = get_categories( $args ); - - if ( empty($categories) ) - return false; - } - - $children = _get_term_hierarchy('category'); - - _cat_rows( $parent, $level, $categories, $children, $page, $per_page, $count ); - -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $categories - * @param unknown_type $count - * @param unknown_type $parent - * @param unknown_type $level - * @param unknown_type $page - * @param unknown_type $per_page - * @return unknown - */ -function _cat_rows( $parent = 0, $level = 0, $categories, &$children, $page = 1, $per_page = 20, &$count ) { - - $start = ($page - 1) * $per_page; - $end = $start + $per_page; - ob_start(); - - foreach ( $categories as $key => $category ) { - if ( $count >= $end ) - break; - - if ( $category->parent != $parent && empty($_GET['s']) ) - continue; - - // If the page starts in a subtree, print the parents. - if ( $count == $start && $category->parent > 0 ) { - - $my_parents = array(); - $p = $category->parent; - while ( $p ) { - $my_parent = get_category( $p ); - $my_parents[] = $my_parent; - if ( $my_parent->parent == 0 ) - break; - $p = $my_parent->parent; - } - - $num_parents = count($my_parents); - while( $my_parent = array_pop($my_parents) ) { - echo "\t" . _cat_row( $my_parent, $level - $num_parents ); - $num_parents--; - } - } - - if ( $count >= $start ) - echo "\t" . _cat_row( $category, $level ); - - unset( $categories[ $key ] ); - - $count++; - - if ( isset($children[$category->term_id]) ) - _cat_rows( $category->term_id, $level + 1, $categories, $children, $page, $per_page, $count ); - } - - $output = ob_get_contents(); - ob_end_clean(); - - echo $output; -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $category - * @param unknown_type $level - * @param unknown_type $name_override - * @return unknown - */ -function _cat_row( $category, $level, $name_override = false ) { - static $row_class = ''; - - $category = get_category( $category, OBJECT, 'display' ); - - $default_cat_id = (int) get_option( 'default_category' ); - $pad = str_repeat( '— ', max(0, $level) ); - $name = ( $name_override ? $name_override : $pad . ' ' . $category->name ); - $edit_link = "categories.php?action=edit&cat_ID=$category->term_id"; - if ( current_user_can( 'manage_categories' ) ) { - $edit = "name)) . "'>" . esc_attr( $name ) . '
      '; - $actions = array(); - $actions['edit'] = '' . __('Edit') . ''; - $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; - if ( $default_cat_id != $category->term_id ) - $actions['delete'] = "term_id) . "'>" . __('Delete') . ""; - $actions = apply_filters('cat_row_actions', $actions, $category); - $action_count = count($actions); - $i = 0; - $edit .= '
      '; - foreach ( $actions as $action => $link ) { - ++$i; - ( $i == $action_count ) ? $sep = '' : $sep = ' | '; - $edit .= "$link$sep"; - } - $edit .= '
      '; - } else { - $edit = $name; - } - - $row_class = 'alternate' == $row_class ? '' : 'alternate'; - $qe_data = get_category_to_edit($category->term_id); - - $category->count = number_format_i18n( $category->count ); - $posts_count = ( $category->count > 0 ) ? "$category->count" : $category->count; - $output = ""; - - $columns = get_column_headers('categories'); - $hidden = get_hidden_columns('categories'); - foreach ( $columns as $column_name => $column_display_name ) { - $class = "class=\"$column_name column-$column_name\""; - - $style = ''; - if ( in_array($column_name, $hidden) ) - $style = ' style="display:none;"'; - - $attributes = "$class$style"; - - switch ($column_name) { - case 'cb': - $output .= ""; - if ( $default_cat_id != $category->term_id ) { - $output .= ""; - } else { - $output .= " "; - } - $output .= ''; - break; - case 'name': - $output .= "$edit"; - $output .= ''; - break; - case 'description': - $output .= "$category->description"; - break; - case 'slug': - $output .= "" . apply_filters('editable_slug', $category->slug) . ""; - break; - case 'posts': - $attributes = 'class="posts column-posts num"' . $style; - $output .= "$posts_count\n"; - break; - default: - $output .= ""; - $output .= apply_filters('manage_categories_custom_column', '', $column_name, $category->term_id); - $output .= ""; - } - } - $output .= ''; - - return $output; -} - /** * {@internal Missing Short Description}} * * @since 2.7 * - * Outputs the HTML for the hidden table rows used in Categories, Link Caregories and Tags quick edit. + * Outputs the HTML for the hidden table rows used in Categories, Link Categories and Tags quick edit. * - * @param string $type "tag", "category" or "link-category" + * @param string $type "edit-tags", "categoried" or "edit-link-categories" + * @param string $taxonomy The taxonomy of the row. * @return */ -function inline_edit_term_row($type) { +function inline_edit_term_row($type, $taxonomy) { - if ( ! current_user_can( 'manage_categories' ) ) + $tax = get_taxonomy($taxonomy); + if ( ! current_user_can( $tax->cap->edit_terms ) ) return; - $is_tag = $type == 'edit-tags'; $columns = get_column_headers($type); $hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($type) ) ); $col_count = count($columns) - count($hidden); @@ -232,20 +40,12 @@ function inline_edit_term_row($type) { - + - - - - - - +
    @@ -256,18 +56,19 @@ function inline_edit_term_row($type) { foreach ( $columns as $column_name => $column_display_name ) { if ( isset( $core_columns[$column_name] ) ) continue; - do_action( 'quick_edit_custom_box', $column_name, $type ); + do_action( 'quick_edit_custom_box', $column_name, $type, $taxonomy ); } ?>

    - + labels->update_item; ?> - + +

    @@ -371,81 +172,10 @@ function link_cat_row( $category, $name_override = false ) { return $output; } -/** - * Outputs the html checked attribute. - * - * Compares the first two arguments and if identical marks as checked - * - * @since 1.0 - * - * @param any $checked One of the values to compare - * @param any $current (true) The other value to compare if not just true - * @param bool $echo Whether or not to echo or just return the string - */ -function checked( $checked, $current = true, $echo = true) { - return __checked_selected_helper( $checked, $current, $echo, 'checked' ); -} - -/** - * Outputs the html selected attribute. - * - * Compares the first two arguments and if identical marks as selected - * - * @since 1.0 - * - * @param any selected One of the values to compare - * @param any $current (true) The other value to compare if not just true - * @param bool $echo Whether or not to echo or just return the string - */ -function selected( $selected, $current = true, $echo = true) { - return __checked_selected_helper( $selected, $current, $echo, 'selected' ); -} - -/** - * Private helper function for checked and selected. - * - * Compares the first two arguments and if identical marks as $type - * - * @since 2.8 - * @access private - * - * @param any $helper One of the values to compare - * @param any $current (true) The other value to compare if not just true - * @param bool $echo Whether or not to echo or just return the string - * @param string $type The type of checked|selected we are doing. - */ -function __checked_selected_helper( $helper, $current, $echo, $type) { - if ( (string) $helper === (string) $current) - $result = " $type='$type'"; - else - $result = ''; - - if ($echo) - echo $result; - - return $result; -} - // // Category Checklists // -/** - * {@internal Missing Short Description}} - * - * @since unknown - * @deprecated Use {@link wp_link_category_checklist()} - * @see wp_link_category_checklist() - * - * @param unknown_type $default - * @param unknown_type $parent - * @param unknown_type $popular_ids - */ -function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) { - global $post_ID; - wp_category_checklist($post_ID); -} - /** * {@internal Missing Short Description}} * @@ -467,9 +197,16 @@ class Walker_Category_Checklist extends Walker { function start_el(&$output, $category, $depth, $args) { extract($args); + if ( empty($taxonomy) ) + $taxonomy = 'category'; + + if ( $taxonomy == 'category' ) + $name = 'post_category'; + else + $name = 'tax_input['.$taxonomy.']'; $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : ''; - $output .= "\n
  • " . ''; + $output .= "\n
  • " . ''; } function end_el(&$output, $category, $depth, $args) { @@ -488,31 +225,62 @@ class Walker_Category_Checklist extends Walker { * @param unknown_type $popular_cats */ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) { + wp_terms_checklist($post_id, + array( + 'taxonomy' => 'category', + 'descendants_and_self' => $descendants_and_self, + 'selected_cats' => $selected_cats, + 'popular_cats' => $popular_cats, + 'walker' => $walker, + 'checked_ontop' => $checked_ontop + )); +} + +/** + * Taxonomy independent version of wp_category_checklist + * + * @param int $post_id + * @param array $args + */ +function wp_terms_checklist($post_id = 0, $args = array()) { + $defaults = array( + 'descendants_and_self' => 0, + 'selected_cats' => false, + 'popular_cats' => false, + 'walker' => null, + 'taxonomy' => 'category', + 'checked_ontop' => true + ); + extract( wp_parse_args($args, $defaults), EXTR_SKIP ); + if ( empty($walker) || !is_a($walker, 'Walker') ) $walker = new Walker_Category_Checklist; $descendants_and_self = (int) $descendants_and_self; - $args = array(); + $args = array('taxonomy' => $taxonomy); + + $tax = get_taxonomy($taxonomy); + $args['disabled'] = !current_user_can($tax->cap->assign_terms); if ( is_array( $selected_cats ) ) $args['selected_cats'] = $selected_cats; elseif ( $post_id ) - $args['selected_cats'] = wp_get_post_categories($post_id); + $args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' => 'ids'))); else $args['selected_cats'] = array(); if ( is_array( $popular_cats ) ) $args['popular_cats'] = $popular_cats; else - $args['popular_cats'] = get_terms( 'category', array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) ); + $args['popular_cats'] = get_terms( $taxonomy, array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) ); if ( $descendants_and_self ) { - $categories = get_categories( "child_of=$descendants_and_self&hierarchical=0&hide_empty=0" ); - $self = get_category( $descendants_and_self ); + $categories = (array) get_terms($taxonomy, array( 'child_of' => $descendants_and_self, 'hierarchical' => 0, 'hide_empty' => 0 ) ); + $self = get_term( $descendants_and_self, $taxonomy ); array_unshift( $categories, $self ); } else { - $categories = get_categories('get=all'); + $categories = (array) get_terms($taxonomy, array('get' => 'all')); } if ( $checked_ontop ) { @@ -549,25 +317,31 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $ech global $post_ID; if ( $post_ID ) - $checked_categories = wp_get_post_categories($post_ID); + $checked_terms = wp_get_object_terms($post_ID, $taxonomy, array('fields'=>'ids')); else - $checked_categories = array(); + $checked_terms = array(); + + $terms = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) ); - $categories = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) ); + $tax = get_taxonomy($taxonomy); + if ( ! current_user_can($tax->cap->assign_terms) ) + $disabled = 'disabled="disabled"'; + else + $disabled = ''; $popular_ids = array(); - foreach ( (array) $categories as $category ) { - $popular_ids[] = $category->term_id; + foreach ( (array) $terms as $term ) { + $popular_ids[] = $term->term_id; if ( !$echo ) // hack for AJAX use continue; - $id = "popular-category-$category->term_id"; - $checked = in_array( $category->term_id, $checked_categories ) ? 'checked="checked"' : ''; + $id = "popular-$taxonomy-$term->term_id"; + $checked = in_array( $term->term_id, $checked_terms ) ? 'checked="checked"' : ''; ?>
  • @@ -576,21 +350,6 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $ech return $popular_ids; } -/** - * {@internal Missing Short Description}} - * - * @since unknown - * @deprecated Use {@link wp_link_category_checklist()} - * @see wp_link_category_checklist() - * - * @param unknown_type $default - */ -function dropdown_link_categories( $default = 0 ) { - global $link_id; - - wp_link_category_checklist($link_id); -} - /** * {@internal Missing Short Description}} * @@ -602,26 +361,24 @@ function wp_link_category_checklist( $link_id = 0 ) { $default = 1; if ( $link_id ) { - $checked_categories = wp_get_link_cats($link_id); - - if ( count( $checked_categories ) == 0 ) { - // No selected categories, strange + $checked_categories = wp_get_link_cats( $link_id ); + // No selected categories, strange + if ( ! count( $checked_categories ) ) $checked_categories[] = $default; - } } else { $checked_categories[] = $default; } - $categories = get_terms('link_category', 'orderby=count&hide_empty=0'); + $categories = get_terms( 'link_category', array( 'orderby' => 'name', 'hide_empty' => 0 ) ); - if ( empty($categories) ) + if ( empty( $categories ) ) return; foreach ( $categories as $category ) { $cat_id = $category->term_id; - $name = esc_html( apply_filters('the_category', $category->name)); - $checked = in_array( $cat_id, $checked_categories ); - echo '"; + $name = esc_html( apply_filters( 'the_category', $category->name ) ); + $checked = in_array( $cat_id, $checked_categories ) ? ' checked="checked"' : ''; + echo '"; } } @@ -638,18 +395,36 @@ function wp_link_category_checklist( $link_id = 0 ) { * @param unknown_type $class * @return unknown */ -function _tag_row( $tag, $class = '', $taxonomy = 'post_tag' ) { +function _tag_row( $tag, $level, $taxonomy = 'post_tag' ) { + global $post_type, $current_screen; + static $row_class = ''; + $row_class = ($row_class == '' ? ' class="alternate"' : ''); + $count = number_format_i18n( $tag->count ); - $tagsel = ($taxonomy == 'post_tag' ? 'tag' : $taxonomy); - $count = ( $count > 0 ) ? "$count" : $count; + $tax = get_taxonomy($taxonomy); + + if ( 'post_tag' == $taxonomy ) { + $tagsel = 'tag'; + } elseif ( 'category' == $taxonomy ) { + $tagsel = 'category_name'; + } elseif ( ! empty($tax->query_var) ) { + $tagsel = $tax->query_var; + } else { + $tagsel = $taxonomy; + } - $name = apply_filters( 'term_name', $tag->name ); + $pad = str_repeat( '— ', max(0, $level) ); + $name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag ); $qe_data = get_term($tag->term_id, $taxonomy, object, 'edit'); - $edit_link = "edit-tags.php?action=edit&taxonomy=$taxonomy&tag_ID=$tag->term_id"; + $edit_link = "edit-tags.php?action=edit&taxonomy=$taxonomy&post_type=$post_type&tag_ID=$tag->term_id"; + $out = ''; - $out .= ''; - $columns = get_column_headers('edit-tags'); - $hidden = get_hidden_columns('edit-tags'); + $out .= ''; + + + $columns = get_column_headers($current_screen); + $hidden = get_hidden_columns($current_screen); + $default_term = get_option('default_' . $taxonomy); foreach ( $columns as $column_name => $column_display_name ) { $class = "class=\"$column_name column-$column_name\""; @@ -661,15 +436,24 @@ function _tag_row( $tag, $class = '', $taxonomy = 'post_tag' ) { switch ($column_name) { case 'cb': - $out .= ' '; + if ( current_user_can($tax->cap->delete_terms) && $tag->term_id != $default_term ) + $out .= ' '; + else + $out .= ' '; break; case 'name': $out .= '' . $name . '
    '; $actions = array(); - $actions['edit'] = '' . __('Edit') . ''; - $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; - $actions['delete'] = "term_id) . "'>" . __('Delete') . ""; + if ( current_user_can($tax->cap->edit_terms) ) { + $actions['edit'] = '' . __('Edit') . ''; + $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; + } + if ( current_user_can($tax->cap->delete_terms) && $tag->term_id != $default_term ) + $actions['delete'] = "term_id) . "'>" . __('Delete') . ""; + $actions = apply_filters('tag_row_actions', $actions, $tag); + $actions = apply_filters("${taxonomy}_row_actions", $actions, $tag); + $action_count = count($actions); $i = 0; $out .= '
    '; @@ -681,7 +465,8 @@ function _tag_row( $tag, $class = '', $taxonomy = 'post_tag' ) { $out .= '
    '; $out .= ''; + $out .= '
    ' . apply_filters('editable_slug', $qe_data->slug) . '
    '; + $out .= '
    ' . $qe_data->parent . '
    '; break; case 'description': $out .= "$tag->description"; @@ -691,7 +476,7 @@ function _tag_row( $tag, $class = '', $taxonomy = 'post_tag' ) { break; case 'posts': $attributes = 'class="posts column-posts num"' . $style; - $out .= "$count"; + $out .= "$count"; break; default: $out .= ""; @@ -700,7 +485,7 @@ function _tag_row( $tag, $class = '', $taxonomy = 'post_tag' ) { } } - $out .= ''; + $out .= "\n"; return $out; } @@ -725,23 +510,84 @@ function tag_rows( $page = 1, $pagesize = 20, $searchterms = '', $taxonomy = 'po $args = array('offset' => $start, 'number' => $pagesize, 'hide_empty' => 0); - if ( !empty( $searchterms ) ) { + if ( !empty( $searchterms ) ) $args['search'] = $searchterms; - } - - $tags = get_terms( $taxonomy, $args ); // convert it to table rows $out = ''; $count = 0; - foreach( $tags as $tag ) - $out .= _tag_row( $tag, ++$count % 2 ? ' class="alternate"' : '', $taxonomy ); + if ( is_taxonomy_hierarchical($taxonomy) ) { + // We'll need the full set of terms then. + $args['number'] = $args['offset'] = 0; + + $terms = get_terms( $taxonomy, $args ); + if ( !empty( $searchterms ) ) // Ignore children on searches. + $children = array(); + else + $children = _get_term_hierarchy($taxonomy); + + // Some funky recursion to get the job done(Paging & parents mainly) is contained within, Skip it for non-hierarchical taxonomies for performance sake + $out .= _term_rows($taxonomy, $terms, $children, $page, $pagesize, $count); + } else { + $terms = get_terms( $taxonomy, $args ); + foreach( $terms as $term ) + $out .= _tag_row( $term, 0, $taxonomy ); + $count = $pagesize; // Only displaying a single page. + } - // filter and send to screen echo $out; return $count; } +function _term_rows( $taxonomy, $terms, &$children, $page = 1, $per_page = 20, &$count, $parent = 0, $level = 0 ) { + + $start = ($page - 1) * $per_page; + $end = $start + $per_page; + + $output = ''; + foreach ( $terms as $key => $term ) { + + if ( $count >= $end ) + break; + + if ( $term->parent != $parent && empty($_GET['s']) ) + continue; + + // If the page starts in a subtree, print the parents. + if ( $count == $start && $term->parent > 0 && empty($_GET['s']) ) { + $my_parents = $parent_ids = array(); + $p = $term->parent; + while ( $p ) { + $my_parent = get_term( $p, $taxonomy ); + $my_parents[] = $my_parent; + $p = $my_parent->parent; + if ( in_array($p, $parent_ids) ) // Prevent parent loops. + break; + $parent_ids[] = $p; + } + unset($parent_ids); + + $num_parents = count($my_parents); + while ( $my_parent = array_pop($my_parents) ) { + $output .= "\t" . _tag_row( $my_parent, $level - $num_parents, $taxonomy ); + $num_parents--; + } + } + + if ( $count >= $start ) + $output .= "\t" . _tag_row( $term, $level, $taxonomy ); + + ++$count; + + unset($terms[$key]); + + if ( isset($children[$term->term_id]) && empty($_GET['s']) ) + $output .= _term_rows( $taxonomy, $terms, $children, $page, $per_page, $count, $term->term_id, $level + 1 ); + } + + return $output; +} + // define the columns to display, the syntax is 'internal name' => 'display name' /** * {@internal Missing Short Description}} @@ -750,19 +596,31 @@ function tag_rows( $page = 1, $pagesize = 20, $searchterms = '', $taxonomy = 'po * * @return unknown */ -function wp_manage_posts_columns() { +function wp_manage_posts_columns( $screen = '') { + if ( empty($screen) ) + $post_type = 'post'; + else + $post_type = $screen->post_type; + $posts_columns = array(); $posts_columns['cb'] = ''; /* translators: manage posts column name */ - $posts_columns['title'] = _x('Post', 'column name'); + $posts_columns['title'] = _x('Title', 'column name'); $posts_columns['author'] = __('Author'); - $posts_columns['categories'] = __('Categories'); - $posts_columns['tags'] = __('Tags'); + if ( empty($post_type) || is_object_in_taxonomy($post_type, 'category') ) + $posts_columns['categories'] = __('Categories'); + if ( empty($post_type) || is_object_in_taxonomy($post_type, 'post_tag') ) + $posts_columns['tags'] = __('Tags'); $post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all'; - if ( !in_array( $post_status, array('pending', 'draft', 'future') ) ) - $posts_columns['comments'] = '
    Comments
    '; + if ( !in_array( $post_status, array('pending', 'draft', 'future') ) && ( empty($post_type) || post_type_supports($post_type, 'comments') ) ) + $posts_columns['comments'] = '
    Comments
    '; $posts_columns['date'] = __('Date'); - $posts_columns = apply_filters('manage_posts_columns', $posts_columns); + + if ( 'page' == $post_type ) + $posts_columns = apply_filters( 'manage_pages_columns', $posts_columns ); + else + $posts_columns = apply_filters( 'manage_posts_columns', $posts_columns, $post_type ); + $posts_columns = apply_filters( "manage_{$post_type}_posts_columns", $posts_columns ); return $posts_columns; } @@ -785,7 +643,7 @@ function wp_manage_media_columns() { //$posts_columns['tags'] = _x('Tags', 'column name'); /* translators: column name */ $posts_columns['parent'] = _x('Attached to', 'column name'); - $posts_columns['comments'] = '
    Comments
    '; + $posts_columns['comments'] = '
    Comments
    '; //$posts_columns['comments'] = __('Comments'); /* translators: column name */ $posts_columns['date'] = _x('Date', 'column name'); @@ -802,46 +660,36 @@ function wp_manage_media_columns() { * @return unknown */ function wp_manage_pages_columns() { - $posts_columns = array(); - $posts_columns['cb'] = ''; - $posts_columns['title'] = __('Title'); - $posts_columns['author'] = __('Author'); - $post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all'; - if ( !in_array( $post_status, array('pending', 'draft', 'future') ) ) - $posts_columns['comments'] = '
    '; - $posts_columns['date'] = __('Date'); - $posts_columns = apply_filters('manage_pages_columns', $posts_columns); - - return $posts_columns; + return wp_manage_posts_columns(); } /** - * {@internal Missing Short Description}} + * Get the column headers for a screen * * @since unknown * - * @param unknown_type $page - * @return unknown + * @param string|object $screen The screen you want the headers for + * @return array Containing the headers in the format id => UI String */ -function get_column_headers($page) { +function get_column_headers($screen) { global $_wp_column_headers; if ( !isset($_wp_column_headers) ) $_wp_column_headers = array(); + if ( is_string($screen) ) + $screen = convert_to_screen($screen); + // Store in static to avoid running filters on each call - if ( isset($_wp_column_headers[$page]) ) - return $_wp_column_headers[$page]; + if ( isset($_wp_column_headers[$screen->id]) ) + return $_wp_column_headers[$screen->id]; - switch ($page) { + switch ($screen->base) { case 'edit': - $_wp_column_headers[$page] = wp_manage_posts_columns(); + $_wp_column_headers[$screen->id] = wp_manage_posts_columns( $screen ); break; - case 'edit-pages': - $_wp_column_headers[$page] = wp_manage_pages_columns(); - break; case 'edit-comments': - $_wp_column_headers[$page] = array( + $_wp_column_headers[$screen->id] = array( 'cb' => '', 'author' => __('Author'), /* translators: column name */ @@ -852,7 +700,7 @@ function get_column_headers($page) { break; case 'link-manager': - $_wp_column_headers[$page] = array( + $_wp_column_headers[$screen->id] = array( 'cb' => '', 'name' => __('Name'), 'url' => __('URL'), @@ -864,10 +712,10 @@ function get_column_headers($page) { break; case 'upload': - $_wp_column_headers[$page] = wp_manage_media_columns(); + $_wp_column_headers[$screen->id] = wp_manage_media_columns(); break; case 'categories': - $_wp_column_headers[$page] = array( + $_wp_column_headers[$screen->id] = array( 'cb' => '', 'name' => __('Name'), 'description' => __('Description'), @@ -877,7 +725,7 @@ function get_column_headers($page) { break; case 'edit-link-categories': - $_wp_column_headers[$page] = array( + $_wp_column_headers[$screen->id] = array( 'cb' => '', 'name' => __('Name'), 'description' => __('Description'), @@ -887,7 +735,7 @@ function get_column_headers($page) { break; case 'edit-tags': - $_wp_column_headers[$page] = array( + $_wp_column_headers[$screen->id] = array( 'cb' => '', 'name' => __('Name'), 'description' => __('Description'), @@ -897,7 +745,7 @@ function get_column_headers($page) { break; case 'users': - $_wp_column_headers[$page] = array( + $_wp_column_headers[$screen->id] = array( 'cb' => '', 'username' => __('Username'), 'name' => __('Name'), @@ -907,11 +755,11 @@ function get_column_headers($page) { ); break; default : - $_wp_column_headers[$page] = array(); + $_wp_column_headers[$screen->id] = array(); } - $_wp_column_headers[$page] = apply_filters('manage_' . $page . '_columns', $_wp_column_headers[$page]); - return $_wp_column_headers[$page]; + $_wp_column_headers[$screen->id] = apply_filters('manage_' . $screen->id . '_columns', $_wp_column_headers[$screen->id]); + return $_wp_column_headers[$screen->id]; } /** @@ -919,18 +767,16 @@ function get_column_headers($page) { * * @since unknown * - * @param unknown_type $type + * @param unknown_type $screen * @param unknown_type $id */ -function print_column_headers( $type, $id = true ) { - $type = str_replace('.php', '', $type); - $columns = get_column_headers( $type ); - $hidden = get_hidden_columns($type); +function print_column_headers( $screen, $id = true ) { + if ( is_string($screen) ) + $screen = convert_to_screen($screen); + + $columns = get_column_headers( $screen ); + $hidden = get_hidden_columns($screen); $styles = array(); -// $styles['tag']['posts'] = 'width: 90px;'; -// $styles['link-category']['links'] = 'width: 90px;'; -// $styles['category']['posts'] = 'width: 90px;'; -// $styles['link']['visible'] = 'text-align: center;'; foreach ( $columns as $column_key => $column_display_name ) { $class = ' class="manage-column'; @@ -948,8 +794,8 @@ function print_column_headers( $type, $id = true ) { if ( in_array($column_key, $hidden) ) $style = 'display:none;'; - if ( isset($styles[$type]) && isset($styles[$type][$column_key]) ) - $style .= ' ' . $styles[$type][$column_key]; + if ( isset($styles[$screen->id]) && isset($styles[$screen->id][$column_key]) ) + $style .= ' ' . $styles[$screen>id][$column_key]; $style = ' style="' . $style . '"'; ?> > @@ -968,10 +814,13 @@ function print_column_headers( $type, $id = true ) { function register_column_headers($screen, $columns) { global $_wp_column_headers; + if ( is_string($screen) ) + $screen = convert_to_screen($screen); + if ( !isset($_wp_column_headers) ) $_wp_column_headers = array(); - $_wp_column_headers[$screen] = $columns; + $_wp_column_headers[$screen->id] = $columns; } /** @@ -979,11 +828,13 @@ function register_column_headers($screen, $columns) { * * @since unknown * - * @param unknown_type $page + * @param unknown_type $screen */ -function get_hidden_columns($page) { - $page = str_replace('.php', '', $page); - return (array) get_user_option( 'manage-' . $page . '-columns-hidden', 0, false ); +function get_hidden_columns($screen) { + if ( is_string($screen) ) + $screen = convert_to_screen($screen); + + return (array) get_user_option( 'manage' . $screen->id. 'columnshidden' ); } /** @@ -993,43 +844,61 @@ function get_hidden_columns($page) { * * @since 2.7 * - * @param string $type 'post' or 'page' + * @param string $screen */ -function inline_edit_row( $type ) { +function inline_edit_row( $screen ) { global $current_user, $mode; - $is_page = 'page' == $type; - if ( $is_page ) { - $screen = 'edit-pages'; - $post = get_default_page_to_edit(); - } else { - $screen = 'edit'; - $post = get_default_post_to_edit(); + if ( is_string($screen) ) { + $screen = array('id' => 'edit-' . $screen, 'base' => 'edit', 'post_type' => $screen ); + $screen = (object) $screen; + } + + $post = get_default_post_to_edit( $screen->post_type ); + $post_type_object = get_post_type_object( $screen->post_type ); + + $taxonomy_names = get_object_taxonomies( $screen->post_type ); + $hierarchical_taxonomies = array(); + $flat_taxonomies = array(); + foreach ( $taxonomy_names as $taxonomy_name ) { + $taxonomy = get_taxonomy( $taxonomy_name); + + if ( !$taxonomy->show_ui ) + continue; + + if ( $taxonomy->hierarchical ) + $hierarchical_taxonomies[] = $taxonomy; + else + $flat_taxonomies[] = $taxonomy; } - $columns = $is_page ? wp_manage_pages_columns() : wp_manage_posts_columns(); + $columns = wp_manage_posts_columns($screen); $hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($screen) ) ); $col_count = count($columns) - count($hidden); $m = ( isset($mode) && 'excerpt' == $mode ) ? 'excerpt' : 'list'; - $can_publish = current_user_can("publish_{$type}s"); + $can_publish = current_user_can($post_type_object->cap->publish_posts); $core_columns = array( 'cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true ); ?> - post_type "; + echo $bulk ? "bulk-edit-row bulk-edit-row-$hclass bulk-edit-$screen->post_type" : "quick-edit-row quick-edit-row-$hclass inline-edit-$screen->post_type"; ?>" style="display: none"> @@ -1286,11 +1181,11 @@ function inline_edit_row( $type ) { * @param unknown_type $post */ function get_inline_data($post) { - - if ( ! current_user_can('edit_' . $post->post_type, $post->ID) ) + $post_type_object = get_post_type_object($post->post_type); + if ( ! current_user_can($post_type_object->cap->edit_post, $post->ID) ) return; - $title = esc_attr($post->post_title); + $title = esc_attr( get_the_title( $post->ID ) ); echo ' '; } @@ -1345,8 +1250,6 @@ function post_rows( $posts = array() ) { $post_ids[] = $a_post->ID; $comment_pending_count = get_pending_comments_num($post_ids); - if ( empty($comment_pending_count) ) - $comment_pending_count = array(); foreach ( $posts as $post ) { if ( empty($comment_pending_count[$post->ID]) ) @@ -1366,7 +1269,7 @@ function post_rows( $posts = array() ) { * @param unknown_type $mode */ function _post_row($a_post, $pending_comments, $mode) { - global $post, $current_user; + global $post, $current_user, $current_screen; static $rowclass; $global_post = $post; @@ -1377,11 +1280,12 @@ function _post_row($a_post, $pending_comments, $mode) { $post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' ); $edit_link = get_edit_post_link( $post->ID ); $title = _draft_or_post_title(); + $post_type_object = get_post_type_object($post->post_type); ?> post_status ); ?> iedit' valign="top"> $column_display_name ) { $class = "class=\"$column_name column-$column_name\""; @@ -1395,7 +1299,7 @@ function _post_row($a_post, $pending_comments, $mode) { case 'cb': ?> - + - + - + - + ID; $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; - $posts_columns = get_column_headers('edit-pages'); - $hidden = get_hidden_columns('edit-pages'); + $posts_columns = get_column_headers( $current_screen ); + $hidden = get_hidden_columns( $current_screen ); $title = _draft_or_post_title(); + $post_type = $page->post_type; + $post_type_object = get_post_type_object($post_type); ?> $column_display_name) { +foreach ( $posts_columns as $column_name => $column_display_name ) { $class = "class=\"$column_name column-$column_name\""; $style = ''; @@ -1623,7 +1529,7 @@ foreach ($posts_columns as $column_name=>$column_display_name) { case 'cb': ?> - + $column_display_name) { $attributes = 'class="post-title page-title column-title"' . $style; $edit_link = get_edit_post_link( $page->ID ); ?> - + post_parent == $page->ID ) { $page->post_parent = 0; - $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = '0' WHERE ID = %d", $page->ID) ); + $wpdb->update($wpdb->posts, array('post_parent' => 0), array('ID' => $page->ID)); clean_page_cache( $page->ID ); } @@ -1820,12 +1726,9 @@ function page_rows($pages, $pagenum = 1, $per_page = 20) { } } -/* +/** * Given a top level page ID, display the nested hierarchy of sub-pages * together with paging support - */ -/** - * {@internal Missing Short Description}} * * @since unknown * @@ -1879,16 +1782,17 @@ function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_ } /** - * {@internal Missing Short Description}} + * Generate HTML for a single row on the users.php admin panel. * - * @since unknown + * @since 2.1.0 * - * @param unknown_type $user_object - * @param unknown_type $style - * @param unknown_type $role - * @return unknown + * @param object $user_object + * @param string $style Optional. Attributes added to the TR element. Must be sanitized. + * @param string $role Key for the $wp_roles array. + * @param int $numposts Optional. Post count to display for this user. Defaults to zero, as in, a new user has made zero posts. + * @return string */ -function user_row( $user_object, $style = '', $role = '' ) { +function user_row( $user_object, $style = '', $role = '', $numposts = 0 ) { global $wp_roles; $current_user = wp_get_current_user(); @@ -1904,12 +1808,11 @@ function user_row( $user_object, $style = '', $role = '' ) { $short_url = substr( $short_url, 0, -1 ); if ( strlen( $short_url ) > 35 ) $short_url = substr( $short_url, 0, 32 ).'...'; - $numposts = get_usernumposts( $user_object->ID ); $checkbox = ''; // Check if the user for this row is editable - if ( current_user_can( 'edit_user', $user_object->ID ) ) { + if ( current_user_can( 'list_users' ) ) { // Set up the user editing link - // TODO: make profile/user-edit determination a seperate function + // TODO: make profile/user-edit determination a separate function if ($current_user->ID == $user_object->ID) { $edit_link = 'profile.php'; } else { @@ -1919,9 +1822,18 @@ function user_row( $user_object, $style = '', $role = '' ) { // Set up the hover actions for this user $actions = array(); - $actions['edit'] = '' . __('Edit') . ''; - if ( $current_user->ID != $user_object->ID ) + + if ( current_user_can('edit_user', $user_object->ID) ) { + $edit = "$user_object->user_login
    "; + $actions['edit'] = '' . __('Edit') . ''; + } else { + $edit = "$user_object->user_login
    "; + } + + if ( !is_multisite() && $current_user->ID != $user_object->ID && current_user_can('delete_user', $user_object->ID) ) $actions['delete'] = "" . __('Delete') . ""; + if ( is_multisite() && $current_user->ID != $user_object->ID && current_user_can('remove_user', $user_object->ID) ) + $actions['remove'] = "" . __('Remove') . ""; $actions = apply_filters('user_row_actions', $actions, $user_object); $action_count = count($actions); $i = 0; @@ -1964,7 +1876,7 @@ function user_row( $user_object, $style = '', $role = '' ) { $r .= ""; break; case 'email': - $r .= ""; + $r .= ""; break; case 'role': $r .= ""; @@ -2095,8 +2007,10 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $comment = get_comment( $comment_id ); $post = get_post($comment->comment_post_ID); $the_comment_status = wp_get_comment_status($comment->comment_ID); - $user_can = current_user_can('edit_post', $post->ID); + $post_type_object = get_post_type_object($post->post_type); + $user_can = current_user_can($post_type_object->cap->edit_post, $post->ID); + $comment_url = esc_url(get_comment_link($comment->comment_ID)); $author_url = get_comment_author_url(); if ( 'http://' == $author_url ) $author_url = ''; @@ -2114,7 +2028,6 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) ); $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) ); - $comment_url = esc_url(get_comment_link($comment->comment_ID)); $approve_url = esc_url( "comment.php?action=approvecomment&p=$post->ID&c=$comment->comment_ID&$approve_nonce" ); $unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$post->ID&c=$comment->comment_ID&$approve_nonce" ); $spam_url = esc_url( "comment.php?action=spamcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" ); @@ -2146,7 +2059,18 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, case 'comment': echo "
    -

    +

    - +post_type, 'title' ) ) : + if ( $bulk ) : ?>
    @@ -1041,16 +910,15 @@ function inline_edit_row( $type ) { - - - - - + + +
    @@ -1059,12 +927,13 @@ function inline_edit_row( $type ) { id, true, $type ); // TODO: ROLE SYSTEM + if ( post_type_supports( $screen->post_type, 'author' ) ) : + $authors = get_editable_user_ids( $current_user->id, true, $screen->post_type ); // TODO: ROLE SYSTEM $authors_dropdown = ''; if ( $authors && count( $authors ) > 1 ) : $users_opt = array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'multi' => 1, 'echo' => 0); if ( $bulk ) - $users_opt['show_option_none'] = __('- No Change -'); + $users_opt['show_option_none'] = __('— No Change —'); $authors_dropdown = '
    - +
    - + + + + labels->name) ?> -
      - + +
        + $taxonomy->name)) ?>
      + + +
    - +
    post_type, 'author' ) && $bulk ) echo $authors_dropdown; ?> - +hierarchical ) : ?> - +post_type, 'page-attributes' ) ) : + if ( !$bulk ) : ?> - +hierarchical ?> + + + + - + - + + +post_type, 'comments' ) || post_type_supports( $screen->post_type, 'trackbacks' ) ) : + if ( $bulk ) : ?>
    + post_type, 'comments' ) ) : ?> - + post_type, 'trackbacks' ) ) : ?> +
    + post_type, 'comments' ) ) : ?> - + post_type, 'trackbacks' ) ) : ?> +
    - - +
    - +post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
    @@ -1250,23 +1144,24 @@ function inline_edit_row( $type ) { foreach ( $columns as $column_name => $column_display_name ) { if ( isset( $core_columns[$column_name] ) ) continue; - do_action( $bulk ? 'bulk_edit_custom_box' : 'quick_edit_custom_box', $column_name, $type); + do_action( $bulk ? 'bulk_edit_custom_box' : 'quick_edit_custom_box', $column_name, $screen->post_type ); } ?>

    - + - + +

    ID ) ) { ?>cap->edit_post, $post->ID ) ) { ?> >ID) && $post->post_status != 'trash' ) { ?> + >cap->edit_post, $post->ID) && $post->post_status != 'trash' ) { ?> ID) && 'trash' != $post->post_status ) { - $actions['edit'] = '' . __('Edit') . ''; - $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; + if ( current_user_can($post_type_object->cap->edit_post, $post->ID) && 'trash' != $post->post_status ) { + $actions['edit'] = '' . __('Edit') . ''; + $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; } - if ( current_user_can('delete_post', $post->ID) ) { + if ( current_user_can($post_type_object->cap->delete_post, $post->ID) ) { if ( 'trash' == $post->post_status ) - $actions['untrash'] = "ID) . "'>" . __('Restore') . ""; + $actions['untrash'] = "ID) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __('Restore') . ""; elseif ( EMPTY_TRASH_DAYS ) - $actions['trash'] = "" . __('Trash') . ""; + $actions['trash'] = "" . __('Trash') . ""; if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS ) - $actions['delete'] = "ID) . "'>" . __('Delete Permanently') . ""; + $actions['delete'] = "" . __('Delete Permanently') . ""; } if ( in_array($post->post_status, array('pending', 'draft')) ) { - if ( current_user_can('edit_post', $post->ID) ) - $actions['view'] = '' . __('Preview') . ''; + if ( current_user_can($post_type_object->cap->edit_post, $post->ID) ) + $actions['view'] = '' . __('Preview') . ''; } elseif ( 'trash' != $post->post_status ) { $actions['view'] = '' . __('View') . ''; } @@ -1528,7 +1432,7 @@ function _post_row($a_post, $pending_comments, $mode) { case 'author': ?> - >> ID) ) { echo "" . __('Edit') . ""; } ?>cap->edit_post, $post->ID) ) { echo "" . __('Edit') . ""; } ?> ID) ) { echo "ID) . "' class='delete'>" . __('Delete') . ""; } ?>cap->delete_post, $post->ID) ) { echo "ID) . "' class='delete'>" . __('Delete') . ""; } ?>
    cap->edit_post, $page->ID ) ) { ?> >ID) && $post->post_status != 'trash' ) { ?> + >cap->edit_post, $page->ID) && $post->post_status != 'trash' ) { ?>labels->parent_item_colon . ' ' . esc_html($parent_name) : ''; ?> ID) && $post->post_status != 'trash' ) { + if ( current_user_can($post_type_object->cap->edit_post, $page->ID) && $post->post_status != 'trash' ) { $actions['edit'] = '' . __('Edit') . ''; $actions['inline'] = '' . __('Quick Edit') . ''; } - if ( current_user_can('delete_page', $page->ID) ) { + if ( current_user_can($post_type_object->cap->delete_post, $page->ID) ) { if ( $post->post_status == 'trash' ) - $actions['untrash'] = "ID) . "'>" . __('Restore') . ""; + $actions['untrash'] = "post_type . '_' . $page->ID) . "'>" . __('Restore') . ""; elseif ( EMPTY_TRASH_DAYS ) $actions['trash'] = "" . __('Trash') . ""; if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS ) - $actions['delete'] = "ID) . "'>" . __('Delete Permanently') . ""; + $actions['delete'] = "post_type . '_' . $page->ID) . "'>" . __('Delete Permanently') . ""; } if ( in_array($post->post_status, array('pending', 'draft')) ) { - if ( current_user_can('edit_page', $page->ID) ) - $actions['view'] = '' . __('Preview') . ''; + if ( current_user_can($post_type_object->cap->edit_post, $page->ID) ) + $actions['view'] = '' . __('Preview') . ''; } elseif ( $post->post_status != 'trash' ) { $actions['view'] = '' . __('View') . ''; } @@ -1716,7 +1622,7 @@ foreach ($posts_columns as $column_name=>$column_display_name) { case 'author': ?> - >> $user_object->first_name $user_object->last_name$email$email$role_name"; echo '
    '; - printf(__('Submitted on %2$s at %3$s'), $comment_url, get_comment_date(__('Y/m/d')), get_comment_date(__('g:ia'))); + /* translators: 2: comment date, 3: comment time */ + printf( __( '%2$s at %3$s' ), $comment_url, + /* translators: comment date format. See http://php.net/date */ get_comment_date( __('Y/m/d') ), + /* translators: comment time format. See http://php.net/date */ get_comment_date( get_option( 'time_format' ) ) ); + + if ( $comment->comment_parent ) { + $parent = get_comment( $comment->comment_parent ); + $parent_link = esc_url( get_comment_link( $comment->comment_parent ) ); + $name = apply_filters( 'get_comment_author', $parent->comment_author ); // there's no API function for this + printf( ' | '.__( 'In reply to %2$s.' ), $parent_link, $name ); + } + echo '
    '; comment_text(); if ( $user_can ) { ?> @@ -2184,7 +2108,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) { $actions['spam'] = "" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . ''; } elseif ( 'spam' == $the_comment_status ) { - $actions['unspam'] = "" . __( 'Not Spam' ) . ''; + $actions['unspam'] = "" . _x( 'Not Spam', 'comment' ) . ''; } elseif ( 'trash' == $the_comment_status ) { $actions['untrash'] = "" . __( 'Restore' ) . ''; } @@ -2253,9 +2177,9 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, case 'response': if ( 'single' !== $mode ) { if ( isset( $_comment_pending_count[$post->ID] ) ) { - $pending_comments = absint( $_comment_pending_count[$post->ID] ); + $pending_comments = $_comment_pending_count[$post->ID]; } else { - $_comment_pending_count_temp = (array) get_pending_comments_num( array( $post->ID ) ); + $_comment_pending_count_temp = get_pending_comments_num( array( $post->ID ) ); $pending_comments = $_comment_pending_count[$post->ID] = $_comment_pending_count_temp[$post->ID]; } if ( $user_can ) { @@ -2349,7 +2273,7 @@ function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single', - +

    @@ -2362,7 +2286,7 @@ function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single', - +
    @@ -2389,39 +2313,6 @@ function wp_comment_trashnotice() { 0) ); - - if ( $categories ) { - foreach ( $categories as $category ) { - if ( $currentcat != $category->term_id && $parent == $category->parent) { - $pad = str_repeat( '– ', $level ); - $category->name = esc_html( $category->name ); - echo "\n\t"; - wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories ); - } - } - } else { - return false; - } -} - /** * {@internal Missing Short Description}} * @@ -2510,7 +2401,7 @@ function _list_meta_row( $entry, &$count ) { $r .= "\n\t\t
    "; - $r .= "\n\t\t
    "; + $r .= "\n\t\t
    "; $r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false ); $r .= ""; @@ -2531,12 +2422,12 @@ function meta_form() { FROM $wpdb->postmeta GROUP BY meta_key HAVING meta_key NOT LIKE '\_%' - ORDER BY LOWER(meta_key) + ORDER BY meta_key LIMIT $limit" ); if ( $keys ) natcasesort($keys); ?> -

    +

    @@ -2550,12 +2441,11 @@ function meta_form() {
    @@ -2572,7 +2462,7 @@ function meta_form() {
    - +
    @@ -2594,7 +2484,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { global $wp_locale, $post, $comment; if ( $for_post ) - $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) ) ? false : true; + $edit = ! ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) ); $tab_index_attribute = ''; if ( (int) $tab_index > 0 ) @@ -2602,7 +2492,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { // echo '
    '; - $time_adj = time() + (get_option( 'gmt_offset' ) * 3600 ); + $time_adj = current_time('timestamp'); $post_date = ($for_post) ? $post->post_date : $comment->comment_date; $jj = ($edit) ? mysql2date( 'd', $post_date, false ) : gmdate( 'd', $time_adj ); $mm = ($edit) ? mysql2date( 'm', $post_date, false ) : gmdate( 'm', $time_adj ); @@ -2709,18 +2599,6 @@ function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) { } } -/** - * {@internal Missing Short Description}} - * - * @since unknown - */ -function browse_happy() { - $getit = __( 'WordPress recommends a better browser' ); - echo ' -
    Browse Happy
    -'; -} - /** * {@internal Missing Short Description}} * @@ -2736,7 +2614,7 @@ function the_attachment_links( $id = false ) { if ( $post->post_type != 'attachment' ) return false; - $icon = get_attachment_icon( $post->ID ); + $icon = wp_get_attachment_image( $post->ID, 'thumbnail', true ); $attachment_data = wp_get_attachment_metadata( $id ); $thumb = isset( $attachment_data['thumb'] ); ?> @@ -2784,13 +2662,12 @@ function the_attachment_links( $id = false ) { * @param string $default slug for the role that should be already selected */ function wp_dropdown_roles( $selected = false ) { - global $wp_roles; $p = ''; $r = ''; $editable_roles = get_editable_roles(); - foreach( $editable_roles as $role => $details ) { + foreach ( $editable_roles as $role => $details ) { $name = translate_user_role($details['name'] ); if ( $selected == $role ) // Make default first in list $p = "\n\t"; @@ -2881,18 +2758,6 @@ function wp_import_upload_form( $action ) { endif; } -/** - * {@internal Missing Short Description}} - * - * @since unknown - */ -function wp_remember_old_slug() { - global $post; - $name = esc_attr($post->post_name); // just in case - if ( strlen($name) ) - echo ''; -} - /** * Add a meta box to an edit form. * @@ -2957,29 +2822,27 @@ function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $pri } /** - * {@internal Missing Short Description}} + * Meta-Box template function * - * @since unknown + * @since 2.5.0 * - * @param unknown_type $page - * @param unknown_type $context - * @param unknown_type $object + * @param string $page page identifier, also known as screen identifier + * @param string $context box context + * @param mixed $object gets passed to the box callback function as first parameter * @return int number of meta_boxes */ function do_meta_boxes($page, $context, $object) { global $wp_meta_boxes; static $already_sorted = false; - //do_action('do_meta_boxes', $page, $context, $object); - $hidden = get_hidden_meta_boxes($page); - echo "
    \n"; + printf('
    ', htmlspecialchars($context)); $i = 0; do { // Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose - if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page", 0, false ) ) { + if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) { foreach ( $sorted as $box_context => $ids ) foreach ( explode(',', $ids) as $id ) if ( $id ) @@ -2997,9 +2860,8 @@ function do_meta_boxes($page, $context, $object) { continue; $i++; $style = ''; - if ( in_array($box['id'], $hidden) ) - $style = 'style="display:none;"'; - echo '
    ' . "\n"; + $hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : ''; + echo '
    ' . "\n"; echo '

    '; echo "

    {$box['title']}

    \n"; echo '
    ' . "\n"; @@ -3045,19 +2907,22 @@ function remove_meta_box($id, $page, $context) { * * @since unknown * - * @param unknown_type $page + * @param unknown_type $screen */ -function meta_box_prefs($page) { +function meta_box_prefs($screen) { global $wp_meta_boxes; - if ( empty($wp_meta_boxes[$page]) ) + if ( is_string($screen) ) + $screen = convert_to_screen($screen); + + if ( empty($wp_meta_boxes[$screen->id]) ) return; - $hidden = get_hidden_meta_boxes($page); + $hidden = get_hidden_meta_boxes($screen); - foreach ( array_keys($wp_meta_boxes[$page]) as $context ) { - foreach ( array_keys($wp_meta_boxes[$page][$context]) as $priority ) { - foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) { + foreach ( array_keys($wp_meta_boxes[$screen->id]) as $context ) { + foreach ( array_keys($wp_meta_boxes[$screen->id][$context]) as $priority ) { + foreach ( $wp_meta_boxes[$screen->id][$context][$priority] as $box ) { if ( false == $box || ! $box['title'] ) continue; // Submit box cannot be hidden @@ -3072,13 +2937,23 @@ function meta_box_prefs($page) { } } -function get_hidden_meta_boxes($page) { - $hidden = (array) get_user_option( "meta-box-hidden_$page", 0, false ); +/** + * Get Hidden Meta Boxes + * + * @since 2.7 + * + * @param string|object $screen Screen identifier + * @return array Hidden Meta Boxes + */ +function get_hidden_meta_boxes( $screen ) { + if ( is_string( $screen ) ) + $screen = convert_to_screen( $screen ); + + $hidden = get_user_option( "metaboxhidden_{$screen->id}" ); // Hide slug boxes by default - if ( empty($hidden[0]) ) { + if ( !is_array( $hidden ) ) $hidden = array('slugdiv'); - } return $hidden; } @@ -3086,16 +2961,31 @@ function get_hidden_meta_boxes($page) { /** * Add a new section to a settings page. * + * Part of the Settings API. Use this to define new settings sections for an admin page. + * Show settings sections in your admin page callback function with do_settings_sections(). + * Add settings fields to your section with add_settings_field() + * + * The $callback argument should be the name of a function that echoes out any + * content you want to show at the top of the settings section before the actual + * fields. It can output nothing if you want. + * * @since 2.7.0 * - * @param string $id String for use in the 'id' attribute of tags. - * @param string $title Title of the section. - * @param string $callback Function that fills the section with the desired content. The function should echo its output. - * @param string $page The type of settings page on which to show the section (general, reading, writing, ...). + * @global $wp_settings_sections Storage array of all settings sections added to admin pages + * + * @param string $id Slug-name to identify the section. Used in the 'id' attribute of tags. + * @param string $title Formatted title of the section. Shown as the heading for the section. + * @param string $callback Function that echos out any content at the top of the section (between heading and fields). + * @param string $page The slug-name of the settings page on which to show the section. Built-in pages include 'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using add_options_page(); */ function add_settings_section($id, $title, $callback, $page) { global $wp_settings_sections; + if ( 'misc' == $page ) { + _deprecated_argument( __FUNCTION__, '3.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) ); + $page = 'general'; + } + if ( !isset($wp_settings_sections) ) $wp_settings_sections = array(); if ( !isset($wp_settings_sections[$page]) ) @@ -3107,20 +2997,35 @@ function add_settings_section($id, $title, $callback, $page) { } /** - * Add a new field to a settings page. + * Add a new field to a section of a settings page + * + * Part of the Settings API. Use this to define a settings field that will show + * as part of a settings section inside a settings page. The fields are shown using + * do_settings_fields() in do_settings-sections() + * + * The $callback argument should be the name of a function that echoes out the + * html input tags for this setting field. Use get_option() to retrive existing + * values to show. * * @since 2.7.0 * - * @param string $id String for use in the 'id' attribute of tags. - * @param string $title Title of the field. - * @param string $callback Function that fills the field with the desired content. The function should echo its output. - * @param string $page The type of settings page on which to show the field (general, reading, writing, ...). - * @param string $section The section of the settingss page in which to show the box (default, ...). + * @global $wp_settings_fields Storage array of settings fields and info about their pages/sections + * + * @param string $id Slug-name to identify the field. Used in the 'id' attribute of tags. + * @param string $title Formatted title of the field. Shown as the label for the field during output. + * @param string $callback Function that fills the field with the desired form inputs. The function should echo its output. + * @param string $page The slug-name of the settings page on which to show the section (general, reading, writing, ...). + * @param string $section The slug-name of the section of the settingss page in which to show the box (default, ...). * @param array $args Additional arguments */ function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) { global $wp_settings_fields; + if ( 'misc' == $page ) { + _deprecated_argument( __FUNCTION__, '3.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) ); + $page = 'general'; + } + if ( !isset($wp_settings_fields) ) $wp_settings_fields = array(); if ( !isset($wp_settings_fields[$page]) ) @@ -3132,11 +3037,17 @@ function add_settings_field($id, $title, $callback, $page, $section = 'default', } /** - * {@internal Missing Short Description}} + * Prints out all settings sections added to a particular settings page * + * Part of the Settings API. Use this in a settings page callback function + * to output all the sections and fields that were added to that $page with + * add_settings_section() and add_settings_field() + * + * @global $wp_settings_sections Storage array of all settings sections added to admin pages + * @global $wp_settings_fields Storage array of settings fields and info about their pages/sections * @since unknown * - * @param unknown_type $page + * @param string $page The slug name of the page whos settings sections you want to output */ function do_settings_sections($page) { global $wp_settings_sections, $wp_settings_fields; @@ -3156,12 +3067,18 @@ function do_settings_sections($page) { } /** - * {@internal Missing Short Description}} + * Print out the settings fields for a particular settings section + * + * Part of the Settings API. Use this in a settings page to output + * a specific section. Should normally be called by do_settings_sections() + * rather than directly. + * + * @global $wp_settings_fields Storage array of settings fields and their pages/sections * * @since unknown * - * @param unknown_type $page - * @param unknown_type $section + * @param string $page Slug title of the admin page who's settings fields you want to show. + * @param section $section Slug title of the settings section who's fields you want to show. */ function do_settings_fields($page, $section) { global $wp_settings_fields; @@ -3182,6 +3099,131 @@ function do_settings_fields($page, $section) { } } +/** + * Register a settings error to be displayed to the user + * + * Part of the Settings API. Use this to show messages to users about settings validation + * problems, missing settings or anything else. + * + * Settings errors should be added inside the $sanitize_callback function defined in + * register_setting() for a given setting to give feedback about the submission. + * + * By default messages will show immediately after the submission that generated the error. + * Additional calls to settings_errors() can be used to show errors even when the settings + * page is first accessed. + * + * @global array $wp_settings_errors Storage array of errors registered during this pageload + * + * @param string $setting Slug title of the setting to which this error applies + * @param string $code Slug-name to identify the error. Used as part of 'id' attribute in HTML output. + * @param string $message The formatted message text to display to the user (will be shown inside styled
    and

    ) + * @param string $type The type of message it is, controls HTML class. Use 'error' or 'updated'. + */ +function add_settings_error( $setting, $code, $message, $type = 'error' ) { + global $wp_settings_errors; + + if ( !isset($wp_settings_errors) ) + $wp_settings_errors = array(); + + $new_error = array( + 'setting' => $setting, + 'code' => $code, + 'message' => $message, + 'type' => $type + ); + $wp_settings_errors[] = $new_error; +} + +/** + * Fetch settings errors registered by add_settings_error() + * + * Checks the $wp_settings_errors array for any errors declared during the current + * pageload and returns them. + * + * If changes were just submitted ($_GET['updated']) and settings errors were saved + * to the 'settings_errors' transient then those errors will be returned instead. This + * is used to pass errors back across pageloads. + * + * Use the $sanitize argument to manually re-sanitize the option before returning errors. + * This is useful if you have errors or notices you want to show even when the user + * hasn't submitted data (i.e. when they first load an options page, or in admin_notices action hook) + * + * @global array $wp_settings_errors Storage array of errors registered during this pageload + * + * @param string $setting Optional slug title of a specific setting who's errors you want. + * @param boolean $sanitize Whether to re-sanitize the setting value before returning errors. + * @return array Array of settings errors + */ +function get_settings_errors( $setting = '', $sanitize = FALSE ) { + global $wp_settings_errors; + + // If $sanitize is true, manually re-run the sanitizisation for this option + // This allows the $sanitize_callback from register_setting() to run, adding + // any settings errors you want to show by default. + if ( $sanitize ) + sanitize_option( $setting, get_option($setting)); + + // If settings were passed back from options.php then use them + // Ignore transients if $sanitize is true, we dont' want the old values anyway + if ( isset($_GET['updated']) && $_GET['updated'] && get_transient('settings_errors') ) { + $settings_errors = get_transient('settings_errors'); + delete_transient('settings_errors'); + // Otherwise check global in case validation has been run on this pageload + } elseif ( count( $wp_settings_errors ) ) { + $settings_errors = $wp_settings_errors; + } else { + return; + } + + // Filter the results to those of a specific setting if one was set + if ( $setting ) { + foreach ( (array) $settings_errors as $key => $details ) + if ( $setting != $details['setting'] ) + unset( $settings_errors[$key] ); + } + return $settings_errors; +} + +/** + * Display settings errors registered by add_settings_error() + * + * Part of the Settings API. Outputs a

    for each error retrieved by get_settings_errors(). + * + * This is called automatically after a settings page based on the Settings API is submitted. + * Errors should be added during the validation callback function for a setting defined in register_setting() + * + * The $sanitize option is passed into get_settings_errors() and will re-run the setting sanitization + * on its current value. + * + * The $hide_on_update option will cause errors to only show when the settings page is first loaded. + * if the user has already saved new values it will be hidden to avoid repeating messages already + * shown in the default error reporting after submission. This is useful to show general errors like missing + * settings when the user arrives at the settings page. + * + * @param string $setting Optional slug title of a specific setting who's errors you want. + * @param boolean $sanitize Whether to re-sanitize the setting value before returning errors. + * @param boolean $hide_on_update If set to true errors will not be shown if the settings page has already been submitted. + * @return + */ +function settings_errors ( $setting = '', $sanitize = FALSE, $hide_on_update = FALSE ) { + + if ($hide_on_update AND $_GET['updated']) return; + + $settings_errors = get_settings_errors( $setting, $sanitize ); + + if ( !is_array($settings_errors) ) return; + + $output = ''; + foreach ( $settings_errors as $key => $details ) { + $css_id = 'setting-error-' . $details['code']; + $css_class = $details['type'] . ' settings-error'; + $output .= "
    \n"; + $output .= "

    {$details['message']}

    "; + $output .= "
    \n"; + } + echo $output; +} + /** * {@internal Missing Short Description}} * @@ -3189,20 +3231,20 @@ function do_settings_fields($page, $section) { * * @param unknown_type $page */ -function manage_columns_prefs($page) { - $columns = get_column_headers($page); - - $hidden = get_hidden_columns($page); +function manage_columns_prefs( $page ) { + $columns = get_column_headers( $page ); + $hidden = get_hidden_columns( $page ); + $special = array('_title', 'cb', 'comment', 'media', 'name', 'title', 'username'); foreach ( $columns as $column => $title ) { - // Can't hide these - if ( 'cb' == $column || 'title' == $column || 'name' == $column || 'username' == $column || 'media' == $column || 'comment' == $column ) + // Can't hide these or they are special + if ( in_array( $column, $special ) ) continue; - if ( empty($title) ) + if ( empty( $title ) ) continue; if ( 'comments' == $column ) - $title = __('Comments'); + $title = __( 'Comments' ); $id = "$column-hide"; echo '
    @@ -3268,55 +3316,62 @@ function the_post_password() { * @since unknown */ function favorite_actions( $screen = null ) { - switch ( $screen ) { - case 'post-new.php': - $default_action = array('edit.php' => array(__('Edit Posts'), 'edit_posts')); - break; - case 'edit-pages.php': - $default_action = array('page-new.php' => array(__('New Page'), 'edit_pages')); - break; - case 'page-new.php': - $default_action = array('edit-pages.php' => array(__('Edit Pages'), 'edit_pages')); - break; - case 'upload.php': - $default_action = array('media-new.php' => array(__('New Media'), 'upload_files')); - break; - case 'media-new.php': - $default_action = array('upload.php' => array(__('Edit Media'), 'upload_files')); - break; - case 'link-manager.php': - $default_action = array('link-add.php' => array(__('New Link'), 'manage_links')); - break; - case 'link-add.php': - $default_action = array('link-manager.php' => array(__('Edit Links'), 'manage_links')); - break; - case 'users.php': - $default_action = array('user-new.php' => array(__('New User'), 'create_users')); - break; - case 'user-new.php': - $default_action = array('users.php' => array(__('Edit Users'), 'edit_users')); - break; - case 'plugins.php': - $default_action = array('plugin-install.php' => array(__('Install Plugins'), 'install_plugins')); - break; - case 'plugin-install.php': - $default_action = array('plugins.php' => array(__('Manage Plugins'), 'activate_plugins')); - break; - case 'themes.php': - $default_action = array('theme-install.php' => array(__('Install Themes'), 'install_themes')); - break; - case 'theme-install.php': - $default_action = array('themes.php' => array(__('Manage Themes'), 'switch_themes')); - break; - default: - $default_action = array('post-new.php' => array(__('New Post'), 'edit_posts')); - break; + $default_action = false; + + if ( is_string($screen) ) + $screen = convert_to_screen($screen); + + if ( isset($screen->post_type) ) { + $post_type_object = get_post_type_object($screen->post_type); + if ( 'add' != $screen->action ) + $default_action = array('post-new.php?post_type=' . $post_type_object->name => array($post_type_object->labels->new_item, $post_type_object->cap->edit_posts)); + else + $default_action = array('edit.php?post_type=' . $post_type_object->name => array($post_type_object->labels->name, $post_type_object->cap->edit_posts)); + } + + if ( !$default_action ) { + switch ( $screen->id ) { + case 'upload': + $default_action = array('media-new.php' => array(__('New Media'), 'upload_files')); + break; + case 'media': + $default_action = array('upload.php' => array(__('Edit Media'), 'upload_files')); + break; + case 'link-manager': + case 'link': + if ( 'add' != $screen->action ) + $default_action = array('link-add.php' => array(__('New Link'), 'manage_links')); + else + $default_action = array('link-manager.php' => array(__('Edit Links'), 'manage_links')); + break; + case 'users': + $default_action = array('user-new.php' => array(__('New User'), 'create_users')); + break; + case 'user': + $default_action = array('users.php' => array(__('Edit Users'), 'edit_users')); + break; + case 'plugins': + $default_action = array('plugin-install.php' => array(__('Install Plugins'), 'install_plugins')); + break; + case 'plugin-install': + $default_action = array('plugins.php' => array(__('Manage Plugins'), 'activate_plugins')); + break; + case 'themes': + $default_action = array('theme-install.php' => array(__('Install Themes'), 'install_themes')); + break; + case 'theme-install': + $default_action = array('themes.php' => array(__('Manage Themes'), 'switch_themes')); + break; + default: + $default_action = array('post-new.php' => array(__('New Post'), 'edit_posts')); + break; + } } $actions = array( 'post-new.php' => array(__('New Post'), 'edit_posts'), 'edit.php?post_status=draft' => array(__('Drafts'), 'edit_posts'), - 'page-new.php' => array(__('New Page'), 'edit_pages'), + 'post-new.php?post_type=page' => array(__('New Page'), 'edit_pages'), 'media-new.php' => array(__('Upload'), 'upload_files'), 'edit-comments.php' => array(__('Comments'), 'moderate_comments') ); @@ -3363,8 +3418,7 @@ function favorite_actions( $screen = null ) { * @param int $id The post id. If not supplied the global $post is used. * */ -function _draft_or_post_title($post_id = 0) -{ +function _draft_or_post_title($post_id = 0) { $title = get_the_title($post_id); if ( empty($title) ) $title = __('(no title)'); @@ -3394,6 +3448,7 @@ function _admin_search_query() { * */ function iframe_header( $title = '', $limit_styles = false ) { +global $hook_suffix; ?> > @@ -3415,9 +3470,20 @@ function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_r do_action('admin_print_styles'); do_action('admin_print_scripts'); do_action('admin_head'); + +$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); ?> -> + class="no-js "> + $screen, 'base' => $screen); + return $screen; +} + function screen_meta($screen) { - global $wp_meta_boxes, $_wp_contextual_help; + global $wp_meta_boxes, $_wp_contextual_help, $title; - $screen = str_replace('.php', '', $screen); - $screen = str_replace('-new', '', $screen); - $screen = str_replace('-add', '', $screen); - $screen = apply_filters('screen_meta_screen', $screen); + if ( is_string($screen) ) + $screen = convert_to_screen($screen); $column_screens = get_column_headers($screen); $meta_screens = array('index' => 'dashboard'); - if ( isset($meta_screens[$screen]) ) - $screen = $meta_screens[$screen]; + if ( isset($meta_screens[$screen->id]) ) { + $screen->id = $meta_screens[$screen->id]; + $screen->base = $screen->id; + } + $show_screen = false; - $show_on_screen = false; - if ( !empty($wp_meta_boxes[$screen]) || !empty($column_screens) ) { + if ( !empty($wp_meta_boxes[$screen->id]) || !empty($column_screens) ) $show_screen = true; - $show_on_screen = true; - } $screen_options = screen_options($screen); if ( $screen_options ) @@ -3500,109 +3579,68 @@ function screen_meta($screen) { if ( !isset($_wp_contextual_help) ) $_wp_contextual_help = array(); - $settings = ''; + $settings = apply_filters('screen_settings', '', $screen); - switch ( $screen ) { - case 'post': - if ( !isset($_wp_contextual_help['post']) ) { - $help = drag_drop_help(); - $help .= '

    ' . __('Writing Posts') . '

    '; - $_wp_contextual_help['post'] = $help; - } - break; - case 'page': - if ( !isset($_wp_contextual_help['page']) ) { - $help = drag_drop_help(); - $_wp_contextual_help['page'] = $help; - } - break; - case 'dashboard': - if ( !isset($_wp_contextual_help['dashboard']) ) { - $help = '

    ' . __('The modules on this screen can be arranged in several columns. You can select the number of columns from the Screen Options tab.') . "

    \n"; - $help .= drag_drop_help(); - $_wp_contextual_help['dashboard'] = $help; - } - break; - case 'link': - if ( !isset($_wp_contextual_help['link']) ) { - $help = drag_drop_help(); - $_wp_contextual_help['link'] = $help; - } - break; - case 'options-general': - if ( !isset($_wp_contextual_help['options-general']) ) - $_wp_contextual_help['options-general'] = __('General Settings'); - break; - case 'theme-install': - case 'plugin-install': - if ( ( !isset($_GET['tab']) || 'dashboard' == $_GET['tab'] ) && !isset($_wp_contextual_help[$screen]) ) { - $help = plugins_search_help(); - $_wp_contextual_help[$screen] = $help; - } - break; + switch ( $screen->id ) { case 'widgets': - if ( !isset($_wp_contextual_help['widgets']) ) { - $help = widgets_help(); - $_wp_contextual_help['widgets'] = $help; - } $settings = '

    ' . __('Enable accessibility mode') . '' . __('Disable accessibility mode') . "

    \n"; $show_screen = true; break; } + if( ! empty( $settings ) ) + $show_screen = true; ?>
    - + - @@ -3631,10 +3669,13 @@ function screen_meta($screen) { function add_contextual_help($screen, $help) { global $_wp_contextual_help; + if ( is_string($screen) ) + $screen = convert_to_screen($screen); + if ( !isset($_wp_contextual_help) ) $_wp_contextual_help = array(); - $_wp_contextual_help[$screen] = $help; + $_wp_contextual_help[$screen->id] = $help; } function drag_drop_help() { @@ -3654,28 +3695,27 @@ function plugins_search_help() { '; } -function widgets_help() { - return ' -

    ' . __('Widgets are added and arranged by simple drag ’n’ drop. If you hover your mouse over the titlebar of a widget, you’ll see a 4-arrow cursor which indicates that the widget is movable. Click on the titlebar, hold down the mouse button and drag the widget to a sidebar. As you drag, you’ll see a dotted box that also moves. This box shows where the widget will go once you drop it.') . '

    -

    ' . __('To remove a widget from a sidebar, drag it back to Available Widgets or click on the arrow on its titlebar to reveal its settings, and then click Remove.') . '

    -

    ' . __('To remove a widget from a sidebar and keep its configuration, drag it to Inactive Widgets.') . '

    -

    ' . __('The Inactive Widgets area stores widgets that are configured but not curently used. If you change themes and the new theme has fewer sidebars than the old, all extra widgets will be stored to Inactive Widgets automatically.') . '

    -'; -} - function screen_layout($screen) { global $screen_layout_columns; - $columns = array('dashboard' => 4, 'post' => 2, 'page' => 2, 'link' => 2); - $columns = apply_filters('screen_layout_columns', $columns, $screen); + if ( is_string($screen) ) + $screen = convert_to_screen($screen); + + $columns = array('dashboard' => 4, 'link' => 2); + + // Add custom post types + foreach ( get_post_types( array('show_ui' => true) ) as $post_type ) + $columns[$post_type] = 2; - if ( !isset($columns[$screen]) ) { + $columns = apply_filters('screen_layout_columns', $columns, $screen->id, $screen); + + if ( !isset($columns[$screen->id]) ) { $screen_layout_columns = 0; return ''; } - $screen_layout_columns = get_user_option("screen_layout_$screen"); - $num = $columns[$screen]; + $screen_layout_columns = get_user_option("screen_layout_$screen->id"); + $num = $columns[$screen->id]; if ( ! $screen_layout_columns ) $screen_layout_columns = 2; @@ -3691,66 +3731,91 @@ function screen_layout($screen) { } function screen_options($screen) { - switch ( $screen ) { + if ( is_string($screen) ) + $screen = convert_to_screen($screen); + + switch ( $screen->base ) { case 'edit': - $per_page_label = __('Posts per page:'); - break; case 'edit-pages': - $per_page_label = __('Pages per page:'); + $post_type = 'post'; + if ( isset($_GET['post_type']) && in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) ) + $post_type = $_GET['post_type']; + $post_type_object = get_post_type_object($post_type); + $per_page_label = $post_type_object->labels->name; + break; + case 'ms-sites': + $per_page_label = _x( 'Sites', 'sites per page (screen options)' ); + break; + case 'ms-users': + $per_page_label = _x( 'Users', 'users per page (screen options)' ); break; case 'edit-comments': - $per_page_label = __('Comments per page:'); + $per_page_label = _x( 'Comments', 'comments per page (screen options)' ); break; case 'upload': - $per_page_label = __('Media items per page:'); - break; - case 'categories': - $per_page_label = __('Categories per page:'); + $per_page_label = _x( 'Media items', 'items per page (screen options)' ); break; case 'edit-tags': - $per_page_label = __('Tags per page:'); + global $tax; + $per_page_label = $tax->labels->name; break; case 'plugins': - $per_page_label = __('Plugins per page:'); + $per_page_label = _x( 'Plugins', 'plugins per page (screen options)' ); break; default: return ''; } - $option = str_replace( '-', '_', "${screen}_per_page" ); - $per_page = (int) get_user_option( $option, 0, false ); + $option = str_replace( '-', '_', "{$screen->id}_per_page" ); + if ( 'edit_tags_per_page' == $option ) { + if ( 'category' == $tax->name ) + $option = 'categories_per_page'; + elseif ( 'post_tag' != $tax->name ) + $option = 'edit_' . $tax->name . '_per_page'; + } + + $per_page = (int) get_user_option( $option ); if ( empty( $per_page ) || $per_page < 1 ) { - if ( 'plugins' == $screen ) + if ( 'plugins' == $screen->id ) $per_page = 999; else $per_page = 20; } + if ( 'edit_comments_per_page' == $option ) $per_page = apply_filters( 'comments_per_page', $per_page, isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all' ); - elseif ( 'categories' == $option ) + elseif ( 'categories_per_page' == $option ) $per_page = apply_filters( 'edit_categories_per_page', $per_page ); else $per_page = apply_filters( $option, $per_page ); - $return = '
    ' . __('Options') . "
    \n"; - $return .= "
    \n"; + $return = "
    \n"; if ( !empty($per_page_label) ) - $return .= " \n"; + $return .= " \n"; $return .= ""; $return .= ""; $return .= "
    \n"; return $return; } -function screen_icon($name = '') { - global $parent_file, $hook_suffix; +function screen_icon($screen = '') { + global $current_screen; + + if ( empty($screen) ) + $screen = $current_screen; + elseif ( is_string($screen) ) + $name = $screen; if ( empty($name) ) { - if ( isset($parent_file) && !empty($parent_file) ) - $name = substr($parent_file, 0, -4); + if ( !empty($screen->parent_base) ) + $name = $screen->parent_base; else - $name = str_replace(array('.php', '-new', '-add'), '', $hook_suffix); + $name = $screen->base; + + if ( 'edit' == $name && isset($screen->post_type) && 'page' == $screen->post_type ) + $name = 'edit-pages'; } + ?>

    $current_screen, 'base' => $current_screen); + } else { + $id = sanitize_key($id); + if ( false !== strpos($id, '-') ) { + list( $id, $typenow ) = explode('-', $id, 2); + if ( taxonomy_exists( $typenow ) ) { + $id = 'edit-tags'; + $taxnow = $typenow; + $typenow = ''; + } + } + $current_screen = array('id' => $id, 'base' => $id); + } + + $current_screen = (object) $current_screen; + + $current_screen->action = $action; + + // Map index to dashboard + if ( 'index' == $current_screen->base ) + $current_screen->base = 'dashboard'; + if ( 'index' == $current_screen->id ) + $current_screen->id = 'dashboard'; + + if ( 'edit' == $current_screen->id ) { + if ( empty($typenow) ) + $typenow = 'post'; + $current_screen->id .= '-' . $typenow; + $current_screen->post_type = $typenow; + } elseif ( 'post' == $current_screen->id ) { + if ( empty($typenow) ) + $typenow = 'post'; + $current_screen->id = $typenow; + $current_screen->post_type = $typenow; + } elseif ( 'edit-tags' == $current_screen->id ) { + if ( empty($taxnow) ) + $taxnow = 'post_tag'; + $current_screen->id = 'edit-' . $taxnow; + $current_screen->taxonomy = $taxnow; + } + + $current_screen = apply_filters('current_screen', $current_screen); +} + ?> diff --git a/wp-admin/includes/theme-install.php b/wp-admin/includes/theme-install.php index d704d67d..ea96ef8b 100644 --- a/wp-admin/includes/theme-install.php +++ b/wp-admin/includes/theme-install.php @@ -156,7 +156,7 @@ function install_theme_search_form() { @@ -301,7 +301,7 @@ function display_theme($theme, $actions = null, $show_details = true) { if ( !is_array($actions) ) { $actions = array(); $actions[] = '' . __('Install') . ''; + '&TB_iframe=true&tbWidth=500&tbHeight=385') . '" class="thickbox thickbox-preview onclick" title="' . esc_attr(sprintf(__('Install “%s”'), $name)) . '">' . __('Install') . ''; $actions[] = '' . __('Preview') . ''; $actions = apply_filters('theme_install_action_links', $actions, $theme); } @@ -366,8 +366,6 @@ function display_theme($theme, $actions = null, $show_details = true) { * @param int $totalpages Number of pages. */ function display_themes($themes, $page = 1, $totalpages = 1) { - global $themes_allowedtags; - $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : ''; $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : ''; ?> @@ -457,8 +455,11 @@ function install_theme_information() { // Sanitize HTML foreach ( (array)$api->sections as $section_name => $content ) $api->sections[$section_name] = wp_kses($content, $themes_allowedtags); - foreach ( array('version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug') as $key ) - $api->$key = wp_kses($api->$key, $themes_allowedtags); + + foreach ( array('version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug') as $key ) { + if ( isset($api->$key) ) + $api->$key = wp_kses($api->$key, $themes_allowedtags); + } iframe_header( __('Theme Install') ); @@ -476,7 +477,7 @@ function install_theme_information() { // Default to a "new" theme $type = 'install'; // Check to see if this theme is known to be installed, and has an update awaiting it. - $update_themes = get_transient('update_themes'); + $update_themes = get_site_transient('update_themes'); if ( is_object($update_themes) && isset($update_themes->response) ) { foreach ( (array)$update_themes->response as $theme_slug => $theme_info ) { if ( $theme_slug === $api->slug ) { diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index b39351fc..44a1f629 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -16,6 +16,10 @@ function current_theme_info() { $themes = get_themes(); $current_theme = get_current_theme(); + if ( ! isset( $themes[$current_theme] ) ) { + delete_option( 'current_theme' ); + $current_theme = get_current_theme(); + } $ct->name = $current_theme; $ct->title = $themes[$current_theme]['Title']; $ct->version = $themes[$current_theme]['Version']; @@ -65,7 +69,7 @@ function delete_theme($template) { request_filesystem_credentials($url, '', true); // Failed to connect, Error and request again $data = ob_get_contents(); ob_end_clean(); - if( ! empty($data) ){ + if ( ! empty($data) ) { include_once( ABSPATH . 'wp-admin/admin-header.php'); echo $data; include( ABSPATH . 'wp-admin/admin-footer.php'); @@ -79,7 +83,7 @@ function delete_theme($template) { return new WP_Error('fs_unavailable', __('Could not access filesystem.')); if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() ) - return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors); + return new WP_Error('fs_error', __('Filesystem error.'), $wp_filesystem->errors); //Get the base plugin folder $themes_dir = $wp_filesystem->wp_themes_dir(); @@ -87,17 +91,14 @@ function delete_theme($template) { return new WP_Error('fs_no_themes_dir', __('Unable to locate WordPress theme directory.')); $themes_dir = trailingslashit( $themes_dir ); - - $errors = array(); - $theme_dir = trailingslashit($themes_dir . $template); $deleted = $wp_filesystem->delete($theme_dir, true); if ( ! $deleted ) - return new WP_Error('could_not_remove_theme', sprintf(__('Could not fully remove the theme %s'), $template) ); + return new WP_Error('could_not_remove_theme', sprintf(__('Could not fully remove the theme %s.'), $template) ); // Force refresh of theme update information - delete_transient('update_themes'); + delete_site_transient('update_themes'); return true; } @@ -116,6 +117,45 @@ function get_broken_themes() { return $wp_broken_themes; } +/** + * Get the allowed themes for the current blog. + * + * @since 3.0.0 + * + * @uses get_themes() + * @uses current_theme_info() + * @uses get_site_allowed_themes() + * @uses wpmu_get_blog_allowedthemes + * + * @return array $themes Array of allowed themes. + */ +function get_allowed_themes() { + if ( !is_multisite() ) + return get_themes(); + + $themes = get_themes(); + $ct = current_theme_info(); + $allowed_themes = apply_filters("allowed_themes", get_site_allowed_themes() ); + if ( $allowed_themes == false ) + $allowed_themes = array(); + + $blog_allowed_themes = wpmu_get_blog_allowedthemes(); + if ( is_array( $blog_allowed_themes ) ) + $allowed_themes = array_merge( $allowed_themes, $blog_allowed_themes ); + + if ( isset( $allowed_themes[ esc_html( $ct->stylesheet ) ] ) == false ) + $allowed_themes[ esc_html( $ct->stylesheet ) ] = true; + + reset( $themes ); + foreach ( $themes as $key => $theme ) { + if ( isset( $allowed_themes[ esc_html( $theme[ 'Stylesheet' ] ) ] ) == false ) + unset( $themes[ $key ] ); + } + reset( $themes ); + + return $themes; +} + /** * Get the Page Templates available in this theme * @@ -156,10 +196,10 @@ function get_page_templates() { /** * Tidies a filename for url display by the theme editor. - * + * * @since 2.9.0 - * @private - * + * @access private + * * @param string $fullpath Full path to the theme file * @param string $containingfolder Path of the theme parent folder * @return string @@ -168,4 +208,46 @@ function _get_template_edit_filename($fullpath, $containingfolder) { return str_replace(dirname(dirname( $containingfolder )) , '', $fullpath); } +/** + * Check if there is an update for a theme available. + * + * Will display link, if there is an update available. + * + * @since 2.7.0 + * + * @param object $theme Theme data object. + * @return bool False if no valid info was passed. + */ +function theme_update_available( $theme ) { + static $themes_update; + + if ( !current_user_can('update_themes' ) ) + return; + + if ( !isset($themes_update) ) + $themes_update = get_site_transient('update_themes'); + + if ( is_object($theme) && isset($theme->stylesheet) ) + $stylesheet = $theme->stylesheet; + elseif ( is_array($theme) && isset($theme['Stylesheet']) ) + $stylesheet = $theme['Stylesheet']; + else + return false; //No valid info passed. + + if ( isset($themes_update->response[ $stylesheet ]) ) { + $update = $themes_update->response[ $stylesheet ]; + $theme_name = is_object($theme) ? $theme->name : (is_array($theme) ? $theme['Name'] : ''); + $details_url = add_query_arg(array('TB_iframe' => 'true', 'width' => 1024, 'height' => 800), $update['url']); //Theme browser inside WP? replace this, Also, theme preview JS will override this on the available list. + $update_url = wp_nonce_url('update.php?action=upgrade-theme&theme=' . urlencode($stylesheet), 'upgrade-theme_' . $stylesheet); + $update_onclick = 'onclick="if ( confirm(\'' . esc_js( __("Upgrading this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to upgrade.") ) . '\') ) {return true;}return false;"'; + + if ( ! current_user_can('update_themes') ) + printf( '

    ' . __('There is a new version of %1$s available. View version %3$s Details.') . '

    ', $theme_name, $details_url, $update['new_version']); + else if ( empty($update['package']) ) + printf( '

    ' . __('There is a new version of %1$s available. View version %3$s Details automatic upgrade unavailable for this theme.') . '

    ', $theme_name, $details_url, $update['new_version']); + else + printf( '

    ' . __('There is a new version of %1$s available. View version %3$s Details or upgrade automatically.') . '

    ', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick ); + } +} + ?> diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index d179e1eb..d9698a7e 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -171,7 +171,58 @@ $_old_files = array( 'wp-images/wpminilogo.png', 'wp.php', 'wp-includes/gettext.php', -'wp-includes/streams.php' +'wp-includes/streams.php', +// MU +'wp-admin/wpmu-admin.php', +'wp-admin/wpmu-blogs.php', +'wp-admin/wpmu-edit.php', +'wp-admin/wpmu-options.php', +'wp-admin/wpmu-themes.php', +'wp-admin/wpmu-upgrade-site.php', +'wp-admin/wpmu-users.php', +'wp-includes/wpmu-default-filters.php', +'wp-includes/wpmu-functions.php', +'wpmu-settings.php', +'index-install.php', +'README.txt', +'htaccess.dist', +'wp-admin/css/mu-rtl.css', +'wp-admin/css/mu.css', +'wp-admin/images/site-admin.png', +'wp-admin/includes/mu.php', +'wp-includes/images/wordpress-mu.png', +// 3.0 +'wp-admin/categories.php', +'wp-admin/edit-category-form.php', +'wp-admin/edit-page-form.php', +'wp-admin/edit-pages.php', +'wp-admin/images/wp-logo.gif', +'wp-admin/js/wp-gears.dev.js', +'wp-admin/js/wp-gears.js', +'wp-admin/options-misc.php', +'wp-admin/page-new.php', +'wp-admin/page.php', +'wp-admin/rtl.css', +'wp-admin/rtl.dev.css', +'wp-admin/update-links.php', +'wp-admin/wp-admin.css', +'wp-admin/wp-admin.dev.css', +'wp-includes/js/codepress', +'wp-includes/js/jquery/autocomplete.dev.js', +'wp-includes/js/jquery/interface.js', +'wp-includes/js/jquery/autocomplete.js', +'wp-includes/js/scriptaculous/prototype.js', +'wp-includes/js/tinymce/wp-tinymce.js', +'wp-content/themes/twentyten/searchform.php', +'wp-admin/import', +'wp-admin/images/ico-edit.png', +'wp-admin/images/fav-top.png', +'wp-admin/images/ico-close.png', +'wp-admin/images/admin-header-footer.png', +'wp-admin/images/screen-options-left.gif', +'wp-admin/images/ico-add.png', +'wp-admin/images/browse-happy.gif', +'wp-admin/images/ico-viewpage.png', ); /** @@ -223,7 +274,7 @@ function update_core($from, $to) { $mysql_version = $wpdb->db_version(); $required_php_version = '4.3'; $required_mysql_version = '4.1.2'; - $wp_version = '2.9.2'; + $wp_version = '3.0'; $php_compat = version_compare( $php_version, $required_php_version, '>=' ); $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); @@ -238,14 +289,22 @@ function update_core($from, $to) { return new WP_Error( 'mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ) ); // Sanity check the unzipped distribution - apply_filters('update_feedback', __('Verifying the unpacked files')); - if ( !$wp_filesystem->exists($from . '/wordpress/wp-settings.php') || !$wp_filesystem->exists($from . '/wordpress/wp-admin/admin.php') || - !$wp_filesystem->exists($from . '/wordpress/wp-includes/functions.php') ) { + apply_filters('update_feedback', __('Verifying the unpacked files…')); + $distro = ''; + $roots = array( '/wordpress', '/wordpress-mu' ); + foreach( $roots as $root ) { + if ( $wp_filesystem->exists($from . $root . '/wp-settings.php') && $wp_filesystem->exists($from . $root . '/wp-admin/admin.php') && + $wp_filesystem->exists($from . $root . '/wp-includes/functions.php') ) { + $distro = $root; + break; + } + } + if ( !$distro ) { $wp_filesystem->delete($from, true); return new WP_Error('insane_distro', __('The update could not be unpacked') ); } - apply_filters('update_feedback', __('Installing the latest version')); + apply_filters('update_feedback', __('Installing the latest version…')); // Create maintenance file to signal that we are upgrading $maintenance_string = ''; @@ -254,7 +313,7 @@ function update_core($from, $to) { $wp_filesystem->put_contents($maintenance_file, $maintenance_string, FS_CHMOD_FILE); // Copy new versions of WP files into place. - $result = copy_dir($from . '/wordpress', $to); + $result = copy_dir($from . $distro, $to); if ( is_wp_error($result) ) { $wp_filesystem->delete($maintenance_file); $wp_filesystem->delete($from, true); @@ -270,7 +329,7 @@ function update_core($from, $to) { } // Upgrade DB with separate request - apply_filters('update_feedback', __('Upgrading database')); + apply_filters('update_feedback', __('Upgrading database…')); $db_upgrade_url = admin_url('upgrade.php?step=upgrade_db'); wp_remote_post($db_upgrade_url, array('timeout' => 60)); @@ -278,8 +337,8 @@ function update_core($from, $to) { $wp_filesystem->delete($from, true); // Force refresh of update information - if ( function_exists('delete_transient') ) - delete_transient('update_core'); + if ( function_exists('delete_site_transient') ) + delete_site_transient('update_core'); else delete_option('update_core'); diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index 0d0e6604..52e9ee1a 100644 --- a/wp-admin/includes/update.php +++ b/wp-admin/includes/update.php @@ -31,9 +31,9 @@ function get_preferred_from_update_core() { */ function get_core_updates( $options = array() ) { $options = array_merge( array('available' => true, 'dismissed' => false ), $options ); - $dismissed = get_option( 'dismissed_update_core' ); + $dismissed = get_site_option( 'dismissed_update_core' ); if ( !is_array( $dismissed ) ) $dismissed = array(); - $from_api = get_transient( 'update_core' ); + $from_api = get_site_transient( 'update_core' ); if ( empty($from_api) ) return false; if ( !isset( $from_api->updates ) || !is_array( $from_api->updates ) ) return false; @@ -57,21 +57,21 @@ function get_core_updates( $options = array() ) { } function dismiss_core_update( $update ) { - $dismissed = get_option( 'dismissed_update_core' ); + $dismissed = get_site_option( 'dismissed_update_core' ); $dismissed[ $update->current.'|'.$update->locale ] = true; - return update_option( 'dismissed_update_core', $dismissed ); + return update_site_option( 'dismissed_update_core', $dismissed ); } function undismiss_core_update( $version, $locale ) { - $dismissed = get_option( 'dismissed_update_core' ); + $dismissed = get_site_option( 'dismissed_update_core' ); $key = $version.'|'.$locale; if ( !isset( $dismissed[$key] ) ) return false; unset( $dismissed[$key] ); - return update_option( 'dismissed_update_core', $dismissed ); + return update_site_option( 'dismissed_update_core', $dismissed ); } function find_core_update( $version, $locale ) { - $from_api = get_transient( 'update_core' ); + $from_api = get_site_transient( 'update_core' ); if ( !is_array( $from_api->updates ) ) return false; $updates = $from_api->updates; foreach($updates as $update) { @@ -82,7 +82,10 @@ function find_core_update( $version, $locale ) { } function core_update_footer( $msg = '' ) { - if ( !current_user_can('manage_options') ) + if ( is_multisite() && !current_user_can('update_core') ) + return false; + + if ( !current_user_can('update_core') ) return sprintf( __( 'Version %s' ), $GLOBALS['wp_version'] ); $cur = get_preferred_from_update_core(); @@ -101,10 +104,8 @@ function core_update_footer( $msg = '' ) { break; case 'upgrade' : - if ( current_user_can('manage_options') ) { - return sprintf( ''.__( 'Get Version %2$s' ).'', 'update-core.php', $cur->current); - break; - } + return sprintf( ''.__( 'Get Version %2$s' ).'', 'update-core.php', $cur->current); + break; case 'latest' : default : @@ -115,6 +116,9 @@ function core_update_footer( $msg = '' ) { add_filter( 'update_footer', 'core_update_footer' ); function update_nag() { + if ( is_multisite() && !current_user_can('update_core') ) + return false; + global $pagenow; if ( 'update-core.php' == $pagenow ) @@ -125,21 +129,24 @@ function update_nag() { if ( ! isset( $cur->response ) || $cur->response != 'upgrade' ) return false; - if ( current_user_can('manage_options') ) - $msg = sprintf( __('WordPress %1$s is available! Please update now.'), $cur->current, 'update-core.php' ); + if ( current_user_can('update_core') ) + $msg = sprintf( __('WordPress %1$s is available! Please update now.'), $cur->current, 'update-core.php' ); else - $msg = sprintf( __('WordPress %1$s is available! Please notify the site administrator.'), $cur->current ); + $msg = sprintf( __('WordPress %1$s is available! Please notify the site administrator.'), $cur->current ); - echo "
    $msg
    "; + echo "
    $msg
    "; } add_action( 'admin_notices', 'update_nag', 3 ); // Called directly from dashboard function update_right_now_message() { + if ( is_multisite() && !current_user_can('update_core') ) + return false; + $cur = get_preferred_from_update_core(); $msg = sprintf( __('You are using WordPress %s.'), $GLOBALS['wp_version'] ); - if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('manage_options') ) + if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('update_core') ) $msg .= " " . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . ''; echo "$msg"; @@ -148,7 +155,7 @@ function update_right_now_message() { function get_plugin_updates() { $all_plugins = get_plugins(); $upgrade_plugins = array(); - $current = get_transient( 'update_plugins' ); + $current = get_site_transient( 'update_plugins' ); foreach ( (array)$all_plugins as $plugin_file => $plugin_data) { if ( isset( $current->response[ $plugin_file ] ) ) { $upgrade_plugins[ $plugin_file ] = (object) $plugin_data; @@ -160,7 +167,10 @@ function get_plugin_updates() { } function wp_plugin_update_rows() { - $plugins = get_transient( 'update_plugins' ); + if ( !current_user_can('update_plugins' ) ) + return; + + $plugins = get_site_transient( 'update_plugins' ); if ( isset($plugins->response) && is_array($plugins->response) ) { $plugins = array_keys( $plugins->response ); foreach( $plugins as $plugin_file ) { @@ -171,7 +181,7 @@ function wp_plugin_update_rows() { add_action( 'admin_init', 'wp_plugin_update_rows' ); function wp_plugin_update_row( $file, $plugin_data ) { - $current = get_transient( 'update_plugins' ); + $current = get_site_transient( 'update_plugins' ); if ( !isset( $current->response[ $file ] ) ) return false; @@ -196,7 +206,6 @@ function wp_plugin_update_row( $file, $plugin_data ) { } function wp_update_plugin($plugin, $feedback = '') { - if ( !empty($feedback) ) add_filter('update_feedback', $feedback); @@ -207,7 +216,7 @@ function wp_update_plugin($plugin, $feedback = '') { function get_theme_updates() { $themes = get_themes(); - $current = get_transient('update_themes'); + $current = get_site_transient('update_themes'); $update_themes = array(); foreach ( $themes as $theme ) { @@ -222,7 +231,6 @@ function get_theme_updates() { } function wp_update_theme($theme, $feedback = '') { - if ( !empty($feedback) ) add_filter('update_feedback', $feedback); @@ -233,7 +241,6 @@ function wp_update_theme($theme, $feedback = '') { function wp_update_core($current, $feedback = '') { - if ( !empty($feedback) ) add_filter('update_feedback', $feedback); @@ -248,12 +255,12 @@ function maintenance_nag() { if ( ! isset( $upgrading ) ) return false; - if ( current_user_can('manage_options') ) + if ( current_user_can('update_core') ) $msg = sprintf( __('An automated WordPress update has failed to complete - please attempt the update again now.'), 'update-core.php' ); else $msg = __('An automated WordPress update has failed to complete! Please notify the site administrator.'); - echo "
    $msg
    "; + echo "
    $msg
    "; } add_action( 'admin_notices', 'maintenance_nag' ); diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index e70b9d96..1560f2c8 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -31,11 +31,15 @@ if ( !function_exists('wp_install') ) : * @param string $user_email User's email. * @param bool $public Whether blog is public. * @param null $deprecated Optional. Not used. + * @param string $user_password Optional. User's chosen password. Will default to a random password. * @return array Array keys 'url', 'user_id', 'password', 'password_message'. */ -function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='') { +function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '' ) { global $wp_rewrite; + if ( !empty( $deprecated ) ) + _deprecated_argument( __FUNCTION__, '2.6' ); + wp_check_mysql_version(); wp_cache_flush(); make_db_current_silent(); @@ -57,14 +61,20 @@ function wp_install($blog_title, $user_name, $user_email, $public, $deprecated=' // Create default user. If the user already exists, the user tables are // being shared among blogs. Just set the role in that case. $user_id = username_exists($user_name); - if ( !$user_id ) { - $random_password = wp_generate_password(); + $user_password = trim($user_password); + $email_password = false; + if ( !$user_id && empty($user_password) ) { + $user_password = wp_generate_password(); $message = __('Note that password carefully! It is a random password that was generated just for you.'); - $user_id = wp_create_user($user_name, $random_password, $user_email); - update_usermeta($user_id, 'default_password_nag', true); + $user_id = wp_create_user($user_name, $user_password, $user_email); + update_user_option($user_id, 'default_password_nag', true, true); + $email_password = true; + } else if ( !$user_id ) { + // Password has been provided + $message = ''.__('Your chosen password.').''; + $user_id = wp_create_user($user_name, $user_password, $user_email); } else { - $random_password = ''; - $message = __('User already exists. Password inherited.'); + $message = __('User already exists. Password inherited.'); } $user = new WP_User($user_id); @@ -74,11 +84,11 @@ function wp_install($blog_title, $user_name, $user_email, $public, $deprecated=' $wp_rewrite->flush_rules(); - wp_new_blog_notification($blog_title, $guessurl, $user_id, $random_password); + wp_new_blog_notification($blog_title, $guessurl, $user_id, ($email_password ? $user_password : __('The password you chose during the install.') ) ); wp_cache_flush(); - return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $random_password, 'password_message' => $message); + return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message); } endif; @@ -93,23 +103,47 @@ if ( !function_exists('wp_install_defaults') ) : * @param int $user_id User ID. */ function wp_install_defaults($user_id) { - global $wpdb; + global $wpdb, $wp_rewrite, $current_site, $table_prefix; // Default category $cat_name = __('Uncategorized'); /* translators: Default category slug */ $cat_slug = sanitize_title(_x('Uncategorized', 'Default category slug')); - $wpdb->insert( $wpdb->terms, array('name' => $cat_name, 'slug' => $cat_slug, 'term_group' => 0) ); - $wpdb->insert( $wpdb->term_taxonomy, array('term_id' => '1', 'taxonomy' => 'category', 'description' => '', 'parent' => 0, 'count' => 1)); + if ( global_terms_enabled() ) { + $cat_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) ); + if ( $cat_id == null ) { + $wpdb->insert( $wpdb->sitecategories, array('cat_ID' => 0, 'cat_name' => $cat_name, 'category_nicename' => $cat_slug, 'last_updated' => current_time('mysql', true)) ); + $cat_id = $wpdb->insert_id; + } + update_option('default_category', $cat_id); + } else { + $cat_id = 1; + } + + $wpdb->insert( $wpdb->terms, array('term_id' => $cat_id, 'name' => $cat_name, 'slug' => $cat_slug, 'term_group' => 0) ); + $wpdb->insert( $wpdb->term_taxonomy, array('term_id' => $cat_id, 'taxonomy' => 'category', 'description' => '', 'parent' => 0, 'count' => 1)); + $cat_tt_id = $wpdb->insert_id; // Default link category $cat_name = __('Blogroll'); /* translators: Default link category slug */ $cat_slug = sanitize_title(_x('Blogroll', 'Default link category slug')); - $wpdb->insert( $wpdb->terms, array('name' => $cat_name, 'slug' => $cat_slug, 'term_group' => 0) ); - $wpdb->insert( $wpdb->term_taxonomy, array('term_id' => '2', 'taxonomy' => 'link_category', 'description' => '', 'parent' => 0, 'count' => 7)); + if ( global_terms_enabled() ) { + $blogroll_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) ); + if ( $blogroll_id == null ) { + $wpdb->insert( $wpdb->sitecategories, array('cat_ID' => 0, 'cat_name' => $cat_name, 'category_nicename' => $cat_slug, 'last_updated' => current_time('mysql', true)) ); + $blogroll_id = $wpdb->insert_id; + } + update_option('default_link_category', $blogroll_id); + } else { + $blogroll_id = 2; + } + + $wpdb->insert( $wpdb->terms, array('term_id' => $blogroll_id, 'name' => $cat_name, 'slug' => $cat_slug, 'term_group' => 0) ); + $wpdb->insert( $wpdb->term_taxonomy, array('term_id' => $blogroll_id, 'taxonomy' => 'link_category', 'description' => '', 'parent' => 0, 'count' => 7)); + $blogroll_tt_id = $wpdb->insert_id; // Now drop in some default links $default_links = array(); @@ -119,7 +153,7 @@ function wp_install_defaults($user_id) { 'link_notes' => ''); $default_links[] = array( 'link_url' => 'http://wordpress.org/development/', - 'link_name' => 'Development Blog', + 'link_name' => 'WordPress Blog', 'link_rss' => 'http://wordpress.org/development/feed/', 'link_notes' => ''); @@ -150,7 +184,7 @@ function wp_install_defaults($user_id) { foreach ( $default_links as $link ) { $wpdb->insert( $wpdb->links, $link); - $wpdb->insert( $wpdb->term_relationships, array('term_taxonomy_id' => 2, 'object_id' => $wpdb->insert_id) ); + $wpdb->insert( $wpdb->term_relationships, array('term_taxonomy_id' => $blogroll_tt_id, 'object_id' => $wpdb->insert_id) ); } // First post @@ -158,15 +192,27 @@ function wp_install_defaults($user_id) { $now_gmt = gmdate('Y-m-d H:i:s'); $first_post_guid = get_option('home') . '/?p=1'; + if ( is_multisite() ) { + $first_post = get_site_option( 'first_post' ); + + if ( empty($first_post) ) + $first_post = stripslashes( __( 'Welcome to SITE_NAME. This is your first post. Edit or delete it, then start blogging!' ) ); + + $first_post = str_replace( "SITE_URL", esc_url( network_home_url() ), $first_post ); + $first_post = str_replace( "SITE_NAME", $current_site->site_name, $first_post ); + } else { + $first_post = __('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!'); + } + $wpdb->insert( $wpdb->posts, array( 'post_author' => $user_id, 'post_date' => $now, 'post_date_gmt' => $now_gmt, - 'post_content' => __('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!'), + 'post_content' => $first_post, 'post_excerpt' => '', 'post_title' => __('Hello world!'), /* translators: Default post slug */ - 'post_name' => _x('hello-world', 'Default post slug'), + 'post_name' => sanitize_title( _x('hello-world', 'Default post slug') ), 'post_modified' => $now, 'post_modified_gmt' => $now_gmt, 'guid' => $first_post_guid, @@ -175,25 +221,37 @@ function wp_install_defaults($user_id) { 'pinged' => '', 'post_content_filtered' => '' )); - $wpdb->insert( $wpdb->term_relationships, array('term_taxonomy_id' => 1, 'object_id' => 1) ); + $wpdb->insert( $wpdb->term_relationships, array('term_taxonomy_id' => $cat_tt_id, 'object_id' => 1) ); // Default comment + $first_comment_author = __('Mr WordPress'); + $first_comment_url = 'http://wordpress.org/'; + $first_comment = __('Hi, this is a comment.
    To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.'); + if ( is_multisite() ) { + $first_comment_author = get_site_option( 'first_comment_author', $first_comment_author ); + $first_comment_url = get_site_option( 'first_comment_url', network_home_url() ); + $first_comment = get_site_option( 'first_comment', $first_comment ); + } $wpdb->insert( $wpdb->comments, array( 'comment_post_ID' => 1, - 'comment_author' => __('Mr WordPress'), + 'comment_author' => $first_comment_author, 'comment_author_email' => '', - 'comment_author_url' => 'http://wordpress.org/', + 'comment_author_url' => $first_comment_url, 'comment_date' => $now, 'comment_date_gmt' => $now_gmt, - 'comment_content' => __('Hi, this is a comment.
    To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.') + 'comment_content' => $first_comment )); + // First Page + $first_page = __('This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.'); + if ( is_multisite() ) + $first_page = get_site_option( 'first_page', $first_page ); $first_post_guid = get_option('home') . '/?page_id=2'; $wpdb->insert( $wpdb->posts, array( 'post_author' => $user_id, 'post_date' => $now, 'post_date_gmt' => $now_gmt, - 'post_content' => __('This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.'), + 'post_content' => $first_page, 'post_excerpt' => '', 'post_title' => __('About'), /* translators: Default page slug */ @@ -206,6 +264,33 @@ function wp_install_defaults($user_id) { 'pinged' => '', 'post_content_filtered' => '' )); + $wpdb->insert( $wpdb->postmeta, array( 'post_id' => 2, 'meta_key' => '_wp_page_template', 'meta_value' => 'default' ) ); + + // Setup default widgets for default theme. + update_option( 'widget_search', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) ); + update_option( 'widget_recent-posts', array ( 2 => array ( 'title' => '', 'number' => 5 ), '_multiwidget' => 1 ) ); + update_option( 'widget_recent-comments', array ( 2 => array ( 'title' => '', 'number' => 5 ), '_multiwidget' => 1 ) ); + update_option( 'widget_archives', array ( 2 => array ( 'title' => '', 'count' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) ); + update_option( 'widget_categories', array ( 2 => array ( 'title' => '', 'count' => 0, 'hierarchical' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) ); + update_option( 'widget_meta', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) ); + update_option( 'sidebars_widgets', array ( 'wp_inactive_widgets' => array ( ), 'primary-widget-area' => array ( 0 => 'search-2', 1 => 'recent-posts-2', 2 => 'recent-comments-2', 3 => 'archives-2', 4 => 'categories-2', 5 => 'meta-2', ), 'secondary-widget-area' => array ( ), 'first-footer-widget-area' => array ( ), 'second-footer-widget-area' => array ( ), 'third-footer-widget-area' => array ( ), 'fourth-footer-widget-area' => array ( ), 'array_version' => 3 ) ); + + if ( is_multisite() ) { + // Flush rules to pick up the new page. + $wp_rewrite->init(); + $wp_rewrite->flush_rules(); + + $user = new WP_User($user_id); + $wpdb->update( $wpdb->options, array('option_value' => $user->user_email), array('option_name' => 'admin_email') ); + + // Remove all perms except for the login user. + $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix.'user_level') ); + $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix.'capabilities') ); + + // Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) TODO: Get previous_blog_id. + if ( !is_super_admin( $user_id ) && $user_id != 1 ) + $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $wpdb->base_prefix.'1_capabilities') ); + } } endif; @@ -226,7 +311,7 @@ function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) { $user = new WP_User($user_id); $email = $user->user_email; $name = $user->user_login; - $message = sprintf(__("Your new WordPress blog has been successfully set up at: + $message = sprintf(__("Your new WordPress site has been successfully set up at: %1\$s @@ -235,13 +320,13 @@ You can log in to the administrator account with the following information: Username: %2\$s Password: %3\$s -We hope you enjoy your new blog. Thanks! +We hope you enjoy your new site. Thanks! --The WordPress Team http://wordpress.org/ "), $blog_url, $name, $password); - @wp_mail($email, __('New WordPress Blog'), $message); + @wp_mail($email, __('New WordPress Site'), $message); } endif; @@ -256,7 +341,7 @@ if ( !function_exists('wp_upgrade') ) : * @return null */ function wp_upgrade() { - global $wp_current_db_version, $wp_db_version; + global $wp_current_db_version, $wp_db_version, $wpdb; $wp_current_db_version = __get_option('db_version'); @@ -264,7 +349,7 @@ function wp_upgrade() { if ( $wp_db_version == $wp_current_db_version ) return; - if( ! is_blog_installed() ) + if ( ! is_blog_installed() ) return; wp_check_mysql_version(); @@ -272,7 +357,16 @@ function wp_upgrade() { pre_schema_upgrade(); make_db_current_silent(); upgrade_all(); + if ( is_multisite() && is_main_site() ) + upgrade_network(); wp_cache_flush(); + + if ( is_multisite() ) { + if ( $wpdb->get_row( "SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = '{$wpdb->blogid}'" ) ) + $wpdb->query( "UPDATE {$wpdb->blog_versions} SET db_version = '{$wp_db_version}' WHERE blog_id = '{$wpdb->blogid}'" ); + else + $wpdb->query( "INSERT INTO {$wpdb->blog_versions} ( `blog_id` , `db_version` , `last_updated` ) VALUES ( '{$wpdb->blogid}', '{$wp_db_version}', NOW());" ); + } } endif; @@ -331,9 +425,6 @@ function upgrade_all() { if ( $wp_current_db_version < 7499 ) upgrade_250(); - if ( $wp_current_db_version < 7796 ) - upgrade_251(); - if ( $wp_current_db_version < 7935 ) upgrade_252(); @@ -349,6 +440,9 @@ function upgrade_all() { if ( $wp_current_db_version < 11958 ) upgrade_290(); + if ( $wp_current_db_version < 15260 ) + upgrade_300(); + maybe_disable_automattic_widgets(); update_option( 'db_version', $wp_db_version ); @@ -470,7 +564,7 @@ function upgrade_110() { // Check if we already set the GMT fields (if we did, then // MAX(post_date_gmt) can't be '0000-00-00 00:00:00' // I just slapped myself silly for not thinking about it earlier - $got_gmt_fields = ($wpdb->get_var("SELECT MAX(post_date_gmt) FROM $wpdb->posts") == '0000-00-00 00:00:00') ? false : true; + $got_gmt_fields = ! ($wpdb->get_var("SELECT MAX(post_date_gmt) FROM $wpdb->posts") == '0000-00-00 00:00:00'); if (!$got_gmt_fields) { @@ -581,23 +675,23 @@ function upgrade_160() { $users = $wpdb->get_results("SELECT * FROM $wpdb->users"); foreach ( $users as $user ) : if ( !empty( $user->user_firstname ) ) - update_usermeta( $user->ID, 'first_name', $wpdb->escape($user->user_firstname) ); + update_user_meta( $user->ID, 'first_name', $wpdb->escape($user->user_firstname) ); if ( !empty( $user->user_lastname ) ) - update_usermeta( $user->ID, 'last_name', $wpdb->escape($user->user_lastname) ); + update_user_meta( $user->ID, 'last_name', $wpdb->escape($user->user_lastname) ); if ( !empty( $user->user_nickname ) ) - update_usermeta( $user->ID, 'nickname', $wpdb->escape($user->user_nickname) ); + update_user_meta( $user->ID, 'nickname', $wpdb->escape($user->user_nickname) ); if ( !empty( $user->user_level ) ) - update_usermeta( $user->ID, $wpdb->prefix . 'user_level', $user->user_level ); + update_user_meta( $user->ID, $wpdb->prefix . 'user_level', $user->user_level ); if ( !empty( $user->user_icq ) ) - update_usermeta( $user->ID, 'icq', $wpdb->escape($user->user_icq) ); + update_user_meta( $user->ID, 'icq', $wpdb->escape($user->user_icq) ); if ( !empty( $user->user_aim ) ) - update_usermeta( $user->ID, 'aim', $wpdb->escape($user->user_aim) ); + update_user_meta( $user->ID, 'aim', $wpdb->escape($user->user_aim) ); if ( !empty( $user->user_msn ) ) - update_usermeta( $user->ID, 'msn', $wpdb->escape($user->user_msn) ); + update_user_meta( $user->ID, 'msn', $wpdb->escape($user->user_msn) ); if ( !empty( $user->user_yim ) ) - update_usermeta( $user->ID, 'yim', $wpdb->escape($user->user_icq) ); + update_user_meta( $user->ID, 'yim', $wpdb->escape($user->user_icq) ); if ( !empty( $user->user_description ) ) - update_usermeta( $user->ID, 'description', $wpdb->escape($user->user_description) ); + update_user_meta( $user->ID, 'description', $wpdb->escape($user->user_description) ); if ( isset( $user->user_idmode ) ): $idmode = $user->user_idmode; @@ -612,11 +706,11 @@ function upgrade_160() { endif; // FIXME: RESET_CAPS is temporary code to reset roles and caps if flag is set. - $caps = get_usermeta( $user->ID, $wpdb->prefix . 'capabilities'); + $caps = get_user_meta( $user->ID, $wpdb->prefix . 'capabilities'); if ( empty($caps) || defined('RESET_CAPS') ) { - $level = get_usermeta($user->ID, $wpdb->prefix . 'user_level'); + $level = get_user_meta($user->ID, $wpdb->prefix . 'user_level', true); $role = translate_level_to_role($level); - update_usermeta( $user->ID, $wpdb->prefix . 'capabilities', array($role => true) ); + update_user_meta( $user->ID, $wpdb->prefix . 'capabilities', array($role => true) ); } endforeach; @@ -628,7 +722,7 @@ function upgrade_160() { // populate comment_count field of posts table $comments = $wpdb->get_results( "SELECT comment_post_ID, COUNT(*) as c FROM $wpdb->comments WHERE comment_approved = '1' GROUP BY comment_post_ID" ); - if( is_array( $comments ) ) + if ( is_array( $comments ) ) foreach ($comments as $comment) $wpdb->update( $wpdb->posts, array('comment_count' => $comment->c), array('ID' => $comment->comment_post_ID) ); @@ -918,18 +1012,6 @@ function upgrade_250() { } -/** - * Execute changes made in WordPress 2.5.1. - * - * @since 2.5.1 - */ -function upgrade_251() { - global $wp_current_db_version; - - // Make the secret longer - update_option('secret', wp_generate_password(64)); -} - /** * Execute changes made in WordPress 2.5.2. * @@ -980,10 +1062,25 @@ function upgrade_270() { * @since 2.8.0 */ function upgrade_280() { - global $wp_current_db_version; + global $wp_current_db_version, $wpdb; if ( $wp_current_db_version < 10360 ) populate_roles_280(); + if ( is_multisite() ) { + $start = 0; + while( $rows = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options ORDER BY option_id LIMIT $start, 20" ) ) { + foreach( $rows as $row ) { + $value = $row->option_value; + if ( !@unserialize( $value ) ) + $value = stripslashes( $value ); + if ( $value !== $row->option_value ) { + update_option( $row->option_name, $value ); + } + } + $start += 20; + } + refresh_blog_details( $wpdb->blogid ); + } } /** @@ -1003,6 +1100,83 @@ function upgrade_290() { } } +/** + * Execute changes made in WordPress 3.0. + * + * @since 3.0.0 + */ +function upgrade_300() { + global $wp_current_db_version, $wpdb; + + if ( $wp_current_db_version < 15093 ) + populate_roles_300(); + + if ( $wp_current_db_version < 14139 && is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false ) + add_site_option( 'siteurl', '' ); + + // 3.0-alpha nav menu postmeta changes. can be removed before release. // r13802 + if ( $wp_current_db_version >= 13226 && $wp_current_db_version < 13974 ) + $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key IN( 'menu_type', 'object_id', 'menu_new_window', 'menu_link', '_menu_item_append', 'menu_item_append', 'menu_item_type', 'menu_item_object_id', 'menu_item_target', 'menu_item_classes', 'menu_item_xfn', 'menu_item_url' )" ); + + // 3.0-beta1 remove_user primitive->meta cap. can be removed before release. r13956 + if ( $wp_current_db_version >= 12751 && $wp_current_db_version < 13974 ) { + $role =& get_role( 'administrator' ); + if ( ! empty( $role ) ) + $role->remove_cap( 'remove_user' ); + } + + // 3.0-beta1 nav menu postmeta changes. can be removed before release. r13974 + if ( $wp_current_db_version >= 13802 && $wp_current_db_version < 13974 ) + $wpdb->update( $wpdb->postmeta, array( 'meta_value' => '' ), array( 'meta_key' => '_menu_item_target', 'meta_value' => '_self' ) ); + + // 3.0 screen options key name changes. + if ( !is_multisite() || is_main_site() ) { + $prefix = like_escape($wpdb->base_prefix); + $wpdb->query( "DELETE FROM $wpdb->usermeta WHERE meta_key LIKE '{$prefix}%meta-box-hidden%' OR meta_key LIKE '{$prefix}%closedpostboxes%' OR meta_key LIKE '{$prefix}%manage-%-columns-hidden%' OR meta_key LIKE '{$prefix}%meta-box-order%' OR meta_key LIKE '{$prefix}%metaboxorder%' OR meta_key LIKE '{$prefix}%screen_layout%' + OR meta_key = 'manageedittagscolumnshidden' OR meta_key='managecategoriescolumnshidden' OR meta_key = 'manageedit-tagscolumnshidden' OR meta_key = 'manageeditcolumnshidden' OR meta_key = 'categories_per_page' OR meta_key = 'edit_tags_per_page'" ); + } + +} + +/** + * Execute network level changes + * + * @since 3.0.0 + */ +function upgrade_network() { + global $wp_current_db_version, $wpdb; + // 2.8 + if ( $wp_current_db_version < 11549 ) { + $wpmu_sitewide_plugins = get_site_option( 'wpmu_sitewide_plugins' ); + $active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' ); + if ( $wpmu_sitewide_plugins ) { + if ( !$active_sitewide_plugins ) + $sitewide_plugins = (array) $wpmu_sitewide_plugins; + else + $sitewide_plugins = array_merge( (array) $active_sitewide_plugins, (array) $wpmu_sitewide_plugins ); + + update_site_option( 'active_sitewide_plugins', $sitewide_plugins ); + } + delete_site_option( 'wpmu_sitewide_plugins' ); + delete_site_option( 'deactivated_sitewide_plugins' ); + + $start = 0; + while( $rows = $wpdb->get_results( "SELECT meta_key, meta_value FROM {$wpdb->sitemeta} ORDER BY meta_id LIMIT $start, 20" ) ) { + foreach( $rows as $row ) { + $value = $row->meta_value; + if ( !@unserialize( $value ) ) + $value = stripslashes( $value ); + if ( $value !== $row->meta_value ) { + update_site_option( $row->meta_key, $value ); + } + } + $start += 20; + } + } + // 3.0 + if ( $wp_current_db_version < 13576 ) + update_site_option( 'global_terms_enabled', '1' ); +} // The functions we use to actually do stuff @@ -1132,11 +1306,11 @@ function __get_option($setting) { global $wpdb; if ( $setting == 'home' && defined( 'WP_HOME' ) ) { - return preg_replace( '|/+$|', '', constant( 'WP_HOME' ) ); + return preg_replace( '|/+$|', '', WP_HOME ); } if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) { - return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) ); + return preg_replace( '|/+$|', '', WP_SITEURL ); } $option = $wpdb->get_var( $wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s", $setting) ); @@ -1196,9 +1370,9 @@ function dbDelta($queries, $execute = true) { global $wpdb; // Separate individual queries into an array - if( !is_array($queries) ) { + if ( !is_array($queries) ) { $queries = explode( ';', $queries ); - if('' == $queries[count($queries) - 1]) array_pop($queries); + if ('' == $queries[count($queries) - 1]) array_pop($queries); } $cqueries = array(); // Creation Queries @@ -1207,33 +1381,28 @@ function dbDelta($queries, $execute = true) { // Create a tablename index for an array ($cqueries) of queries foreach($queries as $qry) { - if(preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) { + if (preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) { $cqueries[trim( strtolower($matches[1]), '`' )] = $qry; $for_update[$matches[1]] = 'Created table '.$matches[1]; - } - else if(preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) { + } else if (preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) { array_unshift($cqueries, $qry); - } - else if(preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) { + } else if (preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) { $iqueries[] = $qry; - } - else if(preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) { + } else if (preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) { $iqueries[] = $qry; - } - else { + } else { // Unrecognized query type } } // Check to see which tables and fields exist - if($tables = $wpdb->get_col('SHOW TABLES;')) { + if ($tables = $wpdb->get_col('SHOW TABLES;')) { // For every table in the database - foreach($tables as $table) { + foreach ($tables as $table) { // If a table query exists for the database table... - if( array_key_exists(strtolower($table), $cqueries) ) { + if ( array_key_exists(strtolower($table), $cqueries) ) { // Clear the field and index arrays - unset($cfields); - unset($indices); + $cfields = $indices = array(); // Get all of the field names in the query from between the parens preg_match("|\((.*)\)|ms", $cqueries[strtolower($table)], $match2); $qryline = trim($match2[1]); @@ -1244,15 +1413,14 @@ function dbDelta($queries, $execute = true) { //echo "
    \n".print_r(strtolower($table), true).":\n".print_r($cqueries, true)."

    "; // For every field line specified in the query - foreach($flds as $fld) { + foreach ($flds as $fld) { // Extract the field name preg_match("|^([^ ]*)|", trim($fld), $fvals); $fieldname = trim( $fvals[1], '`' ); // Verify the found field name $validfield = true; - switch(strtolower($fieldname)) - { + switch (strtolower($fieldname)) { case '': case 'primary': case 'index': @@ -1266,7 +1434,7 @@ function dbDelta($queries, $execute = true) { $fld = trim($fld); // If it's a valid field, add it to the field array - if($validfield) { + if ($validfield) { $cfields[strtolower($fieldname)] = trim($fld, ", \n"); } } @@ -1275,15 +1443,15 @@ function dbDelta($queries, $execute = true) { $tablefields = $wpdb->get_results("DESCRIBE {$table};"); // For every field in the table - foreach($tablefields as $tablefield) { + foreach ($tablefields as $tablefield) { // If the table field exists in the field array... - if(array_key_exists(strtolower($tablefield->Field), $cfields)) { + if (array_key_exists(strtolower($tablefield->Field), $cfields)) { // Get the field type from the query preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches); $fieldtype = $matches[1]; // Is actual field type different from the field type in query? - if($tablefield->Type != $fieldtype) { + if ($tablefield->Type != $fieldtype) { // Add a query to change the column type $cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)]; $for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}"; @@ -1291,10 +1459,9 @@ function dbDelta($queries, $execute = true) { // Get the default value from the array //echo "{$cfields[strtolower($tablefield->Field)]}
    "; - if(preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) { + if (preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) { $default_value = $matches[1]; - if($tablefield->Default != $default_value) - { + if ($tablefield->Default != $default_value) { // Add a query to change the column's default value $cqueries[] = "ALTER TABLE {$table} ALTER COLUMN {$tablefield->Field} SET DEFAULT '{$default_value}'"; $for_update[$table.'.'.$tablefield->Field] = "Changed default value of {$table}.{$tablefield->Field} from {$tablefield->Default} to {$default_value}"; @@ -1303,14 +1470,13 @@ function dbDelta($queries, $execute = true) { // Remove the field from the array (so it's not added) unset($cfields[strtolower($tablefield->Field)]); - } - else { + } else { // This field exists in the table, but not in the creation queries? } } // For every remaining field specified for the table - foreach($cfields as $fieldname => $fielddef) { + foreach ($cfields as $fieldname => $fielddef) { // Push a query line into $cqueries that adds the field to that table $cqueries[] = "ALTER TABLE {$table} ADD COLUMN $fielddef"; $for_update[$table.'.'.$fieldname] = 'Added column '.$table.'.'.$fieldname; @@ -1320,12 +1486,12 @@ function dbDelta($queries, $execute = true) { // Fetch the table index structure from the database $tableindices = $wpdb->get_results("SHOW INDEX FROM {$table};"); - if($tableindices) { + if ($tableindices) { // Clear the index array unset($index_ary); // For every index in the table - foreach($tableindices as $tableindex) { + foreach ($tableindices as $tableindex) { // Add the index to the index data array $keyname = $tableindex->Key_name; $index_ary[$keyname]['columns'][] = array('fieldname' => $tableindex->Column_name, 'subpart' => $tableindex->Sub_part); @@ -1333,32 +1499,31 @@ function dbDelta($queries, $execute = true) { } // For each actual index in the index array - foreach($index_ary as $index_name => $index_data) { + foreach ($index_ary as $index_name => $index_data) { // Build a create string to compare to the query $index_string = ''; - if($index_name == 'PRIMARY') { + if ($index_name == 'PRIMARY') { $index_string .= 'PRIMARY '; - } - else if($index_data['unique']) { + } else if($index_data['unique']) { $index_string .= 'UNIQUE '; } $index_string .= 'KEY '; - if($index_name != 'PRIMARY') { + if ($index_name != 'PRIMARY') { $index_string .= $index_name; } $index_columns = ''; // For each column in the index - foreach($index_data['columns'] as $column_data) { - if($index_columns != '') $index_columns .= ','; + foreach ($index_data['columns'] as $column_data) { + if ($index_columns != '') $index_columns .= ','; // Add the field to the column list string $index_columns .= $column_data['fieldname']; - if($column_data['subpart'] != '') { + if ($column_data['subpart'] != '') { $index_columns .= '('.$column_data['subpart'].')'; } } // Add the column list to the index create string $index_string .= ' ('.$index_columns.')'; - if(!(($aindex = array_search($index_string, $indices)) === false)) { + if (!(($aindex = array_search($index_string, $indices)) === false)) { unset($indices[$aindex]); //echo "
    {$table}:
    Found index:".$index_string."
    \n"; } @@ -1383,8 +1548,8 @@ function dbDelta($queries, $execute = true) { } $allqueries = array_merge($cqueries, $iqueries); - if($execute) { - foreach($allqueries as $query) { + if ($execute) { + foreach ($allqueries as $query) { //echo "
    ".print_r($query, true)."
    \n"; $wpdb->query($query); } @@ -1454,7 +1619,7 @@ function make_site_theme_from_oldschool($theme_name, $template) { if ($oldfile == 'index.php') { // Check to make sure it's not a new index $index = implode('', file("$oldpath/$oldfile")); if (strpos($index, 'WP_USE_THEMES') !== false) { - if (! @copy(WP_CONTENT_DIR . '/themes/default/index.php', "$site_dir/$newfile")) + if (! @copy(WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME . '/index.php', "$site_dir/$newfile")) return false; continue; // Don't copy anything } @@ -1514,12 +1679,12 @@ function make_site_theme_from_oldschool($theme_name, $template) { */ function make_site_theme_from_default($theme_name, $template) { $site_dir = WP_CONTENT_DIR . "/themes/$template"; - $default_dir = WP_CONTENT_DIR . '/themes/default'; + $default_dir = WP_CONTENT_DIR . '/themes/' . WP_DEFAULT_THEME; // Copy files from the default theme to the site theme. //$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css'); - $theme_dir = @ opendir("$default_dir"); + $theme_dir = @ opendir($default_dir); if ($theme_dir) { while(($theme_file = readdir( $theme_dir )) !== false) { if (is_dir("$default_dir/$theme_file")) @@ -1610,7 +1775,7 @@ function make_site_theme() { // Make the new site theme active. $current_template = __get_option('template'); - if ($current_template == 'default') { + if ($current_template == WP_DEFAULT_THEME) { update_option('template', $template); update_option('stylesheet', $template); } @@ -1699,4 +1864,124 @@ function pre_schema_upgrade() { } +/** + * Install Network. + * + * @since 3.0.0 + * + */ +if ( !function_exists( 'install_network' ) ) : +function install_network() { + global $wpdb, $charset_collate; + $ms_queries = " +CREATE TABLE $wpdb->users ( + ID bigint(20) unsigned NOT NULL auto_increment, + user_login varchar(60) NOT NULL default '', + user_pass varchar(64) NOT NULL default '', + user_nicename varchar(50) NOT NULL default '', + user_email varchar(100) NOT NULL default '', + user_url varchar(100) NOT NULL default '', + user_registered datetime NOT NULL default '0000-00-00 00:00:00', + user_activation_key varchar(60) NOT NULL default '', + user_status int(11) NOT NULL default '0', + display_name varchar(250) NOT NULL default '', + spam tinyint(2) NOT NULL default '0', + deleted tinyint(2) NOT NULL default '0', + PRIMARY KEY (ID), + KEY user_login_key (user_login), + KEY user_nicename (user_nicename) +) $charset_collate; +CREATE TABLE $wpdb->blogs ( + blog_id bigint(20) NOT NULL auto_increment, + site_id bigint(20) NOT NULL default '0', + domain varchar(200) NOT NULL default '', + path varchar(100) NOT NULL default '', + registered datetime NOT NULL default '0000-00-00 00:00:00', + last_updated datetime NOT NULL default '0000-00-00 00:00:00', + public tinyint(2) NOT NULL default '1', + archived enum('0','1') NOT NULL default '0', + mature tinyint(2) NOT NULL default '0', + spam tinyint(2) NOT NULL default '0', + deleted tinyint(2) NOT NULL default '0', + lang_id int(11) NOT NULL default '0', + PRIMARY KEY (blog_id), + KEY domain (domain(50),path(5)), + KEY lang_id (lang_id) +) $charset_collate; +CREATE TABLE $wpdb->blog_versions ( + blog_id bigint(20) NOT NULL default '0', + db_version varchar(20) NOT NULL default '', + last_updated datetime NOT NULL default '0000-00-00 00:00:00', + PRIMARY KEY (blog_id), + KEY db_version (db_version) +) $charset_collate; +CREATE TABLE $wpdb->registration_log ( + ID bigint(20) NOT NULL auto_increment, + email varchar(255) NOT NULL default '', + IP varchar(30) NOT NULL default '', + blog_id bigint(20) NOT NULL default '0', + date_registered datetime NOT NULL default '0000-00-00 00:00:00', + PRIMARY KEY (ID), + KEY IP (IP) +) $charset_collate; +CREATE TABLE $wpdb->site ( + id bigint(20) NOT NULL auto_increment, + domain varchar(200) NOT NULL default '', + path varchar(100) NOT NULL default '', + PRIMARY KEY (id), + KEY domain (domain,path) +) $charset_collate; +CREATE TABLE $wpdb->sitemeta ( + meta_id bigint(20) NOT NULL auto_increment, + site_id bigint(20) NOT NULL default '0', + meta_key varchar(255) default NULL, + meta_value longtext, + PRIMARY KEY (meta_id), + KEY meta_key (meta_key), + KEY site_id (site_id) +) $charset_collate; +CREATE TABLE $wpdb->signups ( + domain varchar(200) NOT NULL default '', + path varchar(100) NOT NULL default '', + title longtext NOT NULL, + user_login varchar(60) NOT NULL default '', + user_email varchar(100) NOT NULL default '', + registered datetime NOT NULL default '0000-00-00 00:00:00', + activated datetime NOT NULL default '0000-00-00 00:00:00', + active tinyint(1) NOT NULL default '0', + activation_key varchar(50) NOT NULL default '', + meta longtext, + KEY activation_key (activation_key), + KEY domain (domain) +) $charset_collate; +"; +// now create tables + dbDelta( $ms_queries ); +} +endif; + +/** + * Install global terms. + * + * @since 3.0.0 + * + */ +if ( !function_exists( 'install_global_terms' ) ) : +function install_global_terms() { + global $wpdb, $charset_collate; + $ms_queries = " +CREATE TABLE $wpdb->sitecategories ( + cat_ID bigint(20) NOT NULL auto_increment, + cat_name varchar(55) NOT NULL default '', + category_nicename varchar(200) NOT NULL default '', + last_updated timestamp NOT NULL, + PRIMARY KEY (cat_ID), + KEY category_nicename (category_nicename), + KEY last_updated (last_updated) +) $charset_collate; +"; +// now create tables + dbDelta( $ms_queries ); +} +endif; ?> diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index f8c21e34..7a722975 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -30,7 +30,7 @@ function add_user() { if ( $user_id != $current_user->id || $wp_roles->role_objects[$new_role]->has_cap( 'edit_users' ) ) { // If the new role isn't editable by the logged-in user die with error $editable_roles = get_editable_roles(); - if ( !$editable_roles[$new_role] ) + if ( empty( $editable_roles[$new_role] ) ) wp_die(__('You can’t give users that role.')); $user = new WP_User( $user_id ); @@ -76,13 +76,15 @@ function edit_user( $user_id = 0 ) { if ( isset( $_POST['role'] ) && current_user_can( 'edit_users' ) ) { $new_role = sanitize_text_field( $_POST['role'] ); + $potential_role = isset($wp_roles->role_objects[$new_role]) ? $wp_roles->role_objects[$new_role] : false; // Don't let anyone with 'edit_users' (admins) edit their own role to something without it. - if( $user_id != $current_user->id || $wp_roles->role_objects[$new_role]->has_cap( 'edit_users' )) + // Multisite super admins can freely edit their blog roles -- they possess all caps. + if ( ( is_multisite() && current_user_can( 'manage_sites' ) ) || $user_id != $current_user->id || ($potential_role && $potential_role->has_cap( 'edit_users' ) ) ) $user->role = $new_role; // If the new role isn't editable by the logged-in user die with error $editable_roles = get_editable_roles(); - if ( !$editable_roles[$new_role] ) + if ( ! empty( $new_role ) && empty( $editable_roles[$new_role] ) ) wp_die(__('You can’t give users that role.')); } @@ -92,7 +94,7 @@ function edit_user( $user_id = 0 ) { if ( empty ( $_POST['url'] ) || $_POST['url'] == 'http://' ) { $user->user_url = ''; } else { - $user->user_url = sanitize_url( $_POST['url'] ); + $user->user_url = esc_url_raw( $_POST['url'] ); $user->user_url = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url; } } @@ -156,8 +158,8 @@ function edit_user( $user_id = 0 ) { if ( !empty( $pass1 ) ) $user->user_pass = $pass1; - if ( !$update && !validate_username( $user->user_login ) ) - $errors->add( 'user_login', __( 'ERROR: This username is invalid. Please enter a valid username.' )); + if ( !$update && isset( $_POST['user_login'] ) && !validate_username( $_POST['user_login'] ) ) + $errors->add( 'user_login', __( 'ERROR: This username is invalid because it uses illegal characters. Please enter a valid username.' )); if ( !$update && username_exists( $user->user_login ) ) $errors->add( 'user_login', __( 'ERROR: This username is already registered. Please choose another one.' )); @@ -197,7 +199,11 @@ function edit_user( $user_id = 0 ) { */ function get_author_user_ids() { global $wpdb; - $level_key = $wpdb->prefix . 'user_level'; + if ( !is_multisite() ) + $level_key = $wpdb->get_blog_prefix() . 'user_level'; + else + $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels + return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) ); } @@ -216,7 +222,7 @@ function get_editable_authors( $user_id ) { $editable = get_editable_user_ids( $user_id ); - if( !$editable ) { + if ( !$editable ) { return false; } else { $editable = join(',', $editable); @@ -241,15 +247,19 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'p global $wpdb; $user = new WP_User( $user_id ); + $post_type_obj = get_post_type_object($post_type); - if ( ! $user->has_cap("edit_others_{$post_type}s") ) { - if ( $user->has_cap("edit_{$post_type}s") || $exclude_zeros == false ) + if ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) { + if ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros ) return array($user->id); else return array(); } - $level_key = $wpdb->prefix . 'user_level'; + if ( !is_multisite() ) + $level_key = $wpdb->get_blog_prefix() . 'user_level'; + else + $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key); if ( $exclude_zeros ) @@ -294,7 +304,11 @@ function get_editable_roles() { */ function get_nonauthor_user_ids() { global $wpdb; - $level_key = $wpdb->prefix . 'user_level'; + + if ( !is_multisite() ) + $level_key = $wpdb->get_blog_prefix() . 'user_level'; + else + $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) ); } @@ -320,7 +334,7 @@ function get_others_unpublished_posts($user_id, $type='any') { $dir = ( 'pending' == $type ) ? 'ASC' : 'DESC'; - if( !$editable ) { + if ( !$editable ) { $other_unpubs = ''; } else { $editable = join(',', $editable); @@ -408,20 +422,19 @@ function get_users_drafts( $user_id ) { * @param int $reassign Optional. Reassign posts and links to new User ID. * @return bool True when finished. */ -function wp_delete_user($id, $reassign = 'novalue') { +function wp_delete_user( $id, $reassign = 'novalue' ) { global $wpdb; $id = (int) $id; - $user = new WP_User($id); // allow for transaction statement do_action('delete_user', $id); - if ($reassign == 'novalue') { + if ( 'novalue' === $reassign || null === $reassign ) { $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) ); - if ($post_ids) { - foreach ($post_ids as $post_id) + if ( $post_ids ) { + foreach ( $post_ids as $post_id ) wp_delete_post($post_id); } @@ -432,22 +445,22 @@ function wp_delete_user($id, $reassign = 'novalue') { foreach ( $link_ids as $link_id ) wp_delete_link($link_id); } - } else { $reassign = (int) $reassign; - $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE post_author = %d", $reassign, $id) ); - $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_owner = %d WHERE link_owner = %d", $reassign, $id) ); + $wpdb->update( $wpdb->posts, array('post_author' => $reassign), array('post_author' => $id) ); + $wpdb->update( $wpdb->links, array('link_owner' => $reassign), array('link_owner' => $id) ); } - // FINALLY, delete user - - $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) ); - $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) ); + clean_user_cache($id); - wp_cache_delete($id, 'users'); - wp_cache_delete($user->user_login, 'userlogins'); - wp_cache_delete($user->user_email, 'useremail'); - wp_cache_delete($user->user_nicename, 'userslugs'); + // FINALLY, delete user + if ( !is_multisite() ) { + $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) ); + $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) ); + } else { + $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels + $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = $id AND meta_key = '{$level_key}'"); + } // allow for commit transaction do_action('deleted_user', $id); @@ -474,7 +487,6 @@ if ( !class_exists('WP_User_Search') ) : * WordPress User Search class. * * @since unknown - * @author Mark Jaquith */ class WP_User_Search { @@ -555,27 +567,36 @@ class WP_User_Search { * * @since unknown * @access private - * @var unknown_type + * @var string */ var $query_limit; /** * {@internal Missing Description}} * - * @since unknown + * @since 3.0.0 * @access private - * @var unknown_type + * @var string */ - var $query_sort; + var $query_orderby; /** * {@internal Missing Description}} * - * @since unknown + * @since 3.0.0 * @access private - * @var unknown_type + * @var string + */ + var $query_from; + + /** + * {@internal Missing Description}} + * + * @since 3.0.0 + * @access private + * @var string */ - var $query_from_where; + var $query_where; /** * {@internal Missing Description}} @@ -646,8 +667,10 @@ class WP_User_Search { function prepare_query() { global $wpdb; $this->first_user = ($this->page - 1) * $this->users_per_page; + $this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page); - $this->query_sort = ' ORDER BY user_login'; + $this->query_orderby = ' ORDER BY user_login'; + $search_sql = ''; if ( $this->search_term ) { $searches = array(); @@ -658,13 +681,19 @@ class WP_User_Search { $search_sql .= ')'; } - $this->query_from_where = "FROM $wpdb->users"; - if ( $this->role ) - $this->query_from_where .= $wpdb->prepare(" INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%'); - else - $this->query_from_where .= " WHERE 1=1"; - $this->query_from_where .= " $search_sql"; + $this->query_from = " FROM $wpdb->users"; + $this->query_where = " WHERE 1=1 $search_sql"; + + if ( $this->role ) { + $this->query_from .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id"; + $this->query_where .= $wpdb->prepare(" AND $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%'); + } elseif ( is_multisite() ) { + $level_key = $wpdb->prefix . 'capabilities'; // wpmu site admins don't have user_levels + $this->query_from .= ", $wpdb->usermeta"; + $this->query_where .= " AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'"; + } + do_action_ref_array( 'pre_user_search', array( &$this ) ); } /** @@ -677,10 +706,11 @@ class WP_User_Search { */ function query() { global $wpdb; - $this->results = $wpdb->get_col('SELECT ID ' . $this->query_from_where . $this->query_sort . $this->query_limit); + + $this->results = $wpdb->get_col("SELECT DISTINCT($wpdb->users.ID)" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit); if ( $this->results ) - $this->total_users_for_query = $wpdb->get_var('SELECT COUNT(ID) ' . $this->query_from_where); // no limit + $this->total_users_for_query = $wpdb->get_var("SELECT COUNT(DISTINCT($wpdb->users.ID))" . $this->query_from . $this->query_where); // no limit else $this->search_errors = new WP_Error('no_matching_users_found', __('No matching users were found!')); } @@ -792,39 +822,41 @@ endif; add_action('admin_init', 'default_password_nag_handler'); function default_password_nag_handler($errors = false) { global $user_ID; - if ( ! get_usermeta($user_ID, 'default_password_nag') ) //Short circuit it. + if ( ! get_user_option('default_password_nag') ) //Short circuit it. return; //get_user_setting = JS saved UI setting. else no-js-falback code. if ( 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) { delete_user_setting('default_password_nag'); - update_usermeta($user_ID, 'default_password_nag', false); + update_user_option($user_ID, 'default_password_nag', false, true); } } add_action('profile_update', 'default_password_nag_edit_user', 10, 2); function default_password_nag_edit_user($user_ID, $old_data) { - global $user_ID; - if ( ! get_usermeta($user_ID, 'default_password_nag') ) //Short circuit it. + if ( ! get_user_option('default_password_nag', $user_ID) ) //Short circuit it. return; $new_data = get_userdata($user_ID); if ( $new_data->user_pass != $old_data->user_pass ) { //Remove the nag if the password has been changed. - delete_user_setting('default_password_nag'); - update_usermeta($user_ID, 'default_password_nag', false); + delete_user_setting('default_password_nag', $user_ID); + update_user_option($user_ID, 'default_password_nag', false, true); } } add_action('admin_notices', 'default_password_nag'); function default_password_nag() { - global $user_ID; - if ( ! get_usermeta($user_ID, 'default_password_nag') ) + if ( ! get_user_option('default_password_nag') ) //Short circuit it. return; - echo '

    '; - printf(__("Notice: you're using the auto-generated password for your account. Would you like to change it to something you'll remember easier?
    - Yes, Take me to my profile page | No Thanks, Do not remind me again."), admin_url('profile.php') . '#password', '?default_password_nag=0'); + echo '

    '; + echo '

    '; + echo '' . __('Notice:') . ' '; + _e('You’re using the auto-generated password for your account. Would you like to change it to something you’ll remember easier?'); + echo '

    '; + printf( '' . __('Yes, take me to my profile page') . ' | ', admin_url('profile.php') . '#password' ); + printf( '' . __('No thanks, do not remind me again') . '', '?default_password_nag=0' ); echo '

    '; } diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php index 47dfec52..aef0dbaf 100644 --- a/wp-admin/includes/widgets.php +++ b/wp-admin/includes/widgets.php @@ -68,7 +68,7 @@ function wp_list_widget_controls( $sidebar ) { if ( !empty( $description ) ) { echo "\n"; } @@ -202,7 +202,7 @@ function wp_widget_control( $sidebar_args ) {
    - +

    diff --git a/wp-admin/index-extra.php b/wp-admin/index-extra.php index 32189707..22df0d67 100644 --- a/wp-admin/index-extra.php +++ b/wp-admin/index-extra.php @@ -7,15 +7,13 @@ */ /** Load WordPress Bootstrap */ -require_once('admin.php'); +require_once( './admin.php' ); /** Load WordPress Administration Dashboard API */ -require( 'includes/dashboard.php' ); +require( './includes/dashboard.php' ); -/** Load Magpie RSS API or custom RSS API */ -require_once (ABSPATH . WPINC . '/rss.php'); - -@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); +@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); +send_nosniff_header(); switch ( $_GET['jax'] ) { @@ -35,6 +33,10 @@ case 'dashboard_plugins' : wp_dashboard_plugins_output(); break; +case 'dashboard_quick_press' : + wp_dashboard_quick_press_output(); + break; + } ?> \ No newline at end of file diff --git a/wp-admin/index.php b/wp-admin/index.php index a88b1bc3..789835c9 100644 --- a/wp-admin/index.php +++ b/wp-admin/index.php @@ -7,7 +7,7 @@ */ /** Load WordPress Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); /** Load WordPress dashboard API */ require_once(ABSPATH . 'wp-admin/includes/dashboard.php'); @@ -23,7 +23,26 @@ add_thickbox(); $title = __('Dashboard'); $parent_file = 'index.php'; -require_once('admin-header.php'); + +add_contextual_help($current_screen, + + '

    ' . __('Welcome to your WordPress Dashboard! You will find helpful tips in the Help tab of each screen to assist you as you get to know the application.') . '

    ' . + '

    ' . __('The left-hand navigation menu provides links to the administration screens in your WordPress application. You can expand or collapse navigation sections by clicking on the arrow that appears on the right side of each navigation item when you hover over it. You can also minimize the navigation menu to a narrow icon strip by clicking on the separator lines between navigation sections that end in double arrowheads; when minimized, the submenu items will be displayed on hover.') . '

    ' . + '

    ' . __('You can configure your dashboard by choosing which modules to display, how many columns to display them in, and where each module should be placed. You can hide/show modules and select the number of columns in the Screen Options tab. To rearrange the modules, drag and drop by clicking on the title bar of the selected module and releasing when you see a gray dotted-line box appear in the location you want to place the module. You can also expand or collapse each module by clicking once on the the module’s title bar. In addition, some modules are configurable, and will show a “Configure” link in the title bar when you hover over it.') . '

    ' . + '

    ' . __('The modules on your Dashboard screen are:') . '

    ' . + '

    ' . __('Right Now - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.') . '

    ' . + '

    ' . __('Recent Comments - Shows the most recent comments on your posts (configurable, up to 30) and allows you to moderate them.') . '

    ' . + '

    ' . __('Incoming Links - Shows links to your site found by Google Blog Search.') . '

    ' . + '

    ' . __('QuickPress - Allows you to create a new post and either publish it or save it as a draft.') . '

    ' . + '

    ' . __('Recent Drafts - Displays links to the 5 most recent draft posts you’ve started.') . '

    ' . + '

    ' . __('Other WordPress News - Shows the feed from WordPress Planet. You can configure it to show a different feed of your choosing.') . '

    ' . + '

    ' . __('Plugins - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.') . '

    ' . + '

    ' . __('For more information:') . '

    ' . + '

    ' . __('Dashboard Documentation') . '

    ' . + '

    ' . __('Support Forums') . '

    ' +); + +require_once('./admin-header.php'); $today = current_time('mysql', 1); ?> diff --git a/wp-admin/install.php b/wp-admin/install.php index 0e9b87b9..58be0738 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -6,81 +6,143 @@ * @subpackage Administration */ +// Sanity check. +if ( false ) { +?> + + + + + Error: PHP is not running + + +

    WordPress

    +

    Error: PHP is not running

    +

    WordPress requires that your web server is running PHP. Your server does not have PHP installed, or PHP is turned off.

    + + + > - <?php _e('WordPress › Installation'); ?> + <?php _e( 'WordPress › Installation' ); ?>

    WordPress

    get_var("SHOW TABLES LIKE '$wpdb->users'") != null ); + // Ensure that Blogs appear in search engines by default $blog_public = 1; - if ( isset($_POST) && !empty($_POST) ) { - $blog_public = isset($_POST['blog_public']); - } + if ( ! empty( $_POST ) ) + $blog_public = isset( $_POST['blog_public'] ); + + $weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : ''; + $user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin'; + $admin_password = isset($_POST['admin_password']) ? trim( stripslashes( $_POST['admin_password'] ) ) : ''; + $admin_email = isset( $_POST['admin_email'] ) ? trim( stripslashes( $_POST['admin_email'] ) ) : ''; if ( ! is_null( $error ) ) { ?> -

    ERROR: %s'), $error); ?>

    +

    ERROR: %s' ), $error ); ?>

    - - + + + + + + + - - + + + - + + + + +
    + +

    + +

    -
    + +

    +
    + +

    +
    +

    +
    +

    -

    +

    '.__('Already Installed').'

    '.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'

    ');} +if ( is_blog_installed() ) { + display_header(); + die( '

    ' . __( 'Already Installed' ) . '

    ' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '

    ' . __('Log In') . '

    ' ); +} $php_version = phpversion(); $mysql_version = $wpdb->db_version(); @@ -88,11 +150,11 @@ $php_compat = version_compare( $php_version, $required_php_version, '>=' ); $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); if ( !$mysql_compat && !$php_compat ) - $compat = sprintf( __('You cannot install because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ); + $compat = sprintf( __('You cannot install because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ); elseif ( !$php_compat ) - $compat = sprintf( __('You cannot install because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ); + $compat = sprintf( __('You cannot install because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ); elseif ( !$mysql_compat ) - $compat = sprintf( __('You cannot install because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ); + $compat = sprintf( __('You cannot install because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ); if ( !$mysql_compat || !$php_compat ) { display_header(); @@ -100,68 +162,80 @@ if ( !$mysql_compat || !$php_compat ) { } switch($step) { - case 0: - case 1: // in case people are directly linking to this + case 0: // Step 1 + case 1: // Step 1, direct link. display_header(); ?> -

    -

    ReadMe documentation at your leisure. Otherwise, just fill in the information below and you’ll be on your way to using the most extendable and powerful personal publishing platform in the world.'), '../readme.html'); ?>

    - - -

    -

    - +

    +

    ReadMe documentation at your leisure. Otherwise, just fill in the information below and you’ll be on your way to using the most extendable and powerful personal publishing platform in the world.' ), '../readme.html' ); ?>

    +

    +

    error) ) - wp_die($wpdb->error->get_error_message()); + if ( ! empty( $wpdb->error ) ) + wp_die( $wpdb->error->get_error_message() ); display_header(); // Fill in the data we gathered - $weblog_title = isset($_POST['weblog_title']) ? stripslashes($_POST['weblog_title']) : ''; - $admin_email = isset($_POST['admin_email']) ? stripslashes($_POST['admin_email']) : ''; - $public = isset($_POST['blog_public']) ? (int) $_POST['blog_public'] : 0; + $weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : ''; + $user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin'; + $admin_password = isset($_POST['admin_password']) ? $_POST['admin_password'] : ''; + $admin_password_check = isset($_POST['admin_password2']) ? $_POST['admin_password2'] : ''; + $admin_email = isset( $_POST['admin_email'] ) ?trim( stripslashes( $_POST['admin_email'] ) ) : ''; + $public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 0; // check e-mail address $error = false; - if (empty($admin_email)) { + if ( empty( $user_name ) ) { + // TODO: poka-yoke + display_setup_form( __('you must provide a valid username.') ); + $error = true; + } elseif ( $user_name != sanitize_user( $user_name, true ) ) { + display_setup_form( __('the username you provided has invalid characters.') ); + $error = true; + } elseif ( $admin_password != $admin_password_check ) { + // TODO: poka-yoke + display_setup_form( __( 'your passwords do not match. Please try again' ) ); + $error = true; + } else if ( empty( $admin_email ) ) { // TODO: poka-yoke - display_setup_form( __('you must provide an e-mail address.') ); + display_setup_form( __( 'you must provide an e-mail address.' ) ); $error = true; - } else if (!is_email($admin_email)) { + } elseif ( ! is_email( $admin_email ) ) { // TODO: poka-yoke - display_setup_form( __('that isn’t a valid e-mail address. E-mail addresses look like: username@example.com') ); + display_setup_form( __( 'that isn’t a valid e-mail address. E-mail addresses look like: username@example.com' ) ); $error = true; } if ( $error === false ) { $wpdb->show_errors(); - $result = wp_install($weblog_title, 'admin', $admin_email, $public); - extract($result, EXTR_SKIP); + $result = wp_install($weblog_title, $user_name, $admin_email, $public, '', $admin_password); + extract( $result, EXTR_SKIP ); ?> -

    +

    -

    +

    - - + + - - + +
    admin
    '. $password .'
    '; - } - echo '

    '. $password_message .'

    '; ?>
    '. esc_html($password) .'
    '; + echo "

    $password_message

    "; ?> +
    -

    +

    + + + + + diff --git a/wp-admin/js/common.dev.js b/wp-admin/js/common.dev.js index 2ef85e6b..4972cb0f 100644 --- a/wp-admin/js/common.dev.js +++ b/wp-admin/js/common.dev.js @@ -123,25 +123,47 @@ $(document).ready(function(){ adminMenu.init(); }); // show/hide/save table columns columns = { init : function() { + var that = this; $('.hide-column-tog', '#adv-settings').click( function() { - var column = $(this).val(); - if ( $(this).attr('checked') ) - $('.column-' + column).show(); + var $t = $(this), column = $t.val(); + if ( $t.attr('checked') ) + that.checked(column); else - $('.column-' + column).hide(); + that.unchecked(column); - columns.save_manage_columns_state(); + columns.saveManageColumnsState(); }); }, - save_manage_columns_state : function() { - var hidden = $('.manage-column').filter(':hidden').map(function() { return this.id; }).get().join(','); + saveManageColumnsState : function() { + var hidden = this.hidden(); $.post(ajaxurl, { action: 'hidden-columns', hidden: hidden, screenoptionnonce: $('#screenoptionnonce').val(), page: pagenow }); + }, + + checked : function(column) { + $('.column-' + column).show(); + }, + + unchecked : function(column) { + $('.column-' + column).hide(); + }, + + hidden : function() { + return $('.manage-column').filter(':hidden').map(function() { return this.id; }).get().join(','); + }, + + useCheckboxesForHidden : function() { + this.hidden = function(){ + return $('.hide-column-tog').not(':checked').map(function() { + var id = this.id; + return id.substring( id, id.length - 5 ); + }).get().join(','); + }; } } @@ -172,9 +194,9 @@ showNotice = { jQuery(document).ready( function($) { var lastClicked = false, checks, first, last, checked; - // Move .updated and .error alert boxes + // Move .updated and .error alert boxes. Don't move boxes designed to be inline. $('div.wrap h2:first').nextAll('div.updated, div.error').addClass('below-h2'); - $('div.updated, div.error').not('.below-h2').insertAfter( $('div.wrap h2:first') ); + $('div.updated, div.error').not('.below-h2, .inline').insertAfter( $('div.wrap h2:first') ); // screen settings tab $('#show-settings-link').click(function () { @@ -183,11 +205,11 @@ jQuery(document).ready( function($) { $('#screen-options-wrap').slideToggle('fast', function(){ if ( $(this).hasClass('screen-options-open') ) { - $('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right.gif")'}); + $('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right.gif?ver=20100531")'}); $('#contextual-help-link-wrap').css('visibility', ''); $(this).removeClass('screen-options-open'); } else { - $('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right-up.gif")'}); + $('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right-up.gif?ver=20100531")'}); $(this).addClass('screen-options-open'); } }); @@ -201,11 +223,11 @@ jQuery(document).ready( function($) { $('#contextual-help-wrap').slideToggle('fast', function() { if ( $(this).hasClass('contextual-help-open') ) { - $('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right.gif")'}); + $('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right.gif?ver=20100531")'}); $('#screen-options-link-wrap').css('visibility', ''); $(this).removeClass('contextual-help-open'); } else { - $('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right-up.gif")'}); + $('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right-up.gif?ver=20100531")'}); $(this).addClass('contextual-help-open'); } }); @@ -267,24 +289,37 @@ jQuery(document).ready( function($) { $('div.default-password-nag').hide(); return false; }); -}); -jQuery(document).ready( function($){ - var turboNag = $('span.turbo-nag', '#user_info'); + // tab in textareas + $('#newcontent').keydown(function(e) { + if ( e.keyCode != 9 ) + return true; - if ( !turboNag.length || ('undefined' != typeof(google) && google.gears) ) - return; + var el = e.target, selStart = el.selectionStart, selEnd = el.selectionEnd, val = el.value, scroll, sel; - if ( 'undefined' != typeof GearsFactory ) { - return; - } else { try { - if ( ( 'undefined' != typeof window.ActiveXObject && ActiveXObject('Gears.Factory') ) || - ( 'undefined' != typeof navigator.mimeTypes && navigator.mimeTypes['application/x-googlegears'] ) ) { - return; - } - } catch(e){} - } + this.lastKey = 9; // not a standard DOM property, lastKey is to help stop Opera tab event. See blur handler below. + } catch(err) {} + + if ( document.selection ) { + el.focus(); + sel = document.selection.createRange(); + sel.text = '\t'; + } else if ( selStart >= 0 ) { + scroll = this.scrollTop; + el.value = val.substring(0, selStart).concat('\t', val.substring(selEnd) ); + el.selectionStart = el.selectionEnd = selStart + 1; + this.scrollTop = scroll; + } - turboNag.show(); -}); + if ( e.stopPropagation ) + e.stopPropagation(); + if ( e.preventDefault ) + e.preventDefault(); + }); + + $('#newcontent').blur(function(e) { + if ( this.lastKey && 9 == this.lastKey ) + this.focus(); + }); +}); \ No newline at end of file diff --git a/wp-admin/js/common.js b/wp-admin/js/common.js index eaef37f8..c18dad14 100644 --- a/wp-admin/js/common.js +++ b/wp-admin/js/common.js @@ -1 +1 @@ -var showNotice,adminMenu,columns,validateForm;(function(a){adminMenu={init:function(){var b=a("#adminmenu");a(".wp-menu-toggle",b).each(function(){var c=a(this),d=c.siblings(".wp-submenu");if(d.length){c.click(function(){adminMenu.toggle(d)})}else{c.hide()}});this.favorites();a(".separator",b).click(function(){if(a("body").hasClass("folded")){adminMenu.fold(1);deleteUserSetting("mfold")}else{adminMenu.fold();setUserSetting("mfold","f")}return false});if(a("body").hasClass("folded")){this.fold()}this.restoreMenuState()},restoreMenuState:function(){a("li.wp-has-submenu","#adminmenu").each(function(c,d){var b=getUserSetting("m"+c);if(a(d).hasClass("wp-has-current-submenu")){return true}if("o"==b){a(d).addClass("wp-menu-open")}else{if("c"==b){a(d).removeClass("wp-menu-open")}}})},toggle:function(b){var c=b.slideToggle(150,function(){b.css("display","")}).parent().toggleClass("wp-menu-open").attr("id");if(c){a("li.wp-has-submenu","#adminmenu").each(function(f,g){if(c==g.id){var d=a(g).hasClass("wp-menu-open")?"o":"c";setUserSetting("m"+f,d)}})}return false},fold:function(b){if(b){a("body").removeClass("folded");a("#adminmenu li.wp-has-submenu").unbind()}else{a("body").addClass("folded");a("#adminmenu li.wp-has-submenu").hoverIntent({over:function(j){var d,c,g,k,i;d=a(this).find(".wp-submenu");c=a(this).offset().top+d.height()+1;g=a("#wpwrap").height();k=60+c-g;i=a(window).height()+a(window).scrollTop()-15;if(i<(c-k)){k=c-i}if(k>1){d.css({marginTop:"-"+k+"px"})}else{if(d.css("marginTop")){d.css({marginTop:""})}}d.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open").css({marginTop:""})},timeout:220,sensitivity:8,interval:100})}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)}).bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){a(".hide-column-tog","#adv-settings").click(function(){var b=a(this).val();if(a(this).attr("checked")){a(".column-"+b).show()}else{a(".column-"+b).hide()}columns.save_manage_columns_state()})},save_manage_columns_state:function(){var b=a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()}})(jQuery);showNotice={warn:function(){var a=commonL10n.warnDelete||"";if(confirm(a)){return true}return false},note:function(a){alert(a)}};jQuery(document).ready(function(d){var f=false,a,e,c,b;d("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");d("div.updated, div.error").not(".below-h2").insertAfter(d("div.wrap h2:first"));d("#show-settings-link").click(function(){if(!d("#screen-options-wrap").hasClass("screen-options-open")){d("#contextual-help-link-wrap").css("visibility","hidden")}d("#screen-options-wrap").slideToggle("fast",function(){if(d(this).hasClass("screen-options-open")){d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#contextual-help-link-wrap").css("visibility","");d(this).removeClass("screen-options-open")}else{d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("screen-options-open")}});return false});d("#contextual-help-link").click(function(){if(!d("#contextual-help-wrap").hasClass("contextual-help-open")){d("#screen-options-link-wrap").css("visibility","hidden")}d("#contextual-help-wrap").slideToggle("fast",function(){if(d(this).hasClass("contextual-help-open")){d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#screen-options-link-wrap").css("visibility","");d(this).removeClass("contextual-help-open")}else{d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("contextual-help-open")}});return false});d("tbody").children().children(".check-column").find(":checkbox").click(function(g){if("undefined"==g.shiftKey){return true}if(g.shiftKey){if(!f){return true}a=d(f).closest("form").find(":checkbox");e=a.index(f);c=a.index(this);b=d(this).attr("checked");if(01){d.css({marginTop:"-"+k+"px"})}else{if(d.css("marginTop")){d.css({marginTop:""})}}d.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open").css({marginTop:""})},timeout:220,sensitivity:8,interval:100})}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)}).bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var d=a(this),c=d.val();if(d.attr("checked")){b.checked(c)}else{b.unchecked(c)}columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).show()},unchecked:function(b){a(".column-"+b).hide()},hidden:function(){return a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return a(".hide-column-tog").not(":checked").map(function(){var b=this.id;return b.substring(b,b.length-5)}).get().join(",")}}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()}})(jQuery);showNotice={warn:function(){var a=commonL10n.warnDelete||"";if(confirm(a)){return true}return false},note:function(a){alert(a)}};jQuery(document).ready(function(d){var f=false,a,e,c,b;d("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");d("div.updated, div.error").not(".below-h2, .inline").insertAfter(d("div.wrap h2:first"));d("#show-settings-link").click(function(){if(!d("#screen-options-wrap").hasClass("screen-options-open")){d("#contextual-help-link-wrap").css("visibility","hidden")}d("#screen-options-wrap").slideToggle("fast",function(){if(d(this).hasClass("screen-options-open")){d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right.gif?ver=20100531")'});d("#contextual-help-link-wrap").css("visibility","");d(this).removeClass("screen-options-open")}else{d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right-up.gif?ver=20100531")'});d(this).addClass("screen-options-open")}});return false});d("#contextual-help-link").click(function(){if(!d("#contextual-help-wrap").hasClass("contextual-help-open")){d("#screen-options-link-wrap").css("visibility","hidden")}d("#contextual-help-wrap").slideToggle("fast",function(){if(d(this).hasClass("contextual-help-open")){d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right.gif?ver=20100531")'});d("#screen-options-link-wrap").css("visibility","");d(this).removeClass("contextual-help-open")}else{d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right-up.gif?ver=20100531")'});d(this).addClass("contextual-help-open")}});return false});d("tbody").children().children(".check-column").find(":checkbox").click(function(g){if("undefined"==g.shiftKey){return true}if(g.shiftKey){if(!f){return true}a=d(f).closest("form").find(":checkbox");e=a.index(f);c=a.index(this);b=d(this).attr("checked");if(0=0){g=this.scrollTop;i.value=m.substring(0,n).concat("\t",m.substring(h));i.selectionStart=i.selectionEnd=n+1;this.scrollTop=g}}if(l.stopPropagation){l.stopPropagation()}if(l.preventDefault){l.preventDefault()}});d("#newcontent").blur(function(g){if(this.lastKey&&9==this.lastKey){this.focus()}})}); \ No newline at end of file diff --git a/wp-admin/js/custom-background.dev.js b/wp-admin/js/custom-background.dev.js new file mode 100644 index 00000000..5b4b1543 --- /dev/null +++ b/wp-admin/js/custom-background.dev.js @@ -0,0 +1,46 @@ +var farbtastic; + +function pickColor(color) { + farbtastic.setColor(color); + jQuery('#background-color').val(color); + jQuery('#custom-background-image').css('background-color', color); +} + +jQuery(document).ready(function() { + jQuery('#pickcolor').click(function() { + jQuery('#colorPickerDiv').show(); + return false; + }); + + jQuery('#background-color').keyup(function() { + var _hex = jQuery('#background-color').val(), hex = _hex; + if ( hex[0] != '#' ) + hex = '#' + hex; + hex = hex.replace(/[^#a-fA-F0-9]+/, ''); + if ( hex != _hex ) + jQuery('#background-color').val(hex); + if ( hex.length == 4 || hex.length == 7 ) + pickColor( hex ); + }); + + jQuery('input[name="background-position-x"]').change(function() { + jQuery('#custom-background-image').css('background-position', jQuery(this).val() + ' top'); + }); + + jQuery('input[name="background-repeat"]').change(function() { + jQuery('#custom-background-image').css('background-repeat', jQuery(this).val()); + }); + + farbtastic = jQuery.farbtastic('#colorPickerDiv', function(color) { + pickColor(color); + }); + pickColor(jQuery('#background-color').val()); + + jQuery(document).mousedown(function(){ + jQuery('#colorPickerDiv').each(function(){ + var display = jQuery(this).css('display'); + if ( display == 'block' ) + jQuery(this).fadeOut(2); + }); + }); +}); diff --git a/wp-admin/js/custom-background.js b/wp-admin/js/custom-background.js new file mode 100644 index 00000000..0a5f8afe --- /dev/null +++ b/wp-admin/js/custom-background.js @@ -0,0 +1 @@ +var farbtastic;function pickColor(a){farbtastic.setColor(a);jQuery("#background-color").val(a);jQuery("#custom-background-image").css("background-color",a)}jQuery(document).ready(function(){jQuery("#pickcolor").click(function(){jQuery("#colorPickerDiv").show();return false});jQuery("#background-color").keyup(function(){var b=jQuery("#background-color").val(),a=b;if(a[0]!="#"){a="#"+a}a=a.replace(/[^#a-fA-F0-9]+/,"");if(a!=b){jQuery("#background-color").val(a)}if(a.length==4||a.length==7){pickColor(a)}});jQuery('input[name="background-position-x"]').change(function(){jQuery("#custom-background-image").css("background-position",jQuery(this).val()+" top")});jQuery('input[name="background-repeat"]').change(function(){jQuery("#custom-background-image").css("background-repeat",jQuery(this).val())});farbtastic=jQuery.farbtastic("#colorPickerDiv",function(a){pickColor(a)});pickColor(jQuery("#background-color").val());jQuery(document).mousedown(function(){jQuery("#colorPickerDiv").each(function(){var a=jQuery(this).css("display");if(a=="block"){jQuery(this).fadeOut(2)}})})}); \ No newline at end of file diff --git a/wp-admin/js/dashboard.dev.js b/wp-admin/js/dashboard.dev.js index aa33391c..4969113c 100644 --- a/wp-admin/js/dashboard.dev.js +++ b/wp-admin/js/dashboard.dev.js @@ -6,7 +6,8 @@ jQuery(document).ready( function($) { 'dashboard_incoming_links', 'dashboard_primary', 'dashboard_secondary', - 'dashboard_plugins' + 'dashboard_plugins', + 'dashboard_quick_press' ]; ajaxPopulateWidgets = function(el) { @@ -20,6 +21,10 @@ jQuery(document).ready( function($) { $(this).css('display', ''); if ( 'dashboard_plugins' == id && $.isFunction(tb_init) ) tb_init('#dashboard_plugins a.thickbox'); + if ( 'dashboard_quick_press' == id && $.isFunction(tb_init) ) { + tb_init('#dashboard_quick_press a.thickbox'); + quickPressLoad(); + } }); }); }, i * 500 ); @@ -43,7 +48,7 @@ jQuery(document).ready( function($) { quickPressLoad = function() { var act = $('#quickpost-action'), t; t = $('#quick-press').submit( function() { - $('#dashboard_quick_press h3').append( '' ); + $('#dashboard_quick_press #publishing-action img.waiting').css('visibility', 'visible'); $('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr('disabled','disabled'); if ( 'post' == act.val() ) { @@ -51,8 +56,9 @@ jQuery(document).ready( function($) { } $('#dashboard_quick_press div.inside').load( t.attr( 'action' ), t.serializeArray(), function() { - $('#dashboard_quick_press h3 img').remove(); + $('#dashboard_quick_press #publishing-action img.waiting').css('visibility', 'hidden'); $('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr('disabled',''); + $('#dashboard_quick_press ul').next('p').remove(); $('#dashboard_quick_press ul').find('li').each( function() { $('#dashboard_recent_drafts ul').prepend( this ); } ).end().remove(); @@ -65,6 +71,5 @@ jQuery(document).ready( function($) { $('#publish').click( function() { act.val( 'post-quickpress-publish' ); } ); }; - quickPressLoad(); } ); diff --git a/wp-admin/js/dashboard.js b/wp-admin/js/dashboard.js index c9886183..f391e134 100644 --- a/wp-admin/js/dashboard.js +++ b/wp-admin/js/dashboard.js @@ -1 +1 @@ -var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];ajaxPopulateWidgets=function(b){show=function(g,c){var f,d=a("#"+g+" div.inside:visible").find(".widget-loading");if(d.length){f=d.parent();setTimeout(function(){f.load("index-extra.php?jax="+g,"",function(){f.hide().slideDown("normal",function(){a(this).css("display","");if("dashboard_plugins"==g&&a.isFunction(tb_init)){tb_init("#dashboard_plugins a.thickbox")}})})},c*500)}};if(b){b=b.toString();if(a.inArray(b,ajaxWidgets)!=-1){show(b,0)}}else{a.each(ajaxWidgets,function(c){show(this,c)})}};ajaxPopulateWidgets();postboxes.add_postbox_toggles("dashboard",{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var b=a("#quickpost-action"),c;c=a("#quick-press").submit(function(){a("#dashboard_quick_press h3").append('');a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==b.val()){b.val("post-quickpress-publish")}a("#dashboard_quick_press div.inside").load(c.attr("action"),c.serializeArray(),function(){a("#dashboard_quick_press h3 img").remove();a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");a("#dashboard_quick_press ul").find("li").each(function(){a("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})};quickPressLoad()}); \ No newline at end of file +var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins","dashboard_quick_press"];ajaxPopulateWidgets=function(b){show=function(g,c){var f,d=a("#"+g+" div.inside:visible").find(".widget-loading");if(d.length){f=d.parent();setTimeout(function(){f.load("index-extra.php?jax="+g,"",function(){f.hide().slideDown("normal",function(){a(this).css("display","");if("dashboard_plugins"==g&&a.isFunction(tb_init)){tb_init("#dashboard_plugins a.thickbox")}if("dashboard_quick_press"==g&&a.isFunction(tb_init)){tb_init("#dashboard_quick_press a.thickbox");quickPressLoad()}})})},c*500)}};if(b){b=b.toString();if(a.inArray(b,ajaxWidgets)!=-1){show(b,0)}}else{a.each(ajaxWidgets,function(c){show(this,c)})}};ajaxPopulateWidgets();postboxes.add_postbox_toggles("dashboard",{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var b=a("#quickpost-action"),c;c=a("#quick-press").submit(function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==b.val()){b.val("post-quickpress-publish")}a("#dashboard_quick_press div.inside").load(c.attr("action"),c.serializeArray(),function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");a("#dashboard_quick_press ul").next("p").remove();a("#dashboard_quick_press ul").find("li").each(function(){a("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})}}); \ No newline at end of file diff --git a/wp-admin/js/edit-comments.dev.js b/wp-admin/js/edit-comments.dev.js index cc39f12c..bec6f3cc 100644 --- a/wp-admin/js/edit-comments.dev.js +++ b/wp-admin/js/edit-comments.dev.js @@ -49,6 +49,8 @@ setCommentsList = function() { el = $('#comment-' + id); note = $('#' + action + '-undo-holder').html(); + el.find('.check-column :checkbox').attr('checked', ''); // Uncheck the row so as not to be affected by Bulk Edits. + if ( el.siblings('#replyrow').length && commentReply.cid == id ) commentReply.close(); diff --git a/wp-admin/js/edit-comments.js b/wp-admin/js/edit-comments.js index 8d1347a4..cb865d9c 100644 --- a/wp-admin/js/edit-comments.js +++ b/wp-admin/js/edit-comments.js @@ -1 +1 @@ -var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var c,e,h,l=0,g,i,d,k;c=a('.tablenav input[name="_total"]',"#comments-form");e=a('.tablenav input[name="_per_page"]',"#comments-form");h=a('.tablenav input[name="_page"]',"#comments-form");g=function(n,m){var o=a("#"+m.element);if(o.is(".unapproved")){o.find("div.comment_status").html("0")}else{o.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var p=a(this),r,q;r=p.html().replace(/[^0-9]+/g,"");r=parseInt(r,10);if(isNaN(r)){return}q=a("#"+m.element).is("."+m.dimClass)?1:-1;r=r+q;if(r<0){r=0}p.closest("#awaiting-mod")[0==r?"addClass":"removeClass"]("count-0");f(p,r);j()})};i=function(q,u){var w=a(q.target).attr("className"),m,o,p,t,v,s,r=false;q.data._total=c.val()||0;q.data._per_page=e.val()||0;q.data._page=h.val()||0;q.data._url=document.location.href;if(w.indexOf(":trash=1")!=-1){r="trash"}else{if(w.indexOf(":spam=1")!=-1){r="spam"}}if(r){m=w.replace(/.*?comment-([0-9]+).*/,"$1");o=a("#comment-"+m);note=a("#"+r+"-undo-holder").html();if(o.siblings("#replyrow").length&&commentReply.cid==m){commentReply.close()}if(o.is("tr")){p=o.children(":visible").length;s=a(".author strong",o).text();t=a(''+note+"")}else{s=a(".comment-author",o).text();t=a('")}o.before(t);a("strong","#undo-"+m).text(s+" ");v=a(".undo a","#undo-"+m);v.attr("href","comment.php?action=un"+r+"comment&c="+m+"&_wpnonce="+q.data._ajax_nonce);v.attr("className","delete:the-comment-list:comment-"+m+"::un"+r+"=1 vim-z vim-destructive");a(".avatar",o).clone().prependTo("#undo-"+m+" ."+r+"-undo-inside");v.click(function(){u.wpList.del(this);a("#undo-"+m).css({backgroundColor:"#ceb"}).fadeOut(350,function(){a(this).remove();a("#comment-"+m).css("backgroundColor","").fadeIn(300,function(){a(this).show()})});return false})}return q};d=function(m,n,o){if(n3){while(p.length>3){m=thousandsSeparator+p.substr(p.length-3)+m;p=p.substr(0,p.length-3)}p=p+m}o.html(p)}k=function(m,o){var t,p,q,v=a(o.target).parent().is("span.untrash"),n=a(o.target).parent().is("span.unspam"),u,s;function w(r){if(a(o.target).parent().is("span."+r)){return 1}else{if(a("#"+o.element).is("."+r)){return -1}}return 0}u=w("spam");s=w("trash");if(v){s=-1}if(n){u=-1}a("span.pending-count").each(function(){var r=a(this),y=b(r),x=a("#"+o.element).is(".unapproved");if(a(o.target).parent().is("span.unapprove")||((v||n)&&x)){y=y+1}else{if(x){y=y-1}}if(y<0){y=0}r.closest("#awaiting-mod")[0==y?"addClass":"removeClass"]("count-0");f(r,y);j()});a("span.spam-count").each(function(){var r=a(this),x=b(r)+u;f(r,x)});a("span.trash-count").each(function(){var r=a(this),x=b(r)+s;f(r,x)});if(a("#dashboard_right_now").length){q=s?-1*s:0;j(q)}else{t=c.val()?parseInt(c.val(),10):0;t=t-u-s;if(t<0){t=0}if(("object"==typeof m)&&l p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){var b;if(this.cid){b=a("#comment-"+this.cid);if(this.act=="edit-comment"){b.fadeIn(300,function(){b.show()}).css("backgroundColor","")}a("#replyrow").hide();a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("input","#edithead").val("");a(".error","#replysubmit").html("").hide();a(".waiting","#replysubmit").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}this.cid=""}},open:function(b,d,k){var l=this,e,f,i,g,j=a("#comment-"+b);l.close();l.cid=b;a("td","#replyrow").attr("colspan",a("table.widefat thead th:visible").length);e=a("#replyrow");f=a("#inline-"+b);i=l.act=(k=="edit")?"edit-comment":"replyto-comment";a("#action",e).val(i);a("#comment_post_ID",e).val(d);a("#comment_ID",e).val(b);if(k=="edit"){a("#author",e).val(a("div.author",f).text());a("#author-email",e).val(a("div.author-email",f).text());a("#author-url",e).val(a("div.author-url",f).text());a("#status",e).val(a("div.comment_status",f).text());a("#replycontent",e).val(a("textarea.comment",f).val());a("#edithead, #savebtn",e).show();a("#replyhead, #replybtn",e).hide();g=j.height();if(g>220){if(a.browser.msie){a("#replycontainer, #replycontent",e).height(g-105)}else{a("#replycontainer",e).height(g-105)}}j.after(e).fadeOut("fast",function(){a("#replyrow").fadeIn(300,function(){a(this).show()})})}else{a("#edithead, #savebtn",e).hide();a("#replyhead, #replybtn",e).show();j.after(e);a("#replyrow").fadeIn(300,function(){a(this).show()})}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var n,h,o,c,m;n=a("#replyrow").offset().top;h=n+a("#replyrow").height();o=window.pageYOffset||document.documentElement.scrollTop;c=document.documentElement.clientHeight||self.innerHeight||0;m=o+c;if(m-20]*?>/g,"")}if(c){a("#replysubmit .error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a("span.delete a.delete").click(function(){return false});if(typeof QTags!="undefined"){ed_reply=new QTags("ed_reply","replycontent","replycontainer","more")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a("."+f+".page-numbers");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("input:checkbox","#cb").click().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(){var g=a('select[name="action"]');a("option[value="+f+"]",g).attr("selected","selected");a("#comments-form").submit()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q","z",["e",b],["shift+x",c],["shift+a",d("approve")],["shift+s",d("markspam")],["shift+d",d("delete")],["shift+t",d("trash")],["shift+z",d("untrash")],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery); \ No newline at end of file +var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var c,e,h,l=0,g,i,d,k;c=a('.tablenav input[name="_total"]',"#comments-form");e=a('.tablenav input[name="_per_page"]',"#comments-form");h=a('.tablenav input[name="_page"]',"#comments-form");g=function(n,m){var o=a("#"+m.element);if(o.is(".unapproved")){o.find("div.comment_status").html("0")}else{o.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var p=a(this),r,q;r=p.html().replace(/[^0-9]+/g,"");r=parseInt(r,10);if(isNaN(r)){return}q=a("#"+m.element).is("."+m.dimClass)?1:-1;r=r+q;if(r<0){r=0}p.closest("#awaiting-mod")[0==r?"addClass":"removeClass"]("count-0");f(p,r);j()})};i=function(q,u){var w=a(q.target).attr("className"),m,o,p,t,v,s,r=false;q.data._total=c.val()||0;q.data._per_page=e.val()||0;q.data._page=h.val()||0;q.data._url=document.location.href;if(w.indexOf(":trash=1")!=-1){r="trash"}else{if(w.indexOf(":spam=1")!=-1){r="spam"}}if(r){m=w.replace(/.*?comment-([0-9]+).*/,"$1");o=a("#comment-"+m);note=a("#"+r+"-undo-holder").html();o.find(".check-column :checkbox").attr("checked","");if(o.siblings("#replyrow").length&&commentReply.cid==m){commentReply.close()}if(o.is("tr")){p=o.children(":visible").length;s=a(".author strong",o).text();t=a(''+note+"")}else{s=a(".comment-author",o).text();t=a('")}o.before(t);a("strong","#undo-"+m).text(s+" ");v=a(".undo a","#undo-"+m);v.attr("href","comment.php?action=un"+r+"comment&c="+m+"&_wpnonce="+q.data._ajax_nonce);v.attr("className","delete:the-comment-list:comment-"+m+"::un"+r+"=1 vim-z vim-destructive");a(".avatar",o).clone().prependTo("#undo-"+m+" ."+r+"-undo-inside");v.click(function(){u.wpList.del(this);a("#undo-"+m).css({backgroundColor:"#ceb"}).fadeOut(350,function(){a(this).remove();a("#comment-"+m).css("backgroundColor","").fadeIn(300,function(){a(this).show()})});return false})}return q};d=function(m,n,o){if(n3){while(p.length>3){m=thousandsSeparator+p.substr(p.length-3)+m;p=p.substr(0,p.length-3)}p=p+m}o.html(p)}k=function(m,o){var t,p,q,v=a(o.target).parent().is("span.untrash"),n=a(o.target).parent().is("span.unspam"),u,s;function w(r){if(a(o.target).parent().is("span."+r)){return 1}else{if(a("#"+o.element).is("."+r)){return -1}}return 0}u=w("spam");s=w("trash");if(v){s=-1}if(n){u=-1}a("span.pending-count").each(function(){var r=a(this),y=b(r),x=a("#"+o.element).is(".unapproved");if(a(o.target).parent().is("span.unapprove")||((v||n)&&x)){y=y+1}else{if(x){y=y-1}}if(y<0){y=0}r.closest("#awaiting-mod")[0==y?"addClass":"removeClass"]("count-0");f(r,y);j()});a("span.spam-count").each(function(){var r=a(this),x=b(r)+u;f(r,x)});a("span.trash-count").each(function(){var r=a(this),x=b(r)+s;f(r,x)});if(a("#dashboard_right_now").length){q=s?-1*s:0;j(q)}else{t=c.val()?parseInt(c.val(),10):0;t=t-u-s;if(t<0){t=0}if(("object"==typeof m)&&l p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){var b;if(this.cid){b=a("#comment-"+this.cid);if(this.act=="edit-comment"){b.fadeIn(300,function(){b.show()}).css("backgroundColor","")}a("#replyrow").hide();a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("input","#edithead").val("");a(".error","#replysubmit").html("").hide();a(".waiting","#replysubmit").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}this.cid=""}},open:function(b,d,k){var l=this,e,f,i,g,j=a("#comment-"+b);l.close();l.cid=b;a("td","#replyrow").attr("colspan",a("table.widefat thead th:visible").length);e=a("#replyrow");f=a("#inline-"+b);i=l.act=(k=="edit")?"edit-comment":"replyto-comment";a("#action",e).val(i);a("#comment_post_ID",e).val(d);a("#comment_ID",e).val(b);if(k=="edit"){a("#author",e).val(a("div.author",f).text());a("#author-email",e).val(a("div.author-email",f).text());a("#author-url",e).val(a("div.author-url",f).text());a("#status",e).val(a("div.comment_status",f).text());a("#replycontent",e).val(a("textarea.comment",f).val());a("#edithead, #savebtn",e).show();a("#replyhead, #replybtn",e).hide();g=j.height();if(g>220){if(a.browser.msie){a("#replycontainer, #replycontent",e).height(g-105)}else{a("#replycontainer",e).height(g-105)}}j.after(e).fadeOut("fast",function(){a("#replyrow").fadeIn(300,function(){a(this).show()})})}else{a("#edithead, #savebtn",e).hide();a("#replyhead, #replybtn",e).show();j.after(e);a("#replyrow").fadeIn(300,function(){a(this).show()})}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var n,h,o,c,m;n=a("#replyrow").offset().top;h=n+a("#replyrow").height();o=window.pageYOffset||document.documentElement.scrollTop;c=document.documentElement.clientHeight||self.innerHeight||0;m=o+c;if(m-20]*?>/g,"")}if(c){a("#replysubmit .error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a("span.delete a.delete").click(function(){return false});if(typeof QTags!="undefined"){ed_reply=new QTags("ed_reply","replycontent","replycontainer","more")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a("."+f+".page-numbers");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("input:checkbox","#cb").click().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(){var g=a('select[name="action"]');a("option[value="+f+"]",g).attr("selected","selected");a("#comments-form").submit()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q","z",["e",b],["shift+x",c],["shift+a",d("approve")],["shift+s",d("markspam")],["shift+d",d("delete")],["shift+t",d("trash")],["shift+z",d("untrash")],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery); \ No newline at end of file diff --git a/wp-admin/js/image-edit.dev.js b/wp-admin/js/image-edit.dev.js index 49ce7f3b..0e43d511 100644 --- a/wp-admin/js/image-edit.dev.js +++ b/wp-admin/js/image-edit.dev.js @@ -204,10 +204,10 @@ imageEdit = { if ( fw < 1 ) { w.focus(); - return false;; + return false; } else if ( fh < 1 ) { h.focus(); - return false;; + return false; } if ( fw == t.hold.ow || fh == t.hold.oh ) diff --git a/wp-admin/js/inline-edit-post.dev.js b/wp-admin/js/inline-edit-post.dev.js index f1380ee6..2bb3547b 100644 --- a/wp-admin/js/inline-edit-post.dev.js +++ b/wp-admin/js/inline-edit-post.dev.js @@ -36,17 +36,13 @@ inlineEditPost = { $('#inline-edit label.inline-edit-tags').clone() ); - // categories expandable? + // hiearchical taxonomies expandable? $('span.catshow').click(function() { - $('.inline-editor ul.cat-checklist').addClass("cat-hover"); - $('.inline-editor span.cathide').show(); - $(this).hide(); + $(this).hide().next().show().parent().next().addClass("cat-hover"); }); $('span.cathide').click(function() { - $('.inline-editor ul.cat-checklist').removeClass("cat-hover"); - $('.inline-editor span.catshow').show(); - $(this).hide(); + $(this).hide().prev().show().parent().next().removeClass("cat-hover"); }); $('select[name="_status"] option[value="future"]', bulkRow).remove(); @@ -118,7 +114,6 @@ inlineEditPost = { fields = ['post_title', 'post_name', 'post_author', '_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'ss', 'post_password']; if ( t.type == 'page' ) fields.push('post_parent', 'menu_order', 'page_template'); - if ( t.type == 'post' ) fields.push('tags_input'); // add the new blank row editRow = $('#inline-edit').clone(true); @@ -146,9 +141,24 @@ inlineEditPost = { if ( $('.sticky', rowData).text() == 'sticky' ) $('input[name="sticky"]', editRow).attr("checked", "checked"); - // categories - if ( cats = $('.post_category', rowData).text() ) - $('ul.cat-checklist :checkbox', editRow).val(cats.split(',')); + // hierarchical taxonomies + $('.post_category', rowData).each(function(){ + if( term_ids = $(this).text() ) + { + taxname = $(this).attr('id').replace('_'+id, ''); + $('ul.'+taxname+'-checklist :checkbox', editRow).val(term_ids.split(',')); + } + }); + //flat taxonomies + $('.tags_input', rowData).each(function(){ + if( terms = $(this).text() ) + { + taxname = $(this).attr('id').replace('_'+id, ''); + $('textarea.tax_input_'+taxname, editRow).val(terms); + $('textarea.tax_input_'+taxname, editRow).suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } ); + } + }); + // handle the post status status = $('._status', rowData).text(); @@ -180,12 +190,6 @@ inlineEditPost = { $(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show(); $('.ptitle', editRow).focus(); - // enable autocomplete for tags - if ( t.type == 'post' ) { - tax = 'post_tag'; - $('tr.inline-editor textarea[name="tags_input"]').suggest( 'admin-ajax.php?action=ajax-tag-search&tax='+tax, { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } ); - } - return false; }, @@ -199,7 +203,7 @@ inlineEditPost = { params = { action: 'inline-save', - post_type: this.type, + post_type: typenow, post_ID: id, edit_date: 'true', post_status: page diff --git a/wp-admin/js/inline-edit-post.js b/wp-admin/js/inline-edit-post.js index f8fd54ba..baf9e441 100644 --- a/wp-admin/js/inline-edit-post.js +++ b/wp-admin/js/inline-edit-post.js @@ -1 +1 @@ -(function(a){inlineEditPost={init:function(){var c=this,d=a("#inline-edit"),b=a("#bulk-edit");c.type=a("table.widefat").hasClass("page")?"page":"post";c.what="#"+c.type+"-";d.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});b.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});a("a.cancel",d).click(function(){return inlineEditPost.revert()});a("a.save",d).click(function(){return inlineEditPost.save(this)});a("td",d).keydown(function(f){if(f.which==13){return inlineEditPost.save(this)}});a("a.cancel",b).click(function(){return inlineEditPost.revert()});a("#inline-edit .inline-edit-private input[value=private]").click(function(){var e=a("input.inline-edit-password-input");if(a(this).attr("checked")){e.val("").attr("disabled","disabled")}else{e.attr("disabled","")}});a("a.editinline").live("click",function(){inlineEditPost.edit(this);return false});a("#bulk-title-div").parents("fieldset").after(a("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(a("#inline-edit label.inline-edit-tags").clone());a("span.catshow").click(function(){a(".inline-editor ul.cat-checklist").addClass("cat-hover");a(".inline-editor span.cathide").show();a(this).hide()});a("span.cathide").click(function(){a(".inline-editor ul.cat-checklist").removeClass("cat-hover");a(".inline-editor span.catshow").show();a(this).hide()});a('select[name="_status"] option[value="future"]',b).remove();a("#doaction, #doaction2").click(function(f){var g=a(this).attr("id").substr(2);if(a('select[name="'+g+'"]').val()=="edit"){f.preventDefault();c.setBulk()}else{if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}}});a("#post-query-submit").click(function(f){if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},setBulk:function(){var e="",d=this.type,b,f=true;this.revert();a("#bulk-edit td").attr("colspan",a(".widefat:first thead th:visible").length);a("table.widefat tbody").prepend(a("#bulk-edit"));a("#bulk-edit").addClass("inline-editor").show();a('tbody th.check-column input[type="checkbox"]').each(function(g){if(a(this).attr("checked")){f=false;var h=a(this).val(),c;c=a("#inline_"+h+" .post_title").text()||inlineEditL10n.notitle;e+='
    X'+c+"
    "}});if(f){return this.revert()}a("#bulk-titles").html(e);a("#bulk-titles a").click(function(){var c=a(this).attr("id").substr(1);a('table.widefat input[value="'+c+'"]').attr("checked","");a("#ttle"+c).remove()});if(d=="post"){b="post_tag";a('tr.inline-editor textarea[name="tags_input"]').suggest("admin-ajax.php?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:true,multipleSep:", "})}},edit:function(b){var o=this,j,d,g,n,i,h,k,m,l,c=true,p,e;o.revert();if(typeof(b)=="object"){b=o.getId(b)}j=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password"];if(o.type=="page"){j.push("post_parent","menu_order","page_template")}if(o.type=="post"){j.push("tags_input")}d=a("#inline-edit").clone(true);a("td",d).attr("colspan",a(".widefat:first thead th:visible").length);if(a(o.what+b).hasClass("alternate")){a(d).addClass("alternate")}a(o.what+b).hide().after(d);g=a("#inline_"+b);if(!a(':input[name="post_author"] option[value='+a(".post_author",g).text()+"]",d).val()){a(':input[name="post_author"]',d).prepend('")}for(k=0;k0){m=h[0].className.split("-")[1];l=h;while(c){l=l.next("option");if(l.length==0){break}p=l[0].className.split("-")[1];if(p<=m){c=false}else{l.remove();l=h}}h.remove()}a(d).attr("id","edit-"+b).addClass("inline-editor").show();a(".ptitle",d).focus();if(o.type=="post"){e="post_tag";a('tr.inline-editor textarea[name="tags_input"]').suggest("admin-ajax.php?action=ajax-tag-search&tax="+e,{delay:500,minchars:2,multiple:true,multipleSep:", "})}return false},save:function(e){var d,b,c=a(".post_status_page").val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .inline-edit-save .waiting").show();d={action:"inline-save",post_type:this.type,post_ID:e,edit_date:"true",post_status:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post("admin-ajax.php",d,function(f){a("table.widefat .inline-edit-save .waiting").hide();if(f){if(-1!=f.indexOf("]*?>/g,"");a("#edit-"+e+" .inline-edit-save").append(''+f+"")}}else{a("#edit-"+e+" .inline-edit-save").append(''+inlineEditL10n.error+"")}},"html");return false},revert:function(){var b;if(b=a("table.widefat tr.inline-editor").attr("id")){a("table.widefat .inline-edit-save .waiting").hide();if("bulk-edit"==b){a("table.widefat #bulk-edit").removeClass("inline-editor").hide();a("#bulk-titles").html("");a("#inlineedit").append(a("#bulk-edit"))}else{a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}}return false},getId:function(c){var d=c.tagName=="TR"?c.id:a(c).parents("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditPost.init()})})(jQuery); \ No newline at end of file +(function(a){inlineEditPost={init:function(){var c=this,d=a("#inline-edit"),b=a("#bulk-edit");c.type=a("table.widefat").hasClass("page")?"page":"post";c.what="#"+c.type+"-";d.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});b.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});a("a.cancel",d).click(function(){return inlineEditPost.revert()});a("a.save",d).click(function(){return inlineEditPost.save(this)});a("td",d).keydown(function(f){if(f.which==13){return inlineEditPost.save(this)}});a("a.cancel",b).click(function(){return inlineEditPost.revert()});a("#inline-edit .inline-edit-private input[value=private]").click(function(){var e=a("input.inline-edit-password-input");if(a(this).attr("checked")){e.val("").attr("disabled","disabled")}else{e.attr("disabled","")}});a("a.editinline").live("click",function(){inlineEditPost.edit(this);return false});a("#bulk-title-div").parents("fieldset").after(a("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(a("#inline-edit label.inline-edit-tags").clone());a("span.catshow").click(function(){a(this).hide().next().show().parent().next().addClass("cat-hover")});a("span.cathide").click(function(){a(this).hide().prev().show().parent().next().removeClass("cat-hover")});a('select[name="_status"] option[value="future"]',b).remove();a("#doaction, #doaction2").click(function(f){var g=a(this).attr("id").substr(2);if(a('select[name="'+g+'"]').val()=="edit"){f.preventDefault();c.setBulk()}else{if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}}});a("#post-query-submit").click(function(f){if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},setBulk:function(){var e="",d=this.type,b,f=true;this.revert();a("#bulk-edit td").attr("colspan",a(".widefat:first thead th:visible").length);a("table.widefat tbody").prepend(a("#bulk-edit"));a("#bulk-edit").addClass("inline-editor").show();a('tbody th.check-column input[type="checkbox"]').each(function(g){if(a(this).attr("checked")){f=false;var h=a(this).val(),c;c=a("#inline_"+h+" .post_title").text()||inlineEditL10n.notitle;e+='
    X'+c+"
    "}});if(f){return this.revert()}a("#bulk-titles").html(e);a("#bulk-titles a").click(function(){var c=a(this).attr("id").substr(1);a('table.widefat input[value="'+c+'"]').attr("checked","");a("#ttle"+c).remove()});if(d=="post"){b="post_tag";a('tr.inline-editor textarea[name="tags_input"]').suggest("admin-ajax.php?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:true,multipleSep:", "})}},edit:function(b){var o=this,j,d,g,n,i,h,k,m,l,c=true,p,e;o.revert();if(typeof(b)=="object"){b=o.getId(b)}j=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password"];if(o.type=="page"){j.push("post_parent","menu_order","page_template")}d=a("#inline-edit").clone(true);a("td",d).attr("colspan",a(".widefat:first thead th:visible").length);if(a(o.what+b).hasClass("alternate")){a(d).addClass("alternate")}a(o.what+b).hide().after(d);g=a("#inline_"+b);if(!a(':input[name="post_author"] option[value='+a(".post_author",g).text()+"]",d).val()){a(':input[name="post_author"]',d).prepend('")}for(k=0;k0){m=h[0].className.split("-")[1];l=h;while(c){l=l.next("option");if(l.length==0){break}p=l[0].className.split("-")[1];if(p<=m){c=false}else{l.remove();l=h}}h.remove()}a(d).attr("id","edit-"+b).addClass("inline-editor").show();a(".ptitle",d).focus();return false},save:function(e){var d,b,c=a(".post_status_page").val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .inline-edit-save .waiting").show();d={action:"inline-save",post_type:typenow,post_ID:e,edit_date:"true",post_status:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post("admin-ajax.php",d,function(f){a("table.widefat .inline-edit-save .waiting").hide();if(f){if(-1!=f.indexOf("]*?>/g,"");a("#edit-"+e+" .inline-edit-save").append(''+f+"")}}else{a("#edit-"+e+" .inline-edit-save").append(''+inlineEditL10n.error+"")}},"html");return false},revert:function(){var b;if(b=a("table.widefat tr.inline-editor").attr("id")){a("table.widefat .inline-edit-save .waiting").hide();if("bulk-edit"==b){a("table.widefat #bulk-edit").removeClass("inline-editor").hide();a("#bulk-titles").html("");a("#inlineedit").append(a("#bulk-edit"))}else{a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}}return false},getId:function(c){var d=c.tagName=="TR"?c.id:a(c).parents("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditPost.init()})})(jQuery); \ No newline at end of file diff --git a/wp-admin/js/link.dev.js b/wp-admin/js/link.dev.js index e963db99..2db467a3 100644 --- a/wp-admin/js/link.dev.js +++ b/wp-admin/js/link.dev.js @@ -59,6 +59,7 @@ jQuery(document).ready( function($) { $('#category-add-toggle').click( function() { $(this).parents('div:first').toggleClass( 'wp-hidden-children' ); $('#category-tabs a[href="#categories-all"]').click(); + $('#newcategory').focus(); return false; } ); diff --git a/wp-admin/js/link.js b/wp-admin/js/link.js index db140c6b..e394d7d1 100644 --- a/wp-admin/js/link.js +++ b/wp-admin/js/link.js @@ -1 +1 @@ -jQuery(document).ready(function(c){var b,a=false,d,e;c("#link_name").focus();postboxes.add_postbox_toggles("link");c("#category-tabs a").click(function(){var f=c(this).attr("href");c(this).parent().addClass("tabs").siblings("li").removeClass("tabs");c(".tabs-panel").hide();c(f).show();if("#categories-all"==f){deleteUserSetting("cats")}else{setUserSetting("cats","pop")}return false});if(getUserSetting("cats")){c('#category-tabs a[href="#categories-pop"]').click()}b=c("#newcat").one("focus",function(){c(this).val("").removeClass("form-input-tip")});c("#category-add-submit").click(function(){b.focus()});d=function(){if(a){return}a=true;var f=c(this),h=f.is(":checked"),g=f.val().toString();c("#in-link-category-"+g+", #in-popular-category-"+g).attr("checked",h);a=false};e=function(g,f){c(f.what+" response_data",g).each(function(){var h=c(c(this).text());h.find("label").each(function(){var j=c(this),l=j.find("input").val(),m=j.find("input")[0].id,i=c.trim(j.text()),k;c("#"+m).change(d);k=c('').text(i)})})};c("#categorychecklist").wpList({alt:"",what:"link-category",response:"category-ajax-response",addAfter:e});c('a[href="#categories-all"]').click(function(){deleteUserSetting("cats")});c('a[href="#categories-pop"]').click(function(){setUserSetting("cats","pop")});if("pop"==getUserSetting("cats")){c('a[href="#categories-pop"]').click()}c("#category-add-toggle").click(function(){c(this).parents("div:first").toggleClass("wp-hidden-children");c('#category-tabs a[href="#categories-all"]').click();return false});c(".categorychecklist :checkbox").change(d).filter(":checked").change()}); \ No newline at end of file +jQuery(document).ready(function(c){var b,a=false,d,e;c("#link_name").focus();postboxes.add_postbox_toggles("link");c("#category-tabs a").click(function(){var f=c(this).attr("href");c(this).parent().addClass("tabs").siblings("li").removeClass("tabs");c(".tabs-panel").hide();c(f).show();if("#categories-all"==f){deleteUserSetting("cats")}else{setUserSetting("cats","pop")}return false});if(getUserSetting("cats")){c('#category-tabs a[href="#categories-pop"]').click()}b=c("#newcat").one("focus",function(){c(this).val("").removeClass("form-input-tip")});c("#category-add-submit").click(function(){b.focus()});d=function(){if(a){return}a=true;var f=c(this),h=f.is(":checked"),g=f.val().toString();c("#in-link-category-"+g+", #in-popular-category-"+g).attr("checked",h);a=false};e=function(g,f){c(f.what+" response_data",g).each(function(){var h=c(c(this).text());h.find("label").each(function(){var j=c(this),l=j.find("input").val(),m=j.find("input")[0].id,i=c.trim(j.text()),k;c("#"+m).change(d);k=c('').text(i)})})};c("#categorychecklist").wpList({alt:"",what:"link-category",response:"category-ajax-response",addAfter:e});c('a[href="#categories-all"]').click(function(){deleteUserSetting("cats")});c('a[href="#categories-pop"]').click(function(){setUserSetting("cats","pop")});if("pop"==getUserSetting("cats")){c('a[href="#categories-pop"]').click()}c("#category-add-toggle").click(function(){c(this).parents("div:first").toggleClass("wp-hidden-children");c('#category-tabs a[href="#categories-all"]').click();c("#newcategory").focus();return false});c(".categorychecklist :checkbox").change(d).filter(":checked").change()}); \ No newline at end of file diff --git a/wp-admin/js/media.dev.js b/wp-admin/js/media.dev.js index 7c6f4d27..92749dae 100644 --- a/wp-admin/js/media.dev.js +++ b/wp-admin/js/media.dev.js @@ -31,11 +31,10 @@ var findPosts; _ajax_nonce: $('#_ajax_nonce').val() }; - if ( $('#find-posts-pages').is(':checked') ) { - post['pages'] = 1; - } else { - post['posts'] = 1; - } + var selectedItem; + $("input[@name='itemSelect[]']:checked").each(function() { selectedItem = $(this).val() }); + post['post_type'] = selectedItem; + $.ajax({ type : 'POST', url : ajaxurl, diff --git a/wp-admin/js/media.js b/wp-admin/js/media.js index 4818f81b..4d338a41 100644 --- a/wp-admin/js/media.js +++ b/wp-admin/js/media.js @@ -1 +1 @@ -var findPosts;(function(a){findPosts={open:function(d,c){var b=document.documentElement.scrollTop||a(document).scrollTop();if(d&&c){a("#affected").attr("name",d).val(c)}a("#find-posts").show().draggable({handle:"#find-posts-head"}).css({top:b+50+"px",left:"50%",marginLeft:"-250px"});a("#find-posts-input").focus().keyup(function(f){if(f.which==27){findPosts.close()}});return false},close:function(){a("#find-posts-response").html("");a("#find-posts").draggable("destroy").hide()},send:function(){var b={ps:a("#find-posts-input").val(),action:"find_posts",_ajax_nonce:a("#_ajax_nonce").val()};if(a("#find-posts-pages").is(":checked")){b.pages=1}else{b.posts=1}a.ajax({type:"POST",url:ajaxurl,data:b,success:function(c){findPosts.show(c)},error:function(c){findPosts.error(c)}})},show:function(b){if(typeof(b)=="string"){this.error({responseText:b});return}var c=wpAjax.parseAjaxResponse(b);if(c.errors){this.error({responseText:wpAjax.broken})}c=c.responses[0];a("#find-posts-response").html(c.data)},error:function(b){var c=b.statusText;if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#find-posts-response").html(c)}}};a(document).ready(function(){a("#find-posts-submit").click(function(b){if(""==a("#find-posts-response").html()){b.preventDefault()}});a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){if(a(this).val()=="attach"){b.preventDefault();findPosts.open()}})})})})(jQuery); \ No newline at end of file +var findPosts;(function(a){findPosts={open:function(d,c){var b=document.documentElement.scrollTop||a(document).scrollTop();if(d&&c){a("#affected").attr("name",d).val(c)}a("#find-posts").show().draggable({handle:"#find-posts-head"}).css({top:b+50+"px",left:"50%",marginLeft:"-250px"});a("#find-posts-input").focus().keyup(function(f){if(f.which==27){findPosts.close()}});return false},close:function(){a("#find-posts-response").html("");a("#find-posts").draggable("destroy").hide()},send:function(){var b={ps:a("#find-posts-input").val(),action:"find_posts",_ajax_nonce:a("#_ajax_nonce").val()};var c;a("input[@name='itemSelect[]']:checked").each(function(){c=a(this).val()});b.post_type=c;a.ajax({type:"POST",url:ajaxurl,data:b,success:function(d){findPosts.show(d)},error:function(d){findPosts.error(d)}})},show:function(b){if(typeof(b)=="string"){this.error({responseText:b});return}var c=wpAjax.parseAjaxResponse(b);if(c.errors){this.error({responseText:wpAjax.broken})}c=c.responses[0];a("#find-posts-response").html(c.data)},error:function(b){var c=b.statusText;if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#find-posts-response").html(c)}}};a(document).ready(function(){a("#find-posts-submit").click(function(b){if(""==a("#find-posts-response").html()){b.preventDefault()}});a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){if(a(this).val()=="attach"){b.preventDefault();findPosts.open()}})})})})(jQuery); \ No newline at end of file diff --git a/wp-admin/js/nav-menu.dev.js b/wp-admin/js/nav-menu.dev.js new file mode 100644 index 00000000..2df0a8d3 --- /dev/null +++ b/wp-admin/js/nav-menu.dev.js @@ -0,0 +1,953 @@ +/** + * WordPress Administration Navigation Menu + * Interface JS functions + * + * @version 2.0.0 + * + * @package WordPress + * @subpackage Administration + */ + +var wpNavMenu; + +(function($) { + + var api = wpNavMenu = { + + options : { + menuItemDepthPerLevel : 30, // Do not use directly. Use depthToPx and pxToDepth instead. + globalMaxDepth : 11 + }, + + menuList : undefined, // Set in init. + targetList : undefined, // Set in init. + menusChanged : false, + isRTL: !! ( 'undefined' != typeof isRtl && isRtl ), + negateIfRTL: ( 'undefined' != typeof isRtl && isRtl ) ? -1 : 1, + + // Functions that run on init. + init : function() { + api.menuList = $('#menu-to-edit'); + api.targetList = api.menuList; + + this.jQueryExtensions(); + + this.attachMenuEditListeners(); + + this.setupInputWithDefaultTitle(); + this.attachQuickSearchListeners(); + this.attachThemeLocationsListeners(); + + this.attachTabsPanelListeners(); + + this.attachUnsavedChangesListener(); + + if( api.menuList.length ) // If no menu, we're in the + tab. + this.initSortables(); + + this.initToggles(); + + this.initTabManager(); + }, + + jQueryExtensions : function() { + // jQuery extensions + $.fn.extend({ + menuItemDepth : function() { + var margin = api.isRTL ? this.eq(0).css('margin-right') : this.eq(0).css('margin-left'); + return api.pxToDepth( margin && -1 != margin.indexOf('px') ? margin.slice(0, -2) : 0 ); + }, + updateDepthClass : function(current, prev) { + return this.each(function(){ + var t = $(this); + prev = prev || t.menuItemDepth(); + $(this).removeClass('menu-item-depth-'+ prev ) + .addClass('menu-item-depth-'+ current ); + }); + }, + shiftDepthClass : function(change) { + return this.each(function(){ + var t = $(this), + depth = t.menuItemDepth(); + $(this).removeClass('menu-item-depth-'+ depth ) + .addClass('menu-item-depth-'+ (depth + change) ); + }); + }, + childMenuItems : function() { + var result = $(); + this.each(function(){ + var t = $(this), depth = t.menuItemDepth(), next = t.next(); + while( next.length && next.menuItemDepth() > depth ) { + result = result.add( next ); + next = next.next(); + } + }); + return result; + }, + updateParentMenuItemDBId : function() { + return this.each(function(){ + var item = $(this), + input = item.find('.menu-item-data-parent-id'), + depth = item.menuItemDepth(), + parent = item.prev(); + + if( depth == 0 ) { // Item is on the top level, has no parent + input.val(0); + } else { // Find the parent item, and retrieve its object id. + while( ! parent[0] || ! parent[0].className || -1 == parent[0].className.indexOf('menu-item') || ( parent.menuItemDepth() != depth - 1 ) ) + parent = parent.prev(); + input.val( parent.find('.menu-item-data-db-id').val() ); + } + }); + }, + hideAdvancedMenuItemFields : function() { + return this.each(function(){ + var that = $(this); + $('.hide-column-tog').not(':checked').each(function(){ + that.find('.field-' + $(this).val() ).addClass('hidden-field'); + }); + }); + }, + /** + * Adds selected menu items to the menu. + * + * @param jQuery metabox The metabox jQuery object. + */ + addSelectedToMenu : function(processMethod) { + if ( 0 == $('#menu-to-edit').length ) { + return false; + } + + return this.each(function() { + var t = $(this), menuItems = {}, + checkboxes = t.find('.tabs-panel-active .categorychecklist li input:checked'), + re = new RegExp('menu-item\\[(\[^\\]\]*)'); + + processMethod = processMethod || api.addMenuItemToBottom; + + // If no items are checked, bail. + if ( !checkboxes.length ) + return false; + + // Show the ajax spinner + t.find('img.waiting').show(); + + // Retrieve menu item data + $(checkboxes).each(function(){ + var t = $(this), + listItemDBIDMatch = re.exec( t.attr('name') ), + listItemDBID = 'undefined' == typeof listItemDBIDMatch[1] ? 0 : parseInt(listItemDBIDMatch[1], 10); + if ( this.className && -1 != this.className.indexOf('add-to-top') ) + processMethod = api.addMenuItemToTop; + menuItems[listItemDBID] = t.closest('li').getItemData( 'add-menu-item', listItemDBID ); + }); + + // Add the items + api.addItemToMenu(menuItems, processMethod, function(){ + // Deselect the items and hide the ajax spinner + checkboxes.removeAttr('checked'); + t.find('img.waiting').hide(); + }); + }); + }, + getItemData : function( itemType, id ) { + itemType = itemType || 'menu-item'; + + var itemData = {}, i, + fields = [ + 'menu-item-db-id', + 'menu-item-object-id', + 'menu-item-object', + 'menu-item-parent-id', + 'menu-item-position', + 'menu-item-type', + 'menu-item-title', + 'menu-item-url', + 'menu-item-description', + 'menu-item-attr-title', + 'menu-item-target', + 'menu-item-classes', + 'menu-item-xfn' + ]; + + if( !id && itemType == 'menu-item' ) { + id = this.find('.menu-item-data-db-id').val(); + } + + if( !id ) return itemData; + + this.find('input').each(function() { + var field; + i = fields.length; + while ( i-- ) { + if( itemType == 'menu-item' ) + field = fields[i] + '[' + id + ']'; + else if( itemType == 'add-menu-item' ) + field = 'menu-item[' + id + '][' + fields[i] + ']'; + + if ( + this.name && + field == this.name + ) { + itemData[fields[i]] = this.value; + } + } + }); + + return itemData; + }, + setItemData : function( itemData, itemType, id ) { // Can take a type, such as 'menu-item', or an id. + itemType = itemType || 'menu-item'; + + if( !id && itemType == 'menu-item' ) { + id = $('.menu-item-data-db-id', this).val(); + } + + if( !id ) return this; + + this.find('input').each(function() { + var t = $(this), field; + $.each( itemData, function( attr, val ) { + if( itemType == 'menu-item' ) + field = attr + '[' + id + ']'; + else if( itemType == 'add-menu-item' ) + field = 'menu-item[' + id + '][' + attr + ']'; + + if ( field == t.attr('name') ) { + t.val( val ); + } + }); + }); + return this; + } + }); + }, + + initToggles : function() { + // init postboxes + postboxes.add_postbox_toggles('nav-menus'); + + // adjust columns functions for menus UI + columns.useCheckboxesForHidden(); + columns.checked = function(field) { + $('.field-' + field).removeClass('hidden-field'); + } + columns.unchecked = function(field) { + $('.field-' + field).addClass('hidden-field'); + } + // hide fields + api.menuList.hideAdvancedMenuItemFields(); + }, + + initSortables : function() { + var currentDepth = 0, originalDepth, minDepth, maxDepth, + prev, next, prevBottom, nextThreshold, helperHeight, transport, + menuEdge = api.menuList.offset().left, + body = $('body'), maxChildDepth, + menuMaxDepth = initialMenuMaxDepth(); + + // Use the right edge if RTL. + menuEdge += api.isRTL ? api.menuList.width() : 0; + + api.menuList.sortable({ + handle: '.menu-item-handle', + placeholder: 'sortable-placeholder', + start: function(e, ui) { + var height, width, parent, children, tempHolder; + + // handle placement for rtl orientation + if ( api.isRTL ) + ui.item[0].style.right = 'auto'; + + transport = ui.item.children('.menu-item-transport'); + + // Set depths. currentDepth must be set before children are located. + originalDepth = ui.item.menuItemDepth(); + updateCurrentDepth(ui, originalDepth); + + // Attach child elements to parent + // Skip the placeholder + parent = ( ui.item.next()[0] == ui.placeholder[0] ) ? ui.item.next() : ui.item; + children = parent.childMenuItems(); + transport.append( children ); + + // Update the height of the placeholder to match the moving item. + height = transport.outerHeight(); + // If there are children, account for distance between top of children and parent + height += ( height > 0 ) ? (ui.placeholder.css('margin-top').slice(0, -2) * 1) : 0; + height += ui.helper.outerHeight(); + helperHeight = height; + height -= 2; // Subtract 2 for borders + ui.placeholder.height(height); + + // Update the width of the placeholder to match the moving item. + maxChildDepth = originalDepth; + children.each(function(){ + var depth = $(this).menuItemDepth(); + maxChildDepth = (depth > maxChildDepth) ? depth : maxChildDepth; + }); + width = ui.helper.find('.menu-item-handle').outerWidth(); // Get original width + width += api.depthToPx(maxChildDepth - originalDepth); // Account for children + width -= 2; // Subtract 2 for borders + ui.placeholder.width(width); + + // Update the list of menu items. + tempHolder = ui.placeholder.next(); + tempHolder.css( 'margin-top', helperHeight + 'px' ); // Set the margin to absorb the placeholder + ui.placeholder.detach(); // detach or jQuery UI will think the placeholder is a menu item + $(this).sortable( "refresh" ); // The children aren't sortable. We should let jQ UI know. + ui.item.after( ui.placeholder ); // reattach the placeholder. + tempHolder.css('margin-top', 0); // reset the margin + + // Now that the element is complete, we can update... + updateSharedVars(ui); + }, + stop: function(e, ui) { + var children, depthChange = currentDepth - originalDepth; + + // Return child elements to the list + children = transport.children().insertAfter(ui.item); + + // Update depth classes + if( depthChange != 0 ) { + ui.item.updateDepthClass( currentDepth ); + children.shiftDepthClass( depthChange ); + updateMenuMaxDepth( depthChange ); + } + // Register a change + api.registerChange(); + // Update the item data. + ui.item.updateParentMenuItemDBId(); + + // address sortable's incorrectly-calculated top in opera + ui.item[0].style.top = 0; + + // handle drop placement for rtl orientation + if ( api.isRTL ) { + ui.item[0].style.left = 'auto'; + ui.item[0].style.right = 0; + } + + // The width of the tab bar might have changed. Just in case. + api.refreshMenuTabs( true ); + }, + change: function(e, ui) { + // Make sure the placeholder is inside the menu. + // Otherwise fix it, or we're in trouble. + if( ! ui.placeholder.parent().hasClass('menu') ) + (prev.length) ? prev.after( ui.placeholder ) : api.menuList.prepend( ui.placeholder ); + + updateSharedVars(ui); + }, + sort: function(e, ui) { + var offset = ui.helper.offset(), + edge = api.isRTL ? offset.left + ui.helper.width() : offset.left, + depth = api.negateIfRTL * api.pxToDepth( edge - menuEdge ); + // Check and correct if depth is not within range. + // Also, if the dragged element is dragged upwards over + // an item, shift the placeholder to a child position. + if ( depth > maxDepth || offset.top < prevBottom ) depth = maxDepth; + else if ( depth < minDepth ) depth = minDepth; + + if( depth != currentDepth ) + updateCurrentDepth(ui, depth); + + // If we overlap the next element, manually shift downwards + if( nextThreshold && offset.top + helperHeight > nextThreshold ) { + next.after( ui.placeholder ); + updateSharedVars( ui ); + $(this).sortable( "refreshPositions" ); + } + } + }); + + function updateSharedVars(ui) { + var depth; + + prev = ui.placeholder.prev(); + next = ui.placeholder.next(); + + // Make sure we don't select the moving item. + if( prev[0] == ui.item[0] ) prev = prev.prev(); + if( next[0] == ui.item[0] ) next = next.next(); + + prevBottom = (prev.length) ? prev.offset().top + prev.height() : 0; + nextThreshold = (next.length) ? next.offset().top + next.height() / 3 : 0; + minDepth = (next.length) ? next.menuItemDepth() : 0; + + if( prev.length ) + maxDepth = ( (depth = prev.menuItemDepth() + 1) > api.options.globalMaxDepth ) ? api.options.globalMaxDepth : depth; + else + maxDepth = 0; + } + + function updateCurrentDepth(ui, depth) { + ui.placeholder.updateDepthClass( depth, currentDepth ); + currentDepth = depth; + } + + function initialMenuMaxDepth() { + if( ! body[0].className ) return 0; + var match = body[0].className.match(/menu-max-depth-(\d+)/); + return match && match[1] ? parseInt(match[1]) : 0; + } + + function updateMenuMaxDepth( depthChange ) { + var depth, newDepth = menuMaxDepth; + if ( depthChange === 0 ) { + return; + } else if ( depthChange > 0 ) { + depth = maxChildDepth + depthChange; + if( depth > menuMaxDepth ) + newDepth = depth; + } else if ( depthChange < 0 && maxChildDepth == menuMaxDepth ) { + while( ! $('.menu-item-depth-' + newDepth, api.menuList).length && newDepth > 0 ) + newDepth--; + } + // Update the depth class. + body.removeClass( 'menu-max-depth-' + menuMaxDepth ).addClass( 'menu-max-depth-' + newDepth ); + menuMaxDepth = newDepth; + } + }, + + attachMenuEditListeners : function() { + var that = this; + $('#update-nav-menu').bind('click', function(e) { + if ( e.target && e.target.className ) { + if ( -1 != e.target.className.indexOf('item-edit') ) { + return that.eventOnClickEditLink(e.target); + } else if ( -1 != e.target.className.indexOf('menu-save') ) { + return that.eventOnClickMenuSave(e.target); + } else if ( -1 != e.target.className.indexOf('menu-delete') ) { + return that.eventOnClickMenuDelete(e.target); + } else if ( -1 != e.target.className.indexOf('item-delete') ) { + return that.eventOnClickMenuItemDelete(e.target); + } else if ( -1 != e.target.className.indexOf('item-cancel') ) { + return that.eventOnClickCancelLink(e.target); + } + } + }); + }, + + /** + * An interface for managing default values for input elements + * that is both JS and accessibility-friendly. + * + * Input elements that add the class 'input-with-default-title' + * will have their values set to the provided HTML title when empty. + */ + setupInputWithDefaultTitle : function() { + var name = 'input-with-default-title'; + + $('.' + name).each( function(){ + var $t = $(this), title = $t.attr('title'), val = $t.val(); + $t.data( name, title ); + + if( '' == val ) $t.val( title ); + else if ( title == val ) return; + else $t.removeClass( name ); + }).focus( function(){ + var $t = $(this); + if( $t.val() == $t.data(name) ) + $t.val('').removeClass( name ); + }).blur( function(){ + var $t = $(this); + if( '' == $t.val() ) + $t.addClass( name ).val( $t.data(name) ); + }); + }, + + attachThemeLocationsListeners : function() { + var loc = $('#nav-menu-theme-locations'), params = {}; + params['action'] = 'menu-locations-save'; + params['menu-settings-column-nonce'] = $('#menu-settings-column-nonce').val(); + loc.find('input[type=submit]').click(function() { + loc.find('select').each(function() { + params[this.name] = $(this).val(); + }); + loc.find('.waiting').show(); + $.post( ajaxurl, params, function(r) { + loc.find('.waiting').hide(); + }); + return false; + }); + }, + + attachQuickSearchListeners : function() { + var searchTimer; + + $('.quick-search').keypress(function(e){ + var t = $(this); + + if( 13 == e.which ) { + api.updateQuickSearchResults( t ); + return false; + } + + if( searchTimer ) clearTimeout(searchTimer); + + searchTimer = setTimeout(function(){ + api.updateQuickSearchResults( t ); + }, 400); + }).attr('autocomplete','off'); + }, + + updateQuickSearchResults : function(input) { + var panel, params, + minSearchLength = 2, + q = input.val(); + + if( q.length < minSearchLength ) return; + + panel = input.parents('.tabs-panel'); + params = { + 'action': 'menu-quick-search', + 'response-format': 'markup', + 'menu': $('#menu').val(), + 'menu-settings-column-nonce': $('#menu-settings-column-nonce').val(), + 'q': q, + 'type': input.attr('name') + }; + + $('img.waiting', panel).show(); + + $.post( ajaxurl, params, function(menuMarkup) { + api.processQuickSearchQueryResponse(menuMarkup, params, panel); + }); + }, + + addCustomLink : function( processMethod ) { + var url = $('#custom-menu-item-url').val(), + label = $('#custom-menu-item-name').val(); + + processMethod = processMethod || api.addMenuItemToBottom; + + if ( '' == url || 'http://' == url ) + return false; + + // Show the ajax spinner + $('.customlinkdiv img.waiting').show(); + this.addLinkToMenu( url, label, processMethod, function() { + // Remove the ajax spinner + $('.customlinkdiv img.waiting').hide(); + // Set custom link form back to defaults + $('#custom-menu-item-name').val('').blur(); + $('#custom-menu-item-url').val('http://'); + }); + }, + + addLinkToMenu : function(url, label, processMethod, callback) { + processMethod = processMethod || api.addMenuItemToBottom; + callback = callback || function(){}; + + api.addItemToMenu({ + '-1': { + 'menu-item-type': 'custom', + 'menu-item-url': url, + 'menu-item-title': label + } + }, processMethod, callback); + }, + + addItemToMenu : function(menuItem, processMethod, callback) { + var menu = $('#menu').val(), + nonce = $('#menu-settings-column-nonce').val(); + + processMethod = processMethod || function(){}; + callback = callback || function(){}; + + params = { + 'action': 'add-menu-item', + 'menu': menu, + 'menu-settings-column-nonce': nonce, + 'menu-item': menuItem + }; + + $.post( ajaxurl, params, function(menuMarkup) { + var ins = $('#menu-instructions'); + processMethod(menuMarkup, params); + if( ! ins.hasClass('menu-instructions-inactive') && ins.siblings().length ) + ins.addClass('menu-instructions-inactive'); + callback(); + }); + }, + + /** + * Process the add menu item request response into menu list item. + * + * @param string menuMarkup The text server response of menu item markup. + * @param object req The request arguments. + */ + addMenuItemToBottom : function( menuMarkup, req ) { + $(menuMarkup).hideAdvancedMenuItemFields().appendTo( api.targetList ); + }, + + addMenuItemToTop : function( menuMarkup, req ) { + $(menuMarkup).hideAdvancedMenuItemFields().prependTo( api.targetList ); + }, + + attachUnsavedChangesListener : function() { + $('#menu-management input, #menu-management select, #menu-management, #menu-management textarea').change(function(){ + api.registerChange(); + }); + + if ( 0 != $('#menu-to-edit').length ) { + window.onbeforeunload = function(){ + if ( api.menusChanged ) + return navMenuL10n.saveAlert; + }; + } else { + // Make the post boxes read-only, as they can't be used yet + $('#menu-settings-column').find('input,select').attr('disabled', 'disabled').end().find('a').attr('href', '#').unbind('click'); + } + }, + + registerChange : function() { + api.menusChanged = true; + }, + + attachTabsPanelListeners : function() { + $('#menu-settings-column').bind('click', function(e) { + var selectAreaMatch, panelId, wrapper, items, + target = $(e.target); + + if ( target.hasClass('nav-tab-link') ) { + panelId = /#(.*)$/.exec(e.target.href); + if ( panelId && panelId[1] ) + panelId = panelId[1] + else + return false; + + wrapper = target.parents('.inside').first(); + + // upon changing tabs, we want to uncheck all checkboxes + $('input', wrapper).removeAttr('checked'); + + $('.tabs-panel-active', wrapper).removeClass('tabs-panel-active').addClass('tabs-panel-inactive'); + $('#' + panelId, wrapper).removeClass('tabs-panel-inactive').addClass('tabs-panel-active'); + + $('.tabs', wrapper).removeClass('tabs'); + target.parent().addClass('tabs'); + + // select the search bar + $('.quick-search', wrapper).focus(); + + return false; + } else if ( target.hasClass('select-all') ) { + selectAreaMatch = /#(.*)$/.exec(e.target.href); + if ( selectAreaMatch && selectAreaMatch[1] ) { + items = $('#' + selectAreaMatch[1] + ' .tabs-panel-active .menu-item-title input'); + if( items.length === items.filter(':checked').length ) + items.removeAttr('checked'); + else + items.attr('checked', 'checked'); + return false; + } + } else if ( target.hasClass('submit-add-to-menu') ) { + api.registerChange(); + + if ( e.target.id && 'submit-customlinkdiv' == e.target.id ) + api.addCustomLink( api.addMenuItemToBottom ); + else if ( e.target.id && -1 != e.target.id.indexOf('submit-') ) + $('#' + e.target.id.replace(/submit-/, '')).addSelectedToMenu( api.addMenuItemToBottom ); + return false; + } else if ( target.hasClass('page-numbers') ) { + $.post( ajaxurl, e.target.href.replace(/.*\?/, '').replace(/action=([^&]*)/, '') + '&action=menu-get-metabox', + function( resp ) { + if ( -1 == resp.indexOf('replace-id') ) + return; + + var metaBoxData = $.parseJSON(resp), + toReplace = document.getElementById(metaBoxData['replace-id']), + placeholder = document.createElement('div'), + wrap = document.createElement('div'); + + if ( ! metaBoxData['markup'] || ! toReplace ) + return; + + wrap.innerHTML = metaBoxData['markup'] ? metaBoxData['markup'] : ''; + + toReplace.parentNode.insertBefore( placeholder, toReplace ); + placeholder.parentNode.removeChild( toReplace ); + + placeholder.parentNode.insertBefore( wrap, placeholder ); + + placeholder.parentNode.removeChild( placeholder ); + + } + ); + + return false; + } + }); + }, + + initTabManager : function() { + var fixed = $('.nav-tabs-wrapper'), + fluid = fixed.children('.nav-tabs'), + active = fluid.children('.nav-tab-active'), + tabs = fluid.children('.nav-tab'), + tabsWidth = 0, + fixedRight, fixedLeft, + arrowLeft, arrowRight, resizeTimer, css = {}, + marginFluid = api.isRTL ? 'margin-right' : 'margin-left', + marginFixed = api.isRTL ? 'margin-left' : 'margin-right', + msPerPx = 2; + + /** + * Refreshes the menu tabs. + * Will show and hide arrows where necessary. + * Scrolls to the active tab by default. + * + * @param savePosition {boolean} Optional. Prevents scrolling so + * that the current position is maintained. Default false. + **/ + api.refreshMenuTabs = function( savePosition ) { + var fixedWidth = fixed.width(), + margin = 0, css = {}; + fixedLeft = fixed.offset().left; + fixedRight = fixedLeft + fixedWidth; + + if( !savePosition ) + active.makeTabVisible(); + + // Prevent space from building up next to the last tab if there's more to show + if( tabs.last().isTabVisible() ) { + margin = fixed.width() - tabsWidth; + margin = margin > 0 ? 0 : margin; + css[marginFluid] = margin + 'px'; + fluid.animate( css, 100, "linear" ); + } + + // Show the arrows only when necessary + if( fixedWidth > tabsWidth ) + arrowLeft.add( arrowRight ).hide(); + else + arrowLeft.add( arrowRight ).show(); + } + + $.fn.extend({ + makeTabVisible : function() { + var t = this.eq(0), left, right, css = {}, shift = 0; + + if( ! t.length ) return this; + + left = t.offset().left; + right = left + t.outerWidth(); + + if( right > fixedRight ) + shift = fixedRight - right; + else if ( left < fixedLeft ) + shift = fixedLeft - left; + + if( ! shift ) return this; + + css[marginFluid] = "+=" + api.negateIfRTL * shift + 'px'; + fluid.animate( css, Math.abs( shift ) * msPerPx, "linear" ); + return this; + }, + isTabVisible : function() { + var t = this.eq(0), + left = t.offset().left, + right = left + t.outerWidth(); + return ( right <= fixedRight && left >= fixedLeft ) ? true : false; + } + }); + + // Find the width of all tabs + tabs.each(function(){ + tabsWidth += $(this).outerWidth(true); + }); + + // Set up fixed margin for overflow, unset padding + css['padding'] = 0; + css[marginFixed] = (-1 * tabsWidth) + 'px'; + fluid.css( css ); + + // Build tab navigation + arrowLeft = $(''); + arrowRight = $(''); + // Attach to the document + fixed.wrap(' + + + diff --git a/wp-admin/network.php b/wp-admin/network.php new file mode 100644 index 00000000..a2951641 --- /dev/null +++ b/wp-admin/network.php @@ -0,0 +1,523 @@ +tables( 'ms_global' ) as $table => $prefixed_table ) + $wpdb->$table = $prefixed_table; + +/** + * Check for an existing network. + * + * @since 3.0.0 + * @return Whether a network exists. + */ +function network_domain_check() { + global $wpdb; + if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) ) + return $wpdb->get_var( "SELECT domain FROM $wpdb->site ORDER BY id ASC LIMIT 1" ); + return false; +} + +/** + * Allow subdomain install + * + * @since 3.0.0 + * @return bool Whether subdomain install is allowed + */ +function allow_subdomain_install() { + $domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'siteurl' ) ); + if( false !== strpos( $domain, '/' ) || 'localhost' == $domain || preg_match( '|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|', $domain ) ) + return false; + + return true; +} +/** + * Allow subdirectory install + * + * @since 3.0.0 + * @return bool Whether subdirectory install is allowed + */ +function allow_subdirectory_install() { + global $wpdb; + if ( apply_filters( 'allow_subdirectory_install', false ) ) + return true; + + if ( defined( 'ALLOW_SUBDIRECTORY_INSTALL' ) && ALLOW_SUBDIRECTORY_INSTALL ) + return true; + + $post = $wpdb->get_row( "SELECT ID FROM $wpdb->posts WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'" ); + if ( empty( $post ) ) + return true; + + return false; +} +/** + * Get base domain of network. + * + * @since 3.0.0 + * @return string Base domain. + */ +function get_clean_basedomain() { + if ( $existing_domain = network_domain_check() ) + return $existing_domain; + $domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) ); + if ( $slash = strpos( $domain, '/' ) ) + $domain = substr( $domain, 0, $slash ); + return $domain; +} + +if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) ) + wp_die( __( 'You must define the WP_ALLOW_MULTISITE constant as true in your wp-config.php file to allow creation of a Network.' ) ); + +$title = __( 'Create a Network of WordPress Sites' ); +$parent_file = 'tools.php'; + +add_contextual_help($current_screen, + '

    ' . __('This screen allows you to configure a network as having subdomains (site1.example.com) or subdirectories (example.com/site1). Subdomains require wildcard subdomains to be enabled in Apache and DNS records, if your host allows it.') . '

    ' . + '

    ' . __('Choose subdomains or subdirectories; this can only be switched afterwards by reconfiguring your install. Fill out the network details, and click install. If this does not work, you may have to add a wildcard DNS record (for subdomains) or change to another setting in Permalinks (for subdirectories).') . '

    ' . + '

    ' . __('The next screen for Network will give you individually-generated lines of code to add to your wp-config.php and .htaccess files. Make sure the settings of your FTP client make files starting with a dot visible, so that you can find .htaccess; you may have to create this file if it really is not there. Make backup copies of those two files.') . '

    ' . + '

    ' . __('Add a blogs.dir directory under /wp-content and add the designated lines of code to wp-config.php (just before /*...stop editing...*/) and .htaccess (replacing the existing WordPress rules).') . '

    ' . + '

    ' . __('Refreshing your browser will take you to a screen with an archive of those added lines of code. A set of six links under Super Admin will appear at the top of the main left navigation menu. The multisite network is now enabled.') . '

    ' . + '

    ' . __('The choice of subdirectory sites is disabled if this setup is more than a month old because of permalink problems with “/blog/” from the main site. This disabling will be addressed soon in a future version.') . '

    ' . + '

    ' . __('For more information:') . '

    ' . + '

    ' . __('General Network Creation Documentation') . '

    ' . + '

    ' . __('Tools > Network Documentation') . '

    ' . + '

    ' . __('Support Forums') . '

    ' +); + +include( './admin-header.php' ); +?> +
    + +

    + + Network + * should not be a sudden "Welcome to a new install process! Fill this out and click here." See also contextual help todo. + * + * @since 3.0.0 + */ +function network_step1( $errors = false ) { + global $is_apache; + + if ( get_option( 'siteurl' ) != get_option( 'home' ) ) { + echo '

    ' . __('Error:') . ' ' . sprintf( __( 'Your WordPress address must match your Site address before creating a Network. See General Settings.' ), esc_url( admin_url( 'options-general.php' ) ) ) . '

    '; + echo '
    '; + include ('./admin-footer.php' ); + die(); + } + + $active_plugins = get_option( 'active_plugins' ); + if ( ! empty( $active_plugins ) ) { + echo '

    ' . __('Warning:') . ' ' . sprintf( __( 'Please deactivate your plugins before enabling the Network feature.' ), admin_url( 'plugins.php?plugin_status=active' ) ) . '

    ' . __( 'Once the network is created, you may reactivate your plugins.' ) . '

    '; + echo '
    '; + include( './admin-footer.php' ); + die(); + } + + $hostname = get_clean_basedomain(); + $has_ports = strstr( $hostname, ':' ); + if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ) ) ) ) { + echo '

    ' . __( 'Error:') . ' ' . __( 'You cannot install a network of sites with your server address.' ) . '

    '; + echo '

    ' . sprintf( __( 'You cannot use port numbers such as %s.' ), $has_ports ) . '

    '; + echo '' . __( 'Return to Dashboard' ) . ''; + echo '
    '; + include( './admin-footer.php' ); + die(); + } + + echo '
    '; + + wp_nonce_field( 'install-network-1' ); + + $error_codes = array(); + if ( is_wp_error( $errors ) ) { + echo '

    ' . __( 'ERROR: The network could not be created.' ) . '

    '; + foreach ( $errors->get_error_messages() as $error ) + echo "

    $error

    "; + echo '
    '; + $error_codes = $errors->get_error_codes(); + } + + if ( WP_CONTENT_DIR != ABSPATH . 'wp-content' ) + echo '

    ' . __('Warning!') . ' ' . __( 'Networks may not be fully compatible with custom wp-content directories.' ) . '

    '; + + $site_name = ( ! empty( $_POST['sitename'] ) && ! in_array( 'empty_sitename', $error_codes ) ) ? $_POST['sitename'] : sprintf( _x('%s Sites', 'Default network name' ), get_option( 'blogname' ) ); + $admin_email = ( ! empty( $_POST['email'] ) && ! in_array( 'invalid_email', $error_codes ) ) ? $_POST['email'] : get_option( 'admin_email' ); + ?> +

    +

    +

    ' . __( 'Note:' ) . ' ' . __( 'Please make sure the Apache mod_rewrite module is installed as it will be used at the end of this installation.' ) . '

    '; + elseif ( $is_apache ) + echo '

    ' . __( 'Warning!' ) . ' ' . __( 'It looks like the Apache mod_rewrite module is not installed.' ) . '

    '; + if ( $got_mod_rewrite || $is_apache ) // Protect against mod_rewrite mimicry (but ! Apache) + echo '

    ' . __( 'If mod_rewrite is disabled, ask your administrator to enable that module, or look at the Apache documentation or elsewhere for help setting it up.' ) . '

    '; + } + + if ( allow_subdomain_install() && allow_subdirectory_install() ) : ?> +

    +

    You cannot change this later.' ); ?>

    +

    + + + + + + + + + + +
    site1.%1$s and site2.%1$s', 'subdomain examples' ), $hostname ); ?>
    %1$s/site1 and %1$s/site2', 'subdirectory examples' ), $hostname ); ?>
    + + +

    +

    %1$s before enabling the network feature. It will still be possible to visit your site using the www prefix with an address like %2$s but any links will not have the www prefix.' ), substr( $hostname, 4 ), $hostname ); ?> + + + + + +
    + %s.' ), $hostname ); ?> +
    + + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    localhost, the sites in your WordPress network must use sub-directories. Consider using localhost.localdomain if you wish to use sub-domains.' ); + // Uh oh: + if ( !allow_subdirectory_install() ) + echo ' ' . __( 'Warning!' ) . ' ' . __( 'The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.' ) . ''; + ?>
    ' . __( 'Warning!' ) . ' ' . __( 'The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.' ) . ''; + ?>
    ' . __( 'The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.' ) . ''; + ?>
    + %s.' ), $hostname ); ?> +
    + +
    +
    + +
    +
    +

    ' />

    +
    + ' . $errors->get_error_message() . '
    '; + + if ( $_POST ) { + $subdomain_install = allow_subdomain_install() ? ( allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true ) : false; + } else { + if ( is_multisite() ) { + $subdomain_install = is_subdomain_install(); +?> +

    +get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" ); +?> +

    +

    + +

    +

    +

    Caution: We recommend you back up your existing wp-config.php file.' ); + else + _e( 'Caution: We recommend you back up your existing wp-config.php and .htaccess files.' ); + ?>

    + +
      +
    1. blogs.dir directory in %s. This directory is used to stored uploaded media for your additional sites and must be writeable by the web server.' ), WP_CONTENT_DIR ); + if ( WP_CONTENT_DIR != ABSPATH . 'wp-content' ) + echo ' ' . __('Warning:') . ' ' . __( 'Networks may not be fully compatible with custom wp-content directories.' ) . '

    2. +
    3. wp-config.php file in %s above the line reading /* That’s all, stop editing! Happy blogging. */:' ), ABSPATH ); ?>

      + + '', 'SECURE_AUTH_KEY' => '', 'LOGGED_IN_KEY' => '', 'NONCE_KEY' => '', 'AUTH_SALT' => '', 'SECURE_AUTH_SALT' => '', 'LOGGED_IN_SALT' => '', 'NONCE_SALT' => '' ); + foreach ( $keys_salts as $c => $v ) { + if ( defined( $c ) ) + unset( $keys_salts[ $c ] ); + } + if ( ! empty( $keys_salts ) ) { + $from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); + if ( is_wp_error( $from_api ) ) { + foreach ( $keys_salts as $c => $v ) { + $keys_salts[ $c ] = wp_generate_password( 64, true, true ); + } + } else { + $from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) ); + foreach ( $keys_salts as $c => $v ) { + $keys_salts[ $c ] = substr( array_shift( $from_api ), 28, 64 ); + } + } + $num_keys_salts = count( $keys_salts ); +?> +

      wp-config.php file.', 'These unique authentication keys are also missing from your wp-config.php file.', $num_keys_salts ); ?>

      + + +
    4. + + + + + + + + + + + + + + + + + + + + + + + + + + + + +'; + } else { + $web_config_file = +' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +'; + } + ?> +
    5. web.config file in %s, replacing other WordPress rules:' ), ABSPATH ); ?>

      +
    6. +
    + + +
  • .htaccess file in %s, replacing other WordPress rules:' ), ABSPATH ); ?>

    +
  • + + + +

    +get_error_codes() ) && 'no_wildcard_dns' == $result->get_error_code() ) + network_step2( $result ); + else + network_step1( $result ); + } else { + network_step2(); + } + } else { + network_step2(); + } +} elseif ( is_multisite() || network_domain_check() ) { + network_step2(); +} else { + network_step1(); +} +?> +
    + + diff --git a/wp-admin/options-discussion.php b/wp-admin/options-discussion.php index 8093d159..b2110a29 100644 --- a/wp-admin/options-discussion.php +++ b/wp-admin/options-discussion.php @@ -7,15 +7,23 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); -if ( ! current_user_can('manage_options') ) - wp_die(__('You do not have sufficient permissions to manage options for this blog.')); +if ( ! current_user_can( 'manage_options' ) ) + wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); $title = __('Discussion Settings'); $parent_file = 'options-general.php'; -include('admin-header.php'); +add_contextual_help($current_screen, + '

    ' . __('This screen provides many options for controlling the management and display of comments and links to your posts/pages. So many, in fact, they won’t all fit here! :) Use the documentation link below to get information on what each discussion setting does.') . '

    ' . + '

    ' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '

    ' . + '

    ' . __('For more information:') . '

    ' . + '

    ' . __('Discussion Settings Documentation') . '

    ' . + '

    ' . __('Support Forums') . '

    ' +); + +include('./admin-header.php'); ?>
    @@ -31,7 +39,7 @@ include('admin-header.php');
    +
    - + diff --git a/wp-admin/options-writing.php b/wp-admin/options-writing.php index a8979f4e..dc06459d 100644 --- a/wp-admin/options-writing.php +++ b/wp-admin/options-writing.php @@ -7,15 +7,23 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); -if ( ! current_user_can('manage_options') ) - wp_die(__('You do not have sufficient permissions to manage options for this blog.')); +if ( ! current_user_can( 'manage_options' ) ) + wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); $title = __('Writing Settings'); $parent_file = 'options-general.php'; -include('admin-header.php'); +add_contextual_help($current_screen, + '

    ' . __('You can submit content in several different ways; this screen holds the settings for all of them. The top section controls the editor within these administration screens, while the rest control external publishing methods. For more information on any of these methods, use the documentation links below.') . '

    ' . + '

    ' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '

    ' . + '

    ' . __('For more information:') . '

    ' . + '

    ' . __('Writing Settings Documentation') . '

    ' . + '

    ' . __('Support Forums') . '

    ' +); + +include('./admin-header.php'); ?>
    @@ -52,35 +60,21 @@ wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_category', 'o 0, 'name' => 'default_link_category', 'orderby' => 'name', 'selected' => get_option('default_link_category'), 'hierarchical' => true, 'type' => 'link')); +wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_link_category', 'orderby' => 'name', 'selected' => get_option('default_link_category'), 'hierarchical' => true, 'taxonomy' => 'link_category')); ?> -

    -

    - - - - - - - - - - -
    -
    -
    -
    -
    +

    +

    +

    +

    +

    + +

    %s, %s, %s.'), wp_generate_password(8, false), wp_generate_password(8, false), wp_generate_password(8, false)) ?>

    @@ -112,7 +106,31 @@ wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_email_categor + + +

    +

    + + + + + + + + + + +
    +
    +
    +
    +
    +

    @@ -123,9 +141,10 @@ wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_email_categor -

    Update Services because of your blog’s privacy settings.'), 'options-privacy.php'); ?>

    +

    Update Services because of your site’s privacy settings.'), 'options-privacy.php'); ?>

    + diff --git a/wp-admin/options.php b/wp-admin/options.php index 11d6ee05..15f489d3 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -2,59 +2,116 @@ /** * Options Management Administration Panel. * - * Just allows for displaying of options. + * If accessed directly in a browser this page shows a list of all saved options + * along with editable fields for their values. Serialized data is not supported + * and there is no way to remove options via this page. It is not linked to from + * anywhere else in the admin. * - * This isn't referenced or linked to, but will show all of the options and - * allow editing. The issue is that serialized data is not supported to be - * modified. Options can not be removed. + * This file is also the target of the forms in core and custom options pages + * that use the Settings API. In this case it saves the new option values + * and returns the user to their page of origin. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); $title = __('Settings'); $this_file = 'options.php'; $parent_file = 'options-general.php'; -wp_reset_vars(array('action')); +wp_reset_vars(array('action', 'option_page')); + +if ( empty($option_page) ) // This is for back compat and will eventually be removed. + $option_page = 'options'; + +if ( !current_user_can('manage_options') ) + wp_die(__('Cheatin’ uh?')); + +// Handle admin email change requests +if ( is_multisite() ) { + if ( ! empty($_GET[ 'adminhash' ] ) ) { + $new_admin_details = get_option( 'adminhash' ); + $redirect = 'options-general.php?updated=false'; + if ( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && !empty($new_admin_details[ 'newemail' ]) ) { + update_option( 'admin_email', $new_admin_details[ 'newemail' ] ); + delete_option( 'adminhash' ); + delete_option( 'new_admin_email' ); + $redirect = 'options-general.php?updated=true'; + } + wp_redirect( admin_url( $redirect ) ); + exit; + } elseif ( ! empty( $_GET['dismiss'] ) && 'new_admin_email' == $_GET['dismiss'] ) { + delete_option( 'adminhash' ); + delete_option( 'new_admin_email' ); + wp_redirect( admin_url( 'options-general.php?updated=true' ) ); + exit; + } +} + +if ( is_multisite() && !is_super_admin() && 'update' != $action ) + wp_die(__('Cheatin’ uh?')); $whitelist_options = array( - 'general' => array( 'blogname', 'blogdescription', 'admin_email', 'users_can_register', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'default_role', 'timezone_string' ), + 'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string' ), 'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ), - 'misc' => array( 'use_linksupdate', 'uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path' ), 'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type', 'embed_autourls', 'embed_size_w', 'embed_size_h' ), 'privacy' => array( 'blog_public' ), 'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ), - 'writing' => array( 'default_post_edit_rows', 'use_smilies', 'ping_sites', 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'enable_app', 'enable_xmlrpc' ), + 'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'enable_app', 'enable_xmlrpc' ), 'options' => array( '' ) ); -if ( !defined( 'WP_SITEURL' ) ) $whitelist_options['general'][] = 'siteurl'; -if ( !defined( 'WP_HOME' ) ) $whitelist_options['general'][] = 'home'; -$whitelist_options = apply_filters( 'whitelist_options', $whitelist_options ); +$mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass'); +$uploads_options = array('uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path'); -if ( !current_user_can('manage_options') ) - wp_die(__('Cheatin’ uh?')); +if ( !is_multisite() ) { + if ( !defined( 'WP_SITEURL' ) ) + $whitelist_options['general'][] = 'siteurl'; + if ( !defined( 'WP_HOME' ) ) + $whitelist_options['general'][] = 'home'; -switch($action) { + $whitelist_options['general'][] = 'admin_email'; + $whitelist_options['general'][] = 'users_can_register'; + $whitelist_options['general'][] = 'default_role'; -case 'update': - if ( isset($_POST[ 'option_page' ]) ) { - $option_page = $_POST[ 'option_page' ]; - check_admin_referer( $option_page . '-options' ); - } else { - // This is for back compat and will eventually be removed. - $option_page = 'options'; + $whitelist_options['writing'] = array_merge($whitelist_options['writing'], $mail_options); + $whitelist_options['writing'][] = 'ping_sites'; + + $whitelist_options['media'] = array_merge($whitelist_options['media'], $uploads_options); +} else { + $whitelist_options['general'][] = 'new_admin_email'; + $whitelist_options['general'][] = 'WPLANG'; + $whitelist_options['general'][] = 'language'; + + if ( apply_filters( 'enable_post_by_email_configuration', true ) ) + $whitelist_options['writing'] = array_merge($whitelist_options['writing'], $mail_options); + + $whitelist_options[ 'misc' ] = array(); +} + +$whitelist_options = apply_filters( 'whitelist_options', $whitelist_options ); + +/* + * If $_GET['action'] == 'update' we are saving settings sent from a settings page + */ +if ( 'update' == $action ) { + if ( 'options' == $option_page && !isset( $_POST['option_page'] ) ) { // This is for back compat and will eventually be removed. + $unregistered = true; check_admin_referer( 'update-options' ); + } else { + $unregistered = false; + check_admin_referer( $option_page . '-options' ); } if ( !isset( $whitelist_options[ $option_page ] ) ) - wp_die( __( 'Error! Options page not found.' ) ); + wp_die( __( 'Error: options page not found.' ) ); if ( 'options' == $option_page ) { - $options = explode(',', stripslashes( $_POST[ 'page_options' ] )); + if ( is_multisite() && ! is_super_admin() ) + wp_die( __( 'You do not have sufficient permissions to modify unregistered settings for this site.' ) ); + $options = explode( ',', stripslashes( $_POST[ 'page_options' ] ) ); } else { $options = $whitelist_options[ $option_page ]; } @@ -75,46 +132,62 @@ case 'update': if ( $options ) { foreach ( $options as $option ) { + if ( $unregistered ) + _deprecated_argument( 'options.php', '2.7', sprintf( __( 'The %1$s setting is unregistered. Unregistered settings are deprecated. See http://codex.wordpress.org/Settings_API' ), $option, $option_page ) ); + $option = trim($option); $value = null; if ( isset($_POST[$option]) ) $value = $_POST[$option]; - if ( !is_array($value) ) $value = trim($value); + if ( !is_array($value) ) + $value = trim($value); $value = stripslashes_deep($value); update_option($option, $value); } } - $goback = add_query_arg( 'updated', 'true', wp_get_referer() ); + /** + * Handle settings errors and return to options page + */ + // If no settings errors were registered add a general 'updated' message. + if ( !count( get_settings_errors() ) ) + add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated'); + set_transient('settings_errors', get_settings_errors(), 30); + + /** + * Redirect back to the settings page that was submitted + */ + $goback = add_query_arg( 'updated', 'true', wp_get_referer() ); wp_redirect( $goback ); - break; + exit; +} -default: - include('admin-header.php'); ?> +include('./admin-header.php'); ?>
    -

    +

    get_results("SELECT * FROM $wpdb->options ORDER BY option_name"); - -foreach ( (array) $options as $option) : - $disabled = ''; - $option->option_name = esc_attr($option->option_name); - if ( is_serialized($option->option_value) ) { - if ( is_serialized_string($option->option_value) ) { +$options = $wpdb->get_results( "SELECT * FROM $wpdb->options ORDER BY option_name" ); + +foreach ( (array) $options as $option ) : + $disabled = false; + if ( $option->option_name == '' ) + continue; + if ( is_serialized( $option->option_value ) ) { + if ( is_serialized_string( $option->option_value ) ) { // this is a serialized string, so we should display it - $value = maybe_unserialize($option->option_value); + $value = maybe_unserialize( $option->option_value ); $options_to_update[] = $option->option_name; $class = 'all-options'; } else { $value = 'SERIALIZED DATA'; - $disabled = ' disabled="disabled"'; + $disabled = true; $class = 'all-options disabled'; } } else { @@ -122,28 +195,25 @@ foreach ( (array) $options as $option) : $options_to_update[] = $option->option_name; $class = 'all-options'; } + $name = esc_attr( $option->option_name ); echo " - + "; endforeach; ?>
    "; - - if (strpos($value, "\n") !== false) echo ""; - else echo ""; - + if ( strpos( $value, "\n" ) !== false ) + echo ""; + else + echo ""; echo "
    - -

    +

    diff --git a/wp-admin/page-new.php b/wp-admin/page-new.php deleted file mode 100644 index c73c7fcb..00000000 --- a/wp-admin/page-new.php +++ /dev/null @@ -1,31 +0,0 @@ - diff --git a/wp-admin/page.php b/wp-admin/page.php deleted file mode 100644 index a4a92802..00000000 --- a/wp-admin/page.php +++ /dev/null @@ -1,221 +0,0 @@ -ID) ) - wp_die( __('You attempted to edit a page that doesn’t exist. Perhaps it was deleted?') ); - - if ( !current_user_can('edit_page', $page_ID) ) - wp_die( __('You are not allowed to edit this page.') ); - - if ( 'trash' == $post->post_status ) - wp_die( __('You can’t edit this page because it is in the Trash. Please move it out of the Trash and try again.') ); - - if ( 'page' != $post->post_type ) { - wp_redirect( get_edit_post_link( $post_ID, 'url' ) ); - exit(); - } - - wp_enqueue_script('post'); - if ( user_can_richedit() ) - wp_enqueue_script('editor'); - add_thickbox(); - wp_enqueue_script('media-upload'); - wp_enqueue_script('word-count'); - - if ( $last = wp_check_post_lock( $post->ID ) ) { - add_action('admin_notices', '_admin_notice_post_locked' ); - } else { - wp_set_post_lock( $post->ID ); - wp_enqueue_script('autosave'); - } - - include('edit-page-form.php'); - break; - -case 'editattachment': - $page_id = $post_ID = (int) $_POST['post_ID']; - check_admin_referer('update-attachment_' . $page_id); - - // Don't let these be changed - unset($_POST['guid']); - $_POST['post_type'] = 'attachment'; - - // Update the thumbnail filename - $newmeta = wp_get_attachment_metadata( $page_id, true ); - $newmeta['thumb'] = $_POST['thumb']; - - wp_update_attachment_metadata( $newmeta ); - -case 'editpost': - $page_ID = (int) $_POST['post_ID']; - check_admin_referer('update-page_' . $page_ID); - - $page_ID = edit_post(); - - redirect_page($page_ID); - - exit(); - break; - -case 'trash': - $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']); - check_admin_referer('trash-page_' . $post_id); - - $post = & get_post($post_id); - - if ( !current_user_can('delete_page', $post_id) ) - wp_die( __('You are not allowed to move this page to the trash.') ); - - if ( !wp_trash_post($post_id) ) - wp_die( __('Error in moving to trash...') ); - - wp_redirect( add_query_arg( array('trashed' => 1, 'ids' => $post_id), $sendback ) ); - exit(); - break; - -case 'untrash': - $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']); - check_admin_referer('untrash-page_' . $post_id); - - $post = & get_post($post_id); - - if ( !current_user_can('delete_page', $post_id) ) - wp_die( __('You are not allowed to move this page out of the trash.') ); - - if ( !wp_untrash_post($post_id) ) - wp_die( __('Error in restoring from trash...') ); - - wp_redirect( add_query_arg('untrashed', 1, $sendback) ); - exit(); - break; - -case 'delete': - $page_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']); - check_admin_referer('delete-page_' . $page_id); - - $page = & get_post($page_id); - - if ( !current_user_can('delete_page', $page_id) ) - wp_die( __('You are not allowed to delete this page.') ); - - if ( $page->post_type == 'attachment' ) { - if ( ! wp_delete_attachment($page_id) ) - wp_die( __('Error in deleting...') ); - } else { - if ( !wp_delete_post($page_id) ) - wp_die( __('Error in deleting...') ); - } - - wp_redirect( add_query_arg('deleted', 1, $sendback) ); - exit(); - break; - -case 'preview': - check_admin_referer( 'autosave', 'autosavenonce' ); - - $url = post_preview(); - - wp_redirect($url); - exit(); - break; - -default: - wp_redirect('edit-pages.php'); - exit(); - break; -} // end switch -include('admin-footer.php'); -?> diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index 05aa02a8..47437079 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -7,10 +7,10 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); if ( !current_user_can('edit_plugins') ) - wp_die('

    '.__('You do not have sufficient permissions to edit plugins for this blog.').'

    '); + wp_die( __('You do not have sufficient permissions to edit plugins for this site.') ); $title = __("Edit Plugins"); $parent_file = 'plugins.php'; @@ -21,6 +21,9 @@ wp_admin_css( 'theme-editor' ); $plugins = get_plugins(); +if ( empty($plugins) ) + wp_die( __('There are no plugins installed on this site.') ); + if ( isset($_REQUEST['file']) ) $plugin = stripslashes($_REQUEST['file']); @@ -52,11 +55,16 @@ case 'update': fwrite($f, $newcontent); fclose($f); + $network_wide = is_plugin_active_for_network( $file ); + // Deactivate so we can test it. if ( is_plugin_active($file) || isset($_POST['phperror']) ) { if ( is_plugin_active($file) ) deactivate_plugins($file, true); - wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1&scrollto=$scrollto")); + + update_option('recently_activated', array($file => time()) + (array)get_option('recently_activated')); + + wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1&scrollto=$scrollto&networkwide=" . $network_wide)); exit; } wp_redirect("plugin-editor.php?file=$file&a=te&scrollto=$scrollto"); @@ -77,7 +85,7 @@ default: wp_die( $error ); if ( ! is_plugin_active($file) ) - activate_plugin($file, "plugin-editor.php?file=$file&phperror=1"); // we'll override this later if the plugin can be included without fatal error + activate_plugin($file, "plugin-editor.php?file=$file&phperror=1", ! empty( $_GET['networkwide'] ) ); // we'll override this later if the plugin can be included without fatal error wp_redirect("plugin-editor.php?file=$file&a=te&scrollto=$scrollto"); exit; @@ -99,7 +107,17 @@ default: } } - require_once('admin-header.php'); + add_contextual_help($current_screen, + '

    ' . __('You can use the editor to make changes to any of your plugins’ individual PHP files. Be aware that if you make changes, plugins updates will overwrite your customizations.') . '

    ' . + '

    ' . __('Choose a plugin to edit from the menu in the upper right and click the Select button. Click once on any file name to load it in the editor, and make your changes. Don’t forget to save your changes (Update File) when you’re finished.') . '

    ' . + '

    ' . __('The Documentation menu below the editor lists the PHP functions recognized in the plugin file. Clicking Lookup takes you to a web page about that particular function.') . '

    ' . + '

    ' . __('If you want to make changes but don’t want them to be overwritten when the plugin is updated, you may be ready to think about writing your own plugin. For information on how to edit a plugin or start from scratch, check out the links below.') . '

    ' . + '

    ' . __('For more information:') . '

    ' . + '

    ' . __('Documentation on Editing Plugins') . '

    ' . + '

    ' . __('Support Forums') . '

    ' + ); + + require_once('./admin-header.php'); update_recently_edited(WP_PLUGIN_DIR . '/' . $file); @@ -110,22 +128,20 @@ default: if ( !empty($functions) ) { $docs_select = ''; } } $content = htmlspecialchars( $content ); - $codepress_lang = codepress_get_lang($real_file); - ?> -

    +

    -

    fatal error.') ?>

    +

    fatal error.') ?>

    @@ -198,17 +214,17 @@ foreach ( $plugin_files as $plugin_file ) :
    -
    +
    -
    +
    - +

    Warning: Making changes to active plugins is not recommended. If your changes cause a fatal error, the plugin will be automatically deactivated.'); ?>

    @@ -236,4 +252,4 @@ jQuery(document).ready(function($){ ' . sprintf(__('Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from WordPress core by thousands of developers all over the world. All plugins in the official WordPress.org Plugin Directory are compatible with the WordPress GPL v2 license. You can find new plugins to install by searching or browsing the Directory right here in your own Plugins section.'), 'http://wordpress.org/extend/plugins/') . '

    ' . + '

    ' . __('If you know what you’re looking for, Search is your best bet. The Search screen has options to search the WordPress.org Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting a popular tags. Tags in larger type mean more plugins have been labeled with that tag.') . '

    ' . + '

    ' . __('If you just want to get an idea of what’s available, you can browse Featured, Popular, Newest, and Recently Updated plugins by using the links in the upper left of the screen. These sections rotate regularly.') . '

    ' . + '

    ' . __('If you want to install a plugin that you’ve downloaded elsewhere, click Upload in the upper left. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.') . '

    ' . + '

    ' . __('For more information:') . '

    ' . + '

    ' . __('Documentation on Installing Plugins') . '

    ' . + '

    ' . __('Support Forums') . '

    ' +); + +include('./admin-header.php'); ?>
    @@ -73,4 +83,4 @@ foreach ( (array)$tabs as $action => $text ) {
    ID, 'plugins_last_view', $status); + update_user_meta($current_user->ID, 'plugins_last_view', $status); $page = isset($_REQUEST['paged']) ? $_REQUEST['paged'] : 1; @@ -38,40 +46,55 @@ $page = isset($_REQUEST['paged']) ? $_REQUEST['paged'] : 1; $_SERVER['REQUEST_URI'] = remove_query_arg(array('error', 'deleted', 'activate', 'activate-multi', 'deactivate', 'deactivate-multi', '_error_nonce'), $_SERVER['REQUEST_URI']); if ( !empty($action) ) { + $network_wide = false; + if ( ( isset( $_GET['networkwide'] ) || 'network-activate-selected' == $action ) && is_multisite() && current_user_can( 'manage_network_plugins' ) ) + $network_wide = true; + switch ( $action ) { case 'activate': if ( ! current_user_can('activate_plugins') ) - wp_die(__('You do not have sufficient permissions to activate plugins for this blog.')); + wp_die(__('You do not have sufficient permissions to activate plugins for this site.')); check_admin_referer('activate-plugin_' . $plugin); - $result = activate_plugin($plugin, 'plugins.php?error=true&plugin=' . $plugin); - if ( is_wp_error( $result ) ) - wp_die($result); + $result = activate_plugin($plugin, 'plugins.php?error=true&plugin=' . $plugin, $network_wide); + if ( is_wp_error( $result ) ) { + if ( 'unexpected_output' == $result->get_error_code() ) { + $redirect = 'plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin; + wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); + exit; + } else { + wp_die($result); + } + } $recent = (array)get_option('recently_activated'); if ( isset($recent[ $plugin ]) ) { unset($recent[ $plugin ]); update_option('recently_activated', $recent); } - - wp_redirect("plugins.php?activate=true&plugin_status=$status&paged=$page"); // overrides the ?error=true one above + if ( isset($_GET['from']) && 'import' == $_GET['from'] ) { + wp_redirect("import.php?import=" . str_replace('-importer', '', dirname($plugin)) ); // overrides the ?error=true one above and redirects to the Imports page, striping the -importer suffix + } else { + wp_redirect("plugins.php?activate=true&plugin_status=$status&paged=$page"); // overrides the ?error=true one above + } exit; break; case 'activate-selected': + case 'network-activate-selected': if ( ! current_user_can('activate_plugins') ) - wp_die(__('You do not have sufficient permissions to activate plugins for this blog.')); + wp_die(__('You do not have sufficient permissions to activate plugins for this site.')); check_admin_referer('bulk-manage-plugins'); $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); - $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Only activate plugins which are not already active. + $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); // Only activate plugins which are not already active. if ( empty($plugins) ) { wp_redirect("plugins.php?plugin_status=$status&paged=$page"); exit; } - activate_plugins($plugins, 'plugins.php?error=true'); + activate_plugins($plugins, 'plugins.php?error=true', $network_wide); $recent = (array)get_option('recently_activated'); foreach ( $plugins as $plugin => $time) @@ -83,9 +106,38 @@ if ( !empty($action) ) { wp_redirect("plugins.php?activate-multi=true&plugin_status=$status&paged=$page"); exit; break; + case 'update-selected' : + + check_admin_referer( 'bulk-manage-plugins' ); + + if ( isset( $_GET['plugins'] ) ) + $plugins = explode( ',', $_GET['plugins'] ); + elseif ( isset( $_POST['checked'] ) ) + $plugins = (array) $_POST['checked']; + else + $plugins = array(); + + $title = __( 'Upgrade Plugins' ); + $parent_file = 'plugins.php'; + + require_once( './admin-header.php' ); + + echo '
    '; + screen_icon(); + echo '

    ' . esc_html( $title ) . '

    '; + + + $url = 'update.php?action=update-selected&plugins=' . urlencode( join(',', $plugins) ); + $url = wp_nonce_url($url, 'bulk-update-plugins'); + + echo ""; + echo '
    '; + require_once( './admin-footer.php' ); + exit; + break; case 'error_scrape': if ( ! current_user_can('activate_plugins') ) - wp_die(__('You do not have sufficient permissions to activate plugins for this blog.')); + wp_die(__('You do not have sufficient permissions to activate plugins for this site.')); check_admin_referer('plugin-activation-error_' . $plugin); @@ -93,29 +145,38 @@ if ( !empty($action) ) { if ( is_wp_error($valid) ) wp_die($valid); - if ( defined('E_RECOVERABLE_ERROR') ) - error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR); - else - error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING); + if ( ! WP_DEBUG ) { + if ( defined('E_RECOVERABLE_ERROR') ) + error_reporting(E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR); + else + error_reporting(E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING); + } @ini_set('display_errors', true); //Ensure that Fatal errors are displayed. - include(WP_PLUGIN_DIR . '/' . $plugin); + // Go back to "sandbox" scope so we get the same errors as before + function plugin_sandbox_scrape( $plugin ) { + include( WP_PLUGIN_DIR . '/' . $plugin ); + } + plugin_sandbox_scrape( $plugin ); do_action('activate_' . $plugin); exit; break; case 'deactivate': if ( ! current_user_can('activate_plugins') ) - wp_die(__('You do not have sufficient permissions to deactivate plugins for this blog.')); + wp_die(__('You do not have sufficient permissions to deactivate plugins for this site.')); check_admin_referer('deactivate-plugin_' . $plugin); deactivate_plugins($plugin); update_option('recently_activated', array($plugin => time()) + (array)get_option('recently_activated')); - wp_redirect("plugins.php?deactivate=true&plugin_status=$status&paged=$page"); + if (headers_sent()) + echo ""; + else + wp_redirect("plugins.php?deactivate=true&plugin_status=$status&paged=$page"); exit; break; case 'deactivate-selected': if ( ! current_user_can('activate_plugins') ) - wp_die(__('You do not have sufficient permissions to deactivate plugins for this blog.')); + wp_die(__('You do not have sufficient permissions to deactivate plugins for this site.')); check_admin_referer('bulk-manage-plugins'); @@ -138,7 +199,7 @@ if ( !empty($action) ) { break; case 'delete-selected': if ( ! current_user_can('delete_plugins') ) - wp_die(__('You do not have sufficient permissions to delete plugins for this blog.')); + wp_die(__('You do not have sufficient permissions to delete plugins for this site.')); check_admin_referer('bulk-manage-plugins'); @@ -156,37 +217,59 @@ if ( !empty($action) ) { if ( ! isset($_REQUEST['verify-delete']) ) { wp_enqueue_script('jquery'); - require_once('admin-header.php'); + require_once('./admin-header.php'); ?>
    -

    $data ) { + $plugin_info[ $plugin_file ] = $data; + $plugin_info[ $plugin_file ]['is_uninstallable'] = is_uninstallable_plugin( $plugin ); + } + } } } + screen_icon(); + $plugins_to_delete = count( $plugin_info ); + echo '

    ' . _n( 'Delete Plugin', 'Delete Plugins', $plugins_to_delete ) . '

    '; ?> -

    +

      ', sprintf(__('%s by %s'), $plugin['Name'], $plugin['Author']), ''; + $data_to_delete = false; + foreach ( $plugin_info as $plugin ) { + if ( $plugin['is_uninstallable'] ) { + /* translators: 1: plugin name, 2: plugin author */ + echo '
    • ', sprintf( __( '%1$s by %2$s (will also delete its data)' ), $plugin['Name'], $plugin['Author'] ), '
    • '; + $data_to_delete = true; + } else { + /* translators: 1: plugin name, 2: plugin author */ + echo '
    • ', sprintf( __('%1$s by %2$s' ), $plugin['Name'], $plugin['Author'] ), '
    • '; + } + } ?>
    -

    +

    @@ -195,7 +278,7 @@ if ( !empty($action) ) { echo ''; ?> - +
    @@ -212,7 +295,7 @@ if ( !empty($action) ) {
    ' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '

    '; -$help .= '

    ' . sprintf(__('If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the %s directory and it will be automatically deactivated.'), WP_PLUGIN_DIR) . '

    '; -$help .= '

    ' . sprintf(__('You can find additional plugins for your site by using the new Plugin Browser/Installer functionality or by browsing the WordPress Plugin Directory directly and installing manually. To manually install a plugin you generally just need to upload the plugin file into your %2$s directory. Once a plugin has been installed, you may activate it here.'), 'plugin-install.php', WP_PLUGIN_DIR) . '

    '; +add_contextual_help($current_screen, + '

    ' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '

    ' . + '

    ' . sprintf(__('You can find additional plugins for your site by using the Plugin Browser/Installer functionality or by browsing the WordPress Plugin Directory directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your /wp-content/plugins directory. Once a plugin has been installed, you can activate it here.'), 'plugin-install.php', 'http://wordpress.org/extend/plugins/') . '

    ' . + '

    ' . __('Most of the time, plugins play nicely with the core of WordPress and with other plugins. Sometimes, though, a plugin’s code will get in the way of another plugin, causing compatibility issues. If your site starts doing strange things, this may be the problem. Try deactivating all your plugins and re-activating them in various combinations until you isolate which one(s) caused the issue.') . '

    ' . + '

    ' . sprintf( __('If something goes wrong with a plugin and you can’t use WordPress, delete or rename that file in the %s directory and it will be automatically deactivated.'), WP_PLUGIN_DIR) . '

    ' . + '

    ' . __('For more information:') . '

    ' . + '

    ' . __('Documentation on Managing Plugins') . '

    ' . + '

    ' . __('Support Forums') . '

    ' +); -add_contextual_help('plugins', $help); +$title = __('Plugins'); -$title = __('Manage Plugins'); -require_once('admin-header.php'); +require_once('./admin-header.php'); $invalid = validate_active_plugins(); if ( !empty($invalid) ) @@ -245,10 +333,16 @@ if ( !empty($invalid) ) echo '

    ' . sprintf(__('The plugin %s has been deactivated due to an error: %s'), esc_html($plugin_file), $error->get_error_message()) . '

    '; ?> - -

    fatal error.') ?>

    +unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.'), $_GET['charsout']); + else + $errmsg = __('Plugin could not be activated because it triggered a fatal error.'); + ?> +

    + if ( !isset($_GET['charsout']) && wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $plugin) ) { ?> -

    get_error_message() ); ?>

    +

    get_error_message() ); ?>

    -

    deleted.'); ?>

    +

    deleted.'); ?>

    -

    activated.') ?>

    +

    activated.') ?>

    -

    activated.'); ?>

    +

    activated.'); ?>

    -

    deactivated.') ?>

    +

    deactivated.') ?>

    -

    deactivated.'); ?>

    +

    deactivated.'); ?>

    + +

    -

    +

    $time ) unset($recently_activated[ $key ]); if ( $recently_activated != get_option('recently_activated') ) //If array changed, update it. update_option('recently_activated', $recently_activated); -$current = get_transient( 'update_plugins' ); - -foreach ( (array)$all_plugins as $plugin_file => $plugin_data) { - - //Translate, Apply Markup, Sanitize HTML - $plugin_data = _get_plugin_data_markup_translate($plugin_file, $plugin_data, false, true); - $all_plugins[ $plugin_file ] = $plugin_data; +$current = get_site_transient( 'update_plugins' ); - //Filter into individual sections - if ( is_plugin_active($plugin_file) ) { +foreach ( array( 'all_plugins', 'mustuse_plugins', 'dropins_plugins' ) as $plugin_array_name) { + foreach ( (array) $$plugin_array_name as $plugin_file => $plugin_data ) { + // Translate, Apply Markup, Sanitize HTML + $plugin_data = _get_plugin_data_markup_translate($plugin_file, $plugin_data, false, true); + ${$plugin_array_name}[ $plugin_file ] = $plugin_data; + } +} +unset( $plugin_array_name ); + +foreach ( (array) $all_plugins as $plugin_file => $plugin_data) { + // Filter into individual sections + if ( is_multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins' ) ) { + unset( $all_plugins[ $plugin_file ] ); + continue; + } elseif ( is_plugin_active_for_network($plugin_file) ) { + $network_plugins[ $plugin_file ] = $plugin_data; + } elseif ( is_plugin_active($plugin_file) ) { $active_plugins[ $plugin_file ] = $plugin_data; } else { if ( isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated? @@ -312,18 +425,24 @@ foreach ( (array)$all_plugins as $plugin_file => $plugin_data) { $inactive_plugins[ $plugin_file ] = $plugin_data; } - if ( isset( $current->response[ $plugin_file ] ) ) - $upgrade_plugins[ $plugin_file ] = $plugin_data; + if ( isset( $current->response[ $plugin_file ] ) ) + $upgrade_plugins[ $plugin_file ] = $plugin_data; } +if ( !current_user_can('update_plugins') ) + $upgrade_plugins = array(); + $total_all_plugins = count($all_plugins); $total_inactive_plugins = count($inactive_plugins); $total_active_plugins = count($active_plugins); $total_recent_plugins = count($recent_plugins); $total_upgrade_plugins = count($upgrade_plugins); +$total_network_plugins = count($network_plugins); +$total_mustuse_plugins = count($mustuse_plugins); +$total_dropins_plugins = count($dropins_plugins); -//Searching. -if ( isset($_GET['s']) ) { +// Searching. +if ( !empty($_GET['s']) ) { function _search_plugins_filter_callback($plugin) { static $term; if ( is_null($term) ) @@ -344,17 +463,17 @@ if ( isset($_GET['s']) ) { } $plugin_array_name = "${status}_plugins"; -if ( empty($$plugin_array_name) && $status != 'all' ) { +if ( empty($$plugin_array_name) && !in_array($status, array('all', 'search')) ) { $status = 'all'; $plugin_array_name = "${status}_plugins"; } $plugins = &$$plugin_array_name; -//Paging. +// Paging. $total_this_page = "total_{$status}_plugins"; $total_this_page = $$total_this_page; -$plugins_per_page = (int) get_user_option( 'plugins_per_page', 0, false ); +$plugins_per_page = (int) get_user_option( 'plugins_per_page' ); if ( empty( $plugins_per_page ) || $plugins_per_page < 1 ) $plugins_per_page = 999; $plugins_per_page = apply_filters( 'plugins_per_page', $plugins_per_page ); @@ -384,11 +503,12 @@ $page_links_text = sprintf( '' . __( 'Displaying %s */ function print_plugins_table($plugins, $context = '') { global $page; + $checkbox = ! in_array( $context, array( 'mustuse', 'dropins' ) ) ? '' : ''; ?> - + @@ -396,7 +516,7 @@ function print_plugins_table($plugins, $context = '') { - + @@ -411,29 +531,77 @@ function print_plugins_table($plugins, $context = '') { '; } foreach ( (array)$plugins as $plugin_file => $plugin_data) { - $actions = array(); - $is_active = is_plugin_active($plugin_file); - - if ( $is_active ) - $actions[] = '' . __('Deactivate') . ''; - else - $actions[] = '' . __('Activate') . ''; - - if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) - $actions[] = '' . __('Edit') . ''; - - if ( ! $is_active && current_user_can('delete_plugins') ) - $actions[] = '' . __('Delete') . ''; - - $actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context ); + // preorder + $actions = array( + 'network_deactivate' => '', 'deactivate' => '', + 'network_only' => '', 'activate' => '', + 'network_activate' => '', + 'edit' => '', + 'delete' => '', + ); + + if ( 'mustuse' == $context ) { + $is_active = true; + } elseif ( 'dropins' == $context ) { + $dropins = _get_dropins(); + $plugin_name = $plugin_file; + if ( $plugin_file != $plugin_data['Name'] ) + $plugin_name .= '
    ' . $plugin_data['Name']; + if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant + $is_active = true; + $description = '

    ' . $dropins[ $plugin_file ][0] . '

    '; + } elseif ( constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true + $is_active = true; + $description = '

    ' . $dropins[ $plugin_file ][0] . '

    '; + } else { + $is_active = false; + $description = '' . $dropins[ $plugin_file ][0] . ' ' . __('Inactive:') . ' ' . sprintf( __( 'Requires %s in wp-config.php.' ), "define('" . $dropins[ $plugin_file ][1] . "', true);" ) . '

    '; + } + $description .= '

    ' . $plugin_data['Description'] . '

    '; + } else { + $is_active_for_network = is_plugin_active_for_network($plugin_file); + $is_active = $is_active_for_network || is_plugin_active( $plugin_file ); + if ( $is_active_for_network && !is_super_admin() ) + continue; + + if ( $is_active ) { + if ( $is_active_for_network ) { + if ( is_super_admin() ) + $actions['network_deactivate'] = '' . __('Network Deactivate') . ''; + } else { + $actions['deactivate'] = '' . __('Deactivate') . ''; + } + } else { + if ( is_multisite() && is_network_only_plugin( $plugin_file ) ) + $actions['network_only'] = '' . __('Network Only') . ''; + else + $actions['activate'] = '' . __('Activate') . ''; + + if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) + $actions['network_activate'] = '' . __('Network Activate') . ''; + + if ( current_user_can('delete_plugins') ) + $actions['delete'] = '' . __('Delete') . ''; + } // end if $is_active + + if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) + $actions['edit'] = '' . __('Edit') . ''; + } // end if $context + + $actions = apply_filters( 'plugin_action_links', array_filter( $actions ), $plugin_file, $plugin_data, $context ); $actions = apply_filters( "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context ); - $action_count = count($actions); + $class = $is_active ? 'active' : 'inactive'; + $checkbox = in_array( $context, array( 'mustuse', 'dropins' ) ) ? '' : ""; + if ( 'dropins' != $context ) { + $description = '

    ' . $plugin_data['Description'] . '

    '; + $plugin_name = $plugin_data['Name']; + } echo " - - - + + + @@ -477,6 +645,8 @@ function print_plugins_table($plugins, $context = '') { * @param string $context */ function print_plugin_actions($context, $field_name = 'action' ) { + if ( in_array( $context, array( 'mustuse', 'dropins' ) ) ) + return; ?>
    - +
    @@ -504,10 +680,12 @@ function print_plugin_actions($context, $field_name = 'action' ) { + + @@ -530,6 +708,18 @@ if ( ! empty($inactive_plugins) ) { $class = ( 'inactive' == $status ) ? ' class="current"' : ''; $status_links[] = "
  • " . sprintf( _n( 'Inactive (%s)', 'Inactive (%s)', $total_inactive_plugins ), number_format_i18n( $total_inactive_plugins ) ) . ''; } +if ( ! empty($network_plugins) ) { + $class = ( 'network' == $status ) ? ' class="current"' : ''; + $status_links[] = "
  • " . sprintf( _n( 'Network (%s)', 'Network (%s)', $total_network_plugins ), number_format_i18n( $total_network_plugins ) ) . ''; +} +if ( ! empty($mustuse_plugins) ) { + $class = ( 'mustuse' == $status ) ? ' class="current"' : ''; + $status_links[] = "
  • " . sprintf( _n( 'Must-Use (%s)', 'Must-Use (%s)', $total_mustuse_plugins ), number_format_i18n( $total_mustuse_plugins ) ) . ''; +} +if ( ! empty($dropins_plugins) ) { + $class = ( 'dropins' == $status ) ? ' class="current"' : ''; + $status_links[] = "
  • " . sprintf( _n( 'Drop-ins (%s)', 'Drop-ins (%s)', $total_dropins_plugins ), number_format_i18n( $total_dropins_plugins ) ) . ''; +} if ( ! empty($upgrade_plugins) ) { $class = ( 'upgrade' == $status ) ? ' class="current"' : ''; $status_links[] = "
  • " . sprintf( _n( 'Upgrade Available (%s)', 'Upgrade Available (%s)', $total_upgrade_plugins ), number_format_i18n( $total_upgrade_plugins ) ) . ''; @@ -544,6 +734,14 @@ unset( $status_links ); ?> +

    ' . __( 'Files in the /wp-content/mu-plugins directory are executed automatically.' ) . '

    '; +elseif ( 'dropins' == $status ) + echo '

    ' . __( 'Drop-ins are advanced plugins in the /wp-content directory that replace WordPress functionality when present.' ) . '

    '; + +if ( !empty( $plugins ) && ( ! in_array( $status, array( 'mustuse', 'dropins' ) ) || $page_links ) ) : +?>
    $plugins_per_page ) - $plugins = array_slice($plugins, $start, $plugins_per_page); +endif; + +if ( $total_this_page > $plugins_per_page ) + $plugins = array_slice($plugins, $start, $plugins_per_page); + +print_plugins_table($plugins, $status); - print_plugins_table($plugins, $status); +if ( !empty( $plugins ) && ! in_array( $status, array( 'mustuse', 'dropins' ) ) || $page_links ) { ?>
    + +

    + +

    diff --git a/wp-admin/post-new.php b/wp-admin/post-new.php index 229f3d06..93c4ffbc 100644 --- a/wp-admin/post-new.php +++ b/wp-admin/post-new.php @@ -7,20 +7,31 @@ */ /** Load WordPress Administration Bootstrap */ -require_once('admin.php'); -$title = __('Add New Post'); -$parent_file = 'edit.php'; +require_once('./admin.php'); + +if ( !isset($_GET['post_type']) ) + $post_type = 'post'; +elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) ) + $post_type = $_GET['post_type']; +else + wp_die( __('Invalid post type') ); + +if ( 'post' != $post_type ) { + $parent_file = "edit.php?post_type=$post_type"; + $submenu_file = "post-new.php?post_type=$post_type"; +} else { + $parent_file = 'edit.php'; + $submenu_file = 'post-new.php'; +} + +$post_type_object = get_post_type_object($post_type); + +$title = $post_type_object->labels->add_new_item; + $editing = true; -wp_enqueue_script('autosave'); -wp_enqueue_script('post'); -if ( user_can_richedit() ) - wp_enqueue_script('editor'); -add_thickbox(); -wp_enqueue_script('media-upload'); -wp_enqueue_script('word-count'); - -if ( ! current_user_can('edit_posts') ) { - require_once ('./admin-header.php'); ?> + +if ( 'post' == $post_type && !current_user_can('edit_posts') ) { + include('./admin-header.php'); ?>

    edit_posts capability to your user, in order to be authorized to post.
    You can also e-mail the admin to ask for a promotion.
    @@ -28,13 +39,18 @@ When you’re promoted, just reload this page and you’ll be able to bl

    cap->edit_posts) ) { + $post = get_default_post_to_edit( $post_type, true ); + $post_ID = $post->ID; + include('edit-form-advanced.php'); +} -include('admin-footer.php'); -?> +include('./admin-footer.php'); +?> \ No newline at end of file diff --git a/wp-admin/post.php b/wp-admin/post.php index a8ccddae..548007f7 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -9,35 +9,55 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); $parent_file = 'edit.php'; $submenu_file = 'edit.php'; wp_reset_vars(array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder')); +if ( isset($_GET['post']) ) + $post_id = (int) $_GET['post']; +elseif ( isset($_POST['post_ID']) ) + $post_id = (int) $_POST['post_ID']; +else + $post_id = 0; +$post_ID = $post_id; +$post = null; +$post_type_object = null; +$post_type = null; +if ( $post_id ) { + $post = get_post($post_id); + if ( $post ) { + $post_type_object = get_post_type_object($post->post_type); + if ( $post_type_object ) { + $post_type = $post->post_type; + $current_screen->post_type = $post->post_type; + $current_screen->id = $current_screen->post_type; + } + } +} elseif ( isset($_POST['post_type']) ) { + $post_type_object = get_post_type_object($_POST['post_type']); + if ( $post_type_object ) { + $post_type = $post_type_object->name; + $current_screen->post_type = $post_type; + $current_screen->id = $current_screen->post_type; + } +} + /** * Redirect to previous page. * - * @param int $post_ID Optional. Post ID. + * @param int $post_id Optional. Post ID. */ -function redirect_post($post_ID = '') { - global $action; - - $referredby = ''; - if ( !empty($_POST['referredby']) ) { - $referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']); - $referredby = remove_query_arg('_wp_original_http_referer', $referredby); - } - $referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer()); - +function redirect_post($post_id = '') { if ( !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) { if ( isset($_POST['saveasdraft']) ) $location = 'sidebar.php?a=c'; elseif ( isset($_POST['publish']) ) $location = 'sidebar.php?a=b'; } elseif ( isset($_POST['save']) || isset($_POST['publish']) ) { - $status = get_post_status( $post_ID ); + $status = get_post_status( $post_id ); if ( isset( $_POST['publish'] ) ) { switch ( $status ) { @@ -54,7 +74,7 @@ function redirect_post($post_ID = '') { $message = 'draft' == $status ? 10 : 1; } - $location = add_query_arg( 'message', $message, get_edit_post_link( $post_ID, 'url' ) ); + $location = add_query_arg( 'message', $message, get_edit_post_link( $post_id, 'url' ) ); } elseif ( isset($_POST['addmeta']) && $_POST['addmeta'] ) { $location = add_query_arg( 'message', 2, wp_get_referer() ); $location = explode('#', $location); @@ -64,12 +84,12 @@ function redirect_post($post_ID = '') { $location = explode('#', $location); $location = $location[0] . '#postcustom'; } elseif ( 'post-quickpress-save-cont' == $_POST['action'] ) { - $location = "post.php?action=edit&post=$post_ID&message=7"; + $location = "post.php?action=edit&post=$post_id&message=7"; } else { - $location = add_query_arg( 'message', 4, get_edit_post_link( $post_ID, 'url' ) ); + $location = add_query_arg( 'message', 4, get_edit_post_link( $post_id, 'url' ) ); } - wp_redirect( apply_filters( 'redirect_post_location', $location, $post_ID ) ); + wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) ); } if ( isset( $_POST['deletepost'] ) ) @@ -78,17 +98,19 @@ elseif ( isset($_POST['wp-preview']) && 'dopreview' == $_POST['wp-preview'] ) $action = 'preview'; $sendback = wp_get_referer(); -if ( strpos($sendback, 'post.php') !== false || strpos($sendback, 'post-new.php') !== false ) +if ( strpos($sendback, 'post.php') !== false || strpos($sendback, 'post-new.php') !== false ) { $sendback = admin_url('edit.php'); -else + $sendback .= ( !empty( $post_type ) ) ? '?post_type=' . $post_type : ''; +} else { $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), $sendback ); +} switch($action) { case 'postajaxpost': case 'post': case 'post-quickpress-publish': case 'post-quickpress-save': - check_admin_referer('add-post'); + check_admin_referer('add-' . $post_type); if ( 'post-quickpress-publish' == $action ) $_POST['publish'] = 'publish'; // tell write_post() to publish @@ -100,55 +122,53 @@ case 'post-quickpress-save': if ( !empty( $_POST['quickpress_post_ID'] ) ) { $_POST['post_ID'] = (int) $_POST['quickpress_post_ID']; - $post_ID = edit_post(); + $post_id = edit_post(); } else { - $post_ID = 'postajaxpost' == $action ? edit_post() : write_post(); + $post_id = 'postajaxpost' == $action ? edit_post() : write_post(); } if ( 0 === strpos( $action, 'post-quickpress' ) ) { - $_POST['post_ID'] = $post_ID; + $_POST['post_ID'] = $post_id; // output the quickpress dashboard widget require_once(ABSPATH . 'wp-admin/includes/dashboard.php'); - wp_dashboard_quick_press(); + wp_dashboard_quick_press_output(); exit; } - redirect_post($post_ID); + redirect_post($post_id); exit(); break; case 'edit': $editing = true; - if ( empty( $_GET['post'] ) ) { + if ( empty( $post_id ) ) { wp_redirect("post.php"); exit(); } - $post_ID = $p = (int) $_GET['post']; - $post = get_post($post_ID); + + $p = $post_id; if ( empty($post->ID) ) - wp_die( __('You attempted to edit a post that doesn’t exist. Perhaps it was deleted?') ); + wp_die( __('You attempted to edit an item that doesn’t exist. Perhaps it was deleted?') ); - if ( !current_user_can('edit_post', $post_ID) ) - wp_die( __('You are not allowed to edit this post.') ); + if ( !current_user_can($post_type_object->cap->edit_post, $post_id) ) + wp_die( __('You are not allowed to edit this item.') ); if ( 'trash' == $post->post_status ) - wp_die( __('You can’t edit this post because it is in the Trash. Please restore it and try again.') ); + wp_die( __('You can’t edit this item because it is in the Trash. Please restore it and try again.') ); - if ( 'post' != $post->post_type ) { - wp_redirect( get_edit_post_link( $post->ID, 'url' ) ); - exit(); - } + if ( null == $post_type_object ) + wp_die( __('Unknown post type.') ); - wp_enqueue_script('post'); - if ( user_can_richedit() ) - wp_enqueue_script('editor'); - add_thickbox(); - wp_enqueue_script('media-upload'); - wp_enqueue_script('word-count'); - wp_enqueue_script( 'admin-comments' ); - enqueue_comment_hotkeys_js(); + $post_type = $post->post_type; + if ( 'post' == $post_type ) { + $parent_file = "edit.php"; + $submenu_file = "edit.php"; + } else { + $parent_file = "edit.php?post_type=$post_type"; + $submenu_file = "edit.php?post_type=$post_type"; + } if ( $last = wp_check_post_lock( $post->ID ) ) { add_action('admin_notices', '_admin_notice_post_locked' ); @@ -157,16 +177,19 @@ case 'edit': wp_enqueue_script('autosave'); } - $title = __('Edit Post'); - $post = get_post_to_edit($post_ID); + $title = $post_type_object->labels->edit_item; + $post = get_post_to_edit($post_id); + + if ( post_type_supports($post_type, 'comments') ) { + wp_enqueue_script('admin-comments'); + enqueue_comment_hotkeys_js(); + } - include('edit-form-advanced.php'); + include('./edit-form-advanced.php'); break; case 'editattachment': - $post_id = (int) $_POST['post_ID']; - check_admin_referer('update-attachment_' . $post_id); // Don't let these be changed @@ -180,65 +203,57 @@ case 'editattachment': wp_update_attachment_metadata( $post_id, $newmeta ); case 'editpost': - $post_ID = (int) $_POST['post_ID']; - check_admin_referer('update-post_' . $post_ID); + check_admin_referer('update-' . $post_type . '_' . $post_id); - $post_ID = edit_post(); + $post_id = edit_post(); - redirect_post($post_ID); // Send user on their way while we keep working + redirect_post($post_id); // Send user on their way while we keep working exit(); break; case 'trash': - $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']); - check_admin_referer('trash-post_' . $post_id); + check_admin_referer('trash-' . $post_type . '_' . $post_id); $post = & get_post($post_id); - if ( !current_user_can('delete_post', $post_id) ) - wp_die( __('You are not allowed to move this post to the trash.') ); + if ( !current_user_can($post_type_object->cap->delete_post, $post_id) ) + wp_die( __('You are not allowed to move this item to the Trash.') ); if ( ! wp_trash_post($post_id) ) - wp_die( __('Error in moving to trash...') ); + wp_die( __('Error in moving to Trash.') ); wp_redirect( add_query_arg( array('trashed' => 1, 'ids' => $post_id), $sendback ) ); exit(); break; case 'untrash': - $post_id = isset($_GET['post']) ? intval($_GET['post']) : intval($_POST['post_ID']); - check_admin_referer('untrash-post_' . $post_id); - - $post = & get_post($post_id); + check_admin_referer('untrash-' . $post_type . '_' . $post_id); - if ( !current_user_can('delete_post', $post_id) ) - wp_die( __('You are not allowed to move this post out of the trash.') ); + if ( !current_user_can($post_type_object->cap->delete_post, $post_id) ) + wp_die( __('You are not allowed to move this item out of the Trash.') ); if ( ! wp_untrash_post($post_id) ) - wp_die( __('Error in restoring from trash...') ); + wp_die( __('Error in restoring from Trash.') ); wp_redirect( add_query_arg('untrashed', 1, $sendback) ); exit(); break; case 'delete': - $post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); - check_admin_referer('delete-post_' . $post_id); - - $post = & get_post($post_id); + check_admin_referer('delete-' . $post_type . '_' . $post_id); - if ( !current_user_can('delete_post', $post_id) ) - wp_die( __('You are not allowed to delete this post.') ); + if ( !current_user_can($post_type_object->cap->delete_post, $post_id) ) + wp_die( __('You are not allowed to delete this item.') ); $force = !EMPTY_TRASH_DAYS; if ( $post->post_type == 'attachment' ) { $force = ( $force || !MEDIA_TRASH ); if ( ! wp_delete_attachment($post_id, $force) ) - wp_die( __('Error in deleting...') ); + wp_die( __('Error in deleting.') ); } else { if ( !wp_delete_post($post_id, $force) ) - wp_die( __('Error in deleting...') ); + wp_die( __('Error in deleting.') ); } wp_redirect( add_query_arg('deleted', 1, $sendback) ); @@ -255,9 +270,9 @@ case 'preview': break; default: - wp_redirect('edit.php'); + wp_redirect('edit.php'); exit(); break; } // end switch -include('admin-footer.php'); +include('./admin-footer.php'); ?> diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php index 4eda788c..a1a6f780 100644 --- a/wp-admin/press-this.php +++ b/wp-admin/press-this.php @@ -7,29 +7,12 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); if ( ! current_user_can('edit_posts') ) wp_die( __( 'Cheatin’ uh?' ) ); -/** - * Convert characters. - * - * @package WordPress - * @subpackage Press_This - * @since 2.6.0 - * - * @param string $text - * @return string - */ -function aposfix($text) { - $translation_table[chr(34)] = '"'; - $translation_table[chr(38)] = '&'; - $translation_table[chr(39)] = '''; - return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($text, $translation_table)); -} - /** * Press It form handler. * @@ -45,7 +28,7 @@ function press_it() { $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null; $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null; $quick['post_title'] = ( trim($_POST['title']) != '' ) ? $_POST['title'] : ' '; - $quick['post_content'] = isset($_POST['post_content']) ? $_POST['post_content'] : ''; + $quick['post_content'] = isset($_POST['post_content']) ? $_POST['post_content'] : ''; // insert the post with nothing in it, to get an ID $post_ID = wp_insert_post($quick, true); @@ -55,7 +38,7 @@ function press_it() { $content = isset($_POST['content']) ? $_POST['content'] : ''; $upload = false; - if( !empty($_POST['photo_src']) && current_user_can('upload_files') ) { + if ( !empty($_POST['photo_src']) && current_user_can('upload_files') ) { foreach( (array) $_POST['photo_src'] as $key => $image) { // see if files exist in content - we don't want to upload non-used selected files. if ( strpos($_POST['content'], htmlspecialchars($image)) !== false ) { @@ -63,7 +46,7 @@ function press_it() { $upload = media_sideload_image($image, $post_ID, $desc); // Replace the POSTED content with correct uploaded ones. Regex contains fix for Magic Quotes - if( !is_wp_error($upload) ) + if ( !is_wp_error($upload) ) $content = preg_replace('/]*)src=\\\?(\"|\')'.preg_quote(htmlspecialchars($image), '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content); } } @@ -92,11 +75,17 @@ if ( isset($_REQUEST['action']) && 'post' == $_REQUEST['action'] ) { } // Set Variables -$title = isset( $_GET['t'] ) ? trim( strip_tags( aposfix( stripslashes( $_GET['t'] ) ) ) ) : ''; -$selection = isset( $_GET['s'] ) ? trim( htmlspecialchars( html_entity_decode( aposfix( stripslashes( $_GET['s'] ) ) ) ) ) : ''; +$title = isset( $_GET['t'] ) ? trim( strip_tags( html_entity_decode( stripslashes( $_GET['t'] ) , ENT_QUOTES) ) ) : ''; + +$selection = ''; +if ( !empty($_GET['s']) ) { + $selection = str_replace(''', "'", stripslashes($_GET['s'])); + $selection = trim( htmlspecialchars( html_entity_decode($selection, ENT_QUOTES) ) ); +} + if ( ! empty($selection) ) { $selection = preg_replace('/(\r?\n|\r)/', '

    ', $selection); - $selection = '

    '.str_replace('

    ', '', $selection).'

    '; + $selection = '

    ' . str_replace('

    ', '', $selection) . '

    '; } $url = isset($_GET['u']) ? esc_url($_GET['u']) : ''; @@ -195,7 +184,7 @@ if ( !empty($_REQUEST['ajax']) ) { */ function get_images_from_uri($uri) { $uri = preg_replace('/\/#.+?$/','', $uri); - if( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') ) + if ( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') ) return "'" . esc_attr( html_entity_decode($uri) ) . "'"; $content = wp_remote_fopen($uri); if ( false === $content ) @@ -209,9 +198,9 @@ if ( !empty($_REQUEST['ajax']) ) { $sources = array(); foreach ($matches[3] as $src) { // if no http in url - if(strpos($src, 'http') === false) + if (strpos($src, 'http') === false) // if it doesn't have a relative uri - if( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0) + if ( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0) $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); else $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src); @@ -410,8 +399,8 @@ var photostorage = false; jQuery('#waiting').hide(); jQuery('#extra-fields').show(); } - jQuery('#extra-fields').before('
    '); - + jQuery('#extra-fields').before('
    '); + if(photostorage == false) { jQuery.ajax({ type: "GET", @@ -486,35 +475,59 @@ var photostorage = false;

    - +

    -
    -
    -
    -
    -

    + +
    +

    +

    +
    -
    + -
      - + -
      - -

      - - 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?> - - - -

      +
      +
        + 'category', 'popular_cats' => $popular_ids ) ) ?> +
      + + cap->assign_terms) ) : ?> +

      + + cap->edit_terms) ) : ?> +
      +

      + + labels->add_new_item ); ?> + +

      +

      + + + + 'category', 'hide_empty' => 0, 'name' => 'newcategory_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $tax->labels->parent_item . ' —', 'tab_index' => 3 ) ); ?> + + + +

      +
      + +
    @@ -542,7 +555,7 @@ var photostorage = false;
    -

    | |

    +

    | |

    @@ -558,13 +571,13 @@ var photostorage = false;
  • Add: -<?php _e('Insert an Image'); ?> +<?php _e('Insert an Image'); ?>
  • - <?php _e('Embed a Video'); ?> + <?php _e('Embed a Video'); ?>
  • - +
  • diff --git a/wp-admin/profile.php b/wp-admin/profile.php index 7c30cdfd..97c19db4 100644 --- a/wp-admin/profile.php +++ b/wp-admin/profile.php @@ -15,5 +15,5 @@ define('IS_PROFILE_PAGE', true); /** Load User Editing Page */ -require_once('user-edit.php'); +require_once('./user-edit.php'); ?> diff --git a/wp-admin/revision.php b/wp-admin/revision.php index 9c3ce363..668ec484 100644 --- a/wp-admin/revision.php +++ b/wp-admin/revision.php @@ -7,24 +7,19 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); + +wp_enqueue_script('list-revisions'); + +wp_reset_vars(array('revision', 'left', 'right', 'action')); -wp_reset_vars(array('revision', 'left', 'right', 'diff', 'action')); $revision_id = absint($revision); -$diff = absint($diff); $left = absint($left); $right = absint($right); -$parent_file = $redirect = 'edit.php'; +$redirect = 'edit.php'; switch ( $action ) : -case 'delete' : // stubs -case 'edit' : - if ( constant('WP_POST_REVISIONS') ) // stub - $redirect = remove_query_arg( 'action' ); - else // Revisions disabled - $redirect = 'edit.php'; - break; case 'restore' : if ( !$revision = wp_get_post_revision( $revision_id ) ) break; @@ -33,8 +28,11 @@ case 'restore' : if ( !$post = get_post( $revision->post_parent ) ) break; - if ( !constant('WP_POST_REVISIONS') && !wp_is_post_autosave( $revision ) ) // Revisions disabled and we're not looking at an autosave + // Revisions disabled and we're not looking at an autosave + if ( ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) && !wp_is_post_autosave( $revision ) ) { + $redirect = 'edit.php?post_type=' . $post->post_type; break; + } check_admin_referer( "restore-post_$post->ID|$revision->ID" ); @@ -53,7 +51,7 @@ case 'diff' : // If we're comparing a revision to itself, redirect to the 'view' page for that revision or the edit page for that post if ( $left_revision->ID == $right_revision->ID ) { $redirect = get_edit_post_link( $left_revision->ID ); - include( 'js/revisions-js.php' ); + include( './js/revisions-js.php' ); break; } @@ -72,15 +70,17 @@ case 'diff' : else break; // Don't diff two unrelated revisions - if ( !constant('WP_POST_REVISIONS') ) { // Revisions disabled + if ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) { // Revisions disabled if ( // we're not looking at an autosave ( !wp_is_post_autosave( $left_revision ) && !wp_is_post_autosave( $right_revision ) ) || // we're not comparing an autosave to the current post ( $post->ID !== $left_revision->ID && $post->ID !== $right_revision->ID ) - ) + ) { + $redirect = 'edit.php?post_type=' . $post->post_type; break; + } } if ( @@ -94,6 +94,7 @@ case 'diff' : $post_title = '' . get_the_title() . ''; $h2 = sprintf( __( 'Compare Revisions of “%1$s”' ), $post_title ); + $title = __( 'Revisions' ); $left = $left_revision->ID; $right = $right_revision->ID; @@ -110,12 +111,16 @@ default : if ( !current_user_can( 'read_post', $revision->ID ) || !current_user_can( 'read_post', $post->ID ) ) break; - if ( !constant('WP_POST_REVISIONS') && !wp_is_post_autosave( $revision ) ) // Revisions disabled and we're not looking at an autosave + // Revisions disabled and we're not looking at an autosave + if ( ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) && !wp_is_post_autosave( $revision ) ) { + $redirect = 'edit.php?post_type=' . $post->post_type; break; + } $post_title = '' . get_the_title() . ''; $revision_title = wp_post_revision_title( $revision, false ); - $h2 = sprintf( __( 'Post Revision for “%1$s” created on %2$s' ), $post_title, $revision_title ); + $h2 = sprintf( __( 'Revision for “%1$s” created on %2$s' ), $post_title, $revision_title ); + $title = __( 'Revisions' ); // Sets up the diff radio buttons $left = $revision->ID; @@ -125,23 +130,22 @@ default : break; endswitch; -if ( !$redirect && !in_array( $post->post_type, array( 'post', 'page' ) ) ) +// Empty post_type means either malformed object found, or no valid parent was found. +if ( !$redirect && empty($post->post_type) ) $redirect = 'edit.php'; -if ( $redirect ) { +if ( !empty($redirect) ) { wp_redirect( $redirect ); exit; } -if ( 'page' == $post->post_type ) { - $submenu_file = 'edit-pages.php'; - $title = __( 'Page Revisions' ); -} else { - $submenu_file = 'edit.php'; - $title = __( 'Post Revisions' ); -} +// This is so that the correct "Edit" menu item is selected. +if ( !empty($post->post_type) && 'post' != $post->post_type ) + $parent_file = $submenu_file = 'edit.php?post_type=' . $post->post_type; +else + $parent_file = $submenu_file = 'edit.php'; -require_once( 'admin-header.php' ); +require_once( './admin-header.php' ); ?> @@ -206,7 +210,7 @@ endif; 'form-table', 'parent' => true, 'right' => $right, 'left' => $left ); -if ( !constant( 'WP_POST_REVISIONS' ) ) +if ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) $args['type'] = 'autosave'; wp_list_post_revisions( $post, $args ); @@ -216,5 +220,4 @@ wp_list_post_revisions( $post, $args ); The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.

    "); -if ( version_compare( '4.3', phpversion(), '>' ) ) - wp_die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %s but WordPress requires at least 4.3.'/*/WP_I18N_OLD_PHP*/, phpversion() ) ); +if ( version_compare( $required_php_version, phpversion(), '>' ) ) + wp_die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %1$s but WordPress requires at least %2$s.'/*/WP_I18N_OLD_PHP*/, phpversion(), $required_php_version ) ); if ( !extension_loaded('mysql') && !file_exists(ABSPATH . 'wp-content/db.php') ) wp_die( /*WP_I18N_OLD_MYSQL*/'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.'/*/WP_I18N_OLD_MYSQL*/ ); @@ -102,7 +109,7 @@ switch($step) {

    If for any reason this automatic file creation doesn't work, don't worry. All this does is fill in the database information to a configuration file. You may also simply open wp-config-sample.php in a text editor, fill in your information, and save it as wp-config.php.

    In all likelihood, these items were supplied to you by your Web Host. If you do not have this information, then you will need to contact them before you can continue. If you’re all ready…

    -

    Let’s go!

    +

    Let’s go!

  • - + @@ -138,6 +145,7 @@ switch($step) {
    {$plugin_data['Name']}

    {$plugin_data['Description']}

    $checkbox$plugin_name$description
    99% chance you won't need to change this value.You should be able to get this info from your web host, if localhost does not work.
    If you want to run multiple WordPress installations in a single database, change this.
    +

    ERROR: "Table Prefix" can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/ ); // Test the db connection. /**#@+ @@ -166,16 +179,49 @@ switch($step) { if ( !empty($wpdb->error) ) wp_die($wpdb->error->get_error_message()); + // Fetch or generate keys and salts. + $no_api = isset( $_POST['noapi'] ); + require_once( ABSPATH . WPINC . '/plugin.php' ); + require_once( ABSPATH . WPINC . '/l10n.php' ); + require_once( ABSPATH . WPINC . '/pomo/translations.php' ); + if ( ! $no_api ) { + require_once( ABSPATH . WPINC . '/class-http.php' ); + require_once( ABSPATH . WPINC . '/http.php' ); + wp_fix_server_vars(); + /**#@+ + * @ignore + */ + function get_bloginfo() { + return ( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . str_replace( $_SERVER['PHP_SELF'], '/wp-admin/setup-config.php', '' ) ); + } + /**#@-*/ + $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); + } + + if ( $no_api || is_wp_error( $secret_keys ) ) { + $secret_keys = array(); + require_once( ABSPATH . WPINC . '/pluggable.php' ); + for ( $i = 0; $i < 8; $i++ ) { + $secret_keys[] = wp_generate_password( 64, true, true ); + } + } else { + $secret_keys = explode( "\n", wp_remote_retrieve_body( $secret_keys ) ); + foreach ( $secret_keys as $k => $v ) { + $secret_keys[$k] = substr( $v, 28, 64 ); + } + } + $key = 0; + foreach ($configFile as $line_num => $line) { switch (substr($line,0,16)) { case "define('DB_NAME'": - $configFile[$line_num] = str_replace("putyourdbnamehere", $dbname, $line); + $configFile[$line_num] = str_replace("database_name_here", $dbname, $line); break; case "define('DB_USER'": - $configFile[$line_num] = str_replace("'usernamehere'", "'$uname'", $line); + $configFile[$line_num] = str_replace("'username_here'", "'$uname'", $line); break; case "define('DB_PASSW": - $configFile[$line_num] = str_replace("'yourpasswordhere'", "'$passwrd'", $line); + $configFile[$line_num] = str_replace("'password_here'", "'$passwrd'", $line); break; case "define('DB_HOST'": $configFile[$line_num] = str_replace("localhost", $dbhost, $line); @@ -183,6 +229,16 @@ switch($step) { case '$table_prefix =': $configFile[$line_num] = str_replace('wp_', $prefix, $line); break; + case "define('AUTH_KEY": + case "define('SECURE_A": + case "define('LOGGED_I": + case "define('NONCE_KE": + case "define('AUTH_SAL": + case "define('SECURE_A": + case "define('LOGGED_I": + case "define('NONCE_SA": + $configFile[$line_num] = str_replace('put your unique phrase here', $secret_keys[$key++], $line ); + break; } } if ( ! is_writable(ABSPATH) ) : @@ -190,9 +246,9 @@ switch($step) { ?>

    Sorry, but I can't write the wp-config.php file.

    You can create the wp-config.php manually and paste the following text into it.

    -

    After you've done that, click "Run the install."

    diff --git a/wp-admin/sidebar.php b/wp-admin/sidebar.php index 62a375d4..0f905bf6 100644 --- a/wp-admin/sidebar.php +++ b/wp-admin/sidebar.php @@ -13,7 +13,7 @@ $mode = 'sidebar'; /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); if ( ! current_user_can('edit_posts') ) wp_die(__('Cheatin’ uh?')); diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index 1d1b95ab..72cb117d 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -7,14 +7,28 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); if ( !current_user_can('edit_themes') ) - wp_die('

    '.__('You do not have sufficient permissions to edit templates for this blog.').'

    '); + wp_die('

    '.__('You do not have sufficient permissions to edit templates for this site.').'

    '); $title = __("Edit Themes"); $parent_file = 'themes.php'; +$help = '

    ' . __('You can use the Theme Editor to edit the individual CSS and PHP files which make up your theme.') . '

    '; +$help .= '

    ' . __('Begin by choosing a theme to edit from the dropdown menu and clicking Select. A list then appears of all the template files. Clicking once on any file name causes the file to appear in the large Editor box.') . '

    '; +$help .= '

    ' . __('For PHP files, you can use the Documentation dropdown to select from functions recognized in that file. Lookup takes you to a web page with reference material about that particular function.') . '

    '; +$help .= '

    ' . __('After typing in your edits, click Update File.') . '

    '; +$help .= '

    ' . __('Advice: think very carefully about your site crashing if you are live-editing the theme currently in use.') . '

    '; +$help .= '

    ' . __('Upgrading to a newer version of the same theme will override changes made here. To avoid this, consider creating a child theme instead.') . '

    '; +$help .= '

    ' . __('For more information:') . '

    '; +$help .= '

    ' . __('Documentation on Theme Development') . '

    '; +$help .= '

    ' . __('Documentation on Using Themes') . '

    '; +$help .= '

    ' . __('Documentation on Editing Files') . '

    '; +$help .= '

    ' . __('Documentation on Template Tags') . '

    '; +$help .= '

    ' . __('Support Forums') . '

    '; +add_contextual_help($current_screen, $help); + wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme', 'dir')); wp_admin_css( 'theme-editor' ); @@ -37,9 +51,9 @@ if (empty($file)) { } else { $file = stripslashes($file); if ( 'theme' == $dir ) { - $file = dirname(dirname($themes[$theme]['Template Dir'])) . $file ; + $file = dirname(dirname($themes[$theme]['Template Dir'])) . $file ; } else if ( 'style' == $dir) { - $file = dirname(dirname($themes[$theme]['Stylesheet Dir'])) . $file ; + $file = dirname(dirname($themes[$theme]['Stylesheet Dir'])) . $file ; } } @@ -79,7 +93,7 @@ break; default: - require_once('admin-header.php'); + require_once('./admin-header.php'); update_recently_edited($file); @@ -102,12 +116,11 @@ default: } $content = htmlspecialchars( $content ); - $codepress_lang = codepress_get_lang($file); } ?> -

    +

    $description (
    -

    -

    +

      ($template_show)" : "$description"; - $filedesc = ( $template_file == $file ) ? "$description ($template_show)" : $filedesc; + $filedesc = ( $description != $template_file ) ? "$description
      ($template_show)" : "$description"; + $filedesc = ( $template_file == $file ) ? "$description
      ($template_show)
      " : $filedesc; // If we have two files of the same name prefer the one in the Template Directory // This means that we display the correct files for child themes which overload Templates as well as Styles - if( array_key_exists($description, $template_mapping ) ) { + if ( array_key_exists($description, $template_mapping ) ) { if ( false !== strpos( $template_file, $template_dir ) ) { $template_mapping[ $description ] = array( _get_template_edit_filename($template_file, $template_dir), $filedesc ); } @@ -173,7 +185,7 @@ if ($allowed_files) :
    • &theme=&dir=theme">
    -

    +

      ($style_show)" : "$description"; - $filedesc = ( $style_file == $file ) ? "$description ($style_show)" : $filedesc; + $filedesc = ( $description != $style_file ) ? "$description
      ($style_show)" : "$description"; + $filedesc = ( $style_file == $file ) ? "$description
      ($style_show)
      " : $filedesc; $template_mapping[ $description ] = array( _get_template_edit_filename($style_file, $stylesheet_dir), $filedesc ); } ksort( $template_mapping ); @@ -196,17 +208,17 @@ if ($allowed_files) :
      -
      +
      -
      +
      - +
      @@ -241,4 +253,4 @@ jQuery(document).ready(function($){ break; } -include("admin-footer.php"); +include("./admin-footer.php"); diff --git a/wp-admin/theme-install.php b/wp-admin/theme-install.php index 3341db46..8b954269 100644 --- a/wp-admin/theme-install.php +++ b/wp-admin/theme-install.php @@ -7,15 +7,16 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); if ( ! current_user_can('install_themes') ) - wp_die(__('You do not have sufficient permissions to install themes on this blog.')); + wp_die(__('You do not have sufficient permissions to install themes on this site.')); include(ABSPATH . 'wp-admin/includes/theme-install.php'); $title = __('Install Themes'); $parent_file = 'themes.php'; +$submenu_file = 'themes.php'; wp_reset_vars( array('tab', 'paged') ); wp_enqueue_style( 'theme-install' ); @@ -41,22 +42,30 @@ $tabs = apply_filters('install_themes_tabs', $tabs ); $nonmenu_tabs = apply_filters('install_themes_nonmenu_tabs', $nonmenu_tabs); //If a non-valid menu tab has been selected, And its not a non-menu action. -if( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) { +if ( empty($tab) || ( ! isset($tabs[ $tab ]) && ! in_array($tab, (array)$nonmenu_tabs) ) ) { $tab_actions = array_keys($tabs); $tab = $tab_actions[0]; } -if( empty($paged) ) +if ( empty($paged) ) $paged = 1; $body_id = $tab; do_action('install_themes_pre_' . $tab); //Used to override the general interface, Eg, install or theme information. -include('admin-header.php'); +$help = '

      ' . sprintf(__('You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the WordPress.org Theme Directory. These themes are designed and developed by third parties, are available free of charge, and are licensed under the GNU General Public License, version 2, just like WordPress.'), 'http://wordpress.org/extend/themes/') . '

      '; +$help .= '

      ' . __('You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter. Alternately, you can browse the themes that are Featured, Newest, or Recently Updated. When you find a theme you like, you can preview it or install it.') . '

      '; +$help .= '

      ' . __('You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme’s folder via FTP into your /wp-content/themes directory.') . '

      '; +$help .= '

      ' . __('For more information:') . '

      '; +$help .= '

      ' . __('Documentation on Adding New Themes') . '

      '; +$help .= '

      ' . __('Support Forums') . '

      '; +add_contextual_help($current_screen, $help); + +include('./admin-header.php'); ?>
      -

      +

        $text ) {
      ' . __('Themes give your WordPress style. Once a theme is installed, you may preview it, activate it or deactivate it here.') . '

      '; -if ( current_user_can('install_themes') ) { - $help .= '

      ' . sprintf(__('You can find additional themes for your site by using the new Theme Browser/Installer functionality or by browsing the WordPress Theme Directory directly and installing manually. To install a theme manually, upload its ZIP archive with the new uploader or copy its folder via FTP into your wp-content/themes directory.'), 'theme-install.php', 'theme-install.php?tab=upload' ) . '

      '; - $help .= '

      ' . __('Once a theme is uploaded, you should see it on this page.') . '

      ' ; -} +if ( current_user_can( 'switch_themes' ) ) : + +$help = '

      ' . __('Aside from the default theme included with your WordPress installation, themes are designed and developed by third parties.') . '

      '; +$help .= '

      ' . __('You can see your active theme at the top of the screen. Below are the other themes you have installed that are not currently in use. You can see what your site would look like with one of these themes by clicking the Preview link. To change themes, click the Activate link.') . '

      '; +if ( current_user_can('install_themes') ) + $help .= '

      ' . sprintf(__('If you would like to see more themes to choose from, click on the “Install Themes” tab and you will be able to browse or search for additional themes from the WordPress.org Theme Directory. Themes in the WordPress.org Theme Directory are designed and developed by third parties, and are licensed under the GNU General Public License, version 2, just like WordPress. Oh, and they’re free!'), 'http://wordpress.org/extend/themes/') . '

      '; -add_contextual_help('themes', $help); +$help .= '

      ' . __('For more information:') . '

      '; +$help .= '

      ' . __('Documentation on Using Themes') . '

      '; +$help .= '

      ' . __('Support Forums') . '

      '; +add_contextual_help($current_screen, $help); add_thickbox(); wp_enqueue_script( 'theme-preview' ); -require_once('admin-header.php'); +endif; + +require_once('./admin-header.php'); +if ( is_multisite() && current_user_can('edit_themes') ) { + ?>

      Network Themes screen before they appear here.'), admin_url( 'ms-themes.php') ); ?>

      -

      +

      -

      widgets settings page to configure them.'), admin_url('widgets.php') ); ?>

      +

      widgets settings screen to configure them.'), admin_url( 'widgets.php' ) ); ?>

      -

      Visit site'), get_bloginfo('url') . '/'); ?>

      Visit site' ), home_url( '/' ) ); ?>

      -

      +

      - name]); @@ -84,50 +92,11 @@ $page_links = paginate_links( array( )); $themes = array_slice( $themes, $start, $per_page ); - -/** - * Check if there is an update for a theme available. - * - * Will display link, if there is an update available. - * - * @since 2.7.0 - * - * @param object $theme Theme data object. - * @return bool False if no valid info was passed. - */ -function theme_update_available( $theme ) { - static $themes_update; - if ( !isset($themes_update) ) - $themes_update = get_transient('update_themes'); - - if ( is_object($theme) && isset($theme->stylesheet) ) - $stylesheet = $theme->stylesheet; - elseif ( is_array($theme) && isset($theme['Stylesheet']) ) - $stylesheet = $theme['Stylesheet']; - else - return false; //No valid info passed. - - if ( isset($themes_update->response[ $stylesheet ]) ) { - $update = $themes_update->response[ $stylesheet ]; - $theme_name = is_object($theme) ? $theme->name : (is_array($theme) ? $theme['Name'] : ''); - $details_url = add_query_arg(array('TB_iframe' => 'true', 'width' => 1024, 'height' => 800), $update['url']); //Theme browser inside WP? replace this, Also, theme preview JS will override this on the available list. - $update_url = wp_nonce_url('update.php?action=upgrade-theme&theme=' . urlencode($stylesheet), 'upgrade-theme_' . $stylesheet); - $update_onclick = 'onclick="if ( confirm(\'' . esc_js( __("Upgrading this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to upgrade.") ) . '\') ) {return true;}return false;"'; - - if ( ! current_user_can('update_themes') ) - printf( '

      ' . __('There is a new version of %1$s available. View version %3$s Details.') . '

      ', $theme_name, $details_url, $update['new_version']); - else if ( empty($update->package) ) - printf( '

      ' . __('There is a new version of %1$s available. View version %3$s Details automatic upgrade unavailable for this theme.') . '

      ', $theme_name, $details_url, $update['new_version']); - else - printf( '

      ' . __('There is a new version of %1$s available. View version %3$s Details or upgrade automatically.') . '

      ', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick ); - } -} - ?>
      -

      +

      @@ -138,8 +107,8 @@ function theme_update_available( $theme ) { /* translators: 1: theme title, 2: theme version, 3: theme author */ printf(__('%1$s %2$s by %3$s'), $ct->title, $ct->version, $ct->author) ; ?>

      description; ?>

      -parent_theme) { ?> -

      %2$s. The stylesheet files are located in %3$s. %4$s uses templates from %5$s. Changes made to the templates will affect both themes.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ), $ct->title, $ct->parent_theme); ?>

      +parent_theme ) { ?> +

      %2$s. The stylesheet files are located in %3$s. %4$s uses templates from %5$s. Changes made to the templates will affect both themes.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ), $ct->title, $ct->parent_theme); ?>

      %2$s.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ) ); ?>

      @@ -151,6 +120,13 @@ function theme_update_available( $theme ) {
      +'; + require( './admin-footer.php' ); + exit; +} +?>

      @@ -217,8 +193,8 @@ foreach ( $cols as $col => $theme_name ) { $actions = array(); $actions[] = '' . __('Activate') . ''; $actions[] = '' . __('Preview') . ''; - if ( current_user_can('update_themes') ) - $actions[] = '' . __('Delete') . ''; + if ( current_user_can('delete_themes') ) + $actions[] = '' . __('Delete') . ''; $actions = apply_filters('theme_action_links', $actions, $themes[$theme_name]); $actions = implode ( ' | ', $actions ); @@ -233,9 +209,9 @@ foreach ( $cols as $col => $theme_name ) { printf(__('%1$s %2$s by %3$s'), $title, $version, $author) ; ?>

      - -

      %2$s. The stylesheet files are located in %3$s. %4$s uses templates from %5$s. Changes made to the templates will affect both themes.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ), $title, $parent_theme); ?>

      +

      %2$s. The stylesheet files are located in %3$s. %4$s uses templates from %5$s. Changes made to the templates will affect both themes.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ), $title, $parent_theme); ?>

      %2$s.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ) ); ?>

      @@ -250,7 +226,12 @@ foreach ( $cols as $col => $theme_name ) { -

      +

      Install Themes tab above.'), 'theme-install.php'); + else + printf(__('Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.'), get_site_option('site_name')); + ?>


      @@ -266,11 +247,11 @@ foreach ( $cols as $col => $theme_name ) { -

      -

      +

      +

      @@ -301,4 +282,4 @@ if ( count($broken_themes) ) { ?> - + diff --git a/wp-admin/tools.php b/wp-admin/tools.php index e7145f33..20cecf6b 100644 --- a/wp-admin/tools.php +++ b/wp-admin/tools.php @@ -1,97 +1,58 @@ ' . __('Press This is a bookmarklet that makes it easy to blog about something you come across on the web. You can use it to just grab a link, or to post an excerpt. Press This will even allow you to choose from images included on the page and use them in your post. Just drag the Press This link on this screen to your bookmarks bar in your browser, and you’ll be on your way to easier content creation.') . '

      ' . + '

      ' . __('Note: Turbo/Gears is no longer promoted on this screen as it was in previous versions due to the fact that Google has discontinued support for it.') . '

      ' . + '

      ' . __('For more information:') . '

      ' . + '

      ' . __('Tools Documentation') . '

      ' . + '

      ' . __('Support Forums') . '

      ' +); + +require_once('./admin-header.php'); ?>

      -
      - -
      -

      -


      -

      -

      -

      -
      -
      - - - - - - - - -
      -

      -

      +

      cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) : ?> +
      +

      +

      Use this to convert categories to tags or tags to categories.'), 'import.php' ); ?>

      +
      +
      diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index 69a9e5c0..457ca338 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -7,30 +7,44 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); if ( ! current_user_can('update_plugins') ) - wp_die(__('You do not have sufficient permissions to update plugins for this blog.')); + wp_die(__('You do not have sufficient permissions to update plugins for this site.')); function list_core_update( $update ) { - global $wp_local_package; + global $wp_local_package, $wpdb; $version_string = ('en_US' == $update->locale && 'en_US' == get_locale() ) ? $update->current : sprintf("%s–%s", $update->current, $update->locale); $current = false; if ( !isset($update->response) || 'latest' == $update->response ) $current = true; - $submit = __('Upgrade Automatically'); + $submit = __('Update Automatically'); $form_action = 'update-core.php?action=do-core-upgrade'; + $php_version = phpversion(); + $mysql_version = $wpdb->db_version(); + $show_buttons = true; if ( 'development' == $update->response ) { - $message = __('You are using a development version of WordPress. You can upgrade to the latest nightly build automatically or download the nightly build and install it manually:'); + $message = __('You are using a development version of WordPress. You can update to the latest nightly build automatically or download the nightly build and install it manually:'); $download = __('Download nightly build'); } else { if ( $current ) { - $message = sprintf(__('You have the latest version of WordPress. You do not need to upgrade. However, if you want to re-install version %s, you can do so automatically or download the package and re-install manually:'), $version_string); + $message = sprintf(__('You have the latest version of WordPress. You do not need to update. However, if you want to re-install version %s, you can do so automatically or download the package and re-install manually:'), $version_string); $submit = __('Re-install Automatically'); $form_action = 'update-core.php?action=do-core-reinstall'; } else { - $message = sprintf(__('You can upgrade to version %s automatically or download the package and install it manually:'), $version_string); + $php_compat = version_compare( $php_version, $update->php_version, '>=' ); + $mysql_compat = version_compare( $mysql_version, $update->mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); + if ( !$mysql_compat && !$php_compat ) + $message = sprintf( __('You cannot update because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $update->current, $update->php_version, $update->mysql_version, $php_version, $mysql_version ); + elseif ( !$php_compat ) + $message = sprintf( __('You cannot update because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $update->current, $update->php_version, $php_version ); + elseif ( !$mysql_compat ) + $message = sprintf( __('You cannot update because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $update->current, $update->mysql_version, $mysql_version ); + else + $message = sprintf(__('You can update to WordPress %1$s automatically or download the package and install it manually:'), $version_string); + if ( !$mysql_compat || !$php_compat ) + $show_buttons = false; } $download = sprintf(__('Download %s'), $version_string); } @@ -41,10 +55,12 @@ function list_core_update( $update ) { echo ''; wp_nonce_field('upgrade-core'); echo '

      '; - echo ' '; echo ''; echo ''; - echo '' . $download . ' '; + if ( $show_buttons ) { + echo ' '; + echo '' . $download . ' '; + } if ( 'en_US' != $update->locale ) if ( !isset( $update->dismissed ) || !$update->dismissed ) echo ''; @@ -100,8 +116,8 @@ function core_upgrade_preamble() { $updates = get_core_updates(); ?>

      - -

      + +

      '; @@ -111,15 +127,15 @@ function core_upgrade_preamble() { if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) { echo '

      '; - _e('You have the latest version of WordPress. You do not need to upgrade'); + _e('You have the latest version of WordPress.'); echo '

      '; } else { - echo '

      '; - _e('Important: before upgrading, please backup your database and files.'); + echo '

      '; + _e('Important: before updating, please backup your database and files. For help with updates, visit the Updating WordPress Codex page.'); echo '

      '; echo '

      '; - _e( 'There is a new version of WordPress available for upgrade' ); + _e( 'An updated version of WordPress is available.' ); echo '

      '; } @@ -133,10 +149,11 @@ function core_upgrade_preamble() { echo ''; } echo ''; + echo '

      ' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.' ) . '

      '; dismissed_updates(); list_plugin_updates(); - //list_theme_updates(); + list_theme_updates(); do_action('core_upgrade_preamble'); echo '
      '; } @@ -148,8 +165,11 @@ function list_plugin_updates() { require_once(ABSPATH . 'wp-admin/includes/plugin-install.php'); $plugins = get_plugin_updates(); - if ( empty($plugins) ) + if ( empty( $plugins ) ) { + echo '

      ' . __( 'Plugins' ) . '

      '; + echo '

      ' . __( 'Your plugins are all up to date.' ) . '

      '; return; + } $form_action = 'update-core.php?action=do-plugin-upgrade'; $core_updates = get_core_updates(); @@ -158,23 +178,23 @@ function list_plugin_updates() { else $core_update_version = $core_updates[0]->current; ?> -

      -

      +

      +

      -

      +

      - - + + - - + + @@ -208,49 +228,64 @@ function list_plugin_updates() { echo " - + "; } ?>
      {$plugin_data->Name}" . sprintf(__('You are running version %1$s. Upgrade to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "{$plugin_data->Name}" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "
      -

      +

      ' . __( 'Themes' ) . ''; + echo '

      ' . __( 'Your themes are all up to date.' ) . '

      '; return; + } + + $form_action = 'update-core.php?action=do-theme-upgrade'; + ?> -

      +

      +

      +

      Please Note: Any customizations you have made to the Themes files will be lost. Please consider using child themes for modifications.'), _x('http://codex.wordpress.org/Child_Themes', 'Link used in suggestion to use child themes in GUU') ); ?>

      +
      + +

      - - + + - - + + $theme_data) { + $screenshot = $theme_data->{'Theme Root URI'} . '/' . $stylesheet . '/' . $theme_data->Screenshot; + echo " - + "; } ?>
      {$theme_data->Name}{$theme_data->Name}" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $theme_data->Version, $theme_data->update['new_version']) . "
      +

      +
      -

      +

      errors->get_error_code() ) { foreach ( $wp_filesystem->errors->get_error_messages() as $message ) @@ -305,7 +340,8 @@ function do_core_upgrade( $reinstall = false ) { if ('up_to_date' != $result->get_error_code() ) show_message( __('Installation Failed') ); } else { - show_message( __('WordPress upgraded successfully') ); + show_message( __('WordPress updated successfully') ); + show_message( '' . __('Actions:') . ' ' . __('Go to Dashboard') . '' ); } echo '
      '; } @@ -334,24 +370,6 @@ function no_update_actions($actions) { return ''; } -function do_plugin_upgrade() { - include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - - if ( isset($_GET['plugins']) ) { - $plugins = explode(',', $_GET['plugins']); - } elseif ( isset($_POST['checked']) ) { - $plugins = (array) $_POST['checked']; - } else { - // Nothing to do. - return; - } - $url = 'update-core.php?action=do-plugin-upgrade&plugins=' . urlencode(join(',', $plugins)); - $title = __('Upgrade Plugins'); - $nonce = 'upgrade-core'; - $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) ); - $upgrader->bulk_upgrade($plugins); -} - $action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core'; $upgrade_error = false; @@ -360,32 +378,87 @@ if ( 'do-plugin-upgrade' == $action && !isset($_GET['plugins']) && !isset($_POST $action = 'upgrade-core'; } -$title = __('Upgrade WordPress'); +$title = __('WordPress Updates'); $parent_file = 'tools.php'; +add_contextual_help($current_screen, + '

      ' . __('This screen lets you update to the latest version of WordPress as well as update your themes and plugins from the WordPress.org repository. When updates are available, the number of available updates will appear in a bubble on the left hand menu as a notification. It is very important to keep your WordPress installation up to date for security reasons, so when you see a number appear, make sure you take the time to update, which is an easy process.') . '

      ' . + '

      ' . __('Updating your WordPress installation is a simple one-click procedure; just click on the Update button when it says a new version is available.') . '

      ' . + '

      ' . __('To upgrade themes or plugins from this screen, use the checkboxes to make your selection and click on the appropriate Update button. Check the box at the top of the Themes or Plugins section to select all and update them all at once.') . '

      ' . + '

      ' . __('For more information:') . '

      ' . + '

      ' . __('Documentation on Updating WordPress') . '

      ' . + '

      ' . __('Support Forums') . '

      ' +); + if ( 'upgrade-core' == $action ) { wp_version_check(); - require_once('admin-header.php'); + require_once('./admin-header.php'); core_upgrade_preamble(); } elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) { check_admin_referer('upgrade-core'); + // do the (un)dismiss actions before headers, // so that they can redirect if ( isset( $_POST['dismiss'] ) ) do_dismiss_core_update(); elseif ( isset( $_POST['undismiss'] ) ) - do_undismiss_core_update(); - require_once('admin-header.php'); + do_undismiss_core_update(); + + require_once('./admin-header.php'); if ( 'do-core-reinstall' == $action ) $reinstall = true; else $reinstall = false; + if ( isset( $_POST['upgrade'] ) ) do_core_upgrade($reinstall); + } elseif ( 'do-plugin-upgrade' == $action ) { check_admin_referer('upgrade-core'); - require_once('admin-header.php'); - do_plugin_upgrade(); + + if ( isset( $_GET['plugins'] ) ) { + $plugins = explode( ',', $_GET['plugins'] ); + } elseif ( isset( $_POST['checked'] ) ) { + $plugins = (array) $_POST['checked']; + } else { + wp_redirect('update-core.php'); + exit; + } + + $url = 'update.php?action=update-selected&plugins=' . urlencode(implode(',', $plugins)); + $url = wp_nonce_url($url, 'bulk-update-plugins'); + + $title = __('Update Plugins'); + + require_once('./admin-header.php'); + echo '
      '; + screen_icon('plugins'); + echo '

      ' . esc_html__('Update Plugins') . '

      '; + echo ""; + echo '
      '; +} elseif ( 'do-theme-upgrade' == $action ) { + check_admin_referer('upgrade-core'); + + if ( isset( $_GET['themes'] ) ) { + $themes = explode( ',', $_GET['themes'] ); + } elseif ( isset( $_POST['checked'] ) ) { + $themes = (array) $_POST['checked']; + } else { + wp_redirect('update-core.php'); + exit; + } + + $url = 'update.php?action=update-selected-themes&themes=' . urlencode(implode(',', $themes)); + $url = wp_nonce_url($url, 'bulk-update-themes'); + + $title = __('Update Themes'); + + require_once('./admin-header.php'); + echo '
      '; + screen_icon('themes'); + echo '

      ' . esc_html__('Update Themes') . '

      '; + echo ""; + echo '
      '; } -include('admin-footer.php'); +include('./admin-footer.php'); diff --git a/wp-admin/update-links.php b/wp-admin/update-links.php deleted file mode 100644 index f7f5c527..00000000 --- a/wp-admin/update-links.php +++ /dev/null @@ -1,56 +0,0 @@ -get_col("SELECT link_url FROM $wpdb->links"); - -if ( !$link_uris ) - wp_die(__('No links')); - -$link_uris = urlencode( join( $link_uris, "\n" ) ); - -$query_string = "uris=$link_uris"; - -$options = array(); -$options['timeout'] = 30; -$options['body'] = $query_string; - -$options['headers'] = array( - 'content-type' => 'application/x-www-form-urlencoded; charset='.get_option('blog_charset'), - 'content-length' => strlen( $query_string ), -); - -$response = wp_remote_get('http://api.pingomatic.com/updated-batch/', $options); - -if ( is_wp_error( $response ) ) - wp_die(__('Request Failed.')); - -if ( $response['response']['code'] != 200 ) - wp_die(__('Request Failed.')); - -$body = str_replace(array("\r\n", "\r"), "\n", $response['body']); -$returns = explode("\n", $body); - -foreach ($returns as $return) { - $time = substr($return, 0, 19); - $uri = preg_replace('/(.*?) | (.*?)/', '$2', $return); - $wpdb->update( $wpdb->links, array('link_updated' => $time), array('link_url' => $uri) ); -} - -?> diff --git a/wp-admin/update.php b/wp-admin/update.php index 304c81f8..0664ac8f 100644 --- a/wp-admin/update.php +++ b/wp-admin/update.php @@ -7,7 +7,7 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; @@ -16,16 +16,43 @@ if ( isset($_GET['action']) ) { $theme = isset($_REQUEST['theme']) ? urldecode($_REQUEST['theme']) : ''; $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; - if ( 'upgrade-plugin' == $action ) { + if ( 'update-selected' == $action ) { + if ( ! current_user_can( 'update_plugins' ) ) + wp_die( __( 'You do not have sufficient permissions to update plugins for this site.' ) ); + + check_admin_referer( 'bulk-update-plugins' ); + + if ( isset( $_GET['plugins'] ) ) + $plugins = explode( ',', stripslashes($_GET['plugins']) ); + elseif ( isset( $_POST['checked'] ) ) + $plugins = (array) $_POST['checked']; + else + $plugins = array(); + + $plugins = array_map('urldecode', $plugins); + + $url = 'update.php?action=update-selected&plugins=' . urlencode(implode(',', $plugins)); + $nonce = 'bulk-update-plugins'; + + require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); + wp_enqueue_script('jquery'); + iframe_header(); + + $upgrader = new Plugin_Upgrader( new Bulk_Plugin_Upgrader_Skin( compact( 'nonce', 'url' ) ) ); + $upgrader->bulk_upgrade( $plugins ); + + iframe_footer(); + + } elseif ( 'upgrade-plugin' == $action ) { if ( ! current_user_can('update_plugins') ) - wp_die(__('You do not have sufficient permissions to update plugins for this blog.')); + wp_die(__('You do not have sufficient permissions to update plugins for this site.')); check_admin_referer('upgrade-plugin_' . $plugin); $title = __('Upgrade Plugin'); $parent_file = 'plugins.php'; $submenu_file = 'plugins.php'; - require_once('admin-header.php'); + require_once('./admin-header.php'); $nonce = 'upgrade-plugin_' . $plugin; $url = 'update.php?action=upgrade-plugin&plugin=' . $plugin; @@ -33,30 +60,30 @@ if ( isset($_GET['action']) ) { $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) ); $upgrader->upgrade($plugin); - include('admin-footer.php'); + include('./admin-footer.php'); } elseif ('activate-plugin' == $action ) { if ( ! current_user_can('update_plugins') ) - wp_die(__('You do not have sufficient permissions to update plugins for this blog.')); + wp_die(__('You do not have sufficient permissions to update plugins for this site.')); check_admin_referer('activate-plugin_' . $plugin); - if( ! isset($_GET['failure']) && ! isset($_GET['success']) ) { + if ( ! isset($_GET['failure']) && ! isset($_GET['success']) ) { wp_redirect( 'update.php?action=activate-plugin&failure=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] ); - activate_plugin($plugin); + activate_plugin( $plugin, '', ! empty( $_GET['networkwide'] ) ); wp_redirect( 'update.php?action=activate-plugin&success=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] ); die(); } iframe_header( __('Plugin Reactivation'), true ); - if( isset($_GET['success']) ) + if ( isset($_GET['success']) ) echo '

      ' . __('Plugin reactivated successfully.') . '

      '; - if( isset($_GET['failure']) ){ + if ( isset($_GET['failure']) ){ echo '

      ' . __('Plugin failed to reactivate due to a fatal error.') . '

      '; if ( defined('E_RECOVERABLE_ERROR') ) - error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR); + error_reporting(E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR); else - error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING); + error_reporting(E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING); @ini_set('display_errors', true); //Ensure that Fatal errors are displayed. include(WP_PLUGIN_DIR . '/' . $plugin); @@ -65,7 +92,7 @@ if ( isset($_GET['action']) ) { } elseif ( 'install-plugin' == $action ) { if ( ! current_user_can('install_plugins') ) - wp_die(__('You do not have sufficient permissions to install plugins for this blog.')); + wp_die(__('You do not have sufficient permissions to install plugins for this site.')); include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; //for plugins_api.. @@ -78,22 +105,25 @@ if ( isset($_GET['action']) ) { $title = __('Plugin Install'); $parent_file = 'plugins.php'; $submenu_file = 'plugin-install.php'; - require_once('admin-header.php'); + require_once('./admin-header.php'); $title = sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version ); $nonce = 'install-plugin_' . $plugin; $url = 'update.php?action=install-plugin&plugin=' . $plugin; + if ( isset($_GET['from']) ) + $url .= '&from=' . urlencode(stripslashes($_GET['from'])); + $type = 'web'; //Install plugin type, From Web or an Upload. $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) ); $upgrader->install($api->download_link); - include('admin-footer.php'); + include('./admin-footer.php'); } elseif ( 'upload-plugin' == $action ) { if ( ! current_user_can('install_plugins') ) - wp_die(__('You do not have sufficient permissions to install plugins for this blog.')); + wp_die(__('You do not have sufficient permissions to install plugins for this site.')); check_admin_referer('plugin-upload'); @@ -102,7 +132,7 @@ if ( isset($_GET['action']) ) { $title = __('Upload Plugin'); $parent_file = 'plugins.php'; $submenu_file = 'plugin-install.php'; - require_once('admin-header.php'); + require_once('./admin-header.php'); $title = sprintf( __('Installing Plugin from uploaded file: %s'), basename( $file_upload->filename ) ); $nonce = 'plugin-upload'; @@ -112,12 +142,12 @@ if ( isset($_GET['action']) ) { $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) ); $upgrader->install( $file_upload->package ); - include('admin-footer.php'); + include('./admin-footer.php'); } elseif ( 'upgrade-theme' == $action ) { if ( ! current_user_can('update_themes') ) - wp_die(__('You do not have sufficient permissions to update themes for this blog.')); + wp_die(__('You do not have sufficient permissions to update themes for this site.')); check_admin_referer('upgrade-theme_' . $theme); @@ -126,7 +156,7 @@ if ( isset($_GET['action']) ) { $title = __('Upgrade Theme'); $parent_file = 'themes.php'; $submenu_file = 'themes.php'; - require_once('admin-header.php'); + require_once('./admin-header.php'); $nonce = 'upgrade-theme_' . $theme; $url = 'update.php?action=upgrade-theme&theme=' . $theme; @@ -134,12 +164,37 @@ if ( isset($_GET['action']) ) { $upgrader = new Theme_Upgrader( new Theme_Upgrader_Skin( compact('title', 'nonce', 'url', 'theme') ) ); $upgrader->upgrade($theme); - include('admin-footer.php'); + include('./admin-footer.php'); + } elseif ( 'update-selected-themes' == $action ) { + if ( ! current_user_can( 'update_themes' ) ) + wp_die( __( 'You do not have sufficient permissions to update themes for this site.' ) ); + check_admin_referer( 'bulk-update-themes' ); + + if ( isset( $_GET['themes'] ) ) + $themes = explode( ',', stripslashes($_GET['themes']) ); + elseif ( isset( $_POST['checked'] ) ) + $themes = (array) $_POST['checked']; + else + $themes = array(); + + $themes = array_map('urldecode', $themes); + + $url = 'update.php?action=update-selected-themes&themes=' . urlencode(implode(',', $themes)); + $nonce = 'bulk-update-themes'; + + require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); + wp_enqueue_script('jquery'); + iframe_header(); + + $upgrader = new Theme_Upgrader( new Bulk_Theme_Upgrader_Skin( compact( 'nonce', 'url' ) ) ); + $upgrader->bulk_upgrade( $themes ); + + iframe_footer(); } elseif ( 'install-theme' == $action ) { if ( ! current_user_can('install_themes') ) - wp_die(__('You do not have sufficient permissions to install themes for this blog.')); + wp_die(__('You do not have sufficient permissions to install themes for this site.')); include_once ABSPATH . 'wp-admin/includes/theme-install.php'; //for themes_api.. @@ -153,10 +208,10 @@ if ( isset($_GET['action']) ) { wp_enqueue_script('theme-preview'); $title = __('Install Themes'); $parent_file = 'themes.php'; - $submenu_file = 'theme-install.php'; - require_once('admin-header.php'); + $submenu_file = 'themes.php'; + require_once('./admin-header.php'); - $title = sprintf( __('Installing theme: %s'), $api->name . ' ' . $api->version ); + $title = sprintf( __('Installing Theme: %s'), $api->name . ' ' . $api->version ); $nonce = 'install-theme_' . $theme; $url = 'update.php?action=install-theme&theme=' . $theme; $type = 'web'; //Install theme type, From Web or an Upload. @@ -164,12 +219,12 @@ if ( isset($_GET['action']) ) { $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) ); $upgrader->install($api->download_link); - include('admin-footer.php'); + include('./admin-footer.php'); } elseif ( 'upload-theme' == $action ) { if ( ! current_user_can('install_themes') ) - wp_die(__('You do not have sufficient permissions to install themes for this blog.')); + wp_die(__('You do not have sufficient permissions to install themes for this site.')); check_admin_referer('theme-upload'); @@ -180,7 +235,7 @@ if ( isset($_GET['action']) ) { $submenu_file = 'theme-install.php'; add_thickbox(); wp_enqueue_script('theme-preview'); - require_once('admin-header.php'); + require_once('./admin-header.php'); $title = sprintf( __('Installing Theme from uploaded file: %s'), basename( $file_upload->filename ) ); $nonce = 'theme-upload'; @@ -190,9 +245,9 @@ if ( isset($_GET['action']) ) { $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) ); $upgrader->install( $file_upload->package ); - include('admin-footer.php'); + include('./admin-footer.php'); } else { do_action('update-custom_' . $action); } -} \ No newline at end of file +} diff --git a/wp-admin/upgrade.php b/wp-admin/upgrade.php index 2cb91a23..d0264799 100644 --- a/wp-admin/upgrade.php +++ b/wp-admin/upgrade.php @@ -20,7 +20,7 @@ require( '../wp-load.php' ); timer_start(); require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); -delete_transient('update_core'); +delete_site_transient('update_core'); if ( isset( $_GET['step'] ) ) $step = $_GET['step']; @@ -47,7 +47,10 @@ $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' <?php _e( 'WordPress › Upgrade' ); ?> - +

      WordPress

      @@ -60,11 +63,11 @@ $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ); elseif ( !$php_compat ) - printf( __('You cannot upgrade because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ); + printf( __('You cannot upgrade because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ); elseif ( !$mysql_compat ) - printf( __('You cannot upgrade because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ); + printf( __('You cannot upgrade because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ); ?>

      diff --git a/wp-admin/upload.php b/wp-admin/upload.php index 8ddb013f..355d4632 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -7,7 +7,7 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); wp_enqueue_script( 'wp-ajax-response' ); wp_enqueue_script( 'jquery-ui-draggable' ); @@ -20,14 +20,8 @@ if ( isset($_GET['find_detached']) ) { if ( !current_user_can('edit_posts') ) wp_die( __('You are not allowed to scan for lost attachments.') ); - $all_posts = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'post' OR post_type = 'page'"); - $all_att = $wpdb->get_results("SELECT ID, post_parent FROM $wpdb->posts WHERE post_type = 'attachment'"); + $lost = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent > '0' and post_parent NOT IN ( SELECT ID FROM $wpdb->posts WHERE post_type NOT IN ('attachment', '" . join("', '", get_post_types( array( 'public' => false ) ) ) . "') )"); - $lost = array(); - foreach ( (array) $all_att as $att ) { - if ( $att->post_parent > 0 && ! in_array($att->post_parent, $all_posts) ) - $lost[] = $att->ID; - } $_GET['detached'] = 1; } elseif ( isset($_GET['found_post_id']) && isset($_GET['media']) ) { @@ -48,6 +42,7 @@ if ( isset($_GET['find_detached']) ) { continue; $attach[] = $att_id; + clean_attachment_cache($att_id); } if ( ! empty($attach) ) { @@ -95,7 +90,7 @@ if ( isset($_GET['find_detached']) ) { if ( !wp_trash_post($post_id) ) wp_die( __('Error in moving to trash...') ); } - $location = add_query_arg( array( 'message' => 4, 'ids' => join(',', $post_ids) ), $location ); + $location = add_query_arg( array( 'trashed' => count($post_ids), 'ids' => join(',', $post_ids) ), $location ); break; case 'untrash': foreach( (array) $post_ids as $post_id ) { @@ -105,7 +100,7 @@ if ( isset($_GET['find_detached']) ) { if ( !wp_untrash_post($post_id) ) wp_die( __('Error in restoring from trash...') ); } - $location = add_query_arg('message', 5, $location); + $location = add_query_arg('untrashed', count($post_ids), $location); break; case 'delete': foreach( (array) $post_ids as $post_id_del ) { @@ -115,13 +110,13 @@ if ( isset($_GET['find_detached']) ) { if ( !wp_delete_attachment($post_id_del) ) wp_die( __('Error in deleting...') ); } - $location = add_query_arg('message', 2, $location); + $location = add_query_arg('deleted', count($post_ids), $location); break; } wp_redirect($location); exit; -} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { +} elseif ( ! empty($_GET['_wp_http_referer']) ) { wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); exit; } @@ -134,7 +129,7 @@ if ( ! isset( $_GET['paged'] ) || $_GET['paged'] < 1 ) if ( isset($_GET['detached']) ) { - $media_per_page = (int) get_user_option( 'upload_per_page', 0, false ); + $media_per_page = (int) get_user_option( 'upload_per_page' ); if ( empty($media_per_page) || $media_per_page < 1 ) $media_per_page = 20; $media_per_page = apply_filters( 'upload_per_page', $media_per_page ); @@ -148,7 +143,10 @@ if ( isset($_GET['detached']) ) { } else { $start = ( (int) $_GET['paged'] - 1 ) * $media_per_page; $orphans = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1 LIMIT %d, %d", $start, $media_per_page ) ); - $page_links_total = ceil($wpdb->get_var( "SELECT FOUND_ROWS()" ) / $media_per_page); + $total_orphans = $wpdb->get_var( "SELECT FOUND_ROWS()" ); + $page_links_total = ceil( $total_orphans / $media_per_page ); + $wp_query->found_posts = $total_orphans; + $wp_query->query_vars['posts_per_page'] = $media_per_page; } $post_mime_types = get_post_mime_types(); @@ -164,43 +162,53 @@ if ( isset($_GET['detached']) ) { $is_trash = ( isset($_GET['status']) && $_GET['status'] == 'trash' ); wp_enqueue_script('media'); -require_once('admin-header.php'); -do_action('restrict_manage_posts'); +add_contextual_help( $current_screen, + '

      ' . __('All the files you’ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the Screen Options tab to customize the display of this screen.') . '

      ' . + '

      ' . __('You can narrow the list by file type/status using the text link filters at the top of the screen. You also can refine the list by date using the dropdown menu above the media table.') . '

      ' . + '

      ' . __('Hovering over a row reveals action links: Edit, Delete Permanently, and View. Clicking Edit or on the media file’s name displays a simple screen to edit that individual file’s metadata. Clicking Delete Permanently will delete the file from the media library (as well as from any posts to which it is currently attached). View will take you to the display page for that file.') . '

      ' . + '

      ' . __('If a media file has not been attached to any post, you will see that in the Attached To column, and can click on Attach File to launch a small popup that will allow you to search for a post and attach the file.') . '

      ' . + '

      ' . __('For more information:') . '

      ' . + '

      ' . __('Media Library Documentation') . '

      ' . + '

      ' . __('Support Forums') . '

      ' +); + +require_once('./admin-header.php'); ?>

      ' . __('Search results for “%s”') . '', esc_html( get_search_query() ) ); ?> + printf( '' . __('Search results for “%s”') . '', get_search_query() ); ?>

      ' . __('Undo') . ''; $_SERVER['REQUEST_URI'] = remove_query_arg(array('trashed'), $_SERVER['REQUEST_URI']); } if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) { - $_GET['message'] = '5'; + $message = sprintf( _n( 'Media attachment restored from the trash.', '%d media attachments restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) ); $_SERVER['REQUEST_URI'] = remove_query_arg(array('untrashed'), $_SERVER['REQUEST_URI']); } @@ -216,7 +224,7 @@ if ( isset($_GET['message']) && (int) $_GET['message'] ) { } if ( !empty($message) ) { ?> -

      +

      @@ -480,4 +504,4 @@ if ( $page_links )
      ID ) ); + +if ( ! $user_id && IS_PROFILE_PAGE ) + $user_id = $current_user->ID; +elseif ( ! $user_id && ! IS_PROFILE_PAGE ) + wp_die(__( 'Invalid user ID.' ) ); +elseif ( ! get_userdata( $user_id ) ) + wp_die( __('Invalid user ID.') ); wp_enqueue_script('user-profile'); wp_enqueue_script('password-strength-meter'); @@ -22,22 +33,20 @@ else $submenu_file = 'profile.php'; $parent_file = 'users.php'; -wp_reset_vars(array('action', 'redirect', 'profile', 'user_id', 'wp_http_referer')); +// contextual help - choose Help on the top right of admin panel to preview this. +add_contextual_help($current_screen, + '

      ' . __('Your profile contains information about you (your “account”) as well as some personal options related to using WordPress.') . '

      ' . + '

      ' . __('You can change your password, turn on keyboard shortcuts, change the color scheme of your WordPress administration screens, and turn off the WYSIWYG (Visual) editor, among other things.') . '

      ' . + '

      ' . __('Your username cannot be changed, but you can use other fields to enter your real name or a nickname, and change which name to display on your posts.') . '

      ' . + '

      ' . __('Required fields are indicated; the rest are optional. Profile information will only be displayed if your theme is set up to do so.') . '

      ' . + '

      ' . __('Remember to click the Update Profile button when you are finished.') . '

      ' . + '

      ' . __('For more information:') . '

      ' . + '

      ' . __('Documentation on User Profiles') . '

      ' . + '

      ' . __('Support Forums') . '

      ' +); -$wp_http_referer = remove_query_arg(array('update', 'delete_count'), stripslashes($wp_http_referer)); -$user_id = (int) $user_id; - -if ( !$user_id ) { - if ( IS_PROFILE_PAGE ) { - $current_user = wp_get_current_user(); - $user_id = $current_user->ID; - } else { - wp_die(__('Invalid user ID.')); - } -} elseif ( !get_userdata($user_id) ) { - wp_die( __('Invalid user ID.') ); -} +$wp_http_referer = remove_query_arg(array('update', 'delete_count'), stripslashes($wp_http_referer)); $all_post_caps = array('posts', 'pages'); $user_can_edit = false; @@ -60,6 +69,30 @@ function use_ssl_preference($user) { ID && ! apply_filters( 'enable_edit_any_user_configuration', true ) ) + wp_die( __( 'You do not have permission to edit this user.' ) ); + +// Execute confirmed email change. See send_confirmation_on_profile_email(). +if ( is_multisite() && IS_PROFILE_PAGE && isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) { + $new_email = get_option( $current_user->ID . '_new_email' ); + if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) { + $user->ID = $current_user->ID; + $user->user_email = esc_html( trim( $new_email[ 'newemail' ] ) ); + if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) ) + $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $current_user->user_login ) ); + wp_update_user( get_object_vars( $user ) ); + delete_option( $current_user->ID . '_new_email' ); + wp_redirect( add_query_arg( array('updated' => 'true'), admin_url( 'profile.php' ) ) ); + die(); + } +} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) { + delete_option( $current_user->ID . '_new_email' ); + wp_redirect( add_query_arg( array('updated' => 'true'), admin_url( 'profile.php' ) ) ); + die(); +} + switch ($action) { case 'switchposts': @@ -81,7 +114,33 @@ if ( IS_PROFILE_PAGE ) else do_action('edit_user_profile_update', $user_id); -$errors = edit_user($user_id); +if ( !is_multisite() ) { + $errors = edit_user($user_id); +} else { + $user = get_userdata( $user_id ); + + // Update the email address in signups, if present. + if ( $user->user_login && isset( $_POST[ 'email' ] ) && is_email( $_POST[ 'email' ] ) && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $user->user_login ) ) ) + $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $_POST[ 'email' ], $user_login ) ); + + // WPMU must delete the user from the current blog if WP added him after editing. + $delete_role = false; + $blog_prefix = $wpdb->get_blog_prefix(); + if ( $user_id != $current_user->ID ) { + $cap = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = '{$user_id}' AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'" ); + if ( null == $cap && $_POST[ 'role' ] == '' ) { + $_POST[ 'role' ] = 'contributor'; + $delete_role = true; + } + } + if ( !isset( $errors ) || ( isset( $errors ) && is_object( $errors ) && false == $errors->get_error_codes() ) ) + $errors = edit_user($user_id); + if ( $delete_role ) // stops users being added to current blog when they are edited + delete_user_meta( $user_id, $blog_prefix . 'capabilities' ); + + if ( is_multisite() && !IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) ) + empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id ); +} if ( !is_wp_error( $errors ) ) { $redirect = (IS_PROFILE_PAGE ? "profile.php?" : "user-edit.php?user_id=$user_id&"). "updated=true"; @@ -99,8 +158,11 @@ if ( !current_user_can('edit_user', $user_id) ) include ('admin-header.php'); ?> +ID ) && current_user_can( 'manage_network_options' ) ) { ?> +

      + -
      +

      @@ -108,21 +170,14 @@ include ('admin-header.php');
      -
      -
        - get_error_messages() as $message ) - echo "
      • $message
      • "; - ?> -
      -
      +

      \n

      ", $errors->get_error_messages() ); ?>

      - +> @@ -141,37 +196,20 @@ include ('admin-header.php'); - 1 ) : ?> + 1 && has_action('admin_color_scheme_picker') ) : ?> -
      - $color_info ): ?> -
      /> - - - colors as $html_color ): ?> - - - -
       
      - - -
      - -
      + - + More information'); ?> @@ -185,7 +223,7 @@ do_action('personal_options', $profileuser); - + @@ -202,20 +240,24 @@ wp_dropdown_roles($user_role); // print the 'no role' option. Make it selected if the user has no role yet. if ( $user_role ) - echo ''; + echo ''; else - echo ''; + echo ''; ?> - + + +

      + + - + - + @@ -230,8 +272,8 @@ else
      - + @@ -304,11 +355,10 @@ if ( $show_password_fields ) :
      + ID . '_new_email' ); + if ( $new_email && $new_email != $current_user->user_email ) : ?> +
      +

      %1$s. Cancel'), $new_email['newemail'], esc_url( admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?>

      +
      + +
      caps) > count($profileuser->roles) && apply_filters('additional_capabilities_display', true, $profileuser) ) { ?> @@ -341,6 +391,12 @@ if ( $show_password_fields ) : + + diff --git a/wp-admin/user-new.php b/wp-admin/user-new.php index 9d143253..50d6f1e7 100644 --- a/wp-admin/user-new.php +++ b/wp-admin/user-new.php @@ -7,41 +7,152 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); if ( !current_user_can('create_users') ) wp_die(__('Cheatin’ uh?')); +if ( is_multisite() && !get_site_option( 'add_new_users' ) ) + wp_die( __('Page disabled by the administrator') ); + /** WordPress Registration API */ require_once( ABSPATH . WPINC . '/registration.php'); +if ( is_multisite() ) { + function admin_created_user_email( $text ) { + return sprintf( __( "Hi, +You've been invited to join '%s' at +%s as a %s. +If you do not want to join this site please ignore +this email. This invitation will expire in a few days. + +Please click the following link to activate your user account: +%%s" ), get_bloginfo('name'), site_url(), esc_html( $_REQUEST[ 'role' ] ) ); + } + add_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email' ); + + function admin_created_user_subject( $text ) { + return "[" . get_bloginfo('name') . "] Your site invite"; + } +} + if ( isset($_REQUEST['action']) && 'adduser' == $_REQUEST['action'] ) { check_admin_referer('add-user'); - if ( ! current_user_can('create_users') ) - wp_die(__('You can’t create users.')); + if ( !is_multisite() ) { + $user_id = add_user(); - $user_id = add_user(); - - if ( is_wp_error( $user_id ) ) { - $add_user_errors = $user_id; + if ( is_wp_error( $user_id ) ) { + $add_user_errors = $user_id; + } else { + if ( current_user_can('edit_users') ) { + $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_REQUEST['user_login']), true)); + $redirect = 'users.php?usersearch='. urlencode($new_user_login) . '&update=add' . '#user-' . $user_id; + } else { + $redirect = add_query_arg( 'update', 'add', 'user-new.php' ); + } + wp_redirect( $redirect ); + die(); + } } else { - $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_REQUEST['user_login']), true)); - $redirect = 'users.php?usersearch='. urlencode($new_user_login) . '&update=add'; - wp_redirect( $redirect . '#user-' . $user_id ); - die(); + $user_login = preg_replace( "/\s+/", '', sanitize_user( $_REQUEST[ 'user_login' ], true ) ); + $user_details = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->users} WHERE user_login = %s AND user_email = %s", $user_login, $_REQUEST[ 'email' ] ) ); + if ( $user_details ) { + // Adding an existing user to this blog + $new_user_email = esc_html(trim($_REQUEST['email'])); + $redirect = 'user-new.php'; + $username = $user_details->user_login; + $user_id = $user_details->ID; + if ( ( $username != null && !is_super_admin( $user_id ) ) && ( array_key_exists($blog_id, get_blogs_of_user($user_id)) ) ) { + $redirect = add_query_arg( array('update' => 'addexisting'), 'user-new.php' ); + } else { + if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) { + add_existing_user_to_blog( array( 'user_id' => $user_id, 'role' => $_REQUEST[ 'role' ] ) ); + $redirect = add_query_arg( array('update' => 'addnoconfirmation'), 'user-new.php' ); + } else { + $newuser_key = substr( md5( $user_id ), 0, 5 ); + add_option( 'new_user_' . $newuser_key, array( 'user_id' => $user_id, 'email' => $user_details->user_email, 'role' => $_REQUEST[ 'role' ] ) ); + $message = __("Hi,\n\nYou have been invited to join '%s' at\n%s as a %s.\nPlease click the following link to confirm the invite:\n%s\n"); + wp_mail( $new_user_email, sprintf( __( '[%s] Joining confirmation' ), get_option( 'blogname' ) ), sprintf($message, get_option('blogname'), site_url(), $_REQUEST[ 'role' ], site_url("/newbloguser/$newuser_key/"))); + $redirect = add_query_arg( array('update' => 'add'), 'user-new.php' ); + } + } + wp_redirect( $redirect ); + die(); + } else { + // Adding a new user to this blog + $user_details = wpmu_validate_user_signup( $_REQUEST[ 'user_login' ], $_REQUEST[ 'email' ] ); + unset( $user_details[ 'errors' ]->errors[ 'user_email_used' ] ); + if ( is_wp_error( $user_details[ 'errors' ] ) && !empty( $user_details[ 'errors' ]->errors ) ) { + $add_user_errors = $user_details[ 'errors' ]; + } else { + $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_REQUEST['user_login']), true)); + if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) { + add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email + } + wpmu_signup_user( $new_user_login, $_REQUEST[ 'email' ], array( 'add_to_blog' => $wpdb->blogid, 'new_role' => $_REQUEST[ 'role' ] ) ); + if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) { + $key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $_REQUEST[ 'email' ] ) ); + wpmu_activate_signup( $key ); + $redirect = add_query_arg( array('update' => 'addnoconfirmation'), 'user-new.php' ); + } else { + $redirect = add_query_arg( array('update' => 'newuserconfimation'), 'user-new.php' ); + } + wp_redirect( $redirect ); + die(); + } + } } } $title = __('Add New User'); $parent_file = 'users.php'; +add_contextual_help($current_screen, + '

      ' . __('To add a new user to your site, fill in the form on this screen. If you’re not sure which role to assign, you can use the link below to review the different roles and their capabilities. Here is a basic overview of roles:') . '

      ' . + '
        ' . + '
      • ' . __('Administrators have access to all the administration features.') . '
      • ' . + '
      • ' . __('Editors can publish posts, manage posts as well as manage other people’s posts, etc.') . '
      • ' . + '
      • ' . __('Authors can publish and manage their own posts.') . '
      • ' . + '
      • ' . __('Contributors can write and manage their posts but not publish posts or upload media files.') . '
      • ' . + '
      • ' . __('Subscribers can read comments/comment/receive newsletters, etc.') . '
      • ' . + '
      ' . + '

      ' . __('You must assign a password to the new user, but don’t worry; when they log in for the first time they will be prompted to change it. The username, however, cannot be changed.') . '

      ' . + '

      ' . __('New users will receive an email letting them know they’ve been added as a user for your site. By default, this email will also contain their password. Uncheck the box if you do not the password to be included in the welcome email.') . '

      ' . + '

      ' . __('Remember to click the Add User button at the bottom of this screen when you are finished.') . '

      ' . + '

      ' . __('For more information:') . '

      ' . + '

      ' . __('Documentation on Adding New Users') . '

      ' . + '

      ' . __('Support Forums') . '

      ' +); + wp_enqueue_script('wp-ajax-response'); wp_enqueue_script('user-profile'); wp_enqueue_script('password-strength-meter'); require_once ('admin-header.php'); +if ( isset($_GET['update']) ) { + $messages = array(); + if ( is_multisite() ) { + switch ( $_GET['update'] ) { + case "newuserconfimation": + $messages[] = __('Invitation email sent to new user. A confirmation link must be clicked before their account is created.'); + break; + case "add": + $messages[] = __('Invitation email sent to user. A confirmation link must be clicked for them to be added to your site.'); + break; + case "addnoconfirmation": + $messages[] = __('User has been added to your site.'); + break; + case "addexisting": + $messages[] = __('That user is already a member of this site.'); + break; + } + } else { + if ( 'add' == $_GET['update'] ) + $messages[] = __('User added.'); + } +} ?>
      @@ -58,9 +169,9 @@ require_once ('admin-header.php');

      ' . $msg . '

      '; } ?> @@ -74,12 +185,17 @@ if ( ! empty($messages) ) {
      ' . sprintf(__('Users can register themselves or you can manually create users here.'), site_url('wp-register.php')) . '

      '; else echo '

      ' . sprintf(__('Users cannot currently register themselves, but you can manually create users here.'), admin_url('options-general.php#users_can_register')) . '

      '; +} else { + echo '

      ' . __( 'You can add new users to your site in two ways:' ) . '

      1. ' . __( 'Enter the username and email address of an existing user on this site.' ) . '
      2. ' . __( 'Enter the username and the email address of a person who is not already a member of this site. Choose the username carefully, it cannot be changed.' ) . '

      '; + echo '

      ' . __( 'That person will be sent an email asking them to click a link confirming the invite. New users will then be sent an email with a randomly generated password and a login link.' ) . '

      '; +} ?> - +> + + + + + @@ -105,18 +226,13 @@ $new_user_send_password = !$_POST || isset($_POST['send_password']); - - - - - - +
      @@ -130,7 +246,7 @@ $new_user_send_password = !$_POST || isset($_POST['send_password']); - + + + + + + +

      @@ -150,5 +272,5 @@ $new_user_send_password = !$_POST || isset($_POST['send_password']);

      diff --git a/wp-admin/users.php b/wp-admin/users.php index d11ee53d..aeaabc3b 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -7,17 +7,28 @@ */ /** WordPress Administration Bootstrap */ -require_once('admin.php'); +require_once('./admin.php'); /** WordPress Registration API */ require_once( ABSPATH . WPINC . '/registration.php'); -if ( !current_user_can('edit_users') ) +if ( !current_user_can('list_users') ) wp_die(__('Cheatin’ uh?')); $title = __('Users'); $parent_file = 'users.php'; +// contextual help - choose Help on the top right of admin panel to preview this. +add_contextual_help($current_screen, + '

      ' . __('This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options when they are logged in, based on their role.') . '

      ' . + '

      ' . __('You can customize the display of information on this screen as you can on other screens, by using the Screen Options tab and the on-screen filters.') . '

      ' . + '

      ' . __('To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.') . '

      ' . + '

      ' . __('For more information:') . '

      ' . + '

      ' . __('Documentation on Authors and Users') . '

      ' . + '

      ' . __('Roles and Capabilities Descriptions') . '

      ' . + '

      ' . __('Support Forums') . '

      ' +); + $update = $doaction = ''; if ( isset($_REQUEST['action']) ) $doaction = $_REQUEST['action'] ? $_REQUEST['action'] : $_REQUEST['action2']; @@ -43,26 +54,32 @@ switch ($doaction) { case 'promote': check_admin_referer('bulk-users'); - if (empty($_REQUEST['users'])) { + if ( empty($_REQUEST['users']) ) { wp_redirect($redirect); exit(); } $editable_roles = get_editable_roles(); - if (!$editable_roles[$_REQUEST['new_role']]) + if ( empty( $editable_roles[$_REQUEST['new_role']] ) ) wp_die(__('You can’t give users that role.')); $userids = $_REQUEST['users']; $update = 'promote'; - foreach($userids as $id) { - if ( ! current_user_can('edit_user', $id) ) + foreach ( $userids as $id ) { + $id = (int) $id; + + if ( ! current_user_can('promote_user', $id) ) wp_die(__('You can’t edit that user.')); - // The new role of the current user must also have edit_users caps - if($id == $current_user->ID && !$wp_roles->role_objects[$_REQUEST['new_role']]->has_cap('edit_users')) { + // The new role of the current user must also have promote_users caps + if ( $id == $current_user->ID && !$wp_roles->role_objects[$_REQUEST['new_role']]->has_cap('promote_users') ) { $update = 'err_admin_role'; continue; } + // If the user doesn't already belong to the blog, bail. + if ( is_multisite() && !is_user_member_of_blog( $id ) ) + wp_die(__('Cheatin’ uh?')); + $user = new WP_User($id); $user->set_role($_REQUEST['new_role']); } @@ -73,6 +90,8 @@ case 'promote': break; case 'dodelete': + if ( is_multisite() ) + wp_die( __('User deletion is not allowed from this screen.') ); check_admin_referer('delete-users'); @@ -81,7 +100,7 @@ case 'dodelete': exit(); } - if ( !current_user_can('delete_users') ) + if ( ! current_user_can( 'delete_users' ) ) wp_die(__('You can’t delete users.')); $userids = $_REQUEST['users']; @@ -89,19 +108,23 @@ case 'dodelete': $delete_count = 0; foreach ( (array) $userids as $id) { - if ( ! current_user_can('delete_user', $id) ) - wp_die(__('You can’t delete that user.')); + $id = (int) $id; + + if ( ! current_user_can( 'delete_user', $id ) ) + wp_die(__( 'You can’t delete that user.' ) ); - if($id == $current_user->ID) { + if ( $id == $current_user->ID ) { $update = 'err_admin_del'; continue; } - switch($_REQUEST['delete_option']) { + switch ( $_REQUEST['delete_option'] ) { case 'delete': - wp_delete_user($id); + if ( current_user_can('delete_user', $id) ) + wp_delete_user($id); break; case 'reassign': - wp_delete_user($id, $_REQUEST['reassign_user']); + if ( current_user_can('delete_user', $id) ) + wp_delete_user($id, $_REQUEST['reassign_user']); break; } ++$delete_count; @@ -114,6 +137,8 @@ case 'dodelete': break; case 'delete': + if ( is_multisite() ) + wp_die( __('User deletion is not allowed from this screen.') ); check_admin_referer('bulk-users'); @@ -122,8 +147,8 @@ case 'delete': exit(); } - if ( !current_user_can('delete_users') ) - $errors = new WP_Error('edit_users', __('You can’t delete users.')); + if ( ! current_user_can( 'delete_users' ) ) + $errors = new WP_Error( 'edit_users', __( 'You can’t delete users.' ) ); if ( empty($_REQUEST['users']) ) $userids = array(intval($_REQUEST['user'])); @@ -153,7 +178,13 @@ case 'delete': $go_delete = true; } } - $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users ORDER BY user_login"); + // @todo Delete is always for !is_multisite(). Use API. + if ( !is_multisite() ) { + $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users ORDER BY user_login"); + } else { + // WPMU only searches users of current blog + $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users, $wpdb->usermeta WHERE $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '".$wpdb->prefix."capabilities' ORDER BY user_login"); + } $user_dropdown = '" . sprintf(__('ID #%1s: %2s'), $id, $user->user_login) . "\n"; + $go_remove = true; + } + } + ?> + + +

      + +

      + +
      + +get_results()); + + // Query the users for this page + cache_users($wp_user_search->get_results()); + $messages = array(); if ( isset($_GET['update']) ) : switch($_GET['update']) { case 'del': case 'del_many': $delete_count = isset($_GET['delete_count']) ? (int) $_GET['delete_count'] : 0; - $messages[] = '

      ' . sprintf(_n('%s user deleted', '%s users deleted', $delete_count), $delete_count) . '

      '; + $messages[] = '

      ' . sprintf(_n('%s user deleted', '%s users deleted', $delete_count), $delete_count) . '

      '; break; case 'add': - $messages[] = '

      ' . __('New user created.') . '

      '; + $messages[] = '

      ' . __('New user created.') . '

      '; break; case 'promote': - $messages[] = '

      ' . __('Changed roles.') . '

      '; + $messages[] = '

      ' . __('Changed roles.') . '

      '; break; case 'err_admin_role': $messages[] = '

      ' . __('The current user’s role must have user editing capabilities.') . '

      '; - $messages[] = '

      ' . __('Other user roles have been changed.') . '

      '; + $messages[] = '

      ' . __('Other user roles have been changed.') . '

      '; break; case 'err_admin_del': $messages[] = '

      ' . __('You can’t delete the current user.') . '

      '; - $messages[] = '

      ' . __('Other users have been deleted.') . '

      '; + $messages[] = '

      ' . __('Other users have been deleted.') . '

      '; + break; + case 'remove': + $messages[] = '

      ' . __('User removed from this site.') . '

      '; + break; + case 'err_admin_remove': + $messages[] = '

      ' . __("You can't remove the current user.") . '

      '; + $messages[] = '

      ' . __('Other users have been removed.') . '

      '; break; } endif; ?> @@ -239,7 +371,7 @@ if ( ! empty($messages) ) {
      -

      ' . __('Search results for “%s”') . '', esc_html( $_GET['usersearch'] ) ); ?>

      @@ -248,22 +380,14 @@ if ( isset($_GET['usersearch']) && $_GET['usersearch'] )
        meta_value); - foreach ( (array) $b_roles as $b_role => $val ) { - if ( !isset($avail_roles[$b_role]) ) - $avail_roles[$b_role] = 0; - $avail_roles[$b_role]++; - } -} +$users_of_blog = count_users(); +$total_users = $users_of_blog['total_users']; +$avail_roles =& $users_of_blog['avail_roles']; unset($users_of_blog); $current_role = false; $class = empty($role) ? ' class="current"' : ''; +$role_links = array(); $role_links[] = "
      • " . sprintf( _nx( 'All (%s)', 'All (%s)', $total_users, 'users' ), number_format_i18n( $total_users ) ) . ''; foreach ( $wp_roles->get_names() as $this_role => $name ) { if ( !isset($avail_roles[$this_role]) ) @@ -306,7 +430,11 @@ unset($role_links);
        @@ -356,8 +484,11 @@ foreach ( $wp_user_search->get_results() as $userid ) { $roles = $user_object->roles; $role = array_shift($roles); + if ( is_multisite() && empty( $role ) ) + continue; + $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"'; - echo "\n\t" . user_row($user_object, $style, $role); + echo "\n\t", user_row( $user_object, $style, $role, $post_counts[ $userid ] ); } ?> @@ -372,8 +503,11 @@ foreach ( $wp_user_search->get_results() as $userid ) {
        + + +
        @@ -385,11 +519,21 @@ foreach ( $wp_user_search->get_results() as $userid ) {
        + 'user_login', 'first_name' => 'user_firstname', 'last_name' => 'user_lastname', 'email' => 'user_email', 'url' => 'user_uri', 'role' => 'user_role') as $formpost => $var ) { + $var = 'new_' . $var; + $$var = isset($_REQUEST[$formpost]) ? esc_attr(stripslashes($_REQUEST[$formpost])) : ''; + } + unset($name); +} +?> +
        diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php index e28f46ae..d3c401b1 100644 --- a/wp-admin/widgets.php +++ b/wp-admin/widgets.php @@ -7,12 +7,12 @@ */ /** WordPress Administration Bootstrap */ -require_once( 'admin.php' ); +require_once( './admin.php' ); /** WordPress Administration Widgets API */ require_once(ABSPATH . 'wp-admin/includes/widgets.php'); -if ( ! current_user_can('switch_themes') ) +if ( ! current_user_can('edit_theme_options') ) wp_die( __( 'Cheatin’ uh?' )); wp_admin_css( 'widgets' ); @@ -33,6 +33,19 @@ do_action( 'sidebar_admin_setup' ); $title = __( 'Widgets' ); $parent_file = 'themes.php'; +$help = ' +

        ' . __('Widgets are independent sections of content that can be placed into any widgetized area provided by your theme (commonly called sidebars). To populate your sidebars/widget areas with individual widgets, drag and drop the title bars into the desired area. By default, only the first widget area is expanded. To populate additional widget areas, click on their title bars to expand them.') . '

        +

        ' . __('Available Widgets section contains all the widgets you can choose from. Once you drag a widget into a sidebar, it will open to allow you to configure its settings. When you are happy with the widget settings, click the Save button and the widget will go live on your site. If you click Delete, it will remove the widget.') . '

        +

        ' . __('If you want to remove the widget but save its setting for possible future use, just drag it into the Inactive Widgets area. You can add them back anytime from there. This is especially helpful when you switch to a theme with fewer or different widget areas.') . '

        +

        ' . __('Widgets may be used multiple times. You can give each widget a title, to display on your site, but it’s not required.') . '

        +

        ' . __('Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.') . '

        +

        ' . __('Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.') . '

        +'; +$help .= '

        ' . __('For more information:') . '

        '; +$help .= '

        ' . __('Widgets Documentation') . '

        '; +$help .= '

        ' . __('Support Forums') . '

        '; +add_contextual_help($current_screen, $help); + // register the inactive_widgets area as sidebar register_sidebar(array( 'name' => __('Inactive Widgets'), @@ -120,7 +133,7 @@ retrieve_widgets(); if ( count($wp_registered_sidebars) == 1 ) { // If only "wp_inactive_widgets" is defined the theme has no sidebars, die. - require_once( 'admin-header.php' ); + require_once( './admin-header.php' ); ?>
        @@ -133,7 +146,7 @@ if ( count($wp_registered_sidebars) == 1 ) {
        + require_once( './admin-header.php' ); ?>

        @@ -279,7 +292,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) { } $selected = ''; echo "\t\t (What is this?'); ?>)

        +

        (What is this?'); ?>)

        +

        @@ -155,35 +155,37 @@ function akismet_conf() {

        0 ) { - // some connections work, some fail - if ( $fail_count > 0 && $fail_count < count($servers) ) { ?> -

        -

        this information about Akismet and firewalls.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

        - 0 ) { ?> -

        -

        Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet and firewalls.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

        - -

        -

        -

        -

        fsockopen function. Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet\'s system requirements.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

        +

        fsockopen or gethostbynamel functions. Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet\'s system requirements.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

        -

        -

        Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet and firewalls.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

        - 0 ) { + // some connections work, some fail + if ( $fail_count > 0 && $fail_count < count($servers) ) { ?> +

        +

        this information about Akismet and firewalls.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

        + 0 ) { ?> +

        +

        Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet and firewalls.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

        + +

        +

        + +

        +

        Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet and firewalls.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

        +

        ".__('Akismet is almost ready.')." ".sprintf(__('You must enter your WordPress.com API key for it to work.'), "plugins.php?page=akismet-key-config")."

        +

        ".__('Akismet is almost ready.')." ".sprintf(__('You must enter your Akismet API key for it to work.'), "plugins.php?page=akismet-key-config")."

        "; } add_action('admin_notices', 'akismet_warning'); @@ -370,6 +372,22 @@ function akismet_get_host($host) { return $host; } +// return a comma-separated list of role names for the given user +function akismet_get_user_roles($user_id ) { + $roles = false; + + if ( !class_exists('WP_User') ) + return false; + + if ( $user_id > 0 ) { + $comment_user = new WP_User($user_id); + if ( isset($comment_user->roles) ) + $roles = join(',', $comment_user->roles); + } + + return $roles; +} + // Returns array with headers in $response[0] and body in $response[1] function akismet_http_post($request, $host, $path, $port = 80, $ip=null) { global $wp_version; @@ -415,13 +433,15 @@ function akismet_result_spam( $approved ) { function akismet_auto_check_comment( $comment ) { global $akismet_api_host, $akismet_api_port; - $comment['user_ip'] = preg_replace( '/[^0-9., ]/', '', $_SERVER['REMOTE_ADDR'] ); + $comment['user_ip'] = $_SERVER['REMOTE_ADDR']; $comment['user_agent'] = $_SERVER['HTTP_USER_AGENT']; $comment['referrer'] = $_SERVER['HTTP_REFERER']; $comment['blog'] = get_option('home'); $comment['blog_lang'] = get_locale(); $comment['blog_charset'] = get_option('blog_charset'); $comment['permalink'] = get_permalink($comment['comment_post_ID']); + + $comment['user_role'] = akismet_get_user_roles($comment['user_ID']); $ignore = array( 'HTTP_COOKIE' ); @@ -445,7 +465,7 @@ function akismet_auto_check_comment( $comment ) { $diff = time() - $last_updated; $diff = $diff / 86400; - if ( $post->post_type == 'post' && $diff > 30 && get_option( 'akismet_discard_month' ) == 'true' ) { + if ( $post->post_type == 'post' && $diff > 30 && get_option( 'akismet_discard_month' ) == 'true' && empty($comment['user_ID']) ) { // akismet_result_spam() won't be called so bump the counter here if ( $incr = apply_filters('akismet_spam_count_incr', 1) ) update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr ); @@ -468,7 +488,7 @@ function akismet_delete_old() { function akismet_submit_nonspam_comment ( $comment_id ) { global $wpdb, $akismet_api_host, $akismet_api_port, $current_user, $current_site; $comment_id = (int) $comment_id; - + $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_id'"); if ( !$comment ) // it was deleted return; @@ -482,6 +502,8 @@ function akismet_submit_nonspam_comment ( $comment_id ) { if ( is_object($current_site) ) { $comment->site_domain = $current_site->domain; } + $comment->user_role = akismet_get_user_roles($comment->user_ID); + $query_string = ''; foreach ( $comment as $key => $data ) $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; @@ -508,6 +530,7 @@ function akismet_submit_spam_comment ( $comment_id ) { if ( is_object($current_site) ) { $comment->site_domain = $current_site->domain; } + $comment->user_role = akismet_get_user_roles($comment->user_ID); $query_string = ''; foreach ( $comment as $key => $data ) $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; @@ -515,13 +538,39 @@ function akismet_submit_spam_comment ( $comment_id ) { $response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-spam", $akismet_api_port); } -add_action('wp_set_comment_status', 'akismet_submit_spam_comment'); -add_action('edit_comment', 'akismet_submit_spam_comment'); add_action('preprocess_comment', 'akismet_auto_check_comment', 1); +// For old versions of WP only +function akismet_set_comment_status( $comment_id, $status ) { + if ( $status == 'spam' ) { + akismet_submit_spam_comment( $comment_id ); + } elseif ( $status == 'approve' ) { + akismet_submit_nonspam_comment( $comment_id ); + } +} + +// For WP 2.7+ +function akismet_transition_comment_status( $new_status, $old_status, $comment ) { + if ( $new_status == $old_status ) + return; + + if ( $new_status == 'spam' ) { + akismet_submit_spam_comment( $comment->comment_ID ); + } elseif ( $old_status == 'spam' && ( $new_status == 'approved' || $new_status == 'unapproved' ) ) { + akismet_submit_nonspam_comment( $comment->comment_ID ); + } +} + function akismet_spamtoham( $comment ) { akismet_submit_nonspam_comment( $comment->comment_ID ); } -add_filter( 'comment_spam_to_approved', 'akismet_spamtoham' ); +if ( function_exists( 'wp_transition_comment_status' ) ) { + add_action( 'transition_comment_status', 'akismet_transition_comment_status', 10, 3 ); +} else { + add_action('wp_set_comment_status', 'akismet_set_comment_status', 10, 2); + add_action('edit_comment', 'akismet_submit_spam_comment'); + add_filter( 'comment_spam_to_approved', 'akismet_spamtoham' ); + add_filter( 'comment_spam_to_unapproved', 'akismet_spamtoham' ); +} // Total spam in queue // get_option( 'akismet_spam_count' ) is the total caught ever function akismet_spam_count( $type = false ) { @@ -956,6 +1005,8 @@ function akismet_rightnow() { add_action('rightnow_end', 'akismet_rightnow'); // For WP <= 2.3.x +global $pagenow; + if ( 'moderation.php' == $pagenow ) { function akismet_recheck_button( $page ) { global $submenu; @@ -999,6 +1050,7 @@ function akismet_recheck_queue() { $c['blog_lang'] = get_locale(); $c['blog_charset'] = get_option('blog_charset'); $c['permalink'] = get_permalink($c['comment_post_ID']); + $c['user_role'] = akismet_get_user_roles($c['user_ID']); $id = (int) $c['comment_ID']; $query_string = ''; @@ -1055,7 +1107,7 @@ function widget_akismet_register() { ?> - + diff --git a/wp-content/themes/classic/comments.php b/wp-content/themes/classic/comments.php deleted file mode 100644 index 3ccd0740..00000000 --- a/wp-content/themes/classic/comments.php +++ /dev/null @@ -1,82 +0,0 @@ - -

        - - -

        - - ">» - -

        - - -
          - - -
        1. id="comment-"> - - -

          @

          -
        2. - - - -
        - - -

        - - -

        RSS feed for comments on this post.')); ?> - - URL'); ?> - -

        - - -

        - - -

        logged in to post a comment.'), wp_login_url( get_permalink() ) );?>

        - - -
        - - - -

        '.$user_identity.''); ?>

        - - - -

        -

        - -

        -

        - -

        -

        - - - - - -

        - -

        - -

        -ID); ?> - -
        - - - - -

        - diff --git a/wp-content/themes/classic/footer.php b/wp-content/themes/classic/footer.php deleted file mode 100644 index 819ed428..00000000 --- a/wp-content/themes/classic/footer.php +++ /dev/null @@ -1,18 +0,0 @@ - - -
      - - - -

      WordPress"), __("Powered by WordPress, state-of-the-art semantic personal publishing platform.")); ?>

      - -
    - - - - \ No newline at end of file diff --git a/wp-content/themes/classic/functions.php b/wp-content/themes/classic/functions.php deleted file mode 100644 index 1bc06e22..00000000 --- a/wp-content/themes/classic/functions.php +++ /dev/null @@ -1,17 +0,0 @@ - '
  • ', - 'after_widget' => '
  • ', - 'before_title' => '', - 'after_title' => '', - )); - -?> diff --git a/wp-content/themes/classic/header.php b/wp-content/themes/classic/header.php deleted file mode 100644 index f16c2805..00000000 --- a/wp-content/themes/classic/header.php +++ /dev/null @@ -1,30 +0,0 @@ - - -> - - - - - <?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?> - - - - - - - - - -> -
    -

    - -
    - diff --git a/wp-content/themes/classic/index.php b/wp-content/themes/classic/index.php deleted file mode 100644 index 6cb8c63f..00000000 --- a/wp-content/themes/classic/index.php +++ /dev/null @@ -1,36 +0,0 @@ - - - - -',''); ?> - -
    id="post-"> -

    -
    @
    - -
    - -
    - - - -
    - - - - -

    - - - - - diff --git a/wp-content/themes/classic/rtl.css b/wp-content/themes/classic/rtl.css deleted file mode 100644 index 18188fff..00000000 --- a/wp-content/themes/classic/rtl.css +++ /dev/null @@ -1,92 +0,0 @@ -/* Based on Arabic (RTL) version of WordPress Classic theme, converted by Serdal (Serdal.com) */ - -#menu ul ul, #wp-calendar caption, #wp-calendar #prev a { text-align: right; } -#wp-calendar #next a, .feedback { text-align: left; } - -blockquote { - border-left: 0; - border-right: 5px solid #ccc; - margin-left: auto; - margin-right: 1.5em; - padding-left: 0; - padding-right: 5px; -} - -body { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; } - -h2 { font: 95% 'Al Bayan', 'Traditional Arabic', "Times New Roman", Times, serif; } - -p, li, .feedback { - font: 90%/175% 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - text-align: justify; -} - -acronym, abbr, span.caps, h2, p, li, #header, #menu ul li, #menu ul ul li, #wp-calendar td, .feedback, .meta, .meta a { letter-spacing: normal; } - -#commentlist li ul { - border-left: 0; - border-right: 1px solid #ddd; -} - -#commentlist li .avatar { - margin-right: 0; - margin-left: 12px; -} - -#commentlist li .avatar { - margin-right: 0; - margin-left: 12px; -} - -#content { - margin: 30px 3em 0 13em; - padding-right: 0; - padding-left: 60px; -} - -#header { - border-left: solid 1px #9a9; - border-right: solid 1px #565; - font: normal normal 230% 'Al Bayan', 'Traditional Arabic', 'Times New Roman', Times, serif; - padding: 15px 60px 15px 10px; -} - -#menu { - border-left: 0; - border-right: 1px dotted #ccc; - padding: 20px 30px 10px 0; - right: auto; - left: 2px; -} - -#menu form { margin: 0 13px 0 0; } - -#menu ul { - padding-left: 0; - padding-right: 3px; -} - -#menu ul li { font: normal normal 110% 'Geeza Pro', Tahoma, 'Times New Roman', Times, serif; } - -#menu ul ul li { - font: normal normal 12px/115% 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - padding-left: 0; - padding-right: 12px; -} - -#menu ul ul ul.children { - padding-left: 0; - padding-right: 4px; -} - -#wp-calendar #next a { - padding-right: 0; - padding-left: 10px; -} - -#wp-calendar #prev a { - padding-left: 0; - padding-right: 10px; -} - -#wp-calendar td { font: normal normal 12px 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; } diff --git a/wp-content/themes/classic/screenshot.png b/wp-content/themes/classic/screenshot.png deleted file mode 100644 index 66921306..00000000 Binary files a/wp-content/themes/classic/screenshot.png and /dev/null differ diff --git a/wp-content/themes/classic/sidebar.php b/wp-content/themes/classic/sidebar.php deleted file mode 100644 index ab7d7458..00000000 --- a/wp-content/themes/classic/sidebar.php +++ /dev/null @@ -1,47 +0,0 @@ - - - - diff --git a/wp-content/themes/classic/style.css b/wp-content/themes/classic/style.css deleted file mode 100644 index a3b8df91..00000000 --- a/wp-content/themes/classic/style.css +++ /dev/null @@ -1,368 +0,0 @@ -/* -Theme Name: WordPress Classic -Theme URI: http://wordpress.org/ -Description: The original WordPress theme that graced versions 1.2.x and prior. -Version: 1.5 -Author: Dave Shea -Tags: mantle color, variable width, two columns, widgets - -Default WordPress by Dave Shea || http://mezzoblue.com -Modifications by Matthew Mullenweg || http://photomatt.net -This is just a basic layout, with only the bare minimum defined. -Please tweak this and make it your own. :) -*/ - -.screen-reader-text { - position: absolute; - left: -1000em; -} - -a { - color: #675; -} - -a img { - border: none; -} - -a:visited { - color: #342; -} - -a:hover { - color: #9a8; -} - -acronym, abbr { - border-bottom: 1px dashed #333; -} - -acronym, abbr, span.caps { - font-size: 90%; - letter-spacing: .07em; -} - -acronym, abbr { - cursor: help; -} - -blockquote { - border-left: 5px solid #ccc; - margin-left: 1.5em; - padding-left: 5px; -} - -body { - background: #fff; - border: 2px solid #565; - border-bottom: 1px solid #565; - border-top: 3px solid #565; - color: #000; - font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - margin: 0; - padding: 0; -} - -cite { - font-size: 90%; - font-style: normal; -} - -h2 { - border-bottom: 1px dotted #ccc; - font: 95% "Times New Roman", Times, serif; - letter-spacing: 0.2em; - margin: 15px 0 2px 0; - padding-bottom: 2px; -} - -h3 { - border-bottom: 1px dotted #eee; - font-family: "Times New Roman", Times, serif; - margin-top: 0; -} - -ol#comments li p { - font-size: 100%; -} - -p, li, .feedback { - font: 90%/175% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - letter-spacing: -1px; -} - -/* classes used by the_meta() */ -ul.post-meta { - list-style: none; -} - -ul.post-meta span.post-meta-key { - font-weight: bold; -} - -.credit { - background: #90a090; - border-top: 3px double #aba; - color: #fff; - font-size: 11px; - margin: 10px 0 0 0; - padding: 3px; - text-align: center; -} - -.credit a:link, .credit a:hover { - color: #fff; -} - -.feedback { - color: #ccc; - text-align: right; - clear: both; -} - -.meta { - font-size: .75em; -} - -.meta li, ul.post-meta li { - display: inline; -} - -.meta ul { - display: inline; - list-style: none; - margin: 0; - padding: 0; -} - -.meta, .meta a { - color: #808080; - font-weight: normal; - letter-spacing: 0; -} - -.storytitle { - margin: 0; -} - -.storytitle a { - text-decoration: none; -} - -#commentform #author, #commentform #email, #commentform #url, #commentform textarea { - background: #fff; - border: 1px solid #333; - padding: .2em; -} - -#commentform textarea { - width: 100%; -} - -#commentlist li ul { - border-left: 1px solid #ddd; - font-size: 110%; - list-style-type: none; -} - -#commentlist li .avatar { - float: right; - margin-right: 25px; - border: 1px dotted #ccc; - padding: 2px; -} - -#content { - margin: 30px 13em 0 3em; - padding-right: 60px; -} - -#header { - background: #90a090; - border-bottom: 3px double #aba; - border-left: 1px solid #9a9; - border-right: 1px solid #565; - border-top: 1px solid #9a9; - font: italic normal 230% 'Times New Roman', Times, serif; - letter-spacing: 0.2em; - margin: 0; - padding: 15px 10px 15px 60px; -} - -#header a { - color: #fff; - text-decoration: none; -} - -#header a:hover { - text-decoration: underline; -} - -#menu { - background: #fff; - border-left: 1px dotted #ccc; - border-top: 3px solid #e0e6e0; - padding: 20px 0 10px 30px; - position: absolute; - right: 2px; - top: 0; - width: 11em; -} - -#menu form { - margin: 0 0 0 13px; -} - -#menu input#s { - width: 80%; - background: #eee; - border: 1px solid #999; - color: #000; -} - -#menu ul { - color: #ccc; - font-weight: bold; - list-style-type: none; - margin: 0; - padding-left: 3px; - text-transform: lowercase; -} - -#menu ul li { - font: italic normal 110% 'Times New Roman', Times, serif; - letter-spacing: 0.1em; - margin-top: 10px; - padding-bottom: 2px; /*border-bottom: dotted 1px #ccc;*/ -} - -#menu ul ul { - font-variant: normal; - font-weight: normal; - line-height: 100%; - list-style-type: none; - margin: 0; - padding: 0; - text-align: left; -} - -#menu ul ul li { - border: 0; - font: normal normal 12px/115% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - letter-spacing: 0; - margin-top: 0; - padding: 0; - padding-left: 12px; -} - -#menu ul ul li a { - color: #000; - text-decoration: none; -} - -#menu ul ul li a:hover { - border-bottom: 1px solid #809080; -} - -#menu ul ul ul.children { - font-size: 142%; - padding-left: 4px; -} - -#wp-calendar { - border: 1px solid #ddd; - empty-cells: show; - font-size: 14px; - margin: 0; - width: 90%; -} - -#wp-calendar #next a { - padding-right: 10px; - text-align: right; -} - -#wp-calendar #prev a { - padding-left: 10px; - text-align: left; -} - -#wp-calendar a { - display: block; - text-decoration: none; -} - -#wp-calendar a:hover { - background: #e0e6e0; - color: #333; -} - -#wp-calendar caption { - color: #999; - font-size: 16px; - text-align: left; -} - -#wp-calendar td { - color: #ccc; - font: normal 12px 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - letter-spacing: normal; - padding: 2px 0; - text-align: center; -} - -#wp-calendar td.pad:hover { - background: #fff; -} - -#wp-calendar td:hover, #wp-calendar #today { - background: #eee; - color: #bbb; -} - -#wp-calendar th { - font-style: normal; - text-transform: capitalize; -} - -/* Captions & aligment */ -.aligncenter, -div.aligncenter { - display: block; - margin-left: auto; - margin-right: auto; -} - -.alignleft { - float: left; -} - -.alignright { - float: right; -} - -.wp-caption { - border: 1px solid #ddd; - text-align: center; - background-color: #f3f3f3; - padding-top: 4px; - margin: 10px; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.wp-caption img { - margin: 0; - padding: 0; - border: 0 none; -} - -.wp-caption p.wp-caption-text { - font-size: 11px; - line-height: 17px; - padding: 0 4px 5px; - margin: 0; -} -/* End captions & aligment */ diff --git a/wp-content/themes/default/404.php b/wp-content/themes/default/404.php deleted file mode 100644 index f9fee472..00000000 --- a/wp-content/themes/default/404.php +++ /dev/null @@ -1,18 +0,0 @@ - - -
    - -

    Error 404 - Not Found

    - -
    - - - - \ No newline at end of file diff --git a/wp-content/themes/default/archive.php b/wp-content/themes/default/archive.php deleted file mode 100644 index 70c2a8ce..00000000 --- a/wp-content/themes/default/archive.php +++ /dev/null @@ -1,77 +0,0 @@ - - -
    - - - - - -

    Archive for the ‘’ Category

    - -

    Posts Tagged ‘

    - -

    Archive for

    - -

    Archive for

    - -

    Archive for

    - -

    Author Archive

    - -

    Blog Archives

    - - - - - - -
    > -

    - - -
    - -
    - - - -
    - - - - - Sorry, but there aren't any posts in the %s category yet.", single_cat_title('',false)); - } else if ( is_date() ) { // If this is a date archive - echo("

    Sorry, but there aren't any posts with this date.

    "); - } else if ( is_author() ) { // If this is a category archive - $userdata = get_userdatabylogin(get_query_var('author_name')); - printf("

    Sorry, but there aren't any posts by %s yet.

    ", $userdata->display_name); - } else { - echo("

    No posts found.

    "); - } - get_search_form(); - - endif; -?> - -
    - - - - diff --git a/wp-content/themes/default/archives.php b/wp-content/themes/default/archives.php deleted file mode 100644 index 20428056..00000000 --- a/wp-content/themes/default/archives.php +++ /dev/null @@ -1,29 +0,0 @@ - - - - -
    - - - -

    Archives by Month:

    -
      - -
    - -

    Archives by Subject:

    -
      - -
    - -
    - - diff --git a/wp-content/themes/default/comments-popup.php b/wp-content/themes/default/comments-popup.php deleted file mode 100644 index 49fe744a..00000000 --- a/wp-content/themes/default/comments-popup.php +++ /dev/null @@ -1,124 +0,0 @@ - - - - <?php echo get_option('blogname'); ?> - Comments on <?php the_title(); ?> - - - - - - - -

    - - -

    Comments

    - -

    RSS feed for comments on this post.

    - - -

    The URL to TrackBack this entry is:

    - - - - - -
      - -
    1. - -

      by @

      -
    2. - - -
    - -

    No comments yet.

    - - - -

    Leave a comment

    -

    Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:

    - -
    - -

    Logged in as . Log out »

    - -

    - - -

    - -

    - - -

    - -

    - - -

    - - -

    - -
    - -

    - -

    - - " /> - -

    - ID); ?> -
    - -

    Sorry, the comment form is closed at this time.

    - - - - - -

    Sorry, no posts matched your criteria.

    - - - -

    Powered by WordPress

    - - - - diff --git a/wp-content/themes/default/footer.php b/wp-content/themes/default/footer.php deleted file mode 100644 index 02f6d193..00000000 --- a/wp-content/themes/default/footer.php +++ /dev/null @@ -1,26 +0,0 @@ - - -
    - -
    - - - - - - - diff --git a/wp-content/themes/default/functions.php b/wp-content/themes/default/functions.php deleted file mode 100644 index 072ab662..00000000 --- a/wp-content/themes/default/functions.php +++ /dev/null @@ -1,433 +0,0 @@ - '
  • ', - 'after_widget' => '
  • ', - 'before_title' => '

    ', - 'after_title' => '

    ', - )); -} - -/** @ignore */ -function kubrick_head() { - $head = "\n"; - if ( '' != $output ) - echo $head . $output . $foot; -} - -add_action('wp_head', 'kubrick_head'); - -function kubrick_header_image() { - return apply_filters('kubrick_header_image', get_option('kubrick_header_image')); -} - -function kubrick_upper_color() { - if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { - parse_str(substr($url, strpos($url, '?') + 1), $q); - return $q['upper']; - } else - return '69aee7'; -} - -function kubrick_lower_color() { - if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { - parse_str(substr($url, strpos($url, '?') + 1), $q); - return $q['lower']; - } else - return '4180b6'; -} - -function kubrick_header_image_url() { - if ( $image = kubrick_header_image() ) - $url = get_template_directory_uri() . '/images/' . $image; - else - $url = get_template_directory_uri() . '/images/kubrickheader.jpg'; - - return $url; -} - -function kubrick_header_color() { - return apply_filters('kubrick_header_color', get_option('kubrick_header_color')); -} - -function kubrick_header_color_string() { - $color = kubrick_header_color(); - if ( false === $color ) - return 'white'; - - return $color; -} - -function kubrick_header_display() { - return apply_filters('kubrick_header_display', get_option('kubrick_header_display')); -} - -function kubrick_header_display_string() { - $display = kubrick_header_display(); - return $display ? $display : 'inline'; -} - -add_action('admin_menu', 'kubrick_add_theme_page'); - -function kubrick_add_theme_page() { - if ( isset( $_GET['page'] ) && $_GET['page'] == basename(__FILE__) ) { - if ( isset( $_REQUEST['action'] ) && 'save' == $_REQUEST['action'] ) { - check_admin_referer('kubrick-header'); - if ( isset($_REQUEST['njform']) ) { - if ( isset($_REQUEST['defaults']) ) { - delete_option('kubrick_header_image'); - delete_option('kubrick_header_color'); - delete_option('kubrick_header_display'); - } else { - if ( '' == $_REQUEST['njfontcolor'] ) - delete_option('kubrick_header_color'); - else { - $fontcolor = preg_replace('/^.*(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['njfontcolor']); - update_option('kubrick_header_color', $fontcolor); - } - if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) { - $uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0]; - $lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0]; - update_option('kubrick_header_image', "header-img.php?upper=$uc&lower=$lc"); - } - - if ( isset($_REQUEST['toggledisplay']) ) { - if ( false === get_option('kubrick_header_display') ) - update_option('kubrick_header_display', 'none'); - else - delete_option('kubrick_header_display'); - } - } - } else { - - if ( isset($_REQUEST['headerimage']) ) { - check_admin_referer('kubrick-header'); - if ( '' == $_REQUEST['headerimage'] ) - delete_option('kubrick_header_image'); - else { - $headerimage = preg_replace('/^.*?(header-img.php\?upper=[0-9a-fA-F]{6}&lower=[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['headerimage']); - update_option('kubrick_header_image', $headerimage); - } - } - - if ( isset($_REQUEST['fontcolor']) ) { - check_admin_referer('kubrick-header'); - if ( '' == $_REQUEST['fontcolor'] ) - delete_option('kubrick_header_color'); - else { - $fontcolor = preg_replace('/^.*?(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['fontcolor']); - update_option('kubrick_header_color', $fontcolor); - } - } - - if ( isset($_REQUEST['fontdisplay']) ) { - check_admin_referer('kubrick-header'); - if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] ) - delete_option('kubrick_header_display'); - else - update_option('kubrick_header_display', 'none'); - } - } - //print_r($_REQUEST); - wp_redirect("themes.php?page=functions.php&saved=true"); - die; - } - add_action('admin_head', 'kubrick_theme_page_head'); - } - add_theme_page(__('Custom Header'), __('Custom Header'), 'edit_themes', basename(__FILE__), 'kubrick_theme_page'); -} - -function kubrick_theme_page_head() { -?> - - - -

    '.__('Options saved.').'

    '; -?> -
    -

    -
    -
    - -
    -
    -
    -
    - -
    - red', '#FF0000', 'rgb(255, 0, 0)'); ?>
    - #FF0000', '#F00'); ?>
    - #FF0000', '#F00'); ?>
    - - - - - - -
    -
    -
    -
    - - - - - - - - - - - - -

    -
    - -
    - -
    -
    -
    -
    - diff --git a/wp-content/themes/default/image.php b/wp-content/themes/default/image.php deleted file mode 100644 index 4312630f..00000000 --- a/wp-content/themes/default/image.php +++ /dev/null @@ -1,70 +0,0 @@ - - -
    - - - -
    -

    post_parent); ?> »

    -
    -

    ID, 'medium' ); ?>

    -
    post_excerpt) ) the_excerpt(); // this is the "caption" ?>
    - - Read the rest of this entry »

    '); ?> - - -
    - - - -
    - -
    - - - - - -

    Sorry, no attachments matched your criteria.

    - - - -
    - - diff --git a/wp-content/themes/default/images/audio.jpg b/wp-content/themes/default/images/audio.jpg deleted file mode 100644 index b02e1c86..00000000 Binary files a/wp-content/themes/default/images/audio.jpg and /dev/null differ diff --git a/wp-content/themes/default/images/header-img.php b/wp-content/themes/default/images/header-img.php deleted file mode 100644 index 50bd3c37..00000000 --- a/wp-content/themes/default/images/header-img.php +++ /dev/null @@ -1,82 +0,0 @@ -array('r1', 'g1', 'b1'), 'lower'=>array('r2', 'g2', 'b2')); -foreach ( $vars as $var => $subvars ) { - if ( isset($_GET[$var]) ) { - foreach ( $subvars as $index => $subvar ) { - $length = strlen($_GET[$var]) / 3; - $v = substr($_GET[$var], $index * $length, $length); - if ( $length == 1 ) $v = '' . $v . $v; - $$subvar = hexdec( $v ); - if ( $$subvar < 0 || $$subvar > 255 ) - $default = true; - } - } else { - $default = true; - } -} - -if ( $default ) - list ( $r1, $g1, $b1, $r2, $g2, $b2 ) = array ( 105, 174, 231, 65, 128, 182 ); - -// Create the image -$im = imagecreatefromjpeg($img); - -// Get the background color, define the rectangle height -$white = imagecolorat( $im, 15, 15 ); -$h = 182; - -// Define the boundaries of the rounded edges ( y => array ( x1, x2 ) ) -$corners = array( - 0 => array ( 25, 734 ), - 1 => array ( 23, 736 ), - 2 => array ( 22, 737 ), - 3 => array ( 21, 738 ), - 4 => array ( 21, 738 ), - 177 => array ( 21, 738 ), - 178 => array ( 21, 738 ), - 179 => array ( 22, 737 ), - 180 => array ( 23, 736 ), - 181 => array ( 25, 734 ), - ); - -// Blank out the blue thing -for ( $i = 0; $i < $h; $i++ ) { - $x1 = 19; - $x2 = 740; - imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white ); -} - -// Draw a new color thing -for ( $i = 0; $i < $h; $i++ ) { - $x1 = 20; - $x2 = 739; - $r = ( $r2 - $r1 != 0 ) ? $r1 + ( $r2 - $r1 ) * ( $i / $h ) : $r1; - $g = ( $g2 - $g1 != 0 ) ? $g1 + ( $g2 - $g1 ) * ( $i / $h ) : $g1; - $b = ( $b2 - $b1 != 0 ) ? $b1 + ( $b2 - $b1 ) * ( $i / $h ) : $b1; - $color = imagecolorallocate( $im, $r, $g, $b ); - if ( array_key_exists($i, $corners) ) { - imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $white ); - list ( $x1, $x2 ) = $corners[$i]; - } - imageline( $im, $x1, 18 + $i, $x2, 18 + $i, $color ); -} - -//die; -header("Content-Type: image/jpeg"); -imagejpeg($im, '', 92); -imagedestroy($im); -?> diff --git a/wp-content/themes/default/images/kubrickbg-ltr.jpg b/wp-content/themes/default/images/kubrickbg-ltr.jpg deleted file mode 100644 index dc74fb8d..00000000 Binary files a/wp-content/themes/default/images/kubrickbg-ltr.jpg and /dev/null differ diff --git a/wp-content/themes/default/images/kubrickbg-rtl.jpg b/wp-content/themes/default/images/kubrickbg-rtl.jpg deleted file mode 100644 index 2e9e2374..00000000 Binary files a/wp-content/themes/default/images/kubrickbg-rtl.jpg and /dev/null differ diff --git a/wp-content/themes/default/images/kubrickbgcolor.jpg b/wp-content/themes/default/images/kubrickbgcolor.jpg deleted file mode 100644 index 4653b68e..00000000 Binary files a/wp-content/themes/default/images/kubrickbgcolor.jpg and /dev/null differ diff --git a/wp-content/themes/default/images/kubrickbgwide.jpg b/wp-content/themes/default/images/kubrickbgwide.jpg deleted file mode 100644 index 77096f24..00000000 Binary files a/wp-content/themes/default/images/kubrickbgwide.jpg and /dev/null differ diff --git a/wp-content/themes/default/images/kubrickfooter.jpg b/wp-content/themes/default/images/kubrickfooter.jpg deleted file mode 100644 index d7a4c659..00000000 Binary files a/wp-content/themes/default/images/kubrickfooter.jpg and /dev/null differ diff --git a/wp-content/themes/default/images/kubrickheader.jpg b/wp-content/themes/default/images/kubrickheader.jpg deleted file mode 100644 index 69441ee3..00000000 Binary files a/wp-content/themes/default/images/kubrickheader.jpg and /dev/null differ diff --git a/wp-content/themes/default/index.php b/wp-content/themes/default/index.php deleted file mode 100644 index ae5bf805..00000000 --- a/wp-content/themes/default/index.php +++ /dev/null @@ -1,45 +0,0 @@ - - -
    - - - - - -
    id="post-"> -

    - - -
    - -
    - - -
    - - - - - - - -

    Not Found

    -

    Sorry, but you are looking for something that isn't here.

    - - - - -
    - - - - diff --git a/wp-content/themes/default/links.php b/wp-content/themes/default/links.php deleted file mode 100644 index 81fdc008..00000000 --- a/wp-content/themes/default/links.php +++ /dev/null @@ -1,23 +0,0 @@ - - - - -
    - -

    Links:

    -
      - -
    - -
    - - diff --git a/wp-content/themes/default/page.php b/wp-content/themes/default/page.php deleted file mode 100644 index 87b3dd52..00000000 --- a/wp-content/themes/default/page.php +++ /dev/null @@ -1,30 +0,0 @@ - - -
    - - -
    -

    -
    - Read the rest of this page »

    '); ?> - - '

    Pages: ', 'after' => '

    ', 'next_or_number' => 'number')); ?> - -
    -
    - - ', '

    '); ?> - - - -
    - - - - diff --git a/wp-content/themes/default/rtl.css b/wp-content/themes/default/rtl.css deleted file mode 100644 index 0583b52f..00000000 --- a/wp-content/themes/default/rtl.css +++ /dev/null @@ -1,127 +0,0 @@ -/* -Theme name: WordPress Default - kubrick - -Editors: Navid Kashani -Persian WordPress Project : wp-persian.com -*/ -body, .commentlist li, #commentform input, #commentform textarea, #commentform p, #sidebar, #wp-calendar caption { - font-family:tahoma, arial; -} -#page { - text-align:right; - direction:rtl; -} -h1, h2, h3, #sidebar h2 { - font-family:arial, tahoma; -} -.commentlist li .avatar { - float:left; -} - -.commentlist li { - padding: 5px 10px 10px 5px; - } -.commentlist li ul li { - margin-left: -5px; - margin-right: 10px; -} - -.commentlist p { - margin: 10px 0 10px 5px; -} -#header { - margin:0 1px 0 0; -} -.narrowcolumn { - float:right; - padding: 0 45px 20px 0; -} -.widecolumn { - margin: 5px 150px 0 0; -} -.widecolumn .smallattachment { - margin: 5px 0 5px 5px; -} -.postmetadata { - clear:right; -} -#sidebar { - margin-left: 0; - margin-right: 545px; -} -img.alignright { - margin: 0 7px 2px 0; -} - -img.alignleft { - margin: 0 0 2px 7px; -} - -.alignright { - float: left; -} - -.alignleft { - float: right; -} -code { - display:block; - direction:ltr; - text-align:left; -} -acronym, abbr, span.caps { - letter-spacing:0; /* fix opera bug */ -} -html>body .entry ul { - padding:0 10px 0 0; - text-indent:10px; -} -html>body .entry li { - margin: 7px 10px 8px 0; -} -.entry ol { - padding: 0 35px 0 0; -} -#sidebar ul ul, #sidebar ul ol { - margin: 5px 10px 0 0; -} -#sidebar ul ul ul, #sidebar ul ol { - margin: 0 10px 0 0; -} -#commentform { - margin: 5px 0 0 10px; - } -#commentform input { - margin: 5px 0 1px 5px; -} -#commentform #submit { - float:left; -} -.commentlist p { - margin: 10px 0 10px 5px; -} - -.children .even, .alt { - border-left: 0; - border-right: 1px solid #ddd; -} - -#wp-calendar #next a { - padding-right:0; - padding-left:10px; - text-align:left; -} -#wp-calendar #prev a { - padding-left:0; - padding-right:10px; - text-align:right; -} -blockquote { - margin: 15px 10px 0 30px; - padding-left: 0; - padding-right: 20px; - border-left: 0 none; - border-right: 5px solid #ddd; -} -#email, #url { - direction:ltr; -} \ No newline at end of file diff --git a/wp-content/themes/default/screenshot.png b/wp-content/themes/default/screenshot.png deleted file mode 100644 index e0b1d488..00000000 Binary files a/wp-content/themes/default/screenshot.png and /dev/null differ diff --git a/wp-content/themes/default/search.php b/wp-content/themes/default/search.php deleted file mode 100644 index 4e7ad6dd..00000000 --- a/wp-content/themes/default/search.php +++ /dev/null @@ -1,48 +0,0 @@ - - -
    - - - -

    Search Results

    - - - - - - -
    > -

    - - - -
    - - - - - - - -

    No posts found. Try a different search?

    - - - - -
    - - - - diff --git a/wp-content/themes/default/sidebar.php b/wp-content/themes/default/sidebar.php deleted file mode 100644 index e38b0be0..00000000 --- a/wp-content/themes/default/sidebar.php +++ /dev/null @@ -1,83 +0,0 @@ - - - diff --git a/wp-content/themes/default/single.php b/wp-content/themes/default/single.php deleted file mode 100644 index c9cb4d82..00000000 --- a/wp-content/themes/default/single.php +++ /dev/null @@ -1,73 +0,0 @@ - - -
    - - - - - -
    id="post-"> -

    - -
    - Read the rest of this entry »

    '); ?> - - '

    Pages: ', 'after' => '

    ', 'next_or_number' => 'number')); ?> - Tags: ', ', ', '

    '); ?> - - - -
    -
    - - - - - -

    Sorry, no posts matched your criteria.

    - - - -
    - - diff --git a/wp-content/themes/default/style.css b/wp-content/themes/default/style.css deleted file mode 100644 index d64c5e7d..00000000 --- a/wp-content/themes/default/style.css +++ /dev/null @@ -1,718 +0,0 @@ -/* -Theme Name: WordPress Default -Theme URI: http://wordpress.org/ -Description: The default WordPress theme based on the famous Kubrick. -Version: 1.6 -Author: Michael Heilemann -Author URI: http://binarybonsai.com/ -Tags: blue, custom header, fixed width, two columns, widgets - - Kubrick v1.5 - http://binarybonsai.com/kubrick/ - - This theme was designed and built by Michael Heilemann, - whose blog you will find at http://binarybonsai.com/ - - The CSS, XHTML and design is released under GPL: - http://www.opensource.org/licenses/gpl-license.php - -*/ - - - -/* Begin Typography & Colors */ -body { - font-size: 62.5%; /* Resets 1em to 10px */ - font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; - background: #d5d6d7 url('images/kubrickbgcolor.jpg'); - color: #333; - text-align: center; - } - -#page { - background-color: white; - border: 1px solid #959596; - text-align: left; - } - -#header { - background: #73a0c5 url('images/kubrickheader.jpg') no-repeat bottom center; - } - -#headerimg { - margin: 7px 9px 0; - height: 192px; - width: 740px; - } - -#content { - font-size: 1.2em; - } - -.widecolumn .entry p { - font-size: 1.05em; - } - -.narrowcolumn .entry, .widecolumn .entry { - line-height: 1.4em; - } - -.widecolumn { - line-height: 1.6em; - } - -.narrowcolumn .postmetadata { - text-align: center; - } - -.thread-alt { - background-color: #f8f8f8; -} -.thread-even { - background-color: white; -} -.depth-1 { -border: 1px solid #ddd; -} - -.even, .alt { - - border-left: 1px solid #ddd; -} - -#footer { - background: #e7e7e7 url('images/kubrickfooter.jpg') no-repeat top; - border: none; - } - -small { - font-family: Arial, Helvetica, Sans-Serif; - font-size: 0.9em; - line-height: 1.5em; - } - -h1, h2, h3 { - font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif; - font-weight: bold; - } - -h1 { - font-size: 4em; - text-align: center; - } - -#headerimg .description { - font-size: 1.2em; - text-align: center; - } - -h2 { - font-size: 1.6em; - } - -h2.pagetitle { - font-size: 1.6em; - } - -#sidebar h2 { - font-family: 'Lucida Grande', Verdana, Sans-Serif; - font-size: 1.2em; - } - -h3 { - font-size: 1.3em; - } - -h1, h1 a, h1 a:hover, h1 a:visited, #headerimg .description { - text-decoration: none; - color: white; - } - -h2, h2 a, h2 a:visited, h3, h3 a, h3 a:visited { - color: #333; - } - -h2, h2 a, h2 a:hover, h2 a:visited, h3, h3 a, h3 a:hover, h3 a:visited, #sidebar h2, #wp-calendar caption, cite { - text-decoration: none; - } - -.entry p a:visited { - color: #b85b5a; - } - -.sticky { - background: #f7f7f7; - padding: 0 10px 10px; - } -.sticky h2 { - padding-top: 10px; - } - -.commentlist li, #commentform input, #commentform textarea { - font: 0.9em 'Lucida Grande', Verdana, Arial, Sans-Serif; - } -.commentlist li ul li { - font-size: 1em; -} - -.commentlist li { - font-weight: bold; -} - -.commentlist li .avatar { - float: right; - border: 1px solid #eee; - padding: 2px; - background: #fff; - } - -.commentlist cite, .commentlist cite a { - font-weight: bold; - font-style: normal; - font-size: 1.1em; - } - -.commentlist p { - font-weight: normal; - line-height: 1.5em; - text-transform: none; - } - -#commentform p { - font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; - } - -.commentmetadata { - font-weight: normal; - } - -#sidebar { - font: 1em 'Lucida Grande', Verdana, Arial, Sans-Serif; - } - -small, #sidebar ul ul li, #sidebar ul ol li, .nocomments, .postmetadata, blockquote, strike { - color: #777; - } - -code { - font: 1.1em 'Courier New', Courier, Fixed; - } - -acronym, abbr, span.caps -{ - font-size: 0.9em; - letter-spacing: .07em; - } - -a, h2 a:hover, h3 a:hover { - color: #06c; - text-decoration: none; - } - -a:hover { - color: #147; - text-decoration: underline; - } - -#wp-calendar #prev a, #wp-calendar #next a { - font-size: 9pt; - } - -#wp-calendar a { - text-decoration: none; - } - -#wp-calendar caption { - font: bold 1.3em 'Lucida Grande', Verdana, Arial, Sans-Serif; - text-align: center; - } - -#wp-calendar th { - font-style: normal; - text-transform: capitalize; - } -/* End Typography & Colors */ - - - -/* Begin Structure */ -body { - margin: 0 0 20px 0; - padding: 0; - } - -#page { - background-color: white; - margin: 20px auto; - padding: 0; - width: 760px; - border: 1px solid #959596; - } - -#header { - background-color: #73a0c5; - margin: 0 0 0 1px; - padding: 0; - height: 200px; - width: 758px; - } - -#headerimg { - margin: 0; - height: 200px; - width: 100%; - } - -.narrowcolumn { - float: left; - padding: 0 0 20px 45px; - margin: 0px 0 0; - width: 450px; - } - -.widecolumn { - padding: 10px 0 20px 0; - margin: 5px 0 0 150px; - width: 450px; - } - -.post { - margin: 0 0 40px; - text-align: justify; - } - -.post hr { - display: block; - } - -.widecolumn .post { - margin: 0; - } - -.narrowcolumn .postmetadata { - padding-top: 5px; - } - -.widecolumn .postmetadata { - margin: 30px 0; - } - -.widecolumn .smallattachment { - text-align: center; - float: left; - width: 128px; - margin: 5px 5px 5px 0px; -} - -.widecolumn .attachment { - text-align: center; - margin: 5px 0px; -} - -.postmetadata { - clear: both; -} - -.clear { - clear: both; -} - -#footer { - padding: 0; - margin: 0 auto; - width: 760px; - clear: both; - } - -#footer p { - margin: 0; - padding: 20px 0; - text-align: center; - } -/* End Structure */ - - - -/* Begin Headers */ -h1 { - padding-top: 70px; - margin: 0; - } - -h2 { - margin: 30px 0 0; - } - -h2.pagetitle { - margin-top: 30px; - text-align: center; -} - -#sidebar h2 { - margin: 5px 0 0; - padding: 0; - } - -h3 { - padding: 0; - margin: 30px 0 0; - } - -h3.comments { - padding: 0; - margin: 40px auto 20px ; - } -/* End Headers */ - - - -/* Begin Images */ -p img { - padding: 0; - max-width: 100%; - } - -/* Using 'class="alignright"' on an image will (who would've - thought?!) align the image to the right. And using 'class="centered', - will of course center the image. This is much better than using - align="center", being much more futureproof (and valid) */ - -img.centered { - display: block; - margin-left: auto; - margin-right: auto; - } - -img.alignright { - padding: 4px; - margin: 0 0 2px 7px; - display: inline; - } - -img.alignleft { - padding: 4px; - margin: 0 7px 2px 0; - display: inline; - } - -.alignright { - float: right; - } - -.alignleft { - float: left; - } -/* End Images */ - - - -/* Begin Lists - - Special stylized non-IE bullets - Do not work in Internet Explorer, which merely default to normal bullets. */ - -html>body .entry ul { - margin-left: 0px; - padding: 0 0 0 30px; - list-style: none; - padding-left: 10px; - text-indent: -10px; - } - -html>body .entry li { - margin: 7px 0 8px 10px; - } - -.entry ul li:before, #sidebar ul ul li:before { - content: "\00BB \0020"; - } - -.entry ol { - padding: 0 0 0 35px; - margin: 0; - } - -.entry ol li { - margin: 0; - padding: 0; - } - -.postmetadata ul, .postmetadata li { - display: inline; - list-style-type: none; - list-style-image: none; - } - -#sidebar ul, #sidebar ul ol { - margin: 0; - padding: 0; - } - -#sidebar ul li { - list-style-type: none; - list-style-image: none; - margin-bottom: 15px; - } - -#sidebar ul p, #sidebar ul select { - margin: 5px 0 8px; - } - -#sidebar ul ul, #sidebar ul ol { - margin: 5px 0 0 10px; - } - -#sidebar ul ul ul, #sidebar ul ol { - margin: 0 0 0 10px; - } - -ol li, #sidebar ul ol li { - list-style: decimal outside; - } - -#sidebar ul ul li, #sidebar ul ol li { - margin: 3px 0 0; - padding: 0; - } -/* End Entry Lists */ - - - -/* Begin Form Elements */ -#searchform { - margin: 10px auto; - padding: 5px 3px; - text-align: center; - } - -#sidebar #searchform #s { - width: 108px; - padding: 2px; - } - -#sidebar #searchsubmit { - padding: 1px; - } - -.entry form { /* This is mainly for password protected posts, makes them look better. */ - text-align:center; - } - -select { - width: 130px; - } - -#commentform input { - width: 170px; - padding: 2px; - margin: 5px 5px 1px 0; - } - -#commentform { - margin: 5px 10px 0 0; - } -#commentform textarea { - width: 100%; - padding: 2px; - } -#respond:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; - } -#commentform #submit { - margin: 0 0 5px auto; - float: right; - } -/* End Form Elements */ - - - -/* Begin Comments*/ -.alt { - margin: 0; - padding: 10px; - } - -.commentlist { - padding: 0; - text-align: justify; - } - -.commentlist li { - margin: 15px 0 10px; - padding: 5px 5px 10px 10px; - list-style: none; - - } -.commentlist li ul li { - margin-right: -5px; - margin-left: 10px; -} - -.commentlist p { - margin: 10px 5px 10px 0; -} -.children { padding: 0; } - -#commentform p { - margin: 5px 0; - } - -.nocomments { - text-align: center; - margin: 0; - padding: 0; - } - -.commentmetadata { - margin: 0; - display: block; - } -/* End Comments */ - - - -/* Begin Sidebar */ -#sidebar -{ - padding: 20px 0 10px 0; - margin-left: 545px; - width: 190px; - } - -#sidebar form { - margin: 0; - } -/* End Sidebar */ - - - -/* Begin Calendar */ -#wp-calendar { - empty-cells: show; - margin: 10px auto 0; - width: 155px; - } - -#wp-calendar #next a { - padding-right: 10px; - text-align: right; - } - -#wp-calendar #prev a { - padding-left: 10px; - text-align: left; - } - -#wp-calendar a { - display: block; - } - -#wp-calendar caption { - text-align: center; - width: 100%; - } - -#wp-calendar td { - padding: 3px 0; - text-align: center; - } - -#wp-calendar td.pad:hover { /* Doesn't work in IE */ - background-color: #fff; } -/* End Calendar */ - - - -/* Begin Various Tags & Classes */ -acronym, abbr, span.caps { - cursor: help; - } - -acronym, abbr { - border-bottom: 1px dashed #999; - } - -blockquote { - margin: 15px 30px 0 10px; - padding-left: 20px; - border-left: 5px solid #ddd; - } - -blockquote cite { - margin: 5px 0 0; - display: block; - } - -.center { - text-align: center; - } - -.hidden { - display: none; - } - -.screen-reader-text { - position: absolute; - left: -1000em; -} - -hr { - display: none; - } - -a img { - border: none; - } - -.navigation { - display: block; - text-align: center; - margin-top: 10px; - margin-bottom: 60px; - } -/* End Various Tags & Classes*/ - - - -/* Captions */ -.aligncenter, -div.aligncenter { - display: block; - margin-left: auto; - margin-right: auto; -} - -.wp-caption { - border: 1px solid #ddd; - text-align: center; - background-color: #f3f3f3; - padding-top: 4px; - margin: 10px; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.wp-caption img { - margin: 0; - padding: 0; - border: 0 none; -} - -.wp-caption p.wp-caption-text { - font-size: 11px; - line-height: 17px; - padding: 0 4px 5px; - margin: 0; -} -/* End captions */ - - -/* "Daisy, Daisy, give me your answer do. I'm half crazy all for the love of you. - It won't be a stylish marriage, I can't afford a carriage. - But you'll look sweet upon the seat of a bicycle built for two." */ diff --git a/wp-content/themes/twentyten/404.php b/wp-content/themes/twentyten/404.php new file mode 100644 index 00000000..3baea812 --- /dev/null +++ b/wp-content/themes/twentyten/404.php @@ -0,0 +1,30 @@ + + +
    +
    + +
    +

    +
    +

    + +
    +
    + +
    +
    + + + \ No newline at end of file diff --git a/wp-content/themes/twentyten/archive.php b/wp-content/themes/twentyten/archive.php new file mode 100644 index 00000000..52baaa70 --- /dev/null +++ b/wp-content/themes/twentyten/archive.php @@ -0,0 +1,61 @@ + + +
    +
    + + + +

    + + %s', 'twentyten' ), get_the_date() ); ?> + + %s', 'twentyten' ), get_the_date('F Y') ); ?> + + %s', 'twentyten' ), get_the_date('Y') ); ?> + + + +

    + + + +
    +
    + + + diff --git a/wp-content/themes/twentyten/attachment.php b/wp-content/themes/twentyten/attachment.php new file mode 100644 index 00000000..262f63ee --- /dev/null +++ b/wp-content/themes/twentyten/attachment.php @@ -0,0 +1,116 @@ + + +
    +
    + + + +

    ← %s', 'twentyten' ), get_the_title( $post->post_parent ) ); + ?>

    + +
    > +

    + + + +
    +
    + $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); + foreach ( $attachments as $k => $attachment ) { + if ( $attachment->ID == $post->ID ) + break; + } + $k++; + // If there is more than 1 image attachment in a gallery + if ( count( $attachments ) > 1 ) { + if ( isset( $attachments[ $k ] ) ) + // get the URL of the next image attachment + $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); + else + // or get the URL of the first image attachment + $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); + } else { + // or, if there's only 1 image attachment, get the URL of the image + $next_attachment_url = wp_get_attachment_url(); + } +?> +

    ID, array( $attachment_size, 9999 ) ); // filterable image width with, essentially, no limit for image height. + ?>

    + + + + + +
    +
    post_excerpt ) ) the_excerpt(); ?>
    + +→', 'twentyten' ) ); ?> + '' ) ); ?> + +
    + +
    + + ', '' ); ?> +
    +
    + + + + + +
    +
    + + diff --git a/wp-content/themes/twentyten/author.php b/wp-content/themes/twentyten/author.php new file mode 100644 index 00000000..2bd48c84 --- /dev/null +++ b/wp-content/themes/twentyten/author.php @@ -0,0 +1,60 @@ + + +
    +
    + + + +

    " . get_the_author() . "" ); ?>

    + + +
    +
    + +
    +
    +

    + +
    +
    + + + +
    +
    + + + diff --git a/wp-content/themes/twentyten/category.php b/wp-content/themes/twentyten/category.php new file mode 100644 index 00000000..0792e1fe --- /dev/null +++ b/wp-content/themes/twentyten/category.php @@ -0,0 +1,34 @@ + + +
    +
    + +

    ' . single_cat_title( '', false ) . '' ); + ?>

    + ' . $category_description . '
    '; + + /* Run the loop for the category page to output the posts. + * If you want to overload this in a child theme then include a file + * called loop-category.php and that will be used instead. + */ + get_template_part( 'loop', 'category' ); + ?> + +
    +
    + + + diff --git a/wp-content/themes/twentyten/comments.php b/wp-content/themes/twentyten/comments.php new file mode 100644 index 00000000..7863ca10 --- /dev/null +++ b/wp-content/themes/twentyten/comments.php @@ -0,0 +1,79 @@ + + +
    + +

    +
    + + + + + +

    ' . get_the_title() . '' ); + ?>

    + + 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> + + + +
      + 'twentyten_comment' ) ); + ?> +
    + + 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> + + + + +

    + + + + + + +
    diff --git a/wp-content/themes/twentyten/editor-style-rtl.css b/wp-content/themes/twentyten/editor-style-rtl.css new file mode 100644 index 00000000..2c69a7c5 --- /dev/null +++ b/wp-content/themes/twentyten/editor-style-rtl.css @@ -0,0 +1,56 @@ +/* +Theme Name: Twenty Ten +*/ +/* +Used to style the TinyMCE editor. +*/ +html .mceContentBody{ + direction:rtl; + unicode-bidi:embed; + float:right; +} +* { + font-family: Arial, Tahoma, sans-serif; +} +/* Text elements */ +ul { + margin: 0 -18px 18px 0; +} +ol { + margin: 0 -18px 18px 0; +} +dd { + margin-right: 0; +} +blockquote { + font-style: normal; +} +table { + text-align: right; + margin: 0 0 24px -1px; +} +html .mceContentBody{ + direction:rtl; + unicode-bidi:embed; + float:right; +} +* { + font-family: Arial, Tahoma, sans-serif; +} +/* Text elements */ +ul { + margin: 0 -18px 18px 0; +} +ol { + margin: 0 -18px 18px 0; +} +dd { + margin-right: 0; +} +blockquote { + font-style: normal; +} +table { + text-align: right; + margin: 0 0 24px -1px; +} \ No newline at end of file diff --git a/wp-content/themes/twentyten/editor-style.css b/wp-content/themes/twentyten/editor-style.css new file mode 100644 index 00000000..fa875cad --- /dev/null +++ b/wp-content/themes/twentyten/editor-style.css @@ -0,0 +1,289 @@ +/* +Theme Name: Twenty Ten +*/ +/* +Used to style the TinyMCE editor. +*/ +html .mceContentBody { + max-width:640px; +} +* { + font-family: Georgia, "Bitstream Charter", serif; + color: #444; + line-height: 1.5; +} +p, +dl, +td, +th, +ul, +ol, +blockquote { + font-size: 16px; +} +tr th, +thead th, +label, +tr th, +thead th { + font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; +} +pre { + font-family: "Courier 10 Pitch", Courier, monospace; +} +code, code var { + font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; +} +body, input, textarea { + font-size: 12px; + line-height: 18px; +} +hr { + background-color: #E7E7E7; + border:0; + height: 1px; + margin-bottom: 18px; + clear:both; +} +/* Text elements */ +p { + margin-bottom: 18px; +} +ul { + list-style: square; + margin: 0 0 18px 1.5em; +} +ol { + list-style: decimal; + margin: 0 0 18px 1.5em; +} +ol ol { + list-style:upper-alpha; +} +ol ol ol { + list-style:lower-roman; +} +ol ol ol ol { + list-style:lower-alpha; +} +ul ul, +ol ol, +ul ol, +ol ul { + margin-bottom:0; +} +dl { + margin:0 0 24px 0; +} +dt { + font-weight: bold; +} +dd { + margin-bottom: 18px; +} +strong { + font-weight: bold; + color: #000; +} +cite, +em, +i { + font-style: italic; + border: none; +} +big { + font-size: 131.25%; +} +ins { + background: #FFFFCC; + border: none; + color: #333; +} +del { + text-decoration: line-through; + color: #555; +} +blockquote { + font-style: italic; + padding: 0 3em; +} +blockquote cite, +blockquote em, +blockquote i { + font-style: normal; +} +pre { + background: #f7f7f7; + color: #222; + line-height: 18px; + margin-bottom: 18px; + padding: 1.5em; +} +abbr, +acronym { + border-bottom: 1px dotted #666; + cursor: help; +} +ins { + text-decoration: none; +} +sup, +sub { + height: 0; + line-height: 1; + vertical-align: baseline; + position: relative; + font-size: 10px; +} +sup { + bottom: 1ex; +} +sub { + top: .5ex; +} +a:link { + color:#0066CC; +} +a:visited { + color:#743399; +} +a:active, +a:hover { + color: #FF4B33; +} +p, +ul, +ol, +dd, +pre, +hr { + margin-bottom:24px; +} +ul ul, +ol ol, +ul ol, +ol ul { + margin-bottom:0; +} +pre, +kbd, +tt, +var { + font-size: 15px; + line-height: 21px; +} +code { + font-size: 13px; +} +strong, +b, +dt, +th { + color: #000; +} +h1, +h2, +h3, +h4, +h5, +h6 { + color: #000; + margin: 0 0 20px 0; + line-height: 1.5em; + font-weight: normal; +} +h1 { + font-size: 2.4em; +} +h2 { + font-size: 1.8em; +} +h3 { + font-size: 1.4em; +} +h4 { + font-size: 1.2em; +} +h5 { + font-size: 1em; +} +h6 { + font-size: 0.9em; +} +table { + border: 1px solid #e7e7e7 !important; + text-align: left; + margin: 0 -1px 24px 0; + width: 100%; + border-collapse: collapse; + border-spacing: 0; +} +tr th, +thead th { + border: none !important; + color: #888; + font-size: 12px; + font-weight: bold; + line-height: 18px; + padding: 9px 24px; +} +tr td { + border: none !important; + border-top: 1px solid #e7e7e7 !important; + padding: 6px 24px; +} + + +img { + margin: 0; + max-width: 640px; +} +.alignleft, +img.alignleft { + display: inline; + float: left; + margin-right: 24px; + margin-top: 4px; +} +.alignright, +img.alignright { + display: inline; + float: right; + margin-left: 24px; + margin-top: 4px; +} +.aligncenter, +img.aligncenter { + clear: both; + display: block; + margin-left: auto; + margin-right: auto; +} +img.alignleft, +img.alignright, +img.aligncenter { + margin-bottom: 12px; +} +.wp-caption { + border: none; + background: #f1f1f1; + color: #888; + font-size: 12px; + line-height: 18px; + text-align: center; + margin-bottom: 20px; + padding: 4px; + -moz-border-radius: 0; + -khtml-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} +.wp-caption img { + margin: 5px; +} +.wp-caption p.wp-caption-text { + margin: 0 0 4px; +} +.wp-smiley { + margin:0; +} \ No newline at end of file diff --git a/wp-content/themes/twentyten/footer.php b/wp-content/themes/twentyten/footer.php new file mode 100644 index 00000000..61f2d948 --- /dev/null +++ b/wp-content/themes/twentyten/footer.php @@ -0,0 +1,53 @@ + +
    + + + +
    + + + * tag of your theme, or you will break many plugins, which + * generally use this hook to reference JavaScript files. + */ + + wp_footer(); +?> + + diff --git a/wp-content/themes/twentyten/functions.php b/wp-content/themes/twentyten/functions.php new file mode 100644 index 00000000..3a61e9d8 --- /dev/null +++ b/wp-content/themes/twentyten/functions.php @@ -0,0 +1,541 @@ + + * add_action( 'after_setup_theme', 'my_child_theme_setup' ); + * function my_child_theme_setup() { + * // We are providing our own filter for excerpt_length (or using the unfiltered value) + * remove_filter( 'excerpt_length', 'twentyten_excerpt_length' ); + * ... + * } + * + * + * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API. + * + * @package WordPress + * @subpackage Twenty_Ten + * @since Twenty Ten 1.0 + */ + +/** + * Set the content width based on the theme's design and stylesheet. + * + * Used to set the width of images and content. Should be equal to the width the theme + * is designed for, generally via the style.css stylesheet. + */ +if ( ! isset( $content_width ) ) + $content_width = 640; + +/** Tell WordPress to run twentyten_setup() when the 'after_setup_theme' hook is run. */ +add_action( 'after_setup_theme', 'twentyten_setup' ); + +if ( ! function_exists( 'twentyten_setup' ) ): +/** + * Sets up theme defaults and registers support for various WordPress features. + * + * Note that this function is hooked into the after_setup_theme hook, which runs + * before the init hook. The init hook is too late for some features, such as indicating + * support post thumbnails. + * + * To override twentyten_setup() in a child theme, add your own twentyten_setup to your child theme's + * functions.php file. + * + * @uses add_theme_support() To add support for post thumbnails and automatic feed links. + * @uses register_nav_menus() To add support for navigation menus. + * @uses add_custom_background() To add support for a custom background. + * @uses add_editor_style() To style the visual editor. + * @uses load_theme_textdomain() For translation/localization support. + * @uses add_custom_image_header() To add support for a custom header. + * @uses register_default_headers() To register the default custom header images provided with the theme. + * @uses set_post_thumbnail_size() To set a custom post thumbnail size. + * + * @since Twenty Ten 1.0 + */ +function twentyten_setup() { + + // This theme styles the visual editor with editor-style.css to match the theme style. + add_editor_style(); + + // This theme uses post thumbnails + add_theme_support( 'post-thumbnails' ); + + // Add default posts and comments RSS feed links to head + add_theme_support( 'automatic-feed-links' ); + + // Make theme available for translation + // Translations can be filed in the /languages/ directory + load_theme_textdomain( 'twentyten', TEMPLATEPATH . '/languages' ); + + $locale = get_locale(); + $locale_file = TEMPLATEPATH . "/languages/$locale.php"; + if ( is_readable( $locale_file ) ) + require_once( $locale_file ); + + // This theme uses wp_nav_menu() in one location. + register_nav_menus( array( + 'primary' => __( 'Primary Navigation', 'twentyten' ), + ) ); + + // This theme allows users to set a custom background + add_custom_background(); + + // Your changeable header business starts here + define( 'HEADER_TEXTCOLOR', '' ); + // No CSS, just IMG call. The %s is a placeholder for the theme template directory URI. + define( 'HEADER_IMAGE', '%s/images/headers/path.jpg' ); + + // The height and width of your custom header. You can hook into the theme's own filters to change these values. + // Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values. + define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) ); + define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) ); + + // We'll be using post thumbnails for custom header images on posts and pages. + // We want them to be 940 pixels wide by 198 pixels tall. + // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. + set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); + + // Don't support text inside the header image. + define( 'NO_HEADER_TEXT', true ); + + // Add a way for the custom header to be styled in the admin panel that controls + // custom headers. See twentyten_admin_header_style(), below. + add_custom_image_header( '', 'twentyten_admin_header_style' ); + + // ... and thus ends the changeable header business. + + // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI. + register_default_headers( array( + 'berries' => array( + 'url' => '%s/images/headers/berries.jpg', + 'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg', + /* translators: header image description */ + 'description' => __( 'Berries', 'twentyten' ) + ), + 'cherryblossom' => array( + 'url' => '%s/images/headers/cherryblossoms.jpg', + 'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg', + /* translators: header image description */ + 'description' => __( 'Cherry Blossoms', 'twentyten' ) + ), + 'concave' => array( + 'url' => '%s/images/headers/concave.jpg', + 'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg', + /* translators: header image description */ + 'description' => __( 'Concave', 'twentyten' ) + ), + 'fern' => array( + 'url' => '%s/images/headers/fern.jpg', + 'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg', + /* translators: header image description */ + 'description' => __( 'Fern', 'twentyten' ) + ), + 'forestfloor' => array( + 'url' => '%s/images/headers/forestfloor.jpg', + 'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg', + /* translators: header image description */ + 'description' => __( 'Forest Floor', 'twentyten' ) + ), + 'inkwell' => array( + 'url' => '%s/images/headers/inkwell.jpg', + 'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg', + /* translators: header image description */ + 'description' => __( 'Inkwell', 'twentyten' ) + ), + 'path' => array( + 'url' => '%s/images/headers/path.jpg', + 'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg', + /* translators: header image description */ + 'description' => __( 'Path', 'twentyten' ) + ), + 'sunset' => array( + 'url' => '%s/images/headers/sunset.jpg', + 'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg', + /* translators: header image description */ + 'description' => __( 'Sunset', 'twentyten' ) + ) + ) ); +} +endif; + +if ( ! function_exists( 'twentyten_admin_header_style' ) ) : +/** + * Styles the header image displayed on the Appearance > Header admin panel. + * + * Referenced via add_custom_image_header() in twentyten_setup(). + * + * @since Twenty Ten 1.0 + */ +function twentyten_admin_header_style() { +?> + + tag, by filtering the output of wp_title(). + * + * If we have a site description and we're viewing the home page or a blog posts + * page (when using a static front page), then we will add the site description. + * + * If we're viewing a search result, then we're going to recreate the title entirely. + * We're going to add page numbers to all titles as well, to the middle of a search + * result title and the end of all other titles. + * + * The site title also gets added to all titles. + * + * @since Twenty Ten 1.0 + * + * @param string $title Title generated by wp_title() + * @param string $separator The separator passed to wp_title(). Twenty Ten uses a + * vertical bar, "|", as a separator in header.php. + * @return string The new title, ready for the tag. + */ +function twentyten_filter_wp_title( $title, $separator ) { + // Don't affect wp_title() calls in feeds. + if ( is_feed() ) + return $title; + + // The $paged global variable contains the page number of a listing of posts. + // The $page global variable contains the page number of a single post that is paged. + // We'll display whichever one applies, if we're not looking at the first page. + global $paged, $page; + + if ( is_search() ) { + // If we're a search, let's start over: + $title = sprintf( __( 'Search results for %s', 'twentyten' ), '"' . get_search_query() . '"' ); + // Add a page number if we're on page 2 or more: + if ( $paged >= 2 ) + $title .= " $separator " . sprintf( __( 'Page %s', 'twentyten' ), $paged ); + // Add the site name to the end: + $title .= " $separator " . get_bloginfo( 'name', 'display' ); + // We're done. Let's send the new title back to wp_title(): + return $title; + } + + // Otherwise, let's start by adding the site name to the end: + $title .= get_bloginfo( 'name', 'display' ); + + // If we have a site description and we're on the home/front page, add the description: + $site_description = get_bloginfo( 'description', 'display' ); + if ( $site_description && ( is_home() || is_front_page() ) ) + $title .= " $separator " . $site_description; + + // Add a page number if necessary: + if ( $paged >= 2 || $page >= 2 ) + $title .= " $separator " . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ); + + // Return the new title to wp_title(): + return $title; +} +add_filter( 'wp_title', 'twentyten_filter_wp_title', 10, 2 ); + +/** + * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. + * + * To override this in a child theme, remove the filter and optionally add + * your own function tied to the wp_page_menu_args filter hook. + * + * @since Twenty Ten 1.0 + */ +function twentyten_page_menu_args( $args ) { + $args['show_home'] = true; + return $args; +} +add_filter( 'wp_page_menu_args', 'twentyten_page_menu_args' ); + +/** + * Sets the post excerpt length to 40 characters. + * + * To override this length in a child theme, remove the filter and add your own + * function tied to the excerpt_length filter hook. + * + * @since Twenty Ten 1.0 + * @return int + */ +function twentyten_excerpt_length( $length ) { + return 40; +} +add_filter( 'excerpt_length', 'twentyten_excerpt_length' ); + +/** + * Returns a "Continue Reading" link for excerpts + * + * @since Twenty Ten 1.0 + * @return string "Continue Reading" link + */ +function twentyten_continue_reading_link() { + return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) . '</a>'; +} + +/** + * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyten_continue_reading_link(). + * + * To override this in a child theme, remove the filter and add your own + * function tied to the excerpt_more filter hook. + * + * @since Twenty Ten 1.0 + * @return string An ellipsis + */ +function twentyten_auto_excerpt_more( $more ) { + return ' …' . twentyten_continue_reading_link(); +} +add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' ); + +/** + * Adds a pretty "Continue Reading" link to custom post excerpts. + * + * To override this link in a child theme, remove the filter and add your own + * function tied to the get_the_excerpt filter hook. + * + * @since Twenty Ten 1.0 + * @return string Excerpt with a pretty "Continue Reading" link + */ +function twentyten_custom_excerpt_more( $output ) { + if ( has_excerpt() && ! is_attachment() ) { + $output .= twentyten_continue_reading_link(); + } + return $output; +} +add_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' ); + +/** + * Remove inline styles printed when the gallery shortcode is used. + * + * Galleries are styled by the theme in Twenty Ten's style.css. + * + * @since Twenty Ten 1.0 + * @return string The gallery style filter, with the styles themselves removed. + */ +function twentyten_remove_gallery_css( $css ) { + return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css ); +} +add_filter( 'gallery_style', 'twentyten_remove_gallery_css' ); + +if ( ! function_exists( 'twentyten_comment' ) ) : +/** + * Template for comments and pingbacks. + * + * To override this walker in a child theme without modifying the comments template + * simply create your own twentyten_comment(), and that function will be used instead. + * + * Used as a callback by wp_list_comments() for displaying the comments. + * + * @since Twenty Ten 1.0 + */ +function twentyten_comment( $comment, $args, $depth ) { + $GLOBALS['comment'] = $comment; + switch ( $comment->comment_type ) : + case '' : + ?> + <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> + <div id="comment-<?php comment_ID(); ?>"> + <div class="comment-author vcard"> + <?php echo get_avatar( $comment, 40 ); ?> + <?php printf( __( '%s <span class="says">says:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?> + </div><!-- .comment-author .vcard --> + <?php if ( $comment->comment_approved == '0' ) : ?> + <em><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em> + <br /> + <?php endif; ?> + + <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"> + <?php + /* translators: 1: date, 2: time */ + printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); + ?> + </div><!-- .comment-meta .commentmetadata --> + + <div class="comment-body"><?php comment_text(); ?></div> + + <div class="reply"> + <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> + </div><!-- .reply --> + </div><!-- #comment-## --> + + <?php + break; + case 'pingback' : + case 'trackback' : + ?> + <li class="post pingback"> + <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'twentyten'), ' ' ); ?></p> + <?php + break; + endswitch; +} +endif; + +/** + * Register widgetized areas, including two sidebars and four widget-ready columns in the footer. + * + * To override twentyten_widgets_init() in a child theme, remove the action hook and add your own + * function tied to the init hook. + * + * @since Twenty Ten 1.0 + * @uses register_sidebar + */ +function twentyten_widgets_init() { + // Area 1, located at the top of the sidebar. + register_sidebar( array( + 'name' => __( 'Primary Widget Area', 'twentyten' ), + 'id' => 'primary-widget-area', + 'description' => __( 'The primary widget area', 'twentyten' ), + 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', + 'after_widget' => '</li>', + 'before_title' => '<h3 class="widget-title">', + 'after_title' => '</h3>', + ) ); + + // Area 2, located below the Primary Widget Area in the sidebar. Empty by default. + register_sidebar( array( + 'name' => __( 'Secondary Widget Area', 'twentyten' ), + 'id' => 'secondary-widget-area', + 'description' => __( 'The secondary widget area', 'twentyten' ), + 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', + 'after_widget' => '</li>', + 'before_title' => '<h3 class="widget-title">', + 'after_title' => '</h3>', + ) ); + + // Area 3, located in the footer. Empty by default. + register_sidebar( array( + 'name' => __( 'First Footer Widget Area', 'twentyten' ), + 'id' => 'first-footer-widget-area', + 'description' => __( 'The first footer widget area', 'twentyten' ), + 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', + 'after_widget' => '</li>', + 'before_title' => '<h3 class="widget-title">', + 'after_title' => '</h3>', + ) ); + + // Area 4, located in the footer. Empty by default. + register_sidebar( array( + 'name' => __( 'Second Footer Widget Area', 'twentyten' ), + 'id' => 'second-footer-widget-area', + 'description' => __( 'The second footer widget area', 'twentyten' ), + 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', + 'after_widget' => '</li>', + 'before_title' => '<h3 class="widget-title">', + 'after_title' => '</h3>', + ) ); + + // Area 5, located in the footer. Empty by default. + register_sidebar( array( + 'name' => __( 'Third Footer Widget Area', 'twentyten' ), + 'id' => 'third-footer-widget-area', + 'description' => __( 'The third footer widget area', 'twentyten' ), + 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', + 'after_widget' => '</li>', + 'before_title' => '<h3 class="widget-title">', + 'after_title' => '</h3>', + ) ); + + // Area 6, located in the footer. Empty by default. + register_sidebar( array( + 'name' => __( 'Fourth Footer Widget Area', 'twentyten' ), + 'id' => 'fourth-footer-widget-area', + 'description' => __( 'The fourth footer widget area', 'twentyten' ), + 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', + 'after_widget' => '</li>', + 'before_title' => '<h3 class="widget-title">', + 'after_title' => '</h3>', + ) ); +} +/** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */ +add_action( 'widgets_init', 'twentyten_widgets_init' ); + +/** + * Removes the default styles that are packaged with the Recent Comments widget. + * + * To override this in a child theme, remove the filter and optionally add your own + * function tied to the widgets_init action hook. + * + * @since Twenty Ten 1.0 + */ +function twentyten_remove_recent_comments_style() { + global $wp_widget_factory; + remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); +} +add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' ); + +if ( ! function_exists( 'twentyten_posted_on' ) ) : +/** + * Prints HTML with meta information for the current post—date/time and author. + * + * @since Twenty Ten 1.0 + */ +function twentyten_posted_on() { + printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'twentyten' ), + 'meta-prep meta-prep-author', + sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>', + get_permalink(), + esc_attr( get_the_time() ), + get_the_date() + ), + sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', + get_author_posts_url( get_the_author_meta( 'ID' ) ), + sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ), + get_the_author() + ) + ); +} +endif; + +if ( ! function_exists( 'twentyten_posted_in' ) ) : +/** + * Prints HTML with meta information for the current post (category, tags and permalink). + * + * @since Twenty Ten 1.0 + */ +function twentyten_posted_in() { + // Retrieves tag list of current post, separated by commas. + $tag_list = get_the_tag_list( '', ', ' ); + if ( $tag_list ) { + $posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' ); + } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { + $posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' ); + } else { + $posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyten' ); + } + // Prints the string, replacing the placeholders. + printf( + $posted_in, + get_the_category_list( ', ' ), + $tag_list, + get_permalink(), + the_title_attribute( 'echo=0' ) + ); +} +endif; diff --git a/wp-content/themes/twentyten/header.php b/wp-content/themes/twentyten/header.php new file mode 100644 index 00000000..fbd24860 --- /dev/null +++ b/wp-content/themes/twentyten/header.php @@ -0,0 +1,78 @@ +<?php +/** + * The Header for our theme. + * + * Displays all of the <head> section and everything up till <div id="main"> + * + * @package WordPress + * @subpackage Twenty_Ten + * @since Twenty Ten 1.0 + */ +?><!DOCTYPE html> +<html <?php language_attributes(); ?>> +<head> +<meta charset="<?php bloginfo( 'charset' ); ?>" /> +<title><?php + /* + * Print the <title> tag based on what is being viewed. + * We filter the output of wp_title() a bit -- see + * twentyten_filter_wp_title() in functions.php. + */ + wp_title( '|', true, 'right' ); + + ?> + + + + + * tag of your theme, or you will break many plugins, which + * generally use this hook to add elements to such + * as styles, scripts, and meta tags. + */ + wp_head(); +?> + + +> +
    + + +
    diff --git a/wp-content/themes/twentyten/images/headers/berries-thumbnail.jpg b/wp-content/themes/twentyten/images/headers/berries-thumbnail.jpg new file mode 100644 index 00000000..6e684f48 Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/berries-thumbnail.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/berries.jpg b/wp-content/themes/twentyten/images/headers/berries.jpg new file mode 100644 index 00000000..3031a059 Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/berries.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/cherryblossoms-thumbnail.jpg b/wp-content/themes/twentyten/images/headers/cherryblossoms-thumbnail.jpg new file mode 100644 index 00000000..710049a3 Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/cherryblossoms-thumbnail.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/cherryblossoms.jpg b/wp-content/themes/twentyten/images/headers/cherryblossoms.jpg new file mode 100644 index 00000000..56e9df0e Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/cherryblossoms.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/concave-thumbnail.jpg b/wp-content/themes/twentyten/images/headers/concave-thumbnail.jpg new file mode 100644 index 00000000..b2718679 Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/concave-thumbnail.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/concave.jpg b/wp-content/themes/twentyten/images/headers/concave.jpg new file mode 100644 index 00000000..9970de26 Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/concave.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/fern-thumbnail.jpg b/wp-content/themes/twentyten/images/headers/fern-thumbnail.jpg new file mode 100644 index 00000000..c6113ab5 Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/fern-thumbnail.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/fern.jpg b/wp-content/themes/twentyten/images/headers/fern.jpg new file mode 100644 index 00000000..fc0b3943 Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/fern.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/forestfloor-thumbnail.jpg b/wp-content/themes/twentyten/images/headers/forestfloor-thumbnail.jpg new file mode 100644 index 00000000..b888fc3e Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/forestfloor-thumbnail.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/forestfloor.jpg b/wp-content/themes/twentyten/images/headers/forestfloor.jpg new file mode 100644 index 00000000..45339488 Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/forestfloor.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/inkwell-thumbnail.jpg b/wp-content/themes/twentyten/images/headers/inkwell-thumbnail.jpg new file mode 100644 index 00000000..61e775ed Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/inkwell-thumbnail.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/inkwell.jpg b/wp-content/themes/twentyten/images/headers/inkwell.jpg new file mode 100644 index 00000000..82b0b7d1 Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/inkwell.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/path-thumbnail.jpg b/wp-content/themes/twentyten/images/headers/path-thumbnail.jpg new file mode 100644 index 00000000..0585ec46 Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/path-thumbnail.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/path.jpg b/wp-content/themes/twentyten/images/headers/path.jpg new file mode 100644 index 00000000..d8694978 Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/path.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/sunset-thumbnail.jpg b/wp-content/themes/twentyten/images/headers/sunset-thumbnail.jpg new file mode 100644 index 00000000..416c11a8 Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/sunset-thumbnail.jpg differ diff --git a/wp-content/themes/twentyten/images/headers/sunset.jpg b/wp-content/themes/twentyten/images/headers/sunset.jpg new file mode 100644 index 00000000..66eddaa7 Binary files /dev/null and b/wp-content/themes/twentyten/images/headers/sunset.jpg differ diff --git a/wp-content/themes/twentyten/images/wordpress.png b/wp-content/themes/twentyten/images/wordpress.png new file mode 100644 index 00000000..224f7c8d Binary files /dev/null and b/wp-content/themes/twentyten/images/wordpress.png differ diff --git a/wp-content/themes/twentyten/index.php b/wp-content/themes/twentyten/index.php new file mode 100644 index 00000000..9f7d240c --- /dev/null +++ b/wp-content/themes/twentyten/index.php @@ -0,0 +1,32 @@ + + +
    +
    + + +
    +
    + + + diff --git a/wp-content/themes/twentyten/languages/twentyten.pot b/wp-content/themes/twentyten/languages/twentyten.pot new file mode 100644 index 00000000..b8985cf5 --- /dev/null +++ b/wp-content/themes/twentyten/languages/twentyten.pot @@ -0,0 +1,433 @@ +# Translation of the WordPress theme Twenty Ten 1.0 by the WordPress team. +# Copyright (C) 2010 the WordPress team +# This file is distributed under the same license as the Twenty Ten package. +# FIRST AUTHOR , 2010. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Twenty Ten 1.0\n" +"Report-Msgid-Bugs-To: http://wordpress.org/tag/twentyten\n" +"POT-Creation-Date: 2010-06-15 16:21+0000\n" +"PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" + +#: 404.php:16 loop.php:33 +msgid "Not Found" +msgstr "" + +#: 404.php:18 +msgid "" +"Apologies, but the page you requested could not be found. Perhaps searching " +"will help." +msgstr "" + +#: archive.php:33 +#, php-format +msgid "Daily Archives: %s" +msgstr "" + +#: archive.php:35 +#, php-format +msgid "Monthly Archives: %s" +msgstr "" + +#: archive.php:37 +#, php-format +msgid "Yearly Archives: %s" +msgstr "" + +#: archive.php:39 +msgid "Blog Archives" +msgstr "" + +#: attachment.php:17 +#, php-format +msgid "Return to %s" +msgstr "" + +#. translators: %s - title of parent post +#: attachment.php:19 +#, php-format +msgid " %s" +msgstr "" + +#: attachment.php:27 +#, php-format +msgid "By %2$s" +msgstr "" + +#: attachment.php:31 functions.php:509 +#, php-format +msgid "View all posts by %s" +msgstr "" + +#: attachment.php:38 +#, php-format +msgid "Published %2$s" +msgstr "" + +#: attachment.php:48 +#, php-format +msgid "Full size is %s pixels" +msgstr "" + +#: attachment.php:51 +msgid "Link to full-size image" +msgstr "" + +#: attachment.php:58 attachment.php:105 loop.php:94 loop.php:117 loop.php:159 +#: onecolumn-page.php:27 page.php:32 single.php:53 +msgid "Edit" +msgstr "" + +#: attachment.php:98 functions.php:299 loop.php:109 loop.php:137 +msgid "Continue reading " +msgstr "" + +#: attachment.php:99 loop.php:138 onecolumn-page.php:26 page.php:31 +#: single.php:31 +msgid "Pages:" +msgstr "" + +#: author.php:27 +#, php-format +msgid "Author Archives: %s" +msgstr "" + +#: author.php:37 single.php:40 +#, php-format +msgid "About %s" +msgstr "" + +#: category.php:16 +#, php-format +msgid "Category Archives: %s" +msgstr "" + +#: comments.php:18 +msgid "" +"This post is password protected. Enter the password to view any comments." +msgstr "" + +#: comments.php:35 +#, php-format +msgid "One Response to %2$s" +msgid_plural "%1$s Responses to %2$s" +msgstr[0] "" +msgstr[1] "" + +#: comments.php:41 comments.php:60 +msgid " Older Comments" +msgstr "" + +#: comments.php:42 comments.php:61 +msgid "Newer Comments " +msgstr "" + +#: comments.php:72 +msgid "Comments are closed." +msgstr "" + +#. #-#-#-#-# twentyten.pot (Twenty Ten 1.0) #-#-#-#-# +#. Theme URI of the plugin/theme +#: footer.php:33 +msgid "http://wordpress.org/" +msgstr "" + +#: footer.php:34 +msgid "Semantic Personal Publishing Platform" +msgstr "" + +#: footer.php:35 +#, php-format +msgid "Proudly powered by %s." +msgstr "" + +#: functions.php:97 +msgid "Primary Navigation" +msgstr "" + +#. translators: header image description +#: functions.php:133 +msgid "Berries" +msgstr "" + +#. translators: header image description +#: functions.php:139 +msgid "Cherry Blossoms" +msgstr "" + +#. translators: header image description +#: functions.php:145 +msgid "Concave" +msgstr "" + +#. translators: header image description +#: functions.php:151 +msgid "Fern" +msgstr "" + +#. translators: header image description +#: functions.php:157 +msgid "Forest Floor" +msgstr "" + +#. translators: header image description +#: functions.php:163 +msgid "Inkwell" +msgstr "" + +#. translators: header image description +#: functions.php:169 +msgid "Path" +msgstr "" + +#. translators: header image description +#: functions.php:175 +msgid "Sunset" +msgstr "" + +#: functions.php:237 +#, php-format +msgid "Search results for %s" +msgstr "" + +#: functions.php:240 functions.php:257 +#, php-format +msgid "Page %s" +msgstr "" + +#: functions.php:366 +#, php-format +msgid "%s says:" +msgstr "" + +#: functions.php:369 +msgid "Your comment is awaiting moderation." +msgstr "" + +#. translators: 1: date, 2: time +#: functions.php:376 +#, php-format +msgid "%1$s at %2$s" +msgstr "" + +#: functions.php:376 functions.php:393 +msgid "(Edit)" +msgstr "" + +#: functions.php:393 +msgid "Pingback:" +msgstr "" + +#: functions.php:412 +msgid "Primary Widget Area" +msgstr "" + +#: functions.php:414 +msgid "The primary widget area" +msgstr "" + +#: functions.php:423 +msgid "Secondary Widget Area" +msgstr "" + +#: functions.php:425 +msgid "The secondary widget area" +msgstr "" + +#: functions.php:434 +msgid "First Footer Widget Area" +msgstr "" + +#: functions.php:436 +msgid "The first footer widget area" +msgstr "" + +#: functions.php:445 +msgid "Second Footer Widget Area" +msgstr "" + +#: functions.php:447 +msgid "The second footer widget area" +msgstr "" + +#: functions.php:456 +msgid "Third Footer Widget Area" +msgstr "" + +#: functions.php:458 +msgid "The third footer widget area" +msgstr "" + +#: functions.php:467 +msgid "Fourth Footer Widget Area" +msgstr "" + +#: functions.php:469 +msgid "The fourth footer widget area" +msgstr "" + +#: functions.php:500 +#, php-format +msgid "" +"Posted on %2$s by %3$s" +msgstr "" + +#: functions.php:526 +#, php-format +msgid "" +"This entry was posted in %1$s and tagged %2$s. Bookmark the permalink." +msgstr "" + +#: functions.php:528 +#, php-format +msgid "" +"This entry was posted in %1$s. Bookmark the permalink." +msgstr "" + +#: functions.php:530 +#, php-format +msgid "" +"Bookmark the permalink." +msgstr "" + +#: header.php:71 +msgid "Skip to content" +msgstr "" + +#: loop.php:25 loop.php:172 +msgid " Older posts" +msgstr "" + +#: loop.php:26 loop.php:173 +msgid "Newer posts " +msgstr "" + +#: loop.php:35 +msgid "" +"Apologies, but no results were found for the requested archive. Perhaps " +"searching will help find a related post." +msgstr "" + +#: loop.php:60 loop.php:91 +msgctxt "gallery category slug" +msgid "gallery" +msgstr "" + +#: loop.php:62 loop.php:82 loop.php:125 +#, php-format +msgid "Permalink to %s" +msgstr "" + +#: loop.php:81 +#, php-format +msgid "This gallery contains %2$s photos." +msgstr "" + +#: loop.php:91 +msgid "View posts in the Gallery category" +msgstr "" + +#: loop.php:91 +msgid "More Galleries" +msgstr "" + +#: loop.php:93 loop.php:116 loop.php:158 +msgid "Leave a comment" +msgstr "" + +#: loop.php:93 loop.php:116 loop.php:158 +msgid "1 Comment" +msgstr "" + +#: loop.php:93 loop.php:116 loop.php:158 +msgid "% Comments" +msgstr "" + +#: loop.php:100 +msgctxt "asides category slug" +msgid "asides" +msgstr "" + +#: loop.php:145 +#, php-format +msgid "Posted in %2$s" +msgstr "" + +#: loop.php:154 +#, php-format +msgid "Tagged %2$s" +msgstr "" + +#: search.php:16 +#, php-format +msgid "Search Results for: %s" +msgstr "" + +#: search.php:26 +msgid "Nothing Found" +msgstr "" + +#: search.php:28 +msgid "" +"Sorry, but nothing matched your search criteria. Please try again with some " +"different keywords." +msgstr "" + +#: sidebar.php:27 +msgid "Archives" +msgstr "" + +#: sidebar.php:34 +msgid "Meta" +msgstr "" + +#: single.php:18 single.php:58 +msgctxt "Previous post link" +msgid "←" +msgstr "" + +#: single.php:19 single.php:59 +msgctxt "Next post link" +msgid "→" +msgstr "" + +#: single.php:44 +#, php-format +msgid "View all posts by %s " +msgstr "" + +#: tag.php:16 +#, php-format +msgid "Tag Archives: %s" +msgstr "" + +#. Theme Name of the plugin/theme +msgid "Twenty Ten" +msgstr "" + +#. Description of the plugin/theme +msgid "The 2010 default theme for WordPress." +msgstr "" + +#. Author of the plugin/theme +msgid "the WordPress team" +msgstr "" + +#. Tags of the plugin/theme +msgid "" +"black, blue, white, two-columns, fixed-width, custom-header, custom-" +"background, threaded-comments, sticky-post, translation-ready, microformats, " +"rtl-language-support, editor-style" +msgstr "" diff --git a/wp-content/themes/twentyten/license.txt b/wp-content/themes/twentyten/license.txt new file mode 100644 index 00000000..5fbe4a70 --- /dev/null +++ b/wp-content/themes/twentyten/license.txt @@ -0,0 +1,281 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110, USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + diff --git a/wp-content/themes/twentyten/loop.php b/wp-content/themes/twentyten/loop.php new file mode 100644 index 00000000..84c167dc --- /dev/null +++ b/wp-content/themes/twentyten/loop.php @@ -0,0 +1,175 @@ +get_template_part( 'loop', 'index' ); + * + * @package WordPress + * @subpackage Twenty_Ten + * @since Twenty Ten 1.0 + */ +?> + + +max_num_pages > 1 ) : ?> + + + + + +
    +

    +
    +

    + +
    +
    + + + + + + + + +
    > +

    + + + +
    + + + + +

    %2$s photos.', 'twentyten' ), + 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"', + $total_images + ); ?>

    + + + +
    + +
    + + | + + | ', '' ); ?> +
    +
    + + + + +
    > + + +
    + +
    + +
    + →', 'twentyten' ) ); ?> +
    + + +
    + + | + + | ', '' ); ?> +
    +
    + + + + +
    > +

    + + + + +
    + +
    + +
    + →', 'twentyten' ) ); ?> + '' ) ); ?> +
    + + +
    + + + Posted in %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?> + + | + + + + Tagged %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?> + + | + + + | ', '' ); ?> +
    +
    + + + + + + + + +max_num_pages > 1 ) : ?> + + diff --git a/wp-content/themes/twentyten/onecolumn-page.php b/wp-content/themes/twentyten/onecolumn-page.php new file mode 100644 index 00000000..90b1abf3 --- /dev/null +++ b/wp-content/themes/twentyten/onecolumn-page.php @@ -0,0 +1,38 @@ + + +
    +
    + + + +
    > +

    +
    + + '' ) ); ?> + ', '' ); ?> +
    +
    + + + + + +
    +
    + + diff --git a/wp-content/themes/twentyten/page.php b/wp-content/themes/twentyten/page.php new file mode 100644 index 00000000..540767c5 --- /dev/null +++ b/wp-content/themes/twentyten/page.php @@ -0,0 +1,44 @@ + + +
    +
    + + + +
    > + +

    + +

    + + +
    + + '' ) ); ?> + ', '' ); ?> +
    +
    + + + + + +
    +
    + + + diff --git a/wp-content/themes/twentyten/rtl.css b/wp-content/themes/twentyten/rtl.css new file mode 100644 index 00000000..4ae54e4d --- /dev/null +++ b/wp-content/themes/twentyten/rtl.css @@ -0,0 +1,282 @@ +/* +Theme Name: Twenty Ten +*/ + + +/* +RTL Basics +*/ + + +body { + direction:rtl; + unicode-bidi:embed; +} + + +/* +LAYOUT: Two-Column (Right) +DESCRIPTION: Two-column fixed layout with one sidebar right of content +*/ + +#container { + float: right; + margin: 0 0 0 -240px; +} +#content { + margin: 0 20px 36px 280px; +} +#primary, +#secondary { + float: left; +} +#secondary { + clear: left; +} + + +/* =Fonts +-------------------------------------------------------------- */ +body, +input, +textarea, +.page-title span, +.pingback a.url, +h3#comments-title, +h3#reply-title, +#access .menu, +#access div.menu ul, +#cancel-comment-reply-link, +.form-allowed-tags, +#site-info, +#site-title, +#wp-calendar, +.comment-meta, +.comment-body tr th, +.comment-body thead th, +.entry-content label, +.entry-content tr th, +.entry-content thead th, +.entry-meta, +.entry-title, +.entry-utility, +#respond label, +.navigation, +.page-title, +.pingback p, +.reply, +.widget-title, +input[type=submit] { + font-family: Arial, Tahoma, sans-serif; +} + +/* =Structure +-------------------------------------------------------------- */ + +/* The main theme structure */ +#footer-widget-area .widget-area { + float: right; + margin-left: 20px; + margin-right: 0; +} +#footer-widget-area #fourth { + margin-left: 0; +} +#site-info { + float: right; +} +#site-generator { + float: left; +} + + +/* =Global Elements +-------------------------------------------------------------- */ + +/* Text elements */ +ul { + margin: 0 1.5em 18px 0; +} +blockquote { + font-style: normal; +} + +/* Text meant only for screen readers */ +.screen-reader-text { + left: auto; + text-indent:-9000px; + overflow:hidden; +} + + +/* =Header +-------------------------------------------------------------- */ + +#site-title { + float: right; +} +#site-description { + clear: left; + float: left; + font-style: normal; +} + +/* =Menu +-------------------------------------------------------------- */ + +#access { + float:right; +} + +#access .menu-header, +div.menu { + margin-right: 12px; + margin-left: 0; +} + +#access .menu-header li, +div.menu li{ + float:right; +} + +#access ul ul { + left:auto; + right:0; + float:right; +} +#access ul ul ul { + left:auto; + right:100%; +} + +/* =Content +-------------------------------------------------------------- */ + +#content table { + text-align: right; + margin: 0 0 24px -1px; +} +.page-title span { + font-style:normal; +} +.entry-title, +.entry-meta { + clear: right; + float: right; + margin-left: 68px; + margin-right: 0; +} + +.entry-content input.file, +.entry-content input.button { + margin-left: 24px; + margin-right:0; +} +.entry-content blockquote.left { + float: right; + margin-right: 0; + margin-left: 24px; + text-align: left; +} +.entry-content blockquote.right { + float: left; + margin-right: 24px; + margin-left: 0; + text-align: right; +} +#entry-author-info #author-avatar { + float: right; + margin: 0 0 0 -104px; +} +#entry-author-info #author-description { + float: right; + margin: 0 104px 0 0; +} + +/* Gallery listing +-------------------------------------------------------------- */ + +.category-gallery .gallery-thumb { + float: right; + margin-left:20px; + margin-right:0; +} + + +/* Images +-------------------------------------------------------------- */ + +#content .gallery .gallery-caption { + margin-right: 0; +} + +#content .gallery .gallery-item { + float: right; +} + +/* =Navigation +-------------------------------------------------------------- */ +.nav-previous { + float: right; +} +.nav-next { + float: left; + text-align:left; +} + +/* =Comments +-------------------------------------------------------------- */ + +.commentlist li.comment { + padding: 0 56px 0 0; +} +.commentlist .avatar { + right: 0; + left: auto; +} +.comment-author .says, #comments .pingback .url { + font-style: normal; +} + +/* Comments form */ +.children #respond { + margin: 0 0 0 48px; +} + +/* =Widget Areas +-------------------------------------------------------------- */ + +.widget-area ul { + margin-right: 0; +} +.widget-area ul ul { + margin-right: 1.3em; + margin-left: 0; +} +#wp-calendar caption { + text-align: right; +} +#wp-calendar tfoot #next { + text-align: left; +} + +/* Main sidebars */ +#main .widget-area ul { + margin-right: 0; + padding: 0 0 0 20px; +} +#main .widget-area ul ul { + margin-right: 1.3em; + margin-left: 0; +} + +/* =Footer +-------------------------------------------------------------- */ +#site-generator { + font-style:normal; +} +#site-generator a { + background-position: right center; + padding-right: 20px; + padding-left: 0; +} \ No newline at end of file diff --git a/wp-content/themes/twentyten/screenshot.png b/wp-content/themes/twentyten/screenshot.png new file mode 100644 index 00000000..256069fc Binary files /dev/null and b/wp-content/themes/twentyten/screenshot.png differ diff --git a/wp-content/themes/twentyten/search.php b/wp-content/themes/twentyten/search.php new file mode 100644 index 00000000..3b198bb2 --- /dev/null +++ b/wp-content/themes/twentyten/search.php @@ -0,0 +1,37 @@ + + +
    +
    + + +

    ' . get_search_query() . '' ); ?>

    + + +
    +

    +
    +

    + +
    +
    + +
    +
    + + + diff --git a/wp-content/themes/twentyten/sidebar-footer.php b/wp-content/themes/twentyten/sidebar-footer.php new file mode 100644 index 00000000..0e9f7023 --- /dev/null +++ b/wp-content/themes/twentyten/sidebar-footer.php @@ -0,0 +1,60 @@ + + + + + diff --git a/wp-content/themes/twentyten/sidebar.php b/wp-content/themes/twentyten/sidebar.php new file mode 100644 index 00000000..7e2565b8 --- /dev/null +++ b/wp-content/themes/twentyten/sidebar.php @@ -0,0 +1,56 @@ + + + + + + + + + diff --git a/wp-content/themes/twentyten/single.php b/wp-content/themes/twentyten/single.php new file mode 100644 index 00000000..f97fd460 --- /dev/null +++ b/wp-content/themes/twentyten/single.php @@ -0,0 +1,70 @@ + + +
    +
    + + + + + +
    > +

    + + + +
    + + '' ) ); ?> +
    + + +
    +
    + +
    + +
    + + +
    + + ', '' ); ?> +
    +
    + + + + + + + +
    +
    + + + diff --git a/wp-content/themes/twentyten/style.css b/wp-content/themes/twentyten/style.css new file mode 100644 index 00000000..71a129e7 --- /dev/null +++ b/wp-content/themes/twentyten/style.css @@ -0,0 +1,1346 @@ +/* +Theme Name: Twenty Ten +Theme URI: http://wordpress.org/ +Description: The 2010 default theme for WordPress. +Author: the WordPress team +Version: 1.0 +Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style +*/ + + +/* Reset default browser CSS. Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/index.html +-------------------------------------------------------------- */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + vertical-align: baseline; + background: transparent; +} +body { + line-height: 1; +} +h1, h2, h3, h4, h5, h6 { + font-weight: normal; + clear: both; +} +ol, ul { + list-style: none; +} +blockquote { + quotes: none; +} +blockquote:before, blockquote:after { + content: ''; + content: none; +} +del { + text-decoration: line-through; +} +/* tables still need 'cellspacing="0"' in the markup */ +table { + border-collapse: collapse; + border-spacing: 0; +} +a img { border: none; } + + + +/* +LAYOUT: Two columns +DESCRIPTION: Two-column fixed layout with one sidebar right of content +*/ + +#container { + float: left; + margin: 0 -240px 0 0; + width: 100%; +} +#content { + margin: 0 280px 0 20px; +} +#primary, +#secondary { + float: right; + overflow: hidden; + width: 220px; +} +#secondary { + clear: right; +} +#footer { + clear: both; + width: 100%; +} + +/* +LAYOUT: One column, no sidebar +DESCRIPTION: One centered column with no sidebar +*/ + +.one-column #content { + margin: 0 auto; + width: 640px; +} + +/* +LAYOUT: Full width, no sidebar +DESCRIPTION: Full width content with no sidebar; used for attachment pages +*/ + +.single-attachment #content { + margin: 0 auto; + width: 900px; +} + + +/* =Fonts +-------------------------------------------------------------- */ +body, +input, +textarea, +.page-title span, +.pingback a.url { + font-family: Georgia, "Bitstream Charter", serif; +} + +h3#comments-title, +h3#reply-title, +#access .menu, +#access div.menu ul, +#cancel-comment-reply-link, +.form-allowed-tags, +#site-info, +#site-title, +#wp-calendar, +.comment-meta, +.comment-body tr th, +.comment-body thead th, +.entry-content label, +.entry-content tr th, +.entry-content thead th, +.entry-meta, +.entry-title, +.entry-utility, +#respond label, +.navigation, +.page-title, +.pingback p, +.reply, +.widget-title, +.wp-caption-text, +input[type=submit] +{ + font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; +} +pre { + font-family: "Courier 10 Pitch", Courier, monospace; +} +code { + font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; +} + + + +/* =Structure +-------------------------------------------------------------- */ + +/* The main theme structure */ +#access .menu-header, +div.menu, +#colophon, +#branding, +#main, +#wrapper { + margin: 0 auto; + width: 940px; +} +#wrapper { + margin-top: 20px; + background: #fff; + padding: 0 20px; +} + +/* Structure the footer area */ +#footer-widget-area { + overflow: hidden; +} +#footer-widget-area .widget-area { + float: left; + margin-right: 20px; + width: 220px; +} +#footer-widget-area #fourth { + margin-right: 0; +} +#site-info { + float: left; + width: 700px; + font-weight: bold; + font-size: 14px; +} +#site-generator { + float: right; + width: 220px; +} + + + +/* =Global Elements +-------------------------------------------------------------- */ + +/* Main global 'theme' and typographic styles */ +body { + background: #f1f1f1; +} + +body, +input, +textarea { + color: #666; + font-size: 12px; + line-height: 18px; +} +hr { + background-color: #E7E7E7; + border:0; + height: 1px; + margin-bottom: 18px; + clear:both; +} + +/* Text elements */ +p { + margin-bottom: 18px; +} +ul { + list-style: square; + margin: 0 0 18px 1.5em; +} +ol { + list-style: decimal; + margin: 0 0 18px 1.5em; +} +ol ol { + list-style:upper-alpha; +} +ol ol ol { + list-style:lower-roman; +} +ol ol ol ol { + list-style:lower-alpha; +} +ul ul, +ol ol, +ul ol, +ol ul { + margin-bottom:0; +} +dl { + margin:0 0 24px 0; +} +dt { + font-weight: bold; +} +dd { + margin-bottom: 18px; +} +strong { + font-weight: bold; +} +cite, +em, +i { + font-style: italic; +} +big { + font-size: 131.25%; +} +ins { + background: #ffc; + text-decoration: none; +} +blockquote { + font-style: italic; + padding: 0 3em; +} +blockquote cite, +blockquote em, +blockquote i { + font-style: normal; +} +pre { + background: #f7f7f7; + color: #222; + line-height: 18px; + margin-bottom: 18px; + padding: 1.5em; +} +abbr, +acronym { + border-bottom: 1px dotted #666; + cursor: help; +} + +sup, +sub { + height: 0; + line-height: 1; + vertical-align: baseline; + position: relative; +} +sup { + bottom: 1ex; +} +sub { + top: .5ex; +} +input[type="text"], +textarea { + padding: 2px; + background: #f9f9f9; + border: 1px solid #ccc; + box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); + -moz-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); + -webkit-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); +} +a:link { + color:#0066CC; +} +a:visited { + color:#743399; +} +a:active, +a:hover { + color: #FF4B33; +} + +/* Text meant only for screen readers */ +.screen-reader-text { + position: absolute; + left: -9000px; +} + + + +/* =Header +-------------------------------------------------------------- */ + +#header { + padding: 30px 0 0 0; +} +#site-title { + float: left; + margin: 0 0 18px 0; + width: 700px; + font-size: 30px; + line-height: 36px; +} +#site-title a { + color: #000; + font-weight: bold; + text-decoration: none; +} +#site-description { + clear: right; + float: right; + font-style: italic; + margin: 14px 0 18px 0; + width: 220px; +} + +/* This is the custom header image */ +#branding img { + clear: both; + border-top: 4px solid #000; + display: block; + border-bottom: 1px solid #000; +} + + + +/* =Menu +-------------------------------------------------------------- */ + +#access { + background: #000; + margin: 0 auto; + width: 940px; + display:block; + float:left; +} +#access .menu-header, +div.menu { + font-size: 13px; + margin-left: 12px; +} +#access .menu-header ul, +div.menu ul { + list-style: none; + margin: 0; +} +#access .menu-header li, +div.menu li { + float:left; + position: relative; +} +#access a { + display:block; + text-decoration:none; + color:#aaa; + padding:0 10px; + line-height:38px; +} +#access ul ul { + display:none; + position:absolute; + top:38px; + left:0; + float:left; + box-shadow: 0px 3px 3px rgba(0,0,0,0.2); + -moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); + -webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); + width: 180px; + z-index: 99999; +} +#access ul ul li { + min-width: 180px; +} +#access ul ul ul { + left:100%; + top:0; +} +#access ul ul a { + background:#333; + height:auto; + line-height:1em; + padding:10px; + width: 160px; +} +#access li:hover > a, +#access ul ul :hover > a { + color:#fff; + background:#333; +} +#access ul li:hover > ul { + display:block; +} +#access ul li.current_page_item > a, +#access ul li.current-menu-ancestor > a, +#access ul li.current-menu-item > a, +#access ul li.current-menu-parent > a { + color: #fff; +} + +* html #access ul li.current_page_item a, +* html #access ul li.current-menu-ancestor a, +* html #access ul li.current-menu-item a, +* html #access ul li.current-menu-parent a, +* html #access ul li a:hover { + color:#fff; +} + +/* =Content +-------------------------------------------------------------- */ + +#main { + overflow: hidden; + padding: 40px 0 0 0; +} +#content { + margin-bottom: 36px; +} +#content, +#content input, +#content textarea { + color: #333; + font-size: 16px; + line-height: 24px; +} +#content p, +#content ul, +#content ol, +#content dd, +#content pre, +#content hr { + margin-bottom:24px; +} +#content ul ul, +#content ol ol, +#content ul ol, +#content ol ul { + margin-bottom:0; +} +#content pre, +#content kbd, +#content tt, +#content var { + font-size: 15px; + line-height: 21px; +} +#content code { + font-size: 13px; +} +#content dt, +#content th { + color: #000; +} +#content h1, +#content h2, +#content h3, +#content h4, +#content h5, +#content h6 { + color: #000; + margin: 0 0 20px 0; + line-height: 1.5em; +} +#content table { + border: 1px solid #e7e7e7; + text-align: left; + margin: 0 -1px 24px 0; + width: 100%; +} +#content tr th, +#content thead th { + color: #888; + font-size: 12px; + font-weight: bold; + line-height: 18px; + padding: 9px 24px; +} +#content tr td { + border-top: 1px solid #e7e7e7; + padding: 6px 24px; +} +#content tr.odd td { + background: #F2F7FC; +} +.hentry { + margin: 0 0 48px 0; +} +.home .sticky { + background: #F2F7FC; + border-top: 4px solid #000; + padding: 18px 20px; + margin-left: -20px; + margin-right: -20px; +} +.single .hentry { + margin: 0 0 36px 0; +} +.page-title { + color: #000; + font-size: 14px; + font-weight: bold; + margin: 0 0 36px 0; +} +.page-title span { + color: #333; + font-size: 16px; + font-style: italic; + font-weight: normal; +} +.page-title a:link, +.page-title a:visited { + color:#888; + text-decoration: none; +} +.page-title a:active, +.page-title a:hover { + color: #FF4B33; +} +#content .entry-title { + color: #000; + font-size: 21px; + line-height: 1.3em; + font-weight: bold; + margin-bottom: 0; +} +.entry-title a:link, +.entry-title a:visited { + color:#000; + text-decoration: none; +} +.entry-title a:active, +.entry-title a:hover { + color: #FF4B33; +} +.entry-meta { + color: #888; + font-size: 12px; +} +.entry-meta abbr, +.entry-utility abbr { + border: none; +} +.entry-meta abbr:hover, +.entry-utility abbr:hover { + border-bottom: 1px dotted #666; +} +.entry-content, +.entry-summary { + clear: both; + padding: 12px 0 0 0; +} +#content .entry-summary p:last-child { + margin-bottom: 12px; +} +.entry-content fieldset { + border: 1px solid #E7E7E7; + margin: 0 0 24px 0; + padding: 24px; +} +.entry-content fieldset legend { + background: #fff; + color: #000; + font-weight: bold; + padding: 0 24px; +} +.entry-content input { + margin: 0 0 24px 0; +} +.entry-content input.file, +.entry-content input.button { + margin-right: 24px; +} +.entry-content label { + color: #888; + font-size: 12px; +} +.entry-content select { + margin: 0 0 24px 0; +} +.entry-content sup, +.entry-content sub { + font-size: 10px; +} +.entry-content blockquote.left { + float: left; + margin-left: 0; + margin-right: 24px; + text-align: right; + width: 33%; +} +.entry-content blockquote.right { + float: right; + margin-left: 24px; + margin-right: 0; + text-align: left; + width: 33%; +} +.page-link { + color: #000; + font-weight:bold; + margin:0 0 22px 0; + word-spacing:0.5em; +} +.page-link a:link, +.page-link a:visited { + background: #f1f1f1; + color:#333; + font-weight:normal; + padding:0.5em 0.75em; + text-decoration:none; +} +.home .sticky .page-link a { + background: #D9E8F7; +} +.page-link a:active, +.page-link a:hover { + color: #FF4B33; +} +.page .edit-link { + clear: both; + display: block; +} +#entry-author-info { + background: #F2F7FC; + border-top: 4px solid #000; + padding: 18px 20px; + margin: 24px 0; + overflow: hidden; + clear: both; + font-size: 14px; + line-height: 20px; +} +#entry-author-info #author-avatar { + background: #fff; + border: 1px solid #e7e7e7; + float: left; + margin: 0 -104px 0 0; + padding: 11px; + height: 60px; +} +#entry-author-info #author-description { + float: left; + margin: 0 0 0 104px; +} +#entry-author-info h2 { + color: #000; + font-weight: bold; + font-size: 100%; + margin-bottom: 0; +} +.entry-utility { + color: #888; + font-size: 12px; + line-height: 18px; + clear: both; +} +.entry-meta a, +.entry-utility a { + color: #888; +} +.entry-meta a:hover, +.entry-utility a:hover { + color: #FF4B33; +} +#content .video-player { + padding: 0; +} + + + +/* Asides +-------------------------------------------------------------- */ + +.home #content .category-asides p { + font-size: 14px; + line-height: 20px; + margin-bottom: 10px; + margin-top:0; +} +.home .hentry.category-asides { + padding: 0; +} +.home #content .category-asides .entry-content { + padding-top: 0; +} + + + + +/* Gallery listing +-------------------------------------------------------------- */ + +.category-gallery { + margin-bottom: 48px; +} +.category-gallery h2 { + margin-top: 10px; +} +.category-gallery .entry-meta { +} +.category-gallery .size-thumbnail img { + border: 10px solid #f1f1f1; + margin-bottom: 0; +} +.category-gallery .gallery-thumb { + float: left; + margin-right:20px; + margin-top: -4px; +} +.home #content .category-gallery .entry-content p { + display: inline; +} +.home #content .category-gallery .entry-utility { + padding-top:4px; +} + + +/* Attachment pages +-------------------------------------------------------------- */ + +.entry-content .attachment img { + margin-bottom: 0; +} +.attachment .entry-content .entry-caption { + font-size: 140%; + margin-top: 24px; +} +.attachment .entry-content .nav-previous a:before { + content: '\2190\00a0'; +} +.attachment .entry-content .nav-next a:after { + content: '\00a0\2192'; +} + + + +/* Images +-------------------------------------------------------------- */ + +#content img { + margin: 0; + max-width: 640px; +} +#content .attachment img { + max-width: 900px; +} +#content .alignleft, +#content img.alignleft { + display: inline; + float: left; + margin-right: 24px; + margin-top: 4px; +} +#content .alignright, +#content img.alignright { + display: inline; + float: right; + margin-left: 24px; + margin-top: 4px; +} +#content .aligncenter, +#content img.aligncenter { + clear: both; + display: block; + margin-left: auto; + margin-right: auto; +} +#content img.alignleft, +#content img.alignright, +#content img.aligncenter { + margin-bottom: 12px; +} +#content .wp-caption { + background: #f1f1f1; + line-height: 18px; + text-align: center; + margin-bottom: 20px; + padding: 4px; +} +#content .wp-caption img { + margin: 5px 5px 0; +} +#content .wp-caption p.wp-caption-text { + margin: 5px; + color: #888; + font-size: 12px; +} +#content .wp-smiley { + margin:0; +} +#content .gallery { + margin: auto; +} +#content .gallery .gallery-item { + float: left; + margin-top: 0; + text-align: center; + width: 33%; +} +#content .gallery img { + border: 2px solid #cfcfcf; +} +#content .gallery .gallery-caption { + color: #888; + font-size: 12px; + margin: 0 0 12px; +} +#content .gallery dl { + margin: 0; +} +#content .gallery img { + border: 10px solid #f1f1f1; +} +#content .gallery br+br { + display: none; +} + + + +/* =Navigation +-------------------------------------------------------------- */ + +.navigation { + font-size: 12px; + line-height: 18px; + overflow: hidden; + color: #888; +} +.navigation a:link, +.navigation a:visited { + color: #888; + text-decoration: none; +} +.navigation a:active, +.navigation a:hover { + color: #FF4B33; +} +.nav-previous { + float: left; + width: 50%; +} +.nav-next { + float: right; + width: 50%; + text-align:right; +} +#nav-above { + margin: 0 0 18px 0; +} +#nav-above { + display: none; +} +.paged #nav-above, +.single #nav-above { + display: block; +} +#nav-below { + margin: -18px 0 0 0; +} + + + +/* =Comments +-------------------------------------------------------------- */ +#comments { + clear: both; +} +#comments .navigation { + padding: 0 0 18px 0; +} +h3#comments-title, +h3#reply-title { + color: #000; + font-weight: bold; + font-size: 20px; + margin-bottom: 0; +} +h3#comments-title { + padding: 24px 0; +} +.commentlist { + list-style: none; + margin: 0; +} +.commentlist li.comment { + border-bottom: 1px solid #e7e7e7; + line-height: 24px; + margin: 0 0 24px 0; + padding: 0 0 0 56px; + position: relative; +} +.commentlist li:last-child { + border-bottom:none; + margin-bottom:0; +} +#comments .comment-body ul, +#comments .comment-body ol { + margin-bottom: 18px; +} +#comments .comment-body p:last-child { + margin-bottom: 6px; +} +#comments .comment-body blockquote p:last-child { + margin-bottom: 24px; +} +.commentlist ol { + list-style: decimal; +} +.commentlist .avatar { + position: absolute; + top: 4px; + left: 0; +} +.comment-author { +} +.comment-author cite { + color: #000; + font-style: normal; + font-weight: bold; +} +.comment-author .says { + font-style: italic; +} +.comment-meta { + font-size: 12px; + margin: 0 0 18px 0; +} +.comment-meta a:link, +.comment-meta a:visited { + color: #888; + text-decoration: none; +} +.comment-meta a:active, +.comment-meta a:hover { + color: #FF4B33; +} +.commentlist .even { +} +.commentlist .bypostauthor { +} +.reply { + font-size: 12px; + padding: 0 0 24px 0; +} +.reply a, +a.comment-edit-link { + color: #888; +} +.reply a:hover, +a.comment-edit-link:hover { + color: #FF4B33; +} +.commentlist .children { + list-style: none; + margin: 0; +} +.commentlist .children li { + border: none; + margin: 0; +} +.nopassword, +.nocomments { + display: none; +} +#comments .pingback { + margin-bottom: 18px; + padding-bottom: 18px; + border-bottom: 1px solid #e7e7e7; +} +.commentlist li.comment+li.pingback { + margin-top: -6px; +} +#comments .pingback p { + color: #888; + font-size: 12px; + line-height: 18px; + display:block; + margin: 0; +} +#comments .pingback .url { + font-style: italic; + font-size: 13px; +} + + + +/* Comments form */ +input[type=submit] { + color: #333; +} +#respond { + margin: 24px 0; + border-top: 1px solid #e7e7e7; + overflow: hidden; + position: relative; +} +#respond p { + margin: 0; +} +#respond .comment-notes { + margin-bottom: 1em; +} +.form-allowed-tags { + line-height: 1em; +} +.children #respond { + margin: 0 48px 0 0; +} +h3#reply-title { + margin: 18px 0; +} +#comments-list #respond { + margin: 0 0 18px 0; +} +#comments-list ul #respond { + margin: 0; +} +#cancel-comment-reply-link { + font-size: 12px; + line-height: 18px; + font-weight: normal; +} +#respond .required { + color:#FF4B33; + font-weight:bold; +} +#respond label { + color: #888; + font-size: 12px; +} +#respond input { + margin:0 0 9px; + width:98%; +} +#respond textarea { + width:98%; +} +#respond .form-allowed-tags { + color: #888; + font-size: 12px; + line-height: 18px; +} +#respond .form-allowed-tags code { + font-size: 11px; +} +#respond .form-submit { + margin: 12px 0; +} +#respond .form-submit input { + width: auto; + font-size: 14px; +} + + +/* =Widget Areas +-------------------------------------------------------------- */ + +.widget-area ul { + list-style: none; + margin-left: 0; +} +.widget-area ul ul { + list-style: square; + margin-left: 1.3em; +} +.widget_search #s { /* This keeps the search inputs in line */ + width: 60%; +} +.widget_search label { + display:none; +} +.widget-container { + margin: 0 0 18px 0; +} +.widget-title { + color: #222; + font-weight: bold; +} +.widget-area a:link, +.widget-area a:visited { + text-decoration: none; +} +.widget-area a:active, +.widget-area a:hover { + text-decoration: underline; +} +.widget-area .entry-meta { + font-size: 11px; +} +#wp_tag_cloud div { + line-height: 1.6em; +} +#wp-calendar { + width:100%; +} +#wp-calendar caption { + font-weight: bold; + color: #222; + text-align: left; + font-size:14px; + padding-bottom: 4px; +} +#wp-calendar thead { + font-size:11px; +} +#wp-calendar thead th { +} +#wp-calendar tbody { + color: #aaa; +} +#wp-calendar tbody td { + padding: 3px 0 2px; + background: #f5f5f5; + border:1px solid #fff; + text-align: center; +} +#wp-calendar tbody .pad { + background: none; +} +#wp-calendar tfoot #next { + text-align: right; +} +.widget_rss a.rsswidget { + color: #000; +} +.widget_rss a.rsswidget:hover { + color: #FF4B33; +} +.widget_rss .widget-title img { + height: 11px; + width: 11px; +} + +/* Main sidebars */ +#main .widget-area ul { + margin-left: 0; + padding: 0 20px 0 0; +} +#main .widget-area ul ul { + border: none; + margin-left: 1.3em; + padding: 0; +} +#primary { +} +#secondary { +} + +/* Footer widget areas */ +#footer-widget-area { +} + + + +/* =Footer +-------------------------------------------------------------- */ + +#footer { + margin-bottom: 20px; +} +#colophon { + border-top: 4px solid #000; + margin-top: -4px; + padding: 18px 0; + overflow: hidden; +} +#site-info { + font-weight: bold; +} +#site-info a { + color: #000; + text-decoration: none; +} +#site-generator { + position: relative; + font-style: italic; +} +#site-generator a { + color: #666; + display:inline-block; + text-decoration: none; + background: url(images/wordpress.png) center left no-repeat; + padding-left: 20px; + line-height: 16px; +} +#site-generator a:hover { + text-decoration: underline; +} +img#wpstats { + display:block; + margin: 0 auto 10px; +} + + + +/* Mobile Safari ( iPad, iPhone and iPod Touch ) +-------------------------------------------------------------- */ + +pre { + -webkit-text-size-adjust: 140%; +} +code { + -webkit-text-size-adjust: 160%; +} +#access, +.entry-meta, +.entry-utility, +.navigation, +.widget-area { + -webkit-text-size-adjust: 120%; +} +#site-description { + -webkit-text-size-adjust: none; +} + + + +/* =Print Style +-------------------------------------------------------------- */ + +@media print { + body { + background:none !important; + } + #wrapper { + float: none !important; + clear: both !important; + display: block !important; + position: relative !important; + } + #header { + border-bottom: 2pt solid #000; + padding-bottom: 18pt; + } + #colophon { + border-top: 2pt solid #000; + } + #site-title, + #site-description { + float: none; + margin: 0; + padding:0; + line-height: 1.4em; + } + #site-title { + font-size: 13pt; + } + .entry-content { + font-size: 14pt; + line-height: 1.6em; + } + .entry-title { + font-size: 21pt; + } + #access, + #branding img, + #respond, + .comment-edit-link, + .edit-link, + .navigation, + .page-link, + .widget-area { + display: none !important; + } + #container, + #header, + #footer { + width: 100%; + margin: 0; + } + #content, + .one-column #content { + width: 100%; + margin: 24pt 0 0; + } + .wp-caption p { + font-size: 11pt; + } + #site-info, + #site-generator { + float: none; + width: auto; + } + #colophon { + width: auto; + } + img#wpstats { + display:none + } + #site-generator a { + padding: 0; + margin: 0; + } + #entry-author-info { + border: 1px solid #e7e7e7; + } + #main { + display:inline; + } + .home .sticky { + border: none; + } +} diff --git a/wp-content/themes/twentyten/tag.php b/wp-content/themes/twentyten/tag.php new file mode 100644 index 00000000..2c0cb874 --- /dev/null +++ b/wp-content/themes/twentyten/tag.php @@ -0,0 +1,30 @@ + + +
    +
    + +

    ' . single_tag_title( '', false ) . '' ); + ?>

    + + +
    +
    + + + diff --git a/wp-cron.php b/wp-cron.php index 4f3335b4..19427c5c 100644 --- a/wp-cron.php +++ b/wp-cron.php @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/wp-includes/Text/Diff.php b/wp-includes/Text/Diff.php index 06d1c6c7..3ba7b4c7 100644 --- a/wp-includes/Text/Diff.php +++ b/wp-includes/Text/Diff.php @@ -6,10 +6,8 @@ * The original PHP version of this code was written by Geoffrey T. Dairiki * , and is used/adapted with his permission. * - * $Horde: framework/Text_Diff/Diff.php,v 1.26 2008/01/04 10:07:49 jan Exp $ - * * Copyright 2004 Geoffrey T. Dairiki - * Copyright 2004-2008 The Horde Project (http://www.horde.org/) + * Copyright 2004-2010 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. @@ -65,6 +63,44 @@ class Text_Diff { return $this->_edits; } + /** + * returns the number of new (added) lines in a given diff. + * + * @since Text_Diff 1.1.0 + * + * @return integer The number of new lines + */ + function countAddedLines() + { + $count = 0; + foreach ($this->_edits as $edit) { + if (is_a($edit, 'Text_Diff_Op_add') || + is_a($edit, 'Text_Diff_Op_change')) { + $count += $edit->nfinal(); + } + } + return $count; + } + + /** + * Returns the number of deleted (removed) lines in a given diff. + * + * @since Text_Diff 1.1.0 + * + * @return integer The number of deleted lines + */ + function countDeletedLines() + { + $count = 0; + foreach ($this->_edits as $edit) { + if (is_a($edit, 'Text_Diff_Op_delete') || + is_a($edit, 'Text_Diff_Op_change')) { + $count += $edit->norig(); + } + } + return $count; + } + /** * Computes a reversed diff. * diff --git a/wp-includes/Text/Diff/Engine/native.php b/wp-includes/Text/Diff/Engine/native.php index aa5bca5b..93eaef22 100644 --- a/wp-includes/Text/Diff/Engine/native.php +++ b/wp-includes/Text/Diff/Engine/native.php @@ -1,9 +1,8 @@ . The original PHP version of this * code was written by him, and is used/adapted with his permission. * - * Copyright 2004-2008 The Horde Project (http://www.horde.org/) + * Copyright 2004-2010 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. diff --git a/wp-includes/Text/Diff/Engine/shell.php b/wp-includes/Text/Diff/Engine/shell.php index 7e9629f5..faf38703 100644 --- a/wp-includes/Text/Diff/Engine/shell.php +++ b/wp-includes/Text/Diff/Engine/shell.php @@ -5,9 +5,7 @@ * This class uses the Unix `diff` program via shell_exec to compute the * differences between the two input arrays. * - * $Horde: framework/Text_Diff/Diff/Engine/shell.php,v 1.8 2008/01/04 10:07:50 jan Exp $ - * - * Copyright 2007-2008 The Horde Project (http://www.horde.org/) + * Copyright 2007-2010 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. diff --git a/wp-includes/Text/Diff/Engine/string.php b/wp-includes/Text/Diff/Engine/string.php index 1a0bd3f3..59eb8adb 100644 --- a/wp-includes/Text/Diff/Engine/string.php +++ b/wp-includes/Text/Diff/Engine/string.php @@ -10,10 +10,8 @@ * echo $renderer->render($diff); * * - * $Horde: framework/Text_Diff/Diff/Engine/string.php,v 1.7 2008/01/04 10:07:50 jan Exp $ - * * Copyright 2005 Örjan Persson - * Copyright 2005-2008 The Horde Project (http://www.horde.org/) + * Copyright 2005-2010 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. @@ -39,6 +37,19 @@ class Text_Diff_Engine_string { */ function diff($diff, $mode = 'autodetect') { + // Detect line breaks. + $lnbr = "\n"; + if (strpos($diff, "\r\n") !== false) { + $lnbr = "\r\n"; + } elseif (strpos($diff, "\r") !== false) { + $lnbr = "\r"; + } + + // Make sure we have a line break at the EOF. + if (substr($diff, -strlen($lnbr)) != $lnbr) { + $diff .= $lnbr; + } + if ($mode != 'autodetect' && $mode != 'context' && $mode != 'unified') { return PEAR::raiseError('Type of diff is unsupported'); } @@ -48,17 +59,20 @@ class Text_Diff_Engine_string { $unified = strpos($diff, '---'); if ($context === $unified) { return PEAR::raiseError('Type of diff could not be detected'); - } elseif ($context === false || $context === false) { + } elseif ($context === false || $unified === false) { $mode = $context !== false ? 'context' : 'unified'; } else { $mode = $context < $unified ? 'context' : 'unified'; } } - // split by new line and remove the diff header - $diff = explode("\n", $diff); - array_shift($diff); - array_shift($diff); + // Split by new line and remove the diff header, if there is one. + $diff = explode($lnbr, $diff); + if (($mode == 'context' && strpos($diff[0], '***') === 0) || + ($mode == 'unified' && strpos($diff[0], '---') === 0)) { + array_shift($diff); + array_shift($diff); + } if ($mode == 'context') { return $this->parseContextDiff($diff); diff --git a/wp-includes/Text/Diff/Engine/xdiff.php b/wp-includes/Text/Diff/Engine/xdiff.php index a39a4be1..b9f17360 100644 --- a/wp-includes/Text/Diff/Engine/xdiff.php +++ b/wp-includes/Text/Diff/Engine/xdiff.php @@ -5,9 +5,7 @@ * This class uses the xdiff PECL package (http://pecl.php.net/package/xdiff) * to compute the differences between the two input arrays. * - * $Horde: framework/Text_Diff/Diff/Engine/xdiff.php,v 1.6 2008/01/04 10:07:50 jan Exp $ - * - * Copyright 2004-2008 The Horde Project (http://www.horde.org/) + * Copyright 2004-2010 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. @@ -42,6 +40,9 @@ class Text_Diff_Engine_xdiff { * valid, albeit a little less descriptive and efficient. */ $edits = array(); foreach ($diff as $line) { + if (!strlen($line)) { + continue; + } switch ($line[0]) { case ' ': $edits[] = &new Text_Diff_Op_copy(array(substr($line, 1))); diff --git a/wp-includes/Text/Diff/Renderer.php b/wp-includes/Text/Diff/Renderer.php index 5d226b4e..922f4c09 100644 --- a/wp-includes/Text/Diff/Renderer.php +++ b/wp-includes/Text/Diff/Renderer.php @@ -5,9 +5,7 @@ * This class renders the diff in classic diff format. It is intended that * this class be customized via inheritance, to obtain fancier outputs. * - * $Horde: framework/Text_Diff/Diff/Renderer.php,v 1.21 2008/01/04 10:07:50 jan Exp $ - * - * Copyright 2004-2008 The Horde Project (http://www.horde.org/) + * Copyright 2004-2010 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. diff --git a/wp-includes/Text/Diff/Renderer/inline.php b/wp-includes/Text/Diff/Renderer/inline.php index 1493eaa0..392bd57c 100644 --- a/wp-includes/Text/Diff/Renderer/inline.php +++ b/wp-includes/Text/Diff/Renderer/inline.php @@ -2,9 +2,7 @@ /** * "Inline" diff renderer. * - * $Horde: framework/Text_Diff/Diff/Renderer/inline.php,v 1.21 2008/01/04 10:07:51 jan Exp $ - * - * Copyright 2004-2008 The Horde Project (http://www.horde.org/) + * Copyright 2004-2010 The Horde Project (http://www.horde.org/) * * See the enclosed file COPYING for license information (LGPL). If you did * not receive this file, see http://opensource.org/licenses/lgpl-license.php. @@ -30,42 +28,65 @@ class Text_Diff_Renderer_inline extends Text_Diff_Renderer { /** * Number of leading context "lines" to preserve. + * + * @var integer */ var $_leading_context_lines = 10000; /** * Number of trailing context "lines" to preserve. + * + * @var integer */ var $_trailing_context_lines = 10000; /** * Prefix for inserted text. + * + * @var string */ var $_ins_prefix = ''; /** * Suffix for inserted text. + * + * @var string */ var $_ins_suffix = ''; /** * Prefix for deleted text. + * + * @var string */ var $_del_prefix = ''; /** * Suffix for deleted text. + * + * @var string */ var $_del_suffix = ''; /** * Header for each change block. + * + * @var string */ var $_block_header = ''; + /** + * Whether to split down to character-level. + * + * @var boolean + */ + var $_split_characters = false; + /** * What are we currently splitting on? Used to recurse to show word-level - * changes. + * or character-level changes. + * + * @var string */ var $_split_level = 'lines'; @@ -85,10 +106,10 @@ class Text_Diff_Renderer_inline extends Text_Diff_Renderer { array_walk($lines, array(&$this, '_encode')); } - if ($this->_split_level == 'words') { - return implode('', $lines); - } else { + if ($this->_split_level == 'lines') { return implode("\n", $lines) . "\n"; + } else { + return implode('', $lines); } } @@ -110,8 +131,13 @@ class Text_Diff_Renderer_inline extends Text_Diff_Renderer { function _changed($orig, $final) { - /* If we've already split on words, don't try to do so again - just - * display. */ + /* If we've already split on characters, just display. */ + if ($this->_split_level == 'characters') { + return $this->_deleted($orig) + . $this->_added($final); + } + + /* If we've already split on words, just display. */ if ($this->_split_level == 'words') { $prefix = ''; while ($orig[0] !== false && $final[0] !== false && @@ -130,15 +156,23 @@ class Text_Diff_Renderer_inline extends Text_Diff_Renderer { /* Non-printing newline marker. */ $nl = "\0"; - /* We want to split on word boundaries, but we need to - * preserve whitespace as well. Therefore we split on words, - * but include all blocks of whitespace in the wordlist. */ - $diff = new Text_Diff($this->_splitOnWords($text1, $nl), - $this->_splitOnWords($text2, $nl)); + if ($this->_split_characters) { + $diff = new Text_Diff('native', + array(preg_split('//', $text1), + preg_split('//', $text2))); + } else { + /* We want to split on word boundaries, but we need to preserve + * whitespace as well. Therefore we split on words, but include + * all blocks of whitespace in the wordlist. */ + $diff = new Text_Diff('native', + array($this->_splitOnWords($text1, $nl), + $this->_splitOnWords($text2, $nl))); + } /* Get the diff in inline format. */ - $renderer = new Text_Diff_Renderer_inline(array_merge($this->getParams(), - array('split_level' => 'words'))); + $renderer = new Text_Diff_Renderer_inline + (array_merge($this->getParams(), + array('split_level' => $this->_split_characters ? 'characters' : 'words'))); /* Run the diff and get the output. */ return str_replace($nl, "\n", $renderer->render($diff)) . "\n"; diff --git a/wp-includes/author-template.php b/wp-includes/author-template.php index 51ff8a97..bc44349f 100644 --- a/wp-includes/author-template.php +++ b/wp-includes/author-template.php @@ -22,6 +22,10 @@ */ function get_the_author($deprecated = '') { global $authordata; + + if ( !empty( $deprecated ) ) + _deprecated_argument( __FUNCTION__, '2.1' ); + return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null); } @@ -41,10 +45,14 @@ function get_the_author($deprecated = '') { * @link http://codex.wordpress.org/Template_Tags/the_author * * @param string $deprecated Deprecated. - * @param string $deprecated_echo Echo the string or return it. + * @param string $deprecated_echo Deprecated. Use get_the_author(). Echo the string or return it. * @return string The author's display name, from get_the_author(). */ -function the_author($deprecated = '', $deprecated_echo = true) { +function the_author( $deprecated = '', $deprecated_echo = true ) { + if ( !empty( $deprecated ) ) + _deprecated_argument( __FUNCTION__, '2.1' ); + if ( $deprecated_echo !== true ) + _deprecated_argument( __FUNCTION__, '1.5', __('Use get_the_author() instead if you do not want the value echoed.') ); if ( $deprecated_echo ) echo get_the_author(); return get_the_author(); @@ -119,6 +127,23 @@ function the_author_meta($field = '', $user_id = false) { echo apply_filters('the_author_' . $field, get_the_author_meta($field, $user_id), $user_id); } +/** + * Retrieve either author's link or author's name. + * + * If the author has a home page set, return an HTML link, otherwise just return the + * author's name. + * + * @uses get_the_author_meta() + * @uses get_the_author() + */ +function get_the_author_link() { + if ( get_the_author_meta('url') ) { + return '' . get_the_author() . ''; + } else { + return get_the_author(); + } +} + /** * Display either author's link or author's name. * @@ -127,15 +152,10 @@ function the_author_meta($field = '', $user_id = false) { * * @link http://codex.wordpress.org/Template_Tags/the_author_link * @since 2.1 - * @uses get_the_author_meta() - * @uses the_author() + * @uses get_the_author_link() */ function the_author_link() { - if ( get_the_author_meta('url') ) { - echo '' . get_the_author() . ''; - } else { - the_author(); - } + echo get_the_author_link(); } /** @@ -143,12 +163,12 @@ function the_author_link() { * * @since 1.5 * @uses $post The current post in the Loop's DB object. - * @uses get_usernumposts() + * @uses count_user_posts() * @return int The number of posts by the author. */ function get_the_author_posts() { global $post; - return get_usernumposts($post->post_author); + return count_user_posts($post->post_author); } /** @@ -156,7 +176,7 @@ function get_the_author_posts() { * * @link http://codex.wordpress.org/Template_Tags/the_author_posts * @since 0.71 - * @uses get_the_author_posts() Echos returned value from function. + * @uses get_the_author_posts() Echoes returned value from function. */ function the_author_posts() { echo get_the_author_posts(); @@ -177,6 +197,9 @@ function the_author_posts() { * @param string $deprecated Deprecated. */ function the_author_posts_link($deprecated = '') { + if ( !empty( $deprecated ) ) + _deprecated_argument( __FUNCTION__, '2.1' ); + global $authordata; $link = sprintf( '%3$s', @@ -200,7 +223,7 @@ function get_author_posts_url($author_id, $author_nicename = '') { $link = $wp_rewrite->get_author_permastruct(); if ( empty($link) ) { - $file = get_option('home') . '/'; + $file = home_url() . '/'; $link = $file . '?author=' . $auth_ID; } else { if ( '' == $author_nicename ) { @@ -209,7 +232,7 @@ function get_author_posts_url($author_id, $author_nicename = '') { $author_nicename = $user->user_nicename; } $link = str_replace('%author%', $author_nicename, $link); - $link = get_option('home') . trailingslashit($link); + $link = home_url() . trailingslashit($link); } $link = apply_filters('author_link', $link, $author_id, $author_nicename); @@ -258,12 +281,20 @@ function wp_list_authors($args = '') { $return = ''; /** @todo Move select to get_authors(). */ - $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name"); + $users = get_users_of_blog(); + $author_ids = array(); + foreach ( (array) $users as $user ) + $author_ids[] = $user->user_id; + if ( count($author_ids) > 0 ) { + $author_ids = implode(',', $author_ids ); + $authors = $wpdb->get_results( "SELECT ID, user_nicename from $wpdb->users WHERE ID IN($author_ids) " . ($exclude_admin ? "AND user_login <> 'admin' " : '') . "ORDER BY display_name" ); + } else { + $authors = array(); + } $author_count = array(); - foreach ((array) $wpdb->get_results("SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author") as $row) { + foreach ( (array) $wpdb->get_results("SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql( 'post' ) . " GROUP BY post_author") as $row ) $author_count[$row->post_author] = $row->count; - } foreach ( (array) $authors as $author ) { @@ -326,10 +357,8 @@ function wp_list_authors($args = '') { } - if ( !($posts == 0 && $hide_empty) && 'list' == $style ) - $return .= $link . ''; - else if ( ! $hide_empty ) - $return .= $link . ', '; + if ( $posts || ! $hide_empty ) + $return .= $link . ( ( 'list' == $style ) ? '' : ', ' ); } $return = trim($return, ', '); diff --git a/wp-includes/bookmark-template.php b/wp-includes/bookmark-template.php index cf24da6c..7c5949cc 100644 --- a/wp-includes/bookmark-template.php +++ b/wp-includes/bookmark-template.php @@ -153,6 +153,8 @@ function _walk_bookmarks($bookmarks, $args = '' ) { * formatted bookmarks. * 'categorize' - Default is 1 (integer). Whether to show links listed by * category (default) or show links in one column. + * 'show_description' - Default is 0 (integer). Whether to show the description + * of the bookmark. * * These options define how the Category name will appear before the category * links are displayed, if 'categorize' is 1. If 'categorize' is 0, then it will diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php index c406fcaf..641ae3b4 100644 --- a/wp-includes/bookmark.php +++ b/wp-includes/bookmark.php @@ -33,7 +33,7 @@ function get_bookmark($bookmark, $output = OBJECT, $filter = 'raw') { $_bookmark = & $GLOBALS['link']; } elseif ( ! $_bookmark = wp_cache_get($bookmark, 'bookmark') ) { $_bookmark = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1", $bookmark)); - $_bookmark->link_category = array_unique( wp_get_object_terms($_bookmark->link_id, 'link_category', 'fields=ids') ); + $_bookmark->link_category = array_unique( wp_get_object_terms($_bookmark->link_id, 'link_category', array('fields' => 'ids')) ); wp_cache_add($_bookmark->link_id, $_bookmark, 'bookmark'); } } @@ -79,21 +79,6 @@ function get_bookmark_field( $field, $bookmark, $context = 'display' ) { return sanitize_bookmark_field($field, $bookmark->$field, $bookmark->link_id, $context); } -/** - * Retrieve bookmark data based on ID. - * - * @since 2.0.0 - * @deprecated Use get_bookmark() - * @see get_bookmark() - * - * @param int $bookmark_id ID of link - * @param string $output Either OBJECT, ARRAY_N, or ARRAY_A - * @return object|array - */ -function get_link($bookmark_id, $output = OBJECT, $filter = 'raw') { - return get_bookmark($bookmark_id, $output, $filter); -} - /** * Retrieves the list of bookmarks * @@ -236,7 +221,10 @@ function get_bookmarks($args = '') { $orderby = 'rand()'; break; default: - $orderby = "link_" . $orderby; + $orderparams = array(); + foreach ( explode(',', $orderby) as $ordparam ) + $orderparams[] = 'link_' . trim($ordparam); + $orderby = implode(',', $orderparams); } if ( 'link_id' == $orderby ) @@ -321,18 +309,25 @@ function sanitize_bookmark($bookmark, $context = 'display') { * @return mixed The filtered value */ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) { - $int_fields = array('link_id', 'link_rating'); - if ( in_array($field, $int_fields) ) + switch ( $field ) { + case 'link_id' : // ints + case 'link_rating' : $value = (int) $value; - - $yesno = array('link_visible'); - if ( in_array($field, $yesno) ) + break; + case 'link_category' : // array( ints ) + $value = array_map('absint', (array) $value); + // We return here so that the categories aren't filtered. + // The 'link_category' filter is for the name of a link category, not an array of a link's link categories + return $value; + break; + case 'link_visible' : // bool stored as Y|N $value = preg_replace('/[^YNyn]/', '', $value); - - if ( 'link_target' == $field ) { + break; + case 'link_target' : // "enum" $targets = array('_top', '_blank'); if ( ! in_array($value, $targets) ) $value = ''; + break; } if ( 'raw' == $context ) @@ -352,12 +347,12 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) { } else { // Use display filters by default. $value = apply_filters($field, $value, $bookmark_id, $context); - } - if ( 'attribute' == $context ) - $value = esc_attr($value); - else if ( 'js' == $context ) - $value = esc_js($value); + if ( 'attribute' == $context ) + $value = esc_attr($value); + else if ( 'js' == $context ) + $value = esc_js($value); + } return $value; } diff --git a/wp-includes/cache.php b/wp-includes/cache.php index 5eef60b1..62438662 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -149,8 +149,9 @@ function wp_cache_set($key, $data, $flag = '', $expire = 0) { * @param string|array $groups A group or an array of groups to add */ function wp_cache_add_global_groups( $groups ) { - // Default cache doesn't persist so nothing to do here. - return; + global $wp_object_cache; + + return $wp_object_cache->add_global_groups($groups); } /** @@ -165,6 +166,20 @@ function wp_cache_add_non_persistent_groups( $groups ) { return; } +/** + * Reset internal cache keys and structures. If the cache backend uses global blog or site IDs as part of its cache keys, + * this function instructs the backend to reset those keys and perform any cleanup since blog or site IDs have changed since cache init. + * + * @since 2.6.0 + * + * @param string|array $groups A group or an array of groups to add + */ +function wp_cache_reset() { + global $wp_object_cache; + + return $wp_object_cache->reset(); +} + /** * WordPress Object Cache * @@ -199,7 +214,7 @@ class WP_Object_Cache { * @access private * @since 2.0.0 */ - var $non_existant_objects = array (); + var $non_existent_objects = array (); /** * The amount of times the cache data was already stored in the cache. @@ -219,6 +234,15 @@ class WP_Object_Cache { */ var $cache_misses = 0; + /** + * List of global groups + * + * @var array + * @access protected + * @since 3.0.0 + */ + var $global_groups = array(); + /** * Adds data to the cache if it doesn't already exist. * @@ -234,16 +258,30 @@ class WP_Object_Cache { * @param int $expire When to expire the cache contents * @return bool False if cache ID and group already exists, true on success */ - function add($id, $data, $group = 'default', $expire = '') { - if (empty ($group)) + function add( $id, $data, $group = 'default', $expire = '' ) { + if ( empty ($group) ) $group = 'default'; - if (false !== $this->get($id, $group, false)) + if (false !== $this->get($id, $group)) return false; return $this->set($id, $data, $group, $expire); } + /** + * Sets the list of global groups. + * + * @since 3.0.0 + * + * @param array $groups List of groups that are global. + */ + function add_global_groups( $groups ) { + $groups = (array) $groups; + + $this->global_groups = array_merge($this->global_groups, $groups); + $this->global_groups = array_unique($this->global_groups); + } + /** * Remove the contents of the cache ID in the group * @@ -252,7 +290,7 @@ class WP_Object_Cache { * by default. * * On success the group and the id will be added to the - * $non_existant_objects property in the class. + * $non_existent_objects property in the class. * * @since 2.0.0 * @@ -266,11 +304,11 @@ class WP_Object_Cache { if (empty ($group)) $group = 'default'; - if (!$force && false === $this->get($id, $group, false)) + if (!$force && false === $this->get($id, $group)) return false; unset ($this->cache[$group][$id]); - $this->non_existant_objects[$group][$id] = true; + $this->non_existent_objects[$group][$id] = true; return true; } @@ -294,11 +332,11 @@ class WP_Object_Cache { * ID in the cache group. If the cache is hit (success) then the contents * are returned. * - * On failure, the $non_existant_objects property is checked and if the + * On failure, the $non_existent_objects property is checked and if the * cache group and ID exist in there the cache misses will not be - * incremented. If not in the nonexistant objects property, then the cache + * incremented. If not in the nonexistent objects property, then the cache * misses will be incremented and the cache group and ID will be added to - * the nonexistant objects. + * the nonexistent objects. * * @since 2.0.0 * @@ -308,10 +346,10 @@ class WP_Object_Cache { * contents on success */ function get($id, $group = 'default') { - if (empty ($group)) + if ( empty ($group) ) $group = 'default'; - if (isset ($this->cache[$group][$id])) { + if ( isset ($this->cache[$group][$id]) ) { $this->cache_hits += 1; if ( is_object($this->cache[$group][$id]) ) return wp_clone($this->cache[$group][$id]); @@ -319,10 +357,10 @@ class WP_Object_Cache { return $this->cache[$group][$id]; } - if ( isset ($this->non_existant_objects[$group][$id]) ) + if ( isset ($this->non_existent_objects[$group][$id]) ) return false; - $this->non_existant_objects[$group][$id] = true; + $this->non_existent_objects[$group][$id] = true; $this->cache_misses += 1; return false; } @@ -343,12 +381,25 @@ class WP_Object_Cache { if (empty ($group)) $group = 'default'; - if (false === $this->get($id, $group, false)) + if ( false === $this->get($id, $group) ) return false; return $this->set($id, $data, $group, $expire); } + /** + * Reset keys + * + * @since 3.0.0 + */ + function reset() { + // Clear out non-global caches since the blog ID has changed. + foreach ( array_keys($this->cache) as $group ) { + if ( !in_array($group, $this->global_groups) ) + unset($this->cache[$group]); + } + } + /** * Sets the data contents into the cache * @@ -370,10 +421,10 @@ class WP_Object_Cache { * @return bool Always returns true */ function set($id, $data, $group = 'default', $expire = '') { - if (empty ($group)) + if ( empty ($group) ) $group = 'default'; - if (NULL === $data) + if ( NULL === $data ) $data = ''; if ( is_object($data) ) @@ -381,14 +432,14 @@ class WP_Object_Cache { $this->cache[$group][$id] = $data; - if(isset($this->non_existant_objects[$group][$id])) - unset ($this->non_existant_objects[$group][$id]); + if ( isset($this->non_existent_objects[$group][$id]) ) + unset ($this->non_existent_objects[$group][$id]); return true; } /** - * Echos the stats of the caching. + * Echoes the stats of the caching. * * Gives the cache hits, and cache misses. Also prints every cached group, * key and the data. diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index 010e1c5e..1cbf7d27 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -5,8 +5,6 @@ * Based on "Permalink Redirect" from Scott Yang and "Enforce www. Preference" * by Mark Jaquith * - * @author Scott Yang - * @author Mark Jaquith * @package WordPress * @since 2.3.0 */ @@ -44,7 +42,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { if ( !$requested_url ) { // build the URL in the address bar - $requested_url = ( !empty($_SERVER['HTTPS'] ) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; + $requested_url = is_ssl() ? 'https://' : 'http://'; $requested_url .= $_SERVER['HTTP_HOST']; $requested_url .= $_SERVER['REQUEST_URI']; } @@ -63,8 +61,10 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { $redirect_url = false; // Notice fixing - if ( !isset($redirect['path']) ) $redirect['path'] = ''; - if ( !isset($redirect['query']) ) $redirect['query'] = ''; + if ( !isset($redirect['path']) ) + $redirect['path'] = ''; + if ( !isset($redirect['query']) ) + $redirect['query'] = ''; if ( is_singular() && 1 > $wp_query->post_count && ($id = get_query_var('p')) ) { @@ -75,13 +75,26 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { $id = $vars->post_parent; if ( $redirect_url = get_permalink($id) ) - $redirect['query'] = remove_query_arg(array('p', 'page_id', 'attachment_id'), $redirect['query']); + $redirect['query'] = remove_query_arg(array('p', 'page_id', 'attachment_id', 'post_type'), $redirect['query']); } } // These tests give us a WP-generated permalink if ( is_404() ) { - $redirect_url = redirect_guess_404_permalink(); + + // Redirect ?page_id, ?p=, ?attachment_id= to their respective url's + $id = max( get_query_var('p'), get_query_var('page_id'), get_query_var('attachment_id') ); + if ( $id && $redirect_post = get_post($id) ) { + $post_type_obj = get_post_type_object($redirect_post->post_type); + if ( $post_type_obj->public ) { + $redirect_url = get_permalink($redirect_post); + $redirect['query'] = remove_query_arg(array('p', 'page_id', 'attachment_id', 'post_type'), $redirect['query']); + } + } + + if ( ! $redirect_url ) + $redirect_url = redirect_guess_404_permalink(); + } elseif ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) { // rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101 if ( is_attachment() && !empty($_GET['attachment_id']) && ! $redirect_url ) { @@ -89,7 +102,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { $redirect['query'] = remove_query_arg('attachment_id', $redirect['query']); } elseif ( is_single() && !empty($_GET['p']) && ! $redirect_url ) { if ( $redirect_url = get_permalink(get_query_var('p')) ) - $redirect['query'] = remove_query_arg('p', $redirect['query']); + $redirect['query'] = remove_query_arg(array('p', 'post_type'), $redirect['query']); if ( get_query_var( 'page' ) ) { $redirect_url = trailingslashit( $redirect_url ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' ); $redirect['query'] = remove_query_arg( 'page', $redirect['query'] ); @@ -100,6 +113,11 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { } elseif ( is_page() && !empty($_GET['page_id']) && ! $redirect_url ) { if ( $redirect_url = get_permalink(get_query_var('page_id')) ) $redirect['query'] = remove_query_arg('page_id', $redirect['query']); + } elseif ( is_page() && !is_feed() && isset($wp_query->queried_object) && 'page' == get_option('show_on_front') && $wp_query->queried_object->ID == get_option('page_on_front') && ! $redirect_url ) { + $redirect_url = home_url('/'); + } elseif ( is_home() && !empty($_GET['page_id']) && 'page' == get_option('show_on_front') && get_query_var('page_id') == get_option('page_for_posts') && ! $redirect_url ) { + if ( $redirect_url = get_permalink(get_option('page_for_posts')) ) + $redirect['query'] = remove_query_arg('page_id', $redirect['query']); } elseif ( !empty($_GET['m']) && ( is_year() || is_month() || is_day() ) ) { $m = get_query_var('m'); switch ( strlen($m) ) { @@ -125,23 +143,57 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { } elseif ( is_year() && !empty($_GET['year']) ) { if ( $redirect_url = get_year_link(get_query_var('year')) ) $redirect['query'] = remove_query_arg('year', $redirect['query']); - } elseif ( is_category() && !empty($_GET['cat']) && preg_match( '|^[0-9]+$|', $_GET['cat'] ) ) { - if ( $redirect_url = get_category_link(get_query_var('cat')) ) - $redirect['query'] = remove_query_arg('cat', $redirect['query']); } elseif ( is_author() && !empty($_GET['author']) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) { $author = get_userdata(get_query_var('author')); if ( false !== $author && $redirect_url = get_author_posts_url($author->ID, $author->user_nicename) ) - $redirect['query'] = remove_query_arg('author', $redirect['author']); + $redirect['query'] = remove_query_arg('author', $redirect['query']); + } elseif ( is_category() || is_tag() || is_tax() ) { // Terms (Tags/categories) + + $term_count = 0; + foreach ( array('category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in', + 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and') as $key ) + $term_count += count($wp_query->query_vars[$key]); + + $obj = $wp_query->get_queried_object(); + + if ( $term_count <= 1 && !empty($obj->term_id) && ( $tax_url = get_term_link((int)$obj->term_id, $obj->taxonomy) ) && !is_wp_error($tax_url) ) { + + if ( is_category() ) { + $redirect['query'] = remove_query_arg( array( 'category_name', 'category', 'cat'), $redirect['query']); + } elseif ( is_tag() ) { + $redirect['query'] = remove_query_arg( array( 'tag', 'tag_id'), $redirect['query']); + } elseif ( is_tax() ) { // Custom taxonomies will have a custom query var, remove those too: + $tax = get_taxonomy( $obj->taxonomy ); + if ( false !== $tax->query_var) + $redirect['query'] = remove_query_arg($tax->query_var, $redirect['query']); + else + $redirect['query'] = remove_query_arg( array( 'term', 'taxonomy'), $redirect['query']); + } + + $tax_url = parse_url($tax_url); + if ( ! empty($tax_url['query']) ) { // Custom taxonomies may only be accessable via ?taxonomy=..&term=.. + parse_str($tax_url['query'], $query_vars); + $redirect['query'] = add_query_arg($query_vars, $redirect['query']); + } else { // Taxonomy is accessable via a "pretty-URL" + $redirect['path'] = $tax_url['path']; + } + + } + } elseif ( is_single() && strpos($wp_rewrite->permalink_structure, '%category%') !== false ) { + $category = get_term_by('slug', get_query_var('category_name'), 'category'); + $post_terms = wp_get_object_terms($wp_query->get_queried_object_id(), 'category', array('fields' => 'tt_ids')); + if ( (!$category || is_wp_error($category)) || ( !is_wp_error($post_terms) && !empty($post_terms) && !in_array($category->term_taxonomy_id, $post_terms) ) ) + $redirect_url = get_permalink($wp_query->get_queried_object_id()); } - // paging and feeds + // paging and feeds if ( get_query_var('paged') || is_feed() || get_query_var('cpage') ) { if ( !$redirect_url ) $redirect_url = $requested_url; $paged_redirect = @parse_url($redirect_url); - while ( preg_match( '#/page/[0-9]+?(/+)?$#', $paged_redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|rdf|atom|rss2)(/+)?$#', $paged_redirect['path'] ) || preg_match( '#/comment-page-[0-9]+(/+)?$#', $paged_redirect['path'] ) ) { + while ( preg_match( '#/page/?[0-9]+?(/+)?$#', $paged_redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|rdf|atom|rss2)(/+)?$#', $paged_redirect['path'] ) || preg_match( '#/comment-page-[0-9]+(/+)?$#', $paged_redirect['path'] ) ) { // Strip off paging and feed - $paged_redirect['path'] = preg_replace('#/page/[0-9]+?(/+)?$#', '/', $paged_redirect['path']); // strip off any existing paging + $paged_redirect['path'] = preg_replace('#/page/?[0-9]+?(/+)?$#', '/', $paged_redirect['path']); // strip off any existing paging $paged_redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $paged_redirect['path']); // strip off feed endings $paged_redirect['path'] = preg_replace('#/comment-page-[0-9]+?(/+)?$#', '/', $paged_redirect['path']); // strip off any existing comment paging } @@ -151,7 +203,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { $addl_path = !empty( $addl_path ) ? trailingslashit($addl_path) : ''; if ( get_query_var( 'withcomments' ) ) $addl_path .= 'comments/'; - $addl_path .= user_trailingslashit( 'feed/' . ( ( 'rss2' == get_query_var('feed') || 'feed' == get_query_var('feed') ) ? '' : get_query_var('feed') ), 'feed' ); + $addl_path .= user_trailingslashit( 'feed/' . ( ( get_default_feed() == get_query_var('feed') || 'feed' == get_query_var('feed') ) ? '' : get_query_var('feed') ), 'feed' ); $redirect['query'] = remove_query_arg( 'feed', $redirect['query'] ); } @@ -162,7 +214,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { if ( $paged > 1 && !is_single() ) { $addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit("page/$paged", 'paged'); } elseif ( !is_single() ) { - $addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit($paged_redirect['path'], 'paged'); + $addl_path = !empty( $addl_path ) ? trailingslashit($addl_path) : ''; } } elseif ( $paged > 1 ) { $redirect['query'] = add_query_arg( 'paged', $paged, $redirect['query'] ); @@ -198,7 +250,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { $redirect = @parse_url($redirect_url); // www.example.com vs example.com - $user_home = @parse_url(get_option('home')); + $user_home = @parse_url(home_url()); if ( !empty($user_home['host']) ) $redirect['host'] = $user_home['host']; if ( empty($user_home['path']) ) @@ -250,6 +302,10 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { $redirect['path'] = trailingslashit($redirect['path']); } + // Strip multiple slashes out of the URL + if ( strpos($redirect['path'], '//') > -1 ) + $redirect['path'] = preg_replace('|/+|', '/', $redirect['path']); + // Always trailing slash the Front Page URL if ( trailingslashit( $redirect['path'] ) == trailingslashit( $user_home['path'] ) ) $redirect['path'] = trailingslashit($redirect['path']); @@ -285,7 +341,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { $redirect_url .= '?' . $redirect['query']; } - if ( $redirect_url == $requested_url ) + if ( !$redirect_url || $redirect_url == $requested_url ) return false; // Note that you can use the "redirect_canonical" filter to cancel a canonical redirect for whatever reason by returning FALSE @@ -326,7 +382,9 @@ function redirect_guess_404_permalink() { $where = $wpdb->prepare("post_name LIKE %s", get_query_var('name') . '%'); - // if any of year, monthnum, or day are set, use them to refine the query + // if any of post_type, year, monthnum, or day are set, use them to refine the query + if ( get_query_var('post_type') ) + $where .= $wpdb->prepare(" AND post_type = %s", get_query_var('post_type')); if ( get_query_var('year') ) $where .= $wpdb->prepare(" AND YEAR(post_date) = %d", get_query_var('year')); if ( get_query_var('monthnum') ) diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 4a5ccec0..6ab08e37 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -85,7 +85,7 @@ class WP_Roles { } /** - * Setup the object properties. + * Set up the object properties. * * The role key is set to the current prefix for the $wpdb object with * 'user_roles' appended. If the $wp_user_roles global is set, then it will @@ -97,8 +97,7 @@ class WP_Roles { * @global array $wp_user_roles Used to set the 'roles' property value. */ function _init () { - global $wpdb; - global $wp_user_roles; + global $wpdb, $wp_user_roles; $this->role_key = $wpdb->prefix . 'user_roles'; if ( ! empty( $wp_user_roles ) ) { $this->roles = $wp_user_roles; @@ -125,7 +124,7 @@ class WP_Roles { * * The capabilities are defined in the following format `array( 'read' => true );` * To explicitly deny a role a capability you set the value for that capability to false. - * + * * @since 2.0.0 * @access public * @@ -270,10 +269,10 @@ class WP_Role { var $capabilities; /** - * PHP4 Constructor - Setup object properties. + * PHP4 Constructor - Set up object properties. * * The list of capabilities, must have the key as the name of the capability - * and the value a boolean of whether it is granted to the role or not. + * and the value a boolean of whether it is granted to the role. * * @since 2.0.0 * @access public @@ -501,7 +500,7 @@ class WP_User { } /** - * Setup capability object properties. + * Set up capability object properties. * * Will set the value for the 'cap_key' property to current database table * prefix, followed by 'capabilities'. Will then check to see if the @@ -509,11 +508,16 @@ class WP_User { * used. * * @since 2.1.0 + * + * @param string $cap_key Optional capability key * @access protected */ - function _init_caps() { + function _init_caps( $cap_key = '' ) { global $wpdb; - $this->cap_key = $wpdb->prefix . 'capabilities'; + if ( empty($cap_key) ) + $this->cap_key = $wpdb->prefix . 'capabilities'; + else + $this->cap_key = $cap_key; $this->caps = &$this->{$this->cap_key}; if ( ! is_array( $this->caps ) ) $this->caps = array(); @@ -545,8 +549,8 @@ class WP_User { //Build $allcaps from role caps, overlay user's $caps $this->allcaps = array(); foreach ( (array) $this->roles as $role ) { - $role =& $wp_roles->get_role( $role ); - $this->allcaps = array_merge( (array) $this->allcaps, (array) $role->capabilities ); + $the_role =& $wp_roles->get_role( $role ); + $this->allcaps = array_merge( (array) $this->allcaps, (array) $the_role->capabilities ); } $this->allcaps = array_merge( (array) $this->allcaps, (array) $this->caps ); } @@ -563,7 +567,7 @@ class WP_User { */ function add_role( $role ) { $this->caps[$role] = true; - update_usermeta( $this->ID, $this->cap_key, $this->caps ); + update_user_meta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); $this->update_user_level_from_caps(); } @@ -577,11 +581,12 @@ class WP_User { * @param string $role Role name. */ function remove_role( $role ) { - if ( empty( $this->roles[$role] ) || ( count( $this->roles ) <= 1 ) ) + if ( !in_array($role, $this->roles) ) return; unset( $this->caps[$role] ); - update_usermeta( $this->ID, $this->cap_key, $this->caps ); + update_user_meta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); + $this->update_user_level_from_caps(); } /** @@ -605,7 +610,7 @@ class WP_User { } else { $this->roles = false; } - update_usermeta( $this->ID, $this->cap_key, $this->caps ); + update_user_meta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); $this->update_user_level_from_caps(); do_action( 'set_user_role', $this->ID, $role ); @@ -652,7 +657,7 @@ class WP_User { function update_user_level_from_caps() { global $wpdb; $this->user_level = array_reduce( array_keys( $this->allcaps ), array( &$this, 'level_reduction' ), 0 ); - update_usermeta( $this->ID, $wpdb->prefix.'user_level', $this->user_level ); + update_user_meta( $this->ID, $wpdb->prefix . 'user_level', $this->user_level ); } /** @@ -666,7 +671,7 @@ class WP_User { */ function add_cap( $cap, $grant = true ) { $this->caps[$cap] = $grant; - update_usermeta( $this->ID, $this->cap_key, $this->caps ); + update_user_meta( $this->ID, $this->cap_key, $this->caps ); } /** @@ -678,9 +683,10 @@ class WP_User { * @param string $cap Capability name. */ function remove_cap( $cap ) { - if ( empty( $this->caps[$cap] ) ) return; + if ( empty( $this->caps[$cap] ) ) + return; unset( $this->caps[$cap] ); - update_usermeta( $this->ID, $this->cap_key, $this->caps ); + update_user_meta( $this->ID, $this->cap_key, $this->caps ); } /** @@ -692,8 +698,8 @@ class WP_User { function remove_all_caps() { global $wpdb; $this->caps = array(); - update_usermeta( $this->ID, $this->cap_key, '' ); - update_usermeta( $this->ID, $wpdb->prefix.'user_level', '' ); + delete_user_meta( $this->ID, $this->cap_key ); + delete_user_meta( $this->ID, $wpdb->prefix . 'user_level' ); $this->get_role_caps(); } @@ -712,12 +718,22 @@ class WP_User { * @return bool True, if user has capability; false, if user does not have capability. */ function has_cap( $cap ) { - if ( is_numeric( $cap ) ) + if ( is_numeric( $cap ) ) { + _deprecated_argument( __FUNCTION__, '2.0', __('Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.') ); $cap = $this->translate_level_to_cap( $cap ); + } $args = array_slice( func_get_args(), 1 ); $args = array_merge( array( $cap, $this->ID ), $args ); $caps = call_user_func_array( 'map_meta_cap', $args ); + + // Multisite super admin has all caps by definition, Unless specifically denied. + if ( is_multisite() && is_super_admin() ) { + if ( in_array('do_not_allow', $caps) ) + return false; + return true; + } + // Must have ALL requested caps $capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args ); foreach ( (array) $caps as $cap ) { @@ -744,6 +760,21 @@ class WP_User { return 'level_' . $level; } + /** + * Set the blog to operate on. Defaults to the current blog. + * + * @since 3.0.0 + * + * @param int $blog_id Optional Blog ID, defaults to current blog. + */ + function for_blog( $blog_id = '' ) { + global $wpdb; + if ( ! empty( $blog_id ) ) + $cap_key = $wpdb->get_blog_prefix( $blog_id ) . 'capabilities'; + else + $cap_key = ''; + $this->_init_caps( $cap_key ); + } } /** @@ -751,8 +782,8 @@ class WP_User { * * This does not actually compare whether the user ID has the actual capability, * just what the capability or capabilities are. Meta capability list value can - * be 'delete_user', 'edit_user', 'delete_post', 'delete_page', 'edit_post', - * 'edit_page', 'read_post', or 'read_page'. + * be 'delete_user', 'edit_user', 'remove_user', 'promote_user', 'delete_post', + * 'delete_page', 'edit_post', 'edit_page', 'read_post', or 'read_page'. * * @since 2.0.0 * @@ -765,24 +796,38 @@ function map_meta_cap( $cap, $user_id ) { $caps = array(); switch ( $cap ) { + case 'remove_user': + $caps[] = 'remove_users'; + break; case 'delete_user': $caps[] = 'delete_users'; break; + case 'promote_user': + $caps[] = 'promote_users'; + break; case 'edit_user': - if ( !isset( $args[0] ) || $user_id != $args[0] ) { - $caps[] = 'edit_users'; - } + // Allow user to edit itself + if ( isset( $args[0] ) && $user_id == $args[0] ) + break; + // Fall through + case 'edit_users': + // If multisite these caps are allowed only for super admins. + if ( is_multisite() && !is_super_admin() ) + $caps[] = 'do_not_allow'; + else + $caps[] = 'edit_users'; // Explicit due to primitive fall through break; case 'delete_post': $author_data = get_userdata( $user_id ); //echo "post ID: {$args[0]}
    "; $post = get_post( $args[0] ); - if ( 'page' == $post->post_type ) { - $args = array_merge( array( 'delete_page', $user_id ), $args ); + $post_type = get_post_type_object( $post->post_type ); + if ( $post_type && 'post' != $post_type->capability_type ) { + $args = array_merge( array( $post_type->cap->delete_post, $user_id ), $args ); return call_user_func_array( 'map_meta_cap', $args ); } - if ('' != $post->post_author) { + if ( '' != $post->post_author ) { $post_author_data = get_userdata( $post->post_author ); } else { //No author set yet so default to current user for cap checks @@ -790,7 +835,7 @@ function map_meta_cap( $cap, $user_id ) { } // If the user is the author... - if ( $user_id == $post_author_data->ID ) { + if ( is_object( $post_author_data ) && $user_id == $post_author_data->ID ) { // If the post is published... if ( 'publish' == $post->post_status ) { $caps[] = 'delete_published_posts'; @@ -826,7 +871,7 @@ function map_meta_cap( $cap, $user_id ) { $page_author_data = $author_data; } - if ( $user_id == $page_author_data->ID ) { + if ( is_object( $page_author_data ) && $user_id == $page_author_data->ID ) { // If the page is published... if ( $page->post_status == 'publish' ) { $caps[] = 'delete_published_pages'; @@ -853,14 +898,15 @@ function map_meta_cap( $cap, $user_id ) { $author_data = get_userdata( $user_id ); //echo "post ID: {$args[0]}
    "; $post = get_post( $args[0] ); - if ( 'page' == $post->post_type ) { - $args = array_merge( array( 'edit_page', $user_id ), $args ); + $post_type = get_post_type_object( $post->post_type ); + if ( $post_type && 'post' != $post_type->capability_type ) { + $args = array_merge( array( $post_type->cap->edit_post, $user_id ), $args ); return call_user_func_array( 'map_meta_cap', $args ); } $post_author_data = get_userdata( $post->post_author ); //echo "current user id : $user_id, post author id: " . $post_author_data->ID . "
    "; // If the user is the author... - if ( $user_id == $post_author_data->ID ) { + if ( is_object( $post_author_data ) && $user_id == $post_author_data->ID ) { // If the post is published... if ( 'publish' == $post->post_status ) { $caps[] = 'edit_published_posts'; @@ -888,7 +934,7 @@ function map_meta_cap( $cap, $user_id ) { $page_author_data = get_userdata( $page->post_author ); //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "
    "; // If the user is the author... - if ( $user_id == $page_author_data->ID ) { + if ( is_object( $page_author_data ) && $user_id == $page_author_data->ID ) { // If the page is published... if ( 'publish' == $page->post_status ) { $caps[] = 'edit_published_pages'; @@ -911,8 +957,9 @@ function map_meta_cap( $cap, $user_id ) { break; case 'read_post': $post = get_post( $args[0] ); - if ( 'page' == $post->post_type ) { - $args = array_merge( array( 'read_page', $user_id ), $args ); + $post_type = get_post_type_object( $post->post_type ); + if ( $post_type && 'post' != $post_type->capability_type ) { + $args = array_merge( array( $post_type->cap->read_post, $user_id ), $args ); return call_user_func_array( 'map_meta_cap', $args ); } @@ -923,7 +970,7 @@ function map_meta_cap( $cap, $user_id ) { $author_data = get_userdata( $user_id ); $post_author_data = get_userdata( $post->post_author ); - if ( $user_id == $post_author_data->ID ) + if ( is_object( $post_author_data ) && $user_id == $post_author_data->ID ) $caps[] = 'read'; else $caps[] = 'read_private_posts'; @@ -938,17 +985,60 @@ function map_meta_cap( $cap, $user_id ) { $author_data = get_userdata( $user_id ); $page_author_data = get_userdata( $page->post_author ); - if ( $user_id == $page_author_data->ID ) + if ( is_object( $page_author_data ) && $user_id == $page_author_data->ID ) $caps[] = 'read'; else $caps[] = 'read_private_pages'; break; case 'unfiltered_upload': - if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS == true ) + if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS && ( !is_multisite() || is_super_admin() ) ) $caps[] = $cap; else $caps[] = 'do_not_allow'; break; + case 'edit_files': + case 'edit_plugins': + case 'edit_themes': + if ( defined('DISALLOW_FILE_EDIT') && DISALLOW_FILE_EDIT ) { + $caps[] = 'do_not_allow'; + break; + } + // Fall through if not DISALLOW_FILE_EDIT. + case 'update_plugins': + case 'delete_plugins': + case 'install_plugins': + case 'update_themes': + case 'delete_themes': + case 'install_themes': + case 'update_core': + // Disallow anything that creates, deletes, or edits core, plugin, or theme files. + // Files in uploads are excepted. + if ( defined('DISALLOW_FILE_MODS') && DISALLOW_FILE_MODS ) { + $caps[] = 'do_not_allow'; + break; + } + // Fall through if not DISALLOW_FILE_MODS. + case 'unfiltered_html': + // Disallow unfiltered_html for all users, even admins and super admins. + if ( defined('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML ) { + $caps[] = 'do_not_allow'; + break; + } + // Fall through if not DISALLOW_UNFILTERED_HTML + case 'delete_user': + case 'delete_users': + // If multisite these caps are allowed only for super admins. + if ( is_multisite() && !is_super_admin() ) + $caps[] = 'do_not_allow'; + else + $caps[] = $cap; + break; + case 'create_users': + if ( is_multisite() && !get_site_option( 'add_new_users' ) ) + $caps[] = 'do_not_allow'; + else + $caps[] = $cap; + break; default: // If no meta caps match, return the original cap. $caps[] = $cap; @@ -977,6 +1067,36 @@ function current_user_can( $capability ) { return call_user_func_array( array( &$current_user, 'has_cap' ), $args ); } +/** + * Whether current user has a capability or role for a given blog. + * + * @since 3.0.0 + * + * @param int $blog_id Blog ID + * @param string $capability Capability or role name. + * @return bool + */ +function current_user_can_for_blog( $blog_id, $capability ) { + $current_user = wp_get_current_user(); + + if ( is_multisite() && is_super_admin() ) + return true; + + if ( empty( $current_user ) ) + return false; + + // Create new object to avoid stomping the global current_user. + $user = new WP_User( $current_user->id) ; + + // Set the blog id. @todo add blog id arg to WP_User constructor? + $user->for_blog( $blog_id ); + + $args = array_slice( func_get_args(), 2 ); + $args = array_merge( array( $capability ), $args ); + + return call_user_func_array( array( &$user, 'has_cap' ), $args ); +} + /** * Whether author of supplied post has capability or role. * @@ -1057,4 +1177,53 @@ function remove_role( $role ) { return $wp_roles->remove_role( $role ); } +/** + * Retrieve a list of super admins. + * + * @since 3.0.0 + * + * @uses $super_admins Super admins global variable, if set. + * + * @return array List of super admin logins + */ +function get_super_admins() { + global $super_admins; + + if ( isset($super_admins) ) + return $super_admins; + else + return get_site_option( 'site_admins', array('admin') ); +} + +/** + * Determine if user is a site admin. + * + * @since 3.0.0 + * + * @param int $user_id (Optional) The ID of a user. Defaults to the current user. + * @return bool True if the user is a site admin. + */ +function is_super_admin( $user_id = false ) { + if ( ! $user_id ) { + $current_user = wp_get_current_user(); + $user_id = ! empty($current_user) ? $current_user->id : 0; + } + + if ( ! $user_id ) + return false; + + $user = new WP_User($user_id); + + if ( is_multisite() ) { + $super_admins = get_super_admins(); + if ( is_array( $super_admins ) && in_array( $user->user_login, $super_admins ) ) + return true; + } else { + if ( $user->has_cap('delete_users') ) + return true; + } + + return false; +} + ?> diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 7e378b44..db55a12c 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -20,8 +20,7 @@ function get_category_link( $category_id ) { $catlink = $wp_rewrite->get_category_permastruct(); if ( empty( $catlink ) ) { - $file = get_option( 'home' ) . '/'; - $catlink = $file . '?cat=' . $category_id; + $catlink = home_url('?cat=' . $category_id); } else { $category = &get_category( $category_id ); if ( is_wp_error( $category ) ) @@ -34,7 +33,7 @@ function get_category_link( $category_id ) { $category_nicename = get_category_parents( $category->parent, false, '/', true ) . $category_nicename; $catlink = str_replace( '%category%', $category_nicename, $catlink ); - $catlink = get_option( 'home' ) . user_trailingslashit( $catlink, 'category' ); + $catlink = home_url( user_trailingslashit( $catlink, 'category' ) ); } return apply_filters( 'category_link', $catlink, $category_id ); } @@ -176,6 +175,9 @@ function get_the_category_by_ID( $cat_ID ) { function get_the_category_list( $separator = '', $parents='', $post_id = false ) { global $wp_rewrite; $categories = get_the_category( $post_id ); + if ( !is_object_in_taxonomy( get_post_type( $post_id ), 'category' ) ) + return apply_filters( 'the_category', '', $separator, $parents ); + if ( empty( $categories ) ) return apply_filters( 'the_category', __( 'Uncategorized' ), $separator, $parents ); @@ -208,7 +210,7 @@ function get_the_category_list( $separator = '', $parents='', $post_id = false ) $i = 0; foreach ( $categories as $category ) { if ( 0 < $i ) - $thelist .= $separator . ' '; + $thelist .= $separator; switch ( strtolower( $parents ) ) { case 'multiple': if ( $category->parent ) @@ -315,9 +317,11 @@ function category_description( $category = 0 ) { * 'echo' (bool|int) default is 1 - Whether to display or retrieve content. * 'depth' (int) - The max depth. * 'tab_index' (int) - Tab index for select element. - * 'name' (string) - The name attribute value for selected element. - * 'class' (string) - The class attribute value for selected element. + * 'name' (string) - The name attribute value for select element. + * 'id' (string) - The ID attribute value for select element. Defaults to name if omitted. + * 'class' (string) - The class attribute value for select element. * 'selected' (int) - Which category ID is selected. + * 'taxonomy' (string) - The name of the taxonomy to retrieve. Defaults to category. * * The 'hierarchical' argument, which is disabled by default, will override the * depth argument, unless it is true. When the argument is false, it will @@ -337,12 +341,20 @@ function wp_dropdown_categories( $args = '' ) { 'hide_empty' => 1, 'child_of' => 0, 'exclude' => '', 'echo' => 1, 'selected' => 0, 'hierarchical' => 0, - 'name' => 'cat', 'class' => 'postform', - 'depth' => 0, 'tab_index' => 0 + 'name' => 'cat', 'id' => '', + 'class' => 'postform', 'depth' => 0, + 'tab_index' => 0, 'taxonomy' => 'category', + 'hide_if_empty' => false ); $defaults['selected'] = ( is_category() ) ? get_query_var( 'cat' ) : 0; + // Back compat. + if ( isset( $args['type'] ) && 'link' == $args['type'] ) { + _deprecated_argument( __FUNCTION__, '3.0', '' ); + $args['taxonomy'] = 'link_category'; + } + $r = wp_parse_args( $args, $defaults ); if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) { @@ -356,13 +368,22 @@ function wp_dropdown_categories( $args = '' ) { if ( (int) $tab_index > 0 ) $tab_index_attribute = " tabindex=\"$tab_index\""; - $categories = get_categories( $r ); - $name = esc_attr($name); - $class = esc_attr($class); + $categories = get_terms( $taxonomy, $r ); + $name = esc_attr( $name ); + $class = esc_attr( $class ); + $id = $id ? esc_attr( $id ) : $name; + + if ( ! $r['hide_if_empty'] || ! empty($categories) ) + $output = "\n"; if ( $show_option_all ) { $show_option_all = apply_filters( 'list_cats', $show_option_all ); @@ -382,8 +403,10 @@ function wp_dropdown_categories( $args = '' ) { $depth = -1; // Flat. $output .= walk_category_dropdown_tree( $categories, $depth, $r ); - $output .= "\n"; } + if ( ! $r['hide_if_empty'] || ! empty($categories) ) + $output .= "\n"; + $output = apply_filters( 'wp_dropdown_cats', $output ); @@ -428,44 +451,53 @@ function wp_dropdown_categories( $args = '' ) { */ function wp_list_categories( $args = '' ) { $defaults = array( - 'show_option_all' => '', 'orderby' => 'name', - 'order' => 'ASC', 'show_last_update' => 0, - 'style' => 'list', 'show_count' => 0, - 'hide_empty' => 1, 'use_desc_for_title' => 1, - 'child_of' => 0, 'feed' => '', 'feed_type' => '', - 'feed_image' => '', 'exclude' => '', 'exclude_tree' => '', 'current_category' => 0, + 'show_option_all' => '', 'show_option_none' => __('No categories'), + 'orderby' => 'name', 'order' => 'ASC', + 'show_last_update' => 0, 'style' => 'list', + 'show_count' => 0, 'hide_empty' => 1, + 'use_desc_for_title' => 1, 'child_of' => 0, + 'feed' => '', 'feed_type' => '', + 'feed_image' => '', 'exclude' => '', + 'exclude_tree' => '', 'current_category' => 0, 'hierarchical' => true, 'title_li' => __( 'Categories' ), - 'echo' => 1, 'depth' => 0 + 'echo' => 1, 'depth' => 0, + 'taxonomy' => 'category' ); $r = wp_parse_args( $args, $defaults ); - if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) { + if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) $r['pad_counts'] = true; - } - if ( isset( $r['show_date'] ) ) { + if ( isset( $r['show_date'] ) ) $r['include_last_update_time'] = $r['show_date']; - } if ( true == $r['hierarchical'] ) { $r['exclude_tree'] = $r['exclude']; $r['exclude'] = ''; } + if ( !isset( $r['class'] ) ) + $r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy']; + extract( $r ); + if ( !taxonomy_exists($taxonomy) ) + return false; + $categories = get_categories( $r ); $output = ''; if ( $title_li && 'list' == $style ) - $output = '
  • ' . $r['title_li'] . '
      '; + $output = '
    • ' . $title_li . '
        '; if ( empty( $categories ) ) { - if ( 'list' == $style ) - $output .= '
      • ' . __( "No categories" ) . '
      • '; - else - $output .= __( "No categories" ); + if ( ! empty( $show_option_none ) ) { + if ( 'list' == $style ) + $output .= '
      • ' . $show_option_none . '
      • '; + else + $output .= $show_option_none; + } } else { global $wp_query; @@ -475,7 +507,7 @@ function wp_list_categories( $args = '' ) { else $output .= '' . $show_option_all . ''; - if ( empty( $r['current_category'] ) && is_category() ) + if ( empty( $r['current_category'] ) && ( is_category() || is_tax() ) ) $r['current_category'] = $wp_query->get_queried_object_id(); if ( $hierarchical ) @@ -489,7 +521,7 @@ function wp_list_categories( $args = '' ) { if ( $title_li && 'list' == $style ) $output .= '
    • '; - $output = apply_filters( 'wp_list_categories', $output ); + $output = apply_filters( 'wp_list_categories', $output, $args ); if ( $echo ) echo $output; @@ -848,7 +880,8 @@ function term_description( $term = 0, $taxonomy = 'post_tag' ) { $taxonomy = $term->taxonomy; $term = $term->term_id; } - return get_term_field( 'description', $term, $taxonomy ); + $description = get_term_field( 'description', $term, $taxonomy ); + return is_wp_error( $description ) ? '' : $description; } /** @@ -973,4 +1006,4 @@ function has_tag( $tag = '', $_post = null ) { return $r; } -?> +?> \ No newline at end of file diff --git a/wp-includes/category.php b/wp-includes/category.php index 372c4c70..1f665185 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -15,7 +15,7 @@ */ function get_all_category_ids() { if ( ! $cat_ids = wp_cache_get( 'all_category_ids', 'category' ) ) { - $cat_ids = get_terms( 'category', 'fields=ids&get=all' ); + $cat_ids = get_terms( 'category', array('fields' => 'ids', 'get' => 'all') ); wp_cache_add( 'all_category_ids', $cat_ids, 'category' ); } @@ -37,12 +37,17 @@ function get_all_category_ids() { * @return array List of categories. */ function &get_categories( $args = '' ) { - $defaults = array( 'type' => 'category' ); + $defaults = array( 'taxonomy' => 'category' ); $args = wp_parse_args( $args, $defaults ); - $taxonomy = apply_filters( 'get_categories_taxonomy', 'category', $args ); - if ( 'link' == $args['type'] ) - $taxonomy = 'link_category'; + $taxonomy = apply_filters( 'get_categories_taxonomy', $args['taxonomy'], $args ); + + // Back compat + if ( isset($args['type']) && 'link' == $args['type'] ) { + _deprecated_argument( __FUNCTION__, '3.0', '' ); + $taxonomy = $args['taxonomy'] = 'link_category'; + } + $categories = (array) get_terms( $taxonomy, $args ); foreach ( array_keys( $categories ) as $k ) @@ -98,7 +103,7 @@ function &get_category( $category, $output = OBJECT, $filter = 'raw' ) { * @since 2.1.0 * * @param string $category_path URL containing category slugs. - * @param bool $full_match Optional. Whether should match full path or not. + * @param bool $full_match Optional. Whether full path should be matched. * @param string $output Optional. Constant OBJECT, ARRAY_A, or ARRAY_N * @return null|object|array Null on failure. Type is based on $output value. */ @@ -113,7 +118,7 @@ function get_category_by_path( $category_path, $full_match = true, $output = OBJ foreach ( (array) $category_paths as $pathdir ) $full_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title( $pathdir ); - $categories = get_terms( 'category', "get=all&slug=$leaf_path" ); + $categories = get_terms( 'category', array('get' => 'all', 'slug' => $leaf_path) ); if ( empty( $categories ) ) return null; @@ -178,11 +183,13 @@ function get_cat_ID( $cat_name='General' ) { * @since 1.0.0 * * @param int $cat_id Category ID - * @return string Category name + * @return string Category name, or an empty string if category doesn't exist. */ function get_cat_name( $cat_id ) { $cat_id = (int) $cat_id; $category = &get_category( $cat_id ); + if ( ! $category || is_wp_error( $category ) ) + return ''; return $category->name; } diff --git a/wp-includes/class-IXR.php b/wp-includes/class-IXR.php index f8d61fe8..49f80b0c 100644 --- a/wp-includes/class-IXR.php +++ b/wp-includes/class-IXR.php @@ -356,7 +356,7 @@ EOD; $args = $args[0]; } // Are we dealing with a function or a method? - if (substr($method, 0, 5) == 'this:') { + if ( is_string( $method ) && substr($method, 0, 5) == 'this:' ) { // It's a class method - check it exists $method = substr($method, 5); if (!method_exists($this, $method)) { @@ -581,7 +581,8 @@ class IXR_Client { $gettingHeaders = false; } if (!$gettingHeaders) { - $contents .= trim($line); + // WP#12559 remove trim so as to not strip newlines from received response. + $contents .= $line; } if ($this->debug) { $debug_contents .= $line; diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php new file mode 100644 index 00000000..d913d6db --- /dev/null +++ b/wp-includes/class-http.php @@ -0,0 +1,2002 @@ +http_transport_get_debug - gives working, nonblocking, and blocking transports. + * + * http_transport_post_debug - gives working, nonblocking, and blocking transports. + * + * @package WordPress + * @subpackage HTTP + * @since 2.7.0 + */ +class WP_Http { + + /** + * PHP4 style Constructor - Calls PHP5 Style Constructor + * + * @since 2.7.0 + * @return WP_Http + */ + function WP_Http() { + $this->__construct(); + } + + /** + * PHP5 style Constructor - Set up available transport if not available. + * + * PHP4 does not have the 'self' keyword and since WordPress supports PHP4, the class needs to + * be used for the static call. The transport are set up to save time and will only be created + * once. This class can be created many times without having to go through the step of finding + * which transports are available. + * + * @since 2.7.0 + * @return WP_Http + */ + function __construct() { + WP_Http::_getTransport(); + WP_Http::_postTransport(); + } + + /** + * Tests the WordPress HTTP objects for an object to use and returns it. + * + * Tests all of the objects and returns the object that passes. Also caches that object to be + * used later. + * + * The order for the GET/HEAD requests are HTTP Extension, cURL, Streams, Fopen, and finally + * Fsockopen. fsockopen() is used last, because it has the most overhead in its implementation. + * There isn't any real way around it, since redirects have to be supported, much the same way + * the other transports also handle redirects. + * + * There are currently issues with "localhost" not resolving correctly with DNS. This may cause + * an error "failed to open stream: A connection attempt failed because the connected party did + * not properly respond after a period of time, or established connection failed because [the] + * connected host has failed to respond." + * + * @since 2.7.0 + * @access private + * + * @param array $args Request args, default us an empty array + * @return object|null Null if no transports are available, HTTP transport object. + */ + function &_getTransport( $args = array() ) { + static $working_transport, $blocking_transport, $nonblocking_transport; + + if ( is_null($working_transport) ) { + if ( true === WP_Http_ExtHttp::test($args) ) { + $working_transport['exthttp'] = new WP_Http_ExtHttp(); + $blocking_transport[] = &$working_transport['exthttp']; + } else if ( true === WP_Http_Curl::test($args) ) { + $working_transport['curl'] = new WP_Http_Curl(); + $blocking_transport[] = &$working_transport['curl']; + } else if ( true === WP_Http_Streams::test($args) ) { + $working_transport['streams'] = new WP_Http_Streams(); + $blocking_transport[] = &$working_transport['streams']; + } else if ( true === WP_Http_Fopen::test($args) ) { + $working_transport['fopen'] = new WP_Http_Fopen(); + $blocking_transport[] = &$working_transport['fopen']; + } else if ( true === WP_Http_Fsockopen::test($args) ) { + $working_transport['fsockopen'] = new WP_Http_Fsockopen(); + $blocking_transport[] = &$working_transport['fsockopen']; + } + + foreach ( array('curl', 'streams', 'fopen', 'fsockopen', 'exthttp') as $transport ) { + if ( isset($working_transport[$transport]) ) + $nonblocking_transport[] = &$working_transport[$transport]; + } + } + + do_action( 'http_transport_get_debug', $working_transport, $blocking_transport, $nonblocking_transport ); + + if ( isset($args['blocking']) && !$args['blocking'] ) + return $nonblocking_transport; + else + return $blocking_transport; + } + + /** + * Tests the WordPress HTTP objects for an object to use and returns it. + * + * Tests all of the objects and returns the object that passes. Also caches + * that object to be used later. This is for posting content to a URL and + * is used when there is a body. The plain Fopen Transport can not be used + * to send content, but the streams transport can. This is a limitation that + * is addressed here, by just not including that transport. + * + * @since 2.7.0 + * @access private + * + * @param array $args Request args, default us an empty array + * @return object|null Null if no transports are available, HTTP transport object. + */ + function &_postTransport( $args = array() ) { + static $working_transport, $blocking_transport, $nonblocking_transport; + + if ( is_null($working_transport) ) { + if ( true === WP_Http_ExtHttp::test($args) ) { + $working_transport['exthttp'] = new WP_Http_ExtHttp(); + $blocking_transport[] = &$working_transport['exthttp']; + } else if ( true === WP_Http_Curl::test($args) ) { + $working_transport['curl'] = new WP_Http_Curl(); + $blocking_transport[] = &$working_transport['curl']; + } else if ( true === WP_Http_Streams::test($args) ) { + $working_transport['streams'] = new WP_Http_Streams(); + $blocking_transport[] = &$working_transport['streams']; + } else if ( true === WP_Http_Fsockopen::test($args) ) { + $working_transport['fsockopen'] = new WP_Http_Fsockopen(); + $blocking_transport[] = &$working_transport['fsockopen']; + } + + foreach ( array('curl', 'streams', 'fsockopen', 'exthttp') as $transport ) { + if ( isset($working_transport[$transport]) ) + $nonblocking_transport[] = &$working_transport[$transport]; + } + } + + do_action( 'http_transport_post_debug', $working_transport, $blocking_transport, $nonblocking_transport ); + + if ( isset($args['blocking']) && !$args['blocking'] ) + return $nonblocking_transport; + else + return $blocking_transport; + } + + /** + * Send a HTTP request to a URI. + * + * The body and headers are part of the arguments. The 'body' argument is for the body and will + * accept either a string or an array. The 'headers' argument should be an array, but a string + * is acceptable. If the 'body' argument is an array, then it will automatically be escaped + * using http_build_query(). + * + * The only URI that are supported in the HTTP Transport implementation are the HTTP and HTTPS + * protocols. HTTP and HTTPS are assumed so the server might not know how to handle the send + * headers. Other protocols are unsupported and most likely will fail. + * + * The defaults are 'method', 'timeout', 'redirection', 'httpversion', 'blocking' and + * 'user-agent'. + * + * Accepted 'method' values are 'GET', 'POST', and 'HEAD', some transports technically allow + * others, but should not be assumed. The 'timeout' is used to sent how long the connection + * should stay open before failing when no response. 'redirection' is used to track how many + * redirects were taken and used to sent the amount for other transports, but not all transports + * accept setting that value. + * + * The 'httpversion' option is used to sent the HTTP version and accepted values are '1.0', and + * '1.1' and should be a string. Version 1.1 is not supported, because of chunk response. The + * 'user-agent' option is the user-agent and is used to replace the default user-agent, which is + * 'WordPress/WP_Version', where WP_Version is the value from $wp_version. + * + * 'blocking' is the default, which is used to tell the transport, whether it should halt PHP + * while it performs the request or continue regardless. Actually, that isn't entirely correct. + * Blocking mode really just means whether the fread should just pull what it can whenever it + * gets bytes or if it should wait until it has enough in the buffer to read or finishes reading + * the entire content. It doesn't actually always mean that PHP will continue going after making + * the request. + * + * @access public + * @since 2.7.0 + * @todo Refactor this code. The code in this method extends the scope of its original purpose + * and should be refactored to allow for cleaner abstraction and reduce duplication of the + * code. One suggestion is to create a class specifically for the arguments, however + * preliminary refactoring to this affect has affect more than just the scope of the + * arguments. Something to ponder at least. + * + * @param string $url URI resource. + * @param str|array $args Optional. Override the defaults. + * @return array containing 'headers', 'body', 'response', 'cookies' + */ + function request( $url, $args = array() ) { + global $wp_version; + + $defaults = array( + 'method' => 'GET', + 'timeout' => apply_filters( 'http_request_timeout', 5), + 'redirection' => apply_filters( 'http_request_redirection_count', 5), + 'httpversion' => apply_filters( 'http_request_version', '1.0'), + 'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ), + 'blocking' => true, + 'headers' => array(), + 'cookies' => array(), + 'body' => null, + 'compress' => false, + 'decompress' => true, + 'sslverify' => true + ); + + $r = wp_parse_args( $args, $defaults ); + $r = apply_filters( 'http_request_args', $r, $url ); + + // Allow plugins to short-circuit the request + $pre = apply_filters( 'pre_http_request', false, $r, $url ); + if ( false !== $pre ) + return $pre; + + $arrURL = parse_url($url); + + if ( empty( $url ) || empty($url['scheme'] ) ) + return new WP_Error('http_request_failed', __('A valid URL was not provided.')); + + if ( $this->block_request( $url ) ) + return new WP_Error('http_request_failed', __('User has blocked requests through HTTP.')); + + // Determine if this is a https call and pass that on to the transport functions + // so that we can blacklist the transports that do not support ssl verification + $r['ssl'] = $arrURL['scheme'] == 'https' || $arrURL['scheme'] == 'ssl'; + + // Determine if this request is to OUR install of WordPress + $homeURL = parse_url( get_bloginfo('url') ); + $r['local'] = $homeURL['host'] == $arrURL['host'] || 'localhost' == $arrURL['host']; + unset($homeURL); + + if ( is_null( $r['headers'] ) ) + $r['headers'] = array(); + + if ( ! is_array($r['headers']) ) { + $processedHeaders = WP_Http::processHeaders($r['headers']); + $r['headers'] = $processedHeaders['headers']; + } + + if ( isset($r['headers']['User-Agent']) ) { + $r['user-agent'] = $r['headers']['User-Agent']; + unset($r['headers']['User-Agent']); + } + + if ( isset($r['headers']['user-agent']) ) { + $r['user-agent'] = $r['headers']['user-agent']; + unset($r['headers']['user-agent']); + } + + // Construct Cookie: header if any cookies are set + WP_Http::buildCookieHeader( $r ); + + if ( WP_Http_Encoding::is_available() ) + $r['headers']['Accept-Encoding'] = WP_Http_Encoding::accept_encoding(); + + if ( empty($r['body']) ) { + // Some servers fail when sending content without the content-length header being set. + // Also, to fix another bug, we only send when doing POST and PUT and the content-length + // header isn't already set. + if( ($r['method'] == 'POST' || $r['method'] == 'PUT') && ! isset($r['headers']['Content-Length']) ) + $r['headers']['Content-Length'] = 0; + + // The method is ambiguous, because we aren't talking about HTTP methods, the "get" in + // this case is simply that we aren't sending any bodies and to get the transports that + // don't support sending bodies along with those which do. + $transports = WP_Http::_getTransport($r); + } else { + if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) { + if ( ! version_compare(phpversion(), '5.1.2', '>=') ) + $r['body'] = _http_build_query($r['body'], null, '&'); + else + $r['body'] = http_build_query($r['body'], null, '&'); + $r['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=' . get_option('blog_charset'); + $r['headers']['Content-Length'] = strlen($r['body']); + } + + if ( ! isset( $r['headers']['Content-Length'] ) && ! isset( $r['headers']['content-length'] ) ) + $r['headers']['Content-Length'] = strlen($r['body']); + + // The method is ambiguous, because we aren't talking about HTTP methods, the "post" in + // this case is simply that we are sending HTTP body and to get the transports that do + // support sending the body. Not all do, depending on the limitations of the PHP core + // limitations. + $transports = WP_Http::_postTransport($r); + } + + do_action( 'http_api_debug', $transports, 'transports_list' ); + + $response = array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); + foreach ( (array) $transports as $transport ) { + $response = $transport->request($url, $r); + + do_action( 'http_api_debug', $response, 'response', get_class($transport) ); + + if ( ! is_wp_error($response) ) + return apply_filters( 'http_response', $response, $r, $url ); + } + + return $response; + } + + /** + * Uses the POST HTTP method. + * + * Used for sending data that is expected to be in the body. + * + * @access public + * @since 2.7.0 + * + * @param string $url URI resource. + * @param str|array $args Optional. Override the defaults. + * @return boolean + */ + function post($url, $args = array()) { + $defaults = array('method' => 'POST'); + $r = wp_parse_args( $args, $defaults ); + return $this->request($url, $r); + } + + /** + * Uses the GET HTTP method. + * + * Used for sending data that is expected to be in the body. + * + * @access public + * @since 2.7.0 + * + * @param string $url URI resource. + * @param str|array $args Optional. Override the defaults. + * @return boolean + */ + function get($url, $args = array()) { + $defaults = array('method' => 'GET'); + $r = wp_parse_args( $args, $defaults ); + return $this->request($url, $r); + } + + /** + * Uses the HEAD HTTP method. + * + * Used for sending data that is expected to be in the body. + * + * @access public + * @since 2.7.0 + * + * @param string $url URI resource. + * @param str|array $args Optional. Override the defaults. + * @return boolean + */ + function head($url, $args = array()) { + $defaults = array('method' => 'HEAD'); + $r = wp_parse_args( $args, $defaults ); + return $this->request($url, $r); + } + + /** + * Parses the responses and splits the parts into headers and body. + * + * @access public + * @static + * @since 2.7.0 + * + * @param string $strResponse The full response string + * @return array Array with 'headers' and 'body' keys. + */ + function processResponse($strResponse) { + $res = explode("\r\n\r\n", $strResponse, 2); + + return array('headers' => isset($res[0]) ? $res[0] : array(), 'body' => isset($res[1]) ? $res[1] : ''); + } + + /** + * Transform header string into an array. + * + * If an array is given then it is assumed to be raw header data with numeric keys with the + * headers as the values. No headers must be passed that were already processed. + * + * @access public + * @static + * @since 2.7.0 + * + * @param string|array $headers + * @return array Processed string headers. If duplicate headers are encountered, + * Then a numbered array is returned as the value of that header-key. + */ + function processHeaders($headers) { + // split headers, one per array element + if ( is_string($headers) ) { + // tolerate line terminator: CRLF = LF (RFC 2616 19.3) + $headers = str_replace("\r\n", "\n", $headers); + // unfold folded header fields. LWS = [CRLF] 1*( SP | HT ) , (RFC 2616 2.2) + $headers = preg_replace('/\n[ \t]/', ' ', $headers); + // create the headers array + $headers = explode("\n", $headers); + } + + $response = array('code' => 0, 'message' => ''); + + // If a redirection has taken place, The headers for each page request may have been passed. + // In this case, determine the final HTTP header and parse from there. + for ( $i = count($headers)-1; $i >= 0; $i-- ) { + if ( !empty($headers[$i]) && false === strpos($headers[$i], ':') ) { + $headers = array_splice($headers, $i); + break; + } + } + + $cookies = array(); + $newheaders = array(); + foreach ( $headers as $tempheader ) { + if ( empty($tempheader) ) + continue; + + if ( false === strpos($tempheader, ':') ) { + list( , $response['code'], $response['message']) = explode(' ', $tempheader, 3); + continue; + } + + list($key, $value) = explode(':', $tempheader, 2); + + if ( !empty( $value ) ) { + $key = strtolower( $key ); + if ( isset( $newheaders[$key] ) ) { + if ( !is_array($newheaders[$key]) ) + $newheaders[$key] = array($newheaders[$key]); + $newheaders[$key][] = trim( $value ); + } else { + $newheaders[$key] = trim( $value ); + } + if ( 'set-cookie' == strtolower( $key ) ) + $cookies[] = new WP_Http_Cookie( $value ); + } + } + + return array('response' => $response, 'headers' => $newheaders, 'cookies' => $cookies); + } + + /** + * Takes the arguments for a ::request() and checks for the cookie array. + * + * If it's found, then it's assumed to contain WP_Http_Cookie objects, which are each parsed + * into strings and added to the Cookie: header (within the arguments array). Edits the array by + * reference. + * + * @access public + * @version 2.8.0 + * @static + * + * @param array $r Full array of args passed into ::request() + */ + function buildCookieHeader( &$r ) { + if ( ! empty($r['cookies']) ) { + $cookies_header = ''; + foreach ( (array) $r['cookies'] as $cookie ) { + $cookies_header .= $cookie->getHeaderValue() . '; '; + } + $cookies_header = substr( $cookies_header, 0, -2 ); + $r['headers']['cookie'] = $cookies_header; + } + } + + /** + * Decodes chunk transfer-encoding, based off the HTTP 1.1 specification. + * + * Based off the HTTP http_encoding_dechunk function. Does not support UTF-8. Does not support + * returning footer headers. Shouldn't be too difficult to support it though. + * + * @todo Add support for footer chunked headers. + * @access public + * @since 2.7.0 + * @static + * + * @param string $body Body content + * @return string Chunked decoded body on success or raw body on failure. + */ + function chunkTransferDecode($body) { + $body = str_replace(array("\r\n", "\r"), "\n", $body); + // The body is not chunked encoding or is malformed. + if ( ! preg_match( '/^[0-9a-f]+(\s|\n)+/mi', trim($body) ) ) + return $body; + + $parsedBody = ''; + //$parsedHeaders = array(); Unsupported + + while ( true ) { + $hasChunk = (bool) preg_match( '/^([0-9a-f]+)(\s|\n)+/mi', $body, $match ); + + if ( $hasChunk ) { + if ( empty( $match[1] ) ) + return $body; + + $length = hexdec( $match[1] ); + $chunkLength = strlen( $match[0] ); + + $strBody = substr($body, $chunkLength, $length); + $parsedBody .= $strBody; + + $body = ltrim(str_replace(array($match[0], $strBody), '', $body), "\n"); + + if ( "0" == trim($body) ) + return $parsedBody; // Ignore footer headers. + } else { + return $body; + } + } + } + + /** + * Block requests through the proxy. + * + * Those who are behind a proxy and want to prevent access to certain hosts may do so. This will + * prevent plugins from working and core functionality, if you don't include api.wordpress.org. + * + * You block external URL requests by defining WP_HTTP_BLOCK_EXTERNAL as true in your wp-config.php + * file and this will only allow localhost and your blog to make requests. The constant + * WP_ACCESSIBLE_HOSTS will allow additional hosts to go through for requests. The format of the + * WP_ACCESSIBLE_HOSTS constant is a comma separated list of hostnames to allow. + * + * @since 2.8.0 + * @link http://core.trac.wordpress.org/ticket/8927 Allow preventing external requests. + * + * @param string $uri URI of url. + * @return bool True to block, false to allow. + */ + function block_request($uri) { + // We don't need to block requests, because nothing is blocked. + if ( ! defined( 'WP_HTTP_BLOCK_EXTERNAL' ) || ! WP_HTTP_BLOCK_EXTERNAL ) + return false; + + // parse_url() only handles http, https type URLs, and will emit E_WARNING on failure. + // This will be displayed on blogs, which is not reasonable. + $check = @parse_url($uri); + + /* Malformed URL, can not process, but this could mean ssl, so let through anyway. + * + * This isn't very security sound. There are instances where a hacker might attempt + * to bypass the proxy and this check. However, the reason for this behavior is that + * WordPress does not do any checking currently for non-proxy requests, so it is keeps with + * the default unsecure nature of the HTTP request. + */ + if ( $check === false ) + return false; + + $home = parse_url( get_option('siteurl') ); + + // Don't block requests back to ourselves by default + if ( $check['host'] == 'localhost' || $check['host'] == $home['host'] ) + return apply_filters('block_local_requests', false); + + if ( !defined('WP_ACCESSIBLE_HOSTS') ) + return true; + + static $accessible_hosts; + if ( null == $accessible_hosts ) + $accessible_hosts = preg_split('|,\s*|', WP_ACCESSIBLE_HOSTS); + + return !in_array( $check['host'], $accessible_hosts ); //Inverse logic, If its in the array, then we can't access it. + } +} + +/** + * HTTP request method uses fsockopen function to retrieve the url. + * + * This would be the preferred method, but the fsockopen implementation has the most overhead of all + * the HTTP transport implementations. + * + * @package WordPress + * @subpackage HTTP + * @since 2.7.0 + */ +class WP_Http_Fsockopen { + /** + * Send a HTTP request to a URI using fsockopen(). + * + * Does not support non-blocking mode. + * + * @see WP_Http::request For default options descriptions. + * + * @since 2.7 + * @access public + * @param string $url URI resource. + * @param str|array $args Optional. Override the defaults. + * @return array 'headers', 'body', 'cookies' and 'response' keys. + */ + function request($url, $args = array()) { + $defaults = array( + 'method' => 'GET', 'timeout' => 5, + 'redirection' => 5, 'httpversion' => '1.0', + 'blocking' => true, + 'headers' => array(), 'body' => null, 'cookies' => array() + ); + + $r = wp_parse_args( $args, $defaults ); + + if ( isset($r['headers']['User-Agent']) ) { + $r['user-agent'] = $r['headers']['User-Agent']; + unset($r['headers']['User-Agent']); + } else if( isset($r['headers']['user-agent']) ) { + $r['user-agent'] = $r['headers']['user-agent']; + unset($r['headers']['user-agent']); + } + + // Construct Cookie: header if any cookies are set + WP_Http::buildCookieHeader( $r ); + + $iError = null; // Store error number + $strError = null; // Store error string + + $arrURL = parse_url($url); + + $fsockopen_host = $arrURL['host']; + + $secure_transport = false; + + if ( ! isset( $arrURL['port'] ) ) { + if ( ( $arrURL['scheme'] == 'ssl' || $arrURL['scheme'] == 'https' ) && extension_loaded('openssl') ) { + $fsockopen_host = "ssl://$fsockopen_host"; + $arrURL['port'] = 443; + $secure_transport = true; + } else { + $arrURL['port'] = 80; + } + } + + //fsockopen has issues with 'localhost' with IPv6 with certain versions of PHP, It attempts to connect to ::1, + // which fails when the server is not set up for it. For compatibility, always connect to the IPv4 address. + if ( 'localhost' == strtolower($fsockopen_host) ) + $fsockopen_host = '127.0.0.1'; + + // There are issues with the HTTPS and SSL protocols that cause errors that can be safely + // ignored and should be ignored. + if ( true === $secure_transport ) + $error_reporting = error_reporting(0); + + $startDelay = time(); + + $proxy = new WP_HTTP_Proxy(); + + if ( !WP_DEBUG ) { + if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) + $handle = @fsockopen( $proxy->host(), $proxy->port(), $iError, $strError, $r['timeout'] ); + else + $handle = @fsockopen( $fsockopen_host, $arrURL['port'], $iError, $strError, $r['timeout'] ); + } else { + if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) + $handle = fsockopen( $proxy->host(), $proxy->port(), $iError, $strError, $r['timeout'] ); + else + $handle = fsockopen( $fsockopen_host, $arrURL['port'], $iError, $strError, $r['timeout'] ); + } + + $endDelay = time(); + + // If the delay is greater than the timeout then fsockopen should't be used, because it will + // cause a long delay. + $elapseDelay = ($endDelay-$startDelay) > $r['timeout']; + if ( true === $elapseDelay ) + add_option( 'disable_fsockopen', $endDelay, null, true ); + + if ( false === $handle ) + return new WP_Error('http_request_failed', $iError . ': ' . $strError); + + $timeout = (int) floor( $r['timeout'] ); + $utimeout = $timeout == $r['timeout'] ? 0 : 1000000 * $r['timeout'] % 1000000; + stream_set_timeout( $handle, $timeout, $utimeout ); + + if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) //Some proxies require full URL in this field. + $requestPath = $url; + else + $requestPath = $arrURL['path'] . ( isset($arrURL['query']) ? '?' . $arrURL['query'] : '' ); + + if ( empty($requestPath) ) + $requestPath .= '/'; + + $strHeaders = strtoupper($r['method']) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n"; + + if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) + $strHeaders .= 'Host: ' . $arrURL['host'] . ':' . $arrURL['port'] . "\r\n"; + else + $strHeaders .= 'Host: ' . $arrURL['host'] . "\r\n"; + + if ( isset($r['user-agent']) ) + $strHeaders .= 'User-agent: ' . $r['user-agent'] . "\r\n"; + + if ( is_array($r['headers']) ) { + foreach ( (array) $r['headers'] as $header => $headerValue ) + $strHeaders .= $header . ': ' . $headerValue . "\r\n"; + } else { + $strHeaders .= $r['headers']; + } + + if ( $proxy->use_authentication() ) + $strHeaders .= $proxy->authentication_header() . "\r\n"; + + $strHeaders .= "\r\n"; + + if ( ! is_null($r['body']) ) + $strHeaders .= $r['body']; + + fwrite($handle, $strHeaders); + + if ( ! $r['blocking'] ) { + fclose($handle); + return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); + } + + $strResponse = ''; + while ( ! feof($handle) ) + $strResponse .= fread($handle, 4096); + + fclose($handle); + + if ( true === $secure_transport ) + error_reporting($error_reporting); + + $process = WP_Http::processResponse($strResponse); + $arrHeaders = WP_Http::processHeaders($process['headers']); + + // Is the response code within the 400 range? + if ( (int) $arrHeaders['response']['code'] >= 400 && (int) $arrHeaders['response']['code'] < 500 ) + return new WP_Error('http_request_failed', $arrHeaders['response']['code'] . ': ' . $arrHeaders['response']['message']); + + // If location is found, then assume redirect and redirect to location. + if ( 'HEAD' != $r['method'] && isset($arrHeaders['headers']['location']) ) { + if ( $r['redirection']-- > 0 ) { + return $this->request($arrHeaders['headers']['location'], $r); + } else { + return new WP_Error('http_request_failed', __('Too many redirects.')); + } + } + + // If the body was chunk encoded, then decode it. + if ( ! empty( $process['body'] ) && isset( $arrHeaders['headers']['transfer-encoding'] ) && 'chunked' == $arrHeaders['headers']['transfer-encoding'] ) + $process['body'] = WP_Http::chunkTransferDecode($process['body']); + + if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($arrHeaders['headers']) ) + $process['body'] = WP_Http_Encoding::decompress( $process['body'] ); + + return array('headers' => $arrHeaders['headers'], 'body' => $process['body'], 'response' => $arrHeaders['response'], 'cookies' => $arrHeaders['cookies']); + } + + /** + * Whether this class can be used for retrieving an URL. + * + * @since 2.7.0 + * @static + * @return boolean False means this class can not be used, true means it can. + */ + function test( $args = array() ) { + if ( false !== ($option = get_option( 'disable_fsockopen' )) && time()-$option < 43200 ) // 12 hours + return false; + + $is_ssl = isset($args['ssl']) && $args['ssl']; + + if ( ! $is_ssl && function_exists( 'fsockopen' ) ) + $use = true; + elseif ( $is_ssl && extension_loaded('openssl') && function_exists( 'fsockopen' ) ) + $use = true; + else + $use = false; + + return apply_filters('use_fsockopen_transport', $use, $args); + } +} + +/** + * HTTP request method uses fopen function to retrieve the url. + * + * Requires PHP version greater than 4.3.0 for stream support. Does not allow for $context support, + * but should still be okay, to write the headers, before getting the response. Also requires that + * 'allow_url_fopen' to be enabled. + * + * @package WordPress + * @subpackage HTTP + * @since 2.7.0 + */ +class WP_Http_Fopen { + /** + * Send a HTTP request to a URI using fopen(). + * + * This transport does not support sending of headers and body, therefore should not be used in + * the instances, where there is a body and headers. + * + * Notes: Does not support non-blocking mode. Ignores 'redirection' option. + * + * @see WP_Http::retrieve For default options descriptions. + * + * @access public + * @since 2.7.0 + * + * @param string $url URI resource. + * @param str|array $args Optional. Override the defaults. + * @return array 'headers', 'body', 'cookies' and 'response' keys. + */ + function request($url, $args = array()) { + $defaults = array( + 'method' => 'GET', 'timeout' => 5, + 'redirection' => 5, 'httpversion' => '1.0', + 'blocking' => true, + 'headers' => array(), 'body' => null, 'cookies' => array() + ); + + $r = wp_parse_args( $args, $defaults ); + + $arrURL = parse_url($url); + + if ( false === $arrURL ) + return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url)); + + if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] ) + $url = str_replace($arrURL['scheme'], 'http', $url); + + if ( is_null( $r['headers'] ) ) + $r['headers'] = array(); + + if ( is_string($r['headers']) ) { + $processedHeaders = WP_Http::processHeaders($r['headers']); + $r['headers'] = $processedHeaders['headers']; + } + + $initial_user_agent = ini_get('user_agent'); + + if ( !empty($r['headers']) && is_array($r['headers']) ) { + $user_agent_extra_headers = ''; + foreach ( $r['headers'] as $header => $value ) + $user_agent_extra_headers .= "\r\n$header: $value"; + @ini_set('user_agent', $r['user-agent'] . $user_agent_extra_headers); + } else { + @ini_set('user_agent', $r['user-agent']); + } + + if ( !WP_DEBUG ) + $handle = @fopen($url, 'r'); + else + $handle = fopen($url, 'r'); + + if (! $handle) + return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url)); + + $timeout = (int) floor( $r['timeout'] ); + $utimeout = $timeout == $r['timeout'] ? 0 : 1000000 * $r['timeout'] % 1000000; + stream_set_timeout( $handle, $timeout, $utimeout ); + + if ( ! $r['blocking'] ) { + fclose($handle); + @ini_set('user_agent', $initial_user_agent); //Clean up any extra headers added + return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); + } + + $strResponse = ''; + while ( ! feof($handle) ) + $strResponse .= fread($handle, 4096); + + if ( function_exists('stream_get_meta_data') ) { + $meta = stream_get_meta_data($handle); + + $theHeaders = $meta['wrapper_data']; + if ( isset( $meta['wrapper_data']['headers'] ) ) + $theHeaders = $meta['wrapper_data']['headers']; + } else { + //$http_response_header is a PHP reserved variable which is set in the current-scope when using the HTTP Wrapper + //see http://php.oregonstate.edu/manual/en/reserved.variables.httpresponseheader.php + $theHeaders = $http_response_header; + } + + fclose($handle); + + @ini_set('user_agent', $initial_user_agent); //Clean up any extra headers added + + $processedHeaders = WP_Http::processHeaders($theHeaders); + + if ( ! empty( $strResponse ) && isset( $processedHeaders['headers']['transfer-encoding'] ) && 'chunked' == $processedHeaders['headers']['transfer-encoding'] ) + $strResponse = WP_Http::chunkTransferDecode($strResponse); + + if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($processedHeaders['headers']) ) + $strResponse = WP_Http_Encoding::decompress( $strResponse ); + + return array('headers' => $processedHeaders['headers'], 'body' => $strResponse, 'response' => $processedHeaders['response'], 'cookies' => $processedHeaders['cookies']); + } + + /** + * Whether this class can be used for retrieving an URL. + * + * @since 2.7.0 + * @static + * @return boolean False means this class can not be used, true means it can. + */ + function test($args = array()) { + if ( ! function_exists('fopen') || (function_exists('ini_get') && true != ini_get('allow_url_fopen')) ) + return false; + + if ( isset($args['method']) && 'HEAD' == $args['method'] ) //This transport cannot make a HEAD request + return false; + + $use = true; + //PHP does not verify SSL certs, We can only make a request via this transports if SSL Verification is turned off. + $is_ssl = isset($args['ssl']) && $args['ssl']; + if ( $is_ssl ) { + $is_local = isset($args['local']) && $args['local']; + $ssl_verify = isset($args['sslverify']) && $args['sslverify']; + if ( $is_local && true != apply_filters('https_local_ssl_verify', true) ) + $use = true; + elseif ( !$is_local && true != apply_filters('https_ssl_verify', true) ) + $use = true; + elseif ( !$ssl_verify ) + $use = true; + else + $use = false; + } + + return apply_filters('use_fopen_transport', $use, $args); + } +} + +/** + * HTTP request method uses Streams to retrieve the url. + * + * Requires PHP 5.0+ and uses fopen with stream context. Requires that 'allow_url_fopen' PHP setting + * to be enabled. + * + * Second preferred method for getting the URL, for PHP 5. + * + * @package WordPress + * @subpackage HTTP + * @since 2.7.0 + */ +class WP_Http_Streams { + /** + * Send a HTTP request to a URI using streams with fopen(). + * + * @access public + * @since 2.7.0 + * + * @param string $url + * @param str|array $args Optional. Override the defaults. + * @return array 'headers', 'body', 'cookies' and 'response' keys. + */ + function request($url, $args = array()) { + $defaults = array( + 'method' => 'GET', 'timeout' => 5, + 'redirection' => 5, 'httpversion' => '1.0', + 'blocking' => true, + 'headers' => array(), 'body' => null, 'cookies' => array() + ); + + $r = wp_parse_args( $args, $defaults ); + + if ( isset($r['headers']['User-Agent']) ) { + $r['user-agent'] = $r['headers']['User-Agent']; + unset($r['headers']['User-Agent']); + } else if( isset($r['headers']['user-agent']) ) { + $r['user-agent'] = $r['headers']['user-agent']; + unset($r['headers']['user-agent']); + } + + // Construct Cookie: header if any cookies are set + WP_Http::buildCookieHeader( $r ); + + $arrURL = parse_url($url); + + if ( false === $arrURL ) + return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url)); + + if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] ) + $url = preg_replace('|^' . preg_quote($arrURL['scheme'], '|') . '|', 'http', $url); + + // Convert Header array to string. + $strHeaders = ''; + if ( is_array( $r['headers'] ) ) + foreach ( $r['headers'] as $name => $value ) + $strHeaders .= "{$name}: $value\r\n"; + else if ( is_string( $r['headers'] ) ) + $strHeaders = $r['headers']; + + $is_local = isset($args['local']) && $args['local']; + $ssl_verify = isset($args['sslverify']) && $args['sslverify']; + if ( $is_local ) + $ssl_verify = apply_filters('https_local_ssl_verify', $ssl_verify); + elseif ( ! $is_local ) + $ssl_verify = apply_filters('https_ssl_verify', $ssl_verify); + + $arrContext = array('http' => + array( + 'method' => strtoupper($r['method']), + 'user_agent' => $r['user-agent'], + 'max_redirects' => $r['redirection'] + 1, // See #11557 + 'protocol_version' => (float) $r['httpversion'], + 'header' => $strHeaders, + 'ignore_errors' => true, // Return non-200 requests. + 'timeout' => $r['timeout'], + 'ssl' => array( + 'verify_peer' => $ssl_verify, + 'verify_host' => $ssl_verify + ) + ) + ); + + $proxy = new WP_HTTP_Proxy(); + + if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { + $arrContext['http']['proxy'] = 'tcp://' . $proxy->host() . ':' . $proxy->port(); + $arrContext['http']['request_fulluri'] = true; + + // We only support Basic authentication so this will only work if that is what your proxy supports. + if ( $proxy->use_authentication() ) + $arrContext['http']['header'] .= $proxy->authentication_header() . "\r\n"; + } + + if ( 'HEAD' == $r['method'] ) // Disable redirects for HEAD requests + $arrContext['http']['max_redirects'] = 1; + + if ( ! empty($r['body'] ) ) + $arrContext['http']['content'] = $r['body']; + + $context = stream_context_create($arrContext); + + if ( !WP_DEBUG ) + $handle = @fopen($url, 'r', false, $context); + else + $handle = fopen($url, 'r', false, $context); + + if ( ! $handle ) + return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url)); + + $timeout = (int) floor( $r['timeout'] ); + $utimeout = $timeout == $r['timeout'] ? 0 : 1000000 * $r['timeout'] % 1000000; + stream_set_timeout( $handle, $timeout, $utimeout ); + + if ( ! $r['blocking'] ) { + stream_set_blocking($handle, 0); + fclose($handle); + return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); + } + + $strResponse = stream_get_contents($handle); + $meta = stream_get_meta_data($handle); + + fclose($handle); + + $processedHeaders = array(); + if ( isset( $meta['wrapper_data']['headers'] ) ) + $processedHeaders = WP_Http::processHeaders($meta['wrapper_data']['headers']); + else + $processedHeaders = WP_Http::processHeaders($meta['wrapper_data']); + + if ( ! empty( $strResponse ) && isset( $processedHeaders['headers']['transfer-encoding'] ) && 'chunked' == $processedHeaders['headers']['transfer-encoding'] ) + $strResponse = WP_Http::chunkTransferDecode($strResponse); + + if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($processedHeaders['headers']) ) + $strResponse = WP_Http_Encoding::decompress( $strResponse ); + + return array('headers' => $processedHeaders['headers'], 'body' => $strResponse, 'response' => $processedHeaders['response'], 'cookies' => $processedHeaders['cookies']); + } + + /** + * Whether this class can be used for retrieving an URL. + * + * @static + * @access public + * @since 2.7.0 + * + * @return boolean False means this class can not be used, true means it can. + */ + function test($args = array()) { + if ( ! function_exists('fopen') || (function_exists('ini_get') && true != ini_get('allow_url_fopen')) ) + return false; + + if ( version_compare(PHP_VERSION, '5.0', '<') ) + return false; + + //HTTPS via Proxy was added in 5.1.0 + $is_ssl = isset($args['ssl']) && $args['ssl']; + if ( $is_ssl && version_compare(PHP_VERSION, '5.1.0', '<') ) { + $proxy = new WP_HTTP_Proxy(); + /** + * No URL check, as its not currently passed to the ::test() function + * In the case where a Proxy is in use, Just bypass this transport for HTTPS. + */ + if ( $proxy->is_enabled() ) + return false; + } + + return apply_filters('use_streams_transport', true, $args); + } +} + +/** + * HTTP request method uses HTTP extension to retrieve the url. + * + * Requires the HTTP extension to be installed. This would be the preferred transport since it can + * handle a lot of the problems that forces the others to use the HTTP version 1.0. Even if PHP 5.2+ + * is being used, it doesn't mean that the HTTP extension will be enabled. + * + * @package WordPress + * @subpackage HTTP + * @since 2.7.0 + */ +class WP_Http_ExtHTTP { + /** + * Send a HTTP request to a URI using HTTP extension. + * + * Does not support non-blocking. + * + * @access public + * @since 2.7 + * + * @param string $url + * @param str|array $args Optional. Override the defaults. + * @return array 'headers', 'body', 'cookies' and 'response' keys. + */ + function request($url, $args = array()) { + $defaults = array( + 'method' => 'GET', 'timeout' => 5, + 'redirection' => 5, 'httpversion' => '1.0', + 'blocking' => true, + 'headers' => array(), 'body' => null, 'cookies' => array() + ); + + $r = wp_parse_args( $args, $defaults ); + + if ( isset($r['headers']['User-Agent']) ) { + $r['user-agent'] = $r['headers']['User-Agent']; + unset($r['headers']['User-Agent']); + } else if( isset($r['headers']['user-agent']) ) { + $r['user-agent'] = $r['headers']['user-agent']; + unset($r['headers']['user-agent']); + } + + // Construct Cookie: header if any cookies are set + WP_Http::buildCookieHeader( $r ); + + switch ( $r['method'] ) { + case 'POST': + $r['method'] = HTTP_METH_POST; + break; + case 'HEAD': + $r['method'] = HTTP_METH_HEAD; + break; + case 'PUT': + $r['method'] = HTTP_METH_PUT; + break; + case 'GET': + default: + $r['method'] = HTTP_METH_GET; + } + + $arrURL = parse_url($url); + + if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] ) + $url = preg_replace('|^' . preg_quote($arrURL['scheme'], '|') . '|', 'http', $url); + + $is_local = isset($args['local']) && $args['local']; + $ssl_verify = isset($args['sslverify']) && $args['sslverify']; + if ( $is_local ) + $ssl_verify = apply_filters('https_local_ssl_verify', $ssl_verify); + elseif ( ! $is_local ) + $ssl_verify = apply_filters('https_ssl_verify', $ssl_verify); + + $r['timeout'] = (int) ceil( $r['timeout'] ); + + $options = array( + 'timeout' => $r['timeout'], + 'connecttimeout' => $r['timeout'], + 'redirect' => $r['redirection'], + 'useragent' => $r['user-agent'], + 'headers' => $r['headers'], + 'ssl' => array( + 'verifypeer' => $ssl_verify, + 'verifyhost' => $ssl_verify + ) + ); + + if ( HTTP_METH_HEAD == $r['method'] ) + $options['redirect'] = 0; // Assumption: Docs seem to suggest that this means do not follow. Untested. + + // The HTTP extensions offers really easy proxy support. + $proxy = new WP_HTTP_Proxy(); + + if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { + $options['proxyhost'] = $proxy->host(); + $options['proxyport'] = $proxy->port(); + $options['proxytype'] = HTTP_PROXY_HTTP; + + if ( $proxy->use_authentication() ) { + $options['proxyauth'] = $proxy->authentication(); + $options['proxyauthtype'] = HTTP_AUTH_ANY; + } + } + + if ( !WP_DEBUG ) //Emits warning level notices for max redirects and timeouts + $strResponse = @http_request($r['method'], $url, $r['body'], $options, $info); + else + $strResponse = http_request($r['method'], $url, $r['body'], $options, $info); //Emits warning level notices for max redirects and timeouts + + // Error may still be set, Response may return headers or partial document, and error + // contains a reason the request was aborted, eg, timeout expired or max-redirects reached. + if ( false === $strResponse || ! empty($info['error']) ) + return new WP_Error('http_request_failed', $info['response_code'] . ': ' . $info['error']); + + if ( ! $r['blocking'] ) + return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); + + $headers_body = WP_HTTP::processResponse($strResponse); + $theHeaders = $headers_body['headers']; + $theBody = $headers_body['body']; + unset($headers_body); + + $theHeaders = WP_Http::processHeaders($theHeaders); + + if ( ! empty( $theBody ) && isset( $theHeaders['headers']['transfer-encoding'] ) && 'chunked' == $theHeaders['headers']['transfer-encoding'] ) { + if ( !WP_DEBUG ) + $theBody = @http_chunked_decode($theBody); + else + $theBody = http_chunked_decode($theBody); + } + + if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($theHeaders['headers']) ) + $theBody = http_inflate( $theBody ); + + $theResponse = array(); + $theResponse['code'] = $info['response_code']; + $theResponse['message'] = get_status_header_desc($info['response_code']); + + return array('headers' => $theHeaders['headers'], 'body' => $theBody, 'response' => $theResponse, 'cookies' => $theHeaders['cookies']); + } + + /** + * Whether this class can be used for retrieving an URL. + * + * @static + * @since 2.7.0 + * + * @return boolean False means this class can not be used, true means it can. + */ + function test($args = array()) { + return apply_filters('use_http_extension_transport', function_exists('http_request'), $args ); + } +} + +/** + * HTTP request method uses Curl extension to retrieve the url. + * + * Requires the Curl extension to be installed. + * + * @package WordPress + * @subpackage HTTP + * @since 2.7 + */ +class WP_Http_Curl { + + /** + * Send a HTTP request to a URI using cURL extension. + * + * @access public + * @since 2.7.0 + * + * @param string $url + * @param str|array $args Optional. Override the defaults. + * @return array 'headers', 'body', 'cookies' and 'response' keys. + */ + function request($url, $args = array()) { + $defaults = array( + 'method' => 'GET', 'timeout' => 5, + 'redirection' => 5, 'httpversion' => '1.0', + 'blocking' => true, + 'headers' => array(), 'body' => null, 'cookies' => array() + ); + + $r = wp_parse_args( $args, $defaults ); + + if ( isset($r['headers']['User-Agent']) ) { + $r['user-agent'] = $r['headers']['User-Agent']; + unset($r['headers']['User-Agent']); + } else if( isset($r['headers']['user-agent']) ) { + $r['user-agent'] = $r['headers']['user-agent']; + unset($r['headers']['user-agent']); + } + + // Construct Cookie: header if any cookies are set. + WP_Http::buildCookieHeader( $r ); + + $handle = curl_init(); + + // cURL offers really easy proxy support. + $proxy = new WP_HTTP_Proxy(); + + if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { + + $isPHP5 = version_compare(PHP_VERSION, '5.0.0', '>='); + + if ( $isPHP5 ) { + curl_setopt( $handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP ); + curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() ); + curl_setopt( $handle, CURLOPT_PROXYPORT, $proxy->port() ); + } else { + curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() .':'. $proxy->port() ); + } + + if ( $proxy->use_authentication() ) { + if ( $isPHP5 ) + curl_setopt( $handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY ); + + curl_setopt( $handle, CURLOPT_PROXYUSERPWD, $proxy->authentication() ); + } + } + + $is_local = isset($args['local']) && $args['local']; + $ssl_verify = isset($args['sslverify']) && $args['sslverify']; + if ( $is_local ) + $ssl_verify = apply_filters('https_local_ssl_verify', $ssl_verify); + elseif ( ! $is_local ) + $ssl_verify = apply_filters('https_ssl_verify', $ssl_verify); + + + // CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers. Have to use ceil since + // a value of 0 will allow an ulimited timeout. + $timeout = (int) ceil( $r['timeout'] ); + curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout ); + curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout ); + + curl_setopt( $handle, CURLOPT_URL, $url); + curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true ); + curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, $ssl_verify ); + curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify ); + curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] ); + curl_setopt( $handle, CURLOPT_MAXREDIRS, $r['redirection'] ); + + switch ( $r['method'] ) { + case 'HEAD': + curl_setopt( $handle, CURLOPT_NOBODY, true ); + break; + case 'POST': + curl_setopt( $handle, CURLOPT_POST, true ); + curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] ); + break; + case 'PUT': + curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, 'PUT' ); + curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] ); + break; + } + + if ( true === $r['blocking'] ) + curl_setopt( $handle, CURLOPT_HEADER, true ); + else + curl_setopt( $handle, CURLOPT_HEADER, false ); + + // The option doesn't work with safe mode or when open_basedir is set. + // Disable HEAD when making HEAD requests. + if ( !ini_get('safe_mode') && !ini_get('open_basedir') && 'HEAD' != $r['method'] ) + curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, true ); + + if ( !empty( $r['headers'] ) ) { + // cURL expects full header strings in each element + $headers = array(); + foreach ( $r['headers'] as $name => $value ) { + $headers[] = "{$name}: $value"; + } + curl_setopt( $handle, CURLOPT_HTTPHEADER, $headers ); + } + + if ( $r['httpversion'] == '1.0' ) + curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0 ); + else + curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 ); + + // Cookies are not handled by the HTTP API currently. Allow for plugin authors to handle it + // themselves... Although, it is somewhat pointless without some reference. + do_action_ref_array( 'http_api_curl', array(&$handle) ); + + // We don't need to return the body, so don't. Just execute request and return. + if ( ! $r['blocking'] ) { + curl_exec( $handle ); + curl_close( $handle ); + return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); + } + + $theResponse = curl_exec( $handle ); + + if ( !empty($theResponse) ) { + $headerLength = curl_getinfo($handle, CURLINFO_HEADER_SIZE); + $theHeaders = trim( substr($theResponse, 0, $headerLength) ); + if ( strlen($theResponse) > $headerLength ) + $theBody = substr( $theResponse, $headerLength ); + else + $theBody = ''; + if ( false !== strrpos($theHeaders, "\r\n\r\n") ) { + $headerParts = explode("\r\n\r\n", $theHeaders); + $theHeaders = $headerParts[ count($headerParts) -1 ]; + } + $theHeaders = WP_Http::processHeaders($theHeaders); + } else { + if ( $curl_error = curl_error($handle) ) + return new WP_Error('http_request_failed', $curl_error); + if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array(301, 302) ) ) + return new WP_Error('http_request_failed', __('Too many redirects.')); + + $theHeaders = array( 'headers' => array(), 'cookies' => array() ); + $theBody = ''; + } + + $response = array(); + $response['code'] = curl_getinfo( $handle, CURLINFO_HTTP_CODE ); + $response['message'] = get_status_header_desc($response['code']); + + curl_close( $handle ); + + // See #11305 - When running under safe mode, redirection is disabled above. Handle it manually. + if ( !empty($theHeaders['headers']['location']) && (ini_get('safe_mode') || ini_get('open_basedir')) ) { + if ( $r['redirection']-- > 0 ) { + return $this->request($theHeaders['headers']['location'], $r); + } else { + return new WP_Error('http_request_failed', __('Too many redirects.')); + } + } + + if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($theHeaders['headers']) ) + $theBody = WP_Http_Encoding::decompress( $theBody ); + + return array('headers' => $theHeaders['headers'], 'body' => $theBody, 'response' => $response, 'cookies' => $theHeaders['cookies']); + } + + /** + * Whether this class can be used for retrieving an URL. + * + * @static + * @since 2.7.0 + * + * @return boolean False means this class can not be used, true means it can. + */ + function test($args = array()) { + if ( function_exists('curl_init') && function_exists('curl_exec') ) + return apply_filters('use_curl_transport', true, $args); + + return false; + } +} + +/** + * Adds Proxy support to the WordPress HTTP API. + * + * There are caveats to proxy support. It requires that defines be made in the wp-config.php file to + * enable proxy support. There are also a few filters that plugins can hook into for some of the + * constants. + * + * Please note that only BASIC authentication is supported by most transports. + * cURL and the PHP HTTP Extension MAY support more methods (such as NTLM authentication) depending on your environment. + * + * The constants are as follows: + *
        + *
      1. WP_PROXY_HOST - Enable proxy support and host for connecting.
      2. + *
      3. WP_PROXY_PORT - Proxy port for connection. No default, must be defined.
      4. + *
      5. WP_PROXY_USERNAME - Proxy username, if it requires authentication.
      6. + *
      7. WP_PROXY_PASSWORD - Proxy password, if it requires authentication.
      8. + *
      9. WP_PROXY_BYPASS_HOSTS - Will prevent the hosts in this list from going through the proxy. + * You do not need to have localhost and the blog host in this list, because they will not be passed + * through the proxy. The list should be presented in a comma separated list
      10. + *
      + * + * An example can be as seen below. + * + * define('WP_PROXY_HOST', '192.168.84.101'); + * define('WP_PROXY_PORT', '8080'); + * define('WP_PROXY_BYPASS_HOSTS', 'localhost, www.example.com'); + * + * + * @link http://core.trac.wordpress.org/ticket/4011 Proxy support ticket in WordPress. + * @since 2.8 + */ +class WP_HTTP_Proxy { + + /** + * Whether proxy connection should be used. + * + * @since 2.8 + * @use WP_PROXY_HOST + * @use WP_PROXY_PORT + * + * @return bool + */ + function is_enabled() { + return defined('WP_PROXY_HOST') && defined('WP_PROXY_PORT'); + } + + /** + * Whether authentication should be used. + * + * @since 2.8 + * @use WP_PROXY_USERNAME + * @use WP_PROXY_PASSWORD + * + * @return bool + */ + function use_authentication() { + return defined('WP_PROXY_USERNAME') && defined('WP_PROXY_PASSWORD'); + } + + /** + * Retrieve the host for the proxy server. + * + * @since 2.8 + * + * @return string + */ + function host() { + if ( defined('WP_PROXY_HOST') ) + return WP_PROXY_HOST; + + return ''; + } + + /** + * Retrieve the port for the proxy server. + * + * @since 2.8 + * + * @return string + */ + function port() { + if ( defined('WP_PROXY_PORT') ) + return WP_PROXY_PORT; + + return ''; + } + + /** + * Retrieve the username for proxy authentication. + * + * @since 2.8 + * + * @return string + */ + function username() { + if ( defined('WP_PROXY_USERNAME') ) + return WP_PROXY_USERNAME; + + return ''; + } + + /** + * Retrieve the password for proxy authentication. + * + * @since 2.8 + * + * @return string + */ + function password() { + if ( defined('WP_PROXY_PASSWORD') ) + return WP_PROXY_PASSWORD; + + return ''; + } + + /** + * Retrieve authentication string for proxy authentication. + * + * @since 2.8 + * + * @return string + */ + function authentication() { + return $this->username() . ':' . $this->password(); + } + + /** + * Retrieve header string for proxy authentication. + * + * @since 2.8 + * + * @return string + */ + function authentication_header() { + return 'Proxy-Authorization: Basic ' . base64_encode( $this->authentication() ); + } + + /** + * Whether URL should be sent through the proxy server. + * + * We want to keep localhost and the blog URL from being sent through the proxy server, because + * some proxies can not handle this. We also have the constant available for defining other + * hosts that won't be sent through the proxy. + * + * @uses WP_PROXY_BYPASS_HOSTS + * @since unknown + * + * @param string $uri URI to check. + * @return bool True, to send through the proxy and false if, the proxy should not be used. + */ + function send_through_proxy( $uri ) { + // parse_url() only handles http, https type URLs, and will emit E_WARNING on failure. + // This will be displayed on blogs, which is not reasonable. + $check = @parse_url($uri); + + // Malformed URL, can not process, but this could mean ssl, so let through anyway. + if ( $check === false ) + return true; + + $home = parse_url( get_option('siteurl') ); + + if ( $check['host'] == 'localhost' || $check['host'] == $home['host'] ) + return false; + + if ( !defined('WP_PROXY_BYPASS_HOSTS') ) + return true; + + static $bypass_hosts; + if ( null == $bypass_hosts ) + $bypass_hosts = preg_split('|,\s*|', WP_PROXY_BYPASS_HOSTS); + + return !in_array( $check['host'], $bypass_hosts ); + } +} +/** + * Internal representation of a single cookie. + * + * Returned cookies are represented using this class, and when cookies are set, if they are not + * already a WP_Http_Cookie() object, then they are turned into one. + * + * @todo The WordPress convention is to use underscores instead of camelCase for function and method + * names. Need to switch to use underscores instead for the methods. + * + * @package WordPress + * @subpackage HTTP + * @since 2.8.0 + */ +class WP_Http_Cookie { + + /** + * Cookie name. + * + * @since 2.8.0 + * @var string + */ + var $name; + + /** + * Cookie value. + * + * @since 2.8.0 + * @var string + */ + var $value; + + /** + * When the cookie expires. + * + * @since 2.8.0 + * @var string + */ + var $expires; + + /** + * Cookie URL path. + * + * @since 2.8.0 + * @var string + */ + var $path; + + /** + * Cookie Domain. + * + * @since 2.8.0 + * @var string + */ + var $domain; + + /** + * PHP4 style Constructor - Calls PHP5 Style Constructor. + * + * @access public + * @since 2.8.0 + * @param string|array $data Raw cookie data. + */ + function WP_Http_Cookie( $data ) { + $this->__construct( $data ); + } + + /** + * Sets up this cookie object. + * + * The parameter $data should be either an associative array containing the indices names below + * or a header string detailing it. + * + * If it's an array, it should include the following elements: + *
        + *
      1. Name
      2. + *
      3. Value - should NOT be urlencoded already.
      4. + *
      5. Expires - (optional) String or int (UNIX timestamp).
      6. + *
      7. Path (optional)
      8. + *
      9. Domain (optional)
      10. + *
      + * + * @access public + * @since 2.8.0 + * + * @param string|array $data Raw cookie data. + */ + function __construct( $data ) { + if ( is_string( $data ) ) { + // Assume it's a header string direct from a previous request + $pairs = explode( ';', $data ); + + // Special handling for first pair; name=value. Also be careful of "=" in value + $name = trim( substr( $pairs[0], 0, strpos( $pairs[0], '=' ) ) ); + $value = substr( $pairs[0], strpos( $pairs[0], '=' ) + 1 ); + $this->name = $name; + $this->value = urldecode( $value ); + array_shift( $pairs ); //Removes name=value from items. + + // Set everything else as a property + foreach ( $pairs as $pair ) { + $pair = rtrim($pair); + if ( empty($pair) ) //Handles the cookie ending in ; which results in a empty final pair + continue; + + list( $key, $val ) = strpos( $pair, '=' ) ? explode( '=', $pair ) : array( $pair, '' ); + $key = strtolower( trim( $key ) ); + if ( 'expires' == $key ) + $val = strtotime( $val ); + $this->$key = $val; + } + } else { + if ( !isset( $data['name'] ) ) + return false; + + // Set properties based directly on parameters + $this->name = $data['name']; + $this->value = isset( $data['value'] ) ? $data['value'] : ''; + $this->path = isset( $data['path'] ) ? $data['path'] : ''; + $this->domain = isset( $data['domain'] ) ? $data['domain'] : ''; + + if ( isset( $data['expires'] ) ) + $this->expires = is_int( $data['expires'] ) ? $data['expires'] : strtotime( $data['expires'] ); + else + $this->expires = null; + } + } + + /** + * Confirms that it's OK to send this cookie to the URL checked against. + * + * Decision is based on RFC 2109/2965, so look there for details on validity. + * + * @access public + * @since 2.8.0 + * + * @param string $url URL you intend to send this cookie to + * @return boolean TRUE if allowed, FALSE otherwise. + */ + function test( $url ) { + // Expires - if expired then nothing else matters + if ( time() > $this->expires ) + return false; + + // Get details on the URL we're thinking about sending to + $url = parse_url( $url ); + $url['port'] = isset( $url['port'] ) ? $url['port'] : 80; + $url['path'] = isset( $url['path'] ) ? $url['path'] : '/'; + + // Values to use for comparison against the URL + $path = isset( $this->path ) ? $this->path : '/'; + $port = isset( $this->port ) ? $this->port : 80; + $domain = isset( $this->domain ) ? strtolower( $this->domain ) : strtolower( $url['host'] ); + if ( false === stripos( $domain, '.' ) ) + $domain .= '.local'; + + // Host - very basic check that the request URL ends with the domain restriction (minus leading dot) + $domain = substr( $domain, 0, 1 ) == '.' ? substr( $domain, 1 ) : $domain; + if ( substr( $url['host'], -strlen( $domain ) ) != $domain ) + return false; + + // Port - supports "port-lists" in the format: "80,8000,8080" + if ( !in_array( $url['port'], explode( ',', $port) ) ) + return false; + + // Path - request path must start with path restriction + if ( substr( $url['path'], 0, strlen( $path ) ) != $path ) + return false; + + return true; + } + + /** + * Convert cookie name and value back to header string. + * + * @access public + * @since 2.8.0 + * + * @return string Header encoded cookie name and value. + */ + function getHeaderValue() { + if ( empty( $this->name ) || empty( $this->value ) ) + return ''; + + return $this->name . '=' . urlencode( $this->value ); + } + + /** + * Retrieve cookie header for usage in the rest of the WordPress HTTP API. + * + * @access public + * @since 2.8.0 + * + * @return string + */ + function getFullHeader() { + return 'Cookie: ' . $this->getHeaderValue(); + } +} + +/** + * Implementation for deflate and gzip transfer encodings. + * + * Includes RFC 1950, RFC 1951, and RFC 1952. + * + * @since 2.8 + * @package WordPress + * @subpackage HTTP + */ +class WP_Http_Encoding { + + /** + * Compress raw string using the deflate format. + * + * Supports the RFC 1951 standard. + * + * @since 2.8 + * + * @param string $raw String to compress. + * @param int $level Optional, default is 9. Compression level, 9 is highest. + * @param string $supports Optional, not used. When implemented it will choose the right compression based on what the server supports. + * @return string|bool False on failure. + */ + function compress( $raw, $level = 9, $supports = null ) { + return gzdeflate( $raw, $level ); + } + + /** + * Decompression of deflated string. + * + * Will attempt to decompress using the RFC 1950 standard, and if that fails + * then the RFC 1951 standard deflate will be attempted. Finally, the RFC + * 1952 standard gzip decode will be attempted. If all fail, then the + * original compressed string will be returned. + * + * @since 2.8 + * + * @param string $compressed String to decompress. + * @param int $length The optional length of the compressed data. + * @return string|bool False on failure. + */ + function decompress( $compressed, $length = null ) { + + if ( empty($compressed) ) + return $compressed; + + if ( false !== ( $decompressed = @gzinflate( $compressed ) ) ) + return $decompressed; + + if ( false !== ( $decompressed = WP_Http_Encoding::compatible_gzinflate( $compressed ) ) ) + return $decompressed; + + if ( false !== ( $decompressed = @gzuncompress( $compressed ) ) ) + return $decompressed; + + if ( function_exists('gzdecode') ) { + $decompressed = @gzdecode( $compressed ); + + if ( false !== $decompressed ) + return $decompressed; + } + + return $compressed; + } + + /** + * Decompression of deflated string while staying compatible with the majority of servers. + * + * Certain Servers will return deflated data with headers which PHP's gziniflate() + * function cannot handle out of the box. The following function lifted from + * http://au2.php.net/manual/en/function.gzinflate.php#77336 will attempt to deflate + * the various return forms used. + * + * @since 2.8.1 + * @link http://au2.php.net/manual/en/function.gzinflate.php#77336 + * + * @param string $gzData String to decompress. + * @return string|bool False on failure. + */ + function compatible_gzinflate($gzData) { + if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) { + $i = 10; + $flg = ord( substr($gzData, 3, 1) ); + if ( $flg > 0 ) { + if ( $flg & 4 ) { + list($xlen) = unpack('v', substr($gzData, $i, 2) ); + $i = $i + 2 + $xlen; + } + if ( $flg & 8 ) + $i = strpos($gzData, "\0", $i) + 1; + if ( $flg & 16 ) + $i = strpos($gzData, "\0", $i) + 1; + if ( $flg & 2 ) + $i = $i + 2; + } + return gzinflate( substr($gzData, $i, -8) ); + } else { + return false; + } + } + + /** + * What encoding types to accept and their priority values. + * + * @since 2.8 + * + * @return string Types of encoding to accept. + */ + function accept_encoding() { + $type = array(); + if ( function_exists( 'gzinflate' ) ) + $type[] = 'deflate;q=1.0'; + + if ( function_exists( 'gzuncompress' ) ) + $type[] = 'compress;q=0.5'; + + if ( function_exists( 'gzdecode' ) ) + $type[] = 'gzip;q=0.5'; + + return implode(', ', $type); + } + + /** + * What enconding the content used when it was compressed to send in the headers. + * + * @since 2.8 + * + * @return string Content-Encoding string to send in the header. + */ + function content_encoding() { + return 'deflate'; + } + + /** + * Whether the content be decoded based on the headers. + * + * @since 2.8 + * + * @param array|string $headers All of the available headers. + * @return bool + */ + function should_decode($headers) { + if ( is_array( $headers ) ) { + if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) ) + return true; + } else if ( is_string( $headers ) ) { + return ( stripos($headers, 'content-encoding:') !== false ); + } + + return false; + } + + /** + * Whether decompression and compression are supported by the PHP version. + * + * Each function is tested instead of checking for the zlib extension, to + * ensure that the functions all exist in the PHP version and aren't + * disabled. + * + * @since 2.8 + * + * @return bool + */ + function is_available() { + return ( function_exists('gzuncompress') || function_exists('gzdeflate') || function_exists('gzinflate') ); + } +} diff --git a/wp-includes/class-json.php b/wp-includes/class-json.php index 207c1774..7582609a 100644 --- a/wp-includes/class-json.php +++ b/wp-includes/class-json.php @@ -1,4 +1,5 @@ diff --git a/wp-includes/class-oembed.php b/wp-includes/class-oembed.php index 41794e02..a09b3167 100644 --- a/wp-includes/class-oembed.php +++ b/wp-includes/class-oembed.php @@ -37,23 +37,27 @@ class WP_oEmbed { // The WP_Embed class disables discovery for non-unfiltered_html users, so only providers in this array will be used for them. // Add to this list using the wp_oembed_add_provider() function (see it's PHPDoc for details). $this->providers = apply_filters( 'oembed_providers', array( - '#http://(www\.)?youtube.com/watch.*#i' => array( 'http://www.youtube.com/oembed', true ), - 'http://blip.tv/file/*' => array( 'http://blip.tv/oembed/', false ), - '#http://(www\.)?vimeo\.com/.*#i' => array( 'http://www.vimeo.com/api/oembed.{format}', true ), - '#http://(www\.)?dailymotion\.com/.*#i' => array( 'http://www.dailymotion.com/api/oembed', true ), - '#http://(www\.)?flickr\.com/.*#i' => array( 'http://www.flickr.com/services/oembed/', true ), - '#http://(www\.)?hulu\.com/watch/.*#i' => array( 'http://www.hulu.com/api/oembed.{format}', true ), - '#http://(www\.)?viddler\.com/.*#i' => array( 'http://lab.viddler.com/services/oembed/', true ), - 'http://qik.com/*' => array( 'http://qik.com/api/oembed.{format}', false ), - 'http://revision3.com/*' => array( 'http://revision3.com/api/oembed/', false ), - 'http://i*.photobucket.com/albums/*' => array( 'http://photobucket.com/oembed', false ), - 'http://gi*.photobucket.com/groups/*' => array( 'http://photobucket.com/oembed', false ), - '#http://(www\.)?scribd\.com/.*#i' => array( 'http://www.scribd.com/services/oembed', true ), - 'http://wordpress.tv/*' => array( 'http://wordpress.tv/oembed/', false ), + '#http://(www\.)?youtube.com/watch.*#i' => array( 'http://www.youtube.com/oembed', true ), + 'http://youtu.be/*' => array( 'http://www.youtube.com/oembed', false ), + 'http://blip.tv/file/*' => array( 'http://blip.tv/oembed/', false ), + '#http://(www\.)?vimeo\.com/.*#i' => array( 'http://www.vimeo.com/api/oembed.{format}', true ), + '#http://(www\.)?dailymotion\.com/.*#i' => array( 'http://www.dailymotion.com/api/oembed', true ), + '#http://(www\.)?flickr\.com/.*#i' => array( 'http://www.flickr.com/services/oembed/', true ), + '#http://(.+)?smugmug\.com/.*#i' => array( 'http://api.smugmug.com/services/oembed/', true ), + '#http://(www\.)?hulu\.com/watch/.*#i' => array( 'http://www.hulu.com/api/oembed.{format}', true ), + '#http://(www\.)?viddler\.com/.*#i' => array( 'http://lab.viddler.com/services/oembed/', true ), + 'http://qik.com/*' => array( 'http://qik.com/api/oembed.{format}', false ), + 'http://revision3.com/*' => array( 'http://revision3.com/api/oembed/', false ), + 'http://i*.photobucket.com/albums/*' => array( 'http://photobucket.com/oembed', false ), + 'http://gi*.photobucket.com/groups/*' => array( 'http://photobucket.com/oembed', false ), + '#http://(www\.)?scribd\.com/.*#i' => array( 'http://www.scribd.com/services/oembed', true ), + 'http://wordpress.tv/*' => array( 'http://wordpress.tv/oembed/', false ), + '#http://(answers|surveys)\.polldaddy.com/.*#i' => array( 'http://polldaddy.com/oembed/', true ), + '#http://(www\.)?funnyordie\.com/videos/.*#i' => array( 'http://www.funnyordie.com/oembed', true ), ) ); - // Fix Scribd embeds. They contain new lines in the middle of the HTML which breaks wpautop(). - add_filter( 'oembed_dataparse', array(&$this, 'strip_scribd_newlines'), 10, 3 ); + // Fix any embeds that contain new lines in the middle of the HTML which breaks wpautop(). + add_filter( 'oembed_dataparse', array(&$this, '_strip_newlines'), 10, 3 ); } /** @@ -161,36 +165,63 @@ class WP_oEmbed { function fetch( $provider, $url, $args = '' ) { $args = wp_parse_args( $args, wp_embed_defaults() ); - $provider = add_query_arg( 'format', 'json', $provider ); // JSON is easier to deal with than XML - $provider = add_query_arg( 'maxwidth', $args['width'], $provider ); $provider = add_query_arg( 'maxheight', $args['height'], $provider ); $provider = add_query_arg( 'url', urlencode($url), $provider ); - if ( !$result = wp_remote_retrieve_body( wp_remote_get( $provider ) ) ) - return false; - - $result = trim( $result ); - - // JSON? - // Example content: http://vimeo.com/api/oembed.json?url=http%3A%2F%2Fvimeo.com%2F240975 - if ( $data = json_decode($result) ) { - return $data; + foreach( array( 'json', 'xml' ) as $format ) { + $result = $this->_fetch_with_format( $provider, $format ); + if ( is_wp_error( $result ) && 'not-implemented' == $result->get_error_code() ) + continue; + return ( $result && ! is_wp_error( $result ) ) ? $result : false; } + return false; + } - // Must be XML. Only parse it if PHP5 is installed. (PHP4 isn't worth the trouble.) - // Example content: http://vimeo.com/api/oembed.xml?url=http%3A%2F%2Fvimeo.com%2F240975 - elseif ( function_exists('simplexml_load_string') ) { - $errors = libxml_use_internal_errors( 'true' ); + /** + * Fetches result from an oEmbed provider for a specific format and complete provider URL + * + * @since 3.0.0 + * @access private + * @param string $provider_url_with_args URL to the provider with full arguments list (url, maxheight, etc.) + * @param string $format Format to use + * @return bool|object False on failure, otherwise the result in the form of an object. + */ + function _fetch_with_format( $provider_url_with_args, $format ) { + $provider_url_with_args = add_query_arg( 'format', $format, $provider_url_with_args ); + $response = wp_remote_get( $provider_url_with_args ); + if ( 501 == wp_remote_retrieve_response_code( $response ) ) + return new WP_Error( 'not-implemented' ); + if ( ! $body = wp_remote_retrieve_body( $response ) ) + return false; + $parse_method = "_parse_$format"; + return $this->$parse_method( $body ); + } - $data = simplexml_load_string( $result ); + /** + * Parses a json response body. + * + * @since 3.0.0 + * @access private + */ + function _parse_json( $response_body ) { + return ( ( $data = json_decode( trim( $response_body ) ) ) && is_object( $data ) ) ? $data : false; + } + /** + * Parses an XML response body. + * + * @since 3.0.0 + * @access private + */ + function _parse_xml( $response_body ) { + if ( function_exists('simplexml_load_string') ) { + $errors = libxml_use_internal_errors( 'true' ); + $data = simplexml_load_string( $response_body ); libxml_use_internal_errors( $errors ); - - if ( is_object($data) ) + if ( is_object( $data ) ) return $data; } - return false; } @@ -211,7 +242,7 @@ class WP_oEmbed { return false; $title = ( !empty($data->title) ) ? $data->title : ''; - $return = '' . esc_attr($title) . ''; + $return = '' . esc_attr($title) . ''; break; case 'video': @@ -220,7 +251,7 @@ class WP_oEmbed { break; case 'link': - $return = ( !empty($data->title) ) ? '' . esc_html($data->title) . '' : false; + $return = ( !empty($data->title) ) ? '' . esc_html($data->title) . '' : false; break; default; @@ -232,15 +263,16 @@ class WP_oEmbed { } /** - * Strip new lines from the HTML if it's a Scribd embed. + * Strip any new lines from the HTML. * + * @access private * @param string $html Existing HTML. * @param object $data Data object from WP_oEmbed::data2html() * @param string $url The original URL passed to oEmbed. * @return string Possibly modified $html */ - function strip_scribd_newlines( $html, $data, $url ) { - if ( preg_match( '#http://(www\.)?scribd.com/.*#i', $url ) ) + function _strip_newlines( $html, $data, $url ) { + if ( false !== strpos( $html, "\n" ) ) $html = str_replace( array( "\r\n", "\n" ), '', $html ); return $html; diff --git a/wp-includes/class-phpass.php b/wp-includes/class-phpass.php index 93f4536c..6d77a1cc 100644 --- a/wp-includes/class-phpass.php +++ b/wp-includes/class-phpass.php @@ -3,7 +3,7 @@ * Portable PHP password hashing framework. * @package phpass * @since 2.5 - * @version 0.1 + * @version 0.2 / genuine. * @link http://www.openwall.com/phpass/ */ @@ -29,7 +29,7 @@ * Portable PHP password hashing framework. * * @package phpass - * @version 0.1 / genuine + * @version 0.2 / genuine. * @link http://www.openwall.com/phpass/ * @since 2.5 */ @@ -49,14 +49,14 @@ class PasswordHash { $this->portable_hashes = $portable_hashes; - $this->random_state = microtime() . (function_exists('getmypid') ? getmypid() : '') . uniqid(rand(), TRUE); - + $this->random_state = microtime() . uniqid(rand(), TRUE); // removed getmypid() for compability reasons } function get_random_bytes($count) { $output = ''; - if (($fh = @fopen('/dev/urandom', 'rb'))) { + if ( @is_readable('/dev/urandom') && + ($fh = @fopen('/dev/urandom', 'rb'))) { $output = fread($fh, $count); fclose($fh); } diff --git a/wp-includes/class-simplepie.php b/wp-includes/class-simplepie.php index a404081b..98843f03 100644 --- a/wp-includes/class-simplepie.php +++ b/wp-includes/class-simplepie.php @@ -1,4 +1,5 @@ sanitize($duration_parent[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT)); if (sizeof($temp) > 0) { - (int) $seconds = array_pop($temp); + $seconds = (int) array_pop($temp); } if (sizeof($temp) > 0) { - (int) $minutes = array_pop($temp); + $minutes = (int) array_pop($temp); $seconds += $minutes * 60; } if (sizeof($temp) > 0) { - (int) $hours = array_pop($temp); + $hours = (int) array_pop($temp); $seconds += $hours * 3600; } unset($temp); @@ -14997,5 +14998,5 @@ class SimplePie_Sanitize } } } - +endif; ?> diff --git a/wp-includes/class-smtp.php b/wp-includes/class-smtp.php index 250153c1..065e2e93 100644 --- a/wp-includes/class-smtp.php +++ b/wp-includes/class-smtp.php @@ -265,7 +265,7 @@ class SMTP * finializing the mail transaction. $msg_data is the message * that is to be send with the headers. Each header needs to be * on a single line followed by a with the message headers - * and the message body being seperated by and additional . + * and the message body being separated by and additional . * * Implements rfc 821: DATA * diff --git a/wp-includes/class-snoopy.php b/wp-includes/class-snoopy.php index b1b32d2f..da3d824e 100644 --- a/wp-includes/class-snoopy.php +++ b/wp-includes/class-snoopy.php @@ -1,5 +1,11 @@ handle, $this->src, $this->deps, $this->ver, $this->args) = func_get_args(); if ( !is_array($this->deps) ) $this->deps = array(); - if ( !$this->ver ) - $this->ver = false; } function add_data( $name, $data ) { diff --git a/wp-includes/class.wp-scripts.php b/wp-includes/class.wp-scripts.php index 9fa96e9d..45d2e54c 100644 --- a/wp-includes/class.wp-scripts.php +++ b/wp-includes/class.wp-scripts.php @@ -90,9 +90,13 @@ class WP_Scripts extends WP_Dependencies { if ( false === $group && in_array($handle, $this->in_footer, true) ) $this->in_footer = array_diff( $this->in_footer, (array) $handle ); - $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; + if ( null === $this->registered[$handle]->ver ) + $ver = ''; + else + $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; + if ( isset($this->args[$handle]) ) - $ver .= '&' . $this->args[$handle]; + $ver = $ver ? $ver . '&' . $this->args[$handle] : $this->args[$handle]; $src = $this->registered[$handle]->src; @@ -114,7 +118,8 @@ class WP_Scripts extends WP_Dependencies { $src = $this->base_url . $src; } - $src = add_query_arg('ver', $ver, $src); + if ( !empty($ver) ) + $src = add_query_arg('ver', $ver, $src); $src = esc_url(apply_filters( 'script_loader_src', $src, $handle )); if ( $this->do_concat ) diff --git a/wp-includes/class.wp-styles.php b/wp-includes/class.wp-styles.php index 731ae39c..ecc0bb9e 100644 --- a/wp-includes/class.wp-styles.php +++ b/wp-includes/class.wp-styles.php @@ -35,9 +35,13 @@ class WP_Styles extends WP_Dependencies { if ( !parent::do_item($handle) ) return false; - $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; + if ( null === $this->registered[$handle]->ver ) + $ver = ''; + else + $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; + if ( isset($this->args[$handle]) ) - $ver .= '&' . $this->args[$handle]; + $ver = $ver ? $ver . '&' . $this->args[$handle] : $this->args[$handle]; if ( $this->do_concat ) { if ( $this->in_default_dir($this->registered[$handle]->src) && !isset($this->registered[$handle]->extra['conditional']) && !isset($this->registered[$handle]->extra['alt']) ) { @@ -64,10 +68,12 @@ class WP_Styles extends WP_Dependencies { $tag .= apply_filters( 'style_loader_tag', "\n", $handle ); if ( 'rtl' === $this->text_direction && isset($this->registered[$handle]->extra['rtl']) && $this->registered[$handle]->extra['rtl'] ) { - if ( is_bool( $this->registered[$handle]->extra['rtl'] ) ) - $rtl_href = str_replace( '.css', '-rtl.css', $this->_css_href( $this->registered[$handle]->src , $ver, "$handle-rtl" )); - else + if ( is_bool( $this->registered[$handle]->extra['rtl'] ) ) { + $suffix = isset( $this->registered[$handle]->extra['suffix'] ) ? $this->registered[$handle]->extra['suffix'] : ''; + $rtl_href = str_replace( "{$suffix}.css", "-rtl{$suffix}.css", $this->_css_href( $this->registered[$handle]->src , $ver, "$handle-rtl" )); + } else { $rtl_href = $this->_css_href( $this->registered[$handle]->extra['rtl'], $ver, "$handle-rtl" ); + } $tag .= apply_filters( 'style_loader_tag', "\n", $handle ); } @@ -96,11 +102,12 @@ class WP_Styles extends WP_Dependencies { } function _css_href( $src, $ver, $handle ) { - if ( !preg_match('|^https?://|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) { + if ( !is_bool($src) && !preg_match('|^https?://|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) { $src = $this->base_url . $src; } - $src = add_query_arg('ver', $ver, $src); + if ( !empty($ver) ) + $src = add_query_arg('ver', $ver, $src); $src = apply_filters( 'style_loader_src', $src, $handle ); return esc_url( $src ); } diff --git a/wp-includes/classes.php b/wp-includes/classes.php index d290bbaa..9a136a38 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -26,7 +26,7 @@ class WP { * @access public * @var array */ - var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage'); + var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type'); /** * Private query variables. @@ -133,6 +133,7 @@ class WP { $this->query_vars = array(); $taxonomy_query_vars = array(); + $post_type_query_vars = array(); if ( is_array($extra_query_vars) ) $this->extra_query_vars = & $extra_query_vars; @@ -144,7 +145,7 @@ class WP { // Fetch the rewrite rules. $rewrite = $wp_rewrite->wp_rewrite_rules(); - if (! empty($rewrite)) { + if ( ! empty($rewrite) ) { // If we match a rewrite rule, this will be cleared. $error = '404'; $this->did_permalink = true; @@ -159,7 +160,7 @@ class WP { $req_uri_array = explode('?', $req_uri); $req_uri = $req_uri_array[0]; $self = $_SERVER['PHP_SELF']; - $home_path = parse_url(get_option('home')); + $home_path = parse_url(home_url()); if ( isset($home_path['path']) ) $home_path = $home_path['path']; else @@ -203,12 +204,11 @@ class WP { // If the requesting file is the anchor of the match, prepend it // to the path info. - if ((! empty($req_uri)) && (strpos($match, $req_uri) === 0) && ($req_uri != $request)) { + if ( (! empty($req_uri)) && (strpos($match, $req_uri) === 0) && ($req_uri != $request) ) $request_match = $req_uri . '/' . $request; - } - if (preg_match("#^$match#", $request_match, $matches) || - preg_match("#^$match#", urldecode($request_match), $matches)) { + if ( preg_match("#^$match#", $request_match, $matches) || + preg_match("#^$match#", urldecode($request_match), $matches) ) { // Got a match. $this->matched_rule = $match; @@ -225,10 +225,10 @@ class WP { // If we're processing a 404 request, clear the error var // since we found something. - if (isset($_GET['error'])) + if ( isset($_GET['error']) ) unset($_GET['error']); - if (isset($error)) + if ( isset($error) ) unset($error); break; @@ -236,14 +236,14 @@ class WP { } // If req_uri is empty or if it is a request for ourself, unset error. - if (empty($request) || $req_uri == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false) { - if (isset($_GET['error'])) + if ( empty($request) || $req_uri == $self || strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false ) { + if ( isset($_GET['error']) ) unset($_GET['error']); - if (isset($error)) + if ( isset($error) ) unset($error); - if (isset($perma_query_vars) && strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false) + if ( isset($perma_query_vars) && strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false ) unset($perma_query_vars); $this->did_permalink = false; @@ -256,32 +256,46 @@ class WP { if ( $t->query_var ) $taxonomy_query_vars[$t->query_var] = $taxonomy; - for ($i=0; $ipublic_query_vars); $i += 1) { + foreach ( $GLOBALS['wp_post_types'] as $post_type => $t ) + if ( $t->query_var ) + $post_type_query_vars[$t->query_var] = $post_type; + + for ( $i = 0; $i < count($this->public_query_vars); $i += 1 ) { $wpvar = $this->public_query_vars[$i]; - if (isset($this->extra_query_vars[$wpvar])) + if ( isset($this->extra_query_vars[$wpvar]) ) $this->query_vars[$wpvar] = $this->extra_query_vars[$wpvar]; - elseif (isset($GLOBALS[$wpvar])) + elseif ( isset($GLOBALS[$wpvar]) ) $this->query_vars[$wpvar] = $GLOBALS[$wpvar]; - elseif (!empty($_POST[$wpvar])) + elseif ( !empty($_POST[$wpvar]) ) $this->query_vars[$wpvar] = $_POST[$wpvar]; - elseif (!empty($_GET[$wpvar])) + elseif ( !empty($_GET[$wpvar]) ) $this->query_vars[$wpvar] = $_GET[$wpvar]; - elseif (!empty($perma_query_vars[$wpvar])) + elseif ( !empty($perma_query_vars[$wpvar]) ) $this->query_vars[$wpvar] = $perma_query_vars[$wpvar]; if ( !empty( $this->query_vars[$wpvar] ) ) { $this->query_vars[$wpvar] = (string) $this->query_vars[$wpvar]; - if ( in_array( $wpvar, $taxonomy_query_vars ) ) { + if ( isset( $taxonomy_query_vars[$wpvar] ) ) { $this->query_vars['taxonomy'] = $taxonomy_query_vars[$wpvar]; $this->query_vars['term'] = $this->query_vars[$wpvar]; + } elseif ( isset($post_type_query_vars[$wpvar] ) ) { + $this->query_vars['post_type'] = $post_type_query_vars[$wpvar]; + $this->query_vars['name'] = $this->query_vars[$wpvar]; } } } + // Limit publicly queried post_types to those that are publicly_queryable + if ( isset( $this->query_vars['post_type']) ) { + $queryable_post_types = get_post_types( array('publicly_queryable' => true) ); + if ( ! in_array( $this->query_vars['post_type'], $queryable_post_types ) ) + unset( $this->query_vars['post_type'] ); + } + foreach ( (array) $this->private_query_vars as $var) { - if (isset($this->extra_query_vars[$var])) + if ( isset($this->extra_query_vars[$var]) ) $this->query_vars[$var] = $this->extra_query_vars[$var]; - elseif (isset($GLOBALS[$var]) && '' != $GLOBALS[$var]) + elseif ( isset($GLOBALS[$var]) && '' != $GLOBALS[$var] ) $this->query_vars[$var] = $GLOBALS[$var]; } @@ -395,7 +409,7 @@ class WP { } /** - * Setup the WordPress Globals. + * Set up the WordPress Globals. * * The query_vars property will be extracted to the GLOBALS. So care should * be taken when naming global variables that might interfere with the @@ -426,7 +440,7 @@ class WP { } /** - * Setup the current user. + * Set up the current user. * * @since 2.0.0 */ @@ -435,7 +449,7 @@ class WP { } /** - * Setup the Loop based on the query variables. + * Set up the Loop based on the query variables. * * @uses WP::$query_vars * @since 2.0.0 @@ -447,21 +461,22 @@ class WP { } /** - * Set the Headers for 404, if permalink is not found. + * Set the Headers for 404, if nothing is found for requested URL. + * + * Issue a 404 if a request doesn't match any posts and doesn't match + * any object (e.g. an existing-but-empty category, tag, author) and a 404 was not already + * issued, and if the request was not a search or the homepage. * - * Issue a 404 if a permalink request doesn't match any posts. Don't issue - * a 404 if one was already issued, if the request was a search, or if the - * request was a regular query string request rather than a permalink - * request. Issues a 200, if not 404. + * Otherwise, issue a 200. * * @since 2.0.0 */ function handle_404() { global $wp_query; - if ( (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) ) { + if ( ( 0 == count( $wp_query->posts ) ) && !is_404() && !is_robots() && !is_search() && !is_home() ) { // Don't 404 for these queries if they matched an object. - if ( ( is_tag() || is_category() || is_author() ) && $wp_query->get_queried_object() ) { + if ( ( is_tag() || is_category() || is_tax() || is_author() ) && $wp_query->get_queried_object() && !is_paged() ) { if ( !is_404() ) status_header( 200 ); return; @@ -907,7 +922,7 @@ class Walker { /* * need to display in hierarchical order - * seperate elements into two buckets: top level and children elements + * separate elements into two buckets: top level and children elements * children_elements is two dimensional array, eg. * children_elements[10][] contains all sub-elements whose parent is 10. */ @@ -1021,7 +1036,7 @@ class Walker { } /* - * seperate elements into two buckets: top level and children elements + * separate elements into two buckets: top level and children elements * children_elements is two dimensional array, eg. * children_elements[10][] contains all sub-elements whose parent is 10. */ @@ -1140,7 +1155,7 @@ class Walker_Page extends Walker { */ function start_lvl(&$output, $depth) { $indent = str_repeat("\t", $depth); - $output .= "\n$indent
        \n"; + $output .= "\n$indent'; - $rss->__destruct(); + $rss->__destruct(); unset($rss); } @@ -939,9 +958,9 @@ function wp_widget_rss_process( $widget_rss, $check_feed = true ) { $items = 10; $url = esc_url_raw(strip_tags( $widget_rss['url'] )); $title = trim(strip_tags( $widget_rss['title'] )); - $show_summary = (int) $widget_rss['show_summary']; - $show_author = (int) $widget_rss['show_author']; - $show_date = (int) $widget_rss['show_date']; + $show_summary = isset($widget_rss['show_summary']) ? (int) $widget_rss['show_summary'] : 0; + $show_author = isset($widget_rss['show_author']) ? (int) $widget_rss['show_author'] :0; + $show_date = isset($widget_rss['show_date']) ? (int) $widget_rss['show_date'] : 0; if ( $check_feed ) { $rss = fetch_feed($url); @@ -976,27 +995,123 @@ class WP_Widget_Tag_Cloud extends WP_Widget { function widget( $args, $instance ) { extract($args); - $title = apply_filters('widget_title', empty($instance['title']) ? __('Tags') : $instance['title']); + $current_taxonomy = $this->_get_current_taxonomy($instance); + if ( !empty($instance['title']) ) { + $title = $instance['title']; + } else { + if ( 'post_tag' == $current_taxonomy ) { + $title = __('Tags'); + } else { + $tax = get_taxonomy($current_taxonomy); + $title = $tax->labels->name; + } + } + $title = apply_filters('widget_title', $title, $instance, $this->id_base); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; echo '
        '; - wp_tag_cloud(apply_filters('widget_tag_cloud_args', array())); + wp_tag_cloud( apply_filters('widget_tag_cloud_args', array('taxonomy' => $current_taxonomy) ) ); echo "
        \n"; echo $after_widget; } function update( $new_instance, $old_instance ) { $instance['title'] = strip_tags(stripslashes($new_instance['title'])); + $instance['taxonomy'] = stripslashes($new_instance['taxonomy']); return $instance; } function form( $instance ) { + $current_taxonomy = $this->_get_current_taxonomy($instance); ?>

        - +

        __('Use this widget to add one of your custom menus as a widget.') ); + parent::WP_Widget( 'nav_menu', __('Custom Menu'), $widget_ops ); + } + + function widget($args, $instance) { + // Get menu + $nav_menu = wp_get_nav_menu_object( $instance['nav_menu'] ); + + if ( !$nav_menu ) + return; + + echo $args['before_widget']; + + if ( !empty($instance['title']) ) + echo $args['before_title'] . $instance['title'] . $args['after_title']; + + wp_nav_menu( array( 'fallback_cb' => '', 'menu' => $nav_menu ) ); + + echo $args['after_widget']; + } + + function update( $new_instance, $old_instance ) { + $instance['title'] = strip_tags( stripslashes($new_instance['title']) ); + $instance['nav_menu'] = (int) $new_instance['nav_menu']; + return $instance; + } + + function form( $instance ) { + $title = isset( $instance['title'] ) ? $instance['title'] : ''; + $nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : ''; + + // Get menus + $menus = get_terms( 'nav_menu', array( 'hide_empty' => false ) ); + + // If no menus exists, direct the user to go and create some. + if ( !$menus ) { + echo '

        '. sprintf( __('No menus have been created yet. Create some.'), admin_url('nav-menus.php') ) .'

        '; + return; + } + ?> +

        + + +

        +

        + + +

        + posts - */ -$tableposts = $wpdb->posts; - -/** - * The name of the Users table - * @global string $tableusers - * @deprecated Use $wpdb->users - */ -$tableusers = $wpdb->users; - -/** - * The name of the Categories table - * @global string $tablecategories - * @deprecated Use $wpdb->categories - */ -$tablecategories = $wpdb->categories; - -/** - * The name of the post to category table - * @global string $tablepost2cat - * @deprecated Use $wpdb->post2cat; - */ -$tablepost2cat = $wpdb->post2cat; - -/** - * The name of the comments table - * @global string $tablecomments - * @deprecated Use $wpdb->comments; - */ -$tablecomments = $wpdb->comments; - -/** - * The name of the links table - * @global string $tablelinks - * @deprecated Use $wpdb->links; - */ -$tablelinks = $wpdb->links; - -/** - * @global string $tablelinkcategories - * @deprecated Not used anymore; - */ -$tablelinkcategories = 'linkcategories_is_gone'; - -/** - * The name of the options table - * @global string $tableoptions - * @deprecated Use $wpdb->options; - */ -$tableoptions = $wpdb->options; - -/** - * The name of the postmeta table - * @global string $tablepostmeta - * @deprecated Use $wpdb->postmeta; - */ -$tablepostmeta = $wpdb->postmeta; - /* * Deprecated functions come here to die. */ @@ -82,6 +16,7 @@ $tablepostmeta = $wpdb->postmeta; * Entire Post data. * * @since 0.71 + * @deprecated 1.5.1 * @deprecated Use get_post() * @see get_post() * @@ -89,7 +24,7 @@ $tablepostmeta = $wpdb->postmeta; * @return array */ function get_postdata($postid) { - _deprecated_function(__FUNCTION__, '0.0', 'get_post()'); + _deprecated_function( __FUNCTION__, '1.5.1', 'get_post()' ); $post = &get_post($postid); @@ -118,12 +53,13 @@ function get_postdata($postid) { * Sets up the WordPress Loop. * * @since 1.0.1 - * @deprecated Since 1.5 - {@link http://codex.wordpress.org/The_Loop Use new WordPress Loop} + * @deprecated 1.5 + * @deprecated Use The Loop - {@link http://codex.wordpress.org/The_Loop Use new WordPress Loop} */ function start_wp() { global $wp_query, $post; - _deprecated_function(__FUNCTION__, '1.5', __('new WordPress Loop') ); + _deprecated_function( __FUNCTION__, '1.5', __('new WordPress Loop') ); // Since the old style loop is being used, advance the query iterator here. $wp_query->next_post(); @@ -135,6 +71,7 @@ function start_wp() { * Return or Print Category ID. * * @since 0.71 + * @deprecated 0.71 * @deprecated use get_the_category() * @see get_the_category() * @@ -142,7 +79,7 @@ function start_wp() { * @return null|int */ function the_category_ID($echo = true) { - _deprecated_function(__FUNCTION__, '0.0', 'get_the_category()'); + _deprecated_function( __FUNCTION__, '0.71', 'get_the_category()' ); // Grab the first cat in the list. $categories = get_the_category(); @@ -158,6 +95,7 @@ function the_category_ID($echo = true) { * Print category with optional text before and after. * * @since 0.71 + * @deprecated 0.71 * @deprecated use get_the_category_by_ID() * @see get_the_category_by_ID() * @@ -167,7 +105,7 @@ function the_category_ID($echo = true) { function the_category_head($before='', $after='') { global $currentcat, $previouscat; - _deprecated_function(__FUNCTION__, '0.0', 'get_the_category_by_ID()'); + _deprecated_function( __FUNCTION__, '0.71', 'get_the_category_by_ID()' ); // Grab the first cat in the list. $categories = get_the_category(); @@ -184,6 +122,7 @@ function the_category_head($before='', $after='') { * Prints link to the previous post. * * @since 1.5 + * @deprecated 2.0 * @deprecated Use previous_post_link() * @see previous_post_link() * @@ -196,7 +135,7 @@ function the_category_head($before='', $after='') { */ function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { - _deprecated_function(__FUNCTION__, '0.0', 'previous_post_link()'); + _deprecated_function( __FUNCTION__, '2.0', 'previous_post_link()' ); if ( empty($in_same_cat) || 'no' == $in_same_cat ) $in_same_cat = false; @@ -220,6 +159,7 @@ function previous_post($format='%', $previous='previous post: ', $title='yes', $ * Prints link to the next post. * * @since 0.71 + * @deprecated 2.0 * @deprecated Use next_post_link() * @see next_post_link() * @@ -231,7 +171,7 @@ function previous_post($format='%', $previous='previous post: ', $title='yes', $ * @param string $excluded_categories */ function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { - _deprecated_function(__FUNCTION__, '0.0', 'next_post_link()'); + _deprecated_function( __FUNCTION__, '2.0', 'next_post_link()' ); if ( empty($in_same_cat) || 'no' == $in_same_cat ) $in_same_cat = false; @@ -255,6 +195,7 @@ function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat= * Whether user can create a post. * * @since 1.5 + * @deprecated 2.0 * @deprecated Use current_user_can() * @see current_user_can() * @@ -264,7 +205,7 @@ function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat= * @return bool */ function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); + _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); $author_data = get_userdata($user_id); return ($author_data->user_level > 1); @@ -274,6 +215,7 @@ function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') { * Whether user can create a post. * * @since 1.5 + * @deprecated 2.0 * @deprecated Use current_user_can() * @see current_user_can() * @@ -283,7 +225,7 @@ function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') { * @return bool */ function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); + _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); $author_data = get_userdata($user_id); return ($author_data->user_level >= 1); @@ -293,6 +235,7 @@ function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') { * Whether user can edit a post. * * @since 1.5 + * @deprecated 2.0 * @deprecated Use current_user_can() * @see current_user_can() * @@ -302,13 +245,13 @@ function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') { * @return bool */ function user_can_edit_post($user_id, $post_id, $blog_id = 1) { - _deprecated_function(__FUNCTION__, '0', 'current_user_can()'); + _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); $author_data = get_userdata($user_id); $post = get_post($post_id); $post_author_data = get_userdata($post->post_author); - if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' && $author_data->user_level < 2)) + if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' && $author_data->user_level < 2)) || ($author_data->user_level > $post_author_data->user_level) || ($author_data->user_level >= 10) ) { return true; @@ -321,6 +264,7 @@ function user_can_edit_post($user_id, $post_id, $blog_id = 1) { * Whether user can delete a post. * * @since 1.5 + * @deprecated 2.0 * @deprecated Use current_user_can() * @see current_user_can() * @@ -330,7 +274,7 @@ function user_can_edit_post($user_id, $post_id, $blog_id = 1) { * @return bool */ function user_can_delete_post($user_id, $post_id, $blog_id = 1) { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); + _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); // right now if one can edit, one can delete return user_can_edit_post($user_id, $post_id, $blog_id); @@ -340,6 +284,7 @@ function user_can_delete_post($user_id, $post_id, $blog_id = 1) { * Whether user can set new posts' dates. * * @since 1.5 + * @deprecated 2.0 * @deprecated Use current_user_can() * @see current_user_can() * @@ -349,7 +294,7 @@ function user_can_delete_post($user_id, $post_id, $blog_id = 1) { * @return bool */ function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); + _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); $author_data = get_userdata($user_id); return (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id)); @@ -359,6 +304,7 @@ function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') { * Whether user can delete a post. * * @since 1.5 + * @deprecated 2.0 * @deprecated Use current_user_can() * @see current_user_can() * @@ -368,7 +314,7 @@ function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') { * @return bool returns true if $user_id can edit $post_id's date */ function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); + _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); $author_data = get_userdata($user_id); return (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id)); @@ -378,6 +324,7 @@ function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) { * Whether user can delete a post. * * @since 1.5 + * @deprecated 2.0 * @deprecated Use current_user_can() * @see current_user_can() * @@ -387,7 +334,7 @@ function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) { * @return bool returns true if $user_id can edit $post_id's comments */ function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); + _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); // right now if one can edit a post, one can edit comments made on it return user_can_edit_post($user_id, $post_id, $blog_id); @@ -397,6 +344,7 @@ function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) { * Whether user can delete a post. * * @since 1.5 + * @deprecated 2.0 * @deprecated Use current_user_can() * @see current_user_can() * @@ -406,7 +354,7 @@ function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) { * @return bool returns true if $user_id can delete $post_id's comments */ function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); + _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); // right now if one can edit comments, one can delete comments return user_can_edit_post_comments($user_id, $post_id, $blog_id); @@ -416,6 +364,7 @@ function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) { * Can user can edit other user. * * @since 1.5 + * @deprecated 2.0 * @deprecated Use current_user_can() * @see current_user_can() * @@ -424,7 +373,7 @@ function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) { * @return bool */ function user_can_edit_user($user_id, $other_user) { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); + _deprecated_function( __FUNCTION__, '2.0', 'current_user_can()' ); $user = get_userdata($user_id); $other = get_userdata($other_user); @@ -438,8 +387,9 @@ function user_can_edit_user($user_id, $other_user) { * Gets the links associated with category $cat_name. * * @since 0.71 - * @deprecated Use get_links() - * @see get_links() + * @deprecated 2.1 + * @deprecated Use get_bookmarks() + * @see get_bookmarks() * * @param string $cat_name Optional. The category name to use. If no match is found uses all. * @param string $before Optional. The html to output before the link. @@ -457,7 +407,7 @@ function user_can_edit_user($user_id, $other_user) { function get_linksbyname($cat_name = "noname", $before = '', $after = '
        ', $between = " ", $show_images = true, $orderby = 'id', $show_description = true, $show_rating = false, $limit = -1, $show_updated = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'get_links()'); + _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); $cat_id = -1; $cat = get_term_by('name', $cat_name, 'link_category'); @@ -471,23 +421,31 @@ function get_linksbyname($cat_name = "noname", $before = '', $after = '
        ', * Gets the links associated with the named category. * * @since 1.0.1 - * @deprecated Use wp_get_links() - * @see wp_get_links() + * @deprecated 2.1 + * @deprecated Use wp_list_bookmarks() + * @see wp_list_bookmarks() * * @param string $category The category to use. * @param string $args * @return bool|null */ function wp_get_linksbyname($category, $args = '') { - _deprecated_function(__FUNCTION__, '0.0', 'wp_get_links()'); + _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()'); - $cat = get_term_by('name', $category, 'link_category'); - if ( !$cat ) - return false; - $cat_id = $cat->term_id; + $defaults = array( + 'after' => '
        ', + 'before' => '', + 'categorize' => 0, + 'category_after' => '', + 'category_before' => '', + 'category_name' => $category, + 'show_description' => 1, + 'title_li' => '', + ); + + $r = wp_parse_args( $args, $defaults ); - $args = add_query_arg('category', $cat_id, $args); - wp_get_links($args); + return wp_list_bookmarks($r); } /** @@ -501,8 +459,9 @@ function wp_get_linksbyname($category, $args = '') { * * * @since 1.0.1 - * @deprecated Use get_linkobjects() - * @see get_linkobjects() + * @deprecated 2.1 + * @deprecated Use get_bookmarks() + * @see get_bookmarks() * * @param string $cat_name The category name to use. If no match is found uses all. * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', 'description', or 'rating'. @@ -512,7 +471,7 @@ function wp_get_linksbyname($category, $args = '') { * @return unknown */ function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) { - _deprecated_function(__FUNCTION__, '0.0', 'get_linkobjects()'); + _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); $cat_id = -1; $cat = get_term_by('name', $cat_name, 'link_category'); @@ -553,6 +512,7 @@ function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit * * * @since 1.0.1 + * @deprecated 2.1 * @deprecated Use get_bookmarks() * @see get_bookmarks() * @@ -565,9 +525,9 @@ function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit * @return unknown */ function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); + _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); - $links = get_bookmarks("category=$category&orderby=$orderby&limit=$limit"); + $links = get_bookmarks( array( 'category' => $category, 'orderby' => $orderby, 'limit' => $limit ) ) ; $links_array = array(); foreach ($links as $link) @@ -580,6 +540,7 @@ function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) { * Gets the links associated with category 'cat_name' and display rating stars/chars. * * @since 0.71 + * @deprecated 2.1 * @deprecated Use get_bookmarks() * @see get_bookmarks() * @@ -598,7 +559,7 @@ function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) { */ function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '
        ', $between = " ", $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); + _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); } @@ -607,6 +568,7 @@ function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = * Gets the links associated with category n and display rating stars/chars. * * @since 0.71 + * @deprecated 2.1 * @deprecated Use get_bookmarks() * @see get_bookmarks() * @@ -625,7 +587,7 @@ function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = */ function get_links_withrating($category = -1, $before = '', $after = '
        ', $between = " ", $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); + _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); } @@ -634,18 +596,20 @@ function get_links_withrating($category = -1, $before = '', $after = '
        ', $ * Gets the auto_toggle setting. * * @since 0.71 + * @deprecated 2.1 * @deprecated No alternative function available * * @param int $id The category to get. If no category supplied uses 0 * @return int Only returns 0. */ function get_autotoggle($id = 0) { - _deprecated_function(__FUNCTION__, '0.0' ); + _deprecated_function( __FUNCTION__, '2.1' ); return 0; } /** * @since 0.71 + * @deprecated 2.1 * @deprecated Use wp_list_categories() * @see wp_list_categories() * @@ -672,7 +636,7 @@ function get_autotoggle($id = 0) { function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=false, $child_of=0, $categories=0, $recurse=0, $feed = '', $feed_image = '', $exclude = '', $hierarchical=false) { - _deprecated_function(__FUNCTION__, '0.0', 'wp_list_categories()'); + _deprecated_function( __FUNCTION__, '2.1', 'wp_list_categories()' ); $query = compact('optionall', 'all', 'sort_column', 'sort_order', 'file', 'list', 'optiondates', 'optioncount', 'hide_empty', 'use_desc_for_title', 'children', 'child_of', 'categories', 'recurse', 'feed', 'feed_image', 'exclude', 'hierarchical'); @@ -681,6 +645,7 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde /** * @since 1.2 + * @deprecated 2.1 * @deprecated Use wp_list_categories() * @see wp_list_categories() * @@ -688,7 +653,7 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde * @return unknown */ function wp_list_cats($args = '') { - _deprecated_function(__FUNCTION__, '0.0', 'wp_list_categories()'); + _deprecated_function( __FUNCTION__, '2.1', 'wp_list_categories()' ); $r = wp_parse_args( $args ); @@ -712,6 +677,7 @@ function wp_list_cats($args = '') { /** * @since 0.71 + * @deprecated 2.1 * @deprecated Use wp_dropdown_categories() * @see wp_dropdown_categories() * @@ -730,7 +696,7 @@ function wp_list_cats($args = '') { function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc', $show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false, $selected = 0, $exclude = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'wp_dropdown_categories()'); + _deprecated_function( __FUNCTION__, '2.1', 'wp_dropdown_categories()' ); $show_option_all = ''; if ( $optionall ) @@ -746,19 +712,9 @@ function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = ' return wp_dropdown_categories($query); } -/** - * @since 2.1 - * @deprecated Use wp_tiny_mce(). - * @see wp_tiny_mce() - */ -function tinymce_include() { - _deprecated_function(__FUNCTION__, '0.0', 'wp_tiny_mce()'); - - wp_tiny_mce(); -} - /** * @since 1.2 + * @deprecated 2.1 * @deprecated Use wp_list_authors() * @see wp_list_authors() * @@ -771,7 +727,7 @@ function tinymce_include() { * @return unknown */ function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { - _deprecated_function(__FUNCTION__, '0.0', 'wp_list_authors()'); + _deprecated_function( __FUNCTION__, '2.1', 'wp_list_authors()' ); $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image'); return wp_list_authors($args); @@ -779,6 +735,7 @@ function list_authors($optioncount = false, $exclude_admin = true, $show_fullnam /** * @since 1.0.1 + * @deprecated 2.1 * @deprecated Use wp_get_post_categories() * @see wp_get_post_categories() * @@ -787,7 +744,7 @@ function list_authors($optioncount = false, $exclude_admin = true, $show_fullnam * @return unknown */ function wp_get_post_cats($blogid = '1', $post_ID = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'wp_get_post_categories()'); + _deprecated_function( __FUNCTION__, '2.1', 'wp_get_post_categories()' ); return wp_get_post_categories($post_ID); } @@ -795,6 +752,7 @@ function wp_get_post_cats($blogid = '1', $post_ID = 0) { * Sets the categories that the post id belongs to. * * @since 1.0.1 + * @deprecated 2.1 * @deprecated Use wp_set_post_categories() * @see wp_set_post_categories() * @@ -804,12 +762,13 @@ function wp_get_post_cats($blogid = '1', $post_ID = 0) { * @return unknown */ function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { - _deprecated_function(__FUNCTION__, '0.0', 'wp_set_post_categories()'); + _deprecated_function( __FUNCTION__, '2.1', 'wp_set_post_categories()' ); return wp_set_post_categories($post_ID, $post_categories); } /** * @since 0.71 + * @deprecated 2.1 * @deprecated Use wp_get_archives() * @see wp_get_archives() * @@ -822,7 +781,7 @@ function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array( * @return unknown */ function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { - _deprecated_function(__FUNCTION__, '0.0', 'wp_get_archives()'); + _deprecated_function( __FUNCTION__, '2.1', 'wp_get_archives()' ); $args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count'); return wp_get_archives($args); } @@ -831,6 +790,7 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after * Returns or Prints link to the author's posts. * * @since 1.2 + * @deprecated 2.1 * @deprecated Use get_author_posts_url() * @see get_author_posts_url() * @@ -840,7 +800,7 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after * @return string|null */ function get_author_link($echo = false, $author_id, $author_nicename = '') { - _deprecated_function(__FUNCTION__, '0.0', 'get_author_posts_url()'); + _deprecated_function( __FUNCTION__, '2.1', 'get_author_posts_url()' ); $link = get_author_posts_url($author_id, $author_nicename); @@ -853,6 +813,7 @@ function get_author_link($echo = false, $author_id, $author_nicename = '') { * Print list of pages based on arguments. * * @since 0.71 + * @deprecated 2.1 * @deprecated Use wp_link_pages() * @see wp_link_pages() * @@ -867,7 +828,7 @@ function get_author_link($echo = false, $author_id, $author_nicename = '') { */ function link_pages($before='
        ', $after='
        ', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', $pagelink='%', $more_file='') { - _deprecated_function(__FUNCTION__, '0.0', 'wp_link_pages()'); + _deprecated_function( __FUNCTION__, '2.1', 'wp_link_pages()' ); $args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file'); return wp_link_pages($args); @@ -877,6 +838,7 @@ function link_pages($before='
        ', $after='
        ', $next_or_number='number', * Get value based on option. * * @since 0.71 + * @deprecated 2.1 * @deprecated Use get_option() * @see get_option() * @@ -884,7 +846,7 @@ function link_pages($before='
        ', $after='
        ', $next_or_number='number', * @return string */ function get_settings($option) { - _deprecated_function(__FUNCTION__, '0.0', 'get_option()'); + _deprecated_function( __FUNCTION__, '2.1', 'get_option()' ); return get_option($option); } @@ -893,11 +855,12 @@ function get_settings($option) { * Print the permalink of the current post in the loop. * * @since 0.71 + * @deprecated 1.2 * @deprecated Use the_permalink() * @see the_permalink() */ function permalink_link() { - _deprecated_function(__FUNCTION__, '0.0', 'the_permalink()'); + _deprecated_function( __FUNCTION__, '1.2', 'the_permalink()' ); the_permalink(); } @@ -905,13 +868,14 @@ function permalink_link() { * Print the permalink to the RSS feed. * * @since 0.71 + * @deprecated 2.3 * @deprecated Use the_permalink_rss() * @see the_permalink_rss() * * @param string $file */ function permalink_single_rss($deprecated = '') { - _deprecated_function(__FUNCTION__, '0.0', 'the_permalink_rss()'); + _deprecated_function( __FUNCTION__, '0.0', 'the_permalink_rss()' ); the_permalink_rss(); } @@ -920,14 +884,15 @@ function permalink_single_rss($deprecated = '') { * * @see get_links() for argument information that can be used in $args * @since 1.0.1 - * @deprecated Use get_bookmarks() - * @see get_bookmarks() + * @deprecated 2.1 + * @deprecated Use wp_list_bookmarks() + * @see wp_list_bookmarks() * * @param string $args a query string * @return null|string */ function wp_get_links($args = '') { - _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); + _deprecated_function( __FUNCTION__, '0.0', 'wp_list_bookmarks()' ); if ( strpos( $args, '=' ) === false ) { $cat_id = $args; @@ -935,24 +900,31 @@ function wp_get_links($args = '') { } $defaults = array( - 'category' => -1, 'before' => '', - 'after' => '
        ', 'between' => ' ', - 'show_images' => true, 'orderby' => 'name', - 'show_description' => true, 'show_rating' => false, - 'limit' => -1, 'show_updated' => true, - 'echo' => true + 'after' => '
        ', + 'before' => '', + 'between' => ' ', + 'categorize' => 0, + 'category' => '', + 'echo' => true, + 'limit' => -1, + 'orderby' => 'name', + 'show_description' => true, + 'show_images' => true, + 'show_rating' => false, + 'show_updated' => true, + 'title_li' => '', ); $r = wp_parse_args( $args, $defaults ); - extract( $r, EXTR_SKIP ); - return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo); + return wp_list_bookmarks($r); } /** * Gets the links associated with category by id. * * @since 0.71 + * @deprecated 2.1 * @deprecated Use get_bookmarks() * @see get_bookmarks() * @@ -975,7 +947,7 @@ function wp_get_links($args = '') { */ function get_links($category = -1, $before = '', $after = '
        ', $between = ' ', $show_images = true, $orderby = 'name', $show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) { - _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); + _deprecated_function( __FUNCTION__, '2.1', 'get_bookmarks()' ); $order = 'ASC'; if ( substr($orderby, 0, 1) == '_' ) { @@ -986,7 +958,7 @@ function get_links($category = -1, $before = '', $after = '
        ', $between = ' if ( $category == -1 ) //get_bookmarks uses '' to signify all categories $category = ''; - $results = get_bookmarks("category=$category&orderby=$orderby&order=$order&show_updated=$show_updated&limit=$limit"); + $results = get_bookmarks(array('category' => $category, 'orderby' => $orderby, 'order' => $order, 'show_updated' => $show_updated, 'limit' => $limit)); if ( !$results ) return; @@ -1060,16 +1032,15 @@ function get_links($category = -1, $before = '', $after = '
        ', $between = ' * Output a list of all links, listed by category, using the settings in * $wpdb->linkcategories and output it as a nested HTML unordered list. * - * @author Dougal * @since 1.0.1 + * @deprecated 2.1 * @deprecated Use wp_list_bookmarks() * @see wp_list_bookmarks() * * @param string $order Sort link categories by 'name' or 'id' - * @param string $$deprecated Not Used */ -function get_links_list($order = 'name', $deprecated = '') { - _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()'); +function get_links_list($order = 'name') { + _deprecated_function( __FUNCTION__, '2.1', 'wp_list_bookmarks()' ); $order = strtolower($order); @@ -1083,7 +1054,7 @@ function get_links_list($order = 'name', $deprecated = '') { if ( !isset($direction) ) $direction = ''; - $cats = get_categories("type=link&orderby=$order&order=$direction&hierarchical=0"); + $cats = get_categories(array('type' => 'link', 'orderby' => $order, 'order' => $direction, 'hierarchical' => 0)); // Display each category if ( $cats ) { @@ -1104,10 +1075,8 @@ function get_links_list($order = 'name', $deprecated = '') { /** * Show the link to the links popup and the number of links. * - * @author Fullo - * @link http://sprite.csr.unibo.it/fullo/ - * * @since 0.71 + * @deprecated 2.1 * @deprecated {@internal Use function instead is unknown}} * * @param string $text the text of the link @@ -1117,7 +1086,7 @@ function get_links_list($order = 'name', $deprecated = '') { * @param bool $count the number of links in the db */ function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) { - _deprecated_function(__FUNCTION__, '0.0' ); + _deprecated_function( __FUNCTION__, '2.1' ); if ( $count ) $counts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links"); @@ -1134,6 +1103,7 @@ function links_popup_script($text = 'Links', $width=400, $height=400, $file='lin /** * @since 1.0.1 + * @deprecated 2.1 * @deprecated Use sanitize_bookmark_field() * @see sanitize_bookmark_field() * @@ -1141,7 +1111,7 @@ function links_popup_script($text = 'Links', $width=400, $height=400, $file='lin * @return unknown */ function get_linkrating($link) { - _deprecated_function(__FUNCTION__, '0.0', 'sanitize_bookmark_field()'); + _deprecated_function( __FUNCTION__, '2.1', 'sanitize_bookmark_field()' ); return sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display'); } @@ -1149,6 +1119,7 @@ function get_linkrating($link) { * Gets the name of category by id. * * @since 0.71 + * @deprecated 2.1 * @deprecated Use get_category() * @see get_category() * @@ -1156,7 +1127,7 @@ function get_linkrating($link) { * @return string */ function get_linkcatname($id = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'get_category()'); + _deprecated_function( __FUNCTION__, '2.1', 'get_category()' ); $id = (int) $id; @@ -1178,14 +1149,14 @@ function get_linkcatname($id = 0) { * Print RSS comment feed link. * * @since 1.0.1 + * @deprecated 2.5 * @deprecated Use post_comments_feed_link() * @see post_comments_feed_link() * * @param string $link_text - * @param string $deprecated Not used */ -function comments_rss_link($link_text = 'Comments RSS', $deprecated = '') { - _deprecated_function(__FUNCTION__, '0.0', 'post_comments_feed_link()'); +function comments_rss_link($link_text = 'Comments RSS') { + _deprecated_function( __FUNCTION__, '2.5', 'post_comments_feed_link()' ); post_comments_feed_link($link_text); } @@ -1193,16 +1164,16 @@ function comments_rss_link($link_text = 'Comments RSS', $deprecated = '') { * Print/Return link to category RSS2 feed. * * @since 1.2 + * @deprecated 2.5 * @deprecated Use get_category_feed_link() * @see get_category_feed_link() * * @param bool $echo * @param int $cat_ID - * @param string $deprecated Not used * @return string|null */ -function get_category_rss_link($echo = false, $cat_ID = 1, $deprecated = '') { - _deprecated_function(__FUNCTION__, '0.0', 'get_category_feed_link()'); +function get_category_rss_link($echo = false, $cat_ID = 1) { + _deprecated_function( __FUNCTION__, '2.5', 'get_category_feed_link()' ); $link = get_category_feed_link($cat_ID, 'rss2'); @@ -1215,16 +1186,16 @@ function get_category_rss_link($echo = false, $cat_ID = 1, $deprecated = '') { * Print/Return link to author RSS feed. * * @since 1.2 + * @deprecated 2.5 * @deprecated Use get_author_feed_link() * @see get_author_feed_link() * * @param bool $echo * @param int $author_id - * @param string $deprecated Not used * @return string|null */ -function get_author_rss_link($echo = false, $author_id = 1, $deprecated = '') { - _deprecated_function(__FUNCTION__, '0.0', 'get_author_feed_link()'); +function get_author_rss_link($echo = false, $author_id = 1) { + _deprecated_function( __FUNCTION__, '2.5', 'get_author_feed_link()' ); $link = get_author_feed_link($author_id); if ( $echo ) @@ -1236,66 +1207,56 @@ function get_author_rss_link($echo = false, $author_id = 1, $deprecated = '') { * Return link to the post RSS feed. * * @since 1.5 + * @deprecated 2.2 * @deprecated Use get_post_comments_feed_link() * @see get_post_comments_feed_link() * - * @param string $deprecated Not used * @return string */ -function comments_rss($deprecated = '') { - _deprecated_function(__FUNCTION__, '2.2', 'get_post_comments_feed_link()'); +function comments_rss() { + _deprecated_function( __FUNCTION__, '2.2', 'get_post_comments_feed_link()' ); return get_post_comments_feed_link(); } /** * An alias of wp_create_user(). * + * @since 2.0 + * @deprecated 2.0 + * @deprecated Use wp_create_user() + * @see wp_create_user() + * * @param string $username The user's username. * @param string $password The user's password. * @param string $email The user's email (optional). * @return int The new user's ID. - * @deprecated Use wp_create_user() - * @see wp_create_user() */ function create_user($username, $password, $email) { _deprecated_function( __FUNCTION__, '2.0', 'wp_create_user()' ); return wp_create_user($username, $password, $email); } -/** - * Unused Admin function. - * - * @since 2.0 - * @param string $deprecated Unknown - * @deprecated 2.5 - */ -function documentation_link( $deprecated = '' ) { - _deprecated_function( __FUNCTION__, '2.5', '' ); - return; -} - /** * Unused function. * * @deprecated 2.5 */ function gzip_compression() { + _deprecated_function( __FUNCTION__, '2.5' ); return false; } /** * Retrieve an array of comment data about comment $comment_ID. * + * @since 0.71 + * @deprecated 2.7 * @deprecated Use get_comment() * @see get_comment() - * @since 0.71 - * - * @uses $id - * @uses $wpdb Database Object * * @param int $comment_ID The ID of the comment - * @param int $no_cache Whether to use the cache or not (casted to bool) - * @param bool $include_unapproved Whether to include unapproved comments or not + * @param int $no_cache Whether to use the cache (cast to bool) + * @param bool $include_unapproved Whether to include unapproved comments * @return array The comment data */ function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) { @@ -1307,14 +1268,15 @@ function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = fals * Retrieve the category name by the category ID. * * @since 0.71 + * @deprecated 2.8 * @deprecated Use get_cat_name() - * @see get_cat_name() get_catname() is deprecated in favor of get_cat_name(). + * @see get_cat_name() * * @param int $cat_ID Category ID * @return string category name */ function get_catname( $cat_ID ) { - _deprecated_function(__FUNCTION__, '2.8', 'get_cat_name()'); + _deprecated_function( __FUNCTION__, '2.8', 'get_cat_name()' ); return get_cat_name( $cat_ID ); } @@ -1322,6 +1284,9 @@ function get_catname( $cat_ID ) { * Retrieve category children list separated before and after the term IDs. * * @since 1.2.0 + * @deprecated 2.8 + * @deprecated Use get_term_children() + * @see get_term_children() * * @param int $id Category ID to retrieve children. * @param string $before Optional. Prepend before category term ID. @@ -1330,7 +1295,7 @@ function get_catname( $cat_ID ) { * @return string */ function get_category_children( $id, $before = '/', $after = '', $visited = array() ) { - _deprecated_function(__FUNCTION__, '2.8', 'get_term_children()'); + _deprecated_function( __FUNCTION__, '2.8', 'get_term_children()' ); if ( 0 == $id ) return ''; @@ -1358,25 +1323,26 @@ function get_category_children( $id, $before = '/', $after = '', $visited = arra * * @since 1.5 * @deprecated 2.8 - * @uses $authordata The current author's DB object. - * @return string The author's description. * @deprecated Use the_author_meta('description') + * @see get_the_author_meta() + * + * @return string The author's description. */ function get_the_author_description() { - _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'description\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'description\')' ); return get_the_author_meta('description'); } /** * Display the description of the author of the current post. * - * @link http://codex.wordpress.org/Template_Tags/the_author_description * @since 1.0.0 * @deprecated 2.8 * @deprecated Use the_author_meta('description') + * @see the_author_meta() */ function the_author_description() { - _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'description\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'description\')' ); the_author_meta('description'); } @@ -1385,25 +1351,26 @@ function the_author_description() { * * @since 1.5 * @deprecated 2.8 - * @uses $authordata The current author's DB object. - * @return string The author's login name (username). * @deprecated Use the_author_meta('login') + * @see get_the_author_meta() + * + * @return string The author's login name (username). */ function get_the_author_login() { - _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'login\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'login\')' ); return get_the_author_meta('login'); } /** * Display the login name of the author of the current post. * - * @link http://codex.wordpress.org/Template_Tags/the_author_login * @since 0.71 * @deprecated 2.8 * @deprecated Use the_author_meta('login') + * @see the_author_meta() */ function the_author_login() { - _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'login\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'login\')' ); the_author_meta('login'); } @@ -1412,25 +1379,26 @@ function the_author_login() { * * @since 1.5 * @deprecated 2.8 - * @uses $authordata The current author's DB object. - * @return string The author's first name. * @deprecated Use the_author_meta('first_name') + * @see get_the_author_meta() + * + * @return string The author's first name. */ function get_the_author_firstname() { - _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'first_name\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'first_name\')' ); return get_the_author_meta('first_name'); } /** * Display the first name of the author of the current post. * - * @link http://codex.wordpress.org/Template_Tags/the_author_firstname * @since 0.71 * @deprecated 2.8 * @deprecated Use the_author_meta('first_name') + * @see the_author_meta() */ function the_author_firstname() { - _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'first_name\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'first_name\')' ); the_author_meta('first_name'); } @@ -1439,25 +1407,26 @@ function the_author_firstname() { * * @since 1.5 * @deprecated 2.8 - * @uses $authordata The current author's DB object. + * @deprecated Use get_the_author_meta('last_name') + * @see get_the_author_meta() + * * @return string The author's last name. - * @deprecated Use the_author_meta('last_name') */ function get_the_author_lastname() { - _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'last_name\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'last_name\')' ); return get_the_author_meta('last_name'); } /** * Display the last name of the author of the current post. * - * @link http://codex.wordpress.org/Template_Tags/the_author_lastname * @since 0.71 * @deprecated 2.8 * @deprecated Use the_author_meta('last_name') + * @see the_author_meta() */ function the_author_lastname() { - _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'last_name\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'last_name\')' ); the_author_meta('last_name'); } @@ -1466,25 +1435,26 @@ function the_author_lastname() { * * @since 1.5 * @deprecated 2.8 - * @uses $authordata The current author's DB object. + * @deprecated Use get_the_author_meta('nickname') + * @see get_the_author_meta() + * * @return string The author's nickname. - * @deprecated Use the_author_meta('nickname') */ function get_the_author_nickname() { - _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'nickname\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'nickname\')' ); return get_the_author_meta('nickname'); } /** * Display the nickname of the author of the current post. * - * @link http://codex.wordpress.org/Template_Tags/the_author_nickname * @since 0.71 * @deprecated 2.8 * @deprecated Use the_author_meta('nickname') + * @see the_author_meta() */ function the_author_nickname() { - _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'nickname\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'nickname\')' ); the_author_meta('nickname'); } @@ -1493,25 +1463,26 @@ function the_author_nickname() { * * @since 1.5 * @deprecated 2.8 - * @uses $authordata The current author's DB object. + * @deprecated Use get_the_author_meta('email') + * @see get_the_author_meta() + * * @return string The author's username. - * @deprecated Use the_author_meta('email') */ function get_the_author_email() { - _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'email\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'email\')' ); return get_the_author_meta('email'); } /** * Display the email of the author of the current post. * - * @link http://codex.wordpress.org/Template_Tags/the_author_email * @since 0.71 * @deprecated 2.8 * @deprecated Use the_author_meta('email') + * @see the_author_meta() */ function the_author_email() { - _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'email\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'email\')' ); the_author_meta('email'); } @@ -1520,26 +1491,26 @@ function the_author_email() { * * @since 1.5 * @deprecated 2.8 - * @uses $authordata The current author's DB object. + * @deprecated Use get_the_author_meta('icq') + * @see get_the_author_meta() + * * @return string The author's ICQ number. - * @deprecated Use the_author_meta('icq') */ function get_the_author_icq() { - _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'icq\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'icq\')' ); return get_the_author_meta('icq'); } /** * Display the ICQ number of the author of the current post. * - * @link http://codex.wordpress.org/Template_Tags/the_author_icq * @since 0.71 * @deprecated 2.8 - * @see get_the_author_icq() * @deprecated Use the_author_meta('icq') + * @see the_author_meta() */ function the_author_icq() { - _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'icq\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'icq\')' ); the_author_meta('icq'); } @@ -1548,25 +1519,26 @@ function the_author_icq() { * * @since 1.5 * @deprecated 2.8 - * @uses $authordata The current author's DB object. + * @deprecated Use get_the_author_meta('yim') + * @see get_the_author_meta() + * * @return string The author's Yahoo! IM name. - * @deprecated Use the_author_meta('yim') */ function get_the_author_yim() { - _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'yim\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'yim\')' ); return get_the_author_meta('yim'); } /** * Display the Yahoo! IM name of the author of the current post. * - * @link http://codex.wordpress.org/Template_Tags/the_author_yim * @since 0.71 * @deprecated 2.8 * @deprecated Use the_author_meta('yim') + * @see the_author_meta() */ function the_author_yim() { - _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'yim\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'yim\')' ); the_author_meta('yim'); } @@ -1575,26 +1547,26 @@ function the_author_yim() { * * @since 1.5 * @deprecated 2.8 - * @uses $authordata The current author's DB object. + * @deprecated Use get_the_author_meta('msn') + * @see get_the_author_meta() + * * @return string The author's MSN address. - * @deprecated Use the_author_meta('msn') */ function get_the_author_msn() { - _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'msn\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'msn\')' ); return get_the_author_meta('msn'); } /** * Display the MSN address of the author of the current post. * - * @link http://codex.wordpress.org/Template_Tags/the_author_msn * @since 0.71 * @deprecated 2.8 - * @see get_the_author_msn() * @deprecated Use the_author_meta('msn') + * @see the_author_meta() */ function the_author_msn() { - _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'msn\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'msn\')' ); the_author_meta('msn'); } @@ -1603,26 +1575,26 @@ function the_author_msn() { * * @since 1.5 * @deprecated 2.8 - * @uses $authordata The current author's DB object. + * @deprecated Use get_the_author_meta('aim') + * @see get_the_author_meta() + * * @return string The author's AIM address. - * @deprecated Use the_author_meta('aim') */ function get_the_author_aim() { - _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'aim\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'aim\')' ); return get_the_author_meta('aim'); } /** * Display the AIM address of the author of the current post. * - * @link http://codex.wordpress.org/Template_Tags/the_author_aim * @since 0.71 + * @see the_author_meta() * @deprecated 2.8 - * @see get_the_author_aim() * @deprecated Use the_author_meta('aim') */ function the_author_aim() { - _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'aim\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'aim\')' ); the_author_meta('aim'); } @@ -1631,12 +1603,14 @@ function the_author_aim() { * * @since 1.0.0 * @deprecated 2.8 + * @deprecated Use get_the_author_meta('display_name') + * @see get_the_author_meta() + * * @param int $auth_id The ID of the author. * @return string The author's display name. - * @deprecated Use the_author_meta('display_name') */ function get_author_name( $auth_id = false ) { - _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'display_name\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'display_name\')' ); return get_the_author_meta('display_name', $auth_id); } @@ -1645,23 +1619,26 @@ function get_author_name( $auth_id = false ) { * * @since 1.5 * @deprecated 2.8 - * @uses $authordata The current author's DB object. + * @deprecated Use get_the_author_meta('url') + * @see get_the_author_meta() + * * @return string The URL to the author's page. */ function get_the_author_url() { - _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'url\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'url\')' ); return get_the_author_meta('url'); } /** * Display the URL to the home page of the author of the current post. * - * @link http://codex.wordpress.org/Template_Tags/the_author_url * @since 0.71 * @deprecated 2.8 + * @deprecated Use the_author_meta('url') + * @see the_author_meta() */ function the_author_url() { - _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'url\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'url\')' ); the_author_meta('url'); } @@ -1670,23 +1647,26 @@ function the_author_url() { * * @since 1.5 * @deprecated 2.8 + * @deprecated Use get_the_author_meta('ID') + * @see get_the_author_meta() + * * @return int The author's ID. */ function get_the_author_ID() { - _deprecated_function(__FUNCTION__, '2.8', 'get_the_author_meta(\'ID\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'get_the_author_meta(\'ID\')' ); return get_the_author_meta('ID'); } /** * Display the ID of the author of the current post. * - * @link http://codex.wordpress.org/Template_Tags/the_author_ID * @since 0.71 * @deprecated 2.8 - * @uses get_the_author_ID() + * @deprecated Use the_author_meta('ID') + * @see the_author_meta() */ function the_author_ID() { - _deprecated_function(__FUNCTION__, '2.8', 'the_author_meta(\'ID\')' ); + _deprecated_function( __FUNCTION__, '2.8', 'the_author_meta(\'ID\')' ); the_author_meta('ID'); } @@ -1715,6 +1695,8 @@ function the_author_ID() { * parameters. * * @deprecated 2.9.0 + * @deprecated Use the_content_feed() + * @see the_content_feed() * * @param string $more_link_text Optional. Text to display when more content is available but not displayed. * @param int|bool $stripteaser Optional. Default is 0. @@ -1723,7 +1705,7 @@ function the_author_ID() { * @param int $encode_html Optional. How to encode the content. */ function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) { - _deprecated_function(__FUNCTION__, '2.9', 'the_content_feed' ); + _deprecated_function( __FUNCTION__, '2.9', 'the_content_feed' ); $content = get_the_content($more_link_text, $stripteaser, $more_file); $content = apply_filters('the_content_rss', $content); if ( $cut && !$encode_html ) @@ -1769,7 +1751,7 @@ function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file * @return string HTML stripped out of content with links at the bottom. */ function make_url_footnote( $content ) { - _deprecated_function(__FUNCTION__, '2.9', '' ); + _deprecated_function( __FUNCTION__, '2.9', '' ); preg_match_all( '/(.+?)<\/a>/', $content, $matches ); $links_summary = "\n"; for ( $i=0; $ipost_type) || !$url = wp_get_attachment_url($_post->ID) ) + return __('Missing Attachment'); + + if ( $permalink ) + $url = get_attachment_link($_post->ID); + + $post_title = esc_attr($_post->post_title); + + $innerHTML = get_attachment_innerHTML($_post->ID, $fullsize, $max_dims); + return "$innerHTML"; +} + +/** + * Retrieve icon URL and Path. + * + * @since 2.1.0 + * @deprecated 2.5.0 + * @deprecated Use wp_get_attachment_image_src() + * @see wp_get_attachment_image_src() + * + * @param int $id Optional. Post ID. + * @param bool $fullsize Optional, default to false. Whether to have full image. + * @return array Icon URL and full path to file, respectively. + */ +function get_attachment_icon_src( $id = 0, $fullsize = false ) { + _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image_src()' ); + $id = (int) $id; + if ( !$post = & get_post($id) ) + return false; + + $file = get_attached_file( $post->ID ); + + if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) { + // We have a thumbnail desired, specified and existing + + $src_file = basename($src); + $class = 'attachmentthumb'; + } elseif ( wp_attachment_is_image( $post->ID ) ) { + // We have an image without a thumbnail + + $src = wp_get_attachment_url( $post->ID ); + $src_file = & $file; + $class = 'attachmentimage'; + } elseif ( $src = wp_mime_type_icon( $post->ID ) ) { + // No thumb, no image. We'll look for a mime-related icon instead. + + $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' ); + $src_file = $icon_dir . '/' . basename($src); + } + + if ( !isset($src) || !$src ) + return false; + + return array($src, $src_file); +} + +/** + * Retrieve HTML content of icon attachment image element. + * + * @since 2.0.0 + * @deprecated 2.5.0 + * @deprecated Use wp_get_attachment_image() + * @see wp_get_attachment_image() + * + * @param int $id Optional. Post ID. + * @param bool $fullsize Optional, default to false. Whether to have full size image. + * @param array $max_dims Optional. Dimensions of image. + * @return string HTML content. + */ +function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) { + _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' ); + $id = (int) $id; + if ( !$post = & get_post($id) ) + return false; + + if ( !$src = get_attachment_icon_src( $post->ID, $fullsize ) ) + return false; + + list($src, $src_file) = $src; + + // Do we need to constrain the image? + if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) { + + $imagesize = getimagesize($src_file); + + if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) { + $actual_aspect = $imagesize[0] / $imagesize[1]; + $desired_aspect = $max_dims[0] / $max_dims[1]; + + if ( $actual_aspect >= $desired_aspect ) { + $height = $actual_aspect * $max_dims[0]; + $constraint = "width='{$max_dims[0]}' "; + $post->iconsize = array($max_dims[0], $height); + } else { + $width = $max_dims[1] / $actual_aspect; + $constraint = "height='{$max_dims[1]}' "; + $post->iconsize = array($width, $max_dims[1]); + } + } else { + $post->iconsize = array($imagesize[0], $imagesize[1]); + $constraint = ''; + } + } else { + $constraint = ''; + } + + $post_title = esc_attr($post->post_title); + + $icon = "$post_title"; + + return apply_filters( 'attachment_icon', $icon, $post->ID ); +} + +/** + * Retrieve HTML content of image element. + * + * @since 2.0.0 + * @deprecated 2.5.0 + * @deprecated Use wp_get_attachment_image() + * @see wp_get_attachment_image() + * + * @param int $id Optional. Post ID. + * @param bool $fullsize Optional, default to false. Whether to have full size image. + * @param array $max_dims Optional. Dimensions of image. + * @return string + */ +function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) { + _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' ); + $id = (int) $id; + if ( !$post = & get_post($id) ) + return false; + + if ( $innerHTML = get_attachment_icon($post->ID, $fullsize, $max_dims)) + return $innerHTML; + + + $innerHTML = esc_attr($post->post_title); + + return apply_filters('attachment_innerHTML', $innerHTML, $post->ID); +} + +/* + * Retrieve bookmark data based on ID. + * + * @since 2.0.0 + * @deprecated 2.1.0 + * @deprecated Use get_bookmark() + * @see get_bookmark() + * + * @param int $bookmark_id ID of link + * @param string $output OBJECT, ARRAY_N, or ARRAY_A + * @return object|array + */ +function get_link($bookmark_id, $output = OBJECT, $filter = 'raw') { + _deprecated_function( __FUNCTION__, '2.1', 'get_bookmark()' ); + return get_bookmark($bookmark_id, $output, $filter); +} + +/** + * Performs esc_url() for database or redirect usage. + * + * @since 2.3.1 + * @deprecated 2.8.0 + * @deprecated Use esc_url_raw() + * @see esc_url_raw() + * + * @param string $url The URL to be cleaned. + * @param array $protocols An array of acceptable protocols. + * @return string The cleaned URL. + */ +function sanitize_url( $url, $protocols = null ) { + _deprecated_function( __FUNCTION__, '2.8', 'esc_url_raw()' ); + return esc_url_raw( $url, $protocols ); +} + +/** + * Checks and cleans a URL. + * + * A number of characters are removed from the URL. If the URL is for displaying + * (the default behaviour) amperstands are also replaced. The 'clean_url' filter + * is applied to the returned cleaned URL. + * + * @since 1.2.0 + * @deprecated 3.0.0 + * @deprecated Use esc_url() + * @see Alias for esc_url() + * + * @param string $url The URL to be cleaned. + * @param array $protocols Optional. An array of acceptable protocols. + * @param string $context Optional. How the URL will be used. Default is 'display'. + * @return string The cleaned $url after the 'clean_url' filter is applied. + */ +function clean_url( $url, $protocols = null, $context = 'display' ) { + if ( $context == 'db' ) + _deprecated_function( 'clean_url( $context = \'db\' )', '3.0', 'esc_url_raw()' ); + else + _deprecated_function( __FUNCTION__, '3.0', 'esc_url()' ); + return esc_url( $url, $protocols, $context ); +} + +/** + * Escape single quotes, specialchar double quotes, and fix line endings. + * + * The filter 'js_escape' is also applied by esc_js() + * + * @since 2.0.4 + * @deprecated 2.8.0 + * @deprecated Use esc_js() + * @see esc_js() + * + * @param string $text The text to be escaped. + * @return string Escaped text. + */ +function js_escape( $text ) { + _deprecated_function( __FUNCTION__, '2.8', 'esc_js()' ); + return esc_js( $text ); +} + +/** + * Escaping for HTML blocks. + * + * @deprecated 2.8.0 + * @deprecated Use esc_html() + * @see esc_html() + */ +function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) { + _deprecated_function( __FUNCTION__, '2.8', 'esc_html()' ); + if ( func_num_args() > 1 ) { // Maintain backwards compat for people passing additional args + $args = func_get_args(); + return call_user_func_array( '_wp_specialchars', $args ); + } else { + return esc_html( $string ); + } +} + + +/** + * Escaping for HTML attributes. + * + * @since 2.0.6 + * @deprecated 2.8.0 + * @deprecated Use esc_attr() + * @see esc_attr() + * + * @param string $text + * @return string + */ +function attribute_escape( $text ) { + _deprecated_function( __FUNCTION__, '2.8', 'esc_attr()' ); + return esc_attr( $text ); +} + +/** + * Register widget for sidebar with backwards compatibility. + * + * Allows $name to be an array that accepts either three elements to grab the + * first element and the third for the name or just uses the first element of + * the array for the name. + * + * Passes to {@link wp_register_sidebar_widget()} after argument list and + * backwards compatibility is complete. + * + * @since 2.2.0 + * @deprecated 2.8.0 + * @deprecated Use wp_register_sidebar_widget() + * @see wp_register_sidebar_widget() + * + * @param string|int $name Widget ID. + * @param callback $output_callback Run when widget is called. + * @param string $classname Classname widget option. + * @param mixed $params,... Widget parameters. + */ +function register_sidebar_widget($name, $output_callback, $classname = '') { + _deprecated_function( __FUNCTION__, '2.8', 'wp_register_sidebar_widget()' ); + // Compat + if ( is_array($name) ) { + if ( count($name) == 3 ) + $name = sprintf($name[0], $name[2]); + else + $name = $name[0]; + } + + $id = sanitize_title($name); + $options = array(); + if ( !empty($classname) && is_string($classname) ) + $options['classname'] = $classname; + $params = array_slice(func_get_args(), 2); + $args = array($id, $name, $output_callback, $options); + if ( !empty($params) ) + $args = array_merge($args, $params); + + call_user_func_array('wp_register_sidebar_widget', $args); +} + +/** + * Alias of {@link wp_unregister_sidebar_widget()}. + * + * @since 2.2.0 + * @deprecated 2.8.0 + * @deprecated Use wp_unregister_sidebar_widget() + * @see wp_unregister_sidebar_widget() + * + * @param int|string $id Widget ID. + */ +function unregister_sidebar_widget($id) { + _deprecated_function( __FUNCTION__, '2.8', 'wp_unregister_sidebar_widget()' ); + return wp_unregister_sidebar_widget($id); +} + +/** + * Registers widget control callback for customizing options. + * + * Allows $name to be an array that accepts either three elements to grab the + * first element and the third for the name or just uses the first element of + * the array for the name. + * + * Passes to {@link wp_register_widget_control()} after the argument list has + * been compiled. + * + * @since 2.2.0 + * @deprecated 2.8.0 + * @deprecated Use wp_register_widget_control() + * @see wp_register_widget_control() + * + * @param int|string $name Sidebar ID. + * @param callback $control_callback Widget control callback to display and process form. + * @param int $width Widget width. + * @param int $height Widget height. + */ +function register_widget_control($name, $control_callback, $width = '', $height = '') { + _deprecated_function( __FUNCTION__, '2.8', 'wp_register_widget_control()' ); + // Compat + if ( is_array($name) ) { + if ( count($name) == 3 ) + $name = sprintf($name[0], $name[2]); + else + $name = $name[0]; + } + + $id = sanitize_title($name); + $options = array(); + if ( !empty($width) ) + $options['width'] = $width; + if ( !empty($height) ) + $options['height'] = $height; + $params = array_slice(func_get_args(), 4); + $args = array($id, $name, $control_callback, $options); + if ( !empty($params) ) + $args = array_merge($args, $params); + + call_user_func_array('wp_register_widget_control', $args); +} + +/** + * Alias of {@link wp_unregister_widget_control()}. + * + * @since 2.2.0 + * @deprecated 2.8.0 + * @deprecated Use wp_unregister_widget_control() + * @see wp_unregister_widget_control() + * + * @param int|string $id Widget ID. + */ +function unregister_widget_control($id) { + _deprecated_function( __FUNCTION__, '2.8', 'wp_unregister_widget_control()' ); + return wp_unregister_widget_control($id); +} + +/** + * Remove user meta data. + * + * @since 2.0.0 + * @deprecated 3.0.0 + * @deprecated Use delete_user_meta() + * @see delete_user_meta() + * + * @param int $user_id User ID. + * @param string $meta_key Metadata key. + * @param mixed $meta_value Metadata value. + * @return bool True deletion completed and false if user_id is not a number. + */ +function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) { + _deprecated_function( __FUNCTION__, '3.0', 'delete_user_meta()' ); + global $wpdb; + if ( !is_numeric( $user_id ) ) + return false; + $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); + + if ( is_array($meta_value) || is_object($meta_value) ) + $meta_value = serialize($meta_value); + $meta_value = trim( $meta_value ); + + $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); + + if ( $cur && $cur->umeta_id ) + do_action( 'delete_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); + + if ( ! empty($meta_value) ) + $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s AND meta_value = %s", $user_id, $meta_key, $meta_value) ); + else + $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); + + wp_cache_delete($user_id, 'users'); + + if ( $cur && $cur->umeta_id ) + do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); + + return true; +} + +/** + * Retrieve user metadata. + * + * If $user_id is not a number, then the function will fail over with a 'false' + * boolean return value. Other returned values depend on whether there is only + * one item to be returned, which be that single item type. If there is more + * than one metadata value, then it will be list of metadata values. + * + * @since 2.0.0 + * @deprecated 3.0.0 + * @deprecated Use get_user_meta() + * @see get_user_meta() + * + * @param int $user_id User ID + * @param string $meta_key Optional. Metadata key. + * @return mixed + */ +function get_usermeta( $user_id, $meta_key = '' ) { + _deprecated_function( __FUNCTION__, '3.0', 'get_user_meta()' ); + global $wpdb; + $user_id = (int) $user_id; + + if ( !$user_id ) + return false; + + if ( !empty($meta_key) ) { + $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); + $user = wp_cache_get($user_id, 'users'); + // Check the cached user object + if ( false !== $user && isset($user->$meta_key) ) + $metas = array($user->$meta_key); + else + $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); + } else { + $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM $wpdb->usermeta WHERE user_id = %d", $user_id) ); + } + + if ( empty($metas) ) { + if ( empty($meta_key) ) + return array(); + else + return ''; + } + + $metas = array_map('maybe_unserialize', $metas); + + if ( count($metas) == 1 ) + return $metas[0]; + else + return $metas; +} + +/** + * Update metadata of user. + * + * There is no need to serialize values, they will be serialized if it is + * needed. The metadata key can only be a string with underscores. All else will + * be removed. + * + * Will remove the metadata, if the meta value is empty. + * + * @since 2.0.0 + * @deprecated 3.0.0 + * @deprecated Use update_user_meta() + * @see update_user_meta() + * + * @param int $user_id User ID + * @param string $meta_key Metadata key. + * @param mixed $meta_value Metadata value. + * @return bool True on successful update, false on failure. + */ +function update_usermeta( $user_id, $meta_key, $meta_value ) { + _deprecated_function( __FUNCTION__, '3.0', 'update_user_meta()' ); + global $wpdb; + if ( !is_numeric( $user_id ) ) + return false; + $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key); + + /** @todo Might need fix because usermeta data is assumed to be already escaped */ + if ( is_string($meta_value) ) + $meta_value = stripslashes($meta_value); + $meta_value = maybe_serialize($meta_value); + + if (empty($meta_value)) { + return delete_usermeta($user_id, $meta_key); + } + + $cur = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $meta_key) ); + + if ( $cur ) + do_action( 'update_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); + + if ( !$cur ) + $wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') ); + else if ( $cur->meta_value != $meta_value ) + $wpdb->update($wpdb->usermeta, compact('meta_value'), compact('user_id', 'meta_key') ); + else + return false; + + wp_cache_delete($user_id, 'users'); + + if ( !$cur ) + do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value ); + else + do_action( 'updated_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value ); + + return true; +} + +/** + * Enable/disable automatic general feed link outputting. + * + * @since 2.8.0 + * @deprecated 3.0.0 + * @deprecated Use add_theme_support( 'automatic-feed-links' ) + * + * @param boolean $add Optional, default is true. Add or remove links. Defaults to true. + */ +function automatic_feed_links( $add = true ) { + _deprecated_function( __FUNCTION__, '3.0', "add_theme_support( 'automatic-feed-links' )" ); + + if ( $add ) + add_theme_support( 'automatic-feed-links' ); + else + remove_action( 'wp_head', 'feed_links_extra', 3 ); // Just do this yourself in 3.0+ +} + +/** + * Retrieve user data based on field. + * + * @since 1.5.0 + * @deprecated 3.0.0 + * @deprecated Use get_the_author_meta() + * @see get_the_author_meta() + */ +function get_profile( $field, $user = false ) { + _deprecated_function( __FUNCTION__, '3.0', 'get_the_author_meta()' ); + if ( $user ) { + $user = get_user_by( 'login', $user ); + $user = $user->ID; + } + return get_the_author_meta( $field, $user ); +} + +/** + * Number of posts user has written. + * + * @since 0.71 + * @deprecated 3.0.0 + * @deprecated Use count_user_posts() + * @see count_user_posts() + */ +function get_usernumposts( $userid ) { + _deprecated_function( __FUNCTION__, '3.0', 'count_user_posts()' ); + return count_user_posts( $userid ); +} + +/** + * Callback used to change %uXXXX to &#YYY; syntax + * + * @since 2.8.0 + * @access private + * @deprecated 3.0.0 + * + * @param array $matches Single Match + * @return string An HTML entity + */ +function funky_javascript_callback($matches) { + return "&#".base_convert($matches[1],16,10).";"; +} + +/** + * Fixes javascript bugs in browsers. + * + * Converts unicode characters to HTML numbered entities. + * + * @since 1.5.0 + * @uses $is_macIE + * @uses $is_winIE + * @deprecated 3.0.0 + * + * @param string $text Text to be made safe. + * @return string Fixed text. + */ +function funky_javascript_fix($text) { + _deprecated_function( __FUNCTION__, '3.0' ); + // Fixes for browsers' javascript bugs + global $is_macIE, $is_winIE; + + if ( $is_winIE || $is_macIE ) + $text = preg_replace_callback("/\%u([0-9A-F]{4,4})/", + "funky_javascript_callback", + $text); + + return $text; +} + +/** + * Generates and displays the RDF for the trackback information of current post. + * + * @since 0.71 + * @deprecated 3.0.0 + * + * @param int $deprecated Not used (Was $timezone = 0) + */ +function trackback_rdf($deprecated = '') { + _deprecated_function( __FUNCTION__, '3.0' ); + return ''; +} + +/** + * Checks that the taxonomy name exists. + * + * @since 2.3.0 + * @deprecated 3.0.0 + * @deprecated Use taxonomy_exists() + * @see taxonomy_exists() + * + * @param string $taxonomy Name of taxonomy object + * @return bool Whether the taxonomy exists. + */ +function is_taxonomy( $taxonomy ) { + _deprecated_function( __FUNCTION__, '3.0', 'taxonomy_exists()' ); + return taxonomy_exists( $taxonomy ); +} + +/** + * Check if Term exists. + * + * @since 2.3.0 + * @deprecated 3.0.0 + * @deprecated Use term_exists() + * @see term_exists() + * + * @param int|string $term The term to check + * @param string $taxonomy The taxonomy name to use + * @param int $parent ID of parent term under which to confine the exists search. + * @return mixed Get the term id or Term Object, if exists. + */ +function is_term( $term, $taxonomy = '', $parent = 0 ) { + _deprecated_function( __FUNCTION__, '3.0', 'term_exists()' ); + return term_exists( $term, $taxonomy, $parent ); } -?> \ No newline at end of file diff --git a/wp-includes/feed-atom-comments.php b/wp-includes/feed-atom-comments.php index 7f7e6f51..e4a39d80 100644 --- a/wp-includes/feed-atom-comments.php +++ b/wp-includes/feed-atom-comments.php @@ -16,27 +16,26 @@ echo '' > <?php if ( is_singular() ) - printf(ent2ncr(__('Comments on: %s')), get_the_title_rss()); + printf(ent2ncr(__('Comments on %s')), get_the_title_rss()); elseif ( is_search() ) - printf(ent2ncr(__('Comments for %1$s searching on %2$s')), get_bloginfo_rss( 'name' ), esc_attr(get_search_query())); + printf(ent2ncr(__('Comments for %1$s searching on %2$s')), get_bloginfo_rss( 'name' ), get_search_query() ); else printf(ent2ncr(__('Comments for %s')), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); ?> - - + - + - + @@ -74,7 +73,7 @@ if ( have_comments() ) : while ( have_comments() ) : the_comment(); comment_parent == 0 ) : // This comment is top level ?> - + comment_parent); // The rel attribute below and the id tag above should be GUIDs, but WP doesn't create them for comments (unlike posts). Either way, its more important that they both use the same system diff --git a/wp-includes/feed-atom.php b/wp-includes/feed-atom.php index da3eeb46..b23dffcd 100644 --- a/wp-includes/feed-atom.php +++ b/wp-includes/feed-atom.php @@ -13,16 +13,15 @@ echo ''; ?> xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xml:lang="" - xml:base="/wp-atom.php" + xml:base="/wp-atom.php" > <?php bloginfo_rss('name'); wp_title_rss(); ?> - - + @@ -37,7 +36,7 @@ echo ''; ?> <![CDATA[<?php the_title_rss() ?>]]> - + diff --git a/wp-includes/feed-rdf.php b/wp-includes/feed-rdf.php index 946f370a..3a0daf1f 100644 --- a/wp-includes/feed-rdf.php +++ b/wp-includes/feed-rdf.php @@ -23,9 +23,8 @@ echo ''; ?> - - 1 + 2000-01-01T12:00+00:00 diff --git a/wp-includes/feed-rss.php b/wp-includes/feed-rss.php index 90eeab05..b26897d3 100644 --- a/wp-includes/feed-rss.php +++ b/wp-includes/feed-rss.php @@ -9,7 +9,6 @@ header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_opt $more = 1; echo ''; ?> - <?php bloginfo_rss('name'); wp_title_rss(); ?> diff --git a/wp-includes/feed-rss2-comments.php b/wp-includes/feed-rss2-comments.php index 8232a0f1..74715b80 100644 --- a/wp-includes/feed-rss2-comments.php +++ b/wp-includes/feed-rss2-comments.php @@ -29,7 +29,6 @@ echo ''; - diff --git a/wp-includes/feed-rss2.php b/wp-includes/feed-rss2.php index 12286da2..538f96b7 100644 --- a/wp-includes/feed-rss2.php +++ b/wp-includes/feed-rss2.php @@ -26,7 +26,6 @@ echo ''; ?> - @@ -35,7 +34,7 @@ echo ''; ?> <?php the_title_rss() ?> - + @@ -51,7 +50,7 @@ echo ''; ?> ]]> - + diff --git a/wp-includes/feed.php b/wp-includes/feed.php index ebd392b1..1be12a45 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -186,7 +186,17 @@ function the_excerpt_rss() { * @uses apply_filters() Call 'the_permalink_rss' on the post permalink */ function the_permalink_rss() { - echo apply_filters('the_permalink_rss', get_permalink()); + echo esc_url( apply_filters('the_permalink_rss', get_permalink() )); +} + +/** + * Outputs the link to the comments for the current post in an xml safe way + * + * @since 3.0.0 + * @return none + */ +function comments_link_feed() { + echo esc_url( get_comments_link() ); } /** @@ -199,7 +209,7 @@ function the_permalink_rss() { * @param int|object $comment_id Optional comment object or id. Defaults to global comment object. */ function comment_guid($comment_id = null) { - echo get_comment_guid($comment_id); + echo esc_url( get_comment_guid($comment_id) ); } /** @@ -475,7 +485,7 @@ function prep_atom_text_construct($data) { * @since 2.5 */ function self_link() { - $host = @parse_url(get_option('home')); + $host = @parse_url(home_url()); $host = $host['host']; echo esc_url( 'http' @@ -524,7 +534,8 @@ function fetch_feed($url) { $feed->set_feed_url($url); $feed->set_cache_class('WP_Feed_Cache'); $feed->set_file_class('WP_SimplePie_File'); - $feed->set_cache_duration(apply_filters('wp_feed_cache_transient_lifetime', 43200)); + $feed->set_cache_duration(apply_filters('wp_feed_cache_transient_lifetime', 43200, $url)); + do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) ); $feed->init(); $feed->handle_content_type(); diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index dc9ed2f6..0004673c 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -33,8 +33,8 @@ function wptexturize($text) { $curl = ''; $textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); $stop = count($textarr); - - // No need to setup these variables more than once + + // No need to set up these variables more than once if (!$static_setup) { /* translators: opening curly quote */ $opening_quote = _x('“', 'opening curly quote'); @@ -53,11 +53,11 @@ function wptexturize($text) { $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause"); } - $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney); - $static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', $opening_quote, '’s', $closing_quote, ' ™'), $cockneyreplace); + $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'\'', ' (tm)'), $cockney); + $static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', $opening_quote, $closing_quote, ' ™'), $cockneyreplace); - $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|[([{<]|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/'); - $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '’$1', '$1×$2'); + $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/\'(\d+)/', '/(\s|\A|[([{<]|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/\b(\d+)x(\d+)\b/'); + $dynamic_replacements = array('’$1','’$1', '$1‘', '$1″', '$1′', '$1’$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '’$1', '$1×$2'); $static_setup = true; } @@ -74,7 +74,7 @@ function wptexturize($text) { $curl = $textarr[$i]; if ( !empty($curl) && '<' != $curl{0} && '[' != $curl{0} - && empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) { + && empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) { // This is not a tag, nor is the texturization disabled // static strings $curl = str_replace($static_characters, $static_replacements, $curl); @@ -120,7 +120,7 @@ function _wptexturize_pushpop_element($text, &$stack, $disabled_elements, $openi /* * This disables texturize until we find a closing tag of our type * (e.g.
        ) even if there was invalid nesting before that
        -			 * 
        +			 *
         			 * Example: in the case 
        sadsadasd"baba"
        * "baba" won't be texturize */ @@ -185,7 +185,7 @@ function wpautop($pee, $br = 1) { $pee = $pee . "\n"; // just to make things a little easier, pad the end $pee = preg_replace('|
        \s*
        |', "\n\n", $pee); // Space things out a little - $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend)'; + $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|input|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)'; $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee); $pee = preg_replace('!()!', "$1\n\n", $pee); $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines @@ -287,7 +287,7 @@ function seems_utf8($str) { * @param string $string The text which is to be encoded. * @param mixed $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES. * @param string $charset Optional. The character encoding of the string. Default is false. - * @param boolean $double_encode Optional. Whether or not to encode existing html entities. Default is false. + * @param boolean $double_encode Optional. Whether to encode existing html entities. Default is false. * @return string The encoded text with HTML entities. */ function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) { @@ -334,6 +334,12 @@ function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = fals // Handle double encoding ourselves if ( !$double_encode ) { $string = wp_specialchars_decode( $string, $_quote_style ); + + /* Critical */ + // The previous line decodes &phrase; into &phrase; We must guarantee that &phrase; is valid before proceeding. + $string = wp_kses_normalize_entities($string); + + // Now proceed with custom double-encoding silliness $string = preg_replace( '/&(#?x?[0-9a-z]+);/i', '|wp_entity|$1|/wp_entity|', $string ); } @@ -690,7 +696,7 @@ function sanitize_file_name( $filename ) { // long alpha string not in the extension whitelist. foreach ( (array) $parts as $part) { $filename .= '.' . $part; - + if ( preg_match("/^[a-zA-Z]{2,5}\d?$/", $part) ) { $allowed = false; foreach ( $mimes as $ext_preg => $mime_match ) { @@ -729,19 +735,45 @@ function sanitize_file_name( $filename ) { */ function sanitize_user( $username, $strict = false ) { $raw_username = $username; - $username = wp_strip_all_tags($username); + $username = wp_strip_all_tags( $username ); + $username = remove_accents( $username ); // Kill octets - $username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username); - $username = preg_replace('/&.+?;/', '', $username); // Kill entities + $username = preg_replace( '|%([a-fA-F0-9][a-fA-F0-9])|', '', $username ); + $username = preg_replace( '/&.+?;/', '', $username ); // Kill entities // If strict, reduce to ASCII for max portability. if ( $strict ) - $username = preg_replace('|[^a-z0-9 _.\-@]|i', '', $username); + $username = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $username ); // Consolidate contiguous whitespace - $username = preg_replace('|\s+|', ' ', $username); + $username = preg_replace( '|\s+|', ' ', $username ); - return apply_filters('sanitize_user', $username, $raw_username, $strict); + return apply_filters( 'sanitize_user', $username, $raw_username, $strict ); +} + +/** + * Sanitize a string key. + * + * Keys are used as internal identifiers. They should be lowercase ASCII. Dashes and underscores are allowed. + * + * @since 3.0.0 + * + * @param string $key String key + * @return string Sanitized key + */ +function sanitize_key( $key ) { + $raw_key = $key; + $key = wp_strip_all_tags($key); + // Kill octets + $key = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $key); + $key = preg_replace('/&.+?;/', '', $key); // Kill entities + + $key = preg_replace('|[^a-z0-9 _.\-@]|i', '', $key); + + // Consolidate contiguous whitespace + $key = preg_replace('|\s+|', ' ', $key); + + return apply_filters('sanitize_key', $key, $raw_key); } /** @@ -836,20 +868,21 @@ function sanitize_sql_orderby( $orderby ){ * @since 2.8.0 * * @param string $class The classname to be sanitized - * @param string $fallback The value to return if the sanitization end's up as an empty string. + * @param string $fallback Optional. The value to return if the sanitization end's up as an empty string. + * Defaults to an empty string. * @return string The sanitized value */ -function sanitize_html_class($class, $fallback){ +function sanitize_html_class( $class, $fallback = '' ) { //Strip out any % encoded octets $sanitized = preg_replace('|%[a-fA-F0-9][a-fA-F0-9]|', '', $class); //Limit to A-Z,a-z,0-9,'-' $sanitized = preg_replace('/[^A-Za-z0-9-]/', '', $sanitized); - if ('' == $sanitized) + if ( '' == $sanitized ) $sanitized = $fallback; - return apply_filters('sanitize_html_class',$sanitized, $class, $fallback); + return apply_filters( 'sanitize_html_class', $sanitized, $class, $fallback ); } /** @@ -866,6 +899,9 @@ function sanitize_html_class($class, $fallback){ * @return string Converted string. */ function convert_chars($content, $deprecated = '') { + if ( !empty( $deprecated ) ) + _deprecated_argument( __FUNCTION__, '0.71' ); + // Translation of invalid Unicode references range to valid range $wp_htmltranswinuni = array( '€' => '€', // the Euro sign @@ -919,42 +955,6 @@ function convert_chars($content, $deprecated = '') { return $content; } -/** - * Callback used to change %uXXXX to &#YYY; syntax - * - * @since 2.8? - * - * @param array $matches Single Match - * @return string An HTML entity - */ -function funky_javascript_callback($matches) { - return "&#".base_convert($matches[1],16,10).";"; -} - -/** - * Fixes javascript bugs in browsers. - * - * Converts unicode characters to HTML numbered entities. - * - * @since 1.5.0 - * @uses $is_macIE - * @uses $is_winIE - * - * @param string $text Text to be made safe. - * @return string Fixed text. - */ -function funky_javascript_fix($text) { - // Fixes for browsers' javascript bugs - global $is_macIE, $is_winIE; - - if ( $is_winIE || $is_macIE ) - $text = preg_replace_callback("/\%u([0-9A-F]{4,4})/", - "funky_javascript_callback", - $text); - - return $text; -} - /** * Will only balance the tags if forced to and the option is set to balance tags. * @@ -993,19 +993,22 @@ function balanceTags( $text, $force = false ) { * @return string Balanced text. */ function force_balance_tags( $text ) { - $tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = ''; - $single_tags = array('br', 'hr', 'img', 'input'); //Known single-entity/self-closing tags - $nestable_tags = array('blockquote', 'div', 'span'); //Tags that can be immediately nested within themselves - - # WP bug fix for comments - in case you REALLY meant to type '< !--' + $tagstack = array(); + $stacksize = 0; + $tagqueue = ''; + $newtext = ''; + $single_tags = array('br', 'hr', 'img', 'input'); // Known single-entity/self-closing tags + $nestable_tags = array('blockquote', 'div', 'span'); // Tags that can be immediately nested within themselves + + // WP bug fix for comments - in case you REALLY meant to type '< !--' $text = str_replace('< !--', '< !--', $text); - # WP bug fix for LOVE <3 (and other situations with '<' before a number) + // WP bug fix for LOVE <3 (and other situations with '<' before a number) $text = preg_replace('#<([0-9]{1})#', '<$1', $text); - while (preg_match("/<(\/?\w*)\s*([^>]*)>/",$text,$regex)) { + while ( preg_match("/<(\/?[\w:]*)\s*([^>]*)>/", $text, $regex) ) { $newtext .= $tagqueue; - $i = strpos($text,$regex[0]); + $i = strpos($text, $regex[0]); $l = strlen($regex[0]); // clear the shifter @@ -1014,22 +1017,22 @@ function force_balance_tags( $text ) { if ( isset($regex[1][0]) && '/' == $regex[1][0] ) { // End Tag $tag = strtolower(substr($regex[1],1)); // if too many closing tags - if($stacksize <= 0) { + if( $stacksize <= 0 ) { $tag = ''; - //or close to be safe $tag = '/' . $tag; + // or close to be safe $tag = '/' . $tag; } // if stacktop value = tag close value then pop - else if ($tagstack[$stacksize - 1] == $tag) { // found closing tag + else if ( $tagstack[$stacksize - 1] == $tag ) { // found closing tag $tag = ''; // Close Tag // Pop - array_pop ($tagstack); + array_pop( $tagstack ); $stacksize--; } else { // closing tag not at top, search for it - for ($j=$stacksize-1;$j>=0;$j--) { - if ($tagstack[$j] == $tag) { + for ( $j = $stacksize-1; $j >= 0; $j-- ) { + if ( $tagstack[$j] == $tag ) { // add tag to tagqueue - for ($k=$stacksize-1;$k>=$j;$k--){ - $tagqueue .= ''; + for ( $k = $stacksize-1; $k >= $j; $k--) { + $tagqueue .= ''; $stacksize--; } break; @@ -1043,14 +1046,15 @@ function force_balance_tags( $text ) { // Tag Cleaning // If self-closing or '', don't do anything. - if((substr($regex[2],-1) == '/') || ($tag == '')) { + if ( substr($regex[2],-1) == '/' || $tag == '' ) { + // do nothing } // ElseIf it's a known single-entity tag but it doesn't close itself, do so elseif ( in_array($tag, $single_tags) ) { $regex[2] .= '/'; } else { // Push the tag onto the stack // If the top of the stack is the same as the tag we want to push, close previous tag - if (($stacksize > 0) && !in_array($tag, $nestable_tags) && ($tagstack[$stacksize - 1] == $tag)) { + if ( $stacksize > 0 && !in_array($tag, $nestable_tags) && $tagstack[$stacksize - 1] == $tag ) { $tagqueue = ''; $stacksize--; } @@ -1059,18 +1063,18 @@ function force_balance_tags( $text ) { // Attributes $attributes = $regex[2]; - if($attributes) { + if( !empty($attributes) ) $attributes = ' '.$attributes; - } - $tag = '<'.$tag.$attributes.'>'; + + $tag = '<' . $tag . $attributes . '>'; //If already queuing a close tag, then put this tag on, too - if ($tagqueue) { + if ( !empty($tagqueue) ) { $tagqueue .= $tag; $tag = ''; } } - $newtext .= substr($text,0,$i) . $tag; - $text = substr($text,$i+$l); + $newtext .= substr($text, 0, $i) . $tag; + $text = substr($text, $i + $l); } // Clear Tag Queue @@ -1080,9 +1084,8 @@ function force_balance_tags( $text ) { $newtext .= $text; // Empty Stack - while($x = array_pop($tagstack)) { + while( $x = array_pop($tagstack) ) $newtext .= ''; // Add remaining tags to close - } // WP fix for the bug with HTML comments $newtext = str_replace("< !--"," @@ -2604,9 +2816,7 @@ function _config_wp_siteurl( $url = '' ) { * @return array Direction set for 'rtl', if needed by locale. */ function _mce_set_direction( $input ) { - global $wp_locale; - - if ( 'rtl' == $wp_locale->text_direction ) { + if ( is_rtl() ) { $input['directionality'] = 'rtl'; $input['plugins'] .= ',directionality'; $input['theme_advanced_buttons1'] .= ',ltr'; @@ -2752,13 +2962,67 @@ function wp_parse_args( $args, $defaults = '' ) { return $r; } +/** + * Clean up an array, comma- or space-separated list of IDs + * + * @since 3.0.0 + * + * @param array|string $list + * @return array Sanitized array of IDs + */ +function wp_parse_id_list( $list ) { + if ( !is_array($list) ) + $list = preg_split('/[\s,]+/', $list); + + return array_unique(array_map('absint', $list)); +} + +/** + * Filters a list of objects, based on a set of key => value arguments + * + * @since 3.0.0 + * + * @param array $list An array of objects to filter + * @param array $args An array of key => value arguments to match against each object + * @param string $operator The logical operation to perform. 'or' means only one element + * from the array needs to match; 'and' means all elements must match. The default is 'and'. + * @param bool|string $field A field from the object to place instead of the entire object + * @return array A list of objects or object fields + */ +function wp_filter_object_list( $list, $args = array(), $operator = 'and', $field = false ) { + if ( !is_array($list) ) + return array(); + + if ( empty($args) ) + $args = array(); + + if ( empty($args) && !$field ) + return $list; // nothing to do + + $count = count($args); + + $filtered = array(); + + foreach ( $list as $key => $obj ) { + $matched = count(array_intersect_assoc(get_object_vars($obj), $args)); + if ( ('and' == $operator && $matched == $count) || ('or' == $operator && $matched <= $count) ) { + if ( $field ) + $filtered[] = $obj->$field; + else + $filtered[$key] = $obj; + } + } + + return $filtered; +} + /** * Determines if default embed handlers should be loaded. * * Checks to make sure that the embeds library hasn't already been loaded. If * it hasn't, then it will load the embeds library. * - * @since 2.9 + * @since 2.9.0 */ function wp_maybe_load_embeds() { if ( ! apply_filters('load_default_embeds', true) ) @@ -2790,7 +3054,7 @@ function wp_maybe_load_widgets() { */ function wp_widgets_add_menu() { global $submenu; - $submenu['themes.php'][7] = array( __( 'Widgets' ), 'switch_themes', 'widgets.php' ); + $submenu['themes.php'][7] = array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' ); ksort( $submenu['themes.php'], SORT_NUMERIC ); } @@ -2895,7 +3159,8 @@ function absint( $maybeint ) { * * @since 2.5.0 * - * @return bool Whether or not SSL access is available + * @param string $url + * @return bool Whether SSL access is available */ function url_is_accessable_via_ssl($url) { @@ -2949,24 +3214,26 @@ function atom_service_url_filter($url) * This function is to be used in every function in depreceated.php * * @package WordPress - * @package Debug + * @subpackage Debug * @since 2.5.0 * @access private * - * @uses do_action() Calls 'deprecated_function_run' and passes the function name and what to use instead. - * @uses apply_filters() Calls 'deprecated_function_trigger_error' and expects boolean value of true to do trigger or false to not trigger error. + * @uses do_action() Calls 'deprecated_function_run' and passes the function name, what to use instead, + * and the version the function was deprecated in. + * @uses apply_filters() Calls 'deprecated_function_trigger_error' and expects boolean value of true to do + * trigger or false to not trigger error. * * @param string $function The function that was called * @param string $version The version of WordPress that deprecated the function * @param string $replacement Optional. The function that should have been called */ -function _deprecated_function($function, $version, $replacement=null) { +function _deprecated_function( $function, $version, $replacement=null ) { - do_action('deprecated_function_run', $function, $replacement); + do_action( 'deprecated_function_run', $function, $replacement, $version ); // Allow plugin to filter the output error trigger - if( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true )) { - if( !is_null($replacement) ) + if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) { + if ( ! is_null($replacement) ) trigger_error( sprintf( __('%1$s is deprecated since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) ); else trigger_error( sprintf( __('%1$s is deprecated since version %2$s with no alternative available.'), $function, $version ) ); @@ -2985,27 +3252,75 @@ function _deprecated_function($function, $version, $replacement=null) { * This function is to be used in every file that is depreceated * * @package WordPress - * @package Debug + * @subpackage Debug * @since 2.5.0 * @access private * - * @uses do_action() Calls 'deprecated_file_included' and passes the file name and what to use instead. - * @uses apply_filters() Calls 'deprecated_file_trigger_error' and expects boolean value of true to do trigger or false to not trigger error. + * @uses do_action() Calls 'deprecated_file_included' and passes the file name, what to use instead, + * the version in which the file was deprecated, and any message regarding the change. + * @uses apply_filters() Calls 'deprecated_file_trigger_error' and expects boolean value of true to do + * trigger or false to not trigger error. * * @param string $file The file that was included - * @param string $version The version of WordPress that deprecated the function - * @param string $replacement Optional. The function that should have been called + * @param string $version The version of WordPress that deprecated the file + * @param string $replacement Optional. The file that should have been included based on ABSPATH + * @param string $message Optional. A message regarding the change + */ +function _deprecated_file( $file, $version, $replacement = null, $message = '' ) { + + do_action( 'deprecated_file_included', $file, $replacement, $version, $message ); + + // Allow plugin to filter the output error trigger + if ( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) { + $message = empty( $message ) ? '' : ' ' . $message; + if ( ! is_null( $replacement ) ) + trigger_error( sprintf( __('%1$s is deprecated since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message ); + else + trigger_error( sprintf( __('%1$s is deprecated since version %2$s with no alternative available.'), $file, $version ) . $message ); + } +} +/** + * Marks a function argument as deprecated and informs when it has been used. + * + * This function is to be used whenever a deprecated function argument is used. + * Before this function is called, the argument must be checked for whether it was + * used by comparing it to its default value or evaluating whether it is empty. + * For example: + * + * if ( !empty($deprecated) ) + * _deprecated_argument( __FUNCTION__, '3.0' ); + * + * + * There is a hook deprecated_argument_run that will be called that can be used + * to get the backtrace up to what file and function used the deprecated + * argument. + * + * The current behavior is to trigger an user error if WP_DEBUG is true. + * + * @package WordPress + * @subpackage Debug + * @since 3.0.0 + * @access private + * + * @uses do_action() Calls 'deprecated_argument_run' and passes the function name, a message on the change, + * and the version in which the argument was deprecated. + * @uses apply_filters() Calls 'deprecated_argument_trigger_error' and expects boolean value of true to do + * trigger or false to not trigger error. + * + * @param string $function The function that was called + * @param string $version The version of WordPress that deprecated the argument used + * @param string $message Optional. A message regarding the change. */ -function _deprecated_file($file, $version, $replacement=null) { +function _deprecated_argument( $function, $version, $message = null ) { - do_action('deprecated_file_included', $file, $replacement); + do_action( 'deprecated_argument_run', $function, $message, $version ); // Allow plugin to filter the output error trigger - if( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) { - if( !is_null($replacement) ) - trigger_error( sprintf( __('%1$s is deprecated since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) ); + if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) { + if ( ! is_null( $message ) ) + trigger_error( sprintf( __('%1$s was called with an argument that is deprecated since version %2$s! %3$s'), $function, $version, $message ) ); else - trigger_error( sprintf( __('%1$s is deprecated since version %2$s with no alternative available.'), $file, $version ) ); + trigger_error( sprintf( __('%1$s was called with an argument that is deprecated since version %2$s with no alternative available.'), $function, $version ) ); } } @@ -3154,7 +3469,7 @@ function wp_guess_url() { if ( defined('WP_SITEURL') && '' != WP_SITEURL ) { $url = WP_SITEURL; } else { - $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; + $schema = is_ssl() ? 'https://' : 'http://'; $url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); } return $url; @@ -3180,59 +3495,222 @@ function wp_suspend_cache_invalidation($suspend = true) { return $current_suspend; } -function get_site_option( $key, $default = false, $use_cache = true ) { +/** + * Retrieve site option value based on name of option. + * + * @see get_option() + * @package WordPress + * @subpackage Option + * @since 2.8.0 + * + * @uses apply_filters() Calls 'pre_site_option_$option' before checking the option. + * Any value other than false will "short-circuit" the retrieval of the option + * and return the returned value. + * @uses apply_filters() Calls 'site_option_$option', after checking the option, with + * the option value. + * + * @param string $option Name of option to retrieve. Expected to not be SQL-escaped. + * @param mixed $default Optional value to return if option doesn't exist. Default false. + * @param bool $use_cache Whether to use cache. Multisite only. Default true. + * @return mixed Value set for the option. + */ +function get_site_option( $option, $default = false, $use_cache = true ) { + global $wpdb; + // Allow plugins to short-circuit site options. - $pre = apply_filters( 'pre_site_option_' . $key, false ); + $pre = apply_filters( 'pre_site_option_' . $option, false ); if ( false !== $pre ) return $pre; - $value = get_option($key, $default); + if ( !is_multisite() ) { + $value = get_option($option, $default); + } else { + $cache_key = "{$wpdb->siteid}:$option"; + if ( $use_cache ) + $value = wp_cache_get($cache_key, 'site-options'); + + if ( !isset($value) || (false === $value) ) { + $row = $wpdb->get_row( $wpdb->prepare("SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) ); - return apply_filters( 'site_option_' . $key, $value ); + // Has to be get_row instead of get_var because of funkiness with 0, false, null values + if ( is_object( $row ) ) + $value = $row->meta_value; + else + $value = $default; + + $value = maybe_unserialize( $value ); + + wp_cache_set( $cache_key, $value, 'site-options' ); + } + } + + return apply_filters( 'site_option_' . $option, $value ); } -// expects $key, $value not to be SQL escaped -function add_site_option( $key, $value ) { - $value = apply_filters( 'pre_add_site_option_' . $key, $value ); - $result = add_option($key, $value); - do_action( "add_site_option_{$key}", $key, $value ); +/** + * Add a new site option. + * + * @see add_option() + * @package WordPress + * @subpackage Option + * @since 2.8.0 + * + * @uses apply_filters() Calls 'pre_add_site_option_$option' hook to allow overwriting the + * option value to be stored. + * @uses do_action() Calls 'add_site_option_$option' and 'add_site_option' hooks on success. + * + * @param string $option Name of option to add. Expected to not be SQL-escaped. + * @param mixed $value Optional. Option value, can be anything. Expected to not be SQL-escaped. + * @return bool False if option was not added and true if option was added. + */ +function add_site_option( $option, $value ) { + global $wpdb; + + $value = apply_filters( 'pre_add_site_option_' . $option, $value ); + + if ( !is_multisite() ) { + $result = add_option( $option, $value ); + } else { + $cache_key = "{$wpdb->siteid}:$option"; + + if ( $wpdb->get_row( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) ) ) + return update_site_option( $option, $value ); + + $value = sanitize_option( $option, $value ); + wp_cache_set( $cache_key, $value, 'site-options' ); + + $_value = $value; + $value = maybe_serialize($value); + $result = $wpdb->insert( $wpdb->sitemeta, array('site_id' => $wpdb->siteid, 'meta_key' => $option, 'meta_value' => $value ) ); + $value = $_value; + } + + do_action( "add_site_option_{$option}", $option, $value ); + do_action( "add_site_option", $option, $value ); + return $result; } -function delete_site_option( $key ) { - $result = delete_option($key); - do_action( "delete_site_option_{$key}", $key ); - return $result; +/** + * Removes site option by name. + * + * @see delete_option() + * @package WordPress + * @subpackage Option + * @since 2.8.0 + * + * @uses do_action() Calls 'pre_delete_site_option_$option' hook before option is deleted. + * @uses do_action() Calls 'delete_site_option' and 'delete_site_option_$option' + * hooks on success. + * + * @param string $option Name of option to remove. Expected to not be SQL-escaped. + * @return bool True, if succeed. False, if failure. + */ +function delete_site_option( $option ) { + global $wpdb; + + // ms_protect_special_option( $option ); @todo + + do_action( 'pre_delete_site_option_' . $option ); + + if ( !is_multisite() ) { + $result = delete_option( $option ); + } else { + $row = $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM {$wpdb->sitemeta} WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) ); + if ( is_null( $row ) || !$row->meta_id ) + return false; + $cache_key = "{$wpdb->siteid}:$option"; + wp_cache_delete( $cache_key, 'site-options' ); + + $result = $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->sitemeta} WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) ); + } + + if ( $result ) { + do_action( "delete_site_option_{$option}", $option ); + do_action( "delete_site_option", $option ); + return true; + } + return false; } -// expects $key, $value not to be SQL escaped -function update_site_option( $key, $value ) { - $oldvalue = get_site_option( $key ); - $value = apply_filters( 'pre_update_site_option_' . $key, $value, $oldvalue ); - $result = update_option($key, $value); - do_action( "update_site_option_{$key}", $key, $value ); - return $result; +/** + * Update the value of a site option that was already added. + * + * @see update_option() + * @since 2.8.0 + * @package WordPress + * @subpackage Option + * + * @uses apply_filters() Calls 'pre_update_site_option_$option' hook to allow overwriting the + * option value to be stored. + * @uses do_action() Calls 'update_site_option_$option' and 'update_site_option' hooks on success. + * + * @param string $option Name of option. Expected to not be SQL-escaped. + * @param mixed $value Option value. Expected to not be SQL-escaped. + * @return bool False if value was not updated and true if value was updated. + */ +function update_site_option( $option, $value ) { + global $wpdb; + + $oldvalue = get_site_option( $option ); + $value = apply_filters( 'pre_update_site_option_' . $option, $value, $oldvalue ); + + if ( $value === $oldvalue ) + return false; + + if ( !is_multisite() ) { + $result = update_option( $option, $value ); + } else { + $cache_key = "{$wpdb->siteid}:$option"; + + if ( $value && !$wpdb->get_row( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", $option, $wpdb->siteid ) ) ) + return add_site_option( $option, $value ); + $value = sanitize_option( $option, $value ); + wp_cache_set( $cache_key, $value, 'site-options' ); + + $_value = $value; + $value = maybe_serialize( $value ); + $result = $wpdb->update( $wpdb->sitemeta, array( 'meta_value' => $value ), array( 'site_id' => $wpdb->siteid, 'meta_key' => $option ) ); + $value = $_value; + } + + if ( $result ) { + do_action( "update_site_option_{$option}", $option, $value ); + do_action( "update_site_option", $option, $value ); + return true; + } + return false; } /** * Delete a site transient * - * @since 2.890 + * @since 2.9.0 * @package WordPress * @subpackage Transient * - * @param string $transient Transient name. Expected to not be SQL-escaped - * @return bool true if successful, false otherwise + * @uses do_action() Calls 'delete_site_transient_$transient' hook before transient is deleted. + * @uses do_action() Calls 'deleted_site_transient' hook on success. + * + * @param string $transient Transient name. Expected to not be SQL-escaped. + * @return bool True if successful, false otherwise */ -function delete_site_transient($transient) { - global $_wp_using_ext_object_cache, $wpdb; +function delete_site_transient( $transient ) { + global $_wp_using_ext_object_cache; + do_action( 'delete_site_transient_' . $transient, $transient ); if ( $_wp_using_ext_object_cache ) { - return wp_cache_delete($transient, 'site-transient'); + $result = wp_cache_delete( $transient, 'site-transient' ); } else { - $transient = '_site_transient_' . esc_sql($transient); - return delete_site_option($transient); + $option_timeout = '_site_transient_timeout_' . $transient; + $option = '_site_transient_' . $transient; + $result = delete_site_option( $option ); + if ( $result ) + delete_site_option( $option_timeout ); } + if ( $result ) + do_action( 'deleted_site_transient', $transient ); + return $result; } /** @@ -3240,36 +3718,48 @@ function delete_site_transient($transient) { * * If the transient does not exist or does not have a value, then the return value * will be false. - * + * + * @see get_transient() * @since 2.9.0 * @package WordPress * @subpackage Transient * - * @param string $transient Transient name. Expected to not be SQL-escaped + * @uses apply_filters() Calls 'pre_site_transient_$transient' hook before checking the transient. + * Any value other than false will "short-circuit" the retrieval of the transient + * and return the returned value. + * @uses apply_filters() Calls 'site_transient_$option' hook, after checking the transient, with + * the transient value. + * + * @param string $transient Transient name. Expected to not be SQL-escaped. * @return mixed Value of transient */ -function get_site_transient($transient) { - global $_wp_using_ext_object_cache, $wpdb; +function get_site_transient( $transient ) { + global $_wp_using_ext_object_cache; $pre = apply_filters( 'pre_site_transient_' . $transient, false ); if ( false !== $pre ) return $pre; if ( $_wp_using_ext_object_cache ) { - $value = wp_cache_get($transient, 'site-transient'); + $value = wp_cache_get( $transient, 'site-transient' ); } else { - $transient_option = '_site_transient_' . esc_sql($transient); - $transient_timeout = '_site_transient_timeout_' . esc_sql($transient); - if ( get_site_option($transient_timeout) < time() ) { - delete_site_option($transient_option); - delete_site_option($transient_timeout); - return false; + // Core transients that do not have a timeout. Listed here so querying timeouts can be avoided. + $no_timeout = array('update_core', 'update_plugins', 'update_themes'); + $transient_option = '_site_transient_' . $transient; + if ( ! in_array( $transient, $no_timeout ) ) { + $transient_timeout = '_site_transient_timeout_' . $transient; + $timeout = get_site_option( $transient_timeout ); + if ( false !== $timeout && $timeout < time() ) { + delete_site_option( $transient_option ); + delete_site_option( $transient_timeout ); + return false; + } } - $value = get_site_option($transient_option); + $value = get_site_option( $transient_option ); } - return apply_filters('site_transient_' . $transient, $value); + return apply_filters( 'site_transient_' . $transient, $value ); } /** @@ -3278,40 +3768,101 @@ function get_site_transient($transient) { * You do not need to serialize values, if the value needs to be serialize, then * it will be serialized before it is set. * + * @see set_transient() * @since 2.9.0 * @package WordPress * @subpackage Transient * - * @param string $transient Transient name. Expected to not be SQL-escaped - * @param mixed $value Transient value. + * @uses apply_filters() Calls 'pre_set_site_transient_$transient' hook to allow overwriting the + * transient value to be stored. + * @uses do_action() Calls 'set_site_transient_$transient' and 'setted_site_transient' hooks on success. + * + * @param string $transient Transient name. Expected to not be SQL-escaped. + * @param mixed $value Transient value. Expected to not be SQL-escaped. * @param int $expiration Time until expiration in seconds, default 0 * @return bool False if value was not set and true if value was set. */ -function set_site_transient($transient, $value, $expiration = 0) { - global $_wp_using_ext_object_cache, $wpdb; +function set_site_transient( $transient, $value, $expiration = 0 ) { + global $_wp_using_ext_object_cache; + + $value = apply_filters( 'pre_set_site_transient_' . $transient, $value ); if ( $_wp_using_ext_object_cache ) { - return wp_cache_set($transient, $value, 'site-transient', $expiration); + $result = wp_cache_set( $transient, $value, 'site-transient', $expiration ); } else { $transient_timeout = '_site_transient_timeout_' . $transient; $transient = '_site_transient_' . $transient; - $safe_transient = esc_sql($transient); - if ( false === get_site_option( $safe_transient ) ) { - if ( 0 != $expiration ) - add_site_option($transient_timeout, time() + $expiration); - return add_site_option($transient, $value); + if ( false === get_site_option( $transient ) ) { + if ( $expiration ) + add_site_option( $transient_timeout, time() + $expiration ); + $result = add_site_option( $transient, $value ); } else { - if ( 0 != $expiration ) - update_site_option($transient_timeout, time() + $expiration); - return update_site_option($transient, $value); + if ( $expiration ) + update_site_option( $transient_timeout, time() + $expiration ); + $result = update_site_option( $transient, $value ); } } + if ( $result ) { + do_action( 'set_site_transient_' . $transient ); + do_action( 'setted_site_transient', $transient ); + } + return $result; +} + +/** + * is main site + * + * + * @since 3.0.0 + * @package WordPress + * + * @param int $blog_id optional blog id to test (default current blog) + * @return bool True if not multisite or $blog_id is main site + */ +function is_main_site( $blog_id = '' ) { + global $current_site, $current_blog; + + if ( !is_multisite() ) + return true; + + if ( !$blog_id ) + $blog_id = $current_blog->blog_id; + + return $blog_id == $current_site->blog_id; +} + +/** + * Whether global terms are enabled. + * + * + * @since 3.0.0 + * @package WordPress + * + * @return bool True if multisite and global terms enabled + */ +function global_terms_enabled() { + if ( ! is_multisite() ) + return false; + + static $global_terms = null; + if ( is_null( $global_terms ) ) { + $filter = apply_filters( 'global_terms_enabled', null ); + if ( ! is_null( $filter ) ) + $global_terms = (bool) $filter; + else + $global_terms = (bool) get_site_option( 'global_terms_enabled', false ); + } + return $global_terms; } /** * gmt_offset modification for smart timezone handling * * Overrides the gmt_offset option if we have a timezone_string available + * + * @since 2.8.0 + * + * @return float|bool */ function wp_timezone_override_offset() { if ( !wp_timezone_supported() ) { @@ -3321,7 +3872,6 @@ function wp_timezone_override_offset() { return false; } - @date_default_timezone_set( $timezone_string ); $timezone_object = timezone_open( $timezone_string ); $datetime_object = date_create(); if ( false === $timezone_object || false === $datetime_object ) { @@ -3332,10 +3882,15 @@ function wp_timezone_override_offset() { /** * Check for PHP timezone support + * + * @since 2.9.0 + * + * @return bool */ function wp_timezone_supported() { $support = false; if ( + function_exists( 'date_create' ) && function_exists( 'date_default_timezone_set' ) && function_exists( 'timezone_identifiers_list' ) && function_exists( 'timezone_open' ) && @@ -3346,6 +3901,15 @@ function wp_timezone_supported() { return apply_filters( 'timezone_support', $support ); } +/** + * {@internal Missing Short Description}} + * + * @since 2.9.0 + * + * @param unknown_type $a + * @param unknown_type $b + * @return int + */ function _wp_timezone_choice_usort_callback( $a, $b ) { // Don't use translated versions of Etc if ( 'Etc' === $a['continent'] && 'Etc' === $b['continent'] ) { @@ -3387,8 +3951,10 @@ function _wp_timezone_choice_usort_callback( $a, $b ) { /** * Gives a nicely formatted list of timezone strings // temporary! Not in final * - * @param $selected_zone string Selected Zone + * @since 2.9.0 * + * @param string $selected_zone Selected Zone + * @return string */ function wp_timezone_choice( $selected_zone ) { static $mo_loaded = false; @@ -3412,13 +3978,13 @@ function wp_timezone_choice( $selected_zone ) { // This determines what gets set and translated - we don't translate Etc/* strings here, they are done later $exists = array( - 0 => ( isset( $zone[0] ) && $zone[0] ) ? true : false, - 1 => ( isset( $zone[1] ) && $zone[1] ) ? true : false, - 2 => ( isset( $zone[2] ) && $zone[2] ) ? true : false + 0 => ( isset( $zone[0] ) && $zone[0] ), + 1 => ( isset( $zone[1] ) && $zone[1] ), + 2 => ( isset( $zone[2] ) && $zone[2] ), ); - $exists[3] = ( $exists[0] && 'Etc' !== $zone[0] ) ? true : false; - $exists[4] = ( $exists[1] && $exists[3] ) ? true : false; - $exists[5] = ( $exists[2] && $exists[3] ) ? true : false; + $exists[3] = ( $exists[0] && 'Etc' !== $zone[0] ); + $exists[4] = ( $exists[1] && $exists[3] ); + $exists[5] = ( $exists[2] && $exists[3] ); $zonen[] = array( 'continent' => ( $exists[0] ? $zone[0] : '' ), @@ -3504,7 +4070,7 @@ function wp_timezone_choice( $selected_zone ) { if ( $offset_value === $selected_zone ) $selected = 'selected="selected" '; $structure[] = '"; - + } $structure[] = ''; @@ -3515,8 +4081,11 @@ function wp_timezone_choice( $selected_zone ) { * Strip close comment and close php tags from file headers used by WP * See http://core.trac.wordpress.org/ticket/8497 * - * @since 2.8 -**/ + * @since 2.8.0 + * + * @param string $str + * @return string + */ function _cleanup_header_comment($str) { return trim(preg_replace("/\s*(?:\*\/|\?>).*/", '', $str)); } @@ -3525,8 +4094,6 @@ function _cleanup_header_comment($str) { * Permanently deletes posts, pages, attachments, and comments which have been in the trash for EMPTY_TRASH_DAYS. * * @since 2.9.0 - * - * @return void */ function wp_scheduled_delete() { global $wpdb; @@ -3571,7 +4138,7 @@ function wp_scheduled_delete() { /** * Parse the file contents to retrieve its metadata. * - * Searches for metadata for a file, such as a plugin or theme. Each piece of + * Searches for metadata for a file, such as a plugin or theme. Each piece of * metadata must be on its own line. For a field spanning multple lines, it * must not have any newlines or only parts of it will be displayed. * @@ -3591,7 +4158,7 @@ function wp_scheduled_delete() { * * @param string $file Path to the file * @param bool $markup If the returned data should have HTML markup applied - * @param string $context If specified adds filter hook "extra_<$context>_headers" + * @param string $context If specified adds filter hook "extra_<$context>_headers" */ function get_file_data( $file, $default_headers, $context = '' ) { // We don't need to write to the file, so just open for reading. @@ -3603,7 +4170,7 @@ function get_file_data( $file, $default_headers, $context = '' ) { // PHP will close file handle, but we are good citizens. fclose( $fp ); - if( $context != '' ) { + if ( $context != '' ) { $extra_headers = apply_filters( "extra_$context".'_headers', array() ); $extra_headers = array_flip( $extra_headers ); @@ -3615,7 +4182,7 @@ function get_file_data( $file, $default_headers, $context = '' ) { $all_headers = $default_headers; } - + foreach ( $all_headers as $field => $regex ) { preg_match( '/' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field}); if ( !empty( ${$field} ) ) @@ -3625,16 +4192,109 @@ function get_file_data( $file, $default_headers, $context = '' ) { } $file_data = compact( array_keys( $all_headers ) ); - + return $file_data; } /* * Used internally to tidy up the search terms - * - * @private + * + * @access private * @since 2.9.0 + * + * @param string $t + * @return string */ function _search_terms_tidy($t) { return trim($t, "\"'\n\r "); } + +/** + * Returns true + * + * Useful for returning true to filters easily + * + * @since 3.0.0 + * @see __return_false() + * @return bool true + */ +function __return_true() { + return true; +} + +/** + * Returns false + * + * Useful for returning false to filters easily + * + * @since 3.0.0 + * @see __return_true() + * @return bool false + */ +function __return_false() { + return false; +} + +/** + * Returns 0 + * + * Useful for returning 0 to filters easily + * + * @since 3.0.0 + * @see __return_zero() + * @return int 0 + */ +function __return_zero() { + return 0; +} + +/** + * Returns an empty array + * + * Useful for returning an empty array to filters easily + * + * @since 3.0.0 + * @see __return_zero() + * @return array Empty array + */ +function __return_empty_array() { + return array(); +} + +/** + * Send a HTTP header to disable content type sniffing in browsers which support it. + * + * @link http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx + * @link http://src.chromium.org/viewvc/chrome?view=rev&revision=6985 + * + * @since 3.0.0 + * @return none + */ +function send_nosniff_header() { + @header( 'X-Content-Type-Options: nosniff' ); +} + +/** + * Returns a MySQL expression for selecting the week number based on the start_of_week option. + * + * @internal + * @since 3.0.0 + * @param string $column + * @return string + */ +function _wp_mysql_week( $column ) { + switch ( $start_of_week = (int) get_option( 'start_of_week' ) ) { + default : + case 0 : + return "WEEK( $column, 0 )"; + case 1 : + return "WEEK( $column, 1 )"; + case 2 : + case 3 : + case 4 : + case 5 : + case 6 : + return "WEEK( DATE_SUB( $column, INTERVAL $start_of_week DAY ), 0 )"; + } +} + ?> diff --git a/wp-includes/functions.wp-scripts.php b/wp-includes/functions.wp-scripts.php index 0a60c968..f284435e 100644 --- a/wp-includes/functions.wp-scripts.php +++ b/wp-includes/functions.wp-scripts.php @@ -38,7 +38,12 @@ function wp_print_scripts( $handles = false ) { * Register new JavaScript file. * * @since r16 - * @see WP_Dependencies::add() For parameter information. + * @param string $handle Script name + * @param string $src Script url + * @param array $deps (optional) Array of script names on which this script depends + * @param string|bool $ver (optional) Script version (used for cache busting), set to NULL to disable + * @param bool (optional) Wether to enqueue the script before or before + * @return null */ function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) { global $wp_scripts; @@ -56,7 +61,7 @@ function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_f * Localizes only if script has already been added. * * @since r16 - * @see WP_Script::localize() + * @see WP_Scripts::localize() */ function wp_localize_script( $handle, $object_name, $l10n ) { global $wp_scripts; @@ -86,8 +91,8 @@ function wp_deregister_script( $handle ) { * Registers the script if src provided (does NOT overwrite) and enqueues. * * @since r16 - * @see WP_Script::add(), WP_Script::enqueue() -*/ + * @see wp_register_script() For parameter information. + */ function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) { global $wp_scripts; if ( !is_a($wp_scripts, 'WP_Scripts') ) diff --git a/wp-includes/functions.wp-styles.php b/wp-includes/functions.wp-styles.php index 5251bdaa..df4bd5ac 100644 --- a/wp-includes/functions.wp-styles.php +++ b/wp-includes/functions.wp-styles.php @@ -13,7 +13,8 @@ * @uses do_action() Calls 'wp_print_styles' hook. * @global object $wp_styles The WP_Styles object for printing styles. * - * @param array $handles (optional) Styles to be printed. (void) prints queue, (string) prints that style, (array of strings) prints those styles. + * @param array|bool $handles Styles to be printed. An empty array prints the queue, + * an array with one string prints that style, and an array of strings prints those styles. * @return bool True on success, false on failure. */ function wp_print_styles( $handles = false ) { @@ -36,7 +37,17 @@ function wp_print_styles( $handles = false ) { * Register CSS style file. * * @since r79 - * @see WP_Styles::add() For parameter and additional information. + * @see WP_Styles::add() For additional information. + * @global object $wp_styles The WP_Styles object for printing styles. + * @link http://www.w3.org/TR/CSS2/media.html#media-types List of CSS media types. + * + * @param string $handle Name of the stylesheet. + * @param string|bool $src Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'. + * @param array $deps Array of handles of any stylesheet that this stylesheet depends on. + * (Stylesheets that must be loaded before this stylesheet.) Pass an empty array if there are no dependencies. + * @param string|bool $ver String specifying the stylesheet version number. Set to NULL to disable. + * Used to ensure that the correct version is sent to the client regardless of caching. + * @param string $media The media for which this stylesheet has been defined. */ function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' ) { global $wp_styles; @@ -50,7 +61,10 @@ function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media * Remove a registered CSS file. * * @since r79 - * @see WP_Styles::remove() For parameter and additional information. + * @see WP_Styles::remove() For additional information. + * @global object $wp_styles The WP_Styles object for printing styles. + * + * @param string $handle Name of the stylesheet. */ function wp_deregister_style( $handle ) { global $wp_styles; @@ -63,10 +77,23 @@ function wp_deregister_style( $handle ) { /** * Enqueue a CSS style file. * + * Registers the style if src provided (does NOT overwrite) and enqueues. + * * @since r79 * @see WP_Styles::add(), WP_Styles::enqueue() + * @global object $wp_styles The WP_Styles object for printing styles. + * @link http://www.w3.org/TR/CSS2/media.html#media-types List of CSS media types. + * + * @param string $handle Name of the stylesheet. + * @param string|bool $src Path to the stylesheet from the root directory of WordPress. Example: '/css/mystyle.css'. + * @param array $deps Array of handles (names) of any stylesheet that this stylesheet depends on. + * (Stylesheets that must be loaded before this stylesheet.) Pass an empty array if there are no dependencies. + * @param string|bool $ver String specifying the stylesheet version number, if it has one. This parameter + * is used to ensure that the correct version is sent to the client regardless of caching, and so should be included + * if a version number is available and makes sense for the stylesheet. + * @param string $media The media for which this stylesheet has been defined. */ -function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = false ) { +function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = 'all' ) { global $wp_styles; if ( !is_a($wp_styles, 'WP_Styles') ) $wp_styles = new WP_Styles(); @@ -81,14 +108,14 @@ function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, /** * Check whether style has been added to WordPress Styles. * - * The values for list defaults to 'queue', which is the same as enqueue for - * styles. + * The values for list defaults to 'queue', which is the same as wp_enqueue_style(). * * @since WP unknown; BP unknown + * @global object $wp_styles The WP_Styles object for printing styles. * - * @param string $handle Handle used to add style. - * @param string $list Optional, defaults to 'queue'. Others values are 'registered', 'queue', 'done', 'to_do' - * @return bool + * @param string $handle Name of the stylesheet. + * @param string $list Values are 'registered', 'done', 'queue' and 'to_do'. + * @return bool True on success, false on failure. */ function wp_style_is( $handle, $list = 'queue' ) { global $wp_styles; diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index e6166874..b3712425 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -10,8 +10,7 @@ * Load header template. * * Includes the header template for a theme or if a name is specified then a - * specialised header will be included. If the theme contains no header.php file - * then the header from the default theme will be included. + * specialised header will be included. * * For the parameter, if the file is called "header-special.php" then specify * "special". @@ -31,16 +30,16 @@ function get_header( $name = null ) { $templates[] = "header.php"; + // Backward compat code will be removed in a future release if ('' == locate_template($templates, true)) - load_template( get_theme_root() . '/default/header.php'); + load_template( WPINC . '/theme-compat/header.php'); } /** * Load footer template. * * Includes the footer template for a theme or if a name is specified then a - * specialised footer will be included. If the theme contains no footer.php file - * then the footer from the default theme will be included. + * specialised footer will be included. * * For the parameter, if the file is called "footer-special.php" then specify * "special". @@ -60,16 +59,16 @@ function get_footer( $name = null ) { $templates[] = "footer.php"; + // Backward compat code will be removed in a future release if ('' == locate_template($templates, true)) - load_template( get_theme_root() . '/default/footer.php'); + load_template( WPINC . '/theme-compat/footer.php'); } /** * Load sidebar template. * * Includes the sidebar template for a theme or if a name is specified then a - * specialised sidebar will be included. If the theme contains no sidebar.php - * file then the sidebar from the default theme will be included. + * specialised sidebar will be included. * * For the parameter, if the file is called "sidebar-special.php" then specify * "special". @@ -89,8 +88,44 @@ function get_sidebar( $name = null ) { $templates[] = "sidebar.php"; + // Backward compat code will be removed in a future release if ('' == locate_template($templates, true)) - load_template( get_theme_root() . '/default/sidebar.php'); + load_template( WPINC . '/theme-compat/sidebar.php'); +} + +/** + * Load a template part into a template + * + * Makes it easy for a theme to reuse sections of code in a easy to overload way + * for child themes. + * + * Includes the named template part for a theme or if a name is specified then a + * specialised part will be included. If the theme contains no {slug}.php file + * then no template will be included. + * + * The template is included using require, not require_once, so you may include the + * same template part multiple times. + * + * For the parameter, if the file is called "{slug}-special.php" then specify + * "special". + * + * @uses locate_template() + * @since 3.0.0 + * @uses do_action() Calls 'get_template_part{$slug}' action. + * + * @param string $slug The slug name for the generic template. + * @param string $name The name of the specialised template. + */ +function get_template_part( $slug, $name = null ) { + do_action( "get_template_part_{$slug}", $slug, $name ); + + $templates = array(); + if ( isset($name) ) + $templates[] = "{$slug}-{$name}.php"; + + $templates[] = "{$slug}.php"; + + locate_template($templates, true, false); } /** @@ -111,8 +146,9 @@ function get_sidebar( $name = null ) { * search. To give a few examples of what it can be used for. * * @since 2.7.0 + * @param boolean $echo Default to echo and not return the form. */ -function get_search_form() { +function get_search_form($echo = true) { do_action( 'get_search_form' ); $search_form_template = locate_template(array('searchform.php')); @@ -121,34 +157,41 @@ function get_search_form() { return; } - $form = ''; - echo apply_filters('get_search_form', $form); + if ( $echo ) + echo apply_filters('get_search_form', $form); + else + return apply_filters('get_search_form', $form); } /** * Display the Log In/Out link. * - * Displays a link, which allows the user to navigate to the Log In page to log in - * or log out depending on whether or not they are currently logged in. + * Displays a link, which allows users to navigate to the Log In page to log in + * or log out depending on whether they are currently logged in. * * @since 1.5.0 * @uses apply_filters() Calls 'loginout' hook on HTML link content. * * @param string $redirect Optional path to redirect to on login/logout. + * @param boolean $echo Default to echo and not return the link. */ -function wp_loginout($redirect = '') { +function wp_loginout($redirect = '', $echo = true) { if ( ! is_user_logged_in() ) $link = '' . __('Log in') . ''; else $link = '' . __('Log out') . ''; - echo apply_filters('loginout', $link); + if ( $echo ) + echo apply_filters('loginout', $link); + else + return apply_filters('loginout', $link); } /** @@ -185,17 +228,73 @@ function wp_logout_url($redirect = '') { * @uses apply_filters() calls 'login_url' hook on final login url * * @param string $redirect Path to redirect to on login. + * @param bool $force_reauth Whether to force reauthorization, even if a cookie is present. Default is false. + * @return string A log in url */ -function wp_login_url($redirect = '') { +function wp_login_url($redirect = '', $force_reauth = false) { $login_url = site_url('wp-login.php', 'login'); - if ( !empty($redirect) ) { + if ( !empty($redirect) ) $login_url = add_query_arg('redirect_to', urlencode($redirect), $login_url); - } + + if ( $force_reauth ) + $login_url = add_query_arg('reauth', '1', $login_url); return apply_filters('login_url', $login_url, $redirect); } +/** + * Provides a simple login form for use anywhere within WordPress. By default, it echoes + * the HTML immediately. Pass array('echo'=>false) to return the string instead. + * + * @since 3.0.0 + * @param array $args Configuration options to modify the form output + * @return Void, or string containing the form + */ +function wp_login_form( $args = array() ) { + $defaults = array( 'echo' => true, + 'redirect' => site_url( $_SERVER['REQUEST_URI'] ), // Default redirect is back to the current page + 'form_id' => 'loginform', + 'label_username' => __( 'Username' ), + 'label_password' => __( 'Password' ), + 'label_remember' => __( 'Remember Me' ), + 'label_log_in' => __( 'Log In' ), + 'id_username' => 'user_login', + 'id_password' => 'user_pass', + 'id_remember' => 'rememberme', + 'id_submit' => 'wp-submit', + 'remember' => true, + 'value_username' => '', + 'value_remember' => false, // Set this to true to default the "Remember me" checkbox to checked + ); + $args = wp_parse_args( $args, apply_filters( 'login_form_defaults', $defaults ) ); + + $form = ' +
        + ' . apply_filters( 'login_form_top', '' ) . ' + + + ' . apply_filters( 'login_form_middle', '' ) . ' + ' . ( $args['remember'] ? '' : '' ) . ' + + ' . apply_filters( 'login_form_bottom', '' ) . ' +
        '; + + if ( $args['echo'] ) + echo $form; + else + return $form; +} + /** * Returns the Lost Password URL. * @@ -228,8 +327,9 @@ function wp_lostpassword_url($redirect = '') { * * @param string $before Text to output before the link (defaults to
      • ). * @param string $after Text to output after the link (defaults to
      • ). + * @param boolean $echo Default to echo and not return the link. */ -function wp_register( $before = '
      • ', $after = '
      • ' ) { +function wp_register( $before = '
      • ', $after = '
      • ', $echo = true ) { if ( ! is_user_logged_in() ) { if ( get_option('users_can_register') ) @@ -240,7 +340,10 @@ function wp_register( $before = '
      • ', $after = '
      • ' ) { $link = $before . '' . __('Site Admin') . '' . $after; } - echo apply_filters('register', $link); + if ( $echo ) + echo apply_filters('register', $link); + else + return apply_filters('register', $link); } /** @@ -265,17 +368,16 @@ function wp_meta() { * * @param string $show What to display. */ -function bloginfo($show='') { - echo get_bloginfo($show, 'display'); +function bloginfo( $show='' ) { + echo get_bloginfo( $show, 'display' ); } /** * Retrieve information about the blog. * * Some show parameter values are deprecated and will be removed in future - * versions. Care should be taken to check the function contents and know what - * the deprecated blog info options are. Options without "// DEPRECATED" are - * the preferred and recommended ways to get the information. + * versions. These options will trigger the _deprecated_argument() function. + * The deprecated blog info options are listed in the function contents. * * The possible values for the 'show' parameter are listed below. *
          @@ -289,25 +391,23 @@ function bloginfo($show='') { * comment feeds can be retrieved from the 'comments_atom_url' (Atom comment * feed) or 'comments_rss2_url' (RSS 2.0 comment feed). * - * There are many other options and you should check the function contents: - * {@source 32 37} - * * @since 0.71 * * @param string $show Blog info to retrieve. * @param string $filter How to filter what is retrieved. * @return string Mostly string values, might be empty. */ -function get_bloginfo($show = '', $filter = 'raw') { +function get_bloginfo( $show = '', $filter = 'raw' ) { - switch($show) { - case 'url' : + switch( $show ) { case 'home' : // DEPRECATED case 'siteurl' : // DEPRECATED - $output = get_option('home'); + _deprecated_argument( __FUNCTION__, '2.2', sprintf( __('The %s option is deprecated for the family of bloginfo() functions.' ), $show ) . ' ' . sprintf( __( 'Use the %s option instead.' ), 'url' ) ); + case 'url' : + $output = home_url(); break; case 'wpurl' : - $output = get_option('siteurl'); + $output = site_url(); break; case 'description': $output = get_option('blogdescription'); @@ -362,8 +462,12 @@ function get_bloginfo($show = '', $filter = 'raw') { $output = str_replace('_', '-', $output); break; case 'text_direction': - global $wp_locale; - $output = $wp_locale->text_direction; + //_deprecated_argument( __FUNCTION__, '2.2', sprintf( __('The %s option is deprecated for the family of bloginfo() functions.' ), $show ) . ' ' . sprintf( __( 'Use the %s function instead.' ), 'is_rtl()' ) ); + if ( function_exists( 'is_rtl' ) ) { + $output = is_rtl() ? 'rtl' : 'ltr'; + } else { + $output = 'ltr'; + } break; case 'name': default: @@ -467,31 +571,30 @@ function wp_title($sep = '»', $display = true, $seplocation = '') { $my_year = substr($m, 0, 4); $my_month = $wp_locale->get_month(substr($m, 4, 2)); $my_day = intval(substr($m, 6, 2)); - $title = "$my_year" . ($my_month ? "$t_sep$my_month" : "") . ($my_day ? "$t_sep$my_day" : ""); + $title = $my_year . ($my_month ? $t_sep . $my_month : "") . ($my_day ? $t_sep . $my_day : ""); } if ( !empty($year) ) { $title = $year; if ( !empty($monthnum) ) - $title .= "$t_sep" . $wp_locale->get_month($monthnum); + $title .= $t_sep . $wp_locale->get_month($monthnum); if ( !empty($day) ) - $title .= "$t_sep" . zeroise($day, 2); + $title .= $t_sep . zeroise($day, 2); } // If there is a post if ( is_single() || ( is_home() && !is_front_page() ) || ( is_page() && !is_front_page() ) ) { $post = $wp_query->get_queried_object(); - $title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) ); + $title = apply_filters( 'single_post_title', $post->post_title ); } // If there's a taxonomy if ( is_tax() ) { $taxonomy = get_query_var( 'taxonomy' ); $tax = get_taxonomy( $taxonomy ); - $tax = $tax->label; $term = $wp_query->get_queried_object(); $term = $term->name; - $title = "$tax$t_sep$term"; + $title = $tax->labels->name . $t_sep . $term; } //If it's a search @@ -547,21 +650,21 @@ function wp_title($sep = '»', $display = true, $seplocation = '') { * @return string|null Title when retrieving, null when displaying or failure. */ function single_post_title($prefix = '', $display = true) { - global $wpdb; - $p = get_query_var('p'); - $name = get_query_var('name'); - - if ( intval($p) || '' != $name ) { - if ( !$p ) - $p = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_name = %s", $name)); - $post = & get_post($p); - $title = $post->post_title; - $title = apply_filters('single_post_title', $title); - if ( $display ) - echo $prefix.strip_tags($title); - else - return strip_tags($title); - } + global $wp_query, $post; + + if ( ! $post ) + $_post = $wp_query->get_queried_object(); + else + $_post = $post; + + if ( !isset($_post->post_title) ) + return; + + $title = apply_filters('single_post_title', $_post->post_title, $_post); + if ( $display ) + echo $prefix . $title; + else + return $title; } /** @@ -582,17 +685,21 @@ function single_post_title($prefix = '', $display = true) { * @return string|null Title when retrieving, null when displaying or failure. */ function single_cat_title($prefix = '', $display = true ) { - $cat = intval( get_query_var('cat') ); - if ( !empty($cat) && !(strtoupper($cat) == 'ALL') ) { - $my_cat_name = apply_filters('single_cat_title', get_the_category_by_ID($cat)); - if ( !empty($my_cat_name) ) { - if ( $display ) - echo $prefix.strip_tags($my_cat_name); - else - return strip_tags($my_cat_name); - } - } else if ( is_tag() ) { + global $wp_query; + + if ( is_tag() ) return single_tag_title($prefix, $display); + + if ( !is_category() ) + return; + + $cat = $wp_query->get_queried_object(); + $my_cat_name = apply_filters('single_cat_title', $cat->name); + if ( !empty($my_cat_name) ) { + if ( $display ) + echo $prefix . $my_cat_name; + else + return $my_cat_name; } } @@ -614,22 +721,21 @@ function single_cat_title($prefix = '', $display = true ) { * @return string|null Title when retrieving, null when displaying or failure. */ function single_tag_title($prefix = '', $display = true ) { + global $wp_query; if ( !is_tag() ) return; - $tag_id = intval( get_query_var('tag_id') ); - - if ( !empty($tag_id) ) { - $my_tag = &get_term($tag_id, 'post_tag', OBJECT, 'display'); - if ( is_wp_error( $my_tag ) ) - return false; - $my_tag_name = apply_filters('single_tag_title', $my_tag->name); - if ( !empty($my_tag_name) ) { - if ( $display ) - echo $prefix . $my_tag_name; - else - return $my_tag_name; - } + $tag = $wp_query->get_queried_object(); + + if ( ! $tag ) + return; + + $my_tag_name = apply_filters('single_tag_title', $tag->name); + if ( !empty($my_tag_name) ) { + if ( $display ) + echo $prefix . $my_tag_name; + else + return $my_tag_name; } } @@ -701,8 +807,6 @@ function single_month_title($prefix = '', $display = true ) { * three values for the format are not used, then custom format is assumed. * * @since 1.0.0 - * @author Orien - * @link http://icecode.com/ link navigation hack by Orien * * @param string $url URL to archive. * @param string $text Archive text description. @@ -809,7 +913,7 @@ function wp_get_archives($args = '') { if ( !isset( $cache[ $key ] ) ) { $arcresults = $wpdb->get_results($query); $cache[ $key ] = $arcresults; - wp_cache_add( 'wp_get_archives', $cache, 'general' ); + wp_cache_set( 'wp_get_archives', $cache, 'general' ); } else { $arcresults = $cache[ $key ]; } @@ -831,7 +935,7 @@ function wp_get_archives($args = '') { if ( !isset( $cache[ $key ] ) ) { $arcresults = $wpdb->get_results($query); $cache[ $key ] = $arcresults; - wp_cache_add( 'wp_get_archives', $cache, 'general' ); + wp_cache_set( 'wp_get_archives', $cache, 'general' ); } else { $arcresults = $cache[ $key ]; } @@ -852,7 +956,7 @@ function wp_get_archives($args = '') { if ( !isset( $cache[ $key ] ) ) { $arcresults = $wpdb->get_results($query); $cache[ $key ] = $arcresults; - wp_cache_add( 'wp_get_archives', $cache, 'general' ); + wp_cache_set( 'wp_get_archives', $cache, 'general' ); } else { $arcresults = $cache[ $key ]; } @@ -868,14 +972,14 @@ function wp_get_archives($args = '') { } } } elseif ( 'weekly' == $type ) { - $start_of_week = get_option('start_of_week'); - $query = "SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY WEEK(post_date, $start_of_week), YEAR(post_date) ORDER BY post_date DESC $limit"; + $week = _wp_mysql_week( '`post_date`' ); + $query = "SELECT DISTINCT $week AS `week`, YEAR( `post_date` ) AS `yr`, DATE_FORMAT( `post_date`, '%Y-%m-%d' ) AS `yyyymmdd`, count( `ID` ) AS `posts` FROM `$wpdb->posts` $join $where GROUP BY $week, YEAR( `post_date` ) ORDER BY `post_date` DESC $limit"; $key = md5($query); $cache = wp_cache_get( 'wp_get_archives' , 'general'); if ( !isset( $cache[ $key ] ) ) { $arcresults = $wpdb->get_results($query); $cache[ $key ] = $arcresults; - wp_cache_add( 'wp_get_archives', $cache, 'general' ); + wp_cache_set( 'wp_get_archives', $cache, 'general' ); } else { $arcresults = $cache[ $key ]; } @@ -889,7 +993,7 @@ function wp_get_archives($args = '') { $arc_week = get_weekstartend($arcresult->yyyymmdd, get_option('start_of_week')); $arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']); $arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']); - $url = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', get_option('home'), '', '?', '=', $arc_year, '&', '=', $arcresult->week); + $url = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', home_url(), '', '?', '=', $arc_year, '&', '=', $arcresult->week); $text = $arc_week_start . $archive_week_separator . $arc_week_end; if ($show_post_count) $after = ' ('.$arcresult->posts.')'.$afterafter; @@ -905,7 +1009,7 @@ function wp_get_archives($args = '') { if ( !isset( $cache[ $key ] ) ) { $arcresults = $wpdb->get_results($query); $cache[ $key ] = $arcresults; - wp_cache_add( 'wp_get_archives', $cache, 'general' ); + wp_cache_set( 'wp_get_archives', $cache, 'general' ); } else { $arcresults = $cache[ $key ]; } @@ -952,16 +1056,21 @@ function calendar_week_mod($num) { * @since 1.0.0 * * @param bool $initial Optional, default is true. Use initial calendar names. + * @param bool $echo Optional, default is true. Set to false for return. */ -function get_calendar($initial = true) { +function get_calendar($initial = true, $echo = true) { global $wpdb, $m, $monthnum, $year, $wp_locale, $posts; $cache = array(); $key = md5( $m . $monthnum . $year ); if ( $cache = wp_cache_get( 'get_calendar', 'calendar' ) ) { if ( is_array($cache) && isset( $cache[ $key ] ) ) { - echo $cache[ $key ]; - return; + if ( $echo ) { + echo apply_filters( 'get_calendar', $cache[$key] ); + return; + } else { + return apply_filters( 'get_calendar', $cache[$key] ); + } } } @@ -978,7 +1087,6 @@ function get_calendar($initial = true) { } } - ob_start(); if ( isset($_GET['w']) ) $w = ''.intval($_GET['w']); @@ -1024,7 +1132,7 @@ function get_calendar($initial = true) { /* translators: Calendar caption: 1: month name, 2: 4-digit year */ $calendar_caption = _x('%1$s %2$s', 'calendar caption'); - echo ' + $calendar_output = '
          '; @@ -1038,10 +1146,10 @@ function get_calendar($initial = true) { foreach ( $myweek as $wd ) { $day_name = (true == $initial) ? $wp_locale->get_weekday_initial($wd) : $wp_locale->get_weekday_abbrev($wd); $wd = esc_attr($wd); - echo "\n\t\t"; + $calendar_output .= "\n\t\t"; } - echo ' + $calendar_output .= ' @@ -1049,24 +1157,20 @@ function get_calendar($initial = true) { '; if ( $previous ) { - echo "\n\t\t".''; + $calendar_output .= "\n\t\t".''; } else { - echo "\n\t\t".''; + $calendar_output .= "\n\t\t".''; } - echo "\n\t\t".''; + $calendar_output .= "\n\t\t".''; if ( $next ) { - echo "\n\t\t".''; + $calendar_output .= "\n\t\t".''; } else { - echo "\n\t\t".''; + $calendar_output .= "\n\t\t".''; } - echo ' + $calendar_output .= ' @@ -1087,13 +1191,13 @@ function get_calendar($initial = true) { $daywithpost = array(); } - if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'camino') !== false || strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'safari') !== false) + if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'camino') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false) $ak_title_separator = "\n"; else $ak_title_separator = ', '; $ak_titles_for_day = array(); - $ak_post_titles = $wpdb->get_results("SELECT post_title, DAYOFMONTH(post_date) as dom " + $ak_post_titles = $wpdb->get_results("SELECT ID, post_title, DAYOFMONTH(post_date) as dom " ."FROM $wpdb->posts " ."WHERE YEAR(post_date) = '$thisyear' " ."AND MONTH(post_date) = '$thismonth' " @@ -1103,7 +1207,7 @@ function get_calendar($initial = true) { if ( $ak_post_titles ) { foreach ( (array) $ak_post_titles as $ak_post_title ) { - $post_title = esc_attr( apply_filters( 'the_title', $ak_post_title->post_title ) ); + $post_title = esc_attr( apply_filters( 'the_title', $ak_post_title->post_title, $ak_post_title->ID ) ); if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) ) $ak_titles_for_day['day_'.$ak_post_title->dom] = ''; @@ -1118,24 +1222,24 @@ function get_calendar($initial = true) { // See how much we should pad in the beginning $pad = calendar_week_mod(date('w', $unixmonth)-$week_begins); if ( 0 != $pad ) - echo "\n\t\t".''; + $calendar_output .= "\n\t\t".''; $daysinmonth = intval(date('t', $unixmonth)); for ( $day = 1; $day <= $daysinmonth; ++$day ) { if ( isset($newrow) && $newrow ) - echo "\n\t\n\t\n\t\t"; + $calendar_output .= "\n\t\n\t\n\t\t"; $newrow = false; - if ( $day == gmdate('j', (time() + (get_option('gmt_offset') * 3600))) && $thismonth == gmdate('m', time()+(get_option('gmt_offset') * 3600)) && $thisyear == gmdate('Y', time()+(get_option('gmt_offset') * 3600)) ) - echo ''; + $calendar_output .= $day; + $calendar_output .= ''; if ( 6 == calendar_week_mod(date('w', mktime(0, 0 , 0, $thismonth, $day, $thisyear))-$week_begins) ) $newrow = true; @@ -1143,15 +1247,18 @@ function get_calendar($initial = true) { $pad = 7 - calendar_week_mod(date('w', mktime(0, 0 , 0, $thismonth, $day, $thisyear))-$week_begins); if ( $pad != 0 && $pad != 7 ) - echo "\n\t\t".''; + $calendar_output .= "\n\t\t".''; - echo "\n\t\n\t\n\t
          ' . sprintf($calendar_caption, $wp_locale->get_month($thismonth), date('Y', $unixmonth)) . '
          $day_name$day_name
          « ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '« ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '    ' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' »' . $wp_locale->get_month_abbrev($wp_locale->get_month($next->month)) . ' »  
            
          '; + if ( $day == gmdate('j', current_time('timestamp')) && $thismonth == gmdate('m', current_time('timestamp')) && $thisyear == gmdate('Y', current_time('timestamp')) ) + $calendar_output .= ''; else - echo ''; + $calendar_output .= ''; if ( in_array($day, $daywithpost) ) // any posts today? - echo '$day"; + $calendar_output .= '$day"; else - echo $day; - echo '  
          "; + $calendar_output .= "\n\t\n\t\n\t"; - $output = ob_get_contents(); - ob_end_clean(); - echo $output; - $cache[ $key ] = $output; + $cache[ $key ] = $calendar_output; wp_cache_set( 'get_calendar', $cache, 'calendar' ); + + if ( $echo ) + echo apply_filters( 'get_calendar', $calendar_output ); + else + return apply_filters( 'get_calendar', $calendar_output ); + } /** @@ -1207,37 +1314,66 @@ function the_date_xml() { } /** - * Display or Retrieve the date the post was written. + * Display or Retrieve the date the current $post was written (once per date) * * Will only output the date if the current post's date is different from the * previous one output. + + * i.e. Only one date listing will show per day worth of posts shown in the loop, even if the + * function is called several times for each post. * - * @since 0.71 + * HTML output can be filtered with 'the_date'. + * Date string output can be filtered with 'get_the_date'. * + * @since 0.71 + * @uses get_the_date() * @param string $d Optional. PHP date format defaults to the date_format option if not specified. * @param string $before Optional. Output before the date. * @param string $after Optional. Output after the date. * @param bool $echo Optional, default is display. Whether to echo the date or return it. * @return string|null Null if displaying, string if retrieving. */ -function the_date($d='', $before='', $after='', $echo = true) { - global $post, $day, $previousday; +function the_date( $d = '', $before = '', $after = '', $echo = true ) { + global $day, $previousday; $the_date = ''; if ( $day != $previousday ) { $the_date .= $before; - if ( $d=='' ) - $the_date .= mysql2date(get_option('date_format'), $post->post_date); - else - $the_date .= mysql2date($d, $post->post_date); + $the_date .= get_the_date( $d ); $the_date .= $after; $previousday = $day; - $the_date = apply_filters('the_date', $the_date, $d, $before, $after); - if ( $echo ) - echo $the_date; - else - return $the_date; + $the_date = apply_filters('the_date', $the_date, $d, $before, $after); + + if ( $echo ) + echo $the_date; + else + return $the_date; } + + return null; +} + +/** + * Retrieve the date the current $post was written. + * + * Unlike the_date() this function will always return the date. + * Modify output with 'get_the_date' filter. + * + * @since 3.0.0 + * + * @param string $d Optional. PHP date format defaults to the date_format option if not specified. + * @return string|null Null if displaying, string if retrieving. + */ +function get_the_date( $d = '' ) { + global $post; + $the_date = ''; + + if ( '' == $d ) + $the_date .= mysql2date(get_option('date_format'), $post->post_date); + else + $the_date .= mysql2date($d, $post->post_date); + + return apply_filters('get_the_date', $the_date, $d); } /** @@ -1245,11 +1381,22 @@ function the_date($d='', $before='', $after='', $echo = true) { * * @since 2.1.0 * - * @param string $d Optional. PHP date format. - * @return string + * @param string $d Optional. PHP date format defaults to the date_format option if not specified. + * @param string $before Optional. Output before the date. + * @param string $after Optional. Output after the date. + * @param bool $echo Optional, default is display. Whether to echo the date or return it. + * @return string|null Null if displaying, string if retrieving. */ -function the_modified_date($d = '') { - echo apply_filters('the_modified_date', get_the_modified_date($d), $d); +function the_modified_date($d = '', $before='', $after='', $echo = true) { + + $the_modified_date = $before . get_the_modified_date($d) . $after; + $the_modified_date = apply_filters('the_modified_date', $the_modified_date, $d, $before, $after); + + if ( $echo ) + echo $the_modified_date; + else + return $the_modified_date; + } /** @@ -1284,7 +1431,7 @@ function the_time( $d = '' ) { * * @since 1.5.0 * - * @param string $d Either 'G', 'U', or php date format defaults to the value specified in the time_format option. + * @param string $d Optional Either 'G', 'U', or php date format defaults to the value specified in the time_format option. * @param int|object $post Optional post ID or object. Default is global $post object. * @return string */ @@ -1303,10 +1450,10 @@ function get_the_time( $d = '', $post = null ) { * * @since 2.0.0 * - * @param string $d Either 'G', 'U', or php date format. - * @param bool $gmt Whether of not to return the gmt time. + * @param string $d Optional Either 'G', 'U', or php date format. + * @param bool $gmt Optional, default is false. Whether to return the gmt time. * @param int|object $post Optional post ID or object. Default is global $post object. - * @param bool $translate Whether to translate the time string or not + * @param bool $translate Whether to translate the time string * @return string */ function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { // returns timestamp @@ -1326,7 +1473,7 @@ function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false * * @since 2.0.0 * - * @param string $d Either 'G', 'U', or php date format defaults to the value specified in the time_format option. + * @param string $d Optional Either 'G', 'U', or php date format defaults to the value specified in the time_format option. */ function the_modified_time($d = '') { echo apply_filters('the_modified_time', get_the_modified_time($d), $d); @@ -1337,7 +1484,7 @@ function the_modified_time($d = '') { * * @since 2.0.0 * - * @param string $d Either 'G', 'U', or php date format defaults to the value specified in the time_format option. + * @param string $d Optional Either 'G', 'U', or php date format defaults to the value specified in the time_format option. * @return string */ function get_the_modified_time($d = '') { @@ -1353,10 +1500,10 @@ function get_the_modified_time($d = '') { * * @since 2.0.0 * - * @param string $d Either 'G', 'U', or php date format. - * @param bool $gmt Whether of not to return the gmt time. - * @param int|object $post A post_id or post object - * @param bool translate Whether to translate the result or not + * @param string $d Optional, default is 'U'. Either 'G', 'U', or php date format. + * @param bool $gmt Optional, default is false. Whether to return the gmt time. + * @param int|object $post Optional, default is global post object. A post_id or post object + * @param bool $translate Optional, default is false. Whether to translate the result * @return string Returns timestamp */ function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { @@ -1393,8 +1540,8 @@ function the_weekday() { * * @since 0.71 * - * @param string $before output before the date. - * @param string $after output after the date. + * @param string $before Optional Output before the date. + * @param string $after Optional Output after the date. */ function the_weekday_date($before='',$after='') { global $wp_locale, $post, $day, $previousweekday; @@ -1429,22 +1576,6 @@ function wp_footer() { do_action('wp_footer'); } -/** - * Enable/disable automatic general feed link outputting. - * - * @since 2.8.0 - * - * @param boolean $add Add or remove links. Defaults to true. - */ -function automatic_feed_links( $add = true ) { - if ( $add ) - add_action( 'wp_head', 'feed_links', 2 ); - else { - remove_action( 'wp_head', 'feed_links', 2 ); - remove_action( 'wp_head', 'feed_links_extra', 3 ); - } -} - /** * Display the links to the general feeds. * @@ -1452,7 +1583,10 @@ function automatic_feed_links( $add = true ) { * * @param array $args Optional arguments. */ -function feed_links( $args ) { +function feed_links( $args = array() ) { + if ( !current_theme_supports('automatic-feed-links') ) + return; + $defaults = array( /* translators: Separator between blog name and feed type in feed links */ 'separator' => _x('»', 'feed link'), @@ -1475,7 +1609,7 @@ function feed_links( $args ) { * * @param array $args Optional arguments. */ -function feed_links_extra( $args ) { +function feed_links_extra( $args = array() ) { $defaults = array( /* translators: Separator between blog name and feed type in feed links */ 'separator' => _x('»', 'feed link'), @@ -1517,7 +1651,7 @@ function feed_links_extra( $args ) { $title = esc_attr(sprintf( $args['authortitle'], get_bloginfo('name'), $args['separator'], get_the_author_meta( 'display_name', $author_id ) )); $href = get_author_feed_link( $author_id ); } elseif ( is_search() ) { - $title = esc_attr(sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query() )); + $title = esc_attr(sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query( false ) )); $href = get_search_feed_link(); } @@ -1567,7 +1701,7 @@ function noindex() { * * @since 2.1.0 * - * @return bool Whether of not TinyMCE exists. + * @return bool Whether TinyMCE exists. */ function rich_edit_exists() { global $wp_rich_edit_exists; @@ -1577,7 +1711,7 @@ function rich_edit_exists() { } /** - * Whether or not the user should have a WYSIWIG editor. + * Whether the user should have a WYSIWIG editor. * * Checks that the user requires a WYSIWIG editor and that the editor is * supported in the users browser. @@ -1635,8 +1769,8 @@ function wp_default_editor() { * @since 2.1.0 * * @param string $content Textarea content. - * @param string $id HTML ID attribute value. - * @param string $prev_id HTML ID name for switching back and forth between visual editors. + * @param string $id Optional, default is 'content'. HTML ID attribute value. + * @param string $prev_id Optional, default is 'title'. HTML ID name for switching back and forth between visual editors. * @param bool $media_buttons Optional, default is true. Whether to display media buttons. * @param int $tab_index Optional, default is 2. Tabindex for textarea element. */ @@ -1700,12 +1834,21 @@ function the_editor($content, $id = 'content', $prev_id = 'title', $media_button /** * Retrieve the contents of the search WordPress query variable. * + * The search query string is passed through {@link esc_attr()} + * to ensure that it is safe for placing in an html attribute. + * * @since 2.3.0 + * @uses esc_attr() * + * @param bool $escaped Whether the result is escaped. Default true. + * Only use when you are later escaping it. Do not use unescaped. * @return string */ -function get_search_query() { - return apply_filters( 'get_search_query', get_query_var( 's' ) ); +function get_search_query( $escaped = true ) { + $query = apply_filters( 'get_search_query', get_query_var( 's' ) ); + if ( $escaped ) + $query = esc_attr( $query ); + return $query; } /** @@ -1714,11 +1857,11 @@ function get_search_query() { * The search query string is passed through {@link esc_attr()} * to ensure that it is safe for placing in an html attribute. * - * @uses attr + * @uses esc_attr() * @since 2.1.0 */ function the_search_query() { - echo esc_attr( apply_filters( 'the_search_query', get_search_query() ) ); + echo esc_attr( apply_filters( 'the_search_query', get_search_query( false ) ) ); } /** @@ -1735,8 +1878,8 @@ function language_attributes($doctype = 'html') { $attributes = array(); $output = ''; - if ( $dir = get_bloginfo('text_direction') ) - $attributes[] = "dir=\"$dir\""; + if ( function_exists( 'is_rtl' ) ) + $attributes[] = 'dir="' . ( is_rtl() ? 'rtl' : 'ltr' ) . '"'; if ( $lang = get_bloginfo('language') ) { if ( get_option('html_type') == 'text/html' || $doctype == 'html' ) @@ -1835,7 +1978,7 @@ function paginate_links( $args = '' ) { if ( $add_args ) $link = add_query_arg( $add_args, $link ); $link .= $add_fragment; - $page_links[] = ""; + $page_links[] = ""; endif; for ( $n = 1; $n <= $total; $n++ ) : $n_display = number_format_i18n($n); @@ -1849,7 +1992,7 @@ function paginate_links( $args = '' ) { if ( $add_args ) $link = add_query_arg( $add_args, $link ); $link .= $add_fragment; - $page_links[] = "$n_display"; + $page_links[] = "$n_display"; $dots = true; elseif ( $dots && !$show_all ) : $page_links[] = "..."; @@ -1863,7 +2006,7 @@ function paginate_links( $args = '' ) { if ( $add_args ) $link = add_query_arg( $add_args, $link ); $link .= $add_fragment; - $page_links[] = ""; + $page_links[] = ""; endif; switch ( $type ) : case 'array' : @@ -1895,7 +2038,7 @@ function paginate_links( $args = '' ) { * @param string $key The unique key for this theme. * @param string $name The name of the theme. * @param string $url The url of the css file containing the colour scheme. - * @param array @colors An array of CSS color definitions which are used to give the user a feel for the theme. + * @param array @colors Optional An array of CSS color definitions which are used to give the user a feel for the theme. */ function wp_admin_css_color($key, $name, $url, $colors = array()) { global $_wp_admin_css_colors; @@ -1906,6 +2049,15 @@ function wp_admin_css_color($key, $name, $url, $colors = array()) { $_wp_admin_css_colors[$key] = (object) array('name' => $name, 'url' => $url, 'colors' => $colors); } +/** + * Registers the default Admin color schemes + * + * @since 3.0.0 + */ +function register_admin_color_schemes() { + wp_admin_css_color('classic', __('Blue'), admin_url("css/colors-classic.css"), array('#073447', '#21759B', '#EAF3FA', '#BBD8E7')); + wp_admin_css_color('fresh', __('Gray'), admin_url("css/colors-fresh.css"), array('#464646', '#6D6D6D', '#F1F1F1', '#DFDFDF'));} + /** * Display the URL of a WordPress admin CSS file. * @@ -1964,7 +2116,7 @@ function wp_admin_css( $file = 'wp-admin', $force_echo = false ) { } echo apply_filters( 'wp_admin_css', "\n", $file ); - if ( 'rtl' == get_bloginfo( 'text_direction' ) ) + if ( is_rtl() ) echo apply_filters( 'wp_admin_css', "\n", "$file-rtl" ); } @@ -2019,8 +2171,34 @@ function the_generator( $type ) { * @param string $type The type of generator to return - (html|xhtml|atom|rss2|rdf|comment|export). * @return string The HTML content for the generator. */ -function get_the_generator( $type ) { - switch ($type) { +function get_the_generator( $type = '' ) { + if ( empty( $type ) ) { + + $current_filter = current_filter(); + if ( empty( $current_filter ) ) + return; + + switch ( $current_filter ) { + case 'rss2_head' : + case 'commentsrss2_head' : + $type = 'rss2'; + break; + case 'rss_head' : + case 'opml_head' : + $type = 'comment'; + break; + case 'rdf_header' : + $type = 'rdf'; + break; + case 'atom_head' : + case 'comments_atom_head' : + case 'app_head' : + $type = 'atom'; + break; + } + } + + switch ( $type ) { case 'html': $gen = ''; break; @@ -2046,4 +2224,78 @@ function get_the_generator( $type ) { return apply_filters( "get_the_generator_{$type}", $gen, $type ); } -?> \ No newline at end of file +/** + * Outputs the html checked attribute. + * + * Compares the first two arguments and if identical marks as checked + * + * @since 1.0 + * + * @param mixed $checked One of the values to compare + * @param mixed $current (true) The other value to compare if not just true + * @param bool $echo Whether to echo or just return the string + * @return string html attribute or empty string + */ +function checked( $checked, $current = true, $echo = true ) { + return __checked_selected_helper( $checked, $current, $echo, 'checked' ); +} + +/** + * Outputs the html selected attribute. + * + * Compares the first two arguments and if identical marks as selected + * + * @since 1.0 + * + * @param mixed selected One of the values to compare + * @param mixed $current (true) The other value to compare if not just true + * @param bool $echo Whether to echo or just return the string + * @return string html attribute or empty string + */ +function selected( $selected, $current = true, $echo = true ) { + return __checked_selected_helper( $selected, $current, $echo, 'selected' ); +} + +/** + * Outputs the html disabled attribute. + * + * Compares the first two arguments and if identical marks as disabled + * + * @since 3.0.0 + * + * @param mixed $disabled One of the values to compare + * @param mixed $current (true) The other value to compare if not just true + * @param bool $echo Whether to echo or just return the string + * @return string html attribute or empty string + */ +function disabled( $disabled, $current = true, $echo = true ) { + return __checked_selected_helper( $disabled, $current, $echo, 'disabled' ); +} + +/** + * Private helper function for checked, selected, and disabled. + * + * Compares the first two arguments and if identical marks as $type + * + * @since 2.8 + * @access private + * + * @param any $helper One of the values to compare + * @param any $current (true) The other value to compare if not just true + * @param bool $echo Whether to echo or just return the string + * @param string $type The type of checked|selected|disabled we are doing + * @return string html attribute or empty string + */ +function __checked_selected_helper( $helper, $current, $echo, $type ) { + if ( (string) $helper === (string) $current ) + $result = " $type='$type'"; + else + $result = ''; + + if ( $echo ) + echo $result; + + return $result; +} + +?> diff --git a/wp-includes/http.php b/wp-includes/http.php index e8d1344c..63cf97d1 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -9,1936 +9,8 @@ * @package WordPress * @subpackage HTTP * @since 2.7.0 - * @author Jacob Santos */ -/** - * WordPress HTTP Class for managing HTTP Transports and making HTTP requests. - * - * This class is called for the functionality of making HTTP requests and should replace Snoopy - * functionality, eventually. There is no available functionality to add HTTP transport - * implementations, since most of the HTTP transports are added and available for use. - * - * The exception is that cURL is not available as a transport and lacking an implementation. It will - * be added later and should be a patch on the WordPress Trac. - * - * There are no properties, because none are needed and for performance reasons. Some of the - * functions are static and while they do have some overhead over functions in PHP4, the purpose is - * maintainability. When PHP5 is finally the requirement, it will be easy to add the static keyword - * to the code. It is not as easy to convert a function to a method after enough code uses the old - * way. - * - * Debugging includes several actions, which pass different variables for debugging the HTTP API. - * - * http_transport_get_debug - gives working, nonblocking, and blocking transports. - * - * http_transport_post_debug - gives working, nonblocking, and blocking transports. - * - * @package WordPress - * @subpackage HTTP - * @since 2.7.0 - */ -class WP_Http { - - /** - * PHP4 style Constructor - Calls PHP5 Style Constructor - * - * @since 2.7.0 - * @return WP_Http - */ - function WP_Http() { - $this->__construct(); - } - - /** - * PHP5 style Constructor - Setup available transport if not available. - * - * PHP4 does not have the 'self' keyword and since WordPress supports PHP4, - * the class needs to be used for the static call. - * - * The transport are setup to save time. This should only be called once, so - * the overhead should be fine. - * - * @since 2.7.0 - * @return WP_Http - */ - function __construct() { - WP_Http::_getTransport(); - WP_Http::_postTransport(); - } - - /** - * Tests the WordPress HTTP objects for an object to use and returns it. - * - * Tests all of the objects and returns the object that passes. Also caches - * that object to be used later. - * - * The order for the GET/HEAD requests are Streams, HTTP Extension, Fopen, - * and finally Fsockopen. fsockopen() is used last, because it has the most - * overhead in its implementation. There isn't any real way around it, since - * redirects have to be supported, much the same way the other transports - * also handle redirects. - * - * There are currently issues with "localhost" not resolving correctly with - * DNS. This may cause an error "failed to open stream: A connection attempt - * failed because the connected party did not properly respond after a - * period of time, or established connection failed because connected host - * has failed to respond." - * - * @since 2.7.0 - * @access private - * - * @param array $args Request args, default us an empty array - * @return object|null Null if no transports are available, HTTP transport object. - */ - function &_getTransport( $args = array() ) { - static $working_transport, $blocking_transport, $nonblocking_transport; - - if ( is_null($working_transport) ) { - if ( true === WP_Http_ExtHttp::test($args) ) { - $working_transport['exthttp'] = new WP_Http_ExtHttp(); - $blocking_transport[] = &$working_transport['exthttp']; - } else if ( true === WP_Http_Curl::test($args) ) { - $working_transport['curl'] = new WP_Http_Curl(); - $blocking_transport[] = &$working_transport['curl']; - } else if ( true === WP_Http_Streams::test($args) ) { - $working_transport['streams'] = new WP_Http_Streams(); - $blocking_transport[] = &$working_transport['streams']; - } else if ( true === WP_Http_Fopen::test($args) ) { - $working_transport['fopen'] = new WP_Http_Fopen(); - $blocking_transport[] = &$working_transport['fopen']; - } else if ( true === WP_Http_Fsockopen::test($args) ) { - $working_transport['fsockopen'] = new WP_Http_Fsockopen(); - $blocking_transport[] = &$working_transport['fsockopen']; - } - - foreach ( array('curl', 'streams', 'fopen', 'fsockopen', 'exthttp') as $transport ) { - if ( isset($working_transport[$transport]) ) - $nonblocking_transport[] = &$working_transport[$transport]; - } - } - - do_action( 'http_transport_get_debug', $working_transport, $blocking_transport, $nonblocking_transport ); - - if ( isset($args['blocking']) && !$args['blocking'] ) - return $nonblocking_transport; - else - return $blocking_transport; - } - - /** - * Tests the WordPress HTTP objects for an object to use and returns it. - * - * Tests all of the objects and returns the object that passes. Also caches - * that object to be used later. This is for posting content to a URL and - * is used when there is a body. The plain Fopen Transport can not be used - * to send content, but the streams transport can. This is a limitation that - * is addressed here, by just not including that transport. - * - * @since 2.7.0 - * @access private - * - * @param array $args Request args, default us an empty array - * @return object|null Null if no transports are available, HTTP transport object. - */ - function &_postTransport( $args = array() ) { - static $working_transport, $blocking_transport, $nonblocking_transport; - - if ( is_null($working_transport) ) { - if ( true === WP_Http_ExtHttp::test($args) ) { - $working_transport['exthttp'] = new WP_Http_ExtHttp(); - $blocking_transport[] = &$working_transport['exthttp']; - } else if ( true === WP_Http_Curl::test($args) ) { - $working_transport['curl'] = new WP_Http_Curl(); - $blocking_transport[] = &$working_transport['curl']; - } else if ( true === WP_Http_Streams::test($args) ) { - $working_transport['streams'] = new WP_Http_Streams(); - $blocking_transport[] = &$working_transport['streams']; - } else if ( true === WP_Http_Fsockopen::test($args) ) { - $working_transport['fsockopen'] = new WP_Http_Fsockopen(); - $blocking_transport[] = &$working_transport['fsockopen']; - } - - foreach ( array('curl', 'streams', 'fsockopen', 'exthttp') as $transport ) { - if ( isset($working_transport[$transport]) ) - $nonblocking_transport[] = &$working_transport[$transport]; - } - } - - do_action( 'http_transport_post_debug', $working_transport, $blocking_transport, $nonblocking_transport ); - - if ( isset($args['blocking']) && !$args['blocking'] ) - return $nonblocking_transport; - else - return $blocking_transport; - } - - /** - * Send a HTTP request to a URI. - * - * The body and headers are part of the arguments. The 'body' argument is for the body and will - * accept either a string or an array. The 'headers' argument should be an array, but a string - * is acceptable. If the 'body' argument is an array, then it will automatically be escaped - * using http_build_query(). - * - * The only URI that are supported in the HTTP Transport implementation are the HTTP and HTTPS - * protocols. HTTP and HTTPS are assumed so the server might not know how to handle the send - * headers. Other protocols are unsupported and most likely will fail. - * - * The defaults are 'method', 'timeout', 'redirection', 'httpversion', 'blocking' and - * 'user-agent'. - * - * Accepted 'method' values are 'GET', 'POST', and 'HEAD', some transports technically allow - * others, but should not be assumed. The 'timeout' is used to sent how long the connection - * should stay open before failing when no response. 'redirection' is used to track how many - * redirects were taken and used to sent the amount for other transports, but not all transports - * accept setting that value. - * - * The 'httpversion' option is used to sent the HTTP version and accepted values are '1.0', and - * '1.1' and should be a string. Version 1.1 is not supported, because of chunk response. The - * 'user-agent' option is the user-agent and is used to replace the default user-agent, which is - * 'WordPress/WP_Version', where WP_Version is the value from $wp_version. - * - * 'blocking' is the default, which is used to tell the transport, whether it should halt PHP - * while it performs the request or continue regardless. Actually, that isn't entirely correct. - * Blocking mode really just means whether the fread should just pull what it can whenever it - * gets bytes or if it should wait until it has enough in the buffer to read or finishes reading - * the entire content. It doesn't actually always mean that PHP will continue going after making - * the request. - * - * @access public - * @since 2.7.0 - * @todo Refactor this code. The code in this method extends the scope of its original purpose - * and should be refactored to allow for cleaner abstraction and reduce duplication of the - * code. One suggestion is to create a class specifically for the arguments, however - * preliminary refactoring to this affect has affect more than just the scope of the - * arguments. Something to ponder at least. - * - * @param string $url URI resource. - * @param str|array $args Optional. Override the defaults. - * @return array containing 'headers', 'body', 'response', 'cookies' - */ - function request( $url, $args = array() ) { - global $wp_version; - - $defaults = array( - 'method' => 'GET', - 'timeout' => apply_filters( 'http_request_timeout', 5), - 'redirection' => apply_filters( 'http_request_redirection_count', 5), - 'httpversion' => apply_filters( 'http_request_version', '1.0'), - 'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ), - 'blocking' => true, - 'headers' => array(), - 'cookies' => array(), - 'body' => null, - 'compress' => false, - 'decompress' => true, - 'sslverify' => true - ); - - $r = wp_parse_args( $args, $defaults ); - $r = apply_filters( 'http_request_args', $r, $url ); - - // Allow plugins to short-circuit the request - $pre = apply_filters( 'pre_http_request', false, $r, $url ); - if ( false !== $pre ) - return $pre; - - $arrURL = parse_url($url); - - if ( $this->block_request( $url ) ) - return new WP_Error('http_request_failed', __('User has blocked requests through HTTP.')); - - // Determine if this is a https call and pass that on to the transport functions - // so that we can blacklist the transports that do not support ssl verification - $r['ssl'] = $arrURL['scheme'] == 'https' || $arrURL['scheme'] == 'ssl'; - - // Determine if this request is to OUR install of WordPress - $homeURL = parse_url(get_bloginfo('url')); - $r['local'] = $homeURL['host'] == $arrURL['host'] || 'localhost' == $arrURL['host']; - unset($homeURL); - - if ( is_null( $r['headers'] ) ) - $r['headers'] = array(); - - if ( ! is_array($r['headers']) ) { - $processedHeaders = WP_Http::processHeaders($r['headers']); - $r['headers'] = $processedHeaders['headers']; - } - - if ( isset($r['headers']['User-Agent']) ) { - $r['user-agent'] = $r['headers']['User-Agent']; - unset($r['headers']['User-Agent']); - } - - if ( isset($r['headers']['user-agent']) ) { - $r['user-agent'] = $r['headers']['user-agent']; - unset($r['headers']['user-agent']); - } - - // Construct Cookie: header if any cookies are set - WP_Http::buildCookieHeader( $r ); - - if ( WP_Http_Encoding::is_available() ) - $r['headers']['Accept-Encoding'] = WP_Http_Encoding::accept_encoding(); - - if ( empty($r['body']) ) { - // Some servers fail when sending content without the content-length header being set. - // Also, to fix another bug, we only send when doing POST and PUT and the content-length - // header isn't already set. - if( ($r['method'] == 'POST' || $r['method'] == 'PUT') && ! isset($r['headers']['Content-Length']) ) - $r['headers']['Content-Length'] = 0; - - // The method is ambiguous, because we aren't talking about HTTP methods, the "get" in - // this case is simply that we aren't sending any bodies and to get the transports that - // don't support sending bodies along with those which do. - $transports = WP_Http::_getTransport($r); - } else { - if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) { - if ( ! version_compare(phpversion(), '5.1.2', '>=') ) - $r['body'] = _http_build_query($r['body'], null, '&'); - else - $r['body'] = http_build_query($r['body'], null, '&'); - $r['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=' . get_option('blog_charset'); - $r['headers']['Content-Length'] = strlen($r['body']); - } - - if ( ! isset( $r['headers']['Content-Length'] ) && ! isset( $r['headers']['content-length'] ) ) - $r['headers']['Content-Length'] = strlen($r['body']); - - // The method is ambiguous, because we aren't talking about HTTP methods, the "post" in - // this case is simply that we are sending HTTP body and to get the transports that do - // support sending the body. Not all do, depending on the limitations of the PHP core - // limitations. - $transports = WP_Http::_postTransport($r); - } - - do_action( 'http_api_debug', $transports, 'transports_list' ); - - $response = array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); - foreach ( (array) $transports as $transport ) { - $response = $transport->request($url, $r); - - do_action( 'http_api_debug', $response, 'response', get_class($transport) ); - - if ( ! is_wp_error($response) ) - return apply_filters( 'http_response', $response, $r, $url ); - } - - return $response; - } - - /** - * Uses the POST HTTP method. - * - * Used for sending data that is expected to be in the body. - * - * @access public - * @since 2.7.0 - * - * @param string $url URI resource. - * @param str|array $args Optional. Override the defaults. - * @return boolean - */ - function post($url, $args = array()) { - $defaults = array('method' => 'POST'); - $r = wp_parse_args( $args, $defaults ); - return $this->request($url, $r); - } - - /** - * Uses the GET HTTP method. - * - * Used for sending data that is expected to be in the body. - * - * @access public - * @since 2.7.0 - * - * @param string $url URI resource. - * @param str|array $args Optional. Override the defaults. - * @return boolean - */ - function get($url, $args = array()) { - $defaults = array('method' => 'GET'); - $r = wp_parse_args( $args, $defaults ); - return $this->request($url, $r); - } - - /** - * Uses the HEAD HTTP method. - * - * Used for sending data that is expected to be in the body. - * - * @access public - * @since 2.7.0 - * - * @param string $url URI resource. - * @param str|array $args Optional. Override the defaults. - * @return boolean - */ - function head($url, $args = array()) { - $defaults = array('method' => 'HEAD'); - $r = wp_parse_args( $args, $defaults ); - return $this->request($url, $r); - } - - /** - * Parses the responses and splits the parts into headers and body. - * - * @access public - * @static - * @since 2.7.0 - * - * @param string $strResponse The full response string - * @return array Array with 'headers' and 'body' keys. - */ - function processResponse($strResponse) { - list($theHeaders, $theBody) = explode("\r\n\r\n", $strResponse, 2); - return array('headers' => $theHeaders, 'body' => $theBody); - } - - /** - * Transform header string into an array. - * - * If an array is given then it is assumed to be raw header data with numeric keys with the - * headers as the values. No headers must be passed that were already processed. - * - * @access public - * @static - * @since 2.7.0 - * - * @param string|array $headers - * @return array Processed string headers. If duplicate headers are encountered, - * Then a numbered array is returned as the value of that header-key. - */ - function processHeaders($headers) { - // split headers, one per array element - if ( is_string($headers) ) { - // tolerate line terminator: CRLF = LF (RFC 2616 19.3) - $headers = str_replace("\r\n", "\n", $headers); - // unfold folded header fields. LWS = [CRLF] 1*( SP | HT ) , (RFC 2616 2.2) - $headers = preg_replace('/\n[ \t]/', ' ', $headers); - // create the headers array - $headers = explode("\n", $headers); - } - - $response = array('code' => 0, 'message' => ''); - - $cookies = array(); - $newheaders = array(); - foreach ( $headers as $tempheader ) { - if ( empty($tempheader) ) - continue; - - if ( false === strpos($tempheader, ':') ) { - list( , $iResponseCode, $strResponseMsg) = explode(' ', $tempheader, 3); - $response['code'] = $iResponseCode; - $response['message'] = $strResponseMsg; - continue; - } - - list($key, $value) = explode(':', $tempheader, 2); - - if ( !empty( $value ) ) { - $key = strtolower( $key ); - if ( isset( $newheaders[$key] ) ) { - $newheaders[$key] = array( $newheaders[$key], trim( $value ) ); - } else { - $newheaders[$key] = trim( $value ); - } - if ( 'set-cookie' == strtolower( $key ) ) - $cookies[] = new WP_Http_Cookie( $value ); - } - } - - return array('response' => $response, 'headers' => $newheaders, 'cookies' => $cookies); - } - - /** - * Takes the arguments for a ::request() and checks for the cookie array. - * - * If it's found, then it's assumed to contain WP_Http_Cookie objects, which are each parsed - * into strings and added to the Cookie: header (within the arguments array). Edits the array by - * reference. - * - * @access public - * @version 2.8.0 - * @static - * - * @param array $r Full array of args passed into ::request() - */ - function buildCookieHeader( &$r ) { - if ( ! empty($r['cookies']) ) { - $cookies_header = ''; - foreach ( (array) $r['cookies'] as $cookie ) { - $cookies_header .= $cookie->getHeaderValue() . '; '; - } - $cookies_header = substr( $cookies_header, 0, -2 ); - $r['headers']['cookie'] = $cookies_header; - } - } - - /** - * Decodes chunk transfer-encoding, based off the HTTP 1.1 specification. - * - * Based off the HTTP http_encoding_dechunk function. Does not support UTF-8. Does not support - * returning footer headers. Shouldn't be too difficult to support it though. - * - * @todo Add support for footer chunked headers. - * @access public - * @since 2.7.0 - * @static - * - * @param string $body Body content - * @return string Chunked decoded body on success or raw body on failure. - */ - function chunkTransferDecode($body) { - $body = str_replace(array("\r\n", "\r"), "\n", $body); - // The body is not chunked encoding or is malformed. - if ( ! preg_match( '/^[0-9a-f]+(\s|\n)+/mi', trim($body) ) ) - return $body; - - $parsedBody = ''; - //$parsedHeaders = array(); Unsupported - - while ( true ) { - $hasChunk = (bool) preg_match( '/^([0-9a-f]+)(\s|\n)+/mi', $body, $match ); - - if ( $hasChunk ) { - if ( empty( $match[1] ) ) - return $body; - - $length = hexdec( $match[1] ); - $chunkLength = strlen( $match[0] ); - - $strBody = substr($body, $chunkLength, $length); - $parsedBody .= $strBody; - - $body = ltrim(str_replace(array($match[0], $strBody), '', $body), "\n"); - - if ( "0" == trim($body) ) - return $parsedBody; // Ignore footer headers. - } else { - return $body; - } - } - } - - /** - * Block requests through the proxy. - * - * Those who are behind a proxy and want to prevent access to certain hosts may do so. This will - * prevent plugins from working and core functionality, if you don't include api.wordpress.org. - * - * You block external URL requests by defining WP_HTTP_BLOCK_EXTERNAL in your wp-config.php file - * and this will only allow localhost and your blog to make requests. The constant - * WP_ACCESSIBLE_HOSTS will allow additional hosts to go through for requests. The format of the - * WP_ACCESSIBLE_HOSTS constant is a comma separated list of hostnames to allow. - * - * @since 2.8.0 - * @link http://core.trac.wordpress.org/ticket/8927 Allow preventing external requests. - * - * @param string $uri URI of url. - * @return bool True to block, false to allow. - */ - function block_request($uri) { - // We don't need to block requests, because nothing is blocked. - if ( ! defined('WP_HTTP_BLOCK_EXTERNAL') || ( defined('WP_HTTP_BLOCK_EXTERNAL') && WP_HTTP_BLOCK_EXTERNAL == false ) ) - return false; - - // parse_url() only handles http, https type URLs, and will emit E_WARNING on failure. - // This will be displayed on blogs, which is not reasonable. - $check = @parse_url($uri); - - /* Malformed URL, can not process, but this could mean ssl, so let through anyway. - * - * This isn't very security sound. There are instances where a hacker might attempt - * to bypass the proxy and this check. However, the reason for this behavior is that - * WordPress does not do any checking currently for non-proxy requests, so it is keeps with - * the default unsecure nature of the HTTP request. - */ - if ( $check === false ) - return false; - - $home = parse_url( get_option('siteurl') ); - - // Don't block requests back to ourselves by default - if ( $check['host'] == 'localhost' || $check['host'] == $home['host'] ) - return apply_filters('block_local_requests', false); - - if ( !defined('WP_ACCESSIBLE_HOSTS') ) - return true; - - static $accessible_hosts; - if ( null == $accessible_hosts ) - $accessible_hosts = preg_split('|,\s*|', WP_ACCESSIBLE_HOSTS); - - return !in_array( $check['host'], $accessible_hosts ); //Inverse logic, If its in the array, then we can't access it. - } -} - -/** - * HTTP request method uses fsockopen function to retrieve the url. - * - * This would be the preferred method, but the fsockopen implementation has the most overhead of all - * the HTTP transport implementations. - * - * @package WordPress - * @subpackage HTTP - * @since 2.7.0 - */ -class WP_Http_Fsockopen { - /** - * Send a HTTP request to a URI using fsockopen(). - * - * Does not support non-blocking mode. - * - * @see WP_Http::request For default options descriptions. - * - * @since 2.7 - * @access public - * @param string $url URI resource. - * @param str|array $args Optional. Override the defaults. - * @return array 'headers', 'body', 'cookies' and 'response' keys. - */ - function request($url, $args = array()) { - $defaults = array( - 'method' => 'GET', 'timeout' => 5, - 'redirection' => 5, 'httpversion' => '1.0', - 'blocking' => true, - 'headers' => array(), 'body' => null, 'cookies' => array() - ); - - $r = wp_parse_args( $args, $defaults ); - - if ( isset($r['headers']['User-Agent']) ) { - $r['user-agent'] = $r['headers']['User-Agent']; - unset($r['headers']['User-Agent']); - } else if( isset($r['headers']['user-agent']) ) { - $r['user-agent'] = $r['headers']['user-agent']; - unset($r['headers']['user-agent']); - } - - // Construct Cookie: header if any cookies are set - WP_Http::buildCookieHeader( $r ); - - $iError = null; // Store error number - $strError = null; // Store error string - - $arrURL = parse_url($url); - - $fsockopen_host = $arrURL['host']; - - $secure_transport = false; - - if ( ! isset( $arrURL['port'] ) ) { - if ( ( $arrURL['scheme'] == 'ssl' || $arrURL['scheme'] == 'https' ) && extension_loaded('openssl') ) { - $fsockopen_host = "ssl://$fsockopen_host"; - $arrURL['port'] = 443; - $secure_transport = true; - } else { - $arrURL['port'] = 80; - } - } - - //fsockopen has issues with 'localhost' with IPv6 with certain versions of PHP, It attempts to connect to ::1, - // which fails when the server is not setup for it. For compatibility, always connect to the IPv4 address. - if ( 'localhost' == strtolower($fsockopen_host) ) - $fsockopen_host = '127.0.0.1'; - - // There are issues with the HTTPS and SSL protocols that cause errors that can be safely - // ignored and should be ignored. - if ( true === $secure_transport ) - $error_reporting = error_reporting(0); - - $startDelay = time(); - - $proxy = new WP_HTTP_Proxy(); - - if ( !WP_DEBUG ) { - if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) - $handle = @fsockopen( $proxy->host(), $proxy->port(), $iError, $strError, $r['timeout'] ); - else - $handle = @fsockopen( $fsockopen_host, $arrURL['port'], $iError, $strError, $r['timeout'] ); - } else { - if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) - $handle = fsockopen( $proxy->host(), $proxy->port(), $iError, $strError, $r['timeout'] ); - else - $handle = fsockopen( $fsockopen_host, $arrURL['port'], $iError, $strError, $r['timeout'] ); - } - - $endDelay = time(); - - // If the delay is greater than the timeout then fsockopen should't be used, because it will - // cause a long delay. - $elapseDelay = ($endDelay-$startDelay) > $r['timeout']; - if ( true === $elapseDelay ) - add_option( 'disable_fsockopen', $endDelay, null, true ); - - if ( false === $handle ) - return new WP_Error('http_request_failed', $iError . ': ' . $strError); - - $timeout = (int) floor( $r['timeout'] ); - $utimeout = $timeout == $r['timeout'] ? 0 : 1000000 * $r['timeout'] % 1000000; - stream_set_timeout( $handle, $timeout, $utimeout ); - - if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) //Some proxies require full URL in this field. - $requestPath = $url; - else - $requestPath = $arrURL['path'] . ( isset($arrURL['query']) ? '?' . $arrURL['query'] : '' ); - - if ( empty($requestPath) ) - $requestPath .= '/'; - - $strHeaders = strtoupper($r['method']) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n"; - - if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) - $strHeaders .= 'Host: ' . $arrURL['host'] . ':' . $arrURL['port'] . "\r\n"; - else - $strHeaders .= 'Host: ' . $arrURL['host'] . "\r\n"; - - if ( isset($r['user-agent']) ) - $strHeaders .= 'User-agent: ' . $r['user-agent'] . "\r\n"; - - if ( is_array($r['headers']) ) { - foreach ( (array) $r['headers'] as $header => $headerValue ) - $strHeaders .= $header . ': ' . $headerValue . "\r\n"; - } else { - $strHeaders .= $r['headers']; - } - - if ( $proxy->use_authentication() ) - $strHeaders .= $proxy->authentication_header() . "\r\n"; - - $strHeaders .= "\r\n"; - - if ( ! is_null($r['body']) ) - $strHeaders .= $r['body']; - - fwrite($handle, $strHeaders); - - if ( ! $r['blocking'] ) { - fclose($handle); - return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); - } - - $strResponse = ''; - while ( ! feof($handle) ) - $strResponse .= fread($handle, 4096); - - fclose($handle); - - if ( true === $secure_transport ) - error_reporting($error_reporting); - - $process = WP_Http::processResponse($strResponse); - $arrHeaders = WP_Http::processHeaders($process['headers']); - - // Is the response code within the 400 range? - if ( (int) $arrHeaders['response']['code'] >= 400 && (int) $arrHeaders['response']['code'] < 500 ) - return new WP_Error('http_request_failed', $arrHeaders['response']['code'] . ': ' . $arrHeaders['response']['message']); - - // If location is found, then assume redirect and redirect to location. - if ( isset($arrHeaders['headers']['location']) ) { - if ( $r['redirection']-- > 0 ) { - return $this->request($arrHeaders['headers']['location'], $r); - } else { - return new WP_Error('http_request_failed', __('Too many redirects.')); - } - } - - // If the body was chunk encoded, then decode it. - if ( ! empty( $process['body'] ) && isset( $arrHeaders['headers']['transfer-encoding'] ) && 'chunked' == $arrHeaders['headers']['transfer-encoding'] ) - $process['body'] = WP_Http::chunkTransferDecode($process['body']); - - if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($arrHeaders['headers']) ) - $process['body'] = WP_Http_Encoding::decompress( $process['body'] ); - - return array('headers' => $arrHeaders['headers'], 'body' => $process['body'], 'response' => $arrHeaders['response'], 'cookies' => $arrHeaders['cookies']); - } - - /** - * Whether this class can be used for retrieving an URL. - * - * @since 2.7.0 - * @static - * @return boolean False means this class can not be used, true means it can. - */ - function test( $args = array() ) { - if ( false !== ($option = get_option( 'disable_fsockopen' )) && time()-$option < 43200 ) // 12 hours - return false; - - $is_ssl = isset($args['ssl']) && $args['ssl']; - - if ( ! $is_ssl && function_exists( 'fsockopen' ) ) - $use = true; - elseif ( $is_ssl && extension_loaded('openssl') && function_exists( 'fsockopen' ) ) - $use = true; - else - $use = false; - - return apply_filters('use_fsockopen_transport', $use, $args); - } -} - -/** - * HTTP request method uses fopen function to retrieve the url. - * - * Requires PHP version greater than 4.3.0 for stream support. Does not allow for $context support, - * but should still be okay, to write the headers, before getting the response. Also requires that - * 'allow_url_fopen' to be enabled. - * - * @package WordPress - * @subpackage HTTP - * @since 2.7.0 - */ -class WP_Http_Fopen { - /** - * Send a HTTP request to a URI using fopen(). - * - * This transport does not support sending of headers and body, therefore should not be used in - * the instances, where there is a body and headers. - * - * Notes: Does not support non-blocking mode. Ignores 'redirection' option. - * - * @see WP_Http::retrieve For default options descriptions. - * - * @access public - * @since 2.7.0 - * - * @param string $url URI resource. - * @param str|array $args Optional. Override the defaults. - * @return array 'headers', 'body', 'cookies' and 'response' keys. - */ - function request($url, $args = array()) { - $defaults = array( - 'method' => 'GET', 'timeout' => 5, - 'redirection' => 5, 'httpversion' => '1.0', - 'blocking' => true, - 'headers' => array(), 'body' => null, 'cookies' => array() - ); - - $r = wp_parse_args( $args, $defaults ); - - $arrURL = parse_url($url); - - if ( false === $arrURL ) - return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url)); - - if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] ) - $url = str_replace($arrURL['scheme'], 'http', $url); - - if ( !WP_DEBUG ) - $handle = @fopen($url, 'r'); - else - $handle = fopen($url, 'r'); - - if (! $handle) - return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url)); - - $timeout = (int) floor( $r['timeout'] ); - $utimeout = $timeout == $r['timeout'] ? 0 : 1000000 * $r['timeout'] % 1000000; - stream_set_timeout( $handle, $timeout, $utimeout ); - - if ( ! $r['blocking'] ) { - fclose($handle); - return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); - } - - $strResponse = ''; - while ( ! feof($handle) ) - $strResponse .= fread($handle, 4096); - - if ( function_exists('stream_get_meta_data') ) { - $meta = stream_get_meta_data($handle); - $theHeaders = $meta['wrapper_data']; - if ( isset( $meta['wrapper_data']['headers'] ) ) - $theHeaders = $meta['wrapper_data']['headers']; - } else { - //$http_response_header is a PHP reserved variable which is set in the current-scope when using the HTTP Wrapper - //see http://php.oregonstate.edu/manual/en/reserved.variables.httpresponseheader.php - $theHeaders = $http_response_header; - } - - fclose($handle); - - $processedHeaders = WP_Http::processHeaders($theHeaders); - - if ( ! empty( $strResponse ) && isset( $processedHeaders['headers']['transfer-encoding'] ) && 'chunked' == $processedHeaders['headers']['transfer-encoding'] ) - $strResponse = WP_Http::chunkTransferDecode($strResponse); - - if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($processedHeaders['headers']) ) - $strResponse = WP_Http_Encoding::decompress( $strResponse ); - - return array('headers' => $processedHeaders['headers'], 'body' => $strResponse, 'response' => $processedHeaders['response'], 'cookies' => $processedHeaders['cookies']); - } - - /** - * Whether this class can be used for retrieving an URL. - * - * @since 2.7.0 - * @static - * @return boolean False means this class can not be used, true means it can. - */ - function test($args = array()) { - if ( ! function_exists('fopen') || (function_exists('ini_get') && true != ini_get('allow_url_fopen')) ) - return false; - - $use = true; - - //PHP does not verify SSL certs, We can only make a request via this transports if SSL Verification is turned off. - $is_ssl = isset($args['ssl']) && $args['ssl']; - if ( $is_ssl ) { - $is_local = isset($args['local']) && $args['local']; - $ssl_verify = isset($args['sslverify']) && $args['sslverify']; - if ( $is_local && true != apply_filters('https_local_ssl_verify', true) ) - $use = true; - elseif ( !$is_local && true != apply_filters('https_ssl_verify', true) ) - $use = true; - elseif ( !$ssl_verify ) - $use = true; - else - $use = false; - } - - return apply_filters('use_fopen_transport', $use, $args); - } -} - -/** - * HTTP request method uses Streams to retrieve the url. - * - * Requires PHP 5.0+ and uses fopen with stream context. Requires that 'allow_url_fopen' PHP setting - * to be enabled. - * - * Second preferred method for getting the URL, for PHP 5. - * - * @package WordPress - * @subpackage HTTP - * @since 2.7.0 - */ -class WP_Http_Streams { - /** - * Send a HTTP request to a URI using streams with fopen(). - * - * @access public - * @since 2.7.0 - * - * @param string $url - * @param str|array $args Optional. Override the defaults. - * @return array 'headers', 'body', 'cookies' and 'response' keys. - */ - function request($url, $args = array()) { - $defaults = array( - 'method' => 'GET', 'timeout' => 5, - 'redirection' => 5, 'httpversion' => '1.0', - 'blocking' => true, - 'headers' => array(), 'body' => null, 'cookies' => array() - ); - - $r = wp_parse_args( $args, $defaults ); - - if ( isset($r['headers']['User-Agent']) ) { - $r['user-agent'] = $r['headers']['User-Agent']; - unset($r['headers']['User-Agent']); - } else if( isset($r['headers']['user-agent']) ) { - $r['user-agent'] = $r['headers']['user-agent']; - unset($r['headers']['user-agent']); - } - - // Construct Cookie: header if any cookies are set - WP_Http::buildCookieHeader( $r ); - - $arrURL = parse_url($url); - - if ( false === $arrURL ) - return new WP_Error('http_request_failed', sprintf(__('Malformed URL: %s'), $url)); - - if ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] ) - $url = preg_replace('|^' . preg_quote($arrURL['scheme'], '|') . '|', 'http', $url); - - // Convert Header array to string. - $strHeaders = ''; - if ( is_array( $r['headers'] ) ) - foreach ( $r['headers'] as $name => $value ) - $strHeaders .= "{$name}: $value\r\n"; - else if ( is_string( $r['headers'] ) ) - $strHeaders = $r['headers']; - - $is_local = isset($args['local']) && $args['local']; - $ssl_verify = isset($args['sslverify']) && $args['sslverify']; - if ( $is_local ) - $ssl_verify = apply_filters('https_local_ssl_verify', $ssl_verify); - elseif ( ! $is_local ) - $ssl_verify = apply_filters('https_ssl_verify', $ssl_verify); - - $arrContext = array('http' => - array( - 'method' => strtoupper($r['method']), - 'user_agent' => $r['user-agent'], - 'max_redirects' => $r['redirection'], - 'protocol_version' => (float) $r['httpversion'], - 'header' => $strHeaders, - 'timeout' => $r['timeout'], - 'ssl' => array( - 'verify_peer' => $ssl_verify, - 'verify_host' => $ssl_verify - ) - ) - ); - - $proxy = new WP_HTTP_Proxy(); - - if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { - $arrContext['http']['proxy'] = 'tcp://' . $proxy->host() . ':' . $proxy->port(); - $arrContext['http']['request_fulluri'] = true; - - // We only support Basic authentication so this will only work if that is what your proxy supports. - if ( $proxy->use_authentication() ) - $arrContext['http']['header'] .= $proxy->authentication_header() . "\r\n"; - } - - if ( ! is_null($r['body']) && ! empty($r['body'] ) ) - $arrContext['http']['content'] = $r['body']; - - $context = stream_context_create($arrContext); - - if ( !WP_DEBUG ) - $handle = @fopen($url, 'r', false, $context); - else - $handle = fopen($url, 'r', false, $context); - - if ( ! $handle) - return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url)); - - $timeout = (int) floor( $r['timeout'] ); - $utimeout = $timeout == $r['timeout'] ? 0 : 1000000 * $r['timeout'] % 1000000; - stream_set_timeout( $handle, $timeout, $utimeout ); - - if ( ! $r['blocking'] ) { - stream_set_blocking($handle, 0); - fclose($handle); - return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); - } - - $strResponse = stream_get_contents($handle); - $meta = stream_get_meta_data($handle); - - fclose($handle); - - $processedHeaders = array(); - if ( isset( $meta['wrapper_data']['headers'] ) ) - $processedHeaders = WP_Http::processHeaders($meta['wrapper_data']['headers']); - else - $processedHeaders = WP_Http::processHeaders($meta['wrapper_data']); - - if ( ! empty( $strResponse ) && isset( $processedHeaders['headers']['transfer-encoding'] ) && 'chunked' == $processedHeaders['headers']['transfer-encoding'] ) - $strResponse = WP_Http::chunkTransferDecode($strResponse); - - if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($processedHeaders['headers']) ) - $strResponse = WP_Http_Encoding::decompress( $strResponse ); - - return array('headers' => $processedHeaders['headers'], 'body' => $strResponse, 'response' => $processedHeaders['response'], 'cookies' => $processedHeaders['cookies']); - } - - /** - * Whether this class can be used for retrieving an URL. - * - * @static - * @access public - * @since 2.7.0 - * - * @return boolean False means this class can not be used, true means it can. - */ - function test($args = array()) { - if ( ! function_exists('fopen') || (function_exists('ini_get') && true != ini_get('allow_url_fopen')) ) - return false; - - if ( version_compare(PHP_VERSION, '5.0', '<') ) - return false; - - //HTTPS via Proxy was added in 5.1.0 - $is_ssl = isset($args['ssl']) && $args['ssl']; - if ( $is_ssl && version_compare(PHP_VERSION, '5.1.0', '<') ) { - $proxy = new WP_HTTP_Proxy(); - /** - * No URL check, as its not currently passed to the ::test() function - * In the case where a Proxy is in use, Just bypass this transport for HTTPS. - */ - if ( $proxy->is_enabled() ) - return false; - } - - return apply_filters('use_streams_transport', true, $args); - } -} - -/** - * HTTP request method uses HTTP extension to retrieve the url. - * - * Requires the HTTP extension to be installed. This would be the preferred transport since it can - * handle a lot of the problems that forces the others to use the HTTP version 1.0. Even if PHP 5.2+ - * is being used, it doesn't mean that the HTTP extension will be enabled. - * - * @package WordPress - * @subpackage HTTP - * @since 2.7.0 - */ -class WP_Http_ExtHTTP { - /** - * Send a HTTP request to a URI using HTTP extension. - * - * Does not support non-blocking. - * - * @access public - * @since 2.7 - * - * @param string $url - * @param str|array $args Optional. Override the defaults. - * @return array 'headers', 'body', 'cookies' and 'response' keys. - */ - function request($url, $args = array()) { - $defaults = array( - 'method' => 'GET', 'timeout' => 5, - 'redirection' => 5, 'httpversion' => '1.0', - 'blocking' => true, - 'headers' => array(), 'body' => null, 'cookies' => array() - ); - - $r = wp_parse_args( $args, $defaults ); - - if ( isset($r['headers']['User-Agent']) ) { - $r['user-agent'] = $r['headers']['User-Agent']; - unset($r['headers']['User-Agent']); - } else if( isset($r['headers']['user-agent']) ) { - $r['user-agent'] = $r['headers']['user-agent']; - unset($r['headers']['user-agent']); - } - - // Construct Cookie: header if any cookies are set - WP_Http::buildCookieHeader( $r ); - - switch ( $r['method'] ) { - case 'POST': - $r['method'] = HTTP_METH_POST; - break; - case 'HEAD': - $r['method'] = HTTP_METH_HEAD; - break; - case 'PUT': - $r['method'] = HTTP_METH_PUT; - break; - case 'GET': - default: - $r['method'] = HTTP_METH_GET; - } - - $arrURL = parse_url($url); - - if ( 'http' != $arrURL['scheme'] || 'https' != $arrURL['scheme'] ) - $url = preg_replace('|^' . preg_quote($arrURL['scheme'], '|') . '|', 'http', $url); - - $is_local = isset($args['local']) && $args['local']; - $ssl_verify = isset($args['sslverify']) && $args['sslverify']; - if ( $is_local ) - $ssl_verify = apply_filters('https_local_ssl_verify', $ssl_verify); - elseif ( ! $is_local ) - $ssl_verify = apply_filters('https_ssl_verify', $ssl_verify); - - $r['timeout'] = (int) ceil( $r['timeout'] ); - - $options = array( - 'timeout' => $r['timeout'], - 'connecttimeout' => $r['timeout'], - 'redirect' => $r['redirection'], - 'useragent' => $r['user-agent'], - 'headers' => $r['headers'], - 'ssl' => array( - 'verifypeer' => $ssl_verify, - 'verifyhost' => $ssl_verify - ) - ); - - // The HTTP extensions offers really easy proxy support. - $proxy = new WP_HTTP_Proxy(); - - if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { - $options['proxyhost'] = $proxy->host(); - $options['proxyport'] = $proxy->port(); - $options['proxytype'] = HTTP_PROXY_HTTP; - - if ( $proxy->use_authentication() ) { - $options['proxyauth'] = $proxy->authentication(); - $options['proxyauthtype'] = HTTP_AUTH_BASIC; - } - } - - if ( !WP_DEBUG ) //Emits warning level notices for max redirects and timeouts - $strResponse = @http_request($r['method'], $url, $r['body'], $options, $info); - else - $strResponse = http_request($r['method'], $url, $r['body'], $options, $info); //Emits warning level notices for max redirects and timeouts - - // Error may still be set, Response may return headers or partial document, and error - // contains a reason the request was aborted, eg, timeout expired or max-redirects reached. - if ( false === $strResponse || ! empty($info['error']) ) - return new WP_Error('http_request_failed', $info['response_code'] . ': ' . $info['error']); - - if ( ! $r['blocking'] ) - return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); - - list($theHeaders, $theBody) = explode("\r\n\r\n", $strResponse, 2); - $theHeaders = WP_Http::processHeaders($theHeaders); - - if ( ! empty( $theBody ) && isset( $theHeaders['headers']['transfer-encoding'] ) && 'chunked' == $theHeaders['headers']['transfer-encoding'] ) { - if ( !WP_DEBUG ) - $theBody = @http_chunked_decode($theBody); - else - $theBody = http_chunked_decode($theBody); - } - - if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($theHeaders['headers']) ) - $theBody = http_inflate( $theBody ); - - $theResponse = array(); - $theResponse['code'] = $info['response_code']; - $theResponse['message'] = get_status_header_desc($info['response_code']); - - return array('headers' => $theHeaders['headers'], 'body' => $theBody, 'response' => $theResponse, 'cookies' => $theHeaders['cookies']); - } - - /** - * Whether this class can be used for retrieving an URL. - * - * @static - * @since 2.7.0 - * - * @return boolean False means this class can not be used, true means it can. - */ - function test($args = array()) { - return apply_filters('use_http_extension_transport', function_exists('http_request'), $args ); - } -} - -/** - * HTTP request method uses Curl extension to retrieve the url. - * - * Requires the Curl extension to be installed. - * - * @package WordPress - * @subpackage HTTP - * @since 2.7 - */ -class WP_Http_Curl { - - /** - * Send a HTTP request to a URI using cURL extension. - * - * @access public - * @since 2.7.0 - * - * @param string $url - * @param str|array $args Optional. Override the defaults. - * @return array 'headers', 'body', 'cookies' and 'response' keys. - */ - function request($url, $args = array()) { - $defaults = array( - 'method' => 'GET', 'timeout' => 5, - 'redirection' => 5, 'httpversion' => '1.0', - 'blocking' => true, - 'headers' => array(), 'body' => null, 'cookies' => array() - ); - - $r = wp_parse_args( $args, $defaults ); - - if ( isset($r['headers']['User-Agent']) ) { - $r['user-agent'] = $r['headers']['User-Agent']; - unset($r['headers']['User-Agent']); - } else if( isset($r['headers']['user-agent']) ) { - $r['user-agent'] = $r['headers']['user-agent']; - unset($r['headers']['user-agent']); - } - - // Construct Cookie: header if any cookies are set. - WP_Http::buildCookieHeader( $r ); - - $handle = curl_init(); - - // cURL offers really easy proxy support. - $proxy = new WP_HTTP_Proxy(); - - if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { - - $isPHP5 = version_compare(PHP_VERSION, '5.0.0', '>='); - - if ( $isPHP5 ) { - curl_setopt( $handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP ); - curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() ); - curl_setopt( $handle, CURLOPT_PROXYPORT, $proxy->port() ); - } else { - curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() .':'. $proxy->port() ); - } - - if ( $proxy->use_authentication() ) { - if ( $isPHP5 ) - curl_setopt( $handle, CURLOPT_PROXYAUTH, CURLAUTH_BASIC ); - - curl_setopt( $handle, CURLOPT_PROXYUSERPWD, $proxy->authentication() ); - } - } - - $is_local = isset($args['local']) && $args['local']; - $ssl_verify = isset($args['sslverify']) && $args['sslverify']; - if ( $is_local ) - $ssl_verify = apply_filters('https_local_ssl_verify', $ssl_verify); - elseif ( ! $is_local ) - $ssl_verify = apply_filters('https_ssl_verify', $ssl_verify); - - - // CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers. Have to use ceil since - // a value of 0 will allow an ulimited timeout. - $timeout = (int) ceil( $r['timeout'] ); - curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout ); - curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout ); - - curl_setopt( $handle, CURLOPT_URL, $url); - curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true ); - curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, $ssl_verify ); - curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify ); - curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] ); - curl_setopt( $handle, CURLOPT_MAXREDIRS, $r['redirection'] ); - - switch ( $r['method'] ) { - case 'HEAD': - curl_setopt( $handle, CURLOPT_NOBODY, true ); - break; - case 'POST': - curl_setopt( $handle, CURLOPT_POST, true ); - curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] ); - break; - case 'PUT': - curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, 'PUT' ); - curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] ); - break; - } - - if ( true === $r['blocking'] ) - curl_setopt( $handle, CURLOPT_HEADER, true ); - else - curl_setopt( $handle, CURLOPT_HEADER, false ); - - // The option doesn't work with safe mode or when open_basedir is set. - if ( !ini_get('safe_mode') && !ini_get('open_basedir') ) - curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, true ); - - if ( !empty( $r['headers'] ) ) { - // cURL expects full header strings in each element - $headers = array(); - foreach ( $r['headers'] as $name => $value ) { - $headers[] = "{$name}: $value"; - } - curl_setopt( $handle, CURLOPT_HTTPHEADER, $headers ); - } - - if ( $r['httpversion'] == '1.0' ) - curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0 ); - else - curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 ); - - // Cookies are not handled by the HTTP API currently. Allow for plugin authors to handle it - // themselves... Although, it is somewhat pointless without some reference. - do_action_ref_array( 'http_api_curl', array(&$handle) ); - - // We don't need to return the body, so don't. Just execute request and return. - if ( ! $r['blocking'] ) { - curl_exec( $handle ); - curl_close( $handle ); - return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() ); - } - - $theResponse = curl_exec( $handle ); - - if ( !empty($theResponse) ) { - $headerLength = curl_getinfo($handle, CURLINFO_HEADER_SIZE); - $theHeaders = trim( substr($theResponse, 0, $headerLength) ); - $theBody = substr( $theResponse, $headerLength ); - if ( false !== strrpos($theHeaders, "\r\n\r\n") ) { - $headerParts = explode("\r\n\r\n", $theHeaders); - $theHeaders = $headerParts[ count($headerParts) -1 ]; - } - $theHeaders = WP_Http::processHeaders($theHeaders); - } else { - if ( $curl_error = curl_error($handle) ) - return new WP_Error('http_request_failed', $curl_error); - if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array(301, 302) ) ) - return new WP_Error('http_request_failed', __('Too many redirects.')); - - $theHeaders = array( 'headers' => array(), 'cookies' => array() ); - $theBody = ''; - } - - $response = array(); - $response['code'] = curl_getinfo( $handle, CURLINFO_HTTP_CODE ); - $response['message'] = get_status_header_desc($response['code']); - - curl_close( $handle ); - - if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($theHeaders['headers']) ) - $theBody = WP_Http_Encoding::decompress( $theBody ); - - return array('headers' => $theHeaders['headers'], 'body' => $theBody, 'response' => $response, 'cookies' => $theHeaders['cookies']); - } - - /** - * Whether this class can be used for retrieving an URL. - * - * @static - * @since 2.7.0 - * - * @return boolean False means this class can not be used, true means it can. - */ - function test($args = array()) { - if ( function_exists('curl_init') && function_exists('curl_exec') ) - return apply_filters('use_curl_transport', true, $args); - - return false; - } -} - -/** - * Adds Proxy support to the WordPress HTTP API. - * - * There are caveats to proxy support. It requires that defines be made in the wp-config.php file to - * enable proxy support. There are also a few filters that plugins can hook into for some of the - * constants. - * - * The constants are as follows: - *
            - *
          1. WP_PROXY_HOST - Enable proxy support and host for connecting.
          2. - *
          3. WP_PROXY_PORT - Proxy port for connection. No default, must be defined.
          4. - *
          5. WP_PROXY_USERNAME - Proxy username, if it requires authentication.
          6. - *
          7. WP_PROXY_PASSWORD - Proxy password, if it requires authentication.
          8. - *
          9. WP_PROXY_BYPASS_HOSTS - Will prevent the hosts in this list from going through the proxy. - * You do not need to have localhost and the blog host in this list, because they will not be passed - * through the proxy. The list should be presented in a comma separated list
          10. - *
          - * - * An example can be as seen below. - * - * define('WP_PROXY_HOST', '192.168.84.101'); - * define('WP_PROXY_PORT', '8080'); - * define('WP_PROXY_BYPASS_HOSTS', 'localhost, www.example.com'); - * - * - * @link http://core.trac.wordpress.org/ticket/4011 Proxy support ticket in WordPress. - * @since 2.8 - */ -class WP_HTTP_Proxy { - - /** - * Whether proxy connection should be used. - * - * @since 2.8 - * @use WP_PROXY_HOST - * @use WP_PROXY_PORT - * - * @return bool - */ - function is_enabled() { - return defined('WP_PROXY_HOST') && defined('WP_PROXY_PORT'); - } - - /** - * Whether authentication should be used. - * - * @since 2.8 - * @use WP_PROXY_USERNAME - * @use WP_PROXY_PASSWORD - * - * @return bool - */ - function use_authentication() { - return defined('WP_PROXY_USERNAME') && defined('WP_PROXY_PASSWORD'); - } - - /** - * Retrieve the host for the proxy server. - * - * @since 2.8 - * - * @return string - */ - function host() { - if ( defined('WP_PROXY_HOST') ) - return WP_PROXY_HOST; - - return ''; - } - - /** - * Retrieve the port for the proxy server. - * - * @since 2.8 - * - * @return string - */ - function port() { - if ( defined('WP_PROXY_PORT') ) - return WP_PROXY_PORT; - - return ''; - } - - /** - * Retrieve the username for proxy authentication. - * - * @since 2.8 - * - * @return string - */ - function username() { - if ( defined('WP_PROXY_USERNAME') ) - return WP_PROXY_USERNAME; - - return ''; - } - - /** - * Retrieve the password for proxy authentication. - * - * @since 2.8 - * - * @return string - */ - function password() { - if ( defined('WP_PROXY_PASSWORD') ) - return WP_PROXY_PASSWORD; - - return ''; - } - - /** - * Retrieve authentication string for proxy authentication. - * - * @since 2.8 - * - * @return string - */ - function authentication() { - return $this->username() . ':' . $this->password(); - } - - /** - * Retrieve header string for proxy authentication. - * - * @since 2.8 - * - * @return string - */ - function authentication_header() { - return 'Proxy-Authentication: Basic ' . base64_encode( $this->authentication() ); - } - - /** - * Whether URL should be sent through the proxy server. - * - * We want to keep localhost and the blog URL from being sent through the proxy server, because - * some proxies can not handle this. We also have the constant available for defining other - * hosts that won't be sent through the proxy. - * - * @uses WP_PROXY_BYPASS_HOSTS - * @since unknown - * - * @param string $uri URI to check. - * @return bool True, to send through the proxy and false if, the proxy should not be used. - */ - function send_through_proxy( $uri ) { - // parse_url() only handles http, https type URLs, and will emit E_WARNING on failure. - // This will be displayed on blogs, which is not reasonable. - $check = @parse_url($uri); - - // Malformed URL, can not process, but this could mean ssl, so let through anyway. - if ( $check === false ) - return true; - - $home = parse_url( get_option('siteurl') ); - - if ( $check['host'] == 'localhost' || $check['host'] == $home['host'] ) - return false; - - if ( !defined('WP_PROXY_BYPASS_HOSTS') ) - return true; - - static $bypass_hosts; - if ( null == $bypass_hosts ) - $bypass_hosts = preg_split('|,\s*|', WP_PROXY_BYPASS_HOSTS); - - return !in_array( $check['host'], $bypass_hosts ); - } -} -/** - * Internal representation of a single cookie. - * - * Returned cookies are represented using this class, and when cookies are set, if they are not - * already a WP_Http_Cookie() object, then they are turned into one. - * - * @todo The WordPress convention is to use underscores instead of camelCase for function and method - * names. Need to switch to use underscores instead for the methods. - * - * @package WordPress - * @subpackage HTTP - * @since 2.8.0 - * @author Beau Lebens - */ -class WP_Http_Cookie { - - /** - * Cookie name. - * - * @since 2.8.0 - * @var string - */ - var $name; - - /** - * Cookie value. - * - * @since 2.8.0 - * @var string - */ - var $value; - - /** - * When the cookie expires. - * - * @since 2.8.0 - * @var string - */ - var $expires; - - /** - * Cookie URL path. - * - * @since 2.8.0 - * @var string - */ - var $path; - - /** - * Cookie Domain. - * - * @since 2.8.0 - * @var string - */ - var $domain; - - /** - * PHP4 style Constructor - Calls PHP5 Style Constructor. - * - * @access public - * @since 2.8.0 - * @param string|array $data Raw cookie data. - */ - function WP_Http_Cookie( $data ) { - $this->__construct( $data ); - } - - /** - * Sets up this cookie object. - * - * The parameter $data should be either an associative array containing the indices names below - * or a header string detailing it. - * - * If it's an array, it should include the following elements: - *
            - *
          1. Name
          2. - *
          3. Value - should NOT be urlencoded already.
          4. - *
          5. Expires - (optional) String or int (UNIX timestamp).
          6. - *
          7. Path (optional)
          8. - *
          9. Domain (optional)
          10. - *
          - * - * @access public - * @since 2.8.0 - * - * @param string|array $data Raw cookie data. - */ - function __construct( $data ) { - if ( is_string( $data ) ) { - // Assume it's a header string direct from a previous request - $pairs = explode( ';', $data ); - - // Special handling for first pair; name=value. Also be careful of "=" in value - $name = trim( substr( $pairs[0], 0, strpos( $pairs[0], '=' ) ) ); - $value = substr( $pairs[0], strpos( $pairs[0], '=' ) + 1 ); - $this->name = $name; - $this->value = urldecode( $value ); - array_shift( $pairs ); //Removes name=value from items. - - // Set everything else as a property - foreach ( $pairs as $pair ) { - if ( empty($pair) ) //Handles the cookie ending in ; which results in a empty final pair - continue; - - list( $key, $val ) = explode( '=', $pair ); - $key = strtolower( trim( $key ) ); - if ( 'expires' == $key ) - $val = strtotime( $val ); - $this->$key = $val; - } - } else { - if ( !isset( $data['name'] ) ) - return false; - - // Set properties based directly on parameters - $this->name = $data['name']; - $this->value = isset( $data['value'] ) ? $data['value'] : ''; - $this->path = isset( $data['path'] ) ? $data['path'] : ''; - $this->domain = isset( $data['domain'] ) ? $data['domain'] : ''; - - if ( isset( $data['expires'] ) ) - $this->expires = is_int( $data['expires'] ) ? $data['expires'] : strtotime( $data['expires'] ); - else - $this->expires = null; - } - } - - /** - * Confirms that it's OK to send this cookie to the URL checked against. - * - * Decision is based on RFC 2109/2965, so look there for details on validity. - * - * @access public - * @since 2.8.0 - * - * @param string $url URL you intend to send this cookie to - * @return boolean TRUE if allowed, FALSE otherwise. - */ - function test( $url ) { - // Expires - if expired then nothing else matters - if ( time() > $this->expires ) - return false; - - // Get details on the URL we're thinking about sending to - $url = parse_url( $url ); - $url['port'] = isset( $url['port'] ) ? $url['port'] : 80; - $url['path'] = isset( $url['path'] ) ? $url['path'] : '/'; - - // Values to use for comparison against the URL - $path = isset( $this->path ) ? $this->path : '/'; - $port = isset( $this->port ) ? $this->port : 80; - $domain = isset( $this->domain ) ? strtolower( $this->domain ) : strtolower( $url['host'] ); - if ( false === stripos( $domain, '.' ) ) - $domain .= '.local'; - - // Host - very basic check that the request URL ends with the domain restriction (minus leading dot) - $domain = substr( $domain, 0, 1 ) == '.' ? substr( $domain, 1 ) : $domain; - if ( substr( $url['host'], -strlen( $domain ) ) != $domain ) - return false; - - // Port - supports "port-lists" in the format: "80,8000,8080" - if ( !in_array( $url['port'], explode( ',', $port) ) ) - return false; - - // Path - request path must start with path restriction - if ( substr( $url['path'], 0, strlen( $path ) ) != $path ) - return false; - - return true; - } - - /** - * Convert cookie name and value back to header string. - * - * @access public - * @since 2.8.0 - * - * @return string Header encoded cookie name and value. - */ - function getHeaderValue() { - if ( empty( $this->name ) || empty( $this->value ) ) - return ''; - - return $this->name . '=' . urlencode( $this->value ); - } - - /** - * Retrieve cookie header for usage in the rest of the WordPress HTTP API. - * - * @access public - * @since 2.8.0 - * - * @return string - */ - function getFullHeader() { - return 'Cookie: ' . $this->getHeaderValue(); - } -} - -/** - * Implementation for deflate and gzip transfer encodings. - * - * Includes RFC 1950, RFC 1951, and RFC 1952. - * - * @since 2.8 - * @package WordPress - * @subpackage HTTP - */ -class WP_Http_Encoding { - - /** - * Compress raw string using the deflate format. - * - * Supports the RFC 1951 standard. - * - * @since 2.8 - * - * @param string $raw String to compress. - * @param int $level Optional, default is 9. Compression level, 9 is highest. - * @param string $supports Optional, not used. When implemented it will choose the right compression based on what the server supports. - * @return string|bool False on failure. - */ - function compress( $raw, $level = 9, $supports = null ) { - return gzdeflate( $raw, $level ); - } - - /** - * Decompression of deflated string. - * - * Will attempt to decompress using the RFC 1950 standard, and if that fails - * then the RFC 1951 standard deflate will be attempted. Finally, the RFC - * 1952 standard gzip decode will be attempted. If all fail, then the - * original compressed string will be returned. - * - * @since 2.8 - * - * @param string $compressed String to decompress. - * @param int $length The optional length of the compressed data. - * @return string|bool False on failure. - */ - function decompress( $compressed, $length = null ) { - - if ( false !== ( $decompressed = @gzinflate( $compressed ) ) ) - return $decompressed; - - if ( false !== ( $decompressed = WP_Http_Encoding::compatible_gzinflate( $compressed ) ) ) - return $decompressed; - - if ( false !== ( $decompressed = @gzuncompress( $compressed ) ) ) - return $decompressed; - - if ( function_exists('gzdecode') ) { - $decompressed = @gzdecode( $compressed ); - - if ( false !== $decompressed ) - return $decompressed; - } - - return $compressed; - } - - /** - * Decompression of deflated string while staying compatible with the majority of servers. - * - * Certain Servers will return deflated data with headers which PHP's gziniflate() - * function cannot handle out of the box. The following function lifted from - * http://au2.php.net/manual/en/function.gzinflate.php#77336 will attempt to deflate - * the various return forms used. - * - * @since 2.8.1 - * @link http://au2.php.net/manual/en/function.gzinflate.php#77336 - * - * @param string $gzData String to decompress. - * @return string|bool False on failure. - */ - function compatible_gzinflate($gzData) { - if ( substr($gzData, 0, 3) == "\x1f\x8b\x08" ) { - $i = 10; - $flg = ord( substr($gzData, 3, 1) ); - if ( $flg > 0 ) { - if ( $flg & 4 ) { - list($xlen) = unpack('v', substr($gzData, $i, 2) ); - $i = $i + 2 + $xlen; - } - if ( $flg & 8 ) - $i = strpos($gzData, "\0", $i) + 1; - if ( $flg & 16 ) - $i = strpos($gzData, "\0", $i) + 1; - if ( $flg & 2 ) - $i = $i + 2; - } - return gzinflate( substr($gzData, $i, -8) ); - } else { - return false; - } - } - - /** - * What encoding types to accept and their priority values. - * - * @since 2.8 - * - * @return string Types of encoding to accept. - */ - function accept_encoding() { - $type = array(); - if ( function_exists( 'gzinflate' ) ) - $type[] = 'deflate;q=1.0'; - - if ( function_exists( 'gzuncompress' ) ) - $type[] = 'compress;q=0.5'; - - if ( function_exists( 'gzdecode' ) ) - $type[] = 'gzip;q=0.5'; - - return implode(', ', $type); - } - - /** - * What enconding the content used when it was compressed to send in the headers. - * - * @since 2.8 - * - * @return string Content-Encoding string to send in the header. - */ - function content_encoding() { - return 'deflate'; - } - - /** - * Whether the content be decoded based on the headers. - * - * @since 2.8 - * - * @param array|string $headers All of the available headers. - * @return bool - */ - function should_decode($headers) { - if ( is_array( $headers ) ) { - if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) ) - return true; - } else if ( is_string( $headers ) ) { - return ( stripos($headers, 'content-encoding:') !== false ); - } - - return false; - } - - /** - * Whether decompression and compression are supported by the PHP version. - * - * Each function is tested instead of checking for the zlib extension, to - * ensure that the functions all exist in the PHP version and aren't - * disabled. - * - * @since 2.8 - * - * @return bool - */ - function is_available() { - return ( function_exists('gzuncompress') || function_exists('gzdeflate') || function_exists('gzinflate') ); - } -} - /** * Returns the initialized WP_Http Object * @@ -2119,4 +191,4 @@ function wp_remote_retrieve_body(&$response) { return $response['body']; } -?> +?> \ No newline at end of file diff --git a/wp-includes/images/upload.png b/wp-includes/images/upload.png index 74c6f12f..8ca02d7c 100644 Binary files a/wp-includes/images/upload.png and b/wp-includes/images/upload.png differ diff --git a/wp-includes/js/autosave.dev.js b/wp-includes/js/autosave.dev.js index 7aac86bc..ee5c4e4b 100644 --- a/wp-includes/js/autosave.dev.js +++ b/wp-includes/js/autosave.dev.js @@ -2,7 +2,7 @@ var autosave, autosaveLast = '', autosavePeriodical, autosaveOldMessage = '', au jQuery(document).ready( function($) { var dotabkey = true; - + autosaveLast = $('#post #title').val() + $('#post #content').val(); autosavePeriodical = $.schedule({time: autosaveL10n.autosaveInterval * 1000, func: function() { autosave(); }, repeat: true, protect: true}); @@ -39,7 +39,7 @@ jQuery(document).ready( function($) { // preview $('#post-preview').click(function(){ - if ( 1 > $('#post_ID').val() && notSaved ) { + if ( $('#auto_draft').val() == '1' && notSaved ) { autosaveDelayPreview = true; autosave(); return false; @@ -58,7 +58,7 @@ jQuery(document).ready( function($) { if ( typeof tinyMCE != 'undefined' ) { $('#title')[$.browser.opera ? 'keypress' : 'keydown'](function (e) { if ( e.which == 9 && !e.shiftKey && !e.controlKey && !e.altKey ) { - if ( ($("#post_ID").val() < 1) && ($("#title").val().length > 0) ) { autosave(); } + if ( ($('#auto_draft').val() == '1') && ($("#title").val().length > 0) ) { autosave(); } if ( tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden() && dotabkey ) { e.preventDefault(); dotabkey = false; @@ -70,11 +70,10 @@ jQuery(document).ready( function($) { } // autosave new posts after a title is typed but not if Publish or Save Draft is clicked - if ( 0 > $('#post_ID').val() ) { + if ( '1' == $('#auto_draft').val() ) { $('#title').blur( function() { - if ( !this.value || 0 < $('#post_ID').val() ) + if ( !this.value || $('#auto_draft').val() != '1' ) return; - delayed_autosave(); }); } @@ -121,24 +120,23 @@ function autosave_parse_response(response) { // called when autosaving pre-existing post function autosave_saved(response) { + blockSave = false; autosave_parse_response(response); // parse the ajax response autosave_enable_buttons(); // re-enable disabled form buttons } // called when autosaving new post function autosave_saved_new(response) { + blockSave = false; var res = autosave_parse_response(response), tempID, postID; - // if no errors: update post_ID from the temporary value, grab new save-nonce for that new ID if ( res && res.responses.length && !res.errors ) { - tempID = jQuery('#post_ID').val(); + // An ID is sent only for real auto-saves, not for autosave=0 "keepalive" saves postID = parseInt( res.responses[0].id, 10 ); - autosave_update_post_ID( postID ); // disabled form buttons are re-enabled here - if ( tempID < 0 && postID > 0 ) { // update media buttons + if ( !isNaN(postID) && postID > 0 ) { notSaved = false; - jQuery('#media-buttons a').each(function(){ - this.href = this.href.replace(tempID, postID); - }); + jQuery('#auto_draft').val('0'); // No longer an auto-draft } + autosave_enable_buttons(); if ( autosaveDelayPreview ) { autosaveDelayPreview = false; doPreview(); @@ -148,28 +146,6 @@ function autosave_saved_new(response) { } } -function autosave_update_post_ID( postID ) { - if ( !isNaN(postID) && postID > 0 ) { - if ( postID == parseInt(jQuery('#post_ID').val(), 10) ) { return; } // no need to do this more than once - jQuery('#post_ID').attr({name: "post_ID"}); - jQuery('#post_ID').val(postID); - // We need new nonces - jQuery.post(autosaveL10n.requestFile, { - action: "autosave-generate-nonces", - post_ID: postID, - autosavenonce: jQuery('#autosavenonce').val(), - post_type: jQuery('#post_type').val() - }, function(html) { - jQuery('#_wpnonce').val(html.updateNonce); - jQuery('#delete-action a.submitdelete').attr('href', html.deleteURL); - autosave_enable_buttons(); // re-enable disabled form buttons - jQuery('#delete-action a.submitdelete').fadeIn(); - }, - 'json'); - jQuery('#hiddenaction').val('editpost'); - } -} - function autosave_update_slug(post_id) { // create slug area only if not already there if ( 'undefined' != makeSlugeditClickable && jQuery.isFunction(makeSlugeditClickable) && !jQuery('#edit-slug-box > *').size() ) { @@ -217,6 +193,7 @@ function delayed_autosave() { autosave = function() { // (bool) is rich editor enabled and active + blockSave = true; var rich = (typeof tinyMCE != "undefined") && tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden(), post_data, doAutoSave, ed, origStatus, successCallback; autosave_disable_buttons(); @@ -280,23 +257,25 @@ autosave = function() { post_data["excerpt"] = jQuery("#excerpt").val(); if ( jQuery("#post_author").size() ) post_data["post_author"] = jQuery("#post_author").val(); + if ( jQuery("#parent_id").val() ) + post_data["parent_id"] = jQuery("#parent_id").val(); post_data["user_ID"] = jQuery("#user-id").val(); + if ( jQuery('#auto_draft').val() == '1' ) + post_data["auto_draft"] = '1'; if ( doAutoSave ) { - autosaveLast = jQuery("#title").val()+jQuery("#content").val(); + autosaveLast = jQuery("#title").val() + jQuery("#content").val(); } else { post_data['autosave'] = 0; } - if ( parseInt(post_data["post_ID"], 10) < 1 ) { - post_data["temp_ID"] = post_data["post_ID"]; + if ( post_data["auto_draft"] == '1' ) { successCallback = autosave_saved_new; // new post } else { successCallback = autosave_saved; // pre-existing post } autosaveOldMessage = jQuery('#autosave').html(); - jQuery.ajax({ data: post_data, beforeSend: doAutoSave ? autosave_loading : null, diff --git a/wp-includes/js/autosave.js b/wp-includes/js/autosave.js index 1c056130..581fc6f9 100644 --- a/wp-includes/js/autosave.js +++ b/wp-includes/js/autosave.js @@ -1 +1 @@ -var autosave,autosaveLast="",autosavePeriodical,autosaveOldMessage="",autosaveDelayPreview=false,notSaved=true,blockSave=false,interimLogin=false;jQuery(document).ready(function(b){var a=true;autosaveLast=b("#post #title").val()+b("#post #content").val();autosavePeriodical=b.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});b("#post").submit(function(){b.cancel(autosavePeriodical)});b('input[type="submit"], a.submitdelete',"#submitpost").click(function(){blockSave=true;window.onbeforeunload=null;b(":button, :submit","#submitpost").each(function(){var c=b(this);if(c.hasClass("button-primary")){c.addClass("button-primary-disabled")}else{c.addClass("button-disabled")}});b("#ajax-loading").css("visibility","visible")});window.onbeforeunload=function(){var c=typeof(tinyMCE)!="undefined"?tinyMCE.activeEditor:false,e,d;if(c&&!c.isHidden()){if(c.isDirty()){return autosaveL10n.saveAlert}}else{e=b("#post #title").val(),d=b("#post #content").val();if((e||d)&&e+d!=autosaveLast){return autosaveL10n.saveAlert}}};b("#post-preview").click(function(){if(1>b("#post_ID").val()&¬Saved){autosaveDelayPreview=true;autosave();return false}doPreview();return false});doPreview=function(){b("input#wp-preview").val("dopreview");b("form#post").attr("target","wp-preview").submit().attr("target","");b("input#wp-preview").val("")};if(typeof tinyMCE!="undefined"){b("#title")[b.browser.opera?"keypress":"keydown"](function(c){if(c.which==9&&!c.shiftKey&&!c.controlKey&&!c.altKey){if((b("#post_ID").val()<1)&&(b("#title").val().length>0)){autosave()}if(tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden()&&a){c.preventDefault();a=false;tinyMCE.activeEditor.focus();return false}}})}if(0>b("#post_ID").val()){b("#title").blur(function(){if(!this.value||00){autosave_update_slug(a)}}}if(f){jQuery("#autosave").html(f)}else{if(autosaveOldMessage&&e){jQuery("#autosave").html(autosaveOldMessage)}}return e}function autosave_saved(a){autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(b){var d=autosave_parse_response(b),c,a;if(d&&d.responses.length&&!d.errors){c=jQuery("#post_ID").val();a=parseInt(d.responses[0].id,10);autosave_update_post_ID(a);if(c<0&&a>0){notSaved=false;jQuery("#media-buttons a").each(function(){this.href=this.href.replace(c,a)})}if(autosaveDelayPreview){autosaveDelayPreview=false;doPreview()}}else{autosave_enable_buttons()}}function autosave_update_post_ID(a){if(!isNaN(a)&&a>0){if(a==parseInt(jQuery("#post_ID").val(),10)){return}jQuery("#post_ID").attr({name:"post_ID"});jQuery("#post_ID").val(a);jQuery.post(autosaveL10n.requestFile,{action:"autosave-generate-nonces",post_ID:a,autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()},function(b){jQuery("#_wpnonce").val(b.updateNonce);jQuery("#delete-action a.submitdelete").attr("href",b.deleteURL);autosave_enable_buttons();jQuery("#delete-action a.submitdelete").fadeIn()},"json");jQuery("#hiddenaction").val("editpost")}}function autosave_update_slug(a){if("undefined"!=makeSlugeditClickable&&jQuery.isFunction(makeSlugeditClickable)&&!jQuery("#edit-slug-box > *").size()){jQuery.post(ajaxurl,{action:"sample-permalink",post_id:a,new_title:jQuery("#title").val(),samplepermalinknonce:jQuery("#samplepermalinknonce").val()},function(b){jQuery("#edit-slug-box").html(b);makeSlugeditClickable()})}}function autosave_loading(){jQuery("#autosave").html(autosaveL10n.savingText)}function autosave_enable_buttons(){setTimeout(function(){jQuery(":button, :submit","#submitpost").removeAttr("disabled");jQuery("#ajax-loading").css("visibility","hidden")},500)}function autosave_disable_buttons(){jQuery(":button, :submit","#submitpost").attr("disabled","disabled");setTimeout(autosave_enable_buttons,5000)}function delayed_autosave(){setTimeout(function(){if(blockSave){return}autosave()},200)}autosave=function(){var c=(typeof tinyMCE!="undefined")&&tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden(),d,f,b,e,a;autosave_disable_buttons();d={action:"autosave",post_ID:jQuery("#post_ID").val()||0,post_title:jQuery("#title").val()||"",autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()||"",autosave:1};jQuery(".tags-input").each(function(){d[this.name]=this.value});f=true;if(jQuery("#TB_window").css("display")=="block"){f=false}if(c&&f){b=tinyMCE.activeEditor;if(b.plugins.spellchecker&&b.plugins.spellchecker.active){f=false}else{if("mce_fullscreen"==b.id){tinyMCE.get("content").setContent(b.getContent({format:"raw"}),{format:"raw"})}tinyMCE.get("content").save()}}d.content=jQuery("#content").val();if(jQuery("#post_name").val()){d.post_name=jQuery("#post_name").val()}if((d.post_title.length==0&&d.content.length==0)||d.post_title+d.content==autosaveLast){f=false}e=jQuery("#original_post_status").val();goodcats=([]);jQuery("[name='post_category[]']:checked").each(function(g){goodcats.push(this.value)});d.catslist=goodcats.join(",");if(jQuery("#comment_status").attr("checked")){d.comment_status="open"}if(jQuery("#ping_status").attr("checked")){d.ping_status="open"}if(jQuery("#excerpt").size()){d.excerpt=jQuery("#excerpt").val()}if(jQuery("#post_author").size()){d.post_author=jQuery("#post_author").val()}d.user_ID=jQuery("#user-id").val();if(f){autosaveLast=jQuery("#title").val()+jQuery("#content").val()}else{d.autosave=0}if(parseInt(d.post_ID,10)<1){d.temp_ID=d.post_ID;a=autosave_saved_new}else{a=autosave_saved}autosaveOldMessage=jQuery("#autosave").html();jQuery.ajax({data:d,beforeSend:f?autosave_loading:null,type:"POST",url:autosaveL10n.requestFile,success:a})}; \ No newline at end of file +var autosave,autosaveLast="",autosavePeriodical,autosaveOldMessage="",autosaveDelayPreview=false,notSaved=true,blockSave=false,interimLogin=false;jQuery(document).ready(function(b){var a=true;autosaveLast=b("#post #title").val()+b("#post #content").val();autosavePeriodical=b.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});b("#post").submit(function(){b.cancel(autosavePeriodical)});b('input[type="submit"], a.submitdelete',"#submitpost").click(function(){blockSave=true;window.onbeforeunload=null;b(":button, :submit","#submitpost").each(function(){var c=b(this);if(c.hasClass("button-primary")){c.addClass("button-primary-disabled")}else{c.addClass("button-disabled")}});b("#ajax-loading").css("visibility","visible")});window.onbeforeunload=function(){var c=typeof(tinyMCE)!="undefined"?tinyMCE.activeEditor:false,e,d;if(c&&!c.isHidden()){if(c.isDirty()){return autosaveL10n.saveAlert}}else{e=b("#post #title").val(),d=b("#post #content").val();if((e||d)&&e+d!=autosaveLast){return autosaveL10n.saveAlert}}};b("#post-preview").click(function(){if(b("#auto_draft").val()=="1"&¬Saved){autosaveDelayPreview=true;autosave();return false}doPreview();return false});doPreview=function(){b("input#wp-preview").val("dopreview");b("form#post").attr("target","wp-preview").submit().attr("target","");b("input#wp-preview").val("")};if(typeof tinyMCE!="undefined"){b("#title")[b.browser.opera?"keypress":"keydown"](function(c){if(c.which==9&&!c.shiftKey&&!c.controlKey&&!c.altKey){if((b("#auto_draft").val()=="1")&&(b("#title").val().length>0)){autosave()}if(tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden()&&a){c.preventDefault();a=false;tinyMCE.activeEditor.focus();return false}}})}if("1"==b("#auto_draft").val()){b("#title").blur(function(){if(!this.value||b("#auto_draft").val()!="1"){return}delayed_autosave()})}});function autosave_parse_response(c){var e=wpAjax.parseAjaxResponse(c,"autosave"),f="",a,b,d;if(e&&e.responses&&e.responses.length){f=e.responses[0].data;if(e.responses[0].supplemental){b=e.responses[0].supplemental;if("disable"==b.disable_autosave){autosave=function(){};e={errors:true}}if(b.session_expired&&(d=b.session_expired)){if(!interimLogin||interimLogin.closed){interimLogin=window.open(d,"login","width=600,height=450,resizable=yes,scrollbars=yes,status=yes");interimLogin.focus()}delete b.session_expired}jQuery.each(b,function(g,h){if(g.match(/^replace-/)){jQuery("#"+g.replace("replace-","")).val(h)}})}if(!e.errors){a=parseInt(e.responses[0].id,10);if(!isNaN(a)&&a>0){autosave_update_slug(a)}}}if(f){jQuery("#autosave").html(f)}else{if(autosaveOldMessage&&e){jQuery("#autosave").html(autosaveOldMessage)}}return e}function autosave_saved(a){blockSave=false;autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(b){blockSave=false;var d=autosave_parse_response(b),c,a;if(d&&d.responses.length&&!d.errors){a=parseInt(d.responses[0].id,10);if(!isNaN(a)&&a>0){notSaved=false;jQuery("#auto_draft").val("0")}autosave_enable_buttons();if(autosaveDelayPreview){autosaveDelayPreview=false;doPreview()}}else{autosave_enable_buttons()}}function autosave_update_slug(a){if("undefined"!=makeSlugeditClickable&&jQuery.isFunction(makeSlugeditClickable)&&!jQuery("#edit-slug-box > *").size()){jQuery.post(ajaxurl,{action:"sample-permalink",post_id:a,new_title:jQuery("#title").val(),samplepermalinknonce:jQuery("#samplepermalinknonce").val()},function(b){jQuery("#edit-slug-box").html(b);makeSlugeditClickable()})}}function autosave_loading(){jQuery("#autosave").html(autosaveL10n.savingText)}function autosave_enable_buttons(){setTimeout(function(){jQuery(":button, :submit","#submitpost").removeAttr("disabled");jQuery("#ajax-loading").css("visibility","hidden")},500)}function autosave_disable_buttons(){jQuery(":button, :submit","#submitpost").attr("disabled","disabled");setTimeout(autosave_enable_buttons,5000)}function delayed_autosave(){setTimeout(function(){if(blockSave){return}autosave()},200)}autosave=function(){blockSave=true;var c=(typeof tinyMCE!="undefined")&&tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden(),d,f,b,e,a;autosave_disable_buttons();d={action:"autosave",post_ID:jQuery("#post_ID").val()||0,post_title:jQuery("#title").val()||"",autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()||"",autosave:1};jQuery(".tags-input").each(function(){d[this.name]=this.value});f=true;if(jQuery("#TB_window").css("display")=="block"){f=false}if(c&&f){b=tinyMCE.activeEditor;if(b.plugins.spellchecker&&b.plugins.spellchecker.active){f=false}else{if("mce_fullscreen"==b.id){tinyMCE.get("content").setContent(b.getContent({format:"raw"}),{format:"raw"})}tinyMCE.get("content").save()}}d.content=jQuery("#content").val();if(jQuery("#post_name").val()){d.post_name=jQuery("#post_name").val()}if((d.post_title.length==0&&d.content.length==0)||d.post_title+d.content==autosaveLast){f=false}e=jQuery("#original_post_status").val();goodcats=([]);jQuery("[name='post_category[]']:checked").each(function(g){goodcats.push(this.value)});d.catslist=goodcats.join(",");if(jQuery("#comment_status").attr("checked")){d.comment_status="open"}if(jQuery("#ping_status").attr("checked")){d.ping_status="open"}if(jQuery("#excerpt").size()){d.excerpt=jQuery("#excerpt").val()}if(jQuery("#post_author").size()){d.post_author=jQuery("#post_author").val()}if(jQuery("#parent_id").val()){d.parent_id=jQuery("#parent_id").val()}d.user_ID=jQuery("#user-id").val();if(jQuery("#auto_draft").val()=="1"){d.auto_draft="1"}if(f){autosaveLast=jQuery("#title").val()+jQuery("#content").val()}else{d.autosave=0}if(d.auto_draft=="1"){a=autosave_saved_new}else{a=autosave_saved}autosaveOldMessage=jQuery("#autosave").html();jQuery.ajax({data:d,beforeSend:f?autosave_loading:null,type:"POST",url:autosaveL10n.requestFile,success:a})}; \ No newline at end of file diff --git a/wp-includes/js/codepress/codepress.css b/wp-includes/js/codepress/codepress.css deleted file mode 100644 index 3a4a00a7..00000000 --- a/wp-includes/js/codepress/codepress.css +++ /dev/null @@ -1,21 +0,0 @@ -body { - margin-top:13px; - _margin-top:14px; - background:white; - margin-left:32px; - font-family:monospace; - font-size:13px; - white-space:pre; - background-image:url("images/line-numbers.png"); - background-repeat:repeat-y; - background-position:0 3px; - line-height:16px; - height:100%; -} -pre {margin:0;} -html>body{background-position:0 2px;} -P {margin:0;padding:0;border:0;outline:0;display:block;white-space:pre;} -b, i, s, u, a, em, tt, ins, big, cite, strong, var, dfn {text-decoration:none;font-weight:normal;font-style:normal;font-size:13px;} - -body.hide-line-numbers {background:white;margin-left:16px;} -body.show-line-numbers {background-image:url("images/line-numbers.png");margin-left:32px;} \ No newline at end of file diff --git a/wp-includes/js/codepress/codepress.html b/wp-includes/js/codepress/codepress.html deleted file mode 100644 index d9711d69..00000000 --- a/wp-includes/js/codepress/codepress.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - CodePress - Real Time Syntax Highlighting Editor written in JavaScript - - - - - - - - - diff --git a/wp-includes/js/codepress/codepress.js b/wp-includes/js/codepress/codepress.js deleted file mode 100644 index 804f29a0..00000000 --- a/wp-includes/js/codepress/codepress.js +++ /dev/null @@ -1,137 +0,0 @@ -/* - * CodePress - Real Time Syntax Highlighting Editor written in JavaScript - http://codepress.org/ - * - * Copyright (C) 2006 Fernando M.A.d.S. - * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation. - * - * Read the full licence: http://www.opensource.org/licenses/lgpl-license.php - */ - -CodePress = function(obj) { - var self = document.createElement('iframe'); - self.textarea = obj; - self.textarea.disabled = true; - self.textarea.style.overflow = 'hidden'; - self.style.height = self.textarea.clientHeight +'px'; - self.style.width = self.textarea.clientWidth +'px'; - self.textarea.style.overflow = 'auto'; - self.style.border = '1px solid gray'; - self.frameBorder = 0; // remove IE internal iframe border - self.style.visibility = 'hidden'; - self.style.position = 'absolute'; - self.options = self.textarea.className; - - self.initialize = function() { - self.editor = self.contentWindow.CodePress; - self.editor.body = self.contentWindow.document.getElementsByTagName('body')[0]; - self.editor.setCode(self.textarea.value); - self.setOptions(); - self.editor.syntaxHighlight('init'); - self.textarea.style.display = 'none'; - self.style.position = 'static'; - self.style.visibility = 'visible'; - self.style.display = 'inline'; - } - - // obj can by a textarea id or a string (code) - self.edit = function(obj,language) { - if(obj) self.textarea.value = document.getElementById(obj) ? document.getElementById(obj).value : obj; - if(!self.textarea.disabled) return; - self.language = language ? language : self.getLanguage(); - self.src = CodePress.path+'codepress.html?language='+self.language+'&ts='+(new Date).getTime(); - if(self.attachEvent) self.attachEvent('onload',self.initialize); - else self.addEventListener('load',self.initialize,false); - } - - self.getLanguage = function() { - for (language in CodePress.languages) - if(self.options.match('\\b'+language+'\\b')) - return CodePress.languages[language] ? language : 'generic'; - } - - self.setOptions = function() { - if(self.options.match('autocomplete-off')) self.toggleAutoComplete(); - if(self.options.match('readonly-on')) self.toggleReadOnly(); - if(self.options.match('linenumbers-off')) self.toggleLineNumbers(); - } - - self.getCode = function() { - return self.textarea.disabled ? self.editor.getCode() : self.textarea.value; - } - - self.setCode = function(code) { - self.textarea.disabled ? self.editor.setCode(code) : self.textarea.value = code; - } - - self.toggleAutoComplete = function() { - self.editor.autocomplete = (self.editor.autocomplete) ? false : true; - } - - self.toggleReadOnly = function() { - self.textarea.readOnly = (self.textarea.readOnly) ? false : true; - if(self.style.display != 'none') // prevent exception on FF + iframe with display:none - self.editor.readOnly(self.textarea.readOnly ? true : false); - } - - self.toggleLineNumbers = function() { - var cn = self.editor.body.className; - self.editor.body.className = (cn==''||cn=='show-line-numbers') ? 'hide-line-numbers' : 'show-line-numbers'; - } - - self.toggleEditor = function() { - if(self.textarea.disabled) { - self.textarea.value = self.getCode(); - self.textarea.disabled = false; - self.style.display = 'none'; - self.textarea.style.display = 'inline'; - } - else { - self.textarea.disabled = true; - self.setCode(self.textarea.value); - self.editor.syntaxHighlight('init'); - self.style.display = 'inline'; - self.textarea.style.display = 'none'; - } - } - - self.edit(); - return self; -} - -CodePress.languages = { - csharp : 'C#', - css : 'CSS', - generic : 'Generic', - html : 'HTML', - java : 'Java', - javascript : 'JavaScript', - perl : 'Perl', - ruby : 'Ruby', - php : 'PHP', - text : 'Text', - sql : 'SQL', - vbscript : 'VBScript' -} - - -CodePress.run = function() { - // Modified for WordPress compat to prevent loading on webkit and to - // reference a codepress_path which is specified externally. - if (navigator.userAgent.toLowerCase().indexOf('webkit') != -1) - return; - CodePress.path = codepress_path; - var t = document.getElementsByTagName('textarea'), i, id; - for(i=0,n=t.length;i - * - * Developers: - * Fernando M.A.d.S. - * Michael Hurni - * Contributors: - * Martin D. Kirk - * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation. - * - * Read the full licence: http://www.opensource.org/licenses/lgpl-license.php - */ - -CodePress = { - scrolling : false, - autocomplete : true, - - // set initial vars and start sh - initialize : function() { - if(typeof(editor)=='undefined' && !arguments[0]) return; - body = document.getElementsByTagName('body')[0]; - body.innerHTML = body.innerHTML.replace(/\n/g,""); - chars = '|32|46|62|8|'; // charcodes that trigger syntax highlighting - cc = '\u2009'; // carret char - editor = document.getElementsByTagName('pre')[0]; - document.designMode = 'on'; - document.addEventListener('keypress', this.keyHandler, true); - window.addEventListener('scroll', function() { if(!CodePress.scrolling) CodePress.syntaxHighlight('scroll') }, false); - completeChars = this.getCompleteChars(); - completeEndingChars = this.getCompleteEndingChars(); - }, - - // treat key bindings - keyHandler : function(evt) { - keyCode = evt.keyCode; - charCode = evt.charCode; - fromChar = String.fromCharCode(charCode); - - if((evt.ctrlKey || evt.metaKey) && evt.shiftKey && charCode!=90) { // shortcuts = ctrl||appleKey+shift+key!=z(undo) - CodePress.shortcuts(charCode?charCode:keyCode); - } - else if( (completeEndingChars.indexOf('|'+fromChar+'|')!= -1 || completeChars.indexOf('|'+fromChar+'|')!=-1) && CodePress.autocomplete) { // auto complete - if(!CodePress.completeEnding(fromChar)) - CodePress.complete(fromChar); - } - else if(chars.indexOf('|'+charCode+'|')!=-1||keyCode==13) { // syntax highlighting - top.setTimeout(function(){CodePress.syntaxHighlight('generic');},100); - } - else if(keyCode==9 || evt.tabKey) { // snippets activation (tab) - CodePress.snippets(evt); - } - else if(keyCode==46||keyCode==8) { // save to history when delete or backspace pressed - CodePress.actions.history[CodePress.actions.next()] = editor.innerHTML; - } - else if((charCode==122||charCode==121||charCode==90) && evt.ctrlKey) { // undo and redo - (charCode==121||evt.shiftKey) ? CodePress.actions.redo() : CodePress.actions.undo(); - evt.preventDefault(); - } - else if(charCode==118 && evt.ctrlKey) { // handle paste - top.setTimeout(function(){CodePress.syntaxHighlight('generic');},100); - } - else if(charCode==99 && evt.ctrlKey) { // handle cut - //alert(window.getSelection().getRangeAt(0).toString().replace(/\t/g,'FFF')); - } - - }, - - // put cursor back to its original position after every parsing - findString : function() { - if(self.find(cc)) - window.getSelection().getRangeAt(0).deleteContents(); - }, - - // split big files, highlighting parts of it - split : function(code,flag) { - if(flag=='scroll') { - this.scrolling = true; - return code; - } - else { - this.scrolling = false; - mid = code.indexOf(cc); - if(mid-2000<0) {ini=0;end=4000;} - else if(mid+2000>code.length) {ini=code.length-4000;end=code.length;} - else {ini=mid-2000;end=mid+2000;} - code = code.substring(ini,end); - return code; - } - }, - - getEditor : function() { - if(!document.getElementsByTagName('pre')[0]) { - body = document.getElementsByTagName('body')[0]; - if(!body.innerHTML) return body; - if(body.innerHTML=="
          ") body.innerHTML = "
           
          "; - else body.innerHTML = "
          "+body.innerHTML+"
          "; - } - return document.getElementsByTagName('pre')[0]; - }, - - // syntax highlighting parser - syntaxHighlight : function(flag) { - //if(document.designMode=='off') document.designMode='on' - if(flag != 'init') { window.getSelection().getRangeAt(0).insertNode(document.createTextNode(cc));} - editor = CodePress.getEditor(); - o = editor.innerHTML; - o = o.replace(/
          /g,'\n'); - o = o.replace(/<.*?>/g,''); - x = z = this.split(o,flag); - x = x.replace(/\n/g,'
          '); - - if(arguments[1]&&arguments[2]) x = x.replace(arguments[1],arguments[2]); - - for(i=0;i/g,'>'); - if(content.indexOf('$0')<0) content += cc; - else content = content.replace(/\$0/,cc); - content = content.replace(/\n/g,'
          '); - var pattern = new RegExp(trigger+cc,'gi'); - evt.preventDefault(); // prevent the tab key from being added - this.syntaxHighlight('snippets',pattern,content); - } - } - }, - - readOnly : function() { - document.designMode = (arguments[0]) ? 'off' : 'on'; - }, - - complete : function(trigger) { - window.getSelection().getRangeAt(0).deleteContents(); - var complete = Language.complete; - for (var i=0; i/g,'\n'); - code = code.replace(/\u2009/g,''); - code = code.replace(/<.*?>/g,''); - code = code.replace(/</g,'<'); - code = code.replace(/>/g,'>'); - code = code.replace(/&/gi,'&'); - return code; - }, - - // put code inside editor - setCode : function() { - var code = arguments[0]; - code = code.replace(/\u2009/gi,''); - code = code.replace(/&/gi,'&'); - code = code.replace(//g,'>'); - editor.innerHTML = code; - if (code == '') - document.getElementsByTagName('body')[0].innerHTML = ''; - }, - - // undo and redo methods - actions : { - pos : -1, // actual history position - history : [], // history vector - - undo : function() { - editor = CodePress.getEditor(); - if(editor.innerHTML.indexOf(cc)==-1){ - if(editor.innerHTML != " ") - window.getSelection().getRangeAt(0).insertNode(document.createTextNode(cc)); - this.history[this.pos] = editor.innerHTML; - } - this.pos --; - if(typeof(this.history[this.pos])=='undefined') this.pos ++; - editor.innerHTML = this.history[this.pos]; - if(editor.innerHTML.indexOf(cc)>-1) editor.innerHTML+=cc; - CodePress.findString(); - }, - - redo : function() { - // editor = CodePress.getEditor(); - this.pos++; - if(typeof(this.history[this.pos])=='undefined') this.pos--; - editor.innerHTML = this.history[this.pos]; - CodePress.findString(); - }, - - next : function() { // get next vector position and clean old ones - if(this.pos>20) this.history[this.pos-21] = undefined; - return ++this.pos; - } - } -} - -Language={}; -window.addEventListener('load', function() { CodePress.initialize('new'); }, true); \ No newline at end of file diff --git a/wp-includes/js/codepress/engines/khtml.js b/wp-includes/js/codepress/engines/khtml.js deleted file mode 100644 index e69de29b..00000000 diff --git a/wp-includes/js/codepress/engines/msie.js b/wp-includes/js/codepress/engines/msie.js deleted file mode 100644 index 2558c395..00000000 --- a/wp-includes/js/codepress/engines/msie.js +++ /dev/null @@ -1,304 +0,0 @@ -/* - * CodePress - Real Time Syntax Highlighting Editor written in JavaScript - http://codepress.org/ - * - * Copyright (C) 2007 Fernando M.A.d.S. - * - * Developers: - * Fernando M.A.d.S. - * Michael Hurni - * Contributors: - * Martin D. Kirk - * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation. - * - * Read the full licence: http://www.opensource.org/licenses/lgpl-license.php - */ - -CodePress = { - scrolling : false, - autocomplete : true, - - // set initial vars and start sh - initialize : function() { - if(typeof(editor)=='undefined' && !arguments[0]) return; - chars = '|32|46|62|'; // charcodes that trigger syntax highlighting - cc = '\u2009'; // carret char - editor = document.getElementsByTagName('pre')[0]; - editor.contentEditable = 'true'; - document.getElementsByTagName('body')[0].onfocus = function() {editor.focus();} - document.attachEvent('onkeydown', this.metaHandler); - document.attachEvent('onkeypress', this.keyHandler); - window.attachEvent('onscroll', function() { if(!CodePress.scrolling) setTimeout(function(){CodePress.syntaxHighlight('scroll')},1)}); - completeChars = this.getCompleteChars(); - completeEndingChars = this.getCompleteEndingChars(); - setTimeout(function() { window.scroll(0,0) },50); // scroll IE to top - }, - - // treat key bindings - keyHandler : function(evt) { - charCode = evt.keyCode; - fromChar = String.fromCharCode(charCode); - - if( (completeEndingChars.indexOf('|'+fromChar+'|')!= -1 || completeChars.indexOf('|'+fromChar+'|')!=-1 )&& CodePress.autocomplete) { // auto complete - if(!CodePress.completeEnding(fromChar)) - CodePress.complete(fromChar); - } - else if(chars.indexOf('|'+charCode+'|')!=-1||charCode==13) { // syntax highlighting - CodePress.syntaxHighlight('generic'); - } - }, - - metaHandler : function(evt) { - keyCode = evt.keyCode; - - if(keyCode==9 || evt.tabKey) { - CodePress.snippets(); - } - else if((keyCode==122||keyCode==121||keyCode==90) && evt.ctrlKey) { // undo and redo - (keyCode==121||evt.shiftKey) ? CodePress.actions.redo() : CodePress.actions.undo(); - evt.returnValue = false; - } - else if(keyCode==34||keyCode==33) { // handle page up/down for IE - self.scrollBy(0, (keyCode==34) ? 200 : -200); - evt.returnValue = false; - } - else if(keyCode==46||keyCode==8) { // save to history when delete or backspace pressed - CodePress.actions.history[CodePress.actions.next()] = editor.innerHTML; - } - else if((evt.ctrlKey || evt.metaKey) && evt.shiftKey && keyCode!=90) { // shortcuts = ctrl||appleKey+shift+key!=z(undo) - CodePress.shortcuts(keyCode); - evt.returnValue = false; - } - else if(keyCode==86 && evt.ctrlKey) { // handle paste - window.clipboardData.setData('Text',window.clipboardData.getData('Text').replace(/\t/g,'\u2008')); - top.setTimeout(function(){CodePress.syntaxHighlight('paste');},10); - } - else if(keyCode==67 && evt.ctrlKey) { // handle cut - // window.clipboardData.setData('Text',x[0]); - // code = window.clipboardData.getData('Text'); - } - }, - - // put cursor back to its original position after every parsing - - - findString : function() { - range = self.document.body.createTextRange(); - if(range.findText(cc)){ - range.select(); - range.text = ''; - } - }, - - // split big files, highlighting parts of it - split : function(code,flag) { - if(flag=='scroll') { - this.scrolling = true; - return code; - } - else { - this.scrolling = false; - mid = code.indexOf(cc); - if(mid-2000<0) {ini=0;end=4000;} - else if(mid+2000>code.length) {ini=code.length-4000;end=code.length;} - else {ini=mid-2000;end=mid+2000;} - code = code.substring(ini,end); - return code.substring(code.indexOf('

          '),code.lastIndexOf('

          ')+4); - } - }, - - // syntax highlighting parser - syntaxHighlight : function(flag) { - if(flag!='init') document.selection.createRange().text = cc; - o = editor.innerHTML; - if(flag=='paste') { // fix pasted text - o = o.replace(/
          /g,'\r\n'); - o = o.replace(/\u2008/g,'\t'); - } - o = o.replace(/

          /g,'\n'); - o = o.replace(/<\/P>/g,'\r'); - o = o.replace(/<.*?>/g,''); - o = o.replace(/ /g,''); - o = '

          '+o+'

          '; - o = o.replace(/\n\r/g,'

          '); - o = o.replace(/\n/g,'

          '); - o = o.replace(/\r/g,'<\/P>'); - o = o.replace(/

          (

          )+/,'

          '); - o = o.replace(/<\/P>(<\/P>)+/,'

          '); - o = o.replace(/

          <\/P>/g,'


          '); - x = z = this.split(o,flag); - - if(arguments[1]&&arguments[2]) x = x.replace(arguments[1],arguments[2]); - - for(i=0;i/g,'>'); - if(content.indexOf('$0')<0) content += cc; - else content = content.replace(/\$0/,cc); - content = content.replace(/\n/g,'

          '); - var pattern = new RegExp(trigger+cc,"gi"); - this.syntaxHighlight('snippets',pattern,content); - } - } - }, - - readOnly : function() { - editor.contentEditable = (arguments[0]) ? 'false' : 'true'; - }, - - complete : function(trigger) { - var complete = Language.complete; - for (var i=0; i/g,'\n'); - code = code.replace(/<\/p>/gi,'\r'); - code = code.replace(/

          /i,''); // IE first line fix - code = code.replace(/

          /gi,'\n'); - code = code.replace(/ /gi,''); - code = code.replace(/\u2009/g,''); - code = code.replace(/<.*?>/g,''); - code = code.replace(/</g,'<'); - code = code.replace(/>/g,'>'); - code = code.replace(/&/gi,'&'); - return code; - }, - - // put code inside editor - setCode : function() { - var code = arguments[0]; - code = code.replace(/\u2009/gi,''); - code = code.replace(/&/gi,'&'); - code = code.replace(//g,'>'); - editor.innerHTML = '

          '+code+'
          '; - }, - - - // undo and redo methods - actions : { - pos : -1, // actual history position - history : [], // history vector - - undo : function() { - if(editor.innerHTML.indexOf(cc)==-1){ - document.selection.createRange().text = cc; - this.history[this.pos] = editor.innerHTML; - } - this.pos--; - if(typeof(this.history[this.pos])=='undefined') this.pos++; - editor.innerHTML = this.history[this.pos]; - CodePress.findString(); - }, - - redo : function() { - this.pos++; - if(typeof(this.history[this.pos])=='undefined') this.pos--; - editor.innerHTML = this.history[this.pos]; - CodePress.findString(); - }, - - next : function() { // get next vector position and clean old ones - if(this.pos>20) this.history[this.pos-21] = undefined; - return ++this.pos; - } - } -} - -Language={}; -window.attachEvent('onload', function() { CodePress.initialize('new');}); \ No newline at end of file diff --git a/wp-includes/js/codepress/engines/older.js b/wp-includes/js/codepress/engines/older.js deleted file mode 100644 index e69de29b..00000000 diff --git a/wp-includes/js/codepress/engines/opera.js b/wp-includes/js/codepress/engines/opera.js deleted file mode 100644 index 155bf098..00000000 --- a/wp-includes/js/codepress/engines/opera.js +++ /dev/null @@ -1,260 +0,0 @@ -/* - * CodePress - Real Time Syntax Highlighting Editor written in JavaScript - http://codepress.org/ - * - * Copyright (C) 2007 Fernando M.A.d.S. - * - * Contributors : - * - * Michael Hurni - * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation. - * - * Read the full licence: http://www.opensource.org/licenses/lgpl-license.php - */ - - -CodePress = { - scrolling : false, - autocomplete : true, - - // set initial vars and start sh - initialize : function() { - if(typeof(editor)=='undefined' && !arguments[0]) return; - chars = '|32|46|62|'; // charcodes that trigger syntax highlighting - cc = '\u2009'; // control char - editor = document.getElementsByTagName('body')[0]; - document.designMode = 'on'; - document.addEventListener('keyup', this.keyHandler, true); - window.addEventListener('scroll', function() { if(!CodePress.scrolling) CodePress.syntaxHighlight('scroll') }, false); - completeChars = this.getCompleteChars(); -// CodePress.syntaxHighlight('init'); - }, - - // treat key bindings - keyHandler : function(evt) { - keyCode = evt.keyCode; - charCode = evt.charCode; - - if((evt.ctrlKey || evt.metaKey) && evt.shiftKey && charCode!=90) { // shortcuts = ctrl||appleKey+shift+key!=z(undo) - CodePress.shortcuts(charCode?charCode:keyCode); - } - else if(completeChars.indexOf('|'+String.fromCharCode(charCode)+'|')!=-1 && CodePress.autocomplete) { // auto complete - CodePress.complete(String.fromCharCode(charCode)); - } - else if(chars.indexOf('|'+charCode+'|')!=-1||keyCode==13) { // syntax highlighting - CodePress.syntaxHighlight('generic'); - } - else if(keyCode==9 || evt.tabKey) { // snippets activation (tab) - CodePress.snippets(evt); - } - else if(keyCode==46||keyCode==8) { // save to history when delete or backspace pressed - CodePress.actions.history[CodePress.actions.next()] = editor.innerHTML; - } - else if((charCode==122||charCode==121||charCode==90) && evt.ctrlKey) { // undo and redo - (charCode==121||evt.shiftKey) ? CodePress.actions.redo() : CodePress.actions.undo(); - evt.preventDefault(); - } - else if(keyCode==86 && evt.ctrlKey) { // paste - // TODO: pasted text should be parsed and highlighted - } - }, - - // put cursor back to its original position after every parsing - findString : function() { - var sel = window.getSelection(); - var range = window.document.createRange(); - var span = window.document.getElementsByTagName('span')[0]; - - range.selectNode(span); - sel.removeAllRanges(); - sel.addRange(range); - span.parentNode.removeChild(span); - //if(self.find(cc)) - //window.getSelection().getRangeAt(0).deleteContents(); - }, - - // split big files, highlighting parts of it - split : function(code,flag) { - if(flag=='scroll') { - this.scrolling = true; - return code; - } - else { - this.scrolling = false; - mid = code.indexOf(''); - if(mid-2000<0) {ini=0;end=4000;} - else if(mid+2000>code.length) {ini=code.length-4000;end=code.length;} - else {ini=mid-2000;end=mid+2000;} - code = code.substring(ini,end); - return code; - } - }, - - // syntax highlighting parser - syntaxHighlight : function(flag) { - //if(document.designMode=='off') document.designMode='on' - if(flag!='init') { - var span = document.createElement('span'); - window.getSelection().getRangeAt(0).insertNode(span); - } - - o = editor.innerHTML; -// o = o.replace(/
          /g,'\r\n'); -// o = o.replace(/<(b|i|s|u|a|em|tt|ins|big|cite|strong)?>/g,''); - //alert(o) - o = o.replace(/<(?!span|\/span|br).*?>/gi,''); -// alert(o) -// x = o; - x = z = this.split(o,flag); - //alert(z) -// x = x.replace(/\r\n/g,'
          '); - x = x.replace(/\t/g, ' '); - - - if(arguments[1]&&arguments[2]) x = x.replace(arguments[1],arguments[2]); - - for(i=0;i/g,'>'); - if(content.indexOf('$0')<0) content += cc; - else content = content.replace(/\$0/,cc); - content = content.replace(/\n/g,'
          '); - var pattern = new RegExp(trigger+cc,'gi'); - evt.preventDefault(); // prevent the tab key from being added - this.syntaxHighlight('snippets',pattern,content); - } - } - }, - - readOnly : function() { - document.designMode = (arguments[0]) ? 'off' : 'on'; - }, - - complete : function(trigger) { - window.getSelection().getRangeAt(0).deleteContents(); - var complete = Language.complete; - for (var i=0; i/g,'\n'); - code = code.replace(/\u2009/g,''); - code = code.replace(/<.*?>/g,''); - code = code.replace(/</g,'<'); - code = code.replace(/>/g,'>'); - code = code.replace(/&/gi,'&'); - return code; - }, - - // put code inside editor - setCode : function() { - var code = arguments[0]; - code = code.replace(/\u2009/gi,''); - code = code.replace(/&/gi,'&'); - code = code.replace(//g,'>'); - editor.innerHTML = code; - }, - - // undo and redo methods - actions : { - pos : -1, // actual history position - history : [], // history vector - - undo : function() { - if(editor.innerHTML.indexOf(cc)==-1){ - window.getSelection().getRangeAt(0).insertNode(document.createTextNode(cc)); - this.history[this.pos] = editor.innerHTML; - } - this.pos--; - if(typeof(this.history[this.pos])=='undefined') this.pos++; - editor.innerHTML = this.history[this.pos]; - CodePress.findString(); - }, - - redo : function() { - this.pos++; - if(typeof(this.history[this.pos])=='undefined') this.pos--; - editor.innerHTML = this.history[this.pos]; - CodePress.findString(); - }, - - next : function() { // get next vector position and clean old ones - if(this.pos>20) this.history[this.pos-21] = undefined; - return ++this.pos; - } - } -} - -Language={}; -window.addEventListener('load', function() { CodePress.initialize('new'); }, true); diff --git a/wp-includes/js/codepress/images/line-numbers.png b/wp-includes/js/codepress/images/line-numbers.png deleted file mode 100644 index ffea4e6a..00000000 Binary files a/wp-includes/js/codepress/images/line-numbers.png and /dev/null differ diff --git a/wp-includes/js/codepress/languages/asp.css b/wp-includes/js/codepress/languages/asp.css deleted file mode 100644 index 9a4c505c..00000000 --- a/wp-includes/js/codepress/languages/asp.css +++ /dev/null @@ -1,71 +0,0 @@ -/* - * CodePress color styles for ASP-VB syntax highlighting - * By Martin D. Kirk - */ -/* tags */ - -b { - color:#000080; -} -/* comments */ -big, big b, big em, big ins, big s, strong i, strong i b, strong i s, strong i u, strong i a, strong i a u, strong i s u { - color:gray; - font-weight:normal; -} -/* ASP comments */ -strong dfn, strong dfn a,strong dfn var, strong dfn a u, strong dfn u{ - color:gray; - font-weight:normal; -} - /* attributes */ -s, s b, span s u, span s cite, strong span s { - color:#5656fa ; - font-weight:normal; -} - /* strings */ -strong s,strong s b, strong s u, strong s cite { - color:#009900; - font-weight:normal; -} -strong ins{ - color:#000000; - font-weight:bold; -} - /* Syntax */ -strong a, strong a u { - color:#0000FF; - font-weight:; -} - /* Native Keywords */ -strong u { - color:#990099; - font-weight:bold; -} -/* Numbers */ -strong var{ - color:#FF0000; -} -/* ASP Language */ -span{ - color:#990000; - font-weight:bold; -} -strong i,strong a i, strong u i { - color:#009999; -} -/* style */ -em { - color:#800080; - font-style:normal; -} - /* script */ -ins { - color:#800000; - font-weight:bold; -} - -/* */ -cite, s cite { - color:red; - font-weight:bold; -} \ No newline at end of file diff --git a/wp-includes/js/codepress/languages/asp.js b/wp-includes/js/codepress/languages/asp.js deleted file mode 100644 index 21e78dd8..00000000 --- a/wp-includes/js/codepress/languages/asp.js +++ /dev/null @@ -1,117 +0,0 @@ -/* - * CodePress regular expressions for ASP-vbscript syntax highlighting - */ - -// ASP VBScript -Language.syntax = [ -// all tags - { input : /(<[^!%|!%@]*?>)/g, output : '$1' }, -// style tags - { input : /(<style.*?>)(.*?)(<\/style>)/g, output : '$1$2$3' }, -// script tags - { input : /(<script.*?>)(.*?)(<\/script>)/g, output : '$1$2$3' }, -// strings "" and attributes - { input : /\"(.*?)(\"|
          |<\/P>)/g, output : '"$1$2' }, -// ASP Comment - { input : /\'(.*?)(\'|
          |<\/P>)/g, output : '\'$1$2'}, -// <%.* - { input : /(<%)/g, output : '$1' }, -// .*%> - { input : /(%>)/g, output : '$1' }, -// <%@...%> - { input : /(<%@)(.+?)(%>)/gi, output : '$1$2$3' }, -//Numbers - { input : /\b([\d]+)\b/g, output : '$1' }, -// Reserved Words 1 (Blue) - { input : /\b(And|As|ByRef|ByVal|Call|Case|Class|Const|Dim|Do|Each|Else|ElseIf|Empty|End|Eqv|Exit|False|For|Function)\b/gi, output : '$1' }, - { input : /\b(Get|GoTo|If|Imp|In|Is|Let|Loop|Me|Mod|Enum|New|Next|Not|Nothing|Null|On|Option|Or|Private|Public|ReDim|Rem)\b/gi, output : '$1' }, - { input : /\b(Resume|Select|Set|Stop|Sub|Then|To|True|Until|Wend|While|With|Xor|Execute|Randomize|Erase|ExecuteGlobal|Explicit|step)\b/gi, output : '$1' }, -// Reserved Words 2 (Purple) - { input : /\b(Abandon|Abs|AbsolutePage|AbsolutePosition|ActiveCommand|ActiveConnection|ActualSize|AddHeader|AddNew|AppendChunk)\b/gi, output : '$1' }, - { input : /\b(AppendToLog|Application|Array|Asc|Atn|Attributes|BeginTrans|BinaryRead|BinaryWrite|BOF|Bookmark|Boolean|Buffer|Byte)\b/gi, output : '$1' }, - { input : /\b(CacheControl|CacheSize|Cancel|CancelBatch|CancelUpdate|CBool|CByte|CCur|CDate|CDbl|Charset|Chr|CInt|Clear)\b/gi, output : '$1' }, - { input : /\b(ClientCertificate|CLng|Clone|Close|CodePage|CommandText|CommandType|CommandTimeout|CommitTrans|CompareBookmarks|ConnectionString|ConnectionTimeout)\b/gi, output : '$1' }, - { input : /\b(Contents|ContentType|Cookies|Cos|CreateObject|CreateParameter|CSng|CStr|CursorLocation|CursorType|DataMember|DataSource|Date|DateAdd|DateDiff)\b/gi, output : '$1' }, - { input : /\b(DatePart|DateSerial|DateValue|Day|DefaultDatabase|DefinedSize|Delete|Description|Double|EditMode|Eof|EOF|err|Error)\b/gi, output : '$1' }, - { input : /\b(Exp|Expires|ExpiresAbsolute|Filter|Find|Fix|Flush|Form|FormatCurrency|FormatDateTime|FormatNumber|FormatPercent)\b/gi, output : '$1' }, - { input : /\b(GetChunk|GetLastError|GetRows|GetString|Global|HelpContext|HelpFile|Hex|Hour|HTMLEncode|IgnoreCase|Index|InStr|InStrRev)\b/gi, output : '$1' }, - { input : /\b(Int|Integer|IsArray|IsClientConnected|IsDate|IsolationLevel|Join|LBound|LCase|LCID|Left|Len|Lock|LockType|Log|Long|LTrim)\b/gi, output : '$1' }, - { input : /\b(MapPath|MarshalOptions|MaxRecords|Mid|Minute|Mode|Month|MonthName|Move|MoveFirst|MoveLast|MoveNext|MovePrevious|Name|NextRecordset)\b/gi, output : '$1' }, - { input : /\b(Now|Number|NumericScale|ObjectContext|Oct|Open|OpenSchema|OriginalValue|PageCount|PageSize|Pattern|PICS|Precision|Prepared|Property)\b/gi, output : '$1' }, - { input : /\b(Provider|QueryString|RecordCount|Redirect|RegExp|Remove|RemoveAll|Replace|Requery|Request|Response|Resync|Right|Rnd)\b/gi, output : '$1' }, - { input : /\b(RollbackTrans|RTrim|Save|ScriptTimeout|Second|Seek|Server|ServerVariables|Session|SessionID|SetAbort|SetComplete|Sgn)\b/gi, output : '$1' }, - { input : /\b(Sin|Size|Sort|Source|Space|Split|Sqr|State|StaticObjects|Status|StayInSync|StrComp|String|StrReverse|Supports|Tan|Time)\b/gi, output : '$1' }, - { input : /\b(Timeout|Timer|TimeSerial|TimeValue|TotalBytes|Transfer|Trim|Type|Type|UBound|UCase|UnderlyingValue|UnLock|Update|UpdateBatch)\b/gi, output : '$1' }, - { input : /\b(URLEncode|Value|Value|Version|Weekday|WeekdayName|Write|Year)\b/gi, output : '$1' }, -// Reserved Words 3 (Turquis) - { input : /\b(vbBlack|vbRed|vbGreen|vbYellow|vbBlue|vbMagenta|vbCyan|vbWhite|vbBinaryCompare|vbTextCompare)\b/gi, output : '$1' }, - { input : /\b(vbSunday|vbMonday|vbTuesday|vbWednesday|vbThursday|vbFriday|vbSaturday|vbUseSystemDayOfWeek)\b/gi, output : '$1' }, - { input : /\b(vbFirstJan1|vbFirstFourDays|vbFirstFullWeek|vbGeneralDate|vbLongDate|vbShortDate|vbLongTime|vbShortTime)\b/gi, output : '$1' }, - { input : /\b(vbObjectError|vbCr|VbCrLf|vbFormFeed|vbLf|vbNewLine|vbNullChar|vbNullString|vbTab|vbVerticalTab|vbUseDefault|vbTrue)\b/gi, output : '$1' }, - { input : /\b(vbFalse|vbEmpty|vbNull|vbInteger|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant)\b/gi, output : '$1' }, - { input : /\b(vbDataObject|vbDecimal|vbByte|vbArray)\b/gi, output : '$1' }, -// html comments - { input : /(<!--.*?-->.)/g, output : '$1' } -] - -Language.Functions = [ - // Output at index 0, must be the desired tagname surrounding a $1 - // Name is the index from the regex that marks the functionname - {input : /(function|sub)([ ]*?)(\w+)([ ]*?\()/gi , output : '$1', name : '$3'} -] - -Language.snippets = [ -//Conditional - { input : 'if', output : 'If $0 Then\n\t\nEnd If' }, - { input : 'ifelse', output : 'If $0 Then\n\t\n\nElse\n\t\nEnd If' }, - { input : 'case', output : 'Select Case $0\n\tCase ?\n\tCase Else\nEnd Select'}, -//Response - { input : 'rw', output : 'Response.Write( $0 )' }, - { input : 'resc', output : 'Response.Cookies( $0 )' }, - { input : 'resb', output : 'Response.Buffer'}, - { input : 'resflu', output : 'Response.Flush()'}, - { input : 'resend', output : 'Response.End'}, -//Request - { input : 'reqc', output : 'Request.Cookies( $0 )' }, - { input : 'rq', output : 'Request.Querystring("$0")' }, - { input : 'rf', output : 'Request.Form("$0")' }, -//FSO - { input : 'fso', output : 'Set fso = Server.CreateObject("Scripting.FileSystemObject")\n$0' }, - { input : 'setfo', output : 'Set fo = fso.getFolder($0)' }, - { input : 'setfi', output : 'Set fi = fso.getFile($0)' }, - { input : 'twr', output : 'Set f = fso.CreateTextFile($0,true)\'overwrite\nf.WriteLine()\nf.Close'}, - { input : 'tre', output : 'Set f = fso.OpenTextFile($0, 1)\nf.ReadAll\nf.Close'}, -//Server - { input : 'mapp', output : 'Server.Mappath($0)' }, -//Loops - { input : 'foreach', output : 'For Each $0 in ?\n\t\nNext' }, - { input : 'for', output : 'For $0 to ? step ?\n\t\nNext' }, - { input : 'do', output : 'Do While($0)\n\t\nLoop' }, - { input : 'untilrs', output : 'do until rs.eof\n\t\nrs.movenext\nloop' }, -//ADO - { input : 'adorec', output : 'Set rs = Server.CreateObject("ADODB.Recordset")' }, - { input : 'adocon', output : 'Set Conn = Server.CreateObject("ADODB.Connection")' }, - { input : 'adostr', output : 'Set oStr = Server.CreateObject("ADODB.Stream")' }, -//Http Request - { input : 'xmlhttp', output : 'Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")\nxmlHttp.open("GET", $0, false)\nxmlHttp.send()\n?=xmlHttp.responseText' }, - { input : 'xmldoc', output : 'Set xmldoc = Server.CreateObject("Microsoft.XMLDOM")\nxmldoc.async=false\nxmldoc.load(request)'}, -//Functions - { input : 'func', output : 'Function $0()\n\t\n\nEnd Function'}, - { input : 'sub', output : 'Sub $0()\n\t\nEnd Sub'} - -] - -Language.complete = [ - //{ input : '\'', output : '\'$0\'' }, - { input : '"', output : '"$0"' }, - { input : '(', output : '\($0\)' }, - { input : '[', output : '\[$0\]' }, - { input : '{', output : '{\n\t$0\n}' } -] - -Language.shortcuts = [ - { input : '[space]', output : ' ' }, - { input : '[enter]', output : '
          ' } , - { input : '[j]', output : 'testing' }, - { input : '[7]', output : '&' } -] \ No newline at end of file diff --git a/wp-includes/js/codepress/languages/autoit.css b/wp-includes/js/codepress/languages/autoit.css deleted file mode 100644 index eb2b43b6..00000000 --- a/wp-includes/js/codepress/languages/autoit.css +++ /dev/null @@ -1,13 +0,0 @@ -/** - * CodePress color styles for AutoIt syntax highlighting - */ - -u {font-style:normal;color:#000090;font-weight:bold;font-family:Monospace;} -var {color:#AA0000;font-weight:bold;font-style:normal;} -em {color:#FF33FF;} -ins {color:#AC00A9;} -i {color:#F000FF;} -b {color:#FF0000;} -a {color:#0080FF;font-weight:bold;} -s, s u, s b {color:#9999CC;font-weight:normal;} -cite, cite *{color:#009933;font-weight:normal;} \ No newline at end of file diff --git a/wp-includes/js/codepress/languages/autoit.js b/wp-includes/js/codepress/languages/autoit.js deleted file mode 100644 index 6f5c19d0..00000000 --- a/wp-includes/js/codepress/languages/autoit.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * CodePress regular expressions for AutoIt syntax highlighting - * @author: James Brooks, Michael HURNI - */ - -// AutoIt -Language.syntax = [ - { input : /({|}|\(|\))/g, output : '$1' }, // Brackets - { input : /(\*|\+|-)/g, output : '$1' }, // Operator - { input : /\"(.*?)(\"|
          |<\/P>)/g, output : "\"$1$2" }, // strings double - { input : /\'(.*?)(\'|
          |<\/P>)/g, output : '\'$1$2' }, // strings single - { input : /\b([\d]+)\b/g, output : '$1' }, // Numbers - { input : /#(.*?)(
          |<\/P>)/g, output : '#$1$2' }, // Directives and Includes - { input : /(\$[\w\.]*)/g, output : '$1' }, // vars - { input : /(_[\w\.]*)/g, output : '$1' }, // underscored word - { input : /(\@[\w\.]*)/g, output : '$1' }, // Macros - { input : /\b(Abs|ACos|AdlibDisable|AdlibEnable|Asc|AscW|ASin|Assign|ATan|AutoItSetOption|AutoItWinGetTitle|AutoItWinSetTitle|Beep|Binary|BinaryLen|BinaryMid|BinaryToString|BitAND|BitNOT|BitOR|BitSHIFT|BitXOR|BlockInput|Break|Call|CDTray|Ceiling|Chr|ChrW|ClipGet|ClipPut|ConsoleRead|ConsoleWrite|ConsoleWriteError|ControlClick|ControlCommand|ControlDisable|ControlEnable|ControlFocus|ControlGetFocus|ControlGetHandle|ControlGetPos|ControlGetText|ControlHide|ControlListView|ControlMove|ControlSend|ControlSetText|ControlShow|Cos|Dec|DirCopy|DirCreate|DirGetSize|DirMove|DirRemove|DllCall|DllCall|DllClose|DllOpen|DllStructCreate|DllStructGetData|DllStructGetPtr|DllStructGetSize|DllStructSetData|DriveGetDrive|DriveGetFileSystem|DriveGetLabel|DriveGetSerial|DriveGetType|DriveMapAdd|DriveMapDel|DriveMapGet|DriveSetLabel|DriveSpaceFree|DriveSpaceTotal|DriveStatus|EnvGet|EnvSet|EnvUpdate|Eval|Execute|Exp|FileChangeDir|FileClose|FileCopy|FileCreateNTFS|FileCreateShortcut|FileDelete|FileExists|FileFindFirstFile|FileFindNextFile|FileGetAttrib|FileGetLongName|FileGetShortcut|FileGetShortName|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileOpen|FileOpenDialog|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileSaveDialog|FileSelectFolder|FileSetAttrib|FileSetTime|FileWrite|FileWriteLine|Floor|FtpSetProxy|GuiCreate|GuiCtrlCreateAvi|GuiCtrlCreateButton|GuiCtrlCreateCheckbox|GuiCtrlCreateCombo|GuiCtrlCreateContextMenu|GuiCtrlCreateDate|GuiCtrlCreateDummy|GuiCtrlCreateEdit|GuiCtrlCreateGraphic|GuiCtrlCreateGroup|GuiCtrlCreateIcon|GuiCtrlCreateInput|GuiCtrlCreateLabel|GuiCtrlCreateList|GuiCtrlCreateListView|GuiCtrlCreateListViewItem|GuiCtrlCreateMenu|GuiCtrlCreateMenuItem|GuiCtrlCreateMonthCal|GuiCtrlCreateObj|GuiCtrlCreatePic|GuiCtrlCreateProgress|GuiCtrlCreateRadio|GuiCtrlCreateSlider|GuiCtrlCreateTab|GuiCtrlCreateTabItem|GuiCtrlCreateUpdown|GuiCtrlDelete|GuiCtrlGetHandle|GuiCtrlGetState|GuiCtrlRead|GuiCtrlRecvMsg|GuiCtrlSentMsg|GuiCtrlSendToDummy|GuiCtrlSetBkColor|GuiCtrlSetColor|GuiCtrlSetCursor|GuiCtrlSetData|GuiCtrlSetFont|GuiCtrlSetGraphic|GuiCtrlSetImage|GuiCtrlSetLimit|GuiCtrlSetOnEvent|GuiCtrlSetPos|GuiCtrlResizing|GuiCtrlSetState|GuiCtrlSetTip|GuiDelete|GuiGetCursorInfo|GuiGetMsg|GuiGetStyle|GuiRegisterMsg|GuiSetBkColor|GuiSetCoord|GuiSetCursor|GuiSetFont|GuiSetHelp|GuiSetIcon|GuiSetOnEvent|GuiSetStat|GuiSetStyle|GuiStartGroup|GuiSwitch|Hex|HotKeySet|HttpSetProxy|HWnd|InetGet|InetGetSize|IniDelete|IniRead|IniReadSection|IniReadSectionNames|IniRenameSection|IniWrite|IniWriteSection|InputBox|Int|IsAdmin|IsArray|IsBinary|IsBool|IsDeclared|IsDllStruct|IsFloat|IsHWnd|IsInt|IsKeyword|IsNumber|IsObj|IsString|Log|MemGetStats|Mod|MouseClick|MouseClickDrag|MouseDown|MouseGetCursor|MouseGetPos|MouseMove|MouseUp|MouseWheel|MsgBox|Number|ObjCreate|ObjEvent|ObjGet|ObjName|Ping|PixelCheckSum|PixelGetColor|PixelSearch|ProcessClose|ProcessExists|ProcessList|ProcessSetPriority|ProcessWait|ProcessWaitClose|ProgressOff|ProcessOn|ProgressSet|Random|RegDelete|RegEnumKey|RegEnumVal|RegRead|RegWrite|Round|Run|RunAsSet|RunWait|Send|SetError|SetExtended|ShellExecute|ShellExecuteWait|Shutdown|Sin|Sleep|SoundPlay|SoundSetWaveVolume|SplashImageOn|SplashOff|SplashTextOn|Sqrt|SRandom|StatusbarGetText|StderrRead|StdinWrite|StdoutRead|String|StringAddCR|StringCompare|StringFormat|StringInStr|StringIsAlNum|StringIsAlpha|StringIsASCII|StringIsDigit|StringIsFloat|StringIsInt|StringIsLower|StringIsSpace|StringIsUpper|StringIsXDigit|StringLeft|StringLen|StringLower|StringMid|StringRegExp|StringRegExpReplace|StringReplace|StringRight|StringSplit|StringStripCR|StringStripWS|StringToBinary|StringTrimLeft|StringTrimRight|StringUpper|Tan|TCPAccept|TCPCloseSocket|TCPConnect|TCPListen|TCPNameToIP|TCPrecv|TCPSend|TCPShutdown|TCPStartup|TimerDiff|TimerInit|ToolTip|TrayCreateItem|TrayCreateMenu|TrayGetMenu|TrayGetMsg|TrayItemDelete|TrayItemGetHandle|TrayItemGetState|TrayItemGetText|TrayItemSetOnEvent|TrayItemSetState|TrayItemSetText|TraySetClick|TraySetIcon|TraySetOnEvent|TraySetPauseIcon|TraySetState|TraySetToolTip|TrayTip|UBound|UDPBind|UDPCloseSocket|UDPOpen|UDPRecv|UDPSend|WinActivate|WinActive|WinClose|WinExists|WinFlash|WinGetCaretPos|WinGetClassList|WinGetClientSize|WinGetHandle|WinGetPos|WinGetProcess|WinGetState|WinGetText|WinGetTitle|WinKill|WinList|WinMenuSelectItem|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinSetOnTop|WinSetState|WinSetTitle|WinSetTrans|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/g, output : '$1' } ,// reserved words - { input : /\B;(.*?)(
          |<\/P>)/g, output : ';$1$2' }, // comments - { input : /#CS(.*?)#CE/g, output : '#CS$1#CE' } // Block Comments -] - -Language.snippets = [] - -Language.complete = [ -{ input : '\'',output : '\'$0\'' }, -{ input : '"', output : '"$0"' }, -{ input : '(', output : '\($0\)' }, -{ input : '[', output : '\[$0\]' }, -{ input : '{', output : '{\n\t$0\n}' } -] - -Language.shortcuts = [] diff --git a/wp-includes/js/codepress/languages/csharp.css b/wp-includes/js/codepress/languages/csharp.css deleted file mode 100644 index 8464c5dd..00000000 --- a/wp-includes/js/codepress/languages/csharp.css +++ /dev/null @@ -1,9 +0,0 @@ -/* - * CodePress color styles for Java syntax highlighting - * By Edwin de Jonge - */ - -b {color:#7F0055;font-weight:bold;font-style:normal;} /* reserved words */ -a {color:#2A0088;font-weight:bold;font-style:normal;} /* types */ -i, i b, i s {color:#3F7F5F;font-weight:bold;} /* comments */ -s, s b {color:#2A00FF;font-weight:normal;} /* strings */ \ No newline at end of file diff --git a/wp-includes/js/codepress/languages/csharp.js b/wp-includes/js/codepress/languages/csharp.js deleted file mode 100644 index 0a61fd52..00000000 --- a/wp-includes/js/codepress/languages/csharp.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - * CodePress regular expressions for C# syntax highlighting - * By Edwin de Jonge - */ - -Language.syntax = [ // C# - { input : /\"(.*?)(\"|
          |<\/P>)/g, output : '"$1$2' }, // strings double quote - { input : /\'(.?)(\'|
          |<\/P>)/g, output : '\'$1$2' }, // strings single quote - { input : /\b(abstract|as|base|break|case|catch|checked|continue|default|delegate|do|else|event|explicit|extern|false|finally|fixed|for|foreach|get|goto|if|implicit|in|interface|internal|is|lock|namespace|new|null|object|operator|out|override|params|partial|private|protected|public|readonly|ref|return|set|sealed|sizeof|static|stackalloc|switch|this|throw|true|try|typeof|unchecked|unsafe|using|value|virtual|while)\b/g, output : '$1' }, // reserved words - { input : /\b(bool|byte|char|class|double|float|int|interface|long|string|struct|void)\b/g, output : '$1' }, // types - { input : /([^:]|^)\/\/(.*?)(//$2$3' }, // comments // - { input : /\/\*(.*?)\*\//g, output : '/*$1*/' } // comments /* */ -]; - -Language.snippets = []; - -Language.complete = [ // Auto complete only for 1 character - {input : '\'',output : '\'$0\'' }, - {input : '"', output : '"$0"' }, - {input : '(', output : '\($0\)' }, - {input : '[', output : '\[$0\]' }, - {input : '{', output : '{\n\t$0\n}' } -]; - -Language.shortcuts = []; \ No newline at end of file diff --git a/wp-includes/js/codepress/languages/css.css b/wp-includes/js/codepress/languages/css.css deleted file mode 100644 index 49ba5843..00000000 --- a/wp-includes/js/codepress/languages/css.css +++ /dev/null @@ -1,10 +0,0 @@ -/* - * CodePress color styles for CSS syntax highlighting - */ - -b, b a, b u {color:#000080;} /* tags, ids, classes */ -i, i b, i s, i a, i u {color:gray;} /* comments */ -s, s b {color:#a0a0dd;} /* parameters */ -a {color:#0000ff;} /* keys */ -u {color:red;} /* values */ - diff --git a/wp-includes/js/codepress/languages/css.js b/wp-includes/js/codepress/languages/css.js deleted file mode 100644 index c29059b7..00000000 --- a/wp-includes/js/codepress/languages/css.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * CodePress regular expressions for CSS syntax highlighting - */ - -// CSS -Language.syntax = [ - { input : /(.*?){(.*?)}/g,output : '$1{$2}' }, // tags, ids, classes, values - { input : /([\w-]*?):([^\/])/g,output : '$1:$2' }, // keys - { input : /\((.*?)\)/g,output : '($1)' }, // parameters - { input : /\/\*(.*?)\*\//g,output : '/*$1*/'} // comments -] - -Language.snippets = [] - -Language.complete = [ - { input : '\'',output : '\'$0\'' }, - { input : '"', output : '"$0"' }, - { input : '(', output : '\($0\)' }, - { input : '[', output : '\[$0\]' }, - { input : '{', output : '{\n\t$0\n}' } -] - -Language.shortcuts = [] diff --git a/wp-includes/js/codepress/languages/generic.css b/wp-includes/js/codepress/languages/generic.css deleted file mode 100644 index 712942f4..00000000 --- a/wp-includes/js/codepress/languages/generic.css +++ /dev/null @@ -1,9 +0,0 @@ -/* - * CodePress color styles for generic syntax highlighting - */ - -b {color:#7F0055;font-weight:bold;} /* reserved words */ -u {color:darkblue;font-weight:bold;} /* special words */ -i, i b, i s, i u, i em {color:green;font-weight:normal;} /* comments */ -s, s b, s em {color:#2A00FF;font-weight:normal;} /* strings */ -em {font-weight:bold;} /* special chars */ \ No newline at end of file diff --git a/wp-includes/js/codepress/languages/generic.js b/wp-includes/js/codepress/languages/generic.js deleted file mode 100644 index 4c866de9..00000000 --- a/wp-includes/js/codepress/languages/generic.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - * CodePress regular expressions for generic syntax highlighting - */ - -// generic languages -Language.syntax = [ - { input : /\"(.*?)(\"|
          |<\/P>)/g, output : '"$1$2' }, // strings double quote - { input : /\'(.*?)(\'|
          |<\/P>)/g, output : '\'$1$2' }, // strings single quote - { input : /\b(abstract|continue|for|new|switch|default|goto|boolean|do|if|private|this|break|double|protected|throw|byte|else|import|public|throws|case|return|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|const|float|while|function|label)\b/g, output : '$1' }, // reserved words - { input : /([\(\){}])/g, output : '$1' }, // special chars; - { input : /([^:]|^)\/\/(.*?)(//$2$3' }, // comments // - { input : /\/\*(.*?)\*\//g, output : '/*$1*/' } // comments /* */ -] - -Language.snippets = [] - -Language.complete = [ - { input : '\'', output : '\'$0\'' }, - { input : '"', output : '"$0"' }, - { input : '(', output : '\($0\)' }, - { input : '[', output : '\[$0\]' }, - { input : '{', output : '{\n\t$0\n}' } -] - -Language.shortcuts = [] diff --git a/wp-includes/js/codepress/languages/html.css b/wp-includes/js/codepress/languages/html.css deleted file mode 100644 index 14882e55..00000000 --- a/wp-includes/js/codepress/languages/html.css +++ /dev/null @@ -1,13 +0,0 @@ -/* - * CodePress color styles for HTML syntax highlighting - */ - -b {color:#000080;} /* tags */ -ins, ins b, ins s, ins em {color:gray;} /* comments */ -s, s b {color:#7777e4;} /* attribute values */ -a {color:green;} /* links */ -u {color:#E67300;} /* forms */ -big {color:#db0000;} /* images */ -em, em b {color:#800080;} /* style */ -strong {color:#800000;} /* script */ -tt i {color:darkblue;font-weight:bold;} /* script reserved words */ diff --git a/wp-includes/js/codepress/languages/html.js b/wp-includes/js/codepress/languages/html.js deleted file mode 100644 index 4ead0b08..00000000 --- a/wp-includes/js/codepress/languages/html.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * CodePress regular expressions for HTML syntax highlighting - */ - -// HTML -Language.syntax = [ - { input : /(<[^!]*?>)/g, output : '$1' }, // all tags - { input : /(<a .*?>|<\/a>)/g, output : '$1' }, // links - { input : /(<img .*?>)/g, output : '$1' }, // images - { input : /(<\/?(button|textarea|form|input|select|option|label).*?>)/g, output : '$1' }, // forms - { input : /(<style.*?>)(.*?)(<\/style>)/g, output : '$1$2$3' }, // style tags - { input : /(<script.*?>)(.*?)(<\/script>)/g, output : '$1$2$3' }, // script tags - { input : /=(".*?")/g, output : '=$1' }, // atributes double quote - { input : /=('.*?')/g, output : '=$1' }, // atributes single quote - { input : /(<!--.*?-->.)/g, output : '$1' }, // comments - { input : /\b(alert|window|document|break|continue|do|for|new|this|void|case|default|else|function|return|typeof|while|if|label|switch|var|with|catch|boolean|int|try|false|throws|null|true|goto)\b/g, output : '$1' } // script reserved words -] - -Language.snippets = [ - { input : 'aref', output : '' }, - { input : 'h1', output : '

          $0

          ' }, - { input : 'h2', output : '

          $0

          ' }, - { input : 'h3', output : '

          $0

          ' }, - { input : 'h4', output : '

          $0

          ' }, - { input : 'h5', output : '
          $0
          ' }, - { input : 'h6', output : '
          $0
          ' }, - { input : 'html', output : '\n\t$0\n' }, - { input : 'head', output : '\n\t\n\t$0\n\t\n' }, - { input : 'img', output : '' }, - { input : 'input', output : '' }, - { input : 'label', output : '' }, - { input : 'legend', output : '\n\t$0\n' }, - { input : 'link', output : '' }, - { input : 'base', output : '' }, - { input : 'body', output : '\n\t$0\n' }, - { input : 'css', output : '' }, - { input : 'div', output : '
          \n\t$0\n
          ' }, - { input : 'divid', output : '
          \n\t\n
          ' }, - { input : 'dl', output : '
          \n\t
          \n\t\t$0\n\t
          \n\t
          \n
          ' }, - { input : 'fieldset', output : '
          \n\t$0\n
          ' }, - { input : 'form', output : '
          \n\t\n
          ' }, - { input : 'meta', output : '' }, - { input : 'p', output : '

          $0

          ' }, - { input : 'script', output : '' }, - { input : 'scriptsrc', output : '' }, - { input : 'span', output : '$0' }, - { input : 'table', output : '\n\t\n\t\n
          ' }, - { input : 'style', output : '' } -] - -Language.complete = [ - { input : '\'',output : '\'$0\'' }, - { input : '"', output : '"$0"' }, - { input : '(', output : '\($0\)' }, - { input : '[', output : '\[$0\]' }, - { input : '{', output : '{\n\t$0\n}' } -] - -Language.shortcuts = [] diff --git a/wp-includes/js/codepress/languages/java.css b/wp-includes/js/codepress/languages/java.css deleted file mode 100644 index b9c44416..00000000 --- a/wp-includes/js/codepress/languages/java.css +++ /dev/null @@ -1,7 +0,0 @@ -/* - * CodePress color styles for Java syntax highlighting - */ - -b {color:#7F0055;font-weight:bold;font-style:normal;} /* reserved words */ -i, i b, i s {color:#3F7F5F;font-weight:bold;} /* comments */ -s, s b {color:#2A00FF;font-weight:normal;} /* strings */ diff --git a/wp-includes/js/codepress/languages/java.js b/wp-includes/js/codepress/languages/java.js deleted file mode 100644 index f0d620d6..00000000 --- a/wp-includes/js/codepress/languages/java.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * CodePress regular expressions for Java syntax highlighting - */ - -// Java -Language.syntax = [ - { input : /\"(.*?)(\"|
          |<\/P>)/g, output : '"$1$2'}, // strings double quote - { input : /\'(.*?)(\'|
          |<\/P>)/g, output : '\'$1$2'}, // strings single quote - { input : /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/g, output : '$1'}, // reserved words - { input : /([^:]|^)\/\/(.*?)(//$2$3'}, // comments // - { input : /\/\*(.*?)\*\//g, output : '/*$1*/' }// comments /* */ -] - -Language.snippets = [] - -Language.complete = [ - { input : '\'',output : '\'$0\'' }, - { input : '"', output : '"$0"' }, - { input : '(', output : '\($0\)' }, - { input : '[', output : '\[$0\]' }, - { input : '{', output : '{\n\t$0\n}' } -] - -Language.shortcuts = [] diff --git a/wp-includes/js/codepress/languages/javascript.css b/wp-includes/js/codepress/languages/javascript.css deleted file mode 100644 index acbf49a9..00000000 --- a/wp-includes/js/codepress/languages/javascript.css +++ /dev/null @@ -1,8 +0,0 @@ -/* - * CodePress color styles for JavaScript syntax highlighting - */ - -b {color:#7F0055;font-weight:bold;} /* reserved words */ -u {color:darkblue;font-weight:bold;} /* special words */ -i, i b, i s, i u {color:green;font-weight:normal;} /* comments */ -s, s b, s u {color:#2A00FF;font-weight:normal;} /* strings */ diff --git a/wp-includes/js/codepress/languages/javascript.js b/wp-includes/js/codepress/languages/javascript.js deleted file mode 100644 index 66d0fc02..00000000 --- a/wp-includes/js/codepress/languages/javascript.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * CodePress regular expressions for JavaScript syntax highlighting - */ - -// JavaScript -Language.syntax = [ - { input : /\"(.*?)(\"|
          |<\/P>)/g, output : '"$1$2' }, // strings double quote - { input : /\'(.*?)(\'|
          |<\/P>)/g, output : '\'$1$2' }, // strings single quote - { input : /\b(break|continue|do|for|new|this|void|case|default|else|function|return|typeof|while|if|label|switch|var|with|catch|boolean|int|try|false|throws|null|true|goto)\b/g, output : '$1' }, // reserved words - { input : /\b(alert|isNaN|parent|Array|parseFloat|parseInt|blur|clearTimeout|prompt|prototype|close|confirm|length|Date|location|Math|document|element|name|self|elements|setTimeout|navigator|status|String|escape|Number|submit|eval|Object|event|onblur|focus|onerror|onfocus|onclick|top|onload|toString|onunload|unescape|open|valueOf|window|onmouseover)\b/g, output : '$1' }, // special words - { input : /([^:]|^)\/\/(.*?)(//$2$3' }, // comments // - { input : /\/\*(.*?)\*\//g, output : '/*$1*/' } // comments /* */ -] - -Language.snippets = [ - { input : 'dw', output : 'document.write(\'$0\');' }, - { input : 'getid', output : 'document.getElementById(\'$0\')' }, - { input : 'fun', output : 'function $0(){\n\t\n}' }, - { input : 'func', output : 'function $0(){\n\t\n}' } -] - -Language.complete = [ - { input : '\'',output : '\'$0\'' }, - { input : '"', output : '"$0"' }, - { input : '(', output : '\($0\)' }, - { input : '[', output : '\[$0\]' }, - { input : '{', output : '{\n\t$0\n}' } -] - -Language.shortcuts = [] diff --git a/wp-includes/js/codepress/languages/perl.css b/wp-includes/js/codepress/languages/perl.css deleted file mode 100644 index c2d6d56d..00000000 --- a/wp-includes/js/codepress/languages/perl.css +++ /dev/null @@ -1,11 +0,0 @@ -/* - * CodePress color styles for Perl syntax highlighting - * By J. Nick Koston - */ - -b {color:#7F0055;font-weight:bold;} /* reserved words */ -i, i b, i s, i em, i a, i u {color:gray;font-weight:normal;} /* comments */ -s, s b, s a, s em, s u {color:#2A00FF;font-weight:normal;} /* strings */ -a {color:#006700;font-weight:bold;} /* variables */ -em {color:darkblue;font-weight:bold;} /* functions */ -u {font-weight:bold;} /* special chars */ \ No newline at end of file diff --git a/wp-includes/js/codepress/languages/perl.js b/wp-includes/js/codepress/languages/perl.js deleted file mode 100644 index 06c380d6..00000000 --- a/wp-includes/js/codepress/languages/perl.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * CodePress regular expressions for Perl syntax highlighting - * By J. Nick Koston - */ - -// Perl -Language.syntax = [ - { input : /\"(.*?)(\"|
          |<\/P>)/g, output : '"$1$2' }, // strings double quote - { input : /\'(.*?)(\'|
          |<\/P>)/g, output : '\'$1$2' }, // strings single quote - { input : /([\$\@\%][\w\.]*)/g, output : '$1' }, // vars - { input : /(sub\s+)([\w\.]*)/g, output : '$1$2' }, // functions - { input : /\b(abs|accept|alarm|atan2|bind|binmode|bless|caller|chdir|chmod|chomp|chop|chown|chr|chroot|close|closedir|connect|continue|cos|crypt|dbmclose|dbmopen|defined|delete|die|do|dump|each|else|elsif|endgrent|endhostent|endnetent|endprotoent|endpwent|eof|eval|exec|exists|exit|fcntl|fileno|find|flock|for|foreach|fork|format|formlinegetc|getgrent|getgrgid|getgrnam|gethostbyaddr|gethostbyname|gethostent|getlogin|getnetbyaddr|getnetbyname|getnetent|getpeername|getpgrp|getppid|getpriority|getprotobyname|getprotobynumber|getprotoent|getpwent|getpwnam|getpwuid|getservbyaddr|getservbyname|getservbyport|getservent|getsockname|getsockopt|glob|gmtime|goto|grep|hex|hostname|if|import|index|int|ioctl|join|keys|kill|last|lc|lcfirst|length|link|listen|LoadExternals|local|localtime|log|lstat|map|mkdir|msgctl|msgget|msgrcv|msgsnd|my|next|no|oct|open|opendir|ordpack|package|pipe|pop|pos|print|printf|push|pwd|qq|quotemeta|qw|rand|read|readdir|readlink|recv|redo|ref|rename|require|reset|return|reverse|rewinddir|rindex|rmdir|scalar|seek|seekdir|select|semctl|semget|semop|send|setgrent|sethostent|setnetent|setpgrp|setpriority|setprotoent|setpwent|setservent|setsockopt|shift|shmctl|shmget|shmread|shmwrite|shutdown|sin|sleep|socket|socketpair|sort|splice|split|sprintf|sqrt|srand|stat|stty|study|sub|substr|symlink|syscall|sysopen|sysread|system|syswritetell|telldir|tie|tied|time|times|tr|truncate|uc|ucfirst|umask|undef|unless|unlink|until|unpack|unshift|untie|use|utime|values|vec|waitpid|wantarray|warn|while|write)\b/g, output : '$1' }, // reserved words - { input : /([\(\){}])/g, output : '$1' }, // special chars - { input : /#(.*?)(
          |<\/P>)/g, output : '#$1$2' } // comments -] - -Language.snippets = [] - -Language.complete = [ - { input : '\'',output : '\'$0\'' }, - { input : '"', output : '"$0"' }, - { input : '(', output : '\($0\)' }, - { input : '[', output : '\[$0\]' }, - { input : '{', output : '{\n\t$0\n}' } -] - -Language.shortcuts = [] diff --git a/wp-includes/js/codepress/languages/php.css b/wp-includes/js/codepress/languages/php.css deleted file mode 100644 index 23fca5c7..00000000 --- a/wp-includes/js/codepress/languages/php.css +++ /dev/null @@ -1,12 +0,0 @@ -/* - * CodePress color styles for PHP syntax highlighting - */ - -b {color:#000080;} /* tags */ -big, big b, big em, big ins, big s, strong i, strong i b, strong i s, strong i u, strong i a, strong i a u, strong i s u {color:gray;font-weight:normal;} /* comments */ -s, s b, strong s u, strong s cite {color:#5656fa;font-weight:normal;} /* attributes and strings */ -strong a, strong a u {color:#006700;font-weight:bold;} /* variables */ -em {color:#800080;font-style:normal;} /* style */ -ins {color:#800000;} /* script */ -strong u {color:#7F0055;font-weight:bold;} /* reserved words */ -cite, s cite {color:red;font-weight:bold;} /* */ diff --git a/wp-includes/js/codepress/languages/php.js b/wp-includes/js/codepress/languages/php.js deleted file mode 100644 index 1689fbae..00000000 --- a/wp-includes/js/codepress/languages/php.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * CodePress regular expressions for PHP syntax highlighting - */ - -// PHP -Language.syntax = [ - { input : /(<[^!\?]*?>)/g, output : '$1' }, // all tags - { input : /(<style.*?>)(.*?)(<\/style>)/g, output : '$1$2$3' }, // style tags - { input : /(<script.*?>)(.*?)(<\/script>)/g, output : '$1$2$3' }, // script tags - { input : /\"(.*?)(\"|
          |<\/P>)/g, output : '"$1$2' }, // strings double quote - { input : /\'(.*?)(\'|
          |<\/P>)/g, output : '\'$1$2'}, // strings single quote - { input : /(<\?)/g, output : '$1' }, // ' }, // .*?> - { input : /(<\?php|<\?=|<\?|\?>)/g, output : '$1' }, // php tags - { input : /(\$[\w\.]*)/g, output : '$1' }, // vars - { input : /\b(false|true|and|or|xor|__FILE__|exception|__LINE__|array|as|break|case|class|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|for|foreach|function|global|if|include|include_once|isset|list|new|print|require|require_once|return|static|switch|unset|use|while|__FUNCTION__|__CLASS__|__METHOD__|final|php_user_filter|interface|implements|extends|public|private|protected|abstract|clone|try|catch|throw|this)\b/g, output : '$1' }, // reserved words - { input : /([^:])\/\/(.*?)(//$2$3' }, // php comments // - { input : /([^:])#(.*?)(#$2$3' }, // php comments # - { input : /\/\*(.*?)\*\//g, output : '/*$1*/' }, // php comments /* */ - { input : /(<!--.*?-->.)/g, output : '$1' } // html comments -] - -Language.snippets = [ - { input : 'if', output : 'if($0){\n\t\n}' }, - { input : 'ifelse', output : 'if($0){\n\t\n}\nelse{\n\t\n}' }, - { input : 'else', output : '}\nelse {\n\t' }, - { input : 'elseif', output : '}\nelseif($0) {\n\t' }, - { input : 'do', output : 'do{\n\t$0\n}\nwhile();' }, - { input : 'inc', output : 'include_once("$0");' }, - { input : 'fun', output : 'function $0(){\n\t\n}' }, - { input : 'func', output : 'function $0(){\n\t\n}' }, - { input : 'while', output : 'while($0){\n\t\n}' }, - { input : 'for', output : 'for($0,,){\n\t\n}' }, - { input : 'fore', output : 'foreach($0 as ){\n\t\n}' }, - { input : 'foreach', output : 'foreach($0 as ){\n\t\n}' }, - { input : 'echo', output : 'echo \'$0\';' }, - { input : 'switch', output : 'switch($0) {\n\tcase "": break;\n\tdefault: ;\n}' }, - { input : 'case', output : 'case "$0" : break;' }, - { input : 'ret0', output : 'return false;' }, - { input : 'retf', output : 'return false;' }, - { input : 'ret1', output : 'return true;' }, - { input : 'rett', output : 'return true;' }, - { input : 'ret', output : 'return $0;' }, - { input : 'def', output : 'define(\'$0\',\'\');' }, - { input : '' } -] - -Language.complete = [ - { input : '\'', output : '\'$0\'' }, - { input : '"', output : '"$0"' }, - { input : '(', output : '\($0\)' }, - { input : '[', output : '\[$0\]' }, - { input : '{', output : '{\n\t$0\n}' } -] - -Language.shortcuts = [ - { input : '[space]', output : ' ' }, - { input : '[enter]', output : '
          ' } , - { input : '[j]', output : 'testing' }, - { input : '[7]', output : '&' } -] \ No newline at end of file diff --git a/wp-includes/js/codepress/languages/ruby.css b/wp-includes/js/codepress/languages/ruby.css deleted file mode 100644 index edb9028d..00000000 --- a/wp-includes/js/codepress/languages/ruby.css +++ /dev/null @@ -1,10 +0,0 @@ -/* - * CodePress color styles for Ruby syntax highlighting - */ - -b {color:#7F0055;font-weight:bold;} /* reserved words */ -i, i b, i s, i em, i a, i u {color:gray;font-weight:normal;} /* comments */ -s, s b, s a, s em, s u {color:#2A00FF;font-weight:normal;} /* strings */ -a {color:#006700;font-weight:bold;} /* variables */ -em {color:darkblue;font-weight:bold;} /* functions */ -u {font-weight:bold;} /* special chars */ \ No newline at end of file diff --git a/wp-includes/js/codepress/languages/ruby.js b/wp-includes/js/codepress/languages/ruby.js deleted file mode 100644 index 207f23b0..00000000 --- a/wp-includes/js/codepress/languages/ruby.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * CodePress regular expressions for Perl syntax highlighting - */ - -// Ruby -Language.syntax = [ - { input : /\"(.*?)(\"|
          |<\/P>)/g, output : '"$1$2' }, // strings double quote - { input : /\'(.*?)(\'|
          |<\/P>)/g, output : '\'$1$2' }, // strings single quote - { input : /([\$\@\%]+)([\w\.]*)/g, output : '$1$2' }, // vars - { input : /(def\s+)([\w\.]*)/g, output : '$1$2' }, // functions - { input : /\b(alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\b/g, output : '$1' }, // reserved words - { input : /([\(\){}])/g, output : '$1' }, // special chars - { input : /#(.*?)(
          |<\/P>)/g, output : '#$1$2' } // comments -]; - -Language.snippets = [] - -Language.complete = [ - { input : '\'',output : '\'$0\'' }, - { input : '"', output : '"$0"' }, - { input : '(', output : '\($0\)' }, - { input : '[', output : '\[$0\]' }, - { input : '{', output : '{\n\t$0\n}' } -] - -Language.shortcuts = [] diff --git a/wp-includes/js/codepress/languages/sql.css b/wp-includes/js/codepress/languages/sql.css deleted file mode 100644 index 92c4b96d..00000000 --- a/wp-includes/js/codepress/languages/sql.css +++ /dev/null @@ -1,10 +0,0 @@ -/* - * CodePress color styles for SQL syntax highlighting - * By Merlin Moncure - */ - -b {color:#0000FF;font-style:normal;font-weight:bold;} /* reserved words */ -u {color:#FF0000;font-style:normal;} /* types */ -a {color:#CD6600;font-style:normal;font-weight:bold;} /* commands */ -i, i b, i u, i a, i s {color:#A9A9A9;font-weight:normal;font-style:italic;} /* comments */ -s, s b, s u, s a, s i {color:#2A00FF;font-weight:normal;} /* strings */ diff --git a/wp-includes/js/codepress/languages/sql.js b/wp-includes/js/codepress/languages/sql.js deleted file mode 100644 index 1d4a21f8..00000000 --- a/wp-includes/js/codepress/languages/sql.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * CodePress regular expressions for SQL syntax highlighting - * By Merlin Moncure - */ - -// SQL -Language.syntax = [ - { input : /\'(.*?)(\')/g, output : '\'$1$2' }, // strings single quote - { input : /\b(add|after|aggregate|alias|all|and|as|authorization|between|by|cascade|cache|cache|called|case|check|column|comment|constraint|createdb|createuser|cycle|database|default|deferrable|deferred|diagnostics|distinct|domain|each|else|elseif|elsif|encrypted|except|exception|for|foreign|from|from|full|function|get|group|having|if|immediate|immutable|in|increment|initially|increment|index|inherits|inner|input|intersect|into|invoker|is|join|key|language|left|like|limit|local|loop|match|maxvalue|minvalue|natural|nextval|no|nocreatedb|nocreateuser|not|null|of|offset|oids|on|only|operator|or|order|outer|owner|partial|password|perform|plpgsql|primary|record|references|replace|restrict|return|returns|right|row|rule|schema|security|sequence|session|sql|stable|statistics|table|temp|temporary|then|time|to|transaction|trigger|type|unencrypted|union|unique|user|using|valid|value|values|view|volatile|when|where|with|without|zone)\b/gi, output : '$1' }, // reserved words - { input : /\b(bigint|bigserial|bit|boolean|box|bytea|char|character|cidr|circle|date|decimal|double|float4|float8|inet|int2|int4|int8|integer|interval|line|lseg|macaddr|money|numeric|oid|path|point|polygon|precision|real|refcursor|serial|serial4|serial8|smallint|text|timestamp|varbit|varchar)\b/gi, output : '$1' }, // types - { input : /\b(abort|alter|analyze|begin|checkpoint|close|cluster|comment|commit|copy|create|deallocate|declare|delete|drop|end|execute|explain|fetch|grant|insert|listen|load|lock|move|notify|prepare|reindex|reset|restart|revoke|rollback|select|set|show|start|truncate|unlisten|update)\b/gi, output : '$1' }, // commands - { input : /([^:]|^)\-\-(.*?)(--$2$3' } // comments // -] - -Language.snippets = [ - { input : 'select', output : 'select $0 from where ' } -] - -Language.complete = [ - { input : '\'', output : '\'$0\'' }, - { input : '"', output : '"$0"' }, - { input : '(', output : '\($0\)' }, - { input : '[', output : '\[$0\]' }, - { input : '{', output : '{\n\t$0\n}' } -] - -Language.shortcuts = [] - - - diff --git a/wp-includes/js/codepress/languages/text.css b/wp-includes/js/codepress/languages/text.css deleted file mode 100644 index 474fe60c..00000000 --- a/wp-includes/js/codepress/languages/text.css +++ /dev/null @@ -1,5 +0,0 @@ -/* - * CodePress color styles for Text syntax highlighting - */ - -/* do nothing as expected */ diff --git a/wp-includes/js/codepress/languages/text.js b/wp-includes/js/codepress/languages/text.js deleted file mode 100644 index 6534aafa..00000000 --- a/wp-includes/js/codepress/languages/text.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - * CodePress regular expressions for Text syntax highlighting - */ - -// plain text -Language.syntax = [] -Language.snippets = [] -Language.complete = [] -Language.shortcuts = [] diff --git a/wp-includes/js/codepress/languages/vbscript.css b/wp-includes/js/codepress/languages/vbscript.css deleted file mode 100644 index e1465e90..00000000 --- a/wp-includes/js/codepress/languages/vbscript.css +++ /dev/null @@ -1,71 +0,0 @@ -/* - * CodePress color styles for ASP-VB syntax highlighting - * By Martin D. Kirk - */ - -/* tags */ -b { - color:#000080; -} -/* comments */ -big, big b, big em, big ins, big s, strong i, strong i b, strong i s, strong i u, strong i a, strong i a u, strong i s u { - color:gray; - font-weight:normal; -} -/* ASP comments */ -strong dfn, strong dfn a,strong dfn var, strong dfn a u, strong dfn u{ - color:gray; - font-weight:normal; -} - /* attributes */ -s, s b, span s u, span s cite, strong span s { - color:#5656fa ; - font-weight:normal; -} - /* strings */ -strong s,strong s b, strong s u, strong s cite { - color:#009900; - font-weight:normal; -} -strong ins{ - color:#000000; - font-weight:bold; -} - /* Syntax */ -strong a, strong a u { - color:#0000FF; - font-weight:; -} - /* Native Keywords */ -strong u { - color:#990099; - font-weight:bold; -} -/* Numbers */ -strong var{ - color:#FF0000; -} -/* ASP Language */ -span{ - color:#990000; - font-weight:bold; -} -strong i,strong a i, strong u i { - color:#009999; -} -/* style */ -em { - color:#800080; - font-style:normal; -} - /* script */ -ins { - color:#800000; - font-weight:bold; -} - -/* */ -cite, s cite { - color:red; - font-weight:bold; -} \ No newline at end of file diff --git a/wp-includes/js/codepress/languages/vbscript.js b/wp-includes/js/codepress/languages/vbscript.js deleted file mode 100644 index 21e78dd8..00000000 --- a/wp-includes/js/codepress/languages/vbscript.js +++ /dev/null @@ -1,117 +0,0 @@ -/* - * CodePress regular expressions for ASP-vbscript syntax highlighting - */ - -// ASP VBScript -Language.syntax = [ -// all tags - { input : /(<[^!%|!%@]*?>)/g, output : '$1' }, -// style tags - { input : /(<style.*?>)(.*?)(<\/style>)/g, output : '$1$2$3' }, -// script tags - { input : /(<script.*?>)(.*?)(<\/script>)/g, output : '$1$2$3' }, -// strings "" and attributes - { input : /\"(.*?)(\"|
          |<\/P>)/g, output : '"$1$2' }, -// ASP Comment - { input : /\'(.*?)(\'|
          |<\/P>)/g, output : '\'$1$2'}, -// <%.* - { input : /(<%)/g, output : '$1' }, -// .*%> - { input : /(%>)/g, output : '$1' }, -// <%@...%> - { input : /(<%@)(.+?)(%>)/gi, output : '$1$2$3' }, -//Numbers - { input : /\b([\d]+)\b/g, output : '$1' }, -// Reserved Words 1 (Blue) - { input : /\b(And|As|ByRef|ByVal|Call|Case|Class|Const|Dim|Do|Each|Else|ElseIf|Empty|End|Eqv|Exit|False|For|Function)\b/gi, output : '$1' }, - { input : /\b(Get|GoTo|If|Imp|In|Is|Let|Loop|Me|Mod|Enum|New|Next|Not|Nothing|Null|On|Option|Or|Private|Public|ReDim|Rem)\b/gi, output : '$1' }, - { input : /\b(Resume|Select|Set|Stop|Sub|Then|To|True|Until|Wend|While|With|Xor|Execute|Randomize|Erase|ExecuteGlobal|Explicit|step)\b/gi, output : '$1' }, -// Reserved Words 2 (Purple) - { input : /\b(Abandon|Abs|AbsolutePage|AbsolutePosition|ActiveCommand|ActiveConnection|ActualSize|AddHeader|AddNew|AppendChunk)\b/gi, output : '$1' }, - { input : /\b(AppendToLog|Application|Array|Asc|Atn|Attributes|BeginTrans|BinaryRead|BinaryWrite|BOF|Bookmark|Boolean|Buffer|Byte)\b/gi, output : '$1' }, - { input : /\b(CacheControl|CacheSize|Cancel|CancelBatch|CancelUpdate|CBool|CByte|CCur|CDate|CDbl|Charset|Chr|CInt|Clear)\b/gi, output : '$1' }, - { input : /\b(ClientCertificate|CLng|Clone|Close|CodePage|CommandText|CommandType|CommandTimeout|CommitTrans|CompareBookmarks|ConnectionString|ConnectionTimeout)\b/gi, output : '$1' }, - { input : /\b(Contents|ContentType|Cookies|Cos|CreateObject|CreateParameter|CSng|CStr|CursorLocation|CursorType|DataMember|DataSource|Date|DateAdd|DateDiff)\b/gi, output : '$1' }, - { input : /\b(DatePart|DateSerial|DateValue|Day|DefaultDatabase|DefinedSize|Delete|Description|Double|EditMode|Eof|EOF|err|Error)\b/gi, output : '$1' }, - { input : /\b(Exp|Expires|ExpiresAbsolute|Filter|Find|Fix|Flush|Form|FormatCurrency|FormatDateTime|FormatNumber|FormatPercent)\b/gi, output : '$1' }, - { input : /\b(GetChunk|GetLastError|GetRows|GetString|Global|HelpContext|HelpFile|Hex|Hour|HTMLEncode|IgnoreCase|Index|InStr|InStrRev)\b/gi, output : '$1' }, - { input : /\b(Int|Integer|IsArray|IsClientConnected|IsDate|IsolationLevel|Join|LBound|LCase|LCID|Left|Len|Lock|LockType|Log|Long|LTrim)\b/gi, output : '$1' }, - { input : /\b(MapPath|MarshalOptions|MaxRecords|Mid|Minute|Mode|Month|MonthName|Move|MoveFirst|MoveLast|MoveNext|MovePrevious|Name|NextRecordset)\b/gi, output : '$1' }, - { input : /\b(Now|Number|NumericScale|ObjectContext|Oct|Open|OpenSchema|OriginalValue|PageCount|PageSize|Pattern|PICS|Precision|Prepared|Property)\b/gi, output : '$1' }, - { input : /\b(Provider|QueryString|RecordCount|Redirect|RegExp|Remove|RemoveAll|Replace|Requery|Request|Response|Resync|Right|Rnd)\b/gi, output : '$1' }, - { input : /\b(RollbackTrans|RTrim|Save|ScriptTimeout|Second|Seek|Server|ServerVariables|Session|SessionID|SetAbort|SetComplete|Sgn)\b/gi, output : '$1' }, - { input : /\b(Sin|Size|Sort|Source|Space|Split|Sqr|State|StaticObjects|Status|StayInSync|StrComp|String|StrReverse|Supports|Tan|Time)\b/gi, output : '$1' }, - { input : /\b(Timeout|Timer|TimeSerial|TimeValue|TotalBytes|Transfer|Trim|Type|Type|UBound|UCase|UnderlyingValue|UnLock|Update|UpdateBatch)\b/gi, output : '$1' }, - { input : /\b(URLEncode|Value|Value|Version|Weekday|WeekdayName|Write|Year)\b/gi, output : '$1' }, -// Reserved Words 3 (Turquis) - { input : /\b(vbBlack|vbRed|vbGreen|vbYellow|vbBlue|vbMagenta|vbCyan|vbWhite|vbBinaryCompare|vbTextCompare)\b/gi, output : '$1' }, - { input : /\b(vbSunday|vbMonday|vbTuesday|vbWednesday|vbThursday|vbFriday|vbSaturday|vbUseSystemDayOfWeek)\b/gi, output : '$1' }, - { input : /\b(vbFirstJan1|vbFirstFourDays|vbFirstFullWeek|vbGeneralDate|vbLongDate|vbShortDate|vbLongTime|vbShortTime)\b/gi, output : '$1' }, - { input : /\b(vbObjectError|vbCr|VbCrLf|vbFormFeed|vbLf|vbNewLine|vbNullChar|vbNullString|vbTab|vbVerticalTab|vbUseDefault|vbTrue)\b/gi, output : '$1' }, - { input : /\b(vbFalse|vbEmpty|vbNull|vbInteger|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant)\b/gi, output : '$1' }, - { input : /\b(vbDataObject|vbDecimal|vbByte|vbArray)\b/gi, output : '$1' }, -// html comments - { input : /(<!--.*?-->.)/g, output : '$1' } -] - -Language.Functions = [ - // Output at index 0, must be the desired tagname surrounding a $1 - // Name is the index from the regex that marks the functionname - {input : /(function|sub)([ ]*?)(\w+)([ ]*?\()/gi , output : '$1', name : '$3'} -] - -Language.snippets = [ -//Conditional - { input : 'if', output : 'If $0 Then\n\t\nEnd If' }, - { input : 'ifelse', output : 'If $0 Then\n\t\n\nElse\n\t\nEnd If' }, - { input : 'case', output : 'Select Case $0\n\tCase ?\n\tCase Else\nEnd Select'}, -//Response - { input : 'rw', output : 'Response.Write( $0 )' }, - { input : 'resc', output : 'Response.Cookies( $0 )' }, - { input : 'resb', output : 'Response.Buffer'}, - { input : 'resflu', output : 'Response.Flush()'}, - { input : 'resend', output : 'Response.End'}, -//Request - { input : 'reqc', output : 'Request.Cookies( $0 )' }, - { input : 'rq', output : 'Request.Querystring("$0")' }, - { input : 'rf', output : 'Request.Form("$0")' }, -//FSO - { input : 'fso', output : 'Set fso = Server.CreateObject("Scripting.FileSystemObject")\n$0' }, - { input : 'setfo', output : 'Set fo = fso.getFolder($0)' }, - { input : 'setfi', output : 'Set fi = fso.getFile($0)' }, - { input : 'twr', output : 'Set f = fso.CreateTextFile($0,true)\'overwrite\nf.WriteLine()\nf.Close'}, - { input : 'tre', output : 'Set f = fso.OpenTextFile($0, 1)\nf.ReadAll\nf.Close'}, -//Server - { input : 'mapp', output : 'Server.Mappath($0)' }, -//Loops - { input : 'foreach', output : 'For Each $0 in ?\n\t\nNext' }, - { input : 'for', output : 'For $0 to ? step ?\n\t\nNext' }, - { input : 'do', output : 'Do While($0)\n\t\nLoop' }, - { input : 'untilrs', output : 'do until rs.eof\n\t\nrs.movenext\nloop' }, -//ADO - { input : 'adorec', output : 'Set rs = Server.CreateObject("ADODB.Recordset")' }, - { input : 'adocon', output : 'Set Conn = Server.CreateObject("ADODB.Connection")' }, - { input : 'adostr', output : 'Set oStr = Server.CreateObject("ADODB.Stream")' }, -//Http Request - { input : 'xmlhttp', output : 'Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")\nxmlHttp.open("GET", $0, false)\nxmlHttp.send()\n?=xmlHttp.responseText' }, - { input : 'xmldoc', output : 'Set xmldoc = Server.CreateObject("Microsoft.XMLDOM")\nxmldoc.async=false\nxmldoc.load(request)'}, -//Functions - { input : 'func', output : 'Function $0()\n\t\n\nEnd Function'}, - { input : 'sub', output : 'Sub $0()\n\t\nEnd Sub'} - -] - -Language.complete = [ - //{ input : '\'', output : '\'$0\'' }, - { input : '"', output : '"$0"' }, - { input : '(', output : '\($0\)' }, - { input : '[', output : '\[$0\]' }, - { input : '{', output : '{\n\t$0\n}' } -] - -Language.shortcuts = [ - { input : '[space]', output : ' ' }, - { input : '[enter]', output : '
          ' } , - { input : '[j]', output : 'testing' }, - { input : '[7]', output : '&' } -] \ No newline at end of file diff --git a/wp-includes/js/codepress/languages/xsl.css b/wp-includes/js/codepress/languages/xsl.css deleted file mode 100644 index 385eaaba..00000000 --- a/wp-includes/js/codepress/languages/xsl.css +++ /dev/null @@ -1,15 +0,0 @@ -/* - * CodePress color styles for HTML syntax highlighting - * By RJ Bruneel - */ - -b {color:#000080;} /* tags */ -ins, ins b, ins s, ins em {color:gray;} /* comments */ -s, s b {color:#7777e4;} /* attribute values */ -a {color:#E67300;} /* links */ -u {color:#CC66CC;} /* forms */ -big {color:#db0000;} /* images */ -em, em b {color:#800080;} /* style */ -strong {color:#800000;} /* script */ -tt i {color:darkblue;font-weight:bold;} /* script reserved words */ -xsl {color:green;} /* xsl */ diff --git a/wp-includes/js/codepress/languages/xsl.js b/wp-includes/js/codepress/languages/xsl.js deleted file mode 100644 index e93932a6..00000000 --- a/wp-includes/js/codepress/languages/xsl.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * CodePress regular expressions for XSL syntax highlighting - * By RJ Bruneel - */ - -Language.syntax = [ // XSL - { - input : /(<[^!]*?>)/g, - output : '$1' // all tags - },{ - input : /(<a.*?>|<\/a>)/g, - output : '$1' // links - },{ - input : /(<img .*?>)/g, - output : '$1' // images - },{ - input : /(<\/?(button|textarea|form|input|select|option|label).*?>)/g, - output : '$1' // forms - },{ - input : /(<style.*?>)(.*?)(<\/style>)/g, - output : '$1$2$3' // style tags - },{ - input : /(<script.*?>)(.*?)(<\/script>)/g, - output : '$1$2$3' // script tags - },{ - input : /(<xsl.*?>|<\/xsl.*?>)/g, - output : '$1' // xsl - },{ - input : /=(".*?")/g, - output : '=$1' // atributes double quote - },{ - input : /=('.*?')/g, - output : '=$1' // atributes single quote - },{ - input : /(<!--.*?-->.)/g, - output : '$1' // comments - },{ - input : /\b(alert|window|document|break|continue|do|for|new|this|void|case|default|else|function|return|typeof|while|if|label|switch|var|with|catch|boolean|int|try|false|throws|null|true|goto)\b/g, - output : '$1' // script reserved words - } -]; - -Language.snippets = [ - {input : 'aref', output : '' }, - {input : 'h1', output : '

          $0

          ' }, - {input : 'h2', output : '

          $0

          ' }, - {input : 'h3', output : '

          $0

          ' }, - {input : 'h4', output : '

          $0

          ' }, - {input : 'h5', output : '
          $0
          ' }, - {input : 'h6', output : '
          $0
          ' }, - {input : 'html', output : '\n\t$0\n' }, - {input : 'head', output : '\n\t\n\t$0\n\t\n' }, - {input : 'img', output : '' }, - {input : 'input', output : '' }, - {input : 'label', output : '' }, - {input : 'legend', output : '\n\t$0\n' }, - {input : 'link', output : '' }, - {input : 'base', output : '' }, - {input : 'body', output : '\n\t$0\n' }, - {input : 'css', output : '' }, - {input : 'div', output : '
          \n\t$0\n
          ' }, - {input : 'divid', output : '
          \n\t\n
          ' }, - {input : 'dl', output : '
          \n\t
          \n\t\t$0\n\t
          \n\t
          \n
          ' }, - {input : 'fieldset', output : '
          \n\t$0\n
          ' }, - {input : 'form', output : '
          \n\t\n
          ' }, - {input : 'meta', output : '' }, - {input : 'p', output : '

          $0

          ' }, - {input : 'b', output : '$0' }, - {input : 'li', output : '
        1. $0
        2. ' }, - {input : 'ul', output : '
            $0
          ' }, - {input : 'ol', output : '
            $0
          ' }, - {input : 'strong', output : '$0' }, - {input : 'br', output : '
          ' }, - {input : 'script', output : '' }, - {input : 'scriptsrc', output : '' }, - {input : 'span', output : '$0' }, - {input : 'table', output : '\n\t\n\t\n
          ' }, - {input : 'style', output : '' }, - {input : 'xsl:stylesheet', output : '' }, - {input : 'xsl:template', output : '$0' }, - {input : 'xsl:for-each', output : '' }, - {input : 'xsl:choose', output : '$0<\xsl:choose>' }, - {input : 'xsl:param', output : '' }, - {input : 'xsl:variable', output : '' }, - {input : 'xsl:if', output : '' }, - {input : 'xsl:when', output : '' }, - {input : 'xsl:otherwise', output : '$0' }, - {input : 'xsl:attribute', output : '' }, - {input : 'xsl:value-of', output : '' }, - {input : 'xsl:with-param', output : '' }, - {input : 'xsl:call-template', output : '' } - -]; - -Language.complete = [ // Auto complete only for 1 character - {input : '\'',output : '\'$0\'' }, - {input : '"', output : '"$0"' }, - {input : '(', output : '\($0\)' }, - {input : '[', output : '\[$0\]' }, - {input : '{', output : '{\n\t$0\n}' } -]; - -Language.shortcuts = []; \ No newline at end of file diff --git a/wp-includes/js/codepress/license.txt b/wp-includes/js/codepress/license.txt deleted file mode 100644 index e80ac68d..00000000 --- a/wp-includes/js/codepress/license.txt +++ /dev/null @@ -1,458 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/wp-includes/js/jquery/interface.js b/wp-includes/js/jquery/interface.js deleted file mode 100644 index 6d00f2e6..00000000 --- a/wp-includes/js/jquery/interface.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Interface Elements for jQuery - * - * http://interface.eyecon.ro - * - * Copyright (c) 2006 Stefan Petre - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * - */ -eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('A.cP={2l:C(c){G B.1y(C(){if(!c.8Y||!c.8P)G;F b=B;b.2a={9M:c.9M||bz,8Y:c.8Y,8P:c.8P,7R:c.7R||\'du\',9c:c.9c||\'du\',2K:c.2K&&28 c.2K==\'C\'?c.2K:H,2V:c.2K&&28 c.2V==\'C\'?c.2V:H,6D:c.6D&&28 c.6D==\'C\'?c.6D:H,8A:A(c.8Y,B),8a:A(c.8P,B),1l:c.1l||7n,5w:c.5w||0};b.2a.8a.2x().E(\'S\',\'9e\').eq(0).E({S:b.2a.9M+\'Q\',11:\'2v\'}).3m();b.2a.8A.1y(C(a){B.6L=a}).ht(C(){A(B).2H(b.2a.9c)},C(){A(B).3S(b.2a.9c)}).1C(\'4U\',C(e){if(b.2a.5w==B.6L)G;b.2a.8A.eq(b.2a.5w).3S(b.2a.7R).3m().eq(B.6L).2H(b.2a.7R).3m();b.2a.8a.eq(b.2a.5w).4S({S:0},b.2a.1l,C(){B.Y.11=\'1k\';if(b.2a.2V){b.2a.2V.1x(b,[B])}}).3m().eq(B.6L).1S().4S({S:b.2a.9M},b.2a.1l,C(){B.Y.11=\'2v\';if(b.2a.2K){b.2a.2K.1x(b,[B])}}).3m();if(b.2a.6D){b.2a.6D.1x(b,[B,b.2a.8a.I(B.6L),b.2a.8A.I(b.2a.5w),b.2a.8a.I(b.2a.5w)])}b.2a.5w=B.6L}).eq(0).2H(b.2a.7R).3m();A(B).E(\'S\',A(B).E(\'S\')).E(\'2N\',\'2B\')})}};A.fn.fe=A.cP.2l;A.8p={2l:C(h){G B.1y(C(){F c=B;F d=2*Z.2F/eD;F f=2*Z.2F;if(A(c).E(\'T\')!=\'2i\'&&A(c).E(\'T\')!=\'1J\'){A(c).E(\'T\',\'2i\')}c.1i={1M:A(h.1M,B),2y:h.2y,61:h.61,9l:h.9l,iu:f,1N:A.12.2f(B),T:A.12.3a(B),2b:Z.2F/2,b4:h.b4,7K:h.5U,5U:[],93:H,7G:2*Z.2F/eD};c.1i.d8=(c.1i.1N.w-c.1i.2y)/2;c.1i.6Y=(c.1i.1N.h-c.1i.61-c.1i.61*c.1i.7K)/2;c.1i.3f=2*Z.2F/c.1i.1M.1N();c.1i.aS=c.1i.1N.w/2;c.1i.aR=c.1i.1N.h/2-c.1i.61*c.1i.7K;F g=1c.3x(\'1W\');A(g).E({T:\'1J\',3j:1,O:0,M:0});A(c).1L(g);c.1i.1M.1y(C(a){8G=A(\'3O\',B).I(0);S=R(c.1i.61*c.1i.7K);if(A.2R.46){3u=1c.3x(\'3O\');A(3u).E(\'T\',\'1J\');3u.2E=8G.2E;3u.Y.4X=\'fu 9x:9C.9E.a6(1E=60, Y=1, fc=0, f9=0, f5=0, f3=0)\'}L{3u=1c.3x(\'3u\');if(3u.bZ){4j=3u.bZ("2d");3u.Y.T=\'1J\';3u.Y.S=S+\'Q\';3u.Y.V=c.1i.2y+\'Q\';3u.S=S;3u.V=c.1i.2y;4j.eR();4j.eM(0,S);4j.eJ(1,-1);4j.jm(8G,0,0,c.1i.2y,S);4j.bL();4j.jl="jh-3U";F b=4j.jf(0,0,0,S);b.es(1,"eg(1O, 1O, 1O, 1)");b.es(0,"eg(1O, 1O, 1O, 0.6)");4j.j9=b;if(j7.j5.3o(\'iX\')!=-1){4j.iV()}L{4j.iS(0,0,c.1i.2y,S)}}}c.1i.5U[a]=3u;A(g).1L(3u)}).1C(\'9r\',C(e){c.1i.93=14;c.1i.1l=c.1i.7G*0.1*c.1i.1l/Z.3B(c.1i.1l);G H}).1C(\'86\',C(e){c.1i.93=H;G H});A.8p.6z(c);c.1i.1l=c.1i.7G*0.2;c.1i.it=1P.5Y(C(){c.1i.2b+=c.1i.1l;if(c.1i.2b>f)c.1i.2b=0;A.8p.6z(c)},20);A(c).1C(\'86\',C(){c.1i.1l=c.1i.7G*0.2*c.1i.1l/Z.3B(c.1i.1l)}).1C(\'3t\',C(e){if(c.1i.93==H){1A=A.12.3W(e);dr=c.1i.1N.w-1A.x+c.1i.T.x;c.1i.1l=c.1i.b4*c.1i.7G*(c.1i.1N.w/2-dr)/(c.1i.1N.w/2)}})})},6z:C(b){b.1i.1M.1y(C(a){b8=b.1i.2b+a*b.1i.3f;x=b.1i.d8*Z.51(b8);y=b.1i.6Y*Z.7L(b8);do=R(1Y*(b.1i.6Y+y)/(2*b.1i.6Y));dm=(b.1i.6Y+y)/(2*b.1i.6Y);V=R((b.1i.2y-b.1i.9l)*dm+b.1i.9l);S=R(V*b.1i.61/b.1i.2y);B.Y.O=b.1i.aR+y-S/2+"Q";B.Y.M=b.1i.aS+x-V/2+"Q";B.Y.V=V+"Q";B.Y.S=S+"Q";B.Y.3j=do;b.1i.5U[a].Y.O=R(b.1i.aR+y+S-1-S/2)+"Q";b.1i.5U[a].Y.M=R(b.1i.aS+x-V/2)+"Q";b.1i.5U[a].Y.V=V+"Q";b.1i.5U[a].Y.S=R(S*b.1i.7K)+"Q"})}};A.fn.hL=A.8p.2l;A.1U({1e:{b1:C(p,n,a,b,c){G((-Z.51(p*Z.2F)/2)+0.5)*b+a},ho:C(p,n,a,b,c){G b*(n/=c)*n*n+a},d2:C(p,n,a,b,c){G-b*((n=n/c-1)*n*n*n-1)+a},hh:C(p,n,a,b,c){if((n/=c/2)<1)G b/2*n*n*n*n+a;G-b/2*((n-=2)*n*n*n-2)+a},7D:C(p,n,a,b,c){if((n/=c)<(1/2.75)){G b*(7.8W*n*n)+a}L if(n<(2/2.75)){G b*(7.8W*(n-=(1.5/2.75))*n+.75)+a}L if(n<(2.5/2.75)){G b*(7.8W*(n-=(2.25/2.75))*n+.gV)+a}L{G b*(7.8W*(n-=(2.gR/2.75))*n+.gN)+a}},aQ:C(p,n,a,b,c){if(A.1e.7D)G b-A.1e.7D(p,c-n,0,b,c)+a;G a+b},gE:C(p,n,a,b,c){if(A.1e.aQ&&A.1e.7D)if(ng.1z.6q?g.1z.6q:3J;3J=g.1z.6q-3J;bc=g.1z.5R*3J/g.1z.6q;B.Y.V=g.1z.2y+bc+\'Q\';B.Y.M=g.1z.2y*a+c+\'Q\';c+=bc});A.5K.8F(g,c)})})},8F:C(a,b){if(a.1z.4I)if(a.1z.4I==\'az\')a.1z.2q.I(0).Y.M=(a.3P-a.1z.2y*a.1z.1M.1N())/2-b/2+\'Q\';L if(a.1z.4I==\'M\')a.1z.2q.I(0).Y.M=-b/a.1z.1M.1N()+\'Q\';L if(a.1z.4I==\'2D\')a.1z.2q.I(0).Y.M=(a.3P-a.1z.2y*a.1z.1M.1N())-b/2+\'Q\';a.1z.2q.I(0).Y.V=a.1z.2y*a.1z.1M.1N()+b+\'Q\'},6z:C(b){b.1z.1M.1y(C(a){B.Y.V=b.1z.2y+\'Q\';B.Y.M=b.1z.2y*a+\'Q\'})}};A.fn.fz=A.5K.2l;A.K={18:P,7W:P,3q:P,2A:P,4b:P,af:P,2r:P,2h:P,1M:P,58:C(){A.K.7W.58();if(A.K.3q){A.K.3q.2x()}},4i:C(){A.K.1M=P;A.K.2h=P;A.K.4b=A.K.2r.2m;if(A.K.18.E(\'11\')==\'2v\'){if(A.K.2r.1a.fx){2X(A.K.2r.1a.fx.1K){19\'a4\':A.K.18.6d(A.K.2r.1a.fx.1H,A.K.58);1n;19\'1u\':A.K.18.c6(A.K.2r.1a.fx.1H,A.K.58);1n;19\'8o\':A.K.18.c3(A.K.2r.1a.fx.1H,A.K.58);1n}}L{A.K.18.2x()}if(A.K.2r.1a.2V)A.K.2r.1a.2V.1x(A.K.2r,[A.K.18,A.K.3q])}L{A.K.58()}1P.a2(A.K.2A)},c1:C(){F e=A.K.2r;F f=A.K.8C(e);if(e&&f.3w!=A.K.4b&&f.3w.1b>=e.1a.8N){A.K.4b=f.3w;A.K.af=f.3w;9V={bR:A(e).1m(\'eS\')||\'bR\',2m:f.3w};A.eQ({1K:\'eN\',9V:A.eL(9V),eK:C(b){e.1a.3X=A(\'3w\',b);1N=e.1a.3X.1N();if(1N>0){F c=\'\';e.1a.3X.1y(C(a){c+=\'<7b 4o="\'+A(\'2m\',B).3D()+\'" 8h="\'+a+\'" Y="7z: 8T;">\'+A(\'3D\',B).3D()+\'\'});if(e.1a.9K){F d=A(\'2m\',e.1a.3X.I(0)).3D();e.2m=f.30+d+e.1a.3y+f.5m;A.K.64(e,f.3w.1b!=d.1b?(f.30.1b+f.3w.1b):d.1b,f.3w.1b!=d.1b?(f.30.1b+d.1b):d.1b)}if(1N>0){A.K.aU(e,c)}L{A.K.4i()}}L{A.K.4i()}},5v:e.1a.96})}},aU:C(a,b){A.K.7W.3i(b);A.K.1M=A(\'7b\',A.K.7W.I(0));A.K.1M.9r(A.K.en).1C(\'4U\',A.K.ed);F c=A.12.3a(a);F d=A.12.2f(a);A.K.18.E(\'O\',c.y+d.hb+\'Q\').E(\'M\',c.x+\'Q\').2H(a.1a.9D);if(A.K.3q){A.K.3q.E(\'11\',\'2v\').E(\'O\',c.y+d.hb+\'Q\').E(\'M\',c.x+\'Q\').E(\'V\',A.K.18.E(\'V\')).E(\'S\',A.K.18.E(\'S\'))}A.K.2h=0;A.K.1M.I(0).2Z=a.1a.72;A.K.7I(a,a.1a.3X.I(0),\'6H\');if(A.K.18.E(\'11\')==\'1k\'){if(a.1a.bv){F e=A.12.9y(a,14);F f=A.12.6b(a,14);A.K.18.E(\'V\',a.3P-(A.e0?(e.l+e.r+f.l+f.r):0)+\'Q\')}if(a.1a.fx){2X(a.1a.fx.1K){19\'a4\':A.K.18.6U(a.1a.fx.1H);1n;19\'1u\':A.K.18.dR(a.1a.fx.1H);1n;19\'8o\':A.K.18.dP(a.1a.fx.1H);1n}}L{A.K.18.1S()}if(A.K.2r.1a.2K)A.K.2r.1a.2K.1x(A.K.2r,[A.K.18,A.K.3q])}},dM:C(){F b=B;if(b.1a.3X){A.K.4b=b.2m;A.K.af=b.2m;F c=\'\';b.1a.3X.1y(C(a){2m=A(\'2m\',B).3D().5u();dH=b.2m.5u();if(2m.3o(dH)==0){c+=\'<7b 4o="\'+A(\'2m\',B).3D()+\'" 8h="\'+a+\'" Y="7z: 8T;">\'+A(\'3D\',B).3D()+\'\'}});if(c!=\'\'){A.K.aU(b,c);B.1a.9s=14;G}}b.1a.3X=P;B.1a.9s=H},64:C(a,b,c){if(a.9q){F d=a.9q();d.iJ(14);d.dC("bh",b);d.iE("bh",-c+b);d.7Q()}L if(a.9m){a.9m(b,c)}L{if(a.88){a.88=b;a.dA=c}}a.6a()},dw:C(a){if(a.88)G a.88;L if(a.9q){F b=1c.64.dv();F c=b.il();G 0-c.dC(\'bh\',-ij)}},8C:C(a){F b={2m:a.2m,30:\'\',5m:\'\',3w:\'\'};if(a.1a.9k){F c=H;F d=A.K.dw(a)||0;F e=b.2m.6W(a.1a.3y);1V(F i=0;i=d||d==0)&&!c){if(b.30.1b<=d)b.3w=e[i];L b.5m+=e[i]+(e[i]!=\'\'?a.1a.3y:\'\');c=14}L if(c){b.5m+=e[i]+(e[i]!=\'\'?a.1a.3y:\'\')}if(!c){b.30+=e[i]+(e.1b>1?a.1a.3y:\'\')}}}L{b.3w=b.2m}G b},b9:C(e){1P.a2(A.K.2A);F a=A.K.8C(B);F b=e.6S||e.6R||-1;if(/13|27|35|36|38|40|9/.3M(b)&&A.K.1M){if(1P.3N){1P.3N.b6=14;1P.3N.b5=H}L{e.9b();e.99()}if(A.K.2h!=P)A.K.1M.I(A.K.2h||0).2Z=\'\';L A.K.2h=-1;2X(b){19 9:19 13:if(A.K.2h==-1)A.K.2h=0;F c=A.K.1M.I(A.K.2h||0);F d=c.4Z(\'4o\');B.2m=a.30+d+B.1a.3y+a.5m;A.K.4b=a.3w;A.K.64(B,a.30.1b+d.1b+B.1a.3y.1b,a.30.1b+d.1b+B.1a.3y.1b);A.K.4i();if(B.1a.5p){4E=R(c.4Z(\'8h\'))||0;A.K.7I(B,B.1a.3X.I(4E),\'5p\')}if(B.6O)B.6O(H);G b!=13;1n;19 27:B.2m=a.30+A.K.4b+B.1a.3y+a.5m;B.1a.3X=P;A.K.4i();if(B.6O)B.6O(H);G H;1n;19 35:A.K.2h=A.K.1M.1N()-1;1n;19 36:A.K.2h=0;1n;19 38:A.K.2h--;if(A.K.2h<0)A.K.2h=A.K.1M.1N()-1;1n;19 40:A.K.2h++;if(A.K.2h==A.K.1M.1N())A.K.2h=0;1n}A.K.7I(B,B.1a.3X.I(A.K.2h||0),\'6H\');A.K.1M.I(A.K.2h||0).2Z=B.1a.72;if(A.K.1M.I(A.K.2h||0).6O)A.K.1M.I(A.K.2h||0).6O(H);if(B.1a.9K){F f=A.K.1M.I(A.K.2h||0).4Z(\'4o\');B.2m=a.30+f+B.1a.3y+a.5m;if(A.K.4b.1b!=f.1b)A.K.64(B,a.30.1b+A.K.4b.1b,a.30.1b+f.1b)}G H}A.K.dM.1x(B);if(B.1a.9s==H){if(a.3w!=A.K.4b&&a.3w.1b>=B.1a.8N)A.K.2A=1P.97(A.K.c1,B.1a.4w);if(A.K.1M){A.K.4i()}}G 14},7I:C(a,b,c){if(a.1a[c]){F d={};94=b.dj(\'*\');1V(i=0;i<94.1b;i++){d[94[i].4D]=94[i].6M.hG}a.1a[c].1x(a,[d])}},en:C(e){if(A.K.1M){if(A.K.2h!=P)A.K.1M.I(A.K.2h||0).2Z=\'\';A.K.1M.I(A.K.2h||0).2Z=\'\';A.K.2h=R(B.4Z(\'8h\'))||0;A.K.1M.I(A.K.2h||0).2Z=A.K.2r.1a.72}},ed:C(a){1P.a2(A.K.2A);a=a||A.3N.hD(1P.3N);a.9b();a.99();F b=A.K.8C(A.K.2r);F c=B.4Z(\'4o\');A.K.2r.2m=b.30+c+A.K.2r.1a.3y+b.5m;A.K.4b=B.4Z(\'4o\');A.K.64(A.K.2r,b.30.1b+c.1b+A.K.2r.1a.3y.1b,b.30.1b+c.1b+A.K.2r.1a.3y.1b);A.K.4i();if(A.K.2r.1a.5p){4E=R(B.4Z(\'8h\'))||0;A.K.7I(A.K.2r,A.K.2r.1a.3X.I(4E),\'5p\')}G H},dh:C(e){6K=e.6S||e.6R||-1;if(/13|27|35|36|38|40/.3M(6K)&&A.K.1M){if(1P.3N){1P.3N.b6=14;1P.3N.b5=H}L{e.9b();e.99()}G H}},2l:C(a){if(!a.96||!A.12){G}if(!A.K.18){if(A.2R.46){A(\'23\',1c).1L(\'<3q Y="11:1k;T:1J;4X:9x:9C.9E.a6(1E=0);" id="df" 2E="dc:H;" da="0" d7="b0">\');A.K.3q=A(\'#df\')}A(\'23\',1c).1L(\'<1W id="d4" Y="T: 1J; O: 0; M: 0; z-aY: hj; 11: 1k;"><90 Y="5X: 0;7E: 0; h9-Y: 1k; z-aY: h8;">&6G;\');A.K.18=A(\'#d4\');A.K.7W=A(\'90\',A.K.18)}G B.1y(C(){if(B.4D!=\'aV\'&&B.4Z(\'1K\')!=\'3D\')G;B.1a={};B.1a.96=a.96;B.1a.8N=Z.3B(R(a.8N)||1);B.1a.9D=a.9D?a.9D:\'\';B.1a.72=a.72?a.72:\'\';B.1a.5p=a.5p&&a.5p.1F==2w?a.5p:P;B.1a.2K=a.2K&&a.2K.1F==2w?a.2K:P;B.1a.2V=a.2V&&a.2V.1F==2w?a.2V:P;B.1a.6H=a.6H&&a.6H.1F==2w?a.6H:P;B.1a.bv=a.bv||H;B.1a.9k=a.9k||H;B.1a.3y=B.1a.9k?(a.3y||\', \'):\'\';B.1a.9K=a.9K?14:H;B.1a.4w=Z.3B(R(a.4w)||8V);if(a.fx&&a.fx.1F==6E){if(!a.fx.1K||!/a4|1u|8o/.3M(a.fx.1K)){a.fx.1K=\'1u\'}if(a.fx.1K==\'1u\'&&!A.fx.1u)G;if(a.fx.1K==\'8o\'&&!A.fx.5l)G;a.fx.1H=Z.3B(R(a.fx.1H)||7n);if(a.fx.1H>B.1a.4w){a.fx.1H=B.1a.4w-1Y}B.1a.fx=a.fx}B.1a.3X=P;B.1a.9s=H;A(B).1m(\'b9\',\'cW\').6a(C(){A.K.2r=B;A.K.4b=B.2m}).cV(A.K.dh).5Q(A.K.b9).4W(C(){A.K.2A=1P.97(A.K.4i,gM)})})}};A.fn.gJ=A.K.2l;A.1t={2A:P,4k:P,1X:P,3f:10,2b:C(a,b,c,d){A.1t.4k=a;A.1t.1X=b;A.1t.3f=R(c)||10;A.1t.2A=1P.5Y(A.1t.cR,R(d)||40)},cR:C(){1V(i=0;i0&&A.1t.1X[i].2J.y+A.1t.1X[i].2J.t>5a.y){A.1t.1X[i].2T-=A.1t.3f}L if(A.1t.1X[i].2J.t<=A.1t.1X[i].2J.h&&A.1t.1X[i].2J.t+A.1t.1X[i].2J.hb<5a.y+5a.hb){A.1t.1X[i].2T+=A.1t.3f}if(A.1t.1X[i].2J.l>0&&A.1t.1X[i].2J.x+A.1t.1X[i].2J.l>5a.x){A.1t.1X[i].2P-=A.1t.3f}L if(A.1t.1X[i].2J.l<=A.1t.1X[i].2J.gf&&A.1t.1X[i].2J.l+A.1t.1X[i].2J.1D<5a.x+5a.1D){A.1t.1X[i].2P+=A.1t.3f}}},7w:C(){1P.5h(A.1t.2A);A.1t.4k=P;A.1t.1X=P;1V(i in A.1t.1X){A.1t.1X[i].2J=P}}};A.X={18:P,1g:P,4v:C(){G B.1y(C(){if(B.8L){B.D.cM.3h(\'4R\',A.X.aM);B.D=P;B.8L=H;if(A.2R.46){B.aI="cW"}L{B.Y.g0=\'\';B.Y.cJ=\'\';B.Y.cH=\'\'}}})},aM:C(e){if(A.X.1g!=P){A.X.8I(e);G H}F a=B.3H;A(1c).1C(\'3t\',A.X.aE).1C(\'5n\',A.X.8I);a.D.1A=A.12.3W(e);a.D.4d=a.D.1A;a.D.6g=H;a.D.fY=B!=B.3H;A.X.1g=a;if(a.D.4P&&B!=B.3H){aC=A.12.3a(a.2S);aZ=A.12.2f(a);ay={x:R(A.E(a,\'M\'))||0,y:R(A.E(a,\'O\'))||0};dx=a.D.4d.x-aC.x-aZ.1D/2-ay.x;dy=a.D.4d.y-aC.y-aZ.hb/2-ay.y;A.2Q.4s(a,[dx,dy])}G A.6J||H},cD:C(e){F a=A.X.1g;a.D.6g=14;F b=a.Y;a.D.6o=A.E(a,\'11\');a.D.49=A.E(a,\'T\');if(!a.D.av)a.D.av=a.D.49;a.D.22={x:R(A.E(a,\'M\'))||0,y:R(A.E(a,\'O\'))||0};a.D.8z=0;a.D.8y=0;if(A.2R.46){F c=A.12.6b(a,14);a.D.8z=c.l||0;a.D.8y=c.t||0}a.D.1w=A.1U(A.12.3a(a),A.12.2f(a));if(a.D.49!=\'2i\'&&a.D.49!=\'1J\'){b.T=\'2i\'}A.X.18.58();F d=A(a).cA(14).I(0);A(d).E({11:\'2v\',M:\'2G\',O:\'2G\'});d.Y.4M=\'0\';d.Y.53=\'0\';d.Y.4L=\'0\';d.Y.4K=\'0\';A.X.18.1L(d);F f=A.X.18.I(0).Y;if(a.D.ar){f.V=\'8x\';f.S=\'8x\'}L{f.S=a.D.1w.hb+\'Q\';f.V=a.D.1w.1D+\'Q\'}f.11=\'2v\';f.4M=\'2G\';f.53=\'2G\';f.4L=\'2G\';f.4K=\'2G\';A.1U(a.D.1w,A.12.2f(d));if(a.D.2M){if(a.D.2M.M){a.D.22.x+=a.D.1A.x-a.D.1w.x-a.D.2M.M;a.D.1w.x=a.D.1A.x-a.D.2M.M}if(a.D.2M.O){a.D.22.y+=a.D.1A.y-a.D.1w.y-a.D.2M.O;a.D.1w.y=a.D.1A.y-a.D.2M.O}if(a.D.2M.2D){a.D.22.x+=a.D.1A.x-a.D.1w.x-a.D.1w.hb+a.D.2M.2D;a.D.1w.x=a.D.1A.x-a.D.1w.1D+a.D.2M.2D}if(a.D.2M.4e){a.D.22.y+=a.D.1A.y-a.D.1w.y-a.D.1w.hb+a.D.2M.4e;a.D.1w.y=a.D.1A.y-a.D.1w.hb+a.D.2M.4e}}a.D.2n=a.D.22.x;a.D.2j=a.D.22.y;if(a.D.7V||a.D.2e==\'7X\'){7Z=A.12.6b(a.2S,14);a.D.1w.x=a.7Y+(A.2R.46?0:A.2R.6l?-7Z.l:7Z.l);a.D.1w.y=a.7t+(A.2R.46?0:A.2R.6l?-7Z.t:7Z.t);A(a.2S).1L(A.X.18.I(0))}if(a.D.2e){A.X.ah(a);a.D.4V.2e=A.X.ae}if(a.D.4P){A.2Q.ad(a)}f.M=a.D.1w.x-a.D.8z+\'Q\';f.O=a.D.1w.y-a.D.8y+\'Q\';f.V=a.D.1w.1D+\'Q\';f.S=a.D.1w.hb+\'Q\';A.X.1g.D.8w=H;if(a.D.gx){a.D.4V.5y=A.X.a9}if(a.D.3j!=H){A.X.18.E(\'3j\',a.D.3j)}if(a.D.1E){A.X.18.E(\'1E\',a.D.1E);if(1P.6j){A.X.18.E(\'4X\',\'7s(1E=\'+a.D.1E*1Y+\')\')}}if(a.D.6i){A.X.18.2H(a.D.6i);A.X.18.I(0).6M.Y.11=\'1k\'}if(a.D.4c)a.D.4c.1x(a,[d,a.D.22.x,a.D.22.y]);if(A.1s&&A.1s.7p>0){A.1s.ck(a)}if(a.D.3L==H){b.11=\'1k\'}G H},ah:C(a){if(a.D.2e.1F==8t){if(a.D.2e==\'7X\'){a.D.1Z=A.1U({x:0,y:0},A.12.2f(a.2S));F b=A.12.6b(a.2S,14);a.D.1Z.w=a.D.1Z.1D-b.l-b.r;a.D.1Z.h=a.D.1Z.hb-b.t-b.b}L if(a.D.2e==\'1c\'){F c=A.12.a5();a.D.1Z={x:0,y:0,w:c.w,h:c.h}}}L if(a.D.2e.1F==6h){a.D.1Z={x:R(a.D.2e[0])||0,y:R(a.D.2e[1])||0,w:R(a.D.2e[2])||0,h:R(a.D.2e[3])||0}}a.D.1Z.dx=a.D.1Z.x-a.D.1w.x;a.D.1Z.dy=a.D.1Z.y-a.D.1w.y},8r:C(a){if(a.D.7V||a.D.2e==\'7X\'){A(\'23\',1c).1L(A.X.18.I(0))}A.X.18.58().2x().E(\'1E\',1);if(1P.6j){A.X.18.E(\'4X\',\'7s(1E=1Y)\')}},8I:C(e){A(1c).3h(\'3t\',A.X.aE).3h(\'5n\',A.X.8I);if(A.X.1g==P){G}F a=A.X.1g;A.X.1g=P;if(a.D.6g==H){G H}if(a.D.3I==14){A(a).E(\'T\',a.D.49)}F b=a.Y;if(a.4P){A.X.18.E(\'7z\',\'7g\')}if(a.D.6i){A.X.18.3S(a.D.6i)}if(a.D.5B==H){if(a.D.fx>0){if(!a.D.2g||a.D.2g==\'3Z\'){F x=W A.fx(a,{1H:a.D.fx},\'M\');x.1G(a.D.22.x,a.D.7i)}if(!a.D.2g||a.D.2g==\'3K\'){F y=W A.fx(a,{1H:a.D.fx},\'O\');y.1G(a.D.22.y,a.D.7k)}}L{if(!a.D.2g||a.D.2g==\'3Z\')a.Y.M=a.D.7i+\'Q\';if(!a.D.2g||a.D.2g==\'3K\')a.Y.O=a.D.7k+\'Q\'}A.X.8r(a);if(a.D.3L==H){A(a).E(\'11\',a.D.6o)}}L if(a.D.fx>0){a.D.8w=14;F c=H;if(A.1s&&A.1p&&a.D.3I){c=A.12.3a(A.1p.18.I(0))}A.X.18.4S({M:c?c.x:a.D.1w.x,O:c?c.y:a.D.1w.y},a.D.fx,C(){a.D.8w=H;if(a.D.3L==H){a.Y.11=a.D.6o}A.X.8r(a)})}L{A.X.8r(a);if(a.D.3L==H){A(a).E(\'11\',a.D.6o)}}if(A.1s&&A.1s.7p>0){A.1s.c8(a)}if(A.1p&&a.D.3I){A.1p.c7(a)}if(a.D.2I&&(a.D.7i!=a.D.22.x||a.D.7k!=a.D.22.y)){a.D.2I.1x(a,a.D.aa||[0,0,a.D.7i,a.D.7k])}if(a.D.3C)a.D.3C.1x(a);G H},a9:C(x,y,a,b){if(a!=0)a=R((a+(B.D.gx*a/Z.3B(a))/2)/B.D.gx)*B.D.gx;if(b!=0)b=R((b+(B.D.gy*b/Z.3B(b))/2)/B.D.gy)*B.D.gy;G{dx:a,dy:b,x:0,y:0}},ae:C(x,y,a,b){a=Z.3k(Z.3g(a,B.D.1Z.dx),B.D.1Z.w+B.D.1Z.dx-B.D.1w.1D);b=Z.3k(Z.3g(b,B.D.1Z.dy),B.D.1Z.h+B.D.1Z.dy-B.D.1w.hb);G{dx:a,dy:b,x:0,y:0}},aE:C(e){if(A.X.1g==P||A.X.1g.D.8w==14){G}F a=A.X.1g;a.D.4d=A.12.3W(e);if(a.D.6g==H){3J=Z.cB(Z.5j(a.D.1A.x-a.D.4d.x,2)+Z.5j(a.D.1A.y-a.D.4d.y,2));if(3J0){A.1s.8n(a)}G H},2l:C(o){if(!A.X.18){A(\'23\',1c).1L(\'<1W id="bX">\');A.X.18=A(\'#bX\');F c=A.X.18.I(0);F d=c.Y;d.T=\'1J\';d.11=\'1k\';d.7z=\'7g\';d.bV=\'1k\';d.2N=\'2B\';if(1P.6j){c.aI="bU"}L{d.eZ=\'1k\';d.cH=\'1k\';d.cJ=\'1k\'}}if(!o){o={}}G B.1y(C(){if(B.8L||!A.12)G;if(1P.6j){B.eX=C(){G H};B.eW=C(){G H}}F a=B;F b=o.3c?A(B).eV(o.3c):A(B);if(A.2R.46){b.1y(C(){B.aI="bU"})}L{b.E(\'-eU-6f-7Q\',\'1k\');b.E(\'6f-7Q\',\'1k\');b.E(\'-eT-6f-7Q\',\'1k\')}B.D={cM:b,5B:o.5B?14:H,3L:o.3L?14:H,3I:o.3I?o.3I:H,4P:o.4P?o.4P:H,7V:o.7V?o.7V:H,3j:o.3j?R(o.3j)||0:H,1E:o.1E?2c(o.1E):H,fx:R(o.fx)||P,5z:o.5z?o.5z:H,4V:{},1A:{},4c:o.4c&&o.4c.1F==2w?o.4c:H,3C:o.3C&&o.3C.1F==2w?o.3C:H,2I:o.2I&&o.2I.1F==2w?o.2I:H,2g:/3K|3Z/.3M(o.2g)?o.2g:H,5D:o.5D?R(o.5D)||0:0,2M:o.2M?o.2M:H,ar:o.ar?14:H,6i:o.6i||H};if(o.4V&&o.4V.1F==2w)B.D.4V.6f=o.4V;if(o.4h&&o.4h.1F==2w)B.D.4h=o.4h;if(o.2e&&((o.2e.1F==8t&&(o.2e==\'7X\'||o.2e==\'1c\'))||(o.2e.1F==6h&&o.2e.1b==4))){B.D.2e=o.2e}if(o.2C){B.D.2C=o.2C}if(o.5y){if(28 o.5y==\'eO\'){B.D.gx=R(o.5y)||1;B.D.gy=R(o.5y)||1}L if(o.5y.1b==2){B.D.gx=R(o.5y[0])||1;B.D.gy=R(o.5y[1])||1}}if(o.3n&&o.3n.1F==2w){B.D.3n=o.3n}B.8L=14;b.1y(C(){B.3H=a});b.1C(\'4R\',A.X.aM)})}};A.fn.1U({8j:A.X.4v,6r:A.X.2l});A.1s={bP:C(a,b,c,d){G a<=A.X.1g.D.2n&&(a+c)>=(A.X.1g.D.2n+A.X.1g.D.1w.w)&&b<=A.X.1g.D.2j&&(b+d)>=(A.X.1g.D.2j+A.X.1g.D.1w.h)?14:H},9S:C(a,b,c,d){G!(a>(A.X.1g.D.2n+A.X.1g.D.1w.w)||(a+c)(A.X.1g.D.2j+A.X.1g.D.1w.h)||(b+d)A.X.1g.D.4d.x&&bA.X.1g.D.4d.y?14:H},4T:H,3z:{},7p:0,3p:{},ck:C(a){if(A.X.1g==P){G}F i;A.1s.3z={};F b=H;1V(i in A.1s.3p){if(A.1s.3p[i]!=P){F c=A.1s.3p[i].I(0);if(A(A.X.1g).is(\'.\'+c.1f.a)){if(c.1f.m==H){c.1f.p=A.1U(A.12.6x(c),A.12.6w(c));c.1f.m=14}if(c.1f.ac){A.1s.3p[i].2H(c.1f.ac)}A.1s.3z[i]=A.1s.3p[i];if(A.1p&&c.1f.s&&A.X.1g.D.3I){c.1f.el=A(\'.\'+c.1f.a,c);a.Y.11=\'1k\';A.1p.bM(c);c.1f.9P=A.1p.8g(A.1m(c,\'id\')).6A;a.Y.11=a.D.6o;b=14}if(c.1f.9O){c.1f.9O.1x(A.1s.3p[i].I(0),[A.X.1g])}}}}if(b){A.1p.2b()}},eF:C(){A.1s.3z={};1V(i in A.1s.3p){if(A.1s.3p[i]!=P){F a=A.1s.3p[i].I(0);if(A(A.X.1g).is(\'.\'+a.1f.a)){a.1f.p=A.1U(A.12.6x(a),A.12.6w(a));if(a.1f.ac){A.1s.3p[i].2H(a.1f.ac)}A.1s.3z[i]=A.1s.3p[i];if(A.1p&&a.1f.s&&A.X.1g.D.3I){a.1f.el=A(\'.\'+a.1f.a,a);bJ.Y.11=\'1k\';A.1p.bM(a);bJ.Y.11=bJ.D.6o}}}}},8n:C(e){if(A.X.1g==P){G}A.1s.4T=H;F i;F a=H;F b=0;1V(i in A.1s.3z){F c=A.1s.3z[i].I(0);if(A.1s.4T==H&&A.1s[c.1f.t](c.1f.p.x,c.1f.p.y,c.1f.p.1D,c.1f.p.hb)){if(c.1f.hc&&c.1f.h==H){A.1s.3z[i].2H(c.1f.hc)}if(c.1f.h==H&&c.1f.76){a=14}c.1f.h=14;A.1s.4T=c;if(A.1p&&c.1f.s&&A.X.1g.D.3I){A.1p.18.I(0).2Z=c.1f.eC;A.1p.8n(c)}b++}L if(c.1f.h==14){if(c.1f.6C){c.1f.6C.1x(c,[e,A.X.18.I(0).6M,c.1f.fx])}if(c.1f.hc){A.1s.3z[i].3S(c.1f.hc)}c.1f.h=H}}if(A.1p&&!A.1s.4T&&A.X.1g.3I){A.1p.18.I(0).Y.11=\'1k\'}if(a){A.1s.4T.1f.76.1x(A.1s.4T,[e,A.X.18.I(0).6M])}},c8:C(e){F i;1V(i in A.1s.3z){F a=A.1s.3z[i].I(0);if(a.1f.ac){A.1s.3z[i].3S(a.1f.ac)}if(a.1f.hc){A.1s.3z[i].3S(a.1f.hc)}if(a.1f.s){A.1p.73[A.1p.73.1b]=i}if(a.1f.9I&&a.1f.h==14){a.1f.h=H;a.1f.9I.1x(a,[e,a.1f.fx])}a.1f.m=H;a.1f.h=H}A.1s.3z={}},4v:C(){G B.1y(C(){if(B.8S){if(B.1f.s){id=A.1m(B,\'id\');A.1p.54[id]=P;A(\'.\'+B.1f.a,B).8j()}A.1s.3p[\'d\'+B.bG]=P;B.8S=H;B.f=P}})},2l:C(o){G B.1y(C(){if(B.8S==14||!o.3r||!A.12||!A.X){G}B.1f={a:o.3r,ac:o.9F||H,hc:o.8X||H,eC:o.4G||H,9I:o.je||o.9I||H,76:o.76||o.ev||H,6C:o.6C||o.er||H,9O:o.9O||H,t:o.5T&&(o.5T==\'bP\'||o.5T==\'9S\')?o.5T:\'1A\',fx:o.fx?o.fx:H,m:H,h:H};if(o.bC==14&&A.1p){id=A.1m(B,\'id\');A.1p.54[id]=B.1f.a;B.1f.s=14;if(o.2I){B.1f.2I=o.2I;B.1f.9P=A.1p.8g(id).6A}}B.8S=14;B.bG=R(Z.63()*aW);A.1s.3p[\'d\'+B.bG]=A(B);A.1s.7p++})}};A.fn.1U({ei:A.1s.4v,ee:A.1s.2l});A.jd=A.1s.eF;A.3l={18:P,89:C(){3D=B.2m;if(!3D)G;Y={eb:A(B).E(\'eb\')||\'\',4a:A(B).E(\'4a\')||\'\',87:A(B).E(\'87\')||\'\',e9:A(B).E(\'e9\')||\'\',e8:A(B).E(\'e8\')||\'\',e7:A(B).E(\'e7\')||\'\',bx:A(B).E(\'bx\')||\'\',e6:A(B).E(\'e6\')||\'\'};A.3l.18.E(Y);3i=A.3l.e5(3D);3i=3i.48(W bw("\\\\n","g"),"
          ");A.3l.18.3i(\'j6\');b3=A.3l.18.I(0).3P;A.3l.18.3i(3i);V=A.3l.18.I(0).3P+b3;if(B.66.65&&V>B.66.65[0]){V=B.66.65[0]}B.Y.V=V+\'Q\';if(B.4D==\'bs\'){S=A.3l.18.I(0).5r+b3;if(B.66.65&&S>B.66.65[1]){S=B.66.65[1]}B.Y.S=S+\'Q\'}},e5:C(a){bq={\'&\':\'&j1;\',\'<\':\'&j0;\',\'>\':\'>\',\'"\':\'&iZ;\'};1V(i in bq){a=a.48(W bw(i,\'g\'),bq[i])}G a},2l:C(a){if(A.3l.18==P){A(\'23\',1c).1L(\'<1W id="dX" Y="T: 1J; O: 0; M: 0; 2W: 2B;">\');A.3l.18=A(\'#dX\')}G B.1y(C(){if(/bs|aV/.3M(B.4D)){if(B.4D==\'aV\'){dT=B.4Z(\'1K\');if(!/3D|iW/.3M(dT)){G}}if(a&&(a.1F==bm||(a.1F==6h&&a.1b==2))){if(a.1F==bm)a=[a,a];L{a[0]=R(a[0])||7n;a[1]=R(a[1])||7n}B.66={65:a}}A(B).4W(A.3l.89).5Q(A.3l.89).cV(A.3l.89);A.3l.89.1x(B)}})}};A.fn.iU=A.3l.2l;A.fn.1U({c3:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'4l\',c)})},dP:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'41\',c)})},iQ:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'dG\',c)})},iM:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'M\',c)})},iL:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'2D\',c)})},iK:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'dF\',c)})}});A.fx.5l=C(e,a,b,c,d){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;z.el=A(e);z.1N=A.12.2f(e);z.1e=28 b==\'4B\'?b:d||P;if(!e.4f)e.4f=z.el.E(\'11\');if(c==\'dG\'){c=z.el.E(\'11\')==\'1k\'?\'41\':\'4l\'}L if(c==\'dF\'){c=z.el.E(\'11\')==\'1k\'?\'2D\':\'M\'}z.el.1S();z.1l=a;z.29=28 b==\'C\'?b:P;z.fx=A.fx.9u(e);z.6T=c;z.1T=C(){if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}if(z.6T==\'41\'||z.6T==\'2D\'){z.el.E(\'11\',z.el.I(0).4f==\'1k\'?\'2v\':z.el.I(0).4f)}L{z.el.2x()}A.fx.9n(z.fx.2Y.I(0),z.fx.U);A.2z(z.el.I(0),\'1j\')};2X(z.6T){19\'4l\':5q=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'S\');5q.1G(z.fx.U.1o.hb,0);1n;19\'41\':z.fx.2Y.E(\'S\',\'9e\');z.el.1S();5q=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'S\');5q.1G(0,z.fx.U.1o.hb);1n;19\'M\':5q=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'V\');5q.1G(z.fx.U.1o.1D,0);1n;19\'2D\':z.fx.2Y.E(\'V\',\'9e\');z.el.1S();5q=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'V\');5q.1G(0,z.fx.U.1o.1D);1n}};A.fn.iA=C(a,b){G B.1r(\'1j\',C(){if(!A.4n(B)){A.2z(B,\'1j\');G H}F e=W A.fx.eu(B,a,b);e.bE()})};A.fx.eu=C(e,a,b){F z=B;z.el=A(e);z.el.1S();z.29=b;z.8e=R(a)||40;z.U={};z.U.T=z.el.E(\'T\');z.U.O=R(z.el.E(\'O\'))||0;z.U.M=R(z.el.E(\'M\'))||0;if(z.U.T!=\'2i\'&&z.U.T!=\'1J\'){z.el.E(\'T\',\'2i\')}z.74=5;z.52=1;z.bE=C(){z.52++;z.e=W A.fx(z.el.I(0),{1H:io,1T:C(){z.e=W A.fx(z.el.I(0),{1H:80,1T:C(){z.8e=R(z.8e/2);if(z.52<=z.74)z.bE();L{z.el.E(\'T\',z.U.T).E(\'O\',z.U.O+\'Q\').E(\'M\',z.U.M+\'Q\');A.2z(z.el.I(0),\'1j\');if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}}}},\'O\');z.e.1G(z.U.O-z.8e,z.U.O)}},\'O\');z.e.1G(z.U.O,z.U.O-z.8e)}};A.fn.1U({im:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'41\',\'3U\',c)})},ik:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'41\',\'in\',c)})},ii:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'41\',\'3E\',c)})},ig:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'4l\',\'3U\',c)})},ie:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'4l\',\'in\',c)})},ic:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'4l\',\'3E\',c)})},ib:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'M\',\'3U\',c)})},ia:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'M\',\'in\',c)})},i9:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'M\',\'3E\',c)})},i8:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'2D\',\'3U\',c)})},i7:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'2D\',\'in\',c)})},i6:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'2D\',\'3E\',c)})}});A.fx.3Y=C(e,a,b,c,d,f){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;z.el=A(e);z.1e=28 b==\'4B\'?b:f||P;z.U={};z.U.T=z.el.E(\'T\');z.U.O=z.el.E(\'O\');z.U.M=z.el.E(\'M\');if(!e.4f)e.4f=z.el.E(\'11\');if(d==\'3E\'){d=z.el.E(\'11\')==\'1k\'?\'in\':\'3U\'}z.el.1S();if(z.U.T!=\'2i\'&&z.U.T!=\'1J\'){z.el.E(\'T\',\'2i\')}z.1K=d;b=28 b==\'C\'?b:P;7N=1;2X(c){19\'4l\':z.e=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'O\');z.5x=2c(z.U.O)||0;z.9i=z.dt;7N=-1;1n;19\'41\':z.e=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'O\');z.5x=2c(z.U.O)||0;z.9i=z.dt;1n;19\'2D\':z.e=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'M\');z.5x=2c(z.U.M)||0;z.9i=z.ds;1n;19\'M\':z.e=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'M\');z.5x=2c(z.U.M)||0;z.9i=z.ds;7N=-1;1n}z.e2=W A.fx(z.el.I(0),A.1l(a,z.1e,C(){z.el.E(z.U);if(z.1K==\'3U\'){z.el.E(\'11\',\'1k\')}L z.el.E(\'11\',z.el.I(0).4f==\'1k\'?\'2v\':z.el.I(0).4f);A.2z(z.el.I(0),\'1j\')}),\'1E\');if(d==\'in\'){z.e.1G(z.5x+1Y*7N,z.5x);z.e2.1G(0,1)}L{z.e.1G(z.5x,z.5x+1Y*7N);z.e2.1G(1,0)}};A.fn.1U({i5:C(a,b,c,d){G B.1r(\'1j\',C(){W A.fx.9h(B,a,b,c,\'dq\',d)})},i4:C(a,b,c,d){G B.1r(\'1j\',C(){W A.fx.9h(B,a,b,c,\'9g\',d)})},i3:C(a,b,c,d){G B.1r(\'1j\',C(){W A.fx.9h(B,a,b,c,\'3E\',d)})}});A.fx.9h=C(e,a,b,c,d,f){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;z.el=A(e);z.1e=28 c==\'4B\'?c:f||P;z.29=28 c==\'C\'?c:P;if(d==\'3E\'){d=z.el.E(\'11\')==\'1k\'?\'9g\':\'dq\'}z.1l=a;z.S=b&&b.1F==bm?b:20;z.fx=A.fx.9u(e);z.1K=d;z.1T=C(){if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}if(z.1K==\'9g\'){z.el.1S()}L{z.el.2x()}A.fx.9n(z.fx.2Y.I(0),z.fx.U);A.2z(z.el.I(0),\'1j\')};if(z.1K==\'9g\'){z.el.1S();z.fx.2Y.E(\'S\',z.S+\'Q\').E(\'V\',\'9e\');z.ef=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,C(){z.ef=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'S\');z.ef.1G(z.S,z.fx.U.1o.hb)}),\'V\');z.ef.1G(0,z.fx.U.1o.1D)}L{z.ef=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,C(){z.ef=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'V\');z.ef.1G(z.fx.U.1o.1D,0)}),\'S\');z.ef.1G(z.fx.U.1o.hb,z.S)}};A.fn.i2=C(c,d,e,f){G B.1r(\'dp\',C(){B.6Q=A(B).1m("Y")||\'\';f=28 e==\'4B\'?e:f||P;e=28 e==\'C\'?e:P;F a=A(B).E(\'6P\');F b=B.2S;6k(a==\'b7\'&&b){a=A(b).E(\'6P\');b=b.2S}A(B).E(\'6P\',d);if(28 B.6Q==\'7M\')B.6Q=B.6Q["9d"];A(B).4S({\'6P\':a},c,f,C(){A.2z(B,\'dp\');if(28 A(B).1m("Y")==\'7M\'){A(B).1m("Y")["9d"]="";A(B).1m("Y")["9d"]=B.6Q}L{A(B).1m("Y",B.6Q)}if(e)e.1x(B)})})};A.4n=C(e){if(/^i1$|^i0$|^hZ$|^5W$|^hY$|^hX$|^hW$|^hV$|^hU$|^23$|^hT$|^hS$|^hR$|^hQ$|^hP$|^hO$|^hN$/i.3M(e.98))G H;L G 14};A.fx.9n=C(e,a){F c=e.6M;F b=c.Y;b.T=a.T;b.4M=a.3s.t;b.4K=a.3s.l;b.4L=a.3s.b;b.53=a.3s.r;b.O=a.O+\'Q\';b.M=a.M+\'Q\';e.2S.dn(c,e);e.2S.hM(e)};A.fx.9u=C(e){if(!A.4n(e))G H;F t=A(e);F a=e.Y;F b=H;if(t.E(\'11\')==\'1k\'){95=t.E(\'2W\');t.E(\'2W\',\'2B\').1S();b=14}F c={};c.T=t.E(\'T\');c.1o=A.12.2f(e);c.3s=A.12.b2(e);F d=e.4u?e.4u.dk:t.E(\'hK\');c.O=R(t.E(\'O\'))||0;c.M=R(t.E(\'M\'))||0;F f=\'hJ\'+R(Z.63()*aW);F g=1c.3x(/^3O$|^br$|^hI$|^hr$|^7Q$|^hH$|^7M$|^3q$|^hF$|^hE$|^hC$|^90$|^dl$|^hB$/i.3M(e.98)?\'1W\':e.98);A.1m(g,\'id\',f);F h=A(g).2H(\'hA\');F i=g.Y;F j=0;F k=0;if(c.T==\'2i\'||c.T==\'1J\'){j=c.O;k=c.M}i.O=j+\'Q\';i.M=k+\'Q\';i.T=c.T!=\'2i\'&&c.T!=\'1J\'?\'2i\':c.T;i.S=c.1o.hb+\'Q\';i.V=c.1o.1D+\'Q\';i.4M=c.3s.t;i.53=c.3s.r;i.4L=c.3s.b;i.4K=c.3s.l;i.2N=\'2B\';if(A.2R.46){i.dk=d}L{i.hz=d}if(A.2R=="46"){a.4X="7s(1E="+0.dg*1Y+")"}a.1E=0.dg;e.2S.dn(g,e);g.hy(e);a.4M=\'2G\';a.53=\'2G\';a.4L=\'2G\';a.4K=\'2G\';a.T=\'1J\';a.bV=\'1k\';a.O=\'2G\';a.M=\'2G\';if(b){t.2x();a.2W=95}G{U:c,2Y:A(g)}};A.fx.7H={hx:[0,1O,1O],hw:[dd,1O,1O],hv:[db,db,hu],hs:[0,0,0],hq:[0,0,1O],hp:[d6,42,42],hn:[0,1O,1O],hm:[0,0,6N],hl:[0,6N,6N],hk:[aX,aX,aX],hi:[0,1Y,0],hg:[hf,he,cZ],hd:[6N,0,6N],ha:[85,cZ,47],h7:[1O,cY,0],h6:[h5,50,h4],h3:[6N,0,0],h2:[h1,cX,h0],gZ:[gY,0,8U],gX:[1O,0,1O],gW:[1O,gU,0],gT:[0,67,0],gS:[75,0,gQ],gP:[dd,cU,cY],gO:[gL,gK,cU],gI:[cT,1O,1O],gH:[cS,gG,cS],gF:[8U,8U,8U],gD:[1O,gC,gB],gA:[1O,1O,cT],gw:[0,1O,0],gv:[1O,0,1O],gu:[67,0,0],gs:[0,0,67],gr:[67,67,0],gq:[1O,d6,0],gp:[1O,8R,gn],gm:[67,0,67],gl:[1O,0,0],gk:[8R,8R,8R],gj:[1O,1O,1O],gi:[1O,1O,0]};A.fx.5L=C(a,b){if(A.fx.7H[a])G{r:A.fx.7H[a][0],g:A.fx.7H[a][1],b:A.fx.7H[a][2]};L if(2L=/^6v\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)$/.8Q(a))G{r:R(2L[1]),g:R(2L[2]),b:R(2L[3])};L if(2L=/6v\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)$/.8Q(a))G{r:2c(2L[1])*2.55,g:2c(2L[2])*2.55,b:2c(2L[3])*2.55};L if(2L=/^#([a-fA-6t-9])([a-fA-6t-9])([a-fA-6t-9])$/.8Q(a))G{r:R("6s"+2L[1]+2L[1]),g:R("6s"+2L[2]+2L[2]),b:R("6s"+2L[3]+2L[3])};L if(2L=/^#([a-fA-6t-9]{2})([a-fA-6t-9]{2})([a-fA-6t-9]{2})$/.8Q(a))G{r:R("6s"+2L[1]),g:R("6s"+2L[2]),b:R("6s"+2L[3])};L G b==14?H:{r:1O,g:1O,b:1O}};A.fx.cQ={5d:1,4y:1,5i:1,4x:1,4e:1,4a:1,S:1,M:1,bx:1,gh:1,4L:1,4K:1,53:1,4M:1,7y:1,5R:1,7x:1,8O:1,1E:1,ge:1,gc:1,4Q:1,4F:1,5g:1,5b:1,2D:1,gb:1,O:1,V:1,3j:1};A.fx.cN={6P:1,ga:1,g9:1,g8:1,g7:1,g6:1,g5:1};A.fx.7v=[\'g4\',\'g3\',\'g2\',\'g1\'];A.fx.aL={\'aK\':[\'2u\',\'cK\'],\'8E\':[\'2u\',\'aH\'],\'5X\':[\'5X\',\'\'],\'7E\':[\'7E\',\'\']};A.fn.1U({4S:C(b,c,d,f){G B.1r(C(){F a=A.1l(c,d,f);F e=W A.cI(B,a,b)})},aG:C(b,c){G B.1r(C(){F a=A.1l(b,c);F e=W A.aG(B,a)})},7w:C(a){G B.1y(C(){if(B.5e)A.aF(B,a)})},fZ:C(a){G B.1y(C(){if(B.5e)A.aF(B,a);if(B.1r&&B.1r[\'fx\'])B.1r.fx=[]})}});A.1U({aG:C(a,b){F z=B,5f;z.3f=C(){if(A.cF(b.1T))b.1T.1x(a)};z.2A=5Y(C(){z.3f()},b.1H);a.5e=z},1e:{b1:C(p,n,a,b,c){G((-Z.51(p*Z.2F)/2)+0.5)*b+a}},cI:C(f,g,h){F z=B,5f;F y=f.Y;F k=A.E(f,"2N");F l=A.E(f,"11");F o={};z.9a=(W 6p()).6y();g.1e=g.1e&&A.1e[g.1e]?g.1e:\'b1\';z.8H=C(a,b){if(A.fx.cQ[a]){if(b==\'1S\'||b==\'2x\'||b==\'3E\'){if(!f.5I)f.5I={};F r=2c(A.5S(f,a));f.5I[a]=r&&r>-aW?r:(2c(A.E(f,a))||0);b=b==\'3E\'?(l==\'1k\'?\'1S\':\'2x\'):b;g[b]=14;o[a]=b==\'1S\'?[0,f.5I[a]]:[f.5I[a],0];if(a!=\'1E\')y[a]=o[a][0]+(a!=\'3j\'&&a!=\'87\'?\'Q\':\'\');L A.1m(y,"1E",o[a][0])}L{o[a]=[2c(A.5S(f,a)),2c(b)||0]}}L if(A.fx.cN[a])o[a]=[A.fx.5L(A.5S(f,a)),A.fx.5L(b)];L if(/^5X$|7E$|2u$|8E$|aK$/i.3M(a)){F m=b.48(/\\s+/g,\' \').48(/6v\\s*\\(\\s*/g,\'6v(\').48(/\\s*,\\s*/g,\',\').48(/\\s*\\)/g,\')\').aD(/([^\\s]+)/g);2X(a){19\'5X\':19\'7E\':19\'aK\':19\'8E\':m[3]=m[3]||m[1]||m[0];m[2]=m[2]||m[0];m[1]=m[1]||m[0];1V(F i=0;ig.1H+z.9a){5h(z.2A);z.2A=P;1V(p in o){if(p=="1E")A.1m(y,"1E",o[p][1]);L if(28 o[p][1]==\'7M\')y[p]=\'6v(\'+o[p][1].r+\',\'+o[p][1].g+\',\'+o[p][1].b+\')\';L y[p]=o[p][1]+(p!=\'3j\'&&p!=\'87\'?\'Q\':\'\')}if(g.2x||g.1S)1V(F p in f.5I)if(p=="1E")A.1m(y,p,f.5I[p]);L y[p]="";y.11=g.2x?\'1k\':(l!=\'1k\'?l:\'2v\');y.2N=k;f.5e=P;if(A.cF(g.1T))g.1T.1x(f)}L{F n=t-B.9a;F a=n/g.1H;1V(p in o){if(28 o[p][1]==\'7M\'){y[p]=\'6v(\'+R(A.1e[g.1e](a,n,o[p][0].r,(o[p][1].r-o[p][0].r),g.1H))+\',\'+R(A.1e[g.1e](a,n,o[p][0].g,(o[p][1].g-o[p][0].g),g.1H))+\',\'+R(A.1e[g.1e](a,n,o[p][0].b,(o[p][1].b-o[p][0].b),g.1H))+\')\'}L{F b=A.1e[g.1e](a,n,o[p][0],(o[p][1]-o[p][0]),g.1H);if(p=="1E")A.1m(y,"1E",b);L y[p]=b+(p!=\'3j\'&&p!=\'87\'?\'Q\':\'\')}}}};z.2A=5Y(C(){z.3f()},13);f.5e=z},aF:C(a,b){if(b)a.5e.9a-=fJ;L{1P.5h(a.5e.2A);a.5e=P;A.2z(a,"fx")}}});A.ax=C(a){F b={};if(28 a==\'4B\'){a=a.5u().6W(\';\');1V(F i=0;i0){z.cy=1o[i];z.4a=2c(z.U.4a)}if(z.U.4x.3o(1o[i])>0){z.cx=1o[i];z.aq=2c(z.U.4x)||0}if(z.U.5i.3o(1o[i])>0){z.cw=1o[i];z.ap=2c(z.U.5i)||0}if(z.U.5d.3o(1o[i])>0){z.cv=1o[i];z.ao=2c(z.U.5d)||0}if(z.U.4y.3o(1o[i])>0){z.cu=1o[i];z.an=2c(z.U.4y)||0}if(z.U.5b.3o(1o[i])>0){z.ct=1o[i];z.am=2c(z.U.5b)||0}if(z.U.5g.3o(1o[i])>0){z.cr=1o[i];z.al=2c(z.U.5g)||0}if(z.U.4Q.3o(1o[i])>0){z.cq=1o[i];z.ak=2c(z.U.4Q)||0}if(z.U.4F.3o(1o[i])>0){z.cp=1o[i];z.aj=2c(z.U.4F)||0}}if(z.U.T!=\'2i\'&&z.U.T!=\'1J\'){z.el.E(\'T\',\'2i\')}z.el.E(\'2N\',\'2B\');z.1K=m;2X(z.1K){19\'cz\':z.3V=z.O+z.26.h/2;z.4H=z.O;z.3Q=z.M+z.26.w/2;z.4r=z.M;1n;19\'as\':z.4H=z.O+z.26.h/2;z.3V=z.O;z.4r=z.M+z.26.w/2;z.3Q=z.M;1n;19\'5c\':z.4H=z.O-z.26.h/4;z.3V=z.O;z.4r=z.M-z.26.w/4;z.3Q=z.M;1n}z.ai=H;z.t=(W 6p).6y();z.4i=C(){5h(z.2A);z.2A=P};z.3f=C(){if(z.ai==H){z.el.1S();z.ai=14}F t=(W 6p).6y();F n=t-z.t;F p=n/z.1H;if(t>=z.1H+z.t){97(C(){o=1;if(z.1K){t=z.4H;l=z.4r;if(z.1K==\'5c\')o=0}z.ag(z.3v,l,t,14,o)},13);z.4i()}L{o=1;if(!A.1e||!A.1e[z.1e]){s=((-Z.51(p*Z.2F)/2)+0.5)*(z.3v-z.6m)+z.6m}L{s=A.1e[z.1e](p,n,z.6m,(z.3v-z.6m),z.1H)}if(z.1K){if(!A.1e||!A.1e[z.1e]){t=((-Z.51(p*Z.2F)/2)+0.5)*(z.4H-z.3V)+z.3V;l=((-Z.51(p*Z.2F)/2)+0.5)*(z.4r-z.3Q)+z.3Q;if(z.1K==\'5c\')o=((-Z.51(p*Z.2F)/2)+0.5)*(-0.9B)+0.9B}L{t=A.1e[z.1e](p,n,z.3V,(z.4H-z.3V),z.1H);l=A.1e[z.1e](p,n,z.3Q,(z.4r-z.3Q),z.1H);if(z.1K==\'5c\')o=A.1e[z.1e](p,n,0.9B,-0.9B,z.1H)}}z.ag(s,l,t,H,o)}};z.2A=5Y(C(){z.3f()},13);z.ag=C(a,b,c,d,e){z.el.E(\'S\',z.S*a/1Y+\'Q\').E(\'V\',z.V*a/1Y+\'Q\').E(\'M\',b+\'Q\').E(\'O\',c+\'Q\').E(\'4a\',z.4a*a/1Y+z.cy);if(z.aq)z.el.E(\'4x\',z.aq*a/1Y+z.cx);if(z.ap)z.el.E(\'5i\',z.ap*a/1Y+z.cw);if(z.ao)z.el.E(\'5d\',z.ao*a/1Y+z.cv);if(z.an)z.el.E(\'4y\',z.an*a/1Y+z.cu);if(z.am)z.el.E(\'5b\',z.am*a/1Y+z.ct);if(z.al)z.el.E(\'5g\',z.al*a/1Y+z.cr);if(z.ak)z.el.E(\'4Q\',z.ak*a/1Y+z.cq);if(z.aj)z.el.E(\'4F\',z.aj*a/1Y+z.cp);if(z.1K==\'5c\'){if(1P.6j)z.el.I(0).Y.4X="7s(1E="+e*1Y+")";z.el.I(0).Y.1E=e}if(d){if(z.bL){z.el.E(z.U)}if(z.1K==\'as\'||z.1K==\'5c\'){z.el.E(\'11\',\'1k\');if(z.1K==\'5c\'){if(1P.6j)z.el.I(0).Y.4X="7s(1E="+1Y+")";z.el.I(0).Y.1E=1}}L z.el.E(\'11\',\'2v\');if(z.29)z.29.1x(z.el.I(0));A.2z(z.el.I(0),\'1j\')}}};A.fn.1U({9A:C(a,b,c){o=A.1l(a);G B.1r(\'1j\',C(){W A.fx.9A(B,o,b,c)})},ft:C(a,b,c){G B.1y(C(){A(\'a[@2U*="#"]\',B).4U(C(e){co=B.2U.6W(\'#\');A(\'#\'+co[1]).9A(a,b,c);G H})})}});A.fx.9A=C(e,o,a,b){F z=B;z.o=o;z.e=e;z.2g=/cn|cm/.3M(a)?a:H;z.1e=b;p=A.12.3a(e);s=A.12.5O();z.4i=C(){5h(z.2A);z.2A=P;A.2z(z.e,\'1j\')};z.t=(W 6p).6y();s.h=s.h>s.ih?(s.h-s.ih):s.h;s.w=s.w>s.iw?(s.w-s.iw):s.w;z.4H=p.y>s.h?s.h:p.y;z.4r=p.x>s.w?s.w:p.x;z.3V=s.t;z.3Q=s.l;z.3f=C(){F t=(W 6p).6y();F n=t-z.t;F p=n/z.o.1H;if(t>=z.o.1H+z.t){z.4i();97(C(){z.ab(z.4H,z.4r)},13)}L{if(!z.2g||z.2g==\'cn\'){if(!A.1e||!A.1e[z.1e]){8v=((-Z.51(p*Z.2F)/2)+0.5)*(z.4H-z.3V)+z.3V}L{8v=A.1e[z.1e](p,n,z.3V,(z.4H-z.3V),z.o.1H)}}L{8v=z.3V}if(!z.2g||z.2g==\'cm\'){if(!A.1e||!A.1e[z.1e]){8u=((-Z.51(p*Z.2F)/2)+0.5)*(z.4r-z.3Q)+z.3Q}L{8u=A.1e[z.1e](p,n,z.3Q,(z.4r-z.3Q),z.o.1H)}}L{8u=z.3Q}z.ab(8v,8u)}};z.ab=C(t,l){1P.fs(l,t)};z.2A=5Y(C(){z.3f()},13)};A.fn.a8=C(a,b){G B.1r(\'1j\',C(){if(!A.4n(B)){A.2z(B,\'1j\');G H}F e=W A.fx.a8(B,a,b);e.a7()})};A.fx.a8=C(e,a,b){F z=B;z.el=A(e);z.el.1S();z.74=R(a)||3;z.29=b;z.52=1;z.U={};z.U.T=z.el.E(\'T\');z.U.O=R(z.el.E(\'O\'))||0;z.U.M=R(z.el.E(\'M\'))||0;if(z.U.T!=\'2i\'&&z.U.T!=\'1J\'){z.el.E(\'T\',\'2i\')}z.a7=C(){z.52++;z.e=W A.fx(z.el.I(0),{1H:60,1T:C(){z.e=W A.fx(z.el.I(0),{1H:60,1T:C(){z.e=W A.fx(e,{1H:60,1T:C(){if(z.52<=z.74)z.a7();L{z.el.E(\'T\',z.U.T).E(\'O\',z.U.O+\'Q\').E(\'M\',z.U.M+\'Q\');A.2z(z.el.I(0),\'1j\');if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}}}},\'M\');z.e.1G(z.U.M-20,z.U.M)}},\'M\');z.e.1G(z.U.M+20,z.U.M-20)}},\'M\');z.e.1G(z.U.M,z.U.M+20)}};A.fn.1U({dR:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'4l\',\'in\',c)})},c6:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'4l\',\'3U\',c)})},fr:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'4l\',\'3E\',c)})},fq:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'41\',\'in\',c)})},fp:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'41\',\'3U\',c)})},fo:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'41\',\'3E\',c)})},fm:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'M\',\'in\',c)})},fl:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'M\',\'3U\',c)})},fk:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'M\',\'3E\',c)})},fj:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'2D\',\'in\',c)})},fi:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'2D\',\'3U\',c)})},fh:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'2D\',\'3E\',c)})}});A.fx.1u=C(e,a,b,c,d,f){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;z.el=A(e);z.1e=28 b==\'4B\'?b:f||P;z.29=28 b==\'C\'?b:P;if(d==\'3E\'){d=z.el.E(\'11\')==\'1k\'?\'in\':\'3U\'}if(!e.4f)e.4f=z.el.E(\'11\');z.el.1S();z.1l=a;z.fx=A.fx.9u(e);z.1K=d;z.6T=c;z.1T=C(){if(z.1K==\'3U\')z.el.E(\'2W\',\'2B\');A.fx.9n(z.fx.2Y.I(0),z.fx.U);if(z.1K==\'in\'){z.el.E(\'11\',z.el.I(0).4f==\'1k\'?\'2v\':z.el.I(0).4f)}L{z.el.E(\'11\',\'1k\');z.el.E(\'2W\',\'cl\')}if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}A.2z(z.el.I(0),\'1j\')};2X(z.6T){19\'4l\':z.ef=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'O\');z.79=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e),\'S\');if(z.1K==\'in\'){z.ef.1G(-z.fx.U.1o.hb,0);z.79.1G(0,z.fx.U.1o.hb)}L{z.ef.1G(0,-z.fx.U.1o.hb);z.79.1G(z.fx.U.1o.hb,0)}1n;19\'41\':z.ef=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'O\');if(z.1K==\'in\'){z.ef.1G(z.fx.U.1o.hb,0)}L{z.ef.1G(0,z.fx.U.1o.hb)}1n;19\'M\':z.ef=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'M\');z.79=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e),\'V\');if(z.1K==\'in\'){z.ef.1G(-z.fx.U.1o.1D,0);z.79.1G(0,z.fx.U.1o.1D)}L{z.ef.1G(0,-z.fx.U.1o.1D);z.79.1G(z.fx.U.1o.1D,0)}1n;19\'2D\':z.ef=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'M\');if(z.1K==\'in\'){z.ef.1G(z.fx.U.1o.1D,0)}L{z.ef.1G(0,z.fx.U.1o.1D)}1n}};A.2O=P;A.fn.fg=C(o){G B.1r(\'1j\',C(){W A.fx.cj(B,o)})};A.fx.cj=C(e,o){if(A.2O==P){A(\'23\',1c).1L(\'<1W id="2O">\');A.2O=A(\'#2O\')}A.2O.E(\'11\',\'2v\').E(\'T\',\'1J\');F z=B;z.el=A(e);if(!o||!o.3v){G}if(o.3v.1F==8t&&1c.7o(o.3v)){o.3v=1c.7o(o.3v)}L if(!o.3v.ci){G}if(!o.1H){o.1H=ch}z.1H=o.1H;z.3v=o.3v;z.7e=o.2Z;z.1T=o.1T;if(z.7e){A.2O.2H(z.7e)}z.8s=0;z.8i=0;if(A.e0){z.8s=(R(A.2O.E(\'4y\'))||0)+(R(A.2O.E(\'5i\'))||0)+(R(A.2O.E(\'4F\'))||0)+(R(A.2O.E(\'5g\'))||0);z.8i=(R(A.2O.E(\'4x\'))||0)+(R(A.2O.E(\'5d\'))||0)+(R(A.2O.E(\'5b\'))||0)+(R(A.2O.E(\'4Q\'))||0)}z.2b=A.1U(A.12.3a(z.el.I(0)),A.12.2f(z.el.I(0)));z.3m=A.1U(A.12.3a(z.3v),A.12.2f(z.3v));z.2b.1D-=z.8s;z.2b.hb-=z.8i;z.3m.1D-=z.8s;z.3m.hb-=z.8i;z.29=o.1T;A.2O.E(\'V\',z.2b.1D+\'Q\').E(\'S\',z.2b.hb+\'Q\').E(\'O\',z.2b.y+\'Q\').E(\'M\',z.2b.x+\'Q\').4S({O:z.3m.y,M:z.3m.x,V:z.3m.1D,S:z.3m.hb},z.1H,C(){if(z.7e)A.2O.3S(z.7e);A.2O.E(\'11\',\'1k\');if(z.1T&&z.1T.1F==2w){z.1T.1x(z.el.I(0),[z.3v])}A.2z(z.el.I(0),\'1j\')})};A.1q={24:{2u:10,cf:\'1R/ff.ce\',cd:\'<3O 2E="1R/5o.cc" />\',cb:0.8,ca:\'fb 8G\',c9:\'6m\',3F:7n},fa:H,f8:H,5A:P,7m:H,7l:H,a3:C(a){if(!A.1q.7l||A.1q.7m)G;F b=a.6S||a.6R||-1;2X(b){19 35:if(A.1q.5A)A.1q.2b(P,A(\'a[@4o=\'+A.1q.5A+\']:f7\').I(0));1n;19 36:if(A.1q.5A)A.1q.2b(P,A(\'a[@4o=\'+A.1q.5A+\']:f6\').I(0));1n;19 37:19 8:19 33:19 80:19 f4:F c=A(\'#7j\');if(c.I(0).4q!=P){c.I(0).4q.1x(c.I(0))}1n;19 38:1n;19 39:19 34:19 32:19 fd:19 78:F d=A(\'#7h\');if(d.I(0).4q!=P){d.I(0).4q.1x(d.I(0))}1n;19 40:1n;19 27:A.1q.8q();1n}},6g:C(a){if(a)A.1U(A.1q.24,a);if(1P.3N){A(\'23\',1c).1C(\'5Q\',A.1q.a3)}L{A(1c).1C(\'5Q\',A.1q.a3)}A(\'a\').1y(C(){el=A(B);c5=el.1m(\'4o\')||\'\';c4=el.1m(\'2U\')||\'\';cg=/\\.cc|\\.f2|\\.7q|\\.ce|\\.f1/g;if(c4.5u().aD(cg)!=P&&c5.5u().3o(\'c2\')==0){el.1C(\'4U\',A.1q.2b)}});if(A.2R.46){3q=1c.3x(\'3q\');A(3q).1m({id:\'a1\',2E:\'dc:H;\',da:\'b0\',d7:\'b0\'}).E({11:\'1k\',T:\'1J\',O:\'0\',M:\'0\',4X:\'9x:9C.9E.a6(1E=0)\'});A(\'23\').1L(3q)}7r=1c.3x(\'1W\');A(7r).1m(\'id\',\'a0\').E({T:\'1J\',11:\'1k\',O:\'0\',M:\'0\',1E:0}).1L(1c.8b(\' \')).1C(\'4U\',A.1q.8q);5C=1c.3x(\'1W\');A(5C).1m(\'id\',\'c0\').E({4F:A.1q.24.2u+\'Q\'}).1L(1c.8b(\' \'));9Z=1c.3x(\'1W\');A(9Z).1m(\'id\',\'bY\').E({4F:A.1q.24.2u+\'Q\',4Q:A.1q.24.2u+\'Q\'}).1L(1c.8b(\' \'));9Y=1c.3x(\'a\');A(9Y).1m({id:\'f0\',2U:\'#\'}).E({T:\'1J\',2D:A.1q.24.2u+\'Q\',O:\'0\'}).1L(A.1q.24.cd).1C(\'4U\',A.1q.8q);6Z=1c.3x(\'1W\');A(6Z).1m(\'id\',\'9X\').E({T:\'2i\',9W:\'M\',5X:\'0 8x\',3j:1}).1L(5C).1L(9Z).1L(9Y);21=1c.3x(\'3O\');21.2E=A.1q.24.cf;A(21).1m(\'id\',\'bW\').E({T:\'1J\'});5G=1c.3x(\'a\');A(5G).1m({id:\'7j\',2U:\'#\'}).E({T:\'1J\',11:\'1k\',2N:\'2B\',cC:\'1k\'}).1L(1c.8b(\' \'));5F=1c.3x(\'a\');A(5F).1m({id:\'7h\',2U:\'#\'}).E({T:\'1J\',2N:\'2B\',cC:\'1k\'}).1L(1c.8b(\' \'));2q=1c.3x(\'1W\');A(2q).1m(\'id\',\'bT\').E({11:\'1k\',T:\'2i\',2N:\'2B\',9W:\'M\',5X:\'0 8x\',O:\'0\',M:\'0\',3j:2}).1L([21,5G,5F]);5Z=1c.3x(\'1W\');A(5Z).1m(\'id\',\'8m\').E({11:\'1k\',T:\'1J\',2N:\'2B\',O:\'0\',M:\'0\',9W:\'az\',6P:\'b7\',eY:\'0\'}).1L([2q,6Z]);A(\'23\').1L(7r).1L(5Z)},2b:C(e,a){el=a?A(a):A(B);8J=el.1m(\'4o\');F b,4E,5G,5F;if(8J!=\'c2\'){A.1q.5A=8J;7F=A(\'a[@4o=\'+8J+\']\');b=7F.1N();4E=7F.aY(a?a:B);5G=7F.I(4E-1);5F=7F.I(4E+1)}aw=el.1m(\'2U\');5C=el.1m(\'3T\');3R=A.12.5O();7r=A(\'#a0\');if(!A.1q.7l){A.1q.7l=14;if(A.2R.46){A(\'#a1\').E(\'S\',Z.3g(3R.ih,3R.h)+\'Q\').E(\'V\',Z.3g(3R.iw,3R.w)+\'Q\').1S()}7r.E(\'S\',Z.3g(3R.ih,3R.h)+\'Q\').E(\'V\',Z.3g(3R.iw,3R.w)+\'Q\').1S().bS(bz,A.1q.24.cb,C(){A.1q.aB(aw,5C,3R,b,4E,5G,5F)});A(\'#8m\').E(\'V\',Z.3g(3R.iw,3R.w)+\'Q\')}L{A(\'#7j\').I(0).4q=P;A(\'#7h\').I(0).4q=P;A.1q.aB(aw,5C,3R,b,4E,5G,5F)}G H},aB:C(a,b,c,d,e,f,g){A(\'#aA\').9U();8l=A(\'#7j\');8l.2x();8k=A(\'#7h\');8k.2x();21=A(\'#bW\');2q=A(\'#bT\');5Z=A(\'#8m\');6Z=A(\'#9X\').E(\'2W\',\'2B\');A(\'#c0\').3i(5C);A.1q.7m=14;if(d)A(\'#bY\').3i(A.1q.24.ca+\' \'+(e+1)+\' \'+A.1q.24.c9+\' \'+d);if(f){8l.I(0).4q=C(){B.4W();A.1q.2b(P,f);G H}}if(g){8k.I(0).4q=C(){B.4W();A.1q.2b(P,g);G H}}21.1S();7u=A.12.2f(2q.I(0));4C=Z.3g(7u.1D,21.I(0).V+A.1q.24.2u*2);59=Z.3g(7u.hb,21.I(0).S+A.1q.24.2u*2);21.E({M:(4C-21.I(0).V)/2+\'Q\',O:(59-21.I(0).S)/2+\'Q\'});2q.E({V:4C+\'Q\',S:59+\'Q\'}).1S();bQ=A.12.a5();5Z.E(\'O\',c.t+(bQ.h/15)+\'Q\');if(5Z.E(\'11\')==\'1k\'){5Z.1S().6U(A.1q.24.3F)}5H=W 8M;A(5H).1m(\'id\',\'aA\').1C(\'eP\',C(){4C=5H.V+A.1q.24.2u*2;59=5H.S+A.1q.24.2u*2;21.2x();2q.4S({S:59},7u.hb!=59?A.1q.24.3F:1,C(){2q.4S({V:4C},7u.1D!=4C?A.1q.24.3F:1,C(){2q.aJ(5H);A(5H).E({T:\'1J\',M:A.1q.24.2u+\'Q\',O:A.1q.24.2u+\'Q\'}).6U(A.1q.24.3F,C(){cL=A.12.2f(6Z.I(0));if(f){8l.E({M:A.1q.24.2u+\'Q\',O:A.1q.24.2u+\'Q\',V:4C/2-A.1q.24.2u*3+\'Q\',S:59-A.1q.24.2u*2+\'Q\'}).1S()}if(g){8k.E({M:4C/2+A.1q.24.2u*2+\'Q\',O:A.1q.24.2u+\'Q\',V:4C/2-A.1q.24.2u*3+\'Q\',S:59-A.1q.24.2u*2+\'Q\'}).1S()}6Z.E({V:4C+\'Q\',O:-cL.hb+\'Q\',2W:\'cl\'}).4S({O:-1},A.1q.24.3F,C(){A.1q.7m=H})})})})});5H.2E=a},8q:C(){A(\'#aA\').9U();A(\'#8m\').2x();A(\'#9X\').E(\'2W\',\'2B\');A(\'#a0\').bS(bz,0,C(){A(B).2x();if(A.2R.46){A(\'#a1\').2x()}});A(\'#7j\').I(0).4q=P;A(\'#7h\').I(0).4q=P;A.1q.5A=P;A.1q.7l=H;A.1q.7m=H;G H}};A.N={1v:P,3A:P,1g:P,1A:P,1o:P,T:P,7f:C(e){A.N.1g=(B.9T)?B.9T:B;A.N.1A=A.12.3W(e);A.N.1o={V:R(A(A.N.1g).E(\'V\'))||0,S:R(A(A.N.1g).E(\'S\'))||0};A.N.T={O:R(A(A.N.1g).E(\'O\'))||0,M:R(A(A.N.1g).E(\'M\'))||0};A(1c).1C(\'3t\',A.N.aO).1C(\'5n\',A.N.aN);if(28 A.N.1g.1h.bO===\'C\'){A.N.1g.1h.bO.1x(A.N.1g)}G H},aN:C(e){A(1c).3h(\'3t\',A.N.aO).3h(\'5n\',A.N.aN);if(28 A.N.1g.1h.cO===\'C\'){A.N.1g.1h.cO.1x(A.N.1g)}A.N.1g=P},aO:C(e){if(!A.N.1g){G}1A=A.12.3W(e);6c=A.N.T.O-A.N.1A.y+1A.y;77=A.N.T.M-A.N.1A.x+1A.x;6c=Z.3g(Z.3k(6c,A.N.1g.1h.7d-A.N.1o.S),A.N.1g.1h.6F);77=Z.3g(Z.3k(77,A.N.1g.1h.7c-A.N.1o.V),A.N.1g.1h.6u);if(28 A.N.1g.1h.4h===\'C\'){F a=A.N.1g.1h.4h.1x(A.N.1g,[77,6c]);if(28 a==\'eI\'&&a.1b==2){77=a[0];6c=a[1]}}A.N.1g.Y.O=6c+\'Q\';A.N.1g.Y.M=77+\'Q\';G H},2b:C(e){A(1c).1C(\'3t\',A.N.7g).1C(\'5n\',A.N.7w);A.N.1v=B.1v;A.N.3A=B.3A;A.N.1A=A.12.3W(e);A.N.1o={V:R(A(B.1v).E(\'V\'))||0,S:R(A(B.1v).E(\'S\'))||0};A.N.T={O:R(A(B.1v).E(\'O\'))||0,M:R(A(B.1v).E(\'M\'))||0};if(A.N.1v.1h.4c){A.N.1v.1h.4c.1x(A.N.1v,[B])}G H},7w:C(){A(1c).3h(\'3t\',A.N.7g).3h(\'5n\',A.N.7w);if(A.N.1v.1h.3C){A.N.1v.1h.3C.1x(A.N.1v,[A.N.3A])}A.N.1v=P;A.N.3A=P},5N:C(a,b){G Z.3k(Z.3g(A.N.1o.V+a*b,A.N.1v.1h.8O),A.N.1v.1h.5R)},5M:C(a,b){G Z.3k(Z.3g(A.N.1o.S+a*b,A.N.1v.1h.7x),A.N.1v.1h.7y)},bN:C(a){G Z.3k(Z.3g(a,A.N.1v.1h.7x),A.N.1v.1h.7y)},7g:C(e){if(A.N.1v==P){G}1A=A.12.3W(e);dx=1A.x-A.N.1A.x;dy=1A.y-A.N.1A.y;1B={V:A.N.1o.V,S:A.N.1o.S};2s={O:A.N.T.O,M:A.N.T.M};2X(A.N.3A){19\'e\':1B.V=A.N.5N(dx,1);1n;19\'eH\':1B.V=A.N.5N(dx,1);1B.S=A.N.5M(dy,1);1n;19\'w\':1B.V=A.N.5N(dx,-1);2s.M=A.N.T.M-1B.V+A.N.1o.V;1n;19\'9R\':1B.V=A.N.5N(dx,-1);2s.M=A.N.T.M-1B.V+A.N.1o.V;1B.S=A.N.5M(dy,1);1n;19\'7a\':1B.S=A.N.5M(dy,-1);2s.O=A.N.T.O-1B.S+A.N.1o.S;1B.V=A.N.5N(dx,-1);2s.M=A.N.T.M-1B.V+A.N.1o.V;1n;19\'n\':1B.S=A.N.5M(dy,-1);2s.O=A.N.T.O-1B.S+A.N.1o.S;1n;19\'9Q\':1B.S=A.N.5M(dy,-1);2s.O=A.N.T.O-1B.S+A.N.1o.S;1B.V=A.N.5N(dx,1);1n;19\'s\':1B.S=A.N.5M(dy,1);1n}if(A.N.1v.1h.44){if(A.N.3A==\'n\'||A.N.3A==\'s\')43=1B.S*A.N.1v.1h.44;L 43=1B.V;4z=A.N.bN(43*A.N.1v.1h.44);43=4z/A.N.1v.1h.44;2X(A.N.3A){19\'n\':19\'7a\':19\'9Q\':2s.O+=1B.S-4z;1n}2X(A.N.3A){19\'7a\':19\'w\':19\'9R\':2s.M+=1B.V-43;1n}1B.S=4z;1B.V=43}if(2s.OA.N.1v.1h.7d){1B.S=A.N.1v.1h.7d-2s.O;if(A.N.1v.1h.44){1B.V=1B.S/A.N.1v.1h.44}}if(2s.M+1B.V>A.N.1v.1h.7c){1B.V=A.N.1v.1h.7c-2s.M;if(A.N.1v.1h.44){1B.S=1B.V*A.N.1v.1h.44}}F a=H;if(A.N.1v.1h.eG){a=A.N.1v.1h.eG.1x(A.N.1v,[1B,2s]);if(a){if(a.1o){A.1U(1B,a.1o)}if(a.T){A.1U(2s,a.T)}}}8f=A.N.1v.Y;8f.M=2s.M+\'Q\';8f.O=2s.O+\'Q\';8f.V=1B.V+\'Q\';8f.S=1B.S+\'Q\';G H},2l:C(b){if(!b||!b.3G||b.3G.1F!=6E){G}G B.1y(C(){F a=B;a.1h=b;a.1h.8O=b.8O||10;a.1h.7x=b.7x||10;a.1h.5R=b.5R||5P;a.1h.7y=b.7y||5P;a.1h.6F=b.6F||-8V;a.1h.6u=b.6u||-8V;a.1h.7c=b.7c||5P;a.1h.7d=b.7d||5P;bK=A(a).E(\'T\');if(!(bK==\'2i\'||bK==\'1J\')){a.Y.T=\'2i\'}eE=/n|9Q|e|eH|s|9R|w|7a/g;1V(i in a.1h.3G){if(i.5u().aD(eE)!=P){if(a.1h.3G[i].1F==8t){3c=A(a.1h.3G[i]);if(3c.1N()>0){a.1h.3G[i]=3c.I(0)}}if(a.1h.3G[i].4D){a.1h.3G[i].1v=a;a.1h.3G[i].3A=i;A(a.1h.3G[i]).1C(\'4R\',A.N.2b)}}}if(a.1h.5k){if(28 a.1h.5k===\'4B\'){9N=A(a.1h.5k);if(9N.1N()>0){9N.1y(C(){B.9T=a});9N.1C(\'4R\',A.N.7f)}}L if(a.1h.5k==14){A(B).1C(\'4R\',A.N.7f)}}})},4v:C(){G B.1y(C(){F a=B;1V(i in a.1h.3G){a.1h.3G[i].1v=P;a.1h.3G[i].3A=P;A(a.1h.3G[i]).3h(\'4R\',A.N.2b)}if(a.1h.5k){if(28 a.1h.5k===\'4B\'){3c=A(a.1h.5k);if(3c.1N()>0){3c.3h(\'4R\',A.N.7f)}}L if(a.1h.5k==14){A(B).3h(\'4R\',A.N.7f)}}a.1h=P})}};A.fn.1U({jk:A.N.2l,jj:A.N.4v});A.2t=P;A.6J=H;A.31=P;A.6B=[];A.9L=C(e){F a=e.6S||e.6R||-1;if(a==17||a==16){A.6J=14}};A.9J=C(e){A.6J=H};A.eB=C(e){B.f.1A=A.12.3W(e);B.f.1I=A.1U(A.12.3a(B),A.12.2f(B));B.f.4p=A.12.5O(B);B.f.1A.x-=B.f.1I.x;B.f.1A.y-=B.f.1I.y;A(B).1L(A.2t.I(0));if(B.f.hc)A.2t.2H(B.f.hc).E(\'11\',\'2v\');A.2t.E({11:\'2v\',V:\'2G\',S:\'2G\'});if(B.f.o){A.2t.E(\'1E\',B.f.o)}A.31=B;A.7A=H;A.6B=[];B.f.el.1y(C(){B.1I={x:B.7Y+(B.4u&&!A.2R.6l?R(B.4u.4y)||0:0)+(A.31.2P||0),y:B.7t+(B.4u&&!A.2R.6l?R(B.4u.4x)||0:0)+(A.31.2T||0),1D:B.3P,hb:B.5r};if(B.s==14){if(A.6J==H){B.s=H;A(B).3S(A.31.f.71)}L{A.7A=14;A.6B[A.6B.1b]=A.1m(B,\'id\')}}});A.9H.1x(B,[e]);A(1c).1C(\'3t\',A.9H).1C(\'5n\',A.bI);G H};A.9H=C(e){if(!A.31)G;A.eA.1x(A.31,[e])};A.eA=C(e){if(!A.31)G;F a=A.12.3W(e);F b=A.12.5O(A.31);a.x+=b.l-B.f.4p.l-B.f.1I.x;a.y+=b.t-B.f.4p.t-B.f.1I.y;F c=Z.3k(a.x,B.f.1A.x);F d=Z.3k(Z.3B(a.x-B.f.1A.x),Z.3B(B.f.4p.w-c));F f=Z.3k(a.y,B.f.1A.y);F g=Z.3k(Z.3B(a.y-B.f.1A.y),Z.3B(B.f.4p.h-f));if(B.2T>0&&a.y-20B.2T+B.f.1I.h){F h=Z.3k(B.f.4p.h-B.2T,10);B.2T+=h;if(B.2T!=b.t)g+=h}if(B.2P>0&&a.x-20B.2P+B.f.1I.w){F h=Z.3k(B.f.4p.w-B.2P,10);B.2P+=h;if(B.2P!=b.l)d+=h}A.2t.E({M:c+\'Q\',O:f+\'Q\',V:d+\'Q\',S:g+\'Q\'});A.2t.l=c+B.f.4p.l;A.2t.t=f+B.f.4p.t;A.2t.r=A.2t.l+d;A.2t.b=A.2t.t+g;A.7A=H;B.f.el.1y(C(){9G=A.6B.3o(A.1m(B,\'id\'));if(!(B.1I.x>A.2t.r||(B.1I.x+B.1I.1D)A.2t.b||(B.1I.y+B.1I.hb)0){h+=\'&\'}h+=s+\'[]=\'+A.1m(B,\'id\');o[o.1b]=A.1m(B,\'id\')}})}G{6A:h,o:o}};A.fn.jg=C(o){if(!A.2t){A(\'23\',1c).1L(\'<1W id="2t">\').1C(\'70\',A.9L).1C(\'5Q\',A.9J);A.2t=A(\'#2t\');A.2t.E({T:\'1J\',11:\'1k\'});if(1P.3N){A(\'23\',1c).1C(\'70\',A.9L).1C(\'5Q\',A.9J)}L{A(1c).1C(\'70\',A.9L).1C(\'5Q\',A.9J)}}if(!o){o={}}G B.1y(C(){if(B.ey)G;B.ey=14;B.f={a:o.3r,o:o.1E?2c(o.1E):H,71:o.ex?o.ex:H,hc:o.4G?o.4G:H,8d:o.8d?o.8d:H,8c:o.8c?o.8c:H};B.f.el=A(\'.\'+o.3r);A(B).1C(\'4R\',A.eB).E(\'T\',\'2i\')})};A.2Q={aT:1,ew:C(b){F b=b;G B.1y(C(){B.4g.69.1y(C(a){A.2Q.4s(B,b[a])})})},I:C(){F e=[];B.1y(C(b){if(B.bD){e[b]=[];F c=B;F d=A.12.2f(B);B.4g.69.1y(C(a){F x=B.7Y;F y=B.7t;7B=R(x*1Y/(d.w-B.3P));7C=R(y*1Y/(d.h-B.5r));e[b][a]=[7B||0,7C||0,x||0,y||0]})}});G e},ad:C(a){a.D.ep=a.D.1Z.w-a.D.1w.1D;a.D.eo=a.D.1Z.h-a.D.1w.hb;if(a.92.4g.bB){8Z=a.92.4g.69.I(a.bA+1);if(8Z){a.D.1Z.w=(R(A(8Z).E(\'M\'))||0)+a.D.1w.1D;a.D.1Z.h=(R(A(8Z).E(\'O\'))||0)+a.D.1w.hb}9f=a.92.4g.69.I(a.bA-1);if(9f){F b=R(A(9f).E(\'M\'))||0;F c=R(A(9f).E(\'M\'))||0;a.D.1Z.x+=b;a.D.1Z.y+=c;a.D.1Z.w-=b;a.D.1Z.h-=c}}a.D.ek=a.D.1Z.w-a.D.1w.1D;a.D.ej=a.D.1Z.h-a.D.1w.hb;if(a.D.2C){a.D.gx=((a.D.1Z.w-a.D.1w.1D)/a.D.2C)||1;a.D.gy=((a.D.1Z.h-a.D.1w.hb)/a.D.2C)||1;a.D.d1=a.D.ek/a.D.2C;a.D.d0=a.D.ej/a.D.2C}a.D.1Z.dx=a.D.1Z.x-a.D.22.x;a.D.1Z.dy=a.D.1Z.y-a.D.22.y;A.X.18.E(\'7z\',\'8T\')},3n:C(a,x,y){if(a.D.2C){d9=R(x/a.D.d1);7B=d9*1Y/a.D.2C;d5=R(y/a.D.d0);7C=d5*1Y/a.D.2C}L{7B=R(x*1Y/a.D.ep);7C=R(y*1Y/a.D.eo)}a.D.aa=[7B||0,7C||0,x||0,y||0];if(a.D.3n)a.D.3n.1x(a,a.D.aa)},d3:C(a){6K=a.6S||a.6R||-1;2X(6K){19 35:A.2Q.4s(B.3H,[91,91]);1n;19 36:A.2Q.4s(B.3H,[-91,-91]);1n;19 37:A.2Q.4s(B.3H,[-B.3H.D.gx||-1,0]);1n;19 38:A.2Q.4s(B.3H,[0,-B.3H.D.gy||-1]);1n;19 39:A.2Q.4s(B.3H,[B.3H.D.gx||1,0]);1n;19 40:A.X.4s(B.3H,[0,B.3H.D.gy||1]);1n}},4s:C(a,b){if(!a.D){G}a.D.1w=A.1U(A.12.3a(a),A.12.2f(a));a.D.22={x:R(A.E(a,\'M\'))||0,y:R(A.E(a,\'O\'))||0};a.D.49=A.E(a,\'T\');if(a.D.49!=\'2i\'&&a.D.49!=\'1J\'){a.Y.T=\'2i\'}A.X.ah(a);A.2Q.ad(a);dx=R(b[0])||0;dy=R(b[1])||0;2n=a.D.22.x+dx;2j=a.D.22.y+dy;if(a.D.2C){57=A.X.a9.1x(a,[2n,2j,dx,dy]);if(57.1F==6E){dx=57.dx;dy=57.dy}2n=a.D.22.x+dx;2j=a.D.22.y+dy}57=A.X.ae.1x(a,[2n,2j,dx,dy]);if(57&&57.1F==6E){dx=57.dx;dy=57.dy}2n=a.D.22.x+dx;2j=a.D.22.y+dy;if(a.D.4P&&(a.D.3n||a.D.2I)){A.2Q.3n(a,2n,2j)}2n=!a.D.2g||a.D.2g==\'3Z\'?2n:a.D.22.x||0;2j=!a.D.2g||a.D.2g==\'3K\'?2j:a.D.22.y||0;a.Y.M=2n+\'Q\';a.Y.O=2j+\'Q\'},2l:C(o){G B.1y(C(){if(B.bD==14||!o.3r||!A.12||!A.X||!A.1s){G}4Y=A(o.3r,B);if(4Y.1N()==0){G}F b={2e:\'7X\',4P:14,3n:o.3n&&o.3n.1F==2w?o.3n:P,2I:o.2I&&o.2I.1F==2w?o.2I:P,3c:B,1E:o.1E||H};if(o.2C&&R(o.2C)){b.2C=R(o.2C)||1;b.2C=b.2C>0?b.2C:1}if(4Y.1N()==1)4Y.6r(b);L{A(4Y.I(0)).6r(b);b.3c=P;4Y.6r(b)}4Y.70(A.2Q.d3);4Y.1m(\'aT\',A.2Q.aT++);B.bD=14;B.4g={};B.4g.ec=b.ec;B.4g.2C=b.2C;B.4g.69=4Y;B.4g.bB=o.bB?14:H;by=B;by.4g.69.1y(C(a){B.bA=a;B.92=by});if(o.5f&&o.5f.1F==6h){1V(i=o.5f.1b-1;i>=0;i--){if(o.5f[i].1F==6h&&o.5f[i].1b==2){el=B.4g.69.I(i);if(el.4D){A.2Q.4s(el,o.5f[i])}}}}})}};A.fn.1U({jc:A.2Q.2l,jb:A.2Q.ew,ja:A.2Q.I});A.2p={56:[],ea:C(){B.4W();1d=B.2S;id=A.1m(1d,\'id\');if(A.2p.56[id]!=P){1P.5h(A.2p.56[id])}1u=1d.J.3d+1;if(1d.J.1R.1b<1u){1u=1}1R=A(\'3O\',1d.J.4O);1d.J.3d=1u;if(1R.1N()>0){1R.6d(1d.J.3F,A.2p.7J)}},di:C(){B.4W();1d=B.2S;id=A.1m(1d,\'id\');if(A.2p.56[id]!=P){1P.5h(A.2p.56[id])}1u=1d.J.3d-1;1R=A(\'3O\',1d.J.4O);if(1u<1){1u=1d.J.1R.1b}1d.J.3d=1u;if(1R.1N()>0){1R.6d(1d.J.3F,A.2p.7J)}},2A:C(c){1d=1c.7o(c);if(1d.J.63){1u=1d.J.3d;6k(1u==1d.J.3d){1u=1+R(Z.63()*1d.J.1R.1b)}}L{1u=1d.J.3d+1;if(1d.J.1R.1b<1u){1u=1}}1R=A(\'3O\',1d.J.4O);1d.J.3d=1u;if(1R.1N()>0){1R.6d(1d.J.3F,A.2p.7J)}},go:C(o){F a;if(o&&o.1F==6E){if(o.21){a=1c.7o(o.21.1d);5v=1P.j8.2U.6W("#");o.21.5J=P;if(5v.1b==2){1u=R(5v[1]);1S=5v[1].48(1u,\'\');if(A.1m(a,\'id\')!=1S){1u=1}}L{1u=1}}if(o.84){o.84.4W();a=o.84.2S.2S;id=A.1m(a,\'id\');if(A.2p.56[id]!=P){1P.5h(A.2p.56[id])}5v=o.84.2U.6W("#");1u=R(5v[1]);1S=5v[1].48(1u,\'\');if(A.1m(a,\'id\')!=1S){1u=1}}if(a.J.1R.1b<1u||1u<1){1u=1}a.J.3d=1u;4t=A.12.2f(a);e4=A.12.9y(a);e3=A.12.6b(a);if(a.J.3e){a.J.3e.o.E(\'11\',\'1k\')}if(a.J.3b){a.J.3b.o.E(\'11\',\'1k\')}if(a.J.21){y=R(e4.t)+R(e3.t);if(a.J.1Q){if(a.J.1Q.4J==\'O\'){y+=a.J.1Q.45.hb}L{4t.h-=a.J.1Q.45.hb}}if(a.J.2o){if(a.J.2o&&a.J.2o.5V==\'O\'){y+=a.J.2o.45.hb}L{4t.h-=a.J.2o.45.hb}}if(!a.J.bu){a.J.e1=o.21?o.21.S:(R(a.J.21.E(\'S\'))||0);a.J.bu=o.21?o.21.V:(R(a.J.21.E(\'V\'))||0)}a.J.21.E(\'O\',y+(4t.h-a.J.e1)/2+\'Q\');a.J.21.E(\'M\',(4t.1D-a.J.bu)/2+\'Q\');a.J.21.E(\'11\',\'2v\')}1R=A(\'3O\',a.J.4O);if(1R.1N()>0){1R.6d(a.J.3F,A.2p.7J)}L{9w=A(\'a\',a.J.1Q.o).I(1u-1);A(9w).2H(a.J.1Q.5s);F b=W 8M();b.1d=A.1m(a,\'id\');b.1u=1u-1;b.2E=a.J.1R[a.J.3d-1].2E;if(b.1T){b.5J=P;A.2p.11.1x(b)}L{b.5J=A.2p.11}if(a.J.2o){a.J.2o.o.3i(a.J.1R[1u-1].5W)}}}},7J:C(){1d=B.2S.2S;1d.J.4O.E(\'11\',\'1k\');if(1d.J.1Q.5s){9w=A(\'a\',1d.J.1Q.o).3S(1d.J.1Q.5s).I(1d.J.3d-1);A(9w).2H(1d.J.1Q.5s)}F a=W 8M();a.1d=A.1m(1d,\'id\');a.1u=1d.J.3d-1;a.2E=1d.J.1R[1d.J.3d-1].2E;if(a.1T){a.5J=P;A.2p.11.1x(a)}L{a.5J=A.2p.11}if(1d.J.2o){1d.J.2o.o.3i(1d.J.1R[1d.J.3d-1].5W)}},11:C(){1d=1c.7o(B.1d);if(1d.J.3e){1d.J.3e.o.E(\'11\',\'1k\')}if(1d.J.3b){1d.J.3b.o.E(\'11\',\'1k\')}4t=A.12.2f(1d);y=0;if(1d.J.1Q){if(1d.J.1Q.4J==\'O\'){y+=1d.J.1Q.45.hb}L{4t.h-=1d.J.1Q.45.hb}}if(1d.J.2o){if(1d.J.2o&&1d.J.2o.5V==\'O\'){y+=1d.J.2o.45.hb}L{4t.h-=1d.J.2o.45.hb}}j4=A(\'.bt\',1d);y=y+(4t.h-B.S)/2;x=(4t.1D-B.V)/2;1d.J.4O.E(\'O\',y+\'Q\').E(\'M\',x+\'Q\').3i(\'<3O 2E="\'+B.2E+\'" />\');1d.J.4O.6U(1d.J.3F);3b=1d.J.3d+1;if(3b>1d.J.1R.1b){3b=1}3e=1d.J.3d-1;if(3e<1){3e=1d.J.1R.1b}1d.J.3b.o.E(\'11\',\'2v\').E(\'O\',y+\'Q\').E(\'M\',x+2*B.V/3+\'Q\').E(\'V\',B.V/3+\'Q\').E(\'S\',B.S+\'Q\').1m(\'3T\',1d.J.1R[3b-1].5W);1d.J.3b.o.I(0).2U=\'#\'+3b+A.1m(1d,\'id\');1d.J.3e.o.E(\'11\',\'2v\').E(\'O\',y+\'Q\').E(\'M\',x+\'Q\').E(\'V\',B.V/3+\'Q\').E(\'S\',B.S+\'Q\').1m(\'3T\',1d.J.1R[3e-1].5W);1d.J.3e.o.I(0).2U=\'#\'+3e+A.1m(1d,\'id\')},2l:C(o){if(!o||!o.2q||A.2p.56[o.2q])G;F a=A(\'#\'+o.2q);F c=a.I(0);if(c.Y.T!=\'1J\'&&c.Y.T!=\'2i\'){c.Y.T=\'2i\'}c.Y.2N=\'2B\';if(a.1N()==0)G;c.J={};c.J.1R=o.1R?o.1R:[];c.J.63=o.63&&o.63==14||H;7T=c.dj(\'j3\');1V(i=0;i<7T.1b;i++){6e=c.J.1R.1b;c.J.1R[6e]={2E:7T[i].2E,5W:7T[i].3T||7T[i].j2||\'\'}}if(c.J.1R.1b==0){G}c.J.49=A.1U(A.12.3a(c),A.12.2f(c));c.J.bp=A.12.9y(c);c.J.bo=A.12.6b(c);t=R(c.J.bp.t)+R(c.J.bo.t);b=R(c.J.bp.b)+R(c.J.bo.b);A(\'3O\',c).9U();c.J.3F=o.3F?o.3F:ch;if(o.4J||o.82||o.5s){c.J.1Q={};a.1L(\'<1W 68="dZ">\');c.J.1Q.o=A(\'.dZ\',c);if(o.82){c.J.1Q.82=o.82;c.J.1Q.o.2H(o.82)}if(o.5s){c.J.1Q.5s=o.5s}c.J.1Q.o.E(\'T\',\'1J\').E(\'V\',c.J.49.w+\'Q\');if(o.4J&&o.4J==\'O\'){c.J.1Q.4J=\'O\';c.J.1Q.o.E(\'O\',t+\'Q\')}L{c.J.1Q.4J=\'4e\';c.J.1Q.o.E(\'4e\',b+\'Q\')}c.J.1Q.9v=o.9v?o.9v:\' \';1V(F i=0;i\'+6e+\'\'+(6e!=c.J.1R.1b?c.J.1Q.9v:\'\'))}A(\'a\',c.J.1Q.o).1C(\'4U\',C(){A.2p.go({84:B})});c.J.1Q.45=A.12.2f(c.J.1Q.o.I(0))}if(o.5V||o.81){c.J.2o={};a.1L(\'<1W 68="dW">&6G;\');c.J.2o.o=A(\'.dW\',c);if(o.81){c.J.2o.81=o.81;c.J.2o.o.2H(o.81)}c.J.2o.o.E(\'T\',\'1J\').E(\'V\',c.J.49.w+\'Q\');if(o.5V&&o.5V==\'O\'){c.J.2o.5V=\'O\';c.J.2o.o.E(\'O\',(c.J.1Q&&c.J.1Q.4J==\'O\'?c.J.1Q.45.hb+t:t)+\'Q\')}L{c.J.2o.5V=\'4e\';c.J.2o.o.E(\'4e\',(c.J.1Q&&c.J.1Q.4J==\'4e\'?c.J.1Q.45.hb+b:b)+\'Q\')}c.J.2o.45=A.12.2f(c.J.2o.o.I(0))}if(o.9j){c.J.3b={9j:o.9j};a.1L(\'&6G;\');c.J.3b.o=A(\'.dV\',c);c.J.3b.o.E(\'T\',\'1J\').E(\'11\',\'1k\').E(\'2N\',\'2B\').E(\'4a\',\'dU\').2H(c.J.3b.9j);c.J.3b.o.1C(\'4U\',A.2p.ea)}if(o.9t){c.J.3e={9t:o.9t};a.1L(\'&6G;\');c.J.3e.o=A(\'.dS\',c);c.J.3e.o.E(\'T\',\'1J\').E(\'11\',\'1k\').E(\'2N\',\'2B\').E(\'4a\',\'dU\').2H(c.J.3e.9t);c.J.3e.o.1C(\'4U\',A.2p.di)}a.aJ(\'<1W 68="bt">\');c.J.4O=A(\'.bt\',c);c.J.4O.E(\'T\',\'1J\').E(\'O\',\'2G\').E(\'M\',\'2G\').E(\'11\',\'1k\');if(o.21){a.aJ(\'<1W 68="dz" Y="11: 1k;"><3O 2E="\'+o.21+\'" />\');c.J.21=A(\'.dz\',c);c.J.21.E(\'T\',\'1J\');F d=W 8M();d.1d=o.2q;d.2E=o.21;if(d.1T){d.5J=P;A.2p.go({21:d})}L{d.5J=C(){A.2p.go({21:B})}}}L{A.2p.go({2q:c})}if(o.ba){dQ=R(o.ba)*8V}A.2p.56[o.2q]=o.ba?1P.5Y(\'A.2p.2A(\\\'\'+o.2q+\'\\\')\',dQ):P}};A.1d=A.2p.2l;A.1p={73:[],54:{},18:H,6X:P,2b:C(){if(A.X.1g==P){G}F a,3s,c,cs;A.1p.18.I(0).2Z=A.X.1g.D.5z;a=A.1p.18.I(0).Y;a.11=\'2v\';A.1p.18.1w=A.1U(A.12.3a(A.1p.18.I(0)),A.12.2f(A.1p.18.I(0)));a.V=A.X.1g.D.1w.1D+\'Q\';a.S=A.X.1g.D.1w.hb+\'Q\';3s=A.12.b2(A.X.1g);a.4M=3s.t;a.53=3s.r;a.4L=3s.b;a.4K=3s.l;if(A.X.1g.D.3L==14){c=A(A.X.1g).cA(14).I(0);cs=c.Y;cs.4M=\'2G\';cs.53=\'2G\';cs.4L=\'2G\';cs.4K=\'2G\';cs.11=\'2v\';A.1p.18.58().1L(c)}A(A.X.1g).dO(A.1p.18.I(0));A.X.1g.Y.11=\'1k\'},c7:C(e){if(!e.D.3I&&A.1s.4T.bC){if(e.D.3C)e.D.3C.1x(1g);A(e).E(\'T\',e.D.av||e.D.49);A(e).8j();A(A.1s.4T).dN(e)}A.1p.18.3S(e.D.5z).3i(\'&6G;\');A.1p.6X=P;F a=A.1p.18.I(0).Y;a.11=\'1k\';A.1p.18.dO(e);if(e.D.fx>0){A(e).6U(e.D.fx)}A(\'23\').1L(A.1p.18.I(0));F b=[];F c=H;1V(F i=0;i0){c(b)}},8n:C(e,o){if(!A.X.1g)G;F a=H;F i=0;if(e.1f.el.1N()>0){1V(i=e.1f.el.1N();i>0;i--){if(e.1f.el.I(i-1)!=A.X.1g){if(!e.5t.bb){if((e.1f.el.I(i-1).1I.y+e.1f.el.I(i-1).1I.hb/2)>A.X.1g.D.2j){a=e.1f.el.I(i-1)}L{1n}}L{if((e.1f.el.I(i-1).1I.x+e.1f.el.I(i-1).1I.1D/2)>A.X.1g.D.2n&&(e.1f.el.I(i-1).1I.y+e.1f.el.I(i-1).1I.hb/2)>A.X.1g.D.2j){a=e.1f.el.I(i-1)}}}}}if(a&&A.1p.6X!=a){A.1p.6X=a;A(a).iT(A.1p.18.I(0))}L if(!a&&(A.1p.6X!=P||A.1p.18.I(0).2S!=e)){A.1p.6X=P;A(e).1L(A.1p.18.I(0))}A.1p.18.I(0).Y.11=\'2v\'},bM:C(e){if(A.X.1g==P){G}e.1f.el.1y(C(){B.1I=A.1U(A.12.6w(B),A.12.6x(B))})},8g:C(s){F i;F h=\'\';F o={};if(s){if(A.1p.54[s]){o[s]=[];A(\'#\'+s+\' .\'+A.1p.54[s]).1y(C(){if(h.1b>0){h+=\'&\'}h+=s+\'[]=\'+A.1m(B,\'id\');o[s][o[s].1b]=A.1m(B,\'id\')})}L{1V(a in s){if(A.1p.54[s[a]]){o[s[a]]=[];A(\'#\'+s[a]+\' .\'+A.1p.54[s[a]]).1y(C(){if(h.1b>0){h+=\'&\'}h+=s[a]+\'[]=\'+A.1m(B,\'id\');o[s[a]][o[s[a]].1b]=A.1m(B,\'id\')})}}}}L{1V(i in A.1p.54){o[i]=[];A(\'#\'+i+\' .\'+A.1p.54[i]).1y(C(){if(h.1b>0){h+=\'&\'}h+=i+\'[]=\'+A.1m(B,\'id\');o[i][o[i].1b]=A.1m(B,\'id\')})}}G{6A:h,o:o}},dL:C(e){if(!e.ci){G}G B.1y(C(){if(!B.5t||!A(e).is(\'.\'+B.5t.3r))A(e).2H(B.5t.3r);A(e).6r(B.5t.D)})},4v:C(){G B.1y(C(){A(\'.\'+B.5t.3r).8j();A(B).ei();B.5t=P;B.dK=P})},2l:C(o){if(o.3r&&A.12&&A.X&&A.1s){if(!A.1p.18){A(\'23\',1c).1L(\'<1W id="dJ">&6G;\');A.1p.18=A(\'#dJ\');A.1p.18.I(0).Y.11=\'1k\'}B.ee({3r:o.3r,9F:o.9F?o.9F:H,8X:o.8X?o.8X:H,4G:o.4G?o.4G:H,76:o.76||o.ev,6C:o.6C||o.er,bC:14,2I:o.2I||o.iR,fx:o.fx?o.fx:H,3L:o.3L?14:H,5T:o.5T?o.5T:\'9S\'});G B.1y(C(){F a={5B:o.5B?14:H,dI:5P,1E:o.1E?2c(o.1E):H,5z:o.4G?o.4G:H,fx:o.fx?o.fx:H,3I:14,3L:o.3L?14:H,3c:o.3c?o.3c:P,2e:o.2e?o.2e:P,4c:o.4c&&o.4c.1F==2w?o.4c:H,4h:o.4h&&o.4h.1F==2w?o.4h:H,3C:o.3C&&o.3C.1F==2w?o.3C:H,2g:/3K|3Z/.3M(o.2g)?o.2g:H,5D:o.5D?R(o.5D)||0:H,2M:o.2M?o.2M:H};A(\'.\'+o.3r,B).6r(a);B.dK=14;B.5t={3r:o.3r,5B:o.5B?14:H,dI:5P,1E:o.1E?2c(o.1E):H,5z:o.4G?o.4G:H,fx:o.fx?o.fx:H,3I:14,3L:o.3L?14:H,3c:o.3c?o.3c:P,2e:o.2e?o.2e:P,bb:o.bb?14:H,D:a}})}}};A.fn.1U({iP:A.1p.2l,dN:A.1p.dL,iO:A.1p.4v});A.iN=A.1p.8g;A.2k={62:P,9o:H,9p:P,6a:C(e){A.2k.9o=14;A.2k.1S(e,B,14)},bk:C(e){if(A.2k.62!=B)G;A.2k.9o=H;A.2k.2x(e,B)},1S:C(e,a,b){if(A.2k.62!=P)G;if(!a){a=B}A.2k.62=a;1I=A.1U(A.12.3a(a),A.12.2f(a));7U=A(a);3T=7U.1m(\'3T\');2U=7U.1m(\'2U\');if(3T){A.2k.9p=3T;7U.1m(\'3T\',\'\');A(\'#dE\').3i(3T);if(2U)A(\'#bj\').3i(2U.48(\'iI://\',\'\'));L A(\'#bj\').3i(\'\');18=A(\'#7S\');if(a.4m.2Z){18.I(0).2Z=a.4m.2Z}L{18.I(0).2Z=\'\'}bi=A.12.2f(18.I(0));dD=b&&a.4m.T==\'bn\'?\'4e\':a.4m.T;2X(dD){19\'O\':2j=1I.y-bi.hb;2n=1I.x;1n;19\'M\':2j=1I.y;2n=1I.x-bi.1D;1n;19\'2D\':2j=1I.y;2n=1I.x+1I.1D;1n;19\'bn\':A(\'23\').1C(\'3t\',A.2k.3t);1A=A.12.3W(e);2j=1A.y+15;2n=1A.x+15;1n;8T:2j=1I.y+1I.hb;2n=1I.x;1n}18.E({O:2j+\'Q\',M:2n+\'Q\'});if(a.4m.4w==H){18.1S()}L{18.6U(a.4m.4w)}if(a.4m.2K)a.4m.2K.1x(a);7U.1C(\'86\',A.2k.2x).1C(\'4W\',A.2k.bk)}},3t:C(e){if(A.2k.62==P){A(\'23\').3h(\'3t\',A.2k.3t);G}1A=A.12.3W(e);A(\'#7S\').E({O:1A.y+15+\'Q\',M:1A.x+15+\'Q\'})},2x:C(e,a){if(!a){a=B}if(A.2k.9o!=14&&A.2k.62==a){A.2k.62=P;A(\'#7S\').6d(1);A(a).1m(\'3T\',A.2k.9p).3h(\'86\',A.2k.2x).3h(\'4W\',A.2k.bk);if(a.4m.2V)a.4m.2V.1x(a);A.2k.9p=P}},2l:C(b){if(!A.2k.18){A(\'23\').1L(\'<1W id="7S"><1W id="dE"><1W id="bj">\');A(\'#7S\').E({T:\'1J\',3j:5P,11:\'1k\'});A.2k.18=14}G B.1y(C(){if(A.1m(B,\'3T\')){B.4m={T:/O|4e|M|2D|bn/.3M(b.T)?b.T:\'4e\',2Z:b.2Z?b.2Z:H,4w:b.4w?b.4w:H,2K:b.2K&&b.2K.1F==2w?b.2K:H,2V:b.2V&&b.2V.1F==2w?b.2V:H};F a=A(B);a.1C(\'9r\',A.2k.1S);a.1C(\'6a\',A.2k.6a)}})}};A.fn.iH=A.2k.2l;A.7O={bl:C(e){6K=e.6S||e.6R||-1;if(6K==9){if(1P.3N){1P.3N.b6=14;1P.3N.b5=H}L{e.9b();e.99()}if(B.9q){1c.64.dv().3D="\\t";B.dB=C(){B.6a();B.dB=P}}L if(B.9m){2b=B.88;3m=B.dA;B.2m=B.2m.iG(0,2b)+"\\t"+B.2m.iF(3m);B.9m(2b+1,2b+1);B.6a()}G H}},4v:C(){G B.1y(C(){if(B.6V&&B.6V==14){A(B).3h(\'70\',A.7O.bl);B.6V=H}})},2l:C(){G B.1y(C(){if(B.4D==\'bs\'&&(!B.6V||B.6V==H)){A(B).1C(\'70\',A.7O.bl);B.6V=14}})}};A.fn.1U({iD:A.7O.2l,iC:A.7O.4v});A.12={3a:C(e){F x=0;F y=0;F a=e.Y;F b=H;if(A(e).E(\'11\')==\'1k\'){F c=a.2W;F d=a.T;b=14;a.2W=\'2B\';a.11=\'2v\';a.T=\'1J\'}F f=e;6k(f){x+=f.7Y+(f.4u&&!A.2R.6l?R(f.4u.4y)||0:0);y+=f.7t+(f.4u&&!A.2R.6l?R(f.4u.4x)||0:0);f=f.dY}f=e;6k(f&&f.4D&&f.4D.5u()!=\'23\'){x-=f.2P||0;y-=f.2T||0;f=f.2S}if(b==14){a.11=\'1k\';a.T=d;a.2W=c}G{x:x,y:y}},6x:C(a){F x=0,y=0;6k(a){x+=a.7Y||0;y+=a.7t||0;a=a.dY}G{x:x,y:y}},2f:C(e){F w=A.E(e,\'V\');F h=A.E(e,\'S\');F a=0;F b=0;F c=e.Y;if(A(e).E(\'11\')!=\'1k\'){a=e.3P;b=e.5r}L{F d=c.2W;F f=c.T;c.2W=\'2B\';c.11=\'2v\';c.T=\'1J\';a=e.3P;b=e.5r;c.11=\'1k\';c.T=f;c.2W=d}G{w:w,h:h,1D:a,hb:b}},6w:C(a){G{1D:a.3P||0,hb:a.5r||0}},a5:C(e){F h,w,de;if(e){w=e.83;h=e.7P}L{de=1c.4A;w=1P.bg||9z.bg||(de&&de.83)||1c.23.83;h=1P.bf||9z.bf||(de&&de.7P)||1c.23.7P}G{w:w,h:h}},5O:C(e){F t=0,l=0,w=0,h=0,iw=0,ih=0;if(e&&e.98.5u()!=\'23\'){t=e.2T;l=e.2P;w=e.be;h=e.bd;iw=0;ih=0}L{if(1c.4A){t=1c.4A.2T;l=1c.4A.2P;w=1c.4A.be;h=1c.4A.bd}L if(1c.23){t=1c.23.2T;l=1c.23.2P;w=1c.23.be;h=1c.23.bd}iw=9z.bg||1c.4A.83||1c.23.83||0;ih=9z.bf||1c.4A.7P||1c.23.7P||0}G{t:t,l:l,w:w,h:h,iw:iw,ih:ih}},b2:C(e,a){F c=A(e);F t=c.E(\'4M\')||\'\';F r=c.E(\'53\')||\'\';F b=c.E(\'4L\')||\'\';F l=c.E(\'4K\')||\'\';if(a)G{t:R(t)||0,r:R(r)||0,b:R(b)||0,l:R(l)};L G{t:t,r:r,b:b,l:l}},9y:C(e,a){F c=A(e);F t=c.E(\'5b\')||\'\';F r=c.E(\'5g\')||\'\';F b=c.E(\'4Q\')||\'\';F l=c.E(\'4F\')||\'\';if(a)G{t:R(t)||0,r:R(r)||0,b:R(b)||0,l:R(l)};L G{t:t,r:r,b:b,l:l}},6b:C(e,a){F c=A(e);F t=c.E(\'4x\')||\'\';F r=c.E(\'5i\')||\'\';F b=c.E(\'5d\')||\'\';F l=c.E(\'4y\')||\'\';if(a)G{t:R(t)||0,r:R(r)||0,b:R(b)||0,l:R(l)||0};L G{t:t,r:r,b:b,l:l}},3W:C(a){F x=a.iB||(a.iz+(1c.4A.2P||1c.23.2P))||0;F y=a.iy||(a.ix+(1c.4A.2T||1c.23.2T))||0;G{x:x,y:y}},bH:C(a,b){b(a);a=a.6M;6k(a){A.12.bH(a,b);a=a.iv}},ji:C(c){A.12.bH(c,C(a){1V(F b in a){if(28 a[b]===\'C\'){a[b]=P}}})},ir:C(a,b){F c=A.12.5O();F d=A.12.2f(a);if(!b||b==\'3K\')A(a).E({O:c.t+((Z.3g(c.h,c.ih)-c.t-d.hb)/2)+\'Q\'});if(!b||b==\'3Z\')A(a).E({M:c.l+((Z.3g(c.w,c.iw)-c.l-d.1D)/2)+\'Q\'})},iq:C(a,b){F c=A(\'3O[@2E*="7q"]\',a||1c),7q;c.1y(C(){7q=B.2E;B.2E=b;B.Y.4X="9x:9C.9E.ip(2E=\'"+7q+"\')"})}};[].3o||(6h.jn.3o=C(v,n){n=(n==P)?0:n;F m=B.1b;1V(F i=n;i)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
          "]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
          ","
          "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Sat Feb 13 22:33:48 2010 -0500 */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

          ";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
          ";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
          ").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
          ';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); -jQuery.noConflict(); +(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, +Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& +(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, +a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== +"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, +function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
          a"; +var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, +parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= +false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= +s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, +applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; +else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, +a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== +w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, +cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= +c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); +a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, +function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); +k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), +C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= +e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& +f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; +if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", +e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, +"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, +d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, +e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); +t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| +g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, +CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, +g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, +text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, +setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= +h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== +"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, +h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& +q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; +if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

          ";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); +(function(){var g=s.createElement("div");g.innerHTML="
          ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: +function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= +{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== +"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", +d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? +a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== +1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
          ","
          "],thead:[1,"","
          "],tr:[2,"","
          "],td:[3,"","
          "],col:[2,"","
          "],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
          ","
          "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, +""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); +return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", +""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= +c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? +c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= +function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= +Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, +"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= +a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= +a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== +"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
          ").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, +serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), +function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, +global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& +e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? +"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== +false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= +false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", +c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| +d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); +g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== +1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== +"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; +if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== +"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| +c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; +this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= +this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, +e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
          "; +a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); +c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, +d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- +f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": +"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in +e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);jQuery.noConflict(); diff --git a/wp-includes/js/jquery/suggest.dev.js b/wp-includes/js/jquery/suggest.dev.js index e76c811e..7f46cbc6 100644 --- a/wp-includes/js/jquery/suggest.dev.js +++ b/wp-includes/js/jquery/suggest.dev.js @@ -120,7 +120,7 @@ if ( options.multiple ) { multipleSepPos = q.lastIndexOf(options.multipleSep); if ( multipleSepPos != -1 ) { - q = q.substr(multipleSepPos + options.multipleSep.length); + q = $.trim(q.substr(multipleSepPos + options.multipleSep.length)); } } if (q.length >= options.minchars) { diff --git a/wp-includes/js/jquery/suggest.js b/wp-includes/js/jquery/suggest.js index bc3c9068..5e15c430 100644 --- a/wp-includes/js/jquery/suggest.js +++ b/wp-includes/js/jquery/suggest.js @@ -1 +1 @@ -(function(a){a.suggest=function(o,g){var c,f,n,d,q,p;c=a(o).attr("autocomplete","off");f=a(document.createElement("ul"));n=false;d=0;q=[];p=0;f.addClass(g.resultsClass).appendTo("body");j();a(window).load(j).resize(j);c.blur(function(){setTimeout(function(){f.hide()},200)});if(a.browser.msie){try{f.bgiframe()}catch(s){}}if(a.browser.mozilla){c.keypress(m)}else{c.keydown(m)}function j(){var e=c.offset();f.css({top:(e.top+o.offsetHeight)+"px",left:e.left+"px"})}function m(w){if((/27$|38$|40$/.test(w.keyCode)&&f.is(":visible"))||(/^13$|^9$/.test(w.keyCode)&&u())){if(w.preventDefault){w.preventDefault()}if(w.stopPropagation){w.stopPropagation()}w.cancelBubble=true;w.returnValue=false;switch(w.keyCode){case 38:k();break;case 40:t();break;case 9:case 13:r();break;case 27:f.hide();break}}else{if(c.val().length!=d){if(n){clearTimeout(n)}n=setTimeout(l,g.delay);d=c.val().length}}}function l(){var x=a.trim(c.val()),w,e;if(g.multiple){w=x.lastIndexOf(g.multipleSep);if(w!=-1){x=x.substr(w+g.multipleSep.length)}}if(x.length>=g.minchars){cached=v(x);if(cached){i(cached.items)}else{a.get(g.source,{q:x},function(y){f.hide();e=b(y,x);i(e);h(x,e,y.length)})}}else{f.hide()}}function v(w){var e;for(e=0;eg.maxCacheSize)){x=q.pop();p-=x.size}q.push({q:y,size:w,items:e});p+=w}function i(e){var x="",w;if(!e){return}if(!e.length){f.hide();return}j();for(w=0;w"+e[w]+""}f.html(x).show();f.children("li").mouseover(function(){f.children("li").removeClass(g.selectClass);a(this).addClass(g.selectClass)}).click(function(y){y.preventDefault();y.stopPropagation();r()})}function b(e,z){var w=[],A=e.split(g.delimiter),y,x;for(y=0;y'+B+""});w[w.length]=x}}return w}function u(){var e;if(!f.is(":visible")){return false}e=f.children("li."+g.selectClass);if(!e.length){e=false}return e}function r(){$currentResult=u();if($currentResult){if(g.multiple){if(c.val().indexOf(g.multipleSep)!=-1){$currentVal=c.val().substr(0,(c.val().lastIndexOf(g.multipleSep)+g.multipleSep.length))}else{$currentVal=""}c.val($currentVal+$currentResult.text()+g.multipleSep);c.focus()}else{c.val($currentResult.text())}f.hide();if(g.onSelect){g.onSelect.apply(c[0])}}}function t(){$currentResult=u();if($currentResult){$currentResult.removeClass(g.selectClass).next().addClass(g.selectClass)}else{f.children("li:first-child").addClass(g.selectClass)}}function k(){var e=u();if(e){e.removeClass(g.selectClass).prev().addClass(g.selectClass)}else{f.children("li:last-child").addClass(g.selectClass)}}};a.fn.suggest=function(c,b){if(!c){return}b=b||{};b.multiple=b.multiple||false;b.multipleSep=b.multipleSep||", ";b.source=c;b.delay=b.delay||100;b.resultsClass=b.resultsClass||"ac_results";b.selectClass=b.selectClass||"ac_over";b.matchClass=b.matchClass||"ac_match";b.minchars=b.minchars||2;b.delimiter=b.delimiter||"\n";b.onSelect=b.onSelect||false;b.maxCacheSize=b.maxCacheSize||65536;this.each(function(){new a.suggest(this,b)});return this}})(jQuery); \ No newline at end of file +(function($){$.suggest=function(input,options){var $input,$results,timeout,prevLength,cache,cacheSize;$input=$(input).attr("autocomplete","off");$results=$(document.createElement("ul"));timeout=false;prevLength=0;cache=[];cacheSize=0;$results.addClass(options.resultsClass).appendTo("body");resetPosition();$(window).load(resetPosition).resize(resetPosition);$input.blur(function(){setTimeout(function(){$results.hide()},200)});if($.browser.msie){try{$results.bgiframe()}catch(e){}}if($.browser.mozilla){$input.keypress(processKey)}else{$input.keydown(processKey)}function resetPosition(){var offset=$input.offset();$results.css({top:(offset.top+input.offsetHeight)+"px",left:offset.left+"px"})}function processKey(e){if((/27$|38$|40$/.test(e.keyCode)&&$results.is(":visible"))||(/^13$|^9$/.test(e.keyCode)&&getCurrentResult())){if(e.preventDefault){e.preventDefault()}if(e.stopPropagation){e.stopPropagation()}e.cancelBubble=true;e.returnValue=false;switch(e.keyCode){case 38:prevResult();break;case 40:nextResult();break;case 9:case 13:selectCurrentResult();break;case 27:$results.hide();break}}else{if($input.val().length!=prevLength){if(timeout){clearTimeout(timeout)}timeout=setTimeout(suggest,options.delay);prevLength=$input.val().length}}}function suggest(){var q=$.trim($input.val()),multipleSepPos,items;if(options.multiple){multipleSepPos=q.lastIndexOf(options.multipleSep);if(multipleSepPos!=-1){q=$.trim(q.substr(multipleSepPos+options.multipleSep.length))}}if(q.length>=options.minchars){cached=checkCache(q);if(cached){displayItems(cached.items)}else{$.get(options.source,{q:q},function(txt){$results.hide();items=parseTxt(txt,q);displayItems(items);addToCache(q,items,txt.length)})}}else{$results.hide()}}function checkCache(q){var i;for(i=0;ioptions.maxCacheSize)){cached=cache.pop();cacheSize-=cached.size}cache.push({q:q,size:size,items:items});cacheSize+=size}function displayItems(items){var html="",i;if(!items){return}if(!items.length){$results.hide();return}resetPosition();for(i=0;i"+items[i]+""}$results.html(html).show();$results.children("li").mouseover(function(){$results.children("li").removeClass(options.selectClass);$(this).addClass(options.selectClass)}).click(function(e){e.preventDefault();e.stopPropagation();selectCurrentResult()})}function parseTxt(txt,q){var items=[],tokens=txt.split(options.delimiter),i,token;for(i=0;i'+q+""});items[items.length]=token}}return items}function getCurrentResult(){var $currentResult;if(!$results.is(":visible")){return false}$currentResult=$results.children("li."+options.selectClass);if(!$currentResult.length){$currentResult=false}return $currentResult}function selectCurrentResult(){$currentResult=getCurrentResult();if($currentResult){if(options.multiple){if($input.val().indexOf(options.multipleSep)!=-1){$currentVal=$input.val().substr(0,($input.val().lastIndexOf(options.multipleSep)+options.multipleSep.length))}else{$currentVal=""}$input.val($currentVal+$currentResult.text()+options.multipleSep);$input.focus()}else{$input.val($currentResult.text())}$results.hide();if(options.onSelect){options.onSelect.apply($input[0])}}}function nextResult(){$currentResult=getCurrentResult();if($currentResult){$currentResult.removeClass(options.selectClass).next().addClass(options.selectClass)}else{$results.children("li:first-child").addClass(options.selectClass)}}function prevResult(){var $currentResult=getCurrentResult();if($currentResult){$currentResult.removeClass(options.selectClass).prev().addClass(options.selectClass)}else{$results.children("li:last-child").addClass(options.selectClass)}}};$.fn.suggest=function(source,options){if(!source){return}options=options||{};options.multiple=options.multiple||false;options.multipleSep=options.multipleSep||", ";options.source=source;options.delay=options.delay||100;options.resultsClass=options.resultsClass||"ac_results";options.selectClass=options.selectClass||"ac_over";options.matchClass=options.matchClass||"ac_match";options.minchars=options.minchars||2;options.delimiter=options.delimiter||"\n";options.onSelect=options.onSelect||false;options.maxCacheSize=options.maxCacheSize||65536;this.each(function(){new $.suggest(this,options)});return this}})(jQuery); \ No newline at end of file diff --git a/wp-includes/js/jquery/ui.core.js b/wp-includes/js/jquery/ui.core.js index f510100e..0aecd2a0 100644 --- a/wp-includes/js/jquery/ui.core.js +++ b/wp-includes/js/jquery/ui.core.js @@ -1,5 +1,5 @@ /* - * jQuery UI 1.7.1 + * jQuery UI 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) @@ -7,4 +7,4 @@ * * http://docs.jquery.com/UI */ -jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.1",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery); \ No newline at end of file +jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.3",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(j,k){return this.each(function(){if(!k){if(!j||c.filter(j,[this]).length){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")})}}return i.call(c(this),j,k)})},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery); diff --git a/wp-includes/js/jquery/ui.dialog.js b/wp-includes/js/jquery/ui.dialog.js index acf0960e..cb0a63e7 100644 --- a/wp-includes/js/jquery/ui.dialog.js +++ b/wp-includes/js/jquery/ui.dialog.js @@ -1,5 +1,5 @@ /* - * jQuery UI Dialog 1.7.1 + * jQuery UI Dialog 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) @@ -12,4 +12,4 @@ * ui.draggable.js * ui.resizable.js */ -(function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.title||this.originalTitle||" ",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c("
          ")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("
          ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(e){var d=this;if(false===d._trigger("beforeclose",e)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",e)}):d.uiDialog.hide()&&d._trigger("close",e));c.ui.dialog.overlay.resize();d._isOpen=false},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("
          ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c('').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"]}if(i.constructor!=Array){i=["center","middle"]}if(i[0].constructor==Number){d+=i[0]}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(i[1].constructor==Number){g+=i[1]}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||" ");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.1",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("
          ").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove()},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("
          ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('
          ').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f)}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"))}});c.ui.dialog.maxZ=e}},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("
          ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c('').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"]}if(i.constructor!=Array){i=["center","middle"]}if(i[0].constructor==Number){d+=i[0]}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(i[1].constructor==Number){g+=i[1]}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||" ");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.3",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("
          ").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(ethis.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left
          ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-ythis.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left
          ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y=p&&n<=k)||(m>=p&&m<=k)||(nk))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(ec));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d=p&&n<=k)||(m>=p&&m<=k)||(nk))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(ec));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d
  • ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f
    ');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidthk.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e
    ');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.1",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)){s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery); \ No newline at end of file +(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('
    ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f
    ');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidthk.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e
    ');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.3",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)){s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery); diff --git a/wp-includes/js/jquery/ui.selectable.js b/wp-includes/js/jquery/ui.selectable.js index 69caa92b..90202165 100644 --- a/wp-includes/js/jquery/ui.selectable.js +++ b/wp-includes/js/jquery/ui.selectable.js @@ -1,5 +1,5 @@ /* - * jQuery UI Selectable 1.7.1 + * jQuery UI Selectable 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) @@ -10,4 +10,4 @@ * Depends: * ui.core.js */ -(function(a){a.widget("ui.selectable",a.extend({},a.ui.mouse,{_init:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var d=a(this);var e=d.offset();a.data(this,"selectable-item",{element:this,$element:d,left:e.left,top:e.top,right:e.left+d.outerWidth(),bottom:e.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(d){var b=this;this.opos=[d.pageX,d.pageY];if(this.options.disabled){return}var c=this.options;this.selectees=a(c.filter,this.element[0]);this._trigger("start",d);a(c.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:d.clientX,top:d.clientY,width:0,height:0});if(c.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=true;if(!d.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;b._trigger("unselecting",d,{unselecting:e.element})}});a(d.target).parents().andSelf().each(function(){var e=a.data(this,"selectable-item");if(e){e.$element.removeClass("ui-unselecting").addClass("ui-selecting");e.unselecting=false;e.selecting=true;e.selected=true;b._trigger("selecting",d,{selecting:e.element});return false}})},_mouseDrag:function(i){var c=this;this.dragged=true;if(this.options.disabled){return}var e=this.options;var d=this.opos[0],h=this.opos[1],b=i.pageX,g=i.pageY;if(d>b){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.rightg||j.bottomd&&j.righth&&j.bottomb){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.rightg||j.bottomd&&j.righth&&j.bottom=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)f&&(e+h)m[this.floating?"width":"height"])){return g}else{return(f0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery); \ No newline at end of file +(function(a){a.widget("ui.sortable",a.extend({},a.ui.mouse,{_init:function(){var b=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)f&&(e+h)m[this.floating?"width":"height"])){return g}else{return(f0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery); diff --git a/wp-includes/js/jquery/ui.tabs.js b/wp-includes/js/jquery/ui.tabs.js index 5796f0bb..13cb7f2e 100644 --- a/wp-includes/js/jquery/ui.tabs.js +++ b/wp-includes/js/jquery/ui.tabs.js @@ -1,5 +1,5 @@ /* - * jQuery UI Tabs 1.7.1 + * jQuery UI Tabs 1.7.3 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) @@ -10,4 +10,4 @@ * Depends: * ui.core.js */ -(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.1",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"
    ",spinner:"Loading…",tabTemplate:'
  • #{label}
  • '}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i=0&&this.anchors[f.selected])||f.selected<0)?f.selected:0;f.disabled=c.unique(f.disabled.concat(c.map(this.lis.filter(".ui-state-disabled"),function(s,o){return r.lis.index(s)}))).sort();if(c.inArray(f.selected,f.disabled)!=-1){f.disabled.splice(c.inArray(f.selected,f.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(f.selected>=0&&this.anchors.length){this.panels.eq(f.selected).removeClass("ui-tabs-hide");this.lis.eq(f.selected).addClass("ui-tabs-selected ui-state-active");r.element.queue("tabs",function(){r._trigger("show",null,r._ui(r.anchors[f.selected],r.panels[f.selected]))});this.load(f.selected)}c(window).bind("unload",function(){r.lis.add(r.anchors).unbind(".tabs");r.lis=r.anchors=r.panels=null})}else{f.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[f.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(f.cookie){this._cookie(f.selected,f.cookie)}for(var j=0,p;(p=this.lis[j]);j++){c(p)[c.inArray(j,f.disabled)!=-1&&!c(p).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(f.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(f.event!="mouseover"){var h=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var l=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){h("hover",c(this))});this.lis.bind("mouseout.tabs",function(){l("hover",c(this))});this.anchors.bind("focus.tabs",function(){h("focus",c(this).closest("li"))});this.anchors.bind("blur.tabs",function(){l("focus",c(this).closest("li"))})}var d,k;if(f.fx){if(c.isArray(f.fx)){d=f.fx[0];k=f.fx[1]}else{d=k=f.fx}}function g(i,o){i.css({display:""});if(c.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var m=k?function(i,o){c(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(k,k.duration||"normal",function(){g(o,k);r._trigger("show",null,r._ui(i,o[0]))})}:function(i,o){c(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");r._trigger("show",null,r._ui(i,o[0]))};var n=d?function(o,i){i.animate(d,d.duration||"normal",function(){r.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");g(i,d);r.element.dequeue("tabs")})}:function(o,i,s){r.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");r.element.dequeue("tabs")};this.anchors.bind(f.event+".tabs",function(){var o=this,u=c(this).closest("li"),i=r.panels.filter(":not(.ui-tabs-hide)"),s=c(r._sanitizeSelector(this.hash));if((u.hasClass("ui-tabs-selected")&&!f.collapsible)||u.hasClass("ui-state-disabled")||u.hasClass("ui-state-processing")||r._trigger("select",null,r._ui(this,s[0]))===false){this.blur();return false}f.selected=r.anchors.index(this);r.abort();if(f.collapsible){if(u.hasClass("ui-tabs-selected")){f.selected=-1;if(f.cookie){r._cookie(f.selected,f.cookie)}r.element.queue("tabs",function(){n(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(f.cookie){r._cookie(f.selected,f.cookie)}r.element.queue("tabs",function(){m(o,s)});r.load(r.anchors.index(this));this.blur();return false}}}if(f.cookie){r._cookie(f.selected,f.cookie)}if(s.length){if(i.length){r.element.queue("tabs",function(){n(o,i)})}r.element.queue("tabs",function(){m(o,s)});r.load(r.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(c.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var d=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=c.data(this,"href.tabs");if(e){this.href=e}var f=c(this).unbind(".tabs");c.each(["href","load","cache"],function(g,h){f.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(c.data(this,"destroy.tabs")){c(this).remove()}else{c(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(d.cookie){this._cookie(null,d.cookie)}},add:function(g,f,e){if(e===undefined){e=this.anchors.length}var d=this,i=this.options,k=c(i.tabTemplate.replace(/#\{href\}/g,g).replace(/#\{label\}/g,f)),j=!g.indexOf("#")?g.replace("#",""):this._tabId(c("a",k)[0]);k.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var h=c("#"+j);if(!h.length){h=c(i.panelTemplate).attr("id",j).data("destroy.tabs",true)}h.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(e>=this.lis.length){k.appendTo(this.list);h.appendTo(this.list[0].parentNode)}else{k.insertBefore(this.lis[e]);h.insertBefore(this.panels[e])}i.disabled=c.map(i.disabled,function(m,l){return m>=e?++m:m});this._tabify();if(this.anchors.length==1){k.addClass("ui-tabs-selected ui-state-active");h.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[0],d.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]))},remove:function(d){var f=this.options,g=this.lis.eq(d).remove(),e=this.panels.eq(d).remove();if(g.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(d+(d+1=d?--j:j});this._tabify();this._trigger("remove",null,this._ui(g.find("a")[0],e[0]))},enable:function(d){var e=this.options;if(c.inArray(d,e.disabled)==-1){return}this.lis.eq(d).removeClass("ui-state-disabled");e.disabled=c.grep(e.disabled,function(g,f){return g!=d});this._trigger("enable",null,this._ui(this.anchors[d],this.panels[d]))},disable:function(e){var d=this,f=this.options;if(e!=f.selected){this.lis.eq(e).addClass("ui-state-disabled");f.disabled.push(e);f.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[e],this.panels[e]))}},select:function(d){if(typeof d=="string"){d=this.anchors.index(this.anchors.filter("[href$="+d+"]"))}else{if(d===null){d=-1}}if(d==-1&&this.options.collapsible){d=this.options.selected}this.anchors.eq(d).trigger(this.options.event+".tabs")},load:function(g){var e=this,i=this.options,d=this.anchors.eq(g)[0],f=c.data(d,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&c.data(d,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(g).addClass("ui-state-processing");if(i.spinner){var h=c("span",d);h.data("label.tabs",h.html()).html(i.spinner)}this.xhr=c.ajax(c.extend({},i.ajaxOptions,{url:f,success:function(k,j){c(e._sanitizeSelector(d.hash)).html(k);e._cleanup();if(i.cache){c.data(d,"cache.tabs",true)}e._trigger("load",null,e._ui(e.anchors[g],e.panels[g]));try{i.ajaxOptions.success(k,j)}catch(l){}e.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(e,d){this.anchors.eq(e).removeData("cache.tabs").data("load.tabs",d)},length:function(){return this.anchors.length}});c.extend(c.ui.tabs,{version:"1.7.3",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"
    ",spinner:"Loading…",tabTemplate:'
  • #{label}
  • '}});c.extend(c.ui.tabs.prototype,{rotation:null,rotate:function(f,h){var d=this,i=this.options;var e=d._rotate||(d._rotate=function(j){clearTimeout(d.rotation);d.rotation=setTimeout(function(){var k=i.selected;d.select(++k -1, - Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1, - MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) - }, + Version: '1.6.1', + + Browser: (function(){ + var ua = navigator.userAgent; + var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]'; + return { + IE: !!window.attachEvent && !isOpera, + Opera: isOpera, + WebKit: ua.indexOf('AppleWebKit/') > -1, + Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1, + MobileSafari: /Apple.*Mobile.*Safari/.test(ua) + } + })(), BrowserFeatures: { XPath: !!document.evaluate, - ElementExtensions: !!window.HTMLElement, - SpecificElementExtensions: - document.createElement('div').__proto__ && - document.createElement('div').__proto__ !== - document.createElement('form').__proto__ + SelectorsAPI: !!document.querySelector, + ElementExtensions: (function() { + var constructor = window.Element || window.HTMLElement; + return !!(constructor && constructor.prototype); + })(), + SpecificElementExtensions: (function() { + if (typeof window.HTMLDivElement !== 'undefined') + return true; + + var div = document.createElement('div'); + var form = document.createElement('form'); + var isSupported = false; + + if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) { + isSupported = true; + } + + div = form = null; + + return isSupported; + })() }, ScriptFragment: ']*>([\\S\\s]*?)<\/script>', @@ -36,12 +56,31 @@ var Prototype = { if (Prototype.Browser.MobileSafari) Prototype.BrowserFeatures.SpecificElementExtensions = false; -if (Prototype.Browser.WebKit) - Prototype.BrowserFeatures.XPath = false; + +var Abstract = { }; + + +var Try = { + these: function() { + var returnValue; + + for (var i = 0, length = arguments.length; i < length; i++) { + var lambda = arguments[i]; + try { + returnValue = lambda(); + break; + } catch (e) { } + } + + return returnValue; + } +}; /* Based on Alex Arnell's inheritance implementation. */ -var Class = { - create: function() { + +var Class = (function() { + function subclass() {}; + function create() { var parent = null, properties = $A(arguments); if (Object.isFunction(properties[0])) parent = properties.shift(); @@ -55,7 +94,6 @@ var Class = { klass.subclasses = []; if (parent) { - var subclass = function() { }; subclass.prototype = parent.prototype; klass.prototype = new subclass; parent.subclasses.push(klass); @@ -68,58 +106,67 @@ var Class = { klass.prototype.initialize = Prototype.emptyFunction; klass.prototype.constructor = klass; - return klass; } -}; -Class.Methods = { - addMethods: function(source) { + function addMethods(source) { var ancestor = this.superclass && this.superclass.prototype; var properties = Object.keys(source); - if (!Object.keys({ toString: true }).length) - properties.push("toString", "valueOf"); + if (!Object.keys({ toString: true }).length) { + if (source.toString != Object.prototype.toString) + properties.push("toString"); + if (source.valueOf != Object.prototype.valueOf) + properties.push("valueOf"); + } for (var i = 0, length = properties.length; i < length; i++) { var property = properties[i], value = source[property]; if (ancestor && Object.isFunction(value) && value.argumentNames().first() == "$super") { - var method = value, value = Object.extend((function(m) { - return function() { return ancestor[m].apply(this, arguments) }; - })(property).wrap(method), { - valueOf: function() { return method }, - toString: function() { return method.toString() } - }); + var method = value; + value = (function(m) { + return function() { return ancestor[m].apply(this, arguments); }; + })(property).wrap(method); + + value.valueOf = method.valueOf.bind(method); + value.toString = method.toString.bind(method); } this.prototype[property] = value; } return this; } -}; -var Abstract = { }; + return { + create: create, + Methods: { + addMethods: addMethods + } + }; +})(); +(function() { -Object.extend = function(destination, source) { - for (var property in source) - destination[property] = source[property]; - return destination; -}; + var _toString = Object.prototype.toString; + + function extend(destination, source) { + for (var property in source) + destination[property] = source[property]; + return destination; + } -Object.extend(Object, { - inspect: function(object) { + function inspect(object) { try { - if (object === undefined) return 'undefined'; + if (isUndefined(object)) return 'undefined'; if (object === null) return 'null'; - return object.inspect ? object.inspect() : object.toString(); + return object.inspect ? object.inspect() : String(object); } catch (e) { if (e instanceof RangeError) return '...'; throw e; } - }, + } - toJSON: function(object) { + function toJSON(object) { var type = typeof object; switch (type) { case 'undefined': @@ -130,126 +177,180 @@ Object.extend(Object, { if (object === null) return 'null'; if (object.toJSON) return object.toJSON(); - if (Object.isElement(object)) return; + if (isElement(object)) return; var results = []; for (var property in object) { - var value = Object.toJSON(object[property]); - if (value !== undefined) + var value = toJSON(object[property]); + if (!isUndefined(value)) results.push(property.toJSON() + ': ' + value); } return '{' + results.join(', ') + '}'; - }, + } - toQueryString: function(object) { + function toQueryString(object) { return $H(object).toQueryString(); - }, + } - toHTML: function(object) { + function toHTML(object) { return object && object.toHTML ? object.toHTML() : String.interpret(object); - }, + } - keys: function(object) { - var keys = []; + function keys(object) { + var results = []; for (var property in object) - keys.push(property); - return keys; - }, + results.push(property); + return results; + } - values: function(object) { - var values = []; + function values(object) { + var results = []; for (var property in object) - values.push(object[property]); - return values; - }, + results.push(object[property]); + return results; + } - clone: function(object) { - return Object.extend({ }, object); - }, + function clone(object) { + return extend({ }, object); + } - isElement: function(object) { - return object && object.nodeType == 1; - }, + function isElement(object) { + return !!(object && object.nodeType == 1); + } - isArray: function(object) { - return object && object.constructor === Array; - }, + function isArray(object) { + return _toString.call(object) == "[object Array]"; + } - isHash: function(object) { + + function isHash(object) { return object instanceof Hash; - }, + } - isFunction: function(object) { - return typeof object == "function"; - }, + function isFunction(object) { + return typeof object === "function"; + } - isString: function(object) { - return typeof object == "string"; - }, + function isString(object) { + return _toString.call(object) == "[object String]"; + } - isNumber: function(object) { - return typeof object == "number"; - }, + function isNumber(object) { + return _toString.call(object) == "[object Number]"; + } - isUndefined: function(object) { - return typeof object == "undefined"; + function isUndefined(object) { + return typeof object === "undefined"; + } + + extend(Object, { + extend: extend, + inspect: inspect, + toJSON: toJSON, + toQueryString: toQueryString, + toHTML: toHTML, + keys: keys, + values: values, + clone: clone, + isElement: isElement, + isArray: isArray, + isHash: isHash, + isFunction: isFunction, + isString: isString, + isNumber: isNumber, + isUndefined: isUndefined + }); +})(); +Object.extend(Function.prototype, (function() { + var slice = Array.prototype.slice; + + function update(array, args) { + var arrayLength = array.length, length = args.length; + while (length--) array[arrayLength + length] = args[length]; + return array; + } + + function merge(array, args) { + array = slice.call(array, 0); + return update(array, args); } -}); -Object.extend(Function.prototype, { - argumentNames: function() { - var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip"); + function argumentNames() { + var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1] + .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '') + .replace(/\s+/g, '').split(','); return names.length == 1 && !names[0] ? [] : names; - }, + } - bind: function() { - if (arguments.length < 2 && arguments[0] === undefined) return this; - var __method = this, args = $A(arguments), object = args.shift(); + function bind(context) { + if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; + var __method = this, args = slice.call(arguments, 1); return function() { - return __method.apply(object, args.concat($A(arguments))); + var a = merge(args, arguments); + return __method.apply(context, a); } - }, + } - bindAsEventListener: function() { - var __method = this, args = $A(arguments), object = args.shift(); + function bindAsEventListener(context) { + var __method = this, args = slice.call(arguments, 1); return function(event) { - return __method.apply(object, [event || window.event].concat(args)); + var a = update([event || window.event], args); + return __method.apply(context, a); } - }, + } - curry: function() { + function curry() { if (!arguments.length) return this; - var __method = this, args = $A(arguments); + var __method = this, args = slice.call(arguments, 0); return function() { - return __method.apply(this, args.concat($A(arguments))); + var a = merge(args, arguments); + return __method.apply(this, a); } - }, + } - delay: function() { - var __method = this, args = $A(arguments), timeout = args.shift() * 1000; + function delay(timeout) { + var __method = this, args = slice.call(arguments, 1); + timeout = timeout * 1000 return window.setTimeout(function() { return __method.apply(__method, args); }, timeout); - }, + } + + function defer() { + var args = update([0.01], arguments); + return this.delay.apply(this, args); + } - wrap: function(wrapper) { + function wrap(wrapper) { var __method = this; return function() { - return wrapper.apply(this, [__method.bind(this)].concat($A(arguments))); + var a = update([__method.bind(this)], arguments); + return wrapper.apply(this, a); } - }, + } - methodize: function() { + function methodize() { if (this._methodized) return this._methodized; var __method = this; return this._methodized = function() { - return __method.apply(null, [this].concat($A(arguments))); + var a = update([this], arguments); + return __method.apply(null, a); }; } -}); -Function.prototype.defer = Function.prototype.delay.curry(0.01); + return { + argumentNames: argumentNames, + bind: bind, + bindAsEventListener: bindAsEventListener, + curry: curry, + delay: delay, + defer: defer, + wrap: wrap, + methodize: methodize + } +})()); + Date.prototype.toJSON = function() { return '"' + this.getUTCFullYear() + '-' + @@ -260,30 +361,12 @@ Date.prototype.toJSON = function() { this.getUTCSeconds().toPaddedString(2) + 'Z"'; }; -var Try = { - these: function() { - var returnValue; - - for (var i = 0, length = arguments.length; i < length; i++) { - var lambda = arguments[i]; - try { - returnValue = lambda(); - break; - } catch (e) { } - } - - return returnValue; - } -}; RegExp.prototype.match = RegExp.prototype.test; RegExp.escape = function(str) { return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); }; - -/*--------------------------------------------------------------------------*/ - var PeriodicalExecuter = Class.create({ initialize: function(callback, frequency) { this.callback = callback; @@ -312,8 +395,10 @@ var PeriodicalExecuter = Class.create({ try { this.currentlyExecuting = true; this.execute(); - } finally { this.currentlyExecuting = false; + } catch(e) { + this.currentlyExecuting = false; + throw e; } } } @@ -332,10 +417,25 @@ Object.extend(String, { } }); -Object.extend(String.prototype, { - gsub: function(pattern, replacement) { +Object.extend(String.prototype, (function() { + + function prepareReplacement(replacement) { + if (Object.isFunction(replacement)) return replacement; + var template = new Template(replacement); + return function(match) { return template.evaluate(match) }; + } + + function gsub(pattern, replacement) { var result = '', source = this, match; - replacement = arguments.callee.prepareReplacement(replacement); + replacement = prepareReplacement(replacement); + + if (Object.isString(pattern)) + pattern = RegExp.escape(pattern); + + if (!(pattern.length || pattern.source)) { + replacement = replacement(''); + return replacement + source.split('').join(replacement) + replacement; + } while (source.length > 0) { if (match = source.match(pattern)) { @@ -347,69 +447,64 @@ Object.extend(String.prototype, { } } return result; - }, + } - sub: function(pattern, replacement, count) { - replacement = this.gsub.prepareReplacement(replacement); - count = count === undefined ? 1 : count; + function sub(pattern, replacement, count) { + replacement = prepareReplacement(replacement); + count = Object.isUndefined(count) ? 1 : count; return this.gsub(pattern, function(match) { if (--count < 0) return match[0]; return replacement(match); }); - }, + } - scan: function(pattern, iterator) { + function scan(pattern, iterator) { this.gsub(pattern, iterator); return String(this); - }, + } - truncate: function(length, truncation) { + function truncate(length, truncation) { length = length || 30; - truncation = truncation === undefined ? '...' : truncation; + truncation = Object.isUndefined(truncation) ? '...' : truncation; return this.length > length ? this.slice(0, length - truncation.length) + truncation : String(this); - }, + } - strip: function() { + function strip() { return this.replace(/^\s+/, '').replace(/\s+$/, ''); - }, + } - stripTags: function() { - return this.replace(/<\/?[^>]+>/gi, ''); - }, + function stripTags() { + return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, ''); + } - stripScripts: function() { + function stripScripts() { return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); - }, + } - extractScripts: function() { + function extractScripts() { var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); return (this.match(matchAll) || []).map(function(scriptTag) { return (scriptTag.match(matchOne) || ['', ''])[1]; }); - }, + } - evalScripts: function() { + function evalScripts() { return this.extractScripts().map(function(script) { return eval(script) }); - }, + } - escapeHTML: function() { - var self = arguments.callee; - self.text.data = this; - return self.div.innerHTML; - }, + function escapeHTML() { + return this.replace(/&/g,'&').replace(//g,'>'); + } - unescapeHTML: function() { - var div = new Element('div'); - div.innerHTML = this.stripTags(); - return div.childNodes[0] ? (div.childNodes.length > 1 ? - $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) : - div.childNodes[0].nodeValue) : ''; - }, + function unescapeHTML() { + return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&'); + } - toQueryParams: function(separator) { + + function toQueryParams(separator) { var match = this.strip().match(/([^?#]*)(#.*)?$/); if (!match) return { }; @@ -427,22 +522,22 @@ Object.extend(String.prototype, { } return hash; }); - }, + } - toArray: function() { + function toArray() { return this.split(''); - }, + } - succ: function() { + function succ() { return this.slice(0, this.length - 1) + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); - }, + } - times: function(count) { + function times(count) { return count < 1 ? '' : new Array(count + 1).join(this); - }, + } - camelize: function() { + function camelize() { var parts = this.split('-'), len = parts.length; if (len == 1) return parts[0]; @@ -454,99 +549,117 @@ Object.extend(String.prototype, { camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); return camelized; - }, + } - capitalize: function() { + function capitalize() { return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); - }, + } - underscore: function() { - return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); - }, + function underscore() { + return this.replace(/::/g, '/') + .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') + .replace(/([a-z\d])([A-Z])/g, '$1_$2') + .replace(/-/g, '_') + .toLowerCase(); + } - dasherize: function() { - return this.gsub(/_/,'-'); - }, + function dasherize() { + return this.replace(/_/g, '-'); + } - inspect: function(useDoubleQuotes) { - var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) { - var character = String.specialChar[match[0]]; - return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16); + function inspect(useDoubleQuotes) { + var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) { + if (character in String.specialChar) { + return String.specialChar[character]; + } + return '\\u00' + character.charCodeAt().toPaddedString(2, 16); }); if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; return "'" + escapedString.replace(/'/g, '\\\'') + "'"; - }, + } - toJSON: function() { + function toJSON() { return this.inspect(true); - }, + } - unfilterJSON: function(filter) { - return this.sub(filter || Prototype.JSONFilter, '#{1}'); - }, + function unfilterJSON(filter) { + return this.replace(filter || Prototype.JSONFilter, '$1'); + } - isJSON: function() { - var str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); + function isJSON() { + var str = this; + if (str.blank()) return false; + str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); - }, + } - evalJSON: function(sanitize) { + function evalJSON(sanitize) { var json = this.unfilterJSON(); try { if (!sanitize || json.isJSON()) return eval('(' + json + ')'); } catch (e) { } throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); - }, + } - include: function(pattern) { + function include(pattern) { return this.indexOf(pattern) > -1; - }, + } - startsWith: function(pattern) { + function startsWith(pattern) { return this.indexOf(pattern) === 0; - }, + } - endsWith: function(pattern) { + function endsWith(pattern) { var d = this.length - pattern.length; return d >= 0 && this.lastIndexOf(pattern) === d; - }, + } - empty: function() { + function empty() { return this == ''; - }, + } - blank: function() { + function blank() { return /^\s*$/.test(this); - }, - - interpolate: function(object, pattern) { - return new Template(this, pattern).evaluate(object); } -}); -if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { - escapeHTML: function() { - return this.replace(/&/g,'&').replace(//g,'>'); - }, - unescapeHTML: function() { - return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); + function interpolate(object, pattern) { + return new Template(this, pattern).evaluate(object); } -}); - -String.prototype.gsub.prepareReplacement = function(replacement) { - if (Object.isFunction(replacement)) return replacement; - var template = new Template(replacement); - return function(match) { return template.evaluate(match) }; -}; - -String.prototype.parseQuery = String.prototype.toQueryParams; - -Object.extend(String.prototype.escapeHTML, { - div: document.createElement('div'), - text: document.createTextNode('') -}); -with (String.prototype.escapeHTML) div.appendChild(text); + return { + gsub: gsub, + sub: sub, + scan: scan, + truncate: truncate, + strip: String.prototype.trim ? String.prototype.trim : strip, + stripTags: stripTags, + stripScripts: stripScripts, + extractScripts: extractScripts, + evalScripts: evalScripts, + escapeHTML: escapeHTML, + unescapeHTML: unescapeHTML, + toQueryParams: toQueryParams, + parseQuery: toQueryParams, + toArray: toArray, + succ: succ, + times: times, + camelize: camelize, + capitalize: capitalize, + underscore: underscore, + dasherize: dasherize, + inspect: inspect, + toJSON: toJSON, + unfilterJSON: unfilterJSON, + isJSON: isJSON, + evalJSON: evalJSON, + include: include, + startsWith: startsWith, + endsWith: endsWith, + empty: empty, + blank: blank, + interpolate: interpolate + }; +})()); var Template = Class.create({ initialize: function(template, pattern) { @@ -555,21 +668,22 @@ var Template = Class.create({ }, evaluate: function(object) { - if (Object.isFunction(object.toTemplateReplacements)) + if (object && Object.isFunction(object.toTemplateReplacements)) object = object.toTemplateReplacements(); return this.template.gsub(this.pattern, function(match) { - if (object == null) return ''; + if (object == null) return (match[1] + ''); var before = match[1] || ''; if (before == '\\') return match[2]; var ctx = object, expr = match[3]; - var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/, match = pattern.exec(expr); + var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; + match = pattern.exec(expr); if (match == null) return before; while (match != null) { - var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1]; + var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1]; ctx = ctx[comp]; if (null == ctx || '' == match[3]) break; expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); @@ -577,101 +691,98 @@ var Template = Class.create({ } return before + String.interpret(ctx); - }.bind(this)); + }); } }); Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; var $break = { }; -var Enumerable = { - each: function(iterator, context) { +var Enumerable = (function() { + function each(iterator, context) { var index = 0; - iterator = iterator.bind(context); try { this._each(function(value) { - iterator(value, index++); + iterator.call(context, value, index++); }); } catch (e) { if (e != $break) throw e; } return this; - }, + } - eachSlice: function(number, iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; + function eachSlice(number, iterator, context) { var index = -number, slices = [], array = this.toArray(); + if (number < 1) return array; while ((index += number) < array.length) slices.push(array.slice(index, index+number)); return slices.collect(iterator, context); - }, + } - all: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; + function all(iterator, context) { + iterator = iterator || Prototype.K; var result = true; this.each(function(value, index) { - result = result && !!iterator(value, index); + result = result && !!iterator.call(context, value, index); if (!result) throw $break; }); return result; - }, + } - any: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; + function any(iterator, context) { + iterator = iterator || Prototype.K; var result = false; this.each(function(value, index) { - if (result = !!iterator(value, index)) + if (result = !!iterator.call(context, value, index)) throw $break; }); return result; - }, + } - collect: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; + function collect(iterator, context) { + iterator = iterator || Prototype.K; var results = []; this.each(function(value, index) { - results.push(iterator(value, index)); + results.push(iterator.call(context, value, index)); }); return results; - }, + } - detect: function(iterator, context) { - iterator = iterator.bind(context); + function detect(iterator, context) { var result; this.each(function(value, index) { - if (iterator(value, index)) { + if (iterator.call(context, value, index)) { result = value; throw $break; } }); return result; - }, + } - findAll: function(iterator, context) { - iterator = iterator.bind(context); + function findAll(iterator, context) { var results = []; this.each(function(value, index) { - if (iterator(value, index)) + if (iterator.call(context, value, index)) results.push(value); }); return results; - }, + } - grep: function(filter, iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; + function grep(filter, iterator, context) { + iterator = iterator || Prototype.K; var results = []; if (Object.isString(filter)) - filter = new RegExp(filter); + filter = new RegExp(RegExp.escape(filter)); this.each(function(value, index) { if (filter.match(value)) - results.push(iterator(value, index)); + results.push(iterator.call(context, value, index)); }); return results; - }, + } - include: function(object) { + function include(object) { if (Object.isFunction(this.indexOf)) if (this.indexOf(object) != -1) return true; @@ -683,96 +794,96 @@ var Enumerable = { } }); return found; - }, + } - inGroupsOf: function(number, fillWith) { - fillWith = fillWith === undefined ? null : fillWith; + function inGroupsOf(number, fillWith) { + fillWith = Object.isUndefined(fillWith) ? null : fillWith; return this.eachSlice(number, function(slice) { while(slice.length < number) slice.push(fillWith); return slice; }); - }, + } - inject: function(memo, iterator, context) { - iterator = iterator.bind(context); + function inject(memo, iterator, context) { this.each(function(value, index) { - memo = iterator(memo, value, index); + memo = iterator.call(context, memo, value, index); }); return memo; - }, + } - invoke: function(method) { + function invoke(method) { var args = $A(arguments).slice(1); return this.map(function(value) { return value[method].apply(value, args); }); - }, + } - max: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; + function max(iterator, context) { + iterator = iterator || Prototype.K; var result; this.each(function(value, index) { - value = iterator(value, index); - if (result == undefined || value >= result) + value = iterator.call(context, value, index); + if (result == null || value >= result) result = value; }); return result; - }, + } - min: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; + function min(iterator, context) { + iterator = iterator || Prototype.K; var result; this.each(function(value, index) { - value = iterator(value, index); - if (result == undefined || value < result) + value = iterator.call(context, value, index); + if (result == null || value < result) result = value; }); return result; - }, + } - partition: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; + function partition(iterator, context) { + iterator = iterator || Prototype.K; var trues = [], falses = []; this.each(function(value, index) { - (iterator(value, index) ? + (iterator.call(context, value, index) ? trues : falses).push(value); }); return [trues, falses]; - }, + } - pluck: function(property) { + function pluck(property) { var results = []; this.each(function(value) { results.push(value[property]); }); return results; - }, + } - reject: function(iterator, context) { - iterator = iterator.bind(context); + function reject(iterator, context) { var results = []; this.each(function(value, index) { - if (!iterator(value, index)) + if (!iterator.call(context, value, index)) results.push(value); }); return results; - }, + } - sortBy: function(iterator, context) { - iterator = iterator.bind(context); + function sortBy(iterator, context) { return this.map(function(value, index) { - return {value: value, criteria: iterator(value, index)}; + return { + value: value, + criteria: iterator.call(context, value, index) + }; }).sort(function(left, right) { var a = left.criteria, b = right.criteria; return a < b ? -1 : a > b ? 1 : 0; }).pluck('value'); - }, + } - toArray: function() { + function toArray() { return this.map(); - }, + } - zip: function() { + function zip() { var iterator = Prototype.K, args = $A(arguments); if (Object.isFunction(args.last())) iterator = args.pop(); @@ -781,351 +892,423 @@ var Enumerable = { return this.map(function(value, index) { return iterator(collections.pluck(index)); }); - }, + } - size: function() { + function size() { return this.toArray().length; - }, + } - inspect: function() { + function inspect() { return '#'; } -}; -Object.extend(Enumerable, { - map: Enumerable.collect, - find: Enumerable.detect, - select: Enumerable.findAll, - filter: Enumerable.findAll, - member: Enumerable.include, - entries: Enumerable.toArray, - every: Enumerable.all, - some: Enumerable.any -}); + + + + + + + + + return { + each: each, + eachSlice: eachSlice, + all: all, + every: all, + any: any, + some: any, + collect: collect, + map: collect, + detect: detect, + findAll: findAll, + select: findAll, + filter: findAll, + grep: grep, + include: include, + member: include, + inGroupsOf: inGroupsOf, + inject: inject, + invoke: invoke, + max: max, + min: min, + partition: partition, + pluck: pluck, + reject: reject, + sortBy: sortBy, + toArray: toArray, + entries: toArray, + zip: zip, + size: size, + inspect: inspect, + find: detect + }; +})(); function $A(iterable) { if (!iterable) return []; - if (iterable.toArray) return iterable.toArray(); - var length = iterable.length, results = new Array(length); + if ('toArray' in Object(iterable)) return iterable.toArray(); + var length = iterable.length || 0, results = new Array(length); while (length--) results[length] = iterable[length]; return results; } -if (Prototype.Browser.WebKit) { - function $A(iterable) { - if (!iterable) return []; - if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') && - iterable.toArray) return iterable.toArray(); - var length = iterable.length, results = new Array(length); - while (length--) results[length] = iterable[length]; - return results; - } +function $w(string) { + if (!Object.isString(string)) return []; + string = string.strip(); + return string ? string.split(/\s+/) : []; } Array.from = $A; -Object.extend(Array.prototype, Enumerable); -if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse; +(function() { + var arrayProto = Array.prototype, + slice = arrayProto.slice, + _each = arrayProto.forEach; // use native browser JS 1.6 implementation if available -Object.extend(Array.prototype, { - _each: function(iterator) { + function each(iterator) { for (var i = 0, length = this.length; i < length; i++) iterator(this[i]); - }, + } + if (!_each) _each = each; - clear: function() { + function clear() { this.length = 0; return this; - }, + } - first: function() { + function first() { return this[0]; - }, + } - last: function() { + function last() { return this[this.length - 1]; - }, + } - compact: function() { + function compact() { return this.select(function(value) { return value != null; }); - }, + } - flatten: function() { + function flatten() { return this.inject([], function(array, value) { - return array.concat(Object.isArray(value) ? - value.flatten() : [value]); + if (Object.isArray(value)) + return array.concat(value.flatten()); + array.push(value); + return array; }); - }, + } - without: function() { - var values = $A(arguments); + function without() { + var values = slice.call(arguments, 0); return this.select(function(value) { return !values.include(value); }); - }, + } - reverse: function(inline) { + function reverse(inline) { return (inline !== false ? this : this.toArray())._reverse(); - }, - - reduce: function() { - return this.length > 1 ? this : this[0]; - }, + } - uniq: function(sorted) { + function uniq(sorted) { return this.inject([], function(array, value, index) { if (0 == index || (sorted ? array.last() != value : !array.include(value))) array.push(value); return array; }); - }, + } - intersect: function(array) { + function intersect(array) { return this.uniq().findAll(function(item) { return array.detect(function(value) { return item === value }); }); - }, + } - clone: function() { - return [].concat(this); - }, - size: function() { + function clone() { + return slice.call(this, 0); + } + + function size() { return this.length; - }, + } - inspect: function() { + function inspect() { return '[' + this.map(Object.inspect).join(', ') + ']'; - }, + } - toJSON: function() { + function toJSON() { var results = []; this.each(function(object) { var value = Object.toJSON(object); - if (value !== undefined) results.push(value); + if (!Object.isUndefined(value)) results.push(value); }); return '[' + results.join(', ') + ']'; } -}); - -// use native browser JS 1.6 implementation if available -if (Object.isFunction(Array.prototype.forEach)) - Array.prototype._each = Array.prototype.forEach; - -if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) { - i || (i = 0); - var length = this.length; - if (i < 0) i = length + i; - for (; i < length; i++) - if (this[i] === item) return i; - return -1; -}; - -if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) { - i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; - var n = this.slice(0, i).reverse().indexOf(item); - return (n < 0) ? n : i - n - 1; -}; -Array.prototype.toArray = Array.prototype.clone; + function indexOf(item, i) { + i || (i = 0); + var length = this.length; + if (i < 0) i = length + i; + for (; i < length; i++) + if (this[i] === item) return i; + return -1; + } -function $w(string) { - if (!Object.isString(string)) return []; - string = string.strip(); - return string ? string.split(/\s+/) : []; -} + function lastIndexOf(item, i) { + i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; + var n = this.slice(0, i).reverse().indexOf(item); + return (n < 0) ? n : i - n - 1; + } -if (Prototype.Browser.Opera){ - Array.prototype.concat = function() { - var array = []; - for (var i = 0, length = this.length; i < length; i++) array.push(this[i]); + function concat() { + var array = slice.call(this, 0), item; for (var i = 0, length = arguments.length; i < length; i++) { - if (Object.isArray(arguments[i])) { - for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) - array.push(arguments[i][j]); + item = arguments[i]; + if (Object.isArray(item) && !('callee' in item)) { + for (var j = 0, arrayLength = item.length; j < arrayLength; j++) + array.push(item[j]); } else { - array.push(arguments[i]); + array.push(item); } } return array; - }; -} -Object.extend(Number.prototype, { - toColorPart: function() { - return this.toPaddedString(2, 16); - }, - - succ: function() { - return this + 1; - }, + } - times: function(iterator) { - $R(0, this, true).each(iterator); - return this; - }, + Object.extend(arrayProto, Enumerable); + + if (!arrayProto._reverse) + arrayProto._reverse = arrayProto.reverse; + + Object.extend(arrayProto, { + _each: _each, + clear: clear, + first: first, + last: last, + compact: compact, + flatten: flatten, + without: without, + reverse: reverse, + uniq: uniq, + intersect: intersect, + clone: clone, + toArray: clone, + size: size, + inspect: inspect, + toJSON: toJSON + }); - toPaddedString: function(length, radix) { - var string = this.toString(radix || 10); - return '0'.times(length - string.length) + string; - }, + var CONCAT_ARGUMENTS_BUGGY = (function() { + return [].concat(arguments)[0][0] !== 1; + })(1,2) - toJSON: function() { - return isFinite(this) ? this.toString() : 'null'; - } -}); + if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat; -$w('abs round ceil floor').each(function(method){ - Number.prototype[method] = Math[method].methodize(); -}); + if (!arrayProto.indexOf) arrayProto.indexOf = indexOf; + if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf; +})(); function $H(object) { return new Hash(object); }; var Hash = Class.create(Enumerable, (function() { - if (function() { - var i = 0, Test = function(value) { this.key = value }; - Test.prototype.key = 'foo'; - for (var property in new Test('bar')) i++; - return i > 1; - }()) { - function each(iterator) { - var cache = []; - for (var key in this._object) { - var value = this._object[key]; - if (cache.include(key)) continue; - cache.push(key); - var pair = [key, value]; - pair.key = key; - pair.value = value; - iterator(pair); - } - } - } else { - function each(iterator) { - for (var key in this._object) { - var value = this._object[key], pair = [key, value]; - pair.key = key; - pair.value = value; - iterator(pair); - } + function initialize(object) { + this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); + } + + function _each(iterator) { + for (var key in this._object) { + var value = this._object[key], pair = [key, value]; + pair.key = key; + pair.value = value; + iterator(pair); } } + function set(key, value) { + return this._object[key] = value; + } + + function get(key) { + if (this._object[key] !== Object.prototype[key]) + return this._object[key]; + } + + function unset(key) { + var value = this._object[key]; + delete this._object[key]; + return value; + } + + function toObject() { + return Object.clone(this._object); + } + + function keys() { + return this.pluck('key'); + } + + function values() { + return this.pluck('value'); + } + + function index(value) { + var match = this.detect(function(pair) { + return pair.value === value; + }); + return match && match.key; + } + + function merge(object) { + return this.clone().update(object); + } + + function update(object) { + return new Hash(object).inject(this, function(result, pair) { + result.set(pair.key, pair.value); + return result; + }); + } + function toQueryPair(key, value) { if (Object.isUndefined(value)) return key; return key + '=' + encodeURIComponent(String.interpret(value)); } - return { - initialize: function(object) { - this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); - }, - - _each: each, + function toQueryString() { + return this.inject([], function(results, pair) { + var key = encodeURIComponent(pair.key), values = pair.value; - set: function(key, value) { - return this._object[key] = value; - }, + if (values && typeof values == 'object') { + if (Object.isArray(values)) + return results.concat(values.map(toQueryPair.curry(key))); + } else results.push(toQueryPair(key, values)); + return results; + }).join('&'); + } - get: function(key) { - return this._object[key]; - }, + function inspect() { + return '#'; + } - unset: function(key) { - var value = this._object[key]; - delete this._object[key]; - return value; - }, + function toJSON() { + return Object.toJSON(this.toObject()); + } - toObject: function() { - return Object.clone(this._object); - }, + function clone() { + return new Hash(this); + } - keys: function() { - return this.pluck('key'); - }, + return { + initialize: initialize, + _each: _each, + set: set, + get: get, + unset: unset, + toObject: toObject, + toTemplateReplacements: toObject, + keys: keys, + values: values, + index: index, + merge: merge, + update: update, + toQueryString: toQueryString, + inspect: inspect, + toJSON: toJSON, + clone: clone + }; +})()); - values: function() { - return this.pluck('value'); - }, +Hash.from = $H; +Object.extend(Number.prototype, (function() { + function toColorPart() { + return this.toPaddedString(2, 16); + } - index: function(value) { - var match = this.detect(function(pair) { - return pair.value === value; - }); - return match && match.key; - }, + function succ() { + return this + 1; + } - merge: function(object) { - return this.clone().update(object); - }, + function times(iterator, context) { + $R(0, this, true).each(iterator, context); + return this; + } - update: function(object) { - return new Hash(object).inject(this, function(result, pair) { - result.set(pair.key, pair.value); - return result; - }); - }, + function toPaddedString(length, radix) { + var string = this.toString(radix || 10); + return '0'.times(length - string.length) + string; + } - toQueryString: function() { - return this.map(function(pair) { - var key = encodeURIComponent(pair.key), values = pair.value; + function toJSON() { + return isFinite(this) ? this.toString() : 'null'; + } - if (values && typeof values == 'object') { - if (Object.isArray(values)) - return values.map(toQueryPair.curry(key)).join('&'); - } - return toQueryPair(key, values); - }).join('&'); - }, + function abs() { + return Math.abs(this); + } - inspect: function() { - return '#'; - }, + function round() { + return Math.round(this); + } - toJSON: function() { - return Object.toJSON(this.toObject()); - }, + function ceil() { + return Math.ceil(this); + } - clone: function() { - return new Hash(this); - } + function floor() { + return Math.floor(this); } + + return { + toColorPart: toColorPart, + succ: succ, + times: times, + toPaddedString: toPaddedString, + toJSON: toJSON, + abs: abs, + round: round, + ceil: ceil, + floor: floor + }; })()); -Hash.prototype.toTemplateReplacements = Hash.prototype.toObject; -Hash.from = $H; -var ObjectRange = Class.create(Enumerable, { - initialize: function(start, end, exclusive) { +function $R(start, end, exclusive) { + return new ObjectRange(start, end, exclusive); +} + +var ObjectRange = Class.create(Enumerable, (function() { + function initialize(start, end, exclusive) { this.start = start; this.end = end; this.exclusive = exclusive; - }, + } - _each: function(iterator) { + function _each(iterator) { var value = this.start; while (this.include(value)) { iterator(value); value = value.succ(); } - }, + } - include: function(value) { + function include(value) { if (value < this.start) return false; if (this.exclusive) return value < this.end; return value <= this.end; } -}); -var $R = function(start, end, exclusive) { - return new ObjectRange(start, end, exclusive); -}; + return { + initialize: initialize, + _each: _each, + include: include + }; +})()); + + var Ajax = { getTransport: function() { @@ -1172,7 +1355,6 @@ Ajax.Responders.register({ onCreate: function() { Ajax.activeRequestCount++ }, onComplete: function() { Ajax.activeRequestCount-- } }); - Ajax.Base = Class.create({ initialize: function(options) { this.options = { @@ -1187,11 +1369,13 @@ Ajax.Base = Class.create({ Object.extend(this.options, options || { }); this.options.method = this.options.method.toLowerCase(); + if (Object.isString(this.options.parameters)) this.options.parameters = this.options.parameters.toQueryParams(); + else if (Object.isHash(this.options.parameters)) + this.options.parameters = this.options.parameters.toObject(); } }); - Ajax.Request = Class.create(Ajax.Base, { _complete: false, @@ -1207,7 +1391,6 @@ Ajax.Request = Class.create(Ajax.Base, { var params = Object.clone(this.options.parameters); if (!['get', 'post'].include(this.method)) { - // simulate other verbs over post params['_method'] = this.method; this.method = 'post'; } @@ -1215,7 +1398,6 @@ Ajax.Request = Class.create(Ajax.Base, { this.parameters = params; if (params = Object.toQueryString(params)) { - // when GET, append parameters to URL if (this.method == 'get') this.url += (this.url.include('?') ? '&' : '?') + params; else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) @@ -1274,7 +1456,6 @@ Ajax.Request = Class.create(Ajax.Base, { headers['Connection'] = 'close'; } - // user-defined headers if (typeof this.options.requestHeaders == 'object') { var extras = this.options.requestHeaders; @@ -1315,7 +1496,7 @@ Ajax.Request = Class.create(Ajax.Base, { var contentType = response.getHeader('Content-type'); if (this.options.evalJS == 'force' - || (this.options.evalJS && contentType + || (this.options.evalJS && this.isSameOrigin() && contentType && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) this.evalResponse(); } @@ -1328,15 +1509,23 @@ Ajax.Request = Class.create(Ajax.Base, { } if (state == 'Complete') { - // avoid memory leak in MSIE: clean up this.transport.onreadystatechange = Prototype.emptyFunction; } }, + isSameOrigin: function() { + var m = this.url.match(/^\s*https?:\/\/[^\/]*/); + return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({ + protocol: location.protocol, + domain: document.domain, + port: location.port ? ':' + location.port : '' + })); + }, + getHeader: function(name) { try { - return this.transport.getResponseHeader(name); - } catch (e) { return null } + return this.transport.getResponseHeader(name) || null; + } catch (e) { return null; } }, evalResponse: function() { @@ -1356,6 +1545,13 @@ Ajax.Request = Class.create(Ajax.Base, { Ajax.Request.Events = ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; + + + + + + + Ajax.Response = Class.create({ initialize: function(request){ this.request = request; @@ -1371,12 +1567,13 @@ Ajax.Response = Class.create({ if(readyState == 4) { var xml = transport.responseXML; - this.responseXML = xml === undefined ? null : xml; + this.responseXML = Object.isUndefined(xml) ? null : xml; this.responseJSON = this._getResponseJSON(); } }, status: 0, + statusText: '', getStatus: Ajax.Request.prototype.getStatus, @@ -1408,7 +1605,8 @@ Ajax.Response = Class.create({ if (!json) return null; json = decodeURIComponent(escape(json)); try { - return json.evalJSON(this.request.options.sanitizeJSON); + return json.evalJSON(this.request.options.sanitizeJSON || + !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } @@ -1417,10 +1615,12 @@ Ajax.Response = Class.create({ _getResponseJSON: function() { var options = this.request.options; if (!options.evalJSON || (options.evalJSON != 'force' && - !(this.getHeader('Content-type') || '').include('application/json'))) - return null; + !(this.getHeader('Content-type') || '').include('application/json')) || + this.responseText.blank()) + return null; try { - return this.transport.responseText.evalJSON(options.sanitizeJSON); + return this.responseText.evalJSON(options.sanitizeJSON || + !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } @@ -1434,11 +1634,11 @@ Ajax.Updater = Class.create(Ajax.Request, { failure: (container.failure || (container.success ? null : container)) }; - options = options || { }; + options = Object.clone(options); var onComplete = options.onComplete; - options.onComplete = (function(response, param) { + options.onComplete = (function(response, json) { this.updateContent(response.responseText); - if (Object.isFunction(onComplete)) onComplete(response, param); + if (Object.isFunction(onComplete)) onComplete(response, json); }).bind(this); $super(url, options); @@ -1460,10 +1660,6 @@ Ajax.Updater = Class.create(Ajax.Request, { } else receiver.update(responseText); } - - if (this.success()) { - if (this.onComplete) this.onComplete.bind(this).defer(); - } } }); @@ -1507,6 +1703,9 @@ Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { this.updater = new Ajax.Updater(this.container, this.url, this.options); } }); + + + function $(element) { if (arguments.length > 1) { for (var i = 0, elements = [], length = arguments.length; i < length; i++) @@ -1534,7 +1733,6 @@ if (Prototype.BrowserFeatures.XPath) { if (!window.Node) var Node = { }; if (!Node.ELEMENT_NODE) { - // DOM level 2 ECMAScript Language Binding Object.extend(Node, { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, @@ -1551,13 +1749,30 @@ if (!Node.ELEMENT_NODE) { }); } -(function() { - var element = this.Element; - this.Element = function(tagName, attributes) { + +(function(global) { + + var SETATTRIBUTE_IGNORES_NAME = (function(){ + var elForm = document.createElement("form"); + var elInput = document.createElement("input"); + var root = document.documentElement; + elInput.setAttribute("name", "test"); + elForm.appendChild(elInput); + root.appendChild(elForm); + var isBuggy = elForm.elements + ? (typeof elForm.elements.test == "undefined") + : null; + root.removeChild(elForm); + elForm = elInput = null; + return isBuggy; + })(); + + var element = global.Element; + global.Element = function(tagName, attributes) { attributes = attributes || { }; tagName = tagName.toLowerCase(); var cache = Element.cache; - if (Prototype.Browser.IE && attributes.name) { + if (SETATTRIBUTE_IGNORES_NAME && attributes.name) { tagName = '<' + tagName + ' name="' + attributes.name + '">'; delete attributes.name; return Element.writeAttribute(document.createElement(tagName), attributes); @@ -1565,10 +1780,12 @@ if (!Node.ELEMENT_NODE) { if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); }; - Object.extend(this.Element, element || { }); -}).call(window); + Object.extend(global.Element, element || { }); + if (element) global.Element.prototype = element.prototype; +})(this); Element.cache = { }; +Element.idCounter = 1; Element.Methods = { visible: function(element) { @@ -1581,13 +1798,16 @@ Element.Methods = { return element; }, + hide: function(element) { - $(element).style.display = 'none'; + element = $(element); + element.style.display = 'none'; return element; }, show: function(element) { - $(element).style.display = ''; + element = $(element); + element.style.display = ''; return element; }, @@ -1597,15 +1817,89 @@ Element.Methods = { return element; }, - update: function(element, content) { - element = $(element); - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) return element.update().insert(content); - content = Object.toHTML(content); - element.innerHTML = content.stripScripts(); - content.evalScripts.bind(content).defer(); - return element; - }, + update: (function(){ + + var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){ + var el = document.createElement("select"), + isBuggy = true; + el.innerHTML = ""; + if (el.options && el.options[0]) { + isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION"; + } + el = null; + return isBuggy; + })(); + + var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){ + try { + var el = document.createElement("table"); + if (el && el.tBodies) { + el.innerHTML = "test"; + var isBuggy = typeof el.tBodies[0] == "undefined"; + el = null; + return isBuggy; + } + } catch (e) { + return true; + } + })(); + + var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () { + var s = document.createElement("script"), + isBuggy = false; + try { + s.appendChild(document.createTextNode("")); + isBuggy = !s.firstChild || + s.firstChild && s.firstChild.nodeType !== 3; + } catch (e) { + isBuggy = true; + } + s = null; + return isBuggy; + })(); + + function update(element, content) { + element = $(element); + + if (content && content.toElement) + content = content.toElement(); + + if (Object.isElement(content)) + return element.update().insert(content); + + content = Object.toHTML(content); + + var tagName = element.tagName.toUpperCase(); + + if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) { + element.text = content; + return element; + } + + if (SELECT_ELEMENT_INNERHTML_BUGGY || TABLE_ELEMENT_INNERHTML_BUGGY) { + if (tagName in Element._insertionTranslations.tags) { + while (element.firstChild) { + element.removeChild(element.firstChild); + } + Element._getContentFromAnonymousElement(tagName, content.stripScripts()) + .each(function(node) { + element.appendChild(node) + }); + } + else { + element.innerHTML = content.stripScripts(); + } + } + else { + element.innerHTML = content.stripScripts(); + } + + content.evalScripts.bind(content).defer(); + return element; + } + + return update; + })(), replace: function(element, content) { element = $(element); @@ -1628,24 +1922,28 @@ Element.Methods = { Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) insertions = {bottom:insertions}; - var content, t, range; + var content, insert, tagName, childNodes; - for (position in insertions) { + for (var position in insertions) { content = insertions[position]; position = position.toLowerCase(); - t = Element._insertionTranslations[position]; + insert = Element._insertionTranslations[position]; if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { - t.insert(element, content); + insert(element, content); continue; } content = Object.toHTML(content); - range = element.ownerDocument.createRange(); - t.initializeRange(element, range); - t.insert(element, range.createContextualFragment(content.stripScripts())); + tagName = ((position == 'before' || position == 'after') + ? element.parentNode : element).tagName.toUpperCase(); + + childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); + + if (position == 'top' || position == 'after') childNodes.reverse(); + childNodes.each(insert.curry(element)); content.evalScripts.bind(content).defer(); } @@ -1686,11 +1984,11 @@ Element.Methods = { }, ancestors: function(element) { - return $(element).recursivelyCollect('parentNode'); + return Element.recursivelyCollect(element, 'parentNode'); }, descendants: function(element) { - return $A($(element).getElementsByTagName('*')).each(Element.extend); + return Element.select(element, "*"); }, firstDescendant: function(element) { @@ -1707,16 +2005,17 @@ Element.Methods = { }, previousSiblings: function(element) { - return $(element).recursivelyCollect('previousSibling'); + return Element.recursivelyCollect(element, 'previousSibling'); }, nextSiblings: function(element) { - return $(element).recursivelyCollect('nextSibling'); + return Element.recursivelyCollect(element, 'nextSibling'); }, siblings: function(element) { element = $(element); - return element.previousSiblings().reverse().concat(element.nextSiblings()); + return Element.previousSiblings(element).reverse() + .concat(Element.nextSiblings(element)); }, match: function(element, selector) { @@ -1728,51 +2027,51 @@ Element.Methods = { up: function(element, expression, index) { element = $(element); if (arguments.length == 1) return $(element.parentNode); - var ancestors = element.ancestors(); - return expression ? Selector.findElement(ancestors, expression, index) : - ancestors[index || 0]; + var ancestors = Element.ancestors(element); + return Object.isNumber(expression) ? ancestors[expression] : + Selector.findElement(ancestors, expression, index); }, down: function(element, expression, index) { element = $(element); - if (arguments.length == 1) return element.firstDescendant(); - var descendants = element.descendants(); - return expression ? Selector.findElement(descendants, expression, index) : - descendants[index || 0]; + if (arguments.length == 1) return Element.firstDescendant(element); + return Object.isNumber(expression) ? Element.descendants(element)[expression] : + Element.select(element, expression)[index || 0]; }, previous: function(element, expression, index) { element = $(element); if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element)); - var previousSiblings = element.previousSiblings(); - return expression ? Selector.findElement(previousSiblings, expression, index) : - previousSiblings[index || 0]; + var previousSiblings = Element.previousSiblings(element); + return Object.isNumber(expression) ? previousSiblings[expression] : + Selector.findElement(previousSiblings, expression, index); }, next: function(element, expression, index) { element = $(element); if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element)); - var nextSiblings = element.nextSiblings(); - return expression ? Selector.findElement(nextSiblings, expression, index) : - nextSiblings[index || 0]; + var nextSiblings = Element.nextSiblings(element); + return Object.isNumber(expression) ? nextSiblings[expression] : + Selector.findElement(nextSiblings, expression, index); }, - select: function() { - var args = $A(arguments), element = $(args.shift()); + + select: function(element) { + var args = Array.prototype.slice.call(arguments, 1); return Selector.findChildElements(element, args); }, - adjacent: function() { - var args = $A(arguments), element = $(args.shift()); + adjacent: function(element) { + var args = Array.prototype.slice.call(arguments, 1); return Selector.findChildElements(element.parentNode, args).without(element); }, identify: function(element) { element = $(element); - var id = element.readAttribute('id'), self = arguments.callee; + var id = Element.readAttribute(element, 'id'); if (id) return id; - do { id = 'anonymous_element_' + self.counter++ } while ($(id)); - element.writeAttribute('id', id); + do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id)); + Element.writeAttribute(element, 'id', id); return id; }, @@ -1795,10 +2094,11 @@ Element.Methods = { var attributes = { }, t = Element._attributeTranslations.write; if (typeof name == 'object') attributes = name; - else attributes[name] = value === undefined ? true : value; + else attributes[name] = Object.isUndefined(value) ? true : value; for (var attr in attributes) { - var name = t.names[attr] || attr, value = attributes[attr]; + name = t.names[attr] || attr; + value = attributes[attr]; if (t.values[attr]) name = t.values[attr](element, value); if (value === false || value === null) element.removeAttribute(name); @@ -1810,11 +2110,11 @@ Element.Methods = { }, getHeight: function(element) { - return $(element).getDimensions().height; + return Element.getDimensions(element).height; }, getWidth: function(element) { - return $(element).getDimensions().width; + return Element.getDimensions(element).width; }, classNames: function(element) { @@ -1830,7 +2130,7 @@ Element.Methods = { addClassName: function(element, className) { if (!(element = $(element))) return; - if (!element.hasClassName(className)) + if (!Element.hasClassName(element, className)) element.className += (element.className ? ' ' : '') + className; return element; }, @@ -1844,11 +2144,10 @@ Element.Methods = { toggleClassName: function(element, className) { if (!(element = $(element))) return; - return element[element.hasClassName(className) ? - 'removeClassName' : 'addClassName'](className); + return Element[Element.hasClassName(element, className) ? + 'removeClassName' : 'addClassName'](element, className); }, - // removes whitespace-only text node children cleanWhitespace: function(element) { element = $(element); var node = element.firstChild; @@ -1871,24 +2170,18 @@ Element.Methods = { if (element.compareDocumentPosition) return (element.compareDocumentPosition(ancestor) & 8) === 8; - if (element.sourceIndex && !Prototype.Browser.Opera) { - var e = element.sourceIndex, a = ancestor.sourceIndex, - nextAncestor = ancestor.nextSibling; - if (!nextAncestor) { - do { ancestor = ancestor.parentNode; } - while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode); - } - if (nextAncestor) return (e > a && e < nextAncestor.sourceIndex); - } + if (ancestor.contains) + return ancestor.contains(element) && ancestor !== element; while (element = element.parentNode) if (element == ancestor) return true; + return false; }, scrollTo: function(element) { element = $(element); - var pos = element.cumulativeOffset(); + var pos = Element.cumulativeOffset(element); window.scrollTo(pos[0], pos[1]); return element; }, @@ -1897,7 +2190,7 @@ Element.Methods = { element = $(element); style = style == 'float' ? 'cssFloat' : style.camelize(); var value = element.style[style]; - if (!value) { + if (!value || value == 'auto') { var css = document.defaultView.getComputedStyle(element, null); value = css ? css[style] : null; } @@ -1921,7 +2214,7 @@ Element.Methods = { if (property == 'opacity') element.setOpacity(styles[property]); else elementStyle[(property == 'float' || property == 'cssFloat') ? - (elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') : + (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : property] = styles[property]; return element; @@ -1936,18 +2229,17 @@ Element.Methods = { getDimensions: function(element) { element = $(element); - var display = $(element).getStyle('display'); + var display = Element.getStyle(element, 'display'); if (display != 'none' && display != null) // Safari bug return {width: element.offsetWidth, height: element.offsetHeight}; - // All *Width and *Height properties give 0 on elements with display none, - // so enable the element temporarily var els = element.style; var originalVisibility = els.visibility; var originalPosition = els.position; var originalDisplay = els.display; els.visibility = 'hidden'; - els.position = 'absolute'; + if (originalPosition != 'fixed') // Switching fixed to absolute causes issues in Safari + els.position = 'absolute'; els.display = 'block'; var originalWidth = element.clientWidth; var originalHeight = element.clientHeight; @@ -1963,9 +2255,7 @@ Element.Methods = { if (pos == 'static' || !pos) { element._madePositioned = true; element.style.position = 'relative'; - // Opera returns the offset relative to the positioning context, when an - // element is position relative but top and left have not been defined - if (window.opera) { + if (Prototype.Browser.Opera) { element.style.top = 0; element.style.left = 0; } @@ -2020,9 +2310,9 @@ Element.Methods = { valueL += element.offsetLeft || 0; element = element.offsetParent; if (element) { - if (element.tagName == 'BODY') break; + if (element.tagName.toUpperCase() == 'BODY') break; var p = Element.getStyle(element, 'position'); - if (p == 'relative' || p == 'absolute') break; + if (p !== 'static') break; } } while (element); return Element._returnOffset(valueL, valueT); @@ -2030,10 +2320,9 @@ Element.Methods = { absolutize: function(element) { element = $(element); - if (element.getStyle('position') == 'absolute') return; - // Position.prepare(); // To be done manually by Scripty when it needs it. + if (Element.getStyle(element, 'position') == 'absolute') return element; - var offsets = element.positionedOffset(); + var offsets = Element.positionedOffset(element); var top = offsets[1]; var left = offsets[0]; var width = element.clientWidth; @@ -2054,8 +2343,7 @@ Element.Methods = { relativize: function(element) { element = $(element); - if (element.getStyle('position') == 'relative') return; - // Position.prepare(); // To be done manually by Scripty when it needs it. + if (Element.getStyle(element, 'position') == 'relative') return element; element.style.position = 'relative'; var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); @@ -2097,7 +2385,6 @@ Element.Methods = { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; - // Safari fix if (element.offsetParent == document.body && Element.getStyle(element, 'position') == 'absolute') break; @@ -2105,7 +2392,7 @@ Element.Methods = { element = forElement; do { - if (!Prototype.Browser.Opera || element.tagName == 'BODY') { + if (!Prototype.Browser.Opera || (element.tagName && (element.tagName.toUpperCase() == 'BODY'))) { valueT -= element.scrollTop || 0; valueL -= element.scrollLeft || 0; } @@ -2124,28 +2411,22 @@ Element.Methods = { offsetLeft: 0 }, arguments[2] || { }); - // find page position of source source = $(source); - var p = source.viewportOffset(); + var p = Element.viewportOffset(source); - // find coordinate system to use element = $(element); var delta = [0, 0]; var parent = null; - // delta [0,0] will do fine with position: fixed elements, - // position:absolute needs offsetParent deltas if (Element.getStyle(element, 'position') == 'absolute') { - parent = element.getOffsetParent(); - delta = parent.viewportOffset(); + parent = Element.getOffsetParent(element); + delta = Element.viewportOffset(parent); } - // correct by body offsets (fixes Safari) if (parent == document.body) { delta[0] -= document.body.offsetLeft; delta[1] -= document.body.offsetTop; } - // set position if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; if (options.setWidth) element.style.width = source.offsetWidth + 'px'; @@ -2154,10 +2435,9 @@ Element.Methods = { } }; -Element.Methods.identify.counter = 1; - Object.extend(Element.Methods, { getElementsBySelector: Element.Methods.select, + childElements: Element.Methods.immediateDescendants }); @@ -2171,72 +2451,72 @@ Element._attributeTranslations = { } }; - -if (!document.createRange || Prototype.Browser.Opera) { - Element.Methods.insert = function(element, insertions) { - element = $(element); - - if (Object.isString(insertions) || Object.isNumber(insertions) || - Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) - insertions = { bottom: insertions }; - - var t = Element._insertionTranslations, content, position, pos, tagName; - - for (position in insertions) { - content = insertions[position]; - position = position.toLowerCase(); - pos = t[position]; - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) { - pos.insert(element, content); - continue; - } - - content = Object.toHTML(content); - tagName = ((position == 'before' || position == 'after') - ? element.parentNode : element).tagName.toUpperCase(); - - if (t.tags[tagName]) { - var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); - if (position == 'top' || position == 'after') fragments.reverse(); - fragments.each(pos.insert.curry(element)); +if (Prototype.Browser.Opera) { + Element.Methods.getStyle = Element.Methods.getStyle.wrap( + function(proceed, element, style) { + switch (style) { + case 'left': case 'top': case 'right': case 'bottom': + if (proceed(element, 'position') === 'static') return null; + case 'height': case 'width': + if (!Element.visible(element)) return null; + + var dim = parseInt(proceed(element, style), 10); + + if (dim !== element['offset' + style.capitalize()]) + return dim + 'px'; + + var properties; + if (style === 'height') { + properties = ['border-top-width', 'padding-top', + 'padding-bottom', 'border-bottom-width']; + } + else { + properties = ['border-left-width', 'padding-left', + 'padding-right', 'border-right-width']; + } + return properties.inject(dim, function(memo, property) { + var val = proceed(element, property); + return val === null ? memo : memo - parseInt(val, 10); + }) + 'px'; + default: return proceed(element, style); } - else element.insertAdjacentHTML(pos.adjacency, content.stripScripts()); - - content.evalScripts.bind(content).defer(); } + ); - return element; - }; -} - -if (Prototype.Browser.Opera) { - Element.Methods._getStyle = Element.Methods.getStyle; - Element.Methods.getStyle = function(element, style) { - switch(style) { - case 'left': - case 'top': - case 'right': - case 'bottom': - if (Element._getStyle(element, 'position') == 'static') return null; - default: return Element._getStyle(element, style); + Element.Methods.readAttribute = Element.Methods.readAttribute.wrap( + function(proceed, element, attribute) { + if (attribute === 'title') return element.title; + return proceed(element, attribute); } - }; - Element.Methods._readAttribute = Element.Methods.readAttribute; - Element.Methods.readAttribute = function(element, attribute) { - if (attribute == 'title') return element.title; - return Element._readAttribute(element, attribute); - }; + ); } else if (Prototype.Browser.IE) { - $w('positionedOffset getOffsetParent viewportOffset').each(function(method) { + Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap( + function(proceed, element) { + element = $(element); + try { element.offsetParent } + catch(e) { return $(document.body) } + var position = element.getStyle('position'); + if (position !== 'static') return proceed(element); + element.setStyle({ position: 'relative' }); + var value = proceed(element); + element.setStyle({ position: position }); + return value; + } + ); + + $w('positionedOffset viewportOffset').each(function(method) { Element.Methods[method] = Element.Methods[method].wrap( function(proceed, element) { element = $(element); + try { element.offsetParent } + catch(e) { return Element._returnOffset(0,0) } var position = element.getStyle('position'); - if (position != 'static') return proceed(element); + if (position !== 'static') return proceed(element); + var offsetParent = element.getOffsetParent(); + if (offsetParent && offsetParent.getStyle('position') === 'fixed') + offsetParent.setStyle({ zoom: 1 }); element.setStyle({ position: 'relative' }); var value = proceed(element); element.setStyle({ position: position }); @@ -2245,6 +2525,14 @@ else if (Prototype.Browser.IE) { ); }); + Element.Methods.cumulativeOffset = Element.Methods.cumulativeOffset.wrap( + function(proceed, element) { + try { element.offsetParent } + catch(e) { return Element._returnOffset(0,0) } + return proceed(element); + } + ); + Element.Methods.getStyle = function(element, style) { element = $(element); style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); @@ -2286,39 +2574,98 @@ else if (Prototype.Browser.IE) { return element; }; - Element._attributeTranslations = { - read: { - names: { - 'class': 'className', - 'for': 'htmlFor' - }, - values: { - _getAttr: function(element, attribute) { - return element.getAttribute(attribute, 2); - }, - _getAttrNode: function(element, attribute) { - var node = element.getAttributeNode(attribute); - return node ? node.value : ""; - }, - _getEv: function(element, attribute) { - var attribute = element.getAttribute(attribute); - return attribute ? attribute.toString().slice(23, -2) : null; - }, - _flag: function(element, attribute) { - return $(element).hasAttribute(attribute) ? attribute : null; - }, - style: function(element) { - return element.style.cssText.toLowerCase(); + Element._attributeTranslations = (function(){ + + var classProp = 'className'; + var forProp = 'for'; + + var el = document.createElement('div'); + + el.setAttribute(classProp, 'x'); + + if (el.className !== 'x') { + el.setAttribute('class', 'x'); + if (el.className === 'x') { + classProp = 'class'; + } + } + el = null; + + el = document.createElement('label'); + el.setAttribute(forProp, 'x'); + if (el.htmlFor !== 'x') { + el.setAttribute('htmlFor', 'x'); + if (el.htmlFor === 'x') { + forProp = 'htmlFor'; + } + } + el = null; + + return { + read: { + names: { + 'class': classProp, + 'className': classProp, + 'for': forProp, + 'htmlFor': forProp }, - title: function(element) { - return element.title; + values: { + _getAttr: function(element, attribute) { + return element.getAttribute(attribute); + }, + _getAttr2: function(element, attribute) { + return element.getAttribute(attribute, 2); + }, + _getAttrNode: function(element, attribute) { + var node = element.getAttributeNode(attribute); + return node ? node.value : ""; + }, + _getEv: (function(){ + + var el = document.createElement('div'); + el.onclick = Prototype.emptyFunction; + var value = el.getAttribute('onclick'); + var f; + + if (String(value).indexOf('{') > -1) { + f = function(element, attribute) { + attribute = element.getAttribute(attribute); + if (!attribute) return null; + attribute = attribute.toString(); + attribute = attribute.split('{')[1]; + attribute = attribute.split('}')[0]; + return attribute.strip(); + }; + } + else if (value === '') { + f = function(element, attribute) { + attribute = element.getAttribute(attribute); + if (!attribute) return null; + return attribute.strip(); + }; + } + el = null; + return f; + })(), + _flag: function(element, attribute) { + return $(element).hasAttribute(attribute) ? attribute : null; + }, + style: function(element) { + return element.style.cssText.toLowerCase(); + }, + title: function(element) { + return element.title; + } } } } - }; + })(); Element._attributeTranslations.write = { - names: Object.clone(Element._attributeTranslations.read.names), + names: Object.extend({ + cellpadding: 'cellPadding', + cellspacing: 'cellSpacing' + }, Element._attributeTranslations.read.names), values: { checked: function(element, value) { element.checked = !!value; @@ -2333,15 +2680,15 @@ else if (Prototype.Browser.IE) { Element._attributeTranslations.has = {}; $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + - 'encType maxLength readOnly longDesc').each(function(attr) { + 'encType maxLength readOnly longDesc frameBorder').each(function(attr) { Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; Element._attributeTranslations.has[attr.toLowerCase()] = attr; }); (function(v) { Object.extend(v, { - href: v._getAttr, - src: v._getAttr, + href: v._getAttr2, + src: v._getAttr2, type: v._getAttr, action: v._getAttrNode, disabled: v._flag, @@ -2368,6 +2715,26 @@ else if (Prototype.Browser.IE) { onchange: v._getEv }); })(Element._attributeTranslations.read.values); + + if (Prototype.BrowserFeatures.ElementExtensions) { + (function() { + function _descendants(element) { + var nodes = element.getElementsByTagName('*'), results = []; + for (var i = 0, node; node = nodes[i]; i++) + if (node.tagName !== "!") // Filter out comment nodes. + results.push(node); + return results; + } + + Element.Methods.down = function(element, expression, index) { + element = $(element); + if (arguments.length == 1) return element.firstDescendant(); + return Object.isNumber(expression) ? _descendants(element)[expression] : + Element.select(element, expression)[index || 0]; + } + })(); + } + } else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { @@ -2386,7 +2753,7 @@ else if (Prototype.Browser.WebKit) { (value < 0.00001) ? 0 : value; if (value == 1) - if(element.tagName == 'IMG' && element.width) { + if(element.tagName.toUpperCase() == 'IMG' && element.width) { element.width++; element.width--; } else try { var n = document.createTextNode(' '); @@ -2397,9 +2764,6 @@ else if (Prototype.Browser.WebKit) { return element; }; - // Safari returns margins on body which is incorrect if the child is absolutely - // positioned. For performance reasons, redefine Position.cumulativeOffset for - // KHTML/WebKit only. Element.Methods.cumulativeOffset = function(element) { var valueT = 0, valueL = 0; do { @@ -2415,30 +2779,7 @@ else if (Prototype.Browser.WebKit) { }; } -if (Prototype.Browser.IE || Prototype.Browser.Opera) { - // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements - Element.Methods.update = function(element, content) { - element = $(element); - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) return element.update().insert(content); - - content = Object.toHTML(content); - var tagName = element.tagName.toUpperCase(); - - if (tagName in Element._insertionTranslations.tags) { - $A(element.childNodes).each(function(node) { element.removeChild(node) }); - Element._getContentFromAnonymousElement(tagName, content.stripScripts()) - .each(function(node) { element.appendChild(node) }); - } - else element.innerHTML = content.stripScripts(); - - content.evalScripts.bind(content).defer(); - return element; - }; -} - -if (document.createElement('div').outerHTML) { +if ('outerHTML' in document.documentElement) { Element.Methods.replace = function(element, content) { element = $(element); @@ -2476,45 +2817,25 @@ Element._returnOffset = function(l, t) { Element._getContentFromAnonymousElement = function(tagName, html) { var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; - div.innerHTML = t[0] + html + t[1]; - t[2].times(function() { div = div.firstChild }); + if (t) { + div.innerHTML = t[0] + html + t[1]; + t[2].times(function() { div = div.firstChild }); + } else div.innerHTML = html; return $A(div.childNodes); }; Element._insertionTranslations = { - before: { - adjacency: 'beforeBegin', - insert: function(element, node) { - element.parentNode.insertBefore(node, element); - }, - initializeRange: function(element, range) { - range.setStartBefore(element); - } + before: function(element, node) { + element.parentNode.insertBefore(node, element); }, - top: { - adjacency: 'afterBegin', - insert: function(element, node) { - element.insertBefore(node, element.firstChild); - }, - initializeRange: function(element, range) { - range.selectNodeContents(element); - range.collapse(true); - } + top: function(element, node) { + element.insertBefore(node, element.firstChild); }, - bottom: { - adjacency: 'beforeEnd', - insert: function(element, node) { - element.appendChild(node); - } + bottom: function(element, node) { + element.appendChild(node); }, - after: { - adjacency: 'afterEnd', - insert: function(element, node) { - element.parentNode.insertBefore(node, element.nextSibling); - }, - initializeRange: function(element, range) { - range.setStartAfter(element); - } + after: function(element, node) { + element.parentNode.insertBefore(node, element.nextSibling); }, tags: { TABLE: ['', '
    ', 1], @@ -2526,19 +2847,19 @@ Element._insertionTranslations = { }; (function() { - this.bottom.initializeRange = this.top.initializeRange; - Object.extend(this.tags, { - THEAD: this.tags.TBODY, - TFOOT: this.tags.TBODY, - TH: this.tags.TD + var tags = Element._insertionTranslations.tags; + Object.extend(tags, { + THEAD: tags.TBODY, + TFOOT: tags.TBODY, + TH: tags.TD }); -}).call(Element._insertionTranslations); +})(); Element.Methods.Simulated = { hasAttribute: function(element, attribute) { attribute = Element._attributeTranslations.has[attribute] || attribute; var node = $(element).getAttributeNode(attribute); - return node && node.specified; + return !!(node && node.specified); } }; @@ -2546,41 +2867,81 @@ Element.Methods.ByTag = { }; Object.extend(Element, Element.Methods); -if (!Prototype.BrowserFeatures.ElementExtensions && - document.createElement('div').__proto__) { - window.HTMLElement = { }; - window.HTMLElement.prototype = document.createElement('div').__proto__; - Prototype.BrowserFeatures.ElementExtensions = true; -} +(function(div) { + + if (!Prototype.BrowserFeatures.ElementExtensions && div['__proto__']) { + window.HTMLElement = { }; + window.HTMLElement.prototype = div['__proto__']; + Prototype.BrowserFeatures.ElementExtensions = true; + } + + div = null; + +})(document.createElement('div')) Element.extend = (function() { - if (Prototype.BrowserFeatures.SpecificElementExtensions) + + function checkDeficiency(tagName) { + if (typeof window.Element != 'undefined') { + var proto = window.Element.prototype; + if (proto) { + var id = '_' + (Math.random()+'').slice(2); + var el = document.createElement(tagName); + proto[id] = 'x'; + var isBuggy = (el[id] !== 'x'); + delete proto[id]; + el = null; + return isBuggy; + } + } + return false; + } + + function extendElementWith(element, methods) { + for (var property in methods) { + var value = methods[property]; + if (Object.isFunction(value) && !(property in element)) + element[property] = value.methodize(); + } + } + + var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = checkDeficiency('object'); + + if (Prototype.BrowserFeatures.SpecificElementExtensions) { + if (HTMLOBJECTELEMENT_PROTOTYPE_BUGGY) { + return function(element) { + if (element && typeof element._extendedByPrototype == 'undefined') { + var t = element.tagName; + if (t && (/^(?:object|applet|embed)$/i.test(t))) { + extendElementWith(element, Element.Methods); + extendElementWith(element, Element.Methods.Simulated); + extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]); + } + } + return element; + } + } return Prototype.K; + } var Methods = { }, ByTag = Element.Methods.ByTag; var extend = Object.extend(function(element) { - if (!element || element._extendedByPrototype || + if (!element || typeof element._extendedByPrototype != 'undefined' || element.nodeType != 1 || element == window) return element; var methods = Object.clone(Methods), - tagName = element.tagName, property, value; + tagName = element.tagName.toUpperCase(); - // extend methods for specific tags if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); - for (property in methods) { - value = methods[property]; - if (Object.isFunction(value) && !(property in element)) - element[property] = value.methodize(); - } + extendElementWith(element, methods); element._extendedByPrototype = Prototype.emptyFunction; return element; }, { refresh: function() { - // extend methods for all tags (Safari doesn't need this) if (!Prototype.BrowserFeatures.ElementExtensions) { Object.extend(Methods, Element.Methods); Object.extend(Methods, Element.Methods.Simulated); @@ -2659,14 +3020,18 @@ Element.addMethods = function(methods) { klass = 'HTML' + tagName.capitalize() + 'Element'; if (window[klass]) return window[klass]; - window[klass] = { }; - window[klass].prototype = document.createElement(tagName).__proto__; - return window[klass]; + var element = document.createElement(tagName); + var proto = element['__proto__'] || element.constructor.prototype; + element = null; + return proto; } + var elementPrototype = window.HTMLElement ? HTMLElement.prototype : + Element.prototype; + if (F.ElementExtensions) { - copy(Element.Methods, HTMLElement.prototype); - copy(Element.Methods.Simulated, HTMLElement.prototype, true); + copy(Element.Methods, elementPrototype); + copy(Element.Methods.Simulated, elementPrototype, true); } if (F.SpecificElementExtensions) { @@ -2680,52 +3045,191 @@ Element.addMethods = function(methods) { Object.extend(Element, Element.Methods); delete Element.ByTag; - if (Element.extend.refresh) Element.extend.refresh(); - Element.cache = { }; -}; + if (Element.extend.refresh) Element.extend.refresh(); + Element.cache = { }; +}; + + +document.viewport = { + + getDimensions: function() { + return { width: this.getWidth(), height: this.getHeight() }; + }, + + getScrollOffsets: function() { + return Element._returnOffset( + window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, + window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); + } +}; + +(function(viewport) { + var B = Prototype.Browser, doc = document, element, property = {}; + + function getRootElement() { + if (B.WebKit && !doc.evaluate) + return document; + + if (B.Opera && window.parseFloat(window.opera.version()) < 9.5) + return document.body; + + return document.documentElement; + } + + function define(D) { + if (!element) element = getRootElement(); + + property[D] = 'client' + D; + + viewport['get' + D] = function() { return element[property[D]] }; + return viewport['get' + D](); + } + + viewport.getWidth = define.curry('Width'); + + viewport.getHeight = define.curry('Height'); +})(document.viewport); + + +Element.Storage = { + UID: 1 +}; + +Element.addMethods({ + getStorage: function(element) { + if (!(element = $(element))) return; + + var uid; + if (element === window) { + uid = 0; + } else { + if (typeof element._prototypeUID === "undefined") + element._prototypeUID = [Element.Storage.UID++]; + uid = element._prototypeUID[0]; + } + + if (!Element.Storage[uid]) + Element.Storage[uid] = $H(); -document.viewport = { - getDimensions: function() { - var dimensions = { }; - $w('width height').each(function(d) { - var D = d.capitalize(); - dimensions[d] = self['inner' + D] || - (document.documentElement['client' + D] || document.body['client' + D]); - }); - return dimensions; + return Element.Storage[uid]; }, - getWidth: function() { - return this.getDimensions().width; + store: function(element, key, value) { + if (!(element = $(element))) return; + + if (arguments.length === 2) { + Element.getStorage(element).update(key); + } else { + Element.getStorage(element).set(key, value); + } + + return element; }, - getHeight: function() { - return this.getDimensions().height; + retrieve: function(element, key, defaultValue) { + if (!(element = $(element))) return; + var hash = Element.getStorage(element), value = hash.get(key); + + if (Object.isUndefined(value)) { + hash.set(key, defaultValue); + value = defaultValue; + } + + return value; }, - getScrollOffsets: function() { - return Element._returnOffset( - window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, - window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); + clone: function(element, deep) { + if (!(element = $(element))) return; + var clone = element.cloneNode(deep); + clone._prototypeUID = void 0; + if (deep) { + var descendants = Element.select(clone, '*'), + i = descendants.length; + while (i--) { + descendants[i]._prototypeUID = void 0; + } + } + return Element.extend(clone); } -}; -/* Portions of the Selector class are derived from Jack Slocum’s DomQuery, +}); +/* Portions of the Selector class are derived from Jack Slocum's DomQuery, * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style * license. Please see http://www.yui-ext.com/ for more information. */ var Selector = Class.create({ initialize: function(expression) { this.expression = expression.strip(); - this.compileMatcher(); + + if (this.shouldUseSelectorsAPI()) { + this.mode = 'selectorsAPI'; + } else if (this.shouldUseXPath()) { + this.mode = 'xpath'; + this.compileXPathMatcher(); + } else { + this.mode = "normal"; + this.compileMatcher(); + } + }, - compileMatcher: function() { - // Selectors with namespaced attributes can't use the XPath version - if (Prototype.BrowserFeatures.XPath && !(/(\[[\w-]*?:|:checked)/).test(this.expression)) - return this.compileXPathMatcher(); + shouldUseXPath: (function() { + var IS_DESCENDANT_SELECTOR_BUGGY = (function(){ + var isBuggy = false; + if (document.evaluate && window.XPathResult) { + var el = document.createElement('div'); + el.innerHTML = '
    '; + + var xpath = ".//*[local-name()='ul' or local-name()='UL']" + + "//*[local-name()='li' or local-name()='LI']"; + + var result = document.evaluate(xpath, el, null, + XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + + isBuggy = (result.snapshotLength !== 2); + el = null; + } + return isBuggy; + })(); + + return function() { + if (!Prototype.BrowserFeatures.XPath) return false; + + var e = this.expression; + + if (Prototype.Browser.WebKit && + (e.include("-of-type") || e.include(":empty"))) + return false; + + if ((/(\[[\w-]*?:|:checked)/).test(e)) + return false; + + if (IS_DESCENDANT_SELECTOR_BUGGY) return false; + + return true; + } + + })(), + + shouldUseSelectorsAPI: function() { + if (!Prototype.BrowserFeatures.SelectorsAPI) return false; + + if (Selector.CASE_INSENSITIVE_CLASS_NAMES) return false; + + if (!Selector._div) Selector._div = new Element('div'); + + try { + Selector._div.querySelector(this.expression); + } catch(e) { + return false; + } + + return true; + }, + + compileMatcher: function() { var e = this.expression, ps = Selector.patterns, h = Selector.handlers, - c = Selector.criteria, le, p, m; + c = Selector.criteria, le, p, m, len = ps.length, name; if (Selector._cache[e]) { this.matcher = Selector._cache[e]; @@ -2737,11 +3241,12 @@ var Selector = Class.create({ while (e && le != e && (/\S/).test(e)) { le = e; - for (var i in ps) { - p = ps[i]; + for (var i = 0; i\s*/, - adjacent: /^\s*\+\s*/, - descendant: /^\s/, + patterns: [ + { name: 'laterSibling', re: /^\s*~\s*/ }, + { name: 'child', re: /^\s*>\s*/ }, + { name: 'adjacent', re: /^\s*\+\s*/ }, + { name: 'descendant', re: /^\s/ }, - // selectors follow - tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, - id: /^#([\w\-\*]+)(\b|$)/, - className: /^\.([\w\-\*]+)(\b|$)/, - pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s)|(?=:))/, - attrPresence: /^\[([\w]+)\]/, - attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ - }, + { name: 'tagName', re: /^\s*(\*|[\w\-]+)(\b|$)?/ }, + { name: 'id', re: /^#([\w\-\*]+)(\b|$)/ }, + { name: 'className', re: /^\.([\w\-\*]+)(\b|$)/ }, + { name: 'pseudo', re: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/ }, + { name: 'attrPresence', re: /^\[((?:[\w-]+:)?[\w-]+)\]/ }, + { name: 'attr', re: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ } + ], - // for Selector.match and Element#match assertions: { tagName: function(element, matches) { return matches[1].toUpperCase() == element.tagName.toUpperCase(); @@ -2986,61 +3522,74 @@ Object.extend(Selector, { attr: function(element, matches) { var nodeValue = Element.readAttribute(element, matches[1]); - return Selector.operators[matches[2]](nodeValue, matches[3]); + return nodeValue && Selector.operators[matches[2]](nodeValue, matches[5] || matches[6]); } }, handlers: { - // UTILITY FUNCTIONS - // joins two collections concat: function(a, b) { for (var i = 0, node; node = b[i]; i++) a.push(node); return a; }, - // marks an array of nodes for counting mark: function(nodes) { + var _true = Prototype.emptyFunction; for (var i = 0, node; node = nodes[i]; i++) - node._counted = true; + node._countedByPrototype = _true; return nodes; }, - unmark: function(nodes) { - for (var i = 0, node; node = nodes[i]; i++) - node._counted = undefined; - return nodes; - }, + unmark: (function(){ + + var PROPERTIES_ATTRIBUTES_MAP = (function(){ + var el = document.createElement('div'), + isBuggy = false, + propName = '_countedByPrototype', + value = 'x' + el[propName] = value; + isBuggy = (el.getAttribute(propName) === value); + el = null; + return isBuggy; + })(); + + return PROPERTIES_ATTRIBUTES_MAP ? + function(nodes) { + for (var i = 0, node; node = nodes[i]; i++) + node.removeAttribute('_countedByPrototype'); + return nodes; + } : + function(nodes) { + for (var i = 0, node; node = nodes[i]; i++) + node._countedByPrototype = void 0; + return nodes; + } + })(), - // mark each child node with its position (for nth calls) - // "ofType" flag indicates whether we're indexing for nth-of-type - // rather than nth-child index: function(parentNode, reverse, ofType) { - parentNode._counted = true; + parentNode._countedByPrototype = Prototype.emptyFunction; if (reverse) { for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { var node = nodes[i]; - if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; + if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; } } else { for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++) - if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; + if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++; } }, - // filters out duplicates and extends all nodes unique: function(nodes) { if (nodes.length == 0) return nodes; var results = [], n; for (var i = 0, l = nodes.length; i < l; i++) - if (!(n = nodes[i])._counted) { - n._counted = true; + if (typeof (n = nodes[i])._countedByPrototype == 'undefined') { + n._countedByPrototype = Prototype.emptyFunction; results.push(Element.extend(n)); } return Selector.handlers.unmark(results); }, - // COMBINATOR FUNCTIONS descendant: function(nodes) { var h = Selector.handlers; for (var i = 0, results = [], node; node = nodes[i]; i++) @@ -3051,7 +3600,7 @@ Object.extend(Selector, { child: function(nodes) { var h = Selector.handlers; for (var i = 0, results = [], node; node = nodes[i]; i++) { - for (var j = 0, children = [], child; child = node.childNodes[j]; j++) + for (var j = 0, child; child = node.childNodes[j]; j++) if (child.nodeType == 1 && child.tagName != '!') results.push(child); } return results; @@ -3074,7 +3623,7 @@ Object.extend(Selector, { nextElementSibling: function(node) { while (node = node.nextSibling) - if (node.nodeType == 1) return node; + if (node.nodeType == 1) return node; return null; }, @@ -3084,13 +3633,11 @@ Object.extend(Selector, { return null; }, - // TOKEN FUNCTIONS tagName: function(nodes, root, tagName, combinator) { - tagName = tagName.toUpperCase(); + var uTagName = tagName.toUpperCase(); var results = [], h = Selector.handlers; if (nodes) { if (combinator) { - // fastlane for ordinary descendant combinators if (combinator == "descendant") { for (var i = 0, node; node = nodes[i]; i++) h.concat(results, node.getElementsByTagName(tagName)); @@ -3099,15 +3646,26 @@ Object.extend(Selector, { if (tagName == "*") return nodes; } for (var i = 0, node; node = nodes[i]; i++) - if (node.tagName.toUpperCase() == tagName) results.push(node); + if (node.tagName.toUpperCase() === uTagName) results.push(node); return results; } else return root.getElementsByTagName(tagName); }, id: function(nodes, root, id, combinator) { var targetNode = $(id), h = Selector.handlers; - if (!targetNode) return []; - if (!nodes && root == document) return [targetNode]; + + if (root == document) { + if (!targetNode) return []; + if (!nodes) return [targetNode]; + } else { + if (!root.sourceIndex || root.sourceIndex < 1) { + var nodes = root.getElementsByTagName('*'); + for (var j = 0, node; node = nodes[j]; j++) { + if (node.id === id) return [node]; + } + } + } + if (nodes) { if (combinator) { if (combinator == 'child') { @@ -3146,16 +3704,18 @@ Object.extend(Selector, { return results; }, - attrPresence: function(nodes, root, attr) { + attrPresence: function(nodes, root, attr, combinator) { if (!nodes) nodes = root.getElementsByTagName("*"); + if (nodes && combinator) nodes = this[combinator](nodes); var results = []; for (var i = 0, node; node = nodes[i]; i++) if (Element.hasAttribute(node, attr)) results.push(node); return results; }, - attr: function(nodes, root, attr, value, operator) { + attr: function(nodes, root, attr, value, operator, combinator) { if (!nodes) nodes = root.getElementsByTagName("*"); + if (nodes && combinator) nodes = this[combinator](nodes); var handler = Selector.operators[operator], results = []; for (var i = 0, node; node = nodes[i]; i++) { var nodeValue = Element.readAttribute(node, attr); @@ -3217,7 +3777,6 @@ Object.extend(Selector, { return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root); }, - // handles the an+b logic getIndices: function(a, b, total) { if (a == 0) return b > 0 ? [b] : []; return $R(1, total).inject([], function(memo, i) { @@ -3226,7 +3785,6 @@ Object.extend(Selector, { }); }, - // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type nth: function(nodes, formula, root, reverse, ofType) { if (nodes.length == 0) return []; if (formula == 'even') formula = '2n+0'; @@ -3234,7 +3792,7 @@ Object.extend(Selector, { var h = Selector.handlers, results = [], indexed = [], m; h.mark(nodes); for (var i = 0, node; node = nodes[i]; i++) { - if (!node.parentNode._counted) { + if (!node.parentNode._countedByPrototype) { h.index(node.parentNode, reverse, ofType); indexed.push(node.parentNode); } @@ -3260,8 +3818,7 @@ Object.extend(Selector, { 'empty': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) { - // IE treats comments as element nodes - if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue; + if (node.tagName == '!' || node.firstChild) continue; results.push(node); } return results; @@ -3272,14 +3829,15 @@ Object.extend(Selector, { var exclusions = new Selector(selector).findElements(root); h.mark(exclusions); for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!node._counted) results.push(node); + if (!node._countedByPrototype) results.push(node); h.unmark(exclusions); return results; }, 'enabled': function(nodes, value, root) { for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!node.disabled) results.push(node); + if (!node.disabled && (!node.type || node.type !== 'hidden')) + results.push(node); return results; }, @@ -3299,18 +3857,27 @@ Object.extend(Selector, { operators: { '=': function(nv, v) { return nv == v; }, '!=': function(nv, v) { return nv != v; }, - '^=': function(nv, v) { return nv.startsWith(v); }, - '$=': function(nv, v) { return nv.endsWith(v); }, - '*=': function(nv, v) { return nv.include(v); }, + '^=': function(nv, v) { return nv == v || nv && nv.startsWith(v); }, + '$=': function(nv, v) { return nv == v || nv && nv.endsWith(v); }, + '*=': function(nv, v) { return nv == v || nv && nv.include(v); }, '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); }, - '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); } + '|=': function(nv, v) { return ('-' + (nv || "").toUpperCase() + + '-').include('-' + (v || "").toUpperCase() + '-'); } + }, + + split: function(expression) { + var expressions = []; + expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { + expressions.push(m[1].strip()); + }); + return expressions; }, matchElements: function(elements, expression) { - var matches = new Selector(expression).findElements(), h = Selector.handlers; + var matches = $$(expression), h = Selector.handlers; h.mark(matches); for (var i = 0, results = [], element; element = elements[i]; i++) - if (element._counted) results.push(element); + if (element._countedByPrototype) results.push(element); h.unmark(matches); return results; }, @@ -3323,10 +3890,7 @@ Object.extend(Selector, { }, findChildElements: function(element, expressions) { - var exprs = expressions.join(','), expressions = []; - exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { - expressions.push(m[1].strip()); - }); + expressions = Selector.split(expressions.join(',')); var results = [], h = Selector.handlers; for (var i = 0, l = expressions.length, selector; i < l; i++) { selector = new Selector(expressions[i].strip()); @@ -3336,27 +3900,38 @@ Object.extend(Selector, { } }); +if (Prototype.Browser.IE) { + Object.extend(Selector.handlers, { + concat: function(a, b) { + for (var i = 0, node; node = b[i]; i++) + if (node.tagName !== "!") a.push(node); + return a; + } + }); +} + function $$() { return Selector.findChildElements(document, $A(arguments)); } + var Form = { reset: function(form) { - $(form).reset(); + form = $(form); + form.reset(); return form; }, serializeElements: function(elements, options) { if (typeof options != 'object') options = { hash: !!options }; - else if (options.hash === undefined) options.hash = true; + else if (Object.isUndefined(options.hash)) options.hash = true; var key, value, submitted = false, submit = options.submit; var data = elements.inject({ }, function(result, element) { if (!element.disabled && element.name) { key = element.name; value = $(element).getValue(); - if (value != null && (element.type != 'submit' || (!submitted && + if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && submit !== false && (!submit || key == submit) && (submitted = true)))) { if (key in result) { - // a key is already present; construct an array of values if (!Object.isArray(result[key])) result[key] = [result[key]]; result[key].push(value); } @@ -3376,13 +3951,18 @@ Form.Methods = { }, getElements: function(form) { - return $A($(form).getElementsByTagName('*')).inject([], - function(elements, child) { - if (Form.Element.Serializers[child.tagName.toLowerCase()]) - elements.push(Element.extend(child)); - return elements; - } - ); + var elements = $(form).getElementsByTagName('*'), + element, + arr = [ ], + serializers = Form.Element.Serializers; + for (var i = 0; element = elements[i]; i++) { + arr.push(element); + } + return arr.inject([], function(elements, child) { + if (serializers[child.tagName.toLowerCase()]) + elements.push(Element.extend(child)); + return elements; + }) }, getInputs: function(form, typeName, name) { @@ -3422,7 +4002,7 @@ Form.Methods = { }).sortBy(function(element) { return element.tabIndex }).first(); return firstByIndex ? firstByIndex : elements.find(function(element) { - return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); + return /^(?:input|select|textarea)$/i.test(element.tagName); }); }, @@ -3453,6 +4033,7 @@ Form.Methods = { /*--------------------------------------------------------------------------*/ + Form.Element = { focus: function(element) { $(element).focus(); @@ -3466,6 +4047,7 @@ Form.Element = { }; Form.Element.Methods = { + serialize: function(element) { element = $(element); if (!element.disabled && element.name) { @@ -3506,7 +4088,7 @@ Form.Element.Methods = { try { element.focus(); if (element.select && (element.tagName.toLowerCase() != 'input' || - !['button', 'reset', 'submit'].include(element.type))) + !(/^(?:button|reset|submit)$/i.test(element.type)))) element.select(); } catch (e) { } return element; @@ -3514,7 +4096,6 @@ Form.Element.Methods = { disable: function(element) { element = $(element); - element.blur(); element.disabled = true; return element; }, @@ -3529,6 +4110,7 @@ Form.Element.Methods = { /*--------------------------------------------------------------------------*/ var Field = Form.Element; + var $F = Form.Element.Methods.getValue; /*--------------------------------------------------------------------------*/ @@ -3545,31 +4127,31 @@ Form.Element.Serializers = { }, inputSelector: function(element, value) { - if (value === undefined) return element.checked ? element.value : null; + if (Object.isUndefined(value)) return element.checked ? element.value : null; else element.checked = !!value; }, textarea: function(element, value) { - if (value === undefined) return element.value; + if (Object.isUndefined(value)) return element.value; else element.value = value; }, - select: function(element, index) { - if (index === undefined) + select: function(element, value) { + if (Object.isUndefined(value)) return this[element.type == 'select-one' ? 'selectOne' : 'selectMany'](element); else { - var opt, value, single = !Object.isArray(index); + var opt, currentValue, single = !Object.isArray(value); for (var i = 0, length = element.length; i < length; i++) { opt = element.options[i]; - value = this.optionValue(opt); + currentValue = this.optionValue(opt); if (single) { - if (value == index) { + if (currentValue == value) { opt.selected = true; return; } } - else opt.selected = index.include(value); + else opt.selected = value.include(currentValue); } } }, @@ -3591,13 +4173,13 @@ Form.Element.Serializers = { }, optionValue: function(opt) { - // extend element because hasAttribute may not be native return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; } }; /*--------------------------------------------------------------------------*/ + Abstract.TimedObserver = Class.create(PeriodicalExecuter, { initialize: function($super, element, frequency, callback) { $super(callback, frequency); @@ -3679,321 +4261,441 @@ Form.EventObserver = Class.create(Abstract.EventObserver, { return Form.serialize(this.element); } }); -if (!window.Event) var Event = { }; - -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, - KEY_HOME: 36, - KEY_END: 35, - KEY_PAGEUP: 33, - KEY_PAGEDOWN: 34, - KEY_INSERT: 45, - - cache: { }, - - relatedTarget: function(event) { - var element; - switch(event.type) { - case 'mouseover': element = event.fromElement; break; - case 'mouseout': element = event.toElement; break; - default: return null; - } - return Element.extend(element); - } -}); +(function() { + + var 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, + KEY_HOME: 36, + KEY_END: 35, + KEY_PAGEUP: 33, + KEY_PAGEDOWN: 34, + KEY_INSERT: 45, + + cache: {} + }; -Event.Methods = (function() { - var isButton; + var docEl = document.documentElement; + var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl + && 'onmouseleave' in docEl; + var _isButton; if (Prototype.Browser.IE) { var buttonMap = { 0: 1, 1: 4, 2: 2 }; - isButton = function(event, code) { - return event.button == buttonMap[code]; + _isButton = function(event, code) { + return event.button === buttonMap[code]; }; - } else if (Prototype.Browser.WebKit) { - isButton = function(event, code) { + _isButton = function(event, code) { switch (code) { case 0: return event.which == 1 && !event.metaKey; case 1: return event.which == 1 && event.metaKey; default: return false; } }; - } else { - isButton = function(event, code) { + _isButton = function(event, code) { return event.which ? (event.which === code + 1) : (event.button === code); }; } - return { - isLeftClick: function(event) { return isButton(event, 0) }, - isMiddleClick: function(event) { return isButton(event, 1) }, - isRightClick: function(event) { return isButton(event, 2) }, + function isLeftClick(event) { return _isButton(event, 0) } - element: function(event) { - var node = Event.extend(event).target; - return Element.extend(node.nodeType == Node.TEXT_NODE ? node.parentNode : node); - }, + function isMiddleClick(event) { return _isButton(event, 1) } - findElement: function(event, expression) { - var element = Event.element(event); - return element.match(expression) ? element : element.up(expression); - }, + function isRightClick(event) { return _isButton(event, 2) } - pointer: function(event) { - return { - x: event.pageX || (event.clientX + - (document.documentElement.scrollLeft || document.body.scrollLeft)), - y: event.pageY || (event.clientY + - (document.documentElement.scrollTop || document.body.scrollTop)) - }; - }, + function element(event) { + event = Event.extend(event); - pointerX: function(event) { return Event.pointer(event).x }, - pointerY: function(event) { return Event.pointer(event).y }, + var node = event.target, type = event.type, + currentTarget = event.currentTarget; - stop: function(event) { - Event.extend(event); - event.preventDefault(); - event.stopPropagation(); - event.stopped = true; + if (currentTarget && currentTarget.tagName) { + if (type === 'load' || type === 'error' || + (type === 'click' && currentTarget.tagName.toLowerCase() === 'input' + && currentTarget.type === 'radio')) + node = currentTarget; } + + if (node.nodeType == Node.TEXT_NODE) + node = node.parentNode; + + return Element.extend(node); + } + + function findElement(event, expression) { + var element = Event.element(event); + if (!expression) return element; + var elements = [element].concat(element.ancestors()); + return Selector.findElement(elements, expression, 0); + } + + function pointer(event) { + return { x: pointerX(event), y: pointerY(event) }; + } + + function pointerX(event) { + var docElement = document.documentElement, + body = document.body || { scrollLeft: 0 }; + + return event.pageX || (event.clientX + + (docElement.scrollLeft || body.scrollLeft) - + (docElement.clientLeft || 0)); + } + + function pointerY(event) { + var docElement = document.documentElement, + body = document.body || { scrollTop: 0 }; + + return event.pageY || (event.clientY + + (docElement.scrollTop || body.scrollTop) - + (docElement.clientTop || 0)); + } + + + function stop(event) { + Event.extend(event); + event.preventDefault(); + event.stopPropagation(); + + event.stopped = true; + } + + Event.Methods = { + isLeftClick: isLeftClick, + isMiddleClick: isMiddleClick, + isRightClick: isRightClick, + + element: element, + findElement: findElement, + + pointer: pointer, + pointerX: pointerX, + pointerY: pointerY, + + stop: stop }; -})(); -Event.extend = (function() { + var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { m[name] = Event.Methods[name].methodize(); return m; }); if (Prototype.Browser.IE) { + function _relatedTarget(event) { + var element; + switch (event.type) { + case 'mouseover': element = event.fromElement; break; + case 'mouseout': element = event.toElement; break; + default: return null; + } + return Element.extend(element); + } + Object.extend(methods, { stopPropagation: function() { this.cancelBubble = true }, preventDefault: function() { this.returnValue = false }, - inspect: function() { return "[object Event]" } + inspect: function() { return '[object Event]' } }); - return function(event) { + Event.extend = function(event, element) { if (!event) return false; if (event._extendedByPrototype) return event; event._extendedByPrototype = Prototype.emptyFunction; var pointer = Event.pointer(event); + Object.extend(event, { - target: event.srcElement, - relatedTarget: Event.relatedTarget(event), + target: event.srcElement || element, + relatedTarget: _relatedTarget(event), pageX: pointer.x, pageY: pointer.y }); + return Object.extend(event, methods); }; - } else { - Event.prototype = Event.prototype || document.createEvent("HTMLEvents").__proto__; + Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__; Object.extend(Event.prototype, methods); - return Prototype.K; + Event.extend = Prototype.K; } -})(); - -Object.extend(Event, (function() { - var cache = Event.cache; - function getEventID(element) { - if (element._eventID) return element._eventID; - arguments.callee.id = arguments.callee.id || 1; - return element._eventID = ++arguments.callee.id; - } + function _createResponder(element, eventName, handler) { + var registry = Element.retrieve(element, 'prototype_event_registry'); - function getDOMEventName(eventName) { - if (eventName && eventName.include(':')) return "dataavailable"; - return eventName; - } + if (Object.isUndefined(registry)) { + CACHE.push(element); + registry = Element.retrieve(element, 'prototype_event_registry', $H()); + } - function getCacheForID(id) { - return cache[id] = cache[id] || { }; - } + var respondersForEvent = registry.get(eventName); + if (Object.isUndefined(respondersForEvent)) { + respondersForEvent = []; + registry.set(eventName, respondersForEvent); + } - function getWrappersForEventName(id, eventName) { - var c = getCacheForID(id); - return c[eventName] = c[eventName] || []; - } + if (respondersForEvent.pluck('handler').include(handler)) return false; - function createWrapper(element, eventName, handler) { - var id = getEventID(element); - var c = getWrappersForEventName(id, eventName); - if (c.pluck("handler").include(handler)) return false; + var responder; + if (eventName.include(":")) { + responder = function(event) { + if (Object.isUndefined(event.eventName)) + return false; - var wrapper = function(event) { - if (!Event || !Event.extend || - (event.eventName && event.eventName != eventName)) + if (event.eventName !== eventName) return false; - Event.extend(event); - handler.call(element, event) - }; + Event.extend(event, element); + handler.call(element, event); + }; + } else { + if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED && + (eventName === "mouseenter" || eventName === "mouseleave")) { + if (eventName === "mouseenter" || eventName === "mouseleave") { + responder = function(event) { + Event.extend(event, element); + + var parent = event.relatedTarget; + while (parent && parent !== element) { + try { parent = parent.parentNode; } + catch(e) { parent = element; } + } - wrapper.handler = handler; - c.push(wrapper); - return wrapper; - } + if (parent === element) return; - function findWrapper(id, eventName, handler) { - var c = getWrappersForEventName(id, eventName); - return c.find(function(wrapper) { return wrapper.handler == handler }); - } + handler.call(element, event); + }; + } + } else { + responder = function(event) { + Event.extend(event, element); + handler.call(element, event); + }; + } + } - function destroyWrapper(id, eventName, handler) { - var c = getCacheForID(id); - if (!c[eventName]) return false; - c[eventName] = c[eventName].without(findWrapper(id, eventName, handler)); + responder.handler = handler; + respondersForEvent.push(responder); + return responder; } - function destroyCache() { - for (var id in cache) - for (var eventName in cache[id]) - cache[id][eventName] = null; + function _destroyCache() { + for (var i = 0, length = CACHE.length; i < length; i++) { + Event.stopObserving(CACHE[i]); + CACHE[i] = null; + } } - if (window.attachEvent) { - window.attachEvent("onunload", destroyCache); + var CACHE = []; + + if (Prototype.Browser.IE) + window.attachEvent('onunload', _destroyCache); + + if (Prototype.Browser.WebKit) + window.addEventListener('unload', Prototype.emptyFunction, false); + + + var _getDOMEventName = Prototype.K; + + if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) { + _getDOMEventName = function(eventName) { + var translations = { mouseenter: "mouseover", mouseleave: "mouseout" }; + return eventName in translations ? translations[eventName] : eventName; + }; } - return { - observe: function(element, eventName, handler) { - element = $(element); - var name = getDOMEventName(eventName); + function observe(element, eventName, handler) { + element = $(element); - var wrapper = createWrapper(element, eventName, handler); - if (!wrapper) return element; + var responder = _createResponder(element, eventName, handler); - if (element.addEventListener) { - element.addEventListener(name, wrapper, false); - } else { - element.attachEvent("on" + name, wrapper); + if (!responder) return element; + + if (eventName.include(':')) { + if (element.addEventListener) + element.addEventListener("dataavailable", responder, false); + else { + element.attachEvent("ondataavailable", responder); + element.attachEvent("onfilterchange", responder); } + } else { + var actualEventName = _getDOMEventName(eventName); - return element; - }, + if (element.addEventListener) + element.addEventListener(actualEventName, responder, false); + else + element.attachEvent("on" + actualEventName, responder); + } - stopObserving: function(element, eventName, handler) { - element = $(element); - var id = getEventID(element), name = getDOMEventName(eventName); + return element; + } - if (!handler && eventName) { - getWrappersForEventName(id, eventName).each(function(wrapper) { - element.stopObserving(eventName, wrapper.handler); - }); - return element; + function stopObserving(element, eventName, handler) { + element = $(element); - } else if (!eventName) { - Object.keys(getCacheForID(id)).each(function(eventName) { - element.stopObserving(eventName); - }); - return element; - } + var registry = Element.retrieve(element, 'prototype_event_registry'); - var wrapper = findWrapper(id, eventName, handler); - if (!wrapper) return element; + if (Object.isUndefined(registry)) return element; - if (element.removeEventListener) { - element.removeEventListener(name, wrapper, false); - } else { - element.detachEvent("on" + name, wrapper); - } + if (eventName && !handler) { + var responders = registry.get(eventName); - destroyWrapper(id, eventName, handler); + if (Object.isUndefined(responders)) return element; + responders.each( function(r) { + Element.stopObserving(element, eventName, r.handler); + }); return element; - }, + } else if (!eventName) { + registry.each( function(pair) { + var eventName = pair.key, responders = pair.value; - fire: function(element, eventName, memo) { - element = $(element); - if (element == document && document.createEvent && !element.dispatchEvent) - element = document.documentElement; + responders.each( function(r) { + Element.stopObserving(element, eventName, r.handler); + }); + }); + return element; + } - if (document.createEvent) { - var event = document.createEvent("HTMLEvents"); - event.initEvent("dataavailable", true, true); - } else { - var event = document.createEventObject(); - event.eventType = "ondataavailable"; - } + var responders = registry.get(eventName); - event.eventName = eventName; - event.memo = memo || { }; + if (!responders) return; - if (document.createEvent) { - element.dispatchEvent(event); - } else { - element.fireEvent(event.eventType, event); + var responder = responders.find( function(r) { return r.handler === handler; }); + if (!responder) return element; + + var actualEventName = _getDOMEventName(eventName); + + if (eventName.include(':')) { + if (element.removeEventListener) + element.removeEventListener("dataavailable", responder, false); + else { + element.detachEvent("ondataavailable", responder); + element.detachEvent("onfilterchange", responder); } + } else { + if (element.removeEventListener) + element.removeEventListener(actualEventName, responder, false); + else + element.detachEvent('on' + actualEventName, responder); + } + + registry.set(eventName, responders.without(responder)); + + return element; + } + + function fire(element, eventName, memo, bubble) { + element = $(element); + + if (Object.isUndefined(bubble)) + bubble = true; - return event; + if (element == document && document.createEvent && !element.dispatchEvent) + element = document.documentElement; + + var event; + if (document.createEvent) { + event = document.createEvent('HTMLEvents'); + event.initEvent('dataavailable', true, true); + } else { + event = document.createEventObject(); + event.eventType = bubble ? 'ondataavailable' : 'onfilterchange'; } - }; -})()); -Object.extend(Event, Event.Methods); + event.eventName = eventName; + event.memo = memo || { }; -Element.addMethods({ - fire: Event.fire, - observe: Event.observe, - stopObserving: Event.stopObserving -}); + if (document.createEvent) + element.dispatchEvent(event); + else + element.fireEvent(event.eventType, event); -Object.extend(document, { - fire: Element.Methods.fire.methodize(), - observe: Element.Methods.observe.methodize(), - stopObserving: Element.Methods.stopObserving.methodize() -}); + return Event.extend(event); + } + + + Object.extend(Event, Event.Methods); + + Object.extend(Event, { + fire: fire, + observe: observe, + stopObserving: stopObserving + }); + + Element.addMethods({ + fire: fire, + + observe: observe, + + stopObserving: stopObserving + }); + + Object.extend(document, { + fire: fire.methodize(), + + observe: observe.methodize(), + + stopObserving: stopObserving.methodize(), + + loaded: false + }); + + if (window.Event) Object.extend(window.Event, Event); + else window.Event = Event; +})(); (function() { /* Support for the DOMContentLoaded event is based on work by Dan Webb, - Matthias Miller, Dean Edwards and John Resig. */ + Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */ - var timer, fired = false; + var timer; function fireContentLoadedEvent() { - if (fired) return; - if (timer) window.clearInterval(timer); - document.fire("dom:loaded"); - fired = true; + if (document.loaded) return; + if (timer) window.clearTimeout(timer); + document.loaded = true; + document.fire('dom:loaded'); } - if (document.addEventListener) { - if (Prototype.Browser.WebKit) { - timer = window.setInterval(function() { - if (/loaded|complete/.test(document.readyState)) - fireContentLoadedEvent(); - }, 0); - - Event.observe(window, "load", fireContentLoadedEvent); + function checkReadyState() { + if (document.readyState === 'complete') { + document.stopObserving('readystatechange', checkReadyState); + fireContentLoadedEvent(); + } + } - } else { - document.addEventListener("DOMContentLoaded", - fireContentLoadedEvent, false); + function pollDoScroll() { + try { document.documentElement.doScroll('left'); } + catch(e) { + timer = pollDoScroll.defer(); + return; } + fireContentLoadedEvent(); + } + if (document.addEventListener) { + document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false); } else { - document.write("'); + try{ + // inserting via DOM fails in Safari 2.0, so brute force approach + document.write(' + - + @@ -240,7 +240,7 @@ wp_admin_css( 'wp-admin', true );

    ()

    -

    by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.'), '') ?>

    +

    by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.'), '') ?>

    Moxiecode Systems AB, All rights reserved.') ?>

    TinyMCE website.') ?>

    diff --git a/wp-includes/js/tinymce/wp-tinymce.js b/wp-includes/js/tinymce/wp-tinymce.js deleted file mode 100644 index 58c14caa..00000000 --- a/wp-includes/js/tinymce/wp-tinymce.js +++ /dev/null @@ -1,28 +0,0 @@ -//core -var tinymce={majorVersion:"3",minorVersion:"2.7",releaseDate:"2009-09-22",_init:function(){var o=this,k=document,l=window,j=navigator,b=j.userAgent,h,a,g,f,e,m;o.isOpera=l.opera&&opera.buildNumber;o.isWebKit=/WebKit/.test(b);o.isIE=!o.isWebKit&&!o.isOpera&&(/MSIE/gi).test(b)&&(/Explorer/gi).test(j.appName);o.isIE6=o.isIE&&/MSIE [56]/.test(b);o.isGecko=!o.isWebKit&&/Gecko/.test(b);o.isMac=b.indexOf("Mac")!=-1;o.isAir=/adobeair/i.test(b);if(l.tinyMCEPreInit){o.suffix=tinyMCEPreInit.suffix;o.baseURL=tinyMCEPreInit.base;o.query=tinyMCEPreInit.query;return}o.suffix="";a=k.getElementsByTagName("base");for(h=0;h=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();tinymce.create("static tinymce.util.JSON",{serialize:function(e){var c,a,d=tinymce.util.JSON.serialize,b;if(e==null){return"null"}b=typeof e;if(b=="string"){a="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+e.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(g,f){c=a.indexOf(f);if(c+1){return"\\"+a.charAt(c+1)}g=f.charCodeAt().toString(16);return"\\u"+"0000".substring(g.length)+g})+'"'}if(b=="object"){if(e.hasOwnProperty&&e instanceof Array){for(c=0,a="[";c0?",":"")+d(e[c])}return a+"]"}a="{";for(c in e){a+=typeof e[c]!="function"?(a.length>1?',"':'"')+c+'":'+d(e[c]):""}return a+"}"}return""+e},parse:function(s){try{return eval("("+s+")")}catch(ex){}}});tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){e.call(f.error_scope||f.scope,h,g)};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(c){var e=c.each,b=c.is;var d=c.isWebKit,a=c.isIE;c.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(i,g){var f=this;f.doc=i;f.win=window;f.files={};f.cssFlicker=false;f.counter=0;f.boxModel=!c.isIE||i.compatMode=="CSS1Compat";f.stdMode=i.documentMode===8;f.settings=g=c.extend({keep_values:false,hex_colors:1,process_html:1},g);if(c.isIE6){try{i.execCommand("BackgroundImageCache",false,true)}catch(h){f.cssFlicker=true}}c.addUnload(f.destroy,f)},getRoot:function(){var f=this,g=f.settings;return(g&&f.get(g.root_element))||f.doc.body},getViewPort:function(g){var h,f;g=!g?this.win:g;h=g.document;f=this.boxModel?h.documentElement:h.body;return{x:g.pageXOffset||f.scrollLeft,y:g.pageYOffset||f.scrollTop,w:g.innerWidth||f.clientWidth,h:g.innerHeight||f.clientHeight}},getRect:function(i){var h,f=this,g;i=f.get(i);h=f.getPos(i);g=f.getSize(i);return{x:h.x,y:h.y,w:g.w,h:g.h}},getSize:function(j){var g=this,f,i;j=g.get(j);f=g.getStyle(j,"width");i=g.getStyle(j,"height");if(f.indexOf("px")===-1){f=0}if(i.indexOf("px")===-1){i=0}return{w:parseInt(f)||j.offsetWidth||j.clientWidth,h:parseInt(i)||j.offsetHeight||j.clientHeight}},getParent:function(i,h,g){return this.getParents(i,h,g,false)},getParents:function(p,k,i,m){var h=this,g,j=h.settings,l=[];p=h.get(p);m=m===undefined;if(j.strict_root){i=i||h.getRoot()}if(b(k,"string")){g=k;if(k==="*"){k=function(f){return f.nodeType==1}}else{k=function(f){return h.is(f,g)}}}while(p){if(p==i||!p.nodeType||p.nodeType===9){break}if(!k||k(p)){if(m){l.push(p)}else{return p}}p=p.parentNode}return m?l:null},get:function(f){var g;if(f&&this.doc&&typeof(f)=="string"){g=f;f=this.doc.getElementById(f);if(f&&f.id!==g){return this.doc.getElementsByName(g)[1]}}return f},getNext:function(g,f){return this._findSib(g,f,"nextSibling")},getPrev:function(g,f){return this._findSib(g,f,"previousSibling")},select:function(h,g){var f=this;return c.dom.Sizzle(h,f.get(g)||f.get(f.settings.root_element)||f.doc,[])},is:function(g,f){return c.dom.Sizzle.matches(f,g.nodeType?[g]:g).length>0},add:function(j,l,f,i,k){var g=this;return this.run(j,function(n){var m,h;m=b(l,"string")?g.doc.createElement(l):l;g.setAttribs(m,f);if(i){if(i.nodeType){m.appendChild(i)}else{g.setHTML(m,i)}}return !k?n.appendChild(m):m})},create:function(i,f,g){return this.add(this.doc.createElement(i),i,f,g,1)},createHTML:function(m,f,j){var l="",i=this,g;l+="<"+m;for(g in f){if(f.hasOwnProperty(g)){l+=" "+g+'="'+i.encode(f[g])+'"'}}if(c.is(j)){return l+">"+j+""}return l+" />"},remove:function(h,f){var g=this;return this.run(h,function(m){var l,k,j;l=m.parentNode;if(!l){return null}if(f){for(j=m.childNodes.length-1;j>=0;j--){g.insertAfter(m.childNodes[j],m)}}if(g.fixPsuedoLeaks){l=m.cloneNode(true);f="IELeakGarbageBin";k=g.get(f)||g.add(g.doc.body,"div",{id:f,style:"display:none"});k.appendChild(m);k.innerHTML="";return l}return l.removeChild(m)})},setStyle:function(i,f,g){var h=this;return h.run(i,function(l){var k,j;k=l.style;f=f.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(h.pixelStyles.test(f)&&(c.is(g,"number")||/^[\-0-9\.]+$/.test(g))){g+="px"}switch(f){case"opacity":if(a){k.filter=g===""?"":"alpha(opacity="+(g*100)+")";if(!i.currentStyle||!i.currentStyle.hasLayout){k.display="inline-block"}}k[f]=k["-moz-opacity"]=k["-khtml-opacity"]=g||"";break;case"float":a?k.styleFloat=g:k.cssFloat=g;break;default:k[f]=g||""}if(h.settings.update_styles){h.setAttrib(l,"mce_style")}})},getStyle:function(i,f,h){i=this.get(i);if(!i){return false}if(this.doc.defaultView&&h){f=f.replace(/[A-Z]/g,function(j){return"-"+j});try{return this.doc.defaultView.getComputedStyle(i,null).getPropertyValue(f)}catch(g){return null}}f=f.replace(/-(\D)/g,function(k,j){return j.toUpperCase()});if(f=="float"){f=a?"styleFloat":"cssFloat"}if(i.currentStyle&&h){return i.currentStyle[f]}return i.style[f]},setStyles:function(i,j){var g=this,h=g.settings,f;f=h.update_styles;h.update_styles=0;e(j,function(k,l){g.setStyle(i,l,k)});h.update_styles=f;if(h.update_styles){g.setAttrib(i,h.cssText)}},setAttrib:function(h,i,f){var g=this;if(!h||!i){return}if(g.settings.strict){i=i.toLowerCase()}return this.run(h,function(k){var j=g.settings;switch(i){case"style":if(!b(f,"string")){e(f,function(l,m){g.setStyle(k,m,l)});return}if(j.keep_values){if(f&&!g._isRes(f)){k.setAttribute("mce_style",f,2)}else{k.removeAttribute("mce_style",2)}}k.style.cssText=f;break;case"class":k.className=f||"";break;case"src":case"href":if(j.keep_values){if(j.url_converter){f=j.url_converter.call(j.url_converter_scope||g,f,i,k)}g.setAttrib(k,"mce_"+i,f,2)}break;case"shape":k.setAttribute("mce_style",f);break}if(b(f)&&f!==null&&f.length!==0){k.setAttribute(i,""+f,2)}else{k.removeAttribute(i,2)}})},setAttribs:function(g,h){var f=this;return this.run(g,function(i){e(h,function(j,k){f.setAttrib(i,k,j)})})},getAttrib:function(i,j,h){var f,g=this;i=g.get(i);if(!i||i.nodeType!==1){return false}if(!b(h)){h=""}if(/^(src|href|style|coords|shape)$/.test(j)){f=i.getAttribute("mce_"+j);if(f){return f}}if(a&&g.props[j]){f=i[g.props[j]];f=f&&f.nodeValue?f.nodeValue:f}if(!f){f=i.getAttribute(j,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(j)){if(i[g.props[j]]===true&&f===""){return j}return f?j:""}if(i.nodeName==="FORM"&&i.getAttributeNode(j)){return i.getAttributeNode(j).nodeValue}if(j==="style"){f=f||i.style.cssText;if(f){f=g.serializeStyle(g.parseStyle(f));if(g.settings.keep_values&&!g._isRes(f)){i.setAttribute("mce_style",f)}}}if(d&&j==="class"&&f){f=f.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(a){switch(j){case"rowspan":case"colspan":if(f===1){f=""}break;case"size":if(f==="+0"||f===20||f===0){f=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(f===0){f=""}break;case"hspace":if(f===-1){f=""}break;case"maxlength":case"tabindex":if(f===32768||f===2147483647||f==="32768"){f=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(f===65535){return j}return h;case"shape":f=f.toLowerCase();break;default:if(j.indexOf("on")===0&&f){f=(""+f).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1")}}}return(f!==undefined&&f!==null&&f!=="")?""+f:h},getPos:function(m,i){var g=this,f=0,l=0,j,k=g.doc,h;m=g.get(m);i=i||k.body;if(m){if(a&&!g.stdMode){m=m.getBoundingClientRect();j=g.boxModel?k.documentElement:k.body;f=g.getStyle(g.select("html")[0],"borderWidth");f=(f=="medium"||g.boxModel&&!g.isIE6)&&2||f;m.top+=g.win.self!=g.win.top?2:0;return{x:m.left+j.scrollLeft-f,y:m.top+j.scrollTop-f}}h=m;while(h&&h!=i&&h.nodeType){f+=h.offsetLeft||0;l+=h.offsetTop||0;h=h.offsetParent}h=m.parentNode;while(h&&h!=i&&h.nodeType){f-=h.scrollLeft||0;l-=h.scrollTop||0;h=h.parentNode}}return{x:f,y:l}},parseStyle:function(h){var i=this,j=i.settings,k={};if(!h){return k}function f(w,q,v){var o,u,m,n;o=k[w+"-top"+q];if(!o){return}u=k[w+"-right"+q];if(o!=u){return}m=k[w+"-bottom"+q];if(u!=m){return}n=k[w+"-left"+q];if(m!=n){return}k[v]=n;delete k[w+"-top"+q];delete k[w+"-right"+q];delete k[w+"-bottom"+q];delete k[w+"-left"+q]}function g(n,m,l,p){var o;o=k[m];if(!o){return}o=k[l];if(!o){return}o=k[p];if(!o){return}k[n]=k[m]+" "+k[l]+" "+k[p];delete k[m];delete k[l];delete k[p]}h=h.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");e(h.split(";"),function(m){var l,n=[];if(m){m=m.replace(/_MCE_SEMI_/g,";");m=m.replace(/url\([^\)]+\)/g,function(o){n.push(o);return"url("+n.length+")"});m=m.split(":");l=c.trim(m[1]);l=l.replace(/url\(([^\)]+)\)/g,function(p,o){return n[parseInt(o)-1]});l=l.replace(/rgb\([^\)]+\)/g,function(o){return i.toHex(o)});if(j.url_converter){l=l.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(o,p){return"url("+j.url_converter.call(j.url_converter_scope||i,i.decode(p),"style",null)+")"})}k[c.trim(m[0]).toLowerCase()]=l}});f("border","","border");f("border","-width","border-width");f("border","-color","border-color");f("border","-style","border-style");f("padding","","padding");f("margin","","margin");g("border","border-width","border-style","border-color");if(a){if(k.border=="medium none"){k.border=""}}return k},serializeStyle:function(g){var f="";e(g,function(i,h){if(h&&i){if(c.isGecko&&h.indexOf("-moz-")===0){return}switch(h){case"color":case"background-color":i=i.toLowerCase();break}f+=(f?" ":"")+h+": "+i+";"}});return f},loadCSS:function(f){var h=this,i=h.doc,g;if(!f){f=""}g=h.select("head")[0];e(f.split(","),function(j){var k;if(h.files[j]){return}h.files[j]=true;k=h.create("link",{rel:"stylesheet",href:c._addVer(j)});if(a&&i.documentMode){k.onload=function(){i.recalc();k.onload=null}}g.appendChild(k)})},addClass:function(f,g){return this.run(f,function(h){var i;if(!g){return 0}if(this.hasClass(h,g)){return h.className}i=this.removeClass(h,g);return h.className=(i!=""?(i+" "):"")+g})},removeClass:function(h,i){var f=this,g;return f.run(h,function(k){var j;if(f.hasClass(k,i)){if(!g){g=new RegExp("(^|\\s+)"+i+"(\\s+|$)","g")}j=k.className.replace(g," ");return k.className=c.trim(j!=" "?j:"")}return k.className})},hasClass:function(g,f){g=this.get(g);if(!g||!f){return false}return(" "+g.className+" ").indexOf(" "+f+" ")!==-1},show:function(f){return this.setStyle(f,"display","block")},hide:function(f){return this.setStyle(f,"display","none")},isHidden:function(f){f=this.get(f);return !f||f.style.display=="none"||this.getStyle(f,"display")=="none"},uniqueId:function(f){return(!f?"mce_":f)+(this.counter++)},setHTML:function(i,g){var f=this;return this.run(i,function(m){var h,k,j,q,l,h;g=f.processHTML(g);if(a){function o(){try{m.innerHTML="
    "+g;m.removeChild(m.firstChild)}catch(n){while(m.firstChild){m.firstChild.removeNode()}h=f.create("div");h.innerHTML="
    "+g;e(h.childNodes,function(r,p){if(p){m.appendChild(r)}})}}if(f.settings.fix_ie_paragraphs){g=g.replace(/

    <\/p>|]+)><\/p>|/gi,' 

    ')}o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("p");for(k=j.length-1,h=0;k>=0;k--){q=j[k];if(!q.hasChildNodes()){if(!q.mce_keep){h=1;break}q.removeAttribute("mce_keep")}}}if(h){g=g.replace(/

    ]+)>|

    /ig,'

    ');g=g.replace(/<\/p>/g,"
    ");o();if(f.settings.fix_ie_paragraphs){j=m.getElementsByTagName("DIV");for(k=j.length-1;k>=0;k--){q=j[k];if(q.mce_tmp){l=f.doc.createElement("p");q.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(p,n){var r;if(n!=="mce_tmp"){r=q.getAttribute(n);if(!r&&n==="class"){r=q.className}l.setAttribute(n,r)}});for(h=0;h|]+)>/gi,"<$1b$2>");j=j.replace(/<(\/?)em>|]+)>/gi,"<$1i$2>")}else{if(a){j=j.replace(/'/g,"'");j=j.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}}j=j.replace(/]+)\/>|/gi,"");if(i.keep_values){if(/)/g,"\n");h=h.replace(/^[\r\n]*|[\r\n]*$/g,"");h=h.replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g,"");return h}j=j.replace(/]+|)>([\s\S]*?)<\/script>/gi,function(h,m,l){if(!m){m=' type="text/javascript"'}m=m.replace(/src=\"([^\"]+)\"?/i,function(n,o){if(i.url_converter){o=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(o),"src","script"))}return'mce_src="'+o+'"'});if(c.trim(l)){k.push(f(l));l=""}return""+l+""});j=j.replace(/]+|)>([\s\S]*?)<\/style>/gi,function(h,m,l){if(l){k.push(f(l));l=""}return""+l+""});j=j.replace(/]+|)>([\s\S]*?)<\/noscript>/g,function(h,m,l){return""})}j=j.replace(//g,"");j=j.replace(/<([\w:]+) [^>]*(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)[^>]*>/gi,function(l){function h(o,m,n){if(n==="false"||n==="0"){return""}return" "+m+'="'+m+'"'}l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\"]([^\"]+)[\"]/gi,h);l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=[\']([^\']+)[\']/gi,h);l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)=([^\s\"\'>]+)/gi,h);l=l.replace(/ (checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)([\s>])/gi,' $1="$1"$2');return l});j=j.replace(/<([\w:]+) [^>]*(src|href|style|shape|coords)[^>]*>/gi,function(h,m){function l(o,n,q){var p=q;if(h.indexOf("mce_"+n)!=-1){return o}if(n=="style"){if(g._isRes(q)){return o}p=g.encode(g.serializeStyle(g.parseStyle(p)))}else{if(n!="coords"&&n!="shape"){if(i.url_converter){p=g.encode(i.url_converter.call(i.url_converter_scope||g,g.decode(q),n,m))}}}return" "+n+'="'+q+'" mce_'+n+'="'+p+'"'}h=h.replace(/ (src|href|style|coords|shape)=[\"]([^\"]+)[\"]/gi,l);h=h.replace(/ (src|href|style|coords|shape)=[\']([^\']+)[\']/gi,l);return h.replace(/ (src|href|style|coords|shape)=([^\s\"\'>]+)/gi,l)});j=j.replace(/MCE_SCRIPT:([0-9]+)/g,function(l,h){return k[h]})}return j},getOuterHTML:function(f){var g;f=this.get(f);if(!f){return null}if(f.outerHTML!==undefined){return f.outerHTML}g=(f.ownerDocument||this.doc).createElement("body");g.appendChild(f.cloneNode(true));return g.innerHTML},setOuterHTML:function(j,g,k){var f=this;function i(m,l,p){var q,o;o=p.createElement("body");o.innerHTML=l;q=o.lastChild;while(q){f.insertAfter(q.cloneNode(true),m);q=q.previousSibling}f.remove(m)}return this.run(j,function(l){l=f.get(l);if(l.nodeType==1){k=k||l.ownerDocument||f.doc;if(a){try{if(a&&l.nodeType==1){l.outerHTML=g}else{i(l,g,k)}}catch(h){i(l,g,k)}}else{i(l,g,k)}}})},decode:function(g){var h,i,f;if(/&[^;]+;/.test(g)){h=this.doc.createElement("div");h.innerHTML=g;i=h.firstChild;f="";if(i){do{f+=i.nodeValue}while(i.nextSibling)}return f||g}return g},encode:function(f){return f?(""+f).replace(/[<>&\"]/g,function(h,g){switch(h){case"&":return"&";case'"':return""";case"<":return"<";case">":return">"}return h}):f},insertAfter:function(h,g){var f=this;g=f.get(g);return this.run(h,function(k){var j,i;j=g.parentNode;i=g.nextSibling;if(i){j.insertBefore(k,i)}else{j.appendChild(k)}return k})},isBlock:function(f){if(f.nodeType&&f.nodeType!==1){return false}f=f.nodeName||f;return/^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TH|TBODY|TR|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP)$/.test(f)},replace:function(i,h,f){var g=this;if(b(h,"array")){i=i.cloneNode(true)}return g.run(h,function(j){if(f){e(j.childNodes,function(k){i.appendChild(k.cloneNode(true))})}if(g.fixPsuedoLeaks&&j.nodeType===1){j.parentNode.insertBefore(i,j);g.remove(j);return i}return j.parentNode.replaceChild(i,j)})},findCommonAncestor:function(h,f){var i=h,g;while(i){g=f;while(g&&i!=g){g=g.parentNode}if(i==g){break}i=i.parentNode}if(!i&&h.ownerDocument){return h.ownerDocument.documentElement}return i},toHex:function(f){var h=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(f);function g(i){i=parseInt(i).toString(16);return i.length>1?i:"0"+i}if(h){f="#"+g(h[1])+g(h[2])+g(h[3]);return f}return f},getClasses:function(){var l=this,g=[],k,m={},n=l.settings.class_filter,j;if(l.classes){return l.classes}function o(f){e(f.imports,function(i){o(i)});e(f.cssRules||f.rules,function(i){switch(i.type||1){case 1:if(i.selectorText){e(i.selectorText.split(","),function(p){p=p.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(p)||!/\.[\w\-]+$/.test(p)){return}j=p;p=p.replace(/.*\.([a-z0-9_\-]+).*/i,"$1");if(n&&!(p=n(p,j))){return}if(!m[p]){g.push({"class":p});m[p]=1}})}break;case 3:o(i.styleSheet);break}})}try{e(l.doc.styleSheets,o)}catch(h){}if(g.length>0){l.classes=g}return g},run:function(j,i,h){var g=this,k;if(g.doc&&typeof(j)==="string"){j=g.get(j)}if(!j){return false}h=h||this;if(!j.nodeType&&(j.length||j.length===0)){k=[];e(j,function(l,f){if(l){if(typeof(l)=="string"){l=g.doc.getElementById(l)}k.push(i.call(h,l,f))}});return k}return i.call(h,j)},getAttribs:function(g){var f;g=this.get(g);if(!g){return[]}if(a){f=[];if(g.nodeName=="OBJECT"){return g.attributes}if(g.nodeName==="OPTION"&&this.getAttrib(g,"selected")){f.push({specified:1,nodeName:"selected"})}g.cloneNode(false).outerHTML.replace(/<\/?[\w:]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=\w+|>/gi,"").replace(/[\w:]+/gi,function(h){f.push({specified:1,nodeName:h})});return f}return g.attributes},destroy:function(g){var f=this;if(f.events){f.events.destroy()}f.win=f.doc=f.root=f.events=null;if(!g){c.removeUnload(f.destroy)}},createRng:function(){var f=this.doc;return f.createRange?f.createRange():new c.dom.Range(this)},split:function(l,k,o){var p=this,f=p.createRng(),m,j,n;function g(r,q){r=r[q];if(r&&r[q]&&r[q].nodeType==1&&i(r[q])){p.remove(r[q])}}function i(q){q=p.getOuterHTML(q);q=q.replace(/<(img|hr|table)/gi,"-");q=q.replace(/<[^>]+>/g,"");return q.replace(/[ \t\r\n]+| | /g,"")==""}function h(r){var q=0;while(r.previousSibling){q++;r=r.previousSibling}return q}if(l&&k){f.setStart(l.parentNode,h(l));f.setEnd(k.parentNode,h(k));m=f.extractContents();f=p.createRng();f.setStart(k.parentNode,h(k)+1);f.setEnd(l.parentNode,h(l)+1);j=f.extractContents();n=l.parentNode;g(m,"lastChild");if(!i(m)){n.insertBefore(m,l)}if(o){n.replaceChild(o,k)}else{n.insertBefore(k,l)}g(j,"firstChild");if(!i(j)){n.insertBefore(j,l)}p.remove(l);return o||k}},bind:function(j,f,i,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.add(j,f,i,h||this)},unbind:function(i,f,h){var g=this;if(!g.events){g.events=new c.dom.EventUtils()}return g.events.remove(i,f,h)},_findSib:function(j,g,h){var i=this,k=g;if(j){if(b(k,"string")){k=function(f){return i.is(f,g)}}for(j=j[h];j;j=j[h]){if(k(j)){return j}}}return null},_isRes:function(f){return/^(top|left|bottom|right|width|height)/i.test(f)||/;\s*(top|left|bottom|right|width|height)/i.test(f)}});c.DOM=new c.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(f){var h=0,c=1,e=2,d=tinymce.extend;function g(m,k){var j,l;if(m.parentNode!=k){return -1}for(l=k.firstChild,j=0;l!=m;l=l.nextSibling){j++}return j}function b(k){var j=0;while(k.previousSibling){j++;k=k.previousSibling}return j}function i(j,k){var l;if(j.nodeType==3){return j}if(k<0){return j}l=j.firstChild;while(l!=null&&k>0){--k;l=l.nextSibling}if(l!=null){return l}return j}function a(k){var j=k.doc;d(this,{dom:k,startContainer:j,startOffset:0,endContainer:j,endOffset:0,collapsed:true,commonAncestorContainer:j,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3})}d(a.prototype,{setStart:function(k,j){this._setEndPoint(true,k,j)},setEnd:function(k,j){this._setEndPoint(false,k,j)},setStartBefore:function(j){this.setStart(j.parentNode,b(j))},setStartAfter:function(j){this.setStart(j.parentNode,b(j)+1)},setEndBefore:function(j){this.setEnd(j.parentNode,b(j))},setEndAfter:function(j){this.setEnd(j.parentNode,b(j)+1)},collapse:function(k){var j=this;if(k){j.endContainer=j.startContainer;j.endOffset=j.startOffset}else{j.startContainer=j.endContainer;j.startOffset=j.endOffset}j.collapsed=true},selectNode:function(j){this.setStartBefore(j);this.setEndAfter(j)},selectNodeContents:function(j){this.setStart(j,0);this.setEnd(j,j.nodeType===1?j.childNodes.length:j.nodeValue.length)},compareBoundaryPoints:function(m,n){var l=this,p=l.startContainer,o=l.startOffset,k=l.endContainer,j=l.endOffset;if(m===0){return l._compareBoundaryPoints(p,o,p,o)}if(m===1){return l._compareBoundaryPoints(p,o,k,j)}if(m===2){return l._compareBoundaryPoints(k,j,k,j)}if(m===3){return l._compareBoundaryPoints(k,j,p,o)}},deleteContents:function(){this._traverse(e)},extractContents:function(){return this._traverse(h)},cloneContents:function(){return this._traverse(c)},insertNode:function(m){var j=this,l,k;if(m.nodeType===3||m.nodeType===4){l=j.startContainer.splitText(j.startOffset);j.startContainer.parentNode.insertBefore(m,l)}else{if(j.startContainer.childNodes.length>0){k=j.startContainer.childNodes[j.startOffset]}j.startContainer.insertBefore(m,k)}},surroundContents:function(l){var j=this,k=j.extractContents();j.insertNode(l);l.appendChild(k);j.selectNode(l)},cloneRange:function(){var j=this;return d(new a(j.dom),{startContainer:j.startContainer,startOffset:j.startOffset,endContainer:j.endContainer,endOffset:j.endOffset,collapsed:j.collapsed,commonAncestorContainer:j.commonAncestorContainer})},_isCollapsed:function(){return(this.startContainer==this.endContainer&&this.startOffset==this.endOffset)},_compareBoundaryPoints:function(m,p,k,o){var q,l,j,r,t,s;if(m==k){if(p==o){return 0}else{if(p0){l.collapse(k)}}l.collapsed=l._isCollapsed();l.commonAncestorContainer=l.dom.findCommonAncestor(l.startContainer,l.endContainer)},_traverse:function(r){var s=this,q,m=0,v=0,k,o,l,n,j,u;if(s.startContainer==s.endContainer){return s._traverseSameContainer(r)}for(q=s.endContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.startContainer){return s._traverseCommonStartContainer(q,r)}++m}for(q=s.startContainer,k=q.parentNode;k!=null;q=k,k=k.parentNode){if(k==s.endContainer){return s._traverseCommonEndContainer(q,r)}++v}o=v-m;l=s.startContainer;while(o>0){l=l.parentNode;o--}n=s.endContainer;while(o<0){n=n.parentNode;o++}for(j=l.parentNode,u=n.parentNode;j!=u;j=j.parentNode,u=u.parentNode){l=j;n=u}return s._traverseCommonAncestors(l,n,r)},_traverseSameContainer:function(o){var r=this,q,u,j,k,l,p,m;if(o!=e){q=r.dom.doc.createDocumentFragment()}if(r.startOffset==r.endOffset){return q}if(r.startContainer.nodeType==3){u=r.startContainer.nodeValue;j=u.substring(r.startOffset,r.endOffset);if(o!=c){r.startContainer.deleteData(r.startOffset,r.endOffset-r.startOffset);r.collapse(true)}if(o==e){return null}q.appendChild(r.dom.doc.createTextNode(j));return q}k=i(r.startContainer,r.startOffset);l=r.endOffset-r.startOffset;while(l>0){p=k.nextSibling;m=r._traverseFullySelected(k,o);if(q){q.appendChild(m)}--l;k=p}if(o!=c){r.collapse(true)}return q},_traverseCommonStartContainer:function(j,p){var s=this,r,k,l,m,q,o;if(p!=e){r=s.dom.doc.createDocumentFragment()}k=s._traverseRightBoundary(j,p);if(r){r.appendChild(k)}l=g(j,s.startContainer);m=l-s.startOffset;if(m<=0){if(p!=c){s.setEndBefore(j);s.collapse(false)}return r}k=j.previousSibling;while(m>0){q=k.previousSibling;o=s._traverseFullySelected(k,p);if(r){r.insertBefore(o,r.firstChild)}--m;k=q}if(p!=c){s.setEndBefore(j);s.collapse(false)}return r},_traverseCommonEndContainer:function(m,p){var s=this,r,o,j,k,q,l;if(p!=e){r=s.dom.doc.createDocumentFragment()}j=s._traverseLeftBoundary(m,p);if(r){r.appendChild(j)}o=g(m,s.endContainer);++o;k=s.endOffset-o;j=m.nextSibling;while(k>0){q=j.nextSibling;l=s._traverseFullySelected(j,p);if(r){r.appendChild(l)}--k;j=q}if(p!=c){s.setStartAfter(m);s.collapse(true)}return r},_traverseCommonAncestors:function(p,j,s){var w=this,l,v,o,q,r,k,u,m;if(s!=e){v=w.dom.doc.createDocumentFragment()}l=w._traverseLeftBoundary(p,s);if(v){v.appendChild(l)}o=p.parentNode;q=g(p,o);r=g(j,o);++q;k=r-q;u=p.nextSibling;while(k>0){m=u.nextSibling;l=w._traverseFullySelected(u,s);if(v){v.appendChild(l)}u=m;--k}l=w._traverseRightBoundary(j,s);if(v){v.appendChild(l)}if(s!=c){w.setStartAfter(p);w.collapse(true)}return v},_traverseRightBoundary:function(p,q){var s=this,l=i(s.endContainer,s.endOffset-1),r,o,n,j,k;var m=l!=s.endContainer;if(l==p){return s._traverseNode(l,m,false,q)}r=l.parentNode;o=s._traverseNode(r,false,false,q);while(r!=null){while(l!=null){n=l.previousSibling;j=s._traverseNode(l,m,false,q);if(q!=e){o.insertBefore(j,o.firstChild)}m=true;l=n}if(r==p){return o}l=r.previousSibling;r=r.parentNode;k=s._traverseNode(r,false,false,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseLeftBoundary:function(p,q){var s=this,m=i(s.startContainer,s.startOffset);var n=m!=s.startContainer,r,o,l,j,k;if(m==p){return s._traverseNode(m,n,true,q)}r=m.parentNode;o=s._traverseNode(r,false,true,q);while(r!=null){while(m!=null){l=m.nextSibling;j=s._traverseNode(m,n,true,q);if(q!=e){o.appendChild(j)}n=true;m=l}if(r==p){return o}m=r.nextSibling;r=r.parentNode;k=s._traverseNode(r,false,true,q);if(q!=e){k.appendChild(o)}o=k}return null},_traverseNode:function(j,o,r,s){var u=this,m,l,p,k,q;if(o){return u._traverseFullySelected(j,s)}if(j.nodeType==3){m=j.nodeValue;if(r){k=u.startOffset;l=m.substring(k);p=m.substring(0,k)}else{k=u.endOffset;l=m.substring(0,k);p=m.substring(k)}if(s!=c){j.nodeValue=p}if(s==e){return null}q=j.cloneNode(false);q.nodeValue=l;return q}if(s==e){return null}return j.cloneNode(false)},_traverseFullySelected:function(l,k){var j=this;if(k!=e){return k==c?l.cloneNode(true):l}l.parentNode.removeChild(l);return null}});f.Range=a})(tinymce.dom);(function(){function a(e){var d=this,h="\uFEFF",b,g;function c(j,i){if(j&&i){if(j.item&&i.item&&j.item(0)===i.item(0)){return 1}if(j.isEqual&&i.isEqual&&i.isEqual(j)){return 1}}return 0}function f(){var m=e.dom,j=e.getRng(),s=m.createRng(),p,k,n,q,o,l;function i(v){var t=v.parentNode.childNodes,u;for(u=t.length-1;u>=0;u--){if(t[u]==v){return u}}return -1}function r(v){var t=j.duplicate(),B,y,u,w,x=0,z=0,A,C;t.collapse(v);B=t.parentElement();t.pasteHTML(h);u=B.childNodes;for(y=0;y0&&(w.nodeType!==3||u[y-1].nodeType!==3)){z++}if(w.nodeType===3){A=w.nodeValue.indexOf(h);if(A!==-1){x+=A;break}x+=w.nodeValue.length}else{x=0}}t.moveStart("character",-1);t.text="";return{index:z,offset:x,parent:B}}n=j.item?j.item(0):j.parentElement();if(n.ownerDocument!=m.doc){return s}if(j.item||!n.hasChildNodes()){s.setStart(n.parentNode,i(n));s.setEnd(s.startContainer,s.startOffset+1);return s}l=e.isCollapsed();p=r(true);k=r(false);p.parent.normalize();k.parent.normalize();q=p.parent.childNodes[Math.min(p.index,p.parent.childNodes.length-1)];if(q.nodeType!=3){s.setStart(p.parent,p.index)}else{s.setStart(p.parent.childNodes[p.index],p.offset)}o=k.parent.childNodes[Math.min(k.index,k.parent.childNodes.length-1)];if(o.nodeType!=3){if(!l){k.index++}s.setEnd(k.parent,k.index)}else{s.setEnd(k.parent.childNodes[k.index],k.offset)}if(!l){q=s.startContainer;if(q.nodeType==1){s.setStart(q,Math.min(s.startOffset,q.childNodes.length))}o=s.endContainer;if(o.nodeType==1){s.setEnd(o,Math.min(s.endOffset,o.childNodes.length))}}d.addRange(s);return s}this.addRange=function(j){var o,m=e.dom.doc.body,p,k,q,l,n,i;q=j.startContainer;l=j.startOffset;n=j.endContainer;i=j.endOffset;o=m.createTextRange();q=q.nodeType==1?q.childNodes[Math.min(l,q.childNodes.length-1)]:q;n=n.nodeType==1?n.childNodes[Math.min(l==i?i:i-1,n.childNodes.length-1)]:n;if(q==n&&q.nodeType==1){if(/^(IMG|TABLE)$/.test(q.nodeName)&&l!=i){o=m.createControlRange();o.addElement(q)}else{o=m.createTextRange();if(!q.hasChildNodes()&&q.canHaveHTML){q.innerHTML=h}o.moveToElementText(q);if(q.innerHTML==h){o.collapse(true);q.removeChild(q.firstChild)}}if(l==i){o.collapse(i<=j.endContainer.childNodes.length-1)}o.select();return}function r(t,v){var u,s,w;if(t.nodeType!=3){return -1}u=t.nodeValue;s=m.createTextRange();t.nodeValue=u.substring(0,v)+h+u.substring(v);s.moveToElementText(t.parentNode);s.findText(h);w=Math.abs(s.moveStart("character",-1048575));t.nodeValue=u;return w}if(j.collapsed){pos=r(q,l);o=m.createTextRange();o.move("character",pos);o.select();return}else{if(q==n&&q.nodeType==3){p=r(q,l);o=m.createTextRange();o.move("character",p);o.moveEnd("character",i-l);o.select();return}p=r(q,l);k=r(n,i);o=m.createTextRange();if(p==-1){o.moveToElementText(q);p=0}else{o.move("character",p)}tmpRng=m.createTextRange();if(k==-1){tmpRng.moveToElementText(n)}else{tmpRng.move("character",k)}o.setEndPoint("EndToEnd",tmpRng);o.select();return}};this.getRangeAt=function(){if(!b||!c(g,e.getRng())){b=f();g=e.getRng()}return b};this.destroy=function(){g=b=null}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(D,t,A,v){A=A||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!D||typeof D!=="string"){return A}var B=[],C,y,G,F,z,s,r=true,w=o(t);p.lastIndex=0;while((C=p.exec(D))!==null){B.push(C[1]);if(C[2]){s=RegExp.rightContext;break}}if(B.length>1&&j.exec(D)){if(B.length===2&&f.relative[B[0]]){y=g(B[0]+B[1],t)}else{y=f.relative[B[0]]?[t]:b(B.shift(),t);while(B.length){D=B.shift();if(f.relative[D]){D+=B.shift()}y=g(D,y)}}}else{if(!v&&B.length>1&&t.nodeType===9&&!w&&f.match.ID.test(B[0])&&!f.match.ID.test(B[B.length-1])){var H=b.find(B.shift(),t,w);t=H.expr?b.filter(H.expr,H.set)[0]:H.set[0]}if(t){var H=v?{expr:B.pop(),set:a(v)}:b.find(B.pop(),B.length===1&&(B[0]==="~"||B[0]==="+")&&t.parentNode?t.parentNode:t,w);y=H.expr?b.filter(H.expr,H.set):H.set;if(B.length>0){G=a(y)}else{r=false}while(B.length){var u=B.pop(),x=u;if(!f.relative[u]){u=""}else{x=B.pop()}if(x==null){x=t}f.relative[u](G,x,w)}}else{G=B=[]}}if(!G){G=y}if(!G){throw"Syntax error, unrecognized expression: "+(u||D)}if(d.call(G)==="[object Array]"){if(!r){A.push.apply(A,G)}else{if(t&&t.nodeType===1){for(var E=0;G[E]!=null;E++){if(G[E]&&(G[E]===true||G[E].nodeType===1&&h(t,G[E]))){A.push(y[E])}}}else{for(var E=0;G[E]!=null;E++){if(G[E]&&G[E].nodeType===1){A.push(y[E])}}}}}else{a(G,A)}if(s){b(s,e,A,v);b.uniqueSort(A)}return A};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e":function(w,r,x){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=x?r:r.toUpperCase();for(var s=0,e=w.length;s=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=i++;return e},ATTR:function(u,r,s,e,v,w){var t=u[1].replace(/\\/g,"");if(!w&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if(u[3].match(p).length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return re[3]-0},nth:function(s,r,e){return e[3]-0==r},eq:function(s,r,e){return e[3]-0==r}},filter:{PSEUDO:function(w,s,t,x){var r=s[1],u=f.filters[r];if(u){return u(w,t,s,x)}else{if(r==="contains"){return(w.textContent||w.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),w=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?w===r:u==="*="?w.indexOf(r)>=0:u==="~="?(" "+w+" ").indexOf(r)>=0:!r?w&&e!==false:u==="!="?w!=r:u==="^="?w.indexOf(r)===0:u==="$="?w.substr(w.length-r.length)===r:u==="|="?w===r||w.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(!!document.getElementById(s)){f.find.ID=function(u,v,w){if(typeof v.getElementById!=="undefined"&&!w){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="

    ";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(w,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(v)){try{return a(v.querySelectorAll(w),t)}catch(x){}}return e(w,v,t,u)};for(var r in e){b[r]=e[r]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="
    ";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}}})()}function m(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t0){u=e;break}}}e=e[r]}A[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,x){var t=[],u="",v,s=x.nodeType?[x]:x;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var w=0,r=s.length;w=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){var b=a.each;a.create("tinymce.dom.Element",{Element:function(g,e){var c=this,f,d;e=e||{};c.id=g;c.dom=f=e.dom||a.DOM;c.settings=e;if(!a.isIE){d=c.dom.get(c.id)}b(["getPos","getRect","getParent","add","setStyle","getStyle","setStyles","setAttrib","setAttribs","getAttrib","addClass","removeClass","hasClass","getOuterHTML","setOuterHTML","remove","show","hide","isHidden","setHTML","get"],function(h){c[h]=function(){var j=[g],k;for(k=0;k_';j.deleteContents();j.insertNode(f.getRng().createContextualFragment(i));l=f.dom.get("__caret");j=k.createRange();j.setStartBefore(l);j.setEndAfter(l);f.setRng(j);f.dom.remove("__caret")}else{if(j.item){k.execCommand("Delete",false,null);j=f.getRng()}j.pasteHTML(i)}f.onSetContent.dispatch(f,g)},getStart:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(1);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.firstChild}return h}else{h=g.startContainer;if(h.nodeName=="BODY"){return h.firstChild}return f.dom.getParent(h,"*")}},getEnd:function(){var f=this,g=f.getRng(),h;if(a){if(g.item){return g.item(0)}g=g.duplicate();g.collapse(0);h=g.parentElement();if(h&&h.nodeName=="BODY"){return h.lastChild}return h}else{h=g.endContainer;if(h.nodeName=="BODY"){return h.lastChild}return f.dom.getParent(h,"*")}},getBookmark:function(x){var j=this,m=j.getRng(),f,n,l,u=j.dom.getViewPort(j.win),v,p,z,o,w=-16777215,k,h=j.dom.getRoot(),g=0,i=0,y;n=u.x;l=u.y;if(x){return{rng:m,scrollX:n,scrollY:l}}if(a){if(m.item){v=m.item(0);d(j.dom.select(v.nodeName),function(s,r){if(v==s){p=r;return false}});return{tag:v.nodeName,index:p,scrollX:n,scrollY:l}}f=j.dom.doc.body.createTextRange();f.moveToElementText(h);f.collapse(true);z=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(true);p=Math.abs(f.move("character",w));f=m.duplicate();f.collapse(false);o=Math.abs(f.move("character",w))-p;return{start:p-z,length:o,scrollX:n,scrollY:l}}v=j.getNode();k=j.getSel();if(!k){return null}if(v&&v.nodeName=="IMG"){return{scrollX:n,scrollY:l}}function q(A,D,t){var s=j.dom.doc.createTreeWalker(A,NodeFilter.SHOW_TEXT,null,false),E,B=0,C={};while((E=s.nextNode())!=null){if(E==D){C.start=B}if(E==t){C.end=B;return C}B+=e(E.nodeValue||"").length}return null}if(k.anchorNode==k.focusNode&&k.anchorOffset==k.focusOffset){v=q(h,k.anchorNode,k.focusNode);if(!v){return{scrollX:n,scrollY:l}}e(k.anchorNode.nodeValue||"").replace(/^\s+/,function(r){g=r.length});return{start:Math.max(v.start+k.anchorOffset-g,0),end:Math.max(v.end+k.focusOffset-g,0),scrollX:n,scrollY:l,beg:k.anchorOffset-g==0}}else{v=q(h,m.startContainer,m.endContainer);if(!v){return{scrollX:n,scrollY:l}}return{start:Math.max(v.start+m.startOffset-g,0),end:Math.max(v.end+m.endOffset-i,0),scrollX:n,scrollY:l,beg:m.startOffset-g==0}}},moveToBookmark:function(n){var o=this,g=o.getRng(),p=o.getSel(),j=o.dom.getRoot(),m,h,k;function i(q,t,D){var B=o.dom.doc.createTreeWalker(q,NodeFilter.SHOW_TEXT,null,false),x,s=0,A={},u,C,z,y;while((x=B.nextNode())!=null){z=y=0;k=x.nodeValue||"";h=e(k).length;s+=h;if(s>=t&&!A.startNode){u=t-(s-h);if(n.beg&&u>=h){continue}A.startNode=x;A.startOffset=u+y}if(s>=D){A.endNode=x;A.endOffset=D-(s-h)+y;return A}}return null}if(!n){return false}o.win.scrollTo(n.scrollX,n.scrollY);if(a){o.tridentSel.destroy();if(g=n.rng){try{g.select()}catch(l){}return true}o.win.focus();if(n.tag){g=j.createControlRange();d(o.dom.select(n.tag),function(r,q){if(q==n.index){g.addElement(r)}})}else{try{if(n.start<0){return true}g=p.createRange();g.moveToElementText(j);g.collapse(true);g.moveStart("character",n.start);g.moveEnd("character",n.length)}catch(f){return true}}try{g.select()}catch(l){}return true}if(!p){return false}if(n.rng){p.removeAllRanges();p.addRange(n.rng)}else{if(b(n.start)&&b(n.end)){try{m=i(j,n.start,n.end);if(m){g=o.dom.doc.createRange();g.setStart(m.startNode,m.startOffset);g.setEnd(m.endNode,m.endOffset);p.removeAllRanges();p.addRange(g)}if(!c.isOpera){o.win.focus()}}catch(l){}}}},select:function(g,l){var p=this,f=p.getRng(),q=p.getSel(),o,m,k,j=p.win.document;function h(u,t){var s,r;if(u){s=j.createTreeWalker(u,NodeFilter.SHOW_TEXT,null,false);while(u=s.nextNode()){r=u;if(c.trim(u.nodeValue).length!=0){if(t){return u}else{r=u}}}}return r}if(a){try{o=j.body;if(/^(IMG|TABLE)$/.test(g.nodeName)){f=o.createControlRange();f.addElement(g)}else{f=o.createTextRange();f.moveToElementText(g)}f.select()}catch(i){}}else{if(l){m=h(g,1)||p.dom.select("br:first",g)[0];k=h(g,0)||p.dom.select("br:last",g)[0];if(m&&k){f=j.createRange();if(m.nodeName=="BR"){f.setStartBefore(m)}else{f.setStart(m,0)}if(k.nodeName=="BR"){f.setEndBefore(k)}else{f.setEnd(k,k.nodeValue.length)}}else{f.selectNode(g)}}else{f.selectNode(g)}p.setRng(f)}return g},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}return !g||h.boundingWidth==0||h.collapsed},collapse:function(f){var g=this,h=g.getRng(),i;if(h.item){i=h.item(0);h=this.win.document.body.createTextRange();h.moveToElementText(i)}h.collapse(!!f);g.setRng(h)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(j){var g=this,h,i;if(j&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():g.win.document.createRange())}}catch(f){}if(!i){i=a?g.win.document.body.createTextRange():g.win.document.createRange()}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){h.removeAllRanges();h.addRange(i)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var f=this,h=f.getRng(),g=f.getSel(),i;if(!a){if(!h){return f.dom.getRoot()}i=h.commonAncestorContainer;if(!h.collapsed){if(c.isWebKit&&g.anchorNode&&g.anchorNode.nodeType==1){return g.anchorNode.childNodes[g.anchorOffset]}if(h.startContainer==h.endContainer){if(h.startOffset-h.endOffset<2){if(h.startContainer.hasChildNodes()){i=h.startContainer.childNodes[h.startOffset]}}}}return f.dom.getParent(i,"*")}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}}})})(tinymce);(function(a){a.create("tinymce.dom.XMLWriter",{node:null,XMLWriter:function(c){function b(){var e=document.implementation;if(!e||!e.createDocument){try{return new ActiveXObject("MSXML2.DOMDocument")}catch(d){}try{return new ActiveXObject("Microsoft.XmlDom")}catch(d){}}else{return e.createDocument("","",null)}}this.doc=b();this.valid=a.isOpera||a.isWebKit;this.reset()},reset:function(){var b=this,c=b.doc;if(c.firstChild){c.removeChild(c.firstChild)}b.node=c.appendChild(c.createElement("html"))},writeStartElement:function(c){var b=this;b.node=b.node.appendChild(b.doc.createElement(c))},writeAttribute:function(c,b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.setAttribute(c,b)},writeEndElement:function(){this.node=this.node.parentNode},writeFullEndElement:function(){var b=this,c=b.node;c.appendChild(b.doc.createTextNode(""));b.node=c.parentNode},writeText:function(b){if(this.valid){b=b.replace(/>/g,"%MCGT%")}this.node.appendChild(this.doc.createTextNode(b))},writeCDATA:function(b){this.node.appendChild(this.doc.createCDATASection(b))},writeComment:function(b){if(a.isIE){b=b.replace(/^\-|\-$/g," ")}this.node.appendChild(this.doc.createComment(b.replace(/\-\-/g," ")))},getContent:function(){var b;b=this.doc.xml||new XMLSerializer().serializeToString(this.doc);b=b.replace(/<\?[^?]+\?>||<\/html>||]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(a){a.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(b){this.settings=a.extend({indent_char:" ",indentation:0},b);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(b){this._writeAttributesEnd();this.writeRaw("<"+b);this.tags.push(b);this.inAttr=true;this.count++;this.elementCount=this.count},writeAttribute:function(d,b){var c=this;c.writeRaw(" "+c.encode(d)+'="'+c.encode(b)+'"')},writeEndElement:function(){var b;if(this.tags.length>0){b=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(b){this._writeAttributesEnd();this.writeRaw(this.encode(b));this.count++},writeCDATA:function(b){this._writeAttributesEnd();this.writeRaw("");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("");this.count++},writeRaw:function(b){this.str+=b},encode:function(b){return b.replace(/[<>&"]/g,function(c){switch(c){case"<":return"<";case">":return">";case"&":return"&";case'"':return"""}return c})},getContent:function(){return this.str},_writeAttributesEnd:function(b){if(!this.inAttr){return}this.inAttr=false;if(b&&this.elementCount==this.count){this.writeRaw(" />");return false}this.writeRaw(">");return true}})})(tinymce);(function(e){var g=e.extend,f=e.each,b=e.util.Dispatcher,d=e.isIE,a=e.isGecko;function c(h){return h.replace(/([?+*])/g,".$1")}e.create("tinymce.dom.Serializer",{Serializer:function(j){var i=this;i.key=0;i.onPreProcess=new b(i);i.onPostProcess=new b(i);try{i.writer=new e.dom.XMLWriter()}catch(h){i.writer=new e.dom.StringWriter()}i.settings=j=g({dom:e.DOM,valid_nodes:0,node_filter:0,attr_filter:0,invalid_attrs:/^(mce_|_moz_|sizset|sizcache)/,closed:/^(br|hr|input|meta|img|link|param|area)$/,entity_encoding:"named",entities:"160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",valid_elements:"*[*]",extended_valid_elements:0,valid_child_elements:0,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes:0,font_size_style_values:0,apply_source_formatting:0,indent_mode:"simple",indent_char:"\t",indent_levels:1,remove_linebreaks:1,remove_redundant_brs:1,element_format:"xhtml"},j);i.dom=j.dom;if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(
    \s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^
    \s*<\//.test(n)){return""}return n})})}if(j.element_format=="html"){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/<([^>]+) \/>/g,"<$1>")})}if(j.fix_list_elements){i.onPreProcess.add(function(v,s){var l,y,w=["ol","ul"],u,t,q,k=/^(OL|UL)$/,z;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p=1767){f(i.dom.select("p table",l.node).reverse(),function(p){var o=i.dom.getParent(p.parentNode,"table,p");if(o.nodeName!="TABLE"){try{i.dom.split(o,p)}catch(m){}}})}})}},setEntities:function(p){var n=this,j,m,h={},o="",k;if(n.entityLookup){return}j=p.split(",");for(m=0;m1){f(q[1].split("|"),function(u){var p={},t;k=k||[];u=u.replace(/::/g,"~");u=/^([!\-])?([\w*.?~_\-]+|)([=:<])?(.+)?$/.exec(u);u[2]=u[2].replace(/~/g,":");if(u[1]=="!"){r=r||[];r.push(u[2])}if(u[1]=="-"){for(t=0;t=1767)){p=j.createHTMLDocument("");f(r.nodeName=="BODY"?r.childNodes:[r],function(h){p.body.appendChild(p.importNode(h,true))});if(r.nodeName!="BODY"){r=p.body.firstChild}else{r=p.body}i=k.dom.doc;k.dom.doc=p}k.key=""+(parseInt(k.key)+1);if(!q.no_events){q.node=r;k.onPreProcess.dispatch(k,q)}k.writer.reset();k._serializeNode(r,q.getInner);q.content=k.writer.getContent();if(i){k.dom.doc=i}if(!q.no_events){k.onPostProcess.dispatch(k,q)}k._postProcess(q);q.node=null;return e.trim(q.content)},_postProcess:function(n){var i=this,k=i.settings,j=n.content,m=[],l;if(n.format=="html"){l=i._protect({content:j,patterns:[{pattern:/(]*>)(.*?)(<\/script>)/g},{pattern:/(]*>)(.*?)(<\/noscript>)/g},{pattern:/(]*>)(.*?)(<\/style>)/g},{pattern:/(]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/()/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/

    \s+<\/p>|]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?" 

    ":" 

    ");if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=j.replace(/(<[^>]+>)\s+/g,"$1 ");j=j.replace(/\s+(<\/[^>]+>)/g," $1");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object) ([^>]+)>\s+/g,"<$1 $2>");j=j.replace(/<(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>\s+/g,"<$1>");j=j.replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"")}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=j.replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n");j=j.replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>");j=j.replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(//g,"");if(k.entity_encoding=="raw"){j=j.replace(/

     <\/p>|]+)> <\/p>/g,"\u00a0

    ")}j=j.replace(/]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return""+i.dom.decode(o.replace(//g,""))+""})}n.content=j},_serializeNode:function(D,o){var z=this,A=z.settings,x=z.writer,q,j,u,F,E,G,B,h,y,k,r,C,p,m;if(!A.node_filter||A.node_filter(D)){switch(D.nodeType){case 1:if(D.hasAttribute?D.hasAttribute("mce_bogus"):D.getAttribute("mce_bogus")){return}p=false;q=D.hasChildNodes();k=D.getAttribute("mce_name")||D.nodeName.toLowerCase();if(d){if(D.scopeName!=="HTML"&&D.scopeName!=="html"){k=D.scopeName+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!z.validElementsRE||!z.validElementsRE.test(k)||(z.invalidElementsRE&&z.invalidElementsRE.test(k))||o){p=true;break}if(d){if(A.fix_content_duplication){if(D.mce_serialized==z.key){return}D.mce_serialized=z.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(D.nodeName==="BR"&&D.getAttribute("type")=="_moz"){return}}}if(z.childRules){if(z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(k)){p=true;break}}z.elementName=k}r=z.findRule(k);k=r.name||k;m=A.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){G=r.requiredAttribs;for(F=G.length-1;F>=0;F--){if(this.dom.getAttrib(D,G[F])!==""){break}}if(F==-1){p=true;break}}x.writeStartElement(k);if(r.attribs){for(F=0,B=r.attribs,E=B.length;F-1;F--){h=B[F];if(h.specified){G=h.nodeName.toLowerCase();if(A.invalid_attrs.test(G)||!r.validAttribsRE.test(G)){continue}C=z.findAttribRule(r,G);y=z._getAttrib(D,C,G);if(y!==null){x.writeAttribute(G,y)}}}}if(k==="script"&&e.trim(D.innerHTML)){x.writeText("// ");x.writeCDATA(D.innerHTML.replace(/|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=D.firstChild)&&u.nodeType===1&&D.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("mce_bogus"):u.getAttribute("mce_bogus")){x.writeText("\u00a0")}}else{if(!q){x.writeText("\u00a0")}}}break;case 3:if(z.childRules&&z.parentElementsRE.test(z.elementName)){if(!z.childRules[z.elementName].test(D.nodeName)){return}}return x.writeText(D.nodeValue);case 4:return x.writeCDATA(D.nodeValue);case 8:return x.writeComment(D.nodeValue)}}else{if(D.nodeType==1){q=D.hasChildNodes()}}if(q&&!m){u=D.firstChild;while(u){z._serializeNode(u);z.elementName=k;u=u.nextSibling}}if(!p){if(!m){x.writeFullEndElement()}else{x.writeEndElement()}}},_protect:function(j){var i=this;j.items=j.items||[];function h(l){return l.replace(/[\r\n\\]/g,function(m){if(m==="\n"){return"\\n"}else{if(m==="\\"){return"\\\\"}}return"\\r"})}function k(l){return l.replace(/\\[\\rn]/g,function(m){if(m==="\\n"){return"\n"}else{if(m==="\\\\"){return"\\"}}return"\r"})}f(j.patterns,function(l){j.content=k(h(j.content).replace(l.pattern,function(n,o,m,p){m=k(m);if(l.encode){m=i._encode(m)}j.items.push(m);return o+""+p}))});return j},_unprotect:function(i,j){i=i.replace(/\"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,""))}}if(b.stdMode){e+=''+j.renderHTML()+""}else{e+=""+j.renderHTML()+""}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,""))}}}g="mceToolbarEnd";if(j.Button){g+=" mceToolbarEndButton"}else{if(j.SplitButton){g+=" mceToolbarEndSplitButton"}else{if(j.ListBox){g+=" mceToolbarEndListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,""));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},""+e+"")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{items:[],urls:{},lookup:{},onAdd:new a(this),get:function(d){return this.lookup[d]},requireLangPack:function(f){var d,e=b.EditorManager.settings;if(e&&e.language){d=this.urls[f]+"/langs/"+e.language+".js";if(!b.dom.Event.domLoaded&&!e.strict_mode){b.ScriptLoader.load(d)}else{b.ScriptLoader.add(d)}}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));b.ScriptLoader.add(e,d,g)}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(f){var g=f.each,h=f.extend,e=f.DOM,a=f.dom.Event,c=f.ThemeManager,b=f.PluginManager,d=f.explode;f.create("static tinymce.EditorManager",{editors:{},i18n:{},activeEditor:null,preInit:function(){var i=this,j=window.location;f.documentBaseURL=j.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(f.documentBaseURL)){f.documentBaseURL+="/"}f.baseURL=new f.util.URI(f.documentBaseURL).toAbsolute(f.baseURL);f.EditorManager.baseURI=new f.util.URI(f.baseURL);i.onBeforeUnload=new f.util.Dispatcher(i);a.add(window,"beforeunload",function(k){i.onBeforeUnload.dispatch(i,k)})},init:function(q){var p=this,l,k=f.ScriptLoader,o,n,i=[],m;function j(u,v,r){var t=u[v];if(!t){return}if(f.is(t,"string")){r=t.replace(/\.\w+$/,"");r=r?f.resolve(r):0;t=f.resolve(t)}return t.apply(r||this,Array.prototype.slice.call(arguments,2))}q=h({theme:"simple",language:"en",strict_loading_mode:document.contentType=="application/xhtml+xml"},q);p.settings=q;if(!a.domLoaded&&!q.strict_loading_mode){if(q.language){k.add(f.baseURL+"/langs/"+q.language+".js")}if(q.theme&&q.theme.charAt(0)!="-"&&!c.urls[q.theme]){c.load(q.theme,"themes/"+q.theme+"/editor_template"+f.suffix+".js")}if(q.plugins){l=d(q.plugins);g(l,function(r){if(r&&r.charAt(0)!="-"&&!b.urls[r]){if(!f.isWebKit&&r=="safari"){return}b.load(r,"plugins/"+r+"/editor_plugin"+f.suffix+".js")}})}k.loadQueue()}a.add(document,"init",function(){var r,t;j(q,"onpageload");if(q.browsers){r=false;g(d(q.browsers),function(u){switch(u){case"ie":case"msie":if(f.isIE){r=true}break;case"gecko":if(f.isGecko){r=true}break;case"safari":case"webkit":if(f.isWebKit){r=true}break;case"opera":if(f.isOpera){r=true}break}});if(!r){return}}switch(q.mode){case"exact":r=q.elements||"";if(r.length>0){g(d(r),function(u){if(e.get(u)){m=new f.Editor(u,q);i.push(m);m.render(1)}else{o=0;g(document.forms,function(v){g(v.elements,function(w){if(w.name===u){u="mce_editor_"+o;e.setAttrib(w,"id",u);m=new f.Editor(u,q);i.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function s(v,u){return u.constructor===RegExp?u.test(v.className):e.hasClass(v,u)}g(e.select("textarea"),function(u){if(q.editor_deselector&&s(u,q.editor_deselector)){return}if(!q.editor_selector||s(u,q.editor_selector)){n=e.get(u.name);if(!u.id&&!n){u.id=u.name}if(!u.id||p.get(u.id)){u.id=e.uniqueId()}m=new f.Editor(u.id,q);i.push(m);m.render(1)}});break}if(q.oninit){r=t=0;g(i,function(u){t++;if(!u.initialized){u.onInit.add(function(){r++;if(r==t){j(q,"oninit")}})}else{r++}if(r==t){j(q,"oninit")}})}})},get:function(i){return this.editors[i]},getInstanceById:function(i){return this.get(i)},add:function(i){this.editors[i.id]=i;this._setActive(i);return i},remove:function(j){var i=this;if(!i.editors[j.id]){return null}delete i.editors[j.id];if(i.activeEditor==j){i._setActive(null);g(i.editors,function(k){i._setActive(k);return false})}j.destroy();return j},execCommand:function(o,m,l){var n=this,k=n.get(l),i;switch(o){case"mceFocus":k.focus();return true;case"mceAddEditor":case"mceAddControl":if(!n.get(l)){new f.Editor(l,n.settings).render()}return true;case"mceAddFrameControl":i=l.window;i.tinyMCE=tinyMCE;i.tinymce=f;f.DOM.doc=i.document;f.DOM.win=i;k=new f.Editor(l.element_id,l);k.render();if(f.isIE){function j(){k.destroy();i.detachEvent("onunload",j);i=i.tinyMCE=i.tinymce=null}i.attachEvent("onunload",j)}l.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(k){k.remove()}return true;case"mceToggleEditor":if(!k){n.execCommand("mceAddControl",0,l);return true}if(k.isHidden()){k.show()}else{k.hide()}return true}if(n.activeEditor){return n.activeEditor.execCommand(o,m,l)}return false},execInstanceCommand:function(m,l,k,j){var i=this.get(m);if(i){return i.execCommand(l,k,j)}return false},triggerSave:function(){g(this.editors,function(i){i.save()})},addI18n:function(k,l){var i,j=this.i18n;if(!f.is(k,"string")){g(k,function(n,m){g(n,function(q,p){g(q,function(s,r){if(p==="common"){j[m+"."+r]=s}else{j[m+"."+p+"."+r]=s}})})})}else{g(l,function(n,m){j[k+"."+m]=n})}},_setActive:function(i){this.selectedInstance=this.activeEditor=i}});f.EditorManager.preInit()})(tinymce);var tinyMCE=window.tinyMCE=tinymce.EditorManager;(function(n){var o=n.DOM,k=n.dom.Event,f=n.extend,l=n.util.Dispatcher;var j=n.each,a=n.isGecko,b=n.isIE,e=n.isWebKit;var d=n.is,h=n.ThemeManager,c=n.PluginManager,i=n.EditorManager;var p=n.inArray,m=n.grep,g=n.explode;n.create("tinymce.Editor",{Editor:function(u,r){var q=this;q.id=q.editorId=u;q.execCommands={};q.queryStateCommands={};q.queryValueCommands={};q.isNotDirty=false;q.plugins={};j(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){q[s]=new l(q)});q.settings=r=f({id:u,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:n.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:'',visual_table_class:"mceItemTable",visual:1,inline_styles:true,convert_fonts_to_spans:true,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",valid_elements:"@[id|class|style|title|dir';if(G.document_base_url!=n.documentBaseURL){F.iframeHTML+=''}F.iframeHTML+='';if(n.relaxedDomain){F.iframeHTML+=' +update($wpdb->users, array('user_activation_key' => $key), array('user_login' => $user_login)); } $message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n"; - $message .= get_option('siteurl') . "\r\n\r\n"; + $message .= network_site_url() . "\r\n\r\n"; $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; $message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n"; - $message .= site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n"; + $message .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n"; - // The blogname option is escaped with esc_html on the way into the database in sanitize_option - // we want to reverse this for the plain text arena of emails. - $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); + if ( is_multisite() ) + $blogname = $GLOBALS['current_site']->site_name; + else + // The blogname option is escaped with esc_html on the way into the database in sanitize_option + // we want to reverse this for the plain text arena of emails. + $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); - $title = sprintf(__('[%s] Password Reset'), $blogname); + $title = sprintf( __('[%s] Password Reset'), $blogname ); $title = apply_filters('retrieve_password_title', $title); $message = apply_filters('retrieve_password_message', $message, $key); if ( $message && !wp_mail($user_email, $title, $message) ) - die('

    ' . __('The e-mail could not be sent.') . "
    \n" . __('Possible reason: your host may have disabled the mail() function...') . '

    '); + wp_die( __('The e-mail could not be sent.') . "
    \n" . __('Possible reason: your host may have disabled the mail() function...') ); return true; } @@ -211,22 +239,25 @@ function reset_password($key, $login) { do_action('password_reset', $user, $new_pass); wp_set_password($new_pass, $user->ID); - update_usermeta($user->ID, 'default_password_nag', true); //Set up the Password change nag. + update_user_option($user->ID, 'default_password_nag', true, true); //Set up the Password change nag. $message = sprintf(__('Username: %s'), $user->user_login) . "\r\n"; $message .= sprintf(__('Password: %s'), $new_pass) . "\r\n"; $message .= site_url('wp-login.php', 'login') . "\r\n"; - // The blogname option is escaped with esc_html on the way into the database in sanitize_option - // we want to reverse this for the plain text arena of emails. - $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); + if ( is_multisite() ) + $blogname = $GLOBALS['current_site']->site_name; + else + // The blogname option is escaped with esc_html on the way into the database in sanitize_option + // we want to reverse this for the plain text arena of emails. + $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); - $title = sprintf(__('[%s] Your new password'), $blogname); + $title = sprintf( __('[%s] Your new password'), $blogname ); $title = apply_filters('password_reset_title', $title); $message = apply_filters('password_reset_message', $message, $new_pass); if ( $message && !wp_mail($user->user_email, $title, $message) ) - die('

    ' . __('The e-mail could not be sent.') . "
    \n" . __('Possible reason: your host may have disabled the mail() function...') . '

    '); + wp_die( __('The e-mail could not be sent.') . "
    \n" . __('Possible reason: your host may have disabled the mail() function...') ); wp_password_change_notification($user); @@ -240,45 +271,49 @@ function reset_password($key, $login) { * @param string $user_email User's email address to send password and add * @return int|WP_Error Either user's ID or error on failure. */ -function register_new_user($user_login, $user_email) { +function register_new_user( $user_login, $user_email ) { $errors = new WP_Error(); - $user_login = sanitize_user( $user_login ); + $sanitized_user_login = sanitize_user( $user_login ); $user_email = apply_filters( 'user_registration_email', $user_email ); // Check the username - if ( $user_login == '' ) - $errors->add('empty_username', __('ERROR: Please enter a username.')); - elseif ( !validate_username( $user_login ) ) { - $errors->add('invalid_username', __('ERROR: This username is invalid. Please enter a valid username.')); - $user_login = ''; - } elseif ( username_exists( $user_login ) ) - $errors->add('username_exists', __('ERROR: This username is already registered, please choose another one.')); + if ( $sanitized_user_login == '' ) { + $errors->add( 'empty_username', __( 'ERROR: Please enter a username.' ) ); + } elseif ( ! validate_username( $user_login ) ) { + $errors->add( 'invalid_username', __( 'ERROR: This username is invalid because it uses illegal characters. Please enter a valid username.' ) ); + $sanitized_user_login = ''; + } elseif ( username_exists( $sanitized_user_login ) ) { + $errors->add( 'username_exists', __( 'ERROR: This username is already registered, please choose another one.' ) ); + } // Check the e-mail address - if ($user_email == '') { - $errors->add('empty_email', __('ERROR: Please type your e-mail address.')); - } elseif ( !is_email( $user_email ) ) { - $errors->add('invalid_email', __('ERROR: The email address isn’t correct.')); + if ( $user_email == '' ) { + $errors->add( 'empty_email', __( 'ERROR: Please type your e-mail address.' ) ); + } elseif ( ! is_email( $user_email ) ) { + $errors->add( 'invalid_email', __( 'ERROR: The email address isn’t correct.' ) ); $user_email = ''; - } elseif ( email_exists( $user_email ) ) - $errors->add('email_exists', __('ERROR: This email is already registered, please choose another one.')); + } elseif ( email_exists( $user_email ) ) { + $errors->add( 'email_exists', __( 'ERROR: This email is already registered, please choose another one.' ) ); + } - do_action('register_post', $user_login, $user_email, $errors); + do_action( 'register_post', $sanitized_user_login, $user_email, $errors ); - $errors = apply_filters( 'registration_errors', $errors, $user_login, $user_email ); + $errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email ); if ( $errors->get_error_code() ) return $errors; $user_pass = wp_generate_password(); - $user_id = wp_create_user( $user_login, $user_pass, $user_email ); - if ( !$user_id ) { - $errors->add('registerfail', sprintf(__('ERROR: Couldn’t register you... please contact the webmaster !'), get_option('admin_email'))); + $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email ); + if ( ! $user_id ) { + $errors->add( 'registerfail', sprintf( __( 'ERROR: Couldn’t register you... please contact the webmaster !' ), get_option( 'admin_email' ) ) ); return $errors; } - wp_new_user_notification($user_id, $user_pass); + update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag. + + wp_new_user_notification( $user_id, $user_pass ); return $user_id; } @@ -305,7 +340,7 @@ if ( defined('RELOCATE') ) { // Move flag is set if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); - $schema = ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://'; + $schema = is_ssl() ? 'https://' : 'http://'; if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_option('siteurl') ) update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) ); } @@ -325,11 +360,8 @@ case 'logout' : check_admin_referer('log-out'); wp_logout(); - $redirect_to = 'wp-login.php?loggedout=true'; - if ( isset( $_REQUEST['redirect_to'] ) ) - $redirect_to = $_REQUEST['redirect_to']; - - wp_safe_redirect($redirect_to); + $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?loggedout=true'; + wp_safe_redirect( $redirect_to ); exit(); break; @@ -339,12 +371,14 @@ case 'retrievepassword' : if ( $http_post ) { $errors = retrieve_password(); if ( !is_wp_error($errors) ) { - wp_redirect('wp-login.php?checkemail=confirm'); + $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?checkemail=confirm'; + wp_safe_redirect( $redirect_to ); exit(); } } if ( isset($_GET['error']) && 'invalidkey' == $_GET['error'] ) $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.')); + $redirect_to = apply_filters( 'lostpassword_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' ); do_action('lost_password'); login_header(__('Lost Password'), '

    ' . __('Please enter your username or e-mail address. You will receive a new password via e-mail.') . '

    ', $errors); @@ -359,6 +393,7 @@ case 'retrievepassword' :

    +

    @@ -377,6 +412,7 @@ case 'retrievepassword' : @@ -398,6 +434,12 @@ case 'rp' : break; case 'register' : + if ( is_multisite() ) { + // Multisite uses wp-signup.php + wp_redirect( apply_filters( 'wp_signup_location', get_bloginfo('wpurl') . '/wp-signup.php' ) ); + exit; + } + if ( !get_option('users_can_register') ) { wp_redirect('wp-login.php?registration=disabled'); exit(); @@ -412,11 +454,13 @@ case 'register' : $user_email = $_POST['user_email']; $errors = register_new_user($user_login, $user_email); if ( !is_wp_error($errors) ) { - wp_redirect('wp-login.php?checkemail=registered'); + $redirect_to = !empty( $_POST['redirect_to'] ) ? $_POST['redirect_to'] : 'wp-login.php?checkemail=registered'; + wp_safe_redirect( $redirect_to ); exit(); } } + $redirect_to = apply_filters( 'registration_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' ); login_header(__('Registration Form'), '

    ' . __('Register For This Site') . '

    ', $errors); ?> @@ -432,6 +476,7 @@ case 'register' :


    +

    @@ -446,6 +491,7 @@ case 'register' : @@ -477,6 +523,11 @@ default: $redirect_to = admin_url(); } + $reauth = empty($_REQUEST['reauth']) ? false : true; + + // If the user was redirected to a secure login form from a non-secure admin page, and secure login is required but secure admin is not, then don't use a secure + // cookie and redirect back to the referring non-secure admin page. This allows logins to always be POSTed over SSL while allowing the user to choose visiting + // the admin via http or https. if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) ) $secure_cookie = false; @@ -484,7 +535,7 @@ default: $redirect_to = apply_filters('login_redirect', $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '', $user); - if ( !is_wp_error($user) ) { + if ( !is_wp_error($user) && !$reauth ) { if ( $interim_login ) { $message = '

    ' . __('You have logged in successfully.') . '

    '; login_header( '', $message ); ?> @@ -503,7 +554,7 @@ default: $errors = $user; // Clear errors if loggedout is set. - if ( !empty($_GET['loggedout']) ) + if ( !empty($_GET['loggedout']) || $reauth ) $errors = new WP_Error(); // If cookies are disabled we can't log in even with a valid user+pass @@ -524,13 +575,17 @@ default: elseif ( $interim_login ) $errors->add('expired', __('Your session has expired. Please log-in again.'), 'message'); + // Clear any stale cookies. + if ( $reauth ) + wp_clear_auth_cookie(); + login_header(__('Log In'), '', $errors); if ( isset($_POST['log']) ) $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr(stripslashes($_POST['log'])) : ''; + $rememberme = ! empty( $_POST['rememberme'] ); ?> -

    -

    +

    @@ -552,34 +607,41 @@ default:

    - - +

    - +
    + diff --git a/wp-mail.php b/wp-mail.php index cbc47315..69b54156 100644 --- a/wp-mail.php +++ b/wp-mail.php @@ -10,6 +10,9 @@ /** Make sure that the WordPress bootstrap has run before continuing. */ require(dirname(__FILE__) . '/wp-load.php'); +if ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) + wp_die( __( 'This action has been disabled by the administrator.' ) ); + /** Allow a plugin to do a complete takeover of Post by Email **/ do_action('wp-mail.php'); @@ -32,13 +35,18 @@ $time_difference = get_option('gmt_offset') * 3600; $phone_delim = '::'; $pop3 = new POP3(); -$count = 0; -if ( ! $pop3->connect(get_option('mailserver_url'), get_option('mailserver_port') ) || - ! $pop3->user(get_option('mailserver_login')) || - ( ! $count = $pop3->pass(get_option('mailserver_pass')) ) ) { - $pop3->quit(); - wp_die( ( 0 === $count ) ? __('There doesn’t seem to be any new mail.') : esc_html($pop3->ERROR) ); +if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) ) + wp_die( esc_html( $pop3->ERROR ) ); + +$count = $pop3->pass( get_option('mailserver_pass') ); + +if( false === $count ) + wp_die( esc_html( $pop3->ERROR ) ); + +if( 0 === $count ) { + $pop3->quit(); + wp_die( __('There doesn’t seem to be any new mail.') ); } for ( $i = 1; $i <= $count; $i++ ) { diff --git a/wp-settings.php b/wp-settings.php index 9ab9a690..473f2c6c 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -1,642 +1,200 @@ $v ) - if ( !in_array($k, $noUnset) && isset($GLOBALS[$k]) ) { - $GLOBALS[$k] = NULL; - unset($GLOBALS[$k]); - } -} +define( 'WPINC', 'wp-includes' ); -wp_unregister_GLOBALS(); +// Include files required for initialization. +require( ABSPATH . WPINC . '/load.php' ); +require( ABSPATH . WPINC . '/default-constants.php' ); +require( ABSPATH . WPINC . '/version.php' ); -unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate ); +// Set initial default constants including WP_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE. +wp_initial_constants( ); -/** - * The $blog_id global, which you can change in the config allows you to create a simple - * multiple blog installation using just one WordPress and changing $blog_id around. - * - * @global int $blog_id - * @since 2.0.0 - */ -if ( ! isset($blog_id) ) - $blog_id = 1; +// Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php. +set_magic_quotes_runtime( 0 ); +@ini_set( 'magic_quotes_sybase', 0 ); -// Fix for IIS when running with PHP ISAPI -if ( empty( $_SERVER['REQUEST_URI'] ) || ( php_sapi_name() != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) { +// Set default timezone in PHP 5. +if ( function_exists( 'date_default_timezone_set' ) ) + date_default_timezone_set( 'UTC' ); - // IIS Mod-Rewrite - if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { - $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL']; - } - // IIS Isapi_Rewrite - else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { - $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL']; - } - else - { - // Use ORIG_PATH_INFO if there is no PATH_INFO - if ( !isset($_SERVER['PATH_INFO']) && isset($_SERVER['ORIG_PATH_INFO']) ) - $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO']; - - // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice) - if ( isset($_SERVER['PATH_INFO']) ) { - if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] ) - $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO']; - else - $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO']; - } - - // Append the query string if it exists and isn't null - if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) { - $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; - } - } -} - -// Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests -if ( isset($_SERVER['SCRIPT_FILENAME']) && ( strpos($_SERVER['SCRIPT_FILENAME'], 'php.cgi') == strlen($_SERVER['SCRIPT_FILENAME']) - 7 ) ) - $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; - -// Fix for Dreamhost and other PHP as CGI hosts -if (strpos($_SERVER['SCRIPT_NAME'], 'php.cgi') !== false) - unset($_SERVER['PATH_INFO']); +// Turn register_globals off. +wp_unregister_GLOBALS(); -// Fix empty PHP_SELF -$PHP_SELF = $_SERVER['PHP_SELF']; -if ( empty($PHP_SELF) ) - $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]); +// Ensure these global variables do not exist so they do not interfere with WordPress. +unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate ); -if ( version_compare( '4.3', phpversion(), '>' ) ) { - die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %s but WordPress requires at least 4.3.'/*/WP_I18N_OLD_PHP*/, phpversion() ) ); -} +// Standardize $_SERVER variables across setups. +wp_fix_server_vars(); -if ( !defined('WP_CONTENT_DIR') ) - define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down - -if ( file_exists(ABSPATH . '.maintenance') && !defined('WP_INSTALLING') ) { - include(ABSPATH . '.maintenance'); - // If the $upgrading timestamp is older than 10 minutes, don't die. - if ( ( time() - $upgrading ) < 600 ) { - if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) { - require_once( WP_CONTENT_DIR . '/maintenance.php' ); - die(); - } - - $protocol = $_SERVER["SERVER_PROTOCOL"]; - if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol ) - $protocol = 'HTTP/1.0'; - header( "$protocol 503 Service Unavailable", true, 503 ); - header( 'Content-Type: text/html; charset=utf-8' ); - header( 'Retry-After: 600' ); -?> - - - - - Maintenance - - - -

    Briefly unavailable for scheduled maintenance. Check back in a minute.

    - - - - * $nTimePageTookToExecute = timer_stop(); - * echo $nTimePageTookToExecute; - * - * - * Or instead, you can do: - * - * timer_stop(1); - * - * which will do what the above does. If you need the result, you can assign it to a variable, but - * most cases, you only need to echo it. - * - * @since 0.71 - * @global int $timestart Seconds and Microseconds added together from when timer_start() is called - * @global int $timeend Seconds and Microseconds added together from when function is called - * - * @param int $display Use '0' or null to not echo anything and 1 to echo the total time - * @param int $precision The amount of digits from the right of the decimal to display. Default is 3. - * @return float The "second.microsecond" finished time calculation - */ -function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal - global $timestart, $timeend; - $mtime = microtime(); - $mtime = explode(' ',$mtime); - $mtime = $mtime[1] + $mtime[0]; - $timeend = $mtime; - $timetotal = $timeend-$timestart; - $r = ( function_exists('number_format_i18n') ) ? number_format_i18n($timetotal, $precision) : number_format($timetotal, $precision); - if ( $display ) - echo $r; - return $r; -} +// Start loading timer. timer_start(); -// Add define('WP_DEBUG', true); to wp-config.php to enable display of notices during development. -if ( defined('WP_DEBUG') && WP_DEBUG ) { - if ( defined('E_DEPRECATED') ) - error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT); - else - error_reporting(E_ALL); - // Add define('WP_DEBUG_DISPLAY', false); to wp-config.php to use the globally configured setting for display_errors and not force it to On - if ( ! defined('WP_DEBUG_DISPLAY') || WP_DEBUG_DISPLAY ) - ini_set('display_errors', 1); - // Add define('WP_DEBUG_LOG', true); to enable php debug logging to WP_CONTENT_DIR/debug.log - if ( defined('WP_DEBUG_LOG') && WP_DEBUG_LOG ) { - ini_set('log_errors', 1); - ini_set('error_log', WP_CONTENT_DIR . '/debug.log'); - } -} else { - define('WP_DEBUG', false); - if ( defined('E_RECOVERABLE_ERROR') ) - error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR); - else - error_reporting(E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING); -} +// Check if we're in WP_DEBUG mode. +wp_debug_mode(); -// For an advanced caching plugin to use, static because you would only want one -if ( defined('WP_CACHE') && WP_CACHE ) - @include WP_CONTENT_DIR . '/advanced-cache.php'; +// For an advanced caching plugin to use. Uses a static drop-in because you would only want one. +if ( WP_CACHE ) + WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' ); -/** - * Private - */ -if ( !defined('MEDIA_TRASH') ) - define('MEDIA_TRASH', false); +// Define WP_LANG_DIR if not set. +wp_set_lang_dir(); -/** - * Stores the location of the WordPress directory of functions, classes, and core content. - * - * @since 1.0.0 - */ -define('WPINC', 'wp-includes'); - -if ( !defined('WP_LANG_DIR') ) { - /** - * Stores the location of the language directory. First looks for language folder in WP_CONTENT_DIR - * and uses that folder if it exists. Or it uses the "languages" folder in WPINC. - * - * @since 2.1.0 - */ - if ( file_exists(WP_CONTENT_DIR . '/languages') && @is_dir(WP_CONTENT_DIR . '/languages') ) { - define('WP_LANG_DIR', WP_CONTENT_DIR . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH - if (!defined('LANGDIR')) { - // Old static relative path maintained for limited backwards compatibility - won't work in some cases - define('LANGDIR', 'wp-content/languages'); - } - } else { - define('WP_LANG_DIR', ABSPATH . WPINC . '/languages'); // no leading slash, no trailing slash, full path, not relative to ABSPATH - if (!defined('LANGDIR')) { - // Old relative path maintained for backwards compatibility - define('LANGDIR', WPINC . '/languages'); - } - } -} - -require (ABSPATH . WPINC . '/compat.php'); -require (ABSPATH . WPINC . '/functions.php'); -require (ABSPATH . WPINC . '/classes.php'); +// Load early WordPress files. +require( ABSPATH . WPINC . '/compat.php' ); +require( ABSPATH . WPINC . '/functions.php' ); +require( ABSPATH . WPINC . '/classes.php' ); +// Include the wpdb class, or a db.php database drop-in if present. require_wp_db(); -if ( !empty($wpdb->error) ) - dead_db(); - -/** - * Format specifiers for DB columns. Columns not listed here default to %s. - * @since 2.8.0 - * @see wpdb:$field_types - * @see wpdb:prepare() - * @see wpdb:insert() - * @see wpdb:update() - */ -$wpdb->field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d', - 'parent' => '%d', 'count' => '%d','object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'commment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d', - 'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d', - 'user_status' => '%d', 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d'); +// Set the database table prefix and the format specifiers for database table columns. +wp_set_wpdb_vars(); -$prefix = $wpdb->set_prefix($table_prefix); +// Start the WordPress object cache, or an external object cache if the drop-in is present. +wp_start_object_cache(); -if ( is_wp_error($prefix) ) - wp_die(/*WP_I18N_BAD_PREFIX*/'ERROR: $table_prefix in wp-config.php can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/); +// Load early WordPress files. +require( ABSPATH . WPINC . '/plugin.php' ); +require( ABSPATH . WPINC . '/default-filters.php' ); +require( ABSPATH . WPINC . '/pomo/mo.php' ); -/** - * Copy an object. - * - * Returns a cloned copy of an object. - * - * @since 2.7.0 - * - * @param object $object The object to clone - * @return object The cloned object - */ -function wp_clone( $object ) { - static $can_clone; - if ( !isset( $can_clone ) ) { - $can_clone = version_compare( phpversion(), '5.0', '>=' ); - } - return $can_clone ? clone( $object ) : $object; +// Initialize multisite if enabled. +if ( is_multisite() ) { + require( ABSPATH . WPINC . '/ms-blogs.php' ); + require( ABSPATH . WPINC . '/ms-settings.php' ); +} elseif ( ! defined( 'MULTISITE' ) ) { + define( 'MULTISITE', false ); } -/** - * Whether the current request is in WordPress admin Panel - * - * Does not inform on whether the user is an admin! Use capability checks to - * tell if the user should be accessing a section or not. - * - * @since 1.5.1 - * - * @return bool True if inside WordPress administration pages. - */ -function is_admin() { - if ( defined('WP_ADMIN') ) - return WP_ADMIN; +// Stop most of WordPress from being loaded if we just want the basics. +if ( SHORTINIT ) return false; -} -if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) { - require_once (WP_CONTENT_DIR . '/object-cache.php'); - $_wp_using_ext_object_cache = true; -} else { - require_once (ABSPATH . WPINC . '/cache.php'); - $_wp_using_ext_object_cache = false; +// Load the l18n library. +require( ABSPATH . WPINC . '/l10n.php' ); + +// Run the installer if WordPress is not installed. +wp_not_installed(); + +// Load most of WordPress. +require( ABSPATH . WPINC . '/formatting.php' ); +require( ABSPATH . WPINC . '/capabilities.php' ); +require( ABSPATH . WPINC . '/query.php' ); +require( ABSPATH . WPINC . '/theme.php' ); +require( ABSPATH . WPINC . '/user.php' ); +require( ABSPATH . WPINC . '/meta.php' ); +require( ABSPATH . WPINC . '/general-template.php' ); +require( ABSPATH . WPINC . '/link-template.php' ); +require( ABSPATH . WPINC . '/author-template.php' ); +require( ABSPATH . WPINC . '/post.php' ); +require( ABSPATH . WPINC . '/post-template.php' ); +require( ABSPATH . WPINC . '/category.php' ); +require( ABSPATH . WPINC . '/category-template.php' ); +require( ABSPATH . WPINC . '/comment.php' ); +require( ABSPATH . WPINC . '/comment-template.php' ); +require( ABSPATH . WPINC . '/rewrite.php' ); +require( ABSPATH . WPINC . '/feed.php' ); +require( ABSPATH . WPINC . '/bookmark.php' ); +require( ABSPATH . WPINC . '/bookmark-template.php' ); +require( ABSPATH . WPINC . '/kses.php' ); +require( ABSPATH . WPINC . '/cron.php' ); +require( ABSPATH . WPINC . '/deprecated.php' ); +require( ABSPATH . WPINC . '/script-loader.php' ); +require( ABSPATH . WPINC . '/taxonomy.php' ); +require( ABSPATH . WPINC . '/update.php' ); +require( ABSPATH . WPINC . '/canonical.php' ); +require( ABSPATH . WPINC . '/shortcodes.php' ); +require( ABSPATH . WPINC . '/media.php' ); +require( ABSPATH . WPINC . '/http.php' ); +require( ABSPATH . WPINC . '/class-http.php' ); +require( ABSPATH . WPINC . '/widgets.php' ); +require( ABSPATH . WPINC . '/nav-menu.php' ); +require( ABSPATH . WPINC . '/nav-menu-template.php' ); + +// Load multisite-specific files. +if ( is_multisite() ) { + require( ABSPATH . WPINC . '/ms-functions.php' ); + require( ABSPATH . WPINC . '/ms-default-filters.php' ); + require( ABSPATH . WPINC . '/ms-deprecated.php' ); } -wp_cache_init(); -if ( function_exists('wp_cache_add_global_groups') ) { - wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-transient')); - wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' )); -} - -require (ABSPATH . WPINC . '/plugin.php'); -require (ABSPATH . WPINC . '/default-filters.php'); -include_once(ABSPATH . WPINC . '/pomo/mo.php'); -require_once (ABSPATH . WPINC . '/l10n.php'); - -if ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) { - if ( defined('WP_SITEURL') ) - $link = WP_SITEURL . '/wp-admin/install.php'; - elseif (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) - $link = preg_replace('|/wp-admin/?.*?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php'; - else - $link = preg_replace('|/[^/]+?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php'; - require_once(ABSPATH . WPINC . '/kses.php'); - require_once(ABSPATH . WPINC . '/pluggable.php'); - require_once(ABSPATH . WPINC . '/formatting.php'); - wp_redirect($link); - die(); // have to die here ~ Mark -} - -require (ABSPATH . WPINC . '/formatting.php'); -require (ABSPATH . WPINC . '/capabilities.php'); -require (ABSPATH . WPINC . '/query.php'); -require (ABSPATH . WPINC . '/theme.php'); -require (ABSPATH . WPINC . '/user.php'); -require (ABSPATH . WPINC . '/meta.php'); -require (ABSPATH . WPINC . '/general-template.php'); -require (ABSPATH . WPINC . '/link-template.php'); -require (ABSPATH . WPINC . '/author-template.php'); -require (ABSPATH . WPINC . '/post.php'); -require (ABSPATH . WPINC . '/post-template.php'); -require (ABSPATH . WPINC . '/category.php'); -require (ABSPATH . WPINC . '/category-template.php'); -require (ABSPATH . WPINC . '/comment.php'); -require (ABSPATH . WPINC . '/comment-template.php'); -require (ABSPATH . WPINC . '/rewrite.php'); -require (ABSPATH . WPINC . '/feed.php'); -require (ABSPATH . WPINC . '/bookmark.php'); -require (ABSPATH . WPINC . '/bookmark-template.php'); -require (ABSPATH . WPINC . '/kses.php'); -require (ABSPATH . WPINC . '/cron.php'); -require (ABSPATH . WPINC . '/version.php'); -require (ABSPATH . WPINC . '/deprecated.php'); -require (ABSPATH . WPINC . '/script-loader.php'); -require (ABSPATH . WPINC . '/taxonomy.php'); -require (ABSPATH . WPINC . '/update.php'); -require (ABSPATH . WPINC . '/canonical.php'); -require (ABSPATH . WPINC . '/shortcodes.php'); -require (ABSPATH . WPINC . '/media.php'); -require (ABSPATH . WPINC . '/http.php'); -require (ABSPATH . WPINC . '/widgets.php'); - -if ( !defined('WP_CONTENT_URL') ) - define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up - -/** - * Allows for the plugins directory to be moved from the default location. - * - * @since 2.6.0 - */ -if ( !defined('WP_PLUGIN_DIR') ) - define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash - -/** - * Allows for the plugins directory to be moved from the default location. - * - * @since 2.6.0 - */ -if ( !defined('WP_PLUGIN_URL') ) - define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash - -/** - * Allows for the plugins directory to be moved from the default location. - * - * @since 2.1.0 - */ -if ( !defined('PLUGINDIR') ) - define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. - -/** - * Allows for the mu-plugins directory to be moved from the default location. - * - * @since 2.8.0 - */ -if ( !defined('WPMU_PLUGIN_DIR') ) - define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash - -/** - * Allows for the mu-plugins directory to be moved from the default location. - * - * @since 2.8.0 - */ -if ( !defined('WPMU_PLUGIN_URL') ) - define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash +// Define constants that rely on the API to obtain the default value. +// Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. +wp_plugin_directory_constants( ); -/** - * Allows for the mu-plugins directory to be moved from the default location. - * - * @since 2.8.0 - */ -if ( !defined( 'MUPLUGINDIR' ) ) - define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat. - -if ( is_dir( WPMU_PLUGIN_DIR ) ) { - if ( $dh = opendir( WPMU_PLUGIN_DIR ) ) { - while ( ( $plugin = readdir( $dh ) ) !== false ) { - if ( substr( $plugin, -4 ) == '.php' ) { - include_once( WPMU_PLUGIN_DIR . '/' . $plugin ); - } - } - } +// Load must-use plugins. +foreach ( wp_get_mu_plugins() as $mu_plugin ) { + include_once( $mu_plugin ); } -do_action('muplugins_loaded'); - -/** - * Used to guarantee unique hash cookies - * @since 1.5 - */ -define('COOKIEHASH', md5(get_option('siteurl'))); - -/** - * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php - * @since 2.5.0 - */ -$wp_default_secret_key = 'put your unique phrase here'; - -/** - * It is possible to define this in wp-config.php - * @since 2.0.0 - */ -if ( !defined('USER_COOKIE') ) - define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH); - -/** - * It is possible to define this in wp-config.php - * @since 2.0.0 - */ -if ( !defined('PASS_COOKIE') ) - define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH); - -/** - * It is possible to define this in wp-config.php - * @since 2.5.0 - */ -if ( !defined('AUTH_COOKIE') ) - define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH); +unset( $mu_plugin ); -/** - * It is possible to define this in wp-config.php - * @since 2.6.0 - */ -if ( !defined('SECURE_AUTH_COOKIE') ) - define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH); +do_action( 'muplugins_loaded' ); -/** - * It is possible to define this in wp-config.php - * @since 2.6.0 - */ -if ( !defined('LOGGED_IN_COOKIE') ) - define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH); +if ( is_multisite() ) + ms_cookie_constants( ); -/** - * It is possible to define this in wp-config.php - * @since 2.3.0 - */ -if ( !defined('TEST_COOKIE') ) - define('TEST_COOKIE', 'wordpress_test_cookie'); +// Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies(). +wp_cookie_constants( ); -/** - * It is possible to define this in wp-config.php - * @since 1.2.0 - */ -if ( !defined('COOKIEPATH') ) - define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); +// Define and enforce our SSL constants +wp_ssl_constants( ); -/** - * It is possible to define this in wp-config.php - * @since 1.5.0 - */ -if ( !defined('SITECOOKIEPATH') ) - define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); +// Create common globals. +require( ABSPATH . WPINC . '/vars.php' ); -/** - * It is possible to define this in wp-config.php - * @since 2.6.0 - */ -if ( !defined('ADMIN_COOKIE_PATH') ) - define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); - -/** - * It is possible to define this in wp-config.php - * @since 2.6.0 - */ -if ( !defined('PLUGINS_COOKIE_PATH') ) - define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) ); - -/** - * It is possible to define this in wp-config.php - * @since 2.0.0 - */ -if ( !defined('COOKIE_DOMAIN') ) - define('COOKIE_DOMAIN', false); - -/** - * It is possible to define this in wp-config.php - * @since 2.6.0 - */ -if ( !defined('FORCE_SSL_ADMIN') ) - define('FORCE_SSL_ADMIN', false); -force_ssl_admin(FORCE_SSL_ADMIN); - -/** - * It is possible to define this in wp-config.php - * @since 2.6.0 - */ -if ( !defined('FORCE_SSL_LOGIN') ) - define('FORCE_SSL_LOGIN', false); -force_ssl_login(FORCE_SSL_LOGIN); - -/** - * It is possible to define this in wp-config.php - * @since 2.5.0 - */ -if ( !defined( 'AUTOSAVE_INTERVAL' ) ) - define( 'AUTOSAVE_INTERVAL', 60 ); - -/** - * It is possible to define this in wp-config.php - * @since 2.9.0 - */ -if ( !defined( 'EMPTY_TRASH_DAYS' ) ) - define( 'EMPTY_TRASH_DAYS', 30 ); - -require (ABSPATH . WPINC . '/vars.php'); - -// make taxonomies available to plugins and themes -// @plugin authors: warning: this gets registered again on the init hook +// Make taxonomies and posts available to plugins and themes. +// @plugin authors: warning: these get registered again on the init hook. create_initial_taxonomies(); +create_initial_post_types(); -// Check for hacks file if the option is enabled -if ( get_option('hack_file') ) { - if ( file_exists(ABSPATH . 'my-hacks.php') ) - require(ABSPATH . 'my-hacks.php'); -} - -$current_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins' ) ); -if ( is_array($current_plugins) && !defined('WP_INSTALLING') ) { - foreach ( $current_plugins as $plugin ) { - // check the $plugin filename - // Validate plugin filename - if ( validate_file($plugin) // $plugin must validate as file - || '.php' != substr($plugin, -4) // $plugin must end with '.php' - || !file_exists(WP_PLUGIN_DIR . '/' . $plugin) // $plugin must exist - ) - continue; - - include_once(WP_PLUGIN_DIR . '/' . $plugin); - } - unset($plugin); -} -unset($current_plugins); +// Load active plugins. +foreach ( wp_get_active_and_valid_plugins() as $plugin ) + include_once( $plugin ); +unset( $plugin ); -require (ABSPATH . WPINC . '/pluggable.php'); +// Load pluggable functions. +require( ABSPATH . WPINC . '/pluggable.php' ); +require( ABSPATH . WPINC . '/pluggable-deprecated.php' ); -/* - * In most cases the default internal encoding is latin1, which is of no use, - * since we want to use the mb_ functions for utf-8 strings - */ -if (function_exists('mb_internal_encoding')) { - if (!@mb_internal_encoding(get_option('blog_charset'))) - mb_internal_encoding('UTF-8'); -} +// Set internal encoding. +wp_set_internal_encoding(); - -if ( defined('WP_CACHE') && function_exists('wp_cache_postload') ) +// Run wp_cache_postload() if object cache is enabled and the function exists. +if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) wp_cache_postload(); -do_action('plugins_loaded'); - -$default_constants = array( 'WP_POST_REVISIONS' => true ); -foreach ( $default_constants as $c => $v ) - @define( $c, $v ); // will fail if the constant is already defined -unset($default_constants, $c, $v); +do_action( 'plugins_loaded' ); -// If already slashed, strip. -if ( get_magic_quotes_gpc() ) { - $_GET = stripslashes_deep($_GET ); - $_POST = stripslashes_deep($_POST ); - $_COOKIE = stripslashes_deep($_COOKIE); -} +// Define constants which affect functionality if not already defined. +wp_functionality_constants( ); -// Escape with wpdb. -$_GET = add_magic_quotes($_GET ); -$_POST = add_magic_quotes($_POST ); -$_COOKIE = add_magic_quotes($_COOKIE); -$_SERVER = add_magic_quotes($_SERVER); +// Add magic quotes and set up $_REQUEST ( $_GET + $_POST ) +wp_magic_quotes(); -// Force REQUEST to be GET + POST. If SERVER, COOKIE, or ENV are needed, use those superglobals directly. -$_REQUEST = array_merge($_GET, $_POST); - -do_action('sanitize_comment_cookies'); +do_action( 'sanitize_comment_cookies' ); /** * WordPress Query object @@ -651,21 +209,21 @@ $wp_the_query =& new WP_Query(); * @global object $wp_query * @since 1.5.0 */ -$wp_query =& $wp_the_query; +$wp_query =& $wp_the_query; /** * Holds the WordPress Rewrite object for creating pretty URLs * @global object $wp_rewrite * @since 1.5.0 */ -$wp_rewrite =& new WP_Rewrite(); +$wp_rewrite =& new WP_Rewrite(); /** * WordPress Object * @global object $wp * @since 2.0.0 */ -$wp =& new WP(); +$wp =& new WP(); /** * WordPress Widget Factory Object @@ -674,34 +232,23 @@ $wp =& new WP(); */ $wp_widget_factory =& new WP_Widget_Factory(); -do_action('setup_theme'); +do_action( 'setup_theme' ); -/** - * Web Path to the current active template directory - * @since 1.5.0 - */ -define('TEMPLATEPATH', get_template_directory()); - -/** - * Web Path to the current active template stylesheet directory - * @since 2.1.0 - */ -define('STYLESHEETPATH', get_stylesheet_directory()); +// Define the template related constants. +wp_templating_constants( ); // Load the default text localization domain. load_default_textdomain(); -/** - * The locale of the blog - * @since 1.5.0 - */ +// Find the blog locale. $locale = get_locale(); $locale_file = WP_LANG_DIR . "/$locale.php"; -if ( is_readable($locale_file) ) - require_once($locale_file); +if ( is_readable( $locale_file ) ) + require( $locale_file ); +unset($locale_file); // Pull in locale data after loading text domain. -require_once(ABSPATH . WPINC . '/locale.php'); +require( ABSPATH . WPINC . '/locale.php' ); /** * WordPress Locale object for loading locale domain date and various strings. @@ -710,30 +257,49 @@ require_once(ABSPATH . WPINC . '/locale.php'); */ $wp_locale =& new WP_Locale(); -// Load functions for active theme. -if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/functions.php') ) - include(STYLESHEETPATH . '/functions.php'); -if ( file_exists(TEMPLATEPATH . '/functions.php') ) - include(TEMPLATEPATH . '/functions.php'); +// Load the functions for the active theme, for both parent and child theme if applicable. +if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) + include( STYLESHEETPATH . '/functions.php' ); +if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) + include( TEMPLATEPATH . '/functions.php' ); -// Load in support for template functions which the theme supports +do_action( 'after_setup_theme' ); + +// Load any template functions the theme supports. require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-thumbnail-template.php' ); +register_shutdown_function( 'shutdown_action_hook' ); + +// Set up current user. +$wp->init(); + /** - * Runs just before PHP shuts down execution. + * Most of WP is loaded at this stage, and the user is authenticated. WP continues + * to load on the init hook that follows (e.g. widgets), and many plugins instantiate + * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.). * - * @access private - * @since 1.2.0 + * If you wish to plug an action once WP is loaded, use the wp_loaded hook below. */ -function shutdown_action_hook() { - do_action('shutdown'); - wp_cache_close(); -} -register_shutdown_function('shutdown_action_hook'); - -$wp->init(); // Sets up current user. +do_action( 'init' ); -// Everything is loaded and initialized. -do_action('init'); +// Check site status +if ( is_multisite() ) { + if ( true !== ( $file = ms_site_check() ) ) { + require( $file ); + die(); + } + unset($file); +} +/** + * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated. + * + * AJAX requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for + * users not logged in. + * + * @link http://codex.wordpress.org/AJAX_in_Plugins + * + * @since 3.0.0 + */ +do_action('wp_loaded'); ?> diff --git a/wp-signup.php b/wp-signup.php new file mode 100644 index 00000000..cbea1268 --- /dev/null +++ b/wp-signup.php @@ -0,0 +1,456 @@ +\n"; +} + +if ( !is_multisite() ) { + wp_redirect( get_option( 'siteurl' ) . "/wp-login.php?action=register" ); + die(); +} + +if ( !is_main_site() ) { + wp_redirect( network_home_url( 'wp-signup.php' ) ); + die(); +} + +// Fix for page title +$wp_query->is_404 = false; + +function wpmu_signup_stylesheet() { + ?> + + +
    +
    +' . __('Site Name:') . ''; + else + echo ''; + + if ( $errmsg = $errors->get_error_message('blogname') ) { ?> +

    + ' . $current_site->domain . $current_site->path . '
    '; + else + echo '.' . ( $site_domain = preg_replace( '|^www\.|', '', $current_site->domain ) ) . '
    '; + + if ( !is_user_logged_in() ) { + print '(' . __( 'Your address will be ' ); + if ( !is_subdomain_install() ) + print $current_site->domain . $current_site->path . __( 'sitename' ); + else + print __( 'domain.' ) . $site_domain . $current_site->path; + echo '.) ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) . '

    '; + } + + // Blog Title + ?> + + get_error_message('blog_title') ) { ?> +

    + '; + ?> + +
    +

    + + +
    + + +

    +
    + + ' . __('Username:') . ''; + if ( $errmsg = $errors->get_error_message('user_name') ) { + echo '

    '.$errmsg.'

    '; + } + echo '
    '; + _e( '(Must be at least 4 characters, letters and numbers only.)' ); + ?> + + + get_error_message('user_email') ) { ?> +

    + +
    + get_error_message('generic') ) { + echo '

    ' . $errmsg . '

    '; + } + do_action( 'signup_extra_fields', $errors ); +} + +function validate_user_form() { + return wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']); +} + +function signup_another_blog($blogname = '', $blog_title = '', $errors = '') { + global $current_user, $current_site; + + if ( ! is_wp_error($errors) ) { + $errors = new WP_Error(); + } + + // allow definition of default variables + $filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors )); + $blogname = $filtered_results['blogname']; + $blog_title = $filtered_results['blog_title']; + $errors = $filtered_results['errors']; + + echo '

    ' . sprintf( __( 'Get another %s site in seconds' ), $current_site->site_name ) . '

    '; + + if ( $errors->get_error_code() ) { + echo '

    ' . __( 'There was a problem, please correct the form below and try again.' ) . '

    '; + } + ?> +

    add another site to your account. There is no limit to the number of sites you can have, so create to your heart’s content, but write responsibly!' ), $current_user->display_name ) ?>

    + + ID); + if ( !empty($blogs) ) { ?> + +

    + + + +

    +
    + + + +

    +
    + get_error_code() ) { + signup_another_blog($blogname, $blog_title, $errors); + return false; + } + + $public = (int) $_POST['blog_public']; + $meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); // deprecated + $meta = apply_filters( 'add_signup_meta', $meta ); + + wpmu_create_blog( $domain, $path, $blog_title, $current_user->id, $meta, $wpdb->siteid ); + confirm_another_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta); + return true; +} + +function confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email = '', $meta = '') { + ?> +

    {$blog_title}" ) ?>

    +

    + http://%2$s is your new site. Log in as “%4$s” using your existing password.' ), $domain.$path, $domain.$path, "http://" . $domain.$path . "wp-login.php", $user_name ) ?> +

    + $user_name, 'user_email' => $user_email, 'errors' => $errors )); + $user_name = $filtered_results['user_name']; + $user_email = $filtered_results['user_email']; + $errors = $filtered_results['errors']; + + ?> + +

    site_name ) ?>

    +
    + + + + +

    + + + + + + /> + +
    + /> + + +

    + +

    +
    + get_error_code() ) { + signup_user($user_name, $user_email, $errors); + return false; + } + + if ( 'blog' == $_POST['signup_for'] ) { + signup_blog($user_name, $user_email); + return false; + } + + wpmu_signup_user($user_name, $user_email, apply_filters( "add_signup_meta", array() ) ); + + confirm_user_signup($user_name, $user_email); + return true; +} + +function confirm_user_signup($user_name, $user_email) { + ?> +

    +

    you must activate it.' ) ?>

    +

    %1$s and click the link given.' ), $user_email) ?>

    +

    + $user_name, 'user_email' => $user_email, 'blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors )); + $user_name = $filtered_results['user_name']; + $user_email = $filtered_results['user_email']; + $blogname = $filtered_results['blogname']; + $blog_title = $filtered_results['blog_title']; + $errors = $filtered_results['errors']; + + if ( empty($blogname) ) + $blogname = $user_name; + ?> +
    + + + + + +

    +
    + get_error_code() ) { + signup_user($user_name, $user_email, $errors); + return false; + } + + $result = wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title']); + extract($result); + + if ( $errors->get_error_code() ) { + signup_blog($user_name, $user_email, $blogname, $blog_title, $errors); + return false; + } + + $public = (int) $_POST['blog_public']; + $meta = array ('lang_id' => 1, 'public' => $public); + $meta = apply_filters( "add_signup_meta", $meta ); + + wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta); + confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta); + return true; +} + +function confirm_blog_signup($domain, $path, $blog_title, $user_name = '', $user_email = '', $meta) { + ?> +

    {$blog_title}" ) ?>

    + +

    you must activate it.' ) ?>

    +

    %s and click the link given.' ), $user_email) ?>

    +

    +

    +

    + +

      +
    • +
    • +
    • +
    +

    + ' . sprintf( __( 'Greetings Site Administrator! You are currently allowing “%s” registrations. To change or disable registration go to your Options page.' ), $i18n_signup[$active_signup], esc_url( network_admin_url( 'ms-options.php' ) ) ) . '
    '; + +$newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null; + +$current_user = wp_get_current_user(); +if ( $active_signup == "none" ) { + _e( 'Registration has been disabled.' ); +} elseif ( $active_signup == 'blog' && !is_user_logged_in() ) { + if ( is_ssl() ) + $proto = 'https://'; + else + $proto = 'http://'; + $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode($proto . $_SERVER['HTTP_HOST'] . '/wp-signup.php' )); + echo sprintf( __( 'You must first log in, and then you can create a new site.' ), $login_url ); +} else { + $stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default'; + switch ( $stage ) { + case 'validate-user-signup' : + if ( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' ) + validate_user_signup(); + else + _e( 'User registration has been disabled.' ); + break; + case 'validate-blog-signup': + if ( $active_signup == 'all' || $active_signup == 'blog' ) + validate_blog_signup(); + else + _e( 'Site registration has been disabled.' ); + break; + case 'gimmeanotherblog': + validate_another_blog_signup(); + break; + case 'default': + default : + $user_email = isset( $_POST[ 'user_email' ] ) ? $_POST[ 'user_email' ] : ''; + do_action( "preprocess_signup_form" ); // populate the form from invites, elsewhere? + if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) + signup_another_blog($newblogname); + elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) ) + signup_user( $newblogname, $user_email ); + elseif ( is_user_logged_in() == false && ( $active_signup == 'blog' ) ) + _e( 'Sorry, new registrations are not allowed at this time.' ); + else + _e( 'You are logged in already. No need to register again!' ); + + if ( $newblogname ) { + $newblog = get_blogaddress_by_name( $newblogname ); + + if ( $active_signup == 'blog' || $active_signup == 'all' ) + printf( __( '

    The site you were looking for, %s does not exist, but you can create it now!

    ' ), $newblog ); + else + printf( __( '

    The site you were looking for, %s, does not exist.

    ' ), $newblog ); + } + break; + } +} +?> +
    +
    + + + diff --git a/wp-trackback.php b/wp-trackback.php index 864da720..737fbcec 100644 --- a/wp-trackback.php +++ b/wp-trackback.php @@ -7,13 +7,13 @@ if (empty($wp)) { require_once('./wp-load.php'); - wp('tb=1'); + wp( array( 'tb' => '1' ) ); } /** * trackback_response() - Respond with error or success XML message * - * @param int|bool $error Whether there was an error or not + * @param int|bool $error Whether there was an error * @param string $error_message Error message if an error occurred */ function trackback_response($error = 0, $error_message = '') { diff --git a/xmlrpc.php b/xmlrpc.php index 8e683b75..fd471f26 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -246,7 +246,7 @@ class wp_xmlrpc_server extends IXR_Server { */ function login_pass_ok($user_login, $user_pass) { if ( !get_option( 'enable_xmlrpc' ) ) { - $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this blog. An admin user can enable them at %s'), admin_url('options-writing.php') ) ); + $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site. An admin user can enable them at %s'), admin_url('options-writing.php') ) ); return false; } @@ -268,7 +268,7 @@ class wp_xmlrpc_server extends IXR_Server { */ function login($username, $password) { if ( !get_option( 'enable_xmlrpc' ) ) { - $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this blog. An admin user can enable them at %s'), admin_url('options-writing.php') ) ); + $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site. An admin user can enable them at %s'), admin_url('options-writing.php') ) ); return false; } @@ -279,7 +279,7 @@ class wp_xmlrpc_server extends IXR_Server { return false; } - set_current_user( $user->ID ); + wp_set_current_user( $user->ID ); return $user; } @@ -294,14 +294,13 @@ class wp_xmlrpc_server extends IXR_Server { function escape(&$array) { global $wpdb; - if(!is_array($array)) { + if (!is_array($array)) { return($wpdb->escape($array)); - } - else { + } else { foreach ( (array) $array as $k => $v ) { - if (is_array($v)) { + if ( is_array($v) ) { $this->escape($array[$k]); - } else if (is_object($v)) { + } else if ( is_object($v) ) { //skip } else { $array[$k] = $wpdb->escape($v); @@ -370,7 +369,7 @@ class wp_xmlrpc_server extends IXR_Server { } /** - * Setup blog options property. + * Set up blog options property. * * Passes property through 'xmlrpc_blog_options' filter. * @@ -392,7 +391,7 @@ class wp_xmlrpc_server extends IXR_Server { 'value' => $wp_version ), 'blog_url' => array( - 'desc' => __( 'Blog URL' ), + 'desc' => __( 'Site URL' ), 'readonly' => true, 'option' => 'siteurl' ), @@ -404,12 +403,12 @@ class wp_xmlrpc_server extends IXR_Server { 'option' => 'gmt_offset' ), 'blog_title' => array( - 'desc' => __( 'Blog Title' ), + 'desc' => __( 'Site Title' ), 'readonly' => false, 'option' => 'blogname' ), 'blog_tagline' => array( - 'desc' => __( 'Blog Tagline' ), + 'desc' => __( 'Site Tagline' ), 'readonly' => false, 'option' => 'blogdescription' ), @@ -442,8 +441,9 @@ class wp_xmlrpc_server extends IXR_Server { * @return array */ function wp_getUsersBlogs( $args ) { + global $current_site; // If this isn't on WPMU then just use blogger_getUsersBlogs - if( !function_exists( 'is_site_admin' ) ) { + if ( !is_multisite() ) { array_unshift( $args, 1 ); return $this->blogger_getUsersBlogs( $args ); } @@ -453,23 +453,23 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[0]; $password = $args[1]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } + do_action( 'xmlrpc_call', 'wp.getUsersBlogs' ); $blogs = (array) get_blogs_of_user( $user->ID ); $struct = array( ); - foreach( $blogs as $blog ) { + foreach ( $blogs as $blog ) { // Don't include blogs that aren't hosted at this site - if( $blog->site_id != $current_site->id ) + if ( $blog->site_id != $current_site->id ) continue; $blog_id = $blog->userblog_id; switch_to_blog($blog_id); - $is_admin = current_user_can('level_8'); + $is_admin = current_user_can('manage_options'); $struct[] = array( 'isAdmin' => $is_admin, @@ -505,7 +505,7 @@ class wp_xmlrpc_server extends IXR_Server { return $this->error; } - if( !current_user_can( 'edit_page', $page_id ) ) + if ( !current_user_can( 'edit_page', $page_id ) ) return new IXR_Error( 401, __( 'Sorry, you cannot edit this page.' ) ); do_action('xmlrpc_call', 'wp.getPage'); @@ -514,14 +514,14 @@ class wp_xmlrpc_server extends IXR_Server { $page = get_page($page_id); // If we found the page then format the data. - if($page->ID && ($page->post_type == "page")) { + if ( $page->ID && ($page->post_type == "page") ) { // Get all of the page content and link. $full_page = get_extended($page->post_content); $link = post_permalink($page->ID); // Get info the page parent if there is one. $parent_title = ""; - if(!empty($page->post_parent)) { + if ( !empty($page->post_parent) ) { $parent = get_page($page->post_parent); $parent_title = $parent->post_title; } @@ -535,13 +535,12 @@ class wp_xmlrpc_server extends IXR_Server { $page_date_gmt = mysql2date("Ymd\TH:i:s", $page->post_date_gmt, false); // For drafts use the GMT version of the date - if ( $page->post_status == 'draft' ) { + if ( $page->post_status == 'draft' ) $page_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $page->post_date ), 'Ymd\TH:i:s' ); - } // Pull the categories info together. $categories = array(); - foreach(wp_get_post_categories($page->ID) as $cat_id) { + foreach ( wp_get_post_categories($page->ID) as $cat_id ) { $categories[] = get_cat_name($cat_id); } @@ -549,7 +548,7 @@ class wp_xmlrpc_server extends IXR_Server { $author = get_userdata($page->post_author); $page_template = get_post_meta( $page->ID, '_wp_page_template', true ); - if( empty( $page_template ) ) + if ( empty( $page_template ) ) $page_template = 'default'; $page_struct = array( @@ -603,11 +602,10 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[2]; $num_pages = isset($args[3]) ? (int) $args[3] : 10; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_pages' ) ) + if ( !current_user_can( 'edit_pages' ) ) return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) ); do_action('xmlrpc_call', 'wp.getPages'); @@ -616,10 +614,10 @@ class wp_xmlrpc_server extends IXR_Server { $num_pages = count($pages); // If we have pages, put together their info. - if($num_pages >= 1) { + if ( $num_pages >= 1 ) { $pages_struct = array(); - for($i = 0; $i < $num_pages; $i++) { + for ( $i = 0; $i < $num_pages; $i++ ) { $page = wp_xmlrpc_server::wp_getPage(array( $blog_id, $pages[$i]->ID, $username, $password )); @@ -649,16 +647,14 @@ class wp_xmlrpc_server extends IXR_Server { $page = $args[3]; $publish = $args[4]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'wp.newPage'); // Make sure the user is allowed to add new pages. - if(!current_user_can("publish_pages")) { + if ( !current_user_can("publish_pages") ) return(new IXR_Error(401, __("Sorry, you cannot add new pages."))); - } // Mark this as content for a page. $args[3]["post_type"] = "page"; @@ -683,32 +679,25 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[2]; $page_id = (int) $args[3]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'wp.deletePage'); // Get the current page based on the page_id and // make sure it is a page and not a post. $actual_page = wp_get_single_post($page_id, ARRAY_A); - if( - !$actual_page - || ($actual_page["post_type"] != "page") - ) { + if ( !$actual_page || ($actual_page["post_type"] != "page") ) return(new IXR_Error(404, __("Sorry, no such page."))); - } // Make sure the user can delete pages. - if(!current_user_can("delete_page", $page_id)) { + if ( !current_user_can("delete_page", $page_id) ) return(new IXR_Error(401, __("Sorry, you do not have the right to delete this page."))); - } // Attempt to delete the page. $result = wp_delete_post($page_id); - if(!$result) { + if ( !$result ) return(new IXR_Error(500, __("Failed to delete the page."))); - } return(true); } @@ -730,25 +719,19 @@ class wp_xmlrpc_server extends IXR_Server { $content = $args[4]; $publish = $args[5]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'wp.editPage'); // Get the page data and make sure it is a page. $actual_page = wp_get_single_post($page_id, ARRAY_A); - if( - !$actual_page - || ($actual_page["post_type"] != "page") - ) { + if ( !$actual_page || ($actual_page["post_type"] != "page") ) return(new IXR_Error(404, __("Sorry, no such page."))); - } // Make sure the user is allowed to edit pages. - if(!current_user_can("edit_page", $page_id)) { + if ( !current_user_can("edit_page", $page_id) ) return(new IXR_Error(401, __("Sorry, you do not have the right to edit this page."))); - } // Mark this as content for a page. $content["post_type"] = "page"; @@ -783,11 +766,10 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[1]; $password = $args[2]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_pages' ) ) + if ( !current_user_can( 'edit_pages' ) ) return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) ); do_action('xmlrpc_call', 'wp.getPageList'); @@ -807,7 +789,7 @@ class wp_xmlrpc_server extends IXR_Server { // The date needs to be formated properly. $num_pages = count($page_list); - for($i = 0; $i < $num_pages; $i++) { + for ( $i = 0; $i < $num_pages; $i++ ) { $post_date = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date, false); $post_date_gmt = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date_gmt, false); @@ -844,18 +826,16 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[1]; $password = $args[2]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if(!current_user_can("edit_posts")) { - return(new IXR_Error(401, __("Sorry, you cannot edit posts on this blog."))); - } + if ( !current_user_can("edit_posts") ) + return(new IXR_Error(401, __("Sorry, you cannot edit posts on this site."))); do_action('xmlrpc_call', 'wp.getAuthors'); $authors = array(); - foreach( (array) get_users_of_blog() as $row ) { + foreach ( (array) get_users_of_blog() as $row ) { $authors[] = array( "user_id" => $row->user_id, "user_login" => $row->user_login, @@ -881,19 +861,17 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[1]; $password = $args[2]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_posts' ) ) { - return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this blog in order to view tags.' ) ); - } + if ( !current_user_can( 'edit_posts' ) ) + return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view tags.' ) ); do_action( 'xmlrpc_call', 'wp.getKeywords' ); $tags = array( ); - if( $all_tags = get_tags( ) ) { + if ( $all_tags = get_tags() ) { foreach( (array) $all_tags as $tag ) { $struct['tag_id'] = $tag->term_id; $struct['name'] = $tag->name; @@ -925,22 +903,19 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[2]; $category = $args[3]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'wp.newCategory'); // Make sure the user is allowed to add a category. - if(!current_user_can("manage_categories")) { + if ( !current_user_can("manage_categories") ) return(new IXR_Error(401, __("Sorry, you do not have the right to add a category."))); - } // If no slug was provided make it empty so that // WordPress will generate one. - if(empty($category["slug"])) { + if ( empty($category["slug"]) ) $category["slug"] = ""; - } // If no parent_id was provided make it empty // so that it will be a top level page (no parent). @@ -948,9 +923,8 @@ class wp_xmlrpc_server extends IXR_Server { $category["parent_id"] = ""; // If no description was provided make it empty. - if(empty($category["description"])) { + if ( empty($category["description"]) ) $category["description"] = ""; - } $new_category = array( "cat_name" => $category["name"], @@ -960,9 +934,8 @@ class wp_xmlrpc_server extends IXR_Server { ); $cat_id = wp_insert_category($new_category); - if(!$cat_id) { + if ( !$cat_id ) return(new IXR_Error(500, __("Sorry, the new category failed."))); - } return($cat_id); } @@ -983,15 +956,13 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[2]; $category_id = (int) $args[3]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'wp.deleteCategory'); - if( !current_user_can("manage_categories") ) { + if ( !current_user_can("manage_categories") ) return new IXR_Error( 401, __( "Sorry, you do not have the right to delete a category." ) ); - } return wp_delete_category( $category_id ); } @@ -1013,12 +984,11 @@ class wp_xmlrpc_server extends IXR_Server { $category = $args[3]; $max_results = (int) $args[4]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_posts' ) ) - return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts to this blog in order to view categories.' ) ); + if ( !current_user_can( 'edit_posts' ) ) + return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts to this site in order to view categories.' ) ); do_action('xmlrpc_call', 'wp.suggestCategories'); @@ -1050,12 +1020,11 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[2]; $comment_id = (int) $args[3]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } if ( !current_user_can( 'moderate_comments' ) ) - return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this blog.' ) ); + return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) ); do_action('xmlrpc_call', 'wp.getComment'); @@ -1106,6 +1075,7 @@ class wp_xmlrpc_server extends IXR_Server { * @return array */ function wp_getComments($args) { + $raw_args = $args; $this->escape($args); $blog_id = (int) $args[0]; @@ -1113,9 +1083,8 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[2]; $struct = $args[3]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } if ( !current_user_can( 'moderate_comments' ) ) return new IXR_Error( 401, __( 'Sorry, you cannot edit comments.' ) ); @@ -1149,7 +1118,7 @@ class wp_xmlrpc_server extends IXR_Server { for ( $i = 0; $i < $num_comments; $i++ ) { $comment = wp_xmlrpc_server::wp_getComment(array( - $blog_id, $username, $password, $comments[$i]->comment_ID, + $raw_args[0], $raw_args[1], $raw_args[2], $comments[$i]->comment_ID, )); $comments_struct[] = $comment; } @@ -1173,12 +1142,11 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[2]; $comment_ID = (int) $args[3]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } if ( !current_user_can( 'moderate_comments' ) ) - return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this blog.' ) ); + return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) ); do_action('xmlrpc_call', 'wp.deleteComment'); @@ -1205,12 +1173,11 @@ class wp_xmlrpc_server extends IXR_Server { $comment_ID = (int) $args[3]; $content_struct = $args[4]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } if ( !current_user_can( 'moderate_comments' ) ) - return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this blog.' ) ); + return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) ); do_action('xmlrpc_call', 'wp.editComment'); @@ -1356,12 +1323,11 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[1]; $password = $args[2]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } if ( !current_user_can( 'moderate_comments' ) ) - return new IXR_Error( 403, __( 'You are not allowed access to details about this blog.' ) ); + return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); do_action('xmlrpc_call', 'wp.getCommentStatusList'); @@ -1384,13 +1350,11 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[2]; $post_id = (int) $args[3]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_posts' ) ) { + if ( !current_user_can( 'edit_posts' ) ) return new IXR_Error( 403, __( 'You are not allowed access to details about comments.' ) ); - } do_action('xmlrpc_call', 'wp.getCommentCount'); @@ -1418,13 +1382,11 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[1]; $password = $args[2]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_posts' ) ) { - return new IXR_Error( 403, __( 'You are not allowed access to details about this blog.' ) ); - } + if ( !current_user_can( 'edit_posts' ) ) + return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); do_action('xmlrpc_call', 'wp.getPostStatusList'); @@ -1446,13 +1408,11 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[1]; $password = $args[2]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_posts' ) ) { - return new IXR_Error( 403, __( 'You are not allowed access to details about this blog.' ) ); - } + if ( !current_user_can( 'edit_posts' ) ) + return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); do_action('xmlrpc_call', 'wp.getPageStatusList'); @@ -1474,13 +1434,11 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[1]; $password = $args[2]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_pages' ) ) { - return new IXR_Error( 403, __( 'You are not allowed access to details about this blog.' ) ); - } + if ( !current_user_can( 'edit_pages' ) ) + return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); $templates = get_page_templates( ); $templates['Default'] = 'default'; @@ -1504,14 +1462,12 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[2]; $options = (array) $args[3]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } // If no specific options where asked for, return all of them - if (count( $options ) == 0 ) { + if ( count( $options ) == 0 ) $options = array_keys($this->blog_options); - } return $this->_getOptions($options); } @@ -1524,15 +1480,13 @@ class wp_xmlrpc_server extends IXR_Server { * @param array $options Options to retrieve. * @return array */ - function _getOptions($options) - { + function _getOptions($options) { $data = array( ); - foreach( $options as $option ) { - if( array_key_exists( $option, $this->blog_options ) ) - { + foreach ( $options as $option ) { + if ( array_key_exists( $option, $this->blog_options ) ) { $data[$option] = $this->blog_options[$option]; //Is the value static or dynamic? - if( isset( $data[$option]['option'] ) ) { + if ( isset( $data[$option]['option'] ) ) { $data[$option]['value'] = get_option( $data[$option]['option'] ); unset($data[$option]['option']); } @@ -1558,19 +1512,18 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[2]; $options = (array) $args[3]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'manage_options' ) ) + if ( !current_user_can( 'manage_options' ) ) return new IXR_Error( 403, __( 'You are not allowed to update options.' ) ); - foreach( $options as $o_name => $o_value ) { + foreach ( $options as $o_name => $o_value ) { $option_names[] = $o_name; - if( !array_key_exists( $o_name, $this->blog_options ) ) + if ( !array_key_exists( $o_name, $this->blog_options ) ) continue; - if( $this->blog_options[$o_name]['readonly'] == true ) + if ( $this->blog_options[$o_name]['readonly'] == true ) continue; update_option( $this->blog_options[$o_name]['option'], $o_value ); @@ -1595,15 +1548,16 @@ class wp_xmlrpc_server extends IXR_Server { * @return array */ function blogger_getUsersBlogs($args) { + if ( is_multisite() ) + return $this->_multisite_getUsersBlogs($args); $this->escape($args); $username = $args[1]; $password = $args[2]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'blogger.getUsersBlogs'); @@ -1620,6 +1574,35 @@ class wp_xmlrpc_server extends IXR_Server { return array($struct); } + /** + * Private function for retrieving a users blogs for multisite setups + * + * @access protected + */ + function _multisite_getUsersBlogs($args) { + global $current_blog; + $domain = $current_blog->domain; + $path = $current_blog->path . 'xmlrpc.php'; + $protocol = is_ssl() ? 'https' : 'http'; + + $rpc = new IXR_Client("$protocol://{$domain}{$path}"); + $rpc->query('wp.getUsersBlogs', $args[1], $args[2]); + $blogs = $rpc->getResponse(); + + if ( isset($blogs['faultCode']) ) + return new IXR_Error($blogs['faultCode'], $blogs['faultString']); + + if ( $_SERVER['HTTP_HOST'] == $domain && $_SERVER['REQUEST_URI'] == $path ) { + return $blogs; + } else { + foreach ( (array) $blogs as $blog ) { + if ( strpos($blog['url'], $_SERVER['HTTP_HOST']) ) + return array($blog); + } + return array(); + } + } + /** * Retrieve user's data. * @@ -1637,12 +1620,11 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[1]; $password = $args[2]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_posts' ) ) - return new IXR_Error( 401, __( 'Sorry, you do not have access to user data on this blog.' ) ); + if ( !current_user_can( 'edit_posts' ) ) + return new IXR_Error( 401, __( 'Sorry, you do not have access to user data on this site.' ) ); do_action('xmlrpc_call', 'blogger.getUserInfo'); @@ -1673,11 +1655,10 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[2]; $password = $args[3]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_post', $post_ID ) ) + if ( !current_user_can( 'edit_post', $post_ID ) ) return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) ); do_action('xmlrpc_call', 'blogger.getPost'); @@ -1717,21 +1698,20 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[3]; $num_posts = $args[4]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'blogger.getRecentPosts'); $posts_list = wp_get_recent_posts($num_posts); - if (!$posts_list) { + if ( !$posts_list ) { $this->error = new IXR_Error(500, __('Either there are no posts, or something went wrong.')); return $this->error; } foreach ($posts_list as $entry) { - if( !current_user_can( 'edit_post', $entry['ID'] ) ) + if ( !current_user_can( 'edit_post', $entry['ID'] ) ) continue; $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false); @@ -1751,7 +1731,7 @@ class wp_xmlrpc_server extends IXR_Server { } $recent_posts = array(); - for ($j=0; $jlogin($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'blogger.getTemplate'); - if ( !current_user_can('edit_themes') ) { + if ( !current_user_can('edit_themes') ) return new IXR_Error(401, __('Sorry, this user can not edit the template.')); - } /* warning: here we make the assumption that the blog's URL is on the same server */ $filename = get_option('home') . '/'; @@ -1817,15 +1795,13 @@ class wp_xmlrpc_server extends IXR_Server { $content = $args[4]; $template = $args[5]; /* could be 'main' or 'archiveIndex', but we don't use it */ - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'blogger.setTemplate'); - if ( !current_user_can('edit_themes') ) { + if ( !current_user_can('edit_themes') ) return new IXR_Error(401, __('Sorry, this user cannot edit the template.')); - } /* warning: here we make the assumption that the blog's URL is on the same server */ $filename = get_option('home') . '/'; @@ -1859,15 +1835,14 @@ class wp_xmlrpc_server extends IXR_Server { $content = $args[4]; $publish = $args[5]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'blogger.newPost'); $cap = ($publish) ? 'publish_posts' : 'edit_posts'; if ( !current_user_can($cap) ) - return new IXR_Error(401, __('Sorry, you are not allowed to post on this blog.')); + return new IXR_Error(401, __('Sorry, you are not allowed to post on this site.')); $post_status = ($publish) ? 'publish' : 'draft'; @@ -1886,7 +1861,7 @@ class wp_xmlrpc_server extends IXR_Server { if ( is_wp_error( $post_ID ) ) return new IXR_Error(500, $post_ID->get_error_message()); - if (!$post_ID) + if ( !$post_ID ) return new IXR_Error(500, __('Sorry, your entry could not be posted. Something wrong happened.')); $this->attach_uploads( $post_ID, $post_content ); @@ -1914,17 +1889,15 @@ class wp_xmlrpc_server extends IXR_Server { $content = $args[4]; $publish = $args[5]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'blogger.editPost'); $actual_post = wp_get_single_post($post_ID,ARRAY_A); - if (!$actual_post || $actual_post['post_type'] != 'post') { + if ( !$actual_post || $actual_post['post_type'] != 'post' ) return new IXR_Error(404, __('Sorry, no such post.')); - } $this->escape($actual_post); @@ -1944,9 +1917,9 @@ class wp_xmlrpc_server extends IXR_Server { $result = wp_update_post($postdata); - if (!$result) { + if ( !$result ) return new IXR_Error(500, __('For some strange yet very annoying reason, this post could not be edited.')); - } + $this->attach_uploads( $ID, $post_content ); return true; @@ -1968,26 +1941,23 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[3]; $publish = $args[4]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'blogger.deletePost'); $actual_post = wp_get_single_post($post_ID,ARRAY_A); - if (!$actual_post || $actual_post['post_type'] != 'post') { + if ( !$actual_post || $actual_post['post_type'] != 'post' ) return new IXR_Error(404, __('Sorry, no such post.')); - } if ( !current_user_can('edit_post', $post_ID) ) return new IXR_Error(401, __('Sorry, you do not have the right to delete this post.')); $result = wp_delete_post($post_ID); - if (!$result) { + if ( !$result ) return new IXR_Error(500, __('For some strange yet very annoying reason, this post could not be deleted.')); - } return true; } @@ -2013,76 +1983,63 @@ class wp_xmlrpc_server extends IXR_Server { $content_struct = $args[3]; $publish = $args[4]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'metaWeblog.newPost'); $cap = ( $publish ) ? 'publish_posts' : 'edit_posts'; - $error_message = __( 'Sorry, you are not allowed to publish posts on this blog.' ); + $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' ); $post_type = 'post'; $page_template = ''; - if( !empty( $content_struct['post_type'] ) ) { - if( $content_struct['post_type'] == 'page' ) { + if ( !empty( $content_struct['post_type'] ) ) { + if ( $content_struct['post_type'] == 'page' ) { $cap = ( $publish ) ? 'publish_pages' : 'edit_pages'; - $error_message = __( 'Sorry, you are not allowed to publish pages on this blog.' ); + $error_message = __( 'Sorry, you are not allowed to publish pages on this site.' ); $post_type = 'page'; - if( !empty( $content_struct['wp_page_template'] ) ) + if ( !empty( $content_struct['wp_page_template'] ) ) $page_template = $content_struct['wp_page_template']; - } - elseif( $content_struct['post_type'] == 'post' ) { + } elseif ( $content_struct['post_type'] == 'post' ) { // This is the default, no changes needed - } - else { + } else { // No other post_type values are allowed here return new IXR_Error( 401, __( 'Invalid post type.' ) ); } } - if( !current_user_can( $cap ) ) { + if ( !current_user_can( $cap ) ) return new IXR_Error( 401, $error_message ); - } // Let WordPress generate the post_name (slug) unless // one has been provided. $post_name = ""; - if(isset($content_struct["wp_slug"])) { + if ( isset($content_struct["wp_slug"]) ) $post_name = $content_struct["wp_slug"]; - } // Only use a password if one was given. - if(isset($content_struct["wp_password"])) { + if ( isset($content_struct["wp_password"]) ) $post_password = $content_struct["wp_password"]; - } // Only set a post parent if one was provided. - if(isset($content_struct["wp_page_parent_id"])) { + if ( isset($content_struct["wp_page_parent_id"]) ) $post_parent = $content_struct["wp_page_parent_id"]; - } // Only set the menu_order if it was provided. - if(isset($content_struct["wp_page_order"])) { + if ( isset($content_struct["wp_page_order"]) ) $menu_order = $content_struct["wp_page_order"]; - } $post_author = $user->ID; // If an author id was provided then use it instead. - if( - isset($content_struct["wp_author_id"]) - && ($user->ID != $content_struct["wp_author_id"]) - ) { - switch($post_type) { + if ( isset($content_struct["wp_author_id"]) && ($user->ID != $content_struct["wp_author_id"]) ) { + switch ( $post_type ) { case "post": - if(!current_user_can("edit_others_posts")) { + if ( !current_user_can("edit_others_posts") ) return(new IXR_Error(401, __("You are not allowed to post as this user"))); - } break; case "page": - if(!current_user_can("edit_others_pages")) { + if ( !current_user_can("edit_others_pages") ) return(new IXR_Error(401, __("You are not allowed to create pages as this user"))); - } break; default: return(new IXR_Error(401, __("Invalid post type."))); @@ -2096,8 +2053,8 @@ class wp_xmlrpc_server extends IXR_Server { $post_status = $publish ? 'publish' : 'draft'; - if( isset( $content_struct["{$post_type}_status"] ) ) { - switch( $content_struct["{$post_type}_status"] ) { + if ( isset( $content_struct["{$post_type}_status"] ) ) { + switch ( $content_struct["{$post_type}_status"] ) { case 'draft': case 'private': case 'publish': @@ -2105,9 +2062,8 @@ class wp_xmlrpc_server extends IXR_Server { break; case 'pending': // Pending is only valid for posts, not pages. - if( $post_type === 'post' ) { + if ( $post_type === 'post' ) $post_status = $content_struct["{$post_type}_status"]; - } break; default: $post_status = $publish ? 'publish' : 'draft'; @@ -2120,9 +2076,9 @@ class wp_xmlrpc_server extends IXR_Server { $tags_input = $content_struct['mt_keywords']; - if(isset($content_struct["mt_allow_comments"])) { - if(!is_numeric($content_struct["mt_allow_comments"])) { - switch($content_struct["mt_allow_comments"]) { + if ( isset($content_struct["mt_allow_comments"]) ) { + if ( !is_numeric($content_struct["mt_allow_comments"]) ) { + switch ( $content_struct["mt_allow_comments"] ) { case "closed": $comment_status = "closed"; break; @@ -2133,9 +2089,8 @@ class wp_xmlrpc_server extends IXR_Server { $comment_status = get_option("default_comment_status"); break; } - } - else { - switch((int) $content_struct["mt_allow_comments"]) { + } else { + switch ( (int) $content_struct["mt_allow_comments"] ) { case 0: case 2: $comment_status = "closed"; @@ -2148,14 +2103,13 @@ class wp_xmlrpc_server extends IXR_Server { break; } } - } - else { + } else { $comment_status = get_option("default_comment_status"); } - if(isset($content_struct["mt_allow_pings"])) { - if(!is_numeric($content_struct["mt_allow_pings"])) { - switch($content_struct['mt_allow_pings']) { + if ( isset($content_struct["mt_allow_pings"]) ) { + if ( !is_numeric($content_struct["mt_allow_pings"]) ) { + switch ( $content_struct['mt_allow_pings'] ) { case "closed": $ping_status = "closed"; break; @@ -2166,9 +2120,8 @@ class wp_xmlrpc_server extends IXR_Server { $ping_status = get_option("default_ping_status"); break; } - } - else { - switch((int) $content_struct["mt_allow_pings"]) { + } else { + switch ( (int) $content_struct["mt_allow_pings"] ) { case 0: $ping_status = "closed"; break; @@ -2180,14 +2133,12 @@ class wp_xmlrpc_server extends IXR_Server { break; } } - } - else { + } else { $ping_status = get_option("default_ping_status"); } - if ($post_more) { + if ( $post_more ) $post_content = $post_content . "" . $post_more; - } $to_ping = $content_struct['mt_tb_ping_urls']; if ( is_array($to_ping) ) @@ -2211,7 +2162,7 @@ class wp_xmlrpc_server extends IXR_Server { logIO('O', 'Post cats: ' . var_export($catnames,true)); $post_category = array(); - if (is_array($catnames)) { + if ( is_array($catnames) ) { foreach ($catnames as $cat) { $post_category[] = get_cat_ID($cat); } @@ -2224,20 +2175,19 @@ class wp_xmlrpc_server extends IXR_Server { if ( is_wp_error( $post_ID ) ) return new IXR_Error(500, $post_ID->get_error_message()); - if (!$post_ID) { + if ( !$post_ID ) return new IXR_Error(500, __('Sorry, your entry could not be posted. Something wrong happened.')); - } // Only posts can be sticky - if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) + if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) { if ( $content_struct['sticky'] == true ) stick_post( $post_ID ); elseif ( $content_struct['sticky'] == false ) unstick_post( $post_ID ); + } - if ( isset($content_struct['custom_fields']) ) { + if ( isset($content_struct['custom_fields']) ) $this->set_custom_fields($post_ID, $content_struct['custom_fields']); - } // Handle enclosures $this->add_enclosure_if_new($post_ID, $content_struct['enclosure']); @@ -2250,7 +2200,7 @@ class wp_xmlrpc_server extends IXR_Server { } function add_enclosure_if_new($post_ID, $enclosure) { - if( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) { + if ( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) { $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type']; $found = false; @@ -2264,9 +2214,8 @@ class wp_xmlrpc_server extends IXR_Server { } } } - if (!$found) { + if (!$found) add_post_meta( $post_ID, 'enclosure', $encstring ); - } } } @@ -2283,11 +2232,10 @@ class wp_xmlrpc_server extends IXR_Server { // find any unattached files $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '0' AND post_type = 'attachment'" ); - if( is_array( $attachments ) ) { - foreach( $attachments as $file ) { - if( strpos( $post_content, $file->guid ) !== false ) { + if ( is_array( $attachments ) ) { + foreach ( $attachments as $file ) { + if ( strpos( $post_content, $file->guid ) !== false ) $wpdb->update($wpdb->posts, array('post_parent' => $post_ID), array('ID' => $file->ID) ); - } } } } @@ -2310,87 +2258,73 @@ class wp_xmlrpc_server extends IXR_Server { $content_struct = $args[3]; $publish = $args[4]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'metaWeblog.editPost'); $cap = ( $publish ) ? 'publish_posts' : 'edit_posts'; - $error_message = __( 'Sorry, you are not allowed to publish posts on this blog.' ); + $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' ); $post_type = 'post'; $page_template = ''; - if( !empty( $content_struct['post_type'] ) ) { - if( $content_struct['post_type'] == 'page' ) { + if ( !empty( $content_struct['post_type'] ) ) { + if ( $content_struct['post_type'] == 'page' ) { $cap = ( $publish ) ? 'publish_pages' : 'edit_pages'; - $error_message = __( 'Sorry, you are not allowed to publish pages on this blog.' ); + $error_message = __( 'Sorry, you are not allowed to publish pages on this site.' ); $post_type = 'page'; - if( !empty( $content_struct['wp_page_template'] ) ) + if ( !empty( $content_struct['wp_page_template'] ) ) $page_template = $content_struct['wp_page_template']; - } - elseif( $content_struct['post_type'] == 'post' ) { + } elseif ( $content_struct['post_type'] == 'post' ) { // This is the default, no changes needed - } - else { + } else { // No other post_type values are allowed here return new IXR_Error( 401, __( 'Invalid post type.' ) ); } } - if( !current_user_can( $cap ) ) { + if ( !current_user_can( $cap ) ) return new IXR_Error( 401, $error_message ); - } $postdata = wp_get_single_post($post_ID, ARRAY_A); // If there is no post data for the give post id, stop // now and return an error. Other wise a new post will be // created (which was the old behavior). - if(empty($postdata["ID"])) { + if ( empty($postdata["ID"]) ) return(new IXR_Error(404, __("Invalid post ID."))); - } $this->escape($postdata); extract($postdata, EXTR_SKIP); // Let WordPress manage slug if none was provided. $post_name = ""; - if(isset($content_struct["wp_slug"])) { + if ( isset($content_struct["wp_slug"]) ) $post_name = $content_struct["wp_slug"]; - } // Only use a password if one was given. - if(isset($content_struct["wp_password"])) { + if ( isset($content_struct["wp_password"]) ) $post_password = $content_struct["wp_password"]; - } // Only set a post parent if one was given. - if(isset($content_struct["wp_page_parent_id"])) { + if ( isset($content_struct["wp_page_parent_id"]) ) $post_parent = $content_struct["wp_page_parent_id"]; - } // Only set the menu_order if it was given. - if(isset($content_struct["wp_page_order"])) { + if ( isset($content_struct["wp_page_order"]) ) $menu_order = $content_struct["wp_page_order"]; - } $post_author = $postdata["post_author"]; // Only set the post_author if one is set. - if( - isset($content_struct["wp_author_id"]) - && ($user->ID != $content_struct["wp_author_id"]) - ) { - switch($post_type) { + if ( isset($content_struct["wp_author_id"]) && ($user->ID != $content_struct["wp_author_id"]) ) { + switch ( $post_type ) { case "post": - if(!current_user_can("edit_others_posts")) { + if ( !current_user_can("edit_others_posts") ) return(new IXR_Error(401, __("You are not allowed to change the post author as this user."))); - } break; case "page": - if(!current_user_can("edit_others_pages")) { + if ( !current_user_can("edit_others_pages") ) return(new IXR_Error(401, __("You are not allowed to change the page author as this user."))); - } break; default: return(new IXR_Error(401, __("Invalid post type."))); @@ -2399,9 +2333,9 @@ class wp_xmlrpc_server extends IXR_Server { $post_author = $content_struct["wp_author_id"]; } - if(isset($content_struct["mt_allow_comments"])) { - if(!is_numeric($content_struct["mt_allow_comments"])) { - switch($content_struct["mt_allow_comments"]) { + if ( isset($content_struct["mt_allow_comments"]) ) { + if ( !is_numeric($content_struct["mt_allow_comments"]) ) { + switch ( $content_struct["mt_allow_comments"] ) { case "closed": $comment_status = "closed"; break; @@ -2412,9 +2346,8 @@ class wp_xmlrpc_server extends IXR_Server { $comment_status = get_option("default_comment_status"); break; } - } - else { - switch((int) $content_struct["mt_allow_comments"]) { + } else { + switch ( (int) $content_struct["mt_allow_comments"] ) { case 0: case 2: $comment_status = "closed"; @@ -2429,9 +2362,9 @@ class wp_xmlrpc_server extends IXR_Server { } } - if(isset($content_struct["mt_allow_pings"])) { - if(!is_numeric($content_struct["mt_allow_pings"])) { - switch($content_struct["mt_allow_pings"]) { + if ( isset($content_struct["mt_allow_pings"]) ) { + if ( !is_numeric($content_struct["mt_allow_pings"]) ) { + switch ( $content_struct["mt_allow_pings"] ) { case "closed": $ping_status = "closed"; break; @@ -2442,9 +2375,8 @@ class wp_xmlrpc_server extends IXR_Server { $ping_status = get_option("default_ping_status"); break; } - } - else { - switch((int) $content_struct["mt_allow_pings"]) { + } else { + switch ( (int) $content_struct["mt_allow_pings"] ) { case 0: $ping_status = "closed"; break; @@ -2464,7 +2396,7 @@ class wp_xmlrpc_server extends IXR_Server { $post_category = array(); - if (is_array($catnames)) { + if ( is_array($catnames) ) { foreach ($catnames as $cat) { $post_category[] = get_cat_ID($cat); } @@ -2474,7 +2406,7 @@ class wp_xmlrpc_server extends IXR_Server { $post_more = $content_struct['mt_text_more']; $post_status = $publish ? 'publish' : 'draft'; - if( isset( $content_struct["{$post_type}_status"] ) ) { + if ( isset( $content_struct["{$post_type}_status"] ) ) { switch( $content_struct["{$post_type}_status"] ) { case 'draft': case 'private': @@ -2483,9 +2415,8 @@ class wp_xmlrpc_server extends IXR_Server { break; case 'pending': // Pending is only valid for posts, not pages. - if( $post_type === 'post' ) { + if ( $post_type === 'post' ) $post_status = $content_struct["{$post_type}_status"]; - } break; default: $post_status = $publish ? 'publish' : 'draft'; @@ -2502,9 +2433,8 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.')); } - if ($post_more) { + if ( $post_more ) $post_content = $post_content . "" . $post_more; - } $to_ping = $content_struct['mt_tb_ping_urls']; if ( is_array($to_ping) ) @@ -2531,20 +2461,19 @@ class wp_xmlrpc_server extends IXR_Server { if ( is_wp_error( $result ) ) return new IXR_Error(500, $result->get_error_message()); - if (!$result) { + if ( !$result ) return new IXR_Error(500, __('Sorry, your entry could not be edited. Something wrong happened.')); - } // Only posts can be sticky - if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) + if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) { if ( $content_struct['sticky'] == true ) stick_post( $post_ID ); elseif ( $content_struct['sticky'] == false ) unstick_post( $post_ID ); + } - if ( isset($content_struct['custom_fields']) ) { + if ( isset($content_struct['custom_fields']) ) $this->set_custom_fields($post_ID, $content_struct['custom_fields']); - } // Handle enclosures $this->add_enclosure_if_new($post_ID, $content_struct['enclosure']); @@ -2572,11 +2501,10 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[1]; $password = $args[2]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_post', $post_ID ) ) + if ( !current_user_can( 'edit_post', $post_ID ) ) return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) ); do_action('xmlrpc_call', 'metaWeblog.getPost'); @@ -2588,9 +2516,8 @@ class wp_xmlrpc_server extends IXR_Server { $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt'], false); // For drafts use the GMT version of the post date - if ( $postdata['post_status'] == 'draft' ) { + if ( $postdata['post_status'] == 'draft' ) $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_date'] ), 'Ymd\TH:i:s' ); - } $categories = array(); $catids = wp_get_post_categories($post_ID); @@ -2617,9 +2544,8 @@ class wp_xmlrpc_server extends IXR_Server { $allow_pings = ('open' == $postdata['ping_status']) ? 1 : 0; // Consider future posts as published - if( $postdata['post_status'] === 'future' ) { + if ( $postdata['post_status'] === 'future' ) $postdata['post_status'] = 'publish'; - } $sticky = false; if ( is_sticky( $post_ID ) ) @@ -2631,7 +2557,7 @@ class wp_xmlrpc_server extends IXR_Server { foreach ( (array) $val as $enc ) { $encdata = split("\n", $enc); $enclosure['url'] = trim(htmlspecialchars($encdata[0])); - $enclosure['length'] = trim($encdata[1]); + $enclosure['length'] = (int) trim($encdata[1]); $enclosure['type'] = trim($encdata[2]); break 2; } @@ -2664,7 +2590,7 @@ class wp_xmlrpc_server extends IXR_Server { 'sticky' => $sticky ); - if (!empty($enclosure)) $resp['enclosure'] = $enclosure; + if ( !empty($enclosure) ) $resp['enclosure'] = $enclosure; return $resp; } else { @@ -2689,35 +2615,31 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[2]; $num_posts = (int) $args[3]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'metaWeblog.getRecentPosts'); $posts_list = wp_get_recent_posts($num_posts); - if (!$posts_list) { + if ( !$posts_list ) return array( ); - } foreach ($posts_list as $entry) { - if( !current_user_can( 'edit_post', $entry['ID'] ) ) + if ( !current_user_can( 'edit_post', $entry['ID'] ) ) continue; $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false); $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'], false); // For drafts use the GMT version of the date - if ( $entry['post_status'] == 'draft' ) { + if ( $entry['post_status'] == 'draft' ) $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_date'] ), 'Ymd\TH:i:s' ); - } $categories = array(); $catids = wp_get_post_categories($entry['ID']); - foreach($catids as $catid) { + foreach( $catids as $catid ) $categories[] = get_cat_name($catid); - } $tagnames = array(); $tags = wp_get_post_tags( $entry['ID'] ); @@ -2740,9 +2662,8 @@ class wp_xmlrpc_server extends IXR_Server { $allow_pings = ('open' == $entry['ping_status']) ? 1 : 0; // Consider future posts as published - if( $entry['post_status'] === 'future' ) { + if ( $entry['post_status'] === 'future' ) $entry['post_status'] = 'publish'; - } $struct[] = array( 'dateCreated' => new IXR_Date($post_date), @@ -2772,7 +2693,7 @@ class wp_xmlrpc_server extends IXR_Server { } $recent_posts = array(); - for ($j=0; $jlogin($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_posts' ) ) - return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this blog in order to view categories.' ) ); + if ( !current_user_can( 'edit_posts' ) ) + return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view categories.' ) ); do_action('xmlrpc_call', 'metaWeblog.getCategories'); $categories_struct = array(); - if ( $cats = get_categories('get=all') ) { + if ( $cats = get_categories(array('get' => 'all')) ) { foreach ( $cats as $cat ) { $struct['categoryId'] = $cat->term_id; $struct['parentId'] = $cat->parent; @@ -2849,9 +2769,8 @@ class wp_xmlrpc_server extends IXR_Server { logIO('O', '(MW) Received '.strlen($bits).' bytes'); - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'metaWeblog.newMediaObject'); @@ -2864,7 +2783,7 @@ class wp_xmlrpc_server extends IXR_Server { if ( $upload_err = apply_filters( "pre_upload_error", false ) ) return new IXR_Error(500, $upload_err); - if(!empty($data["overwrite"]) && ($data["overwrite"] == true)) { + if ( !empty($data["overwrite"]) && ($data["overwrite"] == true) ) { // Get postmeta info on the object. $old_file = $wpdb->get_row(" SELECT ID @@ -2904,7 +2823,7 @@ class wp_xmlrpc_server extends IXR_Server { $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id ); wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) ); - return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type ) ); + return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type ), 'upload' ); } /* MovableType API functions @@ -2928,30 +2847,28 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[2]; $num_posts = (int) $args[3]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'mt.getRecentPostTitles'); $posts_list = wp_get_recent_posts($num_posts); - if (!$posts_list) { + if ( !$posts_list ) { $this->error = new IXR_Error(500, __('Either there are no posts, or something went wrong.')); return $this->error; } foreach ($posts_list as $entry) { - if( !current_user_can( 'edit_post', $entry['ID'] ) ) + if ( !current_user_can( 'edit_post', $entry['ID'] ) ) continue; $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false); $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt'], false); // For drafts use the GMT version of the date - if ( $entry['post_status'] == 'draft' ) { + if ( $entry['post_status'] == 'draft' ) $post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $entry['post_date'] ), 'Ymd\TH:i:s' ); - } $struct[] = array( 'dateCreated' => new IXR_Date($post_date), @@ -2964,7 +2881,7 @@ class wp_xmlrpc_server extends IXR_Server { } $recent_posts = array(); - for ($j=0; $jlogin($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_posts' ) ) - return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this blog in order to view categories.' ) ); + if ( !current_user_can( 'edit_posts' ) ) + return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view categories.' ) ); do_action('xmlrpc_call', 'mt.getCategoryList'); $categories_struct = array(); - if ( $cats = get_categories('hide_empty=0&hierarchical=0') ) { - foreach ($cats as $cat) { + if ( $cats = get_categories(array('hide_empty' => 0, 'hierarchical' => 0)) ) { + foreach ( $cats as $cat ) { $struct['categoryId'] = $cat->term_id; $struct['categoryName'] = $cat->name; @@ -3026,11 +2942,10 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[1]; $password = $args[2]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } - if( !current_user_can( 'edit_post', $post_ID ) ) + if ( !current_user_can( 'edit_post', $post_ID ) ) return new IXR_Error( 401, __( 'Sorry, you can not edit this post.' ) ); do_action('xmlrpc_call', 'mt.getPostCategories'); @@ -3039,7 +2954,7 @@ class wp_xmlrpc_server extends IXR_Server { $catids = wp_get_post_categories(intval($post_ID)); // first listed category will be the primary category $isPrimary = true; - foreach($catids as $catid) { + foreach ( $catids as $catid ) { $categories[] = array( 'categoryName' => get_cat_name($catid), 'categoryId' => (string) $catid, @@ -3068,16 +2983,15 @@ class wp_xmlrpc_server extends IXR_Server { $password = $args[2]; $categories = $args[3]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'mt.setPostCategories'); if ( !current_user_can('edit_post', $post_ID) ) return new IXR_Error(401, __('Sorry, you cannot edit this post.')); - foreach($categories as $cat) { + foreach ( $categories as $cat ) { $catids[] = $cat['categoryId']; } @@ -3099,7 +3013,7 @@ class wp_xmlrpc_server extends IXR_Server { do_action('xmlrpc_call', 'mt.supportedMethods'); $supported_methods = array(); - foreach($this->methods as $key=>$value) { + foreach ( $this->methods as $key => $value ) { $supported_methods[] = $key; } @@ -3136,18 +3050,16 @@ class wp_xmlrpc_server extends IXR_Server { $actual_post = wp_get_single_post($post_ID, ARRAY_A); - if (!$actual_post) { + if ( !$actual_post ) return new IXR_Error(404, __('Sorry, no such post.')); - } $comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) ); - if (!$comments) { + if ( !$comments ) return array(); - } $trackback_pings = array(); - foreach($comments as $comment) { + foreach ( $comments as $comment ) { if ( 'trackback' == $comment->comment_type ) { $content = $comment->comment_content; $title = substr($content, 8, (strpos($content, '') - 8)); @@ -3156,7 +3068,7 @@ class wp_xmlrpc_server extends IXR_Server { 'pingURL' => $comment->comment_author_url, 'pingIP' => $comment->comment_author_IP ); - } + } } return $trackback_pings; @@ -3178,9 +3090,8 @@ class wp_xmlrpc_server extends IXR_Server { $username = $args[1]; $password = $args[2]; - if ( !$user = $this->login($username, $password) ) { + if ( !$user = $this->login($username, $password) ) return $this->error; - } do_action('xmlrpc_call', 'mt.publishPost'); @@ -3231,36 +3142,36 @@ class wp_xmlrpc_server extends IXR_Server { // Check if the page linked to is in our site $pos1 = strpos($pagelinkedto, str_replace(array('http://www.','http://','https://www.','https://'), '', get_option('home'))); - if( !$pos1 ) + if ( !$pos1 ) return new IXR_Error(0, __('Is there no link to us?')); // let's find which post is linked to // FIXME: does url_to_postid() cover all these cases already? // if so, then let's use it and drop the old code. $urltest = parse_url($pagelinkedto); - if ($post_ID = url_to_postid($pagelinkedto)) { + if ( $post_ID = url_to_postid($pagelinkedto) ) { $way = 'url_to_postid()'; - } elseif (preg_match('#p/[0-9]{1,}#', $urltest['path'], $match)) { + } elseif ( preg_match('#p/[0-9]{1,}#', $urltest['path'], $match) ) { // the path defines the post_ID (archives/p/XXXX) $blah = explode('/', $match[0]); $post_ID = (int) $blah[1]; $way = 'from the path'; - } elseif (preg_match('#p=[0-9]{1,}#', $urltest['query'], $match)) { + } elseif ( preg_match('#p=[0-9]{1,}#', $urltest['query'], $match) ) { // the querystring defines the post_ID (?p=XXXX) $blah = explode('=', $match[0]); $post_ID = (int) $blah[1]; $way = 'from the querystring'; - } elseif (isset($urltest['fragment'])) { + } elseif ( isset($urltest['fragment']) ) { // an #anchor is there, it's either... - if (intval($urltest['fragment'])) { + if ( intval($urltest['fragment']) ) { // ...an integer #XXXX (simpliest case) $post_ID = (int) $urltest['fragment']; $way = 'from the fragment (numeric)'; - } elseif (preg_match('/post-[0-9]+/',$urltest['fragment'])) { + } elseif ( preg_match('/post-[0-9]+/',$urltest['fragment']) ) { // ...a post id in the form 'post-###' $post_ID = preg_replace('/[^0-9]+/', '', $urltest['fragment']); $way = 'from the fragment (post-###)'; - } elseif (is_string($urltest['fragment'])) { + } elseif ( is_string($urltest['fragment']) ) { // ...or a string #title, a little more complicated $title = preg_replace('/[^a-z0-9]/i', '.', $urltest['fragment']); $sql = $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_title RLIKE %s", $title); @@ -3292,10 +3203,8 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn’t exist, or it is not a pingback-enabled resource.')); // Let's check that the remote site didn't already pingback this entry - $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $post_ID, $pagelinkedfrom) ); - - if ( $wpdb->num_rows ) // We already have a Pingback from this URL - return new IXR_Error(48, __('The pingback has already been registered.')); + if ( $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $post_ID, $pagelinkedfrom) ) ) + return new IXR_Error( 48, __( 'The pingback has already been registered.' ) ); // very stupid, but gives time to the 'from' server to publish ! sleep(1); @@ -3395,26 +3304,25 @@ class wp_xmlrpc_server extends IXR_Server { $url = $args; $post_ID = url_to_postid($url); - if (!$post_ID) { + if ( !$post_ID ) { // We aren't sure that the resource is available and/or pingback enabled return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn’t exist, or it is not a pingback-enabled resource.')); } $actual_post = wp_get_single_post($post_ID, ARRAY_A); - if (!$actual_post) { + if ( !$actual_post ) { // No such post = resource not found return new IXR_Error(32, __('The specified target URL does not exist.')); } $comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) ); - if (!$comments) { + if ( !$comments ) return array(); - } $pingbacks = array(); - foreach($comments as $comment) { + foreach ( $comments as $comment ) { if ( 'pingback' == $comment->comment_type ) $pingbacks[] = $comment->comment_author_url; }