Version 2, June 1991\r
\r
Copyright (C) 1989, 1991 Free Software Foundation, Inc. \r
- 51 Franklin St, Fifth Floor, Boston, MA 02110, USA\r
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA\r
\r
Everyone is permitted to copy and distribute verbatim copies\r
of this license document, but changing it is not allowed.\r
\r
END OF TERMS AND CONDITIONS\r
\r
+\r
+WRITTEN OFFER\r
+\r
+The source code for any program binaries or compressed scripts that are\r
+included with WordPress can be freely obtained at the following URL:\r
+\r
+ http://wordpress.org/download/source/\r
<body>
<h1 id="logo">
<a href="http://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" width="250" height="68" /></a>
- <br /> Version 3.0.6
+ <br /> Version 3.1
</h1>
<p style="text-align: center">Semantic Personal Publishing Platform</p>
<li>The installer should then send you to the <a href="wp-login.php">login page</a>. 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.</li>
</ol>
-<h1>Upgrading</h1>
-<h2>Using the Automatic Upgrader</h2>
-<p>If you are upgrading from version 2.7 or higher, you can use the automatic upgrader:</p>
+<h1>Updating</h1>
+<h2>Using the Automatic Updater</h2>
+<p>If you are updating from version 2.7 or higher, you can use the automatic updater:</p>
<ol>
<li>Open the <span class="file"><a href="wp-admin/update-core.php">wp-admin/update-core.php</a></span> in your browser and follow the instructions.</li>
<li>You wanted more, perhaps? That's it!</li>
</ol>
-<h2>Upgrading Manually</h2>
+<h2>Updating Manually</h2>
<ol>
- <li>Before you upgrade anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</li>
+ <li>Before you update anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</li>
<li>Delete your old WordPress files, saving ones you've modified.</li>
<li>Upload the new files.</li>
<li>Point your browser to <span class="file"><a href="wp-admin/upgrade.php">/wp-admin/upgrade.php</a>.</span></li>
<p>WordPress is the official continuation of <a href="http://cafelog.com/">b2/cafélog</a>, which came from Michel V. The work has been continued by the <a href="http://wordpress.org/about/">WordPress developers</a>. If you would like to support WordPress, please consider <a href="http://wordpress.org/donate/" title="Donate to WordPress">donating</a>.</p>
-<h1>Copyright</h1>
+<h1>License</h1>
<p>WordPress is free software, and is released under the terms of the <abbr title="GNU General Public License">GPL</abbr> version 2 or (at your option) any later version. See <a href="license.txt">license.txt</a>.</p>
require( './wp-blog-header.php' );
if ( !is_multisite() ) {
- wp_redirect( get_option( 'siteurl' ) . "/wp-login.php?action=register" );
+ wp_redirect( site_url( '/wp-login.php?action=register' ) );
die();
}
-require_once( ABSPATH . WPINC . '/registration.php');
-
if ( is_object( $wp_object_cache ) )
$wp_object_cache->cache_enabled = false;
#submit, #key { width: 90%; font-size: 24px; }
#language { margin-top: .5em; }
.error { background: #f66; }
- span.h3 { padding:0 8px; font-size:1.3em; font-family:'Trebuchet MS','Lucida Grande',Verdana,Arial,Sans-Serif; font-weight:700; color:#333333; }
+ span.h3 { padding: 0 8px; font-size: 1.3em; font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; font-weight: bold; color: #333; }
</style>
<?php
}
<?php
echo '<p class="lead-in">';
if ( $signup->domain . $signup->path == '' ) {
- printf( __('Your account has been activated. You may now <a href="%1$s">login</a> 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 <a href="%4$s">reset your password</a>.'), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) );
+ printf( __('Your account has been activated. You may now <a href="%1$s">log in</a> 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 <a href="%4$s">reset your password</a>.'), 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 <a href="%1$s">%2$s</a> 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 <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword' ) );
}
/**
* Executing AJAX process.
*
- * @since unknown
+ * @since 2.1.0
*/
define('DOING_AJAX', true);
define('WP_ADMIN', true);
-require_once('../wp-load.php');
-
if ( ! isset( $_REQUEST['action'] ) )
die('-1');
+require_once('../wp-load.php');
+
require_once('./includes/admin.php');
@header('Content-Type: text/html; charset=' . get_option('blog_charset'));
send_nosniff_header();
if ( isset( $_GET['action'] ) ) :
switch ( $action = $_GET['action'] ) :
-case 'ajax-tag-search' :
- if ( !current_user_can( 'edit_posts' ) )
- die('-1');
+case 'fetch-list' :
- $s = $_GET['q']; // is this slashed already?
+ $list_class = $_GET['list_args']['class'];
+ check_ajax_referer( "fetch-list-$list_class", '_ajax_fetch_list_nonce' );
- if ( isset($_GET['tax']) )
- $taxonomy = sanitize_title($_GET['tax']);
- else
+ $current_screen = (object) $_GET['list_args']['screen'];
+ //TODO fix this in a better way see #15336
+ $current_screen->is_network = 'false' === $current_screen->is_network ? false : true;
+ $current_screen->is_user = 'false' === $current_screen->is_user ? false : true;
+
+ define( 'WP_NETWORK_ADMIN', $current_screen->is_network );
+ define( 'WP_USER_ADMIN', $current_screen->is_user );
+
+ $wp_list_table = _get_list_table( $list_class );
+ if ( ! $wp_list_table )
+ die( '0' );
+
+ if ( ! $wp_list_table->ajax_user_can() )
+ die( '-1' );
+
+ $wp_list_table->ajax_response();
+
+ die( '0' );
+ break;
+case 'ajax-tag-search' :
+ if ( isset( $_GET['tax'] ) ) {
+ $taxonomy = sanitize_key( $_GET['tax'] );
+ $tax = get_taxonomy( $taxonomy );
+ if ( ! $tax )
+ die( '0' );
+ if ( ! current_user_can( $tax->cap->assign_terms ) )
+ die( '-1' );
+ } else {
die('0');
+ }
+
+ $s = stripslashes( $_GET['q'] );
if ( false !== strpos( $s, ',' ) ) {
$s = explode( ',', $s );
if ( strlen( $s ) < 2 )
die; // require 2 chars for matching
- $results = $wpdb->get_col( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = '$taxonomy' AND t.name LIKE ('%" . $s . "%')" );
+ $results = $wpdb->get_col( $wpdb->prepare( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.name LIKE (%s)", $taxonomy, '%' . like_escape( $s ) . '%' ) );
echo join( $results, "\n" );
die;
* @param int $comment_id
* @return die
*/
-function _wp_ajax_delete_comment_response( $comment_id ) {
+function _wp_ajax_delete_comment_response( $comment_id, $delta = -1 ) {
$total = (int) @$_POST['_total'];
$per_page = (int) @$_POST['_per_page'];
$page = (int) @$_POST['_page'];
if ( !$total || !$per_page || !$page || !$url )
die( (string) time() );
- if ( --$total < 0 ) // Take the total from POST and decrement it (since we just deleted one)
+ $total += $delta;
+ if ( $total < 0 )
$total = 0;
- if ( 0 != $total % $per_page && 1 != mt_rand( 1, $per_page ) ) // Only do the expensive stuff on a page-break, and about 1 other time per page
- die( (string) time() );
+ // Only do the expensive stuff on a page-break, and about 1 other time per page
+ if ( 0 == $total % $per_page || 1 == mt_rand( 1, $per_page ) ) {
+ $post_id = 0;
+ $status = 'total_comments'; // What type of comment count are we looking for?
+ $parsed = parse_url( $url );
+ if ( isset( $parsed['query'] ) ) {
+ parse_str( $parsed['query'], $query_vars );
+ if ( !empty( $query_vars['comment_status'] ) )
+ $status = $query_vars['comment_status'];
+ if ( !empty( $query_vars['p'] ) )
+ $post_id = (int) $query_vars['p'];
+ }
+
+ $comment_count = wp_count_comments($post_id);
- $post_id = 0;
- $status = 'total_comments'; // What type of comment count are we looking for?
- $parsed = parse_url( $url );
- if ( isset( $parsed['query'] ) ) {
- parse_str( $parsed['query'], $query_vars );
- if ( !empty( $query_vars['comment_status'] ) )
- $status = $query_vars['comment_status'];
- if ( !empty( $query_vars['p'] ) )
- $post_id = (int) $query_vars['p'];
+ if ( isset( $comment_count->$status ) ) // We're looking for a known type of comment count
+ $total = $comment_count->$status;
+ // else use the decremented value from above
}
- $comment_count = wp_count_comments($post_id);
$time = time(); // The time since the last comment count
- if ( isset( $comment_count->$status ) ) // We're looking for a known type of comment count
- $total = $comment_count->$status;
- // else use the decremented value from above
-
- $page_links = paginate_links( array(
- 'base' => add_query_arg( 'apage', '%#%', $url ),
- 'format' => '',
- 'prev_text' => __('«'),
- 'next_text' => __('»'),
- 'total' => ceil($total / $per_page),
- 'current' => $page
- ) );
$x = new WP_Ajax_Response( array(
'what' => 'comment',
'id' => $comment_id, // here for completeness - not used
'supplemental' => array(
- 'pageLinks' => $page_links,
+ 'total_items_i18n' => sprintf( _n( '1 item', '%s items', $total ), number_format_i18n( $total ) ),
+ 'total_pages' => ceil( $total / $per_page ),
+ 'total_pages_i18n' => number_format_i18n( ceil( $total / $per_page ) ),
'total' => $total,
'time' => $time
)
check_ajax_referer( "delete-comment_$id" );
$status = wp_get_comment_status( $comment->comment_ID );
+ $delta = -1;
if ( isset($_POST['trash']) && 1 == $_POST['trash'] ) {
if ( 'trash' == $status )
die( (string) time() );
if ( 'trash' != $status )
die( (string) time() );
$r = wp_untrash_comment( $comment->comment_ID );
+ if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'trash' ) // undo trash, not in trash
+ $delta = 1;
} elseif ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
if ( 'spam' == $status )
die( (string) time() );
if ( 'spam' != $status )
die( (string) time() );
$r = wp_unspam_comment( $comment->comment_ID );
+ if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'spam' ) // undo spam, not in spam
+ $delta = 1;
} elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) {
$r = wp_delete_comment( $comment->comment_ID );
} else {
}
if ( $r ) // Decide if we need to send back '1' or a more complicated response including page links and comment counts
- _wp_ajax_delete_comment_response( $comment->comment_ID );
+ _wp_ajax_delete_comment_response( $comment->comment_ID, $delta );
die( '0' );
break;
case 'delete-tag' :
else
die('0');
break;
-case 'delete-link-cat' :
- check_ajax_referer( "delete-link-category_$id" );
- if ( !current_user_can( 'manage_categories' ) )
- die('-1');
-
- $cat = get_term( $id, 'link_category' );
- if ( !$cat || is_wp_error( $cat ) )
- die('1');
-
- $cat_name = get_term_field('name', $id, 'link_category');
-
- $default = get_option('default_link_category');
-
- // Don't delete the default cats.
- if ( $id == $default ) {
- $x = new WP_AJAX_Response( array(
- 'what' => 'link-cat',
- 'id' => $id,
- 'data' => new WP_Error( 'default-link-cat', sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name) )
- ) );
- $x->send();
- }
-
- $r = wp_delete_term($id, 'link_category', array('default' => $default));
- if ( !$r )
- die('0');
- if ( is_wp_error($r) ) {
- $x = new WP_AJAX_Response( array(
- 'what' => 'link-cat',
- 'id' => $id,
- 'data' => $r
- ) );
- $x->send();
- }
- die('1');
- break;
case 'delete-link' :
check_ajax_referer( "delete-bookmark_$id" );
if ( !current_user_can( 'manage_links' ) )
}
$x->send();
break;
-case 'add-link-cat' : // From Blogroll -> Categories
- check_ajax_referer( 'add-link-category' );
- if ( !current_user_can( 'manage_categories' ) )
- die('-1');
-
- if ( '' === trim($_POST['name']) ) {
- $x = new WP_Ajax_Response( array(
- 'what' => 'link-cat',
- 'id' => new WP_Error( 'name', __('You did not enter a category name.') )
- ) );
- $x->send();
- }
-
- $r = wp_insert_term($_POST['name'], 'link_category', $_POST );
- if ( is_wp_error( $r ) ) {
- $x = new WP_AJAX_Response( array(
- 'what' => 'link-cat',
- 'id' => $r
- ) );
- $x->send();
- }
-
- extract($r, EXTR_SKIP);
-
- if ( !$link_cat = link_cat_row( $term_id ) )
- die('0');
-
- $x = new WP_Ajax_Response( array(
- 'what' => 'link-cat',
- 'id' => $term_id,
- 'position' => -1,
- 'data' => $link_cat
- ) );
- $x->send();
- break;
-case 'add-tag' : // From Manage->Tags
+case 'add-tag' :
check_ajax_referer( 'add-tag' );
$post_type = !empty($_POST['post_type']) ? $_POST['post_type'] : 'post';
$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');
+ $x = new WP_Ajax_Response();
+
$tag = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST );
if ( !$tag || is_wp_error($tag) || (!$tag = get_term( $tag['term_id'], $taxonomy )) ) {
- $message = __('An error has occured. Please reload the page and try again.');
+ $message = __('An error has occurred. Please reload the page and try again.');
if ( is_wp_error($tag) && $tag->get_error_message() )
$message = $tag->get_error_message();
$x->send();
}
- if ( isset($_POST['screen']) )
- set_current_screen($_POST['screen']);
+ set_current_screen( $_POST['screen'] );
+
+ $wp_list_table = _get_list_table('WP_Terms_List_Table');
$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 );
+ $level = count( get_ancestors( $tag->term_id, $taxonomy ) );
+ ob_start();
+ $wp_list_table->single_row( $tag, $level );
+ $noparents = ob_get_clean();
}
- $tag->name = $tag_full_name;
- $parents = _tag_row( $tag, 0, $taxonomy);
+
+ ob_start();
+ $wp_list_table->single_row( $tag );
+ $parents = ob_get_clean();
$x->add( array(
'what' => 'taxonomy',
$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.
+ 'supplemental' => (array) $tag
) );
$x->send();
break;
case 'get-tagcloud' :
- if ( !current_user_can( 'edit_posts' ) )
- die('-1');
-
- if ( isset($_POST['tax']) )
- $taxonomy = sanitize_title($_POST['tax']);
- else
+ if ( isset( $_POST['tax'] ) ) {
+ $taxonomy = sanitize_key( $_POST['tax'] );
+ $tax = get_taxonomy( $taxonomy );
+ if ( ! $tax )
+ die( '0' );
+ if ( ! current_user_can( $tax->cap->assign_terms ) )
+ die( '-1' );
+ } else {
die('0');
+ }
$tags = get_terms( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) );
- if ( empty( $tags ) ) {
- $tax = get_taxonomy( $taxonomy );
+ if ( empty( $tags ) )
die( isset( $tax->no_tagcloud ) ? $tax->no_tagcloud : __('No tags found!') );
- }
- if ( is_wp_error($tags) )
- die($tags->get_error_message());
+ if ( is_wp_error( $tags ) )
+ die( $tags->get_error_message() );
foreach ( $tags as $key => $tag ) {
$tags[ $key ]->link = '#';
exit;
break;
-case 'add-comment' :
- check_ajax_referer( $action );
- if ( !current_user_can( 'edit_posts' ) )
- die('-1');
- $search = isset($_POST['s']) ? $_POST['s'] : false;
- $status = isset($_POST['comment_status']) ? $_POST['comment_status'] : 'all';
- $per_page = isset($_POST['per_page']) ? (int) $_POST['per_page'] + 8 : 28;
- $start = isset($_POST['page']) ? ( intval($_POST['page']) * $per_page ) -1 : $per_page - 1;
- if ( 1 > $start )
- $start = 27;
-
- $mode = isset($_POST['mode']) ? $_POST['mode'] : 'detail';
- $p = isset($_POST['p']) ? $_POST['p'] : 0;
- $comment_type = isset($_POST['comment_type']) ? $_POST['comment_type'] : '';
- list($comments, $total) = _wp_get_comment_list( $status, $search, $start, 1, $p, $comment_type );
-
- if ( get_option('show_avatars') )
- add_filter( 'comment_author', 'floated_admin_avatar' );
-
- if ( !$comments )
- die('1');
- $x = new WP_Ajax_Response();
- foreach ( (array) $comments as $comment ) {
- get_comment( $comment );
- ob_start();
- _wp_comment_row( $comment->comment_ID, $mode, $status, true, true );
- $comment_list_item = ob_get_contents();
- ob_end_clean();
- $x->add( array(
- 'what' => 'comment',
- 'id' => $comment->comment_ID,
- 'data' => $comment_list_item
- ) );
- }
- $x->send();
- break;
case 'get-comments' :
check_ajax_referer( $action );
- $post_ID = (int) $_POST['post_ID'];
- if ( !current_user_can( 'edit_post', $post_ID ) )
- die('-1');
+ set_current_screen( 'edit-comments' );
- $start = isset($_POST['start']) ? intval($_POST['start']) : 0;
- $num = isset($_POST['num']) ? intval($_POST['num']) : 10;
+ $wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
- list($comments, $total) = _wp_get_comment_list( false, false, $start, $num, $post_ID );
+ if ( !current_user_can( 'edit_post', $post_id ) )
+ die('-1');
- if ( !$comments )
+ $wp_list_table->prepare_items();
+
+ if ( !$wp_list_table->has_items() )
die('1');
$comment_list_item = '';
$x = new WP_Ajax_Response();
- foreach ( (array) $comments as $comment ) {
+ foreach ( $wp_list_table->items as $comment ) {
get_comment( $comment );
ob_start();
- _wp_comment_row( $comment->comment_ID, 'single', false, false );
+ $wp_list_table->single_row( $comment );
$comment_list_item .= ob_get_contents();
ob_end_clean();
}
case 'replyto-comment' :
check_ajax_referer( $action, '_ajax_nonce-replyto-comment' );
+ set_current_screen( 'edit-comments' );
+
$comment_post_ID = (int) $_POST['comment_post_ID'];
if ( !current_user_can( 'edit_post', $comment_post_ID ) )
die('-1');
$comment = get_comment($comment_id);
if ( ! $comment ) die('1');
- $modes = array( 'single', 'detail', 'dashboard' );
- $mode = isset($_POST['mode']) && in_array( $_POST['mode'], $modes ) ? $_POST['mode'] : 'detail';
$position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
- $checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
-
- if ( get_option('show_avatars') && 'single' != $mode )
- add_filter( 'comment_author', 'floated_admin_avatar' );
$x = new WP_Ajax_Response();
ob_start();
- if ( 'dashboard' == $mode ) {
+ if ( 'dashboard' == $_REQUEST['mode'] ) {
require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );
- _wp_dashboard_recent_comments_row( $comment, false );
+ _wp_dashboard_recent_comments_row( $comment );
} else {
- _wp_comment_row( $comment->comment_ID, $mode, false, $checkbox );
+ if ( 'single' == $_REQUEST['mode'] ) {
+ $wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
+ } else {
+ $wp_list_table = _get_list_table('WP_Comments_List_Table');
+ }
+ $wp_list_table->single_row( $comment );
}
$comment_list_item = ob_get_contents();
ob_end_clean();
case 'edit-comment' :
check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' );
+ set_current_screen( 'edit-comments' );
+
$comment_post_ID = (int) $_POST['comment_post_ID'];
if ( ! current_user_can( 'edit_post', $comment_post_ID ) )
die('-1');
$_POST['comment_status'] = $_POST['status'];
edit_comment();
- $mode = ( isset($_POST['mode']) && 'single' == $_POST['mode'] ) ? 'single' : 'detail';
$position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
- $checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
- $comments_listing = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';
-
- if ( get_option('show_avatars') && 'single' != $mode )
- add_filter( 'comment_author', 'floated_admin_avatar' );
+ $comments_status = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';
- $x = new WP_Ajax_Response();
+ $checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
+ $wp_list_table = _get_list_table( $checkbox ? 'WP_Comments_List_Table' : 'WP_Post_Comments_List_Table' );
ob_start();
- _wp_comment_row( $comment_id, $mode, $comments_listing, $checkbox );
+ $wp_list_table->single_row( get_comment( $comment_id ) );
$comment_list_item = ob_get_contents();
ob_end_clean();
+ $x = new WP_Ajax_Response();
+
$x->add( array(
'what' => 'edit_comment',
'id' => $comment->comment_ID,
require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
- $item_ids = wp_save_nav_menu_items( 0, $_POST['menu-item'] );
+ // For performance reasons, we omit some object properties from the checklist.
+ // The following is a hacky way to restore them when adding non-custom items.
+
+ $menu_items_data = array();
+ foreach ( (array) $_POST['menu-item'] as $menu_item_data ) {
+ if (
+ ! empty( $menu_item_data['menu-item-type'] ) &&
+ 'custom' != $menu_item_data['menu-item-type'] &&
+ ! empty( $menu_item_data['menu-item-object-id'] )
+ ) {
+ switch( $menu_item_data['menu-item-type'] ) {
+ case 'post_type' :
+ $_object = get_post( $menu_item_data['menu-item-object-id'] );
+ break;
+
+ case 'taxonomy' :
+ $_object = get_term( $menu_item_data['menu-item-object-id'], $menu_item_data['menu-item-object'] );
+ break;
+ }
+
+ $_menu_items = array_map( 'wp_setup_nav_menu_item', array( $_object ) );
+ $_menu_item = array_shift( $_menu_items );
+
+ // Restore the missing menu item properties
+ $menu_item_data['menu-item-description'] = $_menu_item->description;
+ }
+
+ $menu_items_data[] = $menu_item_data;
+ }
+
+ $item_ids = wp_save_nav_menu_items( 0, $menu_items_data );
if ( is_wp_error( $item_ids ) )
die('-1');
check_ajax_referer( $action );
if ( !current_user_can('create_users') )
die('-1');
- require_once(ABSPATH . WPINC . '/registration.php');
if ( !$user_id = add_user() )
die('0');
elseif ( is_wp_error( $user_id ) ) {
}
$user_object = new WP_User( $user_id );
+ $wp_list_table = _get_list_table('WP_Users_List_Table');
+
$x = new WP_Ajax_Response( array(
'what' => 'user',
'id' => $user_id,
- 'data' => user_row( $user_object, '', $user_object->roles[0] ),
+ 'data' => $wp_list_table->single_row( $user_object, '', $user_object->roles[0] ),
'supplemental' => array(
'show-link' => sprintf(__( 'User <a href="#%s">%s</a> added' ), "user-$user_id", $user_object->user_login),
'role' => $user_object->roles[0]
_wp_ajax_menu_quick_search( $_REQUEST );
+ exit;
+ break;
+case 'wp-link-ajax':
+ require_once ABSPATH . 'wp-admin/includes/internal-linking.php';
+
+ check_ajax_referer( 'internal-linking', '_ajax_linking_nonce' );
+
+ $args = array();
+
+ if ( isset( $_POST['search'] ) )
+ $args['s'] = stripslashes( $_POST['search'] );
+ $args['pagenum'] = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 1;
+
+ $results = wp_link_query( $args );
+
+ if ( ! isset( $results ) )
+ die( '0' );
+
+ echo json_encode( $results );
+ echo "\n";
+
exit;
break;
case 'menu-locations-save':
die( __('You are not allowed to edit this post.') );
}
- if ( isset($_POST['screen']) )
- set_current_screen($_POST['screen']);
+ set_current_screen( $_POST['screen'] );
if ( $last = wp_check_post_lock( $post_ID ) ) {
$last_user = get_userdata( $last );
// update the post
edit_post();
- if ( in_array( $_POST['post_type'], get_post_types( array( 'show_ui' => true ) ) ) ) {
- $post = array();
- $post[] = get_post($_POST['post_ID']);
- if ( is_post_type_hierarchical( $_POST['post_type'] ) ) {
- page_rows( $post );
- } else {
- $mode = $_POST['post_view'];
- post_rows( $post );
- }
- }
+ $wp_list_table = _get_list_table('WP_Posts_List_Table');
+
+ $mode = $_POST['post_view'];
+ $wp_list_table->display_rows( array( get_post( $_POST['post_ID'] ) ) );
exit;
break;
case 'inline-save-tax':
check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' );
- $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : false;
- if ( ! $taxonomy )
- die( __('Cheatin’ uh?') );
- $tax = get_taxonomy($taxonomy);
+ $taxonomy = sanitize_key( $_POST['taxonomy'] );
+ $tax = get_taxonomy( $taxonomy );
+ if ( ! $tax )
+ die( '0' );
if ( ! current_user_can( $tax->cap->edit_terms ) )
- die( __('Cheatin’ uh?') );
-
- if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) )
- die(-1);
+ die( '-1' );
- switch ($_POST['tax_type']) {
- case 'link-cat' :
- $updated = wp_update_term($id, 'link_category', $_POST);
+ set_current_screen( 'edit-' . $taxonomy );
- if ( $updated && !is_wp_error($updated) )
- echo link_cat_row($updated['term_id']);
- else
- die( __('Category not updated.') );
+ $wp_list_table = _get_list_table('WP_Terms_List_Table');
- break;
- case 'tag' :
- $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
-
- $tag = get_term( $id, $taxonomy );
- $_POST['description'] = $tag->description;
-
- $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 ) ) {
- if ( is_wp_error($tag) && $tag->get_error_message() )
- die( $tag->get_error_message() );
- die( __('Item not updated.') );
- }
+ if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) )
+ die(-1);
- set_current_screen( 'edit-' . $taxonomy );
+ $tag = get_term( $id, $taxonomy );
+ $_POST['description'] = $tag->description;
- echo _tag_row($tag, 0, $taxonomy);
- } else {
- if ( is_wp_error($updated) && $updated->get_error_message() )
- die( $updated->get_error_message() );
- die( __('Item not updated.') );
- }
+ $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 ) ) {
+ if ( is_wp_error($tag) && $tag->get_error_message() )
+ die( $tag->get_error_message() );
+ die( __('Item not updated.') );
+ }
- break;
+ echo $wp_list_table->single_row( $tag );
+ } else {
+ if ( is_wp_error($updated) && $updated->get_error_message() )
+ die( $updated->get_error_message() );
+ die( __('Item not updated.') );
}
exit;
$searchand = $search = '';
foreach ( (array) $search_terms as $term ) {
- $term = addslashes_gpc($term);
+ $term = esc_sql( like_escape( $term ) );
$search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))";
$searchand = ' AND ';
}
- $term = $wpdb->escape($s);
+ $term = esc_sql( like_escape( $s ) );
if ( count($search_terms) > 1 && $search_terms[0] != $s )
$search .= " OR ($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%')";
));
$x->send();
- break;
-case 'lj-importer' :
- check_ajax_referer( 'lj-api-import' );
- if ( !current_user_can( 'publish_posts' ) )
- die('-1');
- if ( empty( $_POST['step'] ) )
- die( '-1' );
- define('WP_IMPORTING', true);
- include( ABSPATH . 'wp-admin/import/livejournal.php' );
- $result = $lj_api_import->{ 'step' . ( (int) $_POST['step'] ) }();
- if ( is_wp_error( $result ) )
- echo $result->get_error_message();
- die;
break;
case 'widgets-order' :
check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' );
$sidebar_id = $_POST['sidebar'];
$multi_number = !empty($_POST['multi_number']) ? (int) $_POST['multi_number'] : 0;
$settings = isset($_POST['widget-' . $id_base]) && is_array($_POST['widget-' . $id_base]) ? $_POST['widget-' . $id_base] : false;
- $error = '<p>' . __('An error has occured. Please reload the page and try again.') . '</p>';
+ $error = '<p>' . __('An error has occurred. Please reload the page and try again.') . '</p>';
$sidebars = wp_get_sidebars_widgets();
$sidebar = isset($sidebars[$sidebar_id]) ? $sidebars[$sidebar_id] : array();
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 );
- die( _wp_post_thumbnail_html( $thumbnail_id ) );
- }
- }
+ if ( set_post_thumbnail( $post_ID, $thumbnail_id ) )
+ die( _wp_post_thumbnail_html( $thumbnail_id ) );
die( '0' );
break;
+case 'date_format' :
+ die( date_i18n( sanitize_option( 'date_format', $_POST['date'] ) ) );
+ break;
+case 'time_format' :
+ die( date_i18n( sanitize_option( 'time_format', $_POST['date'] ) ) );
+ break;
default :
do_action( 'wp_ajax_' . $_POST['action'] );
die('0');
get_admin_page_title();
$title = esc_html( strip_tags( $title ) );
+
+if ( is_network_admin() )
+ $admin_title = __( 'Network Admin' );
+elseif ( is_user_admin() )
+ $admin_title = __( 'Global Dashboard' );
+else
+ $admin_title = get_bloginfo( 'name' );
+
+if ( $admin_title == $title )
+ $admin_title = sprintf( __( '%1$s — WordPress' ), $title );
+else
+ $admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $admin_title );
+
+$admin_title = apply_filters( 'admin_title', $admin_title, $title );
+
wp_user_settings();
wp_menu_unfold();
+
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
-<title><?php echo $title; ?> ‹ <?php bloginfo('name') ?> — WordPress</title>
+<title><?php echo $admin_title; ?></title>
<?php
-wp_admin_css( 'css/global' );
+wp_admin_css( 'global' );
wp_admin_css();
-wp_admin_css( 'css/colors' );
-wp_admin_css( 'css/ie' );
+wp_admin_css( 'colors' );
+wp_admin_css( 'ie' );
if ( is_multisite() )
- wp_admin_css( 'css/ms' );
+ wp_admin_css( 'ms' );
wp_enqueue_script('utils');
$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
if ( in_array( $pagenow, array('post.php', 'post-new.php') ) ) {
add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 );
+ add_action( 'admin_print_footer_scripts', 'wp_tiny_mce_preload_dialogs', 30 );
wp_enqueue_script('quicktags');
}
if ( get_user_setting('mfold') == 'f' )
$admin_body_class .= ' folded';
+if ( is_admin_bar_showing() )
+ $admin_body_class .= ' admin-bar';
+
if ( $is_iphone ) { ?>
<style type="text/css">.row-actions{visibility:visible;}</style>
<?php } ?>
<div id="wpcontent">
<div id="wphead">
<?php
-$blog_name = get_bloginfo('name', 'display');
+
+if ( is_network_admin() )
+ $blog_name = sprintf( __('%s Network Admin'), esc_html($current_site->site_name) );
+elseif ( is_user_admin() )
+ $blog_name = sprintf( __('%s Global Dashboard'), esc_html($current_site->site_name) );
+else
+ $blog_name = get_bloginfo('name', 'display');
if ( '' == $blog_name ) {
- $blog_name = ' ';
+ $blog_name = __( 'Visit Site' );
} else {
$blog_name_excerpt = wp_html_excerpt($blog_name, 40);
if ( $blog_name != $blog_name_excerpt )
<a href="<?php echo trailingslashit( get_bloginfo( 'url' ) ); ?>" title="<?php esc_attr_e('Visit Site') ?>">
<span id="site-title"><?php echo $blog_name ?></span>
</a>
-<?php if ( current_user_can('manage_options') && '1' != get_option('blog_public') ): ?>
+<?php if ( !is_network_admin() && !is_user_admin() && current_user_can('manage_options') && '1' != get_option('blog_public') ): ?>
<a id="privacy-on-link" href="options-privacy.php" title="<?php echo esc_attr( apply_filters('privacy_on_link_title', __('Your site is asking search engines not to index its content') ) ); ?>"><?php echo apply_filters('privacy_on_link_text', __('Search Engines Blocked') ); ?></a>
<?php endif; ?>
</h1>
<p><?php
$links = array();
$links[5] = sprintf(__('Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>'), 'profile.php', $user_identity);
-$links[15] = '| <a href="' . wp_logout_url() . '" title="' . __('Log Out') . '">' . __('Log Out') . '</a>';
+if ( is_multisite() && is_super_admin() ) {
+ if ( !is_network_admin() )
+ $links[10] = '| <a href="' . network_admin_url() . '" title="' . ( ! empty( $update_title ) ? $update_title : esc_attr__('Network Admin') ) . '">' . __('Network Admin') . ( ! empty( $total_update_count ) ? ' (' . number_format_i18n( $total_update_count ) . ')' : '' ) . '</a>';
+ else
+ $links[10] = '| <a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>';
+}
+$links[15] = '| <a href="' . wp_logout_url() . '" title="' . esc_attr__('Log Out') . '">' . __('Log Out') . '</a>';
$links = apply_filters('admin_user_info_links', $links, $current_user);
ksort($links);
<div id="wpbody">
<?php
-unset($title_class, $blog_name);
+unset($title_class, $blog_name, $total_update_count, $update_title);
require(ABSPATH . 'wp-admin/menu-header.php');
<?php
screen_meta($current_screen);
-do_action('admin_notices');
+if ( is_network_admin() )
+ do_action('network_admin_notices');
+elseif ( is_user_admin() )
+ do_action('user_admin_notices');
+else
+ do_action('admin_notices');
+
+do_action('all_admin_notices');
if ( $parent_file == 'options-general.php' )
require(ABSPATH . 'wp-admin/options-head.php');
/**
* In WordPress Administration Panels
*
- * @since unknown
+ * @since 2.3.2
*/
-if ( !defined('WP_ADMIN') )
+if ( ! defined('WP_ADMIN') )
define('WP_ADMIN', TRUE);
+if ( ! defined('WP_NETWORK_ADMIN') )
+ define('WP_NETWORK_ADMIN', FALSE);
+
+if ( ! defined('WP_USER_ADMIN') )
+ define('WP_USER_ADMIN', FALSE);
+
+if ( ! WP_NETWORK_ADMIN && ! WP_USER_ADMIN ) {
+ define('WP_BLOG_ADMIN', TRUE);
+}
+
if ( isset($_GET['import']) && !defined('WP_LOAD_IMPORTERS') )
define('WP_LOAD_IMPORTERS', true);
nocache_headers();
-update_category_cache();
-
// Schedule trash collection
if ( !wp_next_scheduled('wp_scheduled_delete') && !defined('WP_INSTALLING') )
wp_schedule_event(time(), 'daily', 'wp_scheduled_delete');
else
$taxnow = '';
-require(ABSPATH . 'wp-admin/menu.php');
+if ( WP_NETWORK_ADMIN )
+ require(ABSPATH . 'wp-admin/network/menu.php');
+elseif ( WP_USER_ADMIN )
+ require(ABSPATH . 'wp-admin/user/menu.php');
+else
+ require(ABSPATH . 'wp-admin/menu.php');
if ( current_user_can( 'manage_options' ) )
@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', '256M' ) );
$query_string = $_SERVER[ 'QUERY_STRING' ];
else
$query_string = 'page=' . $plugin_page;
- wp_redirect( 'tools.php?' . $query_string );
+ wp_redirect( admin_url('tools.php?' . $query_string) );
exit;
}
}
if ( ! current_user_can('import') )
wp_die(__('You are not allowed to import.'));
- if ( validate_file($importer) )
+ if ( validate_file($importer) ) {
wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );
+ exit;
+ }
// Allow plugins to define importers as well
if ( !isset($wp_importers) || !isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2])) {
- if (! file_exists(ABSPATH . "wp-admin/import/$importer.php"))
+ if (! file_exists(ABSPATH . "wp-admin/import/$importer.php")) {
wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );
+ exit;
+ }
include(ABSPATH . "wp-admin/import/$importer.php");
}
define('WP_IMPORTING', true);
- if ( is_multisite() )
- kses_init_filters(); // Always filter imported data with kses.
+ if ( apply_filters( 'force_filtered_html_on_import', false ) )
+ kses_init_filters(); // Always filter imported data with kses on multisite.
call_user_func($wp_importers[$importer][2]);
exit();
} else {
do_action("load-$pagenow");
- // Backwards compatibility with old load-page-new.php, load-page.php,
- // and load-categories.php actions.
- if ( $typenow == 'page' ) {
- if ( $pagenow == 'post-new.php' )
- do_action( 'load-page-new.php' );
- elseif ( $pagenow == 'post.php' )
- do_action( 'load-page.php' );
- } elseif ( $taxnow == 'category' && $pagenow == 'edit-tags.php' ) {
- do_action( 'load-categories.php' );
+ // Backwards compatibility with old load-page-new.php, load-page.php,
+ // and load-categories.php actions.
+ if ( $typenow == 'page' ) {
+ if ( $pagenow == 'post-new.php' )
+ do_action( 'load-page-new.php' );
+ elseif ( $pagenow == 'post.php' )
+ do_action( 'load-page.php' );
+ } elseif ( $pagenow == 'edit-tags.php' ) {
+ if ( $taxnow == 'category' )
+ do_action( 'load-categories.php' );
+ elseif ( $taxnow == 'link_category' )
+ do_action( 'load-edit-link-categories.php' );
}
}
add_contextual_help( $current_screen, '<p>' . __( '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.' ) . '</p>' .
'<p>' . __( 'You can also moderate the comment from this screen using the Status box, where you can also change the timestamp of the comment.' ) . '</p>' .
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
- '<p>' . __( '<a href="http://codex.wordpress.org/Administration_Panels#Comments" target="_blank">Comments Documentation</a>' ) . '</p>' .
+ '<p>' . __( '<a href="http://codex.wordpress.org/Administration_Panels#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank" >Support Forums</a>' ) . '</p>'
);
if ( !$comment = get_comment( $comment_id ) )
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'javascript:history.go(-1)') );
- if ( !current_user_can('edit_post', $comment->comment_post_ID) )
- comment_footer_die( __('You are not allowed to edit comments on this post.') );
+ if ( !current_user_can( 'edit_comment', $comment_id ) )
+ comment_footer_die( __('You are not allowed to edit this comment.') );
if ( 'trash' == $comment->comment_approved )
comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') );
case 'trash' :
case 'spam' :
+ $title = __('Moderate Comment');
+
$comment_id = absint( $_GET['c'] );
if ( !$comment = get_comment_to_edit( $comment_id ) ) {
die();
}
- if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) {
+ if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) {
wp_redirect( admin_url('edit-comments.php?error=2') );
die();
}
<div class="narrow">
<?php screen_icon(); ?>
-<h2><?php esc_html_e( 'Moderate Comment' ); ?></h2>
+<h2><?php echo esc_html( $title ); ?></h2>
<?php
switch ( $action ) {
<table width="100%">
<tr>
<td><a class="button" href="<?php echo admin_url('edit-comments.php'); ?>"><?php esc_attr_e('No'); ?></a></td>
-<td class="textright"><input type='submit' class="button" value='<?php echo esc_attr($button); ?>' /></td>
+<td class="textright"><?php submit_button( $button, 'button' ); ?></td>
</tr>
</table>
<?php wp_nonce_field( $nonce_action ); ?>
<input type='hidden' name='action' value='<?php echo esc_attr($formaction); ?>' />
-<input type='hidden' name='p' value='<?php echo esc_attr($comment->comment_post_ID); ?>' />
<input type='hidden' name='c' value='<?php echo esc_attr($comment->comment_ID); ?>' />
<input type='hidden' name='noredir' value='1' />
</form>
if ( !$comment = get_comment($comment_id) )
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit-comments.php') );
- if ( !current_user_can('edit_post', $comment->comment_post_ID ) )
+ if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
comment_footer_die( __('You are not allowed to edit comments on this post.') );
if ( '' != wp_get_referer() && ! $noredir && false === strpos(wp_get_referer(), 'comment.php') )
-.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
+.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?ver=20101117) 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?ver=20101117) 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?ver=20101117) repeat-x scroll right -207px;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark-rtl-vs.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?ver=20101117) top right repeat-x;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark-rtl-vs.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?ver=20101117) 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?ver=20101117) repeat-x scroll right -109px;}#adminmenu a.wp-has-submenu{background:#eff8ff url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right -379px;}#adminmenu .wp-submenu a{background:#fff url(../images/menu-bits-rtl-vs.gif?ver=20101117) no-repeat scroll right -99px;}#adminmenu li.wp-has-current-submenu a.wp-has-submenu{background:#b5b5b5 url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right top;}.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) 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
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;
+ background: #eee url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right -379px;
}
#upload-menu li.current {
border-right-color: transparent;
}
#adminmenu .wp-submenu .current a.current {
- background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -289px;
+ background: transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) no-repeat scroll right -289px;
}
#adminmenu li.wp-menu-separator {
#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;
+ background: transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) 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;
+ background: url(../images/menu-dark-rtl-vs.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;
+ background: url(../images/menu-bits-rtl-vs.gif?ver=20101117) 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;
+ background: url(../images/menu-dark-rtl-vs.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;
+ background: transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) 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;
+ background: transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right -109px;
}
#adminmenu a.wp-has-submenu {
- background: #f1f1f1 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -379px;
+ background: #eff8ff url(../images/menu-bits-rtl-vs.gif?ver=20101117) repeat-x scroll right -379px;
}
#adminmenu .wp-submenu a {
- background: #fff url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -310px;
+ background: #fff url(../images/menu-bits-rtl-vs.gif?ver=20101117) no-repeat scroll right -99px;
}
#adminmenu li.wp-has-current-submenu a.wp-has-submenu {
- background: #b5b5b5 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right top;
+ background: #b5b5b5 url(../images/menu-bits-rtl-vs.gif?ver=20101117) 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;
+ background: transparent url(../images/menu-bits-rtl-vs.gif?ver=20101117) 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
+ background: transparent url(../images/fav-arrow-rtl.gif?ver=20100531) no-repeat right -4px;
+}
-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
+html,.wp-dialog{background-color:#fcfcfb;}* 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:#174f69;}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:#D1E5EE;}#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:#D1E5EE;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,.wp-tab-panel,ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{border-color:#dfdfdf;}ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{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:#cfdfe9 url("../images/blue-grad.png?ver=20101102") 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:#174f69;}.ac_over{background-color:#f0f0b8;}.ac_results{background-color:#fff;border-color:#808080;}.ac_results li{color:#101010;}.alternate,.alt{background-color:#F8F7F3;}.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;}div.error,.login #login_error{background-color:#ffebe8;border-color:#c00;}div.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:#000;}.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,.wp-tab-bar .wp-tab-active 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;}div.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{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:#cfdfe9 url(../images/blue-grad.png?ver=20101102) repeat-x scroll left top;}th.sortable a:hover,th.sortable a:active,th.sortable a:focus{color:#333;}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;}#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,.submitted-on{color:#777;}.login #nav a{color:#21759b!important;}.login #nav a:hover{color:#d54e21!important;}#footer{color:#777;border-color:#b0c8d7;background:#cfdfe9;background:-moz-linear-gradient(bottom,#cfdfe9,#eff8ff);background:-webkit-gradient(linear,left bottom,left top,from(#cfdfe9),to(#eff8ff));}#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:#efede7;}.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:#D1E5EE;}.widget,.postbox{background-color:#fff;}.ui-sortable .postbox h3{color:#174f69;}.widget .widget-top,.ui-sortable .postbox h3:hover{color:#174f69;}.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:#b0c8d7 1px solid;background:#cfdfe9;background:-moz-linear-gradient(bottom,#cfdfe9,#eff8ff);background:-webkit-gradient(linear,left bottom,left top,from(#cfdfe9),to(#eff8ff));}#wphead h1 a{color:#174f69;}#user_info{color:#777;}#user_info a:link,#user_info a:visited,#footer a:link,#footer a:visited{color:#174f69;text-decoration:none;}#user_info a:hover,#footer a:hover{color:#000;text-decoration:underline!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:#cfdfe9;background-color:#cfdfe9;background-image:url("../images/ed-bg-vs.gif?ver=20101102");}#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:#eff8ff;border-color:#D1E5EE;color:#999;}#poststuff #editor-toolbar .active{border-bottom-color:#eff8ff;background-color:#eff8ff;color:#333;}#post-status-info{background-color:#eff8ff;}.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:#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:#cfdfe9 url("../images/ed-bg-vs.gif?ver=20101102") repeat-x scroll left top;border-color:#cfdfe9;}.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:#D1E5EE;}#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:#d1e5ee;}#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?ver=20101102) 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?ver=20101102) no-repeat scroll left -109px;}#adminmenu a.menu-top{background:#eff8ff url(../images/menu-bits-vs.gif?ver=20101102) repeat-x scroll left -379px;}#adminmenu .wp-submenu a{background:#fff url(../images/menu-bits-vs.gif?ver=20101102) no-repeat scroll 0 -99px;}#adminmenu .wp-has-current-submenu ul li a{background:none;}#adminmenu .wp-has-current-submenu ul li a.current{background:url(../images/menu-dark-vs.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:#d0dfe9 url(../images/menu-bits-vs.gif?ver=20101102) top left repeat-x;border:#5589aa 1px solid;color:#464646;}#adminmenu li.wp-has-current-submenu .wp-submenu,#adminmenu li.wp-has-current-submenu ul li a{border-right-color:#5589aa!important;border-left-color:#5589aa!important;}#adminmenu li.wp-has-current-submenu ul li a{background:url(../images/menu-dark-vs.gif) bottom left no-repeat!important;}#adminmenu li.wp-has-current-submenu ul{border-bottom-color:#5589aa;}#adminmenu .wp-submenu .current a.current{background:transparent url(../images/menu-bits-vs.gif?ver=20101102) no-repeat scroll 0 -289px;}#adminmenu .wp-submenu a:hover{background-color:#f8f7f3!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:#efede7;background-image:none;border-color:#5589aa;}#adminmenu .wp-submenu ul{background-color:#fff;}.folded #adminmenu li.menu-top,#adminmenu .wp-submenu .wp-submenu-head{background:#eff8ff url(../images/menu-bits-vs.gif?ver=20101102) repeat-x scroll left -379px;}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.menu-top.current{background:#e0e0e0 url(../images/menu-bits-vs.gif?ver=20101102) top left repeat-x;border:#5589aa 1px solid;color:#464646;}#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background:#d0dfe9 url(../images/menu-bits-vs.gif?ver=20101102) repeat-x 0 0;border:1px solid;color:#464646;}#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:#F8F7F3;border-color:#D1e5ee;}#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;}body.press-this .postbox:hover .handlediv,body.press-this .stuffbox:hover .handlediv,.meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/menu-bits-vs.gif?ver=20101102) no-repeat scroll left -111px;}#major-publishing-actions{background:#eaf2fa;}.tablenav .tablenav-pages{color:#555;}.tablenav .tablenav-pages a{border-color:#d1e5ee;background:#eee url('../images/menu-bits-vs.gif?ver=20101102') repeat-x scroll left -379px;}.tablenav .tablenav-pages a:hover,.tablenav .tablenav-pages a:focus{color:#d54e21;}.tablenav .tablenav-pages a.disabled,.tablenav .tablenav-pages a.disabled:hover,.tablenav .tablenav-pages a.disabled:focus{color:#aaa;}.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,body.press-this 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{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 .screen-meta-toggle{background:#D1E5ee;}#screen-meta a.show-settings,.toggle-arrow{background-image:url("../images/screen-options-toggle-vs.gif?ver=20100531");}#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.png) no-repeat 0 0;}.view-switch .current #view-switch-list{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 .current #view-switch-excerpt{background:transparent url(../images/list.png) no-repeat -60px 0;}#header-logo{background:transparent url(../images/wp-logo-vs.png?ver=20101102) 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{border-color:#D1E5EE;background-color:#f8f7f3;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;}#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?ver=20101102);text-shadow:#fff 0 1px 0;border-color:#dfdfdf;}#widgets-right .sidebar-name{background-image:url(../images/button-grad.png);text-shadow:#174f69 0 -1px 0;background-color:#cfdfe9;border-color:#174f69;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?ver=20101102) no-repeat scroll left -109px;}#widgets-right .sidebar-name-arrow{background:url("../images/widgets-arrow-vs.gif?ver=20100531") no-repeat scroll 0 -1px transparent;}.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,#nav-menu-footer,.menu-item-handle{background:url("../images/ed-bg-vs.gif?ver=20101102") repeat-x scroll left top #cfdfe9;border-top:solid #D1E5EE 1px;}#menu-management .nav-tab-active{background:#eff8ff;border-bottom-color:#eff8ff;}
\ No newline at end of file
-html {
- background-color: #f7f6f1;
+html,
+.wp-dialog {
+ background-color: #fcfcfb;
}
* html input,
* html .widget {
- border-color: #8cbdd5;
+ border-color: #dfdfdf;
}
textarea,
body,
#wpbody,
.form-table .pre {
- color: #333;
+ color: #174f69;
}
body > #upload-menu {
div.dashboard-widget,
#dashboard-widgets p.dashboard-widget-links,
#replyrow #ed_reply_toolbar input {
- border-color: #ccc;
+ border-color: #D1E5EE
}
#poststuff .inside label.spam,
#postcustomstuff table {
border-color: #dfdfdf;
- background-color: #f9f9f9;
+ background-color: #F9F9F9;
}
#postcustomstuff thead th {
- background-color: #f1f1f1;
+ background-color: #F1F1F1;
}
#postcustomstuff table input,
}
.widefat {
- border-color: #dfdfdf;
+ border-color: #D1E5EE;
background-color: #fff;
}
}
div.tabs-panel,
+.wp-tab-panel,
ul.category-tabs li.tabs,
-ul.add-menu-item-tabs li.tabs {
+ul.add-menu-item-tabs li.tabs,
+.wp-tab-active {
border-color: #dfdfdf;
}
ul.category-tabs li.tabs,
-ul.add-menu-item-tabs li.tabs {
+ul.add-menu-item-tabs li.tabs,
+.wp-tab-active {
background-color: #f1f1f1;
}
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 {
.widget .widget-top,
.postbox h3,
.stuffbox h3 {
- background: #d5e6f2 url("../images/blue-grad.png") repeat-x left top;
+ background: #cfdfe9 url("../images/blue-grad.png?ver=20101102") repeat-x left top;
text-shadow: #fff 0 1px 0;
}
}
.wrap h2 {
- color: #093e56;
+ color: #174f69;
}
.ac_over {
color: #101010;
}
-.alt
-.alternate {
- background-color: #edfbfc;
+.alternate,
+.alt {
+ background-color: #F8F7F3;
}
.available-theme a.screenshot {
border-top-color: #dfdfdf;
}
-.error,
+div.error,
.login #login_error {
background-color: #ffebe8;
border-color: #c00;
}
-.error a {
+div.error a {
color: #c00;
}
}
.submit {
- border-color: #8cbdd5;
+ border-color: #DFDFDF;
}
.highlight {
background-color: #e4f2fd;
- color: #d54e21;
+ color: #000;
}
.howto,
.submit input,
input[type=button],
input[type=submit] {
- border-color: #dfdfdf;
+ border-color: #bbb;
color: #464646;
}
input[type=button]:hover,
input[type=submit]:hover {
color: #000;
- border-color: #adaca7;
+ border-color: #666;
}
.button,
input.button-primary,
button.button-primary,
a.button-primary {
- border-color: #5b86ab;
+ border-color: #298cba;
font-weight: bold;
color: #fff;
- background: #5580a6 url(../images/button-grad-vs.png) repeat-x scroll left top;
+ 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-vs.png) repeat-x scroll left top;
+ background: #21759b url(../images/button-grad-active.png) repeat-x scroll left top;
color: #eaf2fa;
}
a.button-primary:hover,
a.button-primary:focus,
a.button-primary:active {
- border-color: #2e5475;
+ border-color: #13455b;
color: #eaf2fa;
}
.button-primary-disabled,
.button-primary[disabled],
.button-primary:disabled {
- color: #B0C3E2 !important;
- background: #6590A6 !important;
+ color: #9FD0D5 !important;
+ background: #298CBA !important;
}
a:hover,
}
#side-sortables .category-tabs .tabs a,
-#side-sortables .add-menu-item-tabs .tabs a {
+#side-sortables .add-menu-item-tabs .tabs a,
+.wp-tab-bar .wp-tab-active a {
color: #333;
}
color: #d54e21;
}
-.updated,
+div.updated,
.login .message {
background-color: #ffffe0;
border-color: #e6db55;
}
a.page-numbers {
- border-bottom-color: #b8d3e2;
+ border-bottom-color: #B8D3E2;
}
.commentlist li {
}
.widefat td,
-.widefat th,
-#install-plugins .plugins td,
-#install-plugins .plugins th {
+.widefat th {
border-color: #dfdfdf;
}
h3.dashboard-widget-title small,
.find-box-head {
color: #333;
- background: #d5e6f2 url(../images/blue-grad.png) repeat-x scroll left top;
+ background: #cfdfe9 url(../images/blue-grad.png?ver=20101102) repeat-x scroll left top;
+}
+
+th.sortable a:hover, th.sortable a:active, th.sortable a:focus {
+ color: #333;
}
h3.dashboard-widget-title small a {
#media-items a.delete,
.plugins a.delete,
.ui-tabs-nav a {
- color: #1c6280;
-}
-
-/* Because we don't want visited on these links */
-body.press-this .tabs a,
-body.press-this .tabs a:hover {
- border-color: #c6d9e9;
- border-bottom-color: #fff;
- color: #d54e21;
+ color: #21759b;
}
#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,
#edit-slug-box strong,
.tablenav .displaying-num,
-#submitted-on {
+#submitted-on,
+.submitted-on {
color: #777;
}
color: #d54e21 !important;
}
-#footer,
-#footer-upgrade {
- background: #1d507d;
- color: #b6d1e4;
+#footer {
+ color: #777;
+ border-color: #b0c8d7;
+ background: #cfdfe9; /* fallback color */
+ background:-moz-linear-gradient(bottom, #cfdfe9, #eff8ff);
+ background:-webkit-gradient(linear, left bottom, left top, from(#cfdfe9), to(#eff8ff));
}
#media-items,
.checkbox,
.side-info,
.plugins tr,
-.postbox,
#your-profile #rich_editing {
background-color: #fff;
}
.plugins .inactive th,
.plugins .inactive td,
tr.inactive + tr.plugin-update-tr .plugin-update {
- background-color: #ebeeef;
+ background-color: #efede7;
}
.plugin-update-tr .update-message {
#titlediv,
#poststuff .postarea,
.stuffbox {
- border-color: #dfdfdf;
+ border-color: #D1E5EE;
}
.widget,
}
.ui-sortable .postbox h3 {
- color: #093e56;
+ color: #174f69;
}
.widget .widget-top,
.ui-sortable .postbox h3:hover {
- color: #000;
+ color: #174f69;
}
.curtime #timestamp {
}
.login #backtoblog a {
- color: #ccc;
+ color: #464646;
}
#wphead {
- background-color: #1d507d;
-}
-
-body.login {
- border-top-color: #093e56;
+ border-bottom:#b0c8d7 1px solid;
+ background: #cfdfe9; /* fallback color */
+ background:-moz-linear-gradient(bottom, #cfdfe9, #eff8ff);
+ background:-webkit-gradient(linear, left bottom, left top, from(#cfdfe9), to(#eff8ff));
}
#wphead h1 a {
- color: #fff;
+ color: #174f69;
}
#user_info {
- color: #b6d1e4;
+ color: #777;
}
#user_info a:link,
#user_info a:visited,
#footer a:link,
#footer a:visited {
- color: #fff;
+ color: #174f69;
text-decoration: none;
}
#user_info a:hover,
-#user_info a:active,
-#footer a:hover,
-#footer a:active {
- text-decoration: underline;
+#footer a:hover {
+ color: #000;
+ text-decoration: underline !important;
}
div#media-upload-error,
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 .trash a:hover
#dashboard_recent_comments .spam a:hover {
color: #f00;
}
-/* password strength meter */
#pass-strength-result {
background-color: #eee;
border-color: #ddd !important;
/* editors */
#quicktags {
- border-color: #dfdfdf;
- background-color: #dfdfdf;
+ border-color: #cfdfe9;
+ background-color: #cfdfe9;
+ background-image: url("../images/ed-bg-vs.gif?ver=20101102");
}
#ed_toolbar input {
- border-color: #c3c3c3;
+ border-color: #C3C3C3;
}
#ed_toolbar input:hover {
}
#poststuff .wp_themeSkin .mceStatusbar {
- border-color: #ededed;
+ border-color: #EDEDED;
}
#poststuff #edButtonPreview,
#poststuff #edButtonHTML {
- background-color: #f2f1eb;
- border-color: #dfdfdf;
+ background-color: #eff8ff;
+ border-color: #D1E5EE;
color: #999;
}
#poststuff #editor-toolbar .active {
- border-bottom-color: #e3eef7;
- background-color: #e3eef7;
+ border-bottom-color: #eff8ff;
+ background-color: #eff8ff;
color: #333;
}
/* TinyMCE */
#post-status-info {
- background-color: #ededed;
+ background-color: #eff8ff;
}
.wp_themeSkin *,
.wp_themeSkin a:link,
.wp_themeSkin a:visited,
.wp_themeSkin a:active {
- color: #000;
+ color: #000;
}
/* Containers */
/* Button */
.wp_themeSkin .mceButton {
background-color: #e9e8e8;
- border-color: #b2b2b2;
+ border-color: #B2B2B2;
}
.wp_themeSkin a.mceButtonEnabled:hover,
.wp_themeSkin a.mceButtonActive,
.wp_themeSkin a.mceButtonSelected {
- background-color: #d5d5d5;
+ background: #d5d5d5;
border-color: #777 !important;
}
/* ListBox */
.wp_themeSkin .mceListBox .mceText,
.wp_themeSkin .mceListBox .mceOpen {
- border-color: #b2b2b2;
+ border-color: #B2B2B2;
background-color: #d5d5d5;
}
}
.wp_themeSkin select.mceListBox {
- border-color: #b2b2b2;
+ border-color: #B2B2B2;
background-color: #fff;
}
/* SplitButton */
.wp_themeSkin .mceSplitButton a.mceAction,
.wp_themeSkin .mceSplitButton a.mceOpen {
- border-color: #b2b2b2;
+ border-color: #B2B2B2;
}
.wp_themeSkin .mceSplitButton a.mceOpen:hover,
}
.wp_themeSkin .mceSplitButtonActive {
- background-color: #b2b2b2;
+ background-color: #B2B2B2;
}
/* ColorSplitButton */
.wp_themeSkin div.mceColorSplitMenu table {
background-color: #ebebeb;
- border-color: #b2b2b2;
+ border-color: #B2B2B2;
}
.wp_themeSkin .mceColorSplitMenu a {
- border-color: #b2b2b2;
+ border-color: #B2B2B2;
}
.wp_themeSkin .mceColorSplitMenu a.mceMoreColors {
}
.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover {
- border-color: #0a246a;
- background-color: #b6bdd2;
+ border-color: #0A246A;
+ background-color: #B6BDD2;
}
.wp_themeSkin a.mceMoreColors:hover {
- border-color: #0a246a;
+ border-color: #0A246A;
}
/* Menu */
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;
+ background: #cfdfe9 url("../images/ed-bg-vs.gif?ver=20101102") repeat-x scroll left top;
+ border-color: #cfdfe9;
}
.wp-admin #mceModalBlocker {
}
.wp-admin .clearlooks2 .mceFocus .mceTop .mceLeft {
- background: #444;
+ background: #444444;
border-left: 1px solid #999;
border-top: 1px solid #999;
-moz-border-radius: 4px 0 0 0;
}
.wp-admin .clearlooks2 .mceFocus .mceTop .mceRight {
- background: #444;
+ background: #444444;
border-right: 1px solid #999;
border-top: 1px solid #999;
border-top-right-radius: 4px;
#post-status-info,
#titlediv #title,
.editwidget .widget-inside {
- border-color: #dfdfdf;
+ border-color: #D1E5EE;
}
#titlediv #title {
#timestampdiv input,
#namediv input,
#poststuff .inside .the-tagcloud {
- border-color: #dfdfdf;
+ border-color: #ddd;
}
/* menu */
#adminmenu * {
- border-color: #dfdfdf;
+ border-color: #d1e5ee;
}
#adminmenu li.wp-menu-separator {
#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;
+ background: transparent url(../images/menu-bits-vs.gif?ver=20101102) 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;
+ background: transparent url(../images/menu-bits-vs.gif?ver=20101102) no-repeat scroll left -109px;
}
#adminmenu a.menu-top {
- background: #eaf3fa url(../images/menu-bits-vs.gif) repeat-x scroll left -379px;
+ background: #eff8ff url(../images/menu-bits-vs.gif?ver=20101102) repeat-x scroll left -379px;
}
#adminmenu .wp-submenu a {
- background: #fff url(../images/menu-bits-vs.gif) no-repeat scroll 0 -310px;
+ background: #fff url(../images/menu-bits-vs.gif?ver=20101102) no-repeat scroll 0 -99px;
}
#adminmenu .wp-has-current-submenu ul li a {
}
#adminmenu .wp-has-current-submenu ul li a.current {
- background: url(../images/menu-dark.gif) top left no-repeat !important;
+ background: url(../images/menu-dark-vs.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: #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.current a.menu-top {
+ background: #d0dfe9 url(../images/menu-bits-vs.gif?ver=20101102) top left repeat-x;
+ border: #5589aa 1px solid;
+ color: #464646;
}
#adminmenu li.wp-has-current-submenu .wp-submenu,
#adminmenu li.wp-has-current-submenu ul li a {
- border-color: #aaa !important;
+ border-right-color: #5589aa !important;
+ border-left-color: #5589aa !important;
}
#adminmenu li.wp-has-current-submenu ul li a {
- background: url(../images/menu-dark.gif) bottom left no-repeat !important;
+ background: url(../images/menu-dark-vs.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;
+ border-bottom-color: #5589aa;
}
#adminmenu .wp-submenu .current a.current {
- background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll 0 -289px;
+ background: transparent url(../images/menu-bits-vs.gif?ver=20101102) no-repeat scroll 0 -289px;
}
#adminmenu .wp-submenu a:hover {
- background-color: #eaf2fa !important;
+ background-color: #f8f7f3 !important;
color: #333 !important;
}
#adminmenu .wp-submenu li.current a,
#adminmenu .wp-submenu li.current a:hover {
color: #333;
- background-color: #f5f5f5;
+ background-color: #efede7;
background-image: none;
- border-color: #e3e3e3;
- text-shadow: rgba(255,255,255,1) 0 1px 0;
+ border-color: #5589aa;
}
#adminmenu .wp-submenu ul {
.folded #adminmenu li.menu-top,
#adminmenu .wp-submenu .wp-submenu-head {
- background-color: #eaf2fa;
+ background: #eff8ff url(../images/menu-bits-vs.gif?ver=20101102) repeat-x scroll left -379px;
}
.folded #adminmenu li.wp-has-current-submenu,
.folded #adminmenu li.menu-top.current {
- background-color: #bbd8e7;
+ background: #e0e0e0 url(../images/menu-bits-vs.gif?ver=20101102) top left repeat-x;
+ border: #5589aa 1px solid;
+ color: #464646;
}
#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head {
- background-color: #bbd8e7;
- border-color: #8cbdd5;
+ background: #d0dfe9 url(../images/menu-bits-vs.gif?ver=20101102) repeat-x 0% 0%;
+ border: 1px solid;
+ color: #464646;
}
#adminmenu div.wp-submenu {
}
#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 {
+#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;
}
}
#att-info {
- background-color: #e4f2fd;
+ background-color: #E4F2FD;
}
/* edit image */
#sidemenu a.current {
background-color: #fff;
border-color: #dfdfdf #dfdfdf #fff;
- color: #d54e21;
+ color: #D54E21;
}
#screen-options-wrap,
#contextual-help-wrap {
- background-color: #eae9e4;
- border-color: #dfdfdf;
+ background-color: #F8F7F3;
+ border-color: #D1e5ee;
}
#screen-meta-links a.show-settings {
.vim-current,
.vim-current th,
.vim-current td {
- background-color: #e4f2fd !important;
+ background-color: #E4F2FD !important;
}
/* Install Plugins */
}
.inline-editor div.title {
- background-color: #eaf3fa;
+ background-color: #EAF3FA;
}
.inline-editor ul.cat-checklist {
}
.attention {
- color: #d54e21;
+ color: #D54E21;
}
+body.press-this .postbox:hover .handlediv,
+body.press-this .stuffbox:hover .handlediv,
.meta-box-sortables .postbox:hover .handlediv {
- background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;
+ background: transparent url(../images/menu-bits-vs.gif?ver=20101102) no-repeat scroll left -111px;
}
#major-publishing-actions {
}
.tablenav .tablenav-pages a {
- border-color: #e3e3e3;
- background: #eee url('../images/menu-bits-vs.gif') repeat-x scroll left -379px;
+ border-color: #d1e5ee;
+ background: #eee url('../images/menu-bits-vs.gif?ver=20101102') repeat-x scroll left -379px;
}
-.tablenav .tablenav-pages a:hover {
+.tablenav .tablenav-pages a:hover,
+.tablenav .tablenav-pages a:focus {
color: #d54e21;
- border-color: #d54321;
}
-.tablenav .tablenav-pages a:active {
- color: #fff !important;
+.tablenav .tablenav-pages a.disabled,
+.tablenav .tablenav-pages a.disabled:hover,
+.tablenav .tablenav-pages a.disabled:focus {
+ color: #aaa;
}
.tablenav .tablenav-pages .current {
}
#post-body ul.category-tabs li.tabs a,
-#post-body ul.add-menu-item-tabs li.tabs a {
+#post-body ul.add-menu-item-tabs li.tabs a,
+body.press-this ul.category-tabs li.tabs a {
color: #333;
}
}
#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;
+ 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: #5b86ac;
- background-color: #5580a6;
+ border-color: #c0c0c0;
+ background-color: #fff;
}
#favorite-toggle {
- background: transparent url(../images/fav-arrow-vs.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 .screen-meta-toggle {
+ background: #D1E5ee;
}
-#screen-meta a.show-settings {
- background-color: transparent;
- text-shadow: rgba(255,255,255,0.7) 0 1px 0;
+#screen-meta a.show-settings,
+.toggle-arrow {
+ background-image:url("../images/screen-options-toggle-vs.gif?ver=20100531");
}
#icon-edit,
}
.view-switch #view-switch-list {
- background: transparent url(../images/list-vs.png) no-repeat 0 0;
+ background: transparent url(../images/list.png) no-repeat 0 0;
}
-.view-switch #view-switch-list.current {
- background: transparent url(../images/list-vs.png) no-repeat -40px 0;
+.view-switch .current #view-switch-list {
+ background: transparent url(../images/list.png) no-repeat -40px 0;
}
.view-switch #view-switch-excerpt {
- background: transparent url(../images/list-vs.png) no-repeat -20px 0;
+ background: transparent url(../images/list.png) no-repeat -20px 0;
}
-.view-switch #view-switch-excerpt.current {
- background: transparent url(../images/list-vs.png) no-repeat -60px 0;
+.view-switch .current #view-switch-excerpt {
+ background: transparent url(../images/list.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;
+ background: transparent url(../images/wp-logo-vs.png?ver=20101102) no-repeat scroll center center;
}
.popular-tags,
.feature-filter {
background-color: #fff;
- border-color: #dfdfdf;
+ border-color: #DFDFDF;
}
#theme-information .action-button {
- border-top-color: #dfdfdf;
+ border-top-color: #DFDFDF;
}
.theme-listing br.line {
div.widgets-sortables,
#widgets-left .inactive {
- background-color: #f1f1f1;
- border-color: #ddd;
+ border-color: #D1E5EE;
+ background-color: #f8f7f3;
+ -moz-border-radius-bottomleft:8px;
+-moz-border-radius-bottomright:8px
}
#available-widgets .widget-holder {
#widgets-left .sidebar-name {
background-color: #aaa;
- background-image: url(../images/ed-bg-vs.gif);
+ background-image: url(../images/ed-bg-vs.gif?ver=20101102);
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;
+ background-image: url(../images/button-grad.png);
+ text-shadow: #174f69 0 -1px 0;
+ background-color: #cfdfe9;
+ border-color: #174f69;
+ color: #ffffff;
}
.sidebar-name:hover,
}
#widgets-left .sidebar-name-arrow {
- background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -109px;
+ background: transparent url(../images/menu-bits-vs.gif?ver=20101102) no-repeat scroll left -109px;
}
#widgets-right .sidebar-name-arrow {
- background: transparent url(../images/fav-arrow-vs.gif) no-repeat scroll 0 -1px;
+ background: url("../images/widgets-arrow-vs.gif?ver=20100531") no-repeat scroll 0 -1px transparent;
}
.in-widget-title {
background-color: #f1f1f1;
}
-#nav-menu-header, .menu-item-handle {
- background: url("../images/blue-grad.png") repeat-x scroll left top #d5e6f2;
+#nav-menu-header, #nav-menu-footer, .menu-item-handle {
+ background: url("../images/ed-bg-vs.gif?ver=20101102") repeat-x scroll left top #cfdfe9;
+ border-top: solid #D1E5EE 1px;
}
#menu-management .nav-tab-active {
- background: #eaf3fa;
- border-bottom-color: #eaf3fa;
-}
\ No newline at end of file
+ background: #eff8ff;
+ border-bottom-color: #eff8ff;
+}
-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
+html,.wp-dialog{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,.wp-tab-panel,ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{border-color:#dfdfdf;}ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{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;}div.error,.login #login_error{background-color:#ffebe8;border-color:#c00;}div.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:#000;}.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,.wp-tab-bar .wp-tab-active 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;}div.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{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;}th.sortable a:hover,th.sortable a:active,th.sortable a:focus{color:#333;}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;}#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,.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;}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;background-image:url("../images/ed-bg.gif");}#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:#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,.tablenav .tablenav-pages a:focus{color:#d54e21;}.tablenav .tablenav-pages a.disabled,.tablenav .tablenav-pages a.disabled:hover,.tablenav .tablenav-pages a.disabled:focus{color:#aaa;}.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,body.press-this 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{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,.toggle-arrow{background-image:url("../images/screen-options-toggle.gif?ver=20100531");}#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 .current #view-switch-list{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 .current #view-switch-excerpt{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,#nav-menu-footer,.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
-html {
+html,
+.wp-dialog {
background-color: #f9f9f9;
}
}
div.tabs-panel,
+.wp-tab-panel,
ul.category-tabs li.tabs,
-ul.add-menu-item-tabs li.tabs {
+ul.add-menu-item-tabs li.tabs,
+.wp-tab-active {
border-color: #dfdfdf;
}
ul.category-tabs li.tabs,
-ul.add-menu-item-tabs li.tabs {
+ul.add-menu-item-tabs li.tabs,
+.wp-tab-active {
background-color: #f1f1f1;
}
border-top-color: #dfdfdf;
}
-.error,
+div.error,
.login #login_error {
background-color: #ffebe8;
border-color: #c00;
}
-.error a {
+div.error a {
color: #c00;
}
.highlight {
background-color: #e4f2fd;
- color: #d54e21;
+ color: #000;
}
.howto,
}
#side-sortables .category-tabs .tabs a,
-#side-sortables .add-menu-item-tabs .tabs a {
+#side-sortables .add-menu-item-tabs .tabs a,
+.wp-tab-bar .wp-tab-active a {
color: #333;
}
color: #d54e21;
}
-.updated,
+div.updated,
.login .message {
background-color: #ffffe0;
border-color: #e6db55;
}
.widefat td,
-.widefat th,
-#install-plugins .plugins td,
-#install-plugins .plugins th {
+.widefat th {
border-color: #dfdfdf;
}
background: #dfdfdf url(../images/gray-grad.png) repeat-x scroll left top;
}
+th.sortable a:hover, th.sortable a:active, th.sortable a:focus {
+ color: #333;
+}
+
h3.dashboard-widget-title small a {
color: #d7d7d7;
}
color: #21759b;
}
-/* 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;
-}
-
#adminmenu #awaiting-mod,
#adminmenu .update-plugins,
#sidemenu a .update-plugins,
#edit-slug-box strong,
.tablenav .displaying-num,
-#submitted-on {
+#submitted-on,
+.submitted-on {
color: #777;
}
text-decoration: underline !important;
}
-#user_info a:active,
-#footer a:active {
- color: #ccc !important;
-}
-
div#media-upload-error,
.file-error,
abbr.required,
#quicktags {
border-color: #dfdfdf;
background-color: #dfdfdf;
+ background-image: url("../images/ed-bg.gif");
}
#ed_toolbar input {
.wp_themeSkin a.mceButtonEnabled:hover,
.wp_themeSkin a.mceButtonActive,
.wp_themeSkin a.mceButtonSelected {
- background-color: #d5d5d5;
+ background: #d5d5d5;
border-color: #777 !important;
}
background: #eee url('../images/menu-bits.gif?ver=20100610') repeat-x scroll left -379px;
}
-.tablenav .tablenav-pages a:hover {
+.tablenav .tablenav-pages a:hover,
+.tablenav .tablenav-pages a:focus {
color: #d54e21;
- border-color: #d54321;
}
-.tablenav .tablenav-pages a:active {
- color: #fff !important;
+.tablenav .tablenav-pages a.disabled,
+.tablenav .tablenav-pages a.disabled:hover,
+.tablenav .tablenav-pages a.disabled:focus {
+ color: #aaa;
}
.tablenav .tablenav-pages .current {
}
#post-body ul.category-tabs li.tabs a,
-#post-body ul.add-menu-item-tabs li.tabs a {
+#post-body ul.add-menu-item-tabs li.tabs a,
+body.press-this ul.category-tabs li.tabs a {
color: #333;
}
text-decoration: underline;
}
-#screen-meta a.show-settings {
- background-color: transparent;
- text-shadow: rgba(255,255,255,0.7) 0 1px 0;
+#screen-meta a.show-settings,
+.toggle-arrow {
+ background-image:url("../images/screen-options-toggle.gif?ver=20100531");
}
#icon-edit,
background: transparent url(../images/list.png) no-repeat 0 0;
}
-.view-switch #view-switch-list.current {
+.view-switch .current #view-switch-list {
background: transparent url(../images/list.png) no-repeat -40px 0;
}
background: transparent url(../images/list.png) no-repeat -20px 0;
}
-.view-switch #view-switch-excerpt.current {
+.view-switch .current #view-switch-excerpt {
background: transparent url(../images/list.png) no-repeat -60px 0;
}
background-color: #f1f1f1;
}
-#nav-menu-header, .menu-item-handle {
+#nav-menu-header, #nav-menu-footer, .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
+}
-#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
+#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 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
#dashboard_right_now .table_discussion {
float:left;
}
-#dashboard_right_now .versions {
- clear:right;
-}
#dashboard_right_now .versions a {
font-family: Tahoma, Arial;
}
-.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
+.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:both;}#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{min-height:200px;}#dashboard_quick_press.closed{min-height:0;}#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
#dashboard_right_now .versions {
padding: 6px 10px 12px;
- clear: left;
+ clear: both;
}
#dashboard_right_now .versions .b {
margin-right: 10px;
}
+#dashboard_quick_press {
+ min-height: 200px;
+}
+
+#dashboard_quick_press.closed {
+ min-height: 0;
+}
+
#dashboard_quick_press .input-text-wrap,
#dashboard_quick_press .textarea-wrap {
margin: 0 0 1em 5em;
-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
+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 thead th:first-of-type{-moz-border-radius-topleft:3px;-khtml-border-top-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;}.widefat thead th:last-of-type{-moz-border-radius-topright:3px;-khtml-border-top-right-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px;}.widefat tfoot th:first-of-type{-moz-border-radius-bottomleft:3px;-khtml-border-bottom-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}.widefat tfoot th:last-of-type{-moz-border-radius-bottomright:3px;-khtml-border-bottom-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;}.widefat td,.widefat th{border-bottom-width:1px;border-bottom-style:solid;font-size:11px;}.widefat .no-items td{border-bottom-width:0;}.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;}div.updated,div.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;}div.updated p,div.error p{margin:.5em 0;padding:2px;}.wrap div.updated,.wrap div.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
text-decoration: none;
}
+.widefat thead th:first-of-type {
+ -moz-border-radius-topleft: 3px;
+ -khtml-border-top-left-radius: 3px;
+ -webkit-border-top-left-radius: 3px;
+ border-top-left-radius: 3px;
+}
+.widefat thead th:last-of-type {
+ -moz-border-radius-topright: 3px;
+ -khtml-border-top-right-radius: 3px;
+ -webkit-border-top-right-radius: 3px;
+ border-top-right-radius: 3px;
+}
+.widefat tfoot th:first-of-type {
+ -moz-border-radius-bottomleft: 3px;
+ -khtml-border-bottom-left-radius: 3px;
+ -webkit-border-bottom-left-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+.widefat tfoot th:last-of-type {
+ -moz-border-radius-bottomright: 3px;
+ -khtml-border-bottom-right-radius: 3px;
+ -webkit-border-bottom-right-radius: 3px;
+ border-bottom-right-radius: 3px;
+}
+
.widefat td,
.widefat th {
border-bottom-width: 1px;
font-size: 11px;
}
+.widefat .no-items td {
+ border-bottom-width: 0;
+}
+
.widefat td {
padding: 3px 7px;
vertical-align: top;
margin: 0 15px 0 5px;
}
-.updated,
-.error {
+div.updated,
+div.error {
border-width: 1px;
border-style: solid;
padding: 0 0.6em;
border-radius: 3px;
}
-.updated p,
-.error p {
+div.updated p,
+div.error p {
margin: 0.5em 0;
- line-height: 1;
padding: 2px;
}
-.wrap .updated,
-.wrap .error {
+.wrap div.updated,
+.wrap div.error {
margin: 5px 0 15px;
}
-#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
+#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,#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
background: #298CBA;
}
-#wpcontent #ajax-loading {
+#wpcontent #ajax-loading,
+#wpcontent .ajax-loading {
vertical-align: baseline;
}
-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
+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;display:none;}#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
padding: 5px;
text-align: center;
width: 200px;
+ display: none;
}
#pass-strength-result.bad {
-*{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
+*{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:11px;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;}body form .input{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;}#pass-strength-result{font-weight:bold;border-style:solid;border-width:1px;margin:12px 0 6px;padding:6px 5px;text-align:center;}
\ No newline at end of file
-moz-border-radius: 11px;
-khtml-border-radius: 11px;
-webkit-border-radius: 11px;
- border-radius: 5px;
+ border-radius: 11px;
background: #fff;
border: 1px solid #e5e5e5;
-moz-box-shadow: rgba(200,200,200,1) 0 4px 18px;
padding: 16px;
}
-#user_pass,
-#user_login,
-#user_email {
+body form .input {
font-size: 24px;
width: 97%;
padding: 3px;
.clear {
clear: both;
}
+
+#pass-strength-result {
+ font-weight: bold;
+ border-style: solid;
+ border-width: 1px;
+ margin: 12px 0 6px;
+ padding: 6px 5px;
+ text-align: center;
+}
+
-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
+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",Verdana,Arial,"Bitstream Vera Sans",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",Verdana,Arial,"Bitstream Vera Sans",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
}
.media-upload-form label.form-help, td.help {
- font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
font-style: italic;
font-weight: normal;
}
#media-upload p.help,
#media-upload label.help {
- font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
font-style: italic;
font-weight: normal;
}
-#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
+#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;}.site-deleted{background:#ff8573;}.site-spammed{background:#faafaa;}.site-archived{background:#ffebe8;}.site-mature{background:#fecac2;}
\ No newline at end of file
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 {
+.site-deleted {
background: #ff8573;
}
-tr.site-spammed {
- background: #faa;
+.site-spammed {
+ background: #faafaa;
}
-tr.site-archived {
- background:#ffebe8;
+.site-archived {
+ background: #ffebe8;
}
-tr.site-mature {
+.site-mature {
background: #fecac2;
}
-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
+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,#nav-menu-footer{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;}#post-body div.updated{margin:0;}#post-body-content{position:relative;}#menu-management .menu-add-new abbr{font-weight:bold;}#nav-menu-footer{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;}#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
margin-bottom: 20px;
}
- #nav-menu-header, #post-body {
+ #nav-menu-header, #post-body, #nav-menu-footer {
border-color: #ccc;
border-style: solid;
}
#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;
+ border-width: 0 1px;
}
#post-body div.updated {
font-weight:bold;
}
+#nav-menu-footer {
+ 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;
+}
+
/* Menu Tabs */
#menu-management .nav-tabs-nav {
-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
+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;}#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
border-right: 1px solid #fff;
}
-/* 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;
-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
+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.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",Verdana,Arial,"Bitstream Vera Sans",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
body {
- font: 13px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
+ font: 13px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
color: #333;
margin: 0;
padding: 0;
.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.gif) no-repeat scroll left -111px;
}
.handlediv {
.category-add input {
width: 94%;
- font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
font-size: 12px;
margin: 1px;
}
-x-system-font: none;
border-style: solid;
border-width: 1px;
- font-family: "Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
font-size: 11px;
height: 2em;
line-height: 20px;
.button-secondary,
.button-highlighted,
#postcustomstuff .submit input {
- font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
text-decoration: none;
font-size: 11px !important;
line-height: 16px;
-#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
+.alignleft h3{margin:0;}h3 span{font-weight:normal;}#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
+.alignleft h3 {
+ margin: 0;
+}
+
+h3 span {
+ font-weight: normal;
+}
+
#template textarea {
font-family: Consolas, Monaco, Courier, monospace;
font-size: 12px;
--- /dev/null
+div.star{left:auto;right:0;}.star img,div.star a,div.star a:hover,div.star a:visited{right:auto;left:0;}.theme-listing .theme-item h3{font-style:normal;}#theme-information .theme-preview-img{float:right;margin:5px 15px 10px 25px;}#theme-information .action-button #cancel{float:right;}#theme-information .action-button #install{float:left;}.feature-filter .feature-group{float:right;}.feature-filter .feature-name{float:right;text-align:left;}.feature-filter .feature-group li{float:right;padding-right:0;padding-left:25px;}
\ No newline at end of file
--- /dev/null
+div.star {
+ left:auto;
+ right: 0;
+}
+
+.star img, div.star a, div.star a:hover, div.star a:visited {
+ right: auto;
+ left: 0;
+}
+
+.theme-listing .theme-item h3 {
+ font-style: normal;
+}
+
+#theme-information .theme-preview-img {
+ float: right;
+ margin: 5px 15px 10px 25px;
+}
+
+#theme-information .action-button #cancel {
+ float: right;
+}
+
+#theme-information .action-button #install {
+ float: left;
+}
+
+.feature-filter .feature-group {
+ float: right;
+}
+
+.feature-filter .feature-name {
+ float: right;
+ text-align: left;
+}
+
+.feature-filter .feature-group li {
+ float: right;
+ padding-right: 0;
+ padding-left: 25px;
+}
\ 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
+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:725px;}.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;}.feature-container{width:100%;overflow:auto;margin-bottom:10px;}.feature-group{margin-bottom:0!important;}
\ No newline at end of file
.feature-filter .feature-group {
float: left;
margin-bottom: 20px;
- width: 695px;
+ width: 725px;
}
.feature-filter .feature-name {
padding-right: 25px;
min-width: 145px;
}
+
+.feature-container {
+width: 100%;
+overflow: auto;
+margin-bottom: 10px;
+}
+
+.feature-group {
+ margin-bottom: 0px !important;
+}
\ No newline at end of file
-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
+#widget-list .widget,#wp_inactive_widgets .widget{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
+#widget-list .widget,
+#wp_inactive_widgets .widget {
+ float: right;
+}
ul#widget-list li.widget-list-item div.widget-description {
margin: 0 200px 0 0;
padding: 0 4em 0 0;
-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
+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;}#doaction,#doaction2,#post-query-submit{margin-right:0;margin-left:8px;}#save-post{float:right;}#minor-publishing .ajax-loading{padding:3px 4px 0 0;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;}.list-ajax-loading{float:left;margin-right:0;margin-left:9px;}#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-right:0;margin-left:8px;}.tablenav .actions{padding-right:0;padding-left:8px;}.tablenav .tablenav-pages{float:left;}.tablenav .displaying-num{margin-right:0;margin-left:10px;font-family:Tahoma,Arial,sans-serif;font-style:normal;}#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;}.sorting-indicator{margin-left:0;margin-right:7px;}th.sortable a span,th.sorted a span{float:right;}.fixed .column-comments a{float:right;}.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;}#contextual-help-wrap li{margin-left:0;margin-right:18px;}#screen-meta a.show-settings{padding:0 6px 0 16px;background-position:left top;}.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;}.trash-undo-inside,.spam-undo-inside,.spam-undo-inside .avatar,.trash-undo-inside .avatar{margin-right:0;margin-left:8px;}#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;}.media-item .error-div a.dismiss,.describe-toggle-on,.describe-toggle-off{float:left;margin-right:0;margin-left:20px;}.describe-toggle-on,.describe-toggle-off{float:left;margin-left:20px;margin-right:0;}.media-item .error-div{padding-left:0;padding-right:10px;}.media-item .pinkynail{float:right;}.crunching{text-align:left;margin-left:5px;margin-right:0;}.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;}.appearance_page_custom-header #available-headers .default-header{float:right;margin:0 0 20px 20px;}.appearance_page_custom-header #available-headers label input{margin-right:0;margin-left:10px;}#custom-background label{padding-right:0;padding-left:15px;}#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
}
/* 200 - 500
=================================== */
+#doaction,
+#doaction2,
+#post-query-submit {
+ margin-right: 0;
+ margin-left: 8px;
+}
#save-post {
float: right;
}
+#minor-publishing .ajax-loading {
+ padding: 3px 4px 0 0;
+ float: right;
+}
.preview {
float: left;
}
* html #template div {
margin-left: 0;
}
+
+.list-ajax-loading {
+ float: left;
+ margin-right: 0;
+ margin-left: 9px;
+}
+
#your-profile legend {
font-family: Tahoma, Arial, sans-serif;
}
margin-left: 10px;
}
.tablenav a.button-secondary {
- margin: 8px 0 0 8px;
+ margin-right: 0;
+ margin-left: 8px;
+}
+.tablenav .actions {
+ padding-right: 0;
+ padding-left: 8px;
}
.tablenav .tablenav-pages {
float: left;
margin-right: 0;
margin-left: 10px;
font-family: Tahoma, Arial, sans-serif;
+ font-style: normal;
}
#postcustomstuff table input,
#postcustomstuff table select,
.description, .form-wrap p {
font-family: Tahoma, Arial, sans-serif;
}
+.sorting-indicator {
+ margin-left: 0;
+ margin-right: 7px;
+}
+th.sortable a span,
+th.sorted a span {
+ float: right;
+}
+.fixed .column-comments a {
+ float: right;
+}
+
/* 1500 - 1800
=================================== */
.autosave-info {
font-family: Tahoma, Arial, sans-serif;
margin: 0 0 0 6px;
}
+#contextual-help-wrap li {
+ margin-left: 0;
+ margin-right: 18px;
+}
#screen-meta a.show-settings {
padding: 0 6px 0 16px;
- background-position: left bottom;
+ background-position: left top;
}
.metabox-prefs label {
padding-right: 0;
.inline-edit-save img.waiting {
float: left;
}
+.trash-undo-inside,
+.spam-undo-inside,
+.spam-undo-inside .avatar,
+.trash-undo-inside .avatar {
+ margin-right: 0;
+ margin-left: 8px;
+}
/* 2500 - 2700
=================================== */
#bulk-titles div a {
padding: 0 5px 0 0 ;
}
+.media-item .error-div a.dismiss,
+.describe-toggle-on,
+.describe-toggle-off {
+ float: left;
+ margin-right: 0;
+ margin-left: 20px;
+}
+
.describe-toggle-on,
.describe-toggle-off {
float: left;
margin-right: 0;
}
+.media-item .error-div {
+ padding-left: 0;
+ padding-right: 10px;
+}
+
.media-item .pinkynail {
float: right;
}
margin-right: 0;
}
-button.dismiss {
- right: auto;
- left: 5px;
-}
-
-.file-error {
- float: right;
-}
-
.bar {
border-left-width: 3px;
border-left-style: solid;
}
/* Custom Header */
-table#available-headers td {
- padding: 0 0 10px 20px;
+.appearance_page_custom-header #available-headers .default-header {
+ float: right;
+ margin: 0 0 20px 20px;
}
-table#available-headers label input {
+.appearance_page_custom-header #available-headers label input {
margin-right: 0;
- margin-left: 8px;
+ margin-left: 10px;
+}
+
+#custom-background label {
+ padding-right: 0;
+ padding-left: 15px;
}
/* ltr
-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
+p,ul,ol,blockquote,input,select{font-size:12px;}ol{list-style-type:decimal;margin-left:2em;}.code,code{font-family:Consolas,Monaco,Courier,monospace;}kbd,code{padding:1px 3px;margin:0 1px;font-size:11px;}.quicktags,.search{font:12px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}.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;}.pre{white-space:pre-wrap;white-space:-moz-pre-wrap!important;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;}.howto{font-style:italic;display:block;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}p.install-help{margin:8px 0;font-style:italic;}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;}select option{padding:2px;}.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;}.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;}#minor-publishing-actions input,#major-publishing-actions input,#minor-publishing-actions .preview{min-width:80px;text-align:center;}textarea.all-options,input.all-options{width:250px;}input.large-text,textarea.large-text{width:99%;}input.regular-text,#adduser .form-field input{width:25em;}input.small-text{width:50px;}#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;}label,#your-profile label+a{vertical-align:middle;}#misc-publishing-actions label{vertical-align:baseline;}#pass-strength-result{border-style:solid;border-width:1px;float:left;margin:12px 5px 5px 1px;padding:3px 5px;text-align:center;width:200px;display:none;}.indicator-hint{padding-top:8px;}p.search-box{float:right;margin:-5px 0 0;}#major-publishing-actions{padding:6px;clear:both;border-top:none;}#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;}#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;}#minor-publishing .ajax-loading{padding:3px 0 0 4px;float:left;}.preview{float:right;}#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;}a.button,a.button-primary,a.button-secondary{line-height:15px;padding:3px 10px;white-space:nowrap;-webkit-border-radius:10px;}.approve{display:none;}.unapproved .approve,.spam .approve,.trash .approve{display:inline;}.unapproved .unapprove{display:none;}.add-new-h2{font-style:normal;margin:0 6px;position:relative;top:-3px;}td.action-links,th.action-links{text-align:right;}.describe .del-link{padding-left:5px;}#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;}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;}.ajax-feedback{visibility:hidden;vertical-align:bottom;}#ajax-response.alignleft{margin-left:2em;}#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;}#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;}#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;}#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;}#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;}.toggle-arrow{background-repeat:no-repeat;background-position:top left;background-color:transparent;height:22px;line-height:22px;display:block;}.toggle-arrow-active{background-position:bottom left;}#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:top right;background-color:transparent;text-shadow:rgba(255,255,255,0.7) 0 1px 0;}#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 4px 4px;-webkit-border-radius:0 0 4px 4px;-khtml-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.metabox-prefs label{display:inline-block;padding-right:15px;white-space:nowrap;line-height:30px;}.metabox-prefs label input{margin:0 5px 0 2px;}.metabox-prefs label a{display:none;}#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;}body.wp-admin{min-width:785px;}body.admin-bar #wphead{padding-top:28px;}.narrow{width:70%;margin-bottom:40px;}.narrow p{line-height:150%;}.widefat th,.widefat td{overflow:hidden;}.widefat td p{margin:2px 0 .8em;}.widefat .column-comment p{margin:.6em 0;}.widget .widget-top,.postbox h3{cursor:move;-webkit-user-select:none;-moz-user-select:none;-khtml-user-select:none;user-select:none;}.postbox-container{float:left;padding-right:.5%;}.postbox-container .meta-box-sortables{min-height:300px;}.postbox .hndle span{padding:6px 0;}.postbox .hndle{cursor:move;}.hndle a{font-size:11px;font-weight:normal;}.postbox .handlediv{float:right;width:23px;height:26px;}.sortable-placeholder{border-width:1px;border-style:dashed;margin-bottom:20px;}.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;}.temp-border{border:1px dotted #ccc;}.columns-prefs label{padding:0 5px;}#wpbody-content .metabox-holder{padding-top:10px;}#dashboard-widgets .meta-box-sortables{margin:0 5px;}#dashboard_recent_comments div.undo{border-top-style:solid;border-top-width:1px;margin:0 -10px;padding:3px 8px;font-size:11px;}#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;}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:8px 0;text-align:left;}.fixed .column-comments .vers{padding-left:3px;}.fixed .column-comments a{float:left;}.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%;}#commentsdiv.postbox .inside{line-height:1.4em;margin:0;}#commentsdiv.postbox .inside .row-actions{line-height:18px;}#commentsdiv.postbox .inside td{padding:1em 10px;}#commentsdiv.postbox .inside .column-author{width:33%;}#commentsdiv.postbox .inside p{margin:6px 10px 8px;}#commentsdiv.postbox .column-comment p{margin:.6em 0;}#commentsdiv.postbox #replyrow td{padding:0;}.sorting-indicator{display:none;width:7px;height:4px;margin-top:5px;margin-left:7px;background-image:url(../images/sort.gif);background-repeat:no-repeat;}.fixed .column-comments .sorting-indicator{margin-top:3px;}.widefat th.sortable,.widefat th.sorted{padding:0;}th.sortable a,th.sorted a{display:block;overflow:hidden;padding:7px 7px 8px;}.fixed .column-comments.sortable a,.fixed .column-comments.sorted a{padding:8px 0;}th.sortable a span,th.sorted a span{float:left;cursor:pointer;}th.sorted.asc .sorting-indicator,th.desc:hover span.sorting-indicator{display:block;background-position:0 0;}th.sorted.desc .sorting-indicator,th.asc:hover span.sorting-indicator{display:block;background-position:-7px 0;}.tablenav-pages a{border-bottom-style:solid;border-bottom-width:2px;font-weight:bold;margin-right:1px;padding:0 2px;}.tablenav-pages .current-page{text-align:center;}.tablenav-pages .next-page{margin-left:2px;}.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 .one-page{display:none;}.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 .tablenav-pages a.disabled:hover{cursor:default;}.tablenav .tablenav-pages a.disabled:active{cursor:default;}.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;}.tablenav .delete{margin-right:20px;}.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;}.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;}span.post-state-format{font-weight:normal;}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,#wpbody-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;}#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,#submitpost .ajax-loading{vertical-align:middle;}#wpcontent .ajax-loading{visibility:hidden;}.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,#post-format{line-height:2.5em;margin-top:3px;}#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;}#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;}.wp-tab-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;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,.wp-tab-bar li{display:inline;}#side-sortables .category-tabs a,#side-sortables .add-menu-item-tabs a,.wp-tab-bar a{text-decoration:none;}#side-sortables .category-tabs,#side-sortables .add-menu-item-tabs,.wp-tab-bar{margin-bottom:3px;}.categorydiv ul,.customlinkdiv ul,.posttypediv ul,.taxonomydiv ul,#linkcategorydiv ul{list-style:none;padding:0;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;}ul.category-tabs,ul.add-menu-item-tabs,ul.wp-tab-bar{margin-top:12px;}#side-sortables .comments-box thead th,#normal-sortables .comments-box thead th{background:transparent;padding:0 7px 4px;font-style:italic;}ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{border-style:solid solid none;border-width:1px 1px 0;}#commentsdiv img.waiting{padding-left:5px;}#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,ul.wp-tab-bar 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;}.wp-hidden-children .wp-hidden-child,.ui-tabs-hide{display:none;}.commentlist .avatar{vertical-align:text-top;}#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;}#wp-word-count{display:block;padding:2px 7px;}#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;}#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;}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;}.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 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,ul.export-filters,.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;}.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-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;}.taghint{color:#aaa;margin:15px 0 -24px 12px;}#poststuff .tagsdiv .howto{margin:0 0 6px 8px;}.ajaxtag .newtag{background:transparent;position:relative;}.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;}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;}.tagcloud{width:97%;margin:0 0 40px;text-align:justify;}.tagcloud h3{margin:2px 0 12px;}.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;}#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;}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;}.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;}.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 td p{margin-top:4px;}.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;}.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;}#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;text-align:center;}#replysubmit img.waiting,.inline-edit-save img.waiting{padding:4px 10px 0;vertical-align:top;float:right;}#replysubmit .button{margin-right:5px;}#replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center;}#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;}.comment-ays{margin-bottom:0;border-style:solid;border-width:1px;}.comment-ays th{border-right-style:solid;border-right-width:1px;}.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;}.stuffbox .editcomment{clear:none;}#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;}.commentlist .avatar{vertical-align:text-top;}.theme-install-php .tablenav{height:auto;}table#availablethemes{border-spacing:0;border-width:1px 0;border-style:solid none;margin:10px auto;width:100%;}table#availablethemes .no-items td{border-width:0;padding:5px;}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;}.theme-options span{text-transform:uppercase;font-size:13px;}.theme-options a{font-size:15px;}#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;}#broken-themes{text-align:left;width:50%;border-spacing:3px;padding:3px;}.theme-install-php h4{margin:2.5em 0 8px;}.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;}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;}.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;}h2.nav-tab-wrapper,h3.nav-tab-wrapper{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;}.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 .row-actions-visible{padding:0;}.plugins tbody th.check-column{padding:7px 0;}.plugins td,.plugins th{border-bottom:0 none;}.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,#wpbody-content .plugins .theme-title{padding-right:12px;white-space:nowrap;}.plugins .second,.plugins .row-actions-visible{padding:0 0 5px;}.plugins-php .widefat tfoot th,.plugins-php .widefat tfoot td{border-top-style:solid;border-top-width:1px;}.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;}.plugin-install-php h4{margin:2.5em 0 8px;}#profile-page .form-table textarea{width:500px;margin-bottom:6px;}#profile-page .form-table #rich_editing{margin-right:5px;}#your-profile legend{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:22px;}#your-profile #rich_editing{border:none;}#display_name{width:15em;}#createuser .form-field input{width:25em;}#utc-time,#local-time{padding-left:25px;font-style:italic;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}.defaultavatarpicker .avatar{margin:2px 0;vertical-align:middle;}#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;}#excerpt,.attachmentlinks{margin:0;height:4em;width:98%;}#template div{margin-right:190px;}p.pagenav{margin:0;display:inline;}.pagenav span{font-weight:bold;margin:0 6px;}.row-title{font-size:12px!important;font-weight:bold;}.column-author img,.column-username img{float:left;margin-right:10px;margin-top:3px;}.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;}.form-table .pre{padding:8px;margin:0;}table.form-table td .updated{font-size:13px;}.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;}#poststuff h2{margin-top:20px;font-size:1.5em;margin-bottom:15px;padding:0 0 3px;clear:left;}#poststuff h3,.metabox-holder h3{font-size:12px;font-weight:bold;padding:7px 9px;margin:0;line-height:1;}#poststuff .inside,#poststuff .inside p{font-size:11px;margin:6px 6px 8px;}#poststuff .inside .submitbox p{margin:1em 0;}#post-visibility-select,#post-formats-select{line-height:1.5em;margin-top:3px;}#poststuff #submitdiv .inside{margin:0;}#titlediv,#poststuff .postarea{margin-bottom:20px;}td.post-title strong,td.plugin-title strong{display:block;margin-bottom:.2em;}td.post-title p,td.plugin-title p{margin:6px 0;}.wp-hidden-children .wp-hidden-child,.ui-tabs-hide{display:none;}#templateside ul li a{text-decoration:none;}.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;}#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 li a .count-0{display:none;}#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;}.plugin-install #description,.plugin-install-network #description{width:60%;}table .vers,table .column-visible,table .column-rating{text-align:left;}body.iframe{height:98%;}.anchors{margin:10px 20px 10px 20px;}div.nav{height:2em;padding:7px 10px;vertical-align:text-top;margin:5px 0;}.nav .button-secondary{padding:2px 4px;}* html #themeselect{padding:0 3px;height:22px;}.settings-toggle{text-align:right;margin:5px 7px 15px 0;font-size:12px;}.settings-toggle h3{margin:0;}form#tags-filter{position:relative;}td.media-icon{text-align:center;width:80px;padding-top:8px;padding-bottom:8px;}td.media-icon img{max-width:80px;max-height:60px;}.screen-per-page{width:3em;}* html #template div{margin-right:0;}.list-ajax-loading{float:right;margin-right:9px;margin-top:-1px;}.tablenav .list-ajax-loading{margin-top:7px;}#howto{font-size:11px;margin:0 5px;display:block;}.import-system{font-size:16px;}#namediv table{width:100%;}#namediv td.first{width:10px;white-space:nowrap;}#namediv input{width:98%;}#namediv p{margin:10px 0;}#submitdiv h3{margin-bottom:0!important;}.zerosize{height:0;width:0;margin:0;border:0;padding:0;overflow:hidden;position:absolute;}br.clear{height:2px;line-height:2px;}.checkbox{border:none;margin:0;padding:0;}#content{margin:0;width:100%;}fieldset{border:0;padding:0;margin:0;}#linksubmitdiv div.inside,div.inside{padding:0;margin:0;}.post-categories{display:inline;margin:0;padding:0;}.post-categories li{display:inline;}
\ No newline at end of file
-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;
-}
+/*------------------------------------------------------------------------------
+
+
+Hello, this is the main WordPress admin CSS file.
+All the important stuff is in here.
+
+
+TABLE OF CONTENTS:
+------------------
+ 1.0 - Text Elements
+ 2.0 - Forms
+ 3.0 - Actions
+ 4.0 - Notifications
+ 5.0 - TinyMCE
+ 6.0 - Admin Header
+ 6.1 - Favorites Menu
+ 6.2 - Screen Options Tabs
+ 7.0 - Main Navigation
+ 8.0 - Layout Blocks
+ 9.0 - Dashboard
+10.0 - List Posts
+ 10.1 - Inline Editing
+11.0 - Write/Edit Post Screen
+ 11.1 - Custom Fields
+ 11.2 - Post Revisions
+12.0 - Categories
+13.0 - Tags
+14.0 - Media Screen
+ 14.1 - Media Uploader
+ 14.2 - Image Editor
+15.0 - Comments Screen
+16.0 - Themes
+ 16.1 - Custom Header
+ 16.2 - Custom Background
+ 16.3 - Tabbed Admin Screen Interface
+17.0 - Plugins
+18.0 - Users
+19.0 - Tools
+20.0 - Settings
+21.0 - Admin Footer
+22.0 - Misc
+23.0 - Dead
+
+
+------------------------------------------------------------------------------*/
+
+
+
+
+/*------------------------------------------------------------------------------
+ 1.0 - Text Styles
+------------------------------------------------------------------------------*/
p,
ul,
font-size: 12px;
}
-select option {
- padding: 2px;
+ol {
+ list-style-type: decimal;
+ margin-left: 2em;
}
-.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;
+.code, code {
+ font-family: Consolas, Monaco, Courier, monospace;
}
-.plugins p {
- margin: 0 4px;
- padding: 0;
+kbd, code {
+ padding: 1px 3px;
+ margin: 0 1px;
+ font-size: 11px;
}
-.plugins .desc p {
- margin: 0 0 8px;
+.quicktags, .search {
+ font: 12px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
}
-.plugins td.desc {
- line-height: 1.5em;
+.icon32 {
+ float: left;
+ height: 36px;
+ margin: 14px 6px 0 0;
+ width: 36px;
}
-.plugins .desc ul,
-.plugins .desc ol {
- margin: 0 0 0 2em;
+.key-labels label {
+ line-height: 24px;
}
-.plugins .desc ul {
- list-style-type: disc;
+.subtitle {
+ font-size: 0.75em;
+ line-height: 1;
+ padding-left: 25px;
}
-.plugins .action-links {
- white-space: nowrap;
+.pre {
+ /* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */
+ white-space: pre-wrap; /* css-3 */
+ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
+ white-space: -pre-wrap; /* Opera 4-6 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ word-wrap: break-word; /* Internet Explorer 5.5+ */
}
-.plugins .row-actions-visible {
- padding: 0;
+.howto {
+ font-style: italic;
+ display: block;
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
}
-.widefat tbody.plugins th.check-column {
- padding: 7px 0;
+p.install-help {
+ margin: 8px 0;
+ font-style: italic;
}
-.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;
+/*------------------------------------------------------------------------------
+ 2.0 - Forms
+------------------------------------------------------------------------------*/
+
+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;
}
-.plugins .inactive td,
-.plugins .inactive th,
-.plugins .active td,
-.plugins .active th {
- border-top-style: solid;
- border-top-width: 1px;
- padding: 5px 7px 0;
+select option {
+ padding: 2px;
}
-#wpbody-content .plugins .plugin-title {
- padding-right: 12px;
+.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;
}
-.plugins .second td,
-.plugins .second th {
- border-top: 0 none;
- padding: 0 7px 5px;
+form p.submit a.cancel:hover {
+ text-decoration: none;
}
-.plugins-php .widefat tfoot th,
-.plugins-php .widefat tfoot td {
- border-top-style: solid;
- border-top-width: 1px;
+.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;
}
-.import-system {
- font-size: 16px;
+#minor-publishing-actions input,
+#major-publishing-actions input,
+#minor-publishing-actions .preview {
+ min-width: 80px;
+ text-align: center;
}
-.anchors {
- margin: 10px 20px 10px 20px;
+textarea.all-options, input.all-options {
+ width: 250px;
}
-table#availablethemes {
- border-spacing: 0;
- border-width: 1px 0;
- border-style: solid none;
- margin: 10px auto;
- width: 100%;
+input.large-text,
+textarea.large-text {
+ width: 99%;
}
-td.available-theme {
- vertical-align: top;
- width: 240px;
- margin: 0;
- padding: 20px;
- text-align: left;
+input.regular-text,
+#adduser .form-field input {
+ width: 25em;
}
-table#availablethemes td {
- border-width: 0 1px 1px;
- border-style: none solid solid;
+input.small-text {
+ width: 50px;
}
-table#availablethemes td.right,
-table#availablethemes td.left {
- border-right: 0 none;
- border-left: 0 none;
+#doaction,
+#doaction2,
+#post-query-submit {
+ margin-right: 8px;
}
-table#availablethemes td.bottom {
- border-bottom: 0 none;
+.tablenav select[name="action"],
+.tablenav select[name="action2"] {
+ width: 130px;
}
-.available-theme a.screenshot {
- width: 240px;
- height: 180px;
- display: block;
- border-width: 1px;
- border-style: solid;
- margin-bottom: 10px;
- overflow: hidden;
+.tablenav select[name="m"] {
+ width: 155px;
}
-.available-theme img {
- width: 240px;
+.tablenav select#cat {
+ width: 170px;
}
-.available-theme h3 {
- margin: 15px 0 5px;
+#wpcontent select {
+ padding: 2px;
+ height: 2em;
+ font-size: 11px;
}
-#current-theme {
- margin: 1em 0 1.5em;
+#wpcontent option {
+ padding: 2px;
}
-#current-theme a {
- border-bottom: none;
+#timezone_string option {
+ margin-left: 1em;
}
-#current-theme h3 {
- font-size: 17px;
- font-weight: normal;
- margin: 0;
+label,
+#your-profile label + a {
+ vertical-align: middle;
}
-#current-theme .theme-description {
- margin-top: 5px;
+#misc-publishing-actions label {
+ vertical-align: baseline;
}
-#current-theme img {
- float: left;
- border-width: 1px;
+#pass-strength-result {
border-style: solid;
- margin-right: 1em;
- margin-bottom: 1.5em;
- width: 150px;
+ border-width: 1px;
+ float: left;
+ margin: 12px 5px 5px 1px;
+ padding: 3px 5px;
+ text-align: center;
+ width: 200px;
+ display: none;
+}
+.indicator-hint {
+ padding-top: 8px;
}
-#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;
+p.search-box {
+ float: right;
+ margin: -5px 0 0;
}
-#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;
-}
+/*------------------------------------------------------------------------------
+ 3.0 - Actions
+------------------------------------------------------------------------------*/
-.commentlist li {
- padding: 1em 1em .2em;
- margin: 0;
- border-bottom-width: 1px;
- border-bottom-style: solid;
+#major-publishing-actions {
+ padding: 6px;
+ clear: both;
+ border-top: none;
}
-.commentlist li li {
- border-bottom: 0;
- padding: 0;
-}
-.commentlist p {
- padding: 0;
- margin: 0 0 .8em;
-}
-.post-categories {
- display: inline;
- margin: 0;
- padding: 0;
+#delete-action {
+ line-height: 25px;
+ vertical-align: middle;
+ text-align: left;
+ float: left;
}
-.post-categories li {
- display: inline;
+#publishing-action {
+ text-align: right;
+ float: right;
+ line-height: 23px;
}
-.quicktags, .search {
- font: 12px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+#post-body #minor-publishing {
+ padding-bottom: 10px;
}
-.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;
+#post-body #misc-publishing-actions {
+ padding: 0;
}
-form p.submit a.cancel:hover {
- text-decoration: none;
+#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%;
}
-#submitdiv h3 {
- margin-bottom: 0 !important;
+#post-body .misc-pub-section-last {
+ border-right: 0;
}
#misc-publishing-actions {
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;
+#minor-publishing .ajax-loading {
+ padding: 3px 0 0 4px;
float: left;
}
-#publishing-action {
- text-align: right;
+.preview {
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;
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 {
-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;
}
display: none;
}
-.narrow {
- width: 70%;
- margin-bottom: 40px;
+.add-new-h2 {
+ font-style: normal;
+ margin: 0 6px;
+ position: relative;
+ top: -3px;
}
-.narrow p {
- line-height: 150%;
+td.action-links,
+th.action-links {
+ text-align: right;
}
-textarea.all-options, input.all-options {
- width: 250px;
+.describe .del-link {
+ padding-left: 5px;
}
-#namediv table {
- width: 100%;
+
+/*------------------------------------------------------------------------------
+ 4.0 - Notifications
+------------------------------------------------------------------------------*/
+
+#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;
}
-#namediv td.first {
- width: 10px;
- white-space: nowrap;
+.plugins .plugin-update {
+ padding: 0;
}
-#namediv input {
- width: 98%;
+.plugin-update .update-message {
+ margin: 0 10px 8px 31px;
+ font-weight: bold;
}
-#namediv p {
- margin: 10px 0;
+ul#dismissed-updates {
+ display: none;
+}
+form.upgrade {
+ margin-top: 8px;
}
-#wpbody-content .metabox-holder {
- padding-top: 10px;
+form.upgrade .hint {
+ font-style: italic;
+ font-size: 85%;
+ margin: -0.5em 0 2em 0;
}
-#content {
- margin: 0;
- width: 100%;
+.ajax-feedback {
+ visibility: hidden;
+ vertical-align: bottom;
+}
+
+#ajax-response.alignleft {
+ margin-left: 2em;
}
+
+/*------------------------------------------------------------------------------
+ 5.0 - TinyMCE
+------------------------------------------------------------------------------*/
+
#editorcontainer #content {
padding: 6px;
line-height: 150%;
font-style: italic;
}
-#excerpt, .attachmentlinks {
- margin: 0;
- height: 4em;
- width: 98%;
+#wp_editbtns,
+#wp_gallerybtns {
+ padding: 2px;
+ position: absolute;
+ display: none;
+ z-index: 999998;
}
-/* post meta postbox */
-#postcustomstuff table,
-#postcustomstuff input,
-#postcustomstuff textarea {
+#wp_editimgbtn,
+#wp_delimgbtn,
+#wp_editgallery,
+#wp_delgallery {
+ margin: 2px;
+ padding: 2px;
border-width: 1px;
border-style: solid;
-moz-border-radius: 3px;
border-radius: 3px;
}
-#postcustomstuff .updatemeta,
-#postcustomstuff .deletemeta {
- margin: auto;
+
+/*------------------------------------------------------------------------------
+ 6.0 - Admin Header
+------------------------------------------------------------------------------*/
+#wphead-info {
+ margin: 0 0 0 15px;
+ padding-right: 15px;
}
-#postcustomstuff thead th {
- padding: 5px 8px 8px;
+#user_info {
+ float: right;
+ font-size: 12px;
+ line-height: 46px;
+ height: 46px;
}
-#postcustom #postcustomstuff .submit {
- border: 0 none;
- float: none;
- padding: 5px 8px;
+#user_info p {
+ margin: 0;
+ padding: 0;
+ line-height: 46px;
}
-#side-sortables #postcustom #postcustomstuff .submit {
- padding: 0 5px;
+#wphead {
+ height: 46px;
}
-#side-sortables #postcustom #postcustomstuff td.left input {
- margin: 3px 3px 0;
+#wphead a,
+#adminmenu a,
+#sidemenu a,
+#taglist a,
+#catlist a,
+#show-settings a {
+ text-decoration: none;
}
-#side-sortables #postcustom #postcustomstuff #the-list textarea {
- height: 85px;
- margin: 3px;
+#header-logo {
+ float: left;
+ margin: 7px 0 0 15px;
}
-#postcustomstuff table {
+#wphead h1 {
+ font: normal 22px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ padding: 10px 8px 5px;
margin: 0;
- width: 100%;
- border-width: 1px;
- border-style: solid;
- border-spacing: 0;
+ float: left;
}
-#postcustomstuff table input,
-#postcustomstuff table select,
-#postcustomstuff table textarea {
- width: 95%;
- margin: 8px 0 8px 8px;
+#wphead h1.long-title {
+ font: normal 18px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ padding: 12px 10px 5px;
}
-#postcustomstuff th.left,
-#postcustomstuff td.left {
- width: 38%;
+#wphead #privacy-on-link {
+ font-size: 50%;
+ font-style: normal;
+ line-height: 17px;
+ padding: 0 6px;
+ vertical-align: middle;
}
-#postcustomstuff .submit input {
- width: auto;
+#wphead h1 a:hover {
+ text-decoration:none;
}
-
-#postcustomstuff #newmeta .submit {
- padding: 0 8px;
+#wphead h1 a:hover #site-title,
+#wphead h1 a#privacy-on-link:hover {
+ text-decoration:underline;
}
-#postcustomstuff table #addmetasub {
- width: auto;
-}
-#postcustomstuff #newmetaleft {
- vertical-align: top;
-}
+/*------------------------------------------------------------------------------
+ 6.1 - Favorites Menu
+------------------------------------------------------------------------------*/
-#postcustomstuff #newmetaleft a {
- padding: 0 10px;
- text-decoration: none;
+#favorite-actions {
+ float: right;
+ margin: 11px 12px 0;
+ min-width: 130px;
+ position: relative;
}
-#save {
- width: 15em;
+#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;
}
-#template div {
- margin-right: 190px;
+#favorite-inside {
+ margin: 0 0 0 0px;
+ 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;
}
-* html #template div {
- margin-right: 0;
+#favorite-actions a {
+ display: block;
+ text-decoration: none;
+ font-size: 11px;
}
-/* A handy div class for hiding controls.
-Some browsers will disable them when you
-set display: none; */
-.zerosize {
- height: 0;
- width: 0;
- margin: 0;
- border: 0;
- padding: 0;
- overflow: hidden;
- position: absolute;
+#favorite-inside a {
+ padding: 3px 5px 3px 10px;
}
-* html #themeselect {
- padding: 0 3px;
+#favorite-toggle {
height: 22px;
+ position: absolute;
+ right: 0;
+ top: 1px;
+ width: 28px;
}
-#your-profile legend {
- font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- font-size: 22px;
+#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;
}
-#your-profile #rich_editing {
- border: none;
-}
-#howto {
- font-size: 11px;
- margin: 0 5px;
- display: block;
-}
+/*------------------------------------------------------------------------------
+ 6.2 - Screen Options Tabs
+------------------------------------------------------------------------------*/
-#ajax-response.alignleft {
- margin-left: 2em;
+#screen-meta {
+ position: relative;
+ clear: both;
}
-div.nav {
- height: 2em;
- padding: 7px 10px;
- vertical-align: text-top;
- margin: 5px 0;
+#screen-meta-links {
+ margin: 0 18px 0 0;
}
-.nav .button-secondary {
- padding: 2px 4px;
+#screen-meta .screen-reader-text {
+ visibility: hidden;
}
-a.page-numbers {
- border-bottom-style: solid;
- border-bottom-width: 2px;
- font-weight: bold;
- margin-right: 1px;
- padding: 0 2px;
+#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;
}
-p.pagenav {
- margin: 0;
- display: inline;
+#contextual-help-wrap li {
+ list-style-type: disc;
+ margin-left: 18px;
}
-
-.pagenav span {
- font-weight: bold;
- margin: 0 6px;
+.toggle-arrow {
+ background-repeat: no-repeat;
+ background-position: top left;
+ background-color: transparent;
+ height: 22px;
+ line-height: 22px;
+ display: block;
}
-
-.row-title {
- font-size: 12px !important;
- font-weight: bold;
+.toggle-arrow-active {
+ background-position: bottom left;
}
-
-.widefat .column-comment p {
- margin: 0.6em 0;
+#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: top right;
+ background-color: transparent;
+ text-shadow: rgba(255,255,255,0.7) 0 1px 0;
}
-.column-author img, .column-username img {
- float: left;
- margin-right: 10px;
- margin-top: 3px;
+#screen-meta a.show-settings:hover {
+ text-decoration: none;
}
-.tablenav a.button-secondary {
- display: block;
- margin: 3px 8px 0 0;
+#screen-options-wrap h5,
+#contextual-help-wrap h5 {
+ margin: 8px 0;
+ font-size: 13px;
}
-.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;
+#screen-options-wrap,
+#contextual-help-wrap {
+ border-style: none solid solid;
+ border-top: 0 none;
+ border-width: 0 1px 1px;
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;
+ padding: 8px 12px 12px;
+ -moz-border-radius: 0 0 4px 4px;
+ -webkit-border-radius: 0 0 4px 4px;
+ -khtml-border-radius: 0 0 4px 4px;
+ border-radius: 0 0 4px 4px;
}
-/* Admin Header */
-#wphead-info {
- margin: 0 0 0 15px;
+.metabox-prefs label {
+ display: inline-block;
padding-right: 15px;
+ white-space: nowrap;
+ line-height: 30px;
}
-#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;
+.metabox-prefs label input {
+ margin: 0 5px 0 2px;
}
-#wphead h1.long-title {
- font: normal 18px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
- padding: 12px 10px 5px;
+.metabox-prefs label a {
+ display: none;
}
-#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;
-}
+/*------------------------------------------------------------------------------
+ 7.0 - Main Navigation (Left Menu)
+------------------------------------------------------------------------------*/
/* side admin menu */
#adminmenu * {
padding: 6px 0 0 1px;
}
-/* end side admin menu */
-
-/* comments/plugins bubble in menu */
#adminmenu #awaiting-mod,
#adminmenu span.update-plugins,
#sidemenu li a span.update-plugins {
#sidemenu li a .count-0 {
display: none;
}
-/* end menu stuff */
-/* comments bubble */
.post-com-count-wrapper {
min-width: 22px;
font-family: Helvetica, Arial, sans-serif;
padding: 4px 8px;
}
-/* Admin Footer */
-#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;
-}
+/*------------------------------------------------------------------------------
+ 8.0 - Layout Blocks
+------------------------------------------------------------------------------*/
-#footer p {
- margin: 0;
- padding: 15px;
- line-height: 15px;
+body.wp-admin {
+ min-width: 785px;
}
-#footer a {
- text-decoration: none;
+body.admin-bar #wphead {
+ padding-top: 28px;
}
-#footer a:hover {
- text-decoration: underline;
+.narrow {
+ width: 70%;
+ margin-bottom: 40px;
}
-/* Tables used on comment.php and option/setting pages */
+.narrow p {
+ line-height: 150%;
+}
-.form-table {
- border-collapse: collapse;
- margin-top: 0.5em;
- width: 100%;
- margin-bottom: -8px;
- clear: both;
+.widefat th,
+.widefat td {
+ overflow: hidden;
}
-.form-table td {
- margin-bottom: 9px;
- padding: 8px 10px;
- line-height: 20px;
- font-size: 11px;
+.widefat td p {
+ margin: 2px 0 0.8em;
}
-.form-table th,
-.form-wrap label {
- font-weight: normal;
- text-shadow: rgba(255,255,255,1) 0 1px 0;
+.widefat .column-comment p {
+ margin: 0.6em 0;
}
-.form-table th {
- vertical-align: top;
- text-align: left;
- padding: 10px;
- width: 200px;
+.widget .widget-top,
+.postbox h3 {
+ cursor: move;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -khtml-user-select: none;
+ user-select: none;
}
-.form-table th.th-full {
- width: auto;
+.postbox-container {
+ float: left;
+ padding-right: 0.5%;
}
-.form-table div.color-option {
- display: block;
- clear: both;
- margin-top: 12px;
+.postbox-container .meta-box-sortables {
+ min-height: 300px;
}
-.form-table input.tog {
- margin-top: 2px;
- margin-right: 2px;
- float: left;
+.postbox .hndle span {
+ padding: 6px 0;
}
-.form-table table.color-palette {
- vertical-align: bottom;
- float: left;
- margin: -12px 3px 11px;
+.postbox .hndle {
+ cursor: move;
}
-.form-table .color-palette td {
- border-width: 1px 1px 0;
- border-style: solid solid none;
- height: 10px;
- line-height: 20px;
- width: 10px;
+.hndle a {
+ font-size: 11px;
+ font-weight: normal;
}
-input.large-text,
-textarea.large-text {
- width: 99%;
+.postbox .handlediv {
+ float: right;
+ width: 23px;
+ height: 26px;
}
-.form-table input.regular-text,
-#adduser .form-field input {
- width: 25em;
+.sortable-placeholder {
+ border-width: 1px;
+ border-style: dashed;
+ margin-bottom: 20px;
}
-.form-table input.small-text {
- width: 50px;
+.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;
}
-#profile-page .form-table textarea {
- width: 500px;
- margin-bottom: 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;
}
-#profile-page .form-table #rich_editing {
- margin-right: 5px
+.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;
}
-.form-table .pre {
- padding: 8px;
- margin: 0;
+.postbox table.form-table {
+ margin-bottom: 0;
}
-.pre {
- /* http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/ */
- white-space: pre-wrap; /* css-3 */
- white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
- white-space: -pre-wrap; /* Opera 4-6 */
- white-space: -o-pre-wrap; /* Opera 7 */
- word-wrap: break-word; /* Internet Explorer 5.5+ */
+.postbox input[type="text"],
+.postbox textarea,
+.stuffbox input[type="text"],
+.stuffbox textarea {
+ border-width: 1px;
+ border-style: solid;
}
-table.form-table td .updated {
- font-size: 13px;
+.temp-border {
+ border: 1px dotted #ccc;
}
-/* divs for cats and tags pages */
-
-.form-wrap {
- margin: 10px 0;
- width: 97%;
+.columns-prefs label {
+ padding: 0 5px;
}
-.form-wrap p,
-.form-wrap label {
- font-size: 11px;
-}
-.form-wrap label {
- display: block;
- padding: 2px;
- font-size: 12px;
-}
+/*------------------------------------------------------------------------------
+ 9.0 - Dashboard
+------------------------------------------------------------------------------*/
-.form-field input,
-.form-field textarea {
- border-style: solid;
- border-width: 1px;
- width: 95%;
+#wpbody-content .metabox-holder {
+ padding-top: 10px;
}
-p.description,
-.form-wrap p {
- margin: 2px 0 5px;
+#dashboard-widgets .meta-box-sortables {
+ margin: 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;
+#dashboard_recent_comments div.undo {
+ border-top-style: solid;
+ border-top-width: 1px;
+ margin: 0 -10px;
+ padding: 3px 8px;
+ font-size: 11px;
}
-.form-wrap .form-field {
- margin: 0 0 10px;
- padding: 8px;
+#the-comment-list td.comment p.comment-author {
+ margin-top: 0;
+ margin-left: 0;
}
-.col-wrap h3 {
- margin: 12px 0;
- font-size: 1.1em;
+#the-comment-list p.comment-author img {
+ float: left;
+ margin-right: 8px;
}
-.col-wrap p.submit {
- margin-top: -10px;
+#the-comment-list p.comment-author strong a {
+ border: none;
}
-.tagcloud {
- width: 97%;
- margin: 0 0 40px;
- text-align: justify;
+#the-comment-list td {
+ vertical-align: top;
}
-.tagcloud h3 {
- margin: 2px 0 12px;
+#the-comment-list td.comment {
+ word-wrap: break-word;
}
-/* Post Screen */
-#post-body #normal-sortables {
- min-height: 50px;
+#the-comment-list .check-column {
+ padding-top: 8px;
}
-#post-body #advanced-sortables {
- min-height: 20px;
-}
-.postbox {
- position: relative;
- min-width: 255px;
- width: 99.5%;
-}
+/*------------------------------------------------------------------------------
+ 10.0 - List Posts (/Pages/etc)
+------------------------------------------------------------------------------*/
-#trackback_url {
- width: 99%;
+table.fixed {
+ table-layout: fixed;
}
-
-#normal-sortables .postbox .submit {
- background: transparent none;
- border: 0 none;
- float: right;
- padding: 0 12px;
- margin: 0;
+.fixed .column-rating,
+.fixed .column-visible {
+ width: 8%;
}
-
-#normal-sortables .postbox #replyrow .submit {
- float: none;
- margin: 0;
- padding: 3px 7px;
+.fixed .column-date,
+.fixed .column-parent,
+.fixed .column-links {
+ width: 10%;
}
-
-#side-sortables .submitbox .submit input,
-#side-sortables .submitbox .submit .preview,
-#side-sortables .submitbox .submit a.preview:hover {
- border: 0 none;
+.fixed .column-response,
+.fixed .column-author,
+.fixed .column-categories,
+.fixed .column-tags,
+.fixed .column-rel,
+.fixed .column-role {
+ width: 15%;
}
-
-#side-sortables .inside-submitbox .insidebox,
-.stuffbox .insidebox {
- margin: 11px 0;
+.fixed .column-comments {
+ width: 4em;
+ padding: 8px 0;
+ text-align: left;
}
-
-#side-sortables .comments-box,
-#normal-sortables .comments-box {
- border: 0 none;
+.fixed .column-comments .vers {
+ padding-left: 3px;
}
-
-#side-sortables .comments-box thead th,
-#normal-sortables .comments-box thead th {
- background: transparent;
- padding: 0 7px 4px;
- font-style: italic;
+.fixed .column-comments a {
+ float: left;
}
-
-#commentsdiv img.waiting {
- padding-left: 5px;
- vertical-align: middle;
+.fixed .column-slug {
+ width: 25%;
}
-
-#post-body .tagsdiv #newtag {
- margin-right: 5px;
- width: 16em;
+.fixed .column-posts {
+ width: 10%;
}
-
-#side-sortables input#post_password {
- width: 94%
+.fixed .column-icon {
+ width: 80px;
}
-
-#side-sortables .tagsdiv #newtag {
- width: 68%;
+#commentsdiv .fixed .column-author,
+#comments-form .fixed .column-author {
+ width: 20%;
}
-
-#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;
+#commentsdiv.postbox .inside {
+ line-height:1.4em;
+ margin:0;
}
-
-#post-status-info td {
- font-size: 11px;
+#commentsdiv.postbox .inside .row-actions {
+ line-height:18px;
}
-
-.autosave-info {
- padding: 2px 15px 2px 2px;
- text-align: right;
+#commentsdiv.postbox .inside td {
+ padding:1em 10px;
}
-
-#editorcontent #post-status-info {
- border: none;
+#commentsdiv.postbox .inside .column-comment p {
}
-
-#post-body .wp_themeSkin .mceStatusbar a.mceResize {
+#commentsdiv.postbox .inside .column-author {
+ width:33%;
+}
+#commentsdiv.postbox .inside p {
+ margin:6px 10px 8px;
+}
+#commentsdiv.postbox .column-comment p {
+ margin:0.6em 0;
+}
+#commentsdiv.postbox #replyrow td {
+ padding:0;
+}
+.sorting-indicator {
+ display: none;
+ width: 7px;
+ height: 4px;
+ margin-top: 5px;
+ margin-left: 7px;
+ background-image: url(../images/sort.gif);
+ background-repeat: no-repeat;
+}
+.fixed .column-comments .sorting-indicator {
+ margin-top: 3px;
+}
+.widefat th.sortable,
+.widefat th.sorted {
+ padding: 0;
+}
+th.sortable a,
+th.sorted a {
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;
+ overflow: hidden;
+ padding: 7px 7px 8px;
+}
+.fixed .column-comments.sortable a,
+.fixed .column-comments.sorted a {
+ padding: 8px 0;
+}
+th.sortable a span,
+th.sorted a span {
+ float: left;
+ cursor: pointer;
+}
+th.sorted.asc .sorting-indicator,
+th.desc:hover span.sorting-indicator {
+ display: block;
+ background-position: 0 0;
+}
+th.sorted.desc .sorting-indicator,
+th.asc:hover span.sorting-indicator {
+ display: block;
+ background-position: -7px 0;
}
-#linksubmitdiv div.inside,
-div.inside {
- padding: 0;
- margin: 0;
+/* Bulk Actions */
+
+.tablenav-pages a {
+ border-bottom-style: solid;
+ border-bottom-width: 2px;
+ font-weight: bold;
+ margin-right: 1px;
+ padding: 0 2px;
+}
+.tablenav-pages .current-page {
+ text-align: center;
+}
+.tablenav-pages .next-page {
+ margin-left: 2px;
}
-#comment-status-radio p {
- margin: 3px 0 5px;
+.tablenav a.button-secondary {
+ display: block;
+ margin: 3px 8px 0 0;
}
-#comment-status-radio input {
- margin: 2px 3px 5px 0;
+.tablenav {
+ clear: both;
+ height: 30px;
+ margin: 6px 0 4px;
vertical-align: middle;
}
-#comment-status-radio label {
- padding: 5px 0;
+.tablenav .tablenav-pages {
+ float: right;
+ display: block;
+ cursor: default;
+ height: 30px;
+ line-height: 30px;
+ font-size: 11px;
}
-.tagchecklist {
- margin-left: 14px;
- font-size: 12px;
- overflow: auto;
+.tablenav .one-page {
+ display: none;
}
-.tagchecklist strong {
- margin-left: -8px;
- position: absolute;
+.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;
}
-.tagchecklist span {
- margin-right: 25px;
- display: block;
- float: left;
- font-size: 11px;
- line-height: 1.8em;
- white-space: nowrap;
+.tablenav .tablenav-pages a.disabled:hover {
cursor: default;
}
-.tagchecklist span a {
- margin: 6px 0pt 0pt -9px;
- cursor: pointer;
- width: 10px;
- height: 10px;
- display: block;
- float: left;
- text-indent: -9999px;
- overflow: hidden;
- position: absolute;
+.tablenav .tablenav-pages a.disabled:active {
+ cursor: default;
}
-.howto {
+.tablenav .displaying-num {
+ margin-right: 10px;
+ font-size: 12px;
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
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;
+.tablenav .actions {
+ padding: 2px 8px 0 0;
}
-.ac_results li {
- padding: 2px 5px;
- white-space: nowrap;
- text-align: left;
+.tablenav .delete {
+ margin-right: 20px;
}
-.ac_over {
- cursor: pointer;
+.view-switch {
+ float: right;
+ margin: 6px 8px 0;
}
-.ac_match {
- text-decoration: underline;
+.view-switch a {
+ text-decoration: none;
}
-#poststuff h2 {
- margin-top: 20px;
- font-size: 1.5em;
- margin-bottom: 15px;
- padding: 0 0 3px;
- clear: left;
+.filter {
+ float: left;
+ margin: -5px 0 0 10px;
}
-.widget .widget-top,
-.postbox h3 {
- cursor: move;
- -webkit-user-select: none;
- -moz-user-select: none;
- -khtml-user-select: none;
- user-select: none;
+.filter .subsubsub {
+ margin-left: -10px;
+ margin-top: 13px;
+}
+.screen-per-page {
+ width: 3em;
}
-.postbox .hndle span {
- padding: 6px 0;
+#posts-filter fieldset {
+ float: left;
+ margin: 0 1.5ex 1em 0;
+ padding: 0;
}
-.postbox .hndle {
- cursor: move;
+#posts-filter fieldset legend {
+ padding: 0 0 .2em 1px;
}
-.hndle a {
- font-size: 11px;
+span.post-state-format {
font-weight: normal;
}
-#dashboard-widgets .meta-box-sortables {
- margin: 0 5px;
-}
-.postbox .handlediv {
- float: right;
- width: 23px;
- height: 26px;
-}
+/*------------------------------------------------------------------------------
+ 10.1 - Inline Editing
+------------------------------------------------------------------------------*/
-.sortable-placeholder {
- border-width: 1px;
- border-style: dashed;
- margin-bottom: 20px;
+/*
+.quick-edit* is for Quick Edit
+.bulk-edit* is for Bulk Edit
+.inline-edit* is for everything
+*/
+
+/* Layout */
+tr.inline-edit-row td {
+ padding: 0 0.5em;
}
-#poststuff h3,
-.metabox-holder h3 {
+#wpbody-content .inline-edit-row fieldset {
font-size: 12px;
- font-weight: bold;
- padding: 7px 9px;
+ float: left;
margin: 0;
- line-height: 1;
+ padding: 0;
+ width: 100%;
}
-.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;
+#wpbody-content .inline-edit-row fieldset .inline-edit-col {
+ padding: 0 0.5em;
}
-.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;
+#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;
}
-.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;
+#wpbody-content .quick-edit-row-post .inline-edit-col-left {
+ width: 40%;
}
-.postbox table.form-table {
- margin-bottom: 0;
+#wpbody-content .quick-edit-row-post .inline-edit-col-right {
+ width: 39%;
}
-.postbox input[type="text"],
-.postbox textarea,
-.stuffbox input[type="text"],
-.stuffbox textarea {
- border-width: 1px;
- border-style: solid;
+#wpbody-content .inline-edit-row-post .inline-edit-col-center {
+ width: 20%;
}
-#poststuff .inside,
-#poststuff .inside p {
- font-size: 11px;
- margin: 6px 6px 8px;
+#wpbody-content .quick-edit-row-page .inline-edit-col-left {
+ width: 50%;
}
-#poststuff .inside .submitbox p {
- margin: 1em 0;
+#wpbody-content .quick-edit-row-page .inline-edit-col-right,
+#wpbody-content .bulk-edit-row-post .inline-edit-col-right {
+ width: 49%;
}
-#post-visibility-select {
- line-height: 1.5em;
- margin-top: 3px;
+#wpbody-content .bulk-edit-row .inline-edit-col-left {
+ width: 30%;
}
-#poststuff #submitdiv .inside {
+#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,
+#wpbody-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: 0.5em;
+ margin: 0.5em 0 0;
+}
+
+.inline-edit-row span.error {
+ line-height: 22px;
+ margin: 0 15px;
+ padding: 3px 5px;
+}
+
+/* Positioning */
+.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;
}
-#titlediv, #poststuff .postarea {
- margin-bottom: 20px;
+.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: 0.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: 0.5em
+}
+
+/* Styling */
+.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;
+}
+
+/* Specific Elements */
+.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: 0.2em 0.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;
}
+
+/*------------------------------------------------------------------------------
+ 11.0 - Write/Edit Post Screen
+------------------------------------------------------------------------------*/
+
#titlediv {
position: relative;
margin-bottom: 20px;
}
#media-buttons img,
-#submitpost #ajax-loading {
+#submitpost #ajax-loading,
+#submitpost .ajax-loading {
vertical-align: middle;
}
+#wpcontent .ajax-loading {
+ visibility: hidden;
+}
+
.submitbox .submit {
text-align: left;
padding: 12px 10px 10px;
padding: 6px;
}
-#post-status-select {
+#post-status-select, #post-format {
line-height: 2.5em;
margin-top: 3px;
}
-/* Categories */
+/* Post Screen */
+#post-body #normal-sortables {
+ min-height: 50px;
+}
-.category-adder {
- margin-left: 120px;
- padding: 4px 0;
+#post-body #advanced-sortables {
+ min-height: 20px;
}
-.category-adder h4 {
- margin: 0 0 8px;
+.postbox {
+ position: relative;
+ min-width: 255px;
+ width: 99.5%;
}
-#side-sortables .category-adder {
- margin: 0;
+#trackback_url {
+ width: 99%;
}
-#post-body .category-add input, .category-add select {
- width: 30%;
+#normal-sortables .postbox .submit {
+ background: transparent none;
+ border: 0 none;
+ float: right;
+ padding: 0 12px;
+ margin:0;
}
#side-sortables .category-add input {
text-decoration: none;
}
+.wp-tab-panel,
.categorydiv div.tabs-panel,
.customlinkdiv div.tabs-panel,
.posttypediv div.tabs-panel,
}
#side-sortables .category-tabs li,
-#side-sortables .add-menu-item-tabs li {
+#side-sortables .add-menu-item-tabs li,
+.wp-tab-bar li {
display: inline;
}
#side-sortables .category-tabs a,
-#side-sortables .add-menu-item-tabs a {
+#side-sortables .add-menu-item-tabs a,
+.wp-tab-bar a {
text-decoration: none;
}
#side-sortables .category-tabs,
-#side-sortables .add-menu-item-tabs {
+#side-sortables .add-menu-item-tabs,
+.wp-tab-bar {
margin-bottom: 3px;
}
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 {
+#normal-sortables .postbox #replyrow .submit {
+ float: none;
margin: 0;
- padding: 0;
- line-height: 19px;
- word-wrap: break-word;
+ padding: 3px 7px;
}
-.category-adder h4 {
- margin-top: 4px;
- margin-bottom: 0px;
+#side-sortables .submitbox .submit input,
+#side-sortables .submitbox .submit .preview,
+#side-sortables .submitbox .submit a.preview:hover {
+ border: 0 none;
}
-.categorydiv .tabs-panel,
-.customlinkdiv .tabs-panel,
-.posttypediv .tabs-panel,
-.taxonomydiv .tabs-panel {
- border-width: 3px;
- border-style: solid;
+#side-sortables .inside-submitbox .insidebox,
+.stuffbox .insidebox {
+ margin: 11px 0;
}
+#side-sortables .comments-box,
+#normal-sortables .comments-box {
+ border: 0 none;
+}
ul.category-tabs,
-ul.add-menu-item-tabs {
+ul.add-menu-item-tabs,
+ul.wp-tab-bar {
margin-top: 12px;
}
+#side-sortables .comments-box thead th,
+#normal-sortables .comments-box thead th {
+ background: transparent;
+ padding: 0 7px 4px;
+ font-style: italic;
+}
+
ul.category-tabs li.tabs,
-ul.add-menu-item-tabs li.tabs {
+ul.add-menu-item-tabs li.tabs,
+.wp-tab-active {
border-style: solid solid none;
border-width: 1px 1px 0;
}
+#commentsdiv img.waiting {
+ padding-left: 5px;
+}
+
#post-body .category-tabs li.tabs,
#post-body .add-menu-item-tabs li.tabs {
border-style: solid none solid solid;
}
ul.category-tabs li,
-ul.add-menu-item-tabs li {
+ul.add-menu-item-tabs li,
+ul.wp-tab-bar li {
padding: 5px;
-moz-border-radius: 3px 3px 0 0;
-webkit-border-top-left-radius: 3px;
margin: 6px 0;
}
-td.plugin-title {
- white-space: nowrap;
-}
-
/* Global classes */
.wp-hidden-children .wp-hidden-child,
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;
+#post-body .tagsdiv #newtag {
+ margin-right: 5px;
+ width: 16em;
}
-.tablenav .delete {
- margin-right: 20px;
+#side-sortables input#post_password {
+ width: 94%
}
-td.action-links,
-th.action-links {
- text-align: right;
+#side-sortables .tagsdiv #newtag {
+ width: 68%;
}
-/* Diff */
-
-table.diff {
+#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;
}
-table.diff col.content {
- width: 50%;
+#post-status-info td {
+ font-size: 11px;
}
-table.diff tr {
- background-color: transparent;
+.autosave-info {
+ padding: 2px 15px 2px 2px;
+ text-align: right;
}
-table.diff td, table.diff th {
- padding: .5em;
- font-family: Consolas, Monaco, Courier, monospace;
+#editorcontent #post-status-info {
border: none;
}
-table.diff .diff-deletedline del, table.diff .diff-addedline ins {
- text-decoration: 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;
}
#wp-word-count {
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;
border-style: solid;
}
-/* media popup 0819 */
-#sidemenu {
- margin: -30px 15px 0 315px;
- list-style: none;
- position: relative;
- float: right;
- padding-left: 10px;
- font-size: 12px;
+
+/*------------------------------------------------------------------------------
+ 11.1 - Custom Fields
+------------------------------------------------------------------------------*/
+
+#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;
}
-#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;
+#postcustomstuff .updatemeta,
+#postcustomstuff .deletemeta {
+ margin: auto;
}
-#sidemenu li {
- display: inline;
- line-height: 200%;
- list-style: none;
- text-align: center;
- white-space: nowrap;
- margin: 0;
- padding: 0;
+#postcustomstuff thead th {
+ padding: 5px 8px 8px;
}
-#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;
+#postcustom #postcustomstuff .submit {
+ border: 0 none;
+ float: none;
+ padding: 5px 8px;
}
-#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;
+#side-sortables #postcustom #postcustomstuff .submit {
+ padding: 0 5px;
}
-#sidemenu li a .count-0 {
- display: none;
+#side-sortables #postcustom #postcustomstuff td.left input {
+ margin: 3px 3px 0;
}
-/* reply to comments */
-#replyrow {
- font-size: 11px;
+#side-sortables #postcustom #postcustomstuff #the-list textarea {
+ height: 85px;
+ margin: 3px;
}
-#replyrow input {
+#postcustomstuff table {
+ margin: 0;
+ width: 100%;
border-width: 1px;
border-style: solid;
+ border-spacing: 0;
}
-#replyrow td {
- padding: 2px;
+#postcustomstuff table input,
+#postcustomstuff table select,
+#postcustomstuff table textarea {
+ width: 95%;
+ margin: 8px 0 8px 8px;
}
-#replyrow #editorcontainer {
- border: 0 none;
+#postcustomstuff th.left,
+#postcustomstuff td.left {
+ width: 38%;
}
-#replysubmit {
- margin: 0;
- padding: 3px 7px;
+#postcustomstuff .submit input {
+ width: auto;
}
-#replysubmit img.waiting,
-.inline-edit-save img.waiting {
- padding: 4px 10px 0;
+#postcustomstuff #newmeta .submit {
+ padding: 0 8px;
+}
+
+#postcustomstuff table #addmetasub {
+ width: auto;
+}
+
+#postcustomstuff #newmetaleft {
vertical-align: top;
- float: right;
}
-#replysubmit .button {
- margin-right: 5px;
+#postcustomstuff #newmetaleft a {
+ padding: 0 10px;
+ text-decoration: none;
}
-#replyrow #editor-toolbar {
- display: none;
+
+/*------------------------------------------------------------------------------
+ 11.2 - Post Revisions
+------------------------------------------------------------------------------*/
+
+table.diff {
+ width: 100%;
}
-#replyhead {
- font-size: 12px;
- font-weight: bold;
- padding: 2px 10px 4px;
+table.diff col.content {
+ width: 50%;
}
-#edithead .inside {
- float: left;
- padding: 3px 0 2px 5px;
- margin: 0;
- text-align: center;
- font-size: 11px;
+table.diff tr {
+ background-color: transparent;
}
-#edithead .inside input {
- width: 180px;
- font-size: 11px;
+table.diff td, table.diff th {
+ padding: .5em;
+ font-family: Consolas, Monaco, Courier, monospace;
+ border: none;
}
-#edithead label {
- padding: 2px 0;
+table.diff .diff-deletedline del, table.diff .diff-addedline ins {
+ text-decoration: none;
}
-#replycontainer {
- padding: 5px;
- border: 0 none;
- height: 120px;
- overflow: hidden;
- position: relative;
+
+/*------------------------------------------------------------------------------
+ 12.0 - Categories
+------------------------------------------------------------------------------*/
+
+.category-adder {
+ margin-left: 120px;
+ padding: 4px 0;
}
-#replycontent {
- resize: none;
- margin: 0;
- width: 100%;
- height: 100%;
- padding: 0;
- line-height: 150%;
- border: 0 none;
- outline: none;
- font-size: 12px;
+.category-adder h4 {
+ margin: 0 0 8px;
}
-#replyrow #ed_reply_toolbar {
+#side-sortables .category-adder {
margin: 0;
- padding: 2px 3px;
}
-/* show/hide settings */
-#screen-meta {
- position: relative;
- clear: both;
+#post-body .category-add input, .category-add select {
+ width: 30%;
}
-#screen-meta-links {
- margin: 0 18px 0 0;
+#side-sortables .category-add select {
+ width: 100%;
}
-#screen-meta .screen-reader-text {
- visibility: hidden;
+#side-sortables .category-add input.category-add-sumbit, #post-body .category-add input.category-add input.category-add-sumbit {
+ width: auto;
}
-#screen-options-link-wrap,
-#contextual-help-link-wrap {
- float: right;
- height: 22px;
+#post-body ul.category-tabs,
+#post-body ul.add-menu-item-tabs {
+ float: left;
+ width: 120px;
+ text-align: right;
+ /* Negative margin for the sake of those without JS: all tabs display */
+ margin: 0 -120px 0 5px;
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;
+#post-body ul.category-tabs li,
+#post-body ul.add-menu-item-tabs li {
+ padding: 8px;
}
-#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;
+#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;
}
-#screen-meta a.show-settings {
- background-image: url( ../images/screen-options-right.gif?ver=20100531 );
+#post-body ul.category-tabs li.tabs a,
+#post-body ul.add-menu-item-tabs li.tabs a {
+ font-weight: bold;
+ text-decoration: none;
}
-#screen-meta a.show-settings:hover {
- 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: 0.5em 0.9em;
+ border-style: solid;
+ border-width: 1px;
}
-#screen-options-wrap h5,
-#contextual-help-wrap h5 {
- margin: 8px 0;
- font-size: 13px;
+.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;
}
-#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;
+div.tabs-panel-active {
+ display:block;
}
-.metabox-prefs label {
- padding-right: 15px;
- white-space: nowrap;
- line-height: 30px;
+div.tabs-panel-inactive {
+ display:none;
}
-.metabox-prefs label input {
- margin: 0 5px 0 2px;
+#post-body .categorydiv div.tabs-panel,
+.taxonomy div.tabs-panel,
+#post-body #linkcategorydiv div.tabs-panel {
+ margin: 0 5px 0 125px;
}
-.metabox-prefs label a {
- display: none;
+#side-sortables .category-tabs li,
+#side-sortables .add-menu-item-tabs li {
+ display: inline;
}
-/* Inline Editor
- .quick-edit* is for Quick Edit
- .bulk-edit* is for Bulk Edit
- .inline-edit* is for everything
-*/
-/* Layout */
-tr.inline-edit-row td {
- padding: 0 0.5em;
+#side-sortables .category-tabs a,
+#side-sortables .add-menu-item-tabs a {
+ text-decoration: none;
}
-#wpbody-content .inline-edit-row fieldset {
- font-size: 12px;
- float: left;
- margin: 0;
- padding: 0;
- width: 100%;
+#side-sortables .category-tabs,
+#side-sortables .add-menu-item-tabs {
+ margin-bottom: 3px;
}
-#wpbody-content .inline-edit-row fieldset .inline-edit-col {
- padding: 0 0.5em;
+.categorydiv ul,
+.customlinkdiv ul,
+.posttypediv ul,
+.taxonomydiv ul,
+#linkcategorydiv ul {
+ list-style: none;
+ padding: 0;
+ margin: 0;
}
-#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;
+#front-page-warning,
+#front-static-pages ul,
+ul.export-filters,
+.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;
}
-#wpbody-content .quick-edit-row-post .inline-edit-col-left {
- width: 40%;
+ul.categorychecklist li {
+ margin: 0;
+ padding: 0;
+ line-height: 19px;
+ word-wrap: break-word;
}
-#wpbody-content .quick-edit-row-post .inline-edit-col-right {
- width: 39%;
+.categorydiv .tabs-panel,
+.customlinkdiv .tabs-panel,
+.posttypediv .tabs-panel,
+.taxonomydiv .tabs-panel {
+ border-width: 3px;
+ border-style: solid;
}
-#wpbody-content .inline-edit-row-post .inline-edit-col-center {
- width: 20%;
+ul.category-tabs,
+ul.add-menu-item-tabs {
+ margin-top: 12px;
}
-#wpbody-content .quick-edit-row-page .inline-edit-col-left {
- width: 50%;
+ul.category-tabs li.tabs,
+ul.add-menu-item-tabs li.tabs {
+ border-style: solid solid none;
+ border-width: 1px 1px 0;
}
-#wpbody-content .quick-edit-row-page .inline-edit-col-right,
-#wpbody-content .bulk-edit-row-post .inline-edit-col-right {
- width: 49%;
+#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;
}
-#wpbody-content .bulk-edit-row .inline-edit-col-left {
- width: 30%;
+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;
}
-#wpbody-content .bulk-edit-row-page .inline-edit-col-right {
- width: 69%;
+.form-wrap {
+ margin: 10px 0;
+ width: 97%;
}
-#wpbody-content .bulk-edit-row .inline-edit-col-bottom {
- float: right;
- width: 69%;
+.form-wrap p,
+.form-wrap label {
+ font-size: 11px;
}
-#wpbody-content .inline-edit-row-page .inline-edit-col-right,
-#owpbody-content .bulk-edit-row-post .inline-edit-col-right {
- margin-top: 27px;
+.form-wrap label {
+ display: block;
+ padding: 2px;
+ font-size: 12px;
}
-.inline-edit-row fieldset .inline-edit-group {
- clear: both;
+.form-field input,
+.form-field textarea {
+ border-style: solid;
+ border-width: 1px;
+ width: 95%;
}
-.inline-edit-row fieldset .inline-edit-group:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
+p.description,
+.form-wrap p {
+ margin: 2px 0 5px;
}
-.inline-edit-row p.submit {
- clear: both;
- padding: 0.5em;
- margin: 0.5em 0 0;
+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;
}
-.inline-edit-row span.error {
- line-height: 22px;
- margin: 0 15px;
- padding: 3px 5px;
+.form-wrap .form-field {
+ margin: 0 0 10px;
+ padding: 8px;
}
-/* Positioning */
-.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;
+.col-wrap h3 {
+ margin: 12px 0;
+ font-size: 1.1em;
}
-.inline-edit-row fieldset label,
-.inline-edit-row fieldset span.inline-edit-categories-label {
- display: block;
- margin: .2em 0;
+.col-wrap p.submit {
+ margin-top: -10px;
}
-.inline-edit-row fieldset label.inline-edit-tags {
- margin-top: 0;
-}
-.inline-edit-row fieldset label.inline-edit-tags span.title {
- margin: .2em 0;
-}
+/*------------------------------------------------------------------------------
+ 13.0 - Tags
+------------------------------------------------------------------------------*/
-.inline-edit-row fieldset label span.title {
- display: block;
- float: left;
- width: 5em;
+.taghint {
+ color: #aaa;
+ margin: 15px 0 -24px 12px;
}
-.inline-edit-row fieldset label span.input-text-wrap {
- display: block;
- margin-left: 5em;
+#poststuff .tagsdiv .howto {
+ margin: 0 0 6px 8px;
}
-.quick-edit-row-post fieldset.inline-edit-col-right label span.title {
- width: auto;
- padding-right: 0.5em;
+.ajaxtag .newtag {
+ background: transparent;
+ position: relative;
}
-.inline-edit-row .input-text-wrap input[type=text] {
- width: 100%;
+.tagsdiv .newtag {
+ width: 180px;
}
-.inline-edit-row fieldset label input[type=checkbox] {
- vertical-align: text-bottom;
+.tagsdiv .the-tags {
+ display: block;
+ height: 60px;
+ margin: 0 auto;
+ overflow: auto;
+ width: 260px;
}
-.inline-edit-row fieldset label textarea {
- width: 100%;
- height: 4em;
+#post-body-content .tagsdiv .the-tags {
+ margin: 0 5px;
}
-#wpbody-content .bulk-edit-row fieldset .inline-edit-group label {
- max-width: 50%;
+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;
}
-#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child {
- margin-right: 0.5em
+p.popular-tags a {
+ padding: 0 3px;
}
-/* Styling */
-.inline-edit-row h4 {
- text-transform: uppercase;
+.tagcloud {
+ width: 97%;
+ margin: 0 0 40px;
+ text-align: justify;
}
-.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;
+.tagcloud h3 {
+ margin: 2px 0 12px;
}
-/* Specific Elements */
-.inline-edit-row fieldset input[type="text"],
-.inline-edit-row fieldset textarea {
- border-style: solid;
+.ac_results {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+ position: absolute;
+ z-index: 10000;
+ display: none;
border-width: 1px;
+ border-style: solid;
}
-.inline-edit-row fieldset .inline-edit-date {
- float: left;
+.ac_results li {
+ padding: 2px 5px;
+ white-space: nowrap;
+ text-align: 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;
+.ac_over {
+ cursor: pointer;
}
-.inline-edit-row fieldset input[name=aa] {
- font-size: 12px;
- width: 3.5em;
+.ac_match {
+ text-decoration: underline;
}
-.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: 0.2em 0.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;
-}
+/*------------------------------------------------------------------------------
+ 14.0 - Media Screen
+------------------------------------------------------------------------------*/
-/* Media library */
#wpbody-content #media-items .describe {
border-collapse: collapse;
width: 100%;
width: 25%;
}
-/* find posts */
+
+/*------------------------------------------------------------------------------
+ 14.1 - Media Uploader
+------------------------------------------------------------------------------*/
+
.find-box {
width: 500px;
height: 300px;
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;
}
vertical-align: middle;
}
-/* table.fixed column width */
-table.fixed {
- table-layout: fixed;
-}
-.fixed .column-rating,
-.fixed .column-visible {
- width: 8%;
+/*------------------------------------------------------------------------------
+ 14.2 - Image Editor
+------------------------------------------------------------------------------*/
+
+.describe .image-editor {
+ vertical-align: top;
}
-.fixed .column-date,
-.fixed .column-parent,
-.fixed .column-links {
- width: 10%;
+.imgedit-wrap {
+ position: relative;
}
-.fixed .column-response,
-.fixed .column-author,
-.fixed .column-categories,
-.fixed .column-tags,
-.fixed .column-rel,
-.fixed .column-role {
- width: 15%;
+.imgedit-settings p {
+ margin: 8px 0;
}
-.fixed .column-comments {
- width: 4em;
- padding-top: 8px;
+.describe .imgedit-wrap table td {
+ vertical-align: top;
+ padding-top: 0;
}
-.fixed .column-slug {
- width: 25%;
+.imgedit-wrap p,
+.describe .imgedit-wrap table td {
+ font-size: 11px;
+ line-height: 18px;
}
-.fixed .column-posts {
- width: 10%;
+.describe .imgedit-wrap table td.imgedit-settings {
+ padding: 0 5px;
}
-.fixed .column-icon {
- width: 80px;
+td.imgedit-settings input {
+ vertical-align: middle;
}
-#commentsdiv .fixed .column-author,
-#comments-form .fixed .column-author {
- width: 20%;
+.imgedit-wait {
+ position: absolute;
+ top: 0;
+ background: #FFFFFF url(../images/wpspin_light.gif) no-repeat scroll 22px 10px;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+ width: 100%;
+ height: 500px;
+ display: none;
}
-.widefat th,
-.widefat td {
- overflow: hidden;
+.media-disabled,
+.imgedit-settings .disabled {
+ color: grey;
}
-.widefat td p {
- margin: 2px 0 0.8em;
+.imgedit-wait-spin {
+ padding: 0 4px 4px;
+ vertical-align: bottom;
+ visibility: hidden;
}
-table .vers,
-table .column-visible,
-table .column-rating {
- text-align: center;
+.imgedit-menu {
+ margin: 0 0 12px;
+ min-width: 300px;
}
-.icon32 {
+.imgedit-menu div {
float: left;
- height: 36px;
- margin: 14px 6px 0 0;
- width: 36px;
+ 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;
}
-.key-labels label {
- line-height: 24px;
+.imgedit-crop-wrap {
+ position: relative;
}
-.subtitle {
- font-size: 0.75em;
- line-height: 1;
- padding-left: 25px;
+.imgedit-crop {
+ background: transparent url(../images/imgedit-icons.png) no-repeat scroll -9px -31px;
+ margin: 0 8px 0 0;
}
-ol {
- list-style-type: decimal;
- margin-left: 2em;
+.imgedit-crop.disabled:hover {
+ background-position: -9px -31px;
}
-.postbox-container {
- float: left;
- padding-right: 0.5%;
+.imgedit-crop:hover {
+ background-position: -9px -1px;
}
-.postbox-container .meta-box-sortables {
- min-height: 300px;
+.imgedit-rleft {
+ background: transparent url(../images/imgedit-icons.png) no-repeat scroll -46px -31px;
+ margin: 0 3px;
}
-.temp-border {
- border: 1px dotted #ccc;
+.imgedit-rleft.disabled:hover {
+ background-position: -46px -31px;
}
-.columns-prefs label {
- padding: 0 5px;
+.imgedit-rleft:hover {
+ background-position: -46px -1px;
}
-.theme-install-php h4,
-.plugin-install-php h4 {
- margin: 2.5em 0 8px;
+.imgedit-rright {
+ background: transparent url(../images/imgedit-icons.png) no-repeat scroll -77px -31px;
+ margin: 0 8px 0 3px;
}
-p.install-help {
- margin: 8px 0;
- font-style: italic;
+.imgedit-rright.disabled:hover {
+ background-position: -77px -31px;
}
-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;
+.imgedit-rright:hover {
+ background-position: -77px -1px;
}
-p.popular-tags a {
- padding: 0 3px;
+.imgedit-flipv {
+ background: transparent url(../images/imgedit-icons.png) no-repeat scroll -115px -31px;
+ margin: 0 3px;
}
-.stuffbox .editcomment {
- clear: none;
+.imgedit-flipv.disabled:hover {
+ background-position: -115px -31px;
}
-.ajax-feedback {
- visibility: hidden;
- vertical-align: bottom;
+.imgedit-flipv:hover {
+ background-position: -115px -1px;
}
-.tagsdiv .newtag {
- width: 180px;
+.imgedit-fliph {
+ background: transparent url(../images/imgedit-icons.png) no-repeat scroll -147px -31px;
+ margin: 0 8px 0 3px;
}
-.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: #FFFFFF url(../images/wpspin_light.gif) no-repeat scroll 22px 10px;
- opacity: 0.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.disabled:hover {
+ background-position: -147px -31px;
}
.imgedit-fliph:hover {
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;
-}
+/*------------------------------------------------------------------------------
+ 15.0 - Comments Screen
+------------------------------------------------------------------------------*/
-/* tag hints */
-.taghint {
- color: #aaa;
- margin: 15px 0 -24px 12px;
+.form-table {
+ border-collapse: collapse;
+ margin-top: 0.5em;
+ width: 100%;
+ margin-bottom: -8px;
+ clear: both;
}
-#poststuff .tagsdiv .howto {
- margin: 0 0 6px 8px;
+.form-table td {
+ margin-bottom: 9px;
+ padding: 8px 10px;
+ line-height: 20px;
+ font-size: 11px;
}
-.ajaxtag .newtag {
- background: transparent;
- position: relative;
+.form-table th,
+.form-wrap label {
+ font-weight: normal;
+ text-shadow: rgba(255,255,255,1) 0 1px 0;
}
-#broken-themes {
+.form-table th {
+ vertical-align: top;
text-align: left;
- width: 50%;
- border-spacing: 3px;
- padding: 3px;
+ padding: 10px;
+ width: 200px;
}
-.describe .del-link {
- padding-left: 5px;
+.form-table th.th-full {
+ width: auto;
}
-.comment-ays {
- margin-bottom: 0;
- border-style: solid;
- border-width: 1px;
+.form-table div.color-option {
+ display: block;
+ clear: both;
+ margin-top: 12px;
}
-.comment-ays th {
- border-right-style: solid;
- border-right-width: 1px;
+.form-table input.tog {
+ margin-top: 2px;
+ margin-right: 2px;
+ float: left;
}
-/* Custom Background */
-
-div#custom-background-image {
- min-height: 100px;
- border: 1px solid #dfdfdf;
+.form-table td p {
+ margin-top: 4px;
}
-div#custom-background-image img {
- max-width: 400px;
- max-height: 300px;
+.form-table table.color-palette {
+ vertical-align: bottom;
+ float: left;
+ margin: -12px 3px 11px;
}
-#custom-background label {
- padding-right: 15px;
+.form-table .color-palette td {
+ border-width: 1px 1px 0;
+ border-style: solid solid none;
+ height: 10px;
+ line-height: 20px;
+ width: 10px;
}
-/* Custom Header */
-.appearance_page_custom-header #headimg {
- border: 1px solid #DFDFDF;
- min-height: 100px;
- width: 100%;
+.commentlist li {
+ padding: 1em 1em .2em;
+ margin: 0;
+ border-bottom-width: 1px;
+ border-bottom-style: solid;
}
-.appearance_page_custom-header #upload-form p label {
+.commentlist li li {
+ border-bottom: 0;
+ padding: 0;
+}
+
+.commentlist p {
+ padding: 0;
+ margin: 0 0 .8em;
+}
+
+/* reply to comments */
+#replyrow {
font-size: 11px;
}
-.appearance_page_custom-header #available-headers .default-header {
+#replyrow input {
+ border-width: 1px;
+ border-style: solid;
+}
+
+#replyrow td {
+ padding: 2px;
+}
+
+#replyrow #editorcontainer {
+ border: 0 none;
+}
+
+#replysubmit {
+ margin: 0;
+ padding: 3px 7px;
+ text-align:center;
+}
+
+#replysubmit img.waiting,
+.inline-edit-save img.waiting {
+ padding: 4px 10px 0;
+ vertical-align: top;
+ float: right;
+}
+
+#replysubmit .button {
+ margin-right: 5px;
+}
+
+#replysubmit .error {
+ color:red;
+ line-height:21px;
+ text-align:center;
+ vertical-align:center;
+}
+
+#replyrow #editor-toolbar {
+ display: none;
+}
+
+#replyhead {
+ font-size: 12px;
+ font-weight: bold;
+ padding: 2px 10px 4px;
+}
+
+#edithead .inside {
float: left;
- margin: 0 20px 20px 0;
+ padding: 3px 0 2px 5px;
+ margin: 0;
+ text-align: center;
+ font-size: 11px;
}
-.appearance_page_custom-header #available-headers label input {
- margin-right: 10px;
+#edithead .inside input {
+ width: 180px;
+ font-size: 11px;
}
-.appearance_page_custom-header #available-headers label img {
- vertical-align: middle;
+#edithead label {
+ padding: 2px 0;
}
-/* Tab Interface */
+#replycontainer {
+ padding: 5px;
+ border: 0 none;
+ height: 120px;
+ overflow: hidden;
+ position: relative;
+}
-.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;
+#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;
+}
+
+.comment-ays {
+ margin-bottom: 0;
+ border-style: solid;
+ border-width: 1px;
+}
+
+.comment-ays th {
+ border-right-style: solid;
+ border-right-width: 1px;
+}
+
+.trash-undo-inside,
+.spam-undo-inside {
+ margin: 1px 8px 1px 0;
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 {
+.spam-undo-inside .avatar,
+.trash-undo-inside .avatar {
+ height: 20px;
+ width: 20px;
+ margin-right: 8px;
+ vertical-align: middle;
+}
+
+.stuffbox .editcomment {
+ clear: none;
+}
+
+#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;
+}
+
+.commentlist .avatar {
+ vertical-align: text-top;
+}
+
+
+/*------------------------------------------------------------------------------
+ 16.0 - Themes
+------------------------------------------------------------------------------*/
+
+.theme-install-php .tablenav {
+ height:auto;
+}
+
+table#availablethemes {
+ border-spacing: 0;
+ border-width: 1px 0;
+ border-style: solid none;
+ margin: 10px auto;
+ width: 100%;
+}
+
+table#availablethemes .no-items td{
+ border-width:0;
+ padding:5px;
+}
+
+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;
- color: #464646;
+ border-style: solid;
+ margin-bottom: 10px;
+ overflow: hidden;
}
-.themes-php .wrap h2, .theme-install-php .wrap h2 {
- border-bottom: 1px solid #ccc;
- padding-bottom: 0;
+.available-theme img {
+ width: 240px;
}
-h2 .nav-tab {
- padding: 4px 20px 6px;
- font: italic normal normal 24px/35px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+.available-theme h3 {
+ margin: 15px 0 5px;
}
-/* Scrollbar fix for bulk upgrade iframe */
-body.update-php {
- height: 98%;
+#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;
+}
+
+.theme-options span {
+ text-transform: uppercase;
+ font-size: 13px;
+}
+
+.theme-options a {
+ font-size: 15px;
+}
+
+#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;
+}
+
+#broken-themes {
+ text-align: left;
+ width: 50%;
+ border-spacing: 3px;
+ padding: 3px;
+}
+
+.theme-install-php h4 {
+ margin: 2.5em 0 8px;
+}
+
+
+/*------------------------------------------------------------------------------
+ 16.1 - Custom Header Screen
+------------------------------------------------------------------------------*/
+
+.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;
+}
+
+
+/*------------------------------------------------------------------------------
+ 16.2 - Custom Background Screen
+------------------------------------------------------------------------------*/
+
+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;
+}
+
+
+/*------------------------------------------------------------------------------
+ 16.3 - Tabbed Admin Screen Interface (Experimental)
+------------------------------------------------------------------------------*/
+
+.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;
+}
+
+h2.nav-tab-wrapper, h3.nav-tab-wrapper {
+ 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;
+}
+
+
+/*------------------------------------------------------------------------------
+ 17.0 - Plugins
+------------------------------------------------------------------------------*/
+
+.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 .row-actions-visible {
+ padding: 0;
+}
+
+.plugins tbody th.check-column {
+ padding: 7px 0;
+}
+
+.plugins td, .plugins th {
+ border-bottom: 0 none;
+}
+
+.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, #wpbody-content .plugins .theme-title {
+ padding-right: 12px;
+ white-space:nowrap;
+}
+
+.plugins .second, .plugins .row-actions-visible {
+ padding: 0 0 5px;
+}
+
+.plugins-php .widefat tfoot th,
+.plugins-php .widefat tfoot td {
+ border-top-style: solid;
+ border-top-width: 1px;
+}
+
+.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;
+}
+
+.plugin-install-php h4 {
+ margin: 2.5em 0 8px;
+}
+
+
+/*------------------------------------------------------------------------------
+ 18.0 - Users
+------------------------------------------------------------------------------*/
+
+#profile-page .form-table textarea {
+ width: 500px;
+ margin-bottom: 6px;
+}
+
+#profile-page .form-table #rich_editing {
+ margin-right: 5px
+}
+
+#your-profile legend {
+ font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+ font-size: 22px;
+}
+
+#your-profile #rich_editing {
+ border: none;
+}
+
+#display_name {
+ width: 15em;
+}
+
+#createuser .form-field input {
+ width: 25em;
+}
+
+/*------------------------------------------------------------------------------
+ 19.0 - Tools
+------------------------------------------------------------------------------*/
+
+
+
+
+/*------------------------------------------------------------------------------
+ 20.0 - Settings
+------------------------------------------------------------------------------*/
+
+#utc-time, #local-time {
+ padding-left: 25px;
+ font-style: italic;
+ font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
+}
+
+.defaultavatarpicker .avatar {
+ margin: 2px 0;
+ vertical-align: middle;
+}
+
+
+/*------------------------------------------------------------------------------
+ 21.0 - Admin Footer
+------------------------------------------------------------------------------*/
+
+#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;
+}
+
+
+/*------------------------------------------------------------------------------
+ 22.0 - Misc
+------------------------------------------------------------------------------*/
+
+#excerpt, .attachmentlinks {
+ margin: 0;
+ height: 4em;
+ width: 98%;
+}
+
+#template div {
+ margin-right: 190px;
+}
+
+p.pagenav {
+ margin: 0;
+ display: inline;
+}
+
+.pagenav span {
+ font-weight: bold;
+ margin: 0 6px;
+}
+
+.row-title {
+ font-size: 12px !important;
+ font-weight: bold;
+}
+
+.column-author img, .column-username img {
+ float: left;
+ margin-right: 10px;
+ margin-top: 3px;
+}
+
+.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;
+}
+
+.form-table .pre {
+ padding: 8px;
+ margin: 0;
+}
+
+table.form-table td .updated {
+ font-size: 13px;
+}
+
+
+.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 0pt 0pt -9px;
+ cursor: pointer;
+ width: 10px;
+ height: 10px;
+ display: block;
+ float: left;
+ text-indent: -9999px;
+ overflow: hidden;
+ position: absolute;
+}
+
+
+#poststuff h2 {
+ margin-top: 20px;
+ font-size: 1.5em;
+ margin-bottom: 15px;
+ padding: 0 0 3px;
+ clear: left;
+}
+#poststuff h3,
+.metabox-holder h3 {
+ font-size: 12px;
+ font-weight: bold;
+ padding: 7px 9px;
+ margin: 0;
+ line-height: 1;
+}
+#poststuff .inside,
+#poststuff .inside p {
+ font-size: 11px;
+ margin: 6px 6px 8px;
+}
+#poststuff .inside .submitbox p {
+ margin: 1em 0;
+}
+#post-visibility-select, #post-formats-select {
+ line-height: 1.5em;
+ margin-top: 3px;
+}
+#poststuff #submitdiv .inside {
+ margin: 0;
+}
+#titlediv, #poststuff .postarea {
+ margin-bottom: 20px;
+}
+
+
+td.post-title strong, td.plugin-title strong {
+ display: block;
+ margin-bottom: .2em;
+}
+td.post-title p, td.plugin-title p {
+ margin: 6px 0;
+}
+
+
+.wp-hidden-children .wp-hidden-child,
+.ui-tabs-hide {
+ display: none;
+}
+
+#templateside ul li a {
+ text-decoration: none;
+}
+
+
+.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;
+}
+
+
+#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 li a .count-0 {
+ display: none;
+}
+
+#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;
+}
+
+.plugin-install #description, .plugin-install-network #description {
+ width: 60%;
+}
+
+table .vers,
+table .column-visible,
+table .column-rating {
+ text-align: left;
+}
+
+
+/* Scrollbar fix for bulk upgrade iframe */
+body.iframe {
+ height: 98%;
+}
+
+
+/*------------------------------------------------------------------------------
+ 23.0 - Dead
+------------------------------------------------------------------------------*/
+
+/* - Not used anywhere in WordPress - verify and then deprecate
+------------------------------------------------------------------------------*/
+.anchors {
+ margin: 10px 20px 10px 20px;
+}
+div.nav {
+ height: 2em;
+ padding: 7px 10px;
+ vertical-align: text-top;
+ margin: 5px 0;
+}
+.nav .button-secondary {
+ padding: 2px 4px;
+}
+* html #themeselect {
+ padding: 0 3px;
+ height: 22px;
+}
+.settings-toggle {
+ text-align: right;
+ margin: 5px 7px 15px 0;
+ font-size: 12px;
+}
+.settings-toggle h3 {
+ margin: 0;
+}
+form#tags-filter {
+ position: relative;
+}
+
+/* - Only used once or twice in all of WP - deprecate for global style
+------------------------------------------------------------------------------*/
+td.media-icon {
+ text-align: center;
+ width: 80px;
+ padding-top: 8px;
+ padding-bottom: 8px;
+}
+
+td.media-icon img {
+ max-width: 80px;
+ max-height: 60px;
+}
+.screen-per-page {
+ width: 3em;
+}
+* html #template div {margin-right: 0;}
+
+.list-ajax-loading {
+ float: right;
+ margin-right: 9px;
+ margin-top: -1px;
+}
+.tablenav .list-ajax-loading {
+ margin-top: 7px;
+}
+#howto {
+ font-size: 11px;
+ margin: 0 5px;
+ display: block;
+}
+.import-system {font-size: 16px;}
+#namediv table {
+ width: 100%;
+}
+#namediv td.first {
+ width: 10px;
+ white-space: nowrap;
+}
+#namediv input {
+ width: 98%;
+}
+#namediv p {
+ margin: 10px 0;
+}
+#submitdiv h3 {
+ margin-bottom: 0 !important;
+}
+
+/* - Used - but could/should be deprecated with a CSS reset
+------------------------------------------------------------------------------*/
+.zerosize {
+ height: 0;
+ width: 0;
+ margin: 0;
+ border: 0;
+ padding: 0;
+ overflow: hidden;
+ position: absolute;
+}
+br.clear {
+ height: 2px;
+ line-height: 2px;
+}
+.checkbox {
+ border: none;
+ margin: 0;
+ padding: 0;
+}
+#content {
+ margin: 0;
+ width: 100%;
+}
+fieldset {
+ border: 0;
+ padding: 0;
+ margin: 0;
+}
+#linksubmitdiv div.inside,
+div.inside {
+ padding: 0;
+ margin: 0;
+}
+.post-categories {
+ display: inline;
+ margin: 0;
+ padding: 0;
+}
+.post-categories li {
+ display: inline;
}
* Callback for administration header.
*
* @var callback
- * @since unknown
+ * @since 3.0.0
* @access private
*/
var $admin_header_callback;
<td>
<form method="post" action="">
<?php wp_nonce_field('custom-background-remove', '_wpnonce-custom-background-remove'); ?>
-<input type="submit" class="button" name="remove-background" value="<?php esc_attr_e('Remove Background Image'); ?>" /><br/>
+<?php submit_button( __( 'Remove Background Image' ), 'button', 'remove-background', false ); ?><br/>
<?php _e('This will remove the background image. You will not be able to restore any customizations.') ?>
</form>
</td>
<td>
<form method="post" action="">
<?php wp_nonce_field('custom-background-reset', '_wpnonce-custom-background-reset'); ?>
-<input type="submit" class="button" name="reset-background" value="<?php esc_attr_e('Restore Original Image'); ?>" /><br/>
+<?php submit_button( __( 'Restore Original Image' ), 'button', 'reset-background', false ); ?><br/>
<?php _e('This will restore the original background image. You will not be able to restore any customizations.') ?>
</form>
</td>
<label for="upload"><?php _e('Choose an image from your computer:'); ?></label><br /><input type="file" id="upload" name="import" />
<input type="hidden" name="action" value="save" />
<?php wp_nonce_field('custom-background-upload', '_wpnonce-custom-background-upload') ?>
-<input type="submit" class="button" value="<?php esc_attr_e('Upload'); ?>" />
+<?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
</p>
</form>
</td>
</table>
<?php wp_nonce_field('custom-background'); ?>
-<p class="submit"><input type="submit" class="button-primary" name="save-background-options" value="<?php esc_attr_e('Save Changes'); ?>" /></p>
+<?php submit_button( null, 'primary', 'save-background-options' ); ?>
</form>
</div>
}
/**
- * Handle a Image upload for the background image.
+ * Handle an Image upload for the background image.
*
* @since 3.0.0
*/
<?php } ?>
</td>
</tr>
-
+<?php if ( current_theme_supports( 'custom-header-uploads' ) ) : ?>
<tr valign="top">
<th scope="row"><?php _e( 'Upload Image' ); ?></th>
<td>
<input type="file" id="upload" name="import" />
<input type="hidden" name="action" value="save" />
<?php wp_nonce_field( 'custom-header-upload', '_wpnonce-custom-header-upload' ) ?>
- <input type="submit" class="button" value="<?php esc_attr_e( 'Upload' ); ?>" />
+ <?php submit_button( __( 'Upload' ), 'button', 'submit', false ); ?>
</p>
</form>
</td>
</tr>
+<?php endif; ?>
</tbody>
</table>
<tr valign="top">
<th scope="row"><?php _e( 'Default Images' ); ?></th>
<td>
+<?php if ( current_theme_supports( 'custom-header-uploads' ) ) : ?>
<p><?php _e( 'If you don‘t want to upload your own image, you can use one of these cool headers.' ) ?></p>
+<?php else: ?>
+ <p><?php _e( 'You can use one of these cool headers.' ) ?>
+<?php endif; ?>
<?php
$this->show_default_header_selector();
?>
<th scope="row"><?php _e( 'Remove Image' ); ?></th>
<td>
<p><?php _e( 'This will remove the header image. You will not be able to restore any customizations.' ) ?></p>
- <input type="submit" class="button" name="removeheader" value="<?php esc_attr_e( 'Remove Header Image' ); ?>" />
+ <?php submit_button( __( 'Remove Header Image' ), 'button', 'removeheader', false ); ?>
</td>
</tr>
<?php endif;
<th scope="row"><?php _e( 'Reset Image' ); ?></th>
<td>
<p><?php _e( 'This will restore the original header image. You will not be able to restore any customizations.' ) ?></p>
- <input type="submit" class="button" name="resetheader" value="<?php esc_attr_e( 'Restore Original Header Image' ); ?>" />
+ <?php submit_button( __( 'Restore Original Header Image' ), 'button', 'resetheader', false ); ?>
</td>
</tr>
<?php endif; ?>
<th scope="row"><?php _e('Reset Text Color'); ?></th>
<td>
<p><?php _e( 'This will restore the original header text. You will not be able to restore any customizations.' ) ?></p>
- <input type="submit" class="button" name="resettext" value="<?php esc_attr_e( 'Restore Original Header Text' ); ?>" />
+ <?php submit_button( __( 'Restore Original Header Text' ), 'button', 'resettext', false ); ?>
</td>
</tr>
<?php } ?>
</table>
<?php endif;
+do_action( 'custom_header_options' );
+
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
-<p class="submit"><input type="submit" class="button-primary" name="save-header-options" value="<?php esc_attr_e( 'Save Changes' ); ?>" /></p>
+
+<?php submit_button( null, 'primary', 'save-header-options' ); ?>
</form>
</div>
*/
function step_2() {
check_admin_referer('custom-header-upload', '_wpnonce-custom-header-upload');
+ if ( ! current_theme_supports( 'custom-header-uploads' ) )
+ wp_die( 'Cheatin’ uh?' );
+
$overrides = array('test_form' => false);
$file = wp_handle_upload($_FILES['import'], $overrides);
<img src="<?php echo esc_url( $url ); ?>" id="upload" width="<?php echo $width; ?>" height="<?php echo $height; ?>" />
</div>
- <p class="submit">
<input type="hidden" name="x1" id="x1" value="0"/>
<input type="hidden" name="y1" id="y1" value="0"/>
<input type="hidden" name="width" id="width" value="<?php echo esc_attr( $width ); ?>"/>
<input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo esc_attr( $id ); ?>" />
<input type="hidden" name="oitar" id="oitar" value="<?php echo esc_attr( $oitar ); ?>" />
<?php wp_nonce_field( 'custom-header-crop-image' ) ?>
- <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Crop and Publish' ); ?>" />
+
+ <?php submit_button( __( 'Crop and Publish' ) ); ?>
</p>
</form>
</div>
*/
function step_3() {
check_admin_referer('custom-header-crop-image');
+ if ( ! current_theme_supports( 'custom-header-uploads' ) )
+ wp_die( 'Cheatin’ uh?' );
+
if ( $_POST['oitar'] > 1 ) {
$_POST['x1'] = $_POST['x1'] * $_POST['oitar'];
$_POST['y1'] = $_POST['y1'] * $_POST['oitar'];
+++ /dev/null
-<?php
-/**
- * Edit attachments table for inclusion in administration panels.
- *
- * @package WordPress
- * @subpackage Administration
- */
-
-// don't load directly
-if ( !defined('ABSPATH') )
- die('-1');
-
-if ( have_posts() ) { ?>
-<table class="widefat fixed" cellspacing="0">
- <thead>
- <tr>
-<?php print_column_headers('upload'); ?>
- </tr>
- </thead>
-
- <tfoot>
- <tr>
-<?php print_column_headers('upload', false); ?>
- </tr>
- </tfoot>
-
- <tbody id="the-list" class="list:post">
-<?php
-add_filter('the_title','esc_html');
-$alt = '';
-$posts_columns = get_column_headers('upload');
-$hidden = get_hidden_columns('upload');
-
-while ( have_posts() ) : the_post();
-
-if ( $is_trash && $post->post_status != 'trash' )
- continue;
-elseif ( !$is_trash && $post->post_status == 'trash' )
- continue;
-
-$alt = ( 'alternate' == $alt ) ? '' : 'alternate';
-
-$post_owner = ( get_current_user_id() == $post->post_author ? 'self' : 'other' );
-$att_title = _draft_or_post_title();
-?>
- <tr id='post-<?php echo $id; ?>' class='<?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
-
-<?php
-foreach ($posts_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':
- ?>
- <th scope="row" class="check-column"><?php if ( current_user_can('edit_post', $post->ID) ) { ?><input type="checkbox" name="media[]" value="<?php the_ID(); ?>" /><?php } ?></th>
- <?php
- break;
-
- case 'icon':
- $attributes = 'class="column-icon media-icon"' . $style;
- ?>
- <td <?php echo $attributes ?>><?php
- if ( $thumb = wp_get_attachment_image( $post->ID, array(80, 60), true ) ) {
- if ( $is_trash ) echo $thumb;
- else {
-?>
- <a href="<?php echo get_edit_post_link( $post->ID, true ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>">
- <?php echo $thumb; ?>
- </a>
-
-<?php }
- }
- ?></td>
- <?php
- // TODO
- break;
-
- case 'media':
- ?>
- <td <?php echo $attributes ?>><strong><?php if ( $is_trash ) echo $att_title; else { ?><a href="<?php echo get_edit_post_link( $post->ID, true ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $att_title; ?></a><?php } ?></strong>
- <p>
- <?php
- if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) )
- echo esc_html( strtoupper( $matches[1] ) );
- else
- echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) );
- ?>
- </p>
- <?php
- $actions = array();
- if ( current_user_can('edit_post', $post->ID) && !$is_trash )
- $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
- if ( current_user_can('delete_post', $post->ID) ) {
- if ( $is_trash )
- $actions['untrash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=untrash&post=$post->ID", 'untrash-attachment_' . $post->ID) . "'>" . __('Restore') . "</a>";
- elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH )
- $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-attachment_' . $post->ID) . "'>" . __('Trash') . "</a>";
- if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) {
- $delete_ays = (!$is_trash && !MEDIA_TRASH) ? " onclick='return showNotice.warn();'" : '';
- $actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-attachment_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
- }
- }
- if ( !$is_trash ) {
- $title =_draft_or_post_title($post->post_parent);
- $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
- }
- $actions = apply_filters( 'media_row_actions', $actions, $post );
- $action_count = count($actions);
- $i = 0;
- echo '<div class="row-actions">';
- foreach ( $actions as $action => $link ) {
- ++$i;
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
- echo "<span class='$action'>$link$sep</span>";
- }
- echo '</div>';
- ?></td>
- <?php
- break;
-
- case 'author':
- ?>
- <td <?php echo $attributes ?>><?php the_author() ?></td>
- <?php
- break;
-
- case 'tags':
- ?>
- <td <?php echo $attributes ?>><?php
- $tags = get_the_tags();
- if ( !empty( $tags ) ) {
- $out = array();
- foreach ( $tags as $c )
- $out[] = "<a href='edit.php?tag=$c->slug'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . "</a>";
- echo join( ', ', $out );
- } else {
- _e('No Tags');
- }
- ?></td>
- <?php
- break;
-
- case 'desc':
- ?>
- <td <?php echo $attributes ?>><?php echo has_excerpt() ? $post->post_excerpt : ''; ?></td>
- <?php
- break;
-
- case 'date':
- if ( '0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name ) {
- $t_time = $h_time = __('Unpublished');
- } else {
- $t_time = get_the_time(__('Y/m/d g:i:s A'));
- $m_time = $post->post_date;
- $time = get_post_time( 'G', true, $post, false );
- if ( ( abs($t_diff = time() - $time) ) < 86400 ) {
- if ( $t_diff < 0 )
- $h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
- else
- $h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
- } else {
- $h_time = mysql2date(__('Y/m/d'), $m_time);
- }
- }
- ?>
- <td <?php echo $attributes ?>><?php echo $h_time ?></td>
- <?php
- break;
-
- case 'parent':
- if ( $post->post_parent > 0 ) {
- if ( get_post($post->post_parent) ) {
- $title =_draft_or_post_title($post->post_parent);
- }
- ?>
- <td <?php echo $attributes ?>><strong><a href="<?php echo get_edit_post_link( $post->post_parent ); ?>"><?php echo $title ?></a></strong>, <?php echo get_the_time(__('Y/m/d')); ?></td>
- <?php
- } else {
- ?>
- <td <?php echo $attributes ?>><?php _e('(Unattached)'); ?><br />
- <a class="hide-if-no-js" onclick="findPosts.open('media[]','<?php echo $post->ID ?>');return false;" href="#the-list"><?php _e('Attach'); ?></a></td>
- <?php
- }
-
- break;
-
- case 'comments':
- $attributes = 'class="comments column-comments num"' . $style;
- ?>
- <td <?php echo $attributes ?>><div class="post-com-count-wrapper">
- <?php
- $left = get_pending_comments_num( $post->ID );
- $pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
- if ( $left )
- echo '<strong>';
- comments_number("<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . '</span></a>');
- if ( $left )
- echo '</strong>';
- ?>
- </div></td>
- <?php
- break;
-
- case 'actions':
- ?>
- <td <?php echo $attributes ?>>
- <a href="media.php?action=edit&attachment_id=<?php the_ID(); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php _e('Edit'); ?></a> |
- <a href="<?php the_permalink(); ?>"><?php _e('Get permalink'); ?></a>
- </td>
- <?php
- break;
-
- default:
- ?>
- <td <?php echo $attributes ?>><?php do_action('manage_media_custom_column', $column_name, $id); ?></td>
- <?php
- break;
- }
-}
-?>
- </tr>
-<?php endwhile; ?>
- </tbody>
-</table>
-<?php } else { ?>
-
-<p><?php _e('No media attachments found.') ?></p>
-
-<?php
-} // end if ( have_posts() )
-?>
-
/** WordPress Administration Bootstrap */
require_once('./admin.php');
-
if ( !current_user_can('edit_posts') )
wp_die(__('Cheatin’ uh?'));
-wp_enqueue_script('admin-comments');
-enqueue_comment_hotkeys_js();
+$wp_list_table = _get_list_table('WP_Comments_List_Table');
+$pagenum = $wp_list_table->get_pagenum();
-$post_id = isset($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
+$doaction = $wp_list_table->current_action();
-if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2']) ) {
- check_admin_referer('bulk-comments');
+if ( $doaction ) {
+ check_admin_referer( 'bulk-comments' );
- if ( (isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2'])) && !empty($_REQUEST['pagegen_timestamp']) ) {
- $comment_status = $wpdb->escape($_REQUEST['comment_status']);
- $delete_time = $wpdb->escape($_REQUEST['pagegen_timestamp']);
+ if ( 'delete_all' == $doaction && !empty( $_REQUEST['pagegen_timestamp'] ) ) {
+ $comment_status = $wpdb->escape( $_REQUEST['comment_status'] );
+ $delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] );
$comment_ids = $wpdb->get_col( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = '$comment_status' AND '$delete_time' > comment_date_gmt" );
$doaction = 'delete';
- } elseif ( ($_REQUEST['action'] != -1 || $_REQUEST['action2'] != -1) && isset($_REQUEST['delete_comments']) ) {
+ } elseif ( isset( $_REQUEST['delete_comments'] ) ) {
$comment_ids = $_REQUEST['delete_comments'];
- $doaction = ($_REQUEST['action'] != -1) ? $_REQUEST['action'] : $_REQUEST['action2'];
- } elseif ( $_REQUEST['doaction'] == 'undo' && isset($_REQUEST['ids']) ) {
- $comment_ids = array_map( 'absint', explode(',', $_REQUEST['ids']) );
- $doaction = $_REQUEST['action'];
- } else {
+ $doaction = ( $_REQUEST['action'] != -1 ) ? $_REQUEST['action'] : $_REQUEST['action2'];
+ } elseif ( isset( $_REQUEST['ids'] ) ) {
+ $comment_ids = array_map( 'absint', explode( ',', $_REQUEST['ids'] ) );
+ } elseif ( wp_get_referer() ) {
wp_redirect( wp_get_referer() );
+ exit;
}
$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) );
+ $redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids' ), wp_get_referer() );
+ $redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to );
- if ( !current_user_can('edit_post', $_post_id) )
+ foreach ( $comment_ids as $comment_id ) { // Check the permissions on each
+ if ( !current_user_can( 'edit_comment', $comment_id ) )
continue;
- switch( $doaction ) {
+ switch ( $doaction ) {
case 'approve' :
- wp_set_comment_status($comment_id, 'approve');
+ wp_set_comment_status( $comment_id, 'approve' );
$approved++;
break;
case 'unapprove' :
- wp_set_comment_status($comment_id, 'hold');
+ wp_set_comment_status( $comment_id, 'hold' );
$unapproved++;
break;
case 'spam' :
- wp_spam_comment($comment_id);
+ wp_spam_comment( $comment_id );
$spammed++;
break;
case 'unspam' :
- wp_unspam_comment($comment_id);
+ wp_unspam_comment( $comment_id );
$unspammed++;
break;
case 'trash' :
- wp_trash_comment($comment_id);
+ wp_trash_comment( $comment_id );
$trashed++;
break;
case 'untrash' :
- wp_untrash_comment($comment_id);
+ wp_untrash_comment( $comment_id );
$untrashed++;
break;
case 'delete' :
- wp_delete_comment($comment_id);
+ wp_delete_comment( $comment_id );
$deleted++;
break;
}
if ( $deleted )
$redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );
if ( $trashed || $spammed )
- $redirect_to = add_query_arg( 'ids', join(',', $comment_ids), $redirect_to );
+ $redirect_to = add_query_arg( 'ids', join( ',', $comment_ids ), $redirect_to );
wp_redirect( $redirect_to );
exit;
-} elseif ( ! empty($_GET['_wp_http_referer']) ) {
- wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
+} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
+ wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
exit;
}
+$wp_list_table->prepare_items();
+
+$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
+}
+
+wp_enqueue_script('admin-comments');
+enqueue_comment_hotkeys_js();
+
if ( $post_id )
$title = sprintf(__('Comments on “%s”'), wp_html_excerpt(_draft_or_post_title($post_id), 50));
else
$title = __('Comments');
-add_contextual_help( $current_screen, '<p>' . __('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.') . '</p>' .
- '<p>' . __('A yellow row means the comment is waiting for you to moderate it.') . '</p>' .
- '<p>' . __('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.') . '</p>' .
- '<p>' . __('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.') . '</p>' .
- '<p>' . __('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.') . '</p>' .
- '<p>' . __('Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link below to learn more.') . '</p>' .
+add_screen_option( 'per_page', array('label' => _x( 'Comments', 'comments per page (screen options)' )) );
+
+add_contextual_help( $current_screen, '<p>' . __( '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.' ) . '</p>' .
+ '<p>' . __( 'A yellow row means the comment is waiting for you to moderate it.' ) . '</p>' .
+ '<p>' . __( '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.' ) . '</p>' .
+ '<p>' . __( '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.' ) . '</p>' .
+ '<p>' . __( '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.' ) . '</p>' .
+ '<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link below to learn more.' ) . '</p>' .
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
- '<p>' . __( '<a href="http://codex.wordpress.org/Administration_Panels#Comments" target="_blank">Comments Documentation</a>' ) . '</p>' .
- '<p>' . __( '<a href="http://codex.wordpress.org/Comment_Spam" target="_blank">Comment Spam Documentation</a>') . '</p>' .
- '<p>' . __( '<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">Keyboard Shortcuts Documentation</a>') . '</p>' .
- '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+ '<p>' . __( '<a href="http://codex.wordpress.org/Administration_Panels#Comments" target="_blank">Documentation on Comments</a>' ) . '</p>' .
+ '<p>' . __( '<a href="http://codex.wordpress.org/Comment_Spam" target="_blank">Documentation on Comment Spam</a>' ) . '</p>' .
+ '<p>' . __( '<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">Documentation on Keyboard Shortcuts</a>' ) . '</p>' .
+ '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
);
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')) )
- $comment_status = 'all';
-
-$comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : '';
-
-$search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : '';
-$search = esc_attr( $search_dirty ); ?>
+?>
<div class="wrap">
<?php screen_icon(); ?>
-<h2><?php echo esc_html( $title );
-if ( isset($_GET['s']) && $_GET['s'] )
- printf( '<span class="subtitle">' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( stripslashes( $_GET['s'] ) ), 50 ) ) . '</span>' ); ?>
+<h2><?php
+if ( $post_id )
+ echo sprintf(__('Comments on “%s”'),
+ sprintf('<a href="%s">%s</a>',
+ get_edit_post_link($post_id),
+ wp_html_excerpt(_draft_or_post_title($post_id), 50)
+ )
+ );
+else
+ echo __('Comments');
+
+if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
+ printf( '<span class="subtitle">' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ) . '</span>' ); ?>
</h2>
<?php
-if ( isset( $_GET['error'] ) ) {
- $error = (int) $_GET['error'];
+if ( isset( $_REQUEST['error'] ) ) {
+ $error = (int) $_REQUEST['error'];
$error_msg = '';
switch ( $error ) {
case 1 :
echo '<div id="moderated" class="error"><p>' . $error_msg . '</p></div>';
}
-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 ( isset($_REQUEST['approved']) || isset($_REQUEST['deleted']) || isset($_REQUEST['trashed']) || isset($_REQUEST['untrashed']) || isset($_REQUEST['spammed']) || isset($_REQUEST['unspammed']) || isset($_REQUEST['same']) ) {
+ $approved = isset( $_REQUEST['approved'] ) ? (int) $_REQUEST['approved'] : 0;
+ $deleted = isset( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0;
+ $trashed = isset( $_REQUEST['trashed'] ) ? (int) $_REQUEST['trashed'] : 0;
+ $untrashed = isset( $_REQUEST['untrashed'] ) ? (int) $_REQUEST['untrashed'] : 0;
+ $spammed = isset( $_REQUEST['spammed'] ) ? (int) $_REQUEST['spammed'] : 0;
+ $unspammed = isset( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0;
+ $same = isset( $_REQUEST['same'] ) ? (int) $_REQUEST['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 ) {
- $ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
+ $ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
$messages[] = sprintf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
}
$messages[] = sprintf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed );
if ( $trashed > 0 ) {
- $ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
+ $ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
$messages[] = sprintf( _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), $trashed ) . ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
}
}
?>
-<form id="comments-form" action="" method="get">
-<ul class="subsubsub">
-<?php
-$status_links = array();
-$num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments();
-//, number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"),
-//, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>")
-$stati = array(
- 'all' => _nx_noop('All', 'All', 'comments'), // singular not used
- 'moderated' => _n_noop('Pending <span class="count">(<span class="pending-count">%s</span>)</span>', 'Pending <span class="count">(<span class="pending-count">%s</span>)</span>'),
- 'approved' => _n_noop('Approved', 'Approved'), // singular not used
- 'spam' => _n_noop('Spam <span class="count">(<span class="spam-count">%s</span>)</span>', 'Spam <span class="count">(<span class="spam-count">%s</span>)</span>'),
- 'trash' => _n_noop('Trash <span class="count">(<span class="trash-count">%s</span>)</span>', 'Trash <span class="count">(<span class="trash-count">%s</span>)</span>')
- );
+<?php $wp_list_table->views(); ?>
-if ( !EMPTY_TRASH_DAYS )
- unset($stati['trash']);
-
-$link = 'edit-comments.php';
-if ( !empty($comment_type) && 'all' != $comment_type )
- $link = add_query_arg( 'comment_type', $comment_type, $link );
-
-foreach ( $stati as $status => $label ) {
- $class = ( $status == $comment_status ) ? ' class="current"' : '';
-
- if ( !isset( $num_comments->$status ) )
- $num_comments->$status = 10;
- $link = add_query_arg( 'comment_status', $status, $link );
- if ( $post_id )
- $link = add_query_arg( 'p', absint( $post_id ), $link );
- /*
- // I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
- if ( !empty( $_GET['s'] ) )
- $link = add_query_arg( 's', esc_attr( stripslashes( $_GET['s'] ) ), $link );
- */
- if ( isset( $label[2] ) )
- $translated_label = _nx( $label[0], $label[1], $num_comments->$status, $label[2] );
- else
- $translated_label = _n( $label[0], $label[1], $num_comments->$status );
- $status_links[] = "<li class='$status'><a href='$link'$class>" . sprintf(
- $translated_label,
- number_format_i18n( $num_comments->$status )
- ) . '</a>';
-}
-
-$status_links = apply_filters( 'comment_status_links', $status_links );
-
-echo implode( " |</li>\n", $status_links) . '</li>';
-unset($status_links);
-?>
-</ul>
-
-<p class="search-box">
- <label class="screen-reader-text" for="comment-search-input"><?php _e( 'Search Comments' ); ?>:</label>
- <input type="text" id="comment-search-input" name="s" value="<?php _admin_search_query(); ?>" />
- <input type="submit" value="<?php esc_attr_e( 'Search Comments' ); ?>" class="button" />
-</p>
-
-<?php
-$comments_per_page = (int) get_user_option( 'edit_comments_per_page' );
-if ( empty( $comments_per_page ) || $comments_per_page < 1 )
- $comments_per_page = 20;
-$comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
-
-if ( isset( $_GET['apage'] ) )
- $page = abs( (int) $_GET['apage'] );
-else
- $page = 1;
-
-$start = $offset = ( $page - 1 ) * $comments_per_page;
-
-list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 8, $post_id, $comment_type ); // Grab a few extra
-
-$_comment_post_ids = array();
-foreach ( $_comments as $_c ) {
- $_comment_post_ids[] = $_c->comment_post_ID;
-}
-
-$_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);
+<form id="comments-form" action="" method="get">
-$page_links = paginate_links( array(
- 'base' => add_query_arg( 'apage', '%#%' ),
- 'format' => '',
- 'prev_text' => __('«'),
- 'next_text' => __('»'),
- 'total' => ceil($total / $comments_per_page),
- 'current' => $page
-));
+<?php $wp_list_table->search_box( __( 'Search Comments' ), 'comment' ); ?>
-?>
-
-<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
<?php if ( $post_id ) : ?>
<input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />
<?php endif; ?>
<input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr(current_time('mysql', 1)); ?>" />
-<div class="tablenav">
-
-<?php if ( $page_links ) : ?>
-<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
- number_format_i18n( $start + 1 ),
- number_format_i18n( min( $page * $comments_per_page, $total ) ),
- '<span class="total-type-count">' . number_format_i18n( $total ) . '</span>',
- $page_links
-); echo $page_links_text; ?></div>
-<input type="hidden" name="_total" value="<?php echo esc_attr($total); ?>" />
-<input type="hidden" name="_per_page" value="<?php echo esc_attr($comments_per_page); ?>" />
-<input type="hidden" name="_page" value="<?php echo esc_attr($page); ?>" />
-<?php endif; ?>
-
-<?php if ( $comments ) : ?>
-<div class="alignleft actions">
-<select name="action">
-<option value="-1" selected="selected"><?php _e('Bulk Actions') ?></option>
-<?php if ( 'all' == $comment_status || 'approved' == $comment_status ): ?>
-<option value="unapprove"><?php _e('Unapprove'); ?></option>
-<?php endif; ?>
-<?php if ( 'all' == $comment_status || 'moderated' == $comment_status || 'spam' == $comment_status ): ?>
-<option value="approve"><?php _e('Approve'); ?></option>
-<?php endif; ?>
-<?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?>
-<option value="spam"><?php _ex('Mark as Spam', 'comment'); ?></option>
-<?php endif; ?>
-<?php if ( 'trash' == $comment_status ): ?>
-<option value="untrash"><?php _e('Restore'); ?></option>
-<?php elseif ( 'spam' == $comment_status ): ?>
-<option value="unspam"><?php _ex('Not Spam', 'comment'); ?></option>
-<?php endif; ?>
-<?php if ( 'trash' == $comment_status || 'spam' == $comment_status || !EMPTY_TRASH_DAYS ): ?>
-<option value="delete"><?php _e('Delete Permanently'); ?></option>
-<?php else: ?>
-<option value="trash"><?php _e('Move to Trash'); ?></option>
-<?php endif; ?>
-</select>
-<input type="submit" name="doaction" id="doaction" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary apply" />
-<?php wp_nonce_field('bulk-comments'); ?>
-
-<?php endif; ?>
-
-<select name="comment_type">
- <option value="all"><?php _e('Show all comment types'); ?></option>
-<?php
- $comment_types = apply_filters( 'admin_comment_types_dropdown', array(
- 'comment' => __('Comments'),
- 'pings' => __('Pings'),
- ) );
-
- foreach ( $comment_types as $type => $label ) {
- echo " <option value='" . esc_attr($type) . "'";
- selected( $comment_type, $type );
- echo ">$label</option>\n";
- }
-?>
-</select>
-<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
-
-<?php if ( isset($_GET['apage']) ) { ?>
- <input type="hidden" name="apage" value="<?php echo esc_attr( absint( $_GET['apage'] ) ); ?>" />
-<?php }
-
-if ( ( 'spam' == $comment_status || 'trash' == $comment_status) && current_user_can ('moderate_comments') ) {
- wp_nonce_field('bulk-destroy', '_destroy_nonce');
- if ( 'spam' == $comment_status && current_user_can('moderate_comments') ) { ?>
- <input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
-<?php } elseif ( 'trash' == $comment_status && current_user_can('moderate_comments') ) { ?>
- <input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
-<?php }
-} ?>
-<?php do_action('manage_comments_nav', $comment_status); ?>
-</div>
-
-<br class="clear" />
+<input type="hidden" name="_total" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('total_items') ); ?>" />
+<input type="hidden" name="_per_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('per_page') ); ?>" />
+<input type="hidden" name="_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg('page') ); ?>" />
-</div>
-
-<div class="clear"></div>
-<?php if ( $comments ) { ?>
-
-<table class="widefat comments fixed" cellspacing="0">
-<thead>
- <tr>
-<?php print_column_headers('edit-comments'); ?>
- </tr>
-</thead>
-
-<tfoot>
- <tr>
-<?php print_column_headers('edit-comments', false); ?>
- </tr>
-</tfoot>
-
-<tbody id="the-comment-list" class="list:comment">
-<?php
- foreach ($comments as $comment)
- _wp_comment_row( $comment->comment_ID, $mode, $comment_status );
-?>
-</tbody>
-<tbody id="the-extra-comment-list" class="list:comment" style="display: none;">
-<?php
- foreach ($extra_comments as $comment)
- _wp_comment_row( $comment->comment_ID, $mode, $comment_status );
-?>
-</tbody>
-</table>
-
-<div class="tablenav">
-<?php
-if ( $page_links )
- echo "<div class='tablenav-pages'>$page_links_text</div>";
-?>
-
-<div class="alignleft actions">
-<select name="action2">
-<option value="-1" selected="selected"><?php _e('Bulk Actions') ?></option>
-<?php if ( 'all' == $comment_status || 'approved' == $comment_status ): ?>
-<option value="unapprove"><?php _e('Unapprove'); ?></option>
-<?php endif; ?>
-<?php if ( 'all' == $comment_status || 'moderated' == $comment_status || 'spam' == $comment_status ): ?>
-<option value="approve"><?php _e('Approve'); ?></option>
-<?php endif; ?>
-<?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?>
-<option value="spam"><?php _ex('Mark as Spam', 'comment'); ?></option>
-<?php endif; ?>
-<?php if ( 'trash' == $comment_status ): ?>
-<option value="untrash"><?php _e('Restore'); ?></option>
-<?php endif; ?>
-<?php if ( 'trash' == $comment_status || 'spam' == $comment_status || !EMPTY_TRASH_DAYS ): ?>
-<option value="delete"><?php _e('Delete Permanently'); ?></option>
-<?php elseif ( 'spam' == $comment_status ): ?>
-<option value="unspam"><?php _ex('Not Spam', 'comment'); ?></option>
-<?php else: ?>
-<option value="trash"><?php _e('Move to Trash'); ?></option>
-<?php endif; ?>
-</select>
-<input type="submit" name="doaction2" id="doaction2" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary apply" />
-
-<?php if ( 'spam' == $comment_status && current_user_can('moderate_comments') ) { ?>
-<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
-<?php } elseif ( 'trash' == $comment_status && current_user_can('moderate_comments') ) { ?>
-<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
+<?php if ( isset($_REQUEST['paged']) ) { ?>
+ <input type="hidden" name="paged" value="<?php echo esc_attr( absint( $_REQUEST['paged'] ) ); ?>" />
<?php } ?>
-<?php do_action('manage_comments_nav', $comment_status); ?>
-</div>
-
-<br class="clear" />
-</div>
-
-</form>
-<form id="get-extra-comments" method="post" action="" class="add:the-extra-comment-list:" style="display: none;">
- <input type="hidden" name="s" value="<?php echo esc_attr($search); ?>" />
- <input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
- <input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
- <input type="hidden" name="page" value="<?php echo esc_attr($page); ?>" />
- <input type="hidden" name="per_page" value="<?php echo esc_attr($comments_per_page); ?>" />
- <input type="hidden" name="p" value="<?php echo esc_attr( $post_id ); ?>" />
- <input type="hidden" name="comment_type" value="<?php echo esc_attr( $comment_type ); ?>" />
- <?php wp_nonce_field( 'add-comment', '_ajax_nonce', false ); ?>
+<?php $wp_list_table->display(); ?>
</form>
-
-<div id="ajax-response"></div>
-
-<?php } elseif ( 'moderated' == $comment_status ) { ?>
-<p><?php _e('No comments awaiting moderation… yet.') ?></p>
</div>
-</form>
-<?php } else { ?>
-<p><?php _e('No comments found.') ?></p>
-</div>
-</form>
-
-<?php } ?>
-</div>
+<div id="ajax-response"></div>
<?php
wp_comment_reply('-1', true, 'detail');
add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', $post_type, 'side', 'core');
+if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) )
+ add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', $post_type, 'side', 'core' );
+
// all taxonomies
foreach ( get_object_taxonomies($post_type) as $tax_name ) {
$taxonomy = get_taxonomy($tax_name);
add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', $post_type, 'normal', 'core');
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() )
+ if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) )
add_meta_box('authordiv', __('Author'), 'post_author_meta_box', $post_type, 'normal', 'core');
}
do_action('do_meta_boxes', $post_type, 'advanced', $post);
do_action('do_meta_boxes', $post_type, 'side', $post);
+add_screen_option('layout_columns', array('max' => 2) );
+
if ( 'post' == $post_type ) {
add_contextual_help($current_screen,
- '<p>' . __('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.') . '</p>' .
+ '<p>' . __('The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of the box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.') . '</p>' .
'<p>' . __('<strong>Title</strong> - Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '</p>' .
- '<p>' . __('<strong>Post editor</strong> - 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.') . '</p>' .
+ '<p>' . __('<strong>Post editor</strong> - 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 screen icon just before that allows you to expand the edit box to full screen. 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.') . '</p>' .
'<p>' . __('<strong>Publish</strong> - 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.') . '</p>' .
+ ( ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) ? '<p>' . __( '<strong>Post Format</strong> - This designates how your theme will display a specific post. For example, you could have a <em>standard</em> blog post with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="http://codex.wordpress.org/Post_Formats#Supported_Formats">descriptions of each post format</a>.' ) . '</p>' : '' ) .
'<p>' . __('<strong>Featured Image</strong> - 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.') . '</p>' .
'<p>' . __('<strong>Send Trackbacks</strong> - 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.') . '</p>' .
'<p>' . __('<strong>Discussion</strong> - 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.') . '</p>' .
'<p>' . sprintf(__('You can also create posts with the <a href="%s">Press This bookmarklet</a>.'), 'options-writing.php') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Writing_Posts" target="_blank">Documentation on Writing Posts</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Posts_Add_New_SubPanel" target="_blank">Documentation on Writing and Editing Posts</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
} elseif ( 'page' == $post_type ) {
'<p>' . __('<strong>Template</strong> - 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.') . '</p>' .
'<p>' . __('<strong>Order</strong> - Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Pages_Add_New_SubPanel" target="_blank">Page Creation Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Pages_Add_New_SubPanel" target="_blank">Documentation on Adding New Pages</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Pages_Pages_SubPanel#Editing_Individual_Pages" target="_blank">Documentation on Editing Pages</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
}
<?php endif; ?>
<form name="post" action="post.php" method="post" id="post"<?php do_action('post_edit_form_tag'); ?>>
<?php wp_nonce_field($nonce_action); ?>
+<input type="hidden" name="parent_id" value="<?php echo esc_attr( $post->post_parent ); ?>" />
<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
-<input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr($form_action) ?>" />
-<input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr($form_action) ?>" />
+<input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ) ?>" />
+<input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr( $form_action ) ?>" />
<input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
-<input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr($post_type) ?>" />
-<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr($post->post_status) ?>" />
+<input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post_type ) ?>" />
+<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status) ?>" />
<input type="hidden" id="referredby" name="referredby" value="<?php echo esc_url(stripslashes(wp_get_referer())); ?>" />
<?php
if ( 'draft' != $post->post_status )
<?php if ( post_type_supports($post_type, 'title') ) { ?>
<div id="titlediv">
<div id="titlewrap">
- <label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title"><?php _e('Enter title here') ?></label>
+ <label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
</div>
<div class="inside">
<?php
-$sample_permalink_html = get_sample_permalink_html($post->ID);
+$sample_permalink_html = ! empty( $post_type_object->publicly_queryable ) ? get_sample_permalink_html($post->ID) : '';
$shortlink = wp_get_shortlink($post->ID, 'post');
if ( !empty($shortlink) )
$sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';
-if ( !( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>
+if ( ! empty( $post_type_object->publicly_queryable ) && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>
<div id="edit-slug-box">
<?php
if ( ! empty($post->ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status )
<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=" . ( !EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?>
</div>
<div id="publishing-action">
-<input type="submit" name="save" value="<?php esc_attr_e('Update Comment'); ?>" tabindex="4" class="button-primary" />
+<?php submit_button( __( 'Update Comment' ), 'primary', 'save', false, array( 'tabindex' => '4' ) ); ?>
</div>
<div class="clear"></div>
</div>
+++ /dev/null
-<?php
-/**
- * Edit Link Categories Administration Panel.
- *
- * @package WordPress
- * @subpackage Administration
- */
-
-/** WordPress Administration Bootstrap */
-require_once('./admin.php');
-
-// Handle bulk actions
-if ( isset($_GET['action']) && isset($_GET['delete']) ) {
- check_admin_referer('bulk-link-categories');
- $doaction = $_GET['action'] ? $_GET['action'] : $_GET['action2'];
-
- if ( !current_user_can('manage_categories') )
- wp_die(__('Cheatin’ uh?'));
-
- if ( 'delete' == $doaction ) {
- $cats = (array) $_GET['delete'];
- $default_cat_id = get_option('default_link_category');
-
- foreach( $cats as $cat_ID ) {
- $cat_ID = (int) $cat_ID;
- // Don't delete the default cats.
- if ( $cat_ID == $default_cat_id )
- wp_die( sprintf( __("Can’t delete the <strong>%s</strong> category: this is the default one"), get_term_field('name', $cat_ID, 'link_category') ) );
-
- wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
- }
-
- $location = 'edit-link-categories.php';
- if ( $referer = wp_get_referer() ) {
- if ( false !== strpos($referer, 'edit-link-categories.php') )
- $location = $referer;
- }
-
- $location = add_query_arg('message', 6, $location);
- wp_redirect($location);
- exit();
- }
-} elseif ( ! empty($_GET['_wp_http_referer']) ) {
- wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
- exit;
-}
-
-$title = __('Link Categories');
-
-wp_enqueue_script('admin-categories');
-if ( current_user_can('manage_categories') )
- wp_enqueue_script('inline-edit-tax');
-
-add_contextual_help($current_screen, '<p>' . __('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.') . '</p>' .
- '<p>' . __('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.') . '</p>' .
- '<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Links_Link_Categories_SubPanel" target="_blank">Link Categories Documentation</a>') . '</p>' .
- '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
-);
-
-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.');
-$messages[6] = __('Categories deleted.'); ?>
-
-<div class="wrap nosubsub">
-<?php screen_icon(); ?>
-<h2><?php echo esc_html( $title );
-if ( isset($_GET['s']) && $_GET['s'] )
- printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_GET['s']) ) ); ?>
-</h2>
-
-<?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
-<div id="message" class="updated"><p><?php echo $messages[$msg]; ?></p></div>
-<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
-endif; ?>
-
-<form class="search-form" action="" method="get">
-<p class="search-box">
- <label class="screen-reader-text" for="link-category-search-input"><?php _e( 'Search Categories' ); ?>:</label>
- <input type="text" id="link-category-search-input" name="s" value="<?php _admin_search_query(); ?>" />
- <input type="submit" value="<?php esc_attr_e( 'Search Categories' ); ?>" class="button" />
-</p>
-</form>
-<br class="clear" />
-
-<div id="col-container">
-
-<div id="col-right">
-<div class="col-wrap">
-<form id="posts-filter" action="" method="get">
-<div class="tablenav">
-
-<?php
-$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
-if ( empty($pagenum) )
- $pagenum = 1;
-if ( ! isset( $catsperpage ) || $catsperpage < 0 )
- $catsperpage = 20;
-
-$page_links = paginate_links( array(
- 'base' => add_query_arg( 'pagenum', '%#%' ),
- 'format' => '',
- 'prev_text' => __('«'),
- 'next_text' => __('»'),
- 'total' => ceil(wp_count_terms('link_category') / $catsperpage),
- 'current' => $pagenum
-));
-
-if ( $page_links )
- echo "<div class='tablenav-pages'>$page_links</div>";
-?>
-
-<div class="alignleft actions">
-<select name="action">
-<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
-<?php wp_nonce_field('bulk-link-categories'); ?>
-</div>
-
-<br class="clear" />
-</div>
-
-<div class="clear"></div>
-
-<table class="widefat fixed" cellspacing="0">
- <thead>
- <tr>
-<?php print_column_headers('edit-link-categories'); ?>
- </tr>
- </thead>
-
- <tfoot>
- <tr>
-<?php print_column_headers('edit-link-categories', false); ?>
- </tr>
- </tfoot>
-
- <tbody id="the-list" class="list:link-cat">
-<?php
-$start = ($pagenum - 1) * $catsperpage;
-$args = array('offset' => $start, 'number' => $catsperpage, 'hide_empty' => 0);
-if ( !empty( $_GET['s'] ) )
- $args['search'] = $_GET['s'];
-
-$categories = get_terms( 'link_category', $args );
-if ( $categories ) {
- $output = '';
- foreach ( $categories as $category ) {
- $output .= link_cat_row($category);
- }
- echo $output;
- unset($category);
-}
-
-?>
- </tbody>
-</table>
-
-<div class="tablenav">
-<?php
-if ( $page_links )
- echo "<div class='tablenav-pages'>$page_links</div>";
-?>
-
-<div class="alignleft actions">
-<select name="action2">
-<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
-</div>
-
-<br class="clear" />
-</div>
-<br class="clear" />
-</form>
-
-<div class="form-wrap">
-<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the links in that category. Instead, links that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), get_term_field('name', get_option('default_link_category'), 'link_category')) ?></p>
-</div>
-
-
-</div>
-</div><!-- /col-right -->
-
-<div id="col-left">
-<div class="col-wrap">
-
-<?php if ( current_user_can('manage_categories') ) {
- $category = (object) array(); $category->parent = 0; do_action('add_link_category_form_pre', $category); ?>
-
-<div class="form-wrap">
-<h3><?php _e('Add Link Category'); ?></h3>
-<div id="ajax-response"></div>
-<form name="addcat" id="addcat" class="add:the-list: validate" method="post" action="link-category.php">
-<input type="hidden" name="action" value="addcat" />
-<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-link-category'); ?>
-
-<div class="form-field form-required">
- <label for="name"><?php _e('Link Category name') ?></label>
- <input name="name" id="link-name" type="text" value="" size="40" aria-required="true" />
-</div>
-<?php if ( !global_terms_enabled() ) { ?>
-<div class="form-field">
- <label for="slug"><?php _e('Link Category slug') ?></label>
- <input name="slug" id="link-slug" type="text" value="" size="40" />
- <p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
-</div>
-<?php } ?>
-<div class="form-field">
- <label for="description"><?php _e('Description (optional)') ?></label>
- <textarea name="description" id="link-description" rows="5" cols="40"></textarea>
- <p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
-</div>
-
-<p class="submit"><input type="submit" class="button" name="submit" value="<?php esc_attr_e('Add Category'); ?>" /></p>
-<?php do_action('edit_link_category_form', $category); ?>
-</form>
-</div>
-
-<?php } ?>
-
-</div>
-</div><!-- /col-left -->
-
-</div><!-- /col-container -->
-</div><!-- /wrap -->
-
-<?php inline_edit_term_row('edit-link-categories', 'link_category'); ?>
-<?php include('./admin-footer.php'); ?>
+++ /dev/null
-<?php
-/**
- * Edit link category form for inclusion in administration panels.
- *
- * @package WordPress
- * @subpackage Administration
- */
-
-// don't load directly
-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 site.'));
-
-/**
- * @var object
- */
-if ( ! isset( $category ) )
- $category = (object) array();
-
-if ( ! empty($cat_ID) ) {
- /**
- * @var string
- */
- $heading = '<h2>' . __('Edit Link Category') . '</h2>';
- $submit_text = __('Update Category');
- $form = '<form name="editcat" id="editcat" method="post" action="link-category.php" class="validate">';
- $action = 'editedcat';
- $nonce_action = 'update-link-category_' . $cat_ID;
- do_action('edit_link_category_form_pre', $category);
-} else {
- $heading = '<h2>' . __('Add Link Category') . '</h2>';
- $submit_text = __('Add Category');
- $form = '<form name="addcat" id="addcat" class="add:the-list: validate" method="post" action="link-category.php">';
- $action = 'addcat';
- $nonce_action = 'add-link-category';
- do_action('add_link_category_form_pre', $category);
-}
-
-/**
- * @ignore
- * @since 2.7
- * @internal Used to prevent errors in page when no category is being edited.
- *
- * @param object $category
- */
-function _fill_empty_link_category(&$category) {
- if ( ! isset( $category->name ) )
- $category->name = '';
-
- if ( ! isset( $category->slug ) )
- $category->slug = '';
-
- if ( ! isset( $category->description ) )
- $category->description = '';
-}
-
-_fill_empty_link_category($category);
-?>
-
-<div class="wrap">
-<?php screen_icon(); ?>
-<?php echo $heading ?>
-<div id="ajax-response"></div>
-<?php echo $form ?>
-<input type="hidden" name="action" value="<?php echo esc_attr($action) ?>" />
-<input type="hidden" name="cat_ID" value="<?php echo esc_attr($category->term_id) ?>" />
-<?php wp_original_referer_field(true, 'previous'); wp_nonce_field($nonce_action); ?>
- <table class="form-table">
- <tr class="form-field form-required">
- <th scope="row" valign="top"><label for="name"><?php _e('Link Category name') ?></label></th>
- <td><input name="name" id="name" type="text" value="<?php echo esc_attr($category->name); ?>" size="40" aria-required="true" /></td>
- </tr>
-<?php if ( !is_multisite() ) { ?>
- <tr class="form-field">
- <th scope="row" valign="top"><label for="slug"><?php _e('Link Category slug') ?></label></th>
- <td><input name="slug" id="slug" type="text" value="<?php echo esc_attr(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
- <?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
- </tr>
-<?php } ?>
- <tr class="form-field">
- <th scope="row" valign="top"><label for="description"><?php _e('Description (optional)') ?></label></th>
- <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea><br />
- <span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span></td>
- </tr>
- <?php do_action('edit_link_category_form_fields', $category); ?>
- </table>
-<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo esc_attr($submit_text) ?>" /></p>
-<?php do_action('edit_link_category_form', $category); ?>
-</form>
-</div>
do_action('do_meta_boxes', 'link', 'advanced', $link);
do_action('do_meta_boxes', 'link', 'side', $link);
+add_screen_option('layout_columns', array('max' => 2) );
+
add_contextual_help($current_screen,
'<p>' . __( '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.' ) . '</p>' .
'<p>' . __( '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.' ) . '</p>' .
+++ /dev/null
-<?php
-/**
- * Edit posts rows table for inclusion in administration panels.
- *
- * @package WordPress
- * @subpackage Administration
- */
-
-// don't load directly
-if ( !defined('ABSPATH') )
- die('-1');
-?>
-<table class="widefat <?php echo $post_type_object->hierarchical ? 'page' : 'post'; ?> fixed" cellspacing="0">
- <thead>
- <tr>
-<?php print_column_headers( $current_screen ); ?>
- </tr>
- </thead>
-
- <tfoot>
- <tr>
-<?php print_column_headers($current_screen, false); ?>
- </tr>
- </tfoot>
-
- <tbody>
-<?php
-if ( $post_type_object->hierarchical )
- page_rows($posts, $pagenum, $per_page);
-else
- post_rows();
-?>
- </tbody>
-</table>
\ No newline at end of file
return;
}
+// Back compat hooks
if ( 'category' == $taxonomy )
do_action('edit_category_form_pre', $tag );
+elseif ( 'link_category' == $taxonomy )
+ do_action('edit_link_category_form_pre', $tag );
else
do_action('edit_tag_form_pre', $tag);
+
do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>
<div class="wrap">
<tr class="form-field">
<th scope="row" valign="top"><label for="parent"><?php _ex('Parent', 'Taxonomy Parent'); ?></label></th>
<td>
- <?php wp_dropdown_categories(array('hide_empty' => 0, 'hide_if_empty' => false, 'name' => 'parent', 'orderby' => 'name', 'taxonomy' => $taxonomy, 'selected' => $tag->parent, 'exclude' => $tag->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br />
+ <?php wp_dropdown_categories(array('hide_empty' => 0, 'hide_if_empty' => false, 'name' => 'parent', 'orderby' => 'name', 'taxonomy' => $taxonomy, 'selected' => $tag->parent, 'exclude_tree' => $tag->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br />
<?php if ( 'category' == $taxonomy ) : ?>
<span class="description"><?php _e('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.'); ?></span>
<?php endif; ?>
<?php endif; // is_taxonomy_hierarchical() ?>
<tr class="form-field">
<th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?></label></th>
- <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo esc_html($tag->description); ?></textarea><br />
+ <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $tag->description; // textarea_escaped ?></textarea><br />
<span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
</tr>
<?php
+ // Back compat hooks
if ( 'category' == $taxonomy )
do_action('edit_category_form_fields', $tag);
+ if ( 'link_category' == $taxonomy )
+ do_action('edit_link_category_form_fields', $tag);
else
do_action('edit_tag_form_fields', $tag);
+
do_action($taxonomy . '_edit_form_fields', $tag, $taxonomy);
?>
</table>
<?php
+// Back compat hooks
if ( 'category' == $taxonomy )
do_action('edit_category_form', $tag);
+if ( 'link_category' == $taxonomy )
+ do_action('edit_link_category_form', $tag);
else
do_action('edit_tag_form', $tag);
+
do_action($taxonomy . '_edit_form', $tag, $taxonomy);
+
+submit_button( __('Update') );
?>
-<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo esc_attr( __( 'Update' ) ); ?>" /></p>
</form>
</div>
/** WordPress Administration Bootstrap */
require_once('./admin.php');
+$tax = get_taxonomy( $taxnow );
+if ( !current_user_can( $tax->cap->manage_terms ) )
+ wp_die( __( 'Cheatin’ uh?' ) );
-wp_reset_vars( array('action', 'tag', 'taxonomy', 'post_type') );
-
-if ( empty($taxonomy) )
- $taxonomy = 'post_tag';
-
-if ( !taxonomy_exists($taxonomy) )
- wp_die(__('Invalid taxonomy'));
-
-$tax = get_taxonomy($taxonomy);
-
-if ( ! current_user_can($tax->cap->manage_terms) )
- wp_die(__('Cheatin’ uh?'));
+$wp_list_table = _get_list_table('WP_Terms_List_Table');
+$pagenum = $wp_list_table->get_pagenum();
$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 if ( 'link_category' == $tax->name ) {
+ $parent_file = 'link-manager.php';
+ $submenu_file = 'edit-tags.php?taxonomy=link_category';
} 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';
+add_screen_option( 'per_page', array('label' => $title, 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page') );
-switch($action) {
+switch ( $wp_list_table->current_action() ) {
case 'add-tag':
- check_admin_referer('add-tag');
+ check_admin_referer( 'add-tag' );
- if ( !current_user_can($tax->cap->edit_terms) )
- wp_die(__('Cheatin’ uh?'));
+ if ( !current_user_can( $tax->cap->edit_terms ) )
+ wp_die( __( 'Cheatin’ uh?' ) );
- $ret = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST);
+ $ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST );
$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') )
+ if ( false !== strpos( $referer, 'edit-tags.php' ) )
$location = $referer;
}
if ( $ret && !is_wp_error( $ret ) )
- $location = add_query_arg('message', 1, $location);
+ $location = add_query_arg( 'message', 1, $location );
else
- $location = add_query_arg('message', 4, $location);
- wp_redirect($location);
+ $location = add_query_arg( 'message', 4, $location );
+ wp_redirect( $location );
exit;
break;
if ( 'post' != $post_type )
$location .= '&post_type=' . $post_type;
if ( $referer = wp_get_referer() ) {
- if ( false !== strpos($referer, 'edit-tags.php') )
+ if ( false !== strpos( $referer, 'edit-tags.php' ) )
$location = $referer;
}
- if ( !isset( $_GET['tag_ID'] ) ) {
- wp_redirect($location);
+ if ( !isset( $_REQUEST['tag_ID'] ) ) {
+ wp_redirect( $location );
exit;
}
- $tag_ID = (int) $_GET['tag_ID'];
- check_admin_referer('delete-tag_' . $tag_ID);
+ $tag_ID = (int) $_REQUEST['tag_ID'];
+ check_admin_referer( 'delete-tag_' . $tag_ID );
- if ( !current_user_can($tax->cap->delete_terms) )
- wp_die(__('Cheatin’ uh?'));
+ if ( !current_user_can( $tax->cap->delete_terms ) )
+ wp_die( __( 'Cheatin’ uh?' ) );
- wp_delete_term( $tag_ID, $taxonomy);
+ wp_delete_term( $tag_ID, $taxonomy );
- $location = add_query_arg('message', 2, $location);
- wp_redirect($location);
+ $location = add_query_arg( 'message', 2, $location );
+ wp_redirect( $location );
exit;
break;
case 'bulk-delete':
- check_admin_referer('bulk-tags');
+ check_admin_referer( 'bulk-tags' );
- if ( !current_user_can($tax->cap->delete_terms) )
- wp_die(__('Cheatin’ uh?'));
+ if ( !current_user_can( $tax->cap->delete_terms ) )
+ wp_die( __( 'Cheatin’ uh?' ) );
- $tags = (array) $_GET['delete_tags'];
- foreach( $tags as $tag_ID ) {
- wp_delete_term( $tag_ID, $taxonomy);
+ $tags = (array) $_REQUEST['delete_tags'];
+ foreach ( $tags as $tag_ID ) {
+ wp_delete_term( $tag_ID, $taxonomy );
}
$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') )
+ if ( false !== strpos( $referer, 'edit-tags.php' ) )
$location = $referer;
}
- $location = add_query_arg('message', 6, $location);
- wp_redirect($location);
+ $location = add_query_arg( 'message', 6, $location );
+ wp_redirect( $location );
exit;
break;
case 'edit':
$title = $tax->labels->edit_item;
- require_once ('admin-header.php');
- $tag_ID = (int) $_GET['tag_ID'];
-
- if ( !current_user_can($tax->cap->edit_terms) )
- wp_die( __('You are not allowed to edit this item.') );
+ require_once ( 'admin-header.php' );
+ $tag_ID = (int) $_REQUEST['tag_ID'];
- $tag = get_term($tag_ID, $taxonomy, OBJECT, 'edit');
- include('./edit-tag-form.php');
+ $tag = get_term( $tag_ID, $taxonomy, OBJECT, 'edit' );
+ include( './edit-tag-form.php' );
break;
case 'editedtag':
$tag_ID = (int) $_POST['tag_ID'];
- check_admin_referer('update-tag_' . $tag_ID);
+ check_admin_referer( 'update-tag_' . $tag_ID );
- if ( !current_user_can($tax->cap->edit_terms) )
- wp_die(__('Cheatin’ uh?'));
+ if ( !current_user_can( $tax->cap->edit_terms ) )
+ wp_die( __( 'Cheatin’ uh?' ) );
- $ret = wp_update_term($tag_ID, $taxonomy, $_POST);
+ $ret = wp_update_term( $tag_ID, $taxonomy, $_POST );
$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') )
+ if ( false !== strpos( $referer, 'edit-tags.php' ) )
$location = $referer;
}
if ( $ret && !is_wp_error( $ret ) )
- $location = add_query_arg('message', 3, $location);
+ $location = add_query_arg( 'message', 3, $location );
else
- $location = add_query_arg('message', 5, $location);
+ $location = add_query_arg( 'message', 5, $location );
- wp_redirect($location);
+ wp_redirect( $location );
exit;
break;
default:
+if ( ! empty($_REQUEST['_wp_http_referer']) ) {
+ $location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) );
-if ( ! empty($_GET['_wp_http_referer']) ) {
- wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
- exit;
+ if ( ! empty( $_REQUEST['paged'] ) )
+ $location = add_query_arg( 'paged', (int) $_REQUEST['paged'] );
+
+ wp_redirect( $location );
+ exit;
+}
+
+$wp_list_table->prepare_items();
+$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+
+if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
}
wp_enqueue_script('admin-tags');
if ( current_user_can($tax->cap->edit_terms) )
wp_enqueue_script('inline-edit-tax');
-if ( 'category' == $taxonomy || 'post_tag' == $taxonomy ) {
+if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $taxonomy ) {
+ $help ='';
if ( 'category' == $taxonomy )
- $help = '<p>' . 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 <a href="%s">writing settings</a>.'), 'options-writing.php') . '</p>';
+ $help = '<p>' . 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 <a href="%s">writing settings</a>.' ) , 'options-writing.php' ) . '</p>';
+ elseif ( 'link_category' == $taxonomy )
+ $help = '<p>' . __( '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.' ) . '</p>';
else
- $help = '<p>' . __('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.') . '</p>';
+ $help = '<p>' . __( '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.' ) . '</p>';
- $help .='<p>' . __('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.') . '</p>';
+ if ( 'link_category' == $taxonomy )
+ $help .= '<p>' . __( 'You can delete link categories in the Bulk Action pulldown, but that action does not delete the links within the category. Instead, it moves them to the default link category.' ) . '</p>';
+ else
+ $help .='<p>' . __( '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.' ) . '</p>';
if ( 'category' == $taxonomy )
- $help .= '<p>' . __('When adding a new category on this screen, you’ll fill in the following fields:') . '</p>';
- else
- $help .= '<p>' . __('When adding a new tag on this screen, you’ll fill in the following fields:') . '</p>';
+ $help .= '<p>' . __( 'When adding a new category on this screen, you’ll fill in the following fields:' ) . '</p>';
+ elseif ( 'post_tag' == $taxonomy )
+ $help .= '<p>' . __( 'When adding a new tag on this screen, you’ll fill in the following fields:' ) . '</p>';
+
+ if ( 'category' == $taxonomy || 'post_tag' == $taxonomy )
- $help .= '<ul>' .
- '<li>' . __('<strong>Name</strong> - The name is how it appears on your site.') . '</li>';
- if ( ! global_terms_enabled() )
- $help .= '<li>' . __('<strong>Slug</strong> - The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.') . '</li>';
+ $help .= '<ul>' .
+ '<li>' . __( '<strong>Name</strong> - The name is how it appears on your site.' ) . '</li>';
+
+ if ( ! global_terms_enabled() )
+ if ( 'category' == $taxonomy || 'post_tag' == $taxonomy )
+ $help .= '<li>' . __( '<strong>Slug</strong> - The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . '</li>';
if ( 'category' == $taxonomy )
- $help .= '<li>' . __('<strong>Parent</strong> - 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.') . '</li>';
+ $help .= '<li>' . __( '<strong>Parent</strong> - 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.' ) . '</li>';
- $help .= '<li>' . __('<strong>Description</strong> - The description is not prominent by default; however, some themes may display it.') . '</li>' .
+ if ( 'category' == $taxonomy || 'post_tag' == $taxonomy )
+ $help .= '<li>' . __( '<strong>Description</strong> - The description is not prominent by default; however, some themes may display it.' ) . '</li>' .
'</ul>' .
- '<p>' . __('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.') . '</p>' .
- '<p><strong>' . __('For more information:') . '</strong></p>';
+ '<p>' . __( '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.' ) . '</p>' .
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
if ( 'category' == $taxonomy )
- $help .= '<p>' . __('<a href="http://codex.wordpress.org/Manage_Categories_SubPanel" target="_blank">Categories Documentation</a>') . '</p>';
+ $help .= '<p>' . __( '<a href="http://codex.wordpress.org/Posts_Categories_SubPanel" target="_blank">Documentation on Categories</a>' ) . '</p>';
+ elseif ( 'link_category' == $taxonomy )
+ $help .= '<p>' . __( '<a href="http://codex.wordpress.org/Links_Link_Categories_SubPanel" target="_blank">Documentation on Link Categories</a>' ) . '</p>';
else
- $help .= '<p>' . __('<a href="http://codex.wordpress.org/Post_Tags_SubPanel" target="_blank">Tags Documentation</a>') . '</p>';
+ $help .= '<p>' . __( '<a href="http://codex.wordpress.org/Posts_Post_Tags_SubPanel" target="_blank">Documentation on Post Tags</a>' ) . '</p>';
$help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
require_once ('admin-header.php');
+if ( !current_user_can($tax->cap->edit_terms) )
+ wp_die( __('You are not allowed to edit this item.') );
+
$messages[1] = __('Item added.');
$messages[2] = __('Item deleted.');
$messages[3] = __('Item updated.');
<div class="wrap nosubsub">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title );
-if ( !empty($_GET['s']) )
- printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_GET['s']) ) ); ?>
+if ( !empty($_REQUEST['s']) )
+ printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_REQUEST['s']) ) ); ?>
</h2>
-<?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
+<?php if ( isset($_REQUEST['message']) && ( $msg = (int) $_REQUEST['message'] ) ) : ?>
<div id="message" class="updated"><p><?php echo $messages[$msg]; ?></p></div>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
endif; ?>
<form class="search-form" action="" method="get">
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
-<p class="search-box">
- <label class="screen-reader-text" for="tag-search-input"><?php echo $tax->labels->search_items; ?>:</label>
- <input type="text" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" />
- <input type="submit" value="<?php echo esc_attr( $tax->labels->search_items ); ?>" class="button" />
-</p>
+
+<?php $wp_list_table->search_box( $tax->labels->search_items, 'tag' ); ?>
+
</form>
<br class="clear" />
<div id="col-right">
<div class="col-wrap">
-<form id="posts-filter" action="" method="get">
+<form id="posts-filter" action="" method="post">
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
-<div class="tablenav">
-<?php
-$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
-if ( empty($pagenum) )
- $pagenum = 1;
-
-$tags_per_page = (int) get_user_option( 'edit_' . $taxonomy . '_per_page' );
-if ( empty($tags_per_page) || $tags_per_page < 1 )
- $tags_per_page = 20;
-
-if ( 'post_tag' == $taxonomy ) {
- $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
- $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
-} elseif ( 'category' == $taxonomy ) {
- $tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); // Old filter
-} else {
- $tags_per_page = apply_filters( 'edit_' . $taxonomy . '_per_page', $tags_per_page );
-}
-
-$searchterms = !empty($_GET['s']) ? trim(stripslashes($_GET['s'])) : '';
-
-$page_links = paginate_links( array(
- 'base' => add_query_arg( 'pagenum', '%#%' ),
- 'format' => '',
- 'prev_text' => __('«'),
- 'next_text' => __('»'),
- 'total' => ceil(wp_count_terms($taxonomy, array('search' => $searchterms)) / $tags_per_page),
- 'current' => $pagenum
-));
-
-if ( $page_links )
- echo "<div class='tablenav-pages'>$page_links</div>";
-?>
-
-<div class="alignleft actions">
-<select name="action">
-<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
-<?php wp_nonce_field('bulk-tags'); ?>
-</div>
-
-<br class="clear" />
-</div>
-
-<div class="clear"></div>
-<table class="widefat tag fixed" cellspacing="0">
- <thead>
- <tr>
-<?php print_column_headers($current_screen); ?>
- </tr>
- </thead>
-
- <tfoot>
- <tr>
-<?php print_column_headers($current_screen, false); ?>
- </tr>
- </tfoot>
-
- <tbody id="the-list" class="list:tag">
-<?php tag_rows( $pagenum, $tags_per_page, $searchterms, $taxonomy ); ?>
- </tbody>
-</table>
-
-<div class="tablenav">
-<?php
-if ( $page_links )
- echo "<div class='tablenav-pages'>$page_links</div>";
-?>
-
-<div class="alignleft actions">
-<select name="action2">
-<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
-</div>
-
-<br class="clear" />
-</div>
+<?php $wp_list_table->display(); ?>
<br class="clear" />
</form>
<?php
-if ( !is_taxonomy_hierarchical($taxonomy) ) {
+if ( !is_null( $tax->labels->popular_items ) ) {
if ( current_user_can( $tax->cap->edit_terms ) )
$tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false, 'link' => 'edit' ) );
else
}
if ( current_user_can($tax->cap->edit_terms) ) {
+ // Back compat hooks. Deprecated in preference to {$taxonomy}_pre_add_form
if ( 'category' == $taxonomy )
- do_action('add_category_form_pre', (object)array('parent' => 0) ); // Back compat hook. Deprecated in preference to $taxonomy_pre_add_form
+ do_action('add_category_form_pre', (object)array('parent' => 0) );
+ elseif ( 'link_category' == $taxonomy )
+ do_action('add_link_category_form_pre', (object)array('parent' => 0) );
else
- do_action('add_tag_form_pre', $taxonomy); // Back compat hook. Applies to all Taxonomies -not- categories
+ do_action('add_tag_form_pre', $taxonomy);
+
do_action($taxonomy . '_pre_add_form', $taxonomy);
?>
<input name="slug" id="tag-slug" type="text" value="" size="40" />
<p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
</div>
-<?php endif; // is_multisite() ?>
+<?php endif; // global_terms_enabled() ?>
<?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
<div class="form-field">
<label for="parent"><?php _ex('Parent', 'Taxonomy Parent'); ?></label>
if ( ! is_taxonomy_hierarchical($taxonomy) )
do_action('add_tag_form_fields', $taxonomy);
do_action($taxonomy . '_add_form_fields', $taxonomy);
-?>
-<p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php echo esc_attr( $tax->labels->add_new_item ); ?>" /></p>
-<?php
+
+submit_button( $tax->labels->add_new_item, 'button' );
+
+// Back compat hooks. Deprecated in preference to {$taxonomy}_add_form
if ( 'category' == $taxonomy )
- do_action('edit_category_form', (object)array('parent' => 0) ); // Back compat hook. Deprecated in preference to $taxonomy_add_form
+ do_action('edit_category_form', (object)array('parent' => 0) );
+elseif ( 'link_category' == $taxonomy )
+ do_action('edit_link_category_form', (object)array('parent' => 0) );
else
- do_action('add_tag_form', $taxonomy); // Back compat hook. Applies to all Taxonomies -not- categories
+ do_action('add_tag_form', $taxonomy);
+
do_action($taxonomy . '_add_form', $taxonomy);
?>
</form></div>
</div><!-- /col-container -->
</div><!-- /wrap -->
-<?php inline_edit_term_row('edit-tags', $taxonomy); ?>
+<?php $wp_list_table->inline_edit(); ?>
<?php
break;
*/
/** WordPress Administration Bootstrap */
-require_once('./admin.php');
+require_once( './admin.php' );
if ( !isset($_GET['post_type']) )
$post_type = 'post';
$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);
+$post_type_object = get_post_type_object( $post_type );
if ( !current_user_can($post_type_object->cap->edit_posts) )
wp_die(__('Cheatin’ uh?'));
+$wp_list_table = _get_list_table('WP_Posts_List_Table');
+$pagenum = $wp_list_table->get_pagenum();
+
// Back-compat for viewing comments of an entry
-if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['page_id'] ) ) ) {
- wp_redirect( admin_url('edit-comments.php?p=' . $_redirect ) );
- exit;
-} else {
- unset( $_redirect );
+foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) {
+ if ( ! empty( $_REQUEST[ $_redirect ] ) ) {
+ wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) );
+ exit;
+ }
}
+unset( $_redirect );
if ( 'post' != $post_type ) {
$parent_file = "edit.php?post_type=$post_type";
$post_new_file = 'post-new.php';
}
-$pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
-if ( empty($pagenum) )
- $pagenum = 1;
-$edit_per_page = 'edit_' . $post_type . '_per_page';
-$per_page = (int) get_user_option( $edit_per_page );
-if ( empty( $per_page ) || $per_page < 1 )
- $per_page = 20;
-
-$per_page = apply_filters( $edit_per_page, $per_page );
-$per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );
+$doaction = $wp_list_table->current_action();
-// Handle bulk actions
-if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) {
+if ( $doaction ) {
check_admin_referer('bulk-posts');
- $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
+ $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
+ $sendback = add_query_arg( 'paged', $pagenum, $sendback );
if ( strpos($sendback, 'post.php') !== false )
$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=%s AND post_status = %s", $post_type, $post_status ) );
+ if ( 'delete_all' == $doaction ) {
+ $post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_REQUEST['post_status']);
+ if ( get_post_status_object($post_status) ) // Check the post status exists first
+ $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?post_type=$post_type") );
+ } elseif ( isset( $_REQUEST['media'] ) ) {
+ $post_ids = $_REQUEST['media'];
+ } elseif ( isset( $_REQUEST['ids'] ) ) {
+ $post_ids = explode( ',', $_REQUEST['ids'] );
+ } elseif ( !empty( $_REQUEST['post'] ) ) {
+ $post_ids = array_map('intval', $_REQUEST['post']);
+ }
+
+ if ( !isset( $post_ids ) ) {
+ wp_redirect( $sendback );
+ exit;
}
switch ( $doaction ) {
$trashed++;
}
- $sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids)), $sendback );
+ $sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids) ), $sendback );
break;
case 'untrash':
$untrashed = 0;
$sendback = add_query_arg('deleted', $deleted, $sendback);
break;
case 'edit':
- $done = bulk_edit_posts($_GET);
+ $done = bulk_edit_posts($_REQUEST);
if ( is_array($done) ) {
$done['updated'] = count( $done['updated'] );
break;
}
- if ( isset($_GET['action']) )
- $sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $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 ( ! empty($_GET['_wp_http_referer']) ) {
+} elseif ( ! empty($_REQUEST['_wp_http_referer']) ) {
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
exit;
}
-wp_enqueue_script('inline-edit-post');
+$wp_list_table->prepare_items();
-$user_posts = false;
-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;
+$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
}
-$avail_post_stati = wp_edit_posts_query();
-
-if ( $post_type_object->hierarchical )
- $num_pages = ceil($wp_query->post_count / $per_page);
-else
- $num_pages = $wp_query->max_num_pages;
+wp_enqueue_script('inline-edit-post');
$title = $post_type_object->labels->name;
'</ul>' .
'<p>' . __('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.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Posts_Edit_SubPanel" target="_blank">Edit Posts Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Posts_Posts_SubPanel" target="_blank">Documentation on Managing Posts</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
} elseif ( 'page' == $post_type ) {
add_contextual_help($current_screen,
- '<p>' . __('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.') . '</p>' .
+ '<p>' . __('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.') . '</p>' .
'<p>' . __('Managing Pages is very similar to managing Posts, and the screens can be customized in the same way.') . '</p>' .
'<p>' . __('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.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Pages_Edit_SubPanel" target="_blank">Page Management Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Pages_Pages_SubPanel" target="_blank">Documentation on Managing Pages</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
}
-require_once('./admin-header.php');
-
-if ( empty($_GET['mode']) )
- $mode = 'list';
-else
- $mode = esc_attr($_GET['mode']); ?>
+add_screen_option( 'per_page', array('label' => $title, 'default' => 20) );
+require_once('./admin-header.php');
+?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $post_type_object->labels->name ); ?> <a href="<?php echo $post_new_file ?>" class="button add-new-h2"><?php echo esc_html($post_type_object->labels->add_new); ?></a> <?php
-if ( isset($_GET['s']) && $_GET['s'] )
+if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() ); ?>
</h2>
<?php
-if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
-<div id="message" class="updated"><p><strong><?php _e('This has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View Post'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit Post'); ?></a></p></div>
+if ( isset($_REQUEST['posted']) && $_REQUEST['posted'] ) : $_REQUEST['posted'] = (int) $_REQUEST['posted']; ?>
+<div id="message" class="updated"><p><strong><?php _e('This has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_REQUEST['posted'] ); ?>"><?php _e('View Post'); ?></a> | <a href="<?php echo get_edit_post_link( $_REQUEST['posted'] ); ?>"><?php _e('Edit Post'); ?></a></p></div>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
endif; ?>
-<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?>
+<?php if ( isset($_REQUEST['locked']) || isset($_REQUEST['skipped']) || isset($_REQUEST['updated']) || isset($_REQUEST['deleted']) || isset($_REQUEST['trashed']) || isset($_REQUEST['untrashed']) ) { ?>
<div id="message" class="updated"><p>
-<?php if ( isset($_GET['updated']) && (int) $_GET['updated'] ) {
- printf( _n( '%s post updated.', '%s posts updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
- unset($_GET['updated']);
+<?php if ( isset($_REQUEST['updated']) && (int) $_REQUEST['updated'] ) {
+ printf( _n( '%s post updated.', '%s posts updated.', $_REQUEST['updated'] ), number_format_i18n( $_REQUEST['updated'] ) );
+ unset($_REQUEST['updated']);
}
-if ( isset($_GET['skipped']) && (int) $_GET['skipped'] )
- unset($_GET['skipped']);
+if ( isset($_REQUEST['skipped']) && (int) $_REQUEST['skipped'] )
+ unset($_REQUEST['skipped']);
-if ( isset($_GET['locked']) && (int) $_GET['locked'] ) {
- printf( _n( '%s item not updated, somebody is editing it.', '%s items not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) );
- unset($_GET['locked']);
+if ( isset($_REQUEST['locked']) && (int) $_REQUEST['locked'] ) {
+ printf( _n( '%s item not updated, somebody is editing it.', '%s items not updated, somebody is editing them.', $_REQUEST['locked'] ), number_format_i18n( $_REQUEST['locked'] ) );
+ unset($_REQUEST['locked']);
}
-if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
- printf( _n( 'Item permanently deleted.', '%s items permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
- unset($_GET['deleted']);
+if ( isset($_REQUEST['deleted']) && (int) $_REQUEST['deleted'] ) {
+ printf( _n( 'Item permanently deleted.', '%s items permanently deleted.', $_REQUEST['deleted'] ), number_format_i18n( $_REQUEST['deleted'] ) );
+ unset($_REQUEST['deleted']);
}
-if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
- printf( _n( 'Item moved to the trash.', '%s items moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
- $ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
+if ( isset($_REQUEST['trashed']) && (int) $_REQUEST['trashed'] ) {
+ printf( _n( 'Item moved to the Trash.', '%s items moved to the Trash.', $_REQUEST['trashed'] ), number_format_i18n( $_REQUEST['trashed'] ) );
+ $ids = isset($_REQUEST['ids']) ? $_REQUEST['ids'] : 0;
echo ' <a href="' . esc_url( wp_nonce_url( "edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", "bulk-posts" ) ) . '">' . __('Undo') . '</a><br />';
- unset($_GET['trashed']);
+ unset($_REQUEST['trashed']);
}
-if ( isset($_GET['untrashed']) && (int) $_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']);
+if ( isset($_REQUEST['untrashed']) && (int) $_REQUEST['untrashed'] ) {
+ printf( _n( 'Item restored from the Trash.', '%s items restored from the Trash.', $_REQUEST['untrashed'] ), number_format_i18n( $_REQUEST['untrashed'] ) );
+ unset($_REQUEST['undeleted']);
}
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] );
</p></div>
<?php } ?>
-<form id="posts-filter" action="<?php echo admin_url('edit.php'); ?>" method="get">
+<?php $wp_list_table->views(); ?>
-<ul class="subsubsub">
-<?php
-if ( empty($locked_post_status) ) :
-$status_links = array();
-$num_posts = wp_count_posts( $post_type, 'readable' );
-$class = '';
-$allposts = '';
-
-if ( $user_posts ) {
- if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user->ID ) )
- $class = ' class="current"';
- $status_links[] = "<li><a href='edit.php?post_type=$post_type&author=$current_user->ID'$class>" . sprintf( _nx( 'Mine <span class="count">(%s)</span>', 'Mine <span class="count">(%s)</span>', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . '</a>';
- $allposts = '&all_posts=1';
-}
-
-$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[] = "<li><a href='edit.php?post_type=$post_type{$allposts}'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '</a>';
-
-foreach ( get_post_stati(array('show_in_admin_status_list' => true), 'objects') as $status ) {
- $class = '';
-
- $status_name = $status->name;
-
- if ( !in_array( $status_name, $avail_post_stati ) )
- continue;
-
- if ( empty( $num_posts->$status_name ) )
- continue;
-
- if ( isset($_GET['post_status']) && $status_name == $_GET['post_status'] )
- $class = ' class="current"';
-
- $status_links[] = "<li><a href='edit.php?post_status=$status_name&post_type=$post_type'$class>" . sprintf( _n( $status->label_count[0], $status->label_count[1], $num_posts->$status_name ), number_format_i18n( $num_posts->$status_name ) ) . '</a>';
-}
-echo implode( " |</li>\n", $status_links ) . '</li>';
-unset( $status_links );
-endif;
-?>
-</ul>
+<form id="posts-filter" action="" method="get">
-<p class="search-box">
- <label class="screen-reader-text" for="post-search-input"><?php echo $post_type_object->labels->search_items; ?>:</label>
- <input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />
- <input type="submit" value="<?php echo esc_attr( $post_type_object->labels->search_items ); ?>" class="button" />
-</p>
+<?php $wp_list_table->search_box( $post_type_object->labels->search_items, 'post' ); ?>
-<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_GET['post_status']) ? esc_attr($_GET['post_status']) : 'all'; ?>" />
+<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_REQUEST['post_status']) ? esc_attr($_REQUEST['post_status']) : 'all'; ?>" />
<input type="hidden" name="post_type" class="post_type_page" value="<?php echo $post_type; ?>" />
-<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
-
-<?php if ( have_posts() ) { ?>
-
-<div class="tablenav">
-<?php
-$page_links = paginate_links( array(
- 'base' => add_query_arg( 'paged', '%#%' ),
- 'format' => '',
- 'prev_text' => __('«'),
- 'next_text' => __('»'),
- 'total' => $num_pages,
- 'current' => $pagenum
-));
-
-$is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash';
-
-?>
-
-<div class="alignleft actions">
-<select name="action">
-<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<?php if ( $is_trash ) { ?>
-<option value="untrash"><?php _e('Restore'); ?></option>
-<?php } else { ?>
-<option value="edit"><?php _e('Edit'); ?></option>
-<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
-<option value="delete"><?php _e('Delete Permanently'); ?></option>
-<?php } else { ?>
-<option value="trash"><?php _e('Move to Trash'); ?></option>
+<?php if ( ! empty( $_REQUEST['show_sticky'] ) ) { ?>
+<input type="hidden" name="show_sticky" value="1" />
<?php } ?>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
-<?php wp_nonce_field('bulk-posts'); ?>
-
-<?php // view filters
-if ( !is_singular() ) {
-$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 );
+<?php $wp_list_table->display(); ?>
-$month_count = count($arc_result);
-
-if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) {
-$m = isset($_GET['m']) ? (int)$_GET['m'] : 0;
-?>
-<select name='m'>
-<option<?php selected( $m, 0 ); ?> value='0'><?php _e('Show all dates'); ?></option>
-<?php
-foreach ($arc_result as $arc_row) {
- if ( $arc_row->yyear == 0 )
- continue;
- $arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
-
- if ( $arc_row->yyear . $arc_row->mmonth == $m )
- $default = ' selected="selected"';
- else
- $default = '';
-
- echo "<option$default value='" . esc_attr("$arc_row->yyear$arc_row->mmonth") . "'>";
- echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";
- echo "</option>\n";
-}
-?>
-</select>
-<?php } ?>
-
-<?php
-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');
-?>
-<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
-<?php }
-
-if ( $is_trash && current_user_can($post_type_object->cap->edit_others_posts) ) { ?>
-<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
-<?php } ?>
-</div>
-
-<?php if ( $page_links ) { ?>
-<div class="tablenav-pages"><?php
- $count_posts = $post_type_object->hierarchical ? $wp_query->post_count : $wp_query->found_posts;
- $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%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;
- ?></div>
-<?php
-}
-
-if ( !$post_type_object->hierarchical ) {
-?>
-
-<div class="view-switch">
- <a href="<?php echo esc_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'list' == $mode ) echo 'class="current"'; ?> id="view-switch-list" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e('List View') ?>" alt="<?php _e('List View') ?>" /></a>
- <a href="<?php echo esc_url(add_query_arg('mode', 'excerpt', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'excerpt' == $mode ) echo 'class="current"'; ?> id="view-switch-excerpt" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e('Excerpt View') ?>" alt="<?php _e('Excerpt View') ?>" /></a>
-</div>
-
-<?php } ?>
-<div class="clear"></div>
-</div>
-
-<div class="clear"></div>
-
-<?php include( './edit-post-rows.php' ); ?>
-
-<div class="tablenav">
+</form>
<?php
-if ( $page_links )
- echo "<div class='tablenav-pages'>$page_links_text</div>";
+if ( $wp_list_table->has_items() )
+ $wp_list_table->inline_edit();
?>
-<div class="alignleft actions">
-<select name="action2">
-<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<?php if ( $is_trash ) { ?>
-<option value="untrash"><?php _e('Restore'); ?></option>
-<?php } else { ?>
-<option value="edit"><?php _e('Edit'); ?></option>
-<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
-<option value="delete"><?php _e('Delete Permanently'); ?></option>
-<?php } else { ?>
-<option value="trash"><?php _e('Move to Trash'); ?></option>
-<?php } ?>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
-<?php if ( $is_trash && current_user_can($post_type_object->cap->edit_others_posts) ) { ?>
-<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
-<?php } ?>
-<br class="clear" />
-</div>
-<br class="clear" />
-</div>
-
-<?php } else { // have_posts() ?>
-<div class="clear"></div>
-<p><?php
-if ( isset($_GET['post_status']) && 'trash' == $_GET['post_status'] )
- echo $post_type_object->labels->not_found_in_trash;
-else
- echo $post_type_object->labels->not_found;
-?></p>
-<?php } ?>
-
-</form>
-
-<?php inline_edit_row( $current_screen ); ?>
-
<div id="ajax-response"></div>
<br class="clear" />
</div>
require_once('./includes/export.php');
$title = __('Export');
-add_contextual_help($current_screen,
- '<p>' . __('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.') . '</p>' .
+function add_js() {
+?>
+<script type="text/javascript">
+//<![CDATA[
+ jQuery(document).ready(function($){
+ var form = $('#export-filters'),
+ filters = form.find('.export-filters');
+ filters.hide();
+ form.find('input:radio').change(function() {
+ filters.slideUp('fast');
+ switch ( $(this).val() ) {
+ case 'posts': $('#post-filters').slideDown(); break;
+ case 'pages': $('#page-filters').slideDown(); break;
+ }
+ });
+ });
+//]]>
+</script>
+<?php
+}
+add_action( 'admin_head', 'add_js' );
+
+add_contextual_help( $current_screen,
+ '<p>' . __('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 choose for the WXR file to include only certain posts or pages by setting the dropdown filters to limit the export by category, author, date range by month, or publishing status.') . '</p>' .
'<p>' . __('Once generated, your WXR file can be imported by another WordPress site or by another blogging platform able to access this format.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Tools_Export_SubPanel" target="_blank">Export Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Tools_Export_SubPanel" target="_blank">Documentation on Export</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
if ( isset( $_GET['download'] ) ) {
- $author = isset($_GET['author']) ? $_GET['author'] : 'all';
- $taxonomy = array();
- foreach ( get_taxonomies( array( 'show_ui' => true ) ) as $tax )
- $taxonomy[ $tax ] = ! empty( $_GET['export_taxonomy'][ $tax ] ) ? $_GET['export_taxonomy'][ $tax ] : 'all';
- $post_type = isset($_GET['export_post_type']) ? stripslashes_deep($_GET['export_post_type']) : 'all';
- $status = isset($_GET['export_post_status']) ? stripslashes_deep($_GET['export_post_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';
+ $args = array();
+
+ if ( ! isset( $_GET['content'] ) || 'all' == $_GET['content'] ) {
+ $args['content'] = 'all';
+ } else if ( 'posts' == $_GET['content'] ) {
+ $args['content'] = 'post';
+
+ if ( $_GET['cat'] )
+ $args['category'] = (int) $_GET['cat'];
+
+ if ( $_GET['post_author'] )
+ $args['author'] = (int) $_GET['post_author'];
+
+ if ( $_GET['post_start_date'] || $_GET['post_end_date'] ) {
+ $args['start_date'] = $_GET['post_start_date'];
+ $args['end_date'] = $_GET['post_end_date'];
}
- 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';
+
+ if ( $_GET['post_status'] )
+ $args['status'] = $_GET['post_status'];
+ } else if ( 'pages' == $_GET['content'] ) {
+ $args['content'] = 'page';
+
+ if ( $_GET['page_author'] )
+ $args['author'] = (int) $_GET['page_author'];
+
+ if ( $_GET['page_start_date'] || $_GET['page_end_date'] ) {
+ $args['start_date'] = $_GET['page_start_date'];
+ $args['end_date'] = $_GET['page_end_date'];
}
- export_wp( array( 'author' => $author, 'taxonomy' => $taxonomy, 'post_type' => $post_type, 'post_status' => $status, 'start_date' => $start_date, 'end_date' => $end_date ) );
+ if ( $_GET['page_status'] )
+ $args['status'] = $_GET['page_status'];
+ } else {
+ $args['content'] = $_GET['content'];
+ }
+
+ export_wp( $args );
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<option value=\"" . $monthyears[$s]->year . '-' . zeroise( $monthyears[$s]->month, 2 ) . '">' . $monthyears[$s]->lmonth . ' ' . $monthyears[$s]->year . "</option>\n";
- $edateoptions .= "\t<option value=\"" . $monthyears[$e]->eyear . '-' . zeroise( $monthyears[$e]->emonth, 2 ) . '">' . $monthyears[$e]->lmonth . ' ' . $monthyears[$e]->year . "</option>\n";
+function export_date_options() {
+ global $wpdb, $wp_locale;
+
+ $months = $wpdb->get_results( "
+ SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
+ FROM $wpdb->posts
+ WHERE post_type = 'post' AND post_status != 'auto-draft'
+ ORDER BY post_date DESC
+ " );
+
+ $month_count = count( $months );
+ if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
+ return;
+
+ foreach ( $months as $date ) {
+ if ( 0 == $date->year )
+ continue;
+
+ $month = zeroise( $date->month, 2 );
+ echo '<option value="' . $date->year . '-' . $month . '" />' . $wp_locale->get_month( $month ) . ' ' . $date->year . '</option>';
}
}
-
?>
<div class="wrap">
<p><?php _e('When you click the button below WordPress will create an XML file for you to save to your computer.'); ?></p>
<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags.'); ?></p>
-<p><?php _e('Once you’ve saved the download file, you can use the Import function on another WordPress site to import this site.'); ?></p>
-<form action="" method="get">
-<h3><?php _e('Filters'); ?></h3>
-
-<table class="form-table">
-<tr>
-<th><label for="mm_start"><?php _e('Start Date'); ?></label></th>
-<td>
-<select name="mm_start" id="mm_start">
- <option value="all" selected="selected"><?php _e('All Dates'); ?></option>
-<?php echo $dateoptions; ?>
-</select>
-</td>
-</tr>
-<tr>
-<th><label for="mm_end" id="mm_end"><?php _e('End Date'); ?></label></th>
-<td>
-<select name="mm_end" id="mm_end">
- <option value="all" selected="selected"><?php _e('All Dates'); ?></option>
-<?php echo $edateoptions; ?>
-</select>
-</td>
-</tr>
-<tr>
-<th><label for="author"><?php _e('Authors'); ?></label></th>
-<td>
-<select name="author" id="author">
-<option value="all" selected="selected"><?php _e('All Authors'); ?></option>
+<p><?php _e('Once you’ve saved the download file, you can use the Import function in another WordPress installation to import this site.'); ?></p>
+
+<h3><?php _e( 'Choose what to export' ); ?></h3>
+<form action="" method="get" id="export-filters">
+<input type="hidden" name="download" value="true" />
+<p><label><input type="radio" name="content" value="all" checked="checked" /> <?php _e( 'All content' ); ?></label>
+<span class="description"><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus and custom posts.' ); ?></span></p>
+
+<p><label><input type="radio" name="content" value="posts" /> <?php _e( 'Posts' ); ?></label></p>
+<ul id="post-filters" class="export-filters">
+ <li>
+ <label><?php _e( 'Categories:' ); ?></label>
+ <?php wp_dropdown_categories( array( 'show_option_all' => __('All') ) ); ?>
+ </li>
+ <li>
+ <label><?php _e( 'Authors:' ); ?></label>
<?php
-$authors = $wpdb->get_results( "SELECT DISTINCT u.id, u.display_name FROM $wpdb->users u INNER JOIN $wpdb->posts p WHERE u.id = p.post_author ORDER BY u.display_name" );
-foreach ( (array) $authors as $author ) {
- echo "<option value='{$author->id}'>{$author->display_name}</option>\n";
-}
-?>
-</select>
-</td>
-</tr>
-<?php foreach ( get_taxonomies( array( 'show_ui' => 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' => 'export_taxonomy[' . $tax_obj->name . ']', 'id' => 'taxonomy-' . $tax_obj->name, 'class' => '', 'echo' => false ) );
- if ( $term_dropdown )
- echo '<tr><th><label for="taxonomy-' . $tax_obj->name . '">' . $tax_obj->labels->name . '</label></th><td>' . $term_dropdown . '</td></tr>';
-}
+ $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" );
+ wp_dropdown_users( array( 'include' => $authors, 'name' => 'post_author', 'multi' => true, 'show_option_all' => __('All') ) );
?>
-<tr>
-<th><label for="post_type"><?php _e('Content Types'); ?></label></th>
-<td>
-<select name="export_post_type" id="post_type">
- <option value="all" selected="selected"><?php _e('All Content'); ?></option>
- <?php foreach ( get_post_types( array( 'public' => true, 'can_export' => true ), 'objects' ) as $post_type_obj ) { ?>
- <option value="<?php echo $post_type_obj->name; ?>"><?php echo $post_type_obj->labels->name; ?></option>
- <?php } ?>
-</select>
-</td>
-</tr>
-<tr>
-<th><label for="status"><?php _e('Statuses'); ?></label></th>
-<td>
-<select name="export_post_status" id="status">
- <option value="all" selected="selected"><?php _e('All Statuses'); ?></option>
-<?php foreach ( get_post_stati( array( 'internal' => false ), 'objects' ) as $post_status_obj ) { ?>
- <option value="<?php echo $post_status_obj->name; ?>"><?php echo $post_status_obj->label; ?></option>
-<?php } ?>
-</select>
-</td>
-</tr>
-</table>
-<p class="submit"><input type="submit" name="submit" class="button" value="<?php esc_attr_e('Download Export File'); ?>" />
-<input type="hidden" name="download" value="true" />
-</p>
-</form>
-</div>
+ </li>
+ <li>
+ <label><?php _e( 'Date range:' ); ?></label>
+ <select name="post_start_date">
+ <option value="0"><?php _e( 'Start Date' ); ?></option>
+ <?php export_date_options(); ?>
+ </select>
+ <select name="post_end_date">
+ <option value="0"><?php _e( 'End Date' ); ?></option>
+ <?php export_date_options(); ?>
+ </select>
+ </li>
+ <li>
+ <label><?php _e( 'Status:' ); ?></label>
+ <select name="post_status">
+ <option value="0"><?php _e( 'All' ); ?></option>
+ <?php $post_stati = get_post_stati( array( 'internal' => false ), 'objects' );
+ foreach ( $post_stati as $status ) : ?>
+ <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+</ul>
+<p><label><input type="radio" name="content" value="pages" /> <?php _e( 'Pages' ); ?></label></p>
+<ul id="page-filters" class="export-filters">
+ <li>
+ <label><?php _e( 'Authors:' ); ?></label>
<?php
+ $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" );
+ wp_dropdown_users( array( 'include' => $authors, 'name' => 'page_author', 'multi' => true, 'show_option_all' => __('All') ) );
+?>
+ </li>
+ <li>
+ <label><?php _e( 'Date range:' ); ?></label>
+ <select name="page_start_date">
+ <option value="0"><?php _e( 'Start Date' ); ?></option>
+ <?php export_date_options(); ?>
+ </select>
+ <select name="page_end_date">
+ <option value="0"><?php _e( 'End Date' ); ?></option>
+ <?php export_date_options(); ?>
+ </select>
+ </li>
+ <li>
+ <label><?php _e( 'Status:' ); ?></label>
+ <select name="page_status">
+ <option value="0"><?php _e( 'All' ); ?></option>
+ <?php foreach ( $post_stati as $status ) : ?>
+ <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
+ <?php endforeach; ?>
+ </select>
+ </li>
+</ul>
+<?php foreach ( get_post_types( array( '_builtin' => false, 'can_export' => true ), 'objects' ) as $post_type ) : ?>
+<p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p>
+<?php endforeach; ?>
-include ('admin-footer.php');
-?>
+<?php submit_button( __('Download Export File'), 'secondary' ); ?>
+</form>
+</div>
+
+<?php include('admin-footer.php'); ?>
'<p>' . __('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.') . '</p>' .
'<p>' . __('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.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Tools_Import_SubPanel" target="_blank">Import Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Tools_Import_SubPanel" target="_blank">Documentation on Import</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
);
if ( ! empty( $_GET['invalid'] ) && !empty($popular_importers[$_GET['invalid']][3]) ) {
- wp_redirect("import.php?import=" . $popular_importers[$_GET['invalid']][3]);
+ wp_redirect( admin_url('import.php?import=' . $popular_importers[$_GET['invalid']][3]) );
exit;
}
add_thickbox();
+wp_enqueue_script( 'plugin-install' );
+wp_admin_css( 'plugin-install' );
+
require_once ('admin-header.php');
$parent_file = 'tools.php';
?>
// Load all importers so that they can register.
$import_loc = 'wp-admin/import';
-$import_root = ABSPATH.$import_loc;
-$imports_dir = @ opendir($import_root);
-if ($imports_dir) {
- while (($file = readdir($imports_dir)) !== false) {
- if ($file{0} == '.') {
- continue;
- } elseif (substr($file, -4) == '.php') {
- require_once($import_root . '/' . $file);
+$import_root = ABSPATH . $import_loc;
+
+if ( file_exists( $import_root ) ) {
+ $imports_dir = opendir($import_root);
+ if ($imports_dir) {
+ while (($file = readdir($imports_dir)) !== false) {
+ if ($file[0] == '.') {
+ continue;
+ } elseif (substr($file, -4) == '.php') {
+ require_once($import_root . '/' . $file);
+ }
}
}
+ closedir( $imports_dir );
}
-@closedir($imports_dir);
$importers = get_importers();
}
}
if ( empty($action) )
- $action = '<a href="' . esc_url(admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
- '&from=import&TB_iframe=true&width=600&height=550')) . '" class="thickbox" title="' .
+ $action = '<a href="' . esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_slug .
+ '&from=import&TB_iframe=true&width=600&height=550' ) ) . '" class="thickbox" title="' .
esc_attr__('Install importer') . '">' . $data[0] . '</a>';
} else {
$action = "<a href='" . esc_url("admin.php?import=$id") . "' title='" . esc_attr( wptexturize(strip_tags($data[1])) ) ."'>{$data[0]}</a>";
}
if ( current_user_can('install_plugins') )
- echo '<p>' . sprintf( __('If the importer you need is not listed, <a href="%s">search the plugins directory</a> to see if an importer is available.'), esc_url(admin_url('plugin-install.php?tab=search&type=tag&s=importer')) ) . '</p>';
+ echo '<p>' . sprintf( __('If the importer you need is not listed, <a href="%s">search the plugins directory</a> to see if an importer is available.'), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '</p>';
?>
</div>
/** WordPress Template Administration API */
require_once(ABSPATH . 'wp-admin/includes/template.php');
+/** WordPress List Table Administration API and base class */
+require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
+require_once(ABSPATH . 'wp-admin/includes/list-table.php');
+
/** WordPress Theme Administration API */
require_once(ABSPATH . 'wp-admin/includes/theme.php');
/** WordPress Update Administration API */
require_once(ABSPATH . 'wp-admin/includes/update.php');
-/** WordPress Registration API */
-require_once(ABSPATH . WPINC . '/registration.php');
-
/** WordPress Deprecated Administration API */
require_once(ABSPATH . 'wp-admin/includes/deprecated.php');
*/
/**
- * {@internal Missing Short Description}}
+ * Add a link to using values provided in $_POST.
*
- * @since unknown
+ * @since 2.0.0
*
- * @return unknown
+ * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.
*/
function add_link() {
return edit_link();
}
/**
- * {@internal Missing Short Description}}
+ * Update or insert a link using values provided in $_POST.
*
- * @since unknown
+ * @since 2.0.0
*
- * @param unknown_type $link_id
- * @return unknown
+ * @param int $link_id Optional. ID of the link to edit.
+ * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.
*/
-function edit_link( $link_id = '' ) {
- if (!current_user_can( 'manage_links' ))
- wp_die( __( 'Cheatin’ uh?' ));
+function edit_link( $link_id = 0 ) {
+ if ( !current_user_can( 'manage_links' ) )
+ wp_die( __( 'Cheatin’ uh?' ) );
$_POST['link_url'] = esc_html( $_POST['link_url'] );
$_POST['link_url'] = esc_url($_POST['link_url']);
if ( !empty( $link_id ) ) {
$_POST['link_id'] = $link_id;
- return wp_update_link( $_POST);
+ return wp_update_link( $_POST );
} else {
- return wp_insert_link( $_POST);
+ return wp_insert_link( $_POST );
}
}
/**
- * {@internal Missing Short Description}}
+ * Retrieve the default link for editing.
*
- * @since unknown
+ * @since 2.0.0
*
- * @return unknown
+ * @return object Default link
*/
function get_default_link_to_edit() {
if ( isset( $_GET['linkurl'] ) )
- $link->link_url = esc_url( $_GET['linkurl']);
+ $link->link_url = esc_url( $_GET['linkurl'] );
else
$link->link_url = '';
if ( isset( $_GET['name'] ) )
- $link->link_name = esc_attr( $_GET['name']);
+ $link->link_name = esc_attr( $_GET['name'] );
else
$link->link_name = '';
}
/**
- * {@internal Missing Short Description}}
+ * Delete link specified from database
*
- * @since unknown
+ * @since 2.0.0
*
- * @param unknown_type $link_id
- * @return unknown
+ * @param int $link_id ID of the link to delete
+ * @return bool True
*/
function wp_delete_link( $link_id ) {
global $wpdb;
}
/**
- * {@internal Missing Short Description}}
+ * Retrieves the link categories associated with the link specified.
*
- * @since unknown
+ * @since 2.1.0
*
- * @param unknown_type $link_id
- * @return unknown
+ * @param int $link_id Link ID to look up
+ * @return array The requested link's categories
*/
function wp_get_link_cats( $link_id = 0 ) {
}
/**
- * {@internal Missing Short Description}}
+ * Retrieve link data based on ID.
*
- * @since unknown
+ * @since 2.0.0
*
- * @param unknown_type $link_id
- * @return unknown
+ * @param int $link_id ID of link to retrieve
+ * @return object Link for editing
*/
function get_link_to_edit( $link_id ) {
return get_bookmark( $link_id, OBJECT, 'edit' );
}
/**
- * {@internal Missing Short Description}}
+ * This function inserts/updates links into/in the database.
*
- * @since unknown
+ * @since 2.0.0
*
- * @param unknown_type $linkdata
- * @return unknown
+ * @param array $linkdata Elements that make up the link to insert.
+ * @param bool $wp_error Optional. If true return WP_Error object on failure.
+ * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success.
*/
function wp_insert_link( $linkdata, $wp_error = false ) {
global $wpdb;
$link_rel = '';
// Make sure we set a valid category
- if ( ! isset( $link_category ) ||0 == count( $link_category ) || !is_array( $link_category ) ) {
+ if ( ! isset( $link_category ) || 0 == count( $link_category ) || !is_array( $link_category ) ) {
$link_category = array( get_option( 'default_link_category' ) );
}
}
/**
- * {@internal Missing Short Description}}
+ * Update link with the specified link categories.
*
- * @since unknown
+ * @since 2.1.0
*
- * @param unknown_type $link_id
- * @param unknown_type $link_categories
+ * @param int $link_id ID of link to update
+ * @param array $link_categories Array of categories to
*/
function wp_set_link_cats( $link_id = 0, $link_categories = array() ) {
// If $link_categories isn't already an array, make it one:
wp_set_object_terms( $link_id, $link_categories, 'link_category' );
clean_bookmark_cache( $link_id );
-} // wp_set_link_cats()
+}
/**
- * {@internal Missing Short Description}}
+ * Update a link in the database.
*
- * @since unknown
+ * @since 2.0.0
*
- * @param unknown_type $linkdata
- * @return unknown
+ * @param array $linkdata Link data to update.
+ * @return int|WP_Error Value 0 or WP_Error on failure. The updated link ID on success.
*/
function wp_update_link( $linkdata ) {
$link_id = (int) $linkdata['link_id'];
--- /dev/null
+<?php
+/**
+ * Comments and Post Comments List Table classes.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ */
+
+/**
+ * Comments List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_Comments_List_Table extends WP_List_Table {
+
+ var $checkbox = true;
+
+ var $pending_count = array();
+
+ function WP_Comments_List_Table() {
+ global $post_id;
+
+ $post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0;
+
+ if ( get_option('show_avatars') )
+ add_filter( 'comment_author', 'floated_admin_avatar' );
+
+ parent::WP_List_Table( array(
+ 'plural' => 'comments',
+ 'singular' => 'comment',
+ 'ajax' => true,
+ ) );
+ }
+
+ function ajax_user_can() {
+ return current_user_can('edit_posts');
+ }
+
+ function prepare_items() {
+ global $post_id, $comment_status, $search, $comment_type;
+
+ $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
+ if ( !in_array( $comment_status, array( 'all', 'moderated', 'approved', 'spam', 'trash' ) ) )
+ $comment_status = 'all';
+
+ $comment_type = !empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : '';
+
+ $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : '';
+
+ $user_id = ( isset( $_REQUEST['user_id'] ) ) ? $_REQUEST['user_id'] : '';
+
+ $orderby = ( isset( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : '';
+ $order = ( isset( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : '';
+
+ $comments_per_page = $this->get_per_page( $comment_status );
+
+ $doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
+
+ if ( isset( $_REQUEST['number'] ) ) {
+ $number = (int) $_REQUEST['number'];
+ }
+ else {
+ $number = $comments_per_page + min( 8, $comments_per_page ); // Grab a few extra
+ }
+
+ $page = $this->get_pagenum();
+
+ if ( isset( $_REQUEST['start'] ) ) {
+ $start = $_REQUEST['start'];
+ } else {
+ $start = ( $page - 1 ) * $comments_per_page;
+ }
+
+ if ( $doing_ajax && isset( $_REQUEST['offset'] ) ) {
+ $start += $_REQUEST['offset'];
+ }
+
+ $status_map = array(
+ 'moderated' => 'hold',
+ 'approved' => 'approve'
+ );
+
+ $args = array(
+ 'status' => isset( $status_map[$comment_status] ) ? $status_map[$comment_status] : $comment_status,
+ 'search' => $search,
+ 'user_id' => $user_id,
+ 'offset' => $start,
+ 'number' => $number,
+ 'post_id' => $post_id,
+ 'type' => $comment_type,
+ 'orderby' => $orderby,
+ 'order' => $order,
+ );
+
+ $_comments = get_comments( $args );
+
+ update_comment_cache( $_comments );
+
+ $this->items = array_slice( $_comments, 0, $comments_per_page );
+ $this->extra_items = array_slice( $_comments, $comments_per_page );
+
+ $total_comments = get_comments( array_merge( $args, array('count' => true, 'offset' => 0, 'number' => 0) ) );
+
+ $_comment_post_ids = array();
+ foreach ( $_comments as $_c ) {
+ $_comment_post_ids[] = $_c->comment_post_ID;
+ }
+
+ $this->pending_count = get_pending_comments_num( $_comment_post_ids );
+
+ $this->set_pagination_args( array(
+ 'total_items' => $total_comments,
+ 'per_page' => $comments_per_page,
+ ) );
+ }
+
+ function get_per_page( $comment_status = 'all' ) {
+ $comments_per_page = $this->get_items_per_page( 'edit_comments_per_page' );
+ $comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
+ return $comments_per_page;
+ }
+
+ function no_items() {
+ global $comment_status;
+
+ if ( 'moderated' == $comment_status )
+ _e( 'No comments awaiting moderation… yet.' );
+ else
+ _e( 'No comments found.' );
+ }
+
+ function get_views() {
+ global $post_id, $comment_status;
+
+ $status_links = array();
+ $num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments();
+ //, number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"),
+ //, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>")
+ $stati = array(
+ 'all' => _nx_noop('All', 'All', 'comments'), // singular not used
+ 'moderated' => _n_noop('Pending <span class="count">(<span class="pending-count">%s</span>)</span>', 'Pending <span class="count">(<span class="pending-count">%s</span>)</span>'),
+ 'approved' => _n_noop('Approved', 'Approved'), // singular not used
+ 'spam' => _n_noop('Spam <span class="count">(<span class="spam-count">%s</span>)</span>', 'Spam <span class="count">(<span class="spam-count">%s</span>)</span>'),
+ 'trash' => _n_noop('Trash <span class="count">(<span class="trash-count">%s</span>)</span>', 'Trash <span class="count">(<span class="trash-count">%s</span>)</span>')
+ );
+
+ if ( !EMPTY_TRASH_DAYS )
+ unset($stati['trash']);
+
+ $link = 'edit-comments.php';
+ if ( !empty($comment_type) && 'all' != $comment_type )
+ $link = add_query_arg( 'comment_type', $comment_type, $link );
+
+ foreach ( $stati as $status => $label ) {
+ $class = ( $status == $comment_status ) ? ' class="current"' : '';
+
+ if ( !isset( $num_comments->$status ) )
+ $num_comments->$status = 10;
+ $link = add_query_arg( 'comment_status', $status, $link );
+ if ( $post_id )
+ $link = add_query_arg( 'p', absint( $post_id ), $link );
+ /*
+ // I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
+ if ( !empty( $_REQUEST['s'] ) )
+ $link = add_query_arg( 's', esc_attr( stripslashes( $_REQUEST['s'] ) ), $link );
+ */
+ $status_links[$status] = "<a href='$link'$class>" . sprintf(
+ translate_nooped_plural( $label, $num_comments->$status ),
+ number_format_i18n( $num_comments->$status )
+ ) . '</a>';
+ }
+
+ $status_links = apply_filters( 'comment_status_links', $status_links );
+ return $status_links;
+ }
+
+ function get_bulk_actions() {
+ global $comment_status;
+
+ $actions = array();
+ if ( in_array( $comment_status, array( 'all', 'approved' ) ) )
+ $actions['unapprove'] = __( 'Unapprove' );
+ if ( in_array( $comment_status, array( 'all', 'moderated', 'spam' ) ) )
+ $actions['approve'] = __( 'Approve' );
+ if ( in_array( $comment_status, array( 'all', 'moderated', 'approved' ) ) )
+ $actions['spam'] = _x( 'Mark as Spam', 'comment' );
+
+ if ( 'trash' == $comment_status )
+ $actions['untrash'] = __( 'Restore' );
+ elseif ( 'spam' == $comment_status )
+ $actions['unspam'] = _x( 'Not Spam', 'comment' );
+
+ if ( in_array( $comment_status, array( 'trash', 'spam' ) ) || !EMPTY_TRASH_DAYS )
+ $actions['delete'] = __( 'Delete Permanently' );
+ else
+ $actions['trash'] = __( 'Move to Trash' );
+
+ return $actions;
+ }
+
+ function extra_tablenav( $which ) {
+ global $comment_status, $comment_type;
+?>
+ <div class="alignleft actions">
+<?php
+ if ( 'top' == $which ) {
+?>
+ <select name="comment_type">
+ <option value=""><?php _e( 'Show all comment types' ); ?></option>
+<?php
+ $comment_types = apply_filters( 'admin_comment_types_dropdown', array(
+ 'comment' => __( 'Comments' ),
+ 'pings' => __( 'Pings' ),
+ ) );
+
+ foreach ( $comment_types as $type => $label )
+ echo "\t<option value='" . esc_attr( $type ) . "'" . selected( $comment_type, $type, false ) . ">$label</option>\n";
+ ?>
+ </select>
+<?php
+ submit_button( __( 'Filter' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) );
+ }
+
+ if ( ( 'spam' == $comment_status || 'trash' == $comment_status ) && current_user_can( 'moderate_comments' ) ) {
+ wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
+ $title = ( 'spam' == $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
+ submit_button( $title, 'button-secondary apply', 'delete_all', false );
+ }
+ do_action( 'manage_comments_nav', $comment_status );
+ echo '</div>';
+ }
+
+ function current_action() {
+ if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) )
+ return 'delete_all';
+
+ return parent::current_action();
+ }
+
+ function get_columns() {
+ global $post_id;
+
+ $columns = array();
+
+ if ( $this->checkbox )
+ $columns['cb'] = '<input type="checkbox" />';
+
+ $columns['author'] = __( 'Author' );
+ $columns['comment'] = _x( 'Comment', 'column name' );
+
+ if ( !$post_id )
+ $columns['response'] = _x( 'In Response To', 'column name' );
+
+ return $columns;
+ }
+
+ function get_sortable_columns() {
+ return array(
+ 'author' => 'comment_author',
+ 'response' => 'comment_post_ID'
+ );
+ }
+
+ function display() {
+ extract( $this->_args );
+
+ wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
+
+ $this->display_tablenav( 'top' );
+
+?>
+<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
+ <thead>
+ <tr>
+ <?php $this->print_column_headers(); ?>
+ </tr>
+ </thead>
+
+ <tfoot>
+ <tr>
+ <?php $this->print_column_headers( false ); ?>
+ </tr>
+ </tfoot>
+
+ <tbody id="the-comment-list" class="list:comment">
+ <?php $this->display_rows_or_placeholder(); ?>
+ </tbody>
+
+ <tbody id="the-extra-comment-list" class="list:comment" style="display: none;">
+ <?php $this->items = $this->extra_items; $this->display_rows(); ?>
+ </tbody>
+</table>
+<?php
+
+ $this->display_tablenav( 'bottom' );
+ }
+
+ function single_row( $a_comment ) {
+ global $post, $comment, $the_comment_status;
+
+ $comment = $a_comment;
+ $the_comment_status = wp_get_comment_status( $comment->comment_ID );
+
+ $post = get_post( $comment->comment_post_ID );
+
+ $this->user_can = current_user_can( 'edit_comment', $comment->comment_ID );
+
+ echo "<tr id='comment-$comment->comment_ID' class='$the_comment_status'>";
+ echo $this->single_row_columns( $comment );
+ echo "</tr>";
+ }
+
+ function column_cb( $comment ) {
+ if ( $this->user_can )
+ echo "<input type='checkbox' name='delete_comments[]' value='$comment->comment_ID' />";
+ }
+
+ function column_comment( $comment ) {
+ global $post, $comment_status, $the_comment_status;
+
+ $user_can = $this->user_can;
+
+ $comment_url = esc_url( get_comment_link( $comment->comment_ID ) );
+
+ $ptime = date( 'G', strtotime( $comment->comment_date ) );
+ if ( ( abs( time() - $ptime ) ) < 86400 )
+ $ptime = sprintf( __( '%s ago' ), human_time_diff( $ptime ) );
+ else
+ $ptime = mysql2date( __( 'Y/m/d \a\t g:i A' ), $comment->comment_date );
+
+ if ( $user_can ) {
+ $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" ) );
+
+ $url = "comment.php?c=$comment->comment_ID";
+
+ $approve_url = esc_url( $url . "&action=approvecomment&$approve_nonce" );
+ $unapprove_url = esc_url( $url . "&action=unapprovecomment&$approve_nonce" );
+ $spam_url = esc_url( $url . "&action=spamcomment&$del_nonce" );
+ $unspam_url = esc_url( $url . "&action=unspamcomment&$del_nonce" );
+ $trash_url = esc_url( $url . "&action=trashcomment&$del_nonce" );
+ $untrash_url = esc_url( $url . "&action=untrashcomment&$del_nonce" );
+ $delete_url = esc_url( $url . "&action=deletecomment&$del_nonce" );
+ }
+
+ echo '<div class="submitted-on">';
+ /* translators: 2: comment date, 3: comment time */
+ printf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ), $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 = get_comment_author( $parent->comment_ID );
+ printf( ' | '.__( 'In reply to <a href="%1$s">%2$s</a>.' ), $parent_link, $name );
+ }
+
+ echo '</div>';
+ comment_text();
+ if ( $user_can ) { ?>
+ <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
+ <textarea class="comment" rows="1" cols="1"><?php echo esc_textarea( apply_filters( 'comment_edit_pre', $comment->comment_content ) ); ?></textarea>
+ <div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
+ <div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
+ <div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
+ <div class="comment_status"><?php echo $comment->comment_approved; ?></div>
+ </div>
+ <?php
+ }
+
+ if ( $user_can ) {
+ // preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash
+ $actions = array(
+ 'approve' => '', 'unapprove' => '',
+ 'reply' => '',
+ 'quickedit' => '',
+ 'edit' => '',
+ 'spam' => '', 'unspam' => '',
+ 'trash' => '', 'untrash' => '', 'delete' => ''
+ );
+
+ if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments
+ if ( 'approved' == $the_comment_status )
+ $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
+ else if ( 'unapproved' == $the_comment_status )
+ $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
+ } else {
+ $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
+ $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
+ }
+
+ if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {
+ $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
+ } elseif ( 'spam' == $the_comment_status ) {
+ $actions['unspam'] = "<a href='$unspam_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1 vim-z vim-destructive'>" . _x( 'Not Spam', 'comment' ) . '</a>';
+ } elseif ( 'trash' == $the_comment_status ) {
+ $actions['untrash'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1 vim-z vim-destructive'>" . __( 'Restore' ) . '</a>';
+ }
+
+ if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) {
+ $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::delete=1 delete vim-d vim-destructive'>" . __( 'Delete Permanently' ) . '</a>';
+ } else {
+ $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>';
+ }
+
+ if ( 'trash' != $the_comment_status ) {
+ $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . esc_attr__( 'Edit comment' ) . "'>". __( 'Edit' ) . '</a>';
+ $actions['quickedit'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\' );return false;" class="vim-q" title="'.esc_attr__( 'Quick Edit' ).'" href="#">' . __( 'Quick Edit' ) . '</a>';
+ if ( 'spam' != $the_comment_status )
+ $actions['reply'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\' );return false;" class="vim-r" title="'.esc_attr__( 'Reply to this comment' ).'" href="#">' . __( 'Reply' ) . '</a>';
+ }
+
+ $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );
+
+ $i = 0;
+ echo '<div class="row-actions">';
+ foreach ( $actions as $action => $link ) {
+ ++$i;
+ ( ( ( 'approve' == $action || 'unapprove' == $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
+
+ // Reply and quickedit need a hide-if-no-js span when not added with ajax
+ if ( ( 'reply' == $action || 'quickedit' == $action ) && ! defined('DOING_AJAX') )
+ $action .= ' hide-if-no-js';
+ elseif ( ( $action == 'untrash' && $the_comment_status == 'trash' ) || ( $action == 'unspam' && $the_comment_status == 'spam' ) ) {
+ if ( '1' == get_comment_meta( $comment->comment_ID, '_wp_trash_meta_status', true ) )
+ $action .= ' approve';
+ else
+ $action .= ' unapprove';
+ }
+
+ echo "<span class='$action'>$sep$link</span>";
+ }
+ echo '</div>';
+ }
+ }
+
+ function column_author( $comment ) {
+ global $comment_status;
+
+ $author_url = get_comment_author_url();
+ if ( 'http://' == $author_url )
+ $author_url = '';
+ $author_url_display = preg_replace( '|http://(www\.)?|i', '', $author_url );
+ if ( strlen( $author_url_display ) > 50 )
+ $author_url_display = substr( $author_url_display, 0, 49 ) . '...';
+
+ echo "<strong>"; comment_author(); echo '</strong><br />';
+ if ( !empty( $author_url ) )
+ echo "<a title='$author_url' href='$author_url'>$author_url_display</a><br />";
+
+ if ( $this->user_can ) {
+ if ( !empty( $comment->comment_author_email ) ) {
+ comment_author_email_link();
+ echo '<br />';
+ }
+ echo '<a href="edit-comments.php?s=';
+ comment_author_IP();
+ echo '&mode=detail';
+ if ( 'spam' == $comment_status )
+ echo '&comment_status=spam';
+ echo '">';
+ comment_author_IP();
+ echo '</a>';
+ }
+ }
+
+ function column_date( $comment ) {
+ return get_comment_date( __( 'Y/m/d \a\t g:ia' ) );
+ }
+
+ function column_response( $comment ) {
+ global $post;
+
+ if ( isset( $this->pending_count[$post->ID] ) ) {
+ $pending_comments = $this->pending_count[$post->ID];
+ } else {
+ $_pending_count_temp = get_pending_comments_num( array( $post->ID ) );
+ $pending_comments = $this->pending_count[$post->ID] = $_pending_count_temp[$post->ID];
+ }
+
+ if ( current_user_can( 'edit_post', $post->ID ) ) {
+ $post_link = "<a href='" . get_edit_post_link( $post->ID ) . "'>";
+ $post_link .= get_the_title( $post->ID ) . '</a>';
+ } else {
+ $post_link = get_the_title( $post->ID );
+ }
+
+ echo '<div class="response-links"><span class="post-com-count-wrapper">';
+ echo $post_link . '<br />';
+ $this->comments_bubble( $post->ID, $pending_comments );
+ echo '</span> ';
+ echo "<a href='" . get_permalink( $post->ID ) . "'>#</a>";
+ echo '</div>';
+ if ( 'attachment' == $post->post_type && ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) )
+ echo $thumb;
+ }
+
+ function column_default( $comment, $column_name ) {
+ do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );
+ }
+}
+
+/**
+ * Post Comments List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ *
+ * @see WP_Comments_Table
+ */
+class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
+
+ function get_column_info() {
+ $this->_column_headers = array(
+ array(
+ 'author' => __( 'Author' ),
+ 'comment' => _x( 'Comment', 'column name' ),
+ ),
+ array(),
+ array(),
+ );
+
+ return $this->_column_headers;
+ }
+
+ function get_table_classes() {
+ $classes = parent::get_table_classes();
+ $classes[] = 'comments-box';
+ return $classes;
+ }
+
+ function display( $output_empty = false ) {
+ extract( $this->_args );
+
+ wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
+?>
+<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0" style="display:none;">
+ <tbody id="the-comment-list"<?php if ( $singular ) echo " class='list:$singular'"; ?>>
+ <?php if ( ! $output_empty ) $this->display_rows_or_placeholder(); ?>
+ </tbody>
+</table>
+<?php
+ }
+
+ function get_per_page( $comment_status = false ) {
+ return 10;
+ }
+}
+
+?>
/**
* constructor
*
- * @param $arg mixed ingored argument
+ * @param mixed $arg ingored argument
*/
function WP_Filesystem_Direct($arg) {
$this->method = 'direct';
/**
* Reads entire file into a string
*
- * @param $file string Name of the file to read.
+ * @param string $file Name of the file to read.
* @return string|bool The function returns the read data or false on failure.
*/
function get_contents($file) {
/**
* Reads entire file into an array
*
- * @param $file string Path to the file.
+ * @param string $file Path to the file.
* @return array|bool the file contents in an array or false on failure.
*/
function get_contents_array($file) {
/**
* Write a string to a file
*
- * @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 string $file Remote path to the file where to write the data.
+ * @param string $contents The data to write.
+ * @param int $mode (optional) The file permissions as octal number, usually 0644.
* @return bool False upon failure.
*/
function put_contents($file, $contents, $mode = false ) {
/**
* Change directory
*
- * @param $dir string The new current directory.
+ * @param string $dir The new current directory.
* @return bool Returns true on success or false on failure.
*/
function chdir($dir) {
/**
* Changes file group
*
- * @param $file string Path to the file.
- * @param $group mixed A group name or number.
- * @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False.
+ * @param string $file Path to the file.
+ * @param mixed $group A group name or number.
+ * @param bool $recursive (optional) If set True changes file group recursivly. Defaults to False.
* @return bool Returns true on success or false on failure.
*/
function chgrp($file, $group, $recursive = false) {
/**
* Changes filesystem permissions
*
- * @param $file string Path to the file.
- * @param $mode int (optional) The permissions as octal number, usually 0644 for files, 0755 for dirs.
- * @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False.
+ * @param string $file Path to the file.
+ * @param int $mode (optional) The permissions as octal number, usually 0644 for files, 0755 for dirs.
+ * @param bool $recursive (optional) If set True changes file group recursivly. Defaults to False.
* @return bool Returns true on success or false on failure.
*/
function chmod($file, $mode = false, $recursive = false) {
/**
* Changes file owner
*
- * @param $file string Path to the file.
- * @param $owner mixed A user name or number.
- * @param $recursive bool (optional) If set True changes file owner recursivly. Defaults to False.
+ * @param string $file Path to the file.
+ * @param mixed $owner A user name or number.
+ * @param bool $recursive (optional) If set True changes file owner recursivly. Defaults to False.
* @return bool Returns true on success or false on failure.
*/
function chown($file, $owner, $recursive = false) {
/**
* Gets file owner
*
- * @param $file string Path to the file.
+ * @param string $file Path to the file.
* @return string Username of the user.
*/
function owner($file) {
*
* FIXME does not handle errors in fileperms()
*
- * @param $file string Path to the file.
+ * @param string $file Path to the file.
* @return string Mode of the file (last 4 digits).
*/
function getchmod($file) {
--- /dev/null
+<?php
+/**
+ * Links Manager List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_Links_List_Table extends WP_List_Table {
+
+ function WP_Links_List_Table() {
+ parent::WP_List_Table( array(
+ 'plural' => 'bookmarks',
+ ) );
+ }
+
+ function ajax_user_can() {
+ return current_user_can( 'manage_links' );
+ }
+
+ function prepare_items() {
+ global $cat_id, $s, $orderby, $order;
+
+ wp_reset_vars( array( 'action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'orderby', 'order', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]', 's' ) );
+
+ $args = array( 'hide_invisible' => 0, 'hide_empty' => 0 );
+
+ if ( 'all' != $cat_id )
+ $args['category'] = $cat_id;
+ if ( !empty( $s ) )
+ $args['search'] = $s;
+ if ( !empty( $orderby ) )
+ $args['orderby'] = $orderby;
+ if ( !empty( $order ) )
+ $args['order'] = $order;
+
+ $this->items = get_bookmarks( $args );
+ }
+
+ function no_items() {
+ _e( 'No links found.' );
+ }
+
+ function get_bulk_actions() {
+ $actions = array();
+ $actions['delete'] = __( 'Delete' );
+
+ return $actions;
+ }
+
+ function extra_tablenav( $which ) {
+ global $cat_id;
+
+ if ( 'top' != $which )
+ return;
+?>
+ <div class="alignleft actions">
+<?php
+ $dropdown_options = array(
+ 'selected' => $cat_id,
+ 'name' => 'cat_id',
+ 'taxonomy' => 'link_category',
+ 'show_option_all' => __( 'View all categories' ),
+ 'hide_empty' => true,
+ 'hierarchical' => 1,
+ 'show_count' => 0,
+ 'orderby' => 'name',
+ );
+ wp_dropdown_categories( $dropdown_options );
+ submit_button( __( 'Filter' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) );
+?>
+ </div>
+<?php
+ }
+
+ function get_columns() {
+ return array(
+ 'cb' => '<input type="checkbox" />',
+ 'name' => __( 'Name' ),
+ 'url' => __( 'URL' ),
+ 'categories' => __( 'Categories' ),
+ 'rel' => __( 'Relationship' ),
+ 'visible' => __( 'Visible' ),
+ 'rating' => __( 'Rating' )
+ );
+ }
+
+ function get_sortable_columns() {
+ return array(
+ 'name' => 'name',
+ 'url' => 'url',
+ 'visible' => 'visible',
+ 'rating' => 'rating'
+ );
+ }
+
+ function display_rows() {
+ global $cat_id;
+
+ $alt = 0;
+
+ foreach ( $this->items as $link ) {
+ $link = sanitize_bookmark( $link );
+ $link->link_name = esc_attr( $link->link_name );
+ $link->link_category = wp_get_link_cats( $link->link_id );
+
+ $short_url = url_shorten( $link->link_url );
+
+ $visible = ( $link->link_visible == 'Y' ) ? __( 'Yes' ) : __( 'No' );
+ $rating = $link->link_rating;
+ $style = ( $alt++ % 2 ) ? '' : ' class="alternate"';
+
+ $edit_link = get_edit_bookmark_link( $link );
+?>
+ <tr id="link-<?php echo $link->link_id; ?>" valign="middle" <?php echo $style; ?>>
+<?php
+
+ list( $columns, $hidden ) = $this->get_column_info();
+
+ foreach ( $columns as $column_name => $column_display_name ) {
+ $class = "class='column-$column_name'";
+
+ $style = '';
+ if ( in_array( $column_name, $hidden ) )
+ $style = ' style="display:none;"';
+
+ $attributes = $class . $style;
+
+ switch ( $column_name ) {
+ case 'cb':
+ echo '<th scope="row" class="check-column"><input type="checkbox" name="linkcheck[]" value="'. esc_attr( $link->link_id ) .'" /></th>';
+ break;
+
+ case 'name':
+ echo "<td $attributes><strong><a class='row-title' href='$edit_link' title='" . esc_attr( sprintf( __( 'Edit “%s”' ), $link->link_name ) ) . "'>$link->link_name</a></strong><br />";
+
+ $actions = array();
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ) . "' ) ) { return true;}return false;\">" . __( 'Delete' ) . "</a>";
+ echo $this->row_actions( $actions );
+
+ echo '</td>';
+ break;
+ case 'url':
+ echo "<td $attributes><a href='$link->link_url' title='". esc_attr( sprintf( __( 'Visit %s' ), $link->link_name ) )."'>$short_url</a></td>";
+ break;
+ case 'categories':
+ ?><td <?php echo $attributes ?>><?php
+ $cat_names = array();
+ foreach ( $link->link_category as $category ) {
+ $cat = get_term( $category, 'link_category', OBJECT, 'display' );
+ if ( is_wp_error( $cat ) )
+ echo $cat->get_error_message();
+ $cat_name = $cat->name;
+ if ( $cat_id != $category )
+ $cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>";
+ $cat_names[] = $cat_name;
+ }
+ echo implode( ', ', $cat_names );
+ ?></td><?php
+ break;
+ case 'rel':
+ ?><td <?php echo $attributes ?>><?php echo empty( $link->link_rel ) ? '<br />' : $link->link_rel; ?></td><?php
+ break;
+ case 'visible':
+ ?><td <?php echo $attributes ?>><?php echo $visible; ?></td><?php
+ break;
+ case 'rating':
+ ?><td <?php echo $attributes ?>><?php echo $rating; ?></td><?php
+ break;
+ default:
+ ?>
+ <td <?php echo $attributes ?>><?php do_action( 'manage_link_custom_column', $column_name, $link->link_id ); ?></td>
+ <?php
+ break;
+ }
+ }
+?>
+ </tr>
+<?php
+ }
+ }
+}
+
+?>
--- /dev/null
+<?php
+/**
+ * Base class for displaying a list of items in an ajaxified HTML table.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ */
+
+/**
+ * Base class for displaying a list of items in an ajaxified HTML table.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_List_Table {
+
+ /**
+ * The current list of items
+ *
+ * @since 3.1.0
+ * @var array
+ * @access protected
+ */
+ var $items;
+
+ /**
+ * Various information about the current table
+ *
+ * @since 3.1.0
+ * @var array
+ * @access private
+ */
+ var $_args;
+
+ /**
+ * Various information needed for displaying the pagination
+ *
+ * @since 3.1.0
+ * @var array
+ * @access private
+ */
+ var $_pagination_args = array();
+
+ /**
+ * The current screen
+ *
+ * @since 3.1.0
+ * @var object
+ * @access protected
+ */
+ var $screen;
+
+ /**
+ * Cached bulk actions
+ *
+ * @since 3.1.0
+ * @var array
+ * @access private
+ */
+ var $_actions;
+
+ /**
+ * Cached pagination output
+ *
+ * @since 3.1.0
+ * @var string
+ * @access private
+ */
+ var $_pagination;
+
+ /**
+ * Constructor. The child class should call this constructor from it's own constructor
+ *
+ * @param array $args An associative array with information about the current table
+ * @access protected
+ */
+ function WP_List_Table( $args = array() ) {
+ $args = wp_parse_args( $args, array(
+ 'plural' => '',
+ 'singular' => '',
+ 'ajax' => false
+ ) );
+
+ $screen = get_current_screen();
+
+ add_filter( "manage_{$screen->id}_columns", array( &$this, 'get_columns' ), 0 );
+
+ if ( !$args['plural'] )
+ $args['plural'] = $screen->base;
+
+ $this->_args = $args;
+
+ if ( $args['ajax'] ) {
+ // wp_enqueue_script( 'list-table' );
+ add_action( 'admin_footer', array( &$this, '_js_vars' ) );
+ }
+ }
+
+ /**
+ * Checks the current user's permissions
+ * @uses wp_die()
+ *
+ * @since 3.1.0
+ * @access public
+ * @abstract
+ */
+ function ajax_user_can() {
+ die( 'function WP_List_Table::ajax_user_can() must be over-ridden in a sub-class.' );
+ }
+
+ /**
+ * Prepares the list of items for displaying.
+ * @uses WP_List_Table::set_pagination_args()
+ *
+ * @since 3.1.0
+ * @access public
+ * @abstract
+ */
+ function prepare_items() {
+ die( 'function WP_List_Table::prepare_items() must be over-ridden in a sub-class.' );
+ }
+
+ /**
+ * An internal method that sets all the necessary pagination arguments
+ *
+ * @param array $args An associative array with information about the pagination
+ * @access protected
+ */
+ function set_pagination_args( $args ) {
+ $args = wp_parse_args( $args, array(
+ 'total_items' => 0,
+ 'total_pages' => 0,
+ 'per_page' => 0,
+ ) );
+
+ if ( !$args['total_pages'] && $args['per_page'] > 0 )
+ $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
+
+ $this->_pagination_args = $args;
+ }
+
+ /**
+ * Access the pagination args
+ *
+ * @since 3.1.0
+ * @access public
+ *
+ * @param string $key
+ * @return array
+ */
+ function get_pagination_arg( $key ) {
+ if ( 'page' == $key )
+ return $this->get_pagenum();
+
+ if ( isset( $this->_pagination_args[$key] ) )
+ return $this->_pagination_args[$key];
+ }
+
+ /**
+ * Whether the table has items to display or not
+ *
+ * @since 3.1.0
+ * @access public
+ *
+ * @return bool
+ */
+ function has_items() {
+ return !empty( $this->items );
+ }
+
+ /**
+ * Message to be displayed when there are no items
+ *
+ * @since 3.1.0
+ * @access public
+ */
+ function no_items() {
+ _e( 'No items found.' );
+ }
+
+ /**
+ * Display the search box.
+ *
+ * @since 3.1.0
+ * @access public
+ *
+ * @param string $text The search button text
+ * @param string $input_id The search input id
+ */
+ function search_box( $text, $input_id ) {
+ if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
+ return;
+
+ $input_id = $input_id . '-search-input';
+
+ if ( ! empty( $_REQUEST['orderby'] ) )
+ echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
+ if ( ! empty( $_REQUEST['order'] ) )
+ echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
+?>
+<p class="search-box">
+ <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
+ <input type="text" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
+ <?php submit_button( $text, 'button', false, false, array('id' => 'search-submit') ); ?>
+</p>
+<?php
+ }
+
+ /**
+ * Get an associative array ( id => link ) with the list
+ * of views available on this table.
+ *
+ * @since 3.1.0
+ * @access protected
+ *
+ * @return array
+ */
+ function get_views() {
+ return array();
+ }
+
+ /**
+ * Display the bulk actions dropdown.
+ *
+ * @since 3.1.0
+ * @access public
+ */
+ function views() {
+ $screen = get_current_screen();
+
+ $views = $this->get_views();
+ $views = apply_filters( 'views_' . $screen->id, $views );
+
+ if ( empty( $views ) )
+ return;
+
+ echo "<ul class='subsubsub'>\n";
+ foreach ( $views as $class => $view ) {
+ $views[ $class ] = "\t<li class='$class'>$view";
+ }
+ echo implode( " |</li>\n", $views ) . "</li>\n";
+ echo "</ul>";
+ }
+
+ /**
+ * Get an associative array ( option_name => option_title ) with the list
+ * of bulk actions available on this table.
+ *
+ * @since 3.1.0
+ * @access protected
+ *
+ * @return array
+ */
+ function get_bulk_actions() {
+ return array();
+ }
+
+ /**
+ * Display the bulk actions dropdown.
+ *
+ * @since 3.1.0
+ * @access public
+ */
+ function bulk_actions() {
+ $screen = get_current_screen();
+
+ if ( is_null( $this->_actions ) ) {
+ $no_new_actions = $this->_actions = $this->get_bulk_actions();
+ // This filter can currently only be used to remove actions.
+ $this->_actions = apply_filters( 'bulk_actions-' . $screen->id, $this->_actions );
+ $this->_actions = array_intersect_assoc( $this->_actions, $no_new_actions );
+ $two = '';
+ } else {
+ $two = '2';
+ }
+
+ if ( empty( $this->_actions ) )
+ return;
+
+ echo "<select name='action$two'>\n";
+ echo "<option value='-1' selected='selected'>" . __( 'Bulk Actions' ) . "</option>\n";
+ foreach ( $this->_actions as $name => $title )
+ echo "\t<option value='$name'>$title</option>\n";
+ echo "</select>\n";
+
+ submit_button( __( 'Apply' ), 'button-secondary action', false, false, array( 'id' => "doaction$two" ) );
+ echo "\n";
+ }
+
+ /**
+ * Get the current action selected from the bulk actions dropdown.
+ *
+ * @since 3.1.0
+ * @access public
+ *
+ * @return string|bool The action name or False if no action was selected
+ */
+ function current_action() {
+ if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
+ return $_REQUEST['action'];
+
+ if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] )
+ return $_REQUEST['action2'];
+
+ return false;
+ }
+
+ /**
+ * Generate row actions div
+ *
+ * @since 3.1.0
+ * @access protected
+ *
+ * @param array $actions The list of actions
+ * @param bool $always_visible Wether the actions should be always visible
+ * @return string
+ */
+ function row_actions( $actions, $always_visible = false ) {
+ $action_count = count( $actions );
+ $i = 0;
+
+ if ( !$action_count )
+ return '';
+
+ $out = '<div class="' . ( $always_visible ? 'row-actions-visible' : 'row-actions' ) . '">';
+ foreach ( $actions as $action => $link ) {
+ ++$i;
+ ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+ $out .= "<span class='$action'>$link$sep</span>";
+ }
+ $out .= '</div>';
+
+ return $out;
+ }
+
+ /**
+ * Display a monthly dropdown for filtering items
+ *
+ * @since 3.1.0
+ * @access protected
+ */
+ function months_dropdown( $post_type ) {
+ global $wpdb, $wp_locale;
+
+ $months = $wpdb->get_results( $wpdb->prepare( "
+ SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
+ FROM $wpdb->posts
+ WHERE post_type = %s
+ ORDER BY post_date DESC
+ ", $post_type ) );
+
+ $month_count = count( $months );
+
+ if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
+ return;
+
+ $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
+?>
+ <select name='m'>
+ <option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Show all dates' ); ?></option>
+<?php
+ foreach ( $months as $arc_row ) {
+ if ( 0 == $arc_row->year )
+ continue;
+
+ $month = zeroise( $arc_row->month, 2 );
+ $year = $arc_row->year;
+
+ printf( "<option %s value='%s'>%s</option>\n",
+ selected( $m, $year . $month, false ),
+ esc_attr( $arc_row->year . $month ),
+ $wp_locale->get_month( $month ) . " $year"
+ );
+ }
+?>
+ </select>
+<?php
+ }
+
+ /**
+ * Display a view switcher
+ *
+ * @since 3.1.0
+ * @access protected
+ */
+ function view_switcher( $current_mode ) {
+ $modes = array(
+ 'list' => __( 'List View' ),
+ 'excerpt' => __( 'Excerpt View' )
+ );
+
+?>
+ <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
+ <div class="view-switch">
+<?php
+ foreach ( $modes as $mode => $title ) {
+ $class = ( $current_mode == $mode ) ? 'class="current"' : '';
+ echo "<a href='" . esc_url( add_query_arg( 'mode', $mode, $_SERVER['REQUEST_URI'] ) ) . "' $class><img id='view-switch-$mode' src='" . esc_url( includes_url( 'images/blank.gif' ) ) . "' width='20' height='20' title='$title' alt='$title' /></a>\n";
+ }
+ ?>
+ </div>
+<?php
+ }
+
+ /**
+ * Display a comment count bubble
+ *
+ * @since 3.1.0
+ * @access protected
+ *
+ * @param int $post_id
+ * @param int $pending_comments
+ */
+ function comments_bubble( $post_id, $pending_comments ) {
+ $pending_phrase = sprintf( __( '%s pending' ), number_format( $pending_comments ) );
+
+ if ( $pending_comments )
+ echo '<strong>';
+
+ echo "<a href='" . esc_url( add_query_arg( 'p', $post_id, admin_url( 'edit-comments.php' ) ) ) . "' title='" . esc_attr( $pending_phrase ) . "' class='post-com-count'><span class='comment-count'>" . number_format_i18n( get_comments_number() ) . "</span></a>";
+
+ if ( $pending_comments )
+ echo '</strong>';
+ }
+
+ /**
+ * Get the current page number
+ *
+ * @since 3.1.0
+ * @access protected
+ *
+ * @return int
+ */
+ function get_pagenum() {
+ $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
+
+ if( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] )
+ $pagenum = $this->_pagination_args['total_pages'];
+
+ return max( 1, $pagenum );
+ }
+
+ /**
+ * Get number of items to display on a single page
+ *
+ * @since 3.1.0
+ * @access protected
+ *
+ * @return int
+ */
+ function get_items_per_page( $option, $default = 20 ) {
+ $per_page = (int) get_user_option( $option );
+ if ( empty( $per_page ) || $per_page < 1 )
+ $per_page = $default;
+
+ return (int) apply_filters( $option, $per_page );
+ }
+
+ /**
+ * Display the pagination.
+ *
+ * @since 3.1.0
+ * @access protected
+ */
+ function pagination( $which ) {
+ if ( empty( $this->_pagination_args ) )
+ return;
+
+ extract( $this->_pagination_args );
+
+ $output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
+
+ $current = $this->get_pagenum();
+
+ $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
+
+ $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
+
+ $page_links = array();
+
+ $disable_first = $disable_last = '';
+ if ( $current == 1 )
+ $disable_first = ' disabled';
+ if ( $current == $total_pages )
+ $disable_last = ' disabled';
+
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
+ 'first-page' . $disable_first,
+ esc_attr__( 'Go to the first page' ),
+ esc_url( remove_query_arg( 'paged', $current_url ) ),
+ '«'
+ );
+
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
+ 'prev-page' . $disable_first,
+ esc_attr__( 'Go to the previous page' ),
+ esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
+ '‹'
+ );
+
+ if ( 'bottom' == $which )
+ $html_current_page = $current;
+ else
+ $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' />",
+ esc_attr__( 'Current page' ),
+ esc_attr( 'paged' ),
+ $current,
+ strlen( $total_pages )
+ );
+
+ $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
+ $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>';
+
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
+ 'next-page' . $disable_last,
+ esc_attr__( 'Go to the next page' ),
+ esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
+ '›'
+ );
+
+ $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
+ 'last-page' . $disable_last,
+ esc_attr__( 'Go to the last page' ),
+ esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
+ '»'
+ );
+
+ $output .= "\n" . join( "\n", $page_links );
+
+ $page_class = $total_pages < 2 ? ' one-page' : '';
+
+ $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
+
+ echo $this->_pagination;
+ }
+
+ /**
+ * Get a list of columns. The format is:
+ * 'internal-name' => 'Title'
+ *
+ * @since 3.1.0
+ * @access protected
+ * @abstract
+ *
+ * @return array
+ */
+ function get_columns() {
+ die( 'function WP_List_Table::get_columns() must be over-ridden in a sub-class.' );
+ }
+
+ /**
+ * Get a list of sortable columns. The format is:
+ * 'internal-name' => 'orderby'
+ * or
+ * 'internal-name' => array( 'orderby', true )
+ *
+ * The second format will make the initial sorting order be descending
+ *
+ * @since 3.1.0
+ * @access protected
+ *
+ * @return array
+ */
+ function get_sortable_columns() {
+ return array();
+ }
+
+ /**
+ * Get a list of all, hidden and sortable columns, with filter applied
+ *
+ * @since 3.1.0
+ * @access protected
+ *
+ * @return array
+ */
+ function get_column_info() {
+ if ( isset( $this->_column_headers ) )
+ return $this->_column_headers;
+
+ $screen = get_current_screen();
+
+ $columns = get_column_headers( $screen );
+ $hidden = get_hidden_columns( $screen );
+
+ $_sortable = apply_filters( "manage_{$screen->id}_sortable_columns", $this->get_sortable_columns() );
+
+ $sortable = array();
+ foreach ( $_sortable as $id => $data ) {
+ if ( empty( $data ) )
+ continue;
+
+ $data = (array) $data;
+ if ( !isset( $data[1] ) )
+ $data[1] = false;
+
+ $sortable[$id] = $data;
+ }
+
+ $this->_column_headers = array( $columns, $hidden, $sortable );
+
+ return $this->_column_headers;
+ }
+
+ /**
+ * Return number of visible columns
+ *
+ * @since 3.1.0
+ * @access public
+ *
+ * @return int
+ */
+ function get_column_count() {
+ list ( $columns, $hidden ) = $this->get_column_info();
+ $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
+ return count( $columns ) - count( $hidden );
+ }
+
+ /**
+ * Print column headers, accounting for hidden and sortable columns.
+ *
+ * @since 3.1.0
+ * @access protected
+ *
+ * @param bool $with_id Whether to set the id attribute or not
+ */
+ function print_column_headers( $with_id = true ) {
+ $screen = get_current_screen();
+
+ list( $columns, $hidden, $sortable ) = $this->get_column_info();
+
+ $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
+ $current_url = remove_query_arg( 'paged', $current_url );
+
+ if ( isset( $_GET['orderby'] ) )
+ $current_orderby = $_GET['orderby'];
+ else
+ $current_orderby = '';
+
+ if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] )
+ $current_order = 'desc';
+ else
+ $current_order = 'asc';
+
+ foreach ( $columns as $column_key => $column_display_name ) {
+ $class = array( 'manage-column', "column-$column_key" );
+
+ $style = '';
+ if ( in_array( $column_key, $hidden ) )
+ $style = 'display:none;';
+
+ $style = ' style="' . $style . '"';
+
+ if ( 'cb' == $column_key )
+ $class[] = 'check-column';
+ elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
+ $class[] = 'num';
+
+ if ( isset( $sortable[$column_key] ) ) {
+ list( $orderby, $desc_first ) = $sortable[$column_key];
+
+ if ( $current_orderby == $orderby ) {
+ $order = 'asc' == $current_order ? 'desc' : 'asc';
+ $class[] = 'sorted';
+ $class[] = $current_order;
+ } else {
+ $order = $desc_first ? 'desc' : 'asc';
+ $class[] = 'sortable';
+ $class[] = $desc_first ? 'asc' : 'desc';
+ }
+
+ $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
+ }
+
+ $id = $with_id ? "id='$column_key'" : '';
+
+ if ( !empty( $class ) )
+ $class = "class='" . join( ' ', $class ) . "'";
+
+ echo "<th scope='col' $id $class $style>$column_display_name</th>";
+ }
+ }
+
+ /**
+ * Display the table
+ *
+ * @since 3.1.0
+ * @access public
+ */
+ function display() {
+ extract( $this->_args );
+
+ $this->display_tablenav( 'top' );
+
+?>
+<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
+ <thead>
+ <tr>
+ <?php $this->print_column_headers(); ?>
+ </tr>
+ </thead>
+
+ <tfoot>
+ <tr>
+ <?php $this->print_column_headers( false ); ?>
+ </tr>
+ </tfoot>
+
+ <tbody id="the-list"<?php if ( $singular ) echo " class='list:$singular'"; ?>>
+ <?php $this->display_rows_or_placeholder(); ?>
+ </tbody>
+</table>
+<?php
+ $this->display_tablenav( 'bottom' );
+ }
+
+ /**
+ * Get a list of CSS classes for the <table> tag
+ *
+ * @since 3.1.0
+ * @access protected
+ *
+ * @return array
+ */
+ function get_table_classes() {
+ return array( 'widefat', 'fixed', $this->_args['plural'] );
+ }
+
+ /**
+ * Generate the table navigation above or below the table
+ *
+ * @since 3.1.0
+ * @access protected
+ */
+ function display_tablenav( $which ) {
+ if ( 'top' == $which )
+ wp_nonce_field( 'bulk-' . $this->_args['plural'] );
+?>
+ <div class="tablenav <?php echo esc_attr( $which ); ?>">
+
+ <div class="alignleft actions">
+ <?php $this->bulk_actions( $which ); ?>
+ </div>
+<?php
+ $this->extra_tablenav( $which );
+ $this->pagination( $which );
+?>
+
+ <br class="clear" />
+ </div>
+<?php
+ }
+
+ /**
+ * Extra controls to be displayed between bulk actions and pagination
+ *
+ * @since 3.1.0
+ * @access protected
+ */
+ function extra_tablenav( $which ) {}
+
+ /**
+ * Generate the <tbody> part of the table
+ *
+ * @since 3.1.0
+ * @access protected
+ */
+ function display_rows_or_placeholder() {
+ if ( $this->has_items() ) {
+ $this->display_rows();
+ } else {
+ list( $columns, $hidden ) = $this->get_column_info();
+ echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
+ $this->no_items();
+ echo '</td></tr>';
+ }
+ }
+
+ /**
+ * Generate the table rows
+ *
+ * @since 3.1.0
+ * @access protected
+ */
+ function display_rows() {
+ foreach ( $this->items as $item )
+ $this->single_row( $item );
+ }
+
+ /**
+ * Generates content for a single row of the table
+ *
+ * @since 3.1.0
+ * @access protected
+ *
+ * @param object $item The current item
+ */
+ function single_row( $item ) {
+ static $row_class = '';
+ $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
+
+ echo '<tr' . $row_class . '>';
+ echo $this->single_row_columns( $item );
+ echo '</tr>';
+ }
+
+ /**
+ * Generates the columns for a single row of the table
+ *
+ * @since 3.1.0
+ * @access protected
+ *
+ * @param object $item The current item
+ */
+ function single_row_columns( $item ) {
+ list( $columns, $hidden ) = $this->get_column_info();
+
+ 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";
+
+ if ( 'cb' == $column_name ) {
+ echo '<th scope="row" class="check-column">';
+ echo $this->column_cb( $item );
+ echo '</th>';
+ }
+ elseif ( method_exists( $this, 'column_' . $column_name ) ) {
+ echo "<td $attributes>";
+ echo call_user_func( array( &$this, 'column_' . $column_name ), $item );
+ echo "</td>";
+ }
+ else {
+ echo "<td $attributes>";
+ echo $this->column_default( $item, $column_name );
+ echo "</td>";
+ }
+ }
+ }
+
+ /**
+ * Handle an incoming ajax request (called from admin-ajax.php)
+ *
+ * @since 3.1.0
+ * @access public
+ */
+ function ajax_response() {
+ $this->prepare_items();
+
+ extract( $this->_args );
+ extract( $this->_pagination_args );
+
+ ob_start();
+ if ( ! empty( $_REQUEST['no_placeholder'] ) )
+ $this->display_rows();
+ else
+ $this->display_rows_or_placeholder();
+
+ $rows = ob_get_clean();
+
+ $response = array( 'rows' => $rows );
+
+ if ( isset( $total_items ) )
+ $response['total_items_i18n'] = sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) );
+
+ if ( isset( $total_pages ) ) {
+ $response['total_pages'] = $total_pages;
+ $response['total_pages_i18n'] = number_format_i18n( $total_pages );
+ }
+
+ die( json_encode( $response ) );
+ }
+
+ /**
+ * Send required variables to JavaScript land
+ *
+ * @access private
+ */
+ function _js_vars() {
+ $args = array(
+ 'class' => get_class( $this ),
+ 'screen' => get_current_screen()
+ );
+
+ printf( "<script type='text/javascript'>list_args = %s;</script>\n", json_encode( $args ) );
+ }
+}
+?>
--- /dev/null
+<?php
+/**
+ * Media Library List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_Media_List_Table extends WP_List_Table {
+
+ function WP_Media_List_Table() {
+ $this->detached = isset( $_REQUEST['detached'] ) || isset( $_REQUEST['find_detached'] );
+
+ parent::WP_List_Table( array(
+ 'plural' => 'media'
+ ) );
+ }
+
+ function ajax_user_can() {
+ return current_user_can('upload_files');
+ }
+
+ function prepare_items() {
+ global $lost, $wpdb, $wp_query, $post_mime_types, $avail_post_mime_types;
+
+ $q = $_REQUEST;
+
+ if ( !empty( $lost ) )
+ $q['post__in'] = implode( ',', $lost );
+
+ list( $post_mime_types, $avail_post_mime_types ) = wp_edit_attachments_query( $q );
+
+ $this->is_trash = isset( $_REQUEST['status'] ) && 'trash' == $_REQUEST['status'];
+
+ $this->set_pagination_args( array(
+ 'total_items' => $wp_query->found_posts,
+ 'total_pages' => $wp_query->max_num_pages,
+ 'per_page' => $wp_query->query_vars['posts_per_page'],
+ ) );
+ }
+
+ function get_views() {
+ global $wpdb, $post_mime_types, $avail_post_mime_types;
+
+ $type_links = array();
+ $_num_posts = (array) wp_count_attachments();
+ $_total_posts = array_sum($_num_posts) - $_num_posts['trash'];
+ if ( !isset( $total_orphans ) )
+ $total_orphans = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1" );
+ $matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
+ foreach ( $matches as $type => $reals )
+ foreach ( $reals as $real )
+ $num_posts[$type] = ( isset( $num_posts[$type] ) ) ? $num_posts[$type] + $_num_posts[$real] : $_num_posts[$real];
+
+ $class = ( empty($_GET['post_mime_type']) && !$this->detached && !isset($_GET['status']) ) ? ' class="current"' : '';
+ $type_links['all'] = "<a href='upload.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $_total_posts, 'uploaded files' ), number_format_i18n( $_total_posts ) ) . '</a>';
+ foreach ( $post_mime_types as $mime_type => $label ) {
+ $class = '';
+
+ if ( !wp_match_mime_types($mime_type, $avail_post_mime_types) )
+ continue;
+
+ if ( !empty($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
+ $class = ' class="current"';
+ if ( !empty( $num_posts[$mime_type] ) )
+ $type_links[$mime_type] = "<a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
+ }
+ $type_links['detached'] = '<a href="upload.php?detached=1"' . ( $this->detached ? ' class="current"' : '' ) . '>' . sprintf( _nx( 'Unattached <span class="count">(%s)</span>', 'Unattached <span class="count">(%s)</span>', $total_orphans, 'detached files' ), number_format_i18n( $total_orphans ) ) . '</a>';
+
+ if ( !empty($_num_posts['trash']) )
+ $type_links['trash'] = '<a href="upload.php?status=trash"' . ( (isset($_GET['status']) && $_GET['status'] == 'trash' ) ? ' class="current"' : '') . '>' . sprintf( _nx( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '</a>';
+
+ return $type_links;
+ }
+
+ function get_bulk_actions() {
+ $actions = array();
+ $actions['delete'] = __( 'Delete Permanently' );
+ if ( $this->detached )
+ $actions['attach'] = __( 'Attach to a post' );
+
+ return $actions;
+ }
+
+ function extra_tablenav( $which ) {
+ global $post_type;
+ $post_type_obj = get_post_type_object( $post_type );
+?>
+ <div class="alignleft actions">
+<?php
+ if ( 'top' == $which && !is_singular() && !$this->detached && !$this->is_trash ) {
+ $this->months_dropdown( $post_type );
+
+ do_action( 'restrict_manage_posts' );
+ submit_button( __( 'Filter' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) );
+ }
+
+ if ( $this->detached ) {
+ submit_button( __( 'Scan for lost attachments' ), 'secondary', 'find_detached', false );
+ } elseif ( $this->is_trash && current_user_can( 'edit_others_posts' ) ) {
+ submit_button( __( 'Empty Trash' ), 'button-secondary apply', 'delete_all', false );
+ } ?>
+ </div>
+<?php
+ }
+
+ function current_action() {
+ if ( isset( $_REQUEST['find_detached'] ) )
+ return 'find_detached';
+
+ if ( isset( $_REQUEST['found_post_id'] ) && isset( $_REQUEST['media'] ) )
+ return 'attach';
+
+ if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) )
+ return 'delete_all';
+
+ return parent::current_action();
+ }
+
+ function has_items() {
+ return have_posts();
+ }
+
+ function no_items() {
+ _e( 'No media attachments found.' );
+ }
+
+ function get_columns() {
+ $posts_columns = array();
+ $posts_columns['cb'] = '<input type="checkbox" />';
+ $posts_columns['icon'] = '';
+ /* translators: column name */
+ $posts_columns['title'] = _x( 'File', 'column name' );
+ $posts_columns['author'] = __( 'Author' );
+ //$posts_columns['tags'] = _x( 'Tags', 'column name' );
+ /* translators: column name */
+ if ( !$this->detached ) {
+ $posts_columns['parent'] = _x( 'Attached to', 'column name' );
+ $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>';
+ }
+ /* translators: column name */
+ $posts_columns['date'] = _x( 'Date', 'column name' );
+ $posts_columns = apply_filters( 'manage_media_columns', $posts_columns, $this->detached );
+
+ return $posts_columns;
+ }
+
+ function get_sortable_columns() {
+ return array(
+ 'title' => 'title',
+ 'author' => 'author',
+ 'parent' => 'parent',
+ 'comments' => 'comment_count',
+ 'date' => array( 'date', true ),
+ );
+ }
+
+ function display_rows() {
+ global $post, $id;
+
+ add_filter( 'the_title','esc_html' );
+ $alt = '';
+
+ while ( have_posts() ) : the_post();
+
+ if ( $this->is_trash && $post->post_status != 'trash'
+ || !$this->is_trash && $post->post_status == 'trash' )
+ continue;
+
+ $alt = ( 'alternate' == $alt ) ? '' : 'alternate';
+ $post_owner = ( get_current_user_id() == $post->post_author ) ? 'self' : 'other';
+ $att_title = _draft_or_post_title();
+?>
+ <tr id='post-<?php echo $id; ?>' class='<?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
+<?php
+
+list( $columns, $hidden ) = $this->get_column_info();
+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':
+?>
+ <th scope="row" class="check-column"><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><input type="checkbox" name="media[]" value="<?php the_ID(); ?>" /><?php } ?></th>
+<?php
+ break;
+
+ case 'icon':
+ $attributes = 'class="column-icon media-icon"' . $style;
+?>
+ <td <?php echo $attributes ?>><?php
+ if ( $thumb = wp_get_attachment_image( $post->ID, array( 80, 60 ), true ) ) {
+ if ( $this->is_trash ) {
+ echo $thumb;
+ } else {
+?>
+ <a href="<?php echo get_edit_post_link( $post->ID, true ); ?>" title="<?php echo esc_attr( sprintf( __( 'Edit “%s”' ), $att_title ) ); ?>">
+ <?php echo $thumb; ?>
+ </a>
+
+<?php }
+ }
+?>
+ </td>
+<?php
+ break;
+
+ case 'title':
+?>
+ <td <?php echo $attributes ?>><strong><?php if ( $this->is_trash ) echo $att_title; else { ?><a href="<?php echo get_edit_post_link( $post->ID, true ); ?>" title="<?php echo esc_attr( sprintf( __( 'Edit “%s”' ), $att_title ) ); ?>"><?php echo $att_title; ?></a><?php } ?></strong>
+ <p>
+<?php
+ if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) )
+ echo esc_html( strtoupper( $matches[1] ) );
+ else
+ echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) );
+?>
+ </p>
+<?php
+ echo $this->row_actions( $this->_get_row_actions( $post, $att_title ) );
+?>
+ </td>
+<?php
+ break;
+
+ case 'author':
+?>
+ <td <?php echo $attributes ?>><?php the_author() ?></td>
+<?php
+ break;
+
+ case 'tags':
+?>
+ <td <?php echo $attributes ?>><?php
+ $tags = get_the_tags();
+ if ( !empty( $tags ) ) {
+ $out = array();
+ foreach ( $tags as $c )
+ $out[] = "<a href='edit.php?tag=$c->slug'> " . esc_html( sanitize_term_field( 'name', $c->name, $c->term_id, 'post_tag', 'display' ) ) . "</a>";
+ echo join( ', ', $out );
+ } else {
+ _e( 'No Tags' );
+ }
+?>
+ </td>
+<?php
+ break;
+
+ case 'desc':
+?>
+ <td <?php echo $attributes ?>><?php echo has_excerpt() ? $post->post_excerpt : ''; ?></td>
+<?php
+ break;
+
+ case 'date':
+ if ( '0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name ) {
+ $t_time = $h_time = __( 'Unpublished' );
+ } else {
+ $t_time = get_the_time( __( 'Y/m/d g:i:s A' ) );
+ $m_time = $post->post_date;
+ $time = get_post_time( 'G', true, $post, false );
+ if ( ( abs( $t_diff = time() - $time ) ) < 86400 ) {
+ if ( $t_diff < 0 )
+ $h_time = sprintf( __( '%s from now' ), human_time_diff( $time ) );
+ else
+ $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
+ } else {
+ $h_time = mysql2date( __( 'Y/m/d' ), $m_time );
+ }
+ }
+?>
+ <td <?php echo $attributes ?>><?php echo $h_time ?></td>
+<?php
+ break;
+
+ case 'parent':
+ if ( $post->post_parent > 0 ) {
+ if ( get_post( $post->post_parent ) ) {
+ $title =_draft_or_post_title( $post->post_parent );
+ }
+?>
+ <td <?php echo $attributes ?>>
+ <strong><a href="<?php echo get_edit_post_link( $post->post_parent ); ?>"><?php echo $title ?></a></strong>,
+ <?php echo get_the_time( __( 'Y/m/d' ) ); ?>
+ </td>
+<?php
+ } else {
+?>
+ <td <?php echo $attributes ?>><?php _e( '(Unattached)' ); ?><br />
+ <a class="hide-if-no-js" onclick="findPosts.open( 'media[]','<?php echo $post->ID ?>' );return false;" href="#the-list"><?php _e( 'Attach' ); ?></a></td>
+<?php
+ }
+ break;
+
+ case 'comments':
+ $attributes = 'class="comments column-comments num"' . $style;
+?>
+ <td <?php echo $attributes ?>>
+ <div class="post-com-count-wrapper">
+<?php
+ $pending_comments = get_pending_comments_num( $post->ID );
+
+ $this->comments_bubble( $post->ID, $pending_comments );
+?>
+ </div>
+ </td>
+<?php
+ break;
+
+ default:
+?>
+ <td <?php echo $attributes ?>>
+ <?php do_action( 'manage_media_custom_column', $column_name, $id ); ?>
+ </td>
+<?php
+ break;
+ }
+}
+?>
+ </tr>
+<?php endwhile;
+ }
+
+ function _get_row_actions( $post, $att_title ) {
+ $actions = array();
+
+ if ( $this->detached ) {
+ if ( current_user_can( 'edit_post', $post->ID ) )
+ $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '">' . __( 'Edit' ) . '</a>';
+ if ( current_user_can( 'delete_post', $post->ID ) )
+ if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
+ $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url( "post.php?action=trash&post=$post->ID", 'trash-attachment_' . $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
+ } else {
+ $delete_ays = !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
+ $actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url( "post.php?action=delete&post=$post->ID", 'delete-attachment_' . $post->ID ) . "'>" . __( 'Delete Permanently' ) . "</a>";
+ }
+ $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $att_title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
+ if ( current_user_can( 'edit_post', $post->ID ) )
+ $actions['attach'] = '<a href="#the-list" onclick="findPosts.open( \'media[]\',\''.$post->ID.'\' );return false;" class="hide-if-no-js">'.__( 'Attach' ).'</a>';
+ }
+ else {
+ if ( current_user_can( 'edit_post', $post->ID ) && !$this->is_trash )
+ $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '">' . __( 'Edit' ) . '</a>';
+ if ( current_user_can( 'delete_post', $post->ID ) ) {
+ if ( $this->is_trash )
+ $actions['untrash'] = "<a class='submitdelete' href='" . wp_nonce_url( "post.php?action=untrash&post=$post->ID", 'untrash-attachment_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
+ elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH )
+ $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url( "post.php?action=trash&post=$post->ID", 'trash-attachment_' . $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
+ if ( $this->is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) {
+ $delete_ays = ( !$this->is_trash && !MEDIA_TRASH ) ? " onclick='return showNotice.warn();'" : '';
+ $actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url( "post.php?action=delete&post=$post->ID", 'delete-attachment_' . $post->ID ) . "'>" . __( 'Delete Permanently' ) . "</a>";
+ }
+ }
+ if ( !$this->is_trash ) {
+ $title =_draft_or_post_title( $post->post_parent );
+ $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
+ }
+ }
+
+ $actions = apply_filters( 'media_row_actions', $actions, $post, $this->detached );
+
+ return $actions;
+ }
+}
+
+?>
--- /dev/null
+<?php
+/**
+ * Sites List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_MS_Sites_List_Table extends WP_List_Table {
+
+ function WP_MS_Sites_List_Table() {
+ parent::WP_List_Table( array(
+ 'plural' => 'sites',
+ ) );
+ }
+
+ function ajax_user_can() {
+ return current_user_can( 'manage_sites' );
+ }
+
+ function prepare_items() {
+ global $s, $mode, $wpdb, $current_site;
+
+ $mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode'];
+
+ $per_page = $this->get_items_per_page( 'sites_network_per_page' );
+
+ $pagenum = $this->get_pagenum();
+
+ $s = isset( $_REQUEST['s'] ) ? stripslashes( trim( $_REQUEST[ 's' ] ) ) : '';
+ $wild = '';
+ if ( false !== strpos($s, '*') ) {
+ $wild = '%';
+ $s = trim($s, '*');
+ }
+
+ $like_s = esc_sql( like_escape( $s ) );
+
+ $large_network = false;
+ // If the network is large and a search is not being performed, show only the latest blogs with no paging in order
+ // to avoid expensive count queries.
+ if ( !$s && ( get_blog_count() >= 10000 ) ) {
+ if ( !isset($_REQUEST['orderby']) )
+ $_GET['orderby'] = $_REQUEST['orderby'] = '';
+ if ( !isset($_REQUEST['order']) )
+ $_GET['order'] = $_REQUEST['order'] = 'DESC';
+ $large_network = true;
+ }
+
+ $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ";
+
+ if ( empty($s) ) {
+ // Nothing to do.
+ } elseif ( preg_match('/^[0-9]+\./', $s) ) {
+ // IP address
+ $reg_blog_ids = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->registration_log} WHERE {$wpdb->registration_log}.IP LIKE ( '{$like_s}$wild' )" );
+
+ if ( !$reg_blog_ids )
+ $reg_blog_ids = array( 0 );
+
+ $query = "SELECT *
+ FROM {$wpdb->blogs}
+ WHERE site_id = '{$wpdb->siteid}'
+ AND {$wpdb->blogs}.blog_id IN (" . implode( ', ', $reg_blog_ids ) . ")";
+ } else {
+ if ( is_numeric($s) ) {
+ $query .= " AND ( {$wpdb->blogs}.blog_id = '{$like_s}' )";
+ } elseif ( is_subdomain_install() ) {
+ $blog_s = str_replace( '.' . $current_site->domain, '', $like_s );
+ $blog_s .= $wild . '.' . $current_site->domain;
+ $query .= " AND ( {$wpdb->blogs}.domain LIKE '$blog_s' ) ";
+ } else {
+ if ( $like_s != trim('/', $current_site->path) )
+ $blog_s = $current_site->path .= $like_s . $wild . '/';
+ else
+ $blog_s = $like_s;
+ $query .= " AND ( {$wpdb->blogs}.path LIKE '$blog_s' )";
+ }
+ }
+
+ $order_by = isset( $_REQUEST['orderby'] ) ? $_REQUEST['orderby'] : '';
+ if ( $order_by == 'registered' ) {
+ $query .= ' ORDER BY registered ';
+ } elseif ( $order_by == 'lastupdated' ) {
+ $query .= ' ORDER BY last_updated ';
+ } elseif ( $order_by == 'blogname' ) {
+ if ( is_subdomain_install() )
+ $query .= ' ORDER BY domain ';
+ else
+ $query .= ' ORDER BY path ';
+ } elseif ( $order_by == 'blog_id' ) {
+ $query .= ' ORDER BY blog_id ';
+ } else {
+ $order_by = null;
+ }
+
+ if ( isset( $order_by ) ) {
+ $order = ( isset( $_REQUEST['order'] ) && 'DESC' == strtoupper( $_REQUEST['order'] ) ) ? "DESC" : "ASC";
+ $query .= $order;
+ }
+
+ // Don't do an unbounded count on large networks
+ if ( ! $large_network )
+ $total = $wpdb->get_var( str_replace( 'SELECT *', 'SELECT COUNT( blog_id )', $query ) );
+
+ $query .= " LIMIT " . intval( ( $pagenum - 1 ) * $per_page ) . ", " . intval( $per_page );
+ $this->items = $wpdb->get_results( $query, ARRAY_A );
+
+ if ( $large_network )
+ $total = count($this->items);
+
+ $this->set_pagination_args( array(
+ 'total_items' => $total,
+ 'per_page' => $per_page,
+ ) );
+ }
+
+ function no_items() {
+ _e( 'No sites found.' );
+ }
+
+ function get_bulk_actions() {
+ $actions = array();
+ if ( current_user_can( 'delete_sites' ) )
+ $actions['delete'] = __( 'Delete' );
+ $actions['spam'] = _x( 'Mark as Spam', 'site' );
+ $actions['notspam'] = _x( 'Not Spam', 'site' );
+
+ return $actions;
+ }
+
+ function pagination( $which ) {
+ global $mode;
+
+ parent::pagination( $which );
+
+ if ( 'top' == $which )
+ $this->view_switcher( $mode );
+ }
+
+ function get_columns() {
+ $blogname_columns = ( is_subdomain_install() ) ? __( 'Domain' ) : __( 'Path' );
+ $sites_columns = array(
+ 'cb' => '<input type="checkbox" />',
+ 'blogname' => $blogname_columns,
+ 'lastupdated' => __( 'Last Updated' ),
+ 'registered' => _x( 'Registered', 'site' ),
+ 'users' => __( 'Users' )
+ );
+
+ if ( has_filter( 'wpmublogsaction' ) )
+ $sites_columns['plugins'] = __( 'Actions' );
+
+ $sites_columns = apply_filters( 'wpmu_blogs_columns', $sites_columns );
+
+ return $sites_columns;
+ }
+
+ function get_sortable_columns() {
+ return array(
+ 'blogname' => 'blogname',
+ 'lastupdated' => 'lastupdated',
+ 'registered' => 'blog_id',
+ );
+ }
+
+ function display_rows() {
+ global $current_site, $mode;
+
+ $status_list = array(
+ 'archived' => array( 'site-archived', __( 'Archived' ) ),
+ 'spam' => array( 'site-spammed', _x( 'Spam', 'site' ) ),
+ 'deleted' => array( 'site-deleted', __( 'Deleted' ) ),
+ 'mature' => array( 'site-mature', __( 'Mature' ) )
+ );
+
+ $class = '';
+ foreach ( $this->items as $blog ) {
+ $class = ( 'alternate' == $class ) ? '' : 'alternate';
+ reset( $status_list );
+
+ $blog_states = array();
+ foreach ( $status_list as $status => $col ) {
+ if ( get_blog_status( $blog['blog_id'], $status ) == 1 ) {
+ $class = $col[0];
+ $blog_states[] = $col[1];
+ }
+ }
+ $blog_state = '';
+ if ( ! empty( $blog_states ) ) {
+ $state_count = count( $blog_states );
+ $i = 0;
+ $blog_state .= ' - ';
+ foreach ( $blog_states as $state ) {
+ ++$i;
+ ( $i == $state_count ) ? $sep = '' : $sep = ', ';
+ $blog_state .= "<span class='post-state'>$state$sep</span>";
+ }
+ }
+ echo "<tr class='$class'>";
+
+ $blogname = ( is_subdomain_install() ) ? str_replace( '.'.$current_site->domain, '', $blog['domain'] ) : $blog['path'];
+
+ list( $columns, $hidden ) = $this->get_column_info();
+
+ foreach ( $columns as $column_name => $column_display_name ) {
+ $style = '';
+ if ( in_array( $column_name, $hidden ) )
+ $style = ' style="display:none;"';
+
+ switch ( $column_name ) {
+ case 'cb': ?>
+ <th scope="row" class="check-column">
+ <input type="checkbox" id="blog_<?php echo $blog['blog_id'] ?>" name="allblogs[]" value="<?php echo esc_attr( $blog['blog_id'] ) ?>" />
+ </th>
+ <?php
+ break;
+
+ case 'id':?>
+ <th valign="top" scope="row">
+ <?php echo $blog['blog_id'] ?>
+ </th>
+ <?php
+ break;
+
+ case 'blogname':
+ echo "<td class='column-$column_name $column_name'$style>"; ?>
+ <a href="<?php echo esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ); ?>" class="edit"><?php echo $blogname . $blog_state; ?></a>
+ <?php
+ if ( 'list' != $mode )
+ echo '<p>' . sprintf( _x( '%1$s – <em>%2$s</em>', '%1$s: site name. %2$s: site tagline.' ), get_blog_option( $blog['blog_id'], 'blogname' ), get_blog_option( $blog['blog_id'], 'blogdescription ' ) ) . '</p>';
+
+ // Preordered.
+ $actions = array(
+ 'edit' => '', 'backend' => '',
+ 'activate' => '', 'deactivate' => '',
+ 'archive' => '', 'unarchive' => '',
+ 'spam' => '', 'unspam' => '',
+ 'delete' => '',
+ 'visit' => '',
+ );
+
+ $actions['edit'] = '<span class="edit"><a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>';
+ $actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>';
+ if ( $current_site->blog_id != $blog['blog_id'] ) {
+ if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' )
+ $actions['activate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ), 'confirm' ) ) . '">' . __( 'Activate' ) . '</a></span>';
+ else
+ $actions['deactivate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to deactivate the site %s' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Deactivate' ) . '</a></span>';
+
+ if ( get_blog_status( $blog['blog_id'], 'archived' ) == '1' )
+ $actions['unarchive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unarchive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Unarchive' ) . '</a></span>';
+ else
+ $actions['archive'] = '<span class="archive"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to archive the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></span>';
+
+ if ( get_blog_status( $blog['blog_id'], 'spam' ) == '1' )
+ $actions['unspam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unspam the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Not Spam', 'site' ) . '</a></span>';
+ else
+ $actions['spam'] = '<span class="spam"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to mark the site %s as spam.' ), $blogname ) ) ), 'confirm') ) . '">' . _x( 'Spam', 'site' ) . '</a></span>';
+
+ if ( current_user_can( 'delete_site', $blog['blog_id'] ) )
+ $actions['delete'] = '<span class="delete"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'edit.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ), 'confirm') ) . '">' . __( 'Delete' ) . '</a></span>';
+ }
+
+ $actions['visit'] = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'] ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>';
+
+ $actions = apply_filters( 'manage_sites_action_links', array_filter( $actions ), $blog['blog_id'], $blogname );
+ echo $this->row_actions( $actions );
+ ?>
+ </td>
+ <?php
+ break;
+
+ case 'lastupdated':
+ echo "<td valign='top' class='$column_name column-$column_name'$style>";
+ if ( 'list' == $mode )
+ $date = 'Y/m/d';
+ else
+ $date = 'Y/m/d \<\b\r \/\> g:i:s a';
+ echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( $date, $blog['last_updated'] ); ?>
+ </td>
+ <?php
+ break;
+ case 'registered':
+ echo "<td valign='top' class='$column_name column-$column_name'$style>";
+ if ( $blog['registered'] == '0000-00-00 00:00:00' )
+ echo '—';
+ else
+ echo mysql2date( $date, $blog['registered'] );
+ ?>
+ </td>
+ <?php
+ break;
+ case 'users':
+ echo "<td valign='top' class='$column_name column-$column_name'$style>";
+ $blogusers = get_users( array( 'blog_id' => $blog['blog_id'], 'number' => 6) );
+ if ( is_array( $blogusers ) ) {
+ $blogusers_warning = '';
+ if ( count( $blogusers ) > 5 ) {
+ $blogusers = array_slice( $blogusers, 0, 5 );
+ $blogusers_warning = __( 'Only showing first 5 users.' ) . ' <a href="' . esc_url( network_admin_url( 'site-users.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'More' ) . '</a>';
+ }
+ foreach ( $blogusers as $user_object ) {
+ echo '<a href="' . esc_url( network_admin_url( 'user-edit.php?user_id=' . $user_object->ID ) ) . '">' . esc_html( $user_object->user_login ) . '</a> ';
+ if ( 'list' != $mode )
+ echo '( ' . $user_object->user_email . ' )';
+ echo '<br />';
+ }
+ if ( $blogusers_warning != '' )
+ echo '<strong>' . $blogusers_warning . '</strong><br />';
+ }
+ ?>
+ </td>
+ <?php
+ break;
+
+ case 'plugins': ?>
+ <?php if ( has_filter( 'wpmublogsaction' ) ) {
+ echo "<td valign='top' class='$column_name column-$column_name'$style>";
+ do_action( 'wpmublogsaction', $blog['blog_id'] ); ?>
+ </td>
+ <?php }
+ break;
+
+ default:
+ echo "<td class='$column_name column-$column_name'$style>";
+ do_action( 'manage_sites_custom_column', $column_name, $blog['blog_id'] );
+ echo "</td>";
+ break;
+ }
+ }
+ ?>
+ </tr>
+ <?php
+ }
+ }
+}
+
+?>
--- /dev/null
+<?php
+/**
+ * MS Themes List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_MS_Themes_List_Table extends WP_List_Table {
+
+ var $site_id;
+ var $is_site_themes;
+
+ function WP_MS_Themes_List_Table() {
+ global $status, $page;
+
+ $default_status = get_user_option( 'themes_last_view' );
+ if ( empty( $default_status ) )
+ $default_status = 'all';
+ $status = isset( $_REQUEST['theme_status'] ) ? $_REQUEST['theme_status'] : $default_status;
+ if ( !in_array( $status, array( 'all', 'enabled', 'disabled', 'upgrade', 'search' ) ) )
+ $status = 'all';
+ if ( $status != $default_status && 'search' != $status )
+ update_user_meta( get_current_user_id(), 'themes_last_view', $status );
+
+ $page = $this->get_pagenum();
+
+ $screen = get_current_screen();
+ $this->is_site_themes = ( 'site-themes-network' == $screen->id ) ? true : false;
+
+ if ( $this->is_site_themes )
+ $this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+
+ parent::WP_List_Table( array(
+ 'plural' => 'themes'
+ ) );
+ }
+
+ function get_table_classes() {
+ return array( 'widefat', 'plugins' ); // todo: remove and add CSS for .themes
+ }
+
+ function ajax_user_can() {
+ $menu_perms = get_site_option( 'menu_items', array() );
+
+ if ( empty( $menu_perms['themes'] ) && ! is_super_admin() )
+ return false;
+
+ if ( $this->is_site_themes && !current_user_can('manage_sites') )
+ return false;
+ elseif ( !$this->is_site_themes && !current_user_can('manage_network_themes') )
+ return false;
+ return true;
+ }
+
+ function prepare_items() {
+ global $status, $themes, $totals, $page, $orderby, $order, $s;
+
+ wp_reset_vars( array( 'orderby', 'order', 's' ) );
+
+ $themes = array(
+ 'all' => apply_filters( 'all_themes', get_themes() ),
+ 'search' => array(),
+ 'enabled' => array(),
+ 'disabled' => array(),
+ 'upgrade' => array()
+ );
+
+ $site_allowed_themes = get_site_allowed_themes();
+ if ( !$this->is_site_themes ) {
+ $allowed_themes = $site_allowed_themes;
+ $themes_per_page = $this->get_items_per_page( 'themes_network_per_page' );
+ } else {
+ $allowed_themes = wpmu_get_blog_allowedthemes( $this->site_id );
+ $themes_per_page = $this->get_items_per_page( 'site_themes_network_per_page' );
+ }
+
+ $current = get_site_transient( 'update_themes' );
+
+ foreach ( (array) $themes['all'] as $key => $theme ) {
+ $theme_key = $theme['Stylesheet'];
+
+ if ( isset( $allowed_themes [ $theme_key ] ) ) {
+ $themes['all'][$key]['enabled'] = true;
+ $themes['enabled'][$key] = $themes['all'][$key];
+ }
+ else {
+ $themes['all'][$key]['enabled'] = false;
+ $themes['disabled'][$key] = $themes['all'][$key];
+ }
+ if ( isset( $current->response[ $theme['Template'] ] ) )
+ $themes['upgrade'][$key] = $themes['all'][$key];
+
+ if ( $this->is_site_themes && isset( $site_allowed_themes[$theme_key] ) ) {
+ unset( $themes['all'][$key] );
+ unset( $themes['enabled'][$key] );
+ unset( $themes['disabled'][$key] );
+ }
+ }
+
+ if ( !current_user_can( 'update_themes' ) || $this->is_site_themes )
+ $themes['upgrade'] = array();
+
+ if ( $s ) {
+ $status = 'search';
+ $themes['search'] = array_filter( $themes['all'], array( &$this, '_search_callback' ) );
+ }
+
+ $totals = array();
+ foreach ( $themes as $type => $list )
+ $totals[ $type ] = count( $list );
+
+ if ( empty( $themes[ $status ] ) && !in_array( $status, array( 'all', 'search' ) ) )
+ $status = 'all';
+
+ $this->items = $themes[ $status ];
+ $total_this_page = $totals[ $status ];
+
+ if ( $orderby ) {
+ $orderby = ucfirst( $orderby );
+ $order = strtoupper( $order );
+
+ uasort( $this->items, array( &$this, '_order_callback' ) );
+ }
+
+ $start = ( $page - 1 ) * $themes_per_page;
+
+ if ( $total_this_page > $themes_per_page )
+ $this->items = array_slice( $this->items, $start, $themes_per_page );
+
+ $this->set_pagination_args( array(
+ 'total_items' => $total_this_page,
+ 'per_page' => $themes_per_page,
+ ) );
+ }
+
+ function _search_callback( $theme ) {
+ static $term;
+ if ( is_null( $term ) )
+ $term = stripslashes( $_REQUEST['s'] );
+
+ $search_fields = array( 'Name', 'Title', 'Description', 'Author', 'Author Name', 'Author URI', 'Template', 'Stylesheet' );
+ foreach ( $search_fields as $field )
+ if ( stripos( $theme[ $field ], $term ) !== false )
+ return true;
+
+ return false;
+ }
+
+ function _order_callback( $theme_a, $theme_b ) {
+ global $orderby, $order;
+
+ $a = $theme_a[$orderby];
+ $b = $theme_b[$orderby];
+
+ if ( $a == $b )
+ return 0;
+
+ if ( 'DESC' == $order )
+ return ( $a < $b ) ? 1 : -1;
+ else
+ return ( $a < $b ) ? -1 : 1;
+ }
+
+ function no_items() {
+ global $themes;
+
+ if ( !empty( $themes['all'] ) )
+ _e( 'No themes found.' );
+ else
+ _e( 'You do not appear to have any themes available at this time.' );
+ }
+
+ function get_columns() {
+ global $status;
+
+ return array(
+ 'cb' => '<input type="checkbox" />',
+ 'name' => __( 'Theme' ),
+ 'description' => __( 'Description' ),
+ );
+ }
+
+ function get_sortable_columns() {
+ return array(
+ 'name' => 'name',
+ );
+ }
+
+ function get_views() {
+ global $totals, $status;
+
+ $status_links = array();
+ foreach ( $totals as $type => $count ) {
+ if ( !$count )
+ continue;
+
+ switch ( $type ) {
+ case 'all':
+ $text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'themes' );
+ break;
+ case 'enabled':
+ $text = _n( 'Enabled <span class="count">(%s)</span>', 'Enabled <span class="count">(%s)</span>', $count );
+ break;
+ case 'disabled':
+ $text = _n( 'Disabled <span class="count">(%s)</span>', 'Disabled <span class="count">(%s)</span>', $count );
+ break;
+ case 'upgrade':
+ $text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
+ break;
+ }
+
+ if ( $this->is_site_themes )
+ $url = 'site-themes.php?id=' . $this->site_id;
+ else
+ $url = 'themes.php';
+
+ if ( 'search' != $type ) {
+ $status_links[$type] = sprintf( "<a href='%s' %s>%s</a>",
+ esc_url( add_query_arg('theme_status', $type, $url) ),
+ ( $type == $status ) ? ' class="current"' : '',
+ sprintf( $text, number_format_i18n( $count ) )
+ );
+ }
+ }
+
+ return $status_links;
+ }
+
+ function get_bulk_actions() {
+ global $status;
+
+ $actions = array();
+ if ( 'enabled' != $status )
+ $actions['enable-selected'] = $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' );
+ if ( 'disabled' != $status )
+ $actions['disable-selected'] = $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' );
+ if ( ! $this->is_site_themes ) {
+ if ( current_user_can( 'delete_themes' ) )
+ $actions['delete-selected'] = __( 'Delete' );
+ if ( current_user_can( 'update_themes' ) )
+ $actions['update-selected'] = __( 'Update' );
+ }
+ return $actions;
+ }
+
+ function bulk_actions( $which ) {
+ global $status;
+ parent::bulk_actions( $which );
+ }
+
+ function current_action() {
+ return parent::current_action();
+ }
+
+ function display_rows() {
+ foreach ( $this->items as $key => $theme )
+ $this->single_row( $key, $theme );
+ }
+
+ function single_row( $key, $theme ) {
+ global $status, $page, $s;
+
+ $context = $status;
+
+ if ( $this->is_site_themes )
+ $url = "site-themes.php?id={$this->site_id}&";
+ else
+ $url = 'themes.php?';
+
+ // preorder
+ $actions = array(
+ 'enable' => '',
+ 'disable' => '',
+ 'edit' => '',
+ 'delete' => ''
+ );
+
+ $theme_key = $theme['Stylesheet'];
+
+ if ( empty( $theme['enabled'] ) )
+ $actions['enable'] = '<a href="' . esc_url( wp_nonce_url($url . 'action=enable&theme=' . $theme_key . '&paged=' . $page . '&s=' . $s, 'enable-theme_' . $theme_key) ) . '" title="' . esc_attr__('Enable this theme') . '" class="edit">' . ( $this->is_site_themes ? __( 'Enable' ) : __( 'Network Enable' ) ) . '</a>';
+ else
+ $actions['disable'] = '<a href="' . esc_url( wp_nonce_url($url . 'action=disable&theme=' . $theme_key . '&paged=' . $page . '&s=' . $s, 'disable-theme_' . $theme_key) ) . '" title="' . esc_attr__('Disable this theme') . '">' . ( $this->is_site_themes ? __( 'Disable' ) : __( 'Network Disable' ) ) . '</a>';
+
+ if ( current_user_can('edit_themes') )
+ $actions['edit'] = '<a href="' . esc_url('theme-editor.php?theme=' . urlencode( $theme['Name'] )) . '" title="' . esc_attr__('Open this theme in the Theme Editor') . '" class="edit">' . __('Edit') . '</a>';
+
+ if ( empty( $theme['enabled'] ) && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $theme_key != get_option( 'stylesheet' ) && $theme_key != get_option( 'template' ) )
+ $actions['delete'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=delete-selected&checked[]=' . $theme_key . '&theme_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-themes' ) ) . '" title="' . esc_attr__( 'Delete this theme' ) . '" class="delete">' . __( 'Delete' ) . '</a>';
+
+ $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme_key, $theme, $context );
+ $actions = apply_filters( "theme_action_links_$theme_key", $actions, $theme_key, $theme, $context );
+
+ $class = empty( $theme['enabled'] ) ? 'inactive' : 'active';
+ $checkbox_id = "checkbox_" . md5($theme['Name']);
+ $checkbox = "<input type='checkbox' name='checked[]' value='" . esc_attr( $theme_key ) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $theme['Name'] . "</label>";
+
+ $description = '<p>' . $theme['Description'] . '</p>';
+ $theme_name = $theme['Name'];
+
+ $id = sanitize_title( $theme_name );
+
+ echo "<tr id='$id' class='$class'>";
+
+ list( $columns, $hidden ) = $this->get_column_info();
+
+ foreach ( $columns as $column_name => $column_display_name ) {
+ $style = '';
+ if ( in_array( $column_name, $hidden ) )
+ $style = ' style="display:none;"';
+
+ switch ( $column_name ) {
+ case 'cb':
+ echo "<th scope='row' class='check-column'>$checkbox</th>";
+ break;
+ case 'name':
+ echo "<td class='theme-title'$style><strong>$theme_name</strong>";
+ echo $this->row_actions( $actions, true );
+ echo "</td>";
+ break;
+ case 'description':
+ echo "<td class='column-description desc'$style>
+ <div class='theme-description'>$description</div>
+ <div class='$class second theme-version-author-uri'>";
+
+ $theme_meta = array();
+
+ if ( !empty( $theme['Version'] ) )
+ $theme_meta[] = sprintf( __( 'Version %s' ), $theme['Version'] );
+
+ if ( !empty( $theme['Author'] ) )
+ $theme_meta[] = sprintf( __( 'By %s' ), $theme['Author'] );
+
+ if ( !empty( $theme['Theme URI'] ) )
+ $theme_meta[] = '<a href="' . $theme['Theme URI'] . '" title="' . esc_attr__( 'Visit theme homepage' ) . '">' . __( 'Visit Theme Site' ) . '</a>';
+
+ $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $theme_key, $theme, $status );
+ echo implode( ' | ', $theme_meta );
+
+ echo "</div></td>";
+ break;
+
+ default:
+ echo "<td class='$column_name column-$column_name'$style>";
+ do_action( 'manage_themes_custom_column', $column_name, $theme_key, $theme );
+ echo "</td>";
+ }
+ }
+
+ echo "</tr>";
+
+ if ( $this->is_site_themes )
+ remove_action( "after_theme_row_$theme_key", 'wp_theme_update_row' );
+ do_action( 'after_theme_row', $theme_key, $theme, $status );
+ do_action( "after_theme_row_$theme_key", $theme_key, $theme, $status );
+ }
+}
+
+?>
--- /dev/null
+<?php
+/**
+ * Multisite Users List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_MS_Users_List_Table extends WP_List_Table {
+
+ function ajax_user_can() {
+ return current_user_can( 'manage_network_users' );
+ }
+
+ function prepare_items() {
+ global $usersearch, $role, $wpdb, $mode;
+
+ $usersearch = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
+
+ $users_per_page = $this->get_items_per_page( 'users_network_per_page' );
+
+ $role = isset( $_REQUEST['role'] ) ? $_REQUEST['role'] : '';
+
+ $paged = $this->get_pagenum();
+
+ $args = array(
+ 'number' => $users_per_page,
+ 'offset' => ( $paged-1 ) * $users_per_page,
+ 'search' => $usersearch,
+ 'blog_id' => 0,
+ 'fields' => 'all_with_meta'
+ );
+
+ $args['search'] = ltrim($args['search'], '*');
+
+ if ( $role == 'super' ) {
+ $logins = implode( "', '", get_super_admins() );
+ $args['include'] = $wpdb->get_col( "SELECT ID FROM $wpdb->users WHERE user_login IN ('$logins')" );
+ }
+
+ // If the network is large and a search is not being performed, show only the latest users with no paging in order
+ // to avoid expensive count queries.
+ if ( !$usersearch && ( get_blog_count() >= 10000 ) ) {
+ if ( !isset($_REQUEST['orderby']) )
+ $_GET['orderby'] = $_REQUEST['orderby'] = 'id';
+ if ( !isset($_REQUEST['order']) )
+ $_GET['order'] = $_REQUEST['order'] = 'DESC';
+ $args['count_total'] = false;
+ }
+
+ if ( isset( $_REQUEST['orderby'] ) )
+ $args['orderby'] = $_REQUEST['orderby'];
+
+ if ( isset( $_REQUEST['order'] ) )
+ $args['order'] = $_REQUEST['order'];
+
+ $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
+
+ // Query the user IDs for this page
+ $wp_user_search = new WP_User_Query( $args );
+
+ $this->items = $wp_user_search->get_results();
+
+ $this->set_pagination_args( array(
+ 'total_items' => $wp_user_search->get_total(),
+ 'per_page' => $users_per_page,
+ ) );
+ }
+
+ function get_bulk_actions() {
+ $actions = array();
+ if ( current_user_can( 'delete_users' ) )
+ $actions['delete'] = __( 'Delete' );
+ $actions['spam'] = _x( 'Mark as Spam', 'user' );
+ $actions['notspam'] = _x( 'Not Spam', 'user' );
+
+ return $actions;
+ }
+
+ function no_items() {
+ _e( 'No users found.' );
+ }
+
+ function get_views() {
+ global $wp_roles, $role;
+
+ $total_users = get_user_count();
+ $super_admins = get_super_admins();
+ $total_admins = count( $super_admins );
+
+ $current_role = false;
+ $class = $role != 'super' ? ' class="current"' : '';
+ $role_links = array();
+ $role_links['all'] = "<a href='" . network_admin_url('users.php') . "'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
+ $class = $role == 'super' ? ' class="current"' : '';
+ $role_links['super'] = "<a href='" . network_admin_url('users.php?role=super') . "'$class>" . sprintf( _n( 'Super Admin <span class="count">(%s)</span>', 'Super Admins <span class="count">(%s)</span>', $total_admins ), number_format_i18n( $total_admins ) ) . '</a>';
+
+ return $role_links;
+ }
+
+ function pagination( $which ) {
+ global $mode;
+
+ parent::pagination ( $which );
+
+ if ( 'top' == $which )
+ $this->view_switcher( $mode );
+ }
+
+ function get_columns() {
+ $users_columns = array(
+ 'cb' => '<input type="checkbox" />',
+ 'username' => __( 'Username' ),
+ 'name' => __( 'Name' ),
+ 'email' => __( 'E-mail' ),
+ 'registered' => _x( 'Registered', 'user' ),
+ 'blogs' => __( 'Sites' )
+ );
+ $users_columns = apply_filters( 'wpmu_users_columns', $users_columns );
+
+ return $users_columns;
+ }
+
+ function get_sortable_columns() {
+ return array(
+ 'username' => 'login',
+ 'name' => 'name',
+ 'email' => 'email',
+ 'registered' => 'id',
+ );
+ }
+
+ function display_rows() {
+ global $current_site, $mode;
+
+ $alt = '';
+ $super_admins = get_super_admins();
+ foreach ( $this->items as $user ) {
+ $alt = ( 'alternate' == $alt ) ? '' : 'alternate';
+
+ $status_list = array( 'spam' => 'site-spammed', 'deleted' => 'site-deleted' );
+
+ foreach ( $status_list as $status => $col ) {
+ if ( $user->$status )
+ $alt .= " $col";
+ }
+
+ ?>
+ <tr class="<?php echo $alt; ?>">
+ <?php
+
+ list( $columns, $hidden ) = $this->get_column_info();
+
+ 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': ?>
+ <th scope="row" class="check-column">
+ <input type="checkbox" id="blog_<?php echo $user->ID ?>" name="allusers[]" value="<?php echo esc_attr( $user->ID ) ?>" />
+ </th>
+ <?php
+ break;
+
+ case 'username':
+ $avatar = get_avatar( $user->user_email, 32 );
+ if ( get_current_user_id() == $user->ID ) {
+ $edit_link = esc_url( network_admin_url( 'profile.php' ) );
+ } else {
+ $edit_link = esc_url( network_admin_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), 'user-edit.php?user_id=' . $user->ID ) ) );
+ }
+
+ echo "<td $attributes>"; ?>
+ <?php echo $avatar; ?><strong><a href="<?php echo $edit_link; ?>" class="edit"><?php echo stripslashes( $user->user_login ); ?></a><?php
+ if ( in_array( $user->user_login, $super_admins ) )
+ echo ' - ' . __( 'Super Admin' );
+ ?></strong>
+ <br/>
+ <?php
+ $actions = array();
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
+
+ if ( current_user_can( 'delete_user', $user->ID) && ! in_array( $user->user_login, $super_admins ) ) {
+ $actions['delete'] = '<a href="' . $delete = esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'edit.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
+ }
+
+ echo $this->row_actions( $actions );
+ ?>
+ </td>
+ <?php
+ break;
+
+ case 'name':
+ echo "<td $attributes>$user->first_name $user->last_name</td>";
+ break;
+
+ case 'email':
+ echo "<td $attributes><a href='mailto:$user->user_email'>$user->user_email</a></td>";
+ break;
+
+ case 'registered':
+ if ( 'list' == $mode )
+ $date = 'Y/m/d';
+ else
+ $date = 'Y/m/d \<\b\r \/\> g:i:s a';
+
+ echo "<td $attributes>" . mysql2date( $date, $user->user_registered ) . "</td>";
+ break;
+
+ case 'blogs':
+ $blogs = get_blogs_of_user( $user->ID, true );
+ echo "<td $attributes>";
+ if ( is_array( $blogs ) ) {
+ foreach ( (array) $blogs as $key => $val ) {
+ if ( !can_edit_network( $val->site_id ) )
+ continue;
+
+ $path = ( $val->path == '/' ) ? '' : $val->path;
+ echo '<span class="site-' . $val->site_id . '" >';
+ echo '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>';
+ echo ' <small class="row-actions">';
+ $actions = array();
+ $actions['edit'] = '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . __( 'Edit' ) . '</a>';
+
+ $class = '';
+ if ( get_blog_status( $val->userblog_id, 'spam' ) == 1 )
+ $class .= 'site-spammed ';
+ if ( get_blog_status( $val->userblog_id, 'mature' ) == 1 )
+ $class .= 'site-mature ';
+ if ( get_blog_status( $val->userblog_id, 'deleted' ) == 1 )
+ $class .= 'site-deleted ';
+ if ( get_blog_status( $val->userblog_id, 'archived' ) == 1 )
+ $class .= 'site-archived ';
+
+ $actions['view'] = '<a class="' . $class . '" href="' . esc_url( get_home_url( $val->userblog_id ) ) . '">' . __( 'View' ) . '</a>';
+
+ $actions = apply_filters('ms_user_list_site_actions', $actions, $val->userblog_id);
+
+ $i=0;
+ $action_count = count( $actions );
+ foreach ( $actions as $action => $link ) {
+ ++$i;
+ ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
+ echo "<span class='$action'>$link$sep</span>";
+ }
+ echo '</small></span><br/>';
+ }
+ }
+ ?>
+ </td>
+ <?php
+ break;
+
+ default:
+ echo "<td $attributes>";
+ echo apply_filters( 'manage_users_custom_column', '', $column_name, $user->ID );
+ echo "</td>";
+ break;
+ }
+ endforeach
+ ?>
+ </tr>
+ <?php
+ }
+ }
+}
+
+?>
--- /dev/null
+<?php
+/**
+ * Plugin Installer List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_Plugin_Install_List_Table extends WP_List_Table {
+
+ function ajax_user_can() {
+ return current_user_can('install_plugins');
+ }
+
+ function prepare_items() {
+ include( ABSPATH . 'wp-admin/includes/plugin-install.php' );
+
+ global $tabs, $tab, $paged, $type, $term;
+
+ wp_reset_vars( array( 'tab' ) );
+
+ $paged = $this->get_pagenum();
+
+ $per_page = 30;
+
+ // These are the tabs which are shown on the page
+ $tabs = array();
+ $tabs['dashboard'] = __( 'Search' );
+ if ( 'search' == $tab )
+ $tabs['search'] = __( 'Search Results' );
+ $tabs['upload'] = __( 'Upload' );
+ $tabs['featured'] = _x( 'Featured','Plugin Installer' );
+ $tabs['popular'] = _x( 'Popular','Plugin Installer' );
+ $tabs['new'] = _x( 'Newest','Plugin Installer' );
+ $tabs['updated'] = _x( 'Recently Updated','Plugin Installer' );
+
+ $nonmenu_tabs = array( 'plugin-information' ); //Valid actions to perform which do not have a Menu item.
+
+ $tabs = apply_filters( 'install_plugins_tabs', $tabs );
+ $nonmenu_tabs = apply_filters( 'install_plugins_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 ) ) )
+ $tab = key( $tabs );
+
+ $args = array( 'page' => $paged, 'per_page' => $per_page );
+
+ switch ( $tab ) {
+ case 'search':
+ $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : '';
+ $term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
+
+ switch ( $type ) {
+ case 'tag':
+ $args['tag'] = sanitize_title_with_dashes( $term );
+ break;
+ case 'term':
+ $args['search'] = $term;
+ break;
+ case 'author':
+ $args['author'] = $term;
+ break;
+ }
+
+ add_action( 'install_plugins_table_header', 'install_search_form' );
+ break;
+
+ case 'featured':
+ case 'popular':
+ case 'new':
+ case 'updated':
+ $args['browse'] = $tab;
+ break;
+
+ default:
+ $args = false;
+ }
+
+ if ( !$args )
+ return;
+
+ $api = plugins_api( 'query_plugins', $args );
+
+ if ( is_wp_error( $api ) )
+ wp_die( $api->get_error_message() . '</p> <p class="hide-if-no-js"><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' );
+
+ $this->items = $api->plugins;
+
+ $this->set_pagination_args( array(
+ 'total_items' => $api->info['results'],
+ 'per_page' => $per_page,
+ ) );
+ }
+
+ function no_items() {
+ _e( 'No plugins match your request.' );
+ }
+
+ function get_views() {
+ global $tabs, $tab;
+
+ $display_tabs = array();
+ foreach ( (array) $tabs as $action => $text ) {
+ $class = ( $action == $tab ) ? ' class="current"' : '';
+ $href = self_admin_url('plugin-install.php?tab=' . $action);
+ $display_tabs['plugin-install-'.$action] = "<a href='$href'$class>$text</a>";
+ }
+
+ return $display_tabs;
+ }
+
+ function display_tablenav( $which ) {
+ if ( 'top' == $which ) { ?>
+ <div class="tablenav top">
+ <div class="alignleft actions">
+ <?php do_action( 'install_plugins_table_header' ); ?>
+ </div>
+ <?php $this->pagination( $which ); ?>
+ <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
+ <br class="clear" />
+ </div>
+ <?php } else { ?>
+ <div class="tablenav bottom">
+ <?php $this->pagination( $which ); ?>
+ <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
+ <br class="clear" />
+ </div>
+ <?php
+ }
+ }
+
+ function get_table_classes() {
+ extract( $this->_args );
+
+ return array( 'widefat', $plural );
+ }
+
+ function get_columns() {
+ return array(
+ 'name' => __( 'Name' ),
+ 'version' => __( 'Version' ),
+ 'rating' => __( 'Rating' ),
+ 'description' => __( 'Description' ),
+ );
+ }
+
+ function display_rows() {
+ $plugins_allowedtags = array(
+ 'a' => array( 'href' => array(),'title' => array(), 'target' => array() ),
+ 'abbr' => array( 'title' => array() ),'acronym' => array( 'title' => array() ),
+ 'code' => array(), 'pre' => array(), 'em' => array(),'strong' => array(),
+ 'ul' => array(), 'ol' => array(), 'li' => array(), 'p' => array(), 'br' => array()
+ );
+
+ list( $columns, $hidden ) = $this->get_column_info();
+
+ $style = array();
+ foreach ( $columns as $column_name => $column_display_name ) {
+ $style[ $column_name ] = in_array( $column_name, $hidden ) ? 'style="display:none;"' : '';
+ }
+
+ foreach ( (array) $this->items as $plugin ) {
+ if ( is_object( $plugin ) )
+ $plugin = (array) $plugin;
+
+ $title = wp_kses( $plugin['name'], $plugins_allowedtags );
+ //Limit description to 400char, and remove any HTML.
+ $description = strip_tags( $plugin['description'] );
+ if ( strlen( $description ) > 400 )
+ $description = mb_substr( $description, 0, 400 ) . '…';
+ //remove any trailing entities
+ $description = preg_replace( '/&[^;\s]{0,6}$/', '', $description );
+ //strip leading/trailing & multiple consecutive lines
+ $description = trim( $description );
+ $description = preg_replace( "|(\r?\n)+|", "\n", $description );
+ //\n => <br>
+ $description = nl2br( $description );
+ $version = wp_kses( $plugin['version'], $plugins_allowedtags );
+
+ $name = strip_tags( $title . ' ' . $version );
+
+ $author = $plugin['author'];
+ if ( ! empty( $plugin['author'] ) )
+ $author = ' <cite>' . sprintf( __( 'By %s' ), $author ) . '.</cite>';
+
+ $author = wp_kses( $author, $plugins_allowedtags );
+
+ $action_links = array();
+ $action_links[] = '<a href="' . self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] .
+ '&TB_iframe=true&width=600&height=550' ) . '" class="thickbox" title="' .
+ esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '">' . __( 'Details' ) . '</a>';
+
+ 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[] = '<a class="install-now" href="' . $status['url'] . '" title="' . esc_attr( sprintf( __( 'Install %s' ), $name ) ) . '">' . __( 'Install Now' ) . '</a>';
+ break;
+ case 'update_available':
+ if ( $status['url'] )
+ $action_links[] = '<a href="' . $status['url'] . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $status['version'] ) ) . '">' . sprintf( __( 'Update Now' ), $status['version'] ) . '</a>';
+ break;
+ case 'latest_installed':
+ case 'newer_installed':
+ $action_links[] = '<span title="' . esc_attr__( 'This plugin is already installed and is up to date' ) . ' ">' . __( 'Installed' ) . '</span>';
+ break;
+ }
+ }
+
+ $action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
+ ?>
+ <tr>
+ <td class="name column-name"<?php echo $style['name']; ?>><strong><?php echo $title; ?></strong>
+ <div class="action-links"><?php if ( !empty( $action_links ) ) echo implode( ' | ', $action_links ); ?></div>
+ </td>
+ <td class="vers column-version"<?php echo $style['version']; ?>><?php echo $version; ?></td>
+ <td class="vers column-rating"<?php echo $style['rating']; ?>>
+ <div class="star-holder" title="<?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $plugin['num_ratings'] ), number_format_i18n( $plugin['num_ratings'] ) ) ?>">
+ <div class="star star-rating" style="width: <?php echo esc_attr( $plugin['rating'] ) ?>px"></div>
+ <div class="star star5"><img src="<?php echo admin_url( 'images/star.gif' ); ?>" alt="<?php _e( '5 stars' ) ?>" /></div>
+ <div class="star star4"><img src="<?php echo admin_url( 'images/star.gif' ); ?>" alt="<?php _e( '4 stars' ) ?>" /></div>
+ <div class="star star3"><img src="<?php echo admin_url( 'images/star.gif' ); ?>" alt="<?php _e( '3 stars' ) ?>" /></div>
+ <div class="star star2"><img src="<?php echo admin_url( 'images/star.gif' ); ?>" alt="<?php _e( '2 stars' ) ?>" /></div>
+ <div class="star star1"><img src="<?php echo admin_url( 'images/star.gif' ); ?>" alt="<?php _e( '1 star' ) ?>" /></div>
+ </div>
+ </td>
+ <td class="desc column-description"<?php echo $style['description']; ?>><?php echo $description, $author; ?></td>
+ </tr>
+ <?php
+ }
+ }
+}
+
+?>
--- /dev/null
+<?php
+/**
+ * Plugins List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_Plugins_List_Table extends WP_List_Table {
+
+ function WP_Plugins_List_Table() {
+ global $status, $page;
+
+ $default_status = get_user_option( 'plugins_last_view' );
+ if ( empty( $default_status ) )
+ $default_status = 'all';
+ $status = isset( $_REQUEST['plugin_status'] ) ? $_REQUEST['plugin_status'] : $default_status;
+ if ( !in_array( $status, array( 'all', 'active', 'inactive', 'recently_activated', 'upgrade', 'network', 'mustuse', 'dropins', 'search' ) ) )
+ $status = 'all';
+ if ( $status != $default_status && 'search' != $status )
+ update_user_meta( get_current_user_id(), 'plugins_last_view', $status );
+
+ $page = $this->get_pagenum();
+
+ parent::WP_List_Table( array(
+ 'plural' => 'plugins',
+ ) );
+ }
+
+ function get_table_classes() {
+ return array( 'widefat', $this->_args['plural'] );
+ }
+
+ function ajax_user_can() {
+ if ( is_multisite() ) {
+ $menu_perms = get_site_option( 'menu_items', array() );
+
+ if ( empty( $menu_perms['plugins'] ) && ! is_super_admin() )
+ return false;
+ }
+
+ return current_user_can('activate_plugins');
+ }
+
+ function prepare_items() {
+ global $status, $plugins, $totals, $page, $orderby, $order, $s;
+
+ wp_reset_vars( array( 'orderby', 'order', 's' ) );
+
+ $plugins = array(
+ 'all' => apply_filters( 'all_plugins', get_plugins() ),
+ 'search' => array(),
+ 'active' => array(),
+ 'inactive' => array(),
+ 'recently_activated' => array(),
+ 'upgrade' => array(),
+ 'mustuse' => array(),
+ 'dropins' => array()
+ );
+
+ $screen = get_current_screen();
+
+ if ( ! is_multisite() || ( $screen->is_network && current_user_can('manage_network_plugins') ) ) {
+ if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) )
+ $plugins['mustuse'] = get_mu_plugins();
+ if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) )
+ $plugins['dropins'] = get_dropins();
+
+ $current = get_site_transient( 'update_plugins' );
+ foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
+ if ( isset( $current->response[ $plugin_file ] ) )
+ $plugins['upgrade'][ $plugin_file ] = $plugin_data;
+ }
+ }
+
+ set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), 86400 );
+
+ $recently_activated = get_option( 'recently_activated', array() );
+
+ $one_week = 7*24*60*60;
+ foreach ( $recently_activated as $key => $time )
+ if ( $time + $one_week < time() )
+ unset( $recently_activated[$key] );
+ update_option( 'recently_activated', $recently_activated );
+
+ foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
+ // Filter into individual sections
+ if ( is_multisite() && is_network_only_plugin( $plugin_file ) && !$screen->is_network ) {
+ unset( $plugins['all'][ $plugin_file] );
+ } elseif ( is_plugin_active_for_network($plugin_file) && !$screen->is_network ) {
+ unset( $plugins['all'][ $plugin_file ] );
+ } elseif ( is_multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins' ) ) {
+ $plugins['network'][ $plugin_file ] = $plugin_data;
+ } elseif ( ( !$screen->is_network && is_plugin_active( $plugin_file ) )
+ || ( $screen->is_network && is_plugin_active_for_network( $plugin_file ) ) ) {
+ $plugins['active'][ $plugin_file ] = $plugin_data;
+ } else {
+ if ( !$screen->is_network && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
+ $plugins['recently_activated'][ $plugin_file ] = $plugin_data;
+ $plugins['inactive'][ $plugin_file ] = $plugin_data;
+ }
+ }
+
+ if ( !current_user_can( 'update_plugins' ) )
+ $plugins['upgrade'] = array();
+
+ if ( $s ) {
+ $status = 'search';
+ $plugins['search'] = array_filter( $plugins['all'], array( &$this, '_search_callback' ) );
+ }
+
+ $totals = array();
+ foreach ( $plugins as $type => $list )
+ $totals[ $type ] = count( $list );
+
+ if ( empty( $plugins[ $status ] ) && !in_array( $status, array( 'all', 'search' ) ) )
+ $status = 'all';
+
+ $this->items = array();
+ foreach ( $plugins[ $status ] as $plugin_file => $plugin_data ) {
+ // Translate, Don't Apply Markup, Sanitize HTML
+ $this->items[$plugin_file] = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, false, true );
+ }
+
+ $total_this_page = $totals[ $status ];
+
+ if ( $orderby ) {
+ $orderby = ucfirst( $orderby );
+ $order = strtoupper( $order );
+
+ uasort( $this->items, array( &$this, '_order_callback' ) );
+ }
+
+ $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', $screen->id . '_per_page' ) );
+
+ $start = ( $page - 1 ) * $plugins_per_page;
+
+ if ( $total_this_page > $plugins_per_page )
+ $this->items = array_slice( $this->items, $start, $plugins_per_page );
+
+ $this->set_pagination_args( array(
+ 'total_items' => $total_this_page,
+ 'per_page' => $plugins_per_page,
+ ) );
+ }
+
+ function _search_callback( $plugin ) {
+ static $term;
+ if ( is_null( $term ) )
+ $term = stripslashes( $_REQUEST['s'] );
+
+ foreach ( $plugin as $value )
+ if ( stripos( $value, $term ) !== false )
+ return true;
+
+ return false;
+ }
+
+ function _order_callback( $plugin_a, $plugin_b ) {
+ global $orderby, $order;
+
+ $a = $plugin_a[$orderby];
+ $b = $plugin_b[$orderby];
+
+ if ( $a == $b )
+ return 0;
+
+ if ( 'DESC' == $order )
+ return ( $a < $b ) ? 1 : -1;
+ else
+ return ( $a < $b ) ? -1 : 1;
+ }
+
+ function no_items() {
+ global $plugins;
+
+ if ( !empty( $plugins['all'] ) )
+ _e( 'No plugins found.' );
+ else
+ _e( 'You do not appear to have any plugins available at this time.' );
+ }
+
+ function get_columns() {
+ global $status;
+
+ return array(
+ 'cb' => !in_array( $status, array( 'mustuse', 'dropins' ) ) ? '<input type="checkbox" />' : '',
+ 'name' => __( 'Plugin' ),
+ 'description' => __( 'Description' ),
+ );
+ }
+
+ function get_sortable_columns() {
+ return array();
+ }
+
+ function display_tablenav( $which ) {
+ global $status;
+
+ if ( !in_array( $status, array( 'mustuse', 'dropins' ) ) )
+ parent::display_tablenav( $which );
+ }
+
+ function get_views() {
+ global $totals, $status;
+
+ $status_links = array();
+ foreach ( $totals as $type => $count ) {
+ if ( !$count )
+ continue;
+
+ switch ( $type ) {
+ case 'all':
+ $text = _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'plugins' );
+ break;
+ case 'active':
+ $text = _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', $count );
+ break;
+ case 'recently_activated':
+ $text = _n( 'Recently Active <span class="count">(%s)</span>', 'Recently Active <span class="count">(%s)</span>', $count );
+ break;
+ case 'inactive':
+ $text = _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', $count );
+ break;
+ case 'network':
+ $text = _n( 'Network <span class="count">(%s)</span>', 'Network <span class="count">(%s)</span>', $count );
+ break;
+ case 'mustuse':
+ $text = _n( 'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', $count );
+ break;
+ case 'dropins':
+ $text = _n( 'Drop-ins <span class="count">(%s)</span>', 'Drop-ins <span class="count">(%s)</span>', $count );
+ break;
+ case 'upgrade':
+ $text = _n( 'Update Available <span class="count">(%s)</span>', 'Update Available <span class="count">(%s)</span>', $count );
+ break;
+ }
+
+ if ( 'search' != $type ) {
+ $status_links[$type] = sprintf( "<a href='%s' %s>%s</a>",
+ add_query_arg('plugin_status', $type, 'plugins.php'),
+ ( $type == $status ) ? ' class="current"' : '',
+ sprintf( $text, number_format_i18n( $count ) )
+ );
+ }
+ }
+
+ return $status_links;
+ }
+
+ function get_bulk_actions() {
+ global $status;
+
+ $actions = array();
+
+ $screen = get_current_screen();
+
+ if ( 'active' != $status ) {
+ $action = $screen->is_network ? 'network-activate-selected' : 'activate-selected';
+ $actions[ $action ] = __( 'Activate' );
+ }
+
+ if ( 'inactive' != $status && 'recent' != $status )
+ $actions['deactivate-selected'] = __( 'Deactivate' );
+
+ if ( !is_multisite() || $screen->is_network ) {
+ if ( current_user_can( 'update_plugins' ) )
+ $actions['update-selected'] = __( 'Update' );
+ if ( current_user_can( 'delete_plugins' ) && ( 'active' != $status ) )
+ $actions['delete-selected'] = __( 'Delete' );
+ }
+
+ return $actions;
+ }
+
+ function bulk_actions( $which ) {
+ global $status;
+
+ if ( in_array( $status, array( 'mustuse', 'dropins' ) ) )
+ return;
+
+ parent::bulk_actions( $which );
+ }
+
+ function extra_tablenav( $which ) {
+ global $status;
+
+ if ( 'recently_activated' == $status ) { ?>
+ <div class="alignleft actions">
+ <?php submit_button( __( 'Clear List' ), 'secondary', 'clear-recent-list', false ); ?>
+ </div>
+ <?php }
+ }
+
+ function current_action() {
+ if ( isset($_POST['clear-recent-list']) )
+ return 'clear-recent-list';
+
+ return parent::current_action();
+ }
+
+ function display_rows() {
+ global $status;
+
+ $screen = get_current_screen();
+
+ if ( is_multisite() && !$screen->is_network && in_array( $status, array( 'mustuse', 'dropins' ) ) )
+ return;
+
+ foreach ( $this->items as $plugin_file => $plugin_data )
+ $this->single_row( $plugin_file, $plugin_data );
+ }
+
+ function single_row( $plugin_file, $plugin_data ) {
+ global $status, $page, $s;
+
+ $context = $status;
+
+ $screen = get_current_screen();
+
+ // 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 .= '<br/>' . $plugin_data['Name'];
+ if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant
+ $is_active = true;
+ $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
+ } elseif ( constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true
+ $is_active = true;
+ $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
+ } else {
+ $is_active = false;
+ $description = '<p><strong>' . $dropins[ $plugin_file ][0] . ' <span class="attention">' . __('Inactive:') . '</span></strong> ' . sprintf( __( 'Requires <code>%s</code> in <code>wp-config.php</code>.' ), "define('" . $dropins[ $plugin_file ][1] . "', true);" ) . '</p>';
+ }
+ if ( $plugin_data['Description'] )
+ $description .= '<p>' . $plugin_data['Description'] . '</p>';
+ } else {
+ $is_active_for_network = is_plugin_active_for_network($plugin_file);
+ if ( $screen->is_network )
+ $is_active = $is_active_for_network;
+ else
+ $is_active = is_plugin_active( $plugin_file );
+
+ if ( $is_active_for_network && !is_super_admin() && !$screen->is_network )
+ return;
+
+ if ( $screen->is_network ) {
+ if ( $is_active_for_network ) {
+ if ( current_user_can( 'manage_network_plugins' ) )
+ $actions['network_deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
+ } else {
+ if ( current_user_can( 'manage_network_plugins' ) )
+ $actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
+ if ( current_user_can( 'delete_plugins' ) && ! is_plugin_active( $plugin_file ) )
+ $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
+ }
+ } else {
+ if ( $is_active ) {
+ $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
+ } else {
+ $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
+
+ if ( ! is_multisite() && current_user_can('delete_plugins') )
+ $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
+ } // end if $is_active
+ } // end if $screen->is_network
+
+ if ( ( ! is_multisite() || $screen->is_network ) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
+ $actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . esc_attr__('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
+ } // end if $context
+
+ $prefix = $screen->is_network ? 'network_admin_' : '';
+ $actions = apply_filters( $prefix . 'plugin_action_links', array_filter( $actions ), $plugin_file, $plugin_data, $context );
+ $actions = apply_filters( $prefix . "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
+
+ $class = $is_active ? 'active' : 'inactive';
+ $checkbox_id = "checkbox_" . md5($plugin_data['Name']);
+ $checkbox = in_array( $status, array( 'mustuse', 'dropins' ) ) ? '' : "<input type='checkbox' name='checked[]' value='" . esc_attr( $plugin_file ) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $plugin_data['Name'] . "</label>";
+ if ( 'dropins' != $context ) {
+ $description = '<p>' . ( $plugin_data['Description'] ? $plugin_data['Description'] : ' ' ) . '</p>';
+ $plugin_name = $plugin_data['Name'];
+ }
+
+ $id = sanitize_title( $plugin_name );
+
+ echo "<tr id='$id' class='$class'>";
+
+ list( $columns, $hidden ) = $this->get_column_info();
+
+ foreach ( $columns as $column_name => $column_display_name ) {
+ $style = '';
+ if ( in_array( $column_name, $hidden ) )
+ $style = ' style="display:none;"';
+
+ switch ( $column_name ) {
+ case 'cb':
+ echo "<th scope='row' class='check-column'>$checkbox</th>";
+ break;
+ case 'name':
+ echo "<td class='plugin-title'$style><strong>$plugin_name</strong>";
+ echo $this->row_actions( $actions, true );
+ echo "</td>";
+ break;
+ case 'description':
+ echo "<td class='column-description desc'$style>
+ <div class='plugin-description'>$description</div>
+ <div class='$class second plugin-version-author-uri'>";
+
+ $plugin_meta = array();
+ if ( !empty( $plugin_data['Version'] ) )
+ $plugin_meta[] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
+ if ( !empty( $plugin_data['Author'] ) ) {
+ $author = $plugin_data['Author'];
+ if ( !empty( $plugin_data['AuthorURI'] ) )
+ $author = '<a href="' . $plugin_data['AuthorURI'] . '" title="' . esc_attr__( 'Visit author homepage' ) . '">' . $plugin_data['Author'] . '</a>';
+ $plugin_meta[] = sprintf( __( 'By %s' ), $author );
+ }
+ if ( ! empty( $plugin_data['PluginURI'] ) )
+ $plugin_meta[] = '<a href="' . $plugin_data['PluginURI'] . '" title="' . esc_attr__( 'Visit plugin site' ) . '">' . __( 'Visit plugin site' ) . '</a>';
+
+ $plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $status );
+ echo implode( ' | ', $plugin_meta );
+
+ echo "</div></td>";
+ break;
+ default:
+ echo "<td class='$column_name column-$column_name'$style>";
+ do_action( 'manage_plugins_custom_column', $column_name, $plugin_file, $plugin_data );
+ echo "</td>";
+ }
+ }
+
+ echo "</tr>";
+
+ do_action( 'after_plugin_row', $plugin_file, $plugin_data, $status );
+ do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $status );
+ }
+}
+
+?>
--- /dev/null
+<?php
+/**
+ * Posts List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_Posts_List_Table extends WP_List_Table {
+
+ /**
+ * Whether the items should be displayed hierarchically or linearly
+ *
+ * @since 3.1.0
+ * @var bool
+ * @access protected
+ */
+ var $hierarchical_display;
+
+ /**
+ * Holds the number of pending comments for each post
+ *
+ * @since 3.1.0
+ * @var int
+ * @access protected
+ */
+ var $comment_pending_count;
+
+ /**
+ * Holds the number of posts for this user
+ *
+ * @since 3.1.0
+ * @var int
+ * @access private
+ */
+ var $user_posts_count;
+
+ /**
+ * Holds the number of posts which are sticky.
+ *
+ * @since 3.1.0
+ * @var int
+ * @access private
+ */
+ var $sticky_posts_count = 0;
+
+ function WP_Posts_List_Table() {
+ global $post_type_object, $post_type, $wpdb;
+
+ if ( !isset( $_REQUEST['post_type'] ) )
+ $post_type = 'post';
+ elseif ( in_array( $_REQUEST['post_type'], get_post_types( array( 'show_ui' => true ) ) ) )
+ $post_type = $_REQUEST['post_type'];
+ else
+ wp_die( __( 'Invalid post type' ) );
+ $_REQUEST['post_type'] = $post_type;
+
+ $post_type_object = get_post_type_object( $post_type );
+
+ if ( !current_user_can( $post_type_object->cap->edit_others_posts ) ) {
+ $this->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, get_current_user_id() ) );
+
+ if ( $this->user_posts_count && empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['all_posts'] ) && empty( $_REQUEST['author'] ) && empty( $_REQUEST['show_sticky'] ) )
+ $_GET['author'] = get_current_user_id();
+ }
+
+ if ( 'post' == $post_type && $sticky_posts = get_option( 'sticky_posts' ) ) {
+ $sticky_posts = implode( ', ', array_map( 'absint', (array) $sticky_posts ) );
+ $this->sticky_posts_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT( 1 ) FROM $wpdb->posts WHERE post_type = %s AND post_status != 'trash' AND ID IN ($sticky_posts)", $post_type ) );
+ }
+
+ parent::WP_List_Table( array(
+ 'plural' => 'posts',
+ ) );
+ }
+
+ function ajax_user_can() {
+ global $post_type_object;
+
+ return current_user_can( $post_type_object->cap->edit_posts );
+ }
+
+ function prepare_items() {
+ global $post_type_object, $post_type, $avail_post_stati, $wp_query, $per_page, $mode;
+
+ $avail_post_stati = wp_edit_posts_query();
+
+ $this->hierarchical_display = ( $post_type_object->hierarchical && 'menu_order title' == $wp_query->query['orderby'] );
+
+ $total_items = $this->hierarchical_display ? $wp_query->post_count : $wp_query->found_posts;
+
+ $per_page = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' );
+ $per_page = apply_filters( 'edit_posts_per_page', $per_page, $post_type );
+
+ if ( $this->hierarchical_display )
+ $total_pages = ceil( $total_items / $per_page );
+ else
+ $total_pages = $wp_query->max_num_pages;
+
+ $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
+
+ $this->is_trash = isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] == 'trash';
+
+ $this->set_pagination_args( array(
+ 'total_items' => $total_items,
+ 'total_pages' => $total_pages,
+ 'per_page' => $per_page
+ ) );
+ }
+
+ function has_items() {
+ return have_posts();
+ }
+
+ function no_items() {
+ global $post_type_object;
+
+ if ( isset( $_REQUEST['post_status'] ) && 'trash' == $_REQUEST['post_status'] )
+ echo $post_type_object->labels->not_found_in_trash;
+ else
+ echo $post_type_object->labels->not_found;
+ }
+
+ function get_views() {
+ global $post_type, $post_type_object, $locked_post_status, $avail_post_stati;
+
+ if ( !empty($locked_post_status) )
+ return array();
+
+ $status_links = array();
+ $num_posts = wp_count_posts( $post_type, 'readable' );
+ $class = '';
+ $allposts = '';
+
+ $current_user_id = get_current_user_id();
+
+ if ( $this->user_posts_count ) {
+ if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user_id ) )
+ $class = ' class="current"';
+ $status_links['mine'] = "<a href='edit.php?post_type=$post_type&author=$current_user_id'$class>" . sprintf( _nx( 'Mine <span class="count">(%s)</span>', 'Mine <span class="count">(%s)</span>', $this->user_posts_count, 'posts' ), number_format_i18n( $this->user_posts_count ) ) . '</a>';
+ $allposts = '&all_posts=1';
+ }
+
+ $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( $_REQUEST['post_status'] ) && empty( $_REQUEST['show_sticky'] ) ? ' class="current"' : '';
+ $status_links['all'] = "<a href='edit.php?post_type=$post_type{$allposts}'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '</a>';
+
+ foreach ( get_post_stati(array('show_in_admin_status_list' => true), 'objects') as $status ) {
+ $class = '';
+
+ $status_name = $status->name;
+
+ if ( !in_array( $status_name, $avail_post_stati ) )
+ continue;
+
+ if ( empty( $num_posts->$status_name ) )
+ continue;
+
+ if ( isset($_REQUEST['post_status']) && $status_name == $_REQUEST['post_status'] )
+ $class = ' class="current"';
+
+ $status_links[$status_name] = "<a href='edit.php?post_status=$status_name&post_type=$post_type'$class>" . sprintf( translate_nooped_plural( $status->label_count, $num_posts->$status_name ), number_format_i18n( $num_posts->$status_name ) ) . '</a>';
+ }
+
+ if ( ! empty( $this->sticky_posts_count ) ) {
+ $class = ! empty( $_REQUEST['show_sticky'] ) ? ' class="current"' : '';
+
+ $sticky_link = array( 'sticky' => "<a href='edit.php?post_type=$post_type&show_sticky=1'$class>" . sprintf( _nx( 'Sticky <span class="count">(%s)</span>', 'Sticky <span class="count">(%s)</span>', $this->sticky_posts_count, 'posts' ), number_format_i18n( $this->sticky_posts_count ) ) . '</a>' );
+
+ // Sticky comes after Publish, or if not listed, after All.
+ $split = 1 + array_search( ( isset( $status_links['publish'] ) ? 'publish' : 'all' ), array_keys( $status_links ) );
+ $status_links = array_merge( array_slice( $status_links, 0, $split ), $sticky_link, array_slice( $status_links, $split ) );
+ }
+
+ return $status_links;
+ }
+
+ function get_bulk_actions() {
+ $actions = array();
+
+ if ( $this->is_trash )
+ $actions['untrash'] = __( 'Restore' );
+ else
+ $actions['edit'] = __( 'Edit' );
+
+ if ( $this->is_trash || !EMPTY_TRASH_DAYS )
+ $actions['delete'] = __( 'Delete Permanently' );
+ else
+ $actions['trash'] = __( 'Move to Trash' );
+
+ return $actions;
+ }
+
+ function extra_tablenav( $which ) {
+ global $post_type, $post_type_object, $cat;
+?>
+ <div class="alignleft actions">
+<?php
+ if ( 'top' == $which && !is_singular() ) {
+
+ $this->months_dropdown( $post_type );
+
+ 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' );
+ submit_button( __( 'Filter' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) );
+ }
+
+ if ( $this->is_trash && current_user_can( $post_type_object->cap->edit_others_posts ) ) {
+ submit_button( __( 'Empty Trash' ), 'button-secondary apply', 'delete_all', false );
+ }
+?>
+ </div>
+<?php
+ }
+
+ function current_action() {
+ if ( isset( $_REQUEST['delete_all'] ) || isset( $_REQUEST['delete_all2'] ) )
+ return 'delete_all';
+
+ return parent::current_action();
+ }
+
+ function pagination( $which ) {
+ global $post_type_object, $mode;
+
+ parent::pagination( $which );
+
+ if ( 'top' == $which && !$post_type_object->hierarchical )
+ $this->view_switcher( $mode );
+ }
+
+ function get_table_classes() {
+ global $post_type_object;
+
+ return array( 'widefat', 'fixed', $post_type_object->hierarchical ? 'pages' : 'posts' );
+ }
+
+ function get_columns() {
+ $screen = get_current_screen();
+
+ if ( empty( $screen ) )
+ $post_type = 'post';
+ else
+ $post_type = $screen->post_type;
+
+ $posts_columns = array();
+
+ $posts_columns['cb'] = '<input type="checkbox" />';
+
+ /* translators: manage posts column name */
+ $posts_columns['title'] = _x( 'Title', 'column name' );
+
+ if ( post_type_supports( $post_type, 'author' ) )
+ $posts_columns['author'] = __( 'Author' );
+
+ 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 ( post_type_supports( $post_type, 'comments' ) && !in_array( $post_status, array( 'pending', 'draft', 'future' ) ) )
+ $posts_columns['comments'] = '<div class="vers"><img alt="' . esc_attr__( 'Comments' ) . '" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>';
+
+ $posts_columns['date'] = __( 'Date' );
+
+ 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;
+ }
+
+ function get_sortable_columns() {
+ return array(
+ 'title' => 'title',
+ 'author' => 'author',
+ 'parent' => 'parent',
+ 'comments' => 'comment_count',
+ 'date' => array( 'date', true )
+ );
+ }
+
+ function display_rows( $posts = array() ) {
+ global $wp_query, $post_type_object, $per_page;
+
+ if ( empty( $posts ) )
+ $posts = $wp_query->posts;
+
+ if ( $this->hierarchical_display ) {
+ $this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page );
+ } else {
+ $this->_display_rows( $posts );
+ }
+ }
+
+ function _display_rows( $posts ) {
+ global $post, $mode;
+
+ add_filter( 'the_title', 'esc_html' );
+
+ // Create array of post IDs.
+ $post_ids = array();
+
+ foreach ( $posts as $a_post )
+ $post_ids[] = $a_post->ID;
+
+ $this->comment_pending_count = get_pending_comments_num( $post_ids );
+
+ foreach ( $posts as $post )
+ $this->single_row( $post );
+ }
+
+ function _display_rows_hierarchical( $pages, $pagenum = 1, $per_page = 20 ) {
+ global $wpdb;
+
+ $level = 0;
+
+ if ( ! $pages ) {
+ $pages = get_pages( array( 'sort_column' => 'menu_order' ) );
+
+ if ( ! $pages )
+ return false;
+ }
+
+ /*
+ * arrange pages into two parts: top level pages and children_pages
+ * children_pages is two dimensional array, eg.
+ * children_pages[10][] contains all sub-pages whose parent is 10.
+ * It only takes O( N ) to arrange this and it takes O( 1 ) for subsequent lookup operations
+ * If searching, ignore hierarchy and treat everything as top level
+ */
+ if ( empty( $_REQUEST['s'] ) ) {
+
+ $top_level_pages = array();
+ $children_pages = array();
+
+ foreach ( $pages as $page ) {
+
+ // catch and repair bad pages
+ if ( $page->post_parent == $page->ID ) {
+ $page->post_parent = 0;
+ $wpdb->update( $wpdb->posts, array( 'post_parent' => 0 ), array( 'ID' => $page->ID ) );
+ clean_page_cache( $page->ID );
+ }
+
+ if ( 0 == $page->post_parent )
+ $top_level_pages[] = $page;
+ else
+ $children_pages[ $page->post_parent ][] = $page;
+ }
+
+ $pages = &$top_level_pages;
+ }
+
+ $count = 0;
+ $start = ( $pagenum - 1 ) * $per_page;
+ $end = $start + $per_page;
+
+ foreach ( $pages as $page ) {
+ if ( $count >= $end )
+ break;
+
+ if ( $count >= $start )
+ echo "\t" . $this->single_row( $page, $level );
+
+ $count++;
+
+ if ( isset( $children_pages ) )
+ $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page );
+ }
+
+ // if it is the last pagenum and there are orphaned pages, display them with paging as well
+ if ( isset( $children_pages ) && $count < $end ){
+ foreach ( $children_pages as $orphans ){
+ foreach ( $orphans as $op ) {
+ if ( $count >= $end )
+ break;
+ if ( $count >= $start )
+ echo "\t" . $this->single_row( $op, 0 );
+ $count++;
+ }
+ }
+ }
+ }
+
+ /**
+ * Given a top level page ID, display the nested hierarchy of sub-pages
+ * together with paging support
+ *
+ * @since 3.1.0 (Standalone function exists since 2.6.0)
+ *
+ * @param unknown_type $children_pages
+ * @param unknown_type $count
+ * @param unknown_type $parent
+ * @param unknown_type $level
+ * @param unknown_type $pagenum
+ * @param unknown_type $per_page
+ */
+ function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {
+
+ if ( ! isset( $children_pages[$parent] ) )
+ return;
+
+ $start = ( $pagenum - 1 ) * $per_page;
+ $end = $start + $per_page;
+
+ foreach ( $children_pages[$parent] as $page ) {
+
+ if ( $count >= $end )
+ break;
+
+ // If the page starts in a subtree, print the parents.
+ if ( $count == $start && $page->post_parent > 0 ) {
+ $my_parents = array();
+ $my_parent = $page->post_parent;
+ while ( $my_parent ) {
+ $my_parent = get_post( $my_parent );
+ $my_parents[] = $my_parent;
+ if ( !$my_parent->post_parent )
+ break;
+ $my_parent = $my_parent->post_parent;
+ }
+ $num_parents = count( $my_parents );
+ while ( $my_parent = array_pop( $my_parents ) ) {
+ echo "\t" . $this->single_row( $my_parent, $level - $num_parents );
+ $num_parents--;
+ }
+ }
+
+ if ( $count >= $start )
+ echo "\t" . $this->single_row( $page, $level );
+
+ $count++;
+
+ $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page );
+ }
+
+ unset( $children_pages[$parent] ); //required in order to keep track of orphans
+ }
+
+ function single_row( $a_post, $level = 0 ) {
+ global $post, $current_screen, $mode;
+ static $rowclass;
+
+ $global_post = $post;
+ $post = $a_post;
+ setup_postdata( $post );
+
+ $rowclass = 'alternate' == $rowclass ? '' : 'alternate';
+ $post_owner = ( get_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 );
+ $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
+ $post_format = get_post_format( $post->ID );
+ $post_format_class = ( $post_format && !is_wp_error($post_format) ) ? 'format-' . sanitize_html_class( $post_format ) : 'format-default';
+ ?>
+ <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $rowclass . ' author-' . $post_owner . ' status-' . $post->post_status . ' ' . $post_format_class); ?> iedit' valign="top">
+ <?php
+
+ list( $columns, $hidden ) = $this->get_column_info();
+
+ 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':
+ ?>
+ <th scope="row" class="check-column"><?php if ( $can_edit_post ) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th>
+ <?php
+ break;
+
+ case 'title':
+ if ( $this->hierarchical_display ) {
+ $attributes = 'class="post-title page-title column-title"' . $style;
+
+ if ( 0 == $level && (int) $post->post_parent > 0 ) {
+ //sent level 0 by accident, by default, or because we don't know the actual level
+ $find_main_page = (int) $post->post_parent;
+ while ( $find_main_page > 0 ) {
+ $parent = get_page( $find_main_page );
+
+ if ( is_null( $parent ) )
+ break;
+
+ $level++;
+ $find_main_page = (int) $parent->post_parent;
+
+ if ( !isset( $parent_name ) )
+ $parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID );
+ }
+ }
+
+ $post->post_title = esc_html( $post->post_title );
+ $pad = str_repeat( '— ', $level );
+?>
+ <td <?php echo $attributes ?>><strong><?php if ( $can_edit_post && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states( $post ); echo isset( $parent_name ) ? ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name ) : ''; ?></strong>
+<?php
+ }
+ else {
+ $attributes = 'class="post-title page-title column-title"' . $style;
+?>
+ <td <?php echo $attributes ?>><strong><?php if ( $can_edit_post && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ); ?>"><?php echo $title ?></a><?php } else { echo $title; }; _post_states( $post ); ?></strong>
+<?php
+ if ( 'excerpt' == $mode ) {
+ the_excerpt();
+ }
+ }
+
+ $actions = array();
+ if ( $can_edit_post && 'trash' != $post->post_status ) {
+ $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>';
+ $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick Edit' ) . '</a>';
+ }
+ if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
+ if ( 'trash' == $post->post_status )
+ $actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $post->ID ) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
+ elseif ( EMPTY_TRASH_DAYS )
+ $actions['trash'] = "<a class='submitdelete' title='" . esc_attr( __( 'Move this item to the Trash' ) ) . "' href='" . get_delete_post_link( $post->ID ) . "'>" . __( 'Trash' ) . "</a>";
+ if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
+ $actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
+ }
+ if ( in_array( $post->post_status, array( 'pending', 'draft' ) ) ) {
+ if ( $can_edit_post )
+ $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
+ } elseif ( 'trash' != $post->post_status ) {
+ $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View “%s”' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
+ }
+
+ $actions = apply_filters( is_post_type_hierarchical( $post->post_type ) ? 'page_row_actions' : 'post_row_actions', $actions, $post );
+ echo $this->row_actions( $actions );
+
+ get_inline_data( $post );
+ echo '</td>';
+ break;
+
+ case 'date':
+ if ( '0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name ) {
+ $t_time = $h_time = __( 'Unpublished' );
+ $time_diff = 0;
+ } else {
+ $t_time = get_the_time( __( 'Y/m/d g:i:s A' ) );
+ $m_time = $post->post_date;
+ $time = get_post_time( 'G', true, $post );
+
+ $time_diff = time() - $time;
+
+ if ( $time_diff > 0 && $time_diff < 24*60*60 )
+ $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
+ else
+ $h_time = mysql2date( __( 'Y/m/d' ), $m_time );
+ }
+
+ echo '<td ' . $attributes . '>';
+ if ( 'excerpt' == $mode )
+ echo apply_filters( 'post_date_column_time', $t_time, $post, $column_name, $mode );
+ else
+ echo '<abbr title="' . $t_time . '">' . apply_filters( 'post_date_column_time', $h_time, $post, $column_name, $mode ) . '</abbr>';
+ echo '<br />';
+ if ( 'publish' == $post->post_status ) {
+ _e( 'Published' );
+ } elseif ( 'future' == $post->post_status ) {
+ if ( $time_diff > 0 )
+ echo '<strong class="attention">' . __( 'Missed schedule' ) . '</strong>';
+ else
+ _e( 'Scheduled' );
+ } else {
+ _e( 'Last Modified' );
+ }
+ echo '</td>';
+ break;
+
+ case 'categories':
+ ?>
+ <td <?php echo $attributes ?>><?php
+ $categories = get_the_category();
+ if ( !empty( $categories ) ) {
+ $out = array();
+ foreach ( $categories as $c ) {
+ $out[] = sprintf( '<a href="%s">%s</a>',
+ esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'category_name' => $c->slug ), 'edit.php' ) ),
+ esc_html( sanitize_term_field( 'name', $c->name, $c->term_id, 'category', 'display' ) )
+ );
+ }
+ echo join( ', ', $out );
+ } else {
+ _e( 'Uncategorized' );
+ }
+ ?></td>
+ <?php
+ break;
+
+ case 'tags':
+ ?>
+ <td <?php echo $attributes ?>><?php
+ $tags = get_the_tags( $post->ID );
+ if ( !empty( $tags ) ) {
+ $out = array();
+ foreach ( $tags as $c ) {
+ $out[] = sprintf( '<a href="%s">%s</a>',
+ esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'tag' => $c->slug ), 'edit.php' ) ),
+ esc_html( sanitize_term_field( 'name', $c->name, $c->term_id, 'tag', 'display' ) )
+ );
+ }
+ echo join( ', ', $out );
+ } else {
+ _e( 'No Tags' );
+ }
+ ?></td>
+ <?php
+ break;
+
+ case 'comments':
+ ?>
+ <td <?php echo $attributes ?>><div class="post-com-count-wrapper">
+ <?php
+ $pending_comments = isset( $this->comment_pending_count[$post->ID] ) ? $this->comment_pending_count[$post->ID] : 0;
+
+ $this->comments_bubble( $post->ID, $pending_comments );
+ ?>
+ </div></td>
+ <?php
+ break;
+
+ case 'author':
+ ?>
+ <td <?php echo $attributes ?>><?php
+ printf( '<a href="%s">%s</a>',
+ esc_url( add_query_arg( array( 'post_type' => $post->post_type, 'author' => get_the_author_meta( 'ID' ) ), 'edit.php' )),
+ get_the_author()
+ );
+ ?></td>
+ <?php
+ break;
+
+ default:
+ ?>
+ <td <?php echo $attributes ?>><?php
+ if ( is_post_type_hierarchical( $post->post_type ) )
+ do_action( 'manage_pages_custom_column', $column_name, $post->ID );
+ else
+ do_action( 'manage_posts_custom_column', $column_name, $post->ID );
+ do_action( "manage_{$post->post_type}_posts_custom_column", $column_name, $post->ID );
+ ?></td>
+ <?php
+ break;
+ }
+ }
+ ?>
+ </tr>
+ <?php
+ $post = $global_post;
+ }
+
+ /**
+ * Outputs the hidden row displayed when inline editing
+ *
+ * @since 3.1.0
+ */
+ function inline_edit() {
+ global $mode;
+
+ $screen = get_current_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;
+ }
+
+ $m = ( isset( $mode ) && 'excerpt' == $mode ) ? 'excerpt' : 'list';
+ $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 );
+
+ ?>
+
+ <form method="get" action=""><table style="display: none"><tbody id="inlineedit">
+ <?php
+ $hclass = count( $hierarchical_taxonomies ) ? 'post' : 'page';
+ $bulk = 0;
+ while ( $bulk < 2 ) { ?>
+
+ <tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="inline-edit-row inline-edit-row-<?php echo "$hclass inline-edit-$screen->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"><td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
+
+ <fieldset class="inline-edit-col-left"><div class="inline-edit-col">
+ <h4><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></h4>
+ <?php
+
+ if ( post_type_supports( $screen->post_type, 'title' ) ) :
+ if ( $bulk ) : ?>
+ <div id="bulk-title-div">
+ <div id="bulk-titles"></div>
+ </div>
+
+ <?php else : // $bulk ?>
+
+ <label>
+ <span class="title"><?php _e( 'Title' ); ?></span>
+ <span class="input-text-wrap"><input type="text" name="post_title" class="ptitle" value="" /></span>
+ </label>
+
+ <label>
+ <span class="title"><?php _e( 'Slug' ); ?></span>
+ <span class="input-text-wrap"><input type="text" name="post_name" value="" /></span>
+ </label>
+
+ <?php endif; // $bulk
+ endif; // post_type_supports title ?>
+
+ <?php if ( !$bulk ) : ?>
+ <label><span class="title"><?php _e( 'Date' ); ?></span></label>
+ <div class="inline-edit-date">
+ <?php touch_time( 1, 1, 4, 1 ); ?>
+ </div>
+ <br class="clear" />
+ <?php endif; // $bulk
+
+ if ( post_type_supports( $screen->post_type, 'author' ) ) :
+ $authors_dropdown = '';
+
+ if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
+ $users_opt = array(
+ 'hide_if_only_one_author' => false,
+ 'who' => 'authors',
+ 'name' => 'post_author',
+ 'class'=> 'authors',
+ 'multi' => 1,
+ 'echo' => 0
+ );
+ if ( $bulk )
+ $users_opt['show_option_none'] = __( '— No Change —' );
+
+ if ( $authors = wp_dropdown_users( $users_opt ) ) :
+ $authors_dropdown = '<label class="inline-edit-author">';
+ $authors_dropdown .= '<span class="title">' . __( 'Author' ) . '</span>';
+ $authors_dropdown .= $authors;
+ $authors_dropdown .= '</label>';
+ endif;
+ endif; // authors
+ ?>
+
+ <?php if ( !$bulk ) echo $authors_dropdown;
+ endif; // post_type_supports author
+
+ if ( !$bulk ) :
+ ?>
+
+ <div class="inline-edit-group">
+ <label class="alignleft">
+ <span class="title"><?php _e( 'Password' ); ?></span>
+ <span class="input-text-wrap"><input type="text" name="post_password" class="inline-edit-password-input" value="" /></span>
+ </label>
+
+ <em style="margin:5px 10px 0 0" class="alignleft">
+ <?php
+ /* translators: Between password field and private checkbox on post quick edit interface */
+ echo __( '–OR–' );
+ ?>
+ </em>
+ <label class="alignleft inline-edit-private">
+ <input type="checkbox" name="keep_private" value="private" />
+ <span class="checkbox-title"><?php echo __( 'Private' ); ?></span>
+ </label>
+ </div>
+
+ <?php endif; ?>
+
+ </div></fieldset>
+
+ <?php if ( count( $hierarchical_taxonomies ) && !$bulk ) : ?>
+
+ <fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col">
+
+ <?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?>
+
+ <span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ) ?>
+ <span class="catshow"><?php _e( '[more]' ); ?></span>
+ <span class="cathide" style="display:none;"><?php _e( '[less]' ); ?></span>
+ </span>
+ <input type="hidden" name="<?php echo ( $taxonomy->name == 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" />
+ <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name )?>-checklist">
+ <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ) ?>
+ </ul>
+
+ <?php endforeach; //$hierarchical_taxonomies as $taxonomy ?>
+
+ </div></fieldset>
+
+ <?php endif; // count( $hierarchical_taxonomies ) && !$bulk ?>
+
+ <fieldset class="inline-edit-col-right"><div class="inline-edit-col">
+
+ <?php
+ if ( post_type_supports( $screen->post_type, 'author' ) && $bulk )
+ echo $authors_dropdown;
+ ?>
+
+ <?php if ( $post_type_object->hierarchical ) : ?>
+
+ <label>
+ <span class="title"><?php _e( 'Parent' ); ?></span>
+ <?php
+ $dropdown_args = array( 'post_type' => $post_type_object->name, 'selected' => $post->post_parent, 'name' => 'post_parent', 'show_option_none' => __( 'Main Page (no parent)' ), 'option_none_value' => 0, 'sort_column'=> 'menu_order, post_title' );
+ if ( $bulk )
+ $dropdown_args['show_option_no_change'] = __( '— No Change —' );
+ $dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args );
+ wp_dropdown_pages( $dropdown_args );
+ ?>
+ </label>
+
+ <?php if ( post_type_supports( $screen->post_type, 'page-attributes' ) ) :
+ if ( !$bulk ) : ?>
+
+ <label>
+ <span class="title"><?php _e( 'Order' ); ?></span>
+ <span class="input-text-wrap"><input type="text" name="menu_order" class="inline-edit-menu-order-input" value="<?php echo $post->menu_order ?>" /></span>
+ </label>
+
+ <?php endif; // !$bulk ?>
+
+ <label>
+ <span class="title"><?php _e( 'Template' ); ?></span>
+ <select name="page_template">
+ <?php if ( $bulk ) : ?>
+ <option value="-1"><?php _e( '— No Change —' ); ?></option>
+ <?php endif; // $bulk ?>
+ <option value="default"><?php _e( 'Default Template' ); ?></option>
+ <?php page_template_dropdown() ?>
+ </select>
+ </label>
+
+ <?php
+ endif; // post_type_supports page-attributes
+ endif; // $post_type_object->hierarchical ?>
+
+ <?php if ( count( $flat_taxonomies ) && !$bulk ) : ?>
+
+ <?php foreach ( $flat_taxonomies as $taxonomy ) : ?>
+
+ <label class="inline-edit-tags">
+ <span class="title"><?php echo esc_html( $taxonomy->labels->name ) ?></span>
+ <textarea cols="22" rows="1" name="tax_input[<?php echo esc_attr( $taxonomy->name )?>]" class="tax_input_<?php echo esc_attr( $taxonomy->name )?>"></textarea>
+ </label>
+
+ <?php endforeach; //$flat_taxonomies as $taxonomy ?>
+
+ <?php endif; // count( $flat_taxonomies ) && !$bulk ?>
+
+ <?php if ( post_type_supports( $screen->post_type, 'comments' ) || post_type_supports( $screen->post_type, 'trackbacks' ) ) :
+ if ( $bulk ) : ?>
+
+ <div class="inline-edit-group">
+ <?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
+ <label class="alignleft">
+ <span class="title"><?php _e( 'Comments' ); ?></span>
+ <select name="comment_status">
+ <option value=""><?php _e( '— No Change —' ); ?></option>
+ <option value="open"><?php _e( 'Allow' ); ?></option>
+ <option value="closed"><?php _e( 'Do not allow' ); ?></option>
+ </select>
+ </label>
+ <?php endif; if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
+ <label class="alignright">
+ <span class="title"><?php _e( 'Pings' ); ?></span>
+ <select name="ping_status">
+ <option value=""><?php _e( '— No Change —' ); ?></option>
+ <option value="open"><?php _e( 'Allow' ); ?></option>
+ <option value="closed"><?php _e( 'Do not allow' ); ?></option>
+ </select>
+ </label>
+ <?php endif; ?>
+ </div>
+
+ <?php else : // $bulk ?>
+
+ <div class="inline-edit-group">
+ <?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
+ <label class="alignleft">
+ <input type="checkbox" name="comment_status" value="open" />
+ <span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span>
+ </label>
+ <?php endif; if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
+ <label class="alignleft">
+ <input type="checkbox" name="ping_status" value="open" />
+ <span class="checkbox-title"><?php _e( 'Allow Pings' ); ?></span>
+ </label>
+ <?php endif; ?>
+ </div>
+
+ <?php endif; // $bulk
+ endif; // post_type_supports comments or pings ?>
+
+ <div class="inline-edit-group">
+ <label class="inline-edit-status alignleft">
+ <span class="title"><?php _e( 'Status' ); ?></span>
+ <select name="_status">
+ <?php if ( $bulk ) : ?>
+ <option value="-1"><?php _e( '— No Change —' ); ?></option>
+ <?php endif; // $bulk ?>
+ <?php if ( $can_publish ) : // Contributors only get "Unpublished" and "Pending Review" ?>
+ <option value="publish"><?php _e( 'Published' ); ?></option>
+ <option value="future"><?php _e( 'Scheduled' ); ?></option>
+ <?php if ( $bulk ) : ?>
+ <option value="private"><?php _e( 'Private' ) ?></option>
+ <?php endif; // $bulk ?>
+ <?php endif; ?>
+ <option value="pending"><?php _e( 'Pending Review' ); ?></option>
+ <option value="draft"><?php _e( 'Draft' ); ?></option>
+ </select>
+ </label>
+
+ <?php if ( 'post' == $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
+
+ <?php if ( $bulk ) : ?>
+
+ <label class="alignright">
+ <span class="title"><?php _e( 'Sticky' ); ?></span>
+ <select name="sticky">
+ <option value="-1"><?php _e( '— No Change —' ); ?></option>
+ <option value="sticky"><?php _e( 'Sticky' ); ?></option>
+ <option value="unsticky"><?php _e( 'Not Sticky' ); ?></option>
+ </select>
+ </label>
+
+ <?php else : // $bulk ?>
+
+ <label class="alignleft">
+ <input type="checkbox" name="sticky" value="sticky" />
+ <span class="checkbox-title"><?php _e( 'Make this post sticky' ); ?></span>
+ </label>
+
+ <?php endif; // $bulk ?>
+
+ <?php endif; // 'post' && $can_publish && current_user_can( 'edit_others_cap' ) ?>
+
+ </div>
+
+ </div></fieldset>
+
+ <?php
+ list( $columns ) = $this->get_column_info();
+
+ 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, $screen->post_type );
+ }
+ ?>
+ <p class="submit inline-edit-save">
+ <a accesskey="c" href="#inline-edit" title="<?php _e( 'Cancel' ); ?>" class="button-secondary cancel alignleft"><?php _e( 'Cancel' ); ?></a>
+ <?php if ( ! $bulk ) {
+ wp_nonce_field( 'inlineeditnonce', '_inline_edit', false );
+ $update_text = __( 'Update' );
+ ?>
+ <a accesskey="s" href="#inline-edit" title="<?php _e( 'Update' ); ?>" class="button-primary save alignright"><?php echo esc_attr( $update_text ); ?></a>
+ <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
+ <?php } else {
+ submit_button( __( 'Update' ), 'button-primary alignright', 'bulk_edit', false, array( 'accesskey' => 's' ) );
+ } ?>
+ <input type="hidden" name="post_view" value="<?php echo esc_attr( $m ); ?>" />
+ <input type="hidden" name="screen" value="<?php echo esc_attr( $screen->id ); ?>" />
+ <br class="clear" />
+ </p>
+ </td></tr>
+ <?php
+ $bulk++;
+ }
+?>
+ </tbody></table></form>
+<?php
+ }
+}
+
+?>
--- /dev/null
+<?php
+/**
+ * Terms List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_Terms_List_Table extends WP_List_Table {
+
+ var $callback_args;
+
+ function WP_Terms_List_Table() {
+ global $post_type, $taxonomy, $tax;
+
+ wp_reset_vars( array( 'action', 'taxonomy', 'post_type' ) );
+
+ if ( empty( $taxonomy ) )
+ $taxonomy = 'post_tag';
+
+ if ( !taxonomy_exists( $taxonomy ) )
+ wp_die( __( 'Invalid taxonomy' ) );
+
+ $tax = get_taxonomy( $taxonomy );
+
+ if ( empty( $post_type ) || !in_array( $post_type, get_post_types( array( 'public' => true ) ) ) )
+ $post_type = 'post';
+
+ parent::WP_List_Table( array(
+ 'plural' => 'tags',
+ 'singular' => 'tag',
+ ) );
+ }
+
+ function ajax_user_can() {
+ global $tax;
+
+ return current_user_can( $tax->cap->manage_terms );
+ }
+
+ function prepare_items() {
+ global $taxonomy;
+
+ $tags_per_page = $this->get_items_per_page( 'edit_' . $taxonomy . '_per_page' );
+
+ if ( 'post_tag' == $taxonomy ) {
+ $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
+ $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
+ } elseif ( 'category' == $taxonomy ) {
+ $tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); // Old filter
+ }
+
+ $search = !empty( $_REQUEST['s'] ) ? trim( stripslashes( $_REQUEST['s'] ) ) : '';
+
+ $args = array(
+ 'search' => $search,
+ 'page' => $this->get_pagenum(),
+ 'number' => $tags_per_page,
+ );
+
+ if ( !empty( $_REQUEST['orderby'] ) )
+ $args['orderby'] = trim( stripslashes( $_REQUEST['orderby'] ) );
+
+ if ( !empty( $_REQUEST['order'] ) )
+ $args['order'] = trim( stripslashes( $_REQUEST['order'] ) );
+
+ $this->callback_args = $args;
+
+ $this->set_pagination_args( array(
+ 'total_items' => wp_count_terms( $taxonomy, compact( 'search' ) ),
+ 'per_page' => $tags_per_page,
+ ) );
+ }
+
+ function has_items() {
+ // todo: populate $this->items in prepare_items()
+ return true;
+ }
+
+ function get_bulk_actions() {
+ $actions = array();
+ $actions['delete'] = __( 'Delete' );
+
+ return $actions;
+ }
+
+ function current_action() {
+ if ( isset( $_REQUEST['action'] ) && isset( $_REQUEST['delete_tags'] ) && ( 'delete' == $_REQUEST['action'] || 'delete' == $_REQUEST['action2'] ) )
+ return 'bulk-delete';
+
+ return parent::current_action();
+ }
+
+ function get_columns() {
+ global $taxonomy, $typenow;
+
+ $columns = array(
+ 'cb' => '<input type="checkbox" />',
+ 'name' => __( 'Name' ),
+ 'description' => __( 'Description' ),
+ 'slug' => __( 'Slug' ),
+ );
+
+ if ( 'link_category' == $taxonomy ) {
+ $columns['links'] = __( 'Links' );
+ } else {
+ $post_type = empty( $typenow ) ? 'post' : $typenow;
+ $post_type_object = get_post_type_object( $post_type );
+ $columns['posts'] = $post_type_object ? $post_type_object->labels->name : __( 'Posts' );
+ }
+
+ return $columns;
+ }
+
+ function get_sortable_columns() {
+ return array(
+ 'name' => 'name',
+ 'description' => 'description',
+ 'slug' => 'slug',
+ 'posts' => 'count',
+ 'links' => 'count'
+ );
+ }
+
+ function display_rows_or_placeholder() {
+ global $taxonomy;
+
+ $args = wp_parse_args( $this->callback_args, array(
+ 'page' => 1,
+ 'number' => 20,
+ 'search' => '',
+ 'hide_empty' => 0
+ ) );
+
+ extract( $args, EXTR_SKIP );
+
+ $args['offset'] = $offset = ( $page - 1 ) * $number;
+
+ // convert it to table rows
+ $out = '';
+ $count = 0;
+
+ $terms = array();
+
+ if ( is_taxonomy_hierarchical( $taxonomy ) && !isset( $orderby ) ) {
+ // We'll need the full set of terms then.
+ $args['number'] = $args['offset'] = 0;
+
+ $terms = get_terms( $taxonomy, $args );
+ if ( !empty( $search ) ) // 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 .= $this->_rows( $taxonomy, $terms, $children, $offset, $number, $count );
+ } else {
+ $terms = get_terms( $taxonomy, $args );
+ foreach ( $terms as $term )
+ $out .= $this->single_row( $term, 0, $taxonomy );
+ $count = $number; // Only displaying a single page.
+ }
+
+ if ( empty( $terms ) ) {
+ list( $columns, $hidden ) = $this->get_column_info();
+ echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
+ $this->no_items();
+ echo '</td></tr>';
+ } else {
+ echo $out;
+ }
+ }
+
+ function _rows( $taxonomy, $terms, &$children, $start = 0, $per_page = 20, &$count, $parent = 0, $level = 0 ) {
+
+ $end = $start + $per_page;
+
+ $output = '';
+ foreach ( $terms as $key => $term ) {
+
+ if ( $count >= $end )
+ break;
+
+ if ( $term->parent != $parent && empty( $_REQUEST['s'] ) )
+ continue;
+
+ // If the page starts in a subtree, print the parents.
+ if ( $count == $start && $term->parent > 0 && empty( $_REQUEST['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" . $this->single_row( $my_parent, $level - $num_parents, $taxonomy );
+ $num_parents--;
+ }
+ }
+
+ if ( $count >= $start )
+ $output .= "\t" . $this->single_row( $term, $level, $taxonomy );
+
+ ++$count;
+
+ unset( $terms[$key] );
+
+ if ( isset( $children[$term->term_id] ) && empty( $_REQUEST['s'] ) )
+ $output .= $this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );
+ }
+
+ return $output;
+ }
+
+ function single_row( $tag, $level = 0 ) {
+ static $row_class = '';
+ $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
+
+ $this->level = $level;
+
+ echo '<tr id="tag-' . $tag->term_id . '"' . $row_class . '>';
+ echo $this->single_row_columns( $tag );
+ echo '</tr>';
+ }
+
+ function column_cb( $tag ) {
+ global $taxonomy, $tax;
+
+ $default_term = get_option( 'default_' . $taxonomy );
+
+ if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term )
+ return '<input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" />';
+ else
+ return ' ';
+ }
+
+ function column_name( $tag ) {
+ global $taxonomy, $tax, $post_type;
+
+ $default_term = get_option( 'default_' . $taxonomy );
+
+ $pad = str_repeat( '— ', max( 0, $this->level ) );
+ $name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );
+ $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' );
+ $edit_link = get_edit_term_link( $tag->term_id, $taxonomy, $post_type );
+
+ $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a></strong><br />';
+
+ $actions = array();
+ if ( current_user_can( $tax->cap->edit_terms ) ) {
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
+ $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick Edit' ) . '</a>';
+ }
+ if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term )
+ $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) . "'>" . __( 'Delete' ) . "</a>";
+
+ $actions = apply_filters( 'tag_row_actions', $actions, $tag );
+ $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );
+
+ $out .= $this->row_actions( $actions );
+ $out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
+ $out .= '<div class="name">' . $qe_data->name . '</div>';
+ $out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug ) . '</div>';
+ $out .= '<div class="parent">' . $qe_data->parent . '</div></div></td>';
+
+ return $out;
+ }
+
+ function column_description( $tag ) {
+ return $tag->description;
+ }
+
+ function column_slug( $tag ) {
+ return apply_filters( 'editable_slug', $tag->slug );
+ }
+
+ function column_posts( $tag ) {
+ global $taxonomy, $post_type;
+
+ $count = number_format_i18n( $tag->count );
+
+ $tax = get_taxonomy( $taxonomy );
+
+ if ( ! $tax->public )
+ return $count;
+
+ if ( $tax->query_var ) {
+ $args = array( $tax->query_var => $tag->slug );
+ } else {
+ $args = array( 'taxonomy' => $tax->name, 'term' => $tag->slug );
+ }
+
+ $args['post_type'] = $post_type;
+
+ return "<a href='" . add_query_arg( $args, 'edit.php' ) . "'>$count</a>";
+ }
+
+ function column_links( $tag ) {
+ $count = number_format_i18n( $tag->count );
+ if ( $count )
+ $count = "<a href='link-manager.php?cat_id=$tag->term_id'>$count</a>";
+ return $count;
+ }
+
+ function column_default( $tag, $column_name ) {
+ $screen = get_current_screen();
+
+ return apply_filters( "manage_{$screen->taxonomy}_custom_column", '', $column_name, $tag->term_id );
+ }
+
+ /**
+ * Outputs the hidden row displayed when inline editing
+ *
+ * @since 3.1.0
+ */
+ function inline_edit() {
+ global $tax;
+
+ if ( ! current_user_can( $tax->cap->edit_terms ) )
+ return;
+?>
+
+ <form method="get" action=""><table style="display: none"><tbody id="inlineedit">
+ <tr id="inline-edit" class="inline-edit-row" style="display: none"><td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
+
+ <fieldset><div class="inline-edit-col">
+ <h4><?php _e( 'Quick Edit' ); ?></h4>
+
+ <label>
+ <span class="title"><?php _e( 'Name' ); ?></span>
+ <span class="input-text-wrap"><input type="text" name="name" class="ptitle" value="" /></span>
+ </label>
+ <?php if ( !global_terms_enabled() ) { ?>
+ <label>
+ <span class="title"><?php _e( 'Slug' ); ?></span>
+ <span class="input-text-wrap"><input type="text" name="slug" class="ptitle" value="" /></span>
+ </label>
+ <?php } ?>
+ </div></fieldset>
+ <?php
+
+ $core_columns = array( 'cb' => true, 'description' => true, 'name' => true, 'slug' => true, 'posts' => true );
+
+ list( $columns ) = $this->get_column_info();
+
+ foreach ( $columns as $column_name => $column_display_name ) {
+ if ( isset( $core_columns[$column_name] ) )
+ continue;
+
+ do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $tax->name );
+ }
+
+ ?>
+
+ <p class="inline-edit-save submit">
+ <a accesskey="c" href="#inline-edit" title="<?php _e( 'Cancel' ); ?>" class="cancel button-secondary alignleft"><?php _e( 'Cancel' ); ?></a>
+ <?php $update_text = $tax->labels->update_item; ?>
+ <a accesskey="s" href="#inline-edit" title="<?php echo esc_attr( $update_text ); ?>" class="save button-primary alignright"><?php echo $update_text; ?></a>
+ <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
+ <span class="error" style="display:none;"></span>
+ <?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>
+ <input type="hidden" name="taxonomy" value="<?php echo esc_attr( $tax->name ); ?>" />
+ <br class="clear" />
+ </p>
+ </td></tr>
+ </tbody></table></form>
+ <?php
+ }
+}
+
+?>
--- /dev/null
+<?php
+/**
+ * Theme Installer List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_Theme_Install_List_Table extends WP_List_Table {
+
+ function ajax_user_can() {
+ return current_user_can('install_themes');
+ }
+
+ function prepare_items() {
+ include( ABSPATH . 'wp-admin/includes/theme-install.php' );
+
+ global $tabs, $tab, $paged, $type, $term, $theme_field_defaults;
+
+ wp_reset_vars( array( 'tab' ) );
+
+ $paged = $this->get_pagenum();
+
+ $per_page = 30;
+
+ // These are the tabs which are shown on the page,
+ $tabs = array();
+ $tabs['dashboard'] = __( 'Search' );
+ if ( 'search' == $tab )
+ $tabs['search'] = __( 'Search Results' );
+ $tabs['upload'] = __( 'Upload' );
+ $tabs['featured'] = _x( 'Featured','Theme Installer' );
+ //$tabs['popular'] = _x( 'Popular','Theme Installer' );
+ $tabs['new'] = _x( 'Newest','Theme Installer' );
+ $tabs['updated'] = _x( 'Recently Updated','Theme Installer' );
+
+ $nonmenu_tabs = array( 'theme-information' ); // Valid actions to perform which do not have a Menu item.
+
+ $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 ) ) )
+ $tab = key( $tabs );
+
+ $args = array( 'page' => $paged, 'per_page' => $per_page, 'fields' => $theme_field_defaults );
+
+ switch ( $tab ) {
+ case 'search':
+ $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : '';
+ $term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
+
+ switch ( $type ) {
+ case 'tag':
+ $terms = explode( ',', $term );
+ $terms = array_map( 'trim', $terms );
+ $terms = array_map( 'sanitize_title_with_dashes', $terms );
+ $args['tag'] = $terms;
+ break;
+ case 'term':
+ $args['search'] = $term;
+ break;
+ case 'author':
+ $args['author'] = $term;
+ break;
+ }
+
+ if ( !empty( $_POST['features'] ) ) {
+ $terms = $_POST['features'];
+ $terms = array_map( 'trim', $terms );
+ $terms = array_map( 'sanitize_title_with_dashes', $terms );
+ $args['tag'] = $terms;
+ $_REQUEST['s'] = implode( ',', $terms );
+ $_REQUEST['type'] = 'tag';
+ }
+
+ add_action( 'install_themes_table_header', 'install_theme_search_form' );
+ break;
+
+ case 'featured':
+ //case 'popular':
+ case 'new':
+ case 'updated':
+ $args['browse'] = $tab;
+ break;
+
+ default:
+ $args = false;
+ }
+
+ if ( !$args )
+ return;
+
+ $api = themes_api( 'query_themes', $args );
+
+ if ( is_wp_error( $api ) )
+ wp_die( $api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __( 'Try again' ) . '</a>' );
+
+ $this->items = $api->themes;
+
+ $this->set_pagination_args( array(
+ 'total_items' => $api->info['results'],
+ 'per_page' => $per_page,
+ ) );
+ }
+
+ function no_items() {
+ _e( 'No themes match your request.' );
+ }
+
+ function get_views() {
+ global $tabs, $tab;
+
+ $display_tabs = array();
+ foreach ( (array) $tabs as $action => $text ) {
+ $class = ( $action == $tab ) ? ' class="current"' : '';
+ $href = self_admin_url('theme-install.php?tab=' . $action);
+ $display_tabs['theme-install-'.$action] = "<a href='$href'$class>$text</a>";
+ }
+
+ return $display_tabs;
+ }
+
+ function get_columns() {
+ return array();
+ }
+
+ function display() {
+
+ // wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
+?>
+ <div class="tablenav top">
+ <div class="alignleft actions">
+ <?php do_action( 'install_themes_table_header' ); ?>
+ </div>
+ <?php $this->pagination( 'top' ); ?>
+ <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
+ <br class="clear" />
+ </div>
+
+ <table id="availablethemes" cellspacing="0" cellpadding="0">
+ <tbody id="the-list" class="list:themes">
+ <?php $this->display_rows_or_placeholder(); ?>
+ </tbody>
+ </table>
+
+ <div class="tablenav bottom">
+ <?php $this->pagination( 'bottom' ); ?>
+ <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
+ <br class="clear" />
+ </div>
+<?php
+ }
+
+ function display_rows() {
+ $themes = $this->items;
+
+ $rows = ceil( count( $themes ) / 3 );
+ $table = array();
+ $theme_keys = array_keys( $themes );
+ for ( $row = 1; $row <= $rows; $row++ )
+ for ( $col = 1; $col <= 3; $col++ )
+ $table[$row][$col] = array_shift( $theme_keys );
+
+ foreach ( $table as $row => $cols ) {
+ echo "\t<tr>\n";
+ foreach ( $cols as $col => $theme_index ) {
+ $class = array( 'available-theme' );
+ if ( $row == 1 ) $class[] = 'top';
+ if ( $col == 1 ) $class[] = 'left';
+ if ( $row == $rows ) $class[] = 'bottom';
+ if ( $col == 3 ) $class[] = 'right';
+ ?>
+ <td class="<?php echo join( ' ', $class ); ?>"><?php
+ if ( isset( $themes[$theme_index] ) )
+ display_theme( $themes[$theme_index] );
+ ?></td>
+ <?php } // end foreach $cols
+ echo "\t</tr>\n";
+ } // end foreach $table
+ }
+}
+
+?>
--- /dev/null
+<?php
+/**
+ * Themes List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_Themes_List_Table extends WP_List_Table {
+
+ var $search = array();
+ var $features = array();
+
+ function ajax_user_can() {
+ // Do not check edit_theme_options here. AJAX calls for available themes require switch_themes.
+ return current_user_can('switch_themes');
+ }
+
+ function prepare_items() {
+ global $ct;
+
+ $ct = current_theme_info();
+
+ $themes = get_allowed_themes();
+
+ $search = !empty( $_REQUEST['s'] ) ? trim( stripslashes( $_REQUEST['s'] ) ) : '';
+
+ if ( '' !== $search ) {
+ $this->search = array_merge( $this->search, array_filter( array_map( 'trim', explode( ',', $search ) ) ) );
+ $this->search = array_unique( $this->search );
+ }
+
+ if ( !empty( $_REQUEST['features'] ) ) {
+ $this->features = $_REQUEST['features'];
+ $this->features = array_map( 'trim', $this->features );
+ $this->features = array_map( 'sanitize_title_with_dashes', $this->features );
+ $this->features = array_unique( $this->features );
+ }
+
+ if ( $this->search || $this->features ) {
+ foreach ( $themes as $key => $theme ) {
+ if ( !$this->search_theme( $theme ) )
+ unset( $themes[ $key ] );
+ }
+ }
+
+ unset( $themes[$ct->name] );
+ uksort( $themes, "strnatcasecmp" );
+
+ $per_page = 15;
+ $page = $this->get_pagenum();
+
+ $start = ( $page - 1 ) * $per_page;
+
+ $this->items = array_slice( $themes, $start, $per_page );
+
+ $this->set_pagination_args( array(
+ 'total_items' => count( $themes ),
+ 'per_page' => $per_page,
+ ) );
+ }
+
+ function no_items() {
+ if ( $this->search || $this->features ) {
+ _e( 'No items found.' );
+ return;
+ }
+
+ if ( is_multisite() ) {
+ if ( current_user_can( 'install_themes' ) && current_user_can( 'manage_network_themes' ) ) {
+ printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> or <a href="%2$s">install</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $GLOBALS['blog_id'] ), network_admin_url( 'theme-install.php' ) );
+
+ return;
+ } elseif ( current_user_can( 'manage_network_themes' ) ) {
+ printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to <a href="%1$s">enable</a> more themes.' ), network_admin_url( 'site-themes.php?id=' . $GLOBALS['blog_id'] ) );
+
+ return;
+ }
+ // else, fallthrough. install_themes doesn't help if you can't enable it.
+ } else {
+ if ( current_user_can( 'install_themes' ) ) {
+ printf( __( 'You only have one theme installed right now. Live a little! You can choose from over 1,000 free themes in the WordPress.org Theme Directory at any time: just click on the <a href="%s">Install Themes</a> tab above.' ), admin_url( 'theme-install.php' ) );
+
+ return;
+ }
+ }
+ // Fallthrough.
+ printf( __( 'Only the current theme is available to you. Contact the %s administrator for information about accessing additional themes.' ), get_site_option( 'site_name' ) );
+ }
+
+ function tablenav( $which = 'top' ) {
+ if ( $this->get_pagination_arg( 'total_pages' ) <= 1 )
+ return;
+ ?>
+ <div class="tablenav <?php echo $which; ?>">
+ <?php $this->pagination( $which ); ?>
+ <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
+ <br class="clear" />
+ </div>
+ <?php
+ }
+
+ function display() {
+ // wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );
+?>
+ <?php $this->tablenav( 'top' ); ?>
+
+ <table id="availablethemes" cellspacing="0" cellpadding="0">
+ <tbody id="the-list" class="list:themes">
+ <?php $this->display_rows_or_placeholder(); ?>
+ </tbody>
+ </table>
+
+ <?php $this->tablenav( 'bottom' ); ?>
+<?php
+ }
+
+ function get_columns() {
+ return array();
+ }
+
+ function display_rows() {
+ $themes = $this->items;
+ $theme_names = array_keys( $themes );
+ natcasesort( $theme_names );
+
+ $table = array();
+ $rows = ceil( count( $theme_names ) / 3 );
+ for ( $row = 1; $row <= $rows; $row++ )
+ for ( $col = 1; $col <= 3; $col++ )
+ $table[$row][$col] = array_shift( $theme_names );
+
+ foreach ( $table as $row => $cols ) {
+?>
+<tr>
+<?php
+foreach ( $cols as $col => $theme_name ) {
+ $class = array( 'available-theme' );
+ if ( $row == 1 ) $class[] = 'top';
+ if ( $col == 1 ) $class[] = 'left';
+ if ( $row == $rows ) $class[] = 'bottom';
+ if ( $col == 3 ) $class[] = 'right';
+?>
+ <td class="<?php echo join( ' ', $class ); ?>">
+<?php if ( !empty( $theme_name ) ) :
+ $template = $themes[$theme_name]['Template'];
+ $stylesheet = $themes[$theme_name]['Stylesheet'];
+ $title = $themes[$theme_name]['Title'];
+ $version = $themes[$theme_name]['Version'];
+ $description = $themes[$theme_name]['Description'];
+ $author = $themes[$theme_name]['Author'];
+ $screenshot = $themes[$theme_name]['Screenshot'];
+ $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
+ $template_dir = $themes[$theme_name]['Template Dir'];
+ $parent_theme = $themes[$theme_name]['Parent Theme'];
+ $theme_root = $themes[$theme_name]['Theme Root'];
+ $theme_root_uri = $themes[$theme_name]['Theme Root URI'];
+ $preview_link = esc_url( get_option( 'home' ) . '/' );
+ if ( is_ssl() )
+ $preview_link = str_replace( 'http://', 'https://', $preview_link );
+ $preview_link = htmlspecialchars( add_query_arg( array( 'preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true' ), $preview_link ) );
+ $preview_text = esc_attr( sprintf( __( 'Preview of “%s”' ), $title ) );
+ $tags = $themes[$theme_name]['Tags'];
+ $thickbox_class = 'thickbox thickbox-preview';
+ $activate_link = wp_nonce_url( "themes.php?action=activate&template=".urlencode( $template )."&stylesheet=".urlencode( $stylesheet ), 'switch-theme_' . $template );
+ $activate_text = esc_attr( sprintf( __( 'Activate “%s”' ), $title ) );
+ $actions = array();
+ $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' . $activate_text . '">' . __( 'Activate' ) . '</a>';
+ $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr( sprintf( __( 'Preview “%s”' ), $theme_name ) ) . '">' . __( 'Preview' ) . '</a>';
+ if ( ! is_multisite() && current_user_can( 'delete_themes' ) )
+ $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url( "themes.php?action=delete&template=$stylesheet", 'delete-theme_' . $stylesheet ) . '" onclick="' . "return confirm( '" . esc_js( sprintf( __( "You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete." ), $theme_name ) ) . "' );" . '">' . __( 'Delete' ) . '</a>';
+ $actions = apply_filters( 'theme_action_links', $actions, $themes[$theme_name] );
+
+ $actions = implode ( ' | ', $actions );
+?>
+ <a href="<?php echo $preview_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
+<?php if ( $screenshot ) : ?>
+ <img src="<?php echo $theme_root_uri . '/' . $stylesheet . '/' . $screenshot; ?>" alt="" />
+<?php endif; ?>
+ </a>
+<h3><?php
+ /* translators: 1: theme title, 2: theme version, 3: theme author */
+ printf( __( '%1$s %2$s by %3$s' ), $title, $version, $author ) ; ?></h3>
+<p class="description"><?php echo $description; ?></p>
+<span class='action-links'><?php echo $actions ?></span>
+ <?php if ( current_user_can( 'edit_themes' ) && $parent_theme ) {
+ /* translators: 1: theme title, 2: template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */ ?>
+ <p><?php printf( __( 'The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. 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 ); ?></p>
+<?php } else { ?>
+ <p><?php printf( __( 'All of this theme’s files are located in <code>%2$s</code>.' ), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ) ); ?></p>
+<?php } ?>
+<?php if ( $tags ) : ?>
+<p><?php _e( 'Tags:' ); ?> <?php echo join( ', ', $tags ); ?></p>
+<?php endif; ?>
+ <?php theme_update_available( $themes[$theme_name] ); ?>
+<?php endif; // end if not empty theme_name ?>
+ </td>
+<?php } // end foreach $cols ?>
+</tr>
+<?php } // end foreach $table
+ }
+
+ function search_theme( $theme ) {
+ $matched = 0;
+
+ // Match all phrases
+ if ( count( $this->search ) > 0 ) {
+ foreach ( $this->search as $word ) {
+ $matched = 0;
+
+ // In a tag?
+ if ( in_array( $word, array_map( 'sanitize_title_with_dashes', $theme['Tags'] ) ) )
+ $matched = 1;
+
+ // In one of the fields?
+ foreach ( array( 'Name', 'Title', 'Description', 'Author', 'Template', 'Stylesheet' ) AS $field ) {
+ if ( stripos( $theme[$field], $word ) !== false )
+ $matched++;
+ }
+
+ if ( $matched == 0 )
+ return false;
+ }
+ }
+
+ // Now search the features
+ if ( count( $this->features ) > 0 ) {
+ foreach ( $this->features as $word ) {
+ // In a tag?
+ if ( !in_array( $word, array_map( 'sanitize_title_with_dashes', $theme['Tags'] ) ) )
+ return false;
+ }
+ }
+
+ // Only get here if each word exists in the tags or one of the fields
+ return true;
+ }
+}
+
+?>
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['no_package'] = __('Update package not available.');
$this->strings['downloading_package'] = __('Downloading update from <span class="code">%s</span>…');
$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_success'] = __('Plugin upgraded successfully.');
+ $this->strings['process_failed'] = __('Plugin update failed.');
+ $this->strings['process_success'] = __('Plugin updated successfully.');
}
function install_strings() {
$this->skin->bulk_header();
- $this->maintenance_mode(true);
+ // Only start maintenance mode if running in Multisite OR the plugin is in use
+ $maintenance = is_multisite(); // @TODO: This should only kick in for individual sites if at all possible.
+ foreach ( $plugins as $plugin )
+ $maintenance = $maintenance || (is_plugin_active($plugin) && isset($current->response[ $plugin ]) ); // Only activate Maintenance mode if a plugin is active AND has an update available
+ if ( $maintenance )
+ $this->maintenance_mode(true);
$results = array();
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['no_package'] = __('Update package not available.');
$this->strings['downloading_package'] = __('Downloading update from <span class="code">%s</span>…');
$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_success'] = __('Theme upgraded successfully.');
+ $this->strings['process_failed'] = __('Theme update failed.');
+ $this->strings['process_success'] = __('Theme updated successfully.');
}
function install_strings() {
$this->skin->bulk_header();
- $this->maintenance_mode(true);
+ // Only start maintenance mode if running in Multisite OR the theme is in use
+ $maintenance = is_multisite(); // @TODO: This should only kick in for individual sites if at all possible.
+ foreach ( $themes as $theme )
+ $maintenance = $maintenance || $theme == get_stylesheet() || $theme == get_template();
+ if ( $maintenance )
+ $this->maintenance_mode(true);
$results = array();
if ( $theme != get_stylesheet() ) //If not current
return $return;
- //Change to maintainence mode now.
+ //Change to maintenance mode now.
if ( ! $this->bulk )
$this->maintenance_mode(true);
return $return;
//Ensure stylesheet name hasnt changed after the upgrade:
+ // @TODO: Note, This doesnt handle the Template changing, or the Template name changing.
if ( $theme == get_stylesheet() && $theme != $this->result['destination_name'] ) {
$theme_info = $this->theme_info();
$stylesheet = $this->result['destination_name'];
switch_theme($template, $stylesheet, true);
}
- //Time to remove maintainence mode
+ //Time to remove maintenance mode
if ( ! $this->bulk )
$this->maintenance_mode(false);
return $return;
function upgrade_strings() {
$this->strings['up_to_date'] = __('WordPress is at the latest version.');
- $this->strings['no_package'] = __('Upgrade package not available.');
+ $this->strings['no_package'] = __('Update package not available.');
$this->strings['downloading_package'] = __('Downloading update from <span class="code">%s</span>…');
$this->strings['unpack_package'] = __('Unpacking the update…');
$this->strings['copy_failed'] = __('Could not copy files.');
}
function __construct($args = array()) {
- $defaults = array( 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => __('Upgrade Plugin') );
+ $defaults = array( 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => __('Update Plugin') );
$args = wp_parse_args($args, $defaults);
$this->plugin = $args['plugin'];
$update_actions = array(
'activate_plugin' => '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $this->plugin, 'activate-plugin_' . $this->plugin) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>',
- 'plugins_page' => '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Goto plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'
+ 'plugins_page' => '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'
);
if ( $this->plugin_active )
unset( $update_actions['activate_plugin'] );
$update_actions = apply_filters('update_plugin_complete_actions', $update_actions, $this->plugin);
if ( ! empty($update_actions) )
- $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions));
+ $this->feedback(implode(' | ', (array)$update_actions));
}
function before() {
}
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: <strong>%2$s</strong>.');
+ $this->upgrader->strings['skin_upgrade_start'] = __('The update process is starting. This process may take a while on some hosts, so please be patient.');
+ $this->upgrader->strings['skin_update_failed_error'] = __('An error occurred while updating %1$s: <strong>%2$s</strong>.');
$this->upgrader->strings['skin_update_failed'] = __('The update of %1$s failed.');
$this->upgrader->strings['skin_update_successful'] = __('%1$s updated successfully.').' <a onclick="%2$s" href="#" class="hide-if-no-js"><span>'.__('Show Details').'</span><span class="hidden">'.__('Hide Details').'</span>.</a>';
$this->upgrader->strings['skin_upgrade_end'] = __('All updates have been completed.');
function bulk_footer() {
parent::bulk_footer();
$update_actions = array(
- 'plugins_page' => '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Goto plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>',
- 'updates_page' => '<a href="' . admin_url('update-core.php') . '" title="' . esc_attr__('Goto WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>'
+ 'plugins_page' => '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Go to plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>',
+ 'updates_page' => '<a href="' . self_admin_url('update-core.php') . '" title="' . esc_attr__('Go to WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>'
);
$update_actions = apply_filters('update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info);
if ( ! empty($update_actions) )
- $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions));
+ $this->feedback(implode(' | ', (array)$update_actions));
}
}
function bulk_footer() {
parent::bulk_footer();
$update_actions = array(
- 'themes_page' => '<a href="' . admin_url('themes.php') . '" title="' . esc_attr__('Goto themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>',
- 'updates_page' => '<a href="' . admin_url('update-core.php') . '" title="' . esc_attr__('Goto WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>'
+ 'themes_page' => '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Go to themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>',
+ 'updates_page' => '<a href="' . self_admin_url('update-core.php') . '" title="' . esc_attr__('Go to WordPress Updates page') . '" target="_parent">' . __('Return to WordPress Updates') . '</a>'
);
$update_actions = apply_filters('update_bulk_theme_complete_actions', $update_actions, $this->theme_info);
if ( ! empty($update_actions) )
- $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions));
+ $this->feedback(implode(' | ', (array)$update_actions));
}
}
else
$install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin') . '</a>';
- if ( is_multisite() && current_user_can( 'manage_network_plugins' ) )
- $install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>';
+ if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) {
+ $install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network') . '" target="_parent">' . __('Network Activate') . '</a>';
+ unset( $install_actions['activate_plugin'] );
+ }
if ( 'import' == $from )
$install_actions['importers_page'] = '<a href="' . admin_url('import.php') . '" title="' . esc_attr__('Return to Importers') . '" target="_parent">' . __('Return to Importers') . '</a>';
else if ( $this->type == 'web' )
- $install_actions['plugins_page'] = '<a href="' . admin_url('plugin-install.php') . '" title="' . esc_attr__('Return to Plugin Installer') . '" target="_parent">' . __('Return to Plugin Installer') . '</a>';
+ $install_actions['plugins_page'] = '<a href="' . self_admin_url('plugin-install.php') . '" title="' . esc_attr__('Return to Plugin Installer') . '" target="_parent">' . __('Return to Plugin Installer') . '</a>';
else
- $install_actions['plugins_page'] = '<a href="' . admin_url('plugins.php') . '" title="' . esc_attr__('Return to Plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>';
+ $install_actions['plugins_page'] = '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Return to Plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>';
if ( ! $this->result || is_wp_error($this->result) ) {
}
$install_actions = apply_filters('install_plugin_complete_actions', $install_actions, $this->api, $plugin_file);
if ( ! empty($install_actions) )
- $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$install_actions));
+ $this->feedback(implode(' | ', (array)$install_actions));
}
}
);
if ( $this->type == 'web' )
- $install_actions['themes_page'] = '<a href="' . admin_url('theme-install.php') . '" title="' . esc_attr__('Return to Theme Installer') . '" target="_parent">' . __('Return to Theme Installer') . '</a>';
+ $install_actions['themes_page'] = '<a href="' . self_admin_url('theme-install.php') . '" title="' . esc_attr__('Return to Theme Installer') . '" target="_parent">' . __('Return to Theme Installer') . '</a>';
else
- $install_actions['themes_page'] = '<a href="' . admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
+ $install_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
- if ( ! $this->result || is_wp_error($this->result) )
+ if ( ! $this->result || is_wp_error($this->result) || is_network_admin() )
unset( $install_actions['activate'], $install_actions['preview'] );
$install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info);
if ( ! empty($install_actions) )
- $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$install_actions));
+ $this->feedback(implode(' | ', (array)$install_actions));
}
}
}
function __construct($args = array()) {
- $defaults = array( 'url' => '', 'theme' => '', 'nonce' => '', 'title' => __('Upgrade Theme') );
+ $defaults = array( 'url' => '', 'theme' => '', 'nonce' => '', 'title' => __('Update Theme') );
$args = wp_parse_args($args, $defaults);
$this->theme = $args['theme'];
unset($update_actions['preview'], $update_actions['activate']);
}
- $update_actions['themes_page'] = '<a href="' . admin_url('themes.php') . '" title="' . esc_attr__('Return to Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
+ $update_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Return to Themes page') . '" target="_parent">' . __('Return to Themes page') . '</a>';
$update_actions = apply_filters('update_theme_complete_actions', $update_actions, $this->theme);
if ( ! empty($update_actions) )
- $this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions));
+ $this->feedback(implode(' | ', (array)$update_actions));
}
}
$this->package = $uploads['basedir'] . '/' . $this->filename;
}
}
-}
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Users List Table class.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ * @access private
+ */
+class WP_Users_List_Table extends WP_List_Table {
+
+ var $site_id;
+ var $is_site_users;
+
+ function WP_Users_List_Table() {
+ $screen = get_current_screen();
+ $this->is_site_users = 'site-users-network' == $screen->id;
+
+ if ( $this->is_site_users )
+ $this->site_id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+
+ parent::WP_List_Table( array(
+ 'singular' => 'user',
+ 'plural' => 'users'
+ ) );
+ }
+
+ function ajax_user_can() {
+ if ( $this->is_site_users )
+ return current_user_can( 'manage_sites' );
+ else
+ return current_user_can( 'list_users' );
+ }
+
+ function prepare_items() {
+ global $role, $usersearch;
+
+ $usersearch = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
+
+ $role = isset( $_REQUEST['role'] ) ? $_REQUEST['role'] : '';
+
+ $per_page = ( $this->is_site_users ) ? 'site_users_network_per_page' : 'users_per_page';
+ $users_per_page = $this->get_items_per_page( $per_page );
+
+ $paged = $this->get_pagenum();
+
+ $args = array(
+ 'number' => $users_per_page,
+ 'offset' => ( $paged-1 ) * $users_per_page,
+ 'role' => $role,
+ 'search' => $usersearch,
+ 'fields' => 'all_with_meta'
+ );
+
+ $args['search'] = '*' . $args['search'] . '*';
+
+ if ( $this->is_site_users )
+ $args['blog_id'] = $this->site_id;
+
+ if ( isset( $_REQUEST['orderby'] ) )
+ $args['orderby'] = $_REQUEST['orderby'];
+
+ if ( isset( $_REQUEST['order'] ) )
+ $args['order'] = $_REQUEST['order'];
+
+ // Query the user IDs for this page
+ $wp_user_search = new WP_User_Query( $args );
+
+ $this->items = $wp_user_search->get_results();
+
+ $this->set_pagination_args( array(
+ 'total_items' => $wp_user_search->get_total(),
+ 'per_page' => $users_per_page,
+ ) );
+ }
+
+ function no_items() {
+ _e( 'No matching users were found.' );
+ }
+
+ function get_views() {
+ global $wp_roles, $role;
+
+ if ( $this->is_site_users ) {
+ $url = 'site-users.php?id=' . $this->site_id;
+ switch_to_blog( $this->site_id );
+ $users_of_blog = count_users();
+ restore_current_blog();
+ } else {
+ $url = 'users.php';
+ $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['all'] = "<a href='$url'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
+ foreach ( $wp_roles->get_names() as $this_role => $name ) {
+ if ( !isset($avail_roles[$this_role]) )
+ continue;
+
+ $class = '';
+
+ if ( $this_role == $role ) {
+ $current_role = $role;
+ $class = ' class="current"';
+ }
+
+ $name = translate_user_role( $name );
+ /* translators: User role name with count */
+ $name = sprintf( __('%1$s <span class="count">(%2$s)</span>'), $name, $avail_roles[$this_role] );
+ $role_links[$this_role] = "<a href='" . add_query_arg( 'role', $this_role, $url ) . "'$class>$name</a>";
+ }
+
+ return $role_links;
+ }
+
+ function get_bulk_actions() {
+ $actions = array();
+
+ if ( is_multisite() ) {
+ if ( current_user_can( 'remove_users' ) )
+ $actions['remove'] = __( 'Remove' );
+ } else {
+ if ( current_user_can( 'delete_users' ) )
+ $actions['delete'] = __( 'Delete' );
+ }
+
+ return $actions;
+ }
+
+ function extra_tablenav( $which ) {
+ if ( 'top' != $which )
+ return;
+ if ( ! current_user_can( 'promote_users' ) )
+ return;
+?>
+ <div class="alignleft actions">
+ <label class="screen-reader-text" for="new_role"><?php _e( 'Change role to…' ) ?></label>
+ <select name="new_role" id="new_role">
+ <option value=''><?php _e( 'Change role to…' ) ?></option>
+ <?php wp_dropdown_roles(); ?>
+ </select>
+ <?php submit_button( __( 'Change' ), 'secondary', 'changeit', false ); ?>
+ </div>
+<?php
+ }
+
+ function current_action() {
+ if ( isset($_REQUEST['changeit']) && !empty($_REQUEST['new_role']) )
+ return 'promote';
+
+ return parent::current_action();
+ }
+
+ function get_columns() {
+ $c = array(
+ 'cb' => '<input type="checkbox" />',
+ 'username' => __( 'Username' ),
+ 'name' => __( 'Name' ),
+ 'email' => __( 'E-mail' ),
+ 'role' => __( 'Role' ),
+ 'posts' => __( 'Posts' )
+ );
+
+ if ( $this->is_site_users )
+ unset( $c['posts'] );
+
+ return $c;
+ }
+
+ function get_sortable_columns() {
+ $c = array(
+ 'username' => 'login',
+ 'name' => 'name',
+ 'email' => 'email',
+ );
+
+ if ( $this->is_site_users )
+ unset( $c['posts'] );
+
+ return $c;
+ }
+
+ function display_rows() {
+ // Query the post counts for this page
+ if ( ! $this->is_site_users )
+ $post_counts = count_many_users_posts( array_keys( $this->items ) );
+
+ $style = '';
+ foreach ( $this->items as $userid => $user_object ) {
+ $role = reset( $user_object->roles );
+
+ if ( is_multisite() && empty( $role ) )
+ continue;
+
+ $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
+ echo "\n\t", $this->single_row( $user_object, $style, $role, isset( $post_counts ) ? $post_counts[ $userid ] : 0 );
+ }
+ }
+
+ /**
+ * Generate HTML for a single row on the users.php admin panel.
+ *
+ * @since 2.1.0
+ *
+ * @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 single_row( $user_object, $style = '', $role = '', $numposts = 0 ) {
+ global $wp_roles;
+
+ if ( !( is_object( $user_object ) && is_a( $user_object, 'WP_User' ) ) )
+ $user_object = new WP_User( (int) $user_object );
+ $user_object = sanitize_user_object( $user_object, 'display' );
+ $email = $user_object->user_email;
+
+ if ( $this->is_site_users )
+ $url = "site-users.php?id={$this->site_id}&";
+ else
+ $url = 'users.php?';
+
+ $checkbox = '';
+ // Check if the user for this row is editable
+ if ( current_user_can( 'list_users' ) ) {
+ // Set up the user editing link
+ // TODO: make profile/user-edit determination a separate function
+ if ( get_current_user_id() == $user_object->ID ) {
+ $edit_link = 'profile.php';
+ } else {
+ $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), "user-edit.php?user_id=$user_object->ID" ) );
+ }
+
+ // Set up the hover actions for this user
+ $actions = array();
+
+ if ( current_user_can( 'edit_user', $user_object->ID ) ) {
+ $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />";
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
+ } else {
+ $edit = "<strong>$user_object->user_login</strong><br />";
+ }
+
+ if ( !is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'delete_user', $user_object->ID ) )
+ $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "users.php?action=delete&user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Delete' ) . "</a>";
+ if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can( 'remove_user', $user_object->ID ) )
+ $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url( $url."action=remove&user=$user_object->ID", 'bulk-users' ) . "'>" . __( 'Remove' ) . "</a>";
+ $actions = apply_filters( 'user_row_actions', $actions, $user_object );
+ $edit .= $this->row_actions( $actions );
+
+ // Set up the checkbox ( because the user is editable, otherwise its empty )
+ $checkbox = "<input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' />";
+
+ } else {
+ $edit = '<strong>' . $user_object->user_login . '</strong>';
+ }
+ $role_name = isset( $wp_roles->role_names[$role] ) ? translate_user_role( $wp_roles->role_names[$role] ) : __( 'None' );
+ $avatar = get_avatar( $user_object->ID, 32 );
+
+ $r = "<tr id='user-$user_object->ID'$style>";
+
+ list( $columns, $hidden ) = $this->get_column_info();
+
+ 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':
+ $r .= "<th scope='row' class='check-column'>$checkbox</th>";
+ break;
+ case 'username':
+ $r .= "<td $attributes>$avatar $edit</td>";
+ break;
+ case 'name':
+ $r .= "<td $attributes>$user_object->first_name $user_object->last_name</td>";
+ break;
+ case 'email':
+ $r .= "<td $attributes><a href='mailto:$email' title='" . esc_attr( sprintf( __( 'E-mail: %s' ), $email ) ) . "'>$email</a></td>";
+ break;
+ case 'role':
+ $r .= "<td $attributes>$role_name</td>";
+ break;
+ case 'posts':
+ $attributes = 'class="posts column-posts num"' . $style;
+ $r .= "<td $attributes>";
+ if ( $numposts > 0 ) {
+ $r .= "<a href='edit.php?author=$user_object->ID' title='" . esc_attr__( 'View posts by this author' ) . "' class='edit'>";
+ $r .= $numposts;
+ $r .= '</a>';
+ } else {
+ $r .= 0;
+ }
+ $r .= "</td>";
+ break;
+ default:
+ $r .= "<td $attributes>";
+ $r .= apply_filters( 'manage_users_custom_column', '', $column_name, $user_object->ID );
+ $r .= "</td>";
+ }
+ }
+ $r .= '</tr>';
+
+ return $r;
+ }
+}
+
+?>
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.0.0
* @uses $wpdb
*
- * @param string $comment_author
- * @param string $comment_date
+ * @param string $comment_author Author of the comment
+ * @param string $comment_date Date of the comment
* @return mixed Comment ID on success.
*/
function comment_exists($comment_author, $comment_date) {
}
/**
- * {@internal Missing Short Description}}
+ * Update a comment with values provided in $_POST.
*
- * @since unknown
+ * @since 2.0.0
*/
function edit_comment() {
- $comment_post_ID = (int) $_POST['comment_post_ID'];
-
- if (!current_user_can( 'edit_post', $comment_post_ID ))
- wp_die( __('You are not allowed to edit comments on this post, so you cannot edit this comment.' ));
+ if ( ! current_user_can( 'edit_comment', (int) $_POST['comment_ID'] ) )
+ wp_die ( __( 'You are not allowed to edit comments on this post.' ) );
$_POST['comment_author'] = $_POST['newcomment_author'];
$_POST['comment_author_email'] = $_POST['newcomment_author_email'];
}
}
- if (!empty ( $_POST['edit_date'] ) ) {
+ if ( !empty ( $_POST['edit_date'] ) ) {
$aa = $_POST['aa'];
$mm = $_POST['mm'];
$jj = $_POST['jj'];
$_POST['comment_date'] = "$aa-$mm-$jj $hh:$mn:$ss";
}
- wp_update_comment( $_POST);
+ wp_update_comment( $_POST );
}
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.0.0
*
- * @param unknown_type $id
- * @return unknown
+ * @param int $id ID of comment to retrieve
+ * @return bool|object Comment if found. False on failure.
*/
function get_comment_to_edit( $id ) {
if ( !$comment = get_comment($id) )
/**
* Get the number of pending comments on a post or posts
*
- * @since unknown
+ * @since 2.3.0
* @uses $wpdb
*
* @param int|array $post_id Either a single Post ID or an array of Post IDs
if ( 'true' == get_user_option( 'comment_shortcuts' ) )
wp_enqueue_script( 'jquery-table-hotkeys' );
}
-
-if ( is_admin() && isset($pagenow) && ('edit-comments.php' == $pagenow || 'edit.php' == $pagenow) ) {
- if ( get_option('show_avatars') )
- add_filter( 'comment_author', 'floated_admin_avatar' );
-}
-
?>
/**
* Registers dashboard widgets.
*
- * handles POST data, sets up filters.
+ * Handles POST data, sets up filters.
*
- * @since unknown
+ * @since 2.5.0
*/
function wp_dashboard_setup() {
global $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks;
$wp_dashboard_control_callbacks = array();
+ $screen = get_current_screen();
$update = false;
$widget_options = get_option( 'dashboard_widget_options' );
/* Register Widgets and Controls */
// Right Now
- wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' );
+ if ( is_blog_admin() && current_user_can('edit_posts') )
+ wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' );
+
+ if ( is_network_admin() )
+ wp_add_dashboard_widget( 'network_dashboard_right_now', __( 'Right Now' ), 'wp_network_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,
- );
+ if ( is_blog_admin() && current_user_can('moderate_comments') ) {
+ 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_dashboard_recent_comments_control' );
}
- $recent_comments_title = __( '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') ) {
- $update = true;
- $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10;
- $widget_options['dashboard_incoming_links'] = array(
- 'home' => get_option('home'),
- 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
- 'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?scoring=d&ie=utf-8&num=' . $num_items . '&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
- 'items' => $num_items,
- 'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
- );
+ if ( is_blog_admin() && current_user_can('publish_posts') ) {
+ if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
+ $update = true;
+ $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10;
+ $widget_options['dashboard_incoming_links'] = array(
+ 'home' => get_option('home'),
+ 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
+ 'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?scoring=d&ie=utf-8&num=' . $num_items . '&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
+ 'items' => $num_items,
+ 'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
+ );
+ }
+ wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' );
}
- 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( 'install_plugins' ) )
+ if ( ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) )
wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );
// QuickPress Widget
- if ( current_user_can('edit_posts') )
+ if ( is_blog_admin() && current_user_can('edit_posts') )
wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
// Recent Drafts
- if ( current_user_can('edit_posts') )
+ if ( is_blog_admin() && current_user_can('edit_posts') )
wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' );
// Primary feed (Dev Blog) Widget
wp_add_dashboard_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_secondary', 'wp_dashboard_secondary_control' );
// Hook to register new widgets
- do_action( 'wp_dashboard_setup' );
-
// Filter widget order
- $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() );
+ if ( is_network_admin() ) {
+ do_action( 'wp_network_dashboard_setup' );
+ $dashboard_widgets = apply_filters( 'wp_network_dashboard_widgets', array() );
+ } elseif ( is_user_admin() ) {
+ do_action( 'wp_user_dashboard_setup' );
+ $dashboard_widgets = apply_filters( 'wp_user_dashboard_widgets', array() );
+ } else {
+ do_action( 'wp_dashboard_setup' );
+ $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() );
+ }
foreach ( $dashboard_widgets as $widget_id ) {
$name = empty( $wp_registered_widgets[$widget_id]['all_link'] ) ? $wp_registered_widgets[$widget_id]['name'] : $wp_registered_widgets[$widget_id]['name'] . " <a href='{$wp_registered_widgets[$widget_id]['all_link']}' class='edit-box open-box'>" . __('View all') . '</a>';
if ( $update )
update_option( 'dashboard_widget_options', $widget_options );
- do_action('do_meta_boxes', 'dashboard', 'normal', '');
- do_action('do_meta_boxes', 'dashboard', 'side', '');
+ do_action('do_meta_boxes', $screen->id, 'normal', '');
+ do_action('do_meta_boxes', $screen->id, 'side', '');
}
function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null ) {
+ $screen = get_current_screen();
global $wp_dashboard_control_callbacks;
+
if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) {
$wp_dashboard_control_callbacks[$widget_id] = $control_callback;
if ( isset( $_GET['edit'] ) && $widget_id == $_GET['edit'] ) {
list($url) = explode( '#', add_query_arg( 'edit', false ), 2 );
$widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( $url ) . '">' . __( 'Cancel' ) . '</a></span>';
- add_meta_box( $widget_id, $widget_name, '_wp_dashboard_control_callback', 'dashboard', 'normal', 'core' );
- return;
+ $callback = '_wp_dashboard_control_callback';
+ } else {
+ list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );
+ $widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( "$url#$widget_id" ) . '" class="edit-box open-box">' . __( 'Configure' ) . '</a></span>';
}
- list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );
- $widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( "$url#$widget_id" ) . '" class="edit-box open-box">' . __( 'Configure' ) . '</a></span>';
}
- $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary');
+
+ if ( is_blog_admin () )
+ $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary');
+ else if (is_network_admin() )
+ $side_widgets = array('dashboard_primary', 'dashboard_secondary');
+ else
+ $side_widgets = array();
+
$location = 'normal';
if ( in_array($widget_id, $side_widgets) )
$location = 'side';
- add_meta_box( $widget_id, $widget_name , $callback, 'dashboard', $location, 'core' );
+ add_meta_box( $widget_id, $widget_name , $callback, $screen->id, $location, 'core' );
}
function _wp_dashboard_control_callback( $dashboard, $meta_box ) {
echo '<form action="" method="post" class="dashboard-widget-control-form">';
wp_dashboard_trigger_widget_control( $meta_box['id'] );
- echo '<p class="submit"><input type="hidden" name="widget_id" value="' . esc_attr($meta_box['id']) . '" /><input type="submit" value="' . esc_attr__( 'Submit' ) . '" /></p>';
-
+ echo '<input type="hidden" name="widget_id" value="' . esc_attr($meta_box['id']) . '" />';
+ submit_button( __('Submit') );
echo '</form>';
}
/**
* Displays the dashboard.
*
- * @since unknown
+ * @since 2.5.0
*/
function wp_dashboard() {
global $screen_layout_columns;
+ $screen = get_current_screen();
+
$hide2 = $hide3 = $hide4 = '';
switch ( $screen_layout_columns ) {
case 4:
<div id="dashboard-widgets" class="metabox-holder">
<?php
echo "\t<div class='postbox-container' style='$width'>\n";
- do_meta_boxes( 'dashboard', 'normal', '' );
+ do_meta_boxes( $screen->id, 'normal', '' );
echo "\t</div><div class='postbox-container' style='{$hide2}$width'>\n";
- do_meta_boxes( 'dashboard', 'side', '' );
+ do_meta_boxes( $screen->id, 'side', '' );
echo "\t</div><div class='postbox-container' style='{$hide3}$width'>\n";
- do_meta_boxes( 'dashboard', 'column3', '' );
+ do_meta_boxes( $screen->id, 'column3', '' );
echo "\t</div><div class='postbox-container' style='{$hide4}$width'>\n";
- do_meta_boxes( 'dashboard', 'column4', '' );
+ do_meta_boxes( $screen->id, 'column4', '' );
?>
</div></div>
do_action( 'activity_box_end' );
}
+function wp_network_dashboard_right_now() {
+ $actions = array();
+ if ( current_user_can('create_sites') )
+ $actions['create-site'] = '<a href="' . network_admin_url('site-new.php') . '">' . __( 'Create a New Site' ) . '</a>';
+ if ( current_user_can('create_users') )
+ $actions['create-user'] = '<a href="' . network_admin_url('user-new.php') . '">' . __( 'Create a New User' ) . '</a>';
+
+ $c_users = get_user_count();
+ $c_blogs = get_blog_count();
+
+ $user_text = sprintf( _n( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) );
+ $blog_text = sprintf( _n( '%s site', '%s sites', $c_blogs ), number_format_i18n( $c_blogs ) );
+
+ $sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text );
+
+ if ( $actions ) {
+ echo '<ul class="subsubsub">';
+ foreach ( $actions as $class => $action ) {
+ $actions[ $class ] = "\t<li class='$class'>$action";
+ }
+ echo implode( " |</li>\n", $actions ) . "</li>\n";
+ echo '</ul>';
+ }
+?>
+ <br class="clear" />
+
+ <p class="youhave"><?php echo $sentence; ?></p>
+ <?php do_action( 'wpmuadminresult', '' ); ?>
+
+ <form name="searchform" action="<?php echo network_admin_url('users.php'); ?>" method="get">
+ <p>
+ <input type="text" name="s" value="" size="17" />
+ <?php submit_button( __( 'Search Users' ), 'button', 'submit', false, array( 'id' => 'submit_users' ) ); ?>
+ </p>
+ </form>
+
+ <form name="searchform" action="<?php echo network_admin_url('sites.php'); ?>" method="get">
+ <p>
+ <input type="text" name="s" value="" size="17" />
+ <?php submit_button( __( 'Search Sites' ), 'button', 'submit', false, array( 'id' => 'submit_sites' ) ); ?>
+ </p>
+ </form>
+<?php
+ do_action( 'mu_rightnow_end' );
+ do_action( 'mu_activity_box_end' );
+}
+
function wp_dashboard_quick_press_output() {
global $post_ID;
<h4 id="content-label"><label for="content"><?php _e('Content') ?></label></h4>
<div class="textarea-wrap">
- <textarea name="content" id="content" class="mceEditor" rows="3" cols="15" tabindex="2"><?php echo $post->post_content; ?></textarea>
+ <textarea name="content" id="content" class="mceEditor" rows="3" cols="15" tabindex="2"><?php echo esc_textarea( $post->post_content ); ?></textarea>
</div>
<script type="text/javascript">edCanvas = document.getElementById('content');edInsertContent = null;</script>
<input type="hidden" name="quickpress_post_ID" value="<?php echo $post_ID; ?>" />
<input type="hidden" name="post_type" value="post" />
<?php wp_nonce_field('add-post'); ?>
- <input type="submit" name="save" id="save-post" class="button" tabindex="4" value="<?php esc_attr_e('Save Draft'); ?>" />
+ <?php submit_button( __( 'Save Draft' ), 'button', 'save', false, array( 'id' => 'save-post', 'tabindex'=> 4 ) ); ?>
<input type="reset" value="<?php esc_attr_e( 'Reset' ); ?>" class="button" />
<span id="publishing-action">
<input type="submit" name="publish" id="publish" accesskey="p" tabindex="5" class="button-primary" value="<?php current_user_can('publish_posts') ? esc_attr_e('Publish') : esc_attr_e('Submit for Review'); ?>" />
/**
* Display recent comments dashboard widget content.
*
- * @since unknown
+ * @since 2.5.0
*/
function wp_dashboard_recent_comments() {
global $wpdb;
$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;
+ $total_items = isset( $widgets['dashboard_recent_comments'] ) && isset( $widgets['dashboard_recent_comments']['items'] )
+ ? absint( $widgets['dashboard_recent_comments']['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" ) ) {
$comment_link = '<a class="comment-link" href="' . esc_url(get_comment_link()) . '">#</a>';
$actions_string = '';
- if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
+ if ( current_user_can( 'edit_comment', $comment->comment_ID ) ) {
// preorder it: Approve | Reply | Edit | Spam | Trash
$actions = array(
'approve' => '', 'unapprove' => '',
$trash_url = esc_url( "comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
$delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
- $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
- $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
- $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
- $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
- $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
+ $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
+ $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
+ $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . esc_attr__('Edit comment') . "'>". __('Edit') . '</a>';
+ $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.esc_attr__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
+ $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
if ( !EMPTY_TRASH_DAYS )
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
else
- $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
+ $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
$actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
$widget_options['dashboard_recent_comments'] = array();
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-recent-comments']) ) {
- $number = (int) stripslashes($_POST['widget-recent-comments']['items']);
- if ( $number < 1 || $number > 30 )
- $number = 5;
+ $number = absint( $_POST['widget-recent-comments']['items'] );
$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 '<p><label for="comments-number">' . __('Number of comments to show:') . '</label>';
- echo '<input id="comments-number" name="widget-recent-comments[items]" type="text" value="' . $number . '" size="3" /> <small>' . __( '(at most 30)' ) . '</small></p>';
+ echo '<input id="comments-number" name="widget-recent-comments[items]" type="text" value="' . $number . '" size="3" /></p>';
}
function wp_dashboard_incoming_links() {
/**
* Display incoming links dashboard widget content.
*
- * @since unknown
+ * @since 2.5.0
*/
function wp_dashboard_incoming_links_output() {
$widgets = get_option( 'dashboard_widget_options' );
/* translators: incoming links feed, %1$s is other person, %3$s is content */
$text = __( '%1$s linked here saying, "%3$s"' );
- if ( $show_date ) {
- if ( $show_author || $show_summary )
+ if ( !empty($show_date) ) {
+ if ( !empty($show_author) || !empty($show_summary) )
/* translators: incoming links feed, %4$s is the date */
$text .= ' ' . __( 'on %4$s' );
$date = esc_html( strip_tags( $item->get_date() ) );
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
- * @param int $widget_id
+ * @param string $widget_id
*/
function wp_dashboard_rss_output( $widget_id ) {
$widgets = get_option( 'dashboard_widget_options' );
/**
* Display secondary dashboard RSS widget feed.
*
- * @since unknown
+ * @since 2.5.0
*
* @return unknown
*/
/**
* Display plugins most popular, newest plugins, and recently updated widget text.
*
- * @since unknown
+ * @since 2.5.0
*/
function wp_dashboard_plugins_output() {
$popular = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/popular/' );
* echoes out output for this widget. If not cache, echo a "Loading..." stub
* which is later replaced by AJAX call (see top of /wp-admin/index.php)
*
- * @since unknown
+ * @since 2.5.0
*
- * @param int $widget_id
+ * @param string $widget_id
* @param callback $callback
* @param array $check_urls RSS feeds
* @return bool False on failure. True on success.
/**
* Calls widget control callback.
*
- * @since unknown
+ * @since 2.5.0
*
* @param int $widget_control_id Registered Widget ID.
*/
* Sets up $args to be used as input to wp_widget_rss_form(). Handles POST data
* from RSS-type widgets.
*
- * @since unknown
+ * @since 2.5.0
*
- * @param string widget_id
- * @param array form_inputs
+ * @param string $widget_id
+ * @param array $form_inputs
*/
function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
if ( !$widget_options = get_option( 'dashboard_widget_options' ) )
wp_widget_rss_form( $widget_options[$widget_id], $form_inputs );
}
+// Display File upload quota on dashboard
+function wp_dashboard_quota() {
+ if ( !is_multisite() || !current_user_can('edit_posts') || get_site_option( 'upload_space_check_disabled' ) )
+ return true;
+
+ $quota = get_space_allowed();
+ $used = get_dirsize( BLOGUPLOADDIR ) / 1024 / 1024;
+
+ if ( $used > $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 );
+
+ ?>
+ <p class="sub musub"><?php _e( 'Storage Space' ); ?></p>
+ <div class="table table_content musubtable">
+ <table>
+ <tr class="first">
+ <td class="first b b-posts"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>' ), esc_url( admin_url( 'upload.php' ) ), $quota ); ?></td>
+ <td class="t posts"><?php _e( 'Space Allowed' ); ?></td>
+ </tr>
+ </table>
+ </div>
+ <div class="table table_discussion musubtable">
+ <table>
+ <tr class="first">
+ <td class="b b-comments"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>' ), esc_url( admin_url( 'upload.php' ) ), $used, $percentused ); ?></td>
+ <td class="last t comments <?php echo $used_color;?>"><?php _e( 'Space Used' );?></td>
+ </tr>
+ </table>
+ </div>
+ <br class="clear" />
+ <?php
+}
+add_action( 'activity_box_end', 'wp_dashboard_quota' );
+
/**
* Empty function usable by plugins to output empty dashboard widget (to be populated later by JS).
*/
*
*/
function documentation_link() {
- _deprecated_function( __FUNCTION__, '2.5', '' );
+ _deprecated_function( __FUNCTION__, '2.5' );
return;
}
/**
* {@internal Missing Short Description}}
*
- * @since unknown
- * @deprecated unknown
+ * @since 0.71
+ * @deprecated 2.6.0
* @deprecated Use wp_category_checklist()
* @see wp_category_checklist()
*
* @param unknown_type $popular_ids
*/
function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {
- _deprecated_function( __FUNCTION__, '0.0', 'wp_category_checklist()' );
+ _deprecated_function( __FUNCTION__, '2.6', 'wp_category_checklist()' );
global $post_ID;
wp_category_checklist( $post_ID );
}
/**
* {@internal Missing Short Description}}
*
- * @since unknown
- * @deprecated unknown
+ * @since 2.1.0
+ * @deprecated 2.6.0
* @deprecated Use wp_link_category_checklist()
* @see wp_link_category_checklist()
*
* @param unknown_type $default
*/
function dropdown_link_categories( $default = 0 ) {
- _deprecated_function( __FUNCTION__, '0.0', 'wp_link_category_checklist()' );
+ _deprecated_function( __FUNCTION__, '2.6', 'wp_link_category_checklist()' );
global $link_id;
wp_link_category_checklist( $link_id );
}
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.2.0
* @deprecated 3.0.0
* @deprecated Use wp_dropdown_categories()
* @see wp_dropdown_categories()
return;
}
-?>
\ No newline at end of file
+
+/**
+ * @deprecated 3.1.0
+ *
+ * @return array List of user IDs.
+ */
+function get_author_user_ids() {
+ _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
+
+ global $wpdb;
+ 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) );
+}
+
+/**
+ * @deprecated 3.1.0
+ *
+ * @param int $user_id User ID.
+ * @return array|bool List of editable authors. False if no editable users.
+ */
+function get_editable_authors( $user_id ) {
+ _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
+
+ global $wpdb;
+
+ $editable = get_editable_user_ids( $user_id );
+
+ if ( !$editable ) {
+ return false;
+ } else {
+ $editable = join(',', $editable);
+ $authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" );
+ }
+
+ return apply_filters('get_editable_authors', $authors);
+}
+
+/**
+ * @deprecated 3.1.0
+ *
+ * @param int $user_id User ID.
+ * @param bool $exclude_zeros Optional, default is true. Whether to exclude zeros.
+ * @return unknown
+ */
+function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) {
+ _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
+
+ global $wpdb;
+
+ $user = new WP_User( $user_id );
+ $post_type_obj = get_post_type_object($post_type);
+
+ 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();
+ }
+
+ 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 )
+ $query .= " AND meta_value != '0'";
+
+ return $wpdb->get_col( $query );
+}
+
+/**
+ * @deprecated 3.1.0
+ */
+function get_nonauthor_user_ids() {
+ _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
+
+ global $wpdb;
+
+ 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) );
+}
+
+if ( !class_exists('WP_User_Search') ) :
+/**
+ * WordPress User Search class.
+ *
+ * @since 2.1.0
+ * @deprecated 3.1.0
+ */
+class WP_User_Search {
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var unknown_type
+ */
+ var $results;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var unknown_type
+ */
+ var $search_term;
+
+ /**
+ * Page number.
+ *
+ * @since 2.1.0
+ * @access private
+ * @var int
+ */
+ var $page;
+
+ /**
+ * Role name that users have.
+ *
+ * @since 2.5.0
+ * @access private
+ * @var string
+ */
+ var $role;
+
+ /**
+ * Raw page number.
+ *
+ * @since 2.1.0
+ * @access private
+ * @var int|bool
+ */
+ var $raw_page;
+
+ /**
+ * Amount of users to display per page.
+ *
+ * @since 2.1.0
+ * @access public
+ * @var int
+ */
+ var $users_per_page = 50;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var unknown_type
+ */
+ var $first_user;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var int
+ */
+ var $last_user;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var string
+ */
+ var $query_limit;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 3.0.0
+ * @access private
+ * @var string
+ */
+ var $query_orderby;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 3.0.0
+ * @access private
+ * @var string
+ */
+ var $query_from;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 3.0.0
+ * @access private
+ * @var string
+ */
+ var $query_where;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var int
+ */
+ var $total_users_for_query = 0;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var bool
+ */
+ var $too_many_total_users = false;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.1.0
+ * @access private
+ * @var unknown_type
+ */
+ var $search_errors;
+
+ /**
+ * {@internal Missing Description}}
+ *
+ * @since 2.7.0
+ * @access private
+ * @var unknown_type
+ */
+ var $paging_text;
+
+ /**
+ * PHP4 Constructor - Sets up the object properties.
+ *
+ * @since 2.1.0
+ *
+ * @param string $search_term Search terms string.
+ * @param int $page Optional. Page ID.
+ * @param string $role Role name.
+ * @return WP_User_Search
+ */
+ function WP_User_Search ($search_term = '', $page = '', $role = '') {
+ _deprecated_function( __FUNCTION__, '3.1', 'WP_User_Query' );
+
+ $this->search_term = $search_term;
+ $this->raw_page = ( '' == $page ) ? false : (int) $page;
+ $this->page = (int) ( '' == $page ) ? 1 : $page;
+ $this->role = $role;
+
+ $this->prepare_query();
+ $this->query();
+ $this->prepare_vars_for_template_usage();
+ $this->do_paging();
+ }
+
+ /**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since 2.1.0
+ * @access public
+ */
+ 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_orderby = ' ORDER BY user_login';
+
+ $search_sql = '';
+ if ( $this->search_term ) {
+ $searches = array();
+ $search_sql = 'AND (';
+ foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col )
+ $searches[] = $col . " LIKE '%$this->search_term%'";
+ $search_sql .= implode(' OR ', $searches);
+ $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 ) );
+ }
+
+ /**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since 2.1.0
+ * @access public
+ */
+ function query() {
+ global $wpdb;
+
+ $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(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!'));
+ }
+
+ /**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since 2.1.0
+ * @access public
+ */
+ function prepare_vars_for_template_usage() {
+ $this->search_term = stripslashes($this->search_term); // done with DB, from now on we want slashes gone
+ }
+
+ /**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since 2.1.0
+ * @access public
+ */
+ function do_paging() {
+ if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
+ $args = array();
+ if( ! empty($this->search_term) )
+ $args['usersearch'] = urlencode($this->search_term);
+ if( ! empty($this->role) )
+ $args['role'] = urlencode($this->role);
+
+ $this->paging_text = paginate_links( array(
+ 'total' => ceil($this->total_users_for_query / $this->users_per_page),
+ 'current' => $this->page,
+ 'base' => 'users.php?%_%',
+ 'format' => 'userspage=%#%',
+ 'add_args' => $args
+ ) );
+ if ( $this->paging_text ) {
+ $this->paging_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
+ number_format_i18n( ( $this->page - 1 ) * $this->users_per_page + 1 ),
+ number_format_i18n( min( $this->page * $this->users_per_page, $this->total_users_for_query ) ),
+ number_format_i18n( $this->total_users_for_query ),
+ $this->paging_text
+ );
+ }
+ }
+ }
+
+ /**
+ * {@internal Missing Short Description}}
+ *
+ * {@internal Missing Long Description}}
+ *
+ * @since 2.1.0
+ * @access public
+ *
+ * @return unknown
+ */
+ function get_results() {
+ return (array) $this->results;
+ }
+
+ /**
+ * Displaying paging text.
+ *
+ * @see do_paging() Builds paging text.
+ *
+ * @since 2.1.0
+ * @access public
+ */
+ function page_links() {
+ echo $this->paging_text;
+ }
+
+ /**
+ * Whether paging is enabled.
+ *
+ * @see do_paging() Builds paging text.
+ *
+ * @since 2.1.0
+ * @access public
+ *
+ * @return bool
+ */
+ function results_are_paged() {
+ if ( $this->paging_text )
+ return true;
+ return false;
+ }
+
+ /**
+ * Whether there are search terms.
+ *
+ * @since 2.1.0
+ * @access public
+ *
+ * @return bool
+ */
+ function is_search() {
+ if ( $this->search_term )
+ return true;
+ return false;
+ }
+}
+endif;
+
+/**
+ * Retrieve editable posts from other users.
+ *
+ * @deprecated 3.1.0
+ *
+ * @param int $user_id User ID to not retrieve posts from.
+ * @param string $type Optional, defaults to 'any'. Post type to retrieve, can be 'draft' or 'pending'.
+ * @return array List of posts from others.
+ */
+function get_others_unpublished_posts($user_id, $type='any') {
+ _deprecated_function( __FUNCTION__, '3.1' );
+
+ global $wpdb;
+
+ $editable = get_editable_user_ids( $user_id );
+
+ if ( in_array($type, array('draft', 'pending')) )
+ $type_sql = " post_status = '$type' ";
+ else
+ $type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";
+
+ $dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';
+
+ if ( !$editable ) {
+ $other_unpubs = '';
+ } else {
+ $editable = join(',', $editable);
+ $other_unpubs = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != %d ORDER BY post_modified $dir", $user_id) );
+ }
+
+ return apply_filters('get_others_drafts', $other_unpubs);
+}
+
+/**
+ * Retrieve drafts from other users.
+ *
+ * @deprecated 3.1.0
+ *
+ * @param int $user_id User ID.
+ * @return array List of drafts from other users.
+ */
+function get_others_drafts($user_id) {
+ _deprecated_function( __FUNCTION__, '3.1' );
+
+ return get_others_unpublished_posts($user_id, 'draft');
+}
+
+/**
+ * Retrieve pending review posts from other users.
+ *
+ * @deprecated 3.1.0
+ *
+ * @param int $user_id User ID.
+ * @return array List of posts with pending review post type from other users.
+ */
+function get_others_pending($user_id) {
+ _deprecated_function( __FUNCTION__, '3.1' );
+
+ return get_others_unpublished_posts($user_id, 'pending');
+}
*
* Bump this when something changes that might affect compatibility.
*
- * @since unknown
- * @var string
+ * @since 2.5.0
*/
-define('WXR_VERSION', '1.0');
+define( 'WXR_VERSION', '1.1' );
/**
- * {@internal Missing Short Description}}
+ * Generates the WXR export file for download
*
- * @since unknown
+ * @since 2.1.0
*
- * @param unknown_type $args
+ * @param array $args Filters defining what should be included in the export
*/
function export_wp( $args = array() ) {
- global $wpdb, $post_ids, $post, $wp_taxonomies;
+ global $wpdb, $post;
- if ( ! is_array( $args ) )
- $args = array( 'author' => $args );
-
- $defaults = array( 'author' => null, 'taxonomy' => null, 'post_type' => null, 'post_status' => null, 'start_date' => null, 'end_date' => null );
+ $defaults = array( 'content' => 'all', 'author' => false, 'category' => false,
+ 'start_date' => false, 'end_date' => false, 'status' => false,
+ );
$args = wp_parse_args( $args, $defaults );
- extract($args);
-
- do_action('export_wp');
+ do_action( 'export_wp' );
- if( strlen( $start_date ) > 4 && strlen( $end_date ) > 4 )
- $filename = 'wordpress.' . $start_date . '.' . $end_date . '.xml';
- else
- $filename = 'wordpress.' . date( 'Y-m-d' ) . '.xml';
+ $sitename = sanitize_key( get_bloginfo( 'name' ) );
+ if ( ! empty($sitename) ) $sitename .= '.';
+ $filename = $sitename . 'wordpress.' . date( 'Y-m-d' ) . '.xml';
header( 'Content-Description: File Transfer' );
header( 'Content-Disposition: attachment; filename=' . $filename );
header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );
- if ( $post_type && $post_type != 'all' )
- $where = $wpdb->prepare("WHERE post_type = %s ", $post_type);
- else
- $where = "WHERE post_type != 'revision' ";
+ if ( 'all' != $args['content'] && post_type_exists( $args['content'] ) ) {
+ $ptype = get_post_type_object( $args['content'] );
+ if ( ! $ptype->can_export )
+ $args['content'] = 'post';
- if ( $author && $author != 'all' ) {
- $author_id = (int) $author;
- $where .= $wpdb->prepare( "AND post_author = %d ", $author_id );
+ $where = $wpdb->prepare( "{$wpdb->posts}.post_type = %s", $args['content'] );
+ } else {
+ $post_types = get_post_types( array( 'can_export' => true ) );
+ $esses = array_fill( 0, count($post_types), '%s' );
+ $where = $wpdb->prepare( "{$wpdb->posts}.post_type IN (". implode(',',$esses) .")", $post_types );
}
- if ( $start_date && $start_date != 'all' )
- $where .= $wpdb->prepare( "AND post_date >= %s ", $start_date );
-
- if ( $end_date && $end_date != 'all' )
- $where .= $wpdb->prepare( "AND post_date < %s ", $end_date );
+ if ( $args['status'] && ( 'post' == $args['content'] || 'page' == $args['content'] ) )
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_status = %s", $args['status'] );
+ else
+ $where .= " AND {$wpdb->posts}.post_status != 'auto-draft'";
- 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 );
+ $join = '';
+ if ( $args['category'] && 'post' == $args['content'] ) {
+ if ( $term = term_exists( $args['category'], 'category' ) ) {
+ $join = "INNER JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id)";
+ $where .= $wpdb->prepare( " AND {$wpdb->term_relationships}.term_taxonomy_id = %d", $term['term_taxonomy_id'] );
}
}
- if ( $post_status && $post_status != 'all' )
- $where .= $wpdb->prepare( "AND post_status = %s", $post_status );
+ if ( 'post' == $args['content'] || 'page' == $args['content'] ) {
+ if ( $args['author'] )
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_author = %d", $args['author'] );
- // 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" );
+ if ( $args['start_date'] )
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_date >= %s", date( 'Y-m-d', strtotime($args['start_date']) ) );
- $categories = (array) get_categories( array( 'get' => 'all' ) );
- $tags = (array) get_tags( array( '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, array( '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();
+ if ( $args['end_date'] )
+ $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_date < %s", date( 'Y-m-d', strtotime('+1 month', strtotime($args['end_date'])) ) );
+ }
- foreach ( $categories as $category ){
- $parents[$category->term_id] = $category->parent;
+ // grab a snapshot of post IDs, just in case it changes during the export
+ $post_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} $join WHERE $where" );
+
+ // get the requested terms ready, empty unless posts filtered by category or all content
+ $cats = $tags = $terms = array();
+ if ( isset( $term ) && $term ) {
+ $cat = get_term( $term['term_id'], 'category' );
+ $cats = array( $cat->term_id => $cat );
+ unset( $term, $cat );
+ } else if ( 'all' == $args['content'] ) {
+ $categories = (array) get_categories( array( 'get' => 'all' ) );
+ $tags = (array) get_tags( array( 'get' => 'all' ) );
+
+ $custom_taxonomies = get_taxonomies( array( '_builtin' => false ) );
+ $custom_terms = (array) get_terms( $custom_taxonomies, array( 'get' => 'all' ) );
+
+ // put categories in order with no child going before its parent
+ while ( $cat = array_shift( $categories ) ) {
+ if ( $cat->parent == 0 || isset( $cats[$cat->parent] ) )
+ $cats[$cat->term_id] = $cat;
+ else
+ $categories[] = $cat;
}
- $parents = array_unique( array_diff( $parents, array_keys( $parents ) ) );
-
- if ( $zero = array_search( '0', $parents ) )
- unset( $parents[$zero] );
-
- return $parents;
- }
-
- 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;
- }
+ // put terms in order with no child going before its parent
+ while ( $t = array_shift( $custom_terms ) ) {
+ if ( $t->parent == 0 || isset( $terms[$t->parent] ) )
+ $terms[$t->term_id] = $t;
+ else
+ $custom_terms[] = $t;
+ }
- // 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, $custom_taxonomies, $custom_terms );
}
- unset( $categories );
/**
- * Place string in CDATA tag.
+ * Wrap given string in XML CDATA tag.
*
- * @since unknown
+ * @since 2.1.0
*
- * @param string $str String to place in XML CDATA tag.
+ * @param string $str String to wrap in XML CDATA tag.
*/
function wxr_cdata( $str ) {
if ( seems_utf8( $str ) == false )
}
/**
- * {@internal Missing Short Description}}
+ * Return the URL of the site
*
- * @since unknown
+ * @since 2.5.0
*
* @return string Site URL.
*/
function wxr_site_url() {
- global $current_site;
-
- // mu: the base url
- if ( isset( $current_site->domain ) )
+ // ms: the base url
+ if ( is_multisite() )
return network_home_url();
// wp: the blog url
else
}
/**
- * {@internal Missing Short Description}}
+ * Output a cat_name XML tag from a given category object
*
- * @since unknown
+ * @since 2.1.0
*
- * @param object $c Category Object
+ * @param object $category Category Object
*/
- function wxr_cat_name( $c ) {
- if ( empty( $c->name ) )
+ function wxr_cat_name( $category ) {
+ if ( empty( $category->name ) )
return;
- echo '<wp:cat_name>' . wxr_cdata( $c->name ) . '</wp:cat_name>';
+ echo '<wp:cat_name>' . wxr_cdata( $category->name ) . '</wp:cat_name>';
}
/**
- * {@internal Missing Short Description}}
+ * Output a category_description XML tag from a given category object
*
- * @since unknown
+ * @since 2.1.0
*
- * @param object $c Category Object
+ * @param object $category Category Object
*/
- function wxr_category_description( $c ) {
- if ( empty( $c->description ) )
+ function wxr_category_description( $category ) {
+ if ( empty( $category->description ) )
return;
- echo '<wp:category_description>' . wxr_cdata($c->description) . '</wp:category_description>';
+ echo '<wp:category_description>' . wxr_cdata( $category->description ) . '</wp:category_description>';
}
/**
- * {@internal Missing Short Description}}
+ * Output a tag_name XML tag from a given tag object
*
- * @since unknown
+ * @since 2.3.0
*
- * @param object $t Tag Object
+ * @param object $tag Tag Object
*/
- function wxr_tag_name( $t ) {
- if ( empty( $t->name ) )
+ function wxr_tag_name( $tag ) {
+ if ( empty( $tag->name ) )
return;
- echo '<wp:tag_name>' . wxr_cdata($t->name) . '</wp:tag_name>';
+ echo '<wp:tag_name>' . wxr_cdata( $tag->name ) . '</wp:tag_name>';
}
/**
- * {@internal Missing Short Description}}
+ * Output a tag_description XML tag from a given tag object
*
- * @since unknown
+ * @since 2.3.0
*
- * @param object $t Tag Object
+ * @param object $tag Tag Object
*/
- function wxr_tag_description( $t ) {
- if ( empty( $t->description ) )
+ function wxr_tag_description( $tag ) {
+ if ( empty( $tag->description ) )
return;
- echo '<wp:tag_description>' . wxr_cdata($t->description) . '</wp:tag_description>';
+ echo '<wp:tag_description>' . wxr_cdata( $tag->description ) . '</wp:tag_description>';
}
/**
- * {@internal Missing Short Description}}
+ * Output a term_name XML tag from a given term object
*
- * @since unknown
+ * @since 2.9.0
*
- * @param object $t Term Object
+ * @param object $term Term Object
*/
- function wxr_term_name( $t ) {
- if ( empty( $t->name ) )
+ function wxr_term_name( $term ) {
+ if ( empty( $term->name ) )
return;
- echo '<wp:term_name>' . wxr_cdata($t->name) . '</wp:term_name>';
+ echo '<wp:term_name>' . wxr_cdata( $term->name ) . '</wp:term_name>';
}
/**
- * {@internal Missing Short Description}}
+ * Output a term_description XML tag from a given term object
*
- * @since unknown
+ * @since 2.9.0
*
- * @param object $t Term Object
+ * @param object $term Term Object
*/
- function wxr_term_description( $t ) {
- if ( empty( $t->description ) )
+ function wxr_term_description( $term ) {
+ if ( empty( $term->description ) )
return;
- echo '<wp:term_description>' . wxr_cdata($t->description) . '</wp:term_description>';
+ echo '<wp:term_description>' . wxr_cdata( $term->description ) . '</wp:term_description>';
}
/**
- * {@internal Missing Short Description}}
+ * Output list of authors with posts
*
- * @since unknown
+ * @since 3.1.0
+ */
+ function wxr_authors_list() {
+ global $wpdb;
+
+ $authors = array();
+ $results = $wpdb->get_results( "SELECT DISTINCT post_author FROM $wpdb->posts" );
+ foreach ( (array) $results as $result )
+ $authors[] = get_userdata( $result->post_author );
+
+ $authors = array_filter( $authors );
+
+ foreach( $authors as $author ) {
+ echo "\t<wp:author>";
+ echo '<wp:author_id>' . $author->ID . '</wp:author_id>';
+ echo '<wp:author_login>' . $author->user_login . '</wp:author_login>';
+ echo '<wp:author_email>' . $author->user_email . '</wp:author_email>';
+ echo '<wp:author_display_name>' . wxr_cdata( $author->display_name ) . '</wp:author_display_name>';
+ echo '<wp:author_first_name>' . wxr_cdata( $author->user_firstname ) . '</wp:author_first_name>';
+ echo '<wp:author_last_name>' . wxr_cdata( $author->user_lastname ) . '</wp:author_last_name>';
+ echo "</wp:author>\n";
+ }
+ }
+
+ /**
+ * Ouput all navigation menu terms
+ *
+ * @since 3.1.0
+ */
+ function wxr_nav_menu_terms() {
+ $nav_menus = wp_get_nav_menus();
+ if ( empty( $nav_menus ) || ! is_array( $nav_menus ) )
+ return;
+
+ foreach ( $nav_menus as $menu ) {
+ echo "\t<wp:term><wp:term_id>{$menu->term_id}</wp:term_id><wp:term_taxonomy>nav_menu</wp:term_taxonomy><wp:term_slug>{$menu->slug}</wp:term_slug>";
+ wxr_term_name( $menu );
+ echo "</wp:term>\n";
+ }
+ }
+
+ /**
+ * Output list of taxonomy terms, in XML tag format, associated with a post
+ *
+ * @since 2.3.0
*/
function wxr_post_taxonomy() {
global $post;
- $the_list = '';
- $filter = 'rss';
+ $taxonomies = get_object_taxonomies( $post->post_type );
+ if ( empty( $taxonomies ) )
+ return;
+ $terms = wp_get_object_terms( $post->ID, $taxonomies );
- $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<category><![CDATA[$term_name]]></category>\n";
- elseif ( 'post_tag' == $term->taxonomy )
- $the_list .= "\n\t\t<category domain=\"$domain\"><![CDATA[$term_name]]></category>\n";
- // forwards compatibility as above
- $the_list .= "\n\t\t<category domain=\"$domain\" nicename=\"{$term->slug}\"><![CDATA[$term_name]]></category>\n";
+ echo "\t\t<category domain=\"{$term->taxonomy}\" nicename=\"{$term->slug}\">" . wxr_cdata( $term->name ) . "</category>\n";
}
- echo $the_list;
}
- echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
+ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . "\" ?>\n";
?>
-<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
-<!-- It contains information about your blog's posts, comments, and categories. -->
+<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
+<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
-<!-- This file is not intended to serve as a complete backup of your blog. -->
-
-<!-- To import this information into a WordPress blog follow these steps. -->
-<!-- 1. Log in to that blog as an administrator. -->
-<!-- 2. Go to Tools: Import in the blog's admin panels (or Manage: Import in older versions of WordPress). -->
-<!-- 3. Choose "WordPress" from the list. -->
-<!-- 4. Upload this file using the form provided on that page. -->
-<!-- 5. You will first be asked to map the authors in this export file to users -->
-<!-- on the blog. For each author, you may choose to map to an -->
-<!-- existing user on the blog or to create a new user -->
-<!-- 6. WordPress will then import each of the posts, comments, and categories -->
-<!-- contained in this file into your blog -->
-
-<?php the_generator( 'export' );?>
+<!-- This file is not intended to serve as a complete backup of your site. -->
+
+<!-- To import this information into a WordPress site follow these steps: -->
+<!-- 1. Log in to that site as an administrator. -->
+<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
+<!-- 3. Install the "WordPress" importer from the list. -->
+<!-- 4. Activate & Run Importer. -->
+<!-- 5. Upload this file using the form provided on that page. -->
+<!-- 6. You will first be asked to map the authors in this export file to users -->
+<!-- on the site. For each author, you may choose to map to an -->
+<!-- existing user on the site or to create a new user. -->
+<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
+<!-- contained in this file into your site. -->
+
+<?php the_generator( 'export' ); ?>
<rss version="2.0"
xmlns:excerpt="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/excerpt/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
<channel>
<title><?php bloginfo_rss( 'name' ); ?></title>
- <link><?php bloginfo_rss( 'url' ) ?></link>
- <description><?php bloginfo_rss( 'description' ) ?></description>
- <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_lastpostmodified( 'GMT' ), false ); ?></pubDate>
- <generator>http://wordpress.org/?v=<?php bloginfo_rss( 'version' ); ?></generator>
+ <link><?php bloginfo_rss( 'url' ); ?></link>
+ <description><?php bloginfo_rss( 'description' ); ?></description>
+ <pubDate><?php echo date( 'D, d M Y H:i:s +0000' ); ?></pubDate>
<language><?php echo get_option( 'rss_language' ); ?></language>
<wp:wxr_version><?php echo WXR_VERSION; ?></wp:wxr_version>
<wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url>
<wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url>
- <?php if ( $cats ) : foreach ( $cats as $c ) : ?>
- <wp:category><wp:category_nicename><?php echo $c->slug; ?></wp:category_nicename><wp:category_parent><?php echo $c->parent ? $cats[$c->parent]->name : ''; ?></wp:category_parent><?php wxr_cat_name( $c ); ?><?php wxr_category_description( $c ); ?></wp:category>
- <?php endforeach; endif; ?>
- <?php if ( $tags ) : foreach ( $tags as $t ) : ?>
- <wp:tag><wp:tag_slug><?php echo $t->slug; ?></wp:tag_slug><?php wxr_tag_name( $t ); ?><?php wxr_tag_description( $t ); ?></wp:tag>
- <?php endforeach; endif; ?>
- <?php if ( $terms ) : foreach ( $terms as $t ) : ?>
- <wp:term><wp:term_taxonomy><?php echo $t->taxonomy; ?></wp:term_taxonomy><wp:term_slug><?php echo $t->slug; ?></wp:term_slug><wp:term_parent><?php echo $t->parent ? $custom_taxonomies[$t->parent]->name : ''; ?></wp:term_parent><?php wxr_term_name( $t ); ?><?php wxr_term_description( $t ); ?></wp:term>
- <?php endforeach; endif; ?>
+
+<?php wxr_authors_list(); ?>
+
+<?php foreach ( $cats as $c ) : ?>
+ <wp:category><wp:term_id><?php echo $c->term_id ?></wp:term_id><wp:category_nicename><?php echo $c->slug; ?></wp:category_nicename><wp:category_parent><?php echo $c->parent ? $cats[$c->parent]->slug : ''; ?></wp:category_parent><?php wxr_cat_name( $c ); ?><?php wxr_category_description( $c ); ?></wp:category>
+<?php endforeach; ?>
+<?php foreach ( $tags as $t ) : ?>
+ <wp:tag><wp:term_id><?php echo $t->term_id ?></wp:term_id><wp:tag_slug><?php echo $t->slug; ?></wp:tag_slug><?php wxr_tag_name( $t ); ?><?php wxr_tag_description( $t ); ?></wp:tag>
+<?php endforeach; ?>
+<?php foreach ( $terms as $t ) : ?>
+ <wp:term><wp:term_id><?php echo $t->term_id ?></wp:term_id><wp:term_taxonomy><?php echo $t->taxonomy; ?></wp:term_taxonomy><wp:term_slug><?php echo $t->slug; ?></wp:term_slug><wp:term_parent><?php echo $t->parent ? $terms[$t->parent]->slug : ''; ?></wp:term_parent><?php wxr_term_name( $t ); ?><?php wxr_term_description( $t ); ?></wp:term>
+<?php endforeach; ?>
+<?php if ( 'all' == $args['content'] ) wxr_nav_menu_terms(); ?>
<?php do_action( 'rss2_head' ); ?>
- <?php if ( $post_ids ) {
+<?php if ( $post_ids ) {
global $wp_query;
- $wp_query->in_the_loop = true; // Fake being in the loop.
+ $wp_query->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" );
+ $posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
// Begin Loop
- foreach ($posts as $post) {
- setup_postdata( $post );
-
- $is_sticky = 0;
- if ( is_sticky( $post->ID ) )
- $is_sticky = 1;
-
- ?>
+ foreach ( $posts as $post ) {
+ setup_postdata( $post );
+ $is_sticky = is_sticky( $post->ID ) ? 1 : 0;
+?>
<item>
<title><?php echo apply_filters( 'the_title_rss', $post->post_title ); ?></title>
<link><?php the_permalink_rss() ?></link>
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
- <dc:creator><?php echo wxr_cdata( get_the_author() ); ?></dc:creator>
- <?php wxr_post_taxonomy() ?>
-
+ <dc:creator><?php echo get_the_author_meta( 'login' ); ?></dc:creator>
<guid isPermaLink="false"><?php esc_url( the_guid() ); ?></guid>
<description></description>
<content:encoded><?php echo wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) ); ?></content:encoded>
<wp:post_type><?php echo $post->post_type; ?></wp:post_type>
<wp:post_password><?php echo $post->post_password; ?></wp:post_password>
<wp:is_sticky><?php echo $is_sticky; ?></wp:is_sticky>
- <?php
- if ( $post->post_type == 'attachment' ) { ?>
+<?php if ( $post->post_type == 'attachment' ) : ?>
<wp:attachment_url><?php echo wp_get_attachment_url( $post->ID ); ?></wp:attachment_url>
- <?php } ?>
- <?php
- $postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
- if ( $postmeta ) {
- ?>
- <?php foreach( $postmeta as $meta ) { ?>
+<?php endif; ?>
+<?php wxr_post_taxonomy(); ?>
+<?php $postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
+ if ( $postmeta ) : foreach( $postmeta as $meta ) : if ( $meta->meta_key != '_edit_lock' ) : ?>
<wp:postmeta>
- <wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
- <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
+ <wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
+ <wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
</wp:postmeta>
- <?php } ?>
- <?php } ?>
- <?php
- $comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d", $post->ID ) );
- if ( $comments ) { foreach ( $comments as $c ) { ?>
+<?php endif; endforeach; endif; ?>
+<?php $comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
+ if ( $comments ) : foreach ( $comments as $c ) : ?>
<wp:comment>
- <wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
- <wp:comment_author><?php echo wxr_cdata( $c->comment_author ); ?></wp:comment_author>
- <wp:comment_author_email><?php echo $c->comment_author_email; ?></wp:comment_author_email>
- <wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>
- <wp:comment_author_IP><?php echo $c->comment_author_IP; ?></wp:comment_author_IP>
- <wp:comment_date><?php echo $c->comment_date; ?></wp:comment_date>
- <wp:comment_date_gmt><?php echo $c->comment_date_gmt; ?></wp:comment_date_gmt>
- <wp:comment_content><?php echo wxr_cdata( $c->comment_content ) ?></wp:comment_content>
- <wp:comment_approved><?php echo $c->comment_approved; ?></wp:comment_approved>
- <wp:comment_type><?php echo $c->comment_type; ?></wp:comment_type>
- <wp:comment_parent><?php echo $c->comment_parent; ?></wp:comment_parent>
- <wp:comment_user_id><?php echo $c->user_id; ?></wp:comment_user_id>
+ <wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
+ <wp:comment_author><?php echo wxr_cdata( $c->comment_author ); ?></wp:comment_author>
+ <wp:comment_author_email><?php echo $c->comment_author_email; ?></wp:comment_author_email>
+ <wp:comment_author_url><?php echo esc_url_raw( $c->comment_author_url ); ?></wp:comment_author_url>
+ <wp:comment_author_IP><?php echo $c->comment_author_IP; ?></wp:comment_author_IP>
+ <wp:comment_date><?php echo $c->comment_date; ?></wp:comment_date>
+ <wp:comment_date_gmt><?php echo $c->comment_date_gmt; ?></wp:comment_date_gmt>
+ <wp:comment_content><?php echo wxr_cdata( $c->comment_content ) ?></wp:comment_content>
+ <wp:comment_approved><?php echo $c->comment_approved; ?></wp:comment_approved>
+ <wp:comment_type><?php echo $c->comment_type; ?></wp:comment_type>
+ <wp:comment_parent><?php echo $c->comment_parent; ?></wp:comment_parent>
+ <wp:comment_user_id><?php echo $c->user_id; ?></wp:comment_user_id>
</wp:comment>
- <?php } } ?>
+<?php endforeach; endif; ?>
</item>
- <?php
+<?php
}
}
} ?>
</rss>
<?php
}
-
-?>
*/
/** The descriptions for theme files. */
-$wp_file_descriptions = array (
+$wp_file_descriptions = array(
'index.php' => __( 'Main Index Template' ),
'style.css' => __( 'Stylesheet' ),
'editor-style.css' => __( 'Visual Editor Stylesheet' ),
+ 'editor-style-rtl.css' => __( 'Visual Editor RTL Stylesheet' ),
'rtl.css' => __( 'RTL Stylesheet' ),
'comments.php' => __( 'Comments' ),
'comments-popup.php' => __( 'Popup Comments' ),
'my-hacks.php' => __( 'my-hacks.php (legacy hacks support)' ),
'.htaccess' => __( '.htaccess (for rewrite rules )' ),
// Deprecated files
- 'wp-layout.css' => __( 'Stylesheet' ), 'wp-comments.php' => __( 'Comments Template' ), 'wp-comments-popup.php' => __( 'Popup Comments Template' ));
+ 'wp-layout.css' => __( 'Stylesheet' ),
+ 'wp-comments.php' => __( 'Comments Template' ),
+ 'wp-comments-popup.php' => __( 'Popup Comments Template' ),
+);
/**
- * {@internal Missing Short Description}}
+ * Get the description for standard WordPress theme files and other various standard
+ * WordPress files
*
- * @since unknown
+ * @since 1.5.0
*
- * @param unknown_type $file
- * @return unknown
+ * @uses _cleanup_header_comment
+ * @uses $wp_file_descriptions
+ * @param string $file Filesystem path or filename
+ * @return string Description of file from $wp_file_descriptions or basename of $file if description doesn't exist
*/
function get_file_description( $file ) {
global $wp_file_descriptions;
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';
+ return sprintf( __( '%s Page Template' ), _cleanup_header_comment($name[1]) );
}
return basename( $file );
}
/**
- * {@internal Missing Short Description}}
+ * Get the absolute filesystem path to the root of the WordPress installation
*
- * @since unknown
+ * @since 1.5.0
*
- * @return unknown
+ * @uses get_option
+ * @return string Full filesystem path to the root of the WordPress installation
*/
function get_home_path() {
$home = get_option( 'home' );
}
/**
- * {@internal Missing Short Description}}
+ * Get the real file system path to a file to edit within the admin
*
- * @since unknown
+ * If the $file is index.php or .htaccess this function will assume it is relative
+ * to the install root, otherwise it is assumed the file is relative to the wp-content
+ * directory
*
- * @param unknown_type $file
- * @return unknown
+ * @since 1.5.0
+ *
+ * @uses get_home_path
+ * @uses WP_CONTENT_DIR full filesystem path to the wp-content directory
+ * @param string $file filesystem path relative to the WordPress install directory or to the wp-content directory
+ * @return string full file system path to edit
*/
function get_real_file_to_edit( $file ) {
if ('index.php' == $file || '.htaccess' == $file ) {
}
/**
- * {@internal Missing Short Description}}
+ * Make sure that the file that was requested to edit, is allowed to be edited
+ *
+ * Function will die if if you are not allowed to edit the file
*
- * @since unknown
+ * @since 1.5.0
*
- * @param unknown_type $file
- * @param unknown_type $allowed_files
- * @return unknown
+ * @uses wp_die
+ * @uses validate_file
+ * @param string $file file the users is attempting to edit
+ * @param array $allowed_files Array of allowed files to edit, $file must match an entry exactly
+ * @return null
*/
function validate_file_to_edit( $file, $allowed_files = '' ) {
$code = validate_file( $file, $allowed_files );
}
/**
- * {@internal Missing Short Description}}
+ * Handle PHP uploads in WordPress, sanitizing file names, checking extensions for mime type,
+ * and moving the file to the appropriate directory within the uploads directory.
*
- * @since unknown
+ * @since 2.0
*
+ * @uses wp_handle_upload_error
+ * @uses apply_filters
+ * @uses is_multisite
+ * @uses wp_check_filetype_and_ext
+ * @uses current_user_can
+ * @uses wp_upload_dir
+ * @uses wp_unique_filename
+ * @uses delete_transient
* @param array $file Reference to a single element of $_FILES. Call the function once for each uploaded file.
* @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ).
* @return array On success, returns an associative array of file attributes. On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ).
$file['name'] = $proper_filename;
if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
- return call_user_func($upload_error_handler, $file, __( 'File type does not meet security guidelines. Try another.' ));
+ return call_user_func($upload_error_handler, $file, __( 'Sorry, this file type is not permitted for security reasons.' ));
if ( !$ext )
$ext = ltrim(strrchr($file['name'], '.'), '.');
}
/**
- * {@internal Missing Short Description}}
- *
- * Pass this function an array similar to that of a $_FILES POST array.
+ * Handle sideloads, which is the process of retriving a media item from another server instead of
+ * a traditional media upload. This process involves sanitizing the filename, checking extensions
+ * for mime type, and moving the file to the appropriate directory within the uploads directory.
*
- * @since unknown
+ * @since 2.6.0
*
- * @param unknown_type $file
- * @param unknown_type $overrides
- * @return unknown
+ * @uses wp_handle_upload_error
+ * @uses apply_filters
+ * @uses wp_check_filetype_and_ext
+ * @uses current_user_can
+ * @uses wp_upload_dir
+ * @uses wp_unique_filename
+ * @param array $file an array similar to that of a PHP $_FILES POST array
+ * @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ).
+ * @return array On success, returns an associative array of file attributes. On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ).
*/
function wp_handle_sideload( &$file, $overrides = false ) {
// The default error handler.
$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 $upload_error_handler( $file, __( 'Sorry, this file type is not permitted for security reasons.' ));
if ( !$ext )
$ext = ltrim(strrchr($file['name'], '.'), '.');
* @since 2.5.0
*
* @param string $url the URL of the file to download
+ * @param int $timeout The timeout for the request to download the file default 300 seconds
* @return mixed WP_Error on failure, string Filename on success.
*/
-function download_url( $url ) {
+function download_url( $url, $timeout = 300 ) {
//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.'));
if ( ! $handle )
return new WP_Error('http_no_file', __('Could not create Temporary file.'));
- $response = wp_remote_get($url, array('timeout' => 300));
+ $response = wp_remote_get($url, array('timeout' => $timeout));
if ( is_wp_error($response) ) {
fclose($handle);
if ( $error ) {
$error_string = __('<strong>Error:</strong> There was an error connecting to the server, Please verify the settings are correct.');
if ( is_wp_error($error) )
- $error_string = $error->get_error_message();
- echo '<div id="message" class="error"><p>' . esc_html( $error_string ) . '</p></div>';
+ $error_string = esc_html( $error->get_error_message() );
+ echo '<div id="message" class="error"><p>' . $error_string . '</p></div>';
}
$types = array();
<p><?php
$label_user = __('Username');
$label_pass = __('Password');
- _e('To perform the requested action, WordPress needs to access to your web server.');
+ _e('To perform the requested action, WordPress needs to access your web server.');
echo ' ';
if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) {
if ( isset( $types['ssh'] ) ) {
if ( isset( $_POST[ $field ] ) )
echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( stripslashes( $_POST[ $field ] ) ) . '" />';
}
+submit_button( __( 'Proceed' ), 'button', 'upgrade' );
?>
-<p class="submit">
-<input id="upgrade" name="upgrade" type="submit" class="button" value="<?php esc_attr_e('Proceed'); ?>" />
-</p>
</div>
</form>
<?php
$filepath = get_attached_file($post_id);
if ( $filepath && file_exists($filepath) ) {
- if ( 'full' != $size && ( $data = image_get_intermediate_size($post_id, $size) ) )
- $filepath = path_join( dirname($filepath), $data['file'] );
+ if ( 'full' != $size && ( $data = image_get_intermediate_size($post_id, $size) ) ) {
+ $filepath = apply_filters('load_image_to_edit_filesystempath', path_join( dirname($filepath), $data['file'] ), $post_id, $size);
+ }
} elseif ( WP_Http_Fopen::test() ) {
- $filepath = wp_get_attachment_url($post_id);
+ $filepath = apply_filters('load_image_to_edit_attachmenturl', wp_get_attachment_url($post_id) , $post_id, $size);
}
$filepath = apply_filters('load_image_to_edit_path', $filepath, $post_id, $size);
$file = get_attached_file($post_id);
$backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
$restored = false;
- $msg = '';
+ $msg = new stdClass;
if ( !is_array($backup_sizes) ) {
$msg->error = __('Cannot load image metadata.');
}
function wp_save_image($post_id) {
- $return = '';
+ $return = new stdClass;
$success = $delete = $scaled = $nocrop = false;
$post = get_post($post_id);
@ini_set('memory_limit', '256M');
*
* @since 2.0.0
*
- * @return array
+ * @return array Uploaded file's details on success, error message on failure
*/
function wp_import_handle_upload() {
if ( !isset($_FILES['import']) ) {
$url = $file['url'];
$type = $file['type'];
- $file = addslashes( $file['file'] );
+ $file = $file['file'];
$filename = basename( $file );
// Construct the object array
--- /dev/null
+<?php
+/**
+ * Internal linking functions.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+/**
+ * Performs post queries for internal linking.
+ *
+ * @since 3.1.0
+ *
+ * @param array $args Optional. Accepts 'pagenum' and 's' (search) arguments.
+ * @return array Results.
+ */
+function wp_link_query( $args = array() ) {
+ $pts = get_post_types( array( 'publicly_queryable' => true ), 'objects' );
+ $pt_names = array_keys( $pts );
+
+ $query = array(
+ 'post_type' => $pt_names,
+ 'suppress_filters' => true,
+ 'update_post_term_cache' => false,
+ 'update_post_meta_cache' => false,
+ 'post_status' => 'publish',
+ 'order' => 'DESC',
+ 'orderby' => 'post_date',
+ 'posts_per_page' => 20,
+ );
+
+ $args['pagenum'] = isset( $args['pagenum'] ) ? absint( $args['pagenum'] ) : 1;
+
+ if ( isset( $args['s'] ) )
+ $query['s'] = $args['s'];
+
+ $query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0;
+
+ // Do main query.
+ $get_posts = new WP_Query;
+ $posts = $get_posts->query( $query );
+ // Check if any posts were found.
+ if ( ! $get_posts->post_count )
+ return false;
+
+ // Build results.
+ $results = array();
+ foreach ( $posts as $post ) {
+ if ( 'post' == $post->post_type )
+ $info = mysql2date( __( 'Y/m/d' ), $post->post_date );
+ else
+ $info = $pts[ $post->post_type ]->labels->singular_name;
+
+ $results[] = array(
+ 'ID' => $post->ID,
+ 'title' => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ),
+ 'permalink' => get_permalink( $post->ID ),
+ 'info' => $info,
+ );
+ }
+
+ return $results;
+}
+
+/**
+ * Dialog for internal linking.
+ *
+ * @since 3.1.0
+ */
+function wp_link_dialog() {
+?>
+<form id="wp-link" tabindex="-1">
+<?php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?>
+<div id="link-selector">
+ <div id="link-options">
+ <p class="howto"><?php _e( 'Enter the destination URL' ); ?></p>
+ <div>
+ <label for="url-field"><span><?php _e( 'URL' ); ?></span><input id="url-field" type="text" tabindex="10" autocomplete="off" /></label>
+ </div>
+ <div>
+ <label for="link-title-field"><span><?php _e( 'Title' ); ?></span><input id="link-title-field" type="text" tabindex="20" autocomplete="off" /></label>
+ </div>
+ <div class="link-target">
+ <label for="link-target-checkbox"><input type="checkbox" id="link-target-checkbox" tabindex="30" /> <?php _e( 'Open link in a new window/tab' ); ?></label>
+ </div>
+ </div>
+ <?php $show_internal = '1' == get_user_setting( 'wplink', '0' ); ?>
+ <p class="howto toggle-arrow <?php if ( $show_internal ) echo 'toggle-arrow-active'; ?>" id="internal-toggle"><?php _e( 'Or link to existing content' ); ?></p>
+ <div id="search-panel"<?php if ( ! $show_internal ) echo ' style="display:none"'; ?>>
+ <div class="link-search-wrapper">
+ <label for="search-field">
+ <span><?php _e( 'Search' ); ?></span>
+ <input type="text" id="search-field" class="link-search-field" tabindex="60" autocomplete="off" />
+ <img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
+ </label>
+ </div>
+ <div id="search-results" class="query-results">
+ <ul></ul>
+ <div class="river-waiting">
+ <img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
+ </div>
+ </div>
+ <div id="most-recent-results" class="query-results">
+ <div class="query-notice"><em><?php _e( 'No search term specified. Showing recent items.' ); ?></em></div>
+ <ul></ul>
+ <div class="river-waiting">
+ <img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
+ </div>
+ </div>
+ </div>
+</div>
+<div class="submitbox">
+ <div id="wp-link-cancel">
+ <a class="submitdelete deletion" href="#"><?php _e( 'Cancel' ); ?></a>
+ </div>
+ <div id="wp-link-update">
+ <?php submit_button( __('Update'), 'primary', 'wp-link-submit', false, array('tabindex' => 100)); ?>
+ </div>
+</div>
+</form>
+<?php
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Helper functions for displaying a list of items in an ajaxified HTML table.
+ *
+ * @package WordPress
+ * @subpackage List_Table
+ * @since 3.1.0
+ */
+
+/**
+ * Fetch an instance of a WP_List_Table class.
+ *
+ * @access private
+ * @since 3.1.0
+ *
+ * @param string $class The type of the list table, which is the class name.
+ * @return object|bool Object on success, false if the class does not exist.
+ */
+function _get_list_table( $class ) {
+ $core_classes = array(
+ //Site Admin
+ 'WP_Posts_List_Table' => 'posts',
+ 'WP_Media_List_Table' => 'media',
+ 'WP_Terms_List_Table' => 'terms',
+ 'WP_Users_List_Table' => 'users',
+ 'WP_Comments_List_Table' => 'comments',
+ 'WP_Post_Comments_List_Table' => 'comments',
+ 'WP_Links_List_Table' => 'links',
+ 'WP_Plugin_Install_List_Table' => 'plugin-install',
+ 'WP_Themes_List_Table' => 'themes',
+ 'WP_Theme_Install_List_Table' => 'theme-install',
+ 'WP_Plugins_List_Table' => 'plugins',
+ // Network Admin
+ 'WP_MS_Sites_List_Table' => 'ms-sites',
+ 'WP_MS_Users_List_Table' => 'ms-users',
+ 'WP_MS_Themes_List_Table' => 'ms-themes',
+ );
+
+ if ( isset( $core_classes[ $class ] ) ) {
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $core_classes[ $class ] . '-list-table.php' );
+ return new $class;
+ }
+
+ return false;
+}
+
+/**
+ * Register column headers for a particular screen.
+ *
+ * @since 2.7.0
+ *
+ * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
+ * @param array $columns An array of columns with column IDs as the keys and translated column names as the values
+ * @see get_column_headers(), print_column_headers(), get_hidden_columns()
+ */
+function register_column_headers($screen, $columns) {
+ $wp_list_table = new _WP_List_Table_Compat($screen, $columns);
+}
+
+/**
+ * Prints column headers for a particular screen.
+ *
+ * @since 2.7.0
+ */
+function print_column_headers($screen, $id = true) {
+ $wp_list_table = new _WP_List_Table_Compat($screen);
+
+ $wp_list_table->print_column_headers($id);
+}
+
+/**
+ * Helper class to be used only by back compat functions
+ *
+ * @since 3.1.0
+ */
+class _WP_List_Table_Compat extends WP_List_Table {
+ var $_screen;
+ var $_columns;
+
+ function _WP_List_Table_Compat( $screen, $columns = array() ) {
+ if ( is_string( $screen ) )
+ $screen = convert_to_screen( $screen );
+
+ $this->_screen = $screen;
+
+ if ( !empty( $columns ) ) {
+ $this->_columns = $columns;
+ add_filter( 'manage_' . $screen->id . '_columns', array( &$this, 'get_columns' ), 0 );
+ }
+ }
+
+ function get_column_info() {
+ $columns = get_column_headers( $this->_screen );
+ $hidden = get_hidden_columns( $this->_screen );
+ $sortable = array();
+
+ return array( $columns, $hidden, $sortable );
+ }
+
+ function get_columns() {
+ return $this->_columns;
+ }
+}
+?>
\ No newline at end of file
array('images/icons32.png'),
array('images/icons32-vs.png'),
array('images/list.png'),
- array('images/list-vs.png'),
array('images/wpspin_light.gif'),
array('images/wpspin_dark.gif'),
array('images/logo.gif'),
array('../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif'),
array('../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif'),
array('../wp-includes/js/tinymce/plugins/media/img/flash.gif'),
- array('../wp-includes/js/tinymce/plugins/media/img/flv_player.swf'),
array('../wp-includes/js/tinymce/plugins/media/img/quicktime.gif'),
array('../wp-includes/js/tinymce/plugins/media/img/realmedia.gif'),
array('../wp-includes/js/tinymce/plugins/media/img/shockwave.gif'),
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @return unknown
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $tabs
* @return unknown
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*/
function the_media_upload_tabs() {
global $redir_tab;
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $id
* @param unknown_type $alt
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.6.0
*
* @param unknown_type $html
* @param unknown_type $id
$width = $matches[1];
+ $caption = str_replace( array( '>', '<', '"', "'" ),
+ array( '>', '<', '"', ''' ),
+ $caption
+ );
+
$html = preg_replace( '/(class=["\'][^\'"]*)align(none|left|right|center)\s?/', '$1', $html );
if ( empty($align) )
$align = 'none';
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $html
*/
*
* This handles the file upload POST itself, creating the attachment post.
*
- * @since unknown
+ * @since 2.5.0
*
* @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
}
/**
- * {@internal Missing Short Description}}
+ * This handles a sideloaded file in the same way as an uploaded file is handled by {@link media_handle_upload()}
*
- * @since unknown
+ * @since 2.6.0
*
- * @param unknown_type $file_array
- * @param unknown_type $post_id
- * @param unknown_type $desc
- * @param unknown_type $post_data
- * @return unknown
+ * @param array $file_array Array similar to a {@link $_FILES} upload array
+ * @param int $post_id The post ID the media is associated with
+ * @param string $desc Description of the sideloaded file
+ * @param array $post_data allows you to overwrite some of the attachment
+ * @return int|object The ID of the attachment or a WP_Error on failure
*/
function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = array()) {
$overrides = array('test_form'=>false);
$content = $image_meta['caption'];
}
- $title = @$desc;
+ $title = isset($desc) ? $desc : '';
// Construct the attachment array
$attachment = array_merge( array(
// Save the attachment metadata
$id = wp_insert_attachment($attachment, $file, $post_id);
- if ( !is_wp_error($id) ) {
+ if ( !is_wp_error($id) )
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
- return $url;
- }
+
return $id;
}
* Wrap iframe content (produced by $content_func) in a doctype, html head/body
* etc any additional function args will be passed to content_func.
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $content_func
*/
wp_enqueue_style( 'wp-admin' );
wp_enqueue_style( 'colors' );
// 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' ) )
+if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) )
+ || ( ! is_array( $content_func ) && 0 === strpos( $content_func, 'media' ) ) )
wp_enqueue_style( 'media' );
wp_enqueue_style( 'ie' );
?>
//<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time(); ?>'};
-var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup';
+var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
+isRtl = <?php echo (int) is_rtl(); ?>;
//]]>
</script>
<?php
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*/
function media_buttons() {
$do_image = $do_audio = $do_video = true;
add_action( 'media_buttons', 'media_buttons' );
function _media_button($title, $icon, $type) {
- return "<a href='" . esc_url( get_upload_iframe_src($type) ) . "' id='add_$type' class='thickbox' title='$title'><img src='" . esc_url( admin_url( $icon ) ) . "' alt='$title' /></a>";
+ return "<a href='" . esc_url( get_upload_iframe_src($type) ) . "' id='add_$type' class='thickbox' title='$title'><img src='" . esc_url( admin_url( $icon ) ) . "' alt='$title' onclick='return false;' /></a>";
}
function get_upload_iframe_src($type) {
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @return unknown
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @return unknown
*/
$id = 0;
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
- check_admin_referer('media-form');
// Upload File button was clicked
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
unset($_FILES);
}
/**
- * {@internal Missing Short Description}}
+ * Download an image from the specified URL and attach it to a post.
*
- * @since unknown
+ * @since 2.6.0
*
- * @param unknown_type $file
- * @param unknown_type $post_id
- * @param unknown_type $desc
- * @return unknown
+ * @param string $file The URL of the image to download
+ * @param int $post_id The post ID the media is to be associated with
+ * @param string $desc Optional. Description of the image
+ * @return string|WP_Error Populated HTML img tag on success
*/
function media_sideload_image($file, $post_id, $desc = null) {
- if (!empty($file) ) {
+ if ( ! empty($file) ) {
// Download file to temp location
- $tmp = download_url($file);
+ $tmp = download_url( $file );
// Set variables for storage
// fix file filename for query strings
$file_array['tmp_name'] = $tmp;
// If error storing temporarily, unlink
- if ( is_wp_error($tmp) ) {
+ if ( is_wp_error( $tmp ) ) {
@unlink($file_array['tmp_name']);
$file_array['tmp_name'] = '';
}
// do the validation and storage stuff
- $id = media_handle_sideload($file_array, $post_id, @$desc);
- $src = $id;
-
+ $id = media_handle_sideload( $file_array, $post_id, $desc );
// If error storing permanently, unlink
if ( is_wp_error($id) ) {
@unlink($file_array['tmp_name']);
return $id;
}
+
+ $src = wp_get_attachment_url( $id );
}
// Finally check to make sure the file has been saved, then return the html
- if ( !empty($src) ) {
- $alt = @$desc;
+ if ( ! empty($src) ) {
+ $alt = isset($desc) ? esc_attr($desc) : '';
$html = "<img src='$src' alt='$alt' />";
return $html;
}
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @return unknown
*/
$id = 0;
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
- check_admin_referer('media-form');
// Upload File button was clicked
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
unset($_FILES);
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @return unknown
*/
$id = 0;
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
- check_admin_referer('media-form');
// Upload File button was clicked
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
unset($_FILES);
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @return unknown
*/
$id = 0;
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
- check_admin_referer('media-form');
// Upload File button was clicked
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
unset($_FILES);
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @return unknown
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @return unknown
*/
/**
* Retrieve HTML for the image alignment radio buttons with the specified one checked.
*
- * @since unknown
+ * @since 2.7.0
*
* @param unknown_type $post
* @param unknown_type $checked
/**
* Retrieve HTML for the size radio buttons with the specified one checked.
*
- * @since unknown
+ * @since 2.7.0
*
* @param unknown_type $post
- * @param unknown_type $checked
+ * @param unknown_type $check
* @return unknown
*/
function image_size_input_fields( $post, $check = '' ) {
/**
* Retrieve HTML for the Link URL buttons with the default link type as specified.
*
- * @since unknown
+ * @since 2.7.0
*
* @param unknown_type $post
* @param unknown_type $url_type
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $form_fields
* @param unknown_type $post
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $form_fields
* @param unknown_type $post
return $form_fields;
}
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since 2.8.0
+ *
+ * @param unknown_type $form_fields
+ * @param unknown_type $post
+ * @return unknown
+ */
function media_post_single_attachment_fields_to_edit( $form_fields, $post ) {
unset($form_fields['image_url']);
return $form_fields;
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $post
* @param unknown_type $attachment
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $html
* @param unknown_type $attachment_id
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $post
* @param unknown_type $errors
foreach ( get_attachment_taxonomies($post) as $taxonomy ) {
$t = (array) get_taxonomy($taxonomy);
+ if ( ! $t['public'] )
+ continue;
if ( empty($t['label']) )
$t['label'] = $taxonomy;
if ( empty($t['args']) )
* component. Will also create link for showing and hiding the form to modify
* the image attachment.
*
- * @since unknown
+ * @since 2.5.0
*
* @param int $post_id Optional. Post ID.
* @param array $errors Errors for attachment, if any.
/**
* Retrieve HTML form for modifying the image attachment.
*
- * @since unknown
+ * @since 2.5.0
*
* @param int $attachment_id Attachment ID for modification.
* @param string|array $args Optional. Override defaults.
$post = get_post( $attachment_id );
- $default_args = array( 'errors' => null, 'send' => post_type_supports(get_post_type($post->post_parent), 'editor'), 'delete' => true, 'toggle' => true, 'show_title' => true );
+ $default_args = array( 'errors' => null, 'send' => $post->post_parent ? post_type_supports( get_post_type( $post->post_parent ), 'editor' ) : true, 'delete' => true, 'toggle' => true, 'show_title' => true );
$args = wp_parse_args( $args, $default_args );
+ $args = apply_filters( 'get_media_item_args', $args );
extract( $args, EXTR_SKIP );
$toggle_on = __( 'Show' );
);
if ( $send )
- $send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . esc_attr__( 'Insert into Post' ) . "' />";
+ $send = get_submit_button( __( 'Insert into Post' ), 'button', "send[$attachment_id]", false );
if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) {
if ( !EMPTY_TRASH_DAYS ) {
$delete = "<a href='" . wp_nonce_url( "post.php?action=delete&post=$attachment_id", 'delete-attachment_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete'>" . __( 'Delete Permanently' ) . '</a>';
$hidden_fields = array();
foreach ( $form_fields as $id => $field ) {
- if ( $id{0} == '_' )
+ if ( $id[0] == '_' )
continue;
if ( !empty( $field['tr'] ) ) {
if ( !empty( $field[ $field['input'] ] ) )
$item .= $field[ $field['input'] ];
elseif ( $field['input'] == 'textarea' ) {
- $item .= "<textarea type='text' id='$name' name='$name' $aria_required>" . esc_html( $field['value'] ) . '</textarea>';
+ if ( user_can_richedit() ) { // textarea_escaped when user_can_richedit() = false
+ $field['value'] = esc_textarea( $field['value'] );
+ }
+ $item .= "<textarea type='text' id='$name' name='$name' $aria_required>" . $field['value'] . '</textarea>';
} else {
$item .= "<input type='text' class='text' id='$name' name='$name' value='" . esc_attr( $field['value'] ) . "' $aria_required />";
}
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*/
function media_upload_header() {
?>
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $errors
*/
function media_upload_form( $errors = null ) {
- global $type, $tab;
+ global $type, $tab, $pagenow;
$flash_action_url = admin_url('async-upload.php');
do_action('pre-upload-ui');
-if ( $flash ) : ?>
+if ( $flash ) :
+
+// Set the post params, which SWFUpload will post back with the file, and pass
+// them through a filter.
+$post_params = array(
+ "post_id" => $post_id,
+ "auth_cookie" => (is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE]),
+ "logged_in_cookie" => $_COOKIE[LOGGED_IN_COOKIE],
+ "_wpnonce" => wp_create_nonce('media-form'),
+ "type" => $type,
+ "tab" => $tab,
+ "short" => "1",
+);
+$post_params = apply_filters( 'swfupload_post_params', $post_params );
+$p = array();
+foreach ( $post_params as $param => $val )
+ $p[] = "\t\t'$param' : '$val'";
+$post_params_str = implode( ", \n", $p );
+
+// #8545. wmode=transparent cannot be used with SWFUpload
+if ( 'media-new.php' == $pagenow ) {
+ $upload_image_path = get_user_option( 'admin_color' );
+ if ( 'classic' != $upload_image_path )
+ $upload_image_path = 'fresh';
+ $upload_image_path = admin_url( 'images/upload-' . $upload_image_path . '.png?ver=20101205' );
+} else {
+ $upload_image_path = includes_url( 'images/upload.png?ver=20100531' );
+}
+
+?>
<script type="text/javascript">
//<![CDATA[
var swfu;
button_height: "23",
button_width: "132",
button_text_top_padding: 3,
- button_image_url: '<?php echo includes_url('images/upload.png?ver=20100531'); ?>',
+ button_image_url: '<?php echo $upload_image_path; ?>',
button_placeholder_id: "flash-browse-button",
upload_url : "<?php echo esc_attr( $flash_action_url ); ?>",
flash_url : "<?php echo includes_url('js/swfupload/swfupload.swf'); ?>",
file_post_name: "async-upload",
file_types: "<?php echo apply_filters('upload_file_glob', '*.*'); ?>",
post_params : {
- "post_id" : "<?php echo $post_id; ?>",
- "auth_cookie" : "<?php echo (is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE]); ?>",
- "logged_in_cookie": "<?php echo $_COOKIE[LOGGED_IN_COOKIE]; ?>",
- "_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>",
- "type" : "<?php echo $type; ?>",
- "tab" : "<?php echo $tab; ?>",
- "short" : "1"
+ <?php echo $post_params_str; ?>
},
file_size_limit : "<?php echo $max_upload_size; ?>b",
file_dialog_start_handler : fileDialogStart,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
- upload_success_handler : uploadSuccess,
+ upload_success_handler : <?php echo apply_filters( 'swfupload_success_handler', 'uploadSuccess' ); ?>,
upload_complete_handler : uploadComplete,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
<div id="html-upload-ui">
<?php do_action('pre-html-upload-ui'); ?>
<p id="async-upload-wrap">
- <label class="screen-reader-text" for="async-upload"><?php _e('Upload'); ?></label>
- <input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php esc_attr_e('Upload'); ?>" /> <a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e('Cancel'); ?></a>
+ <label class="screen-reader-text" for="async-upload"><?php _e('Upload'); ?></label>
+ <input type="file" name="async-upload" id="async-upload" />
+ <?php submit_button( __( 'Upload' ), 'button', 'html-upload', false ); ?>
+ <a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e('Cancel'); ?></a>
</p>
<div class="clear"></div>
<p class="media-upload-size"><?php printf( __( 'Maximum upload file size: %d%s' ), $upload_size_unit, $sizes[$u] ); ?></p>
<?php if ( is_lighttpd_before_150() ): ?>
- <p><?php _e('If you want to use all capabilities of the uploader, like uploading multiple files at once, please upgrade to lighttpd 1.5.'); ?></p>
+ <p><?php _e('If you want to use all capabilities of the uploader, like uploading multiple files at once, please update to lighttpd 1.5.'); ?></p>
<?php endif;?>
<?php do_action('post-html-upload-ui', $flash); ?>
</div>
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $type
* @param unknown_type $errors
?>
<form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="media-upload-form type-form validate" id="<?php echo $type; ?>-form">
-<input type="submit" class="hidden" name="save" value="" />
+<?php submit_button( '', 'hidden', 'save', false ); ?>
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
<?php wp_nonce_field('media-form'); ?>
?>
</div>
<p class="savebutton ml-submit">
-<input type="submit" class="button" name="save" value="<?php esc_attr_e( 'Save all changes' ); ?>" />
+<?php submit_button( __( 'Save all changes' ), 'button', 'save', false ); ?>
</p>
</form>
<?php
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.7.0
*
* @param unknown_type $type
* @param unknown_type $errors
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $errors
*/
</div>
<p class="ml-submit">
-<input type="submit" class="button savebutton" style="display:none;" name="save" id="save-all" value="<?php esc_attr_e( 'Save all changes' ); ?>" />
+<?php submit_button( __( 'Save all changes' ), 'button savebutton', 'save', false, array( 'id' => 'save-all', 'style' => 'display: none;' ) ); ?>
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
<input type="hidden" name="type" value="<?php echo esc_attr( $GLOBALS['type'] ); ?>" />
<input type="hidden" name="tab" value="<?php echo esc_attr( $GLOBALS['tab'] ); ?>" />
</th>
<td class="field">
<select id="columns" name="columns">
+ <option value="1">1</option>
<option value="2">2</option>
<option value="3" selected="selected">3</option>
<option value="4">4</option>
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $errors
*/
<p id="media-search" class="search-box">
<label class="screen-reader-text" for="media-search-input"><?php _e('Search Media');?>:</label>
<input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
- <input type="submit" value="<?php esc_attr_e( 'Search Media' ); ?>" class="button" />
+ <?php submit_button( __( 'Search Media' ), 'button', '', false ); ?>
</p>
<ul class="subsubsub">
if ( isset($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
$class = ' class="current"';
- $type_links[] = "<li><a href='" . esc_url(add_query_arg(array('post_mime_type'=>$mime_type, 'paged'=>false))) . "'$class>" . sprintf(_n($label[2][0], $label[2][1], $num_posts[$mime_type]), "<span id='$mime_type-counter'>" . number_format_i18n( $num_posts[$mime_type] ) . '</span>') . '</a>';
+ $type_links[] = "<li><a href='" . esc_url(add_query_arg(array('post_mime_type'=>$mime_type, 'paged'=>false))) . "'$class>" . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), "<span id='$mime_type-counter'>" . number_format_i18n( $num_posts[$mime_type] ) . '</span>') . '</a>';
}
-echo implode(' | </li>', $type_links) . '</li>';
+echo implode(' | </li>', apply_filters( 'media_upload_mime_type_links', $type_links ) ) . '</li>';
unset($type_links);
?>
</ul>
</select>
<?php } ?>
-<input type="submit" id="post-query-submit" value="<?php echo esc_attr( __( 'Filter »' ) ); ?>" class="button-secondary" />
+<?php submit_button( __( 'Filter »' ), 'secondary', 'post-query-submit', false ); ?>
</div>
<?php echo get_media_items(null, $errors); ?>
</div>
<p class="ml-submit">
-<input type="submit" class="button savebutton" name="save" value="<?php esc_attr_e( 'Save all changes' ); ?>" />
+<?php submit_button( __( 'Save all changes' ), 'button savebutton', 'save', false ); ?>
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
</p>
</form>
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.7.0
*
* @return unknown
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.7.0
*
* @return unknown
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.7.0
*
* @return unknown
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.7.0
*
* @return unknown
*/
<tr>
<td></td>
<td>
- <input type="submit" class="button" name="insertonlybutton" value="' . esc_attr__('Insert into Post') . '" />
+ ' . get_submit_button( __( 'Insert into Post' ), 'button', 'insertonlybutton', false ) . '
</td>
</tr>
';
*
* Support a GET parameter for disabling the flash uploader.
*
- * @since unknown
+ * @since 2.6.0
*
* @param unknown_type $flash
* @return unknown
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.6.0
*/
function media_upload_flash_bypass() {
echo '<p class="upload-flash-bypass">';
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.6.0
*/
function media_upload_html_bypass($flash = true) {
echo '<p class="upload-html-bypass hide-if-no-js">';
*
* Make sure the GET parameter sticks when we submit a form.
*
- * @since unknown
+ * @since 2.6.0
*
* @param unknown_type $url
* @return unknown
--- /dev/null
+<?php
+
+/**
+ * Build Administration Menu.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+if ( is_network_admin() )
+ do_action('_network_admin_menu');
+elseif ( is_user_admin() )
+ do_action('_user_admin_menu');
+else
+ do_action('_admin_menu');
+
+// Create list of page plugin hook names.
+foreach ($menu as $menu_page) {
+ if ( false !== $pos = strpos($menu_page[2], '?') ) {
+ // Handle post_type=post|page|foo pages.
+ $hook_name = substr($menu_page[2], 0, $pos);
+ $hook_args = substr($menu_page[2], $pos + 1);
+ wp_parse_str($hook_args, $hook_args);
+ // Set the hook name to be the post type.
+ if ( isset($hook_args['post_type']) )
+ $hook_name = $hook_args['post_type'];
+ else
+ $hook_name = basename($hook_name, '.php');
+ unset($hook_args);
+ } else {
+ $hook_name = basename($menu_page[2], '.php');
+ }
+ $hook_name = sanitize_title($hook_name);
+
+ if ( isset($compat[$hook_name]) )
+ $hook_name = $compat[$hook_name];
+ elseif ( !$hook_name )
+ continue;
+
+ $admin_page_hooks[$menu_page[2]] = $hook_name;
+}
+unset($menu_page, $compat);
+
+$_wp_submenu_nopriv = array();
+$_wp_menu_nopriv = array();
+// Loop over submenus and remove pages for which the user does not have privs.
+foreach ( array( 'submenu' ) as $sub_loop ) {
+ foreach ($$sub_loop as $parent => $sub) {
+ foreach ($sub as $index => $data) {
+ if ( ! current_user_can($data[1]) ) {
+ unset(${$sub_loop}[$parent][$index]);
+ $_wp_submenu_nopriv[$parent][$data[2]] = true;
+ }
+ }
+ unset($index, $data);
+
+ if ( empty(${$sub_loop}[$parent]) )
+ unset(${$sub_loop}[$parent]);
+ }
+ unset($sub, $parent);
+}
+unset($sub_loop);
+
+// Loop over the top-level menu.
+// Menus for which the original parent is not accessible due to lack of privs will have the next
+// submenu in line be assigned as the new menu parent.
+foreach ( $menu as $id => $data ) {
+ if ( empty($submenu[$data[2]]) )
+ continue;
+ $subs = $submenu[$data[2]];
+ $first_sub = array_shift($subs);
+ $old_parent = $data[2];
+ $new_parent = $first_sub[2];
+ // If the first submenu is not the same as the assigned parent,
+ // make the first submenu the new parent.
+ if ( $new_parent != $old_parent ) {
+ $_wp_real_parent_file[$old_parent] = $new_parent;
+ $menu[$id][2] = $new_parent;
+
+ foreach ($submenu[$old_parent] as $index => $data) {
+ $submenu[$new_parent][$index] = $submenu[$old_parent][$index];
+ unset($submenu[$old_parent][$index]);
+ }
+ unset($submenu[$old_parent], $index);
+
+ if ( isset($_wp_submenu_nopriv[$old_parent]) )
+ $_wp_submenu_nopriv[$new_parent] = $_wp_submenu_nopriv[$old_parent];
+ }
+}
+unset($id, $data, $subs, $first_sub, $old_parent, $new_parent);
+
+if ( is_network_admin() )
+ do_action('network_admin_menu', '');
+elseif ( is_user_admin() )
+ do_action('user_admin_menu', '');
+else
+ do_action('admin_menu', '');
+
+// Remove menus that have no accessible submenus and require privs that the user does not have.
+// Run re-parent loop again.
+foreach ( $menu as $id => $data ) {
+ if ( ! current_user_can($data[1]) )
+ $_wp_menu_nopriv[$data[2]] = true;
+
+ // If submenu is empty...
+ if ( empty($submenu[$data[2]]) ) {
+ // And user doesn't have privs, remove menu.
+ if ( isset( $_wp_menu_nopriv[$data[2]] ) ) {
+ unset($menu[$id]);
+ }
+ }
+}
+unset($id, $data);
+
+// Remove any duplicated seperators
+$seperator_found = false;
+foreach ( $menu as $id => $data ) {
+ if ( 0 == strcmp('wp-menu-separator', $data[4] ) ) {
+ if (false == $seperator_found) {
+ $seperator_found = true;
+ } else {
+ unset($menu[$id]);
+ $seperator_found = false;
+ }
+ } else {
+ $seperator_found = false;
+ }
+}
+unset($id, $data);
+
+function add_cssclass($add, $class) {
+ $class = empty($class) ? $add : $class .= ' ' . $add;
+ return $class;
+}
+
+function add_menu_classes($menu) {
+
+ $first = $lastorder = false;
+ $i = 0;
+ $mc = count($menu);
+ foreach ( $menu as $order => $top ) {
+ $i++;
+
+ if ( 0 == $order ) { // dashboard is always shown/single
+ $menu[0][4] = add_cssclass('menu-top-first', $top[4]);
+ $lastorder = 0;
+ continue;
+ }
+
+ if ( 0 === strpos($top[2], 'separator') ) { // if separator
+ $first = true;
+ $c = $menu[$lastorder][4];
+ $menu[$lastorder][4] = add_cssclass('menu-top-last', $c);
+ continue;
+ }
+
+ if ( $first ) {
+ $c = $menu[$order][4];
+ $menu[$order][4] = add_cssclass('menu-top-first', $c);
+ $first = false;
+ }
+
+ if ( $mc == $i ) { // last item
+ $c = $menu[$order][4];
+ $menu[$order][4] = add_cssclass('menu-top-last', $c);
+ }
+
+ $lastorder = $order;
+ }
+
+ return apply_filters( 'add_menu_classes', $menu );
+}
+
+uksort($menu, "strnatcasecmp"); // make it all pretty
+
+if ( apply_filters('custom_menu_order', false) ) {
+ $menu_order = array();
+ foreach ( $menu as $menu_item ) {
+ $menu_order[] = $menu_item[2];
+ }
+ unset($menu_item);
+ $default_menu_order = $menu_order;
+ $menu_order = apply_filters('menu_order', $menu_order);
+ $menu_order = array_flip($menu_order);
+ $default_menu_order = array_flip($default_menu_order);
+
+ function sort_menu($a, $b) {
+ global $menu_order, $default_menu_order;
+ $a = $a[2];
+ $b = $b[2];
+ if ( isset($menu_order[$a]) && !isset($menu_order[$b]) ) {
+ return -1;
+ } elseif ( !isset($menu_order[$a]) && isset($menu_order[$b]) ) {
+ return 1;
+ } elseif ( isset($menu_order[$a]) && isset($menu_order[$b]) ) {
+ if ( $menu_order[$a] == $menu_order[$b] )
+ return 0;
+ return ($menu_order[$a] < $menu_order[$b]) ? -1 : 1;
+ } else {
+ return ($default_menu_order[$a] <= $default_menu_order[$b]) ? -1 : 1;
+ }
+ }
+
+ usort($menu, 'sort_menu');
+ unset($menu_order, $default_menu_order);
+}
+
+if ( !user_can_access_admin_page() ) {
+ do_action('admin_page_access_denied');
+ wp_die( __('You do not have sufficient permissions to access this page.') );
+}
+
+$menu = add_menu_classes($menu);
+
+?>
\ No newline at end of file
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
<div style="display:none;">
-<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
+<?php submit_button( __( 'Save' ), 'button', 'save' ); ?>
</div>
<div id="minor-publishing-actions">
<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
<input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" tabindex="4" class="button button-highlighted" />
<?php } ?>
+<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="draft-ajax-loading" alt="" />
</div>
<div id="preview-action">
<?php
if ( 'publish' == $post->post_status ) {
- $preview_link = esc_url(get_permalink($post->ID));
- $preview_button = __('Preview Changes');
+ $preview_link = esc_url( get_permalink( $post->ID ) );
+ $preview_button = __( 'Preview Changes' );
} else {
- $preview_link = esc_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
- $preview_button = __('Preview');
+ $preview_link = get_permalink( $post->ID );
+ if ( is_ssl() )
+ $preview_link = str_replace( 'http://', 'https://', $preview_link );
+ $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) );
+ $preview_button = __( 'Preview' );
}
?>
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a>
case 'auto-draft':
_e('Draft');
break;
- case 'auto-draft':
- _e('Unsaved');
- break;
}
?>
</span>
</div><?php // /misc-pub-section ?>
-
<?php
// translators: Publish box date formt, see http://php.net/date
$datef = __( 'M j, Y @ G:i' );
</div>
<div id="publishing-action">
-<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" id="ajax-loading" style="visibility:hidden;" alt="" />
+<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="ajax-loading" alt="" />
<?php
if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) {
if ( $can_publish ) :
if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" />
- <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Schedule') ?>" />
+ <?php submit_button( __( 'Schedule' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?>
<?php else : ?>
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Publish') ?>" />
- <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Publish') ?>" />
+ <?php submit_button( __( 'Publish' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?>
<?php endif;
else : ?>
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Submit for Review') ?>" />
- <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php esc_attr_e('Submit for Review') ?>" />
+ <?php submit_button( __( 'Submit for Review' ), 'primary', 'publish', false, array( 'tabindex' => '5', 'accesskey' => 'p' ) ); ?>
<?php
endif;
} else { ?>
<?php
}
+/**
+ * Display post format form elements.
+ *
+ * @since 3.1.0
+ *
+ * @param object $post
+ */
+function post_format_meta_box( $post, $box ) {
+ if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :
+ $post_formats = get_theme_support( 'post-formats' );
+
+ if ( is_array( $post_formats[0] ) ) :
+ $post_format = get_post_format( $post->ID );
+ if ( !$post_format )
+ $post_format = '0';
+ $post_format_display = get_post_format_string( $post_format );
+ // Add in the current one if it isn't there yet, in case the current theme doesn't support it
+ if ( $post_format && !in_array( $post_format, $post_formats[0] ) )
+ $post_formats[0][] = $post_format;
+ ?>
+ <div id="post-formats-select">
+ <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0"><?php _e('Standard'); ?></label>
+ <?php foreach ( $post_formats[0] as $format ) : ?>
+ <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>
+ <?php endforeach; ?><br />
+ </div>
+ <?php endif; endif;
+}
+
/**
* Display post tags form fields.
<div class="jaxtag">
<div class="nojs-tags hide-if-js">
<p><?php echo $taxonomy->labels->add_or_remove_items; ?></p>
- <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo esc_attr(get_terms_to_edit( $post->ID, $tax_name )); ?></textarea></div>
+ <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo get_terms_to_edit( $post->ID, $tax_name ); // textarea_escaped by esc_attr() ?></textarea></div>
<?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
<div class="ajaxtag hide-if-no-js">
<label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
</div>
<?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
<p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->choose_from_most_used; ?></a></p>
-<?php else : ?>
-<p><em><?php _e('You cannot modify this taxonomy.'); ?></em></p>
<?php endif; ?>
<?php
}
<?php wp_terms_checklist($post->ID, array( 'taxonomy' => $taxonomy, 'popular_cats' => $popular_ids ) ) ?>
</ul>
</div>
- <?php if ( !current_user_can($tax->cap->assign_terms) ) : ?>
- <p><em><?php _e('You cannot modify this taxonomy.'); ?></em></p>
- <?php endif; ?>
<?php if ( current_user_can($tax->cap->edit_terms) ) : ?>
<div id="<?php echo $taxonomy; ?>-adder" class="wp-hidden-children">
<h4>
*/
function post_excerpt_meta_box($post) {
?>
-<label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
+<label class="screen-reader-text" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
<p><?php _e('Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="http://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>'); ?></p>
<?php
}
<p class="meta-options">
<label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> <?php _e( 'Allow comments.' ) ?></label><br />
<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php printf( __( 'Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.' ), __( 'http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) ); ?></label>
+ <?php do_action('post_comment_status_meta_box-options', $post); ?>
</p>
<?php
}
*
* @since 3.0.0
*
- * @param $result table header rows
- * @return
+ * @param array $result table header rows
+ * @return array
*/
function post_comment_meta_box_thead($result) {
unset($result['cb'], $result['response']);
}
wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
- add_filter('manage_edit-comments_columns', 'post_comment_meta_box_thead', 8, 1);
-?>
-<table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
-<thead><tr>
- <?php print_column_headers('edit-comments'); ?>
-</tr></thead>
-<tbody id="the-comment-list" class="list:comment"></tbody>
-</table>
+ $wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
+ $wp_list_table->display( true );
+?>
<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /></p>
<?php
$hidden = get_hidden_meta_boxes('post');
<script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
<?php
}
- remove_filter('manage_edit-comments_columns', 'post_comment_meta_box_thead');
wp_comment_trashnotice();
}
*/
function post_author_meta_box($post) {
global $user_ID;
- $authors = get_editable_user_ids( get_current_user_id(), true, $post->post_type ); // TODO: ROLE SYSTEM
- if ( $post->post_author && !in_array($post->post_author, $authors) )
- $authors[] = $post->post_author;
?>
-<label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
+<label class="screen-reader-text" for="post_author_override"><?php _e('Author'); ?></label>
<?php
+ wp_dropdown_users( array(
+ 'who' => 'authors',
+ 'name' => 'post_author_override',
+ 'selected' => empty($post->ID) ? $user_ID : $post->post_author,
+ 'include_selected' => true
+ ) );
}
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
<div style="display:none;">
-<input type="submit" name="save" value="<?php esc_attr_e('Save'); ?>" />
+<?php submit_button( __( 'Save' ), 'button', 'save', false ); ?>
</div>
<div id="minor-publishing-actions">
</tr>
<tr class="form-field">
<th valign="top" scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
- <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); ?></textarea></td>
+ <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); // textarea_escaped ?></textarea></td>
</tr>
<tr class="form-field">
<th valign="top" scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.0.0
*
* @return unknown
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.5.0
*
* @param unknown_type $filename
* @param unknown_type $marker
* BEGIN and END markers. Replaces existing marked info. Retains surrounding
* data. Creates file if none exists.
*
- * @since unknown
+ * @since 1.5.0
*
* @param unknown_type $filename
* @param unknown_type $marker
* Always writes to the file if it exists and is writable to ensure that we
* blank out old rules.
*
- * @since unknown
+ * @since 1.5.0
*/
function save_mod_rewrite_rules() {
if ( is_multisite() )
* @return bool True if web.config was updated successfully
*/
function iis7_save_url_rewrite_rules(){
+ if ( is_multisite() )
+ return;
+
global $wp_rewrite;
$home_path = get_home_path();
$web_config_file = $home_path . 'web.config';
// Using win_is_writable() instead of is_writable() because of a bug in Windows PHP
- if ( ( ! file_exists($web_config_file) && win_is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable($web_config_file) ) {
- if ( iis7_supports_permalinks() ) {
- $rule = $wp_rewrite->iis7_url_rewrite_rules(false, '', '');
- if ( ! empty($rule) ) {
- return iis7_add_rewrite_rule($web_config_file, $rule);
- } else {
- return iis7_delete_rewrite_rule($web_config_file);
- }
+ if ( iis7_supports_permalinks() && ( ( ! file_exists($web_config_file) && win_is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable($web_config_file) ) ) {
+ $rule = $wp_rewrite->iis7_url_rewrite_rules(false, '', '');
+ if ( ! empty($rule) ) {
+ return iis7_add_rewrite_rule($web_config_file, $rule);
+ } else {
+ return iis7_delete_rewrite_rule($web_config_file);
}
}
return false;
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.5.0
*
* @param unknown_type $file
*/
/**
* If siteurl or home changed, flush rewrite rules.
*
- * @since unknown
+ * @since 2.1.0
*
* @param unknown_type $old_value
* @param unknown_type $value
add_action( 'update_option_siteurl', 'update_home_siteurl', 10, 2 );
/**
- * {@internal Missing Short Description}}
+ * Shorten an URL, to be used as link text
*
- * @since unknown
+ * @since 1.2.1
*
- * @param unknown_type $url
- * @return unknown
+ * @param string $url
+ * @return string
*/
function url_shorten( $url ) {
$short_url = str_replace( 'http://', '', stripslashes( $url ));
* in the $vars array to the value of $_POST[$var] or $_GET[$var] or ''
* if neither is defined.
*
- * @since unknown
+ * @since 2.0.0
*
* @param array $vars An array of globals to reset.
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.1.0
*
* @param unknown_type $message
*/
switch ( $map_option ) {
case 'edit_per_page':
- case 'ms_sites_per_page':
- case 'ms_users_per_page':
+ case 'users_per_page':
case 'edit_comments_per_page':
case 'upload_per_page':
case 'edit_tags_per_page':
case 'plugins_per_page':
+ // Network admin
+ case 'sites_network_per_page':
+ case 'users_network_per_page':
+ case 'site_users_network_per_page':
+ case 'plugins_network_per_page':
+ case 'themes_network_per_page':
+ case 'site_themes_network_per_page':
$value = (int) $value;
if ( $value < 1 || $value > 999 )
return;
}
}
-/**
- * Check if IIS 7 supports pretty permalinks
- *
- * @since 2.8.0
- *
- * @return bool
- */
-function iis7_supports_permalinks() {
- global $is_iis7;
-
- $supports_permalinks = false;
- if ( $is_iis7 ) {
- /* First we check if the DOMDocument class exists. If it does not exist,
- * which is the case for PHP 4.X, then we cannot easily update the xml configuration file,
- * hence we just bail out and tell user that pretty permalinks cannot be used.
- * This is not a big issue because PHP 4.X is going to be depricated and for IIS it
- * is recommended to use PHP 5.X NTS.
- * Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When
- * URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'.
- * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs
- * via ISAPI then pretty permalinks will not work.
- */
- $supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( php_sapi_name() == 'cgi-fcgi' );
- }
-
- return apply_filters('iis7_supports_permalinks', $supports_permalinks);
-}
-
/**
* Check if rewrite rule for WordPress already exists in the IIS 7 configuration file
*
*
* @since 2.8.0
*
- * @param object $path
+ * @param string $path
* @return bool
*/
-function win_is_writable($path) {
+function win_is_writable( $path ) {
/* will work in despite of Windows ACLs bug
* NOTE: use a trailing slash for folders!!!
* see http://bugs.php.net/bug.php?id=27609
* see http://bugs.php.net/bug.php?id=30931
*/
- if ( $path{strlen($path)-1} == '/' ) // recursively return a temporary file path
- return win_is_writable($path . uniqid(mt_rand()) . '.tmp');
- else if ( is_dir($path) )
- return win_is_writable($path . '/' . uniqid(mt_rand()) . '.tmp');
- // check tmp file for read/write capabilities
- $rm = file_exists($path);
- $f = @fopen($path, 'a');
- if ($f===false)
- return false;
- fclose($f);
- if ( ! $rm )
- unlink($path);
- return true;
+ if ( $path[strlen( $path ) - 1] == '/' ) // recursively return a temporary file path
+ return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp');
+ else if ( is_dir( $path ) )
+ return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' );
+ // check tmp file for read/write capabilities
+ $should_delete_tmp_file = !file_exists( $path );
+ $f = @fopen( $path, 'a' );
+ if ( $f === false )
+ return false;
+ fclose( $f );
+ if ( $should_delete_tmp_file )
+ unlink( $path );
+ return true;
}
/**
do_action( 'delete_blog', $blog_id, $drop );
- $users = get_users_of_blog( $blog_id );
+ $users = get_users( array( 'blog_id' => $blog_id, 'fields' => 'ids' ) );
// Remove users from this blog.
if ( ! empty( $users ) ) {
- foreach ( $users as $user ) {
- remove_user_from_blog( $user->user_id, $blog_id) ;
+ foreach ( $users as $user_id ) {
+ remove_user_from_blog( $user_id, $blog_id) ;
}
}
return true;
}
-function confirm_delete_users( $users ) {
- $current_user = wp_get_current_user();
- if ( !is_array( $users ) )
- return false;
-
- screen_icon();
- ?>
- <h2><?php esc_html_e( 'Users' ); ?></h2>
- <p><?php _e( 'Transfer or delete posts and links before deleting users.' ); ?></p>
- <form action="ms-edit.php?action=dodelete" method="post">
- <input type="hidden" name="dodelete" />
- <?php
- wp_nonce_field( 'ms-users-delete' );
- $site_admins = get_super_admins();
- $admin_out = "<option value='$current_user->ID'>$current_user->user_login</option>";
-
- 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 "<input type='hidden' name='user[]' value='{$val}'/>\n";
- $blogs = get_blogs_of_user( $val, true );
-
- if ( !empty( $blogs ) ) {
- ?>
- <br /><fieldset><p><legend><?php printf( __( "What should be done with posts and links owned by <em>%s</em>?" ), $delete_user->user_login ); ?></legend></p>
- <?php
- foreach ( (array) $blogs as $key => $details ) {
- $blog_users = get_users_of_blog( $details->userblog_id );
- if ( is_array( $blog_users ) && !empty( $blog_users ) ) {
- $user_site = "<a href='" . esc_url( get_home_url( $details->userblog_id ) ) . "'>{$details->blogname}</a>";
- $user_dropdown = "<select name='blog[$val][{$key}]'>";
- $user_list = '';
- foreach ( $blog_users as $user ) {
- if ( $user->user_id != $val && !in_array( $user->user_id, $allusers ) )
- $user_list .= "<option value='{$user->user_id}'>{$user->user_login}</option>";
- }
- if ( '' == $user_list )
- $user_list = $admin_out;
- $user_dropdown .= $user_list;
- $user_dropdown .= "</select>\n";
- ?>
- <ul style="list-style:none;">
- <li><?php printf( __( 'Site: %s' ), $user_site ); ?></li>
- <li><label><input type="radio" id="delete_option0" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID ?>]" value="delete" checked="checked" />
- <?php _e( 'Delete all posts and links.' ); ?></label></li>
- <li><label><input type="radio" id="delete_option1" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID ?>]" value="reassign" />
- <?php echo __( 'Attribute all posts and links to:' ) . '</label>' . $user_dropdown; ?></li>
- </ul>
- <?php
- }
- }
- echo "</fieldset>";
- }
- }
- }
- ?>
- <p class="submit"><input type="submit" class="button-secondary delete" value="<?php esc_attr_e( 'Confirm Deletion' ); ?>" /></p>
- </form>
- <?php
- return true;
-}
-
function wpmu_get_blog_allowedthemes( $blog_id = 0 ) {
$themes = get_themes();
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 );
+ if ( get_site_option( 'upload_space_check_disabled' ) )
+ return min( $size, $fileupload_maxk );
+
return min( $size, $fileupload_maxk, get_upload_space_available() );
}
/**
<?php
}
-// Display File upload quota on dashboard
-function dashboard_quota() {
- if ( get_site_option( 'upload_space_check_disabled' ) )
- return true;
-
- $quota = get_space_allowed();
- $used = get_dirsize( BLOGUPLOADDIR ) / 1024 / 1024;
-
- if ( $used > $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 );
-
- ?>
- <p class="sub musub"><?php _e( 'Storage Space' ); ?></p>
- <div class="table table_content musubtable">
- <table>
- <tr class="first">
- <td class="first b b-posts"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>' ), esc_url( admin_url( 'upload.php' ) ), $quota ); ?></td>
- <td class="t posts"><?php _e( 'Space Allowed' ); ?></td>
- </tr>
- </table>
- </div>
- <div class="table table_discussion musubtable">
- <table>
- <tr class="first">
- <td class="b b-comments"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>' ), esc_url( admin_url( 'upload.php' ) ), $used, $percentused ); ?></td>
- <td class="last t comments <?php echo $used_color;?>"><?php _e( 'Space Used' );?></td>
- </tr>
- </table>
- </div>
- <br class="clear" />
- <?php
-}
-if ( current_user_can( 'edit_posts' ) )
- add_action( 'activity_box_end', 'dashboard_quota' );
-
// Edit blog upload space setting on Edit Blog page
function upload_space_setting( $id ) {
$quota = get_blog_option( $id, 'blog_upload_space' );
}
add_action( 'wpmueditblogaction', 'upload_space_setting' );
-function update_user_status( $id, $pref, $value, $refresh = 1 ) {
+function update_user_status( $id, $pref, $value, $deprecated = null ) {
global $wpdb;
+ if ( null !== $deprecated )
+ _deprecated_argument( __FUNCTION__, '3.1' );
+
$wpdb->update( $wpdb->users, array( $pref => $value ), array( 'ID' => $id ) );
- if ( $refresh == 1 )
- refresh_user_details( $id );
+ clean_user_cache( $id );
if ( $pref == 'spam' ) {
if ( $value == 1 )
$c ++;
$blog = get_active_blog_for_user( get_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( get_current_user_id() );
-
- if ( !empty( $blogs ) ) {
- foreach( $blogs as $blogid => $blog ) {
- if ( $blogid != $dashboard_blog->blog_id && get_user_meta( get_current_user_id() , 'primary_blog', true ) == $dashboard_blog->blog_id ) {
- update_user_meta( get_current_user_id(), 'primary_blog', $blogid );
- continue;
- }
- }
- $blog = get_blog_details( get_user_meta( get_current_user_id(), 'primary_blog', true ) );
- wp_redirect( get_admin_url( $blog->blog_id, '?c=' . $c ) );
- exit;
+ } else {
+ wp_redirect( user_admin_url( '?c=' . $c ) ); // redirect and count to 5, "just in case"
}
- wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
+ exit;
}
add_action( 'admin_page_access_denied', 'redirect_user_to_blog', 99 );
echo "<div class='update-nag'>$msg</div>";
}
}
-add_action( 'admin_notices', 'secret_salt_warning' );
-
-function admin_notice_feed() {
- global $current_screen;
- if ( $current_screen->id != 'dashboard' )
- return;
-
- if ( !empty( $_GET['feed_dismiss'] ) ) {
- update_user_option( get_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 = "<h3>" . esc_html( $title ) . "</h3>\n";
- $content = $item->get_description();
- $content = $content ? wp_html_excerpt( $content, 200 ) . ' … ' : '';
- $link = esc_url( strip_tags( $item->get_link() ) );
- $msg .= "<p>" . $content . "<a href='$link'>" . __( 'Read More' ) . "</a> <a href='index.php?feed_dismiss=" . md5( $title ) . "'>" . __( 'Dismiss' ) . "</a></p>";
- echo "<div class='updated'>$msg</div>";
- } elseif ( is_super_admin() ) {
- printf( '<div class="update-nag">' . __( 'Your feed at %s is empty.' ) . '</div>', esc_html( $url ) );
- }
-}
-add_action( 'admin_notices', 'admin_notice_feed' );
+add_action( 'network_admin_notices', 'secret_salt_warning' );
function site_admin_notice() {
global $wp_db_version;
if ( !is_super_admin() )
return false;
if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version )
- echo "<div class='update-nag'>" . sprintf( __( 'Thank you for Updating! Please visit the <a href="%s">Update Network</a> page to update all your sites.' ), esc_url( admin_url( 'ms-upgrade-network.php' ) ) ) . "</div>";
+ echo "<div class='update-nag'>" . sprintf( __( 'Thank you for Updating! Please visit the <a href="%s">Update Network</a> page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) ) . "</div>";
}
add_action( 'admin_notices', 'site_admin_notice' );
+add_action( 'network_admin_notices', 'site_admin_notice' );
function avoid_blog_page_permalink_collision( $data, $postarr ) {
if ( is_subdomain_install() )
<?php
}
-function show_post_thumbnail_warning() {
- if ( ! is_super_admin() )
- return;
- $mu_media_buttons = get_site_option( 'mu_media_buttons', array() );
- if ( empty($mu_media_buttons['image']) && current_theme_supports( 'post-thumbnails' ) ) {
- echo "<div class='update-nag'>" . sprintf( __( "Warning! The current theme supports Featured Images. You must enable image uploads on <a href='%s'>the options page</a> for it to work." ), esc_url( admin_url( 'ms-options.php' ) ) ) . "</div>";
- }
-}
-add_action( 'admin_notices', 'show_post_thumbnail_warning' );
-
function ms_deprecated_blogs_file() {
if ( ! is_super_admin() )
return;
return;
echo '<div class="update-nag">' . sprintf( __( 'The <code>%1$s</code> file is deprecated. Please remove it and update your server rewrite rules to use <code>%2$s</code> instead.' ), 'wp-content/blogs.php', 'wp-includes/ms-files.php' ) . '</div>';
}
-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' ), '<a href="' . esc_url( admin_url( 'ms-options.php#menu' ) ) . '">' . __( 'Activate' ) . '</a>' );
- echo "<div class='error'><p>$message</p></div>";
-}
+add_action( 'network_admin_notices', 'ms_deprecated_blogs_file' );
/**
* Grants super admin privileges.
*
* @since 3.0.0
- * @param $user_id
+ * @param int $user_id
*/
function grant_super_admin( $user_id ) {
global $super_admins;
* Revokes super admin privileges.
*
* @since 3.0.0
- * @param $user_id
+ * @param int $user_id
*/
function revoke_super_admin( $user_id ) {
global $super_admins;
}
return false;
}
+
+/**
+ * Whether or not we can edit this network from this page
+ *
+ * By default editing of network is restricted to the Network Admin for that site_id this allows for this to be overridden
+ *
+ * @since 3.1.0
+ * @param integer $site_id The network/site id to check.
+ */
+function can_edit_network( $site_id ) {
+ global $wpdb;
+
+ if ($site_id == $wpdb->siteid )
+ $result = true;
+ else
+ $result = false;
+
+ return apply_filters( 'can_edit_network', $result, $site_id );
+}
+
+/**
+ * Thickbox image paths for Network Admin.
+ *
+ * @since 3.1.0
+ * @access private
+ */
+function _thickbox_path_admin_subfolder() {
+?>
+<script type="text/javascript">
+//<![CDATA[
+var tb_pathToImage = "../../wp-includes/js/thickbox/loadingAnimation.gif";
+var tb_closeImage = "../../wp-includes/js/thickbox/tb-close.png";
+//]]>
+</script>
+<?php
+}
+
?>
* @since 3.0.0
*
* @param string $output Passed by reference.
- * @param int $depth Depth of page.
*/
function start_lvl(&$output) {}
* @since 3.0.0
*
* @param string $output Passed by reference.
- * @param int $depth Depth of page.
*/
function end_lvl(&$output) {
}
* @param string $output Passed by reference. Used to append additional content.
* @param object $item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
- * @param int $current_page Menu item ID.
* @param object $args
*/
function start_el(&$output, $item, $depth, $args) {
<p class="field-description description description-wide">
<label for="edit-menu-item-description-<?php echo $item_id; ?>">
<?php _e( 'Description' ); ?><br />
- <textarea id="edit-menu-item-description-<?php echo $item_id; ?>" class="widefat edit-menu-item-description" rows="3" cols="20" name="menu-item-description[<?php echo $item_id; ?>]"><?php echo esc_html( $item->description ); ?></textarea>
+ <textarea id="edit-menu-item-description-<?php echo $item_id; ?>" class="widefat edit-menu-item-description" rows="3" cols="20" name="menu-item-description[<?php echo $item_id; ?>]"><?php echo esc_html( $item->description ); // textarea_escaped ?></textarea>
<span class="description"><?php _e('The description will be displayed in the menu if the current theme supports it.'); ?></span>
</label>
</p>
* @param string $output Passed by reference. Used to append additional content.
* @param object $item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
- * @param int $current_page Menu item ID.
* @param object $args
*/
function start_el(&$output, $item, $depth, $args) {
$output .= '<input type="hidden" class="menu-item-url" name="menu-item[' . $possible_object_id . '][menu-item-url]" value="'. esc_attr( $item->url ) .'" />';
$output .= '<input type="hidden" class="menu-item-target" name="menu-item[' . $possible_object_id . '][menu-item-target]" value="'. esc_attr( $item->target ) .'" />';
$output .= '<input type="hidden" class="menu-item-attr_title" name="menu-item[' . $possible_object_id . '][menu-item-attr_title]" value="'. esc_attr( $item->attr_title ) .'" />';
- $output .= '<input type="hidden" class="menu-item-description" name="menu-item[' . $possible_object_id . '][menu-item-description]" value="'. esc_attr( $item->description ) .'" />';
$output .= '<input type="hidden" class="menu-item-classes" name="menu-item[' . $possible_object_id . '][menu-item-classes]" value="'. esc_attr( implode( ' ', $item->classes ) ) .'" />';
$output .= '<input type="hidden" class="menu-item-xfn" name="menu-item[' . $possible_object_id . '][menu-item-xfn]" value="'. esc_attr( $item->xfn ) .'" />';
}
?>
<p class="button-controls">
<img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
- <input type="submit"<?php disabled( $nav_menu_selected_id, 0 ); ?> class="button-primary" name="nav-menu-locations" value="<?php esc_attr_e( 'Save' ); ?>" />
+ <?php submit_button( __( 'Save' ), 'primary', 'nav-menu-locations', false, disabled( $nav_menu_selected_id, 0, false ) ); ?>
</p>
<?php
}
?>">
<ul id="<?php echo $post_type_name; ?>checklist-most-recent" class="categorychecklist form-no-clear">
<?php
- $recent_args = array_merge( $args, array( 'orderby' => 'post_date', 'order' => 'DESC', 'showposts' => 15 ) );
+ $recent_args = array_merge( $args, array( 'orderby' => 'post_date', 'order' => 'DESC', 'posts_per_page' => 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 );
}
?>
<p class="quick-search-wrap">
- <input type="text" class="quick-search regular-text input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" />
+ <input type="text" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-posttype-<?php echo $post_type_name; ?>" />
<img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
- <input type="submit" class="quick-search-submit button-secondary hide-if-js" value="<?php esc_attr_e('Search'); ?>" />
+ <?php submit_button( __( 'Search' ), 'quick-search-submit button-secondary hide-if-js', 'submit', false ); ?>
</p>
<ul id="<?php echo $post_type_name; ?>-search-checklist" class="list:<?php echo $post_type_name?> categorychecklist form-no-clear">
}
?>
<p class="quick-search-wrap">
- <input type="text" class="quick-search regular-text input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" />
+ <input type="text" class="quick-search input-with-default-title" title="<?php esc_attr_e('Search'); ?>" value="<?php echo $searched; ?>" name="quick-search-taxonomy-<?php echo $taxonomy_name; ?>" />
<img class="waiting" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
- <input type="submit" class="quick-search-submit button-secondary hide-if-js" value="<?php esc_attr_e('Search'); ?>" />
+ <?php submit_button( __( 'Search' ), 'quick-search-submit button-secondary hide-if-js', 'submit', false ); ?>
</p>
<ul id="<?php echo $taxonomy_name; ?>-search-checklist" class="list:<?php echo $taxonomy_name?> categorychecklist form-no-clear">
*
* @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
*/
function install_popular_tags( $args = array() ) {
- if ( ! ($cache = wp_cache_get('popular_tags', 'api')) && ! ($cache = get_option('wporg_popular_tags')) )
- add_option('wporg_popular_tags', array(), '', 'no'); ///No autoload.
-
- if ( $cache && $cache->timeout + 3 * 60 * 60 > time() )
- return $cache->cached;
+ $key = md5(serialize($args));
+ if ( false !== ($tags = get_site_transient('poptags_' . $key) ) )
+ return $tags;
$tags = plugins_api('hot_tags', $args);
if ( is_wp_error($tags) )
return $tags;
- $cache = (object) array('timeout' => time(), 'cached' => $tags);
-
- update_option('wporg_popular_tags', $cache);
- wp_cache_set('popular_tags', $cache, 'api');
+ set_site_transient('poptags_' . $key, $tags, 10800); // 3 * 60 * 60 = 10800
return $tags;
}
-add_action('install_plugins_search', 'install_search', 10, 1);
-
-/**
- * Display search results and display as tag cloud.
- *
- * @since 2.7.0
- *
- * @param string $page
- */
-function install_search($page) {
- $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
- $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
-
- $args = array();
-
- switch( $type ){
- case 'tag':
- $args['tag'] = sanitize_title_with_dashes($term);
- break;
- case 'term':
- $args['search'] = $term;
- break;
- case 'author':
- $args['author'] = $term;
- break;
- }
- $args['page'] = $page;
-
- $api = plugins_api('query_plugins', $args);
-
- if ( is_wp_error($api) )
- wp_die($api);
-
- add_action('install_plugins_table_header', 'install_search_form');
-
- display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']);
-
- return;
-}
-
-add_action('install_plugins_dashboard', 'install_dashboard');
function install_dashboard() {
?>
<p><?php _e('Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> or upload a plugin in .zip format via this page.') ?></p>
$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'])) ),
+ 'link' => esc_url( self_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 '</p><br class="clear" />';
}
+add_action('install_plugins_dashboard', 'install_dashboard');
/**
* Display search form for searching plugins.
$type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
$term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
- ?><form id="search-plugins" method="post" action="<?php echo admin_url('plugin-install.php?tab=search'); ?>">
+ ?><form id="search-plugins" method="get" action="">
+ <input type="hidden" name="tab" value="search" />
<select name="type" id="typeselector">
<option value="term"<?php selected('term', $type) ?>><?php _e('Term'); ?></option>
<option value="author"<?php selected('author', $type) ?>><?php _e('Author'); ?></option>
</select>
<input type="text" name="s" value="<?php echo esc_attr($term) ?>" />
<label class="screen-reader-text" for="plugin-search-input"><?php _e('Search Plugins'); ?></label>
- <input type="submit" id="plugin-search-input" name="search" value="<?php esc_attr_e('Search Plugins'); ?>" class="button" />
+ <?php submit_button( __( 'Search Plugins' ), 'button', 'plugin-search-input', false ); ?>
</form><?php
}
-add_action('install_plugins_featured', 'install_featured', 10, 1);
-/**
- * Display featured plugins.
- *
- * @since 2.7.0
- *
- * @param string $page
- */
-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->get_error_message() . '</p> <p class="hide-if-no-js"><a href="#" onclick="document.location.reload(); return false;">' . __('Try again') . '</a>');
- display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']);
-}
-
-add_action('install_plugins_popular', 'install_popular', 10, 1);
-/**
- * Display popular plugins.
- *
- * @since 2.7.0
- *
- * @param string $page
- */
-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() . '</p> <p class="hide-if-no-js"><a href="#" onclick="document.location.reload(); return false;">' . __('Try again') . '</a>');
- display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']);
-}
-
-add_action('install_plugins_upload', 'install_plugins_upload', 10, 1);
/**
* Upload from zip
* @since 2.8.0
?>
<h4><?php _e('Install a plugin in .zip format') ?></h4>
<p class="install-help"><?php _e('If you have a plugin in a .zip format, you may install it by uploading it here.') ?></p>
- <form method="post" enctype="multipart/form-data" action="<?php echo admin_url('update.php?action=upload-plugin') ?>">
+ <form method="post" enctype="multipart/form-data" action="<?php echo self_admin_url('update.php?action=upload-plugin') ?>">
<?php wp_nonce_field( 'plugin-upload') ?>
<label class="screen-reader-text" for="pluginzip"><?php _e('Plugin zip file'); ?></label>
<input type="file" id="pluginzip" name="pluginzip" />
</form>
<?php
}
-
-add_action('install_plugins_new', 'install_new', 10, 1);
-/**
- * Display new plugins.
- *
- * @since 2.7.0
- *
- * @param string $page
- */
-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->get_error_message() . '</p> <p class="hide-if-no-js"><a href="#" onclick="document.location.reload(); return false;">' . __('Try again') . '</a>');
- display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']);
-}
-add_action('install_plugins_updated', 'install_updated', 10, 1);
-
-
-/**
- * Display recently updated plugins.
- *
- * @since 2.7.0
- *
- * @param string $page
- */
-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() . '</p> <p class="hide-if-no-js"><a href="#" onclick="document.location.reload(); return false;">' . __('Try again') . '</a>');
- display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']);
-}
+add_action('install_plugins_upload', 'install_plugins_upload', 10, 1);
/**
* Display plugin content based on plugin list.
*
* @since 2.7.0
- *
- * @param array $plugins List of plugins.
- * @param string $page
- * @param int $totalpages Number of pages.
*/
-function display_plugins_table($plugins, $page = 1, $totalpages = 1){
- $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
- $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
+function display_plugins_table() {
+ global $wp_list_table;
- $plugins_allowedtags = array('a' => array('href' => array(),'title' => array(), 'target' => array()),
- 'abbr' => array('title' => array()),'acronym' => array('title' => array()),
- 'code' => array(), 'pre' => array(), 'em' => array(),'strong' => array(),
- 'ul' => array(), 'ol' => array(), 'li' => array(), 'p' => array(), 'br' => array());
-
-?>
- <div class="tablenav">
- <div class="alignleft actions">
- <?php do_action('install_plugins_table_header'); ?>
- </div>
- <?php
- $url = esc_url($_SERVER['REQUEST_URI']);
- if ( ! empty($term) )
- $url = add_query_arg('s', $term, $url);
- if ( ! empty($type) )
- $url = add_query_arg('type', $type, $url);
-
- $page_links = paginate_links( array(
- 'base' => add_query_arg('paged', '%#%', $url),
- 'format' => '',
- 'prev_text' => __('«'),
- 'next_text' => __('»'),
- 'total' => $totalpages,
- 'current' => $page
- ));
-
- if ( $page_links )
- echo "\t\t<div class='tablenav-pages'>$page_links</div>";
-?>
- <br class="clear" />
- </div>
- <table class="widefat" id="install-plugins" cellspacing="0">
- <thead>
- <tr>
- <th scope="col" class="name"><?php _e('Name'); ?></th>
- <th scope="col" class="num"><?php _e('Version'); ?></th>
- <th scope="col" class="num"><?php _e('Rating'); ?></th>
- <th scope="col" class="desc"><?php _e('Description'); ?></th>
- </tr>
- </thead>
-
- <tfoot>
- <tr>
- <th scope="col" class="name"><?php _e('Name'); ?></th>
- <th scope="col" class="num"><?php _e('Version'); ?></th>
- <th scope="col" class="num"><?php _e('Rating'); ?></th>
- <th scope="col" class="desc"><?php _e('Description'); ?></th>
- </tr>
- </tfoot>
-
- <tbody class="plugins">
- <?php
- if ( empty($plugins) )
- echo '<tr><td colspan="5">', __('No plugins match your request.'), '</td></tr>';
-
- foreach ( (array) $plugins as $plugin ){
- if ( is_object($plugin) )
- $plugin = (array) $plugin;
-
- $title = wp_kses($plugin['name'], $plugins_allowedtags);
- //Limit description to 400char, and remove any HTML.
- $description = strip_tags($plugin['description']);
- if ( strlen($description) > 400 )
- $description = mb_substr($description, 0, 400) . '…';
- //remove any trailing entities
- $description = preg_replace('/&[^;\s]{0,6}$/', '', $description);
- //strip leading/trailing & multiple consecutive lines
- $description = trim($description);
- $description = preg_replace("|(\r?\n)+|", "\n", $description);
- //\n => <br>
- $description = nl2br($description);
- $version = wp_kses($plugin['version'], $plugins_allowedtags);
-
- $name = strip_tags($title . ' ' . $version);
-
- $author = $plugin['author'];
- if ( ! empty($plugin['author']) )
- $author = ' <cite>' . sprintf( __('By %s'), $author ) . '.</cite>';
-
- $author = wp_kses($author, $plugins_allowedtags);
-
- $action_links = array();
- $action_links[] = '<a href="' . admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] .
- '&TB_iframe=true&width=600&height=550') . '" class="thickbox" title="' .
- esc_attr( sprintf( __( 'More information about %s' ), $name ) ) . '">' . __('Details') . '</a>';
-
- 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[] = '<a class="install-now" href="' . $status['url'] . '" title="' . esc_attr( sprintf( __( 'Install %s' ), $name ) ) . '">' . __('Install Now') . '</a>';
- break;
- case 'update_available':
- if ( $status['url'] )
- $action_links[] = '<a href="' . $status['url'] . '" title="' . esc_attr( sprintf( __( 'Update to version %s' ), $status['version'] ) ) . '">' . sprintf( __('Update Now'), $status['version'] ) . '</a>';
- break;
- case 'latest_installed':
- case 'newer_installed':
- $action_links[] = '<span title="' . esc_attr__( 'This plugin is already installed and is up to date' ) . ' ">' . __('Installed') . '</span>';
- break;
- }
- }
-
- $action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
- ?>
- <tr>
- <td class="name"><strong><?php echo $title; ?></strong>
- <div class="action-links"><?php if ( !empty($action_links) ) echo implode(' | ', $action_links); ?></div>
- </td>
- <td class="vers"><?php echo $version; ?></td>
- <td class="vers">
- <div class="star-holder" title="<?php printf(_n('(based on %s rating)', '(based on %s ratings)', $plugin['num_ratings']), number_format_i18n($plugin['num_ratings'])) ?>">
- <div class="star star-rating" style="width: <?php echo esc_attr($plugin['rating']) ?>px"></div>
- <div class="star star5"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('5 stars') ?>" /></div>
- <div class="star star4"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('4 stars') ?>" /></div>
- <div class="star star3"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('3 stars') ?>" /></div>
- <div class="star star2"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('2 stars') ?>" /></div>
- <div class="star star1"><img src="<?php echo admin_url('images/star.gif'); ?>" alt="<?php _e('1 star') ?>" /></div>
- </div>
- </td>
- <td class="desc"><?php echo $description, $author; ?></td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
-
- <div class="tablenav">
- <?php if ( $page_links )
- echo "\t\t<div class='tablenav-pages'>$page_links</div>"; ?>
- <br class="clear" />
- </div>
-
-<?php
+ $wp_list_table->display();
}
-
-add_action('install_plugins_pre_plugin-information', 'install_plugin_information');
+add_action('install_plugins_search', 'display_plugins_table');
+add_action('install_plugins_featured', 'display_plugins_table');
+add_action('install_plugins_popular', 'display_plugins_table');
+add_action('install_plugins_new', 'display_plugins_table');
+add_action('install_plugins_updated', 'display_plugins_table');
/**
* Determine the status we can perform on a plugin.
$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);
+ $url = wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=' . $update_file), 'upgrade-plugin_' . $update_file);
break;
}
}
$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);
+ $url = wp_nonce_url(self_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'], '=') ){
} 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);
+ $url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $api->slug), 'install-plugin_' . $api->slug);
}
}
if ( isset($_GET['from']) )
iframe_footer();
exit;
}
+add_action('install_plugins_pre_plugin-information', 'install_plugin_information');
+
if ( $markup || $translate )
$plugin_data = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup, $translate );
+ else
+ $plugin_data['AuthorName'] = $plugin_data['Author'];
return $plugin_data;
}
function _get_plugin_data_markup_translate($plugin_file, $plugin_data, $markup = true, $translate = true) {
- //Translate fields30
+ //Translate fields
if ( $translate && ! empty($plugin_data['TextDomain']) ) {
if ( ! empty( $plugin_data['DomainPath'] ) )
load_plugin_textdomain($plugin_data['TextDomain'], false, dirname($plugin_file). $plugin_data['DomainPath']);
$plugin_data[ $field ] = translate($plugin_data[ $field ], $plugin_data['TextDomain']);
}
+ $plugins_allowedtags = array(
+ 'a' => array( 'href' => array(), 'title' => array() ),
+ 'abbr' => array( 'title' => array() ),
+ 'acronym' => array( 'title' => array() ),
+ 'code' => array(),
+ 'em' => array(),
+ 'strong' => array(),
+ );
+
+ $plugin_data['AuthorName'] = $plugin_data['Author'] = wp_kses( $plugin_data['Author'], $plugins_allowedtags );
+
//Apply Markup
if ( $markup ) {
if ( ! empty($plugin_data['PluginURI']) && ! empty($plugin_data['Name']) )
- $plugin_data['Title'] = '<a href="' . $plugin_data['PluginURI'] . '" title="' . __( 'Visit plugin homepage' ) . '">' . $plugin_data['Name'] . '</a>';
+ $plugin_data['Title'] = '<a href="' . $plugin_data['PluginURI'] . '" title="' . esc_attr__( 'Visit plugin homepage' ) . '">' . $plugin_data['Name'] . '</a>';
else
$plugin_data['Title'] = $plugin_data['Name'];
if ( ! empty($plugin_data['AuthorURI']) && ! empty($plugin_data['Author']) )
- $plugin_data['Author'] = '<a href="' . $plugin_data['AuthorURI'] . '" title="' . __( 'Visit author homepage' ) . '">' . $plugin_data['Author'] . '</a>';
+ $plugin_data['Author'] = '<a href="' . $plugin_data['AuthorURI'] . '" title="' . esc_attr__( 'Visit author homepage' ) . '">' . $plugin_data['Author'] . '</a>';
$plugin_data['Description'] = wptexturize( $plugin_data['Description'] );
if ( ! empty($plugin_data['Author']) )
$plugin_data['Description'] .= ' <cite>' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.</cite>';
}
- $plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
-
- // Sanitize all displayed data
- $plugin_data['Title'] = wp_kses($plugin_data['Title'], $plugins_allowedtags);
- $plugin_data['Version'] = wp_kses($plugin_data['Version'], $plugins_allowedtags);
- $plugin_data['Description'] = wp_kses($plugin_data['Description'], $plugins_allowedtags);
- $plugin_data['Author'] = wp_kses($plugin_data['Author'], $plugins_allowedtags);
+ // Sanitize all displayed data. Author and AuthorName sanitized above.
+ $plugin_data['Title'] = wp_kses( $plugin_data['Title'], $plugins_allowedtags );
+ $plugin_data['Version'] = wp_kses( $plugin_data['Version'], $plugins_allowedtags );
+ $plugin_data['Description'] = wp_kses( $plugin_data['Description'], $plugins_allowedtags );
+ $plugin_data['Name'] = wp_kses( $plugin_data['Name'], $plugins_allowedtags );
return $plugin_data;
}
* be split for maintainability. Keep everything in one file for extreme
* optimization purposes.
*
- * @since unknown
+ * @since 1.5.0
*
* @param string $plugin_folder Optional. Relative path to single plugin folder.
* @return array Key is the plugin file path and the value is an array of the plugin data.
$wp_plugins[plugin_basename( $plugin_file )] = $plugin_data;
}
- uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' ));
+ uasort( $wp_plugins, '_sort_uname_callback' );
$cache_plugins[ $plugin_folder ] = $wp_plugins;
wp_cache_set('plugins', $cache_plugins, 'plugins');
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"] );' ));
+ uasort( $wp_plugins, '_sort_uname_callback' );
return $wp_plugins;
}
+/**
+ * Callback to sort array by a 'Name' key.
+ *
+ * @since 3.1.0
+ * @access private
+ */
+function _sort_uname_callback( $a, $b ) {
+ return strnatcasecmp( $a['Name'], $b['Name'] );
+}
+
/**
* Check the wp-content directory and retrieve all drop-ins with any plugin data.
*
$dropins[ $plugin_file ] = $plugin_data;
}
- uksort( $dropins, create_function( '$a, $b', 'return strnatcasecmp( $a, $b );' ));
+ uksort( $dropins, 'strnatcasecmp' );
return $dropins;
}
return in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) || is_plugin_active_for_network( $plugin );
}
+/**
+ * Check whether the plugin is inactive.
+ *
+ * Reverse of is_plugin_active(). Used as a callback.
+ *
+ * @since 3.1.0
+ * @see is_plugin_active()
+ *
+ * @param string $plugin Base plugin path from plugins directory.
+ * @return bool True if inactive. False if active.
+ */
+function is_plugin_inactive( $plugin ) {
+ return ! is_plugin_active( $plugin );
+}
+
/**
* Check whether the plugin is active for the entire network.
*
*
* @since 3.0.0
*
- * @param $file Plugin to check
- * $return bool True if plugin is network only, false otherwise.
+ * @param string $plugin 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 any errors are found or text is outputted, then it will be captured to
* ensure that the success redirection will update the error redirection.
*
- * @since unknown
+ * @since 2.5.0
*
* @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.
+ * @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.
+ * @param bool $silent Prevent calling activation hooks. Optional, default is false.
* @return WP_Error|null WP_Error on invalid file or null on success.
*/
-function activate_plugin( $plugin, $redirect = '', $network_wide = false) {
- $plugin = plugin_basename( trim( $plugin ) );
+function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silent = false ) {
+ $plugin = plugin_basename( trim( $plugin ) );
if ( is_multisite() && ( $network_wide || is_network_only_plugin($plugin) ) ) {
$network_wide = true;
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);
- do_action( 'activate_plugin', trim( $plugin) );
- do_action( 'activate_' . trim( $plugin ) );
+ include_once(WP_PLUGIN_DIR . '/' . $plugin);
+
+ if ( ! $silent ) {
+ do_action( 'activate_plugin', $plugin, $network_wide );
+ do_action( 'activate_' . $plugin, $network_wide );
+ }
+
if ( $network_wide ) {
$current[$plugin] = time();
update_site_option( 'active_sitewide_plugins', $current );
sort($current);
update_option('active_plugins', $current);
}
- do_action( 'activated_plugin', trim( $plugin) );
+
+ if ( ! $silent ) {
+ do_action( 'activated_plugin', $plugin, $network_wide );
+ }
+
if ( ob_get_length() > 0 ) {
$output = ob_get_clean();
return new WP_Error('unexpected_output', __('The plugin generated unexpected output.'), $output);
* The deactivation hook is disabled by the plugin upgrader by using the $silent
* parameter.
*
- * @since unknown
+ * @since 2.5.0
*
* @param string|array $plugins Single plugin or list of plugins to deactivate.
- * @param bool $silent Optional, default is false. Prevent calling deactivate hook.
+ * @param bool $silent Prevent calling deactivation hooks. Default is false.
*/
function deactivate_plugins( $plugins, $silent = false ) {
- $network_current = get_site_option( 'active_sitewide_plugins', array() );
+ if ( is_multisite() )
+ $network_current = get_site_option( 'active_sitewide_plugins', array() );
$current = get_option( 'active_plugins', array() );
$do_blog = $do_network = false;
foreach ( (array) $plugins as $plugin ) {
- $plugin = plugin_basename($plugin);
+ $plugin = plugin_basename( trim( $plugin ) );
if ( ! is_plugin_active($plugin) )
continue;
+
+ $network_wide = is_plugin_active_for_network( $plugin );
+
if ( ! $silent )
- do_action( 'deactivate_plugin', trim( $plugin ) );
+ do_action( 'deactivate_plugin', $plugin, $network_wide );
- if ( is_plugin_active_for_network($plugin) ) {
- // Deactivate network wide
+ if ( $network_wide ) {
$do_network = true;
unset( $network_current[ $plugin ] );
} else {
- // Deactivate for this blog only
- $key = array_search( $plugin, (array) $current );
+ $key = array_search( $plugin, $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 ) {
- do_action( 'deactivate_' . trim( $plugin ) );
- do_action( 'deactivated_plugin', trim( $plugin ) );
+ do_action( 'deactivate_' . $plugin, $network_wide );
+ do_action( 'deactivated_plugin', $plugin, $network_wide );
}
}
*
* The execution will be halted as soon as one of the plugins has an error.
*
- * @since unknown
+ * @since 2.6.0
*
* @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.
+ * @param bool $silent Prevent calling activation hooks. Default is false.
* @return bool|WP_Error True when finished or WP_Error if there were errors during a plugin activation.
*/
-function activate_plugins($plugins, $redirect = '', $network_wide) {
+function activate_plugins( $plugins, $redirect = '', $network_wide = false, $silent = false ) {
if ( !is_array($plugins) )
$plugins = array($plugins);
$errors = array();
- foreach ( (array) $plugins as $plugin ) {
+ foreach ( $plugins as $plugin ) {
if ( !empty($redirect) )
$redirect = add_query_arg('plugin', $plugin, $redirect);
- $result = activate_plugin($plugin, $redirect, $network_wide);
+ $result = activate_plugin($plugin, $redirect, $network_wide, $silent);
if ( is_wp_error($result) )
$errors[$plugin] = $result;
}
* If the plugins parameter list is empty, false will be returned. True when
* completed.
*
- * @since unknown
+ * @since 2.6.0
*
* @param array $plugins List of plugin
* @param string $redirect Redirect to page when complete.
$checked[] = 'checked[]=' . $plugin;
ob_start();
- $url = wp_nonce_url('plugins.php?action=delete-selected&verify-delete=1&' . implode('&', $checked), 'bulk-manage-plugins');
+ $url = wp_nonce_url('plugins.php?action=delete-selected&verify-delete=1&' . implode('&', $checked), 'bulk-plugins');
if ( false === ($credentials = request_filesystem_credentials($url)) ) {
$data = ob_get_contents();
ob_end_clean();
* Validate all active plugins, deactivates invalid and
* returns an array of deactivated ones.
*
- * @since unknown
+ * @since 2.5.0
* @return array invalid plugins, plugin as key, error as value
*/
function validate_active_plugins() {
*
* Checks that the file exists and {@link validate_file() is valid file}.
*
- * @since unknown
+ * @since 2.5.0
*
* @param string $plugin Plugin Path
* @return WP_Error|int 0 on success, WP_Error on failure.
* @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
+ *
+ * @return string The resulting page's hook_suffix
*/
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;
* @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
+ *
+ * @return string The resulting page's hook_suffix
*/
function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
global $_wp_last_object_menu;
* @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
+ *
+ * @return string The resulting page's hook_suffix
*/
function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
global $_wp_last_utility_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.
+ *
+ * @return string The resulting page's hook_suffix
*/
function add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
global $submenu;
/**
* 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 $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.
+ *
+ * @return string The resulting page's hook_suffix
*/
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 );
/**
* 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.
*
* @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.
+ *
+ * @return string The resulting page's hook_suffix
*/
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 );
/**
* 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.
*
* @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.
+ *
+ * @return string The resulting page's hook_suffix
*/
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.
*
* @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.
+ *
+ * @return string The resulting page's hook_suffix
*/
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 );
/**
* 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.
*
* @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.
+ *
+ * @return string The resulting page's hook_suffix
*/
function add_users_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) {
if ( current_user_can('edit_users') )
}
/**
* 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.
*
* @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.
+ *
+ * @return string The resulting page's hook_suffix
*/
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 );
/**
* 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.
*
* @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.
+ *
+ * @return string The resulting page's hook_suffix
*/
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 );
/**
* 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.
*
* @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.
+ *
+ * @return string The resulting page's hook_suffix
*/
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 );
/**
* 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.
*
* @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.
+ *
+ * @return string The resulting page's hook_suffix
*/
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 );
/**
* 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.
*
* @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.
- */
+ *
+ * @return string The resulting page's hook_suffix
+*/
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 );
}
/**
* 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.
*
* @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.
- */
+ *
+ * @return string The resulting page's hook_suffix
+*/
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 );
}
+
+/**
+ * Remove a top level admin menu
+ *
+ * @since 3.1.0
+ *
+ * @param string $menu_slug The slug of the menu
+ * @return array|bool The removed menu on success, False if not found
+ */
+function remove_menu_page( $menu_slug ) {
+ global $menu;
+
+ foreach ( $menu as $i => $item ) {
+ if ( $menu_slug == $item[2] ) {
+ unset( $menu[$i] );
+ return $item;
+ }
+ }
+
+ return false;
+}
+
+/**
+ * Remove an admin submenu
+ *
+ * @since 3.1.0
+ *
+ * @param string $menu_slug The slug for the parent menu
+ * @param string $submenu_slug The slug of the submenu
+ * @return array|bool The removed submenu on success, False if not found
+ */
+function remove_submenu_page( $menu_slug, $submenu_slug ) {
+ global $submenu;
+
+ if ( !isset( $submenu[$menu_slug] ) )
+ return false;
+
+ foreach ( $submenu[$menu_slug] as $i => $item ) {
+ if ( $submenu_slug == $item[2] ) {
+ unset( $submenu[$menu_slug][$i] );
+ return $item;
+ }
+ }
+
+ return false;
+}
+
/**
* Get the url to access a particular menu page based on the slug it was registered with.
*
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] ) );
+ $parent_slug = $_parent_pages[$menu_slug];
+ if ( $parent_slug && ! isset( $_parent_pages[$parent_slug] ) ) {
+ $url = admin_url( add_query_arg( 'page', $menu_slug, $parent_slug ) );
} else {
- $url = admin_url('admin.php?page=' . $menu_slug);
+ $url = admin_url( 'admin.php?page=' . $menu_slug );
}
} else {
$url = '';
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.7.0
*
* @param unknown_type $options
* @return unknown
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.7.0
*
* @param unknown_type $new_options
* @param unknown_type $options
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.7.0
*
* @param unknown_type $del_options
* @param unknown_type $options
* @since 2.6.0
*
* @param bool $update Are we updating a pre-existing post?
- * @param post_data array Array of post data. Defaults to the contents of $_POST.
+ * @param array $post_data Array of post data. Defaults to the contents of $_POST.
* @return object|bool WP_Error on failure, true on success.
*/
function _wp_translate_postdata( $update = false, $post_data = null ) {
/**
* Update an existing post with values provided in $_POST.
*
- * @since unknown
+ * @since 1.5.0
*
* @param array $post_data Optional.
* @return int Post ID.
$post_data = &$_POST;
$post_ID = (int) $post_data['post_ID'];
+ $post = get_post( $post_ID );
+ $post_data['post_type'] = $post->post_type;
$ptype = get_post_type_object($post_data['post_type']);
if ( !current_user_can( $ptype->cap->edit_post, $post_ID ) ) {
}
$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() );
+ if ( 'autosave' != $post_data['action'] && 'auto-draft' == $post_data['post_status'] )
+ $post_data['post_status'] = 'draft';
if ( isset($post_data['visibility']) ) {
switch ( $post_data['visibility'] ) {
}
}
+ // Post Formats
+ if ( current_theme_supports( 'post-formats' ) && isset( $post_data['post_format'] ) ) {
+ $formats = get_theme_support( 'post-formats' );
+ if ( is_array( $formats ) ) {
+ $formats = $formats[0];
+ if ( in_array( $post_data['post_format'], $formats ) ) {
+ set_post_format( $post_ID, $post_data['post_format'] );
+ } elseif ( '0' == $post_data['post_format'] ) {
+ set_post_format( $post_ID, false );
+ }
+ }
+ }
+
// Meta Stuff
if ( isset($post_data['meta']) && $post_data['meta'] ) {
- foreach ( $post_data['meta'] as $key => $value )
+ foreach ( $post_data['meta'] as $key => $value ) {
+ if ( !$meta = get_post_meta_by_id( $key ) )
+ continue;
+ if ( $meta->post_id != $post_ID )
+ continue;
update_meta( $key, $value['key'], $value['value'] );
+ }
}
if ( isset($post_data['deletemeta']) && $post_data['deletemeta'] ) {
- foreach ( $post_data['deletemeta'] as $key => $value )
+ foreach ( $post_data['deletemeta'] as $key => $value ) {
+ if ( !$meta = get_post_meta_by_id( $key ) )
+ continue;
+ if ( $meta->post_id != $post_ID )
+ continue;
delete_meta( $key );
+ }
}
add_meta( $post_ID );
wp_set_post_lock( $post_ID, $GLOBALS['current_user']->ID );
- if ( current_user_can( 'edit_others_posts' ) ) {
- if ( !empty($post_data['sticky']) )
- stick_post($post_ID);
+ if ( current_user_can( $ptype->cap->edit_others_posts ) ) {
+ if ( ! empty( $post_data['sticky'] ) )
+ stick_post( $post_ID );
else
- unstick_post($post_ID);
+ unstick_post( $post_ID );
}
return $post_ID;
$post_data['ID'] = $post_ID;
$updated[] = wp_update_post( $post_data );
- if ( isset( $post_data['sticky'] ) && current_user_can( 'edit_others_posts' ) ) {
+ if ( isset( $post_data['sticky'] ) && current_user_can( $ptype->cap->edit_others_posts ) ) {
if ( 'sticky' == $post_data['sticky'] )
stick_post( $post_ID );
else
/**
* Default post information to use when populating the "Write Post" form.
*
- * @since unknown
+ * @since 2.0.0
*
- *@param string A post type string, defaults to 'post'.
+ * @param string $post_type 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( $post_type = 'post', $create_in_db = false ) {
wp_delete_post( $delete, true ); // Force delete
$post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) );
$post = get_post( $post_id );
+ if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) )
+ set_post_format( $post, get_option( 'default_post_format' ) );
} else {
$post->ID = 0;
$post->post_author = '';
/**
* Get an existing post and format it for editing.
*
- * @since unknown
+ * @since 2.0.0
*
* @param unknown_type $id
* @return unknown
/**
* Determine if a post exists based on title, content, and date
*
- * @since unknown
+ * @since 2.0.0
*
* @param string $title Post title
* @param string $content Optional post content
/**
* Creates a new post from the "Write Post" form using $_POST information.
*
- * @since unknown
+ * @since 2.1.0
*
* @return unknown
*/
/**
* Calls wp_write_post() and handles the errors.
*
- * @since unknown
+ * @since 2.0.0
*
* @return unknown
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.2.0
*
* @param unknown_type $post_ID
* @return unknown
wp_cache_delete($post_ID, 'post_meta');
$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 );
+ $meta_id = $wpdb->insert_id;
+ do_action( 'added_postmeta', $meta_id, $post_ID, $metakey, $metavalue );
- return $wpdb->insert_id;
+ return $meta_id;
}
return false;
} // add_meta
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.2.0
*
* @param unknown_type $mid
* @return unknown
/**
* Get a list of previously defined keys.
*
- * @since unknown
+ * @since 1.2.0
*
* @return unknown
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.1.0
*
* @param unknown_type $mid
* @return unknown
*
* Some postmeta stuff.
*
- * @since unknown
+ * @since 1.2.0
*
* @param unknown_type $postid
* @return unknown
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.2.0
*
* @param unknown_type $meta_id
* @param unknown_type $meta_key Expect Slashed
/**
* Replace hrefs of attachment anchors with up-to-date permalinks.
*
- * @since unknown
+ * @since 2.3.0
* @access private
*
* @param unknown_type $post_ID
/**
* Move child posts to a new parent.
*
- * @since unknown
+ * @since 2.3.0
* @access private
*
* @param unknown_type $old_ID
$perm = 'readable';
}
- if ( isset($q['post_status']) && 'pending' === $q['post_status'] ) {
- $order = 'ASC';
- $orderby = 'modified';
- } elseif ( isset($q['post_status']) && 'draft' === $q['post_status'] ) {
- $order = 'DESC';
+ if ( isset($q['orderby']) )
+ $orderby = $q['orderby'];
+ elseif ( isset($q['post_status']) && in_array($q['post_status'], array('pending', 'draft')) )
$orderby = 'modified';
- } else {
- $order = 'DESC';
- $orderby = 'date';
- }
+
+ if ( isset($q['order']) )
+ $order = $q['order'];
+ elseif ( isset($q['post_status']) && 'pending' == $q['post_status'] )
+ $order = 'ASC';
$per_page = 'edit_' . $post_type . '_per_page';
$posts_per_page = (int) get_user_option( $per_page );
$query = compact('post_type', 'post_status', 'perm', 'order', 'orderby', 'posts_per_page');
// Hierarchical types require special args.
- if ( is_post_type_hierarchical( $post_type ) ) {
+ if ( is_post_type_hierarchical( $post_type ) && !isset($orderby) ) {
$query['orderby'] = 'menu_order title';
$query['order'] = 'asc';
$query['posts_per_page'] = -1;
$query['posts_per_archive_page'] = -1;
}
+ if ( ! empty( $q['show_sticky'] ) )
+ $query['post__in'] = (array) get_option( 'sticky_posts' );
+
wp( $query );
return $avail_post_stati;
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $type
* @return unknown
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $q
* @return unknown
if ( isset($q['post_mime_type']) && !array_intersect( (array) $q['post_mime_type'], array_keys($post_mime_types) ) )
unset($q['post_mime_type']);
- wp($q);
+ if ( isset($q['detached']) )
+ add_filter('posts_where', '_edit_attachments_query_helper');
+
+ wp( $q );
+
+ if ( isset($q['detached']) )
+ remove_filter('posts_where', '_edit_attachments_query_helper');
return array($post_mime_types, $avail_post_mime_types);
}
+function _edit_attachments_query_helper($where) {
+ return $where .= ' AND post_parent < 1';
+}
+
/**
* {@internal Missing Short Description}}
*
* @uses get_user_option()
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $id
* @param unknown_type $page
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param int|object $id Post ID or post object.
* @param string $title (optional) Title
$uri = untrailingslashit($uri);
if ( !empty($uri) )
$uri .= '/';
- $permalink = str_replace('%pagename%', "${uri}%pagename%", $permalink);
+ $permalink = str_replace('%pagename%', "{$uri}%pagename%", $permalink);
}
$permalink = array($permalink, apply_filters('editable_slug', $post->post_name));
*
* intended to be used for the inplace editor of the permalink post slug on in the post (and page?) editor.
*
- * @since unknown
+ * @since 2.5.0
*
* @param int|object $id Post ID or post object.
* @param string $new_title (optional) New title
if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) {
$return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $permalink . "</span>\n";
- if ( current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) )
+ if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) )
$return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
if ( isset($view_post) )
$return .= "<span id='view-post-btn'><a href='$permalink' class='button' target='_blank'>$view_post</a></span>\n";
if ( !$post = get_post( $post_id ) )
return false;
- $lock = get_post_meta( $post->ID, '_edit_lock', true );
- $last = get_post_meta( $post->ID, '_edit_last', true );
+ if ( !$lock = get_post_meta( $post->ID, '_edit_lock', true ) )
+ return false;
+
+ $lock = explode( ':', $lock );
+ $time = $lock[0];
+ $user = isset( $lock[1] ) ? $lock[1] : get_post_meta( $post->ID, '_edit_last', true );
$time_window = apply_filters( 'wp_check_post_lock_window', AUTOSAVE_INTERVAL * 2 );
- if ( $lock && $lock > time() - $time_window && $last != get_current_user_id() )
- return $last;
+ if ( $time && $time > time() - $time_window && $user != get_current_user_id() )
+ return $user;
return false;
}
function wp_set_post_lock( $post_id ) {
if ( !$post = get_post( $post_id ) )
return false;
- if ( 0 == get_current_user_id() )
+ if ( 0 == ($user_id = get_current_user_id()) )
return false;
$now = time();
+ $lock = "$now:$user_id";
- update_post_meta( $post->ID, '_edit_lock', $now );
+ update_post_meta( $post->ID, '_edit_lock', $lock );
}
/**
*/
function _admin_notice_post_locked() {
global $post;
- $last_user = get_userdata( get_post_meta( $post->ID, '_edit_last', true ) );
+
+ $lock = explode( ':', get_post_meta( $post->ID, '_edit_lock', true ) );
+ $user = isset( $lock[1] ) ? $lock[1] : get_post_meta( $post->ID, '_edit_last', true );
+ $last_user = get_userdata( $user );
$last_user_name = $last_user ? $last_user->display_name : __('Somebody');
switch ($post->post_type) {
$mce_spellchecker_languages = apply_filters('mce_spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv');
if ( $teeny ) {
- $plugins = apply_filters( 'teeny_mce_plugins', array('safari', 'inlinepopups', 'media', 'fullscreen', 'wordpress') );
+ $plugins = apply_filters( 'teeny_mce_plugins', array('inlinepopups', 'fullscreen', 'wordpress', 'wplink', 'wpdialogs') );
$ext_plugins = '';
} else {
- $plugins = array( 'safari', 'inlinepopups', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage', 'wpgallery', 'tabfocus' );
+ $plugins = array( 'inlinepopups', 'spellchecker', 'paste', 'wordpress', 'fullscreen', 'wpeditimage', 'wpgallery', 'tabfocus', 'wplink', 'wpdialogs' );
/*
The following filter takes an associative array of external plugins for TinyMCE in the form 'plugin_name' => 'url'.
}
}
- $plugins = implode($plugins, ',');
-
if ( $teeny ) {
$mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold, italic, underline, blockquote, separator, strikethrough, bullist, numlist,justifyleft, justifycenter, justifyright, undo, redo, link, unlink, fullscreen') );
$mce_buttons = implode($mce_buttons, ',');
$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 = 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 = array( 'formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' );
$mce_buttons_2 = apply_filters('mce_buttons_2', $mce_buttons_2);
$mce_buttons_2 = implode($mce_buttons_2, ',');
'theme_advanced_resizing' => true,
'theme_advanced_resize_horizontal' => false,
'dialog_type' => 'modal',
+ 'formats' => "{
+ alignleft : [
+ {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}},
+ {selector : 'img,table', classes : 'alignleft'}
+ ],
+ aligncenter : [
+ {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}},
+ {selector : 'img,table', classes : 'aligncenter'}
+ ],
+ alignright : [
+ {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}},
+ {selector : 'img,table', classes : 'alignright'}
+ ],
+ strikethrough : {inline : 'del'}
+ }",
'relative_urls' => false,
'remove_script_host' => false,
'convert_urls' => false,
'paste_remove_styles' => true,
'paste_remove_spans' => true,
'paste_strip_class_attributes' => 'all',
+ 'paste_text_use_dialog' => true,
'wpeditimage_disable_captions' => $no_captions,
- 'plugins' => $plugins
+ 'plugins' => implode( ',', $plugins ),
);
if ( ! empty( $editor_styles ) && is_array( $editor_styles ) ) {
$mce_css = array();
$style_uri = get_stylesheet_directory_uri();
- if ( TEMPLATEPATH == STYLESHEETPATH ) {
+ if ( ! is_child_theme() ) {
foreach ( $editor_styles as $file )
$mce_css[] = "$style_uri/$file";
} else {
$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";
+ if ( file_exists( "$style_dir/$file" ) )
+ $mce_css[] = "$style_uri/$file";
}
}
$mce_css = implode( ',', $mce_css );
include_once(ABSPATH . WPINC . '/js/tinymce/langs/wp-langs.php');
$mce_options = '';
- foreach ( $initArray as $k => $v )
- $mce_options .= $k . ':"' . $v . '", ';
+ foreach ( $initArray as $k => $v ) {
+ if ( is_bool($v) ) {
+ $val = $v ? 'true' : 'false';
+ $mce_options .= $k . ':' . $val . ', ';
+ continue;
+ } elseif ( !empty($v) && is_string($v) && ( '{' == $v{0} || '[' == $v{0} ) ) {
+ $mce_options .= $k . ':' . $v . ', ';
+ continue;
+ }
+
+ $mce_options .= $k . ':"' . $v . '", ';
+ }
$mce_options = rtrim( trim($mce_options), '\n\r,' ); ?>
<script type="text/javascript">
/* <![CDATA[ */
-<?php if ( $ext_plugins ) echo "$ext_plugins\n"; ?>
-<?php if ( $compressed ) { ?>
-tinyMCEPreInit.go();
-<?php } else { ?>
+<?php
+ if ( $ext_plugins )
+ echo "$ext_plugins\n";
+
+ if ( ! $compressed ) {
+?>
(function(){var t=tinyMCEPreInit,sl=tinymce.ScriptLoader,ln=t.mceInit.language,th=t.mceInit.theme,pl=t.mceInit.plugins;sl.markDone(t.base+'/langs/'+ln+'.js');sl.markDone(t.base+'/themes/'+th+'/langs/'+ln+'.js');sl.markDone(t.base+'/themes/'+th+'/langs/'+ln+'_dlg.js');tinymce.each(pl.split(','),function(n){if(n&&n.charAt(0)!='-'){sl.markDone(t.base+'/plugins/'+n+'/langs/'+ln+'.js');sl.markDone(t.base+'/plugins/'+n+'/langs/'+ln+'_dlg.js');}});})();
<?php } ?>
tinyMCE.init(tinyMCEPreInit.mceInit);
/* ]]> */
</script>
<?php
+
+ // Load additional inline scripts based on active plugins.
+ if ( in_array( 'wpdialogs', $plugins ) ) {
+ wp_print_scripts( array( 'wpdialogs-popup' ) );
+ wp_print_styles('wp-jquery-ui-dialog');
+ }
+ if ( in_array( 'wplink', $plugins ) ) {
+ require_once ABSPATH . 'wp-admin/includes/internal-linking.php';
+ add_action('tiny_mce_preload_dialogs', 'wp_link_dialog');
+ wp_print_scripts('wplink');
+ wp_print_styles('wplink');
+ }
}
+function wp_tiny_mce_preload_dialogs() { ?>
+ <div id="preloaded-dialogs" style="display:none;">
+<?php do_action('tiny_mce_preload_dialogs'); ?>
+ </div>
+<?php }
\ No newline at end of file
'default_comment_status' => 'open',
'default_ping_status' => 'open',
'default_pingback_flag' => 1,
- 'default_post_edit_rows' => 10,
+ 'default_post_edit_rows' => 20,
'posts_per_page' => 10,
/* translators: default date format, see http://php.net/date */
'date_format' => __('F j, Y'),
// 3.0
'page_for_posts' => 0,
'page_on_front' => 0,
+
+ // 3.1
+ 'default_post_format' => 0,
);
// 3.0 multisite
if ( !__get_option('home') ) update_option('home', $guessurl);
// 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', 'secret', 'use_linksupdate', 'default_comment_status_page' );
- foreach ($unusedoptions as $option)
+ $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', 'secret', 'use_linksupdate', 'default_comment_status_page', 'wporg_popular_tags', 'what_to_show');
+ foreach ( $unusedoptions as $option )
delete_option($option);
// delete obsolete magpie stuff
if ( !is_multisite() ) {
$site_admins = array( $site_user->user_login );
- $users = get_users_of_blog();
+ $users = get_users( array( 'fields' => array( 'ID', 'user_login' ) ) );
if ( $users ) {
foreach ( $users as $user ) {
if ( is_super_admin( $user->ID ) && !in_array( $user->user_login, $site_admins ) )
'subdomain_install' => intval( $subdomain_install ),
'global_terms_enabled' => global_terms_enabled() ? '1' : '0'
);
- if ( !intval( $subdomain_install ) )
+ if ( ! $subdomain_install )
$sitemeta['illegal_names'][] = 'blog';
$insert = '';
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.0.0
*
* @param unknown_type $cat_name
* @return unknown
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.0.0
*
* @param unknown_type $id
* @return unknown
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.0.0
*
* @param unknown_type $cat_name
* @param unknown_type $parent
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.0.0
*
* @param unknown_type $categories
* @param unknown_type $post_id
return $cat_ids;
}
-/**
- * Deletes one existing category.
- *
- * @since 2.0.0
- *
- * @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;
- $default = get_option('default_category');
-
- // Don't delete the default cat
- if ( $cat_ID == $default )
- return 0;
-
- return wp_delete_term($cat_ID, 'category', array('default' => $default));
-}
-
/**
* Updates an existing Category or creates a new Category.
*
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.3.0
+ *
+ * @param unknown_type $tag_name
+ * @return unknown
+ */
+function tag_exists($tag_name) {
+ return term_exists($tag_name, 'post_tag');
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since 2.3.0
+ *
+ * @param unknown_type $tag_name
+ * @return unknown
+ */
+function wp_create_tag($tag_name) {
+ return wp_create_term( $tag_name, 'post_tag');
+}
+
+/**
+ * {@internal Missing Short Description}}
+ *
+ * @since 2.3.0
*
* @param unknown_type $post_id
* @return unknown
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.8.0
*
* @param unknown_type $post_id
* @return unknown
/**
* {@internal Missing Short Description}}
*
- * @since unknown
- *
- * @param unknown_type $tag_name
- * @return unknown
- */
-function tag_exists($tag_name) {
- return term_exists($tag_name, 'post_tag');
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $tag_name
- * @return unknown
- */
-function wp_create_tag($tag_name) {
- return wp_create_term( $tag_name, 'post_tag');
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
+ * @since 2.8.0
*
* @param unknown_type $tag_name
* @return unknown
* @subpackage Administration
*/
-/**
- * {@internal Missing Short Description}}
- *
- * @since 2.7
- *
- * Outputs the HTML for the hidden table rows used in Categories, Link Categories and Tags quick edit.
- *
- * @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, $taxonomy) {
-
- $tax = get_taxonomy($taxonomy);
- if ( ! current_user_can( $tax->cap->edit_terms ) )
- return;
-
- $columns = get_column_headers($type);
- $hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($type) ) );
- $col_count = count($columns) - count($hidden);
- ?>
-
-<form method="get" action=""><table style="display: none"><tbody id="inlineedit">
- <tr id="inline-edit" class="inline-edit-row" style="display: none"><td colspan="<?php echo $col_count; ?>">
-
- <fieldset><div class="inline-edit-col">
- <h4><?php _e( 'Quick Edit' ); ?></h4>
-
- <label>
- <span class="title"><?php _e( 'Name' ); ?></span>
- <span class="input-text-wrap"><input type="text" name="name" class="ptitle" value="" /></span>
- </label>
-<?php if ( !is_multisite() ) { ?>
- <label>
- <span class="title"><?php _e( 'Slug' ); ?></span>
- <span class="input-text-wrap"><input type="text" name="slug" class="ptitle" value="" /></span>
- </label>
-<?php } ?>
-
- </div></fieldset>
-
-<?php
-
- $core_columns = array( 'cb' => true, 'description' => true, 'name' => true, 'slug' => true, 'posts' => true );
-
- foreach ( $columns as $column_name => $column_display_name ) {
- if ( isset( $core_columns[$column_name] ) )
- continue;
- do_action( 'quick_edit_custom_box', $column_name, $type, $taxonomy );
- }
-
-?>
-
- <p class="inline-edit-save submit">
- <a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="cancel button-secondary alignleft"><?php _e('Cancel'); ?></a>
- <?php $update_text = $tax->labels->update_item; ?>
- <a accesskey="s" href="#inline-edit" title="<?php echo esc_attr( $update_text ); ?>" class="save button-primary alignright"><?php echo $update_text; ?></a>
- <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
- <span class="error" style="display:none;"></span>
- <?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>
- <input type="hidden" name="taxonomy" value="<?php echo esc_attr( $tax->name ); ?>" />
- <br class="clear" />
- </p>
- </td></tr>
- </tbody></table></form>
-<?php
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $category
- * @param unknown_type $name_override
- * @return unknown
- */
-function link_cat_row( $category, $name_override = false ) {
- static $row_class = '';
-
- if ( !$category = get_term( $category, 'link_category', OBJECT, 'display' ) )
- return false;
- if ( is_wp_error( $category ) )
- return $category;
-
- $default_cat_id = (int) get_option( 'default_link_category' );
- $name = ( $name_override ? $name_override : $category->name );
- $edit_link = "link-category.php?action=edit&cat_ID=$category->term_id";
- if ( current_user_can( 'manage_categories' ) ) {
- $edit = "<a class='row-title' href='$edit_link' title='" . esc_attr(sprintf(__('Edit “%s”'), $category->name)) . "'>$name</a><br />";
- $actions = array();
- $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
- $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
- if ( $default_cat_id != $category->term_id )
- $actions['delete'] = "<a class='delete:the-list:link-cat-$category->term_id submitdelete' href='" . wp_nonce_url("link-category.php?action=delete&cat_ID=$category->term_id", 'delete-link-category_' . $category->term_id) . "'>" . __('Delete') . "</a>";
- $actions = apply_filters('link_cat_row_actions', $actions, $category);
- $action_count = count($actions);
- $i = 0;
- $edit .= '<div class="row-actions">';
- foreach ( $actions as $action => $link ) {
- ++$i;
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
- $edit .= "<span class='$action'>$link$sep</span>";
- }
- $edit .= '</div>';
- } else {
- $edit = $name;
- }
-
- $row_class = 'alternate' == $row_class ? '' : 'alternate';
- $qe_data = get_term_to_edit($category->term_id, 'link_category');
-
- $category->count = number_format_i18n( $category->count );
- $count = ( $category->count > 0 ) ? "<a href='link-manager.php?cat_id=$category->term_id'>$category->count</a>" : $category->count;
- $output = "<tr id='link-cat-$category->term_id' class='iedit $row_class'>";
- $columns = get_column_headers('edit-link-categories');
- $hidden = get_hidden_columns('edit-link-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 .= "<th scope='row' class='check-column'>";
- if ( absint( get_option( 'default_link_category' ) ) != $category->term_id ) {
- $output .= "<input type='checkbox' name='delete[]' value='$category->term_id' />";
- } else {
- $output .= " ";
- }
- $output .= "</th>";
- break;
- case 'name':
- $output .= "<td $attributes>$edit";
- $output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
- $output .= '<div class="name">' . $qe_data->name . '</div>';
- $output .= '<div class="slug">' . apply_filters('editable_slug', $qe_data->slug) . '</div>';
- $output .= '<div class="cat_parent">' . $qe_data->parent . '</div></div></td>';
- break;
- case 'description':
- $output .= "<td $attributes>$category->description</td>";
- break;
- case 'slug':
- $output .= "<td $attributes>" . apply_filters('editable_slug', $category->slug) . "</td>";
- break;
- case 'links':
- $attributes = 'class="links column-links num"' . $style;
- $output .= "<td $attributes>$count</td>";
- break;
- default:
- $output .= "<td $attributes>";
- $output .= apply_filters('manage_link_categories_custom_column', '', $column_name, $category->term_id);
- $output .= "</td>";
- }
- }
- $output .= '</tr>';
-
- return $output;
-}
//
// Category Checklists
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.1
*/
class Walker_Category_Checklist extends Walker {
var $tree_type = 'category';
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.1
*
* @param unknown_type $post_id
* @param unknown_type $descendants_and_self
/**
* Taxonomy independent version of wp_category_checklist
*
+ * @since 3.0.0
+ *
* @param int $post_id
* @param array $args
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $taxonomy
* @param unknown_type $default
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.1
*
* @param unknown_type $link_id
*/
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 ) ? ' checked="checked"' : '';
- echo '<li id="link-category-', $cat_id, '"><label for="in-link-category-', $cat_id, '" class="selectit"><input value="', $cat_id, '" type="checkbox" name="link_category[]" id="in-link-category-', $cat_id, '"', $checked, '/> ', $name, "</label></li>";
- }
-}
-
-// Tag stuff
-
-// Returns a single tag row (see tag_rows below)
-// Note: this is also used in admin-ajax.php!
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $tag
- * @param unknown_type $class
- * @return unknown
- */
-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 );
- $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;
- }
-
- $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&post_type=$post_type&tag_ID=$tag->term_id";
-
- $out = '';
- $out .= '<tr id="tag-' . $tag->term_id . '"' . $row_class . '>';
-
-
- $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\"";
-
- $style = '';
- if ( in_array($column_name, $hidden) )
- $style = ' style="display:none;"';
-
- $attributes = "$class$style";
-
- switch ($column_name) {
- case 'cb':
- if ( current_user_can($tax->cap->delete_terms) && $tag->term_id != $default_term )
- $out .= '<th scope="row" class="check-column"> <input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" /></th>';
- else
- $out .= '<th scope="row" class="check-column"> </th>';
- break;
- case 'name':
- $out .= '<td ' . $attributes . '><strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf(__('Edit “%s”'), $name)) . '">' . $name . '</a></strong><br />';
- $actions = array();
- if ( current_user_can($tax->cap->edit_terms) ) {
- $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
- $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
- }
- if ( current_user_can($tax->cap->delete_terms) && $tag->term_id != $default_term )
- $actions['delete'] = "<a class='delete-tag' href='" . wp_nonce_url("edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id) . "'>" . __('Delete') . "</a>";
-
- $actions = apply_filters('tag_row_actions', $actions, $tag);
- $actions = apply_filters("${taxonomy}_row_actions", $actions, $tag);
-
- $action_count = count($actions);
- $i = 0;
- $out .= '<div class="row-actions">';
- foreach ( $actions as $action => $link ) {
- ++$i;
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
- $out .= "<span class='$action'>$link$sep</span>";
- }
- $out .= '</div>';
- $out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
- $out .= '<div class="name">' . $qe_data->name . '</div>';
- $out .= '<div class="slug">' . apply_filters('editable_slug', $qe_data->slug) . '</div>';
- $out .= '<div class="parent">' . $qe_data->parent . '</div></div></td>';
- break;
- case 'description':
- $out .= "<td $attributes>$tag->description</td>";
- break;
- case 'slug':
- $out .= "<td $attributes>" . apply_filters('editable_slug', $tag->slug) . "</td>";
- break;
- case 'posts':
- $attributes = 'class="posts column-posts num"' . $style;
- $out .= "<td $attributes><a href='edit.php?$tagsel=$tag->slug&post_type=$post_type'>$count</a></td>";
- break;
- default:
- $out .= "<td $attributes>";
- $out .= apply_filters("manage_${taxonomy}_custom_column", '', $column_name, $tag->term_id);
- $out .= "</td>";
- }
- }
-
- $out .= "</tr>\n";
-
- return $out;
-}
-
-// Outputs appropriate rows for the Nth page of the Tag Management screen,
-// assuming M tags displayed at a time on the page
-// Returns the number of tags displayed
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $page
- * @param unknown_type $pagesize
- * @param unknown_type $searchterms
- * @return unknown
- */
-function tag_rows( $page = 1, $pagesize = 20, $searchterms = '', $taxonomy = 'post_tag' ) {
-
- // Get a page worth of tags
- $start = ($page - 1) * $pagesize;
-
- $args = array('offset' => $start, 'number' => $pagesize, 'hide_empty' => 0);
-
- if ( !empty( $searchterms ) )
- $args['search'] = $searchterms;
-
- // convert it to table rows
- $out = '';
- $count = 0;
- 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.
- }
-
- 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}}
- *
- * @since unknown
- *
- * @return unknown
- */
-function wp_manage_posts_columns( $screen = '') {
- if ( empty($screen) )
- $post_type = 'post';
- else
- $post_type = $screen->post_type;
-
- $posts_columns = array();
- $posts_columns['cb'] = '<input type="checkbox" />';
- /* translators: manage posts column name */
- $posts_columns['title'] = _x('Title', 'column name');
- $posts_columns['author'] = __('Author');
- 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') ) && ( empty($post_type) || post_type_supports($post_type, 'comments') ) )
- $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>';
- $posts_columns['date'] = __('Date');
-
- 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;
-}
-
-// define the columns to display, the syntax is 'internal name' => 'display name'
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @return unknown
- */
-function wp_manage_media_columns() {
- $posts_columns = array();
- $posts_columns['cb'] = '<input type="checkbox" />';
- $posts_columns['icon'] = '';
- /* translators: column name */
- $posts_columns['media'] = _x('File', 'column name');
- $posts_columns['author'] = __('Author');
- //$posts_columns['tags'] = _x('Tags', 'column name');
- /* translators: column name */
- $posts_columns['parent'] = _x('Attached to', 'column name');
- $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>';
- //$posts_columns['comments'] = __('Comments');
- /* translators: column name */
- $posts_columns['date'] = _x('Date', 'column name');
- $posts_columns = apply_filters('manage_media_columns', $posts_columns);
-
- return $posts_columns;
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @return unknown
- */
-function wp_manage_pages_columns() {
- return wp_manage_posts_columns();
-}
-
-/**
- * Get the column headers for a screen
- *
- * @since 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($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[$screen->id]) )
- return $_wp_column_headers[$screen->id];
-
- switch ($screen->base) {
- case 'edit':
- $_wp_column_headers[$screen->id] = wp_manage_posts_columns( $screen );
- break;
- case 'edit-comments':
- $_wp_column_headers[$screen->id] = array(
- 'cb' => '<input type="checkbox" />',
- 'author' => __('Author'),
- /* translators: column name */
- 'comment' => _x('Comment', 'column name'),
- //'date' => __('Submitted'),
- 'response' => __('In Response To')
- );
-
- break;
- case 'link-manager':
- $_wp_column_headers[$screen->id] = array(
- 'cb' => '<input type="checkbox" />',
- 'name' => __('Name'),
- 'url' => __('URL'),
- 'categories' => __('Categories'),
- 'rel' => __('Relationship'),
- 'visible' => __('Visible'),
- 'rating' => __('Rating')
- );
-
- break;
- case 'upload':
- $_wp_column_headers[$screen->id] = wp_manage_media_columns();
- break;
- case 'categories':
- $_wp_column_headers[$screen->id] = array(
- 'cb' => '<input type="checkbox" />',
- 'name' => __('Name'),
- 'description' => __('Description'),
- 'slug' => __('Slug'),
- 'posts' => __('Posts')
- );
-
- break;
- case 'edit-link-categories':
- $_wp_column_headers[$screen->id] = array(
- 'cb' => '<input type="checkbox" />',
- 'name' => __('Name'),
- 'description' => __('Description'),
- 'slug' => __('Slug'),
- 'links' => __('Links')
- );
-
- break;
- case 'edit-tags':
- $_wp_column_headers[$screen->id] = array(
- 'cb' => '<input type="checkbox" />',
- 'name' => __('Name'),
- 'description' => __('Description'),
- 'slug' => __('Slug'),
- 'posts' => __('Posts')
- );
-
- break;
- case 'users':
- $_wp_column_headers[$screen->id] = array(
- 'cb' => '<input type="checkbox" />',
- 'username' => __('Username'),
- 'name' => __('Name'),
- 'email' => __('E-mail'),
- 'role' => __('Role'),
- 'posts' => __('Posts')
- );
- break;
- default :
- $_wp_column_headers[$screen->id] = array();
- }
-
- $_wp_column_headers[$screen->id] = apply_filters('manage_' . $screen->id . '_columns', $_wp_column_headers[$screen->id]);
- return $_wp_column_headers[$screen->id];
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $screen
- * @param unknown_type $id
- */
-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();
-
- foreach ( $columns as $column_key => $column_display_name ) {
- $class = ' class="manage-column';
-
- $class .= " column-$column_key";
-
- if ( 'cb' == $column_key )
- $class .= ' check-column';
- elseif ( in_array($column_key, array('posts', 'comments', 'links')) )
- $class .= ' num';
-
- $class .= '"';
-
- $style = '';
- if ( in_array($column_key, $hidden) )
- $style = 'display:none;';
-
- if ( isset($styles[$screen->id]) && isset($styles[$screen->id][$column_key]) )
- $style .= ' ' . $styles[$screen>id][$column_key];
- $style = ' style="' . $style . '"';
-?>
- <th scope="col" <?php echo $id ? "id=\"$column_key\"" : ""; echo $class; echo $style; ?>><?php echo $column_display_name; ?></th>
-<?php }
-}
-
-/**
- * Register column headers for a particular screen. The header names will be listed in the Screen Options.
- *
- * @since 2.7.0
- *
- * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
- * @param array $columns An array of columns with column IDs as the keys and translated column names as the values
- * @see get_column_headers(), print_column_headers(), get_hidden_columns()
- */
-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->id] = $columns;
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $screen
- */
-function get_hidden_columns($screen) {
- if ( is_string($screen) )
- $screen = convert_to_screen($screen);
-
- return (array) get_user_option( 'manage' . $screen->id. 'columnshidden' );
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * Outputs the quick edit and bulk edit table rows for posts and pages
- *
- * @since 2.7
- *
- * @param string $screen
- */
-function inline_edit_row( $screen ) {
- global $mode;
-
- 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 = 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($post_type_object->cap->publish_posts);
- $core_columns = array( 'cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true );
-
-?>
-
-<form method="get" action=""><table style="display: none"><tbody id="inlineedit">
- <?php
- $hclass = count( $hierarchical_taxonomies ) ? 'post' : 'page';
- $bulk = 0;
- while ( $bulk < 2 ) { ?>
-
- <tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="inline-edit-row inline-edit-row-<?php echo "$hclass inline-edit-$screen->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"><td colspan="<?php echo $col_count; ?>">
-
- <fieldset class="inline-edit-col-left"><div class="inline-edit-col">
- <h4><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></h4>
-
-
-<?php
-
-if ( post_type_supports( $screen->post_type, 'title' ) ) :
- if ( $bulk ) : ?>
- <div id="bulk-title-div">
- <div id="bulk-titles"></div>
- </div>
-
-<?php else : // $bulk ?>
-
- <label>
- <span class="title"><?php _e( 'Title' ); ?></span>
- <span class="input-text-wrap"><input type="text" name="post_title" class="ptitle" value="" /></span>
- </label>
-
- <label>
- <span class="title"><?php _e( 'Slug' ); ?></span>
- <span class="input-text-wrap"><input type="text" name="post_name" value="" /></span>
- </label>
-
-<?php endif; // $bulk
-endif; // post_type_supports title ?>
-
-<?php if ( !$bulk ) : ?>
- <label><span class="title"><?php _e( 'Date' ); ?></span></label>
- <div class="inline-edit-date">
- <?php touch_time(1, 1, 4, 1); ?>
- </div>
- <br class="clear" />
-
-<?php endif; // $bulk
-
- if ( post_type_supports( $screen->post_type, 'author' ) ) :
- $authors = get_editable_user_ids( get_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 —');
- $authors_dropdown = '<label>';
- $authors_dropdown .= '<span class="title">' . __( 'Author' ) . '</span>';
- $authors_dropdown .= wp_dropdown_users( $users_opt );
- $authors_dropdown .= '</label>';
-
- endif; // authors
-?>
-
-<?php if ( !$bulk ) echo $authors_dropdown;
-endif; // post_type_supports author
-
-if ( !$bulk ) :
-?>
-
- <div class="inline-edit-group">
- <label class="alignleft">
- <span class="title"><?php _e( 'Password' ); ?></span>
- <span class="input-text-wrap"><input type="text" name="post_password" class="inline-edit-password-input" value="" /></span>
- </label>
-
- <em style="margin:5px 10px 0 0" class="alignleft">
- <?php
- /* translators: Between password field and private checkbox on post quick edit interface */
- echo __( '–OR–' );
- ?>
- </em>
- <label class="alignleft inline-edit-private">
- <input type="checkbox" name="keep_private" value="private" />
- <span class="checkbox-title"><?php echo __('Private'); ?></span>
- </label>
- </div>
-
-<?php endif; ?>
-
- </div></fieldset>
-
-<?php if ( count($hierarchical_taxonomies) && !$bulk ) : ?>
-
- <fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col">
-
-<?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?>
-
- <span class="title inline-edit-categories-label"><?php echo esc_html($taxonomy->labels->name) ?>
- <span class="catshow"><?php _e('[more]'); ?></span>
- <span class="cathide" style="display:none;"><?php _e('[less]'); ?></span>
- </span>
- <input type="hidden" name="<?php echo ( $taxonomy->name == 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr($taxonomy->name) . '][]'; ?>" value="0" />
- <ul class="cat-checklist <?php echo esc_attr($taxonomy->name)?>-checklist">
- <?php wp_terms_checklist(null, array('taxonomy' => $taxonomy->name)) ?>
- </ul>
-
-<?php endforeach; //$hierarchical_taxonomies as $taxonomy ?>
-
- </div></fieldset>
-
-<?php endif; // count($hierarchical_taxonomies) && !$bulk ?>
-
- <fieldset class="inline-edit-col-right"><div class="inline-edit-col">
-
-<?php
- if ( post_type_supports( $screen->post_type, 'author' ) && $bulk )
- echo $authors_dropdown;
-?>
-
-<?php if ( $post_type_object->hierarchical ) : ?>
-
- <label>
- <span class="title"><?php _e( 'Parent' ); ?></span>
-<?php
- $dropdown_args = array('post_type' => $post_type_object->name, 'selected' => $post->post_parent, 'name' => 'post_parent', 'show_option_none' => __('Main Page (no parent)'), 'option_none_value' => 0, 'sort_column'=> 'menu_order, post_title');
- if ( $bulk )
- $dropdown_args['show_option_no_change'] = __('— No Change —');
- $dropdown_args = apply_filters('quick_edit_dropdown_pages_args', $dropdown_args);
- wp_dropdown_pages($dropdown_args);
-?>
- </label>
-
-<?php if ( post_type_supports( $screen->post_type, 'page-attributes' ) ) :
- if ( !$bulk ) : ?>
-
- <label>
- <span class="title"><?php _e( 'Order' ); ?></span>
- <span class="input-text-wrap"><input type="text" name="menu_order" class="inline-edit-menu-order-input" value="<?php echo $post->menu_order ?>" /></span>
- </label>
-
-<?php endif; // !$bulk ?>
-
- <label>
- <span class="title"><?php _e( 'Template' ); ?></span>
- <select name="page_template">
-<?php if ( $bulk ) : ?>
- <option value="-1"><?php _e('— No Change —'); ?></option>
-<?php endif; // $bulk ?>
- <option value="default"><?php _e( 'Default Template' ); ?></option>
- <?php page_template_dropdown() ?>
- </select>
- </label>
-
-<?php
- endif; // post_type_supports page-attributes
-endif; // $post_type_object->hierarchical ?>
-
-<?php if ( count($flat_taxonomies) && !$bulk ) : ?>
-
-<?php foreach ( $flat_taxonomies as $taxonomy ) : ?>
-
- <label class="inline-edit-tags">
- <span class="title"><?php echo esc_html($taxonomy->labels->name) ?></span>
- <textarea cols="22" rows="1" name="tax_input[<?php echo esc_attr($taxonomy->name)?>]" class="tax_input_<?php echo esc_attr($taxonomy->name)?>"></textarea>
- </label>
-
-<?php endforeach; //$flat_taxonomies as $taxonomy ?>
-
-<?php endif; // count($flat_taxonomies) && !$bulk ?>
-
-<?php if ( post_type_supports( $screen->post_type, 'comments' ) || post_type_supports( $screen->post_type, 'trackbacks' ) ) :
- if ( $bulk ) : ?>
-
- <div class="inline-edit-group">
- <?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
- <label class="alignleft">
- <span class="title"><?php _e( 'Comments' ); ?></span>
- <select name="comment_status">
- <option value=""><?php _e('— No Change —'); ?></option>
- <option value="open"><?php _e('Allow'); ?></option>
- <option value="closed"><?php _e('Do not allow'); ?></option>
- </select>
- </label>
- <?php endif; if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
- <label class="alignright">
- <span class="title"><?php _e( 'Pings' ); ?></span>
- <select name="ping_status">
- <option value=""><?php _e('— No Change —'); ?></option>
- <option value="open"><?php _e('Allow'); ?></option>
- <option value="closed"><?php _e('Do not allow'); ?></option>
- </select>
- </label>
- <?php endif; ?>
- </div>
-
-<?php else : // $bulk ?>
-
- <div class="inline-edit-group">
- <?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
- <label class="alignleft">
- <input type="checkbox" name="comment_status" value="open" />
- <span class="checkbox-title"><?php _e( 'Allow Comments' ); ?></span>
- </label>
- <?php endif; if ( post_type_supports( $screen->post_type, 'trackbacks' ) ) : ?>
- <label class="alignleft">
- <input type="checkbox" name="ping_status" value="open" />
- <span class="checkbox-title"><?php _e( 'Allow Pings' ); ?></span>
- </label>
- <?php endif; ?>
- </div>
-
-<?php endif; // $bulk
-endif; // post_type_supports comments or pings ?>
-
- <div class="inline-edit-group">
- <label class="inline-edit-status alignleft">
- <span class="title"><?php _e( 'Status' ); ?></span>
- <select name="_status">
-<?php if ( $bulk ) : ?>
- <option value="-1"><?php _e('— No Change —'); ?></option>
-<?php endif; // $bulk ?>
- <?php if ( $can_publish ) : // Contributors only get "Unpublished" and "Pending Review" ?>
- <option value="publish"><?php _e( 'Published' ); ?></option>
- <option value="future"><?php _e( 'Scheduled' ); ?></option>
-<?php if ( $bulk ) : ?>
- <option value="private"><?php _e('Private') ?></option>
-<?php endif; // $bulk ?>
- <?php endif; ?>
- <option value="pending"><?php _e( 'Pending Review' ); ?></option>
- <option value="draft"><?php _e( 'Draft' ); ?></option>
- </select>
- </label>
-
-<?php if ( 'post' == $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
-
-<?php if ( $bulk ) : ?>
-
- <label class="alignright">
- <span class="title"><?php _e( 'Sticky' ); ?></span>
- <select name="sticky">
- <option value="-1"><?php _e( '— No Change —' ); ?></option>
- <option value="sticky"><?php _e( 'Sticky' ); ?></option>
- <option value="unsticky"><?php _e( 'Not Sticky' ); ?></option>
- </select>
- </label>
-
-<?php else : // $bulk ?>
-
- <label class="alignleft">
- <input type="checkbox" name="sticky" value="sticky" />
- <span class="checkbox-title"><?php _e( 'Make this post sticky' ); ?></span>
- </label>
-
-<?php endif; // $bulk ?>
-
-<?php endif; // !$is_page && $can_publish && current_user_can( 'edit_others_cap' ) ?>
-
- </div>
-
- </div></fieldset>
-
-<?php
- 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, $screen->post_type );
- }
-?>
- <p class="submit inline-edit-save">
- <a accesskey="c" href="#inline-edit" title="<?php _e('Cancel'); ?>" class="button-secondary cancel alignleft"><?php _e('Cancel'); ?></a>
- <?php if ( ! $bulk ) {
- wp_nonce_field( 'inlineeditnonce', '_inline_edit', false );
- $update_text = __( 'Update' );
- ?>
- <a accesskey="s" href="#inline-edit" title="<?php _e('Update'); ?>" class="button-primary save alignright"><?php echo esc_attr( $update_text ); ?></a>
- <img class="waiting" style="display:none;" src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" />
- <?php } else {
- $update_text = __( 'Update' );
- ?>
- <input accesskey="s" class="button-primary alignright" type="submit" name="bulk_edit" value="<?php echo esc_attr( $update_text ); ?>" />
- <?php } ?>
- <input type="hidden" name="post_view" value="<?php echo esc_attr($m); ?>" />
- <input type="hidden" name="screen" value="<?php echo esc_attr($screen->id); ?>" />
- <br class="clear" />
- </p>
- </td></tr>
-<?php
- $bulk++;
- } ?>
- </tbody></table></form>
-<?php
-}
-
-// adds hidden fields with the data for use in the inline editor for posts and pages
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $post
- */
-function get_inline_data($post) {
- $post_type_object = get_post_type_object($post->post_type);
- if ( ! current_user_can($post_type_object->cap->edit_post, $post->ID) )
- return;
-
- $title = htmlspecialchars( trim( $post->post_title ), ENT_QUOTES );
-
- echo '
-<div class="hidden" id="inline_' . $post->ID . '">
- <div class="post_title">' . $title . '</div>
- <div class="post_name">' . apply_filters('editable_slug', $post->post_name) . '</div>
- <div class="post_author">' . $post->post_author . '</div>
- <div class="comment_status">' . esc_html( $post->comment_status ) . '</div>
- <div class="ping_status">' . esc_html( $post->ping_status ) . '</div>
- <div class="_status">' . esc_html( $post->post_status ) . '</div>
- <div class="jj">' . mysql2date( 'd', $post->post_date, false ) . '</div>
- <div class="mm">' . mysql2date( 'm', $post->post_date, false ) . '</div>
- <div class="aa">' . mysql2date( 'Y', $post->post_date, false ) . '</div>
- <div class="hh">' . mysql2date( 'H', $post->post_date, false ) . '</div>
- <div class="mn">' . mysql2date( 'i', $post->post_date, false ) . '</div>
- <div class="ss">' . mysql2date( 's', $post->post_date, false ) . '</div>
- <div class="post_password">' . esc_html( $post->post_password ) . '</div>';
-
- if ( $post_type_object->hierarchical )
- echo '<div class="post_parent">' . $post->post_parent . '</div>';
-
- if ( $post->post_type == 'page' )
- echo '<div class="page_template">' . esc_html( get_post_meta( $post->ID, '_wp_page_template', true ) ) . '</div>';
-
- if ( $post_type_object->hierarchical )
- echo '<div class="menu_order">' . $post->menu_order . '</div>';
-
- $taxonomy_names = get_object_taxonomies( $post->post_type );
- foreach ( $taxonomy_names as $taxonomy_name) {
- $taxonomy = get_taxonomy( $taxonomy_name );
-
- if ( $taxonomy->hierarchical && $taxonomy->show_ui )
- echo '<div class="post_category" id="'.$taxonomy_name.'_'.$post->ID.'">' . implode( ',', wp_get_object_terms( $post->ID, $taxonomy_name, array('fields'=>'ids')) ) . '</div>';
- elseif ( $taxonomy->show_ui )
- echo '<div class="tags_input" id="'.$taxonomy_name.'_'.$post->ID.'">' . esc_html( str_replace( ',', ', ', get_terms_to_edit($post->ID, $taxonomy_name) ) ) . '</div>';
- }
-
- if ( !$post_type_object->hierarchical )
- echo '<div class="sticky">' . (is_sticky($post->ID) ? 'sticky' : '') . '</div>';
-
- echo '</div>';
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $posts
- */
-function post_rows( $posts = array() ) {
- global $wp_query, $post, $mode;
-
- add_filter('the_title','esc_html');
-
- // Create array of post IDs.
- $post_ids = array();
-
- if ( empty($posts) )
- $posts = &$wp_query->posts;
-
- foreach ( $posts as $a_post )
- $post_ids[] = $a_post->ID;
-
- $comment_pending_count = get_pending_comments_num($post_ids);
-
- foreach ( $posts as $post ) {
- if ( empty($comment_pending_count[$post->ID]) )
- $comment_pending_count[$post->ID] = 0;
-
- _post_row($post, $comment_pending_count[$post->ID], $mode);
- }
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $a_post
- * @param unknown_type $pending_comments
- * @param unknown_type $mode
- */
-function _post_row($a_post, $pending_comments, $mode) {
- global $post, $current_screen;
- static $rowclass;
-
- $global_post = $post;
- $post = $a_post;
- setup_postdata($post);
-
- $rowclass = 'alternate' == $rowclass ? '' : 'alternate';
- $post_owner = ( get_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);
-?>
- <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $rowclass . ' author-' . $post_owner . ' status-' . $post->post_status ); ?> iedit' valign="top">
-<?php
- $posts_columns = get_column_headers( $current_screen );
- $hidden = get_hidden_columns( $current_screen );
- foreach ( $posts_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':
- ?>
- <th scope="row" class="check-column"><?php if ( current_user_can( $post_type_object->cap->edit_post, $post->ID ) ) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th>
- <?php
- break;
-
- case 'date':
- if ( '0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name ) {
- $t_time = $h_time = __('Unpublished');
- $time_diff = 0;
- } else {
- $t_time = get_the_time(__('Y/m/d g:i:s A'));
- $m_time = $post->post_date;
- $time = get_post_time('G', true, $post);
-
- $time_diff = time() - $time;
-
- if ( $time_diff > 0 && $time_diff < 24*60*60 )
- $h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
- else
- $h_time = mysql2date(__('Y/m/d'), $m_time);
- }
-
- echo '<td ' . $attributes . '>';
- if ( 'excerpt' == $mode )
- echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode);
- else
- echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) . '</abbr>';
- echo '<br />';
- if ( 'publish' == $post->post_status ) {
- _e('Published');
- } elseif ( 'future' == $post->post_status ) {
- if ( $time_diff > 0 )
- echo '<strong class="attention">' . __('Missed schedule') . '</strong>';
- else
- _e('Scheduled');
- } else {
- _e('Last Modified');
- }
- echo '</td>';
- break;
-
- case 'title':
- $attributes = 'class="post-title column-title"' . $style;
- ?>
- <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->cap->edit_post, $post->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; }; _post_states($post); ?></strong>
- <?php
- if ( 'excerpt' == $mode )
- the_excerpt();
-
- $actions = array();
- if ( current_user_can($post_type_object->cap->edit_post, $post->ID) && 'trash' != $post->post_status ) {
- $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item')) . '">' . __('Edit') . '</a>';
- $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline')) . '">' . __('Quick Edit') . '</a>';
- }
- if ( current_user_can($post_type_object->cap->delete_post, $post->ID) ) {
- if ( 'trash' == $post->post_status )
- $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash')) . "' href='" . wp_nonce_url( admin_url( sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID) ), 'untrash-' . $post->post_type . '_' . $post->ID ) . "'>" . __('Restore') . "</a>";
- elseif ( EMPTY_TRASH_DAYS )
- $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>";
- if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
- $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>";
- }
- if ( in_array($post->post_status, array('pending', 'draft')) ) {
- if ( current_user_can($post_type_object->cap->edit_post, $post->ID) )
- $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($post->ID) ) ) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
- } elseif ( 'trash' != $post->post_status ) {
- $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
- }
- $actions = apply_filters('post_row_actions', $actions, $post);
- $action_count = count($actions);
- $i = 0;
- echo '<div class="row-actions">';
- foreach ( $actions as $action => $link ) {
- ++$i;
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
- echo "<span class='$action'>$link$sep</span>";
- }
- echo '</div>';
-
- get_inline_data($post);
- ?>
- </td>
- <?php
- break;
-
- case 'categories':
- ?>
- <td <?php echo $attributes ?>><?php
- $categories = get_the_category();
- if ( !empty( $categories ) ) {
- $out = array();
- foreach ( $categories as $c )
- $out[] = "<a href='edit.php?post_type={$post->post_type}&category_name={$c->slug}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>";
- echo join( ', ', $out );
- } else {
- _e('Uncategorized');
- }
- ?></td>
- <?php
- break;
-
- case 'tags':
- ?>
- <td <?php echo $attributes ?>><?php
- $tags = get_the_tags($post->ID);
- if ( !empty( $tags ) ) {
- $out = array();
- foreach ( $tags as $c )
- $out[] = "<a href='edit.php?post_type={$post->post_type}&tag={$c->slug}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . "</a>";
- echo join( ', ', $out );
- } else {
- _e('No Tags');
- }
- ?></td>
- <?php
- break;
-
- case 'comments':
- ?>
- <td <?php echo $attributes ?>><div class="post-com-count-wrapper">
- <?php
- $pending_phrase = sprintf( __('%s pending'), number_format( $pending_comments ) );
- if ( $pending_comments )
- echo '<strong>';
- comments_number("<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . '</span></a>');
- if ( $pending_comments )
- echo '</strong>';
- ?>
- </div></td>
- <?php
- break;
-
- case 'author':
- ?>
- <td <?php echo $attributes ?>><a href="edit.php?post_type=<?php echo $post->post_type; ?>&author=<?php the_author_meta('ID'); ?>"><?php the_author() ?></a></td>
- <?php
- break;
-
- case 'control_view':
- ?>
- <td><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></td>
- <?php
- break;
-
- case 'control_edit':
- ?>
- <td><?php if ( current_user_can($post_type_object->cap->edit_post, $post->ID) ) { echo "<a href='$edit_link' class='edit'>" . __('Edit') . "</a>"; } ?></td>
- <?php
- break;
-
- case 'control_delete':
- ?>
- <td><?php if ( current_user_can($post_type_object->cap->delete_post, $post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post=$id", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . "</a>"; } ?></td>
- <?php
- break;
-
- default:
- ?>
- <td <?php echo $attributes ?>><?php do_action('manage_posts_custom_column', $column_name, $post->ID); ?></td>
- <?php
- break;
- }
-}
-?>
- </tr>
-<?php
- $post = $global_post;
-}
-
-/*
- * display one row if the page doesn't have any children
- * otherwise, display the row and its children in subsequent rows
- */
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $page
- * @param unknown_type $level
- */
-function display_page_row( $page, $level = 0 ) {
- global $post, $current_screen;
- static $rowclass;
-
- $post = $page;
- setup_postdata($page);
-
- if ( 0 == $level && (int)$page->post_parent > 0 ) {
- //sent level 0 by accident, by default, or because we don't know the actual level
- $find_main_page = (int)$page->post_parent;
- while ( $find_main_page > 0 ) {
- $parent = get_page($find_main_page);
-
- if ( is_null($parent) )
- break;
-
- $level++;
- $find_main_page = (int)$parent->post_parent;
-
- if ( !isset($parent_name) )
- $parent_name = $parent->post_title;
- }
- }
-
- $page->post_title = esc_html( $page->post_title );
- $pad = str_repeat( '— ', $level );
- $id = (int) $page->ID;
- $rowclass = 'alternate' == $rowclass ? '' : 'alternate';
- $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);
-?>
-<tr id="page-<?php echo $id; ?>" class="<?php echo $rowclass; ?> iedit">
-<?php
-
-foreach ( $posts_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':
- ?>
- <th scope="row" class="check-column"><?php if ( current_user_can( $post_type_object->cap->edit_post, $page->ID ) ) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th>
- <?php
- break;
- case 'date':
- if ( '0000-00-00 00:00:00' == $page->post_date && 'date' == $column_name ) {
- $t_time = $h_time = __('Unpublished');
- $time_diff = 0;
- } else {
- $t_time = get_the_time(__('Y/m/d g:i:s A'));
- $m_time = $page->post_date;
- $time = get_post_time('G', true);
-
- $time_diff = time() - $time;
-
- if ( $time_diff > 0 && $time_diff < 24*60*60 )
- $h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
- else
- $h_time = mysql2date(__('Y/m/d'), $m_time);
- }
- echo '<td ' . $attributes . '>';
- echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $page, $column_name, '') . '</abbr>';
- echo '<br />';
- if ( 'publish' == $page->post_status ) {
- _e('Published');
- } elseif ( 'future' == $page->post_status ) {
- if ( $time_diff > 0 )
- echo '<strong class="attention">' . __('Missed schedule') . '</strong>';
- else
- _e('Scheduled');
- } else {
- _e('Last Modified');
- }
- echo '</td>';
- break;
- case 'title':
- $attributes = 'class="post-title page-title column-title"' . $style;
- $edit_link = get_edit_post_link( $page->ID );
- ?>
- <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->cap->edit_post, $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html($parent_name) : ''; ?></strong>
- <?php
- $actions = array();
- if ( current_user_can($post_type_object->cap->edit_post, $page->ID) && $post->post_status != 'trash' ) {
- $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>';
- $actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
- }
- if ( current_user_can($post_type_object->cap->delete_post, $page->ID) ) {
- if ( $post->post_status == 'trash' )
- $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&action=untrash&post=$page->ID", 'untrash-' . $post->post_type . '_' . $page->ID) . "'>" . __('Restore') . "</a>";
- elseif ( EMPTY_TRASH_DAYS )
- $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>";
- if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS )
- $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&action=delete&post=$page->ID", 'delete-' . $post->post_type . '_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";
- }
- if ( in_array($post->post_status, array('pending', 'draft')) ) {
- if ( current_user_can($post_type_object->cap->edit_post, $page->ID) )
- $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($page->ID) ) ) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
- } elseif ( $post->post_status != 'trash' ) {
- $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
- }
- $actions = apply_filters('page_row_actions', $actions, $page);
- $action_count = count($actions);
-
- $i = 0;
- echo '<div class="row-actions">';
- foreach ( $actions as $action => $link ) {
- ++$i;
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
- echo "<span class='$action'>$link$sep</span>";
- }
- echo '</div>';
-
- get_inline_data($post);
- echo '</td>';
- break;
-
- case 'comments':
- ?>
- <td <?php echo $attributes ?>><div class="post-com-count-wrapper">
- <?php
- $left = get_pending_comments_num( $page->ID );
- $pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
- if ( $left )
- echo '<strong>';
- comments_number("<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . '</span></a>');
- if ( $left )
- echo '</strong>';
- ?>
- </div></td>
- <?php
- break;
-
- case 'author':
- ?>
- <td <?php echo $attributes ?>><a href="edit.php?post_type=<?php echo $post_type; ?>&author=<?php the_author_meta('ID'); ?>"><?php the_author() ?></a></td>
- <?php
- break;
-
- default:
- ?>
- <td <?php echo $attributes ?>><?php do_action('manage_pages_custom_column', $column_name, $id); ?></td>
- <?php
- break;
- }
-}
-?>
-
-</tr>
-
-<?php
-}
-
-/*
- * displays pages in hierarchical order with paging support
- */
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $pages
- * @param unknown_type $pagenum
- * @param unknown_type $per_page
- * @return unknown
- */
-function page_rows($pages, $pagenum = 1, $per_page = 20) {
- global $wpdb;
-
- $level = 0;
-
- if ( ! $pages ) {
- $pages = get_pages( array('sort_column' => 'menu_order') );
-
- if ( ! $pages )
- return false;
- }
-
- /*
- * arrange pages into two parts: top level pages and children_pages
- * children_pages is two dimensional array, eg.
- * children_pages[10][] contains all sub-pages whose parent is 10.
- * It only takes O(N) to arrange this and it takes O(1) for subsequent lookup operations
- * If searching, ignore hierarchy and treat everything as top level
- */
- if ( empty($_GET['s']) ) {
-
- $top_level_pages = array();
- $children_pages = array();
-
- foreach ( $pages as $page ) {
-
- // catch and repair bad pages
- if ( $page->post_parent == $page->ID ) {
- $page->post_parent = 0;
- $wpdb->update($wpdb->posts, array('post_parent' => 0), array('ID' => $page->ID));
- clean_page_cache( $page->ID );
- }
-
- if ( 0 == $page->post_parent )
- $top_level_pages[] = $page;
- else
- $children_pages[ $page->post_parent ][] = $page;
- }
-
- $pages = &$top_level_pages;
- }
-
- $count = 0;
- $start = ($pagenum - 1) * $per_page;
- $end = $start + $per_page;
-
- foreach ( $pages as $page ) {
- if ( $count >= $end )
- break;
-
- if ( $count >= $start )
- echo "\t" . display_page_row( $page, $level );
-
- $count++;
-
- if ( isset($children_pages) )
- _page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page );
- }
-
- // if it is the last pagenum and there are orphaned pages, display them with paging as well
- if ( isset($children_pages) && $count < $end ){
- foreach( $children_pages as $orphans ){
- foreach ( $orphans as $op ) {
- if ( $count >= $end )
- break;
- if ( $count >= $start )
- echo "\t" . display_page_row( $op, 0 );
- $count++;
- }
- }
- }
-}
-
-/**
- * Given a top level page ID, display the nested hierarchy of sub-pages
- * together with paging support
- *
- * @since unknown
- *
- * @param unknown_type $children_pages
- * @param unknown_type $count
- * @param unknown_type $parent
- * @param unknown_type $level
- * @param unknown_type $pagenum
- * @param unknown_type $per_page
- */
-function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {
-
- if ( ! isset( $children_pages[$parent] ) )
- return;
-
- $start = ($pagenum - 1) * $per_page;
- $end = $start + $per_page;
-
- foreach ( $children_pages[$parent] as $page ) {
-
- if ( $count >= $end )
- break;
-
- // If the page starts in a subtree, print the parents.
- if ( $count == $start && $page->post_parent > 0 ) {
- $my_parents = array();
- $my_parent = $page->post_parent;
- while ( $my_parent) {
- $my_parent = get_post($my_parent);
- $my_parents[] = $my_parent;
- if ( !$my_parent->post_parent )
- break;
- $my_parent = $my_parent->post_parent;
- }
- $num_parents = count($my_parents);
- while( $my_parent = array_pop($my_parents) ) {
- echo "\t" . display_page_row( $my_parent, $level - $num_parents );
- $num_parents--;
- }
- }
-
- if ( $count >= $start )
- echo "\t" . display_page_row( $page, $level );
-
- $count++;
-
- _page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page );
- }
-
- unset( $children_pages[$parent] ); //required in order to keep track of orphans
-}
-
-/**
- * Generate HTML for a single row on the users.php admin panel.
- *
- * @since 2.1.0
- *
- * @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 = '', $numposts = 0 ) {
- global $wp_roles;
-
- if ( !( is_object( $user_object) && is_a( $user_object, 'WP_User' ) ) )
- $user_object = new WP_User( (int) $user_object );
- $user_object = sanitize_user_object($user_object, 'display');
- $email = $user_object->user_email;
- $url = $user_object->user_url;
- $short_url = str_replace( 'http://', '', $url );
- $short_url = str_replace( 'www.', '', $short_url );
- if ('/' == substr( $short_url, -1 ))
- $short_url = substr( $short_url, 0, -1 );
- if ( strlen( $short_url ) > 35 )
- $short_url = substr( $short_url, 0, 32 ).'...';
- $checkbox = '';
- // Check if the user for this row is editable
- if ( current_user_can( 'list_users' ) ) {
- // Set up the user editing link
- // TODO: make profile/user-edit determination a separate function
- if ( get_current_user_id() == $user_object->ID) {
- $edit_link = 'profile.php';
- } else {
- $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( esc_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$user_object->ID" ) );
- }
- $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />";
-
- // Set up the hover actions for this user
- $actions = array();
-
- if ( current_user_can('edit_user', $user_object->ID) ) {
- $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />";
- $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
- } else {
- $edit = "<strong>$user_object->user_login</strong><br />";
- }
-
- if ( !is_multisite() && get_current_user_id() != $user_object->ID && current_user_can('delete_user', $user_object->ID) )
- $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&user=$user_object->ID", 'bulk-users') . "'>" . __('Delete') . "</a>";
- if ( is_multisite() && get_current_user_id() != $user_object->ID && current_user_can('remove_user', $user_object->ID) )
- $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=remove&user=$user_object->ID", 'bulk-users') . "'>" . __('Remove') . "</a>";
- $actions = apply_filters('user_row_actions', $actions, $user_object);
- $action_count = count($actions);
- $i = 0;
- $edit .= '<div class="row-actions">';
- foreach ( $actions as $action => $link ) {
- ++$i;
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
- $edit .= "<span class='$action'>$link$sep</span>";
- }
- $edit .= '</div>';
-
- // Set up the checkbox (because the user is editable, otherwise its empty)
- $checkbox = "<input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' />";
-
- } else {
- $edit = '<strong>' . $user_object->user_login . '</strong>';
- }
- $role_name = isset($wp_roles->role_names[$role]) ? translate_user_role($wp_roles->role_names[$role] ) : __('None');
- $r = "<tr id='user-$user_object->ID'$style>";
- $columns = get_column_headers('users');
- $hidden = get_hidden_columns('users');
- $avatar = get_avatar( $user_object->ID, 32 );
- 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':
- $r .= "<th scope='row' class='check-column'>$checkbox</th>";
- break;
- case 'username':
- $r .= "<td $attributes>$avatar $edit</td>";
- break;
- case 'name':
- $r .= "<td $attributes>$user_object->first_name $user_object->last_name</td>";
- break;
- case 'email':
- $r .= "<td $attributes><a href='mailto:$email' title='" . sprintf( __('E-mail: %s' ), $email ) . "'>$email</a></td>";
- break;
- case 'role':
- $r .= "<td $attributes>$role_name</td>";
- break;
- case 'posts':
- $attributes = 'class="posts column-posts num"' . $style;
- $r .= "<td $attributes>";
- if ( $numposts > 0 ) {
- $r .= "<a href='edit.php?author=$user_object->ID' title='" . __( 'View posts by this author' ) . "' class='edit'>";
- $r .= $numposts;
- $r .= '</a>';
- } else {
- $r .= 0;
- }
- $r .= "</td>";
- break;
- default:
- $r .= "<td $attributes>";
- $r .= apply_filters('manage_users_custom_column', '', $column_name, $user_object->ID);
- $r .= "</td>";
- }
- }
- $r .= '</tr>';
-
- return $r;
+ 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 ) ? ' checked="checked"' : '';
+ echo '<li id="link-category-', $cat_id, '"><label for="in-link-category-', $cat_id, '" class="selectit"><input value="', $cat_id, '" type="checkbox" name="link_category[]" id="in-link-category-', $cat_id, '"', $checked, '/> ', $name, "</label></li>";
+ }
}
/**
- * {@internal Missing Short Description}}
+ * Get the column headers for a screen
*
- * @since unknown
+ * @since 2.7.0
*
- * @param string $status Comment status (approved, spam, trash, etc)
- * @param string $s Term to search for
- * @param int $start Offset to start at for pagination
- * @param int $num Maximum number of comments to return
- * @param int $post Post ID or 0 to return all comments
- * @param string $type Comment type (comment, trackback, pingback, etc)
- * @return array [0] contains the comments and [1] contains the total number of comments that match (ignoring $start and $num)
+ * @param string|object $screen The screen you want the headers for
+ * @return array Containing the headers in the format id => UI String
*/
-function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
- global $wpdb;
-
- $start = abs( (int) $start );
- $num = (int) $num;
- $post = (int) $post;
- $count = wp_count_comments();
- $index = '';
-
- if ( 'moderated' == $status ) {
- $approved = "c.comment_approved = '0'";
- $total = $count->moderated;
- } elseif ( 'approved' == $status ) {
- $approved = "c.comment_approved = '1'";
- $total = $count->approved;
- } elseif ( 'spam' == $status ) {
- $approved = "c.comment_approved = 'spam'";
- $total = $count->spam;
- } elseif ( 'trash' == $status ) {
- $approved = "c.comment_approved = 'trash'";
- $total = $count->trash;
- } else {
- $approved = "( c.comment_approved = '0' OR c.comment_approved = '1' )";
- $total = $count->moderated + $count->approved;
- $index = 'USE INDEX (c.comment_date_gmt)';
- }
-
- if ( $post ) {
- $total = '';
- $post = " AND c.comment_post_ID = '$post'";
- } else {
- $post = '';
- }
+function get_column_headers( $screen ) {
+ if ( is_string( $screen ) )
+ $screen = convert_to_screen( $screen );
- $orderby = "ORDER BY c.comment_date_gmt DESC LIMIT $start, $num";
+ global $_wp_column_headers;
- if ( 'comment' == $type )
- $typesql = "AND c.comment_type = ''";
- elseif ( 'pings' == $type )
- $typesql = "AND ( c.comment_type = 'pingback' OR c.comment_type = 'trackback' )";
- elseif ( 'all' == $type )
- $typesql = '';
- elseif ( !empty($type) )
- $typesql = $wpdb->prepare("AND c.comment_type = %s", $type);
- else
- $typesql = '';
-
- if ( !empty($type) )
- $total = '';
-
- $query = "FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ";
- if ( $s ) {
- $total = '';
- $s = $wpdb->escape($s);
- $query .= "AND
- (c.comment_author LIKE '%$s%' OR
- c.comment_author_email LIKE '%$s%' OR
- c.comment_author_url LIKE ('%$s%') OR
- c.comment_author_IP LIKE ('%$s%') OR
- c.comment_content LIKE ('%$s%') ) AND
- $approved
- $typesql";
- } else {
- $query .= "AND $approved $post $typesql";
+ if ( !isset( $_wp_column_headers[ $screen->id ] ) ) {
+ $_wp_column_headers[ $screen->id ] = apply_filters( 'manage_' . $screen->id . '_columns', array() );
}
- $comments = $wpdb->get_results("SELECT * $query $orderby");
- if ( '' === $total )
- $total = $wpdb->get_var("SELECT COUNT(c.comment_ID) $query");
+ return $_wp_column_headers[ $screen->id ];
+}
- update_comment_cache($comments);
+/**
+ * Get a list of hidden columns.
+ *
+ * @since 2.7.0
+ *
+ * @param string|object $screen The screen you want the hidden columns for
+ * @return array
+ */
+function get_hidden_columns( $screen ) {
+ if ( is_string( $screen ) )
+ $screen = convert_to_screen( $screen );
- return array($comments, $total);
+ return (array) get_user_option( 'manage' . $screen->id . 'columnshidden' );
}
+// adds hidden fields with the data for use in the inline editor for posts and pages
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.7.0
*
- * @param unknown_type $comment_id
- * @param unknown_type $mode
- * @param unknown_type $comment_status
- * @param unknown_type $checkbox
+ * @param unknown_type $post
*/
-function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $from_ajax = false ) {
- global $comment, $post, $_comment_pending_count;
- $comment = get_comment( $comment_id );
- $post = get_post($comment->comment_post_ID);
- $the_comment_status = wp_get_comment_status($comment->comment_ID);
+function get_inline_data($post) {
$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 = '';
- $author_url_display = preg_replace('|http://(www\.)?|i', '', $author_url);
- if ( strlen($author_url_display) > 50 )
- $author_url_display = substr($author_url_display, 0, 49) . '...';
-
- $ptime = date('G', strtotime( $comment->comment_date ) );
- if ( ( abs(time() - $ptime) ) < 86400 )
- $ptime = sprintf( __('%s ago'), human_time_diff( $ptime ) );
- else
- $ptime = mysql2date(__('Y/m/d \a\t g:i A'), $comment->comment_date );
-
- if ( $user_can ) {
- $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" ) );
-
- $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" );
- $unspam_url = esc_url( "comment.php?action=unspamcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
- $trash_url = esc_url( "comment.php?action=trashcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
- $untrash_url = esc_url( "comment.php?action=untrashcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
- $delete_url = esc_url( "comment.php?action=deletecomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" );
- }
+ if ( ! current_user_can($post_type_object->cap->edit_post, $post->ID) )
+ return;
- echo "<tr id='comment-$comment->comment_ID' class='$the_comment_status'>";
- $columns = get_column_headers('edit-comments');
- $hidden = get_hidden_columns('edit-comments');
- foreach ( $columns as $column_name => $column_display_name ) {
- $class = "class=\"$column_name column-$column_name\"";
+ $title = esc_textarea( trim( $post->post_title ) );
- $style = '';
- if ( in_array($column_name, $hidden) )
- $style = ' style="display:none;"';
-
- $attributes = "$class$style";
-
- switch ($column_name) {
- case 'cb':
- if ( !$checkbox ) break;
- echo '<th scope="row" class="check-column">';
- if ( $user_can ) echo "<input type='checkbox' name='delete_comments[]' value='$comment->comment_ID' />";
- echo '</th>';
- break;
- case 'comment':
- echo "<td $attributes>";
- echo '<div id="submitted-on">';
- /* translators: 2: comment date, 3: comment time */
- printf( __( '<a href="%1$s">%2$s at %3$s</a>' ), $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 <a href="%1$s">%2$s</a>.' ), $parent_link, $name );
- }
+ echo '
+<div class="hidden" id="inline_' . $post->ID . '">
+ <div class="post_title">' . $title . '</div>
+ <div class="post_name">' . apply_filters('editable_slug', $post->post_name) . '</div>
+ <div class="post_author">' . $post->post_author . '</div>
+ <div class="comment_status">' . esc_html( $post->comment_status ) . '</div>
+ <div class="ping_status">' . esc_html( $post->ping_status ) . '</div>
+ <div class="_status">' . esc_html( $post->post_status ) . '</div>
+ <div class="jj">' . mysql2date( 'd', $post->post_date, false ) . '</div>
+ <div class="mm">' . mysql2date( 'm', $post->post_date, false ) . '</div>
+ <div class="aa">' . mysql2date( 'Y', $post->post_date, false ) . '</div>
+ <div class="hh">' . mysql2date( 'H', $post->post_date, false ) . '</div>
+ <div class="mn">' . mysql2date( 'i', $post->post_date, false ) . '</div>
+ <div class="ss">' . mysql2date( 's', $post->post_date, false ) . '</div>
+ <div class="post_password">' . esc_html( $post->post_password ) . '</div>';
- echo '</div>';
- comment_text();
- if ( $user_can ) { ?>
- <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
- <textarea class="comment" rows="1" cols="1"><?php echo htmlspecialchars( apply_filters('comment_edit_pre', $comment->comment_content), ENT_QUOTES ); ?></textarea>
- <div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
- <div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
- <div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
- <div class="comment_status"><?php echo $comment->comment_approved; ?></div>
- </div>
- <?php
- }
+ if ( $post_type_object->hierarchical )
+ echo '<div class="post_parent">' . $post->post_parent . '</div>';
- if ( $user_can ) {
- // preorder it: Approve | Reply | Quick Edit | Edit | Spam | Trash
- $actions = array(
- 'approve' => '', 'unapprove' => '',
- 'reply' => '',
- 'quickedit' => '',
- 'edit' => '',
- 'spam' => '', 'unspam' => '',
- 'trash' => '', 'untrash' => '', 'delete' => ''
- );
-
- if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments
- if ( 'approved' == $the_comment_status )
- $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
- else if ( 'unapproved' == $the_comment_status )
- $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
- } else {
- $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
- $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
- }
+ if ( $post->post_type == 'page' )
+ echo '<div class="page_template">' . esc_html( get_post_meta( $post->ID, '_wp_page_template', true ) ) . '</div>';
- if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) {
- $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . '</a>';
- } elseif ( 'spam' == $the_comment_status ) {
- $actions['unspam'] = "<a href='$unspam_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:unspam=1 vim-z vim-destructive'>" . _x( 'Not Spam', 'comment' ) . '</a>';
- } elseif ( 'trash' == $the_comment_status ) {
- $actions['untrash'] = "<a href='$untrash_url' class='delete:the-comment-list:comment-$comment->comment_ID:66cc66:untrash=1 vim-z vim-destructive'>" . __( 'Restore' ) . '</a>';
- }
+ if ( $post_type_object->hierarchical )
+ echo '<div class="menu_order">' . $post->menu_order . '</div>';
- if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) {
- $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::delete=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
- } else {
- $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
- }
+ $taxonomy_names = get_object_taxonomies( $post->post_type );
+ foreach ( $taxonomy_names as $taxonomy_name) {
+ $taxonomy = get_taxonomy( $taxonomy_name );
- if ( 'trash' != $the_comment_status ) {
- $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . esc_attr__('Edit comment') . "'>". __('Edit') . '</a>';
- $actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\');return false;" class="vim-q" title="'.esc_attr__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
- if ( 'spam' != $the_comment_status )
- $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\');return false;" class="vim-r" title="'.esc_attr__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
- }
+ if ( $taxonomy->hierarchical && $taxonomy->show_ui )
+ echo '<div class="post_category" id="'.$taxonomy_name.'_'.$post->ID.'">' . implode( ',', wp_get_object_terms( $post->ID, $taxonomy_name, array('fields'=>'ids')) ) . '</div>';
+ elseif ( $taxonomy->show_ui )
+ echo '<div class="tags_input" id="'.$taxonomy_name.'_'.$post->ID.'">' . esc_html( str_replace( ',', ', ', get_terms_to_edit($post->ID, $taxonomy_name) ) ) . '</div>';
+ }
- $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
-
- $i = 0;
- echo '<div class="row-actions">';
- foreach ( $actions as $action => $link ) {
- ++$i;
- ( ( ('approve' == $action || 'unapprove' == $action) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
-
- // Reply and quickedit need a hide-if-no-js span when not added with ajax
- if ( ('reply' == $action || 'quickedit' == $action) && ! $from_ajax )
- $action .= ' hide-if-no-js';
- elseif ( ($action == 'untrash' && $the_comment_status == 'trash') || ($action == 'unspam' && $the_comment_status == 'spam') ) {
- if ('1' == get_comment_meta($comment_id, '_wp_trash_meta_status', true))
- $action .= ' approve';
- else
- $action .= ' unapprove';
- }
-
- echo "<span class='$action'>$sep$link</span>";
- }
- echo '</div>';
- }
+ if ( !$post_type_object->hierarchical )
+ echo '<div class="sticky">' . (is_sticky($post->ID) ? 'sticky' : '') . '</div>';
- echo '</td>';
- break;
- case 'author':
- echo "<td $attributes><strong>"; comment_author(); echo '</strong><br />';
- if ( !empty($author_url) )
- echo "<a title='$author_url' href='$author_url'>$author_url_display</a><br />";
- if ( $user_can ) {
- if ( !empty($comment->comment_author_email) ) {
- comment_author_email_link();
- echo '<br />';
- }
- echo '<a href="edit-comments.php?s=';
- comment_author_IP();
- echo '&mode=detail';
- if ( 'spam' == $comment_status )
- echo '&comment_status=spam';
- echo '">';
- comment_author_IP();
- echo '</a>';
- } //current_user_can
- echo '</td>';
- break;
- case 'date':
- echo "<td $attributes>" . get_comment_date(__('Y/m/d \a\t g:ia')) . '</td>';
- break;
- case 'response':
- if ( 'single' !== $mode ) {
- if ( isset( $_comment_pending_count[$post->ID] ) ) {
- $pending_comments = $_comment_pending_count[$post->ID];
- } else {
- $_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 ) {
- $post_link = "<a href='" . get_edit_post_link($post->ID) . "'>";
- $post_link .= get_the_title($post->ID) . '</a>';
- } else {
- $post_link = get_the_title($post->ID);
- }
- echo "<td $attributes>\n";
- echo '<div class="response-links"><span class="post-com-count-wrapper">';
- echo $post_link . '<br />';
- $pending_phrase = esc_attr(sprintf( __('%s pending'), number_format( $pending_comments ) ));
- if ( $pending_comments )
- echo '<strong>';
- comments_number("<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . '</span></a>');
- if ( $pending_comments )
- echo '</strong>';
- echo '</span> ';
- echo "<a href='" . get_permalink( $post->ID ) . "'>#</a>";
- echo '</div>';
- if ( 'attachment' == $post->post_type && ( $thumb = wp_get_attachment_image( $post->ID, array(80, 60), true ) ) )
- echo $thumb;
- echo '</td>';
- }
- break;
- default:
- echo "<td $attributes>\n";
- do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );
- echo "</td>\n";
- break;
- }
- }
- echo "</tr>\n";
+ echo '</div>';
}
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.7.0
*
* @param unknown_type $position
* @param unknown_type $checkbox
return;
}
- $columns = get_column_headers('edit-comments');
- $hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns('edit-comments') ) );
- $col_count = count($columns) - count($hidden);
+ if ( $mode == 'single' ) {
+ $wp_list_table = _get_list_table('WP_Post_Comments_List_Table');
+ } else {
+ $wp_list_table = _get_list_table('WP_Comments_List_Table');
+ }
?>
<form method="get" action="">
<?php if ( $table_row ) : ?>
-<table style="display:none;"><tbody id="com-reply"><tr id="replyrow" style="display:none;"><td colspan="<?php echo $col_count; ?>">
+<table style="display:none;"><tbody id="com-reply"><tr id="replyrow" style="display:none;"><td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="colspanchange">
<?php else : ?>
<div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;">
<?php endif; ?>
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.2.0
*
* @param unknown_type $meta
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param unknown_type $entry
* @param unknown_type $count
}
$entry['meta_key'] = esc_attr($entry['meta_key']);
- $entry['meta_value'] = htmlspecialchars($entry['meta_value']); // using a <textarea />
+ $entry['meta_value'] = esc_textarea( $entry['meta_value'] ); // using a <textarea />
$entry['meta_id'] = (int) $entry['meta_id'];
$delete_nonce = wp_create_nonce( 'delete-meta_' . $entry['meta_id'] );
$r .= "\n\t<tr id='meta-{$entry['meta_id']}' class='$style'>";
$r .= "\n\t\t<td class='left'><label class='screen-reader-text' for='meta[{$entry['meta_id']}][key]'>" . __( 'Key' ) . "</label><input name='meta[{$entry['meta_id']}][key]' id='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' />";
- $r .= "\n\t\t<div class='submit'><input name='deletemeta[{$entry['meta_id']}]' type='submit' ";
- $r .= "class='delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta' tabindex='6' value='". esc_attr__( 'Delete' ) ."' />";
- $r .= "\n\t\t<input name='updatemeta' type='submit' tabindex='6' value='". esc_attr__( 'Update' ) ."' class='add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce updatemeta' /></div>";
+ $r .= "\n\t\t<div class='submit'>";
+ $r .= get_submit_button( __( 'Delete' ), "delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta", "deletemeta[{$entry['meta_id']}]", false, array( 'tabindex' => '6' ) );
+ $r .= "\n\t\t";
+ $r .= get_submit_button( __( 'Update' ), "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce updatemeta" , 'updatemeta', false, array( 'tabindex' => '6' ) );
+ $r .= "</div>";
$r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );
$r .= "</td>";
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.2.0
*/
function meta_form() {
global $wpdb;
</tr>
<tr><td colspan="2" class="submit">
-<input type="submit" id="addmetasub" name="addmeta" class="add:the-list:newmeta" tabindex="9" value="<?php esc_attr_e( 'Add Custom Field' ) ?>" />
+<?php submit_button( __( 'Add Custom Field' ), 'add:the-list:newmeta', 'addmeta', false, array( 'id' => 'addmetasub', 'tabindex' => '9' ) ); ?>
<?php wp_nonce_field( 'add-meta', '_ajax_nonce-add-meta', false ); ?>
</td></tr>
</tbody>
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 0.71
*
* @param unknown_type $edit
* @param unknown_type $for_post
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.5.0
*
* @param unknown_type $default
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.5.0
*
* @param unknown_type $default
* @param unknown_type $parent
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.0.0
*
* @param unknown_type $id
* @return unknown
<col class="widefat" />
<tr>
<th scope="row"><?php _e( 'URL' ) ?></th>
- <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><?php echo wp_get_attachment_url(); ?></textarea></td>
+ <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><?php echo esc_textarea( wp_get_attachment_url() ); ?></textarea></td>
</tr>
<?php if ( $icon ) : ?>
<tr>
/**
- * Print out <option> html elements for role selectors based on $wp_roles
+ * Print out <option> html elements for role selectors
*
- * @package WordPress
- * @subpackage Administration
- * @since 2.1
+ * @since 2.1.0
*
- * @uses $wp_roles
- * @param string $default slug for the role that should be already selected
+ * @param string $selected slug for the role that should be already selected
*/
function wp_dropdown_roles( $selected = false ) {
$p = '';
foreach ( $editable_roles as $role => $details ) {
$name = translate_user_role($details['name'] );
- if ( $selected == $role ) // Make default first in list
+ if ( $selected == $role ) // preselect specified role
$p = "\n\t<option selected='selected' value='" . esc_attr($role) . "'>$name</option>";
else
$r .= "\n\t<option value='" . esc_attr($role) . "'>$name</option>";
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.3.0
*
* @param unknown_type $size
* @return unknown
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.3.0
*
* @param unknown_type $bytes
* @return unknown
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @return unknown
*/
/**
* Outputs the form used by the importers to accept the data to be imported
*
- * @since 2.0
+ * @since 2.0.0
*
* @param string $action The action attribute for the form.
*/
<input type="hidden" name="action" value="save" />
<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
</p>
-<p class="submit">
-<input type="submit" class="button" value="<?php esc_attr_e( 'Upload file and import' ); ?>" />
-</p>
+<?php submit_button( __('Upload file and import'), 'button' ); ?>
</form>
<?php
endif;
$wp_meta_boxes[$page][$context] = array();
foreach ( array_keys($wp_meta_boxes[$page]) as $a_context ) {
- foreach ( array('high', 'core', 'default', 'low') as $a_priority ) {
- if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) )
- continue;
-
- // If a core box was previously added or removed by a plugin, don't add.
- if ( 'core' == $priority ) {
- // If core box previously deleted, don't add
- if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] )
+ foreach ( array('high', 'core', 'default', 'low') as $a_priority ) {
+ if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) )
+ continue;
+
+ // If a core box was previously added or removed by a plugin, don't add.
+ if ( 'core' == $priority ) {
+ // If core box previously deleted, don't add
+ if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] )
+ return;
+ // If box was added with default priority, give it core priority to maintain sort order
+ if ( 'default' == $a_priority ) {
+ $wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id];
+ unset($wp_meta_boxes[$page][$a_context]['default'][$id]);
+ }
return;
- // If box was added with default priority, give it core priority to maintain sort order
- if ( 'default' == $a_priority ) {
- $wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id];
- unset($wp_meta_boxes[$page][$a_context]['default'][$id]);
}
- return;
- }
- // If no priority given and id already present, use existing priority
- if ( empty($priority) ) {
- $priority = $a_priority;
- // else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority.
- } elseif ( 'sorted' == $priority ) {
- $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title'];
- $callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback'];
- $callback_args = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['args'];
+ // If no priority given and id already present, use existing priority
+ if ( empty($priority) ) {
+ $priority = $a_priority;
+ // else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority.
+ } elseif ( 'sorted' == $priority ) {
+ $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title'];
+ $callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback'];
+ $callback_args = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['args'];
+ }
+ // An id can be in only one priority and one context
+ if ( $priority != $a_priority || $context != $a_context )
+ unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]);
}
- // An id can be in only one priority and one context
- if ( $priority != $a_priority || $context != $a_context )
- unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]);
- }
}
if ( empty($priority) )
$style = '';
$hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : '';
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n";
- echo '<div class="handlediv" title="' . __('Click to toggle') . '"><br /></div>';
+ echo '<div class="handlediv" title="' . esc_attr__('Click to toggle') . '"><br /></div>';
echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n";
echo '<div class="inside">' . "\n";
call_user_func($box['callback'], $object, $box);
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.7.0
*
* @param unknown_type $screen
*/
/**
* Get Hidden Meta Boxes
*
- * @since 2.7
+ * @since 2.7.0
*
* @param string|object $screen Screen identifier
* @return array Hidden Meta Boxes
$hidden = get_user_option( "metaboxhidden_{$screen->id}" );
// Hide slug boxes by default
- if ( !is_array( $hidden ) )
- $hidden = array('slugdiv');
+ if ( !is_array( $hidden ) ) {
+ if ( 'post' == $screen->base || 'page' == $screen->base )
+ $hidden = array('slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv');
+ else
+ $hidden = array( 'slugdiv' );
+ $hidden = apply_filters('default_hidden_meta_boxes', $hidden, $screen);
+ }
return $hidden;
}
*
* @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
+ * @since 2.7.0
*
* @param string $page The slug name of the page whos settings sections you want to output
*/
*
* @global $wp_settings_fields Storage array of settings fields and their pages/sections
*
- * @since unknown
+ * @since 2.7.0
*
* @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.
* Additional calls to settings_errors() can be used to show errors even when the settings
* page is first accessed.
*
+ * @since 3.0.0
+ *
* @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
* 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
+ * If changes were just submitted ($_GET['settings-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.
*
* 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)
*
+ * @since 3.0.0
+ *
* @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.
// 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') ) {
+ if ( isset($_GET['settings-updated']) && $_GET['settings-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
* 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.
*
+ * @since 3.0.0
+ *
* @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 <type>
*/
-function settings_errors ( $setting = '', $sanitize = FALSE, $hide_on_update = FALSE ) {
+function settings_errors( $setting = '', $sanitize = FALSE, $hide_on_update = FALSE ) {
- if ($hide_on_update AND $_GET['updated']) return;
+ if ($hide_on_update AND $_GET['settings-updated']) return;
$settings_errors = get_settings_errors( $setting, $sanitize );
/**
* {@internal Missing Short Description}}
*
- * @since unknown
- *
- * @param unknown_type $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 or they are special
- if ( in_array( $column, $special ) )
- continue;
- if ( empty( $title ) )
- continue;
-
- if ( 'comments' == $column )
- $title = __( 'Comments' );
- $id = "$column-hide";
- echo '<label for="' . $id . '">';
- echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . (! in_array($column, $hidden) ? ' checked="checked"' : '') . ' />';
- echo "$title</label>\n";
- }
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
+ * @since 2.7.0
*
* @param unknown_type $found_action
*/
<?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?>
<label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label>
<input type="text" id="find-posts-input" name="ps" value="" />
- <input type="button" onclick="findPosts.send();" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br />
+ <input type="button" id="find-posts-search" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br />
<?php
$post_types = get_post_types( array('public' => true), 'objects' );
<div id="find-posts-response"></div>
</div>
<div class="find-box-buttons">
- <input type="button" class="button alignleft" onclick="findPosts.close();" value="<?php esc_attr_e('Close'); ?>" />
- <input id="find-posts-submit" type="submit" class="button-primary alignright" value="<?php esc_attr_e('Select'); ?>" />
+ <input id="find-posts-close" type="button" class="button alignleft" value="<?php esc_attr_e('Close'); ?>" />
+ <?php submit_button( __( 'Select' ), 'button-primary alignright', 'find-posts-submit', false ); ?>
</div>
</div>
<?php
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.7.0
*/
function favorite_actions( $screen = null ) {
$default_action = false;
if ( is_string($screen) )
$screen = convert_to_screen($screen);
+ if ( $screen->is_user )
+ return;
+
if ( isset($screen->post_type) ) {
$post_type_object = get_post_type_object($screen->post_type);
if ( 'add' != $screen->action )
}
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;
+ if ( $screen->is_network ) {
+ $default_action = array('sites.php' => array( __('Sites'), 'manage_sites'));
+ } else {
+ 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'),
- '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')
+ if ( !$screen->is_network ) {
+ $actions = array(
+ 'post-new.php' => array(__('New Post'), 'edit_posts'),
+ 'edit.php?post_status=draft' => array(__('Drafts'), 'edit_posts'),
+ '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')
+ );
+ } else {
+ $actions = array(
+ 'sites.php' => array( __('Sites'), 'manage_sites'),
+ 'users.php' => array( __('Users'), 'manage_network_users')
);
+ }
$default_key = array_keys($default_action);
$default_key = $default_key[0];
if ( isset($actions[$default_key]) )
unset($actions[$default_key]);
$actions = array_merge($default_action, $actions);
- $actions = apply_filters('favorite_actions', $actions);
+ $actions = apply_filters( 'favorite_actions', $actions, $screen );
$allowed_actions = array();
foreach ( $actions as $action => $data ) {
* returned.
*
* @since 2.7.0
- * @param int $id The post id. If not supplied the global $post is used.
- *
+ * @param int $post_id The post id. If not supplied the global $post is used.
+ * @return string The post title if set
*/
-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)');
*
*/
function _admin_search_query() {
- echo isset($_GET['s']) ? esc_attr( stripslashes( $_GET['s'] ) ) : '';
+ echo isset($_REQUEST['s']) ? esc_attr( stripslashes( $_REQUEST['s'] ) ) : '';
}
/**
*
*/
function iframe_header( $title = '', $limit_styles = false ) {
-global $hook_suffix;
+ show_admin_bar( false );
+ global $hook_suffix, $current_screen, $current_user, $admin_body_class, $wp_locale;
+ $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
+ $admin_body_class .= ' iframe';
+
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
<head>
//<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}
+var userSettings = {
+ 'url': '<?php echo SITECOOKIEPATH; ?>',
+ 'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>',
+ 'time':'<?php echo time() ?>'
+ },
+ ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>',
+ pagenow = '<?php echo $current_screen->id; ?>',
+ typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>',
+ adminpage = '<?php echo $admin_body_class; ?>',
+ thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>',
+ decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
+ isRtl = <?php echo (int) is_rtl(); ?>;
//]]>
</script>
<?php
+do_action('admin_enqueue_scripts', $hook_suffix);
+do_action("admin_print_styles-$hook_suffix");
do_action('admin_print_styles');
+do_action("admin_print_scripts-$hook_suffix");
do_action('admin_print_scripts');
+do_action("admin_head-$hook_suffix");
do_action('admin_head');
-
-$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
?>
</head>
<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="no-js <?php echo $admin_body_class; ?>">
echo "<span class='post-state'>$state$sep</span>";
}
}
+
+ if ( get_post_format( $post->ID ) )
+ echo ' - <span class="post-state-format">' . get_post_format_string( get_post_format( $post->ID ) ) . '</span>';
}
/**
* @return object An object containing the safe screen name and id
*/
function convert_to_screen( $screen ) {
- $screen = str_replace( array('.php', '-new', '-add' ), '', $screen);
+ $screen = str_replace( array('.php', '-new', '-add', '-network', '-user' ), '', $screen);
+
+ if ( is_network_admin() )
+ $screen .= '-network';
+ elseif ( is_user_admin() )
+ $screen .= '-user';
+
$screen = (string) apply_filters( 'screen_meta_screen', $screen );
$screen = (object) array('id' => $screen, 'base' => $screen);
return $screen;
}
function screen_meta($screen) {
- global $wp_meta_boxes, $_wp_contextual_help, $title;
+ global $wp_meta_boxes, $_wp_contextual_help, $wp_list_table, $wp_current_screen_options;
if ( is_string($screen) )
$screen = convert_to_screen($screen);
- $column_screens = get_column_headers($screen);
+ $columns = get_column_headers( $screen );
+ $hidden = get_hidden_columns( $screen );
+
$meta_screens = array('index' => 'dashboard');
if ( isset($meta_screens[$screen->id]) ) {
}
$show_screen = false;
- if ( !empty($wp_meta_boxes[$screen->id]) || !empty($column_screens) )
+ if ( !empty($wp_meta_boxes[$screen->id]) || !empty($columns) )
$show_screen = true;
$screen_options = screen_options($screen);
$show_screen = true;
break;
}
- if( ! empty( $settings ) )
+ if ( ! empty( $settings ) )
$show_screen = true;
+
+ if ( !empty($wp_current_screen_options) )
+ $show_screen = true;
+
?>
<div id="screen-meta">
<?php if ( $show_screen ) : ?>
<br class="clear" />
</div>
<?php endif;
- if ( ! empty($column_screens) ) : ?>
- <h5><?php echo ( isset( $column_screens['_title'] ) ? $column_screens['_title'] : _x('Show on screen', 'Columns') ) ?></h5>
+ if ( ! empty($columns) ) : ?>
+ <h5><?php echo ( isset( $columns['_title'] ) ? $columns['_title'] : _x('Show on screen', 'Columns') ) ?></h5>
<div class="metabox-prefs">
- <?php manage_columns_prefs($screen); ?>
+<?php
+ $special = array('_title', 'cb', 'comment', 'media', 'name', 'title', 'username', 'blogname');
+
+ foreach ( $columns as $column => $title ) {
+ // Can't hide these for they are special
+ if ( in_array( $column, $special ) )
+ continue;
+ if ( empty( $title ) )
+ continue;
+
+ if ( 'comments' == $column )
+ $title = __( 'Comments' );
+ $id = "$column-hide";
+ echo '<label for="' . $id . '">';
+ echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( !in_array($column, $hidden), true, false ) . ' />';
+ echo "$title</label>\n";
+ }
+?>
<br class="clear" />
</div>
<?php endif;
$_wp_contextual_help[$screen->id] = $help;
}
-function drag_drop_help() {
- return '
- <p>' . __('Most of the modules on this screen can be moved. If you hover your mouse over the title bar of a module you’ll notice the 4 arrow cursor appears to let you know it is movable. Click on it, hold down the mouse button and start dragging the module to a new location. As you drag the module, notice the dotted gray box that also moves. This box indicates where the module will be placed when you release the mouse button.') . '</p>
- <p>' . __('The same modules can be expanded and collapsed by clicking once on their title bar and also completely hidden from the Screen Options tab.') . '</p>
-';
-}
-
-function plugins_search_help() {
- return '
- <p><strong>' . __('Search help') . '</strong></p>' .
- '<p>' . __('You may search based on 3 criteria:') . '<br />' .
- __('<strong>Term:</strong> Searches theme names and descriptions for the specified term.') . '<br />' .
- __('<strong>Tag:</strong> Searches for themes tagged as such.') . '<br />' .
- __('<strong>Author:</strong> Searches for themes created by the Author, or which the Author contributed to.') . '</p>
-';
-}
-
function screen_layout($screen) {
- global $screen_layout_columns;
+ global $screen_layout_columns, $wp_current_screen_options;
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;
-
- $columns = apply_filters('screen_layout_columns', $columns, $screen->id, $screen);
+ // Back compat for plugins using the filter instead of add_screen_option()
+ $columns = apply_filters('screen_layout_columns', array(), $screen->id, $screen);
+ if ( !empty($columns) && isset($columns[$screen->id]) )
+ add_screen_option('layout_columns', array('max' => $columns[$screen->id]) );
- if ( !isset($columns[$screen->id]) ) {
+ if ( !isset($wp_current_screen_options['layout_columns']) ) {
$screen_layout_columns = 0;
return '';
- }
+ }
$screen_layout_columns = get_user_option("screen_layout_$screen->id");
- $num = $columns[$screen->id];
+ $num = $wp_current_screen_options['layout_columns']['max'];
- if ( ! $screen_layout_columns )
+ if ( ! $screen_layout_columns ) {
+ if ( isset($wp_current_screen_options['layout_columns']['default']) )
+ $screen_layout_columns = $wp_current_screen_options['layout_columns']['default'];
+ else
$screen_layout_columns = 2;
+ }
$i = 1;
$return = '<h5>' . __('Screen Layout') . "</h5>\n<div class='columns-prefs'>" . __('Number of Columns:') . "\n";
return $return;
}
+/**
+ * Register and configure an admin screen option
+ *
+ * @since 3.1.0
+ *
+ * @param string $option An option name.
+ * @param mixed $args Option dependent arguments
+ * @return void
+ */
+function add_screen_option( $option, $args = array() ) {
+ global $wp_current_screen_options;
+
+ if ( !isset($wp_current_screen_options) )
+ $wp_current_screen_options = array();
+
+ $wp_current_screen_options[$option] = $args;
+}
+
function screen_options($screen) {
+ global $wp_current_screen_options;
+
if ( is_string($screen) )
$screen = convert_to_screen($screen);
- switch ( $screen->base ) {
- case 'edit':
- case 'edit-pages':
- $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 = _x( 'Comments', 'comments per page (screen options)' );
- break;
- case 'upload':
- $per_page_label = _x( 'Media items', 'items per page (screen options)' );
- break;
- case 'edit-tags':
- global $tax;
- $per_page_label = $tax->labels->name;
- break;
- case 'plugins':
- $per_page_label = _x( 'Plugins', 'plugins per page (screen options)' );
- break;
- default:
- return '';
- }
+ if ( !isset($wp_current_screen_options['per_page']) )
+ return '';
+
+ $per_page_label = $wp_current_screen_options['per_page']['label'];
- $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';
+ if ( empty($wp_current_screen_options['per_page']['option']) ) {
+ $option = str_replace( '-', '_', "{$screen->id}_per_page" );
+ } else {
+ $option = $wp_current_screen_options['per_page']['option'];
}
$per_page = (int) get_user_option( $option );
if ( empty( $per_page ) || $per_page < 1 ) {
- if ( 'plugins' == $screen->id )
- $per_page = 999;
+ if ( isset($wp_current_screen_options['per_page']['default']) )
+ $per_page = $wp_current_screen_options['per_page']['default'];
else
$per_page = 20;
}
else
$per_page = apply_filters( $option, $per_page );
+ // Back compat
+ if ( isset( $screen->post_type ) )
+ $per_page = apply_filters( 'edit_posts_per_page', $per_page, $screen->post_type );
+
$return = "<div class='screen-options'>\n";
if ( !empty($per_page_label) )
$return .= "<input type='text' class='screen-per-page' name='wp_screen_options[value]' id='$option' maxlength='3' value='$per_page' /> <label for='$option'>$per_page_label</label>\n";
- $return .= "<input type='submit' class='button' value='" . esc_attr__('Apply') . "' />";
+ $return .= get_submit_button( __( 'Apply' ), 'button', 'screen-options-apply', false );
$return .= "<input type='hidden' name='wp_screen_options[option]' value='" . esc_attr($option) . "' />";
$return .= "</div>\n";
return $return;
}
function screen_icon($screen = '') {
- global $current_screen;
+ global $current_screen, $typenow;
if ( empty($screen) )
$screen = $current_screen;
elseif ( is_string($screen) )
$name = $screen;
+ $class = 'icon32';
+
if ( empty($name) ) {
if ( !empty($screen->parent_base) )
$name = $screen->parent_base;
if ( 'edit' == $name && isset($screen->post_type) && 'page' == $screen->post_type )
$name = 'edit-pages';
+
+ $post_type = '';
+ if ( isset( $screen->post_type ) )
+ $post_type = $screen->post_type;
+ elseif ( $current_screen == $screen )
+ $post_type = $typenow;
+ if ( $post_type )
+ $class .= ' ' . sanitize_html_class( 'icon32-posts-' . $post_type );
}
?>
- <div id="icon-<?php echo $name; ?>" class="icon32"><br /></div>
+ <div id="icon-<?php echo $name; ?>" class="<?php echo $class; ?>"><br /></div>
<?php
}
}
}
- x.open('GET', 'admin-ajax.php?action=wp-compression-test&test='+test+'&'+(new Date()).getTime(), true);
+ x.open('GET', ajaxurl + '?action=wp-compression-test&test='+test+'&'+(new Date()).getTime(), true);
x.send('');
}
},
<?php
}
+/**
+ * Get the current screen object
+ *
+ * @since 3.1.0
+ *
+ * @return object Current screen object
+ */
+function get_current_screen() {
+ global $current_screen;
+
+ if ( !isset($current_screen) )
+ return null;
+
+ return $current_screen;
+}
+
/**
* Set the current screen object
*
$current_screen->taxonomy = $taxnow;
}
+ $current_screen->is_network = is_network_admin();
+ $current_screen->is_user = is_user_admin();
+
+ if ( $current_screen->is_network ) {
+ $current_screen->base .= '-network';
+ $current_screen->id .= '-network';
+ } elseif ( $current_screen->is_user ) {
+ $current_screen->base .= '-user';
+ $current_screen->id .= '-user';
+ }
+
$current_screen = apply_filters('current_screen', $current_screen);
}
-?>
+/**
+ * Echos a submit button, with provided text and appropriate class
+ *
+ * @since 3.1.0
+ *
+ * @param string $text The text of the button (defaults to 'Save Changes')
+ * @param string $type The type of button. One of: primary, secondary, delete
+ * @param string $name The HTML name of the submit button. Defaults to "submit". If no id attribute
+ * is given in $other_attributes below, $name will be used as the button's id.
+ * @param bool $wrap True if the output button should be wrapped in a paragraph tag,
+ * false otherwise. Defaults to true
+ * @param array|string $other_attributes Other attributes that should be output with the button,
+ * mapping attributes to their values, such as array( 'tabindex' => '1' ).
+ * These attributes will be ouput as attribute="value", such as tabindex="1".
+ * Defaults to no other attributes. Other attributes can also be provided as a
+ * string such as 'tabindex="1"', though the array format is typically cleaner.
+ */
+function submit_button( $text = NULL, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = NULL ) {
+ echo get_submit_button( $text, $type, $name, $wrap, $other_attributes );
+}
+
+/**
+ * Returns a submit button, with provided text and appropriate class
+ *
+ * @since 3.1.0
+ *
+ * @param string $text The text of the button (defaults to 'Save Changes')
+ * @param string $type The type of button. One of: primary, secondary, delete
+ * @param string $name The HTML name of the submit button. Defaults to "submit". If no id attribute
+ * is given in $other_attributes below, $name will be used as the button's id.
+ * @param bool $wrap True if the output button should be wrapped in a paragraph tag,
+ * false otherwise. Defaults to true
+ * @param array|string $other_attributes Other attributes that should be output with the button,
+ * mapping attributes to their values, such as array( 'tabindex' => '1' ).
+ * These attributes will be ouput as attribute="value", such as tabindex="1".
+ * Defaults to no other attributes. Other attributes can also be provided as a
+ * string such as 'tabindex="1"', though the array format is typically cleaner.
+ */
+function get_submit_button( $text = NULL, $type = 'primary', $name = 'submit', $wrap = true, $other_attributes = NULL ) {
+ switch ( $type ) :
+ case 'primary' :
+ case 'secondary' :
+ $class = 'button-' . $type;
+ break;
+ case 'delete' :
+ $class = 'button-secondary delete';
+ break;
+ default :
+ $class = $type; // Custom cases can just pass in the classes they want to be used
+ endswitch;
+ $text = ( NULL == $text ) ? __( 'Save Changes' ) : $text;
+
+ // Default the id attribute to $name unless an id was specifically provided in $other_attributes
+ $id = $name;
+ if ( is_array( $other_attributes ) && isset( $other_attributes['id'] ) ) {
+ $id = $other_attributes['id'];
+ unset( $other_attributes['id'] );
+ }
+
+ $attributes = '';
+ if ( is_array( $other_attributes ) ) {
+ foreach ( $other_attributes as $attribute => $value ) {
+ $attributes .= $attribute . '="' . esc_attr( $value ) . '" '; // Trailing space is important
+ }
+ } else if ( !empty( $other_attributes ) ) { // Attributes provided as a string
+ $attributes = $other_attributes;
+ }
+
+ $button = '<input type="submit" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" class="' . esc_attr( $class );
+ $button .= '" value="' . esc_attr( $text ) . '" ' . $attributes . ' />';
+
+ if ( $wrap ) {
+ $button = '<p class="submit">' . $button . '</p>';
+ }
+
+ return $button;
+}
+
'tags' => true, 'num_ratings' => true
);
-
-/**
- * Retrieve theme installer pages from WordPress Themes API.
- *
- * It is possible for a theme to override the Themes API result with three
- * filters. Assume this is for themes, which can extend on the Theme Info to
- * offer more choices. This is very powerful and must be used with care, when
- * overridding the filters.
- *
- * The first filter, 'themes_api_args', is for the args and gives the action as
- * the second parameter. The hook for 'themes_api_args' must ensure that an
- * object is returned.
- *
- * The second filter, 'themes_api', is the result that would be returned.
- *
- * @since 2.8.0
- *
- * @param string $action
- * @param array|object $args Optional. Arguments to serialize for the Theme Info API.
- * @return mixed
- */
-function themes_api($action, $args = null) {
-
- if ( is_array($args) )
- $args = (object)$args;
-
- if ( !isset($args->per_page) )
- $args->per_page = 24;
-
- $args = apply_filters('themes_api_args', $args, $action); //NOTE: Ensure that an object is returned via this filter.
- $res = apply_filters('themes_api', false, $action, $args); //NOTE: Allows a theme to completely override the builtin WordPress.org API.
-
- if ( ! $res ) {
- $request = wp_remote_post('http://api.wordpress.org/themes/info/1.0/', array( 'body' => array('action' => $action, 'request' => serialize($args))) );
- if ( is_wp_error($request) ) {
- $res = new WP_Error('themes_api_failed', __('An Unexpected HTTP Error occured during the API request.</p> <p><a href="?" onclick="document.location.reload(); return false;">Try again</a>'), $request->get_error_message() );
- } else {
- $res = unserialize($request['body']);
- if ( ! $res )
- $res = new WP_Error('themes_api_failed', __('An unknown error occured'), $request['body']);
- }
- }
- //var_dump(array($args, $res));
- return apply_filters('themes_api_result', $res, $action, $args);
-}
-
/**
* Retrieve list of WordPress theme features (aka theme tags)
*
* @since 2.8.0
*
+ * @deprecated since 3.1.0 Use get_theme_feature_list() instead.
+ *
* @return array
*/
function install_themes_feature_list( ) {
return $feature_list;
}
-add_action('install_themes_search', 'install_theme_search', 10, 1);
-/**
- * Display theme search results
- *
- * @since 2.8.0
- *
- * @param string $page
- */
-function install_theme_search($page) {
- global $theme_field_defaults;
-
- $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
- $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
-
- $args = array();
-
- switch( $type ){
- case 'tag':
- $terms = explode(',', $term);
- $terms = array_map('trim', $terms);
- $terms = array_map('sanitize_title_with_dashes', $terms);
- $args['tag'] = $terms;
- break;
- case 'term':
- $args['search'] = $term;
- break;
- case 'author':
- $args['author'] = $term;
- break;
- }
-
- $args['page'] = $page;
- $args['fields'] = $theme_field_defaults;
-
- if ( !empty( $_POST['features'] ) ) {
- $terms = $_POST['features'];
- $terms = array_map( 'trim', $terms );
- $terms = array_map( 'sanitize_title_with_dashes', $terms );
- $args['tag'] = $terms;
- $_REQUEST['s'] = implode( ',', $terms );
- $_REQUEST['type'] = 'tag';
- }
-
- $api = themes_api('query_themes', $args);
-
- if ( is_wp_error($api) )
- wp_die($api);
-
- add_action('install_themes_table_header', 'install_theme_search_form');
-
- display_themes($api->themes, $api->info['page'], $api->info['pages']);
-}
-
/**
* Display search form for searching themes.
*
?>
<p class="install-help"><?php _e('Search for themes by keyword, author, or tag.') ?></p>
-<form id="search-themes" method="post" action="<?php echo admin_url( 'theme-install.php?tab=search' ); ?>">
+<form id="search-themes" method="get" action="">
+ <input type="hidden" name="tab" value="search" />
<select name="type" id="typeselector">
<option value="term" <?php selected('term', $type) ?>><?php _e('Term'); ?></option>
<option value="author" <?php selected('author', $type) ?>><?php _e('Author'); ?></option>
<option value="tag" <?php selected('tag', $type) ?>><?php _ex('Tag', 'Theme Installer'); ?></option>
</select>
<input type="text" name="s" size="30" value="<?php echo esc_attr($term) ?>" />
- <input type="submit" name="search" value="<?php esc_attr_e('Search'); ?>" class="button" />
+ <?php submit_button( __( 'Search' ), 'button', 'search', false ); ?>
</form>
<?php
}
-add_action('install_themes_dashboard', 'install_themes_dashboard');
/**
* Display tags filter for themes.
*
install_theme_search_form();
?>
<h4><?php _e('Feature Filter') ?></h4>
-<form method="post" action="<?php echo admin_url( 'theme-install.php?tab=search' ); ?>">
+<form method="post" action="<?php echo self_admin_url( 'theme-install.php?tab=search' ); ?>">
<p class="install-help"><?php _e('Find a theme based on specific features') ?></p>
<?php
- $feature_list = install_themes_feature_list( );
+ $feature_list = get_theme_feature_list( );
echo '<div class="feature-filter">';
- $trans = array ('Colors' => __('Colors'), 'black' => __('Black'), 'blue' => __('Blue'), 'brown' => __('Brown'),
- 'green' => __('Green'), 'orange' => __('Orange'), 'pink' => __('Pink'), 'purple' => __('Purple'), 'red' => __('Red'),
- 'silver' => __('Silver'), 'tan' => __('Tan'), 'white' => __('White'), 'yellow' => __('Yellow'), 'dark' => __('Dark'),
- 'light' => __('Light'), 'Columns' => __('Columns'), 'one-column' => __('One Column'), 'two-columns' => __('Two Columns'),
- 'three-columns' => __('Three Columns'), 'four-columns' => __('Four Columns'), 'left-sidebar' => __('Left Sidebar'),
- 'right-sidebar' => __('Right Sidebar'), 'Width' => __('Width'), 'fixed-width' => __('Fixed Width'), 'flexible-width' => __('Flexible Width'),
- 'Features' => __('Features'), 'custom-colors' => __('Custom Colors'), 'custom-header' => __('Custom Header'), 'theme-options' => __('Theme Options'),
- 'threaded-comments' => __('Threaded Comments'), 'sticky-post' => __('Sticky Post'), 'microformats' => __('Microformats'),
- 'Subject' => __('Subject'), 'holiday' => __('Holiday'), 'photoblogging' => __('Photoblogging'), 'seasonal' => __('Seasonal'),
- );
foreach ( (array) $feature_list as $feature_name => $features ) {
- if ( isset($trans[$feature_name]) )
- $feature_name = $trans[$feature_name];
$feature_name = esc_html( $feature_name );
echo '<div class="feature-name">' . $feature_name . '</div>';
- echo '<ol style="float: left; width: 725px;" class="feature-group">';
- foreach ( $features as $feature ) {
- $feature_name = $feature;
- if ( isset($trans[$feature]) )
- $feature_name = $trans[$feature];
+ echo '<ol class="feature-group">';
+ foreach ( $features as $feature => $feature_name ) {
$feature_name = esc_html( $feature_name );
$feature = esc_attr($feature);
?>
</div>
<br class="clear" />
-<p><input type="submit" name="search" value="<?php esc_attr_e('Find Themes'); ?>" class="button" /></p>
+<?php submit_button( __( 'Find Themes' ), 'button', 'search' ); ?>
</form>
<?php
}
+add_action('install_themes_dashboard', 'install_themes_dashboard');
-add_action('install_themes_featured', 'install_themes_featured', 10, 1);
-/**
- * Display featured themes.
- *
- * @since 2.8.0
- *
- * @param string $page
- */
-function install_themes_featured($page = 1) {
- global $theme_field_defaults;
- $args = array('browse' => 'featured', 'page' => $page, 'fields' => $theme_field_defaults);
- $api = themes_api('query_themes', $args);
- if ( is_wp_error($api) )
- wp_die($api);
- display_themes($api->themes, $api->info['page'], $api->info['pages']);
-}
-
-add_action('install_themes_new', 'install_themes_new', 10, 1);
-/**
- * Display new themes/
- *
- * @since 2.8.0
- *
- * @param string $page
- */
-function install_themes_new($page = 1) {
- global $theme_field_defaults;
- $args = array('browse' => 'new', 'page' => $page, 'fields' => $theme_field_defaults);
- $api = themes_api('query_themes', $args);
- if ( is_wp_error($api) )
- wp_die($api);
- display_themes($api->themes, $api->info['page'], $api->info['pages']);
-}
-
-add_action('install_themes_updated', 'install_themes_updated', 10, 1);
-/**
- * Display recently updated themes.
- *
- * @since 2.8.0
- *
- * @param string $page
- */
-function install_themes_updated($page = 1) {
- global $theme_field_defaults;
- $args = array('browse' => 'updated', 'page' => $page, 'fields' => $theme_field_defaults);
- $api = themes_api('query_themes', $args);
- display_themes($api->themes, $api->info['page'], $api->info['pages']);
-}
-
-add_action('install_themes_upload', 'install_themes_upload', 10, 1);
function install_themes_upload($page = 1) {
?>
<h4><?php _e('Install a theme in .zip format') ?></h4>
<p class="install-help"><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.') ?></p>
-<form method="post" enctype="multipart/form-data" action="<?php echo admin_url('update.php?action=upload-theme') ?>">
+<form method="post" enctype="multipart/form-data" action="<?php echo self_admin_url('update.php?action=upload-theme') ?>">
<?php wp_nonce_field( 'theme-upload') ?>
<input type="file" name="themezip" />
- <input type="submit"
- class="button" value="<?php esc_attr_e('Install Now') ?>" />
+ <?php submit_button( __( 'Install Now' ), 'button', 'install-theme-submit', false ); ?>
</form>
<?php
}
+add_action('install_themes_upload', 'install_themes_upload', 10, 1);
function display_theme($theme, $actions = null, $show_details = true) {
global $themes_allowedtags;
$preview_link = $theme->preview_url . '?TB_iframe=true&width=600&height=400';
if ( !is_array($actions) ) {
$actions = array();
- $actions[] = '<a href="' . admin_url('theme-install.php?tab=theme-information&theme=' . $theme->slug .
+ $actions[] = '<a href="' . self_admin_url('theme-install.php?tab=theme-information&theme=' . $theme->slug .
'&TB_iframe=true&tbWidth=500&tbHeight=385') . '" class="thickbox thickbox-preview onclick" title="' . esc_attr(sprintf(__('Install “%s”'), $name)) . '">' . __('Install') . '</a>';
- $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview onclick previewlink" title="' . esc_attr(sprintf(__('Preview “%s”'), $name)) . '">' . __('Preview') . '</a>';
+ if ( !is_network_admin() )
+ $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview onclick previewlink" title="' . esc_attr(sprintf(__('Preview “%s”'), $name)) . '">' . __('Preview') . '</a>';
$actions = apply_filters('theme_install_action_links', $actions, $theme);
}
* Display theme content based on theme list.
*
* @since 2.8.0
- *
- * @param array $themes List of themes.
- * @param string $page
- * @param int $totalpages Number of pages.
*/
-function display_themes($themes, $page = 1, $totalpages = 1) {
- $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : '';
- $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
- ?>
-<div class="tablenav">
-<div class="alignleft actions"><?php do_action('install_themes_table_header'); ?></div>
- <?php
- $url = esc_url($_SERVER['REQUEST_URI']);
- if ( ! empty($term) )
- $url = add_query_arg('s', $term, $url);
- if ( ! empty($type) )
- $url = add_query_arg('type', $type, $url);
-
- $page_links = paginate_links( array(
- 'base' => add_query_arg('paged', '%#%', $url),
- 'format' => '',
- 'prev_text' => __('«'),
- 'next_text' => __('»'),
- 'total' => $totalpages,
- 'current' => $page
- ));
-
- if ( $page_links )
- echo "\t\t<div class='tablenav-pages'>$page_links</div>";
- ?>
-</div>
-<br class="clear" />
-<?php
- if ( empty($themes) ) {
- _e('No themes found');
- return;
- }
-?>
-<table id="availablethemes" cellspacing="0" cellpadding="0">
-<?php
- $rows = ceil(count($themes) / 3);
- $table = array();
- $theme_keys = array_keys($themes);
- for ( $row = 1; $row <= $rows; $row++ )
- for ( $col = 1; $col <= 3; $col++ )
- $table[$row][$col] = array_shift($theme_keys);
-
- foreach ( $table as $row => $cols ) {
- ?>
- <tr>
- <?php
-
- foreach ( $cols as $col => $theme_index ) {
- $class = array('available-theme');
- if ( $row == 1 ) $class[] = 'top';
- if ( $col == 1 ) $class[] = 'left';
- if ( $row == $rows ) $class[] = 'bottom';
- if ( $col == 3 ) $class[] = 'right';
- ?>
- <td class="<?php echo join(' ', $class); ?>"><?php
- if ( isset($themes[$theme_index]) )
- display_theme($themes[$theme_index]);
- ?></td>
- <?php } // end foreach $cols ?>
- </tr>
- <?php } // end foreach $table ?>
-</table>
-
-<div class="tablenav"><?php if ( $page_links )
-echo "\t\t<div class='tablenav-pages'>$page_links</div>"; ?> <br
- class="clear" />
-</div>
+function display_themes() {
+ global $wp_list_table;
-<?php
+ $wp_list_table->display();
}
-
-add_action('install_themes_pre_theme-information', 'install_theme_information');
+add_action('install_themes_search', 'display_themes');
+add_action('install_themes_featured', 'display_themes');
+add_action('install_themes_new', 'display_themes');
+add_action('install_themes_updated', 'display_themes');
/**
* Display theme information in dialog box form.
default:
case 'install':
if ( current_user_can('install_themes') ) :
- $buttons .= '<a class="button-primary" id="install" href="' . wp_nonce_url(admin_url('update.php?action=install-theme&theme=' . $api->slug), 'install-theme_' . $api->slug) . '" target="_parent">' . __('Install Now') . '</a>';
+ $buttons .= '<a class="button-primary" id="install" href="' . wp_nonce_url(self_admin_url('update.php?action=install-theme&theme=' . $api->slug), 'install-theme_' . $api->slug) . '" target="_parent">' . __('Install Now') . '</a>';
endif;
break;
case 'update_available':
if ( current_user_can('update_themes') ) :
- $buttons .= '<a class="button-primary" id="install" href="' . wp_nonce_url(admin_url('update.php?action=upgrade-theme&theme=' . $update_file), 'upgrade-theme_' . $update_file) . '" target="_parent">' . __('Install Update Now') . '</a>';
+ $buttons .= '<a class="button-primary" id="install" href="' . wp_nonce_url(self_admin_url('update.php?action=upgrade-theme&theme=' . $update_file), 'upgrade-theme_' . $update_file) . '" target="_parent">' . __('Install Update Now') . '</a>';
endif;
break;
case 'newer_installed':
iframe_footer();
exit;
}
+add_action('install_themes_pre_theme-information', 'install_theme_information');
+
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.0.0
*
* @return unknown
*/
* @since 2.8.0
*
* @param string $template Template directory of the theme to delete
+ * @param string $redirect Redirect to page when complete.
* @return mixed
*/
-function delete_theme($template) {
+function delete_theme($template, $redirect = '') {
global $wp_filesystem;
if ( empty($template) )
return false;
ob_start();
- $url = wp_nonce_url('themes.php?action=delete&template=' . $template, 'delete-theme_' . $template);
- if ( false === ($credentials = request_filesystem_credentials($url)) ) {
+ if ( empty( $redirect ) )
+ $redirect = wp_nonce_url('themes.php?action=delete&template=' . $template, 'delete-theme_' . $template);
+ if ( false === ($credentials = request_filesystem_credentials($redirect)) ) {
$data = ob_get_contents();
ob_end_clean();
if ( ! empty($data) ){
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 1.5.0
*
* @return unknown
*/
/**
* Get the Page Templates available in this theme
*
- * @since unknown
+ * @since 1.5.0
*
* @return array Key is template name, Value is template name
*/
$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( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version']);
- else if ( empty($update['package']) )
- printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a> <em>automatic upgrade unavailable for this theme</em>.') . '</strong></p>', $theme_name, $details_url, $update['new_version']);
- else
- printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s Details</a> or <a href="%4$s" %5$s>upgrade automatically</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick );
+ $update_onclick = 'onclick="if ( confirm(\'' . esc_js( __("Updating this theme will lose any customizations you have made. 'Cancel' to stop, 'OK' to update.") ) . '\') ) {return true;}return false;"';
+
+ if ( !is_multisite() ) {
+ if ( ! current_user_can('update_themes') )
+ printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version']);
+ else if ( empty($update['package']) )
+ printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>. <em>Automatic update is unavailable for this theme.</em>') . '</strong></p>', $theme_name, $details_url, $update['new_version']);
+ else
+ printf( '<p><strong>' . __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a> or <a href="%4$s" %5$s>update automatically</a>.') . '</strong></p>', $theme_name, $details_url, $update['new_version'], $update_url, $update_onclick );
+ }
+ }
+}
+
+/**
+ * Retrieve list of WordPress theme features (aka theme tags)
+ *
+ * @since 3.1.0
+ *
+ * @return array Array of features keyed by category with translations keyed by slug.
+ */
+function get_theme_feature_list() {
+ // Hard-coded list is used if api not accessible.
+ $features = array(
+ __('Colors') => array(
+ 'black' => __( 'Black' ),
+ 'blue' => __( 'Blue' ),
+ 'brown' => __( 'Brown' ),
+ 'green' => __( 'Green' ),
+ 'orange' => __( 'Orange' ),
+ 'pink' => __( 'Pink' ),
+ 'purple' => __( 'Purple' ),
+ 'red' => __( 'Red' ),
+ 'silver' => __( 'Silver' ),
+ 'tan' => __( 'Tan' ),
+ 'white' => __( 'White' ),
+ 'yellow' => __( 'Yellow' ),
+ 'dark' => __( 'Dark' ),
+ 'light' => __( 'Light ')
+ ),
+
+ __('Columns') => array(
+ 'one-column' => __( 'One Column' ),
+ 'two-columns' => __( 'Two Columns' ),
+ 'three-columns' => __( 'Three Columns' ),
+ 'four-columns' => __( 'Four Columns' ),
+ 'left-sidebar' => __( 'Left Sidebar' ),
+ 'right-sidebar' => __( 'Right Sidebar' )
+ ),
+
+ __('Width') => array(
+ 'fixed-width' => __( 'Fixed Width' ),
+ 'flexible-width' => __( 'Flexible Width' )
+ ),
+
+ __( 'Features' ) => array(
+ 'blavatar' => __( 'Blavatar' ),
+ 'buddypress' => __( 'BuddyPress' ),
+ 'custom-background' => __( 'Custom Background' ),
+ 'custom-colors' => __( 'Custom Colors' ),
+ 'custom-header' => __( 'Custom Header' ),
+ 'custom-menu' => __( 'Custom Menu' ),
+ 'editor-style' => __( 'Editor Style' ),
+ 'front-page-post-form' => __( 'Front Page Posting' ),
+ 'microformats' => __( 'Microformats' ),
+ 'sticky-post' => __( 'Sticky Post' ),
+ 'theme-options' => __( 'Theme Options' ),
+ 'threaded-comments' => __( 'Threaded Comments' ),
+ 'translation-ready' => __( 'Translation Ready' ),
+ 'rtl-language-support' => __( 'RTL Language Support' )
+ ),
+
+ __( 'Subject' ) => array(
+ 'holiday' => __( 'Holiday' ),
+ 'photoblogging' => __( 'Photoblogging' ),
+ 'seasonal' => __( 'Seasonal' )
+ )
+ );
+
+ if ( !current_user_can('install_themes') )
+ return $features;
+
+ if ( !$feature_list = get_site_transient( 'wporg_theme_feature_list' ) )
+ set_site_transient( 'wporg_theme_feature_list', array( ), 10800);
+
+ if ( !$feature_list ) {
+ $feature_list = themes_api( 'feature_list', array( ) );
+ if ( is_wp_error( $feature_list ) )
+ return $features;
+ }
+
+ if ( !$feature_list )
+ return $features;
+
+ set_site_transient( 'wporg_theme_feature_list', $feature_list, 10800 );
+
+ $category_translations = array( 'Colors' => __('Colors'), 'Columns' => __('Columns'), 'Width' => __('Width'),
+ 'Features' => __('Features'), 'Subject' => __('Subject') );
+
+ // Loop over the wporg canonical list and apply translations
+ $wporg_features = array();
+ foreach ( (array) $feature_list as $feature_category => $feature_items ) {
+ if ( isset($category_translations[$feature_category]) )
+ $feature_category = $category_translations[$feature_category];
+ $wporg_features[$feature_category] = array();
+
+ foreach ( $feature_items as $feature ) {
+ if ( isset($features[$feature_category][$feature]) )
+ $wporg_features[$feature_category][$feature] = $features[$feature_category][$feature];
+ else
+ $wporg_features[$feature_category][$feature] = $feature;
+ }
+ }
+
+ return $wporg_features;
+}
+
+/**
+ * Retrieve theme installer pages from WordPress Themes API.
+ *
+ * It is possible for a theme to override the Themes API result with three
+ * filters. Assume this is for themes, which can extend on the Theme Info to
+ * offer more choices. This is very powerful and must be used with care, when
+ * overridding the filters.
+ *
+ * The first filter, 'themes_api_args', is for the args and gives the action as
+ * the second parameter. The hook for 'themes_api_args' must ensure that an
+ * object is returned.
+ *
+ * The second filter, 'themes_api', is the result that would be returned.
+ *
+ * @since 2.8.0
+ *
+ * @param string $action
+ * @param array|object $args Optional. Arguments to serialize for the Theme Info API.
+ * @return mixed
+ */
+function themes_api($action, $args = null) {
+
+ if ( is_array($args) )
+ $args = (object)$args;
+
+ if ( !isset($args->per_page) )
+ $args->per_page = 24;
+
+ $args = apply_filters('themes_api_args', $args, $action); //NOTE: Ensure that an object is returned via this filter.
+ $res = apply_filters('themes_api', false, $action, $args); //NOTE: Allows a theme to completely override the builtin WordPress.org API.
+
+ if ( ! $res ) {
+ $request = wp_remote_post('http://api.wordpress.org/themes/info/1.0/', array( 'body' => array('action' => $action, 'request' => serialize($args))) );
+ if ( is_wp_error($request) ) {
+ $res = new WP_Error('themes_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('themes_api_failed', __('An unknown error occurred.'), $request['body']);
+ }
}
+ //var_dump(array($args, $res));
+ return apply_filters('themes_api_result', $res, $action, $args);
}
?>
'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-add.png',
'wp-admin/images/browse-happy.gif',
'wp-admin/images/ico-viewpage.png',
+// 3.1
+'wp-includes/js/tinymce/blank.htm',
+'wp-includes/js/tinymce/plugins/safari',
+'wp-includes/js/tinymce/plugins/media',
+'wp-admin/edit-link-categories.php',
+'wp-admin/edit-post-rows.php',
+'wp-admin/edit-attachment-rows.php',
+'wp-admin/link-category.php',
+'wp-admin/edit-link-category-form.php',
+'wp-admin/sidebar.php',
+'wp-admin/images/list-vs.png',
+'wp-admin/images/button-grad-vs.png',
+'wp-admin/images/button-grad-active-vs.png',
+'wp-admin/images/fav-arrow-vs.gif',
+'wp-admin/images/fav-arrow-vs-rtl.gif',
+'wp-admin/images/fav-top-vs.gif',
+'wp-admin/images/screen-options-right.gif',
+'wp-admin/images/screen-options-right-up.gif',
+'wp-admin/images/visit-site-button-grad-vs.gif',
+'wp-admin/images/visit-site-button-grad.gif',
+'wp-includes/classes.php',
);
/**
$mysql_version = $wpdb->db_version();
$required_php_version = '4.3';
$required_mysql_version = '4.1.2';
- $wp_version = '3.0.6';
+ $wp_version = '3.1';
$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' );
switch ( $cur->response ) {
case 'development' :
- return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), $GLOBALS['wp_version'], 'update-core.php');
+ return sprintf( __( 'You are using a development version (%1$s). Cool! Please <a href="%2$s">stay updated</a>.' ), $GLOBALS['wp_version'], network_admin_url( 'update-core.php' ) );
break;
case 'upgrade' :
- return sprintf( '<strong>'.__( '<a href="%1$s">Get Version %2$s</a>' ).'</strong>', 'update-core.php', $cur->current);
+ return sprintf( '<strong>'.__( '<a href="%1$s">Get Version %2$s</a>' ).'</strong>', network_admin_url( 'update-core.php' ), $cur->current);
break;
case 'latest' :
if ( ! isset( $cur->response ) || $cur->response != 'upgrade' )
return false;
- if ( current_user_can('update_core') )
- $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s">Please update now</a>.'), $cur->current, 'update-core.php' );
- else
+ if ( current_user_can('update_core') ) {
+ $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s">Please update now</a>.'), $cur->current, network_admin_url( 'update-core.php' ) );
+ } else {
$msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! Please notify the site administrator.'), $cur->current );
-
+ }
echo "<div class='update-nag'>$msg</div>";
}
add_action( 'admin_notices', 'update_nag', 3 );
$cur = get_preferred_from_update_core();
$msg = sprintf( __('You are using <span class="b">WordPress %s</span>.'), $GLOBALS['wp_version'] );
- if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('update_core') )
- $msg .= " <a href='update-core.php' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
+
+ if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('update_core') ) {
+ $msg .= " <a href='" . network_admin_url( 'update-core.php' ) . "' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
+ }
echo "<span id='wp-version-message'>$msg</span>";
}
$plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
$plugin_name = wp_kses( $plugin_data['Name'], $plugins_allowedtags );
- $details_url = admin_url('plugin-install.php?tab=plugin-information&plugin=' . $r->slug . '&TB_iframe=true&width=600&height=800');
+ $details_url = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $r->slug . '&TB_iframe=true&width=600&height=800');
- echo '<tr class="plugin-update-tr"><td colspan="3" class="plugin-update"><div class="update-message">';
- if ( ! current_user_can('update_plugins') )
- printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s Details</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
- else if ( empty($r->package) )
- printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s Details</a> <em>automatic upgrade unavailable for this plugin</em>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
- else
- printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s Details</a> or <a href="%5$s">upgrade automatically</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version, wp_nonce_url('update.php?action=upgrade-plugin&plugin=' . $file, 'upgrade-plugin_' . $file) );
+ $wp_list_table = _get_list_table('WP_Plugins_List_Table');
+
+ if ( is_network_admin() || !is_multisite() ) {
+ echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
+ if ( ! current_user_can('update_plugins') )
+ printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
+ else if ( empty($r->package) )
+ printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
+ else
+ printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">update automatically</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version, wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin&plugin=') . $file, 'upgrade-plugin_' . $file) );
+ }
do_action( "in_plugin_update_message-$file", $plugin_data, $r );
return $upgrader->upgrade($theme);
}
+function wp_theme_update_rows() {
+ if ( !current_user_can('update_themes' ) )
+ return;
+
+ $themes = get_site_transient( 'update_themes' );
+ if ( isset($themes->response) && is_array($themes->response) ) {
+ $themes = array_keys( $themes->response );
+
+ foreach( $themes as $theme ) {
+ add_action( "after_theme_row_$theme", 'wp_theme_update_row', 10, 2 );
+ }
+ }
+}
+add_action( 'admin_init', 'wp_theme_update_rows' );
+
+function wp_theme_update_row( $theme_key, $theme ) {
+ $current = get_site_transient( 'update_themes' );
+ if ( !isset( $current->response[ $theme_key ] ) )
+ return false;
+ $r = $current->response[ $theme_key ];
+ $themes_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());
+ $theme_name = wp_kses( $theme['Name'], $themes_allowedtags );
+
+ $details_url = self_admin_url("theme-install.php?tab=theme-information&theme=$theme_key&TB_iframe=true&width=600&height=400");
+
+ $wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
+
+ echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
+ if ( ! current_user_can('update_themes') )
+ printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r->new_version );
+ else if ( empty( $r['package'] ) )
+ printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'] );
+ else
+ printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">update automatically</a>.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'], wp_nonce_url( self_admin_url('update.php?action=upgrade-theme&theme=') . $theme_key, 'upgrade-theme_' . $theme_key) );
+
+ do_action( "in_theme_update_message-$theme_key", $theme, $r );
+
+ echo '</div></td></tr>';
+}
function wp_update_core($current, $feedback = '') {
if ( !empty($feedback) )
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 2.1.0
*
* @param string $blog_title Blog title.
* @param string $user_name User's username.
$user_password = trim($user_password);
$email_password = false;
if ( !$user_id && empty($user_password) ) {
- $user_password = wp_generate_password();
+ $user_password = wp_generate_password( 12, false );
$message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.');
$user_id = wp_create_user($user_name, $user_password, $user_email);
update_user_option($user_id, 'default_password_nag', true, true);
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 2.1.0
*
* @param int $user_id User ID.
*/
));
// 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.');
+ $first_page = sprintf( __( "This is an example page. It's different from a blog post because it will stay in one place and will show up in your site navigation (in most themes). Most people start with an About page that introduces them to potential site visitors. It might say something like this:
+
+<blockquote>Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my blog. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin' caught in the rain.)</blockquote>
+
+...or something like this:
+
+<blockquote>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickies to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.</blockquote>
+
+As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to delete this page and create new pages for your content. Have fun!" ), admin_url() );
if ( is_multisite() )
$first_page = get_site_option( 'first_page', $first_page );
$first_post_guid = get_option('home') . '/?page_id=2';
'post_date_gmt' => $now_gmt,
'post_content' => $first_page,
'post_excerpt' => '',
- 'post_title' => __('About'),
+ 'post_title' => __( 'Sample Page' ),
/* translators: Default page slug */
- 'post_name' => _x('about', 'Default page slug'),
+ 'post_name' => __( 'sample-page' ),
'post_modified' => $now,
'post_modified_gmt' => $now_gmt,
'guid' => $first_post_guid,
));
$wpdb->insert( $wpdb->postmeta, array( 'post_id' => 2, 'meta_key' => '_wp_page_template', 'meta_value' => 'default' ) );
- // Setup default widgets for default theme.
+ // Set up 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 ) );
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 2.1.0
*
* @param string $blog_title Blog title.
* @param string $blog_url Blog url.
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 2.1.0
*
* @return null
*/
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 1.0.1
*/
function upgrade_all() {
global $wp_current_db_version, $wp_db_version, $wp_rewrite;
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 1.0.0
*
* @param string $table_name Database table name to create.
* @param string $create_ddl SQL statement to create table.
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 1.0.1
*
* @param string $table Database table name.
* @param string $index Index name to drop.
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 1.0.1
*
* @param string $table Database table name.
* @param string $index Database table index column.
/**
* Version of get_option that is private to install/upgrade.
*
- * @since unknown
+ * @since 1.5.1
* @access private
*
* @param string $setting Option name.
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 1.5.0
*
* @param string $content
* @return string
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 1.5.0
*
* @param unknown_type $queries
* @param unknown_type $execute
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 1.5.0
*/
function make_db_current() {
global $wp_queries;
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 1.5.0
*/
function make_db_current_silent() {
global $wp_queries;
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 1.5.0
*
* @param unknown_type $theme_name
* @param unknown_type $template
}
// Add a theme header.
- $header = "/*\nTheme Name: $theme_name\nTheme URI: " . __get_option('siteurl') . "\nDescription: A theme automatically created by the upgrade.\nVersion: 1.0\nAuthor: Moi\n*/\n";
+ $header = "/*\nTheme Name: $theme_name\nTheme URI: " . __get_option('siteurl') . "\nDescription: A theme automatically created by the update.\nVersion: 1.0\nAuthor: Moi\n*/\n";
$stylelines = file_get_contents("$site_dir/style.css");
if ($stylelines) {
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 1.5.0
*
* @param unknown_type $theme_name
* @param unknown_type $template
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 1.5.0
*
* @return unknown
*/
/**
* Translate user level to user role name.
*
- * @since unknown
+ * @since 2.0.0
*
* @param int $level User level.
* @return string User role name.
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 2.1.0
*/
function wp_check_mysql_version() {
global $wpdb;
*
* {@internal Missing Long Description}}
*
- * @since unknown
+ * @since 2.2.0
*/
function maybe_disable_automattic_widgets() {
$plugins = __get_option( 'active_plugins' );
/**
* Runs before the schema is upgraded.
+ *
+ * @since 2.9.0
*/
function pre_schema_upgrade() {
global $wp_current_db_version, $wp_db_version, $wpdb;
*/
function edit_user( $user_id = 0 ) {
global $wp_roles, $wpdb;
- if ( $user_id != 0 ) {
+ $user = new stdClass;
+ if ( $user_id ) {
$update = true;
$user->ID = (int) $user_id;
$userdata = get_userdata( $user_id );
$user->user_login = $wpdb->escape( $userdata->user_login );
} else {
$update = false;
- $user = '';
}
if ( !$update && isset( $_POST['user_login'] ) )
if ( isset( $_POST['description'] ) )
$user->description = trim( $_POST['description'] );
- foreach ( _wp_get_user_contactmethods() as $method => $name ) {
+ foreach ( _wp_get_user_contactmethods( $user ) as $method => $name ) {
if ( isset( $_POST[$method] ))
$user->$method = sanitize_text_field( $_POST[$method] );
}
if ( $update ) {
$user->rich_editing = isset( $_POST['rich_editing'] ) && 'false' == $_POST['rich_editing'] ? 'false' : 'true';
$user->admin_color = isset( $_POST['admin_color'] ) ? sanitize_text_field( $_POST['admin_color'] ) : 'fresh';
+ $user->show_admin_bar_front = isset( $_POST['admin_bar_front'] ) ? 'true' : 'false';
+ $user->show_admin_bar_admin = isset( $_POST['admin_bar_admin'] ) ? 'true' : 'false';
}
$user->comment_shortcuts = isset( $_POST['comment_shortcuts'] ) && 'true' == $_POST['comment_shortcuts'] ? 'true' : '';
$errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please enter an e-mail address.' ), array( 'form-field' => 'email' ) );
} elseif ( !is_email( $user->user_email ) ) {
$errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The e-mail address isn’t correct.' ), array( 'form-field' => 'email' ) );
- } elseif ( ( $owner_id = email_exists($user->user_email) ) && $owner_id != $user->ID ) {
+ } elseif ( ( $owner_id = email_exists($user->user_email) ) && ( !$update || ( $owner_id != $user->ID ) ) ) {
$errors->add( 'email_exists', __('<strong>ERROR</strong>: This email is already registered, please choose another one.'), array( 'form-field' => 'email' ) );
}
return $user_id;
}
-/**
- * {@internal Missing Short Description}}
- *
- * {@internal Missing Long Description}}
- *
- * @since unknown
- *
- * @return array List of user IDs.
- */
-function get_author_user_ids() {
- global $wpdb;
- 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) );
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * {@internal Missing Long Description}}
- *
- * @since unknown
- *
- * @param int $user_id User ID.
- * @return array|bool List of editable authors. False if no editable users.
- */
-function get_editable_authors( $user_id ) {
- global $wpdb;
-
- $editable = get_editable_user_ids( $user_id );
-
- if ( !$editable ) {
- return false;
- } else {
- $editable = join(',', $editable);
- $authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" );
- }
-
- return apply_filters('get_editable_authors', $authors);
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * {@internal Missing Long Description}}
- *
- * @since unknown
- *
- * @param int $user_id User ID.
- * @param bool $exclude_zeros Optional, default is true. Whether to exclude zeros.
- * @return unknown
- */
-function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) {
- global $wpdb;
-
- $user = new WP_User( $user_id );
- $post_type_obj = get_post_type_object($post_type);
-
- 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();
- }
-
- 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 )
- $query .= " AND meta_value != '0'";
-
- return $wpdb->get_col( $query );
-}
-
/**
* Fetch a filtered list of user roles that the current user is
* allowed to edit.
return $editable_roles;
}
-/**
- * {@internal Missing Short Description}}
- *
- * {@internal Missing Long Description}}
- *
- * @since unknown
- *
- * @return unknown
- */
-function get_nonauthor_user_ids() {
- global $wpdb;
-
- 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) );
-}
-
-/**
- * Retrieve editable posts from other users.
- *
- * @since unknown
- *
- * @param int $user_id User ID to not retrieve posts from.
- * @param string $type Optional, defaults to 'any'. Post type to retrieve, can be 'draft' or 'pending'.
- * @return array List of posts from others.
- */
-function get_others_unpublished_posts($user_id, $type='any') {
- global $wpdb;
-
- $editable = get_editable_user_ids( $user_id );
-
- if ( in_array($type, array('draft', 'pending')) )
- $type_sql = " post_status = '$type' ";
- else
- $type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";
-
- $dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';
-
- if ( !$editable ) {
- $other_unpubs = '';
- } else {
- $editable = join(',', $editable);
- $other_unpubs = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != %d ORDER BY post_modified $dir", $user_id) );
- }
-
- return apply_filters('get_others_drafts', $other_unpubs);
-}
-
-/**
- * Retrieve drafts from other users.
- *
- * @since unknown
- *
- * @param int $user_id User ID.
- * @return array List of drafts from other users.
- */
-function get_others_drafts($user_id) {
- return get_others_unpublished_posts($user_id, 'draft');
-}
-
-/**
- * Retrieve pending review posts from other users.
- *
- * @since unknown
- *
- * @param int $user_id User ID.
- * @return array List of posts with pending review post type from other users.
- */
-function get_others_pending($user_id) {
- return get_others_unpublished_posts($user_id, 'pending');
-}
-
/**
* Retrieve user data and filter it.
*
- * @since unknown
+ * @since 2.0.5
*
* @param int $user_id User ID.
* @return object WP_User object with user data.
function get_user_to_edit( $user_id ) {
$user = new WP_User( $user_id );
- $user_contactmethods = _wp_get_user_contactmethods();
+ $user_contactmethods = _wp_get_user_contactmethods( $user );
foreach ($user_contactmethods as $method => $name) {
if ( empty( $user->{$method} ) )
$user->{$method} = '';
/**
* Retrieve the user's drafts.
*
- * @since unknown
+ * @since 2.0.0
*
* @param int $user_id User ID.
* @return array
* being deleted will be run after the posts are either reassigned or deleted.
* The user meta will also be deleted that are for that User ID.
*
- * @since unknown
+ * @since 2.0.0
*
* @param int $id User ID.
* @param int $reassign Optional. Reassign posts and links to new User ID.
/**
* Remove all capabilities from user.
*
- * @since unknown
+ * @since 2.1.0
*
* @param int $id User ID.
*/
$user->remove_all_caps();
}
-if ( !class_exists('WP_User_Search') ) :
+add_action('admin_init', 'default_password_nag_handler');
/**
- * WordPress User Search class.
- *
- * @since unknown
+ * @since 2.8.0
*/
-class WP_User_Search {
-
- /**
- * {@internal Missing Description}}
- *
- * @since unknown
- * @access private
- * @var unknown_type
- */
- var $results;
-
- /**
- * {@internal Missing Description}}
- *
- * @since unknown
- * @access private
- * @var unknown_type
- */
- var $search_term;
-
- /**
- * Page number.
- *
- * @since unknown
- * @access private
- * @var int
- */
- var $page;
-
- /**
- * Role name that users have.
- *
- * @since unknown
- * @access private
- * @var string
- */
- var $role;
-
- /**
- * Raw page number.
- *
- * @since unknown
- * @access private
- * @var int|bool
- */
- var $raw_page;
-
- /**
- * Amount of users to display per page.
- *
- * @since unknown
- * @access public
- * @var int
- */
- var $users_per_page = 50;
-
- /**
- * {@internal Missing Description}}
- *
- * @since unknown
- * @access private
- * @var unknown_type
- */
- var $first_user;
-
- /**
- * {@internal Missing Description}}
- *
- * @since unknown
- * @access private
- * @var int
- */
- var $last_user;
-
- /**
- * {@internal Missing Description}}
- *
- * @since unknown
- * @access private
- * @var string
- */
- var $query_limit;
-
- /**
- * {@internal Missing Description}}
- *
- * @since 3.0.0
- * @access private
- * @var string
- */
- var $query_orderby;
-
- /**
- * {@internal Missing Description}}
- *
- * @since 3.0.0
- * @access private
- * @var string
- */
- var $query_from;
-
- /**
- * {@internal Missing Description}}
- *
- * @since 3.0.0
- * @access private
- * @var string
- */
- var $query_where;
-
- /**
- * {@internal Missing Description}}
- *
- * @since unknown
- * @access private
- * @var int
- */
- var $total_users_for_query = 0;
-
- /**
- * {@internal Missing Description}}
- *
- * @since unknown
- * @access private
- * @var bool
- */
- var $too_many_total_users = false;
-
- /**
- * {@internal Missing Description}}
- *
- * @since unknown
- * @access private
- * @var unknown_type
- */
- var $search_errors;
-
- /**
- * {@internal Missing Description}}
- *
- * @since unknown
- * @access private
- * @var unknown_type
- */
- var $paging_text;
-
- /**
- * PHP4 Constructor - Sets up the object properties.
- *
- * @since unknown
- *
- * @param string $search_term Search terms string.
- * @param int $page Optional. Page ID.
- * @param string $role Role name.
- * @return WP_User_Search
- */
- function WP_User_Search ($search_term = '', $page = '', $role = '') {
- $this->search_term = $search_term;
- $this->raw_page = ( '' == $page ) ? false : (int) $page;
- $this->page = (int) ( '' == $page ) ? 1 : $page;
- $this->role = $role;
-
- $this->prepare_query();
- $this->query();
- $this->prepare_vars_for_template_usage();
- $this->do_paging();
- }
-
- /**
- * {@internal Missing Short Description}}
- *
- * {@internal Missing Long Description}}
- *
- * @since unknown
- * @access public
- */
- 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_orderby = ' ORDER BY user_login';
-
- $search_sql = '';
- if ( $this->search_term ) {
- $searches = array();
- $search_sql = 'AND (';
- foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col )
- $searches[] = $col . " LIKE '%$this->search_term%'";
- $search_sql .= implode(' OR ', $searches);
- $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 ) );
- }
-
- /**
- * {@internal Missing Short Description}}
- *
- * {@internal Missing Long Description}}
- *
- * @since unknown
- * @access public
- */
- function query() {
- global $wpdb;
-
- $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(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!'));
- }
-
- /**
- * {@internal Missing Short Description}}
- *
- * {@internal Missing Long Description}}
- *
- * @since unknown
- * @access public
- */
- function prepare_vars_for_template_usage() {
- $this->search_term = stripslashes($this->search_term); // done with DB, from now on we want slashes gone
- }
-
- /**
- * {@internal Missing Short Description}}
- *
- * {@internal Missing Long Description}}
- *
- * @since unknown
- * @access public
- */
- function do_paging() {
- if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
- $args = array();
- if( ! empty($this->search_term) )
- $args['usersearch'] = urlencode($this->search_term);
- if( ! empty($this->role) )
- $args['role'] = urlencode($this->role);
-
- $this->paging_text = paginate_links( array(
- 'total' => ceil($this->total_users_for_query / $this->users_per_page),
- 'current' => $this->page,
- 'base' => 'users.php?%_%',
- 'format' => 'userspage=%#%',
- 'add_args' => $args
- ) );
- if ( $this->paging_text ) {
- $this->paging_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
- number_format_i18n( ( $this->page - 1 ) * $this->users_per_page + 1 ),
- number_format_i18n( min( $this->page * $this->users_per_page, $this->total_users_for_query ) ),
- number_format_i18n( $this->total_users_for_query ),
- $this->paging_text
- );
- }
- }
- }
-
- /**
- * {@internal Missing Short Description}}
- *
- * {@internal Missing Long Description}}
- *
- * @since unknown
- * @access public
- *
- * @return unknown
- */
- function get_results() {
- return (array) $this->results;
- }
-
- /**
- * Displaying paging text.
- *
- * @see do_paging() Builds paging text.
- *
- * @since unknown
- * @access public
- */
- function page_links() {
- echo $this->paging_text;
- }
-
- /**
- * Whether paging is enabled.
- *
- * @see do_paging() Builds paging text.
- *
- * @since unknown
- * @access public
- *
- * @return bool
- */
- function results_are_paged() {
- if ( $this->paging_text )
- return true;
- return false;
- }
-
- /**
- * Whether there are search terms.
- *
- * @since unknown
- * @access public
- *
- * @return bool
- */
- function is_search() {
- if ( $this->search_term )
- return true;
- return false;
- }
-}
-endif;
-
-add_action('admin_init', 'default_password_nag_handler');
function default_password_nag_handler($errors = false) {
global $user_ID;
if ( ! get_user_option('default_password_nag') ) //Short circuit it.
}
add_action('profile_update', 'default_password_nag_edit_user', 10, 2);
+/**
+ * @since 2.8.0
+ */
function default_password_nag_edit_user($user_ID, $old_data) {
if ( ! get_user_option('default_password_nag', $user_ID) ) //Short circuit it.
return;
}
add_action('admin_notices', 'default_password_nag');
+/**
+ * @since 2.8.0
+ */
function default_password_nag() {
- if ( ! get_user_option('default_password_nag') ) //Short circuit it.
+ global $pagenow;
+ if ( 'profile.php' == $pagenow || ! get_user_option('default_password_nag') ) //Short circuit it.
return;
echo '<div class="error default-password-nag">';
echo '<p>';
echo '<strong>' . __('Notice:') . '</strong> ';
- _e('You’re using the auto-generated password for your account. Would you like to change it to something you’ll remember easier?');
+ _e('You’re using the auto-generated password for your account. Would you like to change it to something easier to remember?');
echo '</p><p>';
printf( '<a href="%s">' . __('Yes, take me to my profile page') . '</a> | ', admin_url('profile.php') . '#password' );
printf( '<a href="%s" id="default-password-nag-no">' . __('No thanks, do not remind me again') . '</a>', '?default_password_nag=0' );
*/
/**
- * Display list of the available widgets, either all or matching search.
+ * Display list of the available widgets.
*
- * The search parameter are search terms separated by spaces.
- *
- * @since unknown
- *
- * @param string $show Optional, default is all. What to display, can be 'all', 'unused', or 'used'.
- * @param string $_search Optional. Search for widgets. Should be unsanitized.
+ * @since 2.5.0
*/
function wp_list_widgets() {
global $wp_registered_widgets, $sidebars_widgets, $wp_registered_widget_controls;
$sort = $wp_registered_widgets;
- usort( $sort, create_function( '$a, $b', 'return strnatcasecmp( $a["name"], $b["name"] );' ) );
+ usort( $sort, '_sort_name_callback' );
$done = array();
foreach ( $sort as $widget ) {
}
}
+/**
+ * Callback to sort array by a 'name' key.
+ *
+ * @since 3.1.0
+ * @access private
+ */
+function _sort_name_callback( $a, $b ) {
+ return strnatcasecmp( $a['name'], $b['name'] );
+}
+
/**
* Show the widgets and their settings for a sidebar.
* Used in the the admin widget config screen.
*
- * @since unknown
+ * @since 2.5.0
*
* @param string $sidebar id slug of the sidebar
*/
/**
* {@internal Missing Short Description}}
*
- * @since unknown
+ * @since 2.5.0
*
* @param array $params
* @return array
$id = isset($params[0]['_temp_id']) ? $params[0]['_temp_id'] : $widget_id;
$hidden = isset($params[0]['_hide']) ? ' style="display:none;"' : '';
- $params[0]['before_widget'] = "<div id='widget-${i}_$id' class='widget'$hidden>";
+ $params[0]['before_widget'] = "<div id='widget-{$i}_{$id}' class='widget'$hidden>";
$params[0]['after_widget'] = "</div>";
$params[0]['before_title'] = "%BEG_OF_TITLE%"; // deprecated
$params[0]['after_title'] = "%END_OF_TITLE%"; // deprecated
*
* Called from dynamic_sidebar().
*
- * @since unknown
+ * @since 2.5.0
*
* @param array $sidebar_args
* @return array
</div>
<div class="alignright<?php if ( 'noform' === $has_form ) echo ' widget-control-noform'; ?>">
<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-feedback " title="" alt="" />
- <input type="submit" name="savewidget" class="button-primary widget-control-save" value="<?php esc_attr_e('Save'); ?>" />
+ <?php submit_button( __( 'Save' ), 'button-primary widget-control-save', 'savewidget', false ); ?>
</div>
<br class="clear" />
</div>
require_once( './admin.php' );
/** Load WordPress Administration Dashboard API */
-require( './includes/dashboard.php' );
+require(ABSPATH . 'wp-admin/includes/dashboard.php' );
@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
send_nosniff_header();
$title = __('Dashboard');
$parent_file = 'index.php';
+if ( is_user_admin() )
+ add_screen_option('layout_columns', array('max' => 4, 'default' => 1) );
+else
+ add_screen_option('layout_columns', array('max' => 4, 'default' => 2) );
+
add_contextual_help($current_screen,
- '<p>' . __('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.') . '</p>' .
- '<p>' . __('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.') . '</p>' .
- '<p>' . __('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.') . '</p>' .
- '<p>' . __('The modules on your Dashboard screen are:') . '</p>' .
- '<p>' . __('<strong>Right Now</strong> - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.') . '</p>' .
- '<p>' . __('<strong>Recent Comments</strong> - Shows the most recent comments on your posts (configurable, up to 30) and allows you to moderate them.') . '</p>' .
- '<p>' . __('<strong>Incoming Links</strong> - Shows links to your site found by Google Blog Search.') . '</p>' .
- '<p>' . __('<strong>QuickPress</strong> - Allows you to create a new post and either publish it or save it as a draft.') . '</p>' .
- '<p>' . __('<strong>Recent Drafts</strong> - Displays links to the 5 most recent draft posts you’ve started.') . '</p>' .
- '<p>' . __('<strong>Other WordPress News</strong> - Shows the feed from <a href="http://planet.wordpress.org" target="_blank">WordPress Planet</a>. You can configure it to show a different feed of your choosing.') . '</p>' .
- '<p>' . __('<strong>Plugins</strong> - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.') . '</p>' .
- '<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Dashboard_SubPanel" target="_blank">Dashboard Documentation</a>') . '</p>' .
- '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+ '<p>' . __( '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.' ) . '</p>' .
+ '<p>' . __( 'The Admin Bar at the top, new in 3.1, provides quick access to common tasks when you are viewing your site.' ) . '</p>' .
+ '<p>' . __( '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 faint separator lines between the Dashboard and Posts sections, or between Comments and Appearance; when minimized, the submenu items will be displayed on hover.' ) . '</p>' .
+ '<p>' . __( 'You can configure your dashboard by choosing which boxes, or modules, to display in the work area, how many columns to display them in, and where each box should be placed. You can hide/show boxes and select the number of columns in the Screen Options tab. To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box. You can also expand or collapse each box by clicking once on the title bar of the box. In addition, some boxes are configurable, and will show a “Configure” link in the title bar when you hover over it.' ) . '</p>' .
+ '<p>' . __( 'The boxes on your Dashboard screen are:' ) . '</p>' .
+ '<p>' . __( '<strong>Right Now</strong> - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '</p>' .
+ '<p>' . __( '<strong>Recent Comments</strong> - Shows the most recent comments on your posts (configurable, up to 30) and allows you to moderate them.' ) . '</p>' .
+ '<p>' . __( '<strong>Incoming Links</strong> - Shows links to your site found by Google Blog Search.' ) . '</p>' .
+ '<p>' . __( '<strong>QuickPress</strong> - Allows you to create a new post and either publish it or save it as a draft.' ) . '</p>' .
+ '<p>' . __( '<strong>Recent Drafts</strong> - Displays links to the 5 most recent draft posts you’ve started.' ) . '</p>' .
+ '<p>' . __( '<strong>WordPress Development Blog</strong> - Come here for the latest scoop.' ) . '</p>' .
+ '<p>' . __( '<strong>Other WordPress News</strong> - Shows the feed from <a href="http://planet.wordpress.org" target="_blank">WordPress Planet</a>. You can configure it to show a different feed of your choosing.' ) . '</p>' .
+ '<p>' . __( '<strong>Plugins</strong> - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.' ) . '</p>' .
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="http://codex.wordpress.org/Dashboard_SubPanel" target="_blank">Documentation on Dashboard</a>' ) . '</p>' .
+ '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
);
-require_once('./admin-header.php');
+include (ABSPATH . 'wp-admin/admin-header.php');
$today = current_time('mysql', 1);
?>
* @subpackage Plugin
*/
-/**
- * @global bool $wp_only_load_config
- * @name $wp_only_load_config
- * @var bool
- * @since unknown
- */
-$wp_only_load_config = true;
-
/** Load WordPress Bootstrap */
require_once(dirname(dirname(__FILE__)).'/wp-load.php');
* @global bool|int $debug
* @name $debug
* @var bool|int
- * @since unknown
+ * @since 1.0.0
*/
$debug = 0;
/**
* Create database table, if it doesn't already exist.
*
- * @since unknown
+ * @since 1.0.0
* @package WordPress
* @subpackage Plugin
* @uses $wpdb
/**
* Add column to database table, if column doesn't already exist in table.
*
- * @since unknown
+ * @since 1.0.0
* @package WordPress
* @subpackage Plugin
* @uses $wpdb
/**
* Drop column from database table, if it exists.
*
- * @since unknown
+ * @since 1.0.0
* @package WordPress
* @subpackage Plugin
* @uses $wpdb
* Default
* Extra
*
- * @since unknown
+ * @since 1.0.0
* @package WordPress
* @subpackage Plugin
*
return false;
}
-?>
+?>
\ No newline at end of file
<script type="text/javascript" src="../wp-includes/js/jquery/jquery.js"></script>
<script type="text/javascript" src="js/password-strength-meter.js"></script>
<script type="text/javascript" src="js/user-profile.js"></script>
-<script type="text/javascript" src="js/utils.js"></script>
+<script type="text/javascript" src="../wp-includes/js/l10n.js"></script>
<script type='text/javascript'>
/* <![CDATA[ */
var pwsL10n = {
},
toggle : function(el) {
- var id = el.slideToggle(150, function() {
- el.css('display','');
- }).parent().toggleClass( 'wp-menu-open' ).attr('id');
-
- if ( id ) {
- $('li.wp-has-submenu', '#adminmenu').each(function(i, e) {
- if ( id == e.id ) {
- var v = $(e).hasClass('wp-menu-open') ? 'o' : 'c';
- setUserSetting( 'm'+i, v );
- }
- });
- }
+ el.slideToggle(150, function() {
+ var id = el.parent().toggleClass( 'wp-menu-open' ).attr('id');
+ if ( id ) {
+ $('li.wp-has-submenu', '#adminmenu').each(function(i, e) {
+ if ( id == e.id ) {
+ var v = $(e).hasClass('wp-menu-open') ? 'o' : 'c';
+ setUserSetting( 'm'+i, v );
+ }
+ });
+ }
+ });
return false;
},
checked : function(column) {
$('.column-' + column).show();
+ this.colSpanChange(+1);
},
unchecked : function(column) {
$('.column-' + column).hide();
+ this.colSpanChange(-1);
},
hidden : function() {
return id.substring( id, id.length - 5 );
}).get().join(',');
};
+ },
+
+ colSpanChange : function(diff) {
+ var $t = $('table').find('.colspanchange'), n;
+ if ( !$t.length )
+ return;
+ n = parseInt( $t.attr('colspan'), 10 ) + diff;
+ $t.attr('colspan', n.toString());
}
}
};
jQuery(document).ready( function($) {
- var lastClicked = false, checks, first, last, checked;
+ var lastClicked = false, checks, first, last, checked, bgx = ( isRtl ? 'left' : 'right' );
// 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');
$('#screen-options-wrap').slideToggle('fast', function(){
if ( $(this).hasClass('screen-options-open') ) {
- $('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right.gif?ver=20100531")'});
+ $('#show-settings-link').css({'backgroundPosition':'top '+bgx});
$('#contextual-help-link-wrap').css('visibility', '');
$(this).removeClass('screen-options-open');
} else {
- $('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right-up.gif?ver=20100531")'});
+ $('#show-settings-link').css({'backgroundPosition':'bottom '+bgx});
$(this).addClass('screen-options-open');
}
});
$('#contextual-help-wrap').slideToggle('fast', function() {
if ( $(this).hasClass('contextual-help-open') ) {
- $('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right.gif?ver=20100531")'});
+ $('#contextual-help-link').css({'backgroundPosition':'top '+bgx});
$('#screen-options-link-wrap').css('visibility', '');
$(this).removeClass('contextual-help-open');
} else {
- $('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right-up.gif?ver=20100531")'});
+ $('#contextual-help-link').css({'backgroundPosition':'bottom '+bgx});
$(this).addClass('contextual-help-open');
}
});
return true;
});
- $('thead, tfoot').find(':checkbox').click( function(e) {
+ $('thead, tfoot').find('.check-column :checkbox').click( function(e) {
var c = $(this).attr('checked'),
kbtoggle = 'undefined' == typeof toggleWithKeyboard ? false : toggleWithKeyboard,
toggle = e.shiftKey || kbtoggle;
if ( this.lastKey && 9 == this.lastKey )
this.focus();
});
-});
\ No newline at end of file
+});
-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(){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<e&&0<c&&e!=c){a.slice(e,c).attr("checked",function(){if(d(this).closest("tr").is(":visible")){return b?"checked":""}return""})}}f=this;return true});d("thead, tfoot").find(":checkbox").click(function(i){var j=d(this).attr("checked"),h="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,g=i.shiftKey||h;d(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").attr("checked",function(){if(d(this).closest("tr").is(":hidden")){return""}if(g){return d(this).attr("checked")?"":"checked"}else{if(j){return"checked"}}return""});d(this).closest("table").children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").attr("checked",function(){if(g){return""}else{if(j){return"checked"}}return""})});d("#default-password-nag-no").click(function(){setUserSetting("default_password_nag","hide");d("div.default-password-nag").hide();return false});d("#newcontent").keydown(function(l){if(l.keyCode!=9){return true}var i=l.target,n=i.selectionStart,h=i.selectionEnd,m=i.value,g,k;try{this.lastKey=9}catch(j){}if(document.selection){i.focus();k=document.selection.createRange();k.text="\t"}else{if(n>=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
+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){b.slideToggle(150,function(){var c=b.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(){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();this.colSpanChange(+1)},unchecked:function(b){a(".column-"+b).hide();this.colSpanChange(-1)},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(",")}},colSpanChange:function(b){var d=a("table").find(".colspanchange"),c;if(!d.length){return}c=parseInt(d.attr("colspan"),10)+b;d.attr("colspan",c.toString())}};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(e){var g=false,b,f,d,c,a=(isRtl?"left":"right");e("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");e("div.updated, div.error").not(".below-h2, .inline").insertAfter(e("div.wrap h2:first"));e("#show-settings-link").click(function(){if(!e("#screen-options-wrap").hasClass("screen-options-open")){e("#contextual-help-link-wrap").css("visibility","hidden")}e("#screen-options-wrap").slideToggle("fast",function(){if(e(this).hasClass("screen-options-open")){e("#show-settings-link").css({backgroundPosition:"top "+a});e("#contextual-help-link-wrap").css("visibility","");e(this).removeClass("screen-options-open")}else{e("#show-settings-link").css({backgroundPosition:"bottom "+a});e(this).addClass("screen-options-open")}});return false});e("#contextual-help-link").click(function(){if(!e("#contextual-help-wrap").hasClass("contextual-help-open")){e("#screen-options-link-wrap").css("visibility","hidden")}e("#contextual-help-wrap").slideToggle("fast",function(){if(e(this).hasClass("contextual-help-open")){e("#contextual-help-link").css({backgroundPosition:"top "+a});e("#screen-options-link-wrap").css("visibility","");e(this).removeClass("contextual-help-open")}else{e("#contextual-help-link").css({backgroundPosition:"bottom "+a});e(this).addClass("contextual-help-open")}});return false});e("tbody").children().children(".check-column").find(":checkbox").click(function(h){if("undefined"==h.shiftKey){return true}if(h.shiftKey){if(!g){return true}b=e(g).closest("form").find(":checkbox");f=b.index(g);d=b.index(this);c=e(this).attr("checked");if(0<f&&0<d&&f!=d){b.slice(f,d).attr("checked",function(){if(e(this).closest("tr").is(":visible")){return c?"checked":""}return""})}}g=this;return true});e("thead, tfoot").find(".check-column :checkbox").click(function(j){var k=e(this).attr("checked"),i="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,h=j.shiftKey||i;e(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").attr("checked",function(){if(e(this).closest("tr").is(":hidden")){return""}if(h){return e(this).attr("checked")?"":"checked"}else{if(k){return"checked"}}return""});e(this).closest("table").children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").attr("checked",function(){if(h){return""}else{if(k){return"checked"}}return""})});e("#default-password-nag-no").click(function(){setUserSetting("default_password_nag","hide");e("div.default-password-nag").hide();return false});e("#newcontent").keydown(function(m){if(m.keyCode!=9){return true}var j=m.target,o=j.selectionStart,i=j.selectionEnd,n=j.value,h,l;try{this.lastKey=9}catch(k){}if(document.selection){j.focus();l=document.selection.createRange();l.text="\t"}else{if(o>=0){h=this.scrollTop;j.value=n.substring(0,o).concat("\t",n.substring(i));j.selectionStart=j.selectionEnd=o+1;this.scrollTop=h}}if(m.stopPropagation){m.stopPropagation()}if(m.preventDefault){m.preventDefault()}});e("#newcontent").blur(function(h){if(this.lastKey&&9==this.lastKey){this.focus()}})});
\ No newline at end of file
jQuery('#background-color').keyup(function() {
var _hex = jQuery('#background-color').val(), hex = _hex;
- if ( hex[0] != '#' )
+ if ( hex.charAt(0) != '#' )
hex = '#' + hex;
hex = hex.replace(/[^#a-fA-F0-9]+/, '');
if ( hex != _hex )
-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
+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.charAt(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
if ( e.length ) {
p = e.parent();
setTimeout( function(){
- p.load('index-extra.php?jax=' + id, '', function() {
+ p.load( ajaxurl.replace( '/admin-ajax.php', '' ) + '/index-extra.php?jax=' + id, '', function() {
p.hide().slideDown('normal', 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');
+ if ( 'dashboard_quick_press' == id )
quickPressLoad();
- }
});
});
}, i * 500 );
};
ajaxPopulateWidgets();
- postboxes.add_postbox_toggles('dashboard', { pbshow: ajaxPopulateWidgets } );
+ postboxes.add_postbox_toggles(pagenow, { pbshow: ajaxPopulateWidgets } );
/* QuickPress */
quickPressLoad = function() {
$('#dashboard_quick_press ul').find('li').each( function() {
$('#dashboard_recent_drafts ul').prepend( this );
} ).end().remove();
- tb_init('a.thickbox');
quickPressLoad();
} );
return false;
-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
+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(ajaxurl.replace("/admin-ajax.php","")+"/index-extra.php?jax="+g,"",function(){f.hide().slideDown("normal",function(){a(this).css("display","");if("dashboard_quick_press"==g){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(pagenow,{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();quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})}});
\ No newline at end of file
setCommentsList = function() {
var totalInput, perPageInput, pageInput, lastConfidentTime = 0, dimAfter, delBefore, updateTotalCount, delAfter;
- totalInput = $('.tablenav input[name="_total"]', '#comments-form');
- perPageInput = $('.tablenav input[name="_per_page"]', '#comments-form');
- pageInput = $('.tablenav input[name="_page"]', '#comments-form');
+ totalInput = $('input[name="_total"]', '#comments-form');
+ perPageInput = $('input[name="_per_page"]', '#comments-form');
+ pageInput = $('input[name="_page"]', '#comments-form');
dimAfter = function( r, settings ) {
var c = $('#' + settings.element);
settings.data._per_page = perPageInput.val() || 0;
settings.data._page = pageInput.val() || 0;
settings.data._url = document.location.href;
+ settings.data.comment_status = $('input[name=comment_status]', '#comments-form').val();
if ( cl.indexOf(':trash=1') != -1 )
action = 'trash';
total = 0;
if ( ( 'object' == typeof r ) && lastConfidentTime < settings.parsed.responses[0].supplemental.time ) {
- pageLinks = settings.parsed.responses[0].supplemental.pageLinks || '';
- if ( $.trim( pageLinks ) )
- $('.tablenav-pages').find( '.page-numbers' ).remove().end().append( $( pageLinks ) );
- else
- $('.tablenav-pages').find( '.page-numbers' ).remove();
-
+ total_items_i18n = settings.parsed.responses[0].supplemental.total_items_i18n || '';
+ if ( total_items_i18n ) {
+ $('.displaying-num').text( total_items_i18n );
+ $('.total-pages').text( settings.parsed.responses[0].supplemental.total_pages_i18n );
+ $('.tablenav-pages').find('.next-page, .last-page').toggleClass('disabled', settings.parsed.responses[0].supplemental.total_pages == $('.current-page').val());
+ }
updateTotalCount( total, settings.parsed.responses[0].supplemental.time, true );
} else {
updateTotalCount( total, r, false );
}
}
- if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 || untrash ) {
+
+ if ( ! theExtraList || theExtraList.size() == 0 || theExtraList.children().size() == 0 || untrash || unspam ) {
return;
}
theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() );
- $('#get-extra-comments').submit();
+
+ refillTheExtraList();
+ };
+
+ var refillTheExtraList = function(ev) {
+ // var args = $.query.get(), total_pages = listTable.get_total_pages(), per_page = $('input[name=_per_page]', '#comments-form').val(), r;
+ var args = $.query.get(), total_pages = $('.total-pages').text(), per_page = $('input[name=_per_page]', '#comments-form').val(), r;
+
+ if (! args.paged)
+ args.paged = 1;
+
+ if (args.paged > total_pages) {
+ return;
+ }
+
+ if (ev) {
+ theExtraList.empty();
+ args.number = Math.min(8, per_page); // see WP_Comments_List_Table::prepare_items() @ class-wp-comments-list-table.php
+ } else {
+ args.number = 1;
+ args.offset = Math.min(8, per_page) - 1; // fetch only the next item on the extra list
+ }
+
+ args.no_placeholder = true;
+
+ args.paged ++;
+
+ // $.query.get() needs some correction to be sent into an ajax request
+ if ( true === args.comment_type )
+ args.comment_type = '';
+
+ args = $.extend(args, {
+ 'action': 'fetch-list',
+ 'list_args': list_args,
+ '_ajax_fetch_list_nonce': $('#_ajax_fetch_list_nonce').val()
+ });
+
+ $.ajax({
+ url: ajaxurl,
+ global: false,
+ dataType: 'json',
+ data: args,
+ success: function(response) {
+ theExtraList.get(0).wpList.add( response.rows );
+ }
+ });
};
theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
if ( s.target.className.indexOf(':trash=1') != -1 || s.target.className.indexOf(':spam=1') != -1 )
$('#undo-' + id).fadeIn(300, function(){ $(this).show() });
});
+ // $(listTable).bind('changePage', refillTheExtraList);
};
commentReply = {
this.comments_listing = $('#comments-form > input[name="comment_status"]').val() || '';
+ /* $(listTable).bind('beforeChangePage', function(){
+ commentReply.close();
+ }); */
},
addEvents : function(r) {
t.close();
t.cid = id;
- $('td', '#replyrow').attr('colspan', $('table.widefat thead th:visible').length);
editRow = $('#replyrow');
rowData = $('#inline-'+id);
act = t.act = (a == 'edit') ? 'edit-comment' : 'replyto-comment';
send : function() {
var post = {};
+ $('#replysubmit .error').hide();
$('#replysubmit .waiting').show();
$('#replyrow input').each(function() {
post.content = $('#replycontent').val();
post.id = post.comment_post_ID;
post.comments_listing = this.comments_listing;
+ post.p = $('[name=p]').val();
$.ajax({
type : 'POST',
.animate( { 'backgroundColor':'#CCEEBB' }, 600 )
.animate( { 'backgroundColor': bg }, 600 );
- $.fn.wpList.process($(id))
+ // $.fn.wpList.process($(id));
},
error : function(r) {
setCommentsList();
commentReply.init();
- $('span.delete a.delete').click(function(){return false;});
+ $(document).delegate('span.delete a.delete', 'click', function(){return false;});
if ( typeof QTags != 'undefined' )
ed_reply = new QTags('ed_reply', 'replycontent', 'replycontainer', 'more');
var first_last, l;
first_last = 'next' == which? 'first' : 'last';
- l = $('.'+which+'.page-numbers');
+ l = $('.tablenav-pages .'+which+'-page:not(.disabled)');
if (l.length)
window.location = l[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g, '')+'&hotkeys_highlight_'+first_last+'=1';
}
return function() {
var scope = $('select[name="action"]');
$('option[value='+value+']', scope).attr('selected', 'selected');
- $('#comments-form').submit();
+ $('#doaction').click();
}
};
$.table_hotkeys(
$('table.widefat'),
['a', 'u', 's', 'd', 'r', 'q', 'z', ['e', edit_comment], ['shift+x', toggle_all],
- ['shift+a', make_bulk('approve')], ['shift+s', make_bulk('markspam')],
+ ['shift+a', make_bulk('approve')], ['shift+s', make_bulk('spam')],
['shift+d', make_bulk('delete')], ['shift+t', make_bulk('trash')],
['shift+z', make_bulk('untrash')], ['shift+u', make_bulk('unapprove')]],
{ highlight_first: adminCommentsL10n.hotkeys_highlight_first, highlight_last: adminCommentsL10n.hotkeys_highlight_last,
-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('<tr id="undo-'+m+'" class="undo un'+r+'" style="display:none;"><td colspan="'+p+'">'+note+"</td></tr>")}else{s=a(".comment-author",o).text();t=a('<div id="undo-'+m+'" style="display:none;" class="undo un'+r+'">'+note+"</div>")}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(n<l){return}if(o){l=n}c.val(m.toString());a("span.total-type-count").each(function(){f(a(this),m)})};function j(s){var r=a("#dashboard_right_now"),o,q,p,m;s=s||0;if(isNaN(s)||!r.length){return}o=a("span.total-count",r);q=a("span.approved-count",r);p=b(o);p=p+s;m=p-b(a("span.pending-count",r))-b(a("span.spam-count",r));f(o,p);f(q,m)}function b(m){var o=parseInt(m.html().replace(/[^0-9]+/g,""),10);if(isNaN(o)){return 0}return o}function f(o,p){var m="";if(isNaN(p)){return}p=p<1?"0":p.toString();if(p.length>3){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<o.parsed.responses[0].supplemental.time){p=o.parsed.responses[0].supplemental.pageLinks||"";if(a.trim(p)){a(".tablenav-pages").find(".page-numbers").remove().end().append(a(p))}else{a(".tablenav-pages").find(".page-numbers").remove()}d(t,o.parsed.responses[0].supplemental.time,true)}else{d(t,m,false)}}if(theExtraList.size()==0||theExtraList.children().size()==0||v){return}theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone());a("#get-extra-comments").submit()};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:i,dimAfter:g,delAfter:k,addColor:"none"}).bind("wpListDelEnd",function(n,m){var o=m.element.replace(/[^0-9]+/g,"");if(m.target.className.indexOf(":trash=1")!=-1||m.target.className.indexOf(":spam=1")!=-1){a("#undo-"+o).fadeIn(300,function(){a(this).show()})}})};commentReply={cid:"",act:"",init:function(){var b=a("#replyrow");a("a.cancel",b).click(function(){return commentReply.revert()});a("a.save",b).click(function(){return commentReply.send()});a("input#author, input#author-email, input#author-url",b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a("#the-comment-list .column-comment > 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<h){window.scroll(0,h-c+35)}else{if(n-20<o){window.scroll(0,n-35)}}a("#replycontent").focus().keyup(function(p){if(p.which==27){commentReply.revert()}})},600);return false},send:function(){var b={};a("#replysubmit .waiting").show();a("#replyrow input").each(function(){b[a(this).attr("name")]=a(this).val()});b.content=a("#replycontent").val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;a.ajax({type:"POST",url:ajaxurl,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(b){var e,g,f,d;if(typeof(b)=="string"){this.error({responseText:b});return false}e=wpAjax.parseAjaxResponse(b);if(e.errors){this.error({responseText:wpAjax.broken});return false}e=e.responses[0];g=e.data;f="#comment-"+e.id;if("edit-comment"==this.act){a(f).remove()}a(g).hide();a("#replyrow").after(g);this.revert();this.addEvents(a(f));d=a(f).hasClass("unapproved")?"#ffffe0":"#fff";a(f).animate({backgroundColor:"#CCEEBB"},600).animate({backgroundColor:d},600);a.fn.wpList.process(a(f))},error:function(b){var c=b.statusText;a("#replysubmit .waiting").hide();if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/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 d,f,i,m=0,h,j,e,l;d=a('input[name="_total"]',"#comments-form");f=a('input[name="_per_page"]',"#comments-form");i=a('input[name="_page"]',"#comments-form");h=function(o,n){var p=a("#"+n.element);if(p.is(".unapproved")){p.find("div.comment_status").html("0")}else{p.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var q=a(this),s,r;s=q.html().replace(/[^0-9]+/g,"");s=parseInt(s,10);if(isNaN(s)){return}r=a("#"+n.element).is("."+n.dimClass)?1:-1;s=s+r;if(s<0){s=0}q.closest("#awaiting-mod")[0==s?"addClass":"removeClass"]("count-0");g(q,s);k()})};j=function(r,v){var x=a(r.target).attr("className"),o,p,q,u,w,t,s=false;r.data._total=d.val()||0;r.data._per_page=f.val()||0;r.data._page=i.val()||0;r.data._url=document.location.href;r.data.comment_status=a("input[name=comment_status]","#comments-form").val();if(x.indexOf(":trash=1")!=-1){s="trash"}else{if(x.indexOf(":spam=1")!=-1){s="spam"}}if(s){o=x.replace(/.*?comment-([0-9]+).*/,"$1");p=a("#comment-"+o);note=a("#"+s+"-undo-holder").html();p.find(".check-column :checkbox").attr("checked","");if(p.siblings("#replyrow").length&&commentReply.cid==o){commentReply.close()}if(p.is("tr")){q=p.children(":visible").length;t=a(".author strong",p).text();u=a('<tr id="undo-'+o+'" class="undo un'+s+'" style="display:none;"><td colspan="'+q+'">'+note+"</td></tr>")}else{t=a(".comment-author",p).text();u=a('<div id="undo-'+o+'" style="display:none;" class="undo un'+s+'">'+note+"</div>")}p.before(u);a("strong","#undo-"+o).text(t+" ");w=a(".undo a","#undo-"+o);w.attr("href","comment.php?action=un"+s+"comment&c="+o+"&_wpnonce="+r.data._ajax_nonce);w.attr("className","delete:the-comment-list:comment-"+o+"::un"+s+"=1 vim-z vim-destructive");a(".avatar",p).clone().prependTo("#undo-"+o+" ."+s+"-undo-inside");w.click(function(){v.wpList.del(this);a("#undo-"+o).css({backgroundColor:"#ceb"}).fadeOut(350,function(){a(this).remove();a("#comment-"+o).css("backgroundColor","").fadeIn(300,function(){a(this).show()})});return false})}return r};e=function(n,o,p){if(o<m){return}if(p){m=o}d.val(n.toString());a("span.total-type-count").each(function(){g(a(this),n)})};function k(t){var s=a("#dashboard_right_now"),p,r,q,o;t=t||0;if(isNaN(t)||!s.length){return}p=a("span.total-count",s);r=a("span.approved-count",s);q=c(p);q=q+t;o=q-c(a("span.pending-count",s))-c(a("span.spam-count",s));g(p,q);g(r,o)}function c(o){var p=parseInt(o.html().replace(/[^0-9]+/g,""),10);if(isNaN(p)){return 0}return p}function g(p,q){var o="";if(isNaN(q)){return}q=q<1?"0":q.toString();if(q.length>3){while(q.length>3){o=thousandsSeparator+q.substr(q.length-3)+o;q=q.substr(0,q.length-3)}q=q+o}p.html(q)}l=function(n,p){var u,q,s,w=a(p.target).parent().is("span.untrash"),o=a(p.target).parent().is("span.unspam"),v,t;function x(r){if(a(p.target).parent().is("span."+r)){return 1}else{if(a("#"+p.element).is("."+r)){return -1}}return 0}v=x("spam");t=x("trash");if(w){t=-1}if(o){v=-1}a("span.pending-count").each(function(){var r=a(this),z=c(r),y=a("#"+p.element).is(".unapproved");if(a(p.target).parent().is("span.unapprove")||((w||o)&&y)){z=z+1}else{if(y){z=z-1}}if(z<0){z=0}r.closest("#awaiting-mod")[0==z?"addClass":"removeClass"]("count-0");g(r,z);k()});a("span.spam-count").each(function(){var r=a(this),y=c(r)+v;g(r,y)});a("span.trash-count").each(function(){var r=a(this),y=c(r)+t;g(r,y)});if(a("#dashboard_right_now").length){s=t?-1*t:0;k(s)}else{u=d.val()?parseInt(d.val(),10):0;u=u-v-t;if(u<0){u=0}if(("object"==typeof n)&&m<p.parsed.responses[0].supplemental.time){total_items_i18n=p.parsed.responses[0].supplemental.total_items_i18n||"";if(total_items_i18n){a(".displaying-num").text(total_items_i18n);a(".total-pages").text(p.parsed.responses[0].supplemental.total_pages_i18n);a(".tablenav-pages").find(".next-page, .last-page").toggleClass("disabled",p.parsed.responses[0].supplemental.total_pages==a(".current-page").val())}e(u,p.parsed.responses[0].supplemental.time,true)}else{e(u,n,false)}}if(!theExtraList||theExtraList.size()==0||theExtraList.children().size()==0||w||o){return}theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone());b()};var b=function(s){var o=a.query.get(),n=a(".total-pages").text(),p=a("input[name=_per_page]","#comments-form").val(),q;if(!o.paged){o.paged=1}if(o.paged>n){return}if(s){theExtraList.empty();o.number=Math.min(8,p)}else{o.number=1;o.offset=Math.min(8,p)-1}o.no_placeholder=true;o.paged++;if(true===o.comment_type){o.comment_type=""}o=a.extend(o,{action:"fetch-list",list_args:list_args,_ajax_fetch_list_nonce:a("#_ajax_fetch_list_nonce").val()});a.ajax({url:ajaxurl,global:false,dataType:"json",data:o,success:function(r){theExtraList.get(0).wpList.add(r.rows)}})};theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"});theList=a("#the-comment-list").wpList({alt:"",delBefore:j,dimAfter:h,delAfter:l,addColor:"none"}).bind("wpListDelEnd",function(o,n){var p=n.element.replace(/[^0-9]+/g,"");if(n.target.className.indexOf(":trash=1")!=-1||n.target.className.indexOf(":spam=1")!=-1){a("#undo-"+p).fadeIn(300,function(){a(this).show()})}})};commentReply={cid:"",act:"",init:function(){var b=a("#replyrow");a("a.cancel",b).click(function(){return commentReply.revert()});a("a.save",b).click(function(){return commentReply.send()});a("input#author, input#author-email, input#author-url",b).keypress(function(c){if(c.which==13){commentReply.send();c.preventDefault();return false}});a("#the-comment-list .column-comment > 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;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<h){window.scroll(0,h-c+35)}else{if(n-20<o){window.scroll(0,n-35)}}a("#replycontent").focus().keyup(function(p){if(p.which==27){commentReply.revert()}})},600);return false},send:function(){var b={};a("#replysubmit .error").hide();a("#replysubmit .waiting").show();a("#replyrow input").each(function(){b[a(this).attr("name")]=a(this).val()});b.content=a("#replycontent").val();b.id=b.comment_post_ID;b.comments_listing=this.comments_listing;b.p=a("[name=p]").val();a.ajax({type:"POST",url:ajaxurl,data:b,success:function(c){commentReply.show(c)},error:function(c){commentReply.error(c)}});return false},show:function(b){var e,g,f,d;if(typeof(b)=="string"){this.error({responseText:b});return false}e=wpAjax.parseAjaxResponse(b);if(e.errors){this.error({responseText:wpAjax.broken});return false}e=e.responses[0];g=e.data;f="#comment-"+e.id;if("edit-comment"==this.act){a(f).remove()}a(g).hide();a("#replyrow").after(g);this.revert();this.addEvents(a(f));d=a(f).hasClass("unapproved")?"#ffffe0":"#fff";a(f).animate({backgroundColor:"#CCEEBB"},600).animate({backgroundColor:d},600)},error:function(b){var c=b.statusText;a("#replysubmit .waiting").hide();if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#replysubmit .error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a(document).delegate("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(".tablenav-pages ."+f+"-page:not(.disabled)");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("#doaction").click()}};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("spam")],["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 blocklist1, blocklist2;
// Protect pre|script tags
- content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
- a = a.replace(/<br ?\/?>[\r\n]*/g, '<wp_temp>');
- return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '<wp_temp>');
- });
+ if ( content.indexOf('<pre') != -1 || content.indexOf('<script') != -1 ) {
+ content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
+ a = a.replace(/<br ?\/?>(\r\n|\n)?/g, '<wp_temp>');
+ return a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp_temp>');
+ });
+ }
// Pretty it up for the source editor
blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset';
content = content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*', 'g'), '</$1>\n');
- content = content.replace(new RegExp('\\s*<(('+blocklist1+')[^>]*)>', 'g'), '\n<$1>');
+ content = content.replace(new RegExp('\\s*<((?:'+blocklist1+')(?: [^>]*)?)>', 'g'), '\n<$1>');
// Mark </p> if it has any attributes.
content = content.replace(/(<p [^>]+>.*?)<\/p>/g, '$1</p#>');
// Sepatate <div> containing <p>
- content = content.replace(/<div([^>]*)>\s*<p>/gi, '<div$1>\n\n');
+ content = content.replace(/<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n');
// Remove <p> and <br />
content = content.replace(/\s*<p>/gi, '');
content = content.replace(/caption\]\n\n+\[caption/g, 'caption]\n\n[caption');
blocklist2 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset';
- content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'g'), '\n<$1>');
+ content = content.replace(new RegExp('\\s*<((?:'+blocklist2+')(?: [^>]*)?)\\s*>', 'g'), '\n<$1>');
content = content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*', 'g'), '</$1>\n');
content = content.replace(/<li([^>]*)>/g, '\t<li$1>');
+ if ( content.indexOf('<hr') != -1 ) {
+ content = content.replace(/\s*<hr( [^>]*)?>\s*/g, '\n\n<hr$1>\n\n');
+ }
+
if ( content.indexOf('<object') != -1 ) {
content = content.replace(/<object[\s\S]+?<\/object>/g, function(a){
return a.replace(/[\r\n]+/g, '');
},
_wp_Autop : function(pee) {
- var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend';
+ var blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend|hr';
if ( pee.indexOf('<object') != -1 ) {
pee = pee.replace(/<object[\s\S]+?<\/object>/g, function(a){
return a.replace(/[\r\n]+/g, ' ');
});
+ // Protect pre|script tags
+ if ( pee.indexOf('<pre') != -1 || pee.indexOf('<script') != -1 ) {
+ pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
+ return a.replace(/(\r\n|\n)/g, '<wp_temp_br>');
+ });
+ }
+
pee = pee + '\n\n';
pee = pee.replace(/<br \/>\s*<br \/>/gi, '\n\n');
- pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), '\n$1');
+ pee = pee.replace(new RegExp('(<(?:'+blocklist+')(?: [^>]*)?>)', 'gi'), '\n$1');
pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), '$1\n\n');
+ pee = pee.replace(/<hr( [^>]*)?>/gi, '<hr$1>\n\n'); // hr is self closing block element
pee = pee.replace(/\r\n|\r/g, '\n');
pee = pee.replace(/\n\s*\n+/g, '\n\n');
pee = pee.replace(/([\s\S]+?)\n\n/g, '<p>$1</p>\n');
pee = pee.replace(/<p>\s*?<\/p>/gi, '');
- pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
+ pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')(?: [^>]*)?>)\\s*</p>', 'gi'), "$1");
pee = pee.replace(/<p>(<li.+?)<\/p>/gi, '$1');
pee = pee.replace(/<p>\s*<blockquote([^>]*)>/gi, '<blockquote$1><p>');
pee = pee.replace(/<\/blockquote>\s*<\/p>/gi, '</p></blockquote>');
- pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)', 'gi'), "$1");
- pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
+ pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')(?: [^>]*)?>)', 'gi'), "$1");
+ pee = pee.replace(new RegExp('(</?(?:'+blocklist+')(?: [^>]*)?>)\\s*</p>', 'gi'), "$1");
pee = pee.replace(/\s*\n/gi, '<br />\n');
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
pee = pee.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi, '$1');
pee = pee.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi, '[caption$1[/caption]');
pee = pee.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g, function(a, b, c) {
- if ( c.match(/<p( [^>]+)?>/) )
+ if ( c.match(/<p( [^>]*)?>/) )
return a;
return b + '<p>' + c + '</p>';
});
- // Fix the pre|script tags
- pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
- a = a.replace(/<br ?\/?>[\r\n]*/g, '\n');
- return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '\n');
- });
+ // put back the line breaks in pre|script
+ pee = pee.replace(/<wp_temp_br>/g, '\n');
return pee;
},
-jQuery(document).ready(function(b){var a=wpCookies.getHash("TinyMCE_content_size");if(getUserSetting("editor")=="html"){if(a){b("#content").css("height",a.ch-15+"px")}}else{if(typeof tinyMCE!="object"){b("#content").css("color","#000")}else{b("#quicktags").hide()}}});var switchEditors={mode:"",I:function(a){return document.getElementById(a)},_wp_Nop:function(b){var c,a;b=b.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(d){d=d.replace(/<br ?\/?>[\r\n]*/g,"<wp_temp>");return d.replace(/<\/?p( [^>]*)?>[\r\n]*/g,"<wp_temp>")});c="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset";b=b.replace(new RegExp("\\s*</("+c+")>\\s*","g"),"</$1>\n");b=b.replace(new RegExp("\\s*<(("+c+")[^>]*)>","g"),"\n<$1>");b=b.replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>");b=b.replace(/<div([^>]*)>\s*<p>/gi,"<div$1>\n\n");b=b.replace(/\s*<p>/gi,"");b=b.replace(/\s*<\/p>\s*/gi,"\n\n");b=b.replace(/\n[\s\u00a0]+\n/g,"\n\n");b=b.replace(/\s*<br ?\/?>\s*/gi,"\n");b=b.replace(/\s*<div/g,"\n<div");b=b.replace(/<\/div>\s*/g,"</div>\n");b=b.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n");b=b.replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption");a="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset";b=b.replace(new RegExp("\\s*<(("+a+") ?[^>]*)\\s*>","g"),"\n<$1>");b=b.replace(new RegExp("\\s*</("+a+")>\\s*","g"),"</$1>\n");b=b.replace(/<li([^>]*)>/g,"\t<li$1>");if(b.indexOf("<object")!=-1){b=b.replace(/<object[\s\S]+?<\/object>/g,function(d){return d.replace(/[\r\n]+/g,"")})}b=b.replace(/<\/p#>/g,"</p>\n");b=b.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1");b=b.replace(/^\s+/,"");b=b.replace(/[\s\u00a0]+$/,"");b=b.replace(/<wp_temp>/g,"\n");return b},go:function(i,g){i=i||"content";g=g||this.mode||"";var b,h=this.I("quicktags"),c=this.I("edButtonHTML"),d=this.I("edButtonPreview"),a=this.I(i);try{b=tinyMCE.get(i)}catch(f){b=false}if("tinymce"==g){if(b&&!b.isHidden()){return false}setUserSetting("editor","tinymce");this.mode="html";d.className="active";c.className="";edCloseAllTags();h.style.display="none";a.style.color="#FFF";a.value=this.wpautop(a.value);try{if(b){b.show()}else{tinyMCE.execCommand("mceAddControl",false,i)}}catch(f){}a.style.color="#000"}else{setUserSetting("editor","html");a.style.color="#000";this.mode="tinymce";c.className="active";d.className="";if(b&&!b.isHidden()){a.style.height=b.getContentAreaContainer().offsetHeight+24+"px";b.hide()}h.style.display="block"}return false},_wp_Autop:function(a){var b="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend";if(a.indexOf("<object")!=-1){a=a.replace(/<object[\s\S]+?<\/object>/g,function(c){return c.replace(/[\r\n]+/g,"")})}a=a.replace(/<[^<>]+>/g,function(c){return c.replace(/[\r\n]+/g," ")});a=a+"\n\n";a=a.replace(/<br \/>\s*<br \/>/gi,"\n\n");a=a.replace(new RegExp("(<(?:"+b+")[^>]*>)","gi"),"\n$1");a=a.replace(new RegExp("(</(?:"+b+")>)","gi"),"$1\n\n");a=a.replace(/\r\n|\r/g,"\n");a=a.replace(/\n\s*\n+/g,"\n\n");a=a.replace(/([\s\S]+?)\n\n/g,"<p>$1</p>\n");a=a.replace(/<p>\s*?<\/p>/gi,"");a=a.replace(new RegExp("<p>\\s*(</?(?:"+b+")[^>]*>)\\s*</p>","gi"),"$1");a=a.replace(/<p>(<li.+?)<\/p>/gi,"$1");a=a.replace(/<p>\s*<blockquote([^>]*)>/gi,"<blockquote$1><p>");a=a.replace(/<\/blockquote>\s*<\/p>/gi,"</p></blockquote>");a=a.replace(new RegExp("<p>\\s*(</?(?:"+b+")[^>]*>)","gi"),"$1");a=a.replace(new RegExp("(</?(?:"+b+")[^>]*>)\\s*</p>","gi"),"$1");a=a.replace(/\s*\n/gi,"<br />\n");a=a.replace(new RegExp("(</?(?:"+b+")[^>]*>)\\s*<br />","gi"),"$1");a=a.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1");a=a.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi,"[caption$1[/caption]");a=a.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(e,d,f){if(f.match(/<p( [^>]+)?>/)){return e}return d+"<p>"+f+"</p>"});a=a.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(c){c=c.replace(/<br ?\/?>[\r\n]*/g,"\n");return c.replace(/<\/?p( [^>]*)?>[\r\n]*/g,"\n")});return a},pre_wpautop:function(b){var a=this,c={o:a,data:b,unfiltered:b};jQuery("body").trigger("beforePreWpautop",[c]);c.data=a._wp_Nop(c.data);jQuery("body").trigger("afterPreWpautop",[c]);return c.data},wpautop:function(b){var a=this,c={o:a,data:b,unfiltered:b};jQuery("body").trigger("beforeWpautop",[c]);c.data=a._wp_Autop(c.data);jQuery("body").trigger("afterWpautop",[c]);return c.data}};
\ No newline at end of file
+jQuery(document).ready(function(b){var a=wpCookies.getHash("TinyMCE_content_size");if(getUserSetting("editor")=="html"){if(a){b("#content").css("height",a.ch-15+"px")}}else{if(typeof tinyMCE!="object"){b("#content").css("color","#000")}else{b("#quicktags").hide()}}});var switchEditors={mode:"",I:function(a){return document.getElementById(a)},_wp_Nop:function(b){var c,a;if(b.indexOf("<pre")!=-1||b.indexOf("<script")!=-1){b=b.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(d){d=d.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp_temp>");return d.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp_temp>")})}c="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset";b=b.replace(new RegExp("\\s*</("+c+")>\\s*","g"),"</$1>\n");b=b.replace(new RegExp("\\s*<((?:"+c+")(?: [^>]*)?)>","g"),"\n<$1>");b=b.replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>");b=b.replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n");b=b.replace(/\s*<p>/gi,"");b=b.replace(/\s*<\/p>\s*/gi,"\n\n");b=b.replace(/\n[\s\u00a0]+\n/g,"\n\n");b=b.replace(/\s*<br ?\/?>\s*/gi,"\n");b=b.replace(/\s*<div/g,"\n<div");b=b.replace(/<\/div>\s*/g,"</div>\n");b=b.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n");b=b.replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption");a="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset";b=b.replace(new RegExp("\\s*<((?:"+a+")(?: [^>]*)?)\\s*>","g"),"\n<$1>");b=b.replace(new RegExp("\\s*</("+a+")>\\s*","g"),"</$1>\n");b=b.replace(/<li([^>]*)>/g,"\t<li$1>");if(b.indexOf("<hr")!=-1){b=b.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")}if(b.indexOf("<object")!=-1){b=b.replace(/<object[\s\S]+?<\/object>/g,function(d){return d.replace(/[\r\n]+/g,"")})}b=b.replace(/<\/p#>/g,"</p>\n");b=b.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1");b=b.replace(/^\s+/,"");b=b.replace(/[\s\u00a0]+$/,"");b=b.replace(/<wp_temp>/g,"\n");return b},go:function(i,g){i=i||"content";g=g||this.mode||"";var b,h=this.I("quicktags"),c=this.I("edButtonHTML"),d=this.I("edButtonPreview"),a=this.I(i);try{b=tinyMCE.get(i)}catch(f){b=false}if("tinymce"==g){if(b&&!b.isHidden()){return false}setUserSetting("editor","tinymce");this.mode="html";d.className="active";c.className="";edCloseAllTags();h.style.display="none";a.style.color="#FFF";a.value=this.wpautop(a.value);try{if(b){b.show()}else{tinyMCE.execCommand("mceAddControl",false,i)}}catch(f){}a.style.color="#000"}else{setUserSetting("editor","html");a.style.color="#000";this.mode="tinymce";c.className="active";d.className="";if(b&&!b.isHidden()){a.style.height=b.getContentAreaContainer().offsetHeight+24+"px";b.hide()}h.style.display="block"}return false},_wp_Autop:function(a){var b="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend|hr";if(a.indexOf("<object")!=-1){a=a.replace(/<object[\s\S]+?<\/object>/g,function(c){return c.replace(/[\r\n]+/g,"")})}a=a.replace(/<[^<>]+>/g,function(c){return c.replace(/[\r\n]+/g," ")});if(a.indexOf("<pre")!=-1||a.indexOf("<script")!=-1){a=a.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(c){return c.replace(/(\r\n|\n)/g,"<wp_temp_br>")})}a=a+"\n\n";a=a.replace(/<br \/>\s*<br \/>/gi,"\n\n");a=a.replace(new RegExp("(<(?:"+b+")(?: [^>]*)?>)","gi"),"\n$1");a=a.replace(new RegExp("(</(?:"+b+")>)","gi"),"$1\n\n");a=a.replace(/<hr( [^>]*)?>/gi,"<hr$1>\n\n");a=a.replace(/\r\n|\r/g,"\n");a=a.replace(/\n\s*\n+/g,"\n\n");a=a.replace(/([\s\S]+?)\n\n/g,"<p>$1</p>\n");a=a.replace(/<p>\s*?<\/p>/gi,"");a=a.replace(new RegExp("<p>\\s*(</?(?:"+b+")(?: [^>]*)?>)\\s*</p>","gi"),"$1");a=a.replace(/<p>(<li.+?)<\/p>/gi,"$1");a=a.replace(/<p>\s*<blockquote([^>]*)>/gi,"<blockquote$1><p>");a=a.replace(/<\/blockquote>\s*<\/p>/gi,"</p></blockquote>");a=a.replace(new RegExp("<p>\\s*(</?(?:"+b+")(?: [^>]*)?>)","gi"),"$1");a=a.replace(new RegExp("(</?(?:"+b+")(?: [^>]*)?>)\\s*</p>","gi"),"$1");a=a.replace(/\s*\n/gi,"<br />\n");a=a.replace(new RegExp("(</?(?:"+b+")[^>]*>)\\s*<br />","gi"),"$1");a=a.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1");a=a.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi,"[caption$1[/caption]");a=a.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(e,d,f){if(f.match(/<p( [^>]*)?>/)){return e}return d+"<p>"+f+"</p>"});a=a.replace(/<wp_temp_br>/g,"\n");return a},pre_wpautop:function(b){var a=this,c={o:a,data:b,unfiltered:b};jQuery("body").trigger("beforePreWpautop",[c]);c.data=a._wp_Nop(c.data);jQuery("body").trigger("afterPreWpautop",[c]);return c.data},wpautop:function(b){var a=this,c={o:a,data:b,unfiltered:b};jQuery("body").trigger("beforeWpautop",[c]);c.data=a._wp_Autop(c.data);jQuery("body").trigger("afterWpautop",[c]);return c.data}};
\ No newline at end of file
-// $Id: farbtastic.js,v 1.2 2007/01/08 22:53:01 unconed Exp $
-// Farbtastic 1.2
-
-var farbtastic_click = false;
-
-jQuery.fn.farbtastic = function (callback) {
- jQuery.farbtastic(this, callback);
+/*!
+ * Farbtastic: jQuery color picker plug-in v1.3u
+ *
+ * Licensed under the GPL license:
+ * http://www.gnu.org/licenses/gpl.html
+ */
+(function($) {
+
+$.fn.farbtastic = function (options) {
+ $.farbtastic(this, options);
return this;
};
-jQuery.farbtastic = function (container, callback) {
- var container = jQuery(container).get(0);
- return container.farbtastic || (container.farbtastic = new jQuery._farbtastic(container, callback));
-}
+$.farbtastic = function (container, callback) {
+ var container = $(container).get(0);
+ return container.farbtastic || (container.farbtastic = new $._farbtastic(container, callback));
+};
-jQuery._farbtastic = function (container, callback) {
+$._farbtastic = function (container, callback) {
// Store farbtastic object
var fb = this;
// Insert markup
- jQuery(container).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>');
- var e = jQuery('.farbtastic', container);
- fb.wheel = jQuery('.wheel', container).get(0);
+ $(container).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>');
+ var e = $('.farbtastic', container);
+ fb.wheel = $('.wheel', container).get(0);
// Dimensions
fb.radius = 84;
fb.square = 100;
// Fix background PNGs in IE6
if (navigator.appVersion.match(/MSIE [0-6]\./)) {
- jQuery('*', e).each(function () {
+ $('*', e).each(function () {
if (this.currentStyle.backgroundImage != 'none') {
var image = this.currentStyle.backgroundImage;
image = this.currentStyle.backgroundImage.substring(5, image.length - 2);
- jQuery(this).css({
+ $(this).css({
'backgroundImage': 'none',
'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
});
fb.linkTo = function (callback) {
// Unbind previous nodes
if (typeof fb.callback == 'object') {
- jQuery(fb.callback).unbind('keyup', fb.updateValue);
+ $(fb.callback).unbind('keyup', fb.updateValue);
}
// Reset color
fb.callback = callback;
}
else if (typeof callback == 'object' || typeof callback == 'string') {
- fb.callback = jQuery(callback);
+ fb.callback = $(callback);
fb.callback.bind('keyup', fb.updateValue);
if (fb.callback.get(0).value) {
fb.setColor(fb.callback.get(0).value);
}
}
return this;
- }
+ };
fb.updateValue = function (event) {
if (this.value && this.value != fb.color) {
fb.setColor(this.value);
}
- }
+ };
/**
* Change color with HTML syntax #123456
fb.updateDisplay();
}
return this;
- }
+ };
/**
* Change color with HSL triplet [0..1, 0..1, 0..1]
fb.color = fb.pack(fb.rgb);
fb.updateDisplay();
return this;
- }
+ };
/////////////////////////////////////////////////////
* of the widget.
*/
fb.widgetCoords = function (event) {
- var x, y;
- var el = event.target || event.srcElement;
- var reference = fb.wheel;
-
- if (typeof event.offsetX != 'undefined') {
- // Use offset coordinates and find common offsetParent
- var pos = { x: event.offsetX, y: event.offsetY };
-
- // Send the coordinates upwards through the offsetParent chain.
- var e = el;
- while (e) {
- e.mouseX = pos.x;
- e.mouseY = pos.y;
- pos.x += e.offsetLeft;
- pos.y += e.offsetTop;
- e = e.offsetParent;
- }
-
- // Look for the coordinates starting from the wheel widget.
- var e = reference;
- var offset = { x: 0, y: 0 }
- while (e) {
- if (typeof e.mouseX != 'undefined') {
- x = e.mouseX - offset.x;
- y = e.mouseY - offset.y;
- break;
- }
- offset.x += e.offsetLeft;
- offset.y += e.offsetTop;
- e = e.offsetParent;
- }
-
- // Reset stored coordinates
- e = el;
- while (e) {
- e.mouseX = undefined;
- e.mouseY = undefined;
- e = e.offsetParent;
- }
- }
- else {
- // Use absolute coordinates
- var pos = fb.absolutePosition(reference);
- x = (event.pageX || 0*(event.clientX + jQuery('html').get(0).scrollLeft)) - pos.x;
- y = (event.pageY || 0*(event.clientY + jQuery('html').get(0).scrollTop)) - pos.y;
- }
- // Subtract distance to middle
- return { x: x - fb.width / 2, y: y - fb.width / 2 };
- }
+ var offset = $(fb.wheel).offset();
+ return { x: (event.pageX - offset.left) - fb.width / 2, y: (event.pageY - offset.top) - fb.width / 2 };
+ };
/**
* Mousedown handler
*/
fb.mousedown = function (event) {
- farbtastic_click = true;
// Capture mouse
if (!document.dragging) {
- jQuery(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);
+ $(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);
document.dragging = true;
}
// Process
fb.mousemove(event);
return false;
- }
+ };
/**
* Mousemove handler
fb.setHSL([fb.hsl[0], sat, lum]);
}
return false;
- }
+ };
/**
* Mouseup handler
*/
fb.mouseup = function () {
// Uncapture mouse
- farbtastic_click = false;
- jQuery(document).unbind('mousemove', fb.mousemove);
- jQuery(document).unbind('mouseup', fb.mouseup);
+ $(document).unbind('mousemove', fb.mousemove);
+ $(document).unbind('mouseup', fb.mouseup);
document.dragging = false;
- }
+ };
/**
* Update the markers and styles
fb.updateDisplay = function () {
// Markers
var angle = fb.hsl[0] * 6.28;
- jQuery('.h-marker', e).css({
+ $('.h-marker', e).css({
left: Math.round(Math.sin(angle) * fb.radius + fb.width / 2) + 'px',
top: Math.round(-Math.cos(angle) * fb.radius + fb.width / 2) + 'px'
});
- jQuery('.sl-marker', e).css({
+ $('.sl-marker', e).css({
left: Math.round(fb.square * (.5 - fb.hsl[1]) + fb.width / 2) + 'px',
top: Math.round(fb.square * (.5 - fb.hsl[2]) + fb.width / 2) + 'px'
});
// Saturation/Luminance gradient
- jQuery('.color', e).css('backgroundColor', fb.pack(fb.HSLToRGB([fb.hsl[0], 1, 0.5])));
+ $('.color', e).css('backgroundColor', fb.pack(fb.HSLToRGB([fb.hsl[0], 1, 0.5])));
// Linked elements or callback
if (typeof fb.callback == 'object') {
// Set background/foreground color
- jQuery(fb.callback).css({
+ $(fb.callback).css({
backgroundColor: fb.color,
color: fb.hsl[2] > 0.5 ? '#000' : '#fff'
});
// Change linked value
- jQuery(fb.callback).each(function() {
+ $(fb.callback).each(function() {
if (this.value && this.value != fb.color) {
this.value = fb.color;
}
else if (typeof fb.callback == 'function') {
fb.callback.call(fb, fb.color);
}
- }
-
- /**
- * Get absolute position of element
- */
- fb.absolutePosition = function (el) {
- var r = { x: el.offsetLeft, y: el.offsetTop };
- // Resolve relative to offsetParent
- if (el.offsetParent) {
- var tmp = fb.absolutePosition(el.offsetParent);
- r.x += tmp.x;
- r.y += tmp.y;
- }
- return r;
};
/* Various color utility functions */
return '#' + (r < 16 ? '0' : '') + r.toString(16) +
(g < 16 ? '0' : '') + g.toString(16) +
(b < 16 ? '0' : '') + b.toString(16);
- }
+ };
fb.unpack = function (color) {
if (color.length == 7) {
parseInt('0x' + color.substring(2, 3)) / 15,
parseInt('0x' + color.substring(3, 4)) / 15];
}
- }
+ };
fb.HSLToRGB = function (hsl) {
var m1, m2, r, g, b;
return [this.hueToRGB(m1, m2, h+0.33333),
this.hueToRGB(m1, m2, h),
this.hueToRGB(m1, m2, h-0.33333)];
- }
+ };
fb.hueToRGB = function (m1, m2, h) {
h = (h < 0) ? h + 1 : ((h > 1) ? h - 1 : h);
if (h * 2 < 1) return m2;
if (h * 3 < 2) return m1 + (m2 - m1) * (0.66666 - h) * 6;
return m1;
- }
+ };
fb.RGBToHSL = function (rgb) {
var min, max, delta, h, s, l;
h /= 6;
}
return [h, s, l];
- }
+ };
// Install mousedown handler (the others are set on the document on-demand)
- jQuery('*', e).mousedown(fb.mousedown);
+ $('*', e).mousedown(fb.mousedown);
// Init color
fb.setColor('#000000');
if (callback) {
fb.linkTo(callback);
}
-}
\ No newline at end of file
+};
+
+})(jQuery);
\ No newline at end of file
-
(function($) {
inlineEditPost = {
- init : function() {
+ init : function(){
var t = this, qeRow = $('#inline-edit'), bulkRow = $('#bulk-edit');
- t.type = $('table.widefat').hasClass('page') ? 'page' : 'post';
- t.what = '#'+t.type+'-';
+ t.type = $('table.widefat').hasClass('pages') ? 'page' : 'post';
+ t.what = '#post-';
// prepare the edit rows
- qeRow.keyup(function(e) { if(e.which == 27) return inlineEditPost.revert(); });
- bulkRow.keyup(function(e) { if (e.which == 27) return inlineEditPost.revert(); });
+ qeRow.keyup(function(e){
+ if (e.which == 27)
+ return inlineEditPost.revert();
+ });
+ bulkRow.keyup(function(e){
+ if (e.which == 27)
+ return inlineEditPost.revert();
+ });
- $('a.cancel', qeRow).click(function() { return inlineEditPost.revert(); });
- $('a.save', qeRow).click(function() { return inlineEditPost.save(this); });
- $('td', qeRow).keydown(function(e) { if ( e.which == 13 ) return inlineEditPost.save(this); });
+ $('a.cancel', qeRow).click(function(){
+ return inlineEditPost.revert();
+ });
+ $('a.save', qeRow).click(function(){
+ return inlineEditPost.save(this);
+ });
+ $('td', qeRow).keydown(function(e){
+ if ( e.which == 13 )
+ return inlineEditPost.save(this);
+ });
- $('a.cancel', bulkRow).click(function() { return inlineEditPost.revert(); });
+ $('a.cancel', bulkRow).click(function(){
+ return inlineEditPost.revert();
+ });
$('#inline-edit .inline-edit-private input[value=private]').click( function(){
var pw = $('input.inline-edit-password-input');
});
// add events
- $('a.editinline').live('click', function() { inlineEditPost.edit(this); return false; });
+ $('a.editinline').live('click', function(){
+ inlineEditPost.edit(this);
+ return false;
+ });
$('#bulk-title-div').parents('fieldset').after(
$('#inline-edit fieldset.inline-edit-categories').clone()
);
// hiearchical taxonomies expandable?
- $('span.catshow').click(function() {
+ $('span.catshow').click(function(){
$(this).hide().next().show().parent().next().addClass("cat-hover");
});
- $('span.cathide').click(function() {
+ $('span.cathide').click(function(){
$(this).hide().prev().show().parent().next().removeClass("cat-hover");
});
if ( $('form#posts-filter tr.inline-editor').length > 0 )
t.revert();
});
-
},
- toggle : function(el) {
+ toggle : function(el){
var t = this;
$(t.what+t.getId(el)).css('display') == 'none' ? t.revert() : t.edit(el);
},
- setBulk : function() {
+ setBulk : function(){
var te = '', type = this.type, tax, c = true;
this.revert();
return this.revert();
$('#bulk-titles').html(te);
- $('#bulk-titles a').click(function() {
+ $('#bulk-titles a').click(function(){
var id = $(this).attr('id').substr(1);
$('table.widefat input[value="'+id+'"]').attr('checked', '');
});
// enable autocomplete for tags
- if ( type == 'post' ) {
+ if ( 'post' == type ) {
// support multi taxonomies?
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: ", " } );
},
edit : function(id) {
- var t = this, fields, editRow, rowData, cats, status, pageOpt, f, pageLevel, nextPage, pageLoop = true, nextLevel, tax;
+ var t = this, fields, editRow, rowData, cats, status, pageOpt, pageLevel, nextPage, pageLoop = true, nextLevel, tax;
t.revert();
if ( typeof(id) == 'object' )
id = t.getId(id);
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 == 'page' )
+ fields.push('post_parent', 'menu_order', 'page_template');
// add the new blank row
editRow = $('#inline-edit').clone(true);
// author no longer has edit caps, so we need to add them to the list of authors
$(':input[name="post_author"]', editRow).prepend('<option value="' + $('.post_author', rowData).text() + '">' + $('#' + t.type + '-' + id + ' .author').text() + '</option>');
}
+ if ( $(':input[name="post_author"] option', editRow).length == 1 ) {
+ $('label.inline-edit-author', editRow).hide();
+ }
- for ( f = 0; f < fields.length; f++ ) {
+ for ( var f = 0; f < fields.length; f++ ) {
$(':input[name="'+fields[f]+'"]', editRow).val( $('.'+fields[f], rowData).text() );
}
// hierarchical taxonomies
$('.post_category', rowData).each(function(){
- if( term_ids = $(this).text() )
- {
+ var term_ids = $(this).text();
+
+ if ( term_ids ) {
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() )
- {
+ var terms = $(this).text();
+
+ if ( terms ) {
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();
- if ( status != 'future' ) $('select[name="_status"] option[value="future"]', editRow).remove();
- if ( status == 'private' ) {
+ if ( 'future' != status )
+ $('select[name="_status"] option[value="future"]', editRow).remove();
+
+ if ( 'private' == status ) {
$('input[name="keep_private"]', editRow).attr("checked", "checked");
$('input.inline-edit-password-input').val('').attr('disabled', 'disabled');
}
save : function(id) {
var params, fields, page = $('.post_status_page').val() || '';
- if( typeof(id) == 'object' )
+ if ( typeof(id) == 'object' )
id = this.getId(id);
$('table.widefat .inline-edit-save .waiting').show();
return false;
},
- revert : function() {
- var id;
+ revert : function(){
+ var id = $('table.widefat tr.inline-editor').attr('id');
- if ( id = $('table.widefat tr.inline-editor').attr('id') ) {
+ if ( id ) {
$('table.widefat .inline-edit-save .waiting').hide();
if ( 'bulk-edit' == id ) {
$('table.widefat #bulk-edit').removeClass('inline-editor').hide();
$('#bulk-titles').html('');
$('#inlineedit').append( $('#bulk-edit') );
- } else {
+ } else {
$('#'+id).remove();
id = id.substr( id.lastIndexOf('-') + 1 );
$(this.what+id).show();
},
getId : function(o) {
- var id = o.tagName == 'TR' ? o.id : $(o).parents('tr').attr('id'), parts = id.split('-');
+ var id = $(o).closest('tr').attr('id'),
+ parts = id.split('-');
return parts[parts.length - 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(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+='<div id="ttle'+h+'"><a id="_'+h+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+c+"</div>"}});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('<option value="'+a(".post_author",g).text()+'">'+a("#"+o.type+"-"+b+" .author").text()+"</option>")}for(k=0;k<j.length;k++){a(':input[name="'+j[k]+'"]',d).val(a("."+j[k],g).text())}if(a(".comment_status",g).text()=="open"){a('input[name="comment_status"]',d).attr("checked","checked")}if(a(".ping_status",g).text()=="open"){a('input[name="ping_status"]',d).attr("checked","checked")}if(a(".sticky",g).text()=="sticky"){a('input[name="sticky"]',d).attr("checked","checked")}a(".post_category",g).each(function(){if(term_ids=a(this).text()){taxname=a(this).attr("id").replace("_"+b,"");a("ul."+taxname+"-checklist :checkbox",d).val(term_ids.split(","))}});a(".tags_input",g).each(function(){if(terms=a(this).text()){taxname=a(this).attr("id").replace("_"+b,"");a("textarea.tax_input_"+taxname,d).val(terms);a("textarea.tax_input_"+taxname,d).suggest("admin-ajax.php?action=ajax-tag-search&tax="+taxname,{delay:500,minchars:2,multiple:true,multipleSep:", "})}});i=a("._status",g).text();if(i!="future"){a('select[name="_status"] option[value="future"]',d).remove()}if(i=="private"){a('input[name="keep_private"]',d).attr("checked","checked");a("input.inline-edit-password-input").val("").attr("disabled","disabled")}h=a('select[name="post_parent"] option[value="'+b+'"]',d);if(h.length>0){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("<tr")){a(inlineEditPost.what+e).remove();a("#edit-"+e).before(f).remove();a(inlineEditPost.what+e).hide().fadeIn()}else{f=f.replace(/<.[^<>]*?>/g,"");a("#edit-"+e+" .inline-edit-save").append('<span class="error">'+f+"</span>")}}else{a("#edit-"+e+" .inline-edit-save").append('<span class="error">'+inlineEditL10n.error+"</span>")}},"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("pages")?"page":"post";c.what="#post-";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+='<div id="ttle'+h+'"><a id="_'+h+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+c+"</div>"}});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("post"==d){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,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('<option value="'+a(".post_author",g).text()+'">'+a("#"+o.type+"-"+b+" .author").text()+"</option>")}if(a(':input[name="post_author"] option',d).length==1){a("label.inline-edit-author",d).hide()}for(var k=0;k<j.length;k++){a(':input[name="'+j[k]+'"]',d).val(a("."+j[k],g).text())}if(a(".comment_status",g).text()=="open"){a('input[name="comment_status"]',d).attr("checked","checked")}if(a(".ping_status",g).text()=="open"){a('input[name="ping_status"]',d).attr("checked","checked")}if(a(".sticky",g).text()=="sticky"){a('input[name="sticky"]',d).attr("checked","checked")}a(".post_category",g).each(function(){var f=a(this).text();if(f){taxname=a(this).attr("id").replace("_"+b,"");a("ul."+taxname+"-checklist :checkbox",d).val(f.split(","))}});a(".tags_input",g).each(function(){var f=a(this).text();if(f){taxname=a(this).attr("id").replace("_"+b,"");a("textarea.tax_input_"+taxname,d).val(f);a("textarea.tax_input_"+taxname,d).suggest("admin-ajax.php?action=ajax-tag-search&tax="+taxname,{delay:500,minchars:2,multiple:true,multipleSep:", "})}});i=a("._status",g).text();if("future"!=i){a('select[name="_status"] option[value="future"]',d).remove()}if("private"==i){a('input[name="keep_private"]',d).attr("checked","checked");a("input.inline-edit-password-input").val("").attr("disabled","disabled")}h=a('select[name="post_parent"] option[value="'+b+'"]',d);if(h.length>0){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("<tr")){a(inlineEditPost.what+e).remove();a("#edit-"+e).before(f).remove();a(inlineEditPost.what+e).hide().fadeIn()}else{f=f.replace(/<.[^<>]*?>/g,"");a("#edit-"+e+" .inline-edit-save").append('<span class="error">'+f+"</span>")}}else{a("#edit-"+e+" .inline-edit-save").append('<span class="error">'+inlineEditL10n.error+"</span>")}},"html");return false},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");if(b){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=a(c).closest("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditPost.init()})})(jQuery);
\ No newline at end of file
--- /dev/null
+jQuery(document).ready(function($) {
+
+window.listTable = {
+
+ init: function() {
+ this.loading = false;
+
+ this.reset( '.tablenav, .search-box, .wp-list-table' );
+
+ if ( '' == $.query.GET('paged') )
+ $.query.SET('paged', 1);
+ this.set_total_pages();
+
+ this.$tbody = $('#the-list, #the-comment-list');
+ },
+
+ /**
+ * Simulates form.reset() for all input, select, and textarea elements
+ * within a provided context.
+ */
+ reset: function( context ) {
+ context = $(context);
+
+ $('input', context).each( function(){
+ this.value = this.defaultValue;
+ this.checked = this.defaultChecked;
+ });
+
+ $('select', context).each( function(){
+ var options = $('option', this),
+ anySelected = false;
+
+ options.each( function(){
+ this.selected = this.defaultSelected;
+ anySelected = anySelected || this.defaultSelected;
+ });
+
+ // If no options are selected within a single-select dropdown,
+ // select the first element by default.
+ if ( ! this.multiple && ! anySelected )
+ options[0].selected = true;
+ });
+
+ $('textarea', context).each( function(){
+ this.value = this.defaultValue;
+ });
+ },
+
+ // paging
+ set_total_pages: function(num) {
+ var last_page_url = $('.last-page').attr('href');
+
+ if ( last_page_url )
+ this.total_pages = num || $.query.load( last_page_url ).get('paged');
+ },
+
+ get_total_pages: function() {
+ return this.total_pages;
+ },
+
+ htmlencode: function(value) {
+ return $('<div/>').text(value).html();
+ },
+
+ update_rows: function(args, reset_paging, callback) {
+ if ( this.loading )
+ return false;
+
+ var different = false, data = {};
+
+ $.each(args, function(key, val) {
+ if ( val != $.query.GET(key) ) {
+ $.query.SET(key, val);
+ different = true;
+ }
+ });
+
+ if ( !different )
+ return false;
+
+ this.start_loading();
+
+ if ( reset_paging )
+ $.query.SET('paged', 1);
+
+ $.each( $.query.get(), function(key, value) {
+ if ( true === value )
+ data[key] = '';
+ else
+ data[key] = value;
+ });
+
+ this._callback = callback;
+
+ this.fetch_list(
+ data,
+ $.proxy(this, 'handle_success'),
+ $.proxy(this, 'handle_error')
+ );
+
+ return true;
+ },
+
+ fetch_list: function(data, success_callback, error_callback) {
+ data = $.extend(data, {
+ 'action': 'fetch-list',
+ 'list_args': list_args,
+ '_ajax_fetch_list_nonce': $('#_ajax_fetch_list_nonce').val()
+ });
+
+ $.ajax({
+ url: ajaxurl,
+ global: false,
+ dataType: 'json',
+ data: data,
+ success: success_callback,
+ error: error_callback
+ });
+ },
+
+ handle_success: function(response) {
+ if ( 'object' != typeof response ) {
+ this.handle_error();
+ } else {
+ var tablenav = $('.tablenav-pages');
+
+ this.stop_loading();
+
+ $('div.updated, div.error').not('.persistent, .inline').remove();
+
+ this.$tbody.html(response.rows);
+
+ $('.displaying-num').html(response.total_items_i18n);
+ $('.total-pages').html(response.total_pages_i18n);
+
+ this.set_total_pages(response.total_pages);
+
+ if ( response.total_pages > 1 )
+ tablenav.removeClass('one-page');
+
+ $('.current-page').val($.query.GET('paged'));
+
+ // Disable buttons that should noop.
+ tablenav.find('.first-page, .prev-page').toggleClass('disabled', 1 == $.query.GET('paged'));
+ tablenav.find('.next-page, .last-page').toggleClass('disabled', response.total_pages == $.query.GET('paged'));
+
+ $('th.column-cb :input').attr('checked', false);
+
+ if ( history.replaceState ) {
+ history.replaceState({}, '', location.pathname + $.query);
+ }
+
+ if ( this._callback )
+ this._callback();
+ }
+ },
+
+ handle_error: function() {
+ this.stop_loading();
+
+ $('h2').after('<div class="error ajax below-h2"><p>' + listTableL10n.error + '</p></div>');
+ },
+
+ start_loading: function() {
+ this.loading = true;
+
+ $('.error.ajax').remove();
+
+ $('.list-ajax-loading').css('visibility', 'visible');
+ },
+
+ stop_loading: function() {
+ this.loading = false;
+
+ $('.list-ajax-loading').css('visibility', 'hidden');
+ }
+}
+
+listTable.init();
+
+// Ajaxify various UI elements
+
+ function change_page(paged, $el) {
+ if ( paged < 1 )
+ paged = 1;
+
+ if ( paged > listTable.get_total_pages() )
+ paged = listTable.get_total_pages();
+
+ $(listTable).trigger('beforeChangePage');
+ listTable.update_rows({'paged': paged}, false, function() {
+ if ( $el.parents('.tablenav.bottom').length )
+ scrollTo(0, 0);
+
+ $(listTable).trigger('changePage');
+ });
+ }
+
+ // pagination
+ $('.tablenav-pages a').click(function() {
+ var $el = $(this),
+ paged = $.query.GET('paged');
+
+ switch ( $el.attr('class') ) {
+ case 'first-page':
+ paged = 1;
+ break;
+ case 'prev-page':
+ paged -= 1;
+ break;
+ case 'next-page':
+ paged += 1;
+ break;
+ case 'last-page':
+ paged = listTable.get_total_pages();
+ break;
+ }
+
+ change_page(paged, $el);
+
+ return false;
+ });
+
+ $('.current-page').keypress(function(e) {
+ if ( 13 != e.keyCode )
+ return;
+
+ var $el = $(this);
+
+ change_page(parseInt($el.val()) || 1, $el);
+
+ return false;
+ });
+
+ // sortable columns
+ $('th.sortable a, th.sorted a').click(function() {
+
+ function get_initial_order($el) {
+ return $.query.load( $el.find('a').attr('href') ).get('order');
+ }
+
+ var $link = $(this),
+ $th = $link.parent('th'),
+ thIndex = $th.index(),
+ orderby = $.query.load( $link.attr('href') ).get('orderby'),
+ order;
+
+ // th should include both headers in thead and tfoot
+ $th = $th.closest('table').find('thead th:eq(' + thIndex + '), tfoot th:eq(' + thIndex + ')');
+
+ if ( orderby == $.query.get('orderby') ) {
+ // changing the direction
+ order = ( 'asc' == $.query.get('order') ) ? 'desc' : 'asc';
+ } else {
+ // changing the parameter
+ order = get_initial_order($th);
+
+ var $old_th = $('th.sorted');
+ if ( $old_th.length ) {
+ $old_th.removeClass('sorted').addClass('sortable');
+ $old_th.removeClass('desc').removeClass('asc').addClass(
+ 'asc' == get_initial_order( $old_th ) ? 'desc' : 'asc'
+ );
+ }
+
+ $th.removeClass('sortable').addClass('sorted');
+ }
+
+ $th.removeClass('desc').removeClass('asc').addClass(order);
+
+ listTable.update_rows({'orderby': orderby, 'order': order}, true);
+
+ return false;
+ });
+
+ // searchbox
+ function change_search(ev) {
+ if ( 'keypress' == ev.type && 13 != ev.keyCode )
+ return;
+
+ ev.preventDefault();
+ ev.stopImmediatePropagation();
+
+ var data = $(this).parent('.search-box').find(':input').serializeObject();
+
+ listTable.update_rows(data, true, function() {
+ if ( $('h2.nav-tab-wrapper').length )
+ return;
+
+ if ( 'site-users-network' == pagenow || 'site-themes-network' == pagenow ) {
+ $('h4.search-text').remove();
+
+ if ( data.s )
+ $('ul.subsubsub').after($('<h4 class="clear search-text">').html(
+ listTableL10n.search.replace('%s', this.htmlencode(data.s))
+ ));
+ } else {
+ $('h2 .subtitle').remove();
+
+ if ( data.s )
+ $('h2').append($('<span class="subtitle">').html(
+ listTableL10n.search.replace('%s', this.htmlencode(data.s))
+ ));
+ }
+ });
+ }
+ $('.search-box :submit').click(change_search);
+ $('.search-box :text').keypress(change_search);
+
+ // tablenav dropdowns
+ $('#post-query-submit').click(function() {
+ var args = {};
+
+ $(this).parents('.actions').find('select[name!="action"]').each(function() {
+ var $el = $(this);
+
+ args[$el.attr('name')] = $el.val();
+ });
+
+ listTable.update_rows(args, true);
+
+ return false;
+ });
+
+ // view switch
+ $('.view-switch a').click(function() {
+ var $this = $(this);
+
+ listTable.update_rows({'mode': $.query.load($this.attr('href')).get('mode')}, false, function() {
+ $('.view-switch .current').removeClass('current');
+ $this.addClass('current');
+ });
+
+ return false;
+ });
+});
+
--- /dev/null
+jQuery(document).ready(function(a){window.listTable={init:function(){this.loading=false;this.reset(".tablenav, .search-box, .wp-list-table");if(""==a.query.GET("paged")){a.query.SET("paged",1)}this.set_total_pages();this.$tbody=a("#the-list, #the-comment-list")},reset:function(d){d=a(d);a("input",d).each(function(){this.value=this.defaultValue;this.checked=this.defaultChecked});a("select",d).each(function(){var e=a("option",this),f=false;e.each(function(){this.selected=this.defaultSelected;f=f||this.defaultSelected});if(!this.multiple&&!f){e[0].selected=true}});a("textarea",d).each(function(){this.value=this.defaultValue})},set_total_pages:function(e){var d=a(".last-page").attr("href");if(d){this.total_pages=e||a.query.load(d).get("paged")}},get_total_pages:function(){return this.total_pages},htmlencode:function(d){return a("<div/>").text(d).html()},update_rows:function(e,d,h){if(this.loading){return false}var g=false,f={};a.each(e,function(i,j){if(j!=a.query.GET(i)){a.query.SET(i,j);g=true}});if(!g){return false}this.start_loading();if(d){a.query.SET("paged",1)}a.each(a.query.get(),function(i,j){if(true===j){f[i]=""}else{f[i]=j}});this._callback=h;this.fetch_list(f,a.proxy(this,"handle_success"),a.proxy(this,"handle_error"));return true},fetch_list:function(e,f,d){e=a.extend(e,{action:"fetch-list",list_args:list_args,_ajax_fetch_list_nonce:a("#_ajax_fetch_list_nonce").val()});a.ajax({url:ajaxurl,global:false,dataType:"json",data:e,success:f,error:d})},handle_success:function(d){if("object"!=typeof d){this.handle_error()}else{var e=a(".tablenav-pages");this.stop_loading();a("div.updated, div.error").not(".persistent, .inline").remove();this.$tbody.html(d.rows);a(".displaying-num").html(d.total_items_i18n);a(".total-pages").html(d.total_pages_i18n);this.set_total_pages(d.total_pages);if(d.total_pages>1){e.removeClass("one-page")}a(".current-page").val(a.query.GET("paged"));e.find(".first-page, .prev-page").toggleClass("disabled",1==a.query.GET("paged"));e.find(".next-page, .last-page").toggleClass("disabled",d.total_pages==a.query.GET("paged"));a("th.column-cb :input").attr("checked",false);if(history.replaceState){history.replaceState({},"",location.pathname+a.query)}if(this._callback){this._callback()}}},handle_error:function(){this.stop_loading();a("h2").after('<div class="error ajax below-h2"><p>'+listTableL10n.error+"</p></div>")},start_loading:function(){this.loading=true;a(".error.ajax").remove();a(".list-ajax-loading").css("visibility","visible")},stop_loading:function(){this.loading=false;a(".list-ajax-loading").css("visibility","hidden")}};listTable.init();function b(e,d){if(e<1){e=1}if(e>listTable.get_total_pages()){e=listTable.get_total_pages()}a(listTable).trigger("beforeChangePage");listTable.update_rows({paged:e},false,function(){if(d.parents(".tablenav.bottom").length){scrollTo(0,0)}a(listTable).trigger("changePage")})}a(".tablenav-pages a").click(function(){var e=a(this),d=a.query.GET("paged");switch(e.attr("class")){case"first-page":d=1;break;case"prev-page":d-=1;break;case"next-page":d+=1;break;case"last-page":d=listTable.get_total_pages();break}b(d,e);return false});a(".current-page").keypress(function(f){if(13!=f.keyCode){return}var d=a(this);b(parseInt(d.val())||1,d);return false});a("th.sortable a, th.sorted a").click(function(){function i(k){return a.query.load(k.find("a").attr("href")).get("order")}var f=a(this),h=f.parent("th"),g=h.index(),j=a.query.load(f.attr("href")).get("orderby"),e;h=h.closest("table").find("thead th:eq("+g+"), tfoot th:eq("+g+")");if(j==a.query.get("orderby")){e=("asc"==a.query.get("order"))?"desc":"asc"}else{e=i(h);var d=a("th.sorted");if(d.length){d.removeClass("sorted").addClass("sortable");d.removeClass("desc").removeClass("asc").addClass("asc"==i(d)?"desc":"asc")}h.removeClass("sortable").addClass("sorted")}h.removeClass("desc").removeClass("asc").addClass(e);listTable.update_rows({orderby:j,order:e},true);return false});function c(d){if("keypress"==d.type&&13!=d.keyCode){return}d.preventDefault();d.stopImmediatePropagation();var e=a(this).parent(".search-box").find(":input").serializeObject();listTable.update_rows(e,true,function(){if(a("h2.nav-tab-wrapper").length){return}if("site-users-network"==pagenow||"site-themes-network"==pagenow){a("h4.search-text").remove();if(e.s){a("ul.subsubsub").after(a('<h4 class="clear search-text">').html(listTableL10n.search.replace("%s",this.htmlencode(e.s))))}}else{a("h2 .subtitle").remove();if(e.s){a("h2").append(a('<span class="subtitle">').html(listTableL10n.search.replace("%s",this.htmlencode(e.s))))}}})}a(".search-box :submit").click(c);a(".search-box :text").keypress(c);a("#post-query-submit").click(function(){var d={};a(this).parents(".actions").find('select[name!="action"]').each(function(){var e=a(this);d[e.attr("name")]=e.val()});listTable.update_rows(d,true);return false});a(".view-switch a").click(function(){var d=a(this);listTable.update_rows({mode:a.query.load(d.attr("href")).get("mode")},false,function(){a(".view-switch .current").removeClass("current");d.addClass("current")});return false})});
\ No newline at end of file
var tb_position;
(function($) {
tb_position = function() {
- var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width;
+ var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width, adminbar_height = 0;
+
+ if ( $('body.admin-bar').length )
+ adminbar_height = 28;
if ( tbWindow.size() ) {
- tbWindow.width( W - 50 ).height( H - 45 );
- $('#TB_iframeContent').width( W - 50 ).height( H - 75 );
+ tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
+ $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
if ( typeof document.body.style.maxWidth != 'undefined' )
- tbWindow.css({'top':'20px','margin-top':'0'});
+ tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
};
return $('a.thickbox').each( function() {
if ( ! href ) return;
href = href.replace(/&width=[0-9]+/g, '');
href = href.replace(/&height=[0-9]+/g, '');
- $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
+ $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 - adminbar_height ) );
});
};
-function send_to_editor(b){var a;if(typeof tinyMCE!="undefined"&&(a=tinyMCE.activeEditor)&&!a.isHidden()){a.focus();if(tinymce.isIE){a.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark)}if(b.indexOf("[caption")===0){if(a.plugins.wpeditimage){b=a.plugins.wpeditimage._do_shcode(b)}}else{if(b.indexOf("[gallery")===0){if(a.plugins.wpgallery){b=a.plugins.wpgallery._do_gallery(b)}}else{if(b.indexOf("[embed")===0){if(a.plugins.wordpress){b=a.plugins.wordpress._setEmbed(b)}}}}a.execCommand("mceInsertContent",false,b)}else{if(typeof edInsertContent=="function"){edInsertContent(edCanvas,b)}else{jQuery(edCanvas).val(jQuery(edCanvas).val()+b)}}tb_remove()}var tb_position;(function(a){tb_position=function(){var e=a("#TB_window"),d=a(window).width(),c=a(window).height(),b=(720<d)?720:d;if(e.size()){e.width(b-50).height(c-45);a("#TB_iframeContent").width(b-50).height(c-75);e.css({"margin-left":"-"+parseInt(((b-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){e.css({top:"20px","margin-top":"0"})}}return a("a.thickbox").each(function(){var f=a(this).attr("href");if(!f){return}f=f.replace(/&width=[0-9]+/g,"");f=f.replace(/&height=[0-9]+/g,"");a(this).attr("href",f+"&width="+(b-80)+"&height="+(c-85))})};a(window).resize(function(){tb_position()})})(jQuery);jQuery(document).ready(function(a){a("a.thickbox").click(function(){if(typeof tinyMCE!="undefined"&&tinyMCE.activeEditor){tinyMCE.get("content").focus();tinyMCE.activeEditor.windowManager.bookmark=tinyMCE.activeEditor.selection.getBookmark("simple")}})});
\ No newline at end of file
+function send_to_editor(b){var a;if(typeof tinyMCE!="undefined"&&(a=tinyMCE.activeEditor)&&!a.isHidden()){a.focus();if(tinymce.isIE){a.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark)}if(b.indexOf("[caption")===0){if(a.plugins.wpeditimage){b=a.plugins.wpeditimage._do_shcode(b)}}else{if(b.indexOf("[gallery")===0){if(a.plugins.wpgallery){b=a.plugins.wpgallery._do_gallery(b)}}else{if(b.indexOf("[embed")===0){if(a.plugins.wordpress){b=a.plugins.wordpress._setEmbed(b)}}}}a.execCommand("mceInsertContent",false,b)}else{if(typeof edInsertContent=="function"){edInsertContent(edCanvas,b)}else{jQuery(edCanvas).val(jQuery(edCanvas).val()+b)}}tb_remove()}var tb_position;(function(a){tb_position=function(){var f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720<e)?720:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}return a("a.thickbox").each(function(){var g=a(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");a(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85-b))})};a(window).resize(function(){tb_position()})})(jQuery);jQuery(document).ready(function(a){a("a.thickbox").click(function(){if(typeof tinyMCE!="undefined"&&tinyMCE.activeEditor){tinyMCE.get("content").focus();tinyMCE.activeEditor.windowManager.bookmark=tinyMCE.activeEditor.selection.getBookmark("simple")}})});
\ No newline at end of file
if ( '' == $('#find-posts-response').html() )
e.preventDefault();
});
+ $( '#find-posts .find-box-search :input' ).keypress( function( event ) {
+ if ( 13 == event.which ) {
+ findPosts.send();
+ return false;
+ }
+ } );
+ $( '#find-posts-search' ).click( findPosts.send );
+ $( '#find-posts-close' ).click( findPosts.close );
$('#doaction, #doaction2').click(function(e){
$('select[name^="action"]').each(function(){
if ( $(this).val() == 'attach' ) {
-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
+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("#find-posts .find-box-search :input").keypress(function(b){if(13==b.which){findPosts.send();return false}});a("#find-posts-search").click(findPosts.send);a("#find-posts-close").click(findPosts.close);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
* @param jQuery panel The tabs panel we're searching in.
*/
processQuickSearchQueryResponse : function(resp, req, panel) {
- var i, matched, newID,
+ var matched, newID,
takenIDs = {},
form = document.getElementById('nav-menu-meta'),
pattern = new RegExp('menu-item\\[(\[^\\]\]*)', 'g'),
- items = resp.match(/<li>.*<\/li>/g);
+ $items = $('<div>').html(resp).find('li'),
+ $item;
- if( ! items ) {
+ if( ! $items.length ) {
$('.categorychecklist', panel).html( '<li><p>' + navMenuL10n.noResultsFound + '</p></li>' );
$('img.waiting', panel).hide();
return;
}
- i = items.length;
- while( i-- ) {
+ $items.each(function(){
+ $item = $(this);
+
// make a unique DB ID number
- matched = pattern.exec(items[i]);
+ matched = pattern.exec($item.html());
+
if ( matched && matched[1] ) {
newID = matched[1];
while( form.elements['menu-item[' + newID + '][menu-item-type]'] || takenIDs[ newID ] ) {
takenIDs[newID] = true;
if ( newID != matched[1] ) {
- items[i] = items[i].replace(new RegExp('menu-item\\[' + matched[1] + '\\]', 'g'), 'menu-item[' + newID + ']');
+ $item.html( $item.html().replace(new RegExp(
+ 'menu-item\\[' + matched[1] + '\\]', 'g'),
+ 'menu-item[' + newID + ']'
+ ) );
}
}
- }
+ });
- $('.categorychecklist', panel).html( items.join('') );
+ $('.categorychecklist', panel).html( $items );
$('img.waiting', panel).hide();
},
-var wpNavMenu;(function(b){var a=wpNavMenu={options:{menuItemDepthPerLevel:30,globalMaxDepth:11},menuList:undefined,targetList:undefined,menusChanged:false,isRTL:!!("undefined"!=typeof isRtl&&isRtl),negateIfRTL:("undefined"!=typeof isRtl&&isRtl)?-1:1,init:function(){a.menuList=b("#menu-to-edit");a.targetList=a.menuList;this.jQueryExtensions();this.attachMenuEditListeners();this.setupInputWithDefaultTitle();this.attachQuickSearchListeners();this.attachThemeLocationsListeners();this.attachTabsPanelListeners();this.attachUnsavedChangesListener();if(a.menuList.length){this.initSortables()}this.initToggles();this.initTabManager()},jQueryExtensions:function(){b.fn.extend({menuItemDepth:function(){var c=a.isRTL?this.eq(0).css("margin-right"):this.eq(0).css("margin-left");return a.pxToDepth(c&&-1!=c.indexOf("px")?c.slice(0,-2):0)},updateDepthClass:function(d,c){return this.each(function(){var e=b(this);c=c||e.menuItemDepth();b(this).removeClass("menu-item-depth-"+c).addClass("menu-item-depth-"+d)})},shiftDepthClass:function(c){return this.each(function(){var d=b(this),e=d.menuItemDepth();b(this).removeClass("menu-item-depth-"+e).addClass("menu-item-depth-"+(e+c))})},childMenuItems:function(){var c=b();this.each(function(){var d=b(this),f=d.menuItemDepth(),e=d.next();while(e.length&&e.menuItemDepth()>f){c=c.add(e);e=e.next()}});return c},updateParentMenuItemDBId:function(){return this.each(function(){var e=b(this),c=e.find(".menu-item-data-parent-id"),f=e.menuItemDepth(),d=e.prev();if(f==0){c.val(0)}else{while(!d[0]||!d[0].className||-1==d[0].className.indexOf("menu-item")||(d.menuItemDepth()!=f-1)){d=d.prev()}c.val(d.find(".menu-item-data-db-id").val())}})},hideAdvancedMenuItemFields:function(){return this.each(function(){var c=b(this);b(".hide-column-tog").not(":checked").each(function(){c.find(".field-"+b(this).val()).addClass("hidden-field")})})},addSelectedToMenu:function(c){if(0==b("#menu-to-edit").length){return false}return this.each(function(){var e=b(this),d={},g=e.find(".tabs-panel-active .categorychecklist li input:checked"),f=new RegExp("menu-item\\[([^\\]]*)");c=c||a.addMenuItemToBottom;if(!g.length){return false}e.find("img.waiting").show();b(g).each(function(){var i=b(this),h=f.exec(i.attr("name")),j="undefined"==typeof h[1]?0:parseInt(h[1],10);if(this.className&&-1!=this.className.indexOf("add-to-top")){c=a.addMenuItemToTop}d[j]=i.closest("li").getItemData("add-menu-item",j)});a.addItemToMenu(d,c,function(){g.removeAttr("checked");e.find("img.waiting").hide()})})},getItemData:function(f,g){f=f||"menu-item";var d={},e,c=["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(!g&&f=="menu-item"){g=this.find(".menu-item-data-db-id").val()}if(!g){return d}this.find("input").each(function(){var h;e=c.length;while(e--){if(f=="menu-item"){h=c[e]+"["+g+"]"}else{if(f=="add-menu-item"){h="menu-item["+g+"]["+c[e]+"]"}}if(this.name&&h==this.name){d[c[e]]=this.value}}});return d},setItemData:function(c,d,e){d=d||"menu-item";if(!e&&d=="menu-item"){e=b(".menu-item-data-db-id",this).val()}if(!e){return this}this.find("input").each(function(){var f=b(this),g;b.each(c,function(h,i){if(d=="menu-item"){g=h+"["+e+"]"}else{if(d=="add-menu-item"){g="menu-item["+e+"]["+h+"]"}}if(g==f.attr("name")){f.val(i)}})});return this}})},initToggles:function(){postboxes.add_postbox_toggles("nav-menus");columns.useCheckboxesForHidden();columns.checked=function(c){b(".field-"+c).removeClass("hidden-field")};columns.unchecked=function(c){b(".field-"+c).addClass("hidden-field")};a.menuList.hideAdvancedMenuItemFields()},initSortables:function(){var p=0,e,t,d,l,o,f,c,i,s,m=a.menuList.offset().left,h=b("body"),q,n=r();m+=a.isRTL?a.menuList.width():0;a.menuList.sortable({handle:".menu-item-handle",placeholder:"sortable-placeholder",start:function(A,z){var u,x,w,v,y;if(a.isRTL){z.item[0].style.right="auto"}s=z.item.children(".menu-item-transport");e=z.item.menuItemDepth();j(z,e);w=(z.item.next()[0]==z.placeholder[0])?z.item.next():z.item;v=w.childMenuItems();s.append(v);u=s.outerHeight();u+=(u>0)?(z.placeholder.css("margin-top").slice(0,-2)*1):0;u+=z.helper.outerHeight();i=u;u-=2;z.placeholder.height(u);q=e;v.each(function(){var B=b(this).menuItemDepth();q=(B>q)?B:q});x=z.helper.find(".menu-item-handle").outerWidth();x+=a.depthToPx(q-e);x-=2;z.placeholder.width(x);y=z.placeholder.next();y.css("margin-top",i+"px");z.placeholder.detach();b(this).sortable("refresh");z.item.after(z.placeholder);y.css("margin-top",0);k(z)},stop:function(x,w){var v,u=p-e;v=s.children().insertAfter(w.item);if(u!=0){w.item.updateDepthClass(p);v.shiftDepthClass(u);g(u)}a.registerChange();w.item.updateParentMenuItemDBId();w.item[0].style.top=0;if(a.isRTL){w.item[0].style.left="auto";w.item[0].style.right=0}a.refreshMenuTabs(true)},change:function(v,u){if(!u.placeholder.parent().hasClass("menu")){(l.length)?l.after(u.placeholder):a.menuList.prepend(u.placeholder)}k(u)},sort:function(w,v){var y=v.helper.offset(),u=a.isRTL?y.left+v.helper.width():y.left,x=a.negateIfRTL*a.pxToDepth(u-m);if(x>d||y.top<f){x=d}else{if(x<t){x=t}}if(x!=p){j(v,x)}if(c&&y.top+i>c){o.after(v.placeholder);k(v);b(this).sortable("refreshPositions")}}});function k(u){var v;l=u.placeholder.prev();o=u.placeholder.next();if(l[0]==u.item[0]){l=l.prev()}if(o[0]==u.item[0]){o=o.next()}f=(l.length)?l.offset().top+l.height():0;c=(o.length)?o.offset().top+o.height()/3:0;t=(o.length)?o.menuItemDepth():0;if(l.length){d=((v=l.menuItemDepth()+1)>a.options.globalMaxDepth)?a.options.globalMaxDepth:v}else{d=0}}function j(u,v){u.placeholder.updateDepthClass(v,p);p=v}function r(){if(!h[0].className){return 0}var u=h[0].className.match(/menu-max-depth-(\d+)/);return u&&u[1]?parseInt(u[1]):0}function g(u){var v,w=n;if(u===0){return}else{if(u>0){v=q+u;if(v>n){w=v}}else{if(u<0&&q==n){while(!b(".menu-item-depth-"+w,a.menuList).length&&w>0){w--}}}}h.removeClass("menu-max-depth-"+n).addClass("menu-max-depth-"+w);n=w}},attachMenuEditListeners:function(){var c=this;b("#update-nav-menu").bind("click",function(d){if(d.target&&d.target.className){if(-1!=d.target.className.indexOf("item-edit")){return c.eventOnClickEditLink(d.target)}else{if(-1!=d.target.className.indexOf("menu-save")){return c.eventOnClickMenuSave(d.target)}else{if(-1!=d.target.className.indexOf("menu-delete")){return c.eventOnClickMenuDelete(d.target)}else{if(-1!=d.target.className.indexOf("item-delete")){return c.eventOnClickMenuItemDelete(d.target)}else{if(-1!=d.target.className.indexOf("item-cancel")){return c.eventOnClickCancelLink(d.target)}}}}}}})},setupInputWithDefaultTitle:function(){var c="input-with-default-title";b("."+c).each(function(){var f=b(this),e=f.attr("title"),d=f.val();f.data(c,e);if(""==d){f.val(e)}else{if(e==d){return}else{f.removeClass(c)}}}).focus(function(){var d=b(this);if(d.val()==d.data(c)){d.val("").removeClass(c)}}).blur(function(){var d=b(this);if(""==d.val()){d.addClass(c).val(d.data(c))}})},attachThemeLocationsListeners:function(){var d=b("#nav-menu-theme-locations"),c={};c.action="menu-locations-save";c["menu-settings-column-nonce"]=b("#menu-settings-column-nonce").val();d.find("input[type=submit]").click(function(){d.find("select").each(function(){c[this.name]=b(this).val()});d.find(".waiting").show();b.post(ajaxurl,c,function(e){d.find(".waiting").hide()});return false})},attachQuickSearchListeners:function(){var c;b(".quick-search").keypress(function(f){var d=b(this);if(13==f.which){a.updateQuickSearchResults(d);return false}if(c){clearTimeout(c)}c=setTimeout(function(){a.updateQuickSearchResults(d)},400)}).attr("autocomplete","off")},updateQuickSearchResults:function(d){var c,g,e=2,f=d.val();if(f.length<e){return}c=d.parents(".tabs-panel");g={action:"menu-quick-search","response-format":"markup",menu:b("#menu").val(),"menu-settings-column-nonce":b("#menu-settings-column-nonce").val(),q:f,type:d.attr("name")};b("img.waiting",c).show();b.post(ajaxurl,g,function(h){a.processQuickSearchQueryResponse(h,g,c)})},addCustomLink:function(c){var e=b("#custom-menu-item-url").val(),d=b("#custom-menu-item-name").val();c=c||a.addMenuItemToBottom;if(""==e||"http://"==e){return false}b(".customlinkdiv img.waiting").show();this.addLinkToMenu(e,d,c,function(){b(".customlinkdiv img.waiting").hide();b("#custom-menu-item-name").val("").blur();b("#custom-menu-item-url").val("http://")})},addLinkToMenu:function(e,d,c,f){c=c||a.addMenuItemToBottom;f=f||function(){};a.addItemToMenu({"-1":{"menu-item-type":"custom","menu-item-url":e,"menu-item-title":d}},c,f)},addItemToMenu:function(e,c,g){var f=b("#menu").val(),d=b("#menu-settings-column-nonce").val();c=c||function(){};g=g||function(){};params={action:"add-menu-item",menu:f,"menu-settings-column-nonce":d,"menu-item":e};b.post(ajaxurl,params,function(h){var i=b("#menu-instructions");c(h,params);if(!i.hasClass("menu-instructions-inactive")&&i.siblings().length){i.addClass("menu-instructions-inactive")}g()})},addMenuItemToBottom:function(c,d){b(c).hideAdvancedMenuItemFields().appendTo(a.targetList)},addMenuItemToTop:function(c,d){b(c).hideAdvancedMenuItemFields().prependTo(a.targetList)},attachUnsavedChangesListener:function(){b("#menu-management input, #menu-management select, #menu-management, #menu-management textarea").change(function(){a.registerChange()});if(0!=b("#menu-to-edit").length){window.onbeforeunload=function(){if(a.menusChanged){return navMenuL10n.saveAlert}}}else{b("#menu-settings-column").find("input,select").attr("disabled","disabled").end().find("a").attr("href","#").unbind("click")}},registerChange:function(){a.menusChanged=true},attachTabsPanelListeners:function(){b("#menu-settings-column").bind("click",function(h){var f,d,i,c,g=b(h.target);if(g.hasClass("nav-tab-link")){d=/#(.*)$/.exec(h.target.href);if(d&&d[1]){d=d[1]}else{return false}i=g.parents(".inside").first();b("input",i).removeAttr("checked");b(".tabs-panel-active",i).removeClass("tabs-panel-active").addClass("tabs-panel-inactive");b("#"+d,i).removeClass("tabs-panel-inactive").addClass("tabs-panel-active");b(".tabs",i).removeClass("tabs");g.parent().addClass("tabs");b(".quick-search",i).focus();return false}else{if(g.hasClass("select-all")){f=/#(.*)$/.exec(h.target.href);if(f&&f[1]){c=b("#"+f[1]+" .tabs-panel-active .menu-item-title input");if(c.length===c.filter(":checked").length){c.removeAttr("checked")}else{c.attr("checked","checked")}return false}}else{if(g.hasClass("submit-add-to-menu")){a.registerChange();if(h.target.id&&"submit-customlinkdiv"==h.target.id){a.addCustomLink(a.addMenuItemToBottom)}else{if(h.target.id&&-1!=h.target.id.indexOf("submit-")){b("#"+h.target.id.replace(/submit-/,"")).addSelectedToMenu(a.addMenuItemToBottom)}}return false}else{if(g.hasClass("page-numbers")){b.post(ajaxurl,h.target.href.replace(/.*\?/,"").replace(/action=([^&]*)/,"")+"&action=menu-get-metabox",function(m){if(-1==m.indexOf("replace-id")){return}var l=b.parseJSON(m),e=document.getElementById(l["replace-id"]),k=document.createElement("div"),j=document.createElement("div");if(!l.markup||!e){return}j.innerHTML=l.markup?l.markup:"";e.parentNode.insertBefore(k,e);k.parentNode.removeChild(e);k.parentNode.insertBefore(j,k);k.parentNode.removeChild(k)});return false}}}}})},initTabManager:function(){var h=b(".nav-tabs-wrapper"),j=h.children(".nav-tabs"),g=j.children(".nav-tab-active"),m=j.children(".nav-tab"),e=0,o,f,l,d,k,i={},c=a.isRTL?"margin-right":"margin-left",p=a.isRTL?"margin-left":"margin-right",n=2;a.refreshMenuTabs=function(q){var t=h.width(),s=0,r={};f=h.offset().left;o=f+t;if(!q){g.makeTabVisible()}if(m.last().isTabVisible()){s=h.width()-e;s=s>0?0:s;r[c]=s+"px";j.animate(r,100,"linear")}if(t>e){l.add(d).hide()}else{l.add(d).show()}};b.fn.extend({makeTabVisible:function(){var u=this.eq(0),v,s,r={},q=0;if(!u.length){return this}v=u.offset().left;s=v+u.outerWidth();if(s>o){q=o-s}else{if(v<f){q=f-v}}if(!q){return this}r[c]="+="+a.negateIfRTL*q+"px";j.animate(r,Math.abs(q)*n,"linear");return this},isTabVisible:function(){var r=this.eq(0),s=r.offset().left,q=s+r.outerWidth();return(q<=o&&s>=f)?true:false}});m.each(function(){e+=b(this).outerWidth(true)});i.padding=0;i[p]=(-1*e)+"px";j.css(i);l=b('<div class="nav-tabs-arrow nav-tabs-arrow-left"><a>«</a></div>');d=b('<div class="nav-tabs-arrow nav-tabs-arrow-right"><a>»</a></div>');h.wrap('<div class="nav-tabs-nav"/>').parent().prepend(l).append(d);a.refreshMenuTabs();b(window).resize(function(){if(k){clearTimeout(k)}k=setTimeout(a.refreshMenuTabs,200)});b.each([{arrow:l,next:"next",last:"first",operator:"+="},{arrow:d,next:"prev",last:"last",operator:"-="}],function(){var q=this;this.arrow.mousedown(function(){var t=Math.abs(parseInt(j.css(c))),r=t,s={};if("-="==q.operator){r=Math.abs(e-h.width())-t}if(!r){return}s[c]=q.operator+r+"px";j.animate(s,r*n,"linear")}).mouseup(function(){var s,r;j.stop(true);s=m[q.last]();while((r=s[q.next]())&&r.length&&!r.isTabVisible()){s=r}s.makeTabVisible()})})},eventOnClickEditLink:function(d){var c,e,f=/#(.*)$/.exec(d.href);if(f&&f[1]){c=b("#"+f[1]);e=c.parent();if(0!=e.length){if(e.hasClass("menu-item-edit-inactive")){if(!c.data("menu-item-data")){c.data("menu-item-data",c.getItemData())}c.slideDown("fast");e.removeClass("menu-item-edit-inactive").addClass("menu-item-edit-active")}else{c.slideUp("fast");e.removeClass("menu-item-edit-active").addClass("menu-item-edit-inactive")}return false}}},eventOnClickCancelLink:function(d){var c=b(d).closest(".menu-item-settings");c.setItemData(c.data("menu-item-data"));return false},eventOnClickMenuSave:function(e){var f="",c=b("#menu-name"),d=c.val();if(!d||d==c.attr("title")||!d.replace(/\s+/,"")){c.parent().addClass("form-invalid");return false}b("#nav-menu-theme-locations select").each(function(){f+='<input type="hidden" name="'+this.name+'" value="'+b(this).val()+'" />'});b("#update-nav-menu").append(f);a.menuList.find(".menu-item-data-position").val(function(g){return g+1});window.onbeforeunload=null;return true},eventOnClickMenuDelete:function(c){if(confirm(navMenuL10n.warnDeleteMenu)){window.onbeforeunload=null;return true}return false},eventOnClickMenuItemDelete:function(c){var d=parseInt(c.id.replace("delete-",""),10);a.removeMenuItem(b("#menu-item-"+d));a.registerChange();return false},processQuickSearchQueryResponse:function(g,m,c){var h,e,j,f={},d=document.getElementById("nav-menu-meta"),l=new RegExp("menu-item\\[([^\\]]*)","g"),k=g.match(/<li>.*<\/li>/g);if(!k){b(".categorychecklist",c).html("<li><p>"+navMenuL10n.noResultsFound+"</p></li>");b("img.waiting",c).hide();return}h=k.length;while(h--){e=l.exec(k[h]);if(e&&e[1]){j=e[1];while(d.elements["menu-item["+j+"][menu-item-type]"]||f[j]){j--}f[j]=true;if(j!=e[1]){k[h]=k[h].replace(new RegExp("menu-item\\["+e[1]+"\\]","g"),"menu-item["+j+"]")}}}b(".categorychecklist",c).html(k.join(""));b("img.waiting",c).hide()},removeMenuItem:function(d){var c=d.childMenuItems();d.addClass("deleting").animate({opacity:0,height:0},350,function(){var e=b("#menu-instructions");d.remove();c.shiftDepthClass(-1).updateParentMenuItemDBId();if(!e.siblings().length){e.removeClass("menu-instructions-inactive")}})},depthToPx:function(c){return c*a.options.menuItemDepthPerLevel},pxToDepth:function(c){return Math.floor(c/a.options.menuItemDepthPerLevel)}};b(document).ready(function(){wpNavMenu.init()})})(jQuery);
\ No newline at end of file
+var wpNavMenu;(function(b){var a=wpNavMenu={options:{menuItemDepthPerLevel:30,globalMaxDepth:11},menuList:undefined,targetList:undefined,menusChanged:false,isRTL:!!("undefined"!=typeof isRtl&&isRtl),negateIfRTL:("undefined"!=typeof isRtl&&isRtl)?-1:1,init:function(){a.menuList=b("#menu-to-edit");a.targetList=a.menuList;this.jQueryExtensions();this.attachMenuEditListeners();this.setupInputWithDefaultTitle();this.attachQuickSearchListeners();this.attachThemeLocationsListeners();this.attachTabsPanelListeners();this.attachUnsavedChangesListener();if(a.menuList.length){this.initSortables()}this.initToggles();this.initTabManager()},jQueryExtensions:function(){b.fn.extend({menuItemDepth:function(){var c=a.isRTL?this.eq(0).css("margin-right"):this.eq(0).css("margin-left");return a.pxToDepth(c&&-1!=c.indexOf("px")?c.slice(0,-2):0)},updateDepthClass:function(d,c){return this.each(function(){var e=b(this);c=c||e.menuItemDepth();b(this).removeClass("menu-item-depth-"+c).addClass("menu-item-depth-"+d)})},shiftDepthClass:function(c){return this.each(function(){var d=b(this),e=d.menuItemDepth();b(this).removeClass("menu-item-depth-"+e).addClass("menu-item-depth-"+(e+c))})},childMenuItems:function(){var c=b();this.each(function(){var d=b(this),f=d.menuItemDepth(),e=d.next();while(e.length&&e.menuItemDepth()>f){c=c.add(e);e=e.next()}});return c},updateParentMenuItemDBId:function(){return this.each(function(){var e=b(this),c=e.find(".menu-item-data-parent-id"),f=e.menuItemDepth(),d=e.prev();if(f==0){c.val(0)}else{while(!d[0]||!d[0].className||-1==d[0].className.indexOf("menu-item")||(d.menuItemDepth()!=f-1)){d=d.prev()}c.val(d.find(".menu-item-data-db-id").val())}})},hideAdvancedMenuItemFields:function(){return this.each(function(){var c=b(this);b(".hide-column-tog").not(":checked").each(function(){c.find(".field-"+b(this).val()).addClass("hidden-field")})})},addSelectedToMenu:function(c){if(0==b("#menu-to-edit").length){return false}return this.each(function(){var e=b(this),d={},g=e.find(".tabs-panel-active .categorychecklist li input:checked"),f=new RegExp("menu-item\\[([^\\]]*)");c=c||a.addMenuItemToBottom;if(!g.length){return false}e.find("img.waiting").show();b(g).each(function(){var i=b(this),h=f.exec(i.attr("name")),j="undefined"==typeof h[1]?0:parseInt(h[1],10);if(this.className&&-1!=this.className.indexOf("add-to-top")){c=a.addMenuItemToTop}d[j]=i.closest("li").getItemData("add-menu-item",j)});a.addItemToMenu(d,c,function(){g.removeAttr("checked");e.find("img.waiting").hide()})})},getItemData:function(f,g){f=f||"menu-item";var d={},e,c=["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(!g&&f=="menu-item"){g=this.find(".menu-item-data-db-id").val()}if(!g){return d}this.find("input").each(function(){var h;e=c.length;while(e--){if(f=="menu-item"){h=c[e]+"["+g+"]"}else{if(f=="add-menu-item"){h="menu-item["+g+"]["+c[e]+"]"}}if(this.name&&h==this.name){d[c[e]]=this.value}}});return d},setItemData:function(c,d,e){d=d||"menu-item";if(!e&&d=="menu-item"){e=b(".menu-item-data-db-id",this).val()}if(!e){return this}this.find("input").each(function(){var f=b(this),g;b.each(c,function(h,i){if(d=="menu-item"){g=h+"["+e+"]"}else{if(d=="add-menu-item"){g="menu-item["+e+"]["+h+"]"}}if(g==f.attr("name")){f.val(i)}})});return this}})},initToggles:function(){postboxes.add_postbox_toggles("nav-menus");columns.useCheckboxesForHidden();columns.checked=function(c){b(".field-"+c).removeClass("hidden-field")};columns.unchecked=function(c){b(".field-"+c).addClass("hidden-field")};a.menuList.hideAdvancedMenuItemFields()},initSortables:function(){var p=0,e,t,d,l,o,f,c,i,s,m=a.menuList.offset().left,h=b("body"),q,n=r();m+=a.isRTL?a.menuList.width():0;a.menuList.sortable({handle:".menu-item-handle",placeholder:"sortable-placeholder",start:function(A,z){var u,x,w,v,y;if(a.isRTL){z.item[0].style.right="auto"}s=z.item.children(".menu-item-transport");e=z.item.menuItemDepth();j(z,e);w=(z.item.next()[0]==z.placeholder[0])?z.item.next():z.item;v=w.childMenuItems();s.append(v);u=s.outerHeight();u+=(u>0)?(z.placeholder.css("margin-top").slice(0,-2)*1):0;u+=z.helper.outerHeight();i=u;u-=2;z.placeholder.height(u);q=e;v.each(function(){var B=b(this).menuItemDepth();q=(B>q)?B:q});x=z.helper.find(".menu-item-handle").outerWidth();x+=a.depthToPx(q-e);x-=2;z.placeholder.width(x);y=z.placeholder.next();y.css("margin-top",i+"px");z.placeholder.detach();b(this).sortable("refresh");z.item.after(z.placeholder);y.css("margin-top",0);k(z)},stop:function(x,w){var v,u=p-e;v=s.children().insertAfter(w.item);if(u!=0){w.item.updateDepthClass(p);v.shiftDepthClass(u);g(u)}a.registerChange();w.item.updateParentMenuItemDBId();w.item[0].style.top=0;if(a.isRTL){w.item[0].style.left="auto";w.item[0].style.right=0}a.refreshMenuTabs(true)},change:function(v,u){if(!u.placeholder.parent().hasClass("menu")){(l.length)?l.after(u.placeholder):a.menuList.prepend(u.placeholder)}k(u)},sort:function(w,v){var y=v.helper.offset(),u=a.isRTL?y.left+v.helper.width():y.left,x=a.negateIfRTL*a.pxToDepth(u-m);if(x>d||y.top<f){x=d}else{if(x<t){x=t}}if(x!=p){j(v,x)}if(c&&y.top+i>c){o.after(v.placeholder);k(v);b(this).sortable("refreshPositions")}}});function k(u){var v;l=u.placeholder.prev();o=u.placeholder.next();if(l[0]==u.item[0]){l=l.prev()}if(o[0]==u.item[0]){o=o.next()}f=(l.length)?l.offset().top+l.height():0;c=(o.length)?o.offset().top+o.height()/3:0;t=(o.length)?o.menuItemDepth():0;if(l.length){d=((v=l.menuItemDepth()+1)>a.options.globalMaxDepth)?a.options.globalMaxDepth:v}else{d=0}}function j(u,v){u.placeholder.updateDepthClass(v,p);p=v}function r(){if(!h[0].className){return 0}var u=h[0].className.match(/menu-max-depth-(\d+)/);return u&&u[1]?parseInt(u[1]):0}function g(u){var v,w=n;if(u===0){return}else{if(u>0){v=q+u;if(v>n){w=v}}else{if(u<0&&q==n){while(!b(".menu-item-depth-"+w,a.menuList).length&&w>0){w--}}}}h.removeClass("menu-max-depth-"+n).addClass("menu-max-depth-"+w);n=w}},attachMenuEditListeners:function(){var c=this;b("#update-nav-menu").bind("click",function(d){if(d.target&&d.target.className){if(-1!=d.target.className.indexOf("item-edit")){return c.eventOnClickEditLink(d.target)}else{if(-1!=d.target.className.indexOf("menu-save")){return c.eventOnClickMenuSave(d.target)}else{if(-1!=d.target.className.indexOf("menu-delete")){return c.eventOnClickMenuDelete(d.target)}else{if(-1!=d.target.className.indexOf("item-delete")){return c.eventOnClickMenuItemDelete(d.target)}else{if(-1!=d.target.className.indexOf("item-cancel")){return c.eventOnClickCancelLink(d.target)}}}}}}})},setupInputWithDefaultTitle:function(){var c="input-with-default-title";b("."+c).each(function(){var f=b(this),e=f.attr("title"),d=f.val();f.data(c,e);if(""==d){f.val(e)}else{if(e==d){return}else{f.removeClass(c)}}}).focus(function(){var d=b(this);if(d.val()==d.data(c)){d.val("").removeClass(c)}}).blur(function(){var d=b(this);if(""==d.val()){d.addClass(c).val(d.data(c))}})},attachThemeLocationsListeners:function(){var d=b("#nav-menu-theme-locations"),c={};c.action="menu-locations-save";c["menu-settings-column-nonce"]=b("#menu-settings-column-nonce").val();d.find("input[type=submit]").click(function(){d.find("select").each(function(){c[this.name]=b(this).val()});d.find(".waiting").show();b.post(ajaxurl,c,function(e){d.find(".waiting").hide()});return false})},attachQuickSearchListeners:function(){var c;b(".quick-search").keypress(function(f){var d=b(this);if(13==f.which){a.updateQuickSearchResults(d);return false}if(c){clearTimeout(c)}c=setTimeout(function(){a.updateQuickSearchResults(d)},400)}).attr("autocomplete","off")},updateQuickSearchResults:function(d){var c,g,e=2,f=d.val();if(f.length<e){return}c=d.parents(".tabs-panel");g={action:"menu-quick-search","response-format":"markup",menu:b("#menu").val(),"menu-settings-column-nonce":b("#menu-settings-column-nonce").val(),q:f,type:d.attr("name")};b("img.waiting",c).show();b.post(ajaxurl,g,function(h){a.processQuickSearchQueryResponse(h,g,c)})},addCustomLink:function(c){var e=b("#custom-menu-item-url").val(),d=b("#custom-menu-item-name").val();c=c||a.addMenuItemToBottom;if(""==e||"http://"==e){return false}b(".customlinkdiv img.waiting").show();this.addLinkToMenu(e,d,c,function(){b(".customlinkdiv img.waiting").hide();b("#custom-menu-item-name").val("").blur();b("#custom-menu-item-url").val("http://")})},addLinkToMenu:function(e,d,c,f){c=c||a.addMenuItemToBottom;f=f||function(){};a.addItemToMenu({"-1":{"menu-item-type":"custom","menu-item-url":e,"menu-item-title":d}},c,f)},addItemToMenu:function(e,c,g){var f=b("#menu").val(),d=b("#menu-settings-column-nonce").val();c=c||function(){};g=g||function(){};params={action:"add-menu-item",menu:f,"menu-settings-column-nonce":d,"menu-item":e};b.post(ajaxurl,params,function(h){var i=b("#menu-instructions");c(h,params);if(!i.hasClass("menu-instructions-inactive")&&i.siblings().length){i.addClass("menu-instructions-inactive")}g()})},addMenuItemToBottom:function(c,d){b(c).hideAdvancedMenuItemFields().appendTo(a.targetList)},addMenuItemToTop:function(c,d){b(c).hideAdvancedMenuItemFields().prependTo(a.targetList)},attachUnsavedChangesListener:function(){b("#menu-management input, #menu-management select, #menu-management, #menu-management textarea").change(function(){a.registerChange()});if(0!=b("#menu-to-edit").length){window.onbeforeunload=function(){if(a.menusChanged){return navMenuL10n.saveAlert}}}else{b("#menu-settings-column").find("input,select").attr("disabled","disabled").end().find("a").attr("href","#").unbind("click")}},registerChange:function(){a.menusChanged=true},attachTabsPanelListeners:function(){b("#menu-settings-column").bind("click",function(h){var f,d,i,c,g=b(h.target);if(g.hasClass("nav-tab-link")){d=/#(.*)$/.exec(h.target.href);if(d&&d[1]){d=d[1]}else{return false}i=g.parents(".inside").first();b("input",i).removeAttr("checked");b(".tabs-panel-active",i).removeClass("tabs-panel-active").addClass("tabs-panel-inactive");b("#"+d,i).removeClass("tabs-panel-inactive").addClass("tabs-panel-active");b(".tabs",i).removeClass("tabs");g.parent().addClass("tabs");b(".quick-search",i).focus();return false}else{if(g.hasClass("select-all")){f=/#(.*)$/.exec(h.target.href);if(f&&f[1]){c=b("#"+f[1]+" .tabs-panel-active .menu-item-title input");if(c.length===c.filter(":checked").length){c.removeAttr("checked")}else{c.attr("checked","checked")}return false}}else{if(g.hasClass("submit-add-to-menu")){a.registerChange();if(h.target.id&&"submit-customlinkdiv"==h.target.id){a.addCustomLink(a.addMenuItemToBottom)}else{if(h.target.id&&-1!=h.target.id.indexOf("submit-")){b("#"+h.target.id.replace(/submit-/,"")).addSelectedToMenu(a.addMenuItemToBottom)}}return false}else{if(g.hasClass("page-numbers")){b.post(ajaxurl,h.target.href.replace(/.*\?/,"").replace(/action=([^&]*)/,"")+"&action=menu-get-metabox",function(m){if(-1==m.indexOf("replace-id")){return}var l=b.parseJSON(m),e=document.getElementById(l["replace-id"]),k=document.createElement("div"),j=document.createElement("div");if(!l.markup||!e){return}j.innerHTML=l.markup?l.markup:"";e.parentNode.insertBefore(k,e);k.parentNode.removeChild(e);k.parentNode.insertBefore(j,k);k.parentNode.removeChild(k)});return false}}}}})},initTabManager:function(){var h=b(".nav-tabs-wrapper"),j=h.children(".nav-tabs"),g=j.children(".nav-tab-active"),m=j.children(".nav-tab"),e=0,o,f,l,d,k,i={},c=a.isRTL?"margin-right":"margin-left",p=a.isRTL?"margin-left":"margin-right",n=2;a.refreshMenuTabs=function(q){var t=h.width(),s=0,r={};f=h.offset().left;o=f+t;if(!q){g.makeTabVisible()}if(m.last().isTabVisible()){s=h.width()-e;s=s>0?0:s;r[c]=s+"px";j.animate(r,100,"linear")}if(t>e){l.add(d).hide()}else{l.add(d).show()}};b.fn.extend({makeTabVisible:function(){var u=this.eq(0),v,s,r={},q=0;if(!u.length){return this}v=u.offset().left;s=v+u.outerWidth();if(s>o){q=o-s}else{if(v<f){q=f-v}}if(!q){return this}r[c]="+="+a.negateIfRTL*q+"px";j.animate(r,Math.abs(q)*n,"linear");return this},isTabVisible:function(){var r=this.eq(0),s=r.offset().left,q=s+r.outerWidth();return(q<=o&&s>=f)?true:false}});m.each(function(){e+=b(this).outerWidth(true)});i.padding=0;i[p]=(-1*e)+"px";j.css(i);l=b('<div class="nav-tabs-arrow nav-tabs-arrow-left"><a>«</a></div>');d=b('<div class="nav-tabs-arrow nav-tabs-arrow-right"><a>»</a></div>');h.wrap('<div class="nav-tabs-nav"/>').parent().prepend(l).append(d);a.refreshMenuTabs();b(window).resize(function(){if(k){clearTimeout(k)}k=setTimeout(a.refreshMenuTabs,200)});b.each([{arrow:l,next:"next",last:"first",operator:"+="},{arrow:d,next:"prev",last:"last",operator:"-="}],function(){var q=this;this.arrow.mousedown(function(){var t=Math.abs(parseInt(j.css(c))),r=t,s={};if("-="==q.operator){r=Math.abs(e-h.width())-t}if(!r){return}s[c]=q.operator+r+"px";j.animate(s,r*n,"linear")}).mouseup(function(){var s,r;j.stop(true);s=m[q.last]();while((r=s[q.next]())&&r.length&&!r.isTabVisible()){s=r}s.makeTabVisible()})})},eventOnClickEditLink:function(d){var c,e,f=/#(.*)$/.exec(d.href);if(f&&f[1]){c=b("#"+f[1]);e=c.parent();if(0!=e.length){if(e.hasClass("menu-item-edit-inactive")){if(!c.data("menu-item-data")){c.data("menu-item-data",c.getItemData())}c.slideDown("fast");e.removeClass("menu-item-edit-inactive").addClass("menu-item-edit-active")}else{c.slideUp("fast");e.removeClass("menu-item-edit-active").addClass("menu-item-edit-inactive")}return false}}},eventOnClickCancelLink:function(d){var c=b(d).closest(".menu-item-settings");c.setItemData(c.data("menu-item-data"));return false},eventOnClickMenuSave:function(e){var f="",c=b("#menu-name"),d=c.val();if(!d||d==c.attr("title")||!d.replace(/\s+/,"")){c.parent().addClass("form-invalid");return false}b("#nav-menu-theme-locations select").each(function(){f+='<input type="hidden" name="'+this.name+'" value="'+b(this).val()+'" />'});b("#update-nav-menu").append(f);a.menuList.find(".menu-item-data-position").val(function(g){return g+1});window.onbeforeunload=null;return true},eventOnClickMenuDelete:function(c){if(confirm(navMenuL10n.warnDeleteMenu)){window.onbeforeunload=null;return true}return false},eventOnClickMenuItemDelete:function(c){var d=parseInt(c.id.replace("delete-",""),10);a.removeMenuItem(b("#menu-item-"+d));a.registerChange();return false},processQuickSearchQueryResponse:function(g,k,c){var e,i,f={},d=document.getElementById("nav-menu-meta"),j=new RegExp("menu-item\\[([^\\]]*)","g"),h=b("<div>").html(g).find("li"),l;if(!h.length){b(".categorychecklist",c).html("<li><p>"+navMenuL10n.noResultsFound+"</p></li>");b("img.waiting",c).hide();return}h.each(function(){l=b(this);e=j.exec(l.html());if(e&&e[1]){i=e[1];while(d.elements["menu-item["+i+"][menu-item-type]"]||f[i]){i--}f[i]=true;if(i!=e[1]){l.html(l.html().replace(new RegExp("menu-item\\["+e[1]+"\\]","g"),"menu-item["+i+"]"))}}});b(".categorychecklist",c).html(h);b("img.waiting",c).hide()},removeMenuItem:function(d){var c=d.childMenuItems();d.addClass("deleting").animate({opacity:0,height:0},350,function(){var e=b("#menu-instructions");d.remove();c.shiftDepthClass(-1).updateParentMenuItemDBId();if(!e.siblings().length){e.removeClass("menu-instructions-inactive")}})},depthToPx:function(c){return c*a.options.menuItemDepthPerLevel},pxToDepth:function(c){return Math.floor(c/a.options.menuItemDepthPerLevel)}};b(document).ready(function(){wpNavMenu.init()})})(jQuery);
\ No newline at end of file
/* Plugin Browser Thickbox related JS*/
+var tb_position;
jQuery(document).ready(function($) {
- var thickDims = function() {
- var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width;
+ tb_position = function() {
+ var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width, adminbar_height = 0;
+
+ if ( $('body.admin-bar').length )
+ adminbar_height = 28;
if ( tbWindow.size() ) {
- tbWindow.width( W - 50 ).height( H - 45 );
- $('#TB_iframeContent').width( W - 50 ).height( H - 75 );
+ tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
+ $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
- if ( ! ( $.browser.msie && $.browser.version.substr(0,1) < 7 ) )
- tbWindow.css({'top':'20px','margin-top':'0'});
+ if ( typeof document.body.style.maxWidth != 'undefined' )
+ tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
};
- return $('#dashboard_plugins a.thickbox, .plugins a.thickbox').each( function() {
+ return $('a.thickbox').each( function() {
var href = $(this).attr('href');
if ( ! href )
return;
href = href.replace(/&width=[0-9]+/g, '');
href = href.replace(/&height=[0-9]+/g, '');
- $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
+ $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 - adminbar_height ) );
});
};
- thickDims().click( function() {
+ $(window).resize(function(){ tb_position(); });
+
+ $('#dashboard_plugins a.thickbox, .plugins a.thickbox').click( function() {
tb_click.call(this);
$('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
return false;
});
- $('#install-plugins .action-links .install-now').click( function() {
+ $('a.install-now').click( function() {
return confirm( plugininstallL10n.ays );
});
});
-jQuery(document).ready(function(b){var a=function(){var f=b("#TB_window"),e=b(window).width(),d=b(window).height(),c=(720<e)?720:e;if(f.size()){f.width(c-50).height(d-45);b("#TB_iframeContent").width(c-50).height(d-75);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(!(b.browser.msie&&b.browser.version.substr(0,1)<7)){f.css({top:"20px","margin-top":"0"})}}return b("#dashboard_plugins a.thickbox, .plugins a.thickbox").each(function(){var g=b(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");b(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85))})};a().click(function(){tb_click.call(this);b("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});b("#TB_ajaxWindowTitle").html("<strong>"+plugininstallL10n.plugin_information+"</strong> "+b(this).attr("title"));return false});b("#plugin-information #sidemenu a").click(function(){var c=b(this).attr("name");b("#plugin-information-header a.current").removeClass("current");b(this).addClass("current");b("#section-holder div.section").hide();b("#section-"+c).show();return false});b("#install-plugins .action-links .install-now").click(function(){return confirm(plugininstallL10n.ays)})});
\ No newline at end of file
+var tb_position;jQuery(document).ready(function(a){tb_position=function(){var f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720<e)?720:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}return a("a.thickbox").each(function(){var g=a(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");a(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85-b))})};a(window).resize(function(){tb_position()});a("#dashboard_plugins a.thickbox, .plugins a.thickbox").click(function(){tb_click.call(this);a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});a("#TB_ajaxWindowTitle").html("<strong>"+plugininstallL10n.plugin_information+"</strong> "+a(this).attr("title"));return false});a("#plugin-information #sidemenu a").click(function(){var b=a(this).attr("name");a("#plugin-information-header a.current").removeClass("current");a(this).addClass("current");a("#section-holder div.section").hide();a("#section-"+b).show();return false});a("a.install-now").click(function(){return confirm(plugininstallL10n.ays)})});
\ No newline at end of file
'action' : 'get-comments',
'mode' : 'single',
'_ajax_nonce' : $('#add_comment_nonce').val(),
- 'post_ID' : $('#post_ID').val(),
+ 'p' : $('#post_ID').val(),
'start' : st,
- 'num' : num
+ 'number' : num
};
$.post(ajaxurl, data,
theList = theExtraList = null;
$("a[className*=':']").unbind();
- setCommentsList();
if ( commentsBox.st > commentsBox.total )
$('#show-comments').hide();
}
function updateText() {
- var attemptedDate, originalDate, currentDate, publishOn, page = 'page' == pagenow || 'page-new' == pagenow,
- postStatus = $('#post_status'), optPublish = $('option[value=publish]', postStatus), aa = $('#aa').val(),
+ var attemptedDate, originalDate, currentDate, publishOn, postStatus = $('#post_status'),
+ optPublish = $('option[value=publish]', postStatus), aa = $('#aa').val(),
mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val();
attemptedDate = new Date( aa, mm - 1, jj, hh, mn );
$('#publish').val( postL10n.publish );
} else {
publishOn = postL10n.publishOnPast;
- if ( page )
- $('#publish').val( postL10n.updatePage );
- else
- $('#publish').val( postL10n.updatePost );
+ $('#publish').val( postL10n.update );
}
if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) { //hack
$('#timestamp').html(stamp);
}
if ( $('input:radio:checked', '#post-visibility-select').val() == 'private' ) {
- if ( page )
- $('#publish').val( postL10n.updatePage );
- else
- $('#publish').val( postL10n.updatePost );
+ $('#publish').val( postL10n.update );
if ( optPublish.length == 0 ) {
postStatus.append('<option value="publish">' + postL10n.privatelyPublished + '</option>');
} else {
-var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(b){return b.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"")},parseTags:function(e){var h=e.id,b=h.split("-check-num-")[1],d=a(e).closest(".tagsdiv"),g=d.find(".the-tags"),c=g.val().split(","),f=[];delete c[b];a.each(c,function(i,j){j=a.trim(j);if(j){f.push(j)}});g.val(this.clean(f.join(",")));this.quickClicks(d);return false},quickClicks:function(d){var g=a(".the-tags",d),e=a(".tagchecklist",d),f=a(d).attr("id"),b,c;if(!g.length){return}c=g.attr("disabled");b=g.val().split(",");e.empty();a.each(b,function(i,k){var j,h;k=a.trim(k);if(!k){return}j=a("<span />").text(k);if(!c){h=a('<a id="'+f+"-check-num-"+i+'" class="ntdelbutton">X</a>');h.click(function(){tagBox.parseTags(this)});j.prepend(" ").prepend(h)}e.append(j)})},flushTags:function(e,b,g){b=b||false;var i,c=a(".the-tags",e),h=a("input.newtag",e),d;i=b?a(b).text():h.val();tagsval=c.val();d=tagsval?tagsval+","+i:i;d=this.clean(d);d=array_unique_noempty(d.split(",")).join(",");c.val(d);this.quickClicks(e);if(!b){h.val("")}if("undefined"==typeof(g)){h.focus()}return false},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)});a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))});a("div.taghint",c).click(function(){a(this).css("visibility","hidden").parent().siblings(".newtag").focus()});a("input.newtag",c).blur(function(){if(this.value==""){a(this).parent().siblings(".taghint").css("visibility","")}}).focus(function(){a(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(".tagsdiv"));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return false}}).each(function(){var d=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+d,{delay:500,minchars:2,multiple:true,multipleSep:","})});a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});a("a.tagcloud-link").click(function(){tagBox.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})}};commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv img.waiting").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),post_ID:a("#post_ID").val(),start:b,num:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv img.waiting").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();setCommentsList();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").parent().html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")});return false}};WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)};WPSetThumbnailID=function(c){var b=a("input[value=_thumbnail_id]","#list-table");if(b.size()>0){a("#meta\\["+b.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(c)}};WPRemoveThumbnail=function(b){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(c){if(c=="0"){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(c)}})}})(jQuery);jQuery(document).ready(function(e){var b,a,f="";postboxes.add_postbox_toggles(pagenow);if(e("#tagsdiv-post_tag").length){tagBox.init()}else{e("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}})}e(".categorydiv").each(function(){var l=e(this).attr("id"),h=false,k,m,j,g,i;j=l.split("-");j.shift();g=j.join("-");i=g+"_tab";if(g=="category"){i="cats"}e("a","#"+g+"-tabs").click(function(){var n=e(this).attr("href");e(this).parent().addClass("tabs").siblings("li").removeClass("tabs");e("#"+g+"-tabs").siblings(".tabs-panel").hide();e(n).show();if("#"+g+"-all"==n){deleteUserSetting(i)}else{setUserSetting(i,"pop")}return false});if(getUserSetting(i)){e('a[href="#'+g+'-pop"]',"#"+g+"-tabs").click()}e("#new"+g).one("focus",function(){e(this).val("").removeClass("form-input-tip")});e("#"+g+"-add-submit").click(function(){e("#new"+g).focus()});k=function(){if(h){return}h=true;var n=jQuery(this),p=n.is(":checked"),o=n.val().toString();e("#in-"+g+"-"+o+", #in-"+g+"-category-"+o).attr("checked",p);h=false};catAddBefore=function(n){if(!e("#new"+g).val()){return false}n.data+="&"+e(":checked","#"+g+"checklist").serialize();return n};m=function(q,p){var o,n=e("#new"+g+"_parent");if("undefined"!=p.parsed.responses[0]&&(o=p.parsed.responses[0].supplemental.newcat_parent)){n.before(o);n.remove()}};e("#"+g+"checklist").wpList({alt:"",response:g+"-ajax-response",addBefore:catAddBefore,addAfter:m});e("#"+g+"-add-toggle").click(function(){e("#"+g+"-adder").toggleClass("wp-hidden-children");e('a[href="#'+g+'-all"]',"#"+g+"-tabs").click();e("#new"+g).focus();return false});e("#"+g+"checklist li.popular-category :checkbox, #"+g+"checklist-pop :checkbox").live("click",function(){var n=e(this),p=n.is(":checked"),o=n.val();if(o&&n.parents("#taxonomy-"+g).length){e("#in-"+g+"-"+o+", #in-popular-"+g+"-"+o).attr("checked",p)}})});if(e("#postcustom").length){e("#the-list").wpList({addAfter:function(g,h){e("table#list-table").show()},addBefore:function(g){g.data+="&post_id="+e("#post_ID").val();return g}})}if(e("#submitdiv").length){b=e("#timestamp").html();a=e("#post-visibility-display").html();function d(){var g=e("#post-visibility-select");if(e("input:radio:checked",g).val()!="public"){e("#sticky").attr("checked",false);e("#sticky-span").hide()}else{e("#sticky-span").show()}if(e("input:radio:checked",g).val()!="password"){e("#password-span").hide()}else{e("#password-span").show()}}function c(){var n,p,h,r,o="page"==pagenow||"page-new"==pagenow,q=e("#post_status"),i=e("option[value=publish]",q),g=e("#aa").val(),l=e("#mm").val(),m=e("#jj").val(),k=e("#hh").val(),j=e("#mn").val();n=new Date(g,l-1,m,k,j);p=new Date(e("#hidden_aa").val(),e("#hidden_mm").val()-1,e("#hidden_jj").val(),e("#hidden_hh").val(),e("#hidden_mn").val());h=new Date(e("#cur_aa").val(),e("#cur_mm").val()-1,e("#cur_jj").val(),e("#cur_hh").val(),e("#cur_mn").val());if(n.getFullYear()!=g||(1+n.getMonth())!=l||n.getDate()!=m||n.getMinutes()!=j){e(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{e(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}if(n>h&&e("#original_post_status").val()!="future"){r=postL10n.publishOnFuture;e("#publish").val(postL10n.schedule)}else{if(n<=h&&e("#original_post_status").val()!="publish"){r=postL10n.publishOn;e("#publish").val(postL10n.publish)}else{r=postL10n.publishOnPast;if(o){e("#publish").val(postL10n.updatePage)}else{e("#publish").val(postL10n.updatePost)}}}if(p.toUTCString()==n.toUTCString()){e("#timestamp").html(b)}else{e("#timestamp").html(r+" <b>"+e("option[value="+e("#mm").val()+"]","#mm").text()+" "+m+", "+g+" @ "+k+":"+j+"</b> ")}if(e("input:radio:checked","#post-visibility-select").val()=="private"){if(o){e("#publish").val(postL10n.updatePage)}else{e("#publish").val(postL10n.updatePost)}if(i.length==0){q.append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}else{i.html(postL10n.privatelyPublished)}e("option[value=publish]",q).attr("selected",true);e(".edit-post-status","#misc-publishing-actions").hide()}else{if(e("#original_post_status").val()=="future"||e("#original_post_status").val()=="draft"){if(i.length){i.remove();q.val(e("#hidden_post_status").val())}}else{i.html(postL10n.published)}if(q.is(":hidden")){e(".edit-post-status","#misc-publishing-actions").show()}}e("#post-status-display").html(e("option:selected",q).text());if(e("option:selected",q).val()=="private"||e("option:selected",q).val()=="publish"){e("#save-post").hide()}else{e("#save-post").show();if(e("option:selected",q).val()=="pending"){e("#save-post").show().val(postL10n.savePending)}else{e("#save-post").show().val(postL10n.saveDraft)}}return true}e(".edit-visibility","#visibility").click(function(){if(e("#post-visibility-select").is(":hidden")){d();e("#post-visibility-select").slideDown("normal");e(this).hide()}return false});e(".cancel-post-visibility","#post-visibility-select").click(function(){e("#post-visibility-select").slideUp("normal");e("#visibility-radio-"+e("#hidden-post-visibility").val()).attr("checked",true);e("#post_password").val(e("#hidden_post_password").val());e("#sticky").attr("checked",e("#hidden-post-sticky").attr("checked"));e("#post-visibility-display").html(a);e(".edit-visibility","#visibility").show();c();return false});e(".save-post-visibility","#post-visibility-select").click(function(){var g=e("#post-visibility-select");g.slideUp("normal");e(".edit-visibility","#visibility").show();c();if(e("input:radio:checked",g).val()!="public"){e("#sticky").attr("checked",false)}if(true==e("#sticky").attr("checked")){f="Sticky"}else{f=""}e("#post-visibility-display").html(postL10n[e("input:radio:checked",g).val()+f]);return false});e("input:radio","#post-visibility-select").change(function(){d()});e("#timestampdiv").siblings("a.edit-timestamp").click(function(){if(e("#timestampdiv").is(":hidden")){e("#timestampdiv").slideDown("normal");e(this).hide()}return false});e(".cancel-timestamp","#timestampdiv").click(function(){e("#timestampdiv").slideUp("normal");e("#mm").val(e("#hidden_mm").val());e("#jj").val(e("#hidden_jj").val());e("#aa").val(e("#hidden_aa").val());e("#hh").val(e("#hidden_hh").val());e("#mn").val(e("#hidden_mn").val());e("#timestampdiv").siblings("a.edit-timestamp").show();c();return false});e(".save-timestamp","#timestampdiv").click(function(){if(c()){e("#timestampdiv").slideUp("normal");e("#timestampdiv").siblings("a.edit-timestamp").show()}return false});e("#post-status-select").siblings("a.edit-post-status").click(function(){if(e("#post-status-select").is(":hidden")){e("#post-status-select").slideDown("normal");e(this).hide()}return false});e(".save-post-status","#post-status-select").click(function(){e("#post-status-select").slideUp("normal");e("#post-status-select").siblings("a.edit-post-status").show();c();return false});e(".cancel-post-status","#post-status-select").click(function(){e("#post-status-select").slideUp("normal");e("#post_status").val(e("#hidden_post_status").val());e("#post-status-select").siblings("a.edit-post-status").show();c();return false})}if(e("#edit-slug-box").length){editPermalink=function(g){var h,l=0,k=e("#editable-post-name"),m=k.html(),p=e("#post_name"),q=p.val(),n=e("#edit-slug-buttons"),o=n.html(),j=e("#editable-post-name-full").html();e("#view-post-btn").hide();n.html('<a href="#" class="save button">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>");n.children(".save").click(function(){var i=k.children("input").val();e.post(ajaxurl,{action:"sample-permalink",post_id:g,new_slug:i,new_title:e("#title").val(),samplepermalinknonce:e("#samplepermalinknonce").val()},function(r){e("#edit-slug-box").html(r);n.html(o);p.attr("value",i);makeSlugeditClickable();e("#view-post-btn").show()});return false});e(".cancel","#edit-slug-buttons").click(function(){e("#view-post-btn").show();k.html(m);n.html(o);p.attr("value",q);return false});for(h=0;h<j.length;++h){if("%"==j.charAt(h)){l++}}slug_value=(l>j.length/4)?"":j;k.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(r){var i=r.keyCode||0;if(13==i){n.children(".save").click();return false}if(27==i){n.children(".cancel").click();return false}p.attr("value",this.value)}).focus()};makeSlugeditClickable=function(){e("#editable-post-name").click(function(){e("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()}if(e("#title").val()==""){e("#title").siblings("#title-prompt-text").css("visibility","")}e("#title-prompt-text").click(function(){e(this).css("visibility","hidden").siblings("#title").focus()});e("#title").blur(function(){if(this.value==""){e(this).siblings("#title-prompt-text").css("visibility","")}}).focus(function(){e(this).siblings("#title-prompt-text").css("visibility","hidden")}).keydown(function(g){e(this).siblings("#title-prompt-text").css("visibility","hidden");e(this).unbind(g)})});
\ No newline at end of file
+var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(b){return b.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"")},parseTags:function(e){var h=e.id,b=h.split("-check-num-")[1],d=a(e).closest(".tagsdiv"),g=d.find(".the-tags"),c=g.val().split(","),f=[];delete c[b];a.each(c,function(i,j){j=a.trim(j);if(j){f.push(j)}});g.val(this.clean(f.join(",")));this.quickClicks(d);return false},quickClicks:function(d){var g=a(".the-tags",d),e=a(".tagchecklist",d),f=a(d).attr("id"),b,c;if(!g.length){return}c=g.attr("disabled");b=g.val().split(",");e.empty();a.each(b,function(i,k){var j,h;k=a.trim(k);if(!k){return}j=a("<span />").text(k);if(!c){h=a('<a id="'+f+"-check-num-"+i+'" class="ntdelbutton">X</a>');h.click(function(){tagBox.parseTags(this)});j.prepend(" ").prepend(h)}e.append(j)})},flushTags:function(e,b,g){b=b||false;var i,c=a(".the-tags",e),h=a("input.newtag",e),d;i=b?a(b).text():h.val();tagsval=c.val();d=tagsval?tagsval+","+i:i;d=this.clean(d);d=array_unique_noempty(d.split(",")).join(",");c.val(d);this.quickClicks(e);if(!b){h.val("")}if("undefined"==typeof(g)){h.focus()}return false},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)});a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))});a("div.taghint",c).click(function(){a(this).css("visibility","hidden").parent().siblings(".newtag").focus()});a("input.newtag",c).blur(function(){if(this.value==""){a(this).parent().siblings(".taghint").css("visibility","")}}).focus(function(){a(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(".tagsdiv"));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return false}}).each(function(){var d=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+d,{delay:500,minchars:2,multiple:true,multipleSep:","})});a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});a("a.tagcloud-link").click(function(){tagBox.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})}};commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv img.waiting").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),p:a("#post_ID").val(),start:b,number:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv img.waiting").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").parent().html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")});return false}};WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)};WPSetThumbnailID=function(c){var b=a("input[value=_thumbnail_id]","#list-table");if(b.size()>0){a("#meta\\["+b.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(c)}};WPRemoveThumbnail=function(b){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(c){if(c=="0"){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(c)}})}})(jQuery);jQuery(document).ready(function(e){var b,a,f="";postboxes.add_postbox_toggles(pagenow);if(e("#tagsdiv-post_tag").length){tagBox.init()}else{e("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}})}e(".categorydiv").each(function(){var l=e(this).attr("id"),h=false,k,m,j,g,i;j=l.split("-");j.shift();g=j.join("-");i=g+"_tab";if(g=="category"){i="cats"}e("a","#"+g+"-tabs").click(function(){var n=e(this).attr("href");e(this).parent().addClass("tabs").siblings("li").removeClass("tabs");e("#"+g+"-tabs").siblings(".tabs-panel").hide();e(n).show();if("#"+g+"-all"==n){deleteUserSetting(i)}else{setUserSetting(i,"pop")}return false});if(getUserSetting(i)){e('a[href="#'+g+'-pop"]',"#"+g+"-tabs").click()}e("#new"+g).one("focus",function(){e(this).val("").removeClass("form-input-tip")});e("#"+g+"-add-submit").click(function(){e("#new"+g).focus()});k=function(){if(h){return}h=true;var n=jQuery(this),p=n.is(":checked"),o=n.val().toString();e("#in-"+g+"-"+o+", #in-"+g+"-category-"+o).attr("checked",p);h=false};catAddBefore=function(n){if(!e("#new"+g).val()){return false}n.data+="&"+e(":checked","#"+g+"checklist").serialize();return n};m=function(q,p){var o,n=e("#new"+g+"_parent");if("undefined"!=p.parsed.responses[0]&&(o=p.parsed.responses[0].supplemental.newcat_parent)){n.before(o);n.remove()}};e("#"+g+"checklist").wpList({alt:"",response:g+"-ajax-response",addBefore:catAddBefore,addAfter:m});e("#"+g+"-add-toggle").click(function(){e("#"+g+"-adder").toggleClass("wp-hidden-children");e('a[href="#'+g+'-all"]',"#"+g+"-tabs").click();e("#new"+g).focus();return false});e("#"+g+"checklist li.popular-category :checkbox, #"+g+"checklist-pop :checkbox").live("click",function(){var n=e(this),p=n.is(":checked"),o=n.val();if(o&&n.parents("#taxonomy-"+g).length){e("#in-"+g+"-"+o+", #in-popular-"+g+"-"+o).attr("checked",p)}})});if(e("#postcustom").length){e("#the-list").wpList({addAfter:function(g,h){e("table#list-table").show()},addBefore:function(g){g.data+="&post_id="+e("#post_ID").val();return g}})}if(e("#submitdiv").length){b=e("#timestamp").html();a=e("#post-visibility-display").html();function d(){var g=e("#post-visibility-select");if(e("input:radio:checked",g).val()!="public"){e("#sticky").attr("checked",false);e("#sticky-span").hide()}else{e("#sticky-span").show()}if(e("input:radio:checked",g).val()!="password"){e("#password-span").hide()}else{e("#password-span").show()}}function c(){var n,o,h,q,p=e("#post_status"),i=e("option[value=publish]",p),g=e("#aa").val(),l=e("#mm").val(),m=e("#jj").val(),k=e("#hh").val(),j=e("#mn").val();n=new Date(g,l-1,m,k,j);o=new Date(e("#hidden_aa").val(),e("#hidden_mm").val()-1,e("#hidden_jj").val(),e("#hidden_hh").val(),e("#hidden_mn").val());h=new Date(e("#cur_aa").val(),e("#cur_mm").val()-1,e("#cur_jj").val(),e("#cur_hh").val(),e("#cur_mn").val());if(n.getFullYear()!=g||(1+n.getMonth())!=l||n.getDate()!=m||n.getMinutes()!=j){e(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{e(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}if(n>h&&e("#original_post_status").val()!="future"){q=postL10n.publishOnFuture;e("#publish").val(postL10n.schedule)}else{if(n<=h&&e("#original_post_status").val()!="publish"){q=postL10n.publishOn;e("#publish").val(postL10n.publish)}else{q=postL10n.publishOnPast;e("#publish").val(postL10n.update)}}if(o.toUTCString()==n.toUTCString()){e("#timestamp").html(b)}else{e("#timestamp").html(q+" <b>"+e("option[value="+e("#mm").val()+"]","#mm").text()+" "+m+", "+g+" @ "+k+":"+j+"</b> ")}if(e("input:radio:checked","#post-visibility-select").val()=="private"){e("#publish").val(postL10n.update);if(i.length==0){p.append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}else{i.html(postL10n.privatelyPublished)}e("option[value=publish]",p).attr("selected",true);e(".edit-post-status","#misc-publishing-actions").hide()}else{if(e("#original_post_status").val()=="future"||e("#original_post_status").val()=="draft"){if(i.length){i.remove();p.val(e("#hidden_post_status").val())}}else{i.html(postL10n.published)}if(p.is(":hidden")){e(".edit-post-status","#misc-publishing-actions").show()}}e("#post-status-display").html(e("option:selected",p).text());if(e("option:selected",p).val()=="private"||e("option:selected",p).val()=="publish"){e("#save-post").hide()}else{e("#save-post").show();if(e("option:selected",p).val()=="pending"){e("#save-post").show().val(postL10n.savePending)}else{e("#save-post").show().val(postL10n.saveDraft)}}return true}e(".edit-visibility","#visibility").click(function(){if(e("#post-visibility-select").is(":hidden")){d();e("#post-visibility-select").slideDown("normal");e(this).hide()}return false});e(".cancel-post-visibility","#post-visibility-select").click(function(){e("#post-visibility-select").slideUp("normal");e("#visibility-radio-"+e("#hidden-post-visibility").val()).attr("checked",true);e("#post_password").val(e("#hidden_post_password").val());e("#sticky").attr("checked",e("#hidden-post-sticky").attr("checked"));e("#post-visibility-display").html(a);e(".edit-visibility","#visibility").show();c();return false});e(".save-post-visibility","#post-visibility-select").click(function(){var g=e("#post-visibility-select");g.slideUp("normal");e(".edit-visibility","#visibility").show();c();if(e("input:radio:checked",g).val()!="public"){e("#sticky").attr("checked",false)}if(true==e("#sticky").attr("checked")){f="Sticky"}else{f=""}e("#post-visibility-display").html(postL10n[e("input:radio:checked",g).val()+f]);return false});e("input:radio","#post-visibility-select").change(function(){d()});e("#timestampdiv").siblings("a.edit-timestamp").click(function(){if(e("#timestampdiv").is(":hidden")){e("#timestampdiv").slideDown("normal");e(this).hide()}return false});e(".cancel-timestamp","#timestampdiv").click(function(){e("#timestampdiv").slideUp("normal");e("#mm").val(e("#hidden_mm").val());e("#jj").val(e("#hidden_jj").val());e("#aa").val(e("#hidden_aa").val());e("#hh").val(e("#hidden_hh").val());e("#mn").val(e("#hidden_mn").val());e("#timestampdiv").siblings("a.edit-timestamp").show();c();return false});e(".save-timestamp","#timestampdiv").click(function(){if(c()){e("#timestampdiv").slideUp("normal");e("#timestampdiv").siblings("a.edit-timestamp").show()}return false});e("#post-status-select").siblings("a.edit-post-status").click(function(){if(e("#post-status-select").is(":hidden")){e("#post-status-select").slideDown("normal");e(this).hide()}return false});e(".save-post-status","#post-status-select").click(function(){e("#post-status-select").slideUp("normal");e("#post-status-select").siblings("a.edit-post-status").show();c();return false});e(".cancel-post-status","#post-status-select").click(function(){e("#post-status-select").slideUp("normal");e("#post_status").val(e("#hidden_post_status").val());e("#post-status-select").siblings("a.edit-post-status").show();c();return false})}if(e("#edit-slug-box").length){editPermalink=function(g){var h,l=0,k=e("#editable-post-name"),m=k.html(),p=e("#post_name"),q=p.val(),n=e("#edit-slug-buttons"),o=n.html(),j=e("#editable-post-name-full").html();e("#view-post-btn").hide();n.html('<a href="#" class="save button">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>");n.children(".save").click(function(){var i=k.children("input").val();e.post(ajaxurl,{action:"sample-permalink",post_id:g,new_slug:i,new_title:e("#title").val(),samplepermalinknonce:e("#samplepermalinknonce").val()},function(r){e("#edit-slug-box").html(r);n.html(o);p.attr("value",i);makeSlugeditClickable();e("#view-post-btn").show()});return false});e(".cancel","#edit-slug-buttons").click(function(){e("#view-post-btn").show();k.html(m);n.html(o);p.attr("value",q);return false});for(h=0;h<j.length;++h){if("%"==j.charAt(h)){l++}}slug_value=(l>j.length/4)?"":j;k.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(r){var i=r.keyCode||0;if(13==i){n.children(".save").click();return false}if(27==i){n.children(".cancel").click();return false}p.attr("value",this.value)}).focus()};makeSlugeditClickable=function(){e("#editable-post-name").click(function(){e("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()}if(e("#title").val()==""){e("#title").siblings("#title-prompt-text").css("visibility","")}e("#title-prompt-text").click(function(){e(this).css("visibility","hidden").siblings("#title").focus()});e("#title").blur(function(){if(this.value==""){e(this).siblings("#title-prompt-text").css("visibility","")}}).focus(function(){e(this).siblings("#title-prompt-text").css("visibility","hidden")}).keydown(function(g){e(this).siblings("#title-prompt-text").css("visibility","hidden");e(this).unbind(g)})});
\ No newline at end of file
<?php
+// The JS here is purposefully obfuscated to preserve mystery and romance.
+// If you want to see behind the curtain, visit http://core.trac.wordpress.org/ticket/15262
+
if ( !defined( 'ABSPATH' ) )
exit;
var parent = form.find('select#parent').val();
if ( parent > 0 && $('#tag-' + parent ).length > 0 ) // If the parent exists on this page, insert it below. Else insert it at the top of the list.
- $('#the-list #tag-' + parent).after( res.responses[0].supplemental['noparents'] ); // As the parent exists, Insert the version with - - - prefixed
+ $('.tags #tag-' + parent).after( res.responses[0].supplemental['noparents'] ); // As the parent exists, Insert the version with - - - prefixed
else
- $('#the-list').prepend( res.responses[0].supplemental['parents'] ); // As the parent is not visible, Insert the version with Parent - Child - ThisTerm
+ $('.tags').prepend( res.responses[0].supplemental['parents'] ); // As the parent is not visible, Insert the version with Parent - Child - ThisTerm
+
+ $('.tags .no-items').remove();
if ( form.find('select#parent') ) {
// Parents field exists, Add new term to the list.
return false;
});
-});
\ No newline at end of file
+});
-jQuery(document).ready(function(a){a(".delete-tag").live("click",function(g){var b=a(this),f=b.parents("tr"),c=true,d;if("undefined"!=showNotice){c=showNotice.warn()}if(c){d=b.attr("href").replace(/[^?]*\?/,"").replace(/action=delete/,"action=delete-tag");a.post(ajaxurl,d,function(e){if("1"==e){a("#ajax-response").empty();f.fadeOut("normal",function(){f.remove()});a("select#parent option[value="+d.match(/tag_ID=(\d+)/)[1]+"]").remove();a("a.tag-link-"+d.match(/tag_ID=(\d+)/)[1]).remove()}else{if("-1"==e){a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.noPerm+"</p></div>");f.children().css("backgroundColor","")}else{a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.broken+"</p></div>");f.children().css("backgroundColor","")}}});f.children().css("backgroundColor","#f33")}return false});a("#submit").click(function(){var b=a(this).parents("form");if(!validateForm(b)){return false}a.post(ajaxurl,a("#addtag").serialize(),function(h){a("#ajax-response").empty();var f=wpAjax.parseAjaxResponse(h,"ajax-response");if(!f){return}var g=b.find("select#parent").val();if(g>0&&a("#tag-"+g).length>0){a("#the-list #tag-"+g).after(f.responses[0].supplemental.noparents)}else{a("#the-list").prepend(f.responses[0].supplemental.parents)}if(b.find("select#parent")){var e=f.responses[1].supplemental;var c="";for(var d=0;d<f.responses[1].position;d++){c+=" "}b.find("select#parent option:selected").after('<option value="'+e.term_id+'">'+c+e.name+"</option>")}a('input[type="text"]:visible, textarea:visible',b).val("")});return false})});
\ No newline at end of file
+jQuery(document).ready(function(a){a(".delete-tag").live("click",function(g){var b=a(this),f=b.parents("tr"),c=true,d;if("undefined"!=showNotice){c=showNotice.warn()}if(c){d=b.attr("href").replace(/[^?]*\?/,"").replace(/action=delete/,"action=delete-tag");a.post(ajaxurl,d,function(e){if("1"==e){a("#ajax-response").empty();f.fadeOut("normal",function(){f.remove()});a("select#parent option[value="+d.match(/tag_ID=(\d+)/)[1]+"]").remove();a("a.tag-link-"+d.match(/tag_ID=(\d+)/)[1]).remove()}else{if("-1"==e){a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.noPerm+"</p></div>");f.children().css("backgroundColor","")}else{a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.broken+"</p></div>");f.children().css("backgroundColor","")}}});f.children().css("backgroundColor","#f33")}return false});a("#submit").click(function(){var b=a(this).parents("form");if(!validateForm(b)){return false}a.post(ajaxurl,a("#addtag").serialize(),function(h){a("#ajax-response").empty();var f=wpAjax.parseAjaxResponse(h,"ajax-response");if(!f){return}var g=b.find("select#parent").val();if(g>0&&a("#tag-"+g).length>0){a(".tags #tag-"+g).after(f.responses[0].supplemental.noparents)}else{a(".tags").prepend(f.responses[0].supplemental.parents)}a(".tags .no-items").remove();if(b.find("select#parent")){var e=f.responses[1].supplemental;var c="";for(var d=0;d<f.responses[1].position;d++){c+=" "}b.find("select#parent option:selected").after('<option value="'+e.term_id+'">'+c+e.name+"</option>")}a('input[type="text"]:visible, textarea:visible',b).val("")});return false})});
\ No newline at end of file
--- /dev/null
+var ThemeViewer;
+
+(function($){
+ ThemeViewer = function( args ) {
+
+ function init() {
+ $( '#filter-click, #mini-filter-click' ).unbind( 'click' ).click( function() {
+ $( '#filter-click' ).toggleClass( 'current' );
+ $( '#filter-box' ).slideToggle();
+ $( '#current-theme' ).slideToggle( 300 );
+ return false;
+ });
+
+ $( '#filter-box :checkbox' ).unbind( 'click' ).click( function() {
+ var count = $( '#filter-box :checked' ).length,
+ text = $( '#filter-click' ).text();
+
+ if ( text.indexOf( '(' ) != -1 )
+ text = text.substr( 0, text.indexOf( '(' ) );
+
+ if ( count == 0 )
+ $( '#filter-click' ).text( text );
+ else
+ $( '#filter-click' ).text( text + ' (' + count + ')' );
+ });
+
+ /* $('#filter-box :submit').unbind( 'click' ).click(function() {
+ var features = [];
+ $('#filter-box :checked').each(function() {
+ features.push($(this).val());
+ });
+
+ listTable.update_rows({'features': features}, true, function() {
+ $( '#filter-click' ).toggleClass( 'current' );
+ $( '#filter-box' ).slideToggle();
+ $( '#current-theme' ).slideToggle( 300 );
+ });
+
+ return false;
+ }); */
+ }
+
+ // These are the functions we expose
+ var api = {
+ init: init
+ };
+
+ return api;
+ }
+})(jQuery);
+
+jQuery( document ).ready( function($) {
+ theme_viewer = new ThemeViewer();
+ theme_viewer.init();
+});
--- /dev/null
+var ThemeViewer;(function(a){ThemeViewer=function(b){function d(){a("#filter-click, #mini-filter-click").unbind("click").click(function(){a("#filter-click").toggleClass("current");a("#filter-box").slideToggle();a("#current-theme").slideToggle(300);return false});a("#filter-box :checkbox").unbind("click").click(function(){var e=a("#filter-box :checked").length,f=a("#filter-click").text();if(f.indexOf("(")!=-1){f=f.substr(0,f.indexOf("("))}if(e==0){a("#filter-click").text(f)}else{a("#filter-click").text(f+" ("+e+")")}})}var c={init:d};return c}})(jQuery);jQuery(document).ready(function(a){theme_viewer=new ThemeViewer();theme_viewer.init()});
\ No newline at end of file
$(document).ready( function() {
$('#pass1').val('').keyup( check_pass_strength );
$('#pass2').val('').keyup( check_pass_strength );
+ $('#pass-strength-result').show();
$('.color-palette').click(function(){$(this).siblings('input[name=admin_color]').attr('checked', 'checked')});
$('#nickname').blur(function(){
var str = $(this).val() || $('#user_login').val();
-(function(a){function b(){var e=a("#pass1").val(),d=a("#user_login").val(),c=a("#pass2").val(),f;a("#pass-strength-result").removeClass("short bad good strong");if(!e){a("#pass-strength-result").html(pwsL10n.empty);return}f=passwordStrength(e,d,c);switch(f){case 2:a("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:a("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:a("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;case 5:a("#pass-strength-result").addClass("short").html(pwsL10n.mismatch);break;default:a("#pass-strength-result").addClass("short").html(pwsL10n["short"])}}a(document).ready(function(){a("#pass1").val("").keyup(b);a("#pass2").val("").keyup(b);a(".color-palette").click(function(){a(this).siblings("input[name=admin_color]").attr("checked","checked")});a("#nickname").blur(function(){var e=a(this).val()||a("#user_login").val();var c=a("#display_name");var d=c.children("option:selected").attr("id");c.children("#display_nickname").remove();if(!c.children("option[value="+e+"]").length){c.append('<option id="display_nickname" value="'+e+'">'+e+"</option>")}a("#"+d).attr("selected","selected")});a("#first_name, #last_name").blur(function(){var c=a("#display_name");var f=a("#first_name").val(),d=a("#last_name").val();var e=c.children("option:selected").attr("id");a("#display_firstname, #display_lastname, #display_firstlast, #display_lastfirst").remove();if(f&&!c.children("option[value="+f+"]").length){c.append('<option id="display_firstname" value="'+f+'">'+f+"</option>")}if(d&&!c.children("option[value="+d+"]").length){c.append('<option id="display_lastname" value="'+d+'">'+d+"</option>")}if(f&&d){if(!c.children("option[value="+f+" "+d+"]").length){c.append('<option id="display_firstlast" value="'+f+" "+d+'">'+f+" "+d+"</option>")}if(!c.children("option[value="+d+" "+f+"]").length){c.append('<option id="display_lastfirst" value="'+d+" "+f+'">'+d+" "+f+"</option>")}}a("#"+e).attr("selected","selected")})})})(jQuery);
\ No newline at end of file
+(function(a){function b(){var e=a("#pass1").val(),d=a("#user_login").val(),c=a("#pass2").val(),f;a("#pass-strength-result").removeClass("short bad good strong");if(!e){a("#pass-strength-result").html(pwsL10n.empty);return}f=passwordStrength(e,d,c);switch(f){case 2:a("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:a("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:a("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;case 5:a("#pass-strength-result").addClass("short").html(pwsL10n.mismatch);break;default:a("#pass-strength-result").addClass("short").html(pwsL10n["short"])}}a(document).ready(function(){a("#pass1").val("").keyup(b);a("#pass2").val("").keyup(b);a("#pass-strength-result").show();a(".color-palette").click(function(){a(this).siblings("input[name=admin_color]").attr("checked","checked")});a("#nickname").blur(function(){var e=a(this).val()||a("#user_login").val();var c=a("#display_name");var d=c.children("option:selected").attr("id");c.children("#display_nickname").remove();if(!c.children("option[value="+e+"]").length){c.append('<option id="display_nickname" value="'+e+'">'+e+"</option>")}a("#"+d).attr("selected","selected")});a("#first_name, #last_name").blur(function(){var c=a("#display_name");var f=a("#first_name").val(),d=a("#last_name").val();var e=c.children("option:selected").attr("id");a("#display_firstname, #display_lastname, #display_firstlast, #display_lastfirst").remove();if(f&&!c.children("option[value="+f+"]").length){c.append('<option id="display_firstname" value="'+f+'">'+f+"</option>")}if(d&&!c.children("option[value="+d+"]").length){c.append('<option id="display_lastname" value="'+d+'">'+d+"</option>")}if(f&&d){if(!c.children("option[value="+f+" "+d+"]").length){c.append('<option id="display_firstlast" value="'+f+" "+d+'">'+f+" "+d+"</option>")}if(!c.children("option[value="+d+" "+f+"]").length){c.append('<option id="display_lastfirst" value="'+d+" "+f+'">'+d+" "+f+"</option>")}}a("#"+e).attr("selected","selected")})})})(jQuery);
\ No newline at end of file
// utility functions
-function convertEntities(o) {
- var c, v;
- c = function(s) {
- if (/&[^;]+;/.test(s)) {
- var e = document.createElement("div");
- e.innerHTML = s;
- return !e.firstChild ? s : e.firstChild.nodeValue;
- }
- return s;
- }
-
- if ( typeof o === 'string' ) {
- return c(o);
- } else if ( typeof o === 'object' ) {
- for (v in o) {
- if ( typeof o[v] === 'string' ) {
- o[v] = c(o[v]);
- }
- }
- }
- return o;
-}
var wpCookies = {
// The following functions are from Cookie.js class in TinyMCE, Moxiecode, used under LGPL.
-function convertEntities(b){var d,a;d=function(c){if(/&[^;]+;/.test(c)){var f=document.createElement("div");f.innerHTML=c;return !f.firstChild?c:f.firstChild.nodeValue}return c};if(typeof b==="string"){return d(b)}else{if(typeof b==="object"){for(a in b){if(typeof b[a]==="string"){b[a]=d(b[a])}}}}return b}var wpCookies={each:function(d,a,c){var e,b;if(!d){return 0}c=c||d;if(typeof(d.length)!="undefined"){for(e=0,b=d.length;e<b;e++){if(a.call(c,d[e],e,d)===false){return 0}}}else{for(e in d){if(d.hasOwnProperty(e)){if(a.call(c,d[e],e,d)===false){return 0}}}}return 1},getHash:function(c){var a=this.get(c),b;if(a){this.each(a.split("&"),function(d){d=d.split("=");b=b||{};b[d[0]]=d[1]})}return b},setHash:function(i,a,f,c,h,b){var g="";this.each(a,function(e,d){g+=(!g?"":"&")+d+"="+e});this.set(i,g,f,c,h,b)},get:function(h){var g=document.cookie,f,d=h+"=",a;if(!g){return}a=g.indexOf("; "+d);if(a==-1){a=g.indexOf(d);if(a!=0){return null}}else{a+=2}f=g.indexOf(";",a);if(f==-1){f=g.length}return decodeURIComponent(g.substring(a+d.length,f))},set:function(h,a,f,c,g,b){document.cookie=h+"="+encodeURIComponent(a)+((f)?"; expires="+f.toGMTString():"")+((c)?"; path="+c:"")+((g)?"; domain="+g:"")+((b)?"; secure":"")},remove:function(c,a){var b=new Date();b.setTime(b.getTime()-1000);this.set(c,"",b,a,b)}};function getUserSetting(a,b){var c=getAllUserSettings();if(c.hasOwnProperty(a)){return c[a]}if(typeof b!="undefined"){return b}return""}function setUserSetting(a,i,k){if("object"!==typeof userSettings){return false}var h="wp-settings-"+userSettings.uid,e=wpCookies.getHash(h)||{},g=new Date(),b,f=a.toString().replace(/[^A-Za-z0-9_]/,""),j=i.toString().replace(/[^A-Za-z0-9_]/,"");if(k){delete e[f]}else{e[f]=j}g.setTime(g.getTime()+31536000000);b=userSettings.url;wpCookies.setHash(h,e,g,b);wpCookies.set("wp-settings-time-"+userSettings.uid,userSettings.time,g,b);return a}function deleteUserSetting(a){return setUserSetting(a,"",1)}function getAllUserSettings(){if("object"!==typeof userSettings){return{}}return wpCookies.getHash("wp-settings-"+userSettings.uid)||{}};
\ No newline at end of file
+var wpCookies={each:function(d,a,c){var e,b;if(!d){return 0}c=c||d;if(typeof(d.length)!="undefined"){for(e=0,b=d.length;e<b;e++){if(a.call(c,d[e],e,d)===false){return 0}}}else{for(e in d){if(d.hasOwnProperty(e)){if(a.call(c,d[e],e,d)===false){return 0}}}}return 1},getHash:function(c){var a=this.get(c),b;if(a){this.each(a.split("&"),function(d){d=d.split("=");b=b||{};b[d[0]]=d[1]})}return b},setHash:function(i,a,f,c,h,b){var g="";this.each(a,function(e,d){g+=(!g?"":"&")+d+"="+e});this.set(i,g,f,c,h,b)},get:function(h){var g=document.cookie,f,d=h+"=",a;if(!g){return}a=g.indexOf("; "+d);if(a==-1){a=g.indexOf(d);if(a!=0){return null}}else{a+=2}f=g.indexOf(";",a);if(f==-1){f=g.length}return decodeURIComponent(g.substring(a+d.length,f))},set:function(h,a,f,c,g,b){document.cookie=h+"="+encodeURIComponent(a)+((f)?"; expires="+f.toGMTString():"")+((c)?"; path="+c:"")+((g)?"; domain="+g:"")+((b)?"; secure":"")},remove:function(c,a){var b=new Date();b.setTime(b.getTime()-1000);this.set(c,"",b,a,b)}};function getUserSetting(a,b){var c=getAllUserSettings();if(c.hasOwnProperty(a)){return c[a]}if(typeof b!="undefined"){return b}return""}function setUserSetting(a,i,k){if("object"!==typeof userSettings){return false}var h="wp-settings-"+userSettings.uid,e=wpCookies.getHash(h)||{},g=new Date(),b,f=a.toString().replace(/[^A-Za-z0-9_]/,""),j=i.toString().replace(/[^A-Za-z0-9_]/,"");if(k){delete e[f]}else{e[f]=j}g.setTime(g.getTime()+31536000000);b=userSettings.url;wpCookies.setHash(h,e,g,b);wpCookies.set("wp-settings-time-"+userSettings.uid,userSettings.time,g,b);return a}function deleteUserSetting(a){return setUserSetting(a,"",1)}function getAllUserSettings(){if("object"!==typeof userSettings){return{}}return wpCookies.getHash("wp-settings-"+userSettings.uid)||{}};
\ No newline at end of file
ui.item.css({'marginLeft':'','width':''});
},
stop: function(e,ui) {
- if ( ui.item.hasClass('ui-draggable') )
+ if ( ui.item.hasClass('ui-draggable') && ui.item.data('draggable') )
ui.item.draggable('destroy');
if ( ui.item.hasClass('deleting') ) {
-var wpWidgets;(function(a){wpWidgets={init:function(){var c,b=a("div.widgets-sortables");a("#widgets-right").children(".widgets-holder-wrap").children(".sidebar-name").click(function(){var e=a(this).siblings(".widgets-sortables"),d=a(this).parent();if(!d.hasClass("closed")){e.sortable("disable");d.addClass("closed")}else{d.removeClass("closed");e.sortable("enable").sortable("refresh")}});a("#widgets-left").children(".widgets-holder-wrap").children(".sidebar-name").click(function(){a(this).siblings(".widget-holder").parent().toggleClass("closed")});b.not("#wp_inactive_widgets").each(function(){var e=50,d=a(this).children(".widget").length;e=e+parseInt(d*48,10);a(this).css("minHeight",e+"px")});a("a.widget-action").live("click",function(){var f={},g=a(this).closest("div.widget"),d=g.children(".widget-inside"),e=parseInt(g.find("input.widget-width").val(),10);if(d.is(":hidden")){if(e>250&&d.closest("div.widgets-sortables").length){f.width=e+30+"px";if(d.closest("div.widget-liquid-right").length){f.marginLeft=235-e+"px"}g.css(f)}wpWidgets.fixLabels(g);d.slideDown("fast")}else{d.slideUp("fast",function(){g.css({width:"",marginLeft:""})})}return false});a("input.widget-control-save").live("click",function(){wpWidgets.save(a(this).closest("div.widget"),0,1,0);return false});a("a.widget-control-remove").live("click",function(){wpWidgets.save(a(this).closest("div.widget"),1,1,0);return false});a("a.widget-control-close").live("click",function(){wpWidgets.close(a(this).closest("div.widget"));return false});b.children(".widget").each(function(){wpWidgets.appendTitle(this);if(a("p.widget-error",this).length){a("a.widget-action",this).click()}});a("#widget-list").children(".widget").draggable({connectToSortable:"div.widgets-sortables",handle:"> .widget-top > .widget-title",distance:2,helper:"clone",zIndex:5,containment:"document",start:function(f,d){wpWidgets.fixWebkit(1);d.helper.find("div.widget-description").hide()},stop:function(f,d){if(c){a(c).hide()}c="";wpWidgets.fixWebkit()}});b.sortable({placeholder:"widget-placeholder",items:"> .widget",handle:"> .widget-top > .widget-title",cursor:"move",distance:2,containment:"document",start:function(f,d){wpWidgets.fixWebkit(1);d.item.children(".widget-inside").hide();d.item.css({marginLeft:"",width:""})},stop:function(g,d){if(d.item.hasClass("ui-draggable")){d.item.draggable("destroy")}if(d.item.hasClass("deleting")){wpWidgets.save(d.item,1,0,1);d.item.remove();return}var f=d.item.find("input.add_new").val(),j=d.item.find("input.multi_number").val(),i=d.item.attr("id"),h=a(this).attr("id");d.item.css({marginLeft:"",width:""});wpWidgets.fixWebkit();if(f){if("multi"==f){d.item.html(d.item.html().replace(/<[^<>]+>/g,function(e){return e.replace(/__i__|%i%/g,j)}));d.item.attr("id",i.replace(/__i__|%i%/g,j));j++;a("div#"+i).find("input.multi_number").val(j)}else{if("single"==f){d.item.attr("id","new-"+i);c="div#"+i}}wpWidgets.save(d.item,0,0,1);d.item.find("input.add_new").val("");d.item.find("a.widget-action").click();return}wpWidgets.saveOrder(h)},receive:function(f,d){if(!a(this).is(":visible")){a(this).sortable("cancel")}}}).sortable("option","connectWith","div.widgets-sortables").parent().filter(".closed").children(".widgets-sortables").sortable("disable");a("#available-widgets").droppable({tolerance:"pointer",accept:function(d){return a(d).parent().attr("id")!="widget-list"},drop:function(f,d){d.draggable.addClass("deleting");a("#removing-widget").hide().children("span").html("")},over:function(f,d){d.draggable.addClass("deleting");a("div.widget-placeholder").hide();if(d.draggable.hasClass("ui-sortable-helper")){a("#removing-widget").show().children("span").html(d.draggable.find("div.widget-title").children("h4").html())}},out:function(f,d){d.draggable.removeClass("deleting");a("div.widget-placeholder").show();a("#removing-widget").hide().children("span").html("")}})},saveOrder:function(c){if(c){a("#"+c).closest("div.widgets-holder-wrap").find("img.ajax-feedback").css("visibility","visible")}var b={action:"widgets-order",savewidgets:a("#_wpnonce_widgets").val(),sidebars:[]};a("div.widgets-sortables").each(function(){b["sidebars["+a(this).attr("id")+"]"]=a(this).sortable("toArray").join(",")});a.post(ajaxurl,b,function(){a("img.ajax-feedback").css("visibility","hidden")});this.resize()},save:function(g,d,e,b){var h=g.closest("div.widgets-sortables").attr("id"),f=g.find("form").serialize(),c;g=a(g);a(".ajax-feedback",g).css("visibility","visible");c={action:"save-widget",savewidgets:a("#_wpnonce_widgets").val(),sidebar:h};if(d){c.delete_widget=1}f+="&"+a.param(c);a.post(ajaxurl,f,function(i){var j;if(d){if(!a("input.widget_number",g).val()){j=a("input.widget-id",g).val();a("#available-widgets").find("input.widget-id").each(function(){if(a(this).val()==j){a(this).closest("div.widget").show()}})}if(e){b=0;g.slideUp("fast",function(){a(this).remove();wpWidgets.saveOrder()})}else{g.remove();wpWidgets.resize()}}else{a(".ajax-feedback").css("visibility","hidden");if(i&&i.length>2){a("div.widget-content",g).html(i);wpWidgets.appendTitle(g);wpWidgets.fixLabels(g)}}if(b){wpWidgets.saveOrder()}})},appendTitle:function(b){var c=a('input[id*="-title"]',b);if(c=c.val()){c=c.replace(/<[^<>]+>/g,"").replace(/</g,"<").replace(/>/g,">");a(b).children(".widget-top").children(".widget-title").children().children(".in-widget-title").html(": "+c)}},resize:function(){a("div.widgets-sortables").not("#wp_inactive_widgets").each(function(){var c=50,b=a(this).children(".widget").length;c=c+parseInt(b*48,10);a(this).css("minHeight",c+"px")})},fixWebkit:function(b){b=b?"none":"";a("body").css({WebkitUserSelect:b,KhtmlUserSelect:b})},fixLabels:function(b){b.children(".widget-inside").find("label").each(function(){var c=a(this).attr("for");if(c&&c==a("input",this).attr("id")){a(this).removeAttr("for")}})},close:function(b){b.children(".widget-inside").slideUp("fast",function(){b.css({width:"",marginLeft:""})})}};a(document).ready(function(b){wpWidgets.init()})})(jQuery);
\ No newline at end of file
+var wpWidgets;(function(a){wpWidgets={init:function(){var c,b=a("div.widgets-sortables");a("#widgets-right").children(".widgets-holder-wrap").children(".sidebar-name").click(function(){var e=a(this).siblings(".widgets-sortables"),d=a(this).parent();if(!d.hasClass("closed")){e.sortable("disable");d.addClass("closed")}else{d.removeClass("closed");e.sortable("enable").sortable("refresh")}});a("#widgets-left").children(".widgets-holder-wrap").children(".sidebar-name").click(function(){a(this).siblings(".widget-holder").parent().toggleClass("closed")});b.not("#wp_inactive_widgets").each(function(){var e=50,d=a(this).children(".widget").length;e=e+parseInt(d*48,10);a(this).css("minHeight",e+"px")});a("a.widget-action").live("click",function(){var f={},g=a(this).closest("div.widget"),d=g.children(".widget-inside"),e=parseInt(g.find("input.widget-width").val(),10);if(d.is(":hidden")){if(e>250&&d.closest("div.widgets-sortables").length){f.width=e+30+"px";if(d.closest("div.widget-liquid-right").length){f.marginLeft=235-e+"px"}g.css(f)}wpWidgets.fixLabels(g);d.slideDown("fast")}else{d.slideUp("fast",function(){g.css({width:"",marginLeft:""})})}return false});a("input.widget-control-save").live("click",function(){wpWidgets.save(a(this).closest("div.widget"),0,1,0);return false});a("a.widget-control-remove").live("click",function(){wpWidgets.save(a(this).closest("div.widget"),1,1,0);return false});a("a.widget-control-close").live("click",function(){wpWidgets.close(a(this).closest("div.widget"));return false});b.children(".widget").each(function(){wpWidgets.appendTitle(this);if(a("p.widget-error",this).length){a("a.widget-action",this).click()}});a("#widget-list").children(".widget").draggable({connectToSortable:"div.widgets-sortables",handle:"> .widget-top > .widget-title",distance:2,helper:"clone",zIndex:5,containment:"document",start:function(f,d){wpWidgets.fixWebkit(1);d.helper.find("div.widget-description").hide()},stop:function(f,d){if(c){a(c).hide()}c="";wpWidgets.fixWebkit()}});b.sortable({placeholder:"widget-placeholder",items:"> .widget",handle:"> .widget-top > .widget-title",cursor:"move",distance:2,containment:"document",start:function(f,d){wpWidgets.fixWebkit(1);d.item.children(".widget-inside").hide();d.item.css({marginLeft:"",width:""})},stop:function(g,d){if(d.item.hasClass("ui-draggable")&&d.item.data("draggable")){d.item.draggable("destroy")}if(d.item.hasClass("deleting")){wpWidgets.save(d.item,1,0,1);d.item.remove();return}var f=d.item.find("input.add_new").val(),j=d.item.find("input.multi_number").val(),i=d.item.attr("id"),h=a(this).attr("id");d.item.css({marginLeft:"",width:""});wpWidgets.fixWebkit();if(f){if("multi"==f){d.item.html(d.item.html().replace(/<[^<>]+>/g,function(e){return e.replace(/__i__|%i%/g,j)}));d.item.attr("id",i.replace(/__i__|%i%/g,j));j++;a("div#"+i).find("input.multi_number").val(j)}else{if("single"==f){d.item.attr("id","new-"+i);c="div#"+i}}wpWidgets.save(d.item,0,0,1);d.item.find("input.add_new").val("");d.item.find("a.widget-action").click();return}wpWidgets.saveOrder(h)},receive:function(f,d){if(!a(this).is(":visible")){a(this).sortable("cancel")}}}).sortable("option","connectWith","div.widgets-sortables").parent().filter(".closed").children(".widgets-sortables").sortable("disable");a("#available-widgets").droppable({tolerance:"pointer",accept:function(d){return a(d).parent().attr("id")!="widget-list"},drop:function(f,d){d.draggable.addClass("deleting");a("#removing-widget").hide().children("span").html("")},over:function(f,d){d.draggable.addClass("deleting");a("div.widget-placeholder").hide();if(d.draggable.hasClass("ui-sortable-helper")){a("#removing-widget").show().children("span").html(d.draggable.find("div.widget-title").children("h4").html())}},out:function(f,d){d.draggable.removeClass("deleting");a("div.widget-placeholder").show();a("#removing-widget").hide().children("span").html("")}})},saveOrder:function(c){if(c){a("#"+c).closest("div.widgets-holder-wrap").find("img.ajax-feedback").css("visibility","visible")}var b={action:"widgets-order",savewidgets:a("#_wpnonce_widgets").val(),sidebars:[]};a("div.widgets-sortables").each(function(){b["sidebars["+a(this).attr("id")+"]"]=a(this).sortable("toArray").join(",")});a.post(ajaxurl,b,function(){a("img.ajax-feedback").css("visibility","hidden")});this.resize()},save:function(g,d,e,b){var h=g.closest("div.widgets-sortables").attr("id"),f=g.find("form").serialize(),c;g=a(g);a(".ajax-feedback",g).css("visibility","visible");c={action:"save-widget",savewidgets:a("#_wpnonce_widgets").val(),sidebar:h};if(d){c.delete_widget=1}f+="&"+a.param(c);a.post(ajaxurl,f,function(i){var j;if(d){if(!a("input.widget_number",g).val()){j=a("input.widget-id",g).val();a("#available-widgets").find("input.widget-id").each(function(){if(a(this).val()==j){a(this).closest("div.widget").show()}})}if(e){b=0;g.slideUp("fast",function(){a(this).remove();wpWidgets.saveOrder()})}else{g.remove();wpWidgets.resize()}}else{a(".ajax-feedback").css("visibility","hidden");if(i&&i.length>2){a("div.widget-content",g).html(i);wpWidgets.appendTitle(g);wpWidgets.fixLabels(g)}}if(b){wpWidgets.saveOrder()}})},appendTitle:function(b){var c=a('input[id*="-title"]',b);if(c=c.val()){c=c.replace(/<[^<>]+>/g,"").replace(/</g,"<").replace(/>/g,">");a(b).children(".widget-top").children(".widget-title").children().children(".in-widget-title").html(": "+c)}},resize:function(){a("div.widgets-sortables").not("#wp_inactive_widgets").each(function(){var c=50,b=a(this).children(".widget").length;c=c+parseInt(b*48,10);a(this).css("minHeight",c+"px")})},fixWebkit:function(b){b=b?"none":"";a("body").css({WebkitUserSelect:b,KhtmlUserSelect:b})},fixLabels:function(b){b.children(".widget-inside").find("label").each(function(){var c=a(this).attr("for");if(c&&c==a("input",this).attr("id")){a(this).removeAttr("for")}})},close:function(b){b.children(".widget-inside").slideUp("fast",function(){b.css({width:"",marginLeft:""})})}};a(document).ready(function(b){wpWidgets.init()})})(jQuery);
\ No newline at end of file
+++ /dev/null
-<?php
-/**
- * Manage link category administration actions.
- *
- * This page is accessed by the link management pages and handles the forms and
- * AJAX processes for category actions.
- *
- * @package WordPress
- * @subpackage Administration
- */
-
-/** Load WordPress Administration Bootstrap */
-require_once('./admin.php');
-
-wp_reset_vars(array('action', 'cat'));
-
-switch($action) {
-
-case 'addcat':
-
- check_admin_referer('add-link-category');
-
- if ( !current_user_can('manage_categories') )
- wp_die(__('Cheatin’ uh?'));
-
- if ( wp_insert_term($_POST['name'], 'link_category', $_POST ) ) {
- wp_redirect('edit-link-categories.php?message=1#addcat');
- } else {
- wp_redirect('edit-link-categories.php?message=4#addcat');
- }
- exit;
-break;
-
-case 'delete':
- $cat_ID = (int) $_GET['cat_ID'];
- check_admin_referer('delete-link-category_' . $cat_ID);
-
- if ( !current_user_can('manage_categories') )
- wp_die(__('Cheatin’ uh?'));
-
- $cat_name = get_term_field('name', $cat_ID, 'link_category');
- $default_cat_id = get_option('default_link_category');
-
- // Don't delete the default cats.
- if ( $cat_ID == $default_cat_id )
- wp_die(sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
-
- wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
-
- $location = 'edit-link-categories.php';
- if ( $referer = wp_get_original_referer() ) {
- if ( false !== strpos($referer, 'edit-link-categories.php') )
- $location = $referer;
- }
-
- $location = add_query_arg('message', 2, $location);
-
- wp_redirect($location);
- exit;
-
-break;
-
-case 'edit':
- $title = __('Edit Category');
- $parent_file = 'link-manager.php';
- $submenu_file = 'edit-link-categories.php';
- require_once ('admin-header.php');
- $cat_ID = (int) $_GET['cat_ID'];
- $category = get_term_to_edit($cat_ID, 'link_category');
- include('./edit-link-category-form.php');
- include('./admin-footer.php');
- exit;
-break;
-
-case 'editedcat':
- $cat_ID = (int) $_POST['cat_ID'];
- check_admin_referer('update-link-category_' . $cat_ID);
-
- if ( !current_user_can('manage_categories') )
- wp_die(__('Cheatin’ uh?'));
-
- $location = 'edit-link-categories.php';
- if ( $referer = wp_get_original_referer() ) {
- if ( false !== strpos($referer, 'edit-link-categories.php') )
- $location = $referer;
- }
-
- $update = wp_update_term($cat_ID, 'link_category', $_POST);
-
- if ( $update && !is_wp_error($update) )
- $location = add_query_arg('message', 3, $location);
- else
- $location = add_query_arg('message', 5, $location);
-
- wp_redirect($location);
- exit;
-break;
-}
-
-?>
/** Load WordPress Administration Bootstrap */
require_once ('admin.php');
+if ( ! current_user_can( 'manage_links' ) )
+ wp_die( __( 'You do not have sufficient permissions to edit the links for this site.' ) );
+
+$wp_list_table = _get_list_table('WP_Links_List_Table');
// Handle bulk deletes
-if ( isset($_GET['action']) && isset($_GET['linkcheck']) ) {
- check_admin_referer('bulk-bookmarks');
- $doaction = $_GET['action'] ? $_GET['action'] : $_GET['action2'];
+$doaction = $wp_list_table->current_action();
- if ( ! current_user_can('manage_links') )
- wp_die( __('You do not have sufficient permissions to edit the links for this site.') );
+if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) {
+ check_admin_referer( 'bulk-bookmarks' );
if ( 'delete' == $doaction ) {
- $bulklinks = (array) $_GET['linkcheck'];
+ $bulklinks = (array) $_REQUEST['linkcheck'];
foreach ( $bulklinks as $link_id ) {
$link_id = (int) $link_id;
- wp_delete_link($link_id);
+ wp_delete_link( $link_id );
}
- wp_safe_redirect( wp_get_referer() );
+ wp_redirect( add_query_arg('deleted', count( $bulklinks ), admin_url( 'link-manager.php' ) ) );
exit;
}
-} elseif ( ! empty($_GET['_wp_http_referer']) ) {
- wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
+} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
+ wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
exit;
}
-wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]'));
-
-if ( empty($cat_id) )
- $cat_id = 'all';
-
-if ( empty($order_by) )
- $order_by = 'order_name';
+$wp_list_table->prepare_items();
$title = __('Links');
$this_file = $parent_file = 'link-manager.php';
'<p>' . __('You can customize the display of this screen using the Screen Options tab and/or the dropdown filters above the links table.') . '</p>' .
'<p>' . __('If you delete a link, it will be removed permanently, as Links do not have a Trash function yet.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Links_Edit_SubPanel" target="_blank">Link Management Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Links_Links_SubPanel" target="_blank">Documentation on Managing Links</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
if ( ! current_user_can('manage_links') )
wp_die(__("You do not have sufficient permissions to edit the links for this site."));
-switch ($order_by) {
- case 'order_id' :
- $sqlorderby = 'id';
- break;
- case 'order_url' :
- $sqlorderby = 'url';
- break;
- case 'order_desc' :
- $sqlorderby = 'description';
- break;
- case 'order_owner' :
- $sqlorderby = 'owner';
- break;
- case 'order_rating' :
- $sqlorderby = 'rating';
- break;
- case 'order_name' :
- default :
- $sqlorderby = 'name';
- break;
-} ?>
+?>
<div class="wrap nosubsub">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?> <a href="link-add.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'link'); ?></a> <?php
-if ( !empty($_GET['s']) )
- printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_GET['s']) ) ); ?>
+if ( !empty($_REQUEST['s']) )
+ printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_REQUEST['s']) ) ); ?>
</h2>
<?php
-if ( isset($_GET['deleted']) ) {
+if ( isset($_REQUEST['deleted']) ) {
echo '<div id="message" class="updated"><p>';
- $deleted = (int) $_GET['deleted'];
+ $deleted = (int) $_REQUEST['deleted'];
printf(_n('%s link deleted.', '%s links deleted', $deleted), $deleted);
echo '</p></div>';
$_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']);
}
?>
-<form class="search-form" action="" method="get">
-<p class="search-box">
- <label class="screen-reader-text" for="link-search-input"><?php _e( 'Search Links' ); ?>:</label>
- <input type="text" id="link-search-input" name="s" value="<?php _admin_search_query(); ?>" />
- <input type="submit" value="<?php esc_attr_e( 'Search Links' ); ?>" class="button" />
-</p>
-</form>
-<br class="clear" />
-
<form id="posts-filter" action="" method="get">
-<div class="tablenav">
-
-<?php
-if ( 'all' == $cat_id )
- $cat_id = '';
-$args = array( 'category' => $cat_id, 'hide_invisible' => 0, 'orderby' => $sqlorderby, 'hide_empty' => 0 );
-if ( ! empty( $_GET['s'] ) )
- $args['search'] = $_GET['s'];
-$links = get_bookmarks( $args );
-if ( $links ) {
-?>
-
-<div class="alignleft actions">
-<select name="action">
-<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
-
-<?php
-$categories = get_terms('link_category', array("hide_empty" => 1));
-$select_cat = "<select name=\"cat_id\">\n";
-$select_cat .= '<option value="all"' . (($cat_id == 'all') ? " selected='selected'" : '') . '>' . __('View all Categories') . "</option>\n";
-foreach ((array) $categories as $cat)
- $select_cat .= '<option value="' . esc_attr($cat->term_id) . '"' . (($cat->term_id == $cat_id) ? " selected='selected'" : '') . '>' . sanitize_term_field('name', $cat->name, $cat->term_id, 'link_category', 'display') . "</option>\n";
-$select_cat .= "</select>\n";
-
-$select_order = "<select name=\"order_by\">\n";
-$select_order .= '<option value="order_id"' . (($order_by == 'order_id') ? " selected='selected'" : '') . '>' . __('Order by Link ID') . "</option>\n";
-$select_order .= '<option value="order_name"' . (($order_by == 'order_name') ? " selected='selected'" : '') . '>' . __('Order by Name') . "</option>\n";
-$select_order .= '<option value="order_url"' . (($order_by == 'order_url') ? " selected='selected'" : '') . '>' . __('Order by Address') . "</option>\n";
-$select_order .= '<option value="order_rating"' . (($order_by == 'order_rating') ? " selected='selected'" : '') . '>' . __('Order by Rating') . "</option>\n";
-$select_order .= "</select>\n";
-
-echo $select_cat;
-echo $select_order;
-
-?>
-<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
-
-</div>
-
-<br class="clear" />
-</div>
-
-<div class="clear"></div>
-
-<?php
- $link_columns = get_column_headers('link-manager');
- $hidden = get_hidden_columns('link-manager');
-?>
-
-<?php wp_nonce_field('bulk-bookmarks') ?>
-<table class="widefat fixed" cellspacing="0">
- <thead>
- <tr>
-<?php print_column_headers('link-manager'); ?>
- </tr>
- </thead>
-
- <tfoot>
- <tr>
-<?php print_column_headers('link-manager', false); ?>
- </tr>
- </tfoot>
-
- <tbody>
-<?php
- $alt = 0;
-
- foreach ($links as $link) {
- $link = sanitize_bookmark($link);
- $link->link_name = esc_attr($link->link_name);
- $link->link_category = wp_get_link_cats($link->link_id);
- $short_url = str_replace('http://', '', $link->link_url);
- $short_url = preg_replace('/^www\./i', '', $short_url);
- if ('/' == substr($short_url, -1))
- $short_url = substr($short_url, 0, -1);
- if (strlen($short_url) > 35)
- $short_url = substr($short_url, 0, 32).'...';
- $visible = ($link->link_visible == 'Y') ? __('Yes') : __('No');
- $rating = $link->link_rating;
- $style = ($alt % 2) ? '' : ' class="alternate"';
- ++ $alt;
- $edit_link = get_edit_bookmark_link();
- ?><tr id="link-<?php echo $link->link_id; ?>" valign="middle" <?php echo $style; ?>><?php
- foreach($link_columns as $column_name=>$column_display_name) {
- $class = "class=\"column-$column_name\"";
-
- $style = '';
- if ( in_array($column_name, $hidden) )
- $style = ' style="display:none;"';
-
- $attributes = "$class$style";
-
- switch($column_name) {
- case 'cb':
- echo '<th scope="row" class="check-column"><input type="checkbox" name="linkcheck[]" value="'. esc_attr($link->link_id) .'" /></th>';
- break;
- case 'name':
-
- echo "<td $attributes><strong><a class='row-title' href='$edit_link' title='" . esc_attr(sprintf(__('Edit “%s”'), $link->link_name)) . "'>$link->link_name</a></strong><br />";
- $actions = array();
- $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
- $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id) . "' onclick=\"if ( confirm('" . esc_js(sprintf( __("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
- $action_count = count($actions);
- $i = 0;
- echo '<div class="row-actions">';
- foreach ( $actions as $action => $linkaction ) {
- ++$i;
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
- echo "<span class='$action'>$linkaction$sep</span>";
- }
- echo '</div>';
- echo '</td>';
- break;
- case 'url':
- echo "<td $attributes><a href='$link->link_url' title='".sprintf(__('Visit %s'), $link->link_name)."'>$short_url</a></td>";
- break;
- case 'categories':
- ?><td <?php echo $attributes ?>><?php
- $cat_names = array();
- foreach ($link->link_category as $category) {
- $cat = get_term($category, 'link_category', OBJECT, 'display');
- if ( is_wp_error( $cat ) )
- echo $cat->get_error_message();
- $cat_name = $cat->name;
- if ( $cat_id != $category )
- $cat_name = "<a href='link-manager.php?cat_id=$category'>$cat_name</a>";
- $cat_names[] = $cat_name;
- }
- echo implode(', ', $cat_names);
- ?></td><?php
- break;
- case 'rel':
- ?><td <?php echo $attributes ?>><?php echo empty($link->link_rel) ? '<br />' : $link->link_rel; ?></td><?php
- break;
- case 'visible':
- ?><td <?php echo $attributes ?>><?php echo $visible; ?></td><?php
- break;
- case 'rating':
- ?><td <?php echo $attributes ?>><?php echo $rating; ?></td><?php
- break;
- default:
- ?>
- <td <?php echo $attributes ?>><?php do_action('manage_link_custom_column', $column_name, $link->link_id); ?></td>
- <?php
- break;
- }
- }
- echo "\n </tr>\n";
- }
-?>
- </tbody>
-</table>
-
-<div class="tablenav">
-
-<div class="alignleft actions">
-<select name="action2">
-<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<option value="delete"><?php _e('Delete'); ?></option>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
-</div>
+<?php $wp_list_table->search_box( __( 'Search Links' ), 'link' ); ?>
-<?php } else { ?>
-<p><?php _e( 'No links found.' ) ?></p>
-<?php } ?>
-
-<br class="clear" />
-</div>
-
-</form>
+<?php $wp_list_table->display(); ?>
<div id="ajax-response"></div>
+</form>
</div>
/**
* XML callback function for the start of a new XML tag.
*
- * @since unknown
+ * @since 0.71
* @access private
*
* @uses $updated_timestamp Not used inside function.
/**
* XML callback function that is called at the end of a XML tag.
*
- * @since unknown
+ * @since 0.71
* @access private
* @package WordPress
* @subpackage Dummy
if ( !empty($_POST['linkcheck']) )
$linkcheck = $_POST['linkcheck'];
-$this_file = 'link-manager.php';
+$this_file = admin_url('link-manager.php');
switch ($action) {
case 'deletebookmarks' :
$problem_output = array();
foreach ( $problems as $table => $problem )
$problem_output[] = "$table: $problem";
- echo '<textarea name="errors" id="errors" rows="20" cols="60">' . format_to_edit(implode("\n", $problem_output)) . '</textarea>';
+ echo '<textarea name="errors" id="errors" rows="20" cols="60">' . esc_textarea( implode("\n", $problem_output) ) . '</textarea>';
} else {
echo '<p>'.__('Repairs complete. Please remove the following line from wp-config.php to prevent this page from being used by unauthorized users.')."</p><code>define('WP_ALLOW_REPAIR', true);</code>";
}
} else {
if ( isset($_GET['referrer']) && 'is_blog_installed' == $_GET['referrer'] )
- _e('One or more database tables is unavailable. To allow WordPress to attempt to repair these tables, press the "Repair Database" button. Repairing can take awhile, so please be patient.');
+ _e('One or more database tables are unavailable. To allow WordPress to attempt to repair these tables, press the “Repair Database” button. Repairing can take a while, so please be patient.');
else
- _e('WordPress can automatically look for some common database problems and repair them. Repairing can take awhile, so please be patient.')
+ _e('WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.')
?>
<p class="step"><a class="button" href="<?php echo wp_nonce_url('repair.php?repair=1', 'repair_db') ?>"><?php _e( 'Repair Database' ); ?></a></p>
<?php _e('WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing.'); ?>
* @subpackage Administration
*/
+if ( ! isset( $_GET['inline'] ) )
+ define( 'IFRAME_REQUEST' , true );
+
/** Load WordPress Administration Bootstrap */
require_once('./admin.php');
$errors = array();
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
- check_admin_referer('media-form');
// Upload File button was clicked
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
unset($_FILES);
$location .= '?message=3';
wp_redirect( admin_url($location) );
+ exit;
}
$title = __('Upload New Media');
<input type="hidden" name="post_id" id="post_id" value="0" />
<?php wp_nonce_field('media-form'); ?>
<div id="media-items" class="hide-if-no-js"> </div>
- <p>
- <input type="submit" class="button savebutton hide-if-no-js" name="save" value="<?php esc_attr_e( 'Save all changes' ); ?>" />
- </p>
+ <?php submit_button( __( 'Save all changes' ), 'button savebutton hide-if-no-js', 'save' ); ?>
</form>
</div>
$errors = null;
if ( empty( $_GET['attachment_id'] ) ) {
- wp_redirect('upload.php');
+ wp_redirect( admin_url('upload.php') );
exit();
}
$att_id = (int) $_GET['attachment_id'];
wp_enqueue_script('image-edit');
wp_enqueue_style('imgareaselect');
+ add_contextual_help( $current_screen,
+ '<p>' . __('This screen allows you to edit five fields for metadata in a file within the media library.') . '</p>' .
+ '<p>' . __('For images only, you can click on Edit Image under the thumbnail to expand out an inline image editor with icons for cropping, rotating, or flipping the image as well as for undoing and redoing. The boxes on the right give you more options for scaling the image, for cropping it, and for cropping the thumbnail in a different way than you crop the original image. You can click on Help in those boxes to get more information.') . '</p>' .
+ '<p>' . __('Note that you crop the image by clicking on it (the Crop icon is already selected) and dragging the cropping frame to select the desired part. Then click Save to retain the cropping.') . '</p>' .
+ '<p>' . __('Remember to click Update Media to save metadata entered or changed.') . '</p>' .
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Media_Add_New_SubPanel#Edit_Media" target="_blank">Documentation on Edit Media</a>') . '</p>' .
+ '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+);
+
require( './admin-header.php' );
$parent_file = 'upload.php';
<form method="post" action="" class="media-upload-form" id="media-single-form">
<p class="submit" style="padding-bottom: 0;">
-<input type="submit" class="button-primary" name="save" value="<?php esc_attr_e('Update Media'); ?>" />
+<?php submit_button( __( 'Update Media' ), 'primary', 'save', false ); ?>
</p>
<div class="media-single">
<div id='media-item-<?php echo $att_id; ?>' class='media-item'>
-<?php echo get_media_item( $att_id, array( 'toggle' => false, 'send' => false, 'delete' => false, 'show_title' => false, 'errors' => $errors ) ); ?>
+<?php echo get_media_item( $att_id, array( 'toggle' => false, 'send' => false, 'delete' => false, 'show_title' => false, 'errors' => !empty($errors[$att_id]) ? $errors[$att_id] : null ) ); ?>
</div>
</div>
-<p class="submit">
-<input type="submit" class="button-primary" name="save" value="<?php esc_attr_e('Update Media'); ?>" />
+<?php submit_button( __( 'Update Media' ), 'primary', 'save' ); ?>
<input type="hidden" name="post_id" id="post_id" value="<?php echo isset($post_id) ? esc_attr($post_id) : ''; ?>" />
<input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo esc_attr($att_id); ?>" />
<input type="hidden" name="action" value="editattachment" />
<?php wp_original_referer_field(true, 'previous'); ?>
<?php wp_nonce_field('media-form'); ?>
-</p>
+
</form>
</div>
exit;
default:
- wp_redirect( 'upload.php' );
+ wp_redirect( admin_url('upload.php') );
exit;
endswitch;
* @name $self
* @var string
*/
-$self = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
+$self = preg_replace('|^.*/wp-admin/network/|i', '', $_SERVER['PHP_SELF']);
+$self = preg_replace('|^.*/wp-admin/|i', '', $self);
$self = preg_replace('|^.*/plugins/|i', '', $self);
$self = preg_replace('|^.*/mu-plugins/|i', '', $self);
if ( !empty($submenu[$item[2]]) )
$class[] = 'wp-has-submenu';
- if ( ( $parent_file && $item[2] == $parent_file ) || ( false === strpos($parent_file, '?') && $self == $item[2] ) ) {
+ if ( ( $parent_file && $item[2] == $parent_file ) || ( empty($typenow) && $self == $item[2] ) ) {
if ( !empty($submenu[$item[2]]) )
$class[] = 'wp-has-current-submenu wp-menu-open';
else
* @var array
*/
-$awaiting_mod = wp_count_comments();
-$awaiting_mod = $awaiting_mod->moderated;
-
-if ( is_multisite() && is_super_admin() ) {
- /* translators: Network menu item */
- $menu[0] = array(__('Super Admin'), 'manage_network', 'ms-admin.php', '', 'menu-top menu-top-first menu-icon-site', 'menu-site', 'div');
- $submenu[ 'ms-admin.php' ][1] = array( __('Admin'), 'manage_network', 'ms-admin.php' );
- /* translators: Sites menu item */
- $submenu[ 'ms-admin.php' ][5] = array( __('Sites'), 'manage_sites', 'ms-sites.php' );
- $submenu[ 'ms-admin.php' ][10] = array( __('Users'), 'manage_network_users', 'ms-users.php' );
- $submenu[ 'ms-admin.php' ][20] = array( __('Themes'), 'manage_network_themes', 'ms-themes.php' );
- $submenu[ 'ms-admin.php' ][25] = array( __('Options'), 'manage_network_options', 'ms-options.php' );
- $submenu[ 'ms-admin.php' ][30] = array( __('Update'), 'manage_network', 'ms-upgrade-network.php' );
+$menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div' );
- $menu[1] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
+$submenu[ 'index.php' ][0] = array( __('Dashboard'), 'read', 'index.php' );
- $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-icon-dashboard', 'menu-dashboard', 'div' );
-} else {
- $menu[2] = array( __('Dashboard'), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div' );
+if ( is_multisite() ) {
+ $submenu[ 'index.php' ][5] = array( __('My Sites'), 'read', 'my-sites.php' );
}
-if ( is_multisite() || is_super_admin() ) {
- $submenu[ 'index.php' ][0] = array( __('Dashboard'), 'read', 'index.php' );
+if ( ! is_multisite() || is_super_admin() ) {
+ $plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
+ $update_plugins = get_site_transient( 'update_plugins' );
+ if ( !empty($update_plugins->response) )
+ $plugin_update_count = count( $update_plugins->response );
+ $update_themes = get_site_transient( 'update_themes' );
+ if ( !empty($update_themes->response) )
+ $theme_update_count = count( $update_themes->response );
+ $update_wordpress = get_core_updates( array('dismissed' => false) );
+ if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
+ $wordpress_update_count = 1;
- if ( is_multisite() )
- $submenu[ 'index.php' ][5] = array( __('My Sites'), 'read', 'my-sites.php' );
-
- if ( is_super_admin() ) {
- $plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
- $update_plugins = get_site_transient( 'update_plugins' );
- if ( !empty($update_plugins->response) )
- $plugin_update_count = count( $update_plugins->response );
- $update_themes = get_site_transient( 'update_themes' );
- if ( !empty($update_themes->response) )
- $theme_update_count = count( $update_themes->response );
- $update_wordpress = get_core_updates( array('dismissed' => false) );
- if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
- $wordpress_update_count = 1;
-
- $update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
- $update_title = array();
- if ( $wordpress_update_count )
- $update_title[] = sprintf(__('%d WordPress Update'), $wordpress_update_count);
- if ( $plugin_update_count )
- $update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $plugin_update_count), $plugin_update_count);
- if ( $theme_update_count )
- $update_title[] = sprintf(_n('%d Theme Update', '%d Themes Updates', $theme_update_count), $theme_update_count);
-
- $update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : '';
-
- $submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'install_plugins', 'update-core.php');
- unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title);
- }
+ $total_update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
+ $update_title = array();
+ if ( $wordpress_update_count )
+ $update_title[] = sprintf(__('%d WordPress Update'), $wordpress_update_count);
+ if ( $plugin_update_count )
+ $update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $plugin_update_count), $plugin_update_count);
+ if ( $theme_update_count )
+ $update_title[] = sprintf(_n('%d Theme Update', '%d Themes Updates', $theme_update_count), $theme_update_count);
+
+ $update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : '';
+}
+
+if ( ! is_multisite() ) {
+ $submenu[ 'index.php' ][10] = array( sprintf( __('Updates %s'), "<span class='update-plugins count-$total_update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($total_update_count) . "</span></span>" ), 'update_core', 'update-core.php');
}
+unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_themes, $update_plugins, $update_wordpress);
+
$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
$menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top menu-icon-post', 'menu-posts', 'div' );
$submenu['edit.php'][10] = array( _x('Add New', 'post'), 'edit_posts', 'post-new.php' );
$i = 15;
- foreach ( $wp_taxonomies as $tax ) {
+ foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
if ( ! $tax->show_ui || ! in_array('post', (array) $tax->object_type, true) )
continue;
- $submenu['edit.php'][$i++] = array( esc_attr( $tax->labels->name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name );
+ $submenu['edit.php'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name );
}
unset($tax);
$submenu['link-manager.php'][5] = array( __('Links'), 'manage_links', 'link-manager.php' );
/* translators: add new links */
$submenu['link-manager.php'][10] = array( _x('Add New', 'link'), 'manage_links', 'link-add.php' );
- $submenu['link-manager.php'][15] = array( __('Link Categories'), 'manage_categories', 'edit-link-categories.php' );
+ $submenu['link-manager.php'][15] = array( __('Link Categories'), 'manage_categories', 'edit-tags.php?taxonomy=link_category' );
$menu[20] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'menu-top menu-icon-page', 'menu-pages', 'div' );
$submenu['edit.php?post_type=page'][5] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page' );
/* translators: add new page */
$submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), 'edit_pages', 'post-new.php?post_type=page' );
$i = 15;
- foreach ( $wp_taxonomies as $tax ) {
+ foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
if ( ! $tax->show_ui || ! in_array('page', (array) $tax->object_type, true) )
continue;
- $submenu['edit.php?post_type=page'][$i++] = array( esc_attr( $tax->labels->name ), $tax->cap->manage_terms, 'edit-tags.php?post_type=page&taxonomy=' . $tax->name );
+ $submenu['edit.php?post_type=page'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&post_type=page' );
}
unset($tax);
+$awaiting_mod = wp_count_comments();
+$awaiting_mod = $awaiting_mod->moderated;
$menu[25] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top menu-icon-comments', 'menu-comments', 'div' );
+unset($awaiting_mod);
$_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group
-foreach ( (array) get_post_types( array('show_ui' => true, '_builtin' => false) ) as $ptype ) {
+foreach ( (array) get_post_types( array('show_ui' => true, '_builtin' => false, 'show_in_menu' => true ) ) as $ptype ) {
$ptype_obj = get_post_type_object( $ptype );
- $ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : $_wp_last_object_menu++; // If we're to use $_wp_last_object_menu, increment it first.
+ // Check if it should be a submenu.
+ if ( $ptype_obj->show_in_menu !== true )
+ continue;
+ $ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : ++$_wp_last_object_menu; // If we're to use $_wp_last_object_menu, increment it first.
$ptype_for_id = sanitize_html_class( $ptype );
if ( is_string( $ptype_obj->menu_icon ) ) {
$menu_icon = esc_url( $ptype_obj->menu_icon );
while ( isset($menu[$ptype_menu_position]) || in_array($ptype_menu_position, $core_menu_positions) )
$ptype_menu_position++;
- $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->name ), $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-posts-' . $ptype_for_id, $menu_icon );
- $submenu["edit.php?post_type=$ptype"][5] = array( $ptype_obj->labels->name, $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype");
+ $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-posts-' . $ptype_for_id, $menu_icon );
+ $submenu["edit.php?post_type=$ptype"][5] = array( $ptype_obj->labels->menu_name, $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype");
$submenu["edit.php?post_type=$ptype"][10] = array( $ptype_obj->labels->add_new, $ptype_obj->cap->edit_posts, "post-new.php?post_type=$ptype" );
$i = 15;
- foreach ( $wp_taxonomies as $tax ) {
+ foreach ( get_taxonomies( array(), 'objects' ) as $tax ) {
if ( ! $tax->show_ui || ! in_array($ptype, (array) $tax->object_type, true) )
continue;
- $submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr( $tax->labels->name ), $tax->cap->manage_terms, "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" );
+ $submenu["edit.php?post_type=$ptype"][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, "edit-tags.php?taxonomy=$tax->name&post_type=$ptype" );
}
}
-unset($ptype, $ptype_obj);
+unset($ptype, $ptype_obj, $ptype_class, $ptype_for_id, $ptype_menu_position, $menu_icon, $i, $tax);
$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );
}
// Add 'Editor' to the bottom of the Appearence menu.
-add_action('admin_menu', '_add_themes_utility_last', 101);
+if ( ! is_multisite() )
+ add_action('admin_menu', '_add_themes_utility_last', 101);
function _add_themes_utility_last() {
// Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook
add_submenu_page('themes.php', _x('Editor', 'theme editor'), _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php');
$update_count = count( $update_plugins->response );
$menu_perms = get_site_option('menu_items', array());
-if ( is_super_admin() || ( is_multisite() && isset($menu_perms['plugins']) && $menu_perms['plugins'] ) ) {
- $menu[65] = array( sprintf( __('Plugins %s'), "<span class='update-plugins count-$update_count'><span class='plugin-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div' );
- $submenu['plugins.php'][5] = array( __('Plugins'), 'activate_plugins', 'plugins.php' );
- /* translators: add new plugin */
- $submenu['plugins.php'][10] = array(_x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php');
- $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
+if ( ! is_multisite() || is_super_admin() || ! empty( $menu_perms['plugins'] ) ) {
+ $count = "<span class='update-plugins count-$update_count'><span class='plugin-count'>" . number_format_i18n($update_count) . "</span></span>";
+ if ( is_multisite() )
+ $count = '';
+ $menu[65] = array( sprintf( __('Plugins %s'), $count ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div' );
+ if ( ! is_multisite() ) {
+ /* translators: add new plugin */
+ $submenu['plugins.php'][5] = array( __('Plugins'), 'activate_plugins', 'plugins.php' );
+ $submenu['plugins.php'][10] = array( _x('Add New', 'plugin'), 'install_plugins', 'plugin-install.php' );
+ $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
+ }
}
unset($menu_perms, $update_plugins, $update_count);
if ( current_user_can('list_users') ) {
$_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.
$submenu['users.php'][5] = array(__('Users'), 'list_users', 'users.php');
- $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php');
+ if ( current_user_can('create_users') )
+ $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php');
+ else
+ $submenu['users.php'][10] = array(_x('Add New', 'user'), 'promote_users', 'user-new.php');
$submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php');
} else {
$_wp_real_parent_file['users.php'] = 'profile.php';
$submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php');
- $submenu['profile.php'][10] = array(__('Add New User'), 'create_users', 'user-new.php');
+ if ( current_user_can('create_users') )
+ $submenu['profile.php'][10] = array(__('Add New User'), 'create_users', 'user-new.php');
+ else
+ $submenu['profile.php'][10] = array(__('Add New User'), 'promote_users', 'user-new.php');
}
$menu[75] = array( __('Tools'), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'div' );
$submenu['tools.php'][15] = array( __('Export'), 'import', 'export.php' );
if ( is_multisite() && !is_main_site() )
$submenu['tools.php'][25] = array( __('Delete Site'), 'manage_options', 'ms-delete-site.php' );
- if ( ( ! is_multisite() || defined( 'MULTISITE' ) ) && defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE && is_super_admin() )
+ if ( ! is_multisite() && defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE )
$submenu['tools.php'][50] = array(__('Network'), 'manage_options', 'network.php');
$menu[80] = array( __('Settings'), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div' );
$_wp_real_parent_file['post-new.php'] = 'edit.php';
$_wp_real_parent_file['edit-pages.php'] = 'edit.php?post_type=page';
$_wp_real_parent_file['page-new.php'] = 'edit.php?post_type=page';
-$_wp_real_parent_file['wpmu-admin.php'] = 'ms-admin.php';
-
-do_action('_admin_menu');
-
-// Create list of page plugin hook names.
-foreach ($menu as $menu_page) {
- if ( false !== $pos = strpos($menu_page[2], '?') ) {
- // Handle post_type=post|page|foo pages.
- $hook_name = substr($menu_page[2], 0, $pos);
- $hook_args = substr($menu_page[2], $pos + 1);
- wp_parse_str($hook_args, $hook_args);
- // Set the hook name to be the post type.
- if ( isset($hook_args['post_type']) )
- $hook_name = $hook_args['post_type'];
- else
- $hook_name = basename($hook_name, '.php');
- unset($hook_args);
- } else {
- $hook_name = basename($menu_page[2], '.php');
- }
- $hook_name = sanitize_title($hook_name);
-
- // ensure we're backwards compatible
- $compat = array(
- 'index' => 'dashboard',
- 'edit' => 'posts',
- 'post' => 'posts',
- 'upload' => 'media',
- 'link-manager' => 'links',
- 'edit-pages' => 'pages',
- 'page' => 'pages',
- 'edit-comments' => 'comments',
- 'options-general' => 'settings',
- 'themes' => 'appearance',
- );
-
- if ( isset($compat[$hook_name]) )
- $hook_name = $compat[$hook_name];
- elseif ( !$hook_name )
- continue;
-
- $admin_page_hooks[$menu_page[2]] = $hook_name;
-}
-unset($menu_page);
-
-$_wp_submenu_nopriv = array();
-$_wp_menu_nopriv = array();
-// Loop over submenus and remove pages for which the user does not have privs.
-foreach ( array( 'submenu' ) as $sub_loop ) {
- foreach ($$sub_loop as $parent => $sub) {
- foreach ($sub as $index => $data) {
- if ( ! current_user_can($data[1]) ) {
- unset(${$sub_loop}[$parent][$index]);
- $_wp_submenu_nopriv[$parent][$data[2]] = true;
- }
- }
- unset($index, $data);
-
- if ( empty(${$sub_loop}[$parent]) )
- unset(${$sub_loop}[$parent]);
- }
- unset($sub, $parent);
-}
-unset($sub_loop);
-
-// Loop over the top-level menu.
-// Menus for which the original parent is not accessible due to lack of privs will have the next
-// submenu in line be assigned as the new menu parent.
-foreach ( $menu as $id => $data ) {
- if ( empty($submenu[$data[2]]) )
- continue;
- $subs = $submenu[$data[2]];
- $first_sub = array_shift($subs);
- $old_parent = $data[2];
- $new_parent = $first_sub[2];
- // If the first submenu is not the same as the assigned parent,
- // make the first submenu the new parent.
- if ( $new_parent != $old_parent ) {
- $_wp_real_parent_file[$old_parent] = $new_parent;
- $menu[$id][2] = $new_parent;
-
- foreach ($submenu[$old_parent] as $index => $data) {
- $submenu[$new_parent][$index] = $submenu[$old_parent][$index];
- unset($submenu[$old_parent][$index]);
- }
- unset($submenu[$old_parent], $index);
-
- if ( isset($_wp_submenu_nopriv[$old_parent]) )
- $_wp_submenu_nopriv[$new_parent] = $_wp_submenu_nopriv[$old_parent];
- }
-}
-unset($id, $data, $subs, $first_sub, $old_parent, $new_parent);
-
-do_action('admin_menu', '');
-
-// Remove menus that have no accessible submenus and require privs that the user does not have.
-// Run re-parent loop again.
-foreach ( $menu as $id => $data ) {
- if ( ! current_user_can($data[1]) )
- $_wp_menu_nopriv[$data[2]] = true;
-
- // If submenu is empty...
- if ( empty($submenu[$data[2]]) ) {
- // And user doesn't have privs, remove menu.
- if ( isset( $_wp_menu_nopriv[$data[2]] ) ) {
- unset($menu[$id]);
- }
- }
-}
-unset($id, $data);
-
-// Remove any duplicated seperators
-$seperator_found = false;
-foreach ( $menu as $id => $data ) {
- if ( 0 == strcmp('wp-menu-separator', $data[4] ) ) {
- if (false == $seperator_found) {
- $seperator_found = true;
- } else {
- unset($menu[$id]);
- $seperator_found = false;
- }
- } else {
- $seperator_found = false;
- }
-}
-unset($id, $data);
-
-function add_cssclass($add, $class) {
- $class = empty($class) ? $add : $class .= ' ' . $add;
- return $class;
-}
-
-function add_menu_classes($menu) {
-
- $first = $lastorder = false;
- $i = 0;
- $mc = count($menu);
- foreach ( $menu as $order => $top ) {
- $i++;
-
- if ( 0 == $order ) { // dashboard is always shown/single
- $menu[0][4] = add_cssclass('menu-top-first', $top[4]);
- $lastorder = 0;
- continue;
- }
-
- if ( 0 === strpos($top[2], 'separator') ) { // if separator
- $first = true;
- $c = $menu[$lastorder][4];
- $menu[$lastorder][4] = add_cssclass('menu-top-last', $c);
- continue;
- }
-
- if ( $first ) {
- $c = $menu[$order][4];
- $menu[$order][4] = add_cssclass('menu-top-first', $c);
- $first = false;
- }
-
- if ( $mc == $i ) { // last item
- $c = $menu[$order][4];
- $menu[$order][4] = add_cssclass('menu-top-last', $c);
- }
-
- $lastorder = $order;
- }
-
- return apply_filters( 'add_menu_classes', $menu );
-}
-
-uksort($menu, "strnatcasecmp"); // make it all pretty
-
-if ( apply_filters('custom_menu_order', false) ) {
- $menu_order = array();
- foreach ( $menu as $menu_item ) {
- $menu_order[] = $menu_item[2];
- }
- unset($menu_item);
- $default_menu_order = $menu_order;
- $menu_order = apply_filters('menu_order', $menu_order);
- $menu_order = array_flip($menu_order);
- $default_menu_order = array_flip($default_menu_order);
-
- function sort_menu($a, $b) {
- global $menu_order, $default_menu_order;
- $a = $a[2];
- $b = $b[2];
- if ( isset($menu_order[$a]) && !isset($menu_order[$b]) ) {
- return -1;
- } elseif ( !isset($menu_order[$a]) && isset($menu_order[$b]) ) {
- return 1;
- } elseif ( isset($menu_order[$a]) && isset($menu_order[$b]) ) {
- if ( $menu_order[$a] == $menu_order[$b] )
- return 0;
- return ($menu_order[$a] < $menu_order[$b]) ? -1 : 1;
- } else {
- return ($default_menu_order[$a] <= $default_menu_order[$b]) ? -1 : 1;
- }
- }
-
- usort($menu, 'sort_menu');
- unset($menu_order, $default_menu_order);
-}
-
-$menu = add_menu_classes($menu);
-
-if ( !user_can_access_admin_page() ) {
- do_action('admin_page_access_denied');
- wp_die( __('You do not have sufficient permissions to access this page.') );
-}
+$_wp_real_parent_file['wpmu-admin.php'] = 'tools.php';
+$_wp_real_parent_file['ms-admin.php'] = 'tools.php';
+
+// ensure we're backwards compatible
+$compat = array(
+ 'index' => 'dashboard',
+ 'edit' => 'posts',
+ 'post' => 'posts',
+ 'upload' => 'media',
+ 'link-manager' => 'links',
+ 'edit-pages' => 'pages',
+ 'page' => 'pages',
+ 'edit-comments' => 'comments',
+ 'options-general' => 'settings',
+ 'themes' => 'appearance',
+ );
+
+require_once(ABSPATH . 'wp-admin/includes/menu.php');
?>
* @subpackage Administration
*/
require_once('../wp-load.php');
-wp_redirect('edit-comments.php?comment_status=moderated');
+wp_redirect( admin_url('edit-comments.php?comment_status=moderated') );
+exit;
?>
require_once( './admin.php' );
-if ( !is_multisite() )
- wp_die( __( 'Multisite support is not enabled.' ) );
-
-if ( ! current_user_can( 'manage_network' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
-$title = __( 'Network Admin' );
-$parent_file = 'ms-admin.php';
-
-add_contextual_help($current_screen,
- '<p>' . __('Until WordPress 3.0, running multiple sites required using WordPress MU instead of regular WordPress. In version 3.0, these applications have merged. If you are a former MU user, you should be aware of the following changes:') . '</p>' .
- '<ul><li>' . __('Site Admin is now Super Admin (we highly encourage you to get yourself a cape!).') . '</li>' .
- '<li>' . __('Blogs are now called Sites; Site is now called Network.') . '</li></ul>' .
- '<p>' . __('This screen provides the network administrator with links to the screens for Sites and Users to either create a new site or user, or to search existing users and sites. Those screens are also accessible through the left-hand navigation in the Super Admin section.') . '</p>' .
- '<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Super_Admin_Super_Admin_Menu" target="_blank">Documentation on Super Admin Menu</a>') . '</p>' .
- '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
-);
-
-require_once( './admin-header.php' );
-
-$c_users = get_user_count();
-$c_blogs = get_blog_count();
-
-$user_text = sprintf( _n( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) );
-$blog_text = sprintf( _n( '%s site', '%s sites', $c_blogs ), number_format_i18n( $c_blogs ) );
-
-$sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text );
+wp_redirect( network_admin_url() );
+exit;
?>
-
-<div class="wrap">
- <?php screen_icon(); ?>
- <h2><?php echo esc_html( $title ); ?></h2>
-
- <ul class="subsubsub">
- <li><a href="ms-sites.php#form-add-site"><?php _e( 'Create a New Site' ); ?></a> |</li>
- <li><a href="ms-users.php#form-add-user"><?php _e( 'Create a New User' ); ?></a></li>
- </ul>
- <br class="clear" />
-
- <p class="youhave"><?php echo $sentence; ?></p>
- <?php do_action( 'wpmuadminresult', '' ); ?>
-
- <form name="searchform" action="ms-users.php" method="get">
- <p>
- <input type="hidden" name="action" value="users" />
- <input type="text" name="s" value="" size="17" />
- <input class="button" type="submit" name="submit" value="<?php esc_attr_e( 'Search Users' ); ?>" />
- </p>
- </form>
-
- <form name="searchform" action="ms-sites.php" method="get">
- <p>
- <input type="hidden" name="action" value="blogs" />
- <input type="hidden" name="searchaction" value="name" />
- <input type="text" name="s" value="" size="17" />
- <input class="button" type="submit" name="blog_name" value="<?php esc_attr_e( 'Search Sites' ); ?>" />
- </p>
- </form>
-
- <?php do_action( 'mu_rightnow_end' ); ?>
- <?php do_action( 'mu_activity_box_end' ); ?>
-</div>
-
-<?php include( './admin-footer.php' ); ?>
<form method="post" name="deletedirect">
<input type="hidden" name="action" value="deleteblog" />
<p><input id="confirmdelete" type="checkbox" name="confirmdelete" value="1" /> <label for="confirmdelete"><strong><?php printf( __( "I'm sure I want to permanently disable my site, and I am aware I can never get it back or use %s again." ), is_subdomain_install() ? $current_blog->domain : $current_blog->domain . $current_blog->path ); ?></strong></label></p>
- <p class="submit"><input type="submit" value="<?php esc_attr_e( 'Delete My Site Permanently' ) ?>" /></p>
+ <?php submit_button( __( 'Delete My Site Permanently' ) ); ?>
</form>
<?php
}
require_once( './admin.php' );
-if ( ! is_multisite() )
- wp_die( __( 'Multisite support is not enabled.' ) );
-
-if ( empty( $_GET['action'] ) )
- wp_redirect( admin_url( 'ms-admin.php' ) );
-
-do_action( 'wpmuadminedit' , '');
-
-if ( isset( $_GET['id' ]) )
- $id = intval( $_GET['id'] );
-elseif ( isset( $_POST['id'] ) )
- $id = intval( $_POST['id'] );
-
-switch ( $_GET['action'] ) {
- case 'siteoptions':
- check_admin_referer( 'siteoptions' );
- if ( ! current_user_can( 'manage_network_options' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- if ( empty( $_POST ) )
- wp_die( sprintf( __( 'You probably need to go back to the <a href="%s">options page</a>.', esc_url( admin_url( 'ms-options.php' ) ) ) ) );
-
- if ( isset($_POST['WPLANG']) && ( '' === $_POST['WPLANG'] || in_array( $_POST['WPLANG'], get_available_languages() ) ) )
- update_site_option( 'WPLANG', $_POST['WPLANG'] );
-
- if ( is_email( $_POST['admin_email'] ) )
- update_site_option( 'admin_email', $_POST['admin_email'] );
-
- $illegal_names = split( ' ', $_POST['illegal_names'] );
- foreach ( (array) $illegal_names as $name ) {
- $name = trim( $name );
- if ( $name != '' )
- $names[] = trim( $name );
- }
- update_site_option( 'illegal_names', $names );
-
- if ( $_POST['limited_email_domains'] != '' ) {
- $limited_email_domains = str_replace( ' ', "\n", $_POST['limited_email_domains'] );
- $limited_email_domains = split( "\n", stripslashes( $limited_email_domains ) );
- $limited_email = array();
- foreach ( (array) $limited_email_domains as $domain ) {
- $domain = trim( $domain );
- if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
- $limited_email[] = trim( $domain );
- }
- update_site_option( 'limited_email_domains', $limited_email );
- } else {
- update_site_option( 'limited_email_domains', '' );
- }
-
- if ( $_POST['banned_email_domains'] != '' ) {
- $banned_email_domains = split( "\n", stripslashes( $_POST['banned_email_domains'] ) );
- $banned = array();
- foreach ( (array) $banned_email_domains as $domain ) {
- $domain = trim( $domain );
- if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
- $banned[] = trim( $domain );
- }
- update_site_option( 'banned_email_domains', $banned );
- } else {
- update_site_option( 'banned_email_domains', '' );
- }
- update_site_option( 'default_user_role', $_POST['default_user_role'] );
- if ( trim( $_POST['dashboard_blog_orig'] ) == '' )
- $_POST['dashboard_blog_orig'] = $current_site->blog_id;
- if ( trim( $_POST['dashboard_blog'] ) == '' ) {
- $_POST['dashboard_blog'] = $current_site->blog_id;
- $dashboard_blog_id = $current_site->blog_id;
- } elseif ( ! preg_match( '/(--|\.)/', $_POST['dashboard_blog'] ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $_POST['dashboard_blog'] ) ) {
- $dashboard_blog = $_POST['dashboard_blog'];
- $blog_details = get_blog_details( $dashboard_blog );
- if ( false === $blog_details ) {
- if ( is_numeric( $dashboard_blog ) )
- wp_die( __( 'A dashboard site referenced by ID must already exist' ) );
- if ( is_subdomain_install() ) {
- $domain = $dashboard_blog . '.' . $current_site->domain;
- $path = $current_site->path;
- } else {
- $domain = $current_site->domain;
- $path = trailingslashit( $current_site->path . $dashboard_blog );
- }
- $wpdb->hide_errors();
- $dashboard_blog_id = wpmu_create_blog( $domain, $path, __( 'My Dashboard' ), $current_user->id , array( 'public' => 0 ), $current_site->id );
- $wpdb->show_errors();
- } else {
- $dashboard_blog_id = $blog_details->blog_id;
- }
- }
- if ( is_wp_error( $dashboard_blog_id ) )
- wp_die( __( 'Problem creating dashboard site: ' ) . $dashboard_blog_id->get_error_message() );
- if ( $_POST['dashboard_blog_orig'] != $_POST['dashboard_blog'] ) {
- $users = get_users_of_blog( get_site_option( 'dashboard_blog' ) );
- $move_users = array();
- foreach ( (array)$users as $user ) {
- $user_meta_value = unserialize( $user->meta_value );
- if ( is_array( $user_meta_value ) && array_pop( $var_by_ref = array_keys( $user_meta_value ) ) == 'subscriber' )
- $move_users[] = $user->user_id;
- }
- if ( false == empty( $move_users ) ) {
- foreach ( (array)$move_users as $user_id ) {
- remove_user_from_blog($user_id, get_site_option( 'dashboard_blog' ) );
- add_user_to_blog( $dashboard_blog_id, $user_id, get_site_option( 'default_user_role', 'subscriber' ) );
- update_user_meta( $user_id, 'primary_blog', $dashboard_blog_id );
- }
- }
- }
- update_site_option( 'dashboard_blog', $dashboard_blog_id );
-
- $options = array( 'registrationnotification', 'registration', 'add_new_users', 'menu_items', 'mu_media_buttons', 'upload_space_check_disabled', 'blog_upload_space', 'upload_filetypes', 'site_name', 'first_post', 'first_page', 'first_comment', 'first_comment_url', 'first_comment_author', 'welcome_email', 'welcome_user_email', 'fileupload_maxk', 'admin_notice_feed', 'global_terms_enabled' );
- $checked_options = array( 'mu_media_buttons' => array(), 'menu_items' => array(), 'registrationnotification' => 'no', 'upload_space_check_disabled' => 1, 'add_new_users' => 0 );
- foreach ( $checked_options as $option_name => $option_unchecked_value ) {
- if ( ! isset( $_POST[$option_name] ) )
- $_POST[$option_name] = $option_unchecked_value;
- }
- foreach ( $options as $option_name ) {
- if ( ! isset($_POST[$option_name]) )
- continue;
- $value = stripslashes_deep( $_POST[$option_name] );
- update_site_option( $option_name, $value );
- }
-
- // Update more options here
- do_action( 'update_wpmu_options' );
-
- wp_redirect( add_query_arg( 'updated', 'true', admin_url( 'ms-options.php' ) ) );
- exit();
- break;
- case 'addblog':
- check_admin_referer( 'add-blog', '_wpnonce_add-blog' );
-
- if ( ! current_user_can( 'manage_sites' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- if ( is_array( $_POST['blog'] ) == false )
- wp_die( __( 'Can’t create an empty site.' ) );
- $blog = $_POST['blog'];
- $domain = '';
- if ( ! preg_match( '/(--)/', $blog['domain'] ) && preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) )
- $domain = strtolower( $blog['domain'] );
-
- // If not a subdomain install, make sure the domain isn't a reserved word
- if ( ! is_subdomain_install() ) {
- $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) );
- if ( in_array( $domain, $subdirectory_reserved_names ) )
- wp_die( sprintf( __('The following words are reserved for use by WordPress functions and cannot be used as blog names: <code>%s</code>' ), implode( '</code>, <code>', $subdirectory_reserved_names ) ) );
- }
-
- $email = sanitize_email( $blog['email'] );
- $title = $blog['title'];
-
- if ( empty( $domain ) )
- wp_die( __( 'Missing or invalid site address.' ) );
- if ( empty( $email ) )
- wp_die( __( 'Missing email address.' ) );
- if ( !is_email( $email ) )
- wp_die( __( 'Invalid email address.' ) );
-
- if ( is_subdomain_install() ) {
- $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
- $path = $base;
- } else {
- $newdomain = $current_site->domain;
- $path = $base . $domain . '/';
- }
-
- $password = 'N/A';
- $user_id = email_exists($email);
- if ( !$user_id ) { // Create a new user with a random password
- $password = wp_generate_password();
- $user_id = wpmu_create_user( $domain, $password, $email );
- if ( false == $user_id )
- wp_die( __( 'There was an error creating the user.' ) );
- else
- wp_new_user_notification( $user_id, $password );
- }
-
- $wpdb->hide_errors();
- $id = wpmu_create_blog( $newdomain, $path, $title, $user_id , array( 'public' => 1 ), $current_site->id );
- $wpdb->show_errors();
- if ( !is_wp_error( $id ) ) {
- $dashboard_blog = get_dashboard_blog();
- if ( !is_super_admin( $user_id ) && get_user_option( 'primary_blog', $user_id ) == $dashboard_blog->blog_id )
- update_user_option( $user_id, 'primary_blog', $id, true );
- $content_mail = sprintf( __( "New site created by %1s\n\nAddress: http://%2s\nName: %3s"), $current_user->user_login , $newdomain . $path, stripslashes( $title ) );
- wp_mail( get_site_option('admin_email'), sprintf( __( '[%s] New Site Created' ), $current_site->site_name ), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' );
- wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) );
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'add-blog' ), wp_get_referer() ) );
- exit();
- } else {
- wp_die( $id->get_error_message() );
- }
- break;
-
- case 'updateblog':
- check_admin_referer( 'editblog' );
- if ( ! current_user_can( 'manage_sites' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- if ( empty( $_POST ) )
- wp_die( sprintf( __( 'You probably need to go back to the <a href="%s">sites page</a>', esc_url( admin_url( 'ms-sites.php' ) ) ) ) );
-
- switch_to_blog( $id );
-
- // themes
- $allowedthemes = array();
- if ( isset($_POST['theme']) && is_array( $_POST['theme'] ) ) {
- foreach ( $_POST['theme'] as $theme => $val ) {
- if ( 'on' == $val )
- $allowedthemes[$theme] = true;
- }
- }
- update_option( 'allowedthemes', $allowedthemes );
-
- // options
- if ( is_array( $_POST['option'] ) ) {
- $c = 1;
- $count = count( $_POST['option'] );
- $skip_options = array( 'allowedthemes' ); // Don't update these options since they are handled elsewhere in the form.
- foreach ( (array) $_POST['option'] as $key => $val ) {
- if ( $key === 0 || is_array( $val ) || in_array($key, $skip_options) )
- continue; // Avoids "0 is a protected WP option and may not be modified" error when edit blog options
- if ( $c == $count )
- update_option( $key, stripslashes( $val ) );
- else
- update_option( $key, stripslashes( $val ), false ); // no need to refresh blog details yet
- $c++;
- }
- }
-
- // home and siteurl
- if ( isset( $_POST['update_home_url'] ) && $_POST['update_home_url'] == 'update' ) {
- $blog_address = get_blogaddress_by_domain( $_POST['blog']['domain'], $_POST['blog']['path'] );
- if ( get_option( 'siteurl' ) != $blog_address )
- update_option( 'siteurl', $blog_address );
-
- if ( get_option( 'home' ) != $blog_address )
- update_option( 'home', $blog_address );
- }
-
- // rewrite rules can't be flushed during switch to blog
- delete_option( 'rewrite_rules' );
-
- // update blogs table
- $blog_data = stripslashes_deep( $_POST['blog'] );
- update_blog_details( $id, $blog_data );
-
- // get blog prefix
- $blog_prefix = $wpdb->get_blog_prefix( $id );
-
- // user roles
- if ( isset( $_POST['role'] ) && is_array( $_POST['role'] ) == true ) {
- $newroles = $_POST['role'];
-
- reset( $newroles );
- foreach ( (array) $newroles as $userid => $role ) {
- $user = new WP_User( $userid );
- if ( empty( $user->ID ) )
- continue;
- $user->for_blog( $id );
- $user->set_role( $role );
- }
- }
-
- // remove user
- if ( isset( $_POST['blogusers'] ) && is_array( $_POST['blogusers'] ) ) {
- reset( $_POST['blogusers'] );
- foreach ( (array) $_POST['blogusers'] as $key => $val )
- remove_user_from_blog( $key, $id );
- }
-
- // change password
- if ( isset( $_POST['user_password'] ) && is_array( $_POST['user_password'] ) ) {
- reset( $_POST['user_password'] );
- $newroles = $_POST['role'];
- foreach ( (array) $_POST['user_password'] as $userid => $pass ) {
- unset( $_POST['role'] );
- $_POST['role'] = $newroles[ $userid ];
- if ( $pass != '' ) {
- $cap = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = %d AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'", $userid ) );
- $userdata = get_userdata($userid);
- $_POST['pass1'] = $_POST['pass2'] = $pass;
- $_POST['email'] = $userdata->user_email;
- $_POST['rich_editing'] = $userdata->rich_editing;
- edit_user( $userid );
- if ( $cap == null )
- $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->usermeta} WHERE user_id = %d AND meta_key = '{$blog_prefix}capabilities' AND meta_value = 'a:0:{}'", $userid ) );
- }
- }
- unset( $_POST['role'] );
- $_POST['role'] = $newroles;
- }
-
- // add user
- if ( !empty( $_POST['newuser'] ) ) {
- $newuser = $_POST['newuser'];
- $userid = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . $wpdb->users . " WHERE user_login = %s", $newuser ) );
- if ( $userid ) {
- $user = $wpdb->get_var( "SELECT user_id FROM " . $wpdb->usermeta . " WHERE user_id='$userid' AND meta_key='{$blog_prefix}capabilities'" );
- if ( $user == false )
- add_user_to_blog( $id, $userid, $_POST['new_role'] );
- }
- }
- do_action( 'wpmu_update_blog_options' );
- restore_current_blog();
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'editblog', 'id' => $id ), wp_get_referer() ) );
- break;
-
- case 'deleteblog':
- check_admin_referer('deleteblog');
- if ( ! current_user_can( 'manage_sites' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- if ( $id != '0' && $id != $current_site->blog_id )
- wpmu_delete_blog( $id, true );
-
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'delete' ), wp_get_referer() ) );
- exit();
- break;
-
- case 'allblogs':
- if ( isset( $_POST['doaction']) || isset($_POST['doaction2'] ) ) {
- check_admin_referer( 'bulk-ms-sites', '_wpnonce_bulk-ms-sites' );
-
- if ( ! current_user_can( 'manage_sites' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- if ( $_GET['action'] != -1 || $_POST['action2'] != -1 )
- $doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
-
-
- foreach ( (array) $_POST['allblogs'] as $key => $val ) {
- if ( $val != '0' && $val != $current_site->blog_id ) {
- switch ( $doaction ) {
- case 'delete':
- $blogfunction = 'all_delete';
- wpmu_delete_blog( $val, true );
- break;
-
- case 'spam':
- $blogfunction = 'all_spam';
- update_blog_status( $val, 'spam', '1', 0 );
- set_time_limit( 60 );
- break;
-
- case 'notspam':
- $blogfunction = 'all_notspam';
- update_blog_status( $val, 'spam', '0', 0 );
- set_time_limit( 60 );
- break;
- }
- } else {
- wp_die( __( 'You are not allowed to change the current site.' ) );
- }
- }
-
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $blogfunction ), wp_get_referer() ) );
- exit();
- } else {
- wp_redirect( admin_url( 'ms-sites.php' ) );
- }
- break;
-
- case 'archiveblog':
- check_admin_referer( 'archiveblog' );
- if ( ! current_user_can( 'manage_sites' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- update_blog_status( $id, 'archived', '1' );
- do_action( 'archive_blog', $id );
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'archive' ), wp_get_referer() ) );
- exit();
- break;
-
- case 'unarchiveblog':
- check_admin_referer( 'unarchiveblog' );
- if ( ! current_user_can( 'manage_sites' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- do_action( 'unarchive_blog', $id );
- update_blog_status( $id, 'archived', '0' );
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unarchive' ), wp_get_referer() ) );
- exit();
- break;
-
- case 'activateblog':
- check_admin_referer( 'activateblog' );
- if ( ! current_user_can( 'manage_sites' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- update_blog_status( $id, 'deleted', '0' );
- do_action( 'activate_blog', $id );
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'activate' ), wp_get_referer() ) );
- exit();
- break;
-
- case 'deactivateblog':
- check_admin_referer( 'deactivateblog' );
- if ( ! current_user_can( 'manage_sites' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- do_action( 'deactivate_blog', $id );
- update_blog_status( $id, 'deleted', '1' );
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'deactivate' ), wp_get_referer() ) );
- exit();
- break;
-
- case 'unspamblog':
- check_admin_referer( 'unspamblog' );
- if ( ! current_user_can( 'manage_sites' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- update_blog_status( $id, 'spam', '0' );
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unspam' ), wp_get_referer() ) );
- exit();
- break;
-
- case 'spamblog':
- check_admin_referer( 'spamblog' );
- if ( ! current_user_can( 'manage_sites' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- update_blog_status( $id, 'spam', '1' );
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'spam' ), wp_get_referer() ) );
- exit();
- break;
-
- // Themes
- case 'updatethemes':
- if ( ! current_user_can( 'manage_network_themes' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- if ( is_array( $_POST['theme'] ) ) {
- $themes = get_themes();
- reset( $themes );
- $allowed_themes = array();
- foreach ( (array) $themes as $key => $theme ) {
- if ( $_POST['theme'][ esc_html( $theme['Stylesheet'] ) ] == 'enabled' )
- $allowed_themes[ esc_html( $theme['Stylesheet'] ) ] = true;
- }
- update_site_option( 'allowedthemes', $allowed_themes );
- }
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'themes' ), wp_get_referer() ) );
- exit();
- break;
-
- // Common
- case 'confirm':
- if ( !headers_sent() ) {
- nocache_headers();
- header( 'Content-Type: text/html; charset=utf-8' );
- }
- if ( $current_site->blog_id == $id )
- wp_die( __( 'You are not allowed to change the current site.' ) );
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) ) language_attributes(); ?>>
- <head>
- <title><?php _e( 'WordPress › Confirm your action' ); ?></title>
-
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <?php
- wp_admin_css( 'install', true );
- wp_admin_css( 'ie', true );
- ?>
- </head>
- <body>
- <h1 id="logo"><img alt="WordPress" src="<?php echo esc_attr( admin_url( 'images/wordpress-logo.png' ) ); ?>" /></h1>
- <form action="ms-edit.php?action=<?php echo esc_attr( $_GET['action2'] ) ?>" method="post">
- <input type="hidden" name="action" value="<?php echo esc_attr( $_GET['action2'] ) ?>" />
- <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
- <input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
- <?php wp_nonce_field( $_GET['action2'], '_wpnonce', false ); ?>
- <p><?php echo esc_html( stripslashes( $_GET['msg'] ) ); ?></p>
- <p class="submit"><input class="button" type="submit" value="<?php _e( 'Confirm' ); ?>" /></p>
- </form>
- </body>
- </html>
- <?php
- break;
-
- // Users
- case 'deleteuser':
- if ( ! current_user_can( 'manage_network_users' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- check_admin_referer( 'deleteuser' );
-
- if ( $id != '0' && $id != '1' ) {
- $_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle with arrays
- $title = __( 'Users' );
- $parent_file = 'ms-admin.php';
- require_once( 'admin-header.php' );
- echo '<div class="wrap">';
- confirm_delete_users( $_POST['allusers'] );
- echo '</div>';
- require_once( 'admin-footer.php' );
- exit();
- } else {
- wp_redirect( admin_url( 'ms-users.php' ) );
- }
- break;
-
- case 'allusers':
- if ( ! current_user_can( 'manage_network_users' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- if ( isset( $_POST['doaction']) || isset($_POST['doaction2'] ) ) {
- check_admin_referer( 'bulk-ms-users', '_wpnonce_bulk-ms-users' );
-
- if ( $_GET['action'] != -1 || $_POST['action2'] != -1 )
- $doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
-
- foreach ( (array) $_POST['allusers'] as $key => $val ) {
- if ( !empty( $val ) ) {
- switch ( $doaction ) {
- case 'delete':
- $title = __( 'Users' );
- $parent_file = 'ms-admin.php';
- require_once( 'admin-header.php' );
- echo '<div class="wrap">';
- confirm_delete_users( $_POST['allusers'] );
- echo '</div>';
- require_once( 'admin-footer.php' );
- exit();
- break;
-
- case 'spam':
- $user = new WP_User( $val );
- if ( in_array( $user->user_login, get_super_admins() ) )
- wp_die( sprintf( __( 'Warning! User cannot be modified. The user %s is a network administrator.' ), esc_html( $user->user_login ) ) );
-
- $userfunction = 'all_spam';
- $blogs = get_blogs_of_user( $val, true );
- foreach ( (array) $blogs as $key => $details ) {
- if ( $details->userblog_id != $current_site->blog_id ) // main blog not a spam !
- update_blog_status( $details->userblog_id, 'spam', '1' );
- }
- update_user_status( $val, 'spam', '1', 1 );
- break;
-
- case 'notspam':
- $userfunction = 'all_notspam';
- $blogs = get_blogs_of_user( $val, true );
- foreach ( (array) $blogs as $key => $details )
- update_blog_status( $details->userblog_id, 'spam', '0' );
-
- update_user_status( $val, 'spam', '0', 1 );
- break;
- }
- }
- }
-
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) );
- exit();
- } else {
- wp_redirect( admin_url( 'ms-users.php' ) );
- }
- break;
-
- case 'dodelete':
- check_admin_referer( 'ms-users-delete' );
- if ( ! current_user_can( 'manage_network_users' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- if ( ! empty( $_POST['blog'] ) && is_array( $_POST['blog'] ) ) {
- foreach ( $_POST['blog'] as $id => $users ) {
- foreach ( $users as $blogid => $user_id ) {
- if ( ! empty( $_POST['delete'] ) && 'reassign' == $_POST['delete'][$blogid][$id] )
- remove_user_from_blog( $id, $blogid, $user_id );
- else
- remove_user_from_blog( $id, $blogid );
- }
- }
- }
- $i = 0;
- if ( is_array( $_POST['user'] ) && ! empty( $_POST['user'] ) )
- foreach( $_POST['user'] as $id ) {
- wpmu_delete_user( $id );
- $i++;
- }
-
- if ( $i == 1 )
- $deletefunction = 'delete';
- else
- $deletefunction = 'all_delete';
-
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $deletefunction ), admin_url( 'ms-users.php' ) ) );
- break;
-
- case 'adduser':
- check_admin_referer( 'add-user', '_wpnonce_add-user' );
- if ( ! current_user_can( 'manage_network_users' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- if ( is_array( $_POST['user'] ) == false )
- wp_die( __( 'Cannot create an empty user.' ) );
- $user = $_POST['user'];
- if ( empty($user['username']) && empty($user['email']) )
- wp_die( __( 'Missing username and email.' ) );
- elseif ( empty($user['username']) )
- wp_die( __( 'Missing username.' ) );
- elseif ( empty($user['email']) )
- wp_die( __( 'Missing email.' ) );
-
- $password = wp_generate_password();
- $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
-
- if ( false == $user_id )
- wp_die( __( 'Duplicated username or email address.' ) );
- else
- wp_new_user_notification( $user_id, $password );
-
- if ( get_site_option( 'dashboard_blog' ) == false )
- add_user_to_blog( $current_site->blog_id, $user_id, get_site_option( 'default_user_role', 'subscriber' ) );
- else
- add_user_to_blog( get_site_option( 'dashboard_blog' ), $user_id, get_site_option( 'default_user_role', 'subscriber' ) );
-
- wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'add' ), wp_get_referer() ) );
- exit();
- break;
-
- default:
- wp_redirect( admin_url( 'ms-admin.php' ) );
- break;
-}
+wp_redirect( network_admin_url() );
+exit;
?>
require_once( './admin.php' );
-if ( ! is_multisite() )
- wp_die( __( 'Multisite support is not enabled.' ) );
-
-if ( ! current_user_can( 'manage_network_options' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
-$title = __( 'Network Options' );
-$parent_file = 'ms-admin.php';
-
-add_contextual_help($current_screen,
- '<p>' . __('This screen sets and changes options for the network as a whole. The first site is the main site in the network and network options are pulled from that original site’s options.') . '</p>' .
- '<p>' . __('Operational settings has fields for the network’s name and admin email.') . '</p>' .
- '<p>' . __('Dashboard Site is an option to give a site to users who do not have a site on the system. Their default role is Subscriber, but that default can be changed. The Admin Notice Feed can provide a notice on all dashboards of the latest post via RSS or Atom, or provide no such notice if left blank.') . '</p>' .
- '<p>' . __('Registration settings can disable/enable public signups. If you let others sign up for a site, install spam plugins. Spaces, not commas, should separate names banned as sites for this network.') . '</p>' .
- '<p>' . __('New site settings are defaults applied when a new site is created in the network. These include welcome email for when a new site or user account is registered, and what᾿s put in the first post, page, comment, comment author, and comment URL.') . '</p>' .
- '<p>' . __('Upload settings control the size of the uploaded files and the amount of available upload space for each site. You can change the default value for specific sites when you edit a particular site. Allowed file types are also listed (space separated only).') . '</p>' .
- '<p>' . __('Checkboxes for media upload buttons set which are shown in the visual editor. If unchecked, a generic upload button is still visible; other media types can still be uploaded if on the allowed file types list.') . '</p>' .
- '<p>' . __('Menu setting enables/disables the plugin menus from appearing for non super admins, so that only super admins, not site admins, have access to activate plugins.') . '</p>' .
- '<p>' . __('Super admins can no longer be added on the Options screen. You must now go to the list of existing users on Super Admin > Users and click on Username or the Edit action link below that name. This goes to an Edit User page where you can check a box to grant super admin privileges.') . '</p>' .
- '<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Super_Admin_Options_SubPanel" target="_blank">Network Options Documentation</a>') . '</p>' .
- '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
-);
-
-include( './admin-header.php' );
-
-if (isset($_GET['updated'])) {
- ?>
- <div id="message" class="updated"><p><?php _e( 'Options saved.' ) ?></p></div>
- <?php
-}
-?>
-
-<div class="wrap">
- <?php screen_icon(); ?>
- <h2><?php _e( 'Network Options' ) ?></h2>
- <form method="post" action="ms-edit.php?action=siteoptions">
- <?php wp_nonce_field( 'siteoptions' ); ?>
- <h3><?php _e( 'Operational Settings' ); ?></h3>
- <table class="form-table">
- <tr valign="top">
- <th scope="row"><label for="site_name"><?php _e( 'Network Name' ) ?></label></th>
- <td>
- <input name="site_name" type="text" id="site_name" class="regular-text" value="<?php echo esc_attr( $current_site->site_name ) ?>" />
- <br />
- <?php _e( 'What you would like to call this website.' ) ?>
- </td>
- </tr>
-
- <tr valign="top">
- <th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th>
- <td>
- <input name="admin_email" type="text" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option('admin_email') ) ?>" />
- <br />
- <?php printf( __( 'Registration and support emails will come from this address. An address such as <code>support@%s</code> is recommended.' ), $current_site->domain ); ?>
- </td>
- </tr>
- </table>
- <h3><?php _e( 'Dashboard Settings' ); ?></h3>
- <table class="form-table">
- <tr valign="top">
- <th scope="row"><label for="dashboard_blog"><?php _e( 'Dashboard Site' ) ?></label></th>
- <td>
- <?php
- if ( $dashboard_blog = get_site_option( 'dashboard_blog' ) ) {
- $details = get_blog_details( $dashboard_blog );
- $blogname = untrailingslashit( sanitize_user( str_replace( '.', '', str_replace( $current_site->domain . $current_site->path, '', $details->domain . $details->path ) ) ) );
- } else {
- $blogname = '';
- }?>
- <input name="dashboard_blog_orig" type="hidden" id="dashboard_blog_orig" value="<?php echo esc_attr( $blogname ); ?>" />
- <input name="dashboard_blog" type="text" id="dashboard_blog" value="<?php echo esc_attr( $blogname ); ?>" class="regular-text" />
- <br />
- <?php _e( 'Site path (“dashboard”, “control”, “manager”, etc.) or blog ID.<br />New users are added to this site as the user role defined below if they don’t have a site. Leave blank for the main site. Users with the Subscriber role on the old site will be moved to the new site if changed. The new site will be created if it does not exist.' ); ?>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="default_user_role"><?php _e( 'Dashboard User Default Role' ) ?></label></th>
- <td>
- <select name="default_user_role" id="default_user_role"><?php
- wp_dropdown_roles( get_site_option( 'default_user_role', 'subscriber' ) );
- ?>
- </select>
- <br />
- <?php _e( 'The default role for new users on the Dashboard site. “Subscriber” or “Contributor” roles are recommended.' ); ?>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="admin_notice_feed"><?php _e( 'Admin Notice Feed' ) ?></label></th>
- <td><input name="admin_notice_feed" class="large-text" type="text" id="admin_notice_feed" value="<?php echo esc_attr( get_site_option( 'admin_notice_feed' ) ) ?>" size="80" /><br />
- <?php _e( 'Display the latest post from this RSS or Atom feed on all site dashboards. Leave blank to disable.' ); ?><br />
-
- <?php if ( get_site_option( 'admin_notice_feed' ) != get_home_url( $current_site->id, 'feed/' ) )
- echo __( 'A good one to use would be the feed from your main site: ' ) . esc_url( get_home_url( $current_site->id, 'feed/' ) ) ?></td>
- </tr>
- </table>
- <h3><?php _e( 'Registration Settings' ); ?></h3>
- <table class="form-table">
- <tr valign="top">
- <th scope="row"><?php _e( 'Allow new registrations' ) ?></th>
- <?php
- if ( !get_site_option( 'registration' ) )
- update_site_option( 'registration', 'none' );
- $reg = get_site_option( 'registration' );
- ?>
- <td>
- <label><input name="registration" type="radio" id="registration1" value="none"<?php checked( $reg, 'none') ?> /> <?php _e( 'Registration is disabled.' ); ?></label><br />
- <label><input name="registration" type="radio" id="registration2" value="user"<?php checked( $reg, 'user') ?> /> <?php _e( 'User accounts may be registered.' ); ?></label><br />
- <label><input name="registration" type="radio" id="registration3" value="blog"<?php checked( $reg, 'blog') ?> /> <?php _e( 'Logged in users may register new sites.' ); ?></label><br />
- <label><input name="registration" type="radio" id="registration4" value="all"<?php checked( $reg, 'all') ?> /> <?php _e( 'Both sites and user accounts can be registered.' ); ?></label><br />
- <p><?php _e( 'Disable or enable registration and who or what can be registered. (Default is disabled.)' ); ?></p>
- <?php if ( is_subdomain_install() ) {
- echo '<p>' . __( 'If registration is disabled, please set <code>NOBLOGREDIRECT</code> in <code>wp-config.php</code> to a URL you will redirect visitors to if they visit a non-existent site.' ) . '</p>';
- } ?>
- </td>
- </tr>
-
- <tr valign="top">
- <th scope="row"><?php _e( 'Registration notification' ) ?></th>
- <?php
- if ( !get_site_option( 'registrationnotification' ) )
- update_site_option( 'registrationnotification', 'yes' );
- ?>
- <td>
- <label><input name="registrationnotification" type="checkbox" id="registrationnotification" value="yes"<?php checked( get_site_option( 'registrationnotification' ), 'yes' ) ?> /> <?php _e( 'Send the network admin an email notification every time someone registers a site or user account.' ) ?></label>
- </td>
- </tr>
-
- <tr valign="top" id="addnewusers">
- <th scope="row"><?php _e( 'Add New Users' ) ?></th>
- <td>
- <label><input name="add_new_users" type="checkbox" id="add_new_users" value="1"<?php checked( get_site_option( 'add_new_users' ) ) ?> /> <?php _e( 'Allow site administrators to add new users to their site via the "Users->Add New" page.' ); ?></label>
- </td>
- </tr>
-
- <tr valign="top">
- <th scope="row"><label for="illegal_names"><?php _e( 'Banned Names' ) ?></label></th>
- <td>
- <input name="illegal_names" type="text" id="illegal_names" class="large-text" value="<?php echo esc_attr( implode( " ", get_site_option( 'illegal_names' ) ) ); ?>" size="45" />
- <br />
- <?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ) ?>
- </td>
- </tr>
-
- <tr valign="top">
- <th scope="row"><label for="limited_email_domains"><?php _e( 'Limited Email Registrations' ) ?></label></th>
- <td>
- <?php $limited_email_domains = get_site_option( 'limited_email_domains' );
- $limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); ?>
- <textarea name="limited_email_domains" id="limited_email_domains" cols="45" rows="5">
-<?php echo wp_htmledit_pre( $limited_email_domains == '' ? '' : implode( "\n", (array) $limited_email_domains ) ); ?></textarea>
- <br />
- <?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ) ?>
- </td>
- </tr>
-
- <tr valign="top">
- <th scope="row"><label for="banned_email_domains"><?php _e('Banned Email Domains') ?></label></th>
- <td>
- <textarea name="banned_email_domains" id="banned_email_domains" cols="45" rows="5">
-<?php echo wp_htmledit_pre( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) ) ); ?></textarea>
- <br />
- <?php _e( 'If you want to ban domains from site registrations. One domain per line.' ) ?>
- </td>
- </tr>
-
- </table>
- <h3><?php _e('New Site Settings'); ?></h3>
- <table class="form-table">
-
- <tr valign="top">
- <th scope="row"><label for="welcome_email"><?php _e( 'Welcome Email' ) ?></label></th>
- <td>
- <textarea name="welcome_email" id="welcome_email" rows="5" cols="45" class="large-text">
-<?php echo wp_htmledit_pre( stripslashes( get_site_option( 'welcome_email' ) ) ) ?></textarea>
- <br />
- <?php _e( 'The welcome email sent to new site owners.' ) ?>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="welcome_user_email"><?php _e( 'Welcome User Email' ) ?></label></th>
- <td>
- <textarea name="welcome_user_email" id="welcome_user_email" rows="5" cols="45" class="large-text">
-<?php echo wp_htmledit_pre( stripslashes( get_site_option( 'welcome_user_email' ) ) ) ?></textarea>
- <br />
- <?php _e( 'The welcome email sent to new users.' ) ?>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="first_post"><?php _e( 'First Post' ) ?></label></th>
- <td>
- <textarea name="first_post" id="first_post" rows="5" cols="45" class="large-text">
-<?php echo wp_htmledit_pre( stripslashes( get_site_option( 'first_post' ) ) ) ?></textarea>
- <br />
- <?php _e( 'The first post on a new site.' ) ?>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="first_page"><?php _e( 'First Page' ) ?></label></th>
- <td>
- <textarea name="first_page" id="first_page" rows="5" cols="45" class="large-text">
-<?php echo wp_htmledit_pre( stripslashes( get_site_option('first_page') ) ) ?></textarea>
- <br />
- <?php _e( 'The first page on a new site.' ) ?>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="first_comment"><?php _e( 'First Comment' ) ?></label></th>
- <td>
- <textarea name="first_comment" id="first_comment" rows="5" cols="45" class="large-text">
-<?php echo wp_htmledit_pre( stripslashes( get_site_option('first_comment') ) ) ?></textarea>
- <br />
- <?php _e( 'The first comment on a new site.' ) ?>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
- <td>
- <input type="text" size="40" name="first_comment_author" id="first_comment_author" value="<?php echo get_site_option('first_comment_author') ?>" />
- <br />
- <?php _e( 'The author of the first comment on a new site.' ) ?>
- </td>
- </tr>
- <tr valign="top">
- <th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ) ?></label></th>
- <td>
- <input type="text" size="40" name="first_comment_url" id="first_comment_url" value="<?php echo esc_attr( get_site_option( 'first_comment_url' ) ) ?>" />
- <br />
- <?php _e( 'The URL for the first comment on a new site.' ) ?>
- </td>
- </tr>
- </table>
- <h3><?php _e( 'Upload Settings' ); ?></h3>
- <table class="form-table">
- <tr valign="top">
- <th scope="row"><?php _e( 'Media upload buttons' ) ?></th>
- <?php $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); ?>
- <td><label><input type="checkbox" id="mu_media_buttons_image" name="mu_media_buttons[image]" value="1"<?php checked( ! empty( $mu_media_buttons['image'] ) ) ?>/> <?php _e( 'Images' ); ?></label><br />
- <label><input type="checkbox" id="mu_media_buttons_video" name="mu_media_buttons[video]" value="1"<?php checked( ! empty( $mu_media_buttons['video'] ) ) ?>/> <?php _e( 'Videos' ); ?></label><br />
- <label><input type="checkbox" id="mu_media_buttons_audio" name="mu_media_buttons[audio]" value="1"<?php checked( ! empty( $mu_media_buttons['audio'] ) ) ?>/> <?php _e( 'Music' ); ?></label><br />
- <?php _e( 'The media upload buttons to display on the “Write Post” page. Make sure you update the allowed upload file types below as well.' ); ?></td>
- </tr>
-
- <tr valign="top">
- <th scope="row"><?php _e( 'Site upload space' ) ?></th>
- <td>
- <label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( get_site_option( 'upload_space_check_disabled' ), 0 ) ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="text" id="blog_upload_space" value="' . esc_attr( get_site_option('blog_upload_space', 10) ) . '" size="3" />' ); ?></label><br />
- </td>
- </tr>
-
- <tr valign="top">
- <th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th>
- <td><input name="upload_filetypes" type="text" id="upload_filetypes" class="large-text" value="<?php echo esc_attr( get_site_option('upload_filetypes', 'jpg jpeg png gif') ) ?>" size="45" /></td>
- </tr>
-
- <tr valign="top">
- <th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ) ?></label></th>
- <td><?php printf( _x( '%s KB', 'File size in kilobytes' ), '<input name="fileupload_maxk" type="text" id="fileupload_maxk" value="' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '" size="5" />' ); ?></td>
- </tr>
- </table>
-
-<?php
- $languages = get_available_languages();
- if ( ! empty( $languages ) ) {
- $lang = get_site_option( 'WPLANG' );
-?>
- <h3><?php _e( 'Network Wide Settings' ); ?></h3>
- <div class="updated inline"><p><strong><?php _e( 'Notice:' ); ?></strong> <?php _e( 'These settings may be overridden by site owners.' ); ?></p></div>
- <table class="form-table">
- <?php
- ?>
- <tr valign="top">
- <th><label for="WPLANG"><?php _e( 'Default Language' ) ?></label></th>
- <td>
- <select name="WPLANG" id="WPLANG">
- <?php mu_dropdown_languages( $languages, get_site_option( 'WPLANG' ) ); ?>
- </select>
- </td>
- </tr>
- </table>
-<?php
- } // languages
-?>
-
- <h3><?php _e( 'Menu Settings' ); ?></h3>
- <table id="menu" class="form-table">
- <tr valign="top">
- <th scope="row"><?php _e( 'Enable administration menus' ); ?></th>
- <td>
- <?php
- $menu_perms = get_site_option( 'menu_items' );
- $menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) );
- foreach ( (array) $menu_items as $key => $val ) {
- echo "<label><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . ( isset( $menu_perms[$key] ) ? checked( $menu_perms[$key], '1', false ) : '' ) . " /> " . esc_html( $val ) . "</label><br/>";
- }
- ?>
- </td>
- </tr>
- </table>
-
- <?php do_action( 'wpmu_options' ); // Add more options here ?>
-
- <p class="submit"><input type="submit" class="button-primary" name="Submit" value="<?php esc_attr_e( 'Save Changes' ) ?>" /></p>
- </form>
-</div>
-
-<?php include( './admin-footer.php' ); ?>
+wp_redirect( network_admin_url('settings.php') );
\ No newline at end of file
require_once( './admin.php' );
-if ( ! is_multisite() )
- wp_die( __( 'Multisite support is not enabled.' ) );
+wp_redirect( network_admin_url('sites.php') );
+exit;
-if ( ! current_user_can( 'manage_sites' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
-$title = __( 'Sites' );
-$parent_file = 'ms-admin.php';
-
-if ( isset( $_GET['action'] ) && 'editblog' == $_GET['action'] ) {
- add_contextual_help($current_screen,
- '<p>' . __('This extensive list of options has five modules: Site Info, Site Options, allowing Site Themes for this given site, changing user roles and passwords for that site, adding a new user, and Miscellaneous Site Actions (upload size limits).') . '</p>' .
- '<p>' . __('Note that some fields in Site Options are grayed out and say Serialized Data. These are stored values in the database which you cannot change from here.') . '</p>' .
- '<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Super_Admin_Sites_Edit_Site" target="_blank">Documentation on Editing Sites</a>') . '</p>' .
- '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
- );
-} else {
- add_contextual_help($current_screen,
- '<p>' . __('Add New takes you farther down on this same page. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.') . '</p>' .
- '<p>' . __('This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.') . '</p>' .
- '<p>' . __('Hovering over each site reveals seven options (three for the primary site):') . '</p>' .
- '<ul><li>' . __('an Edit link to a separate Edit Site screen.') . '</li>' .
- '<li>' . __('Backend means the Dashboard for that site.') . '</li>' .
- '<li>' . __('Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.') . '</li>' .
- '<li>' . __('Delete which is a permanent action after the confirmations screen.') . '</li>' .
- '<li>' . __('Visit to go to the frontend site live.') . '</li></ul>' .
- '<p>' . __('The site ID is used internally, and is not shown on the front end of the site or to users/viewers.') . '</p>' .
- '<p>' . __('Clicking on bold settings can re-sort this table. The upper right icons switch between list and excerpt views.') . '</p>' .
- '<p>' . __("Clicking on Add Site, after filling out the address, title, and admin's email address, adds the site instantly to the network and this table. You may want to then click on the action link to edit options for that site.") . '</p>' .
- '<p>' . __('If the admin email for the new site does not exist in the database, a new user will also be created.') . '</p>' .
- '<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Super_Admin_Sites_SubPanel" target="_blank">Documentation on Sites</a>') . '</p>' .
- '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
- );
-}
-
-wp_enqueue_script( 'admin-forms' );
-
-require_once( './admin-header.php' );
-
-$id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0;
-
-if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['action'] ) ) {
- ?>
- <div id="message" class="updated"><p>
- <?php
- switch ( $_GET['action'] ) {
- case 'all_notspam':
- _e( 'Sites removed from spam.' );
- break;
- case 'all_spam':
- _e( 'Sites marked as spam.' );
- break;
- case 'all_delete':
- _e( 'Sites deleted.' );
- break;
- case 'delete':
- _e( 'Site deleted.' );
- break;
- case 'add-blog':
- _e( 'Site added.' );
- break;
- case 'archive':
- _e( 'Site archived.' );
- break;
- case 'unarchive':
- _e( 'Site unarchived.' );
- break;
- case 'activate':
- _e( 'Site activated.' );
- break;
- case 'deactivate':
- _e( 'Site deactivated.' );
- break;
- case 'unspam':
- _e( 'Site removed from spam.' );
- break;
- case 'spam':
- _e( 'Site marked as spam.' );
- break;
- default:
- _e( 'Settings saved.' );
- break;
- }
- ?>
- </p></div>
- <?php
-}
-
-$action = isset( $_GET['action'] ) ? $_GET['action'] : 'list';
-
-switch ( $action ) {
- // Edit site
- case 'editblog':
- $blog_prefix = $wpdb->get_blog_prefix( $id );
- $options = $wpdb->get_results( "SELECT * FROM {$blog_prefix}options WHERE option_name NOT LIKE '\_%' AND option_name NOT LIKE '%user_roles'" );
- $details = get_blog_details( $id );
- if ( $details->site_id != $wpdb->siteid )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
- $editblog_roles = get_blog_option( $id, "{$blog_prefix}user_roles" );
- $is_main_site = is_main_site( $id );
- ?>
- <div class="wrap">
- <?php screen_icon(); ?>
- <h2><?php _e( 'Edit Site' ); ?> - <a href="<?php echo esc_url( get_home_url( $id ) ); ?>"><?php echo esc_url( get_home_url( $id ) ); ?></a></h2>
- <form method="post" action="ms-edit.php?action=updateblog">
- <?php wp_nonce_field( 'editblog' ); ?>
- <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
- <div class="metabox-holder" style="width:49%;float:left;">
- <div id="blogedit_bloginfo" class="postbox">
- <h3 class="hndle"><span><?php _e( 'Site info (wp_blogs)' ); ?></span></h3>
- <div class="inside">
- <table class="form-table">
- <tr class="form-field form-required">
- <th scope="row"><?php _e( 'Domain' ) ?></th>
- <?php
- $protocol = is_ssl() ? 'https://' : 'http://';
- if ( $is_main_site ) { ?>
- <td><code><?php echo $protocol; echo esc_attr( $details->domain ) ?></code></td>
- <?php } else { ?>
- <td><?php echo $protocol; ?><input name="blog[domain]" type="text" id="domain" value="<?php echo esc_attr( $details->domain ) ?>" size="33" /></td>
- <?php } ?>
- </tr>
- <tr class="form-field form-required">
- <th scope="row"><?php _e( 'Path' ) ?></th>
- <?php if ( $is_main_site ) { ?>
- <td><code><?php echo esc_attr( $details->path ) ?></code></td>
- <?php } else { ?>
- <td><input name="blog[path]" type="text" id="path" value="<?php echo esc_attr( $details->path ) ?>" size="40" style='margin-bottom:5px;' />
- <br /><input type="checkbox" style="width:20px;" name="update_home_url" value="update" <?php if ( get_blog_option( $id, 'siteurl' ) == untrailingslashit( get_blogaddress_by_id ($id ) ) || get_blog_option( $id, 'home' ) == untrailingslashit( get_blogaddress_by_id( $id ) ) ) echo 'checked="checked"'; ?> /> <?php _e( 'Update <code>siteurl</code> and <code>home</code> as well.' ); ?></td>
- <?php } ?>
- </tr>
- <tr class="form-field">
- <th scope="row"><?php _ex( 'Registered', 'site' ) ?></th>
- <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr( $details->registered ) ?>" size="40" /></td>
- </tr>
- <tr class="form-field">
- <th scope="row"><?php _e('Last Updated') ?></th>
- <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr( $details->last_updated ) ?>" size="40" /></td>
- </tr>
- <?php
- $radio_fields = array( 'public' => __( 'Public' ) );
- if ( ! $is_main_site ) {
- $radio_fields['archived'] = __( 'Archived' );
- $radio_fields['spam'] = _x( 'Spam', 'site' );
- $radio_fields['deleted'] = __( 'Deleted' );
- }
- $radio_fields['mature'] = __( 'Mature' );
- foreach ( $radio_fields as $field_key => $field_label ) {
- ?>
- <tr>
- <th scope="row"><?php echo $field_label; ?></th>
- <td>
- <input type="radio" name="blog[<?php echo $field_key; ?>]" id="blog_<?php echo $field_key; ?>_1" value="1"<?php checked( $details->$field_key, 1 ); ?> />
- <label for="blog_<?php echo $field_key; ?>_1"><?php _e('Yes'); ?></label>
- <input type="radio" name="blog[<?php echo $field_key; ?>]" id="blog_<?php echo $field_key; ?>_0" value="0"<?php checked( $details->$field_key, 0 ); ?> />
- <label for="blog_<?php echo $field_key; ?>_0"><?php _e('No'); ?></label>
- </td>
- </tr>
- <?php } ?>
- </table>
- <p class="submit" style="text-align:center;"><input type="submit" name="Submit" value="<?php esc_attr_e( 'Update Options' ) ?>" /></p>
- </div>
- </div>
-
- <div id="blogedit_blogoptions" class="postbox" >
- <h3 class="hndle"><span><?php printf( __( 'Site options (%soptions)' ), $blog_prefix ); ?></span></h3>
- <div class="inside">
- <table class="form-table">
- <?php
- $editblog_default_role = 'subscriber';
- foreach ( $options as $option ) {
- if ( $option->option_name == 'default_role' )
- $editblog_default_role = $option->option_value;
- $disabled = false;
- $class = 'all-options';
- if ( is_serialized( $option->option_value ) ) {
- if ( is_serialized_string( $option->option_value ) ) {
- $option->option_value = esc_html( maybe_unserialize( $option->option_value ), 'single' );
- } else {
- $option->option_value = 'SERIALIZED DATA';
- $disabled = true;
- $class = 'all-options disabled';
- }
- }
- if ( strpos( $option->option_value, "\n" ) !== false ) {
- ?>
- <tr class="form-field">
- <th scope="row"><?php echo ucwords( str_replace( "_", " ", $option->option_name ) ) ?></th>
- <td><textarea class="<?php echo $class; ?>" rows="5" cols="40" name="option[<?php echo esc_attr( $option->option_name ) ?>]" id="<?php echo esc_attr( $option->option_name ) ?>"<?php disabled( $disabled ) ?>><?php echo wp_htmledit_pre( $option->option_value ) ?></textarea></td>
- </tr>
- <?php
- } else {
- ?>
- <tr class="form-field">
- <th scope="row"><?php echo esc_html( ucwords( str_replace( "_", " ", $option->option_name ) ) ); ?></th>
- <?php if ( $is_main_site && in_array( $option->option_name, array( 'siteurl', 'home' ) ) ) { ?>
- <td><code><?php echo esc_html( $option->option_value ) ?></code></td>
- <?php } else { ?>
- <td><input class="<?php echo $class; ?>" name="option[<?php echo esc_attr( $option->option_name ) ?>]" type="text" id="<?php echo esc_attr( $option->option_name ) ?>" value="<?php echo esc_attr( $option->option_value ) ?>" size="40" <?php disabled( $disabled ) ?> /></td>
- <?php } ?>
- </tr>
- <?php
- }
- } // End foreach
- ?>
- </table>
- <p class="submit" style="text-align:center;"><input type="submit" name="Submit" value="<?php esc_attr_e( 'Update Options' ) ?>" /></p>
- </div>
- </div>
- </div>
-
- <div class="metabox-holder" style="width:49%;float:right;">
- <?php
- // Site Themes
- $themes = get_themes();
- $blog_allowed_themes = wpmu_get_blog_allowedthemes( $id );
- $allowed_themes = get_site_option( 'allowedthemes' );
-
- if ( ! $allowed_themes )
- $allowed_themes = array_keys( $themes );
-
- $out = '';
- foreach ( $themes as $key => $theme ) {
- $theme_key = esc_html( $theme['Stylesheet'] );
- if ( ! isset( $allowed_themes[$theme_key] ) ) {
- $checked = isset( $blog_allowed_themes[ $theme_key ] ) ? 'checked="checked"' : '';
- $out .= '<tr class="form-field form-required">
- <th title="' . esc_attr( $theme["Description"] ).'" scope="row">' . esc_html( $key ) . '</th>
- <td><label><input name="theme[' . esc_attr( $theme_key ) . ']" type="checkbox" style="width:20px;" value="on" '.$checked.'/> ' . __( 'Active' ) . '</label></td>
- </tr>';
- }
- }
-
- if ( $out != '' ) {
- ?>
- <div id="blogedit_blogthemes" class="postbox">
- <h3 class="hndle"><span><?php esc_html_e( 'Site Themes' ); ?></span></h3>
- <div class="inside">
- <p class="description"><?php _e( 'Activate the themename of an existing theme and hit "Update Options" to allow the theme for this site.' ) ?></p>
- <table class="form-table">
- <?php echo $out; ?>
- </table>
- <p class="submit" style="text-align:center;"><input type="submit" name="Submit" value="<?php esc_attr_e( 'Update Options' ) ?>" /></p>
- </div></div>
- <?php }
-
- // Site users
- $blogusers = get_users_of_blog( $id );
- if ( is_array( $blogusers ) ) {
- echo '<div id="blogedit_blogusers" class="postbox"><h3 class="hndle"><span>' . __( 'Site Users' ) . '</span></h3><div class="inside">';
- echo '<table class="form-table">';
- echo "<tr><th>" . __( 'User' ) . "</th><th>" . __( 'Role' ) . "</th><th>" . __( 'Password' ) . "</th><th>" . __( 'Remove' ) . "</th></tr>";
- reset( $blogusers );
- foreach ( (array) $blogusers as $key => $val ) {
- if ( isset( $val->meta_value ) && ! $val->meta_value )
- continue;
- $t = @unserialize( $val->meta_value );
- if ( is_array( $t ) ) {
- reset( $t );
- $existing_role = key( $t );
- }
- echo '<tr><td><a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a></td>';
- if ( $val->user_id != $current_user->data->ID ) {
- ?>
- <td>
- <select name="role[<?php echo $val->user_id ?>]" id="new_role_1"><?php
- foreach ( $editblog_roles as $role => $role_assoc ){
- $name = translate_user_role( $role_assoc['name'] );
- echo '<option ' . selected( $role, $existing_role, false ) . ' value="' . esc_attr( $role ) . '">' . esc_html( $name ) . '</option>';
- }
- ?>
- </select>
- </td>
- <td>
- <input type="text" name="user_password[<?php echo esc_attr( $val->user_id ) ?>]" />
- </td>
- <?php
- echo '<td><input title="' . __( 'Click to remove user' ) . '" type="checkbox" name="blogusers[' . esc_attr( $val->user_id ) . ']" /></td>';
- } else {
- echo "<td><strong>" . __ ( 'N/A' ) . "</strong></td><td><strong>" . __ ( 'N/A' ) . "</strong></td><td><strong>" . __( 'N/A' ) . "</strong></td>";
- }
- echo '</tr>';
- }
- echo "</table>";
- echo '<p class="submit" style="text-align:center;"><input type="submit" name="Submit" value="' . esc_attr__( 'Update Options' ) . '" /></p>';
- echo "</div></div>";
- }
- ?>
-
- <div id="blogedit_blogadduser" class="postbox">
- <h3 class="hndle"><span><?php _e( 'Add a new user' ); ?></span></h3>
- <div class="inside">
- <p class="description"><?php _e( 'Enter the username of an existing user and hit “Update Options” to add the user.' ) ?></p>
- <table class="form-table">
- <tr>
- <th scope="row"><?php _e( 'User Login:' ) ?></th>
- <td><input type="text" name="newuser" id="newuser" /></td>
- </tr>
- <tr>
- <th scope="row"><?php _e( 'Role:' ) ?></th>
- <td>
- <select name="new_role" id="new_role_0">
- <?php
- reset( $editblog_roles );
- foreach ( $editblog_roles as $role => $role_assoc ){
- $name = translate_user_role( $role_assoc['name'] );
- $selected = ( $role == $editblog_default_role ) ? 'selected="selected"' : '';
- echo '<option ' . $selected . ' value="' . esc_attr( $role ) . '">' . esc_html( $name ) . '</option>';
- }
- ?>
- </select>
- </td>
- </tr>
- </table>
- <p class="submit" style="text-align:center;"><input type="submit" name="Submit" value="<?php esc_attr_e( 'Update Options' ) ?>" /></p>
- </div>
- </div>
-
- <div id="blogedit_miscoptions" class="postbox">
- <h3 class="hndle"><span><?php _e( 'Misc Site Actions' ) ?></span></h3>
- <div class="inside">
- <table class="form-table">
- <?php do_action( 'wpmueditblogaction', $id ); ?>
- </table>
- <p class="submit" style="text-align:center;"><input type="submit" name="Submit" value="<?php esc_attr_e( 'Update Options' ) ?>" /></p>
- </div>
- </div>
- </div>
-
- <div style="clear:both;"></div>
- </form>
- </div>
- <?php
- break;
-
- // List sites
- case 'list':
- default:
- $pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
- if ( empty($pagenum) )
- $pagenum = 1;
-
- $per_page = (int) get_user_option( 'ms_sites_per_page' );
- if ( empty( $per_page ) || $per_page < 1 )
- $per_page = 15;
-
- $per_page = apply_filters( 'ms_sites_per_page', $per_page );
-
- $s = isset( $_GET['s'] ) ? stripslashes( trim( $_GET[ 's' ] ) ) : '';
- $like_s = esc_sql( like_escape( $s ) );
-
- $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ";
-
- if ( isset( $_GET['searchaction'] ) ) {
- if ( 'name' == $_GET['searchaction'] ) {
- $query .= " AND ( {$wpdb->blogs}.domain LIKE '%{$like_s}%' OR {$wpdb->blogs}.path LIKE '%{$like_s}%' ) ";
- } elseif ( 'id' == $_GET['searchaction'] ) {
- $query .= " AND {$wpdb->blogs}.blog_id = '{$like_s}' ";
- } elseif ( 'ip' == $_GET['searchaction'] ) {
- $query = "SELECT *
- FROM {$wpdb->blogs}, {$wpdb->registration_log}
- WHERE site_id = '{$wpdb->siteid}'
- AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id
- AND {$wpdb->registration_log}.IP LIKE ('%{$like_s}%')";
- }
- }
-
- $order_by = isset( $_GET['sortby'] ) ? $_GET['sortby'] : 'id';
- if ( $order_by == 'registered' ) {
- $query .= ' ORDER BY registered ';
- } elseif ( $order_by == 'lastupdated' ) {
- $query .= ' ORDER BY last_updated ';
- } elseif ( $order_by == 'blogname' ) {
- $query .= ' ORDER BY domain ';
- } else {
- $order_by = 'id';
- $query .= " ORDER BY {$wpdb->blogs}.blog_id ";
- }
-
- $order = ( isset( $_GET['order'] ) && 'DESC' == $_GET['order'] ) ? "DESC" : "ASC";
- $query .= $order;
-
- $total = $wpdb->get_var( str_replace( 'SELECT *', 'SELECT COUNT(blog_id)', $query ) );
-
- $query .= " LIMIT " . intval( ( $pagenum - 1 ) * $per_page ) . ", " . intval( $per_page );
- $blog_list = $wpdb->get_results( $query, ARRAY_A );
-
- $num_pages = ceil($total / $per_page);
- $page_links = paginate_links( array(
- 'base' => add_query_arg( 'paged', '%#%' ),
- 'format' => '',
- 'prev_text' => __( '«' ),
- 'next_text' => __( '»' ),
- 'total' => $num_pages,
- 'current' => $pagenum
- ));
-
- if ( empty( $_GET['mode'] ) )
- $mode = 'list';
- else
- $mode = esc_attr( $_GET['mode'] );
- ?>
-
- <div class="wrap">
- <?php screen_icon(); ?>
- <h2><?php _e('Sites') ?>
- <a href="#form-add-site" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'sites' ); ?></a>
- <?php
- if ( isset( $_GET['s'] ) && $_GET['s'] )
- printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', esc_html( $s ) );
- ?>
- </h2>
-
- <form action="ms-sites.php" method="get" id="ms-search">
- <p class="search-box">
- <input type="hidden" name="action" value="blogs" />
- <input type="text" name="s" value="<?php echo esc_attr( $s ); ?>" />
- <input type="submit" class="button" value="<?php esc_attr_e( 'Search Site by' ) ?>" />
- <select name="searchaction">
- <option value="name" selected="selected"><?php _e( 'Name' ); ?></option>
- <option value="id"><?php _e( 'ID' ); ?></option>
- <option value="ip"><?php _e( 'IP address' ); ?></option>
- </select>
- </p>
- </form>
-
- <form id="form-site-list" action="ms-edit.php?action=allblogs" method="post">
- <input type="hidden" name="mode" value="<?php echo esc_attr( $mode ); ?>" />
- <div class="tablenav">
- <div class="alignleft actions">
- <select name="action">
- <option value="-1" selected="selected"><?php _e( 'Bulk Actions' ); ?></option>
- <option value="delete"><?php _e( 'Delete' ); ?></option>
- <option value="spam"><?php _ex( 'Mark as Spam', 'site' ); ?></option>
- <option value="notspam"><?php _ex( 'Not Spam', 'site' ); ?></option>
- </select>
- <input type="submit" value="<?php esc_attr_e( 'Apply' ); ?>" name="doaction" id="doaction" class="button-secondary action" />
- <?php wp_nonce_field( 'bulk-ms-sites', '_wpnonce_bulk-ms-sites' ); ?>
- </div>
-
- <?php if ( $page_links ) { ?>
- <div class="tablenav-pages">
- <?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
- number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
- number_format_i18n( min( $pagenum * $per_page, $total ) ),
- number_format_i18n( $total ),
- $page_links
- ); echo $page_links_text; ?>
- </div>
- <?php } ?>
-
- <div class="view-switch">
- <a href="<?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ) ?>"><img <?php if ( 'list' == $mode ) echo 'class="current"'; ?> id="view-switch-list" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e( 'List View' ) ?>" alt="<?php _e( 'List View' ) ?>" /></a>
- <a href="<?php echo esc_url( add_query_arg( 'mode', 'excerpt', $_SERVER['REQUEST_URI'] ) ) ?>"><img <?php if ( 'excerpt' == $mode ) echo 'class="current"'; ?> id="view-switch-excerpt" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e( 'Excerpt View' ) ?>" alt="<?php _e( 'Excerpt View' ) ?>" /></a>
- </div>
-
- </div>
-
- <div class="clear"></div>
-
- <?php
- // define the columns to display, the syntax is 'internal name' => 'display name'
- $blogname_columns = ( is_subdomain_install() ) ? __( 'Domain' ) : __( 'Path' );
- $sites_columns = array(
- 'id' => __( 'ID' ),
- 'blogname' => $blogname_columns,
- 'lastupdated' => __( 'Last Updated'),
- 'registered' => _x( 'Registered', 'site' ),
- 'users' => __( 'Users' )
- );
-
- if ( has_filter( 'wpmublogsaction' ) )
- $sites_columns['plugins'] = __( 'Actions' );
-
- $sites_columns = apply_filters( 'wpmu_blogs_columns', $sites_columns );
- ?>
-
- <table class="widefat">
- <thead>
- <tr>
- <th class="manage-column column-cb check-column" id="cb" scope="col">
- <input type="checkbox" />
- </th>
- <?php
- $col_url = '';
- foreach($sites_columns as $column_id => $column_display_name) {
- $column_link = "<a href='";
- $order2 = '';
- if ( $order_by == $column_id )
- $order2 = ( $order == 'DESC' ) ? 'ASC' : 'DESC';
-
- $column_link .= esc_url( add_query_arg( array( 'order' => $order2, 'paged' => $pagenum, 'sortby' => $column_id ), remove_query_arg( array('action', 'updated'), $_SERVER['REQUEST_URI'] ) ) );
- $column_link .= "'>{$column_display_name}</a>";
- $col_url .= '<th scope="col">' . ( ( $column_id == 'users' || $column_id == 'plugins' ) ? $column_display_name : $column_link ) . '</th>';
- }
- echo $col_url ?>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <th class="manage-column column-cb check-column" id="cb1" scope="col">
- <input type="checkbox" />
- </th>
- <?php echo $col_url ?>
- </tr>
- </tfoot>
- <tbody id="the-site-list" class="list:site">
- <?php
- $status_list = array( 'archived' => array( 'site-archived', __( 'Archived' ) ), 'spam' => array( 'site-spammed', _x( 'Spam', 'site' ) ), 'deleted' => array( 'site-deleted', __( 'Deleted' ) ), 'mature' => array( 'site-mature', __( 'Mature' ) ) );
- if ( $blog_list ) {
- $class = '';
- foreach ( $blog_list as $blog ) {
- $class = ( 'alternate' == $class ) ? '' : 'alternate';
- reset( $status_list );
-
- $blog_states = array();
- foreach ( $status_list as $status => $col ) {
- if ( get_blog_status( $blog['blog_id'], $status ) == 1 ) {
- $class = $col[0];
- $blog_states[] = $col[1];
- }
- }
- $blog_state = '';
- if ( ! empty( $blog_states ) ) {
- $state_count = count( $blog_states );
- $i = 0;
- $blog_state .= ' - ';
- foreach ( $blog_states as $state ) {
- ++$i;
- ( $i == $state_count ) ? $sep = '' : $sep = ', ';
- $blog_state .= "<span class='post-state'>$state$sep</span>";
- }
- }
- echo "<tr class='$class'>";
-
- $blogname = ( is_subdomain_install() ) ? str_replace( '.'.$current_site->domain, '', $blog['domain'] ) : $blog['path'];
- foreach ( $sites_columns as $column_name=>$column_display_name ) {
- switch ( $column_name ) {
- case 'id': ?>
- <th scope="row" class="check-column">
- <input type="checkbox" id="blog_<?php echo $blog['blog_id'] ?>" name="allblogs[]" value="<?php echo esc_attr( $blog['blog_id'] ) ?>" />
- </th>
- <th valign="top" scope="row">
- <?php echo $blog['blog_id'] ?>
- </th>
- <?php
- break;
-
- case 'blogname': ?>
- <td class="column-title">
- <a href="<?php echo esc_url( admin_url( 'ms-sites.php?action=editblog&id=' . $blog['blog_id'] ) ); ?>" class="edit"><?php echo $blogname . $blog_state; ?></a>
- <?php
- if ( 'list' != $mode )
- echo '<p>' . sprintf( _x( '%1$s – <em>%2$s</em>', '%1$s: site name. %2$s: site tagline.' ), get_blog_option( $blog['blog_id'], 'blogname' ), get_blog_option( $blog['blog_id'], 'blogdescription ' ) ) . '</p>';
-
- // Preordered.
- $actions = array(
- 'edit' => '', 'backend' => '',
- 'activate' => '', 'deactivate' => '',
- 'archive' => '', 'unarchive' => '',
- 'spam' => '', 'unspam' => '',
- 'delete' => '',
- 'visit' => '',
- );
-
- $actions['edit'] = '<span class="edit"><a href="' . esc_url( admin_url( 'ms-sites.php?action=editblog&id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>';
- $actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url($blog['blog_id']) ) . "' class='edit'>" . __( 'Backend' ) . '</a></span>';
- if ( $current_site->blog_id != $blog['blog_id'] ) {
- if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' )
- $actions['activate'] = '<span class="activate"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ) ) . '">' . __( 'Activate' ) . '</a></span>';
- else
- $actions['deactivate'] = '<span class="activate"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=deactivateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to deactivate the site %s' ), $blogname ) ) ) ) . '">' . __( 'Deactivate' ) . '</a></span>';
-
- if ( get_blog_status( $blog['blog_id'], 'archived' ) == '1' )
- $actions['unarchive'] = '<span class="archive"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=unarchiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unarchive the site %s.' ), $blogname ) ) ) ) . '">' . __( 'Unarchive' ) . '</a></span>';
- else
- $actions['archive'] = '<span class="archive"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=archiveblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to archive the site %s.' ), $blogname ) ) ) ) . '">' . _x( 'Archive', 'verb; site' ) . '</a></span>';
-
- if ( get_blog_status( $blog['blog_id'], 'spam' ) == '1' )
- $actions['unspam'] = '<span class="spam"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=unspamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to unspam the site %s.' ), $blogname ) ) ) ) . '">' . _x( 'Not Spam', 'site' ) . '</a></span>';
- else
- $actions['spam'] = '<span class="spam"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=spamblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to mark the site %s as spam.' ), $blogname ) ) ) ) . '">' . _x( 'Spam', 'site' ) . '</a></span>';
-
- $actions['delete'] = '<span class="delete"><a href="' . esc_url( admin_url( 'ms-edit.php?action=confirm&action2=deleteblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to delete the site %s.' ), $blogname ) ) ) ) . '">' . __( 'Delete' ) . '</a></span>';
- }
-
- $actions['visit'] = "<span class='view'><a href='" . esc_url( get_home_url( $blog['blog_id'] ) ) . "' rel='permalink'>" . __( 'Visit' ) . '</a></span>';
- $actions = array_filter( $actions );
- if ( count( $actions ) ) : ?>
- <div class="row-actions">
- <?php echo implode( ' | ', $actions ); ?>
- </div>
- <?php endif; ?>
- </td>
- <?php
- break;
-
- case 'lastupdated': ?>
- <td valign="top">
- <?php
- if ( 'list' == $mode )
- $date = 'Y/m/d';
- else
- $date = 'Y/m/d \<\b\r \/\> g:i:s a';
- echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __( 'Never' ) : mysql2date( __( $date ), $blog['last_updated'] ); ?>
- </td>
- <?php
- break;
- case 'registered': ?>
- <td valign="top">
- <?php
- if ( $blog['registered'] == '0000-00-00 00:00:00' )
- echo '—';
- else
- echo mysql2date( __( $date ), $blog['registered'] );
- ?>
- </td>
- <?php
- break;
- case 'users': ?>
- <td valign="top">
- <?php
- $blogusers = get_users_of_blog( $blog['blog_id'] );
- if ( is_array( $blogusers ) ) {
- $blogusers_warning = '';
- if ( count( $blogusers ) > 5 ) {
- $blogusers = array_slice( $blogusers, 0, 5 );
- $blogusers_warning = __( 'Only showing first 5 users.' ) . ' <a href="' . esc_url( get_admin_url( $blog['blog_id'], 'users.php' ) ) . '">' . __( 'More' ) . '</a>';
- }
- foreach ( $blogusers as $key => $val ) {
- echo '<a href="' . esc_url( admin_url( 'user-edit.php?user_id=' . $val->user_id ) ) . '">' . esc_html( $val->user_login ) . '</a> ';
- if ( 'list' != $mode )
- echo '(' . $val->user_email . ')';
- echo '<br />';
- }
- if ( $blogusers_warning != '' )
- echo '<strong>' . $blogusers_warning . '</strong><br />';
- }
- ?>
- </td>
- <?php
- break;
-
- case 'plugins': ?>
- <?php if ( has_filter( 'wpmublogsaction' ) ) { ?>
- <td valign="top">
- <?php do_action( 'wpmublogsaction', $blog['blog_id'] ); ?>
- </td>
- <?php } ?>
- <?php break;
-
- default: ?>
- <?php if ( has_filter( 'manage_blogs_custom_column' ) ) { ?>
- <td valign="top">
- <?php do_action( 'manage_blogs_custom_column', $column_name, $blog['blog_id'] ); ?>
- </td>
- <?php } ?>
- <?php break;
- }
- }
- ?>
- </tr>
- <?php
- }
- } else { ?>
- <tr>
- <td colspan="<?php echo (int) count( $sites_columns ); ?>"><?php _e( 'No sites found.' ) ?></td>
- </tr>
- <?php
- } // end if ($blogs)
- ?>
-
- </tbody>
- </table>
- <div class="tablenav">
- <?php
- if ( $page_links )
- echo "<div class='tablenav-pages'>$page_links_text</div>";
- ?>
-
- <div class="alignleft actions">
- <select name="action2">
- <option value="-1" selected="selected"><?php _e( 'Bulk Actions' ); ?></option>
- <option value="delete"><?php _e( 'Delete' ); ?></option>
- <option value="spam"><?php _ex( 'Mark as Spam', 'site' ); ?></option>
- <option value="notspam"><?php _ex( 'Not Spam', 'site' ); ?></option>
- </select>
- <input type="submit" value="<?php esc_attr_e( 'Apply' ); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
- </div>
- <br class="clear" />
- </div>
-
- </form>
- </div>
-
- <div id="form-add-site" class="wrap">
- <h3><?php _e( 'Add Site' ) ?></h3>
- <form method="post" action="ms-edit.php?action=addblog">
- <?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?>
- <table class="form-table">
- <tr class="form-field form-required">
- <th scope="row"><?php _e( 'Site Address' ) ?></th>
- <td>
- <?php if ( is_subdomain_install() ) { ?>
- <input name="blog[domain]" type="text" class="regular-text" title="<?php _e( 'Domain' ) ?>"/>.<?php echo preg_replace( '|^www\.|', '', $current_site->domain );?>
- <?php } else {
- echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php _e( 'Domain' ) ?>"/>
- <?php }
- echo '<p>' . __( 'Only the characters a-z and 0-9 recommended.' ) . '</p>';
- ?>
- </td>
- </tr>
- <tr class="form-field form-required">
- <th scope="row"><?php _e( 'Site Title' ) ?></th>
- <td><input name="blog[title]" type="text" class="regular-text" title="<?php _e( 'Title' ) ?>"/></td>
- </tr>
- <tr class="form-field form-required">
- <th scope="row"><?php _e( 'Admin Email' ) ?></th>
- <td><input name="blog[email]" type="text" class="regular-text" title="<?php _e( 'Email' ) ?>"/></td>
- </tr>
- <tr class="form-field">
- <td colspan="2"><?php _e( 'A new user will be created if the above email address is not in the database.' ) ?><br /><?php _e( 'The username and password will be mailed to this email address.' ) ?></td>
- </tr>
- </table>
- <p class="submit">
- <input class="button" type="submit" name="go" value="<?php esc_attr_e( 'Add Site' ) ?>" /></p>
- </form>
- </div>
- <?php
- break;
-} // end switch( $action )
-
-include( './admin-footer.php' ); ?>
+?>
require_once( './admin.php' );
-if ( ! current_user_can( 'manage_network_themes' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
-$title = __( 'Network Themes' );
-$parent_file = 'ms-admin.php';
-
-add_contextual_help($current_screen,
- '<p>' . __('This screen enables and disables the inclusion of themes available to choose in the Appearance menu for each site. It does not activate or deactivate which theme a site is currently using.') . '</p>' .
- '<p>' . __('If the network admin disables a theme that is in use, it can still remain selected on that site. If another theme is chosen, the disabled theme will not appear in the site’s Appearance > Themes screen.') . '</p>' .
- '<p>' . __('Themes can be enabled on a site by site basis by the network admin on the Edit Site screen you go to via the Edit action link on the Sites screen.') . '</p>' .
- '<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Super_Admin_Themes_SubPanel" target="_blank">Documentation on Network Themes</a>') . '</p>' .
- '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
-);
-
-require_once( './admin-header.php' );
-
-if ( isset( $_GET['updated'] ) ) {
- ?>
- <div id="message" class="updated"><p><?php _e( 'Site themes saved.' ) ?></p></div>
- <?php
-}
-
-$themes = get_themes();
-$allowed_themes = get_site_allowed_themes();
+wp_redirect( network_admin_url('themes.php') );
+exit;
?>
-<div class="wrap">
- <form action="<?php echo esc_url( admin_url( 'ms-edit.php?action=updatethemes' ) ); ?>" method="post">
- <?php screen_icon(); ?>
- <h2><?php _e( 'Network Themes' ) ?></h2>
- <p><?php _e( 'Themes must be enabled for your network before they will be available to individual sites.' ) ?></p>
- <p class="submit">
- <input type="submit" value="<?php _e( 'Apply Changes' ) ?>" /></p>
- <table class="widefat">
- <thead>
- <tr>
- <th style="width:15%;"><?php _e( 'Enable' ) ?></th>
- <th style="width:25%;"><?php _e( 'Theme' ) ?></th>
- <th style="width:10%;"><?php _e( 'Version' ) ?></th>
- <th style="width:60%;"><?php _e( 'Description' ) ?></th>
- </tr>
- </thead>
- <tbody id="plugins">
- <?php
- $total_theme_count = $activated_themes_count = 0;
- $class = '';
- foreach ( (array) $themes as $key => $theme ) {
- $total_theme_count++;
- $theme_key = esc_html( $theme['Stylesheet'] );
- $class = ( 'alt' == $class ) ? '' : 'alt';
- $class1 = $enabled = $disabled = '';
- $enabled = $disabled = false;
-
- if ( isset( $allowed_themes[$theme_key] ) == true ) {
- $enabled = true;
- $activated_themes_count++;
- $class1 = 'active';
- } else {
- $disabled = true;
- }
- ?>
- <tr valign="top" class="<?php echo $class . ' ' . $class1; ?>">
- <td>
- <label><input name="theme[<?php echo $theme_key ?>]" type="radio" id="enabled_<?php echo $theme_key ?>" value="enabled" <?php checked( $enabled ) ?> /> <?php _e( 'Yes' ) ?></label>
-
- <label><input name="theme[<?php echo $theme_key ?>]" type="radio" id="disabled_<?php echo $theme_key ?>" value="disabled" <?php checked( $disabled ) ?> /> <?php _e( 'No' ) ?></label>
- </td>
- <th scope="row" style="text-align:left;"><?php echo $key ?></th>
- <td><?php echo $theme['Version'] ?></td>
- <td><?php echo $theme['Description'] ?></td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
-
- <p class="submit">
- <input type="submit" value="<?php _e( 'Apply Changes' ) ?>" /></p>
- </form>
-
- <h3><?php _e( 'Total' )?></h3>
- <p>
- <?php printf( __( 'Themes Installed: %d' ), $total_theme_count); ?>
- <br />
- <?php printf( __( 'Themes Enabled: %d' ), $activated_themes_count); ?>
- </p>
-</div>
-
-<?php include( './admin-footer.php' ); ?>
require_once('admin.php');
-if ( !is_multisite() )
- wp_die( __( 'Multisite support is not enabled.' ) );
+wp_redirect( network_admin_url('upgrade.php') );
+exit;
-require_once( ABSPATH . WPINC . '/http.php' );
-
-$title = __( 'Update Network' );
-$parent_file = 'ms-admin.php';
-
-add_contextual_help($current_screen,
- '<p>' . __('Only use this screen once you have updated to a new version of WordPress through Dashboard > Updates. Clicking the Update Network button will step through each site in the network, five at a time, and make sure any database upgrades are applied.') . '</p>' .
- '<p>' . __('If a version update to core has not happened, clicking this button won’t affect anything.') . '</p>' .
- '<p>' . __('If this process fails for any reason, users logging in to their sites will force the same update.') . '</p>' .
- '<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Super_Admin_Update_SubPanel" target="_blank">Update Network Documentation</a>') . '</p>' .
- '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
-);
-
-require_once('admin-header.php');
-
-if ( ! current_user_can( 'manage_network' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
-echo '<div class="wrap">';
-screen_icon();
-echo '<h2>' . __( 'Update Network' ) . '</h2>';
-
-$action = isset($_GET['action']) ? $_GET['action'] : 'show';
-
-switch ( $action ) {
- case "upgrade":
- $n = ( isset($_GET['n']) ) ? intval($_GET['n']) : 0;
-
- if ( $n < 5 ) {
- global $wp_db_version;
- update_site_option( 'wpmu_upgrade_site', $wp_db_version );
- }
-
- $blogs = $wpdb->get_results( "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A );
- if ( empty( $blogs ) ) {
- echo '<p>' . __( 'All done!' ) . '</p>';
- break;
- }
- echo "<ul>";
- foreach ( (array) $blogs as $details ) {
- $siteurl = get_blog_option( $details['blog_id'], 'siteurl' );
- echo "<li>$siteurl</li>";
- $response = wp_remote_get( trailingslashit( $siteurl ) . "wp-admin/upgrade.php?step=upgrade_db", array( 'timeout' => 120, 'httpversion' => '1.1' ) );
- if ( is_wp_error( $response ) )
- wp_die( sprintf( __( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: <em>%2$s</em>' ), $siteurl, $response->get_error_message() ) );
- do_action( 'after_mu_upgrade', $response );
- do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] );
- }
- echo "</ul>";
- ?><p><?php _e( 'If your browser doesn’t start loading the next page automatically, click this link:' ); ?> <a class="button" href="ms-upgrade-network.php?action=upgrade&n=<?php echo ($n + 5) ?>"><?php _e("Next Sites"); ?></a></p>
- <script type='text/javascript'>
- <!--
- function nextpage() {
- location.href = "ms-upgrade-network.php?action=upgrade&n=<?php echo ($n + 5) ?>";
- }
- setTimeout( "nextpage()", 250 );
- //-->
- </script><?php
- break;
- case 'show':
- default:
- ?><p><?php _e( 'You can update all the sites on your network through this page. It works by calling the update script of each site automatically. Hit the link below to update.' ); ?></p>
- <p><a class="button" href="ms-upgrade-network.php?action=upgrade"><?php _e("Update Network"); ?></a></p><?php
- do_action( 'wpmu_upgrade_page' );
- break;
-}
?>
-</div>
-
-<?php include('./admin-footer.php'); ?>
require_once( './admin.php' );
-if ( !is_multisite() )
- wp_die( __( 'Multisite support is not enabled.' ) );
-
-if ( ! current_user_can( 'manage_network_users' ) )
- wp_die( __( 'You do not have permission to access this page.' ) );
-
-$title = __( 'Users' );
-$parent_file = 'ms-admin.php';
-
-add_contextual_help($current_screen,
- '<p>' . __('This table shows all users across the network and the sites to which they are assigned.') . '</p>' .
- '<p>' . __('Hover over any user on the list to make the edit links appear. The Edit link on the left will take you to his or her Edit User profile page; the Edit link on the right by any site name goes to an Edit Site screen for that site.') . '</p>' .
- '<p>' . __('You can also go to the user’s profile page by clicking on the individual username.') . '</p>' .
- '<p>' . __('You can sort the table by clicking on any of the bold headings and switch between list and excerpt views by using the icons in the upper right.') . '</p>' .
- '<p>' . __('The bulk action will permanently delete selected users, or mark/unmark those selected as spam. Spam users will have posts removed and will be unable to sign up again with the same email addresses.') . '</p>' .
- '<p>' . __('Add User will add that person to this table and send them an email.') . '</p>' .
- '<p>' . __('Users who are signed up to the network without a site are added as subscribers to the main or primary dashboard site, giving them profile pages to manage their accounts. These users will only see Dashboard and My Sites in the main navigation until a site is created for them.') . '</p>' .
- '<p>' . __('You can make an existing user an additional super admin by going to the Edit User profile page and checking the box to grant that privilege.') . '</p>' .
- '<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Super_Admin_Users_SubPanel" target="_blank">Network Users Documentation</a>') . '</p>' .
- '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
-);
-
-wp_enqueue_script( 'admin-forms' );
-
-require_once( './admin-header.php' );
-
-if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['action'] ) ) {
- ?>
- <div id="message" class="updated"><p>
- <?php
- switch ( $_GET['action'] ) {
- case 'delete':
- _e( 'User deleted.' );
- break;
- case 'all_spam':
- _e( 'Users marked as spam.' );
- break;
- case 'all_notspam':
- _e( 'Users removed from spam.' );
- break;
- case 'all_delete':
- _e( 'Users deleted.' );
- break;
- case 'add':
- _e( 'User added.' );
- break;
- }
- ?>
- </p></div>
- <?php
-}
-
- $pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
- if ( empty( $pagenum ) )
- $pagenum = 1;
-
- $per_page = (int) get_user_option( 'ms_users_per_page' );
- if ( empty( $per_page ) || $per_page < 1 )
- $per_page = 15;
-
- $per_page = apply_filters( 'ms_users_per_page', $per_page );
-
- $s = isset( $_GET['s'] ) ? stripslashes( trim( $_GET[ 's' ] ) ) : '';
- $like_s = esc_sql( like_escape( $s ) );
-
- $query = "SELECT * FROM {$wpdb->users}";
-
- if ( !empty( $like_s ) ) {
- $query .= " WHERE user_login LIKE '%$like_s%' OR user_email LIKE '%$like_s%'";
- }
-
- $order_by = isset( $_GET['sortby'] ) ? $_GET['sortby'] : 'id';
- if ( $order_by == 'email' ) {
- $query .= ' ORDER BY user_email ';
- } elseif ( $order_by == 'login' ) {
- $query .= ' ORDER BY user_login ';
- } elseif ( $order_by == 'name' ) {
- $query .= ' ORDER BY display_name ';
- } elseif ( $order_by == 'registered' ) {
- $query .= ' ORDER BY user_registered ';
- } else {
- $order_by = 'id';
- $query .= ' ORDER BY ID ';
- }
-
- $order = ( isset( $_GET['order'] ) && 'DESC' == $_GET['order'] ) ? 'DESC' : 'ASC';
- $query .= $order;
-
- $total = $wpdb->get_var( str_replace( 'SELECT *', 'SELECT COUNT(ID)', $query ) );
-
- $query .= " LIMIT " . intval( ( $pagenum - 1 ) * $per_page) . ", " . intval( $per_page );
-
- $user_list = $wpdb->get_results( $query, ARRAY_A );
-
- $num_pages = ceil( $total / $per_page );
- $page_links = paginate_links( array(
- 'base' => add_query_arg( 'paged', '%#%' ),
- 'format' => '',
- 'prev_text' => __( '«' ),
- 'next_text' => __( '»' ),
- 'total' => $num_pages,
- 'current' => $pagenum
- ));
-
- if ( empty( $_GET['mode'] ) )
- $mode = 'list';
- else
- $mode = esc_attr( $_GET['mode'] );
-
- ?>
- <div class="wrap">
- <?php screen_icon(); ?>
- <h2><?php esc_html_e( 'Users' ); ?>
- <a href="#form-add-user" class="button add-new-h2"><?php echo esc_html_x( 'Add New' , 'users'); ?></a>
- <?php
- if ( isset( $_GET['s'] ) && $_GET['s'] )
- printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', esc_html( $s ) );
- ?>
- </h2>
-
- <form action="ms-users.php" method="get" class="search-form">
- <p class="search-box">
- <input type="text" name="s" value="<?php echo esc_attr( $s ); ?>" class="search-input" id="user-search-input" />
- <input type="submit" id="post-query-submit" value="<?php esc_attr_e( 'Search Users' ) ?>" class="button" />
- </p>
- </form>
-
- <form id="form-user-list" action='ms-edit.php?action=allusers' method='post'>
- <input type="hidden" name="mode" value="<?php echo esc_attr( $mode ); ?>" />
- <div class="tablenav">
- <div class="alignleft actions">
- <select name="action">
- <option value="-1" selected="selected"><?php _e( 'Bulk Actions' ); ?></option>
- <option value="delete"><?php _e( 'Delete' ); ?></option>
- <option value="spam"><?php _ex( 'Mark as Spam', 'user' ); ?></option>
- <option value="notspam"><?php _ex( 'Not Spam', 'user' ); ?></option>
- </select>
- <input type="submit" value="<?php esc_attr_e( 'Apply' ); ?>" name="doaction" id="doaction" class="button-secondary action" />
- <?php wp_nonce_field( 'bulk-ms-users', '_wpnonce_bulk-ms-users' ); ?>
- </div>
-
- <?php if ( $page_links ) { ?>
- <div class="tablenav-pages">
- <?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
- number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
- number_format_i18n( min( $pagenum * $per_page, $total ) ),
- number_format_i18n( $total ),
- $page_links
- ); echo $page_links_text; ?>
- </div>
- <?php } ?>
-
- <div class="view-switch">
- <a href="<?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ) ?>"><img <?php if ( 'list' == $mode ) echo 'class="current"'; ?> id="view-switch-list" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e( 'List View' ) ?>" alt="<?php _e( 'List View' ) ?>" /></a>
- <a href="<?php echo esc_url( add_query_arg( 'mode', 'excerpt', $_SERVER['REQUEST_URI'] ) ) ?>"><img <?php if ( 'excerpt' == $mode ) echo 'class="current"'; ?> id="view-switch-excerpt" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e( 'Excerpt View' ) ?>" alt="<?php _e( 'Excerpt View' ) ?>" /></a>
- </div>
- </div>
- <div class="clear"></div>
-
- <?php
- // define the columns to display, the syntax is 'internal name' => 'display name'
- $users_columns = array(
- 'id' => __( 'ID' ),
- 'login' => __( 'Username' ),
- 'name' => __( 'Name' ),
- 'email' => __( 'E-mail' ),
- 'registered' => _x( 'Registered', 'user' ),
- 'blogs' => __( 'Sites' )
- );
- $users_columns = apply_filters( 'wpmu_users_columns', $users_columns );
- ?>
- <table class="widefat">
- <thead>
- <tr>
- <th class="manage-column column-cb check-column" scope="col">
- <input type="checkbox" />
- </th>
- <?php
- $col_url = '';
- foreach($users_columns as $column_id => $column_display_name) {
- $column_link = "<a href='";
- $order2 = '';
- if ( $order_by == $column_id )
- $order2 = ( $order == 'DESC' ) ? 'ASC' : 'DESC';
-
- $column_link .= esc_url( add_query_arg( array( 'order' => $order2, 'paged' => $pagenum, 'sortby' => $column_id ), remove_query_arg( array( 'action', 'updated' ), $_SERVER['REQUEST_URI'] ) ) );
- $column_link .= "'>{$column_display_name}</a>";
- $col_url .= '<th scope="col">' . ( $column_id == 'blogs' ? $column_display_name : $column_link ) . '</th>';
- }
- echo $col_url; ?>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <th class="manage-column column-cb check-column" scope="col">
- <input type="checkbox" />
- </th>
- <?php echo $col_url; ?>
- </tr>
- </tfoot>
- <tbody id="the-user-list" class="list:user">
- <?php if ( $user_list ) {
- $class = '';
- $super_admins = get_super_admins();
- foreach ( (array) $user_list as $user ) {
- $class = ( 'alternate' == $class ) ? '' : 'alternate';
-
- $status_list = array( 'spam' => 'site-spammed', 'deleted' => 'site-deleted' );
-
- foreach ( $status_list as $status => $col ) {
- if ( $user[$status] )
- $class = $col;
- }
-
- ?>
- <tr class="<?php echo $class; ?>">
- <?php
- foreach( (array) $users_columns as $column_name=>$column_display_name ) :
- switch( $column_name ) {
- case 'id': ?>
- <th scope="row" class="check-column">
- <input type="checkbox" id="blog_<?php echo $user['ID'] ?>" name="allusers[]" value="<?php echo esc_attr( $user['ID'] ) ?>" />
- </th>
- <th valign="top" scope="row">
- <?php echo $user['ID'] ?>
- </th>
- <?php
- break;
-
- case 'login':
- $avatar = get_avatar( $user['user_email'], 32 );
- $edit_link = ( $current_user->ID == $user['ID'] ) ? 'profile.php' : 'user-edit.php?user_id=' . $user['ID'];
- ?>
- <td class="username column-username">
- <?php echo $avatar; ?><strong><a href="<?php echo esc_url( admin_url( $edit_link ) ); ?>" class="edit"><?php echo stripslashes( $user['user_login'] ); ?></a><?php
- if ( in_array( $user['user_login'], $super_admins ) )
- echo ' - ' . __( 'Super admin' );
- ?></strong>
- <br/>
- <div class="row-actions">
- <span class="edit"><a href="<?php echo esc_url( admin_url( $edit_link ) ); ?>"><?php _e( 'Edit' ); ?></a></span>
- <?php if ( ! in_array( $user['user_login'], $super_admins ) ) { ?>
- | <span class="delete"><a href="<?php echo $delete = esc_url( admin_url( add_query_arg( '_wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'ms-edit.php', 'deleteuser' ) . '&action=deleteuser&id=' . $user['ID'] ) ) ); ?>" class="delete"><?php _e( 'Delete' ); ?></a></span>
- <?php } ?>
- </div>
- </td>
- <?php
- break;
-
- case 'name': ?>
- <td class="name column-name"><?php echo $user['display_name'] ?></td>
- <?php
- break;
-
- case 'email': ?>
- <td class="email column-email"><a href="mailto:<?php echo $user['user_email'] ?>"><?php echo $user['user_email'] ?></a></td>
- <?php
- break;
-
- case 'registered':
- if ( 'list' == $mode )
- $date = 'Y/m/d';
- else
- $date = 'Y/m/d \<\b\r \/\> g:i:s a';
- ?>
- <td><?php echo mysql2date( __( $date ), $user['user_registered'] ); ?></td>
- <?php
- break;
-
- case 'blogs':
- $blogs = get_blogs_of_user( $user['ID'], true );
- ?>
- <td>
- <?php
- if ( is_array( $blogs ) ) {
- foreach ( (array) $blogs as $key => $val ) {
- $path = ( $val->path == '/' ) ? '' : $val->path;
- echo '<a href="'. esc_url( admin_url( 'ms-sites.php?action=editblog&id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>';
- echo ' <small class="row-actions">';
-
- // Edit
- echo '<a href="'. esc_url( admin_url( 'ms-sites.php?action=editblog&id=' . $val->userblog_id ) ) .'">' . __( 'Edit' ) . '</a> | ';
-
- // View
- echo '<a ';
- if ( get_blog_status( $val->userblog_id, 'spam' ) == 1 )
- echo 'style="background-color: #faa" ';
- echo 'href="' . esc_url( get_home_url( $val->userblog_id ) ) . '">' . __( 'View' ) . '</a>';
-
- echo '</small><br />';
- }
- }
- ?>
- </td>
- <?php
- break;
-
- default: ?>
- <td><?php do_action( 'manage_users_custom_column', $column_name, $user['ID'] ); ?></td>
- <?php
- break;
- }
- endforeach
- ?>
- </tr>
- <?php
- }
- } else {
- ?>
- <tr>
- <td colspan="<?php echo (int) count($users_columns); ?>"><?php _e( 'No users found.' ) ?></td>
- </tr>
- <?php
- } // end if ($users)
- ?>
- </tbody>
- </table>
-
- <div class="tablenav">
- <?php
- if ( $page_links )
- echo "<div class='tablenav-pages'>$page_links_text</div>";
- ?>
-
- <div class="alignleft actions">
- <select name="action2">
- <option value="-1" selected="selected"><?php _e( 'Bulk Actions' ); ?></option>
- <option value="delete"><?php _e( 'Delete' ); ?></option>
- <option value="spam"><?php _ex( 'Mark as Spam', 'user' ); ?></option>
- <option value="notspam"><?php _ex( 'Not Spam', 'user' ); ?></option>
- </select>
- <input type="submit" value="<?php esc_attr_e( 'Apply' ); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
- </div>
- <br class="clear" />
- </div>
-
- </form>
- </div>
-
-<?php
-if ( apply_filters( 'show_adduser_fields', true ) ) :
+wp_redirect( network_admin_url('users.php') );
+exit;
?>
-<div class="wrap" id="form-add-user">
- <h3><?php _e( 'Add User' ) ?></h3>
- <form action="ms-edit.php?action=adduser" method="post">
- <table class="form-table">
- <tr class="form-field form-required">
- <th scope="row"><?php _e( 'Username' ) ?></th>
- <td><input type="text" class="regular-text" name="user[username]" /></td>
- </tr>
- <tr class="form-field form-required">
- <th scope="row"><?php _e( 'Email' ) ?></th>
- <td><input type="text" class="regular-text" name="user[email]" /></td>
- </tr>
- <tr class="form-field">
- <td colspan="2"><?php _e( 'Username and password will be mailed to the above email address.' ) ?></td>
- </tr>
- </table>
- <p class="submit">
- <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
- <input class="button" type="submit" value="<?php esc_attr_e( 'Add user' ) ?>" /></p>
- </form>
-</div>
-<?php endif; ?>
-
-<?php include( './admin-footer.php' ); ?>
'<p>' . __('This screen shows an individual user all of their sites in this network, and also allows that user to set a primary site. He or she can use the links under each site to visit either the frontend or the dashboard for that site.') . '</p>' .
'<p>' . __('Up until WordPress version 3.0, what is now called a Multi-site Network had to be installed separately as WordPress MU (multi-user).') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Dashboard_My_Sites_SubPanel" target="_blank">My Sites Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Dashboard_My_Sites_SubPanel" target="_blank">Documentation on My Sites</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
</table>
<input type="hidden" name="action" value="updateblogsettings" />
<?php wp_nonce_field( 'update-my-sites' ); ?>
- <p>
- <input type="submit" class="button-primary" value="<?php _e( 'Save Changes' ) ?>" />
- </p>
+ <?php submit_button(); ?>
</form>
</div>
<?php
*/
/** Load WordPress Administration Bootstrap */
-require_once( 'admin.php' );
+require_once( './admin.php' );
// Load all the nav menu interface functions
require_once( ABSPATH . 'wp-admin/includes/nav-menu.php' );
$ordered_menu_items = wp_get_nav_menu_items( $menu_id );
$menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) );
- // setup the data we need in one pass through the array of menu items
+ // set up the data we need in one pass through the array of menu items
$dbids_to_orders = array();
$orders_to_dbids = array();
foreach( (array) $ordered_menu_items as $ordered_menu_item_object ) {
$ordered_menu_items = wp_get_nav_menu_items( $menu_id );
$menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) );
- // setup the data we need in one pass through the array of menu items
+ // set up the data we need in one pass through the array of menu items
$dbids_to_orders = array();
$orders_to_dbids = array();
foreach( (array) $ordered_menu_items as $ordered_menu_item_object ) {
if ( ! current_theme_supports( 'menus' ) && ! wp_get_nav_menus() )
$messages[] = '<div id="message" class="updated"><p>' . __('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.') . '</p></div>';
-$help = '<p>' . __('This feature is new in version 3.0; to use a custom menu in place of your theme’s default menus, support for this feature must be registered in the theme’s functions.php file. If your theme does not support the custom menus feature yet (the new default theme, Twenty Ten, does), you can learn about adding support yourself by following the below link.') . '</p>';
+$help = '<p>' . __('This feature, introduced in version 3.0, allows you to use a custom menu in place of your theme’s default menus. If your theme does not support the custom menus feature yet (the default theme, Twenty Ten, does), you can learn about adding this support by following the Documentation link in this tab. You can still use the “Custom Menu” widget to add menus to a sidebar.') . '</p>';
$help .= '<p>' . __('You can create custom menus for your site. These menus may contain links to pages, categories, custom links or other content types (use the Screen Options tab to decide which ones to show on the screen). You can specify a different navigation label for a menu item as well as other attributes. You can create multiple menus. If your theme includes more than one menu, you can choose which custom menu to associate with each. You can also use custom menus in conjunction with the Custom Menus widget.') . '</p>';
-$help .= '<p>' . __('To create a new custom menu, click on the + tab, give the menu a name, and click Create Menu. Next, add menu items from the appropriate boxes. You’ll be able to edit the information for each menu item, and can drag and drop to put them in order. You can also drag a menu item a little to the right to make it a submenu, to create menus with hierarchy. You’ll see when the position of the drop target shifts over to create the nested placement. Don’t forget to click Save when you’re finished.') . '</p>';
+$help .= '<p>' . __('To create a new custom menu, click on the + tab, give the menu a name, and click Create Menu. Next, add menu items from the appropriate boxes. You’ll be able to edit the information for each menu item, and can drag and drop to put them in order. You can also drag a menu item a little to the right to make it a submenu, to create menus with hierarchy. Drop the item into its new nested placement when the dotted rectangle target shifts over, also a little to the right. Don’t forget to click Save when you’re finished.') . '</p>';
$help .= '<p><strong>' . __('For more information:') . '</strong></p>';
-$help .= '<p>' . __('<a href="http://codex.wordpress.org/Appearance_Menus_SubPanel" target="_blank">Menus Documentation</a>') . '</p>';
+$help .= '<p>' . __('<a href="http://codex.wordpress.org/Appearance_Menus_SubPanel" target="_blank">Documentation on Menus</a>') . '</p>';
$help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
add_contextual_help($current_screen, $help);
// Get the admin header
-require_once( 'admin-header.php' );
+require_once( './admin-header.php' );
?>
<div class="wrap">
<?php screen_icon(); ?>
<option value="0"><?php esc_html_e('Add New Menu'); ?></option>
</select>
<input type="hidden" name="action" value="edit" />
- <input class="button-secondary" name="select_menu" type="submit" value="<?php esc_attr_e('Select'); ?>" />
+ <?php submit_button( __( 'Select' ), 'secondary', 'select_menu', false ); ?>
</form>
</div>
<div class="nav-tabs-wrapper">
<?php endif; ?>
<br class="clear" />
<div class="publishing-action">
- <input class="button-primary menu-save" name="save_menu" type="submit" value="<?php empty($nav_menu_selected_id) ? esc_attr_e('Create Menu') : esc_attr_e('Save Menu'); ?>" />
+ <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false ); ?>
</div><!-- END .publishing-action -->
<?php if ( ! empty( $nav_menu_selected_id ) ) : ?>
?>
</div><!-- /#post-body-content -->
</div><!-- /#post-body -->
+ <div id="nav-menu-footer">
+ <div class="major-publishing-actions">
+ <div class="publishing-action">
+ <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false ); ?>
+ </div>
+ </div>
+ </div><!-- /#nav-menu-footer -->
</form><!-- /#update-nav-menu -->
</div><!-- /.menu-edit -->
</div><!-- /#menu-management -->
</div><!-- /.wrap-->
-<?php include( 'admin-footer.php' ); ?>
+<?php include( './admin-footer.php' ); ?>
if ( ! is_super_admin() )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
-if ( is_multisite() && ! defined( 'MULTISITE' ) )
- wp_die( __( 'The Network creation panel is not for WordPress MU networks.' ) );
+if ( is_multisite() ) {
+ if ( ! is_network_admin() ) {
+ wp_redirect( network_admin_url( 'setup.php' ) );
+ exit;
+ }
+ if ( ! defined( 'MULTISITE' ) )
+ wp_die( __( 'The Network creation panel is not for WordPress MU networks.' ) );
+}
// We need to create references to ms global tables to enable Network.
foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table )
if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) )
wp_die( __( 'You must define the <code>WP_ALLOW_MULTISITE</code> 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';
+if ( is_network_admin() ) {
+ $title = __( 'Network Setup' );
+ $parent_file = 'settings.php';
+} else {
+ $title = __( 'Create a Network of WordPress Sites' );
+ $parent_file = 'tools.php';
+}
add_contextual_help($current_screen,
'<p>' . __('This screen allows you to configure a network as having subdomains (<code>site1.example.com</code>) or subdirectories (<code>example.com/site1</code>). Subdomains require wildcard subdomains to be enabled in Apache and DNS records, if your host allows it.') . '</p>' .
'<p>' . __('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.') . '</p>' .
'<p>' . __('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.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Create_A_Network" target="_blank">General Network Creation Documentation</a>') . '</p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Tools_Network_SubPanel" target="_blank">Tools > Network Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Create_A_Network" target="_blank">Documentation on Creating a Network</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Tools_Network_SubPanel" target="_blank">Documentation on the Network Screen</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
-include( './admin-header.php' );
+include( ABSPATH . 'wp-admin/admin-header.php' );
?>
<div class="wrap">
-<?php screen_icon(); ?>
+<?php screen_icon('tools'); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<?php
if ( get_option( 'siteurl' ) != get_option( 'home' ) ) {
echo '<div class="error"><p><strong>' . __('Error:') . '</strong> ' . sprintf( __( 'Your <strong>WordPress address</strong> must match your <strong>Site address</strong> before creating a Network. See <a href="%s">General Settings</a>.' ), esc_url( admin_url( 'options-general.php' ) ) ) . '</p></div>';
echo '</div>';
- include ('./admin-footer.php' );
+ include ( ABSPATH . 'wp-admin/admin-footer.php' );
+ die();
+ }
+
+ if ( defined('DO_NOT_UPGRADE_GLOBAL_TABLES') ) {
+ echo '<div class="error"><p><strong>' . __('Error:') . '</strong> ' . __( 'The constant DO_NOT_UPGRADE_GLOBAL_TABLES cannot be defined when creating a network.' ) . '</p></div>';
+ echo '</div>';
+ include ( ABSPATH . 'wp-admin/admin-footer.php' );
die();
}
if ( ! empty( $active_plugins ) ) {
echo '<div class="updated"><p><strong>' . __('Warning:') . '</strong> ' . sprintf( __( 'Please <a href="%s">deactivate your plugins</a> before enabling the Network feature.' ), admin_url( 'plugins.php?plugin_status=active' ) ) . '</p></div><p>' . __( 'Once the network is created, you may reactivate your plugins.' ) . '</p>';
echo '</div>';
- include( './admin-footer.php' );
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
die();
}
echo '<p>' . sprintf( __( 'You cannot use port numbers such as <code>%s</code>.' ), $has_ports ) . '</p>';
echo '<a href="' . esc_url( admin_url() ) . '">' . __( 'Return to Dashboard' ) . '</a>';
echo '</div>';
- include( './admin-footer.php' );
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
die();
}
</td>
</tr>
</table>
- <p class='submit'><input class="button-primary" name='submit' type='submit' value='<?php esc_attr_e( 'Install' ); ?>' /></p>
+ <?php submit_button( __( 'Install' ), 'primary', 'submit' ); ?>
</form>
- <?php
+ <?php
}
/**
global $base, $wpdb;
$hostname = get_clean_basedomain();
+ if ( ! isset( $base ) )
+ $base = trailingslashit( stripslashes( dirname( dirname( $_SERVER['SCRIPT_NAME'] ) ) ) );
+
// Wildcard DNS message.
if ( is_wp_error( $errors ) )
echo '<div class="error">' . $errors->get_error_message() . '</div>';
if ( $_POST ) {
- $subdomain_install = allow_subdomain_install() ? ( allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true ) : false;
+ if ( allow_subdomain_install() )
+ $subdomain_install = allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true;
+ else
+ $subdomain_install = false;
} else {
if ( is_multisite() ) {
$subdomain_install = is_subdomain_install();
?>
- <div class="updated"><p><strong><?php _e( 'Notice: The Network feature is already enabled.' ); ?></strong> <?php _e( 'The original configuration steps are shown here for reference.' ); ?></p></div>
-<?php } else {
+ <p><?php _e( 'The original configuration steps are shown here for reference.' ); ?></p>
+<?php
+ } else {
$subdomain_install = (bool) $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" );
?>
<div class="error"><p><strong><?php _e('Warning:'); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div>
<h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>
<p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>
<div class="updated inline"><p><?php
- if ( iis7_supports_permalinks() )
- _e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> file.' );
+ if ( file_exists( ABSPATH . '.htaccess' ) )
+ printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), '.htaccess' );
+ elseif ( file_exists( ABSPATH . 'web.config' ) )
+ printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), 'web.config' );
else
- _e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>.htaccess</code> files.' );
+ _e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> file.' );
?></p></div>
<?php
}
?>
<ol>
<li><p><?php
- printf( __( 'Create a <code>blogs.dir</code> directory in <code>%s</code>. This directory is used to stored uploaded media for your additional sites and must be writeable by the web server.' ), WP_CONTENT_DIR );
+ printf( __( 'Create a <code>blogs.dir</code> directory at <code>%s/blogs.dir</code>. This directory is used to store 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 ' <strong>' . __('Warning:') . ' ' . __( 'Networks may not be fully compatible with custom wp-content directories.' ) . '</strong';
?></p></li>
unset( $keys_salts[ $c ] );
}
if ( ! empty( $keys_salts ) ) {
+ $keys_salts_str = '';
$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 );
+ $keys_salts_str .= "\ndefine( '$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 );
+ $keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );";
}
}
$num_keys_salts = count( $keys_salts );
?>
<p><?php
echo _n( 'This unique authentication key is also missing from your <code>wp-config.php</code> file.', 'These unique authentication keys are also missing from your <code>wp-config.php</code> file.', $num_keys_salts ); ?> <?php _e( 'To make your installation more secure, you should also add:' ) ?></p>
- <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php
- foreach ( $keys_salts as $c => $v ) {
- echo "\ndefine( '$c', '$v' );";
- }
-?></textarea>
+ <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php echo esc_textarea( $keys_salts_str ); ?></textarea>
<?php
}
?>
<action type="None" />
</rule>
<rule name="WordPress Rule 5" stopProcessing="true">
- <match url="^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)" ignoreCase="false" />
+ <match url="^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*)" ignoreCase="false" />
<action type="Rewrite" url="{R:2}" />
</rule>
<rule name="WordPress Rule 6" stopProcessing="true">
?>
<li><p><?php printf( __( 'Add the following to your <code>web.config</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p>
<textarea class="code" readonly="readonly" cols="100" rows="20">
- <?php echo wp_htmledit_pre( $web_config_file ); ?>
+ <?php echo esc_textarea( $web_config_file ); ?>
</textarea></li>
</ol>
// @todo custom content dir.
if ( ! $subdomain_install )
- $htaccess_file .= "\nRewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]\nRewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]";
+ $htaccess_file .= "\nRewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]\nRewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]";
$htaccess_file .= "\nRewriteRule . index.php [L]";
?>
<li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p>
<textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>">
-<?php echo wp_htmledit_pre( $htaccess_file ); ?></textarea></li>
+<?php echo esc_textarea( $htaccess_file ); ?></textarea></li>
</ol>
<?php endif; // end IIS/Apache code branches.
}
}
-$base = trailingslashit( stripslashes( dirname( dirname( $_SERVER['SCRIPT_NAME'] ) ) ) );
-
if ( $_POST ) {
+
+ $base = trailingslashit( stripslashes( dirname( dirname( $_SERVER['SCRIPT_NAME'] ) ) ) );
+
check_admin_referer( 'install-network-1' );
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
?>
</div>
-<?php include( './admin-footer.php' ); ?>
+<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
--- /dev/null
+<?php
+/**
+ * WordPress Network Administration Bootstrap
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+define( 'WP_NETWORK_ADMIN', TRUE );
+
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( dirname( __FILE__ ) ) . '/admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! is_main_site() ) {
+ wp_redirect( network_admin_url() );
+ exit;
+}
+?>
--- /dev/null
+<?php
+/**
+ * Action handler for Multisite administration panels.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( empty( $_GET['action'] ) ) {
+ wp_redirect( admin_url( 'index.php' ) );
+ exit;
+}
+
+function confirm_delete_users( $users ) {
+ $current_user = wp_get_current_user();
+ if ( !is_array( $users ) )
+ return false;
+
+ screen_icon();
+ ?>
+ <h2><?php esc_html_e( 'Users' ); ?></h2>
+ <p><?php _e( 'Transfer or delete posts and links before deleting users.' ); ?></p>
+ <form action="edit.php?action=dodelete" method="post">
+ <input type="hidden" name="dodelete" />
+ <?php
+ wp_nonce_field( 'ms-users-delete' );
+ $site_admins = get_super_admins();
+ $admin_out = "<option value='$current_user->ID'>$current_user->user_login</option>";
+
+ foreach ( ( $allusers = (array) $_POST['allusers'] ) as $key => $val ) {
+ if ( $val != '' && $val != '0' ) {
+ $delete_user = new WP_User( $val );
+
+ if ( ! current_user_can( 'delete_user', $delete_user->ID ) )
+ wp_die( sprintf( __( 'Warning! User %s cannot be deleted.' ), $delete_user->user_login ) );
+
+ 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 "<input type='hidden' name='user[]' value='{$val}'/>\n";
+ $blogs = get_blogs_of_user( $val, true );
+
+ if ( !empty( $blogs ) ) {
+ ?>
+ <br /><fieldset><p><legend><?php printf( __( "What should be done with posts and links owned by <em>%s</em>?" ), $delete_user->user_login ); ?></legend></p>
+ <?php
+ foreach ( (array) $blogs as $key => $details ) {
+ $blog_users = get_users( array( 'blog_id' => $details->userblog_id ) );
+ if ( is_array( $blog_users ) && !empty( $blog_users ) ) {
+ $user_site = "<a href='" . esc_url( get_home_url( $details->userblog_id ) ) . "'>{$details->blogname}</a>";
+ $user_dropdown = "<select name='blog[$val][{$key}]'>";
+ $user_list = '';
+ foreach ( $blog_users as $user ) {
+ if ( ! in_array( $user->ID, $allusers ) )
+ $user_list .= "<option value='{$user->ID}'>{$user->user_login}</option>";
+ }
+ if ( '' == $user_list )
+ $user_list = $admin_out;
+ $user_dropdown .= $user_list;
+ $user_dropdown .= "</select>\n";
+ ?>
+ <ul style="list-style:none;">
+ <li><?php printf( __( 'Site: %s' ), $user_site ); ?></li>
+ <li><label><input type="radio" id="delete_option0" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID ?>]" value="delete" checked="checked" />
+ <?php _e( 'Delete all posts and links.' ); ?></label></li>
+ <li><label><input type="radio" id="delete_option1" name="delete[<?php echo $details->userblog_id . '][' . $delete_user->ID ?>]" value="reassign" />
+ <?php echo __( 'Attribute all posts and links to:' ) . '</label>' . $user_dropdown; ?></li>
+ </ul>
+ <?php
+ }
+ }
+ echo "</fieldset>";
+ }
+ }
+ }
+
+ submit_button( __('Confirm Deletion'), 'delete' );
+ ?>
+ </form>
+ <?php
+ return true;
+}
+
+do_action( 'wpmuadminedit' , '');
+
+if ( isset( $_GET['id' ]) )
+ $id = intval( $_GET['id'] );
+elseif ( isset( $_POST['id'] ) )
+ $id = intval( $_POST['id'] );
+
+switch ( $_GET['action'] ) {
+ case 'siteoptions':
+ check_admin_referer( 'siteoptions' );
+ if ( ! current_user_can( 'manage_network_options' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ if ( empty( $_POST ) )
+ wp_die( sprintf( __( 'You probably need to go back to the <a href="%s">options page</a>.' ), esc_url( admin_url( 'settings.php' ) ) ) );
+
+ if ( isset($_POST['WPLANG']) && ( '' === $_POST['WPLANG'] || in_array( $_POST['WPLANG'], get_available_languages() ) ) )
+ update_site_option( 'WPLANG', $_POST['WPLANG'] );
+
+ if ( is_email( $_POST['admin_email'] ) )
+ update_site_option( 'admin_email', $_POST['admin_email'] );
+
+ $illegal_names = split( ' ', $_POST['illegal_names'] );
+ foreach ( (array) $illegal_names as $name ) {
+ $name = trim( $name );
+ if ( $name != '' )
+ $names[] = trim( $name );
+ }
+ update_site_option( 'illegal_names', $names );
+
+ if ( $_POST['limited_email_domains'] != '' ) {
+ $limited_email_domains = str_replace( ' ', "\n", $_POST['limited_email_domains'] );
+ $limited_email_domains = split( "\n", stripslashes( $limited_email_domains ) );
+ $limited_email = array();
+ foreach ( (array) $limited_email_domains as $domain ) {
+ $domain = trim( $domain );
+ if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
+ $limited_email[] = trim( $domain );
+ }
+ update_site_option( 'limited_email_domains', $limited_email );
+ } else {
+ update_site_option( 'limited_email_domains', '' );
+ }
+
+ if ( $_POST['banned_email_domains'] != '' ) {
+ $banned_email_domains = split( "\n", stripslashes( $_POST['banned_email_domains'] ) );
+ $banned = array();
+ foreach ( (array) $banned_email_domains as $domain ) {
+ $domain = trim( $domain );
+ if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
+ $banned[] = trim( $domain );
+ }
+ update_site_option( 'banned_email_domains', $banned );
+ } else {
+ update_site_option( 'banned_email_domains', '' );
+ }
+
+ $options = array( 'registrationnotification', 'registration', 'add_new_users', 'menu_items', 'mu_media_buttons', 'upload_space_check_disabled', 'blog_upload_space', 'upload_filetypes', 'site_name', 'first_post', 'first_page', 'first_comment', 'first_comment_url', 'first_comment_author', 'welcome_email', 'welcome_user_email', 'fileupload_maxk', 'global_terms_enabled' );
+ $checked_options = array( 'mu_media_buttons' => array(), 'menu_items' => array(), 'registrationnotification' => 'no', 'upload_space_check_disabled' => 1, 'add_new_users' => 0 );
+ foreach ( $checked_options as $option_name => $option_unchecked_value ) {
+ if ( ! isset( $_POST[$option_name] ) )
+ $_POST[$option_name] = $option_unchecked_value;
+ }
+ foreach ( $options as $option_name ) {
+ if ( ! isset($_POST[$option_name]) )
+ continue;
+ $value = stripslashes_deep( $_POST[$option_name] );
+ update_site_option( $option_name, $value );
+ }
+
+ // Update more options here
+ do_action( 'update_wpmu_options' );
+
+ wp_redirect( add_query_arg( 'updated', 'true', network_admin_url( 'settings.php' ) ) );
+ exit();
+ break;
+
+ case 'updateblog':
+ // No longer used.
+ break;
+
+ case 'deleteblog':
+ check_admin_referer('deleteblog');
+ if ( ! ( current_user_can( 'manage_sites' ) && current_user_can( 'delete_sites' ) ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ if ( $id != '0' && $id != $current_site->blog_id && current_user_can( 'delete_site', $id ) ) {
+ wpmu_delete_blog( $id, true );
+ wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'delete' ), wp_get_referer() ) );
+ } else {
+ wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'not_deleted' ), wp_get_referer() ) );
+ }
+
+ exit();
+ break;
+
+ case 'allblogs':
+ if ( ( isset( $_POST['action'] ) || isset( $_POST['action2'] ) ) && isset( $_POST['allblogs'] ) ) {
+ check_admin_referer( 'bulk-sites' );
+
+ if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ if ( $_GET['action'] != -1 || $_POST['action2'] != -1 )
+ $doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
+
+ $blogfunction = '';
+
+ foreach ( (array) $_POST['allblogs'] as $key => $val ) {
+ if ( $val != '0' && $val != $current_site->blog_id ) {
+ switch ( $doaction ) {
+ case 'delete':
+ if ( ! current_user_can( 'delete_site', $val ) )
+ wp_die( __( 'You are not allowed to delete the site.' ) );
+ $blogfunction = 'all_delete';
+ wpmu_delete_blog( $val, true );
+ break;
+
+ case 'spam':
+ $blogfunction = 'all_spam';
+ update_blog_status( $val, 'spam', '1' );
+ set_time_limit( 60 );
+ break;
+
+ case 'notspam':
+ $blogfunction = 'all_notspam';
+ update_blog_status( $val, 'spam', '0' );
+ set_time_limit( 60 );
+ break;
+ }
+ } else {
+ wp_die( __( 'You are not allowed to change the current site.' ) );
+ }
+ }
+
+ wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $blogfunction ), wp_get_referer() ) );
+ } else {
+ wp_redirect( network_admin_url( 'sites.php' ) );
+ }
+ exit();
+ break;
+
+ case 'archiveblog':
+ check_admin_referer( 'archiveblog' );
+ if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ update_blog_status( $id, 'archived', '1' );
+ wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'archive' ), wp_get_referer() ) );
+ exit();
+ break;
+
+ case 'unarchiveblog':
+ check_admin_referer( 'unarchiveblog' );
+ if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ update_blog_status( $id, 'archived', '0' );
+ wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unarchive' ), wp_get_referer() ) );
+ exit();
+ break;
+
+ case 'activateblog':
+ check_admin_referer( 'activateblog' );
+ if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ update_blog_status( $id, 'deleted', '0' );
+ do_action( 'activate_blog', $id );
+ wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'activate' ), wp_get_referer() ) );
+ exit();
+ break;
+
+ case 'deactivateblog':
+ check_admin_referer( 'deactivateblog' );
+ if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ do_action( 'deactivate_blog', $id );
+ update_blog_status( $id, 'deleted', '1' );
+ wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'deactivate' ), wp_get_referer() ) );
+ exit();
+ break;
+
+ case 'unspamblog':
+ check_admin_referer( 'unspamblog' );
+ if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ update_blog_status( $id, 'spam', '0' );
+ wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unspam' ), wp_get_referer() ) );
+ exit();
+ break;
+
+ case 'spamblog':
+ check_admin_referer( 'spamblog' );
+ if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ update_blog_status( $id, 'spam', '1' );
+ wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'spam' ), wp_get_referer() ) );
+ exit();
+ break;
+
+ case 'unmatureblog':
+ check_admin_referer( 'unmatureblog' );
+ if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ update_blog_status( $id, 'mature', '0' );
+ wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unmature' ), wp_get_referer() ) );
+ exit();
+ break;
+
+ case 'matureblog':
+ check_admin_referer( 'matureblog' );
+ if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ update_blog_status( $id, 'mature', '1' );
+ wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'mature' ), wp_get_referer() ) );
+ exit();
+ break;
+
+ // Common
+ case 'confirm':
+ check_admin_referer( 'confirm' );
+ if ( !headers_sent() ) {
+ nocache_headers();
+ header( 'Content-Type: text/html; charset=utf-8' );
+ }
+ if ( $current_site->blog_id == $id )
+ wp_die( __( 'You are not allowed to change the current site.' ) );
+ ?>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) ) language_attributes(); ?>>
+ <head>
+ <title><?php _e( 'WordPress › Confirm your action' ); ?></title>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <?php
+ wp_admin_css( 'install', true );
+ wp_admin_css( 'ie', true );
+ ?>
+ </head>
+ <body>
+ <h1 id="logo"><img alt="WordPress" src="<?php echo esc_attr( admin_url( 'images/wordpress-logo.png' ) ); ?>" /></h1>
+ <form action="edit.php?action=<?php echo esc_attr( $_GET['action2'] ) ?>" method="post">
+ <input type="hidden" name="action" value="<?php echo esc_attr( $_GET['action2'] ) ?>" />
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
+ <input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
+ <?php wp_nonce_field( $_GET['action2'], '_wpnonce', false ); ?>
+ <p><?php echo esc_html( stripslashes( $_GET['msg'] ) ); ?></p>
+ <?php submit_button( __('Confirm'), 'button' ); ?>
+ </form>
+ </body>
+ </html>
+ <?php
+ exit();
+ break;
+
+ // Users
+ case 'deleteuser':
+ if ( ! current_user_can( 'manage_network_users' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ check_admin_referer( 'deleteuser' );
+
+ if ( $id != '0' && $id != '1' ) {
+ $_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle with arrays
+ $title = __( 'Users' );
+ $parent_file = 'users.php';
+ require_once( '../admin-header.php' );
+ echo '<div class="wrap">';
+ confirm_delete_users( $_POST['allusers'] );
+ echo '</div>';
+ require_once( '../admin-footer.php' );
+ } else {
+ wp_redirect( network_admin_url( 'users.php' ) );
+ }
+ exit();
+ break;
+
+ case 'allusers':
+ if ( !current_user_can( 'manage_network_users' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ if ( ( isset( $_POST['action']) || isset($_POST['action2'] ) ) && isset( $_POST['allusers'] ) ) {
+ check_admin_referer( 'bulk-users-network' );
+
+ if ( $_GET['action'] != -1 || $_POST['action2'] != -1 )
+ $doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2'];
+
+ $userfunction = '';
+
+ foreach ( (array) $_POST['allusers'] as $key => $val ) {
+ if ( !empty( $val ) ) {
+ switch ( $doaction ) {
+ case 'delete':
+ if ( ! current_user_can( 'delete_users' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+ $title = __( 'Users' );
+ $parent_file = 'users.php';
+ require_once( '../admin-header.php' );
+ echo '<div class="wrap">';
+ confirm_delete_users( $_POST['allusers'] );
+ echo '</div>';
+ require_once( '../admin-footer.php' );
+ exit();
+ break;
+
+ case 'spam':
+ $user = new WP_User( $val );
+ if ( in_array( $user->user_login, get_super_admins() ) )
+ wp_die( sprintf( __( 'Warning! User cannot be modified. The user %s is a network administrator.' ), esc_html( $user->user_login ) ) );
+
+ $userfunction = 'all_spam';
+ $blogs = get_blogs_of_user( $val, true );
+ foreach ( (array) $blogs as $key => $details ) {
+ if ( $details->userblog_id != $current_site->blog_id ) // main blog not a spam !
+ update_blog_status( $details->userblog_id, 'spam', '1' );
+ }
+ update_user_status( $val, 'spam', '1' );
+ break;
+
+ case 'notspam':
+ $userfunction = 'all_notspam';
+ $blogs = get_blogs_of_user( $val, true );
+ foreach ( (array) $blogs as $key => $details )
+ update_blog_status( $details->userblog_id, 'spam', '0' );
+
+ update_user_status( $val, 'spam', '0' );
+ break;
+ }
+ }
+ }
+
+ wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $userfunction ), wp_get_referer() ) );
+ } else {
+ $location = network_admin_url( 'users.php' );
+
+ if ( ! empty( $_REQUEST['paged'] ) )
+ $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );
+ wp_redirect( $location );
+ }
+ exit();
+ break;
+
+ case 'dodelete':
+ check_admin_referer( 'ms-users-delete' );
+ if ( ! ( current_user_can( 'manage_network_users' ) && current_user_can( 'delete_users' ) ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ if ( ! empty( $_POST['blog'] ) && is_array( $_POST['blog'] ) ) {
+ foreach ( $_POST['blog'] as $id => $users ) {
+ foreach ( $users as $blogid => $user_id ) {
+ if ( ! current_user_can( 'delete_user', $id ) )
+ continue;
+
+ if ( ! empty( $_POST['delete'] ) && 'reassign' == $_POST['delete'][$blogid][$id] )
+ remove_user_from_blog( $id, $blogid, $user_id );
+ else
+ remove_user_from_blog( $id, $blogid );
+ }
+ }
+ }
+ $i = 0;
+ if ( is_array( $_POST['user'] ) && ! empty( $_POST['user'] ) )
+ foreach( $_POST['user'] as $id ) {
+ if ( ! current_user_can( 'delete_user', $id ) )
+ continue;
+ wpmu_delete_user( $id );
+ $i++;
+ }
+
+ if ( $i == 1 )
+ $deletefunction = 'delete';
+ else
+ $deletefunction = 'all_delete';
+
+ wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => $deletefunction ), network_admin_url( 'users.php' ) ) );
+ exit();
+ break;
+
+ default:
+ // Let plugins use us as a post handler easily
+ do_action( 'network_admin_edit_' . $_GET['action'] );
+ wp_redirect( network_admin_url( 'index.php' ) );
+ exit();
+ break;
+}
+?>
--- /dev/null
+<?php
+/**
+ * Handle default network dashboard widgets options AJAX.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+require( '../index-extra.php' );
--- /dev/null
+<?php
+/**
+ * Multisite administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+/** Load WordPress dashboard API */
+require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );
+
+if ( !is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! current_user_can( 'manage_network' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+$title = __( 'Dashboard' );
+$parent_file = 'index.php';
+
+add_contextual_help($current_screen,
+ '<p>' . __('Until WordPress 3.0, running multiple sites required using WordPress MU instead of regular WordPress. In version 3.0, these applications have merged. If you are a former MU user, you should be aware of the following changes:') . '</p>' .
+ '<ul><li>' . __('Site Admin is now Super Admin (we highly encourage you to get yourself a cape!).') . '</li>' .
+ '<li>' . __('Blogs are now called Sites; Site is now called Network.') . '</li></ul>' .
+ '<p>' . __('This screen provides the network administrator with links to the screens for Sites and Users to either create a new site or user, or to search existing users and sites, as well as Dashboard widgets. Those screens are also accessible through the left-hand navigation in the Network Admin section.') . '</p>' .
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin" target="_blank">Documentation on the Network Admin</a>') . '</p>' .
+ '<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
+);
+
+wp_dashboard_setup();
+
+wp_enqueue_script( 'dashboard' );
+wp_enqueue_script( 'plugin-install' );
+wp_admin_css( 'dashboard' );
+wp_admin_css( 'plugin-install' );
+add_thickbox();
+
+add_screen_option('layout_columns', array('max' => 4, 'default' => 2) );
+
+require_once( '../admin-header.php' );
+
+?>
+
+<div class="wrap">
+<?php screen_icon(); ?>
+<h2><?php echo esc_html( $title ); ?></h2>
+
+<div id="dashboard-widgets-wrap">
+
+<?php wp_dashboard(); ?>
+
+<div class="clear"></div>
+</div><!-- dashboard-widgets-wrap -->
+
+</div><!-- wrap -->
+
+<?php include( '../admin-footer.php' ); ?>
--- /dev/null
+<?php
+/**
+ * Build Network Administration Menu.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/* translators: Network menu item */
+$menu[0] = array(__('Dashboard'), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div');
+
+$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
+
+/* translators: Sites menu item */
+$menu[5] = array(__('Sites'), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'div');
+$submenu['sites.php'][5] = array( __('Sites'), 'manage_sites', 'sites.php' );
+$submenu['sites.php'][10] = array( _x('Add New', 'site'), 'create_sites', 'site-new.php' );
+
+$menu[10] = array(__('Users'), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'div');
+$submenu['users.php'][5] = array( __('Users'), 'manage_network_users', 'users.php' );
+$submenu['users.php'][10] = array( _x('Add New', 'user'), 'create_users', 'user-new.php' );
+
+$plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
+$update_themes = get_site_transient( 'update_themes' );
+if ( !empty($update_themes->response) )
+ $theme_update_count = count( $update_themes->response );
+$menu[15] = array(sprintf(__('Themes %s'), "<span class='update-plugins count-$theme_update_count'><span class='theme-count'>" . number_format_i18n($theme_update_count) . "</span></span>" ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div');
+$submenu['themes.php'][5] = array( __('Themes'), 'manage_network_themes', 'themes.php' );
+$submenu['themes.php'][10] = array( _x('Add New', 'theme'), 'install_themes', 'theme-install.php' );
+$submenu['themes.php'][15] = array( _x('Editor', 'theme editor'), 'edit_themes', 'theme-editor.php' );
+
+$update_plugins = get_site_transient( 'update_plugins' );
+if ( !empty($update_plugins->response) )
+ $plugin_update_count = count( $update_plugins->response );
+$menu[20] = array(sprintf( __('Plugins %s'), "<span class='update-plugins count-$plugin_update_count'><span class='plugin-count'>" . number_format_i18n($plugin_update_count) . "</span></span>" ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'div');
+$submenu['plugins.php'][5] = array( __('Plugins'), 'manage_network_plugins', 'plugins.php' );
+$submenu['plugins.php'][10] = array( _x('Add New', 'plugin editor'), 'install_plugins', 'plugin-install.php' );
+$submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
+
+
+$menu[25] = array(__('Settings'), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'div');
+if ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
+ $submenu['settings.php'][5] = array( __('Settings'), 'manage_network_options', 'settings.php' );
+ $submenu['settings.php'][10] = array( __('Network Setup'), 'manage_network_options', 'setup.php' );
+}
+
+$update_wordpress = get_core_updates( array('dismissed' => false) );
+if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
+ $wordpress_update_count = 1;
+
+$update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
+$update_title = array();
+if ( $wordpress_update_count )
+ $update_title[] = sprintf(__('%d WordPress Update'), $wordpress_update_count);
+if ( $plugin_update_count )
+ $update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $plugin_update_count), $plugin_update_count);
+if ( $theme_update_count )
+ $update_title[] = sprintf(_n('%d Theme Update', '%d Themes Updates', $theme_update_count), $theme_update_count);
+
+$update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : '';
+
+$menu[30] = array(sprintf( __('Updates %s'), "<span class='update-plugins count-$update_count' title='$update_title'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'manage_network', 'upgrade.php', '', 'menu-top menu-icon-tools', 'menu-update', 'div');
+$submenu[ 'upgrade.php' ][10] = array( __( 'Updates' ), 'update_core', 'update-core.php' );
+$submenu[ 'upgrade.php' ][15] = array( __( 'Update Network' ), 'manage_network', 'upgrade.php' );
+unset($plugin_update_count, $theme_update_count, $wordpress_update_count, $update_count, $update_title, $update_themes, $update_plugins, $update_wordpress);
+
+
+$menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' );
+
+require_once(ABSPATH . 'wp-admin/includes/menu.php');
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Plugin editor network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+require( '../plugin-editor.php' );
--- /dev/null
+<?php
+/**
+ * Install plugin network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+if ( isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) )
+ define( 'IFRAME_REQUEST', true );
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+require( '../plugin-install.php' );
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Network Plugins administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+require( '../plugins.php' );
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * User profile network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+require( '../profile.php' );
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Multisite network settings administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! current_user_can( 'manage_network_options' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+$title = __( 'Settings' );
+$parent_file = 'settings.php';
+
+add_contextual_help($current_screen,
+ '<p>' . __('This screen sets and changes options for the network as a whole. The first site is the main site in the network and network options are pulled from that original site’s options.') . '</p>' .
+ '<p>' . __('Operational settings has fields for the network’s name and admin email.') . '</p>' .
+ '<p>' . __('Dashboard Site is an option to give a site to users who do not have a site on the system. Their default role is Subscriber, but that default can be changed. The Admin Notice Feed can provide a notice on all dashboards of the latest post via RSS or Atom, or provide no such notice if left blank.') . '</p>' .
+ '<p>' . __('Registration settings can disable/enable public signups. If you let others sign up for a site, install spam plugins. Spaces, not commas, should separate names banned as sites for this network.') . '</p>' .
+ '<p>' . __('New site settings are defaults applied when a new site is created in the network. These include welcome email for when a new site or user account is registered, and what᾿s put in the first post, page, comment, comment author, and comment URL.') . '</p>' .
+ '<p>' . __('Upload settings control the size of the uploaded files and the amount of available upload space for each site. You can change the default value for specific sites when you edit a particular site. Allowed file types are also listed (space separated only).') . '</p>' .
+ '<p>' . __('Checkboxes for media upload buttons set which are shown in the visual editor. If unchecked, a generic upload button is still visible; other media types can still be uploaded if on the allowed file types list.') . '</p>' .
+ '<p>' . __('Menu setting enables/disables the plugin menus from appearing for non super admins, so that only super admins, not site admins, have access to activate plugins.') . '</p>' .
+ '<p>' . __('Super admins can no longer be added on the Options screen. You must now go to the list of existing users on Super Admin > Users and click on Username or the Edit action link below that name. This goes to an Edit User page where you can check a box to grant super admin privileges.') . '</p>' .
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Settings_Screen" target="_blank">Documentation on Network Settings</a>') . '</p>' .
+ '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+);
+
+include( '../admin-header.php' );
+
+if (isset($_GET['updated'])) {
+ ?>
+ <div id="message" class="updated"><p><?php _e( 'Options saved.' ) ?></p></div>
+ <?php
+}
+?>
+
+<div class="wrap">
+ <?php screen_icon('options-general'); ?>
+ <h2><?php _e( 'Settings' ) ?></h2>
+ <form method="post" action="edit.php?action=siteoptions">
+ <?php wp_nonce_field( 'siteoptions' ); ?>
+ <h3><?php _e( 'Operational Settings' ); ?></h3>
+ <table class="form-table">
+ <tr valign="top">
+ <th scope="row"><label for="site_name"><?php _e( 'Network Name' ) ?></label></th>
+ <td>
+ <input name="site_name" type="text" id="site_name" class="regular-text" value="<?php echo esc_attr( $current_site->site_name ) ?>" />
+ <br />
+ <?php _e( 'What you would like to call this website.' ) ?>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th>
+ <td>
+ <input name="admin_email" type="text" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option('admin_email') ) ?>" />
+ <br />
+ <?php printf( __( 'Registration and support emails will come from this address. An address such as <code>support@%s</code> is recommended.' ), $current_site->domain ); ?>
+ </td>
+ </tr>
+ </table>
+ <h3><?php _e( 'Registration Settings' ); ?></h3>
+ <table class="form-table">
+ <tr valign="top">
+ <th scope="row"><?php _e( 'Allow new registrations' ) ?></th>
+ <?php
+ if ( !get_site_option( 'registration' ) )
+ update_site_option( 'registration', 'none' );
+ $reg = get_site_option( 'registration' );
+ ?>
+ <td>
+ <label><input name="registration" type="radio" id="registration1" value="none"<?php checked( $reg, 'none') ?> /> <?php _e( 'Registration is disabled.' ); ?></label><br />
+ <label><input name="registration" type="radio" id="registration2" value="user"<?php checked( $reg, 'user') ?> /> <?php _e( 'User accounts may be registered.' ); ?></label><br />
+ <label><input name="registration" type="radio" id="registration3" value="blog"<?php checked( $reg, 'blog') ?> /> <?php _e( 'Logged in users may register new sites.' ); ?></label><br />
+ <label><input name="registration" type="radio" id="registration4" value="all"<?php checked( $reg, 'all') ?> /> <?php _e( 'Both sites and user accounts can be registered.' ); ?></label><br />
+ <?php if ( is_subdomain_install() )
+ _e( 'If registration is disabled, please set <code>NOBLOGREDIRECT</code> in <code>wp-config.php</code> to a URL you will redirect visitors to if they visit a non-existent site.' );
+ ?>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <th scope="row"><?php _e( 'Registration notification' ) ?></th>
+ <?php
+ if ( !get_site_option( 'registrationnotification' ) )
+ update_site_option( 'registrationnotification', 'yes' );
+ ?>
+ <td>
+ <label><input name="registrationnotification" type="checkbox" id="registrationnotification" value="yes"<?php checked( get_site_option( 'registrationnotification' ), 'yes' ) ?> /> <?php _e( 'Send the network admin an email notification every time someone registers a site or user account.' ) ?></label>
+ </td>
+ </tr>
+
+ <tr valign="top" id="addnewusers">
+ <th scope="row"><?php _e( 'Add New Users' ) ?></th>
+ <td>
+ <label><input name="add_new_users" type="checkbox" id="add_new_users" value="1"<?php checked( get_site_option( 'add_new_users' ) ) ?> /> <?php _e( 'Allow site administrators to add new users to their site via the "Users → Add New" page.' ); ?></label>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <th scope="row"><label for="illegal_names"><?php _e( 'Banned Names' ) ?></label></th>
+ <td>
+ <input name="illegal_names" type="text" id="illegal_names" class="large-text" value="<?php echo esc_attr( implode( " ", (array) get_site_option( 'illegal_names' ) ) ); ?>" size="45" />
+ <br />
+ <?php _e( 'Users are not allowed to register these sites. Separate names by spaces.' ) ?>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <th scope="row"><label for="limited_email_domains"><?php _e( 'Limited Email Registrations' ) ?></label></th>
+ <td>
+ <?php $limited_email_domains = get_site_option( 'limited_email_domains' );
+ $limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); ?>
+ <textarea name="limited_email_domains" id="limited_email_domains" cols="45" rows="5">
+<?php echo esc_textarea( $limited_email_domains == '' ? '' : implode( "\n", (array) $limited_email_domains ) ); ?></textarea>
+ <br />
+ <?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ) ?>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <th scope="row"><label for="banned_email_domains"><?php _e('Banned Email Domains') ?></label></th>
+ <td>
+ <textarea name="banned_email_domains" id="banned_email_domains" cols="45" rows="5">
+<?php echo esc_textarea( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) ) ); ?></textarea>
+ <br />
+ <?php _e( 'If you want to ban domains from site registrations. One domain per line.' ) ?>
+ </td>
+ </tr>
+
+ </table>
+ <h3><?php _e('New Site Settings'); ?></h3>
+ <table class="form-table">
+
+ <tr valign="top">
+ <th scope="row"><label for="welcome_email"><?php _e( 'Welcome Email' ) ?></label></th>
+ <td>
+ <textarea name="welcome_email" id="welcome_email" rows="5" cols="45" class="large-text">
+<?php echo esc_textarea( stripslashes( get_site_option( 'welcome_email' ) ) ) ?></textarea>
+ <br />
+ <?php _e( 'The welcome email sent to new site owners.' ) ?>
+ </td>
+ </tr>
+ <tr valign="top">
+ <th scope="row"><label for="welcome_user_email"><?php _e( 'Welcome User Email' ) ?></label></th>
+ <td>
+ <textarea name="welcome_user_email" id="welcome_user_email" rows="5" cols="45" class="large-text">
+<?php echo esc_textarea( stripslashes( get_site_option( 'welcome_user_email' ) ) ) ?></textarea>
+ <br />
+ <?php _e( 'The welcome email sent to new users.' ) ?>
+ </td>
+ </tr>
+ <tr valign="top">
+ <th scope="row"><label for="first_post"><?php _e( 'First Post' ) ?></label></th>
+ <td>
+ <textarea name="first_post" id="first_post" rows="5" cols="45" class="large-text">
+<?php echo esc_textarea( stripslashes( get_site_option( 'first_post' ) ) ) ?></textarea>
+ <br />
+ <?php _e( 'The first post on a new site.' ) ?>
+ </td>
+ </tr>
+ <tr valign="top">
+ <th scope="row"><label for="first_page"><?php _e( 'First Page' ) ?></label></th>
+ <td>
+ <textarea name="first_page" id="first_page" rows="5" cols="45" class="large-text">
+<?php echo esc_textarea( stripslashes( get_site_option('first_page') ) ) ?></textarea>
+ <br />
+ <?php _e( 'The first page on a new site.' ) ?>
+ </td>
+ </tr>
+ <tr valign="top">
+ <th scope="row"><label for="first_comment"><?php _e( 'First Comment' ) ?></label></th>
+ <td>
+ <textarea name="first_comment" id="first_comment" rows="5" cols="45" class="large-text">
+<?php echo esc_textarea( stripslashes( get_site_option('first_comment') ) ) ?></textarea>
+ <br />
+ <?php _e( 'The first comment on a new site.' ) ?>
+ </td>
+ </tr>
+ <tr valign="top">
+ <th scope="row"><label for="first_comment_author"><?php _e( 'First Comment Author' ) ?></label></th>
+ <td>
+ <input type="text" size="40" name="first_comment_author" id="first_comment_author" value="<?php echo get_site_option('first_comment_author') ?>" />
+ <br />
+ <?php _e( 'The author of the first comment on a new site.' ) ?>
+ </td>
+ </tr>
+ <tr valign="top">
+ <th scope="row"><label for="first_comment_url"><?php _e( 'First Comment URL' ) ?></label></th>
+ <td>
+ <input type="text" size="40" name="first_comment_url" id="first_comment_url" value="<?php echo esc_attr( get_site_option( 'first_comment_url' ) ) ?>" />
+ <br />
+ <?php _e( 'The URL for the first comment on a new site.' ) ?>
+ </td>
+ </tr>
+ </table>
+ <h3><?php _e( 'Upload Settings' ); ?></h3>
+ <table class="form-table">
+ <tr valign="top">
+ <th scope="row"><?php _e( 'Media upload buttons' ) ?></th>
+ <?php $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); ?>
+ <td><label><input type="checkbox" id="mu_media_buttons_image" name="mu_media_buttons[image]" value="1"<?php checked( ! empty( $mu_media_buttons['image'] ) ) ?>/> <?php _e( 'Images' ); ?></label><br />
+ <label><input type="checkbox" id="mu_media_buttons_video" name="mu_media_buttons[video]" value="1"<?php checked( ! empty( $mu_media_buttons['video'] ) ) ?>/> <?php _e( 'Videos' ); ?></label><br />
+ <label><input type="checkbox" id="mu_media_buttons_audio" name="mu_media_buttons[audio]" value="1"<?php checked( ! empty( $mu_media_buttons['audio'] ) ) ?>/> <?php _e( 'Music' ); ?></label><br />
+ <?php _e( 'The media upload buttons to display on the “Write Post” page. Make sure you update the allowed upload file types below as well.' ); ?></td>
+ </tr>
+
+ <tr valign="top">
+ <th scope="row"><?php _e( 'Site upload space' ) ?></th>
+ <td>
+ <label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( get_site_option( 'upload_space_check_disabled' ), 0 ) ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="text" id="blog_upload_space" value="' . esc_attr( get_site_option('blog_upload_space', 10) ) . '" size="3" />' ); ?></label><br />
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <th scope="row"><label for="upload_filetypes"><?php _e( 'Upload file types' ) ?></label></th>
+ <td><input name="upload_filetypes" type="text" id="upload_filetypes" class="large-text" value="<?php echo esc_attr( get_site_option('upload_filetypes', 'jpg jpeg png gif') ) ?>" size="45" /></td>
+ </tr>
+
+ <tr valign="top">
+ <th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ) ?></label></th>
+ <td><?php printf( _x( '%s KB', 'File size in kilobytes' ), '<input name="fileupload_maxk" type="text" id="fileupload_maxk" value="' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '" size="5" />' ); ?></td>
+ </tr>
+ </table>
+
+<?php
+ $languages = get_available_languages();
+ if ( ! empty( $languages ) ) {
+ $lang = get_site_option( 'WPLANG' );
+?>
+ <h3><?php _e( 'Language Settings' ); ?></h3>
+ <table class="form-table">
+ <tr valign="top">
+ <th><label for="WPLANG"><?php _e( 'Default Language' ); ?></label></th>
+ <td>
+ <select name="WPLANG" id="WPLANG">
+ <?php mu_dropdown_languages( $languages, get_site_option( 'WPLANG' ) ); ?>
+ </select>
+ </td>
+ </tr>
+ </table>
+<?php
+ } // languages
+?>
+
+ <h3><?php _e( 'Menu Settings' ); ?></h3>
+ <table id="menu" class="form-table">
+ <tr valign="top">
+ <th scope="row"><?php _e( 'Enable administration menus' ); ?></th>
+ <td>
+ <?php
+ $menu_perms = get_site_option( 'menu_items' );
+ $menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) );
+ foreach ( (array) $menu_items as $key => $val ) {
+ echo "<label><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . ( isset( $menu_perms[$key] ) ? checked( $menu_perms[$key], '1', false ) : '' ) . " /> " . esc_html( $val ) . "</label><br/>";
+ }
+ ?>
+ </td>
+ </tr>
+ </table>
+
+ <?php do_action( 'wpmu_options' ); // Add more options here ?>
+
+ <?php submit_button(); ?>
+ </form>
+</div>
+
+<?php include( '../admin-footer.php' ); ?>
--- /dev/null
+<?php
+/**
+ * Network Setup administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+require( '../network.php' );
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Edit Site Info Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have sufficient permissions to edit this site.' ) );
+
+add_contextual_help($current_screen,
+ '<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
+ '<p>' . __('<strong>Info</strong> - The domain and path are rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' .
+ '<p>' . __('<strong>Users</strong> - This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' .
+ '<p>' . sprintf( __('<strong>Themes</strong> - This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
+ '<p>' . __('<strong>Settings</strong> - This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>' .
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screens" target="_blank">Documentation on Site Management</a>') . '</p>' .
+ '<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
+);
+
+$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+
+if ( ! $id )
+ wp_die( __('Invalid site ID.') );
+
+$details = get_blog_details( $id );
+if ( !can_edit_network( $details->site_id ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+$is_main_site = is_main_site( $id );
+
+if ( isset($_REQUEST['action']) && 'update-site' == $_REQUEST['action'] ) {
+ check_admin_referer( 'edit-site' );
+
+ switch_to_blog( $id );
+
+ if ( isset( $_POST['update_home_url'] ) && $_POST['update_home_url'] == 'update' ) {
+ $blog_address = get_blogaddress_by_domain( $_POST['blog']['domain'], $_POST['blog']['path'] );
+ if ( get_option( 'siteurl' ) != $blog_address )
+ update_option( 'siteurl', $blog_address );
+
+ if ( get_option( 'home' ) != $blog_address )
+ update_option( 'home', $blog_address );
+ }
+
+ // rewrite rules can't be flushed during switch to blog
+ delete_option( 'rewrite_rules' );
+
+ // update blogs table
+ $blog_data = stripslashes_deep( $_POST['blog'] );
+ $existing_details = get_blog_details( $id, false );
+ $blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' );
+ foreach ( $blog_data_checkboxes as $c ) {
+ if ( ! in_array( $existing_details->$c, array( 0, 1 ) ) )
+ $blog_data[ $c ] = $existing_details->$c;
+ else
+ $blog_data[ $c ] = isset( $_POST['blog'][ $c ] ) ? 1 : 0;
+ }
+ update_blog_details( $id, $blog_data );
+
+ restore_current_blog();
+ wp_redirect( add_query_arg( array( 'update' => 'updated', 'id' => $id ), 'site-info.php') );
+ exit;
+}
+
+if ( isset($_GET['update']) ) {
+ $messages = array();
+ if ( 'updated' == $_GET['update'] )
+ $messages[] = __('Site info updated.');
+}
+
+$title = sprintf( __('Edit Site: %s'), get_blogaddress_by_id($id));
+$parent_file = 'sites.php';
+$submenu_file = 'sites.php';
+
+require('../admin-header.php');
+
+?>
+
+<div class="wrap">
+<?php screen_icon('ms-admin'); ?>
+<h2 id="edit-site"><?php echo $title ?></h2>
+<h3 class="nav-tab-wrapper">
+<?php
+$tabs = array(
+ 'site-info' => array( 'label' => __( 'Info' ), 'url' => 'site-info.php' ),
+ 'site-users' => array( 'label' => __( 'Users' ), 'url' => 'site-users.php' ),
+ 'site-themes' => array( 'label' => __( 'Themes' ), 'url' => 'site-themes.php' ),
+ 'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ),
+);
+foreach ( $tabs as $tab_id => $tab ) {
+ $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
+ echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
+}
+?>
+</h3>
+<?php
+if ( ! empty( $messages ) ) {
+ foreach ( $messages as $msg )
+ echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
+} ?>
+<form method="post" action="site-info.php?action=update-site">
+ <?php wp_nonce_field( 'edit-site' ); ?>
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
+ <table class="form-table">
+ <tr class="form-field form-required">
+ <th scope="row"><?php _e( 'Domain' ) ?></th>
+ <?php
+ $protocol = is_ssl() ? 'https://' : 'http://';
+ if ( $is_main_site ) { ?>
+ <td><code><?php echo $protocol; echo esc_attr( $details->domain ) ?></code></td>
+ <?php } else { ?>
+ <td><?php echo $protocol; ?><input name="blog[domain]" type="text" id="domain" value="<?php echo esc_attr( $details->domain ) ?>" size="33" /></td>
+ <?php } ?>
+ </tr>
+ <tr class="form-field form-required">
+ <th scope="row"><?php _e( 'Path' ) ?></th>
+ <?php if ( $is_main_site ) { ?>
+ <td><code><?php echo esc_attr( $details->path ) ?></code></td>
+ <?php } else { ?>
+ <td><input name="blog[path]" type="text" id="path" value="<?php echo esc_attr( $details->path ) ?>" size="40" style='margin-bottom:5px;' />
+ <br /><input type="checkbox" style="width:20px;" name="update_home_url" value="update" <?php if ( get_blog_option( $id, 'siteurl' ) == untrailingslashit( get_blogaddress_by_id ($id ) ) || get_blog_option( $id, 'home' ) == untrailingslashit( get_blogaddress_by_id( $id ) ) ) echo 'checked="checked"'; ?> /> <?php _e( 'Update <code>siteurl</code> and <code>home</code> as well.' ); ?></td>
+ <?php } ?>
+ </tr>
+ <tr class="form-field">
+ <th scope="row"><?php _ex( 'Registered', 'site' ) ?></th>
+ <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr( $details->registered ) ?>" size="40" /></td>
+ </tr>
+ <tr class="form-field">
+ <th scope="row"><?php _e( 'Last Updated' ); ?></th>
+ <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr( $details->last_updated ) ?>" size="40" /></td>
+ </tr>
+ <?php
+ $attribute_fields = array( 'public' => __( 'Public' ) );
+ if ( ! $is_main_site ) {
+ $attribute_fields['archived'] = __( 'Archived' );
+ $attribute_fields['spam'] = _x( 'Spam', 'site' );
+ $attribute_fields['deleted'] = __( 'Deleted' );
+ }
+ $attribute_fields['mature'] = __( 'Mature' );
+ ?>
+ <tr>
+ <th scope="row"><?php _e( 'Attributes' ); ?></th>
+ <td>
+ <?php foreach ( $attribute_fields as $field_key => $field_label ) : ?>
+ <label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1" <?php checked( (bool) $details->$field_key, true ); disabled( ! in_array( $details->$field_key, array( 0, 1 ) ) ); ?> />
+ <?php echo $field_label; ?></label><br/>
+ <?php endforeach; ?>
+ </td>
+ </tr>
+ </table>
+ <?php submit_button(); ?>
+</form>
+
+</div>
+<?php
+require('../admin-footer.php');
--- /dev/null
+<?php
+/**
+ * Add Site Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have sufficient permissions to add sites to this network.' ) );
+
+add_contextual_help($current_screen,
+ '<p>' . __('This screen is for Super Admins to add new sites to the network. This is not affected by the registration settings.') . '</p>' .
+ '<p>' . __('If the admin email for the new site does not exist in the database, a new user will also be created.') . '</p>' .
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screens" target="_blank">Documentation on Site Management</a>') . '</p>' .
+ '<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
+);
+
+if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) {
+ check_admin_referer( 'add-blog', '_wpnonce_add-blog' );
+
+ if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ if ( ! is_array( $_POST['blog'] ) )
+ wp_die( __( 'Can’t create an empty site.' ) );
+ $blog = $_POST['blog'];
+ $domain = '';
+ if ( ! preg_match( '/(--)/', $blog['domain'] ) && preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) )
+ $domain = strtolower( $blog['domain'] );
+
+ // If not a subdomain install, make sure the domain isn't a reserved word
+ if ( ! is_subdomain_install() ) {
+ $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) );
+ if ( in_array( $domain, $subdirectory_reserved_names ) )
+ wp_die( sprintf( __('The following words are reserved for use by WordPress functions and cannot be used as blog names: <code>%s</code>' ), implode( '</code>, <code>', $subdirectory_reserved_names ) ) );
+ }
+
+ $email = sanitize_email( $blog['email'] );
+ $title = $blog['title'];
+
+ if ( empty( $domain ) )
+ wp_die( __( 'Missing or invalid site address.' ) );
+ if ( empty( $email ) )
+ wp_die( __( 'Missing email address.' ) );
+ if ( !is_email( $email ) )
+ wp_die( __( 'Invalid email address.' ) );
+
+ if ( is_subdomain_install() ) {
+ $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
+ $path = $base;
+ } else {
+ $newdomain = $current_site->domain;
+ $path = $base . $domain . '/';
+ }
+
+ $password = 'N/A';
+ $user_id = email_exists($email);
+ if ( !$user_id ) { // Create a new user with a random password
+ $password = wp_generate_password( 12, false );
+ $user_id = wpmu_create_user( $domain, $password, $email );
+ if ( false == $user_id )
+ wp_die( __( 'There was an error creating the user.' ) );
+ else
+ wp_new_user_notification( $user_id, $password );
+ }
+
+ $wpdb->hide_errors();
+ $id = wpmu_create_blog( $newdomain, $path, $title, $user_id , array( 'public' => 1 ), $current_site->id );
+ $wpdb->show_errors();
+ if ( !is_wp_error( $id ) ) {
+ if ( !is_super_admin( $user_id ) && !get_user_option( 'primary_blog', $user_id ) )
+ update_user_option( $user_id, 'primary_blog', $id, true );
+ $content_mail = sprintf( __( "New site created by %1s\n\nAddress: http://%2s\nName: %3s"), $current_user->user_login , $newdomain . $path, stripslashes( $title ) );
+ wp_mail( get_site_option('admin_email'), sprintf( __( '[%s] New Site Created' ), $current_site->site_name ), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' );
+ wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) );
+ wp_redirect( add_query_arg( array('update' => 'added'), 'site-new.php' ) );
+ exit;
+ } else {
+ wp_die( $id->get_error_message() );
+ }
+}
+
+if ( isset($_GET['update']) ) {
+ $messages = array();
+ if ( 'added' == $_GET['update'] )
+ $messages[] = __('Site added.');
+}
+
+$title = __('Add New Site');
+$parent_file = 'sites.php';
+
+require('../admin-header.php');
+
+?>
+
+<div class="wrap">
+<?php screen_icon('ms-admin'); ?>
+<h2 id="add-new-site"><?php _e('Add New Site') ?></h2>
+<?php
+if ( ! empty( $messages ) ) {
+ foreach ( $messages as $msg )
+ echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
+} ?>
+<form method="post" action="<?php echo network_admin_url('site-new.php?action=add-site'); ?>">
+<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?>
+ <table class="form-table">
+ <tr class="form-field form-required">
+ <th scope="row"><?php _e( 'Site Address' ) ?></th>
+ <td>
+ <?php if ( is_subdomain_install() ) { ?>
+ <input name="blog[domain]" type="text" class="regular-text" title="<?php _e( 'Domain' ) ?>"/>.<?php echo preg_replace( '|^www\.|', '', $current_site->domain );?>
+ <?php } else {
+ echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php _e( 'Domain' ) ?>"/>
+ <?php }
+ echo '<p>' . __( 'Only the characters a-z and 0-9 recommended.' ) . '</p>';
+ ?>
+ </td>
+ </tr>
+ <tr class="form-field form-required">
+ <th scope="row"><?php _e( 'Site Title' ) ?></th>
+ <td><input name="blog[title]" type="text" class="regular-text" title="<?php _e( 'Title' ) ?>"/></td>
+ </tr>
+ <tr class="form-field form-required">
+ <th scope="row"><?php _e( 'Admin Email' ) ?></th>
+ <td><input name="blog[email]" type="text" class="regular-text" title="<?php _e( 'Email' ) ?>"/></td>
+ </tr>
+ <tr class="form-field">
+ <td colspan="2"><?php _e( 'A new user will be created if the above email address is not in the database.' ) ?><br /><?php _e( 'The username and password will be mailed to this email address.' ) ?></td>
+ </tr>
+ </table>
+ <?php submit_button( __('Add Site'), 'primary', 'add-site' ); ?>
+ </form>
+</div>
+<?php
+require('../admin-footer.php');
+?>
--- /dev/null
+<?php
+/**
+ * Edit Site Settings Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have sufficient permissions to edit this site.' ) );
+
+add_contextual_help($current_screen,
+ '<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
+ '<p>' . __('<strong>Info</strong> - The domain and path are rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' .
+ '<p>' . __('<strong>Users</strong> - This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' .
+ '<p>' . sprintf( __('<strong>Themes</strong> - This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
+ '<p>' . __('<strong>Settings</strong> - This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>' .
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screens" target="_blank">Documentation on Site Management</a>') . '</p>' .
+ '<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
+);
+
+$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+
+if ( ! $id )
+ wp_die( __('Invalid site ID.') );
+
+$details = get_blog_details( $id );
+if ( !can_edit_network( $details->site_id ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+$is_main_site = is_main_site( $id );
+
+if ( isset($_REQUEST['action']) && 'update-site' == $_REQUEST['action'] && is_array( $_POST['option'] ) ) {
+ check_admin_referer( 'edit-site' );
+
+ switch_to_blog( $id );
+
+ $c = 1;
+ $count = count( $_POST['option'] );
+ $skip_options = array( 'allowedthemes' ); // Don't update these options since they are handled elsewhere in the form.
+ foreach ( (array) $_POST['option'] as $key => $val ) {
+ if ( $key === 0 || is_array( $val ) || in_array($key, $skip_options) )
+ continue; // Avoids "0 is a protected WP option and may not be modified" error when edit blog options
+ if ( $c == $count )
+ update_option( $key, stripslashes( $val ) );
+ else
+ update_option( $key, stripslashes( $val ), false ); // no need to refresh blog details yet
+ $c++;
+ }
+
+ do_action( 'wpmu_update_blog_options' );
+ restore_current_blog();
+ wp_redirect( add_query_arg( array( 'update' => 'updated', 'id' => $id ), 'site-settings.php') );
+ exit;
+}
+
+if ( isset($_GET['update']) ) {
+ $messages = array();
+ if ( 'updated' == $_GET['update'] )
+ $messages[] = __('Site options updated.');
+}
+
+$title = sprintf( __('Edit Site: %s'), get_blogaddress_by_id($id));
+$parent_file = 'sites.php';
+$submenu_file = 'sites.php';
+
+require('../admin-header.php');
+
+?>
+
+<div class="wrap">
+<?php screen_icon('ms-admin'); ?>
+<h2 id="edit-site"><?php echo $title ?></h2>
+<h3 class="nav-tab-wrapper">
+<?php
+$tabs = array(
+ 'site-info' => array( 'label' => __( 'Info' ), 'url' => 'site-info.php' ),
+ 'site-users' => array( 'label' => __( 'Users' ), 'url' => 'site-users.php' ),
+ 'site-themes' => array( 'label' => __( 'Themes' ), 'url' => 'site-themes.php' ),
+ 'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ),
+);
+foreach ( $tabs as $tab_id => $tab ) {
+ $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
+ echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
+}
+?>
+</h3>
+<?php
+if ( ! empty( $messages ) ) {
+ foreach ( $messages as $msg )
+ echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
+} ?>
+<form method="post" action="site-settings.php?action=update-site">
+ <?php wp_nonce_field( 'edit-site' ); ?>
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
+ <table class="form-table">
+ <?php
+ $blog_prefix = $wpdb->get_blog_prefix( $id );
+ $options = $wpdb->get_results( "SELECT * FROM {$blog_prefix}options WHERE option_name NOT LIKE '\_%' AND option_name NOT LIKE '%user_roles'" );
+ foreach ( $options as $option ) {
+ if ( $option->option_name == 'default_role' )
+ $editblog_default_role = $option->option_value;
+ $disabled = false;
+ $class = 'all-options';
+ if ( is_serialized( $option->option_value ) ) {
+ if ( is_serialized_string( $option->option_value ) ) {
+ $option->option_value = esc_html( maybe_unserialize( $option->option_value ), 'single' );
+ } else {
+ $option->option_value = 'SERIALIZED DATA';
+ $disabled = true;
+ $class = 'all-options disabled';
+ }
+ }
+ if ( strpos( $option->option_value, "\n" ) !== false ) {
+ ?>
+ <tr class="form-field">
+ <th scope="row"><?php echo ucwords( str_replace( "_", " ", $option->option_name ) ) ?></th>
+ <td><textarea class="<?php echo $class; ?>" rows="5" cols="40" name="option[<?php echo esc_attr( $option->option_name ) ?>]" id="<?php echo esc_attr( $option->option_name ) ?>"<?php disabled( $disabled ) ?>><?php echo esc_textarea( $option->option_value ) ?></textarea></td>
+ </tr>
+ <?php
+ } else {
+ ?>
+ <tr class="form-field">
+ <th scope="row"><?php echo esc_html( ucwords( str_replace( "_", " ", $option->option_name ) ) ); ?></th>
+ <?php if ( $is_main_site && in_array( $option->option_name, array( 'siteurl', 'home' ) ) ) { ?>
+ <td><code><?php echo esc_html( $option->option_value ) ?></code></td>
+ <?php } else { ?>
+ <td><input class="<?php echo $class; ?>" name="option[<?php echo esc_attr( $option->option_name ) ?>]" type="text" id="<?php echo esc_attr( $option->option_name ) ?>" value="<?php echo esc_attr( $option->option_value ) ?>" size="40" <?php disabled( $disabled ) ?> /></td>
+ <?php } ?>
+ </tr>
+ <?php
+ }
+ } // End foreach
+ do_action( 'wpmueditblogaction', $id );
+ ?>
+ </table>
+ <?php submit_button(); ?>
+</form>
+
+</div>
+<?php
+require('../admin-footer.php');
--- /dev/null
+<?php
+/**
+ * Edit Site Themes Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+$menu_perms = get_site_option( 'menu_items', array() );
+
+if ( empty( $menu_perms['themes'] ) && ! is_super_admin() )
+ wp_die( __( 'Cheatin’ uh?' ) );
+
+if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have sufficient permissions to manage themes for this site.' ) );
+
+add_contextual_help($current_screen,
+ '<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
+ '<p>' . __('<strong>Info</strong> - The domain and path are rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' .
+ '<p>' . __('<strong>Users</strong> - This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' .
+ '<p>' . sprintf( __('<strong>Themes</strong> - This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
+ '<p>' . __('<strong>Settings</strong> - This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>' .
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screens" target="_blank">Documentation on Site Management</a>') . '</p>' .
+ '<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
+);
+
+$wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
+
+$action = $wp_list_table->current_action();
+
+$s = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
+
+// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
+$temp_args = array( 'enabled', 'disabled', 'error' );
+$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] );
+$referer = remove_query_arg( $temp_args, wp_get_referer() );
+
+$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+
+if ( ! $id )
+ wp_die( __('Invalid site ID.') );
+
+$wp_list_table->prepare_items();
+
+$details = get_blog_details( $id );
+if ( !can_edit_network( $details->site_id ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+$is_main_site = is_main_site( $id );
+
+if ( $action ) {
+ switch_to_blog( $id );
+ $allowed_themes = get_option( 'allowedthemes' );
+
+ switch ( $action ) {
+ case 'enable':
+ check_admin_referer( 'enable-theme_' . $_GET['theme'] );
+ $theme = $_GET['theme'];
+ $action = 'enabled';
+ $n = 1;
+ if ( !$allowed_themes )
+ $allowed_themes = array( $theme => true );
+ else
+ $allowed_themes[$theme] = true;
+ break;
+ case 'disable':
+ check_admin_referer( 'disable-theme_' . $_GET['theme'] );
+ $theme = $_GET['theme'];
+ $action = 'disabled';
+ $n = 1;
+ if ( !$allowed_themes )
+ $allowed_themes = array();
+ else
+ unset( $allowed_themes[$theme] );
+ break;
+ case 'enable-selected':
+ check_admin_referer( 'bulk-themes' );
+ if ( isset( $_POST['checked'] ) ) {
+ $themes = (array) $_POST['checked'];
+ $action = 'enabled';
+ $n = count( $themes );
+ foreach( (array) $themes as $theme )
+ $allowed_themes[ $theme ] = true;
+ } else {
+ $action = 'error';
+ $n = 'none';
+ }
+ break;
+ case 'disable-selected':
+ check_admin_referer( 'bulk-themes' );
+ if ( isset( $_POST['checked'] ) ) {
+ $themes = (array) $_POST['checked'];
+ $action = 'disabled';
+ $n = count( $themes );
+ foreach( (array) $themes as $theme )
+ unset( $allowed_themes[ $theme ] );
+ } else {
+ $action = 'error';
+ $n = 'none';
+ }
+ break;
+ }
+
+ update_option( 'allowedthemes', $allowed_themes );
+ restore_current_blog();
+
+ wp_redirect( add_query_arg( $action, $n, $referer ) );
+ exit;
+}
+
+if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) {
+ wp_redirect( $referer );
+ exit();
+}
+
+add_thickbox();
+add_screen_option( 'per_page', array( 'label' => _x( 'Themes', 'themes per page (screen options)' ) ) );
+
+$title = sprintf( __('Edit Site: %s'), get_blogaddress_by_id($id));
+$parent_file = 'sites.php';
+$submenu_file = 'sites.php';
+
+require('../admin-header.php'); ?>
+
+<div class="wrap">
+<?php screen_icon('ms-admin'); ?>
+<h2 id="edit-site"><?php echo $title ?></h2>
+<h3 class="nav-tab-wrapper">
+<?php
+$tabs = array(
+ 'site-info' => array( 'label' => __( 'Info' ), 'url' => 'site-info.php' ),
+ 'site-users' => array( 'label' => __( 'Users' ), 'url' => 'site-users.php' ),
+ 'site-themes' => array( 'label' => __( 'Themes' ), 'url' => 'site-themes.php' ),
+ 'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ),
+);
+foreach ( $tabs as $tab_id => $tab ) {
+ $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
+ echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
+}
+?>
+</h3><?php
+
+if ( isset( $_GET['enabled'] ) ) {
+ $_GET['enabled'] = absint( $_GET['enabled'] );
+ echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme enabled.', '%s themes enabled.', $_GET['enabled'] ), number_format_i18n( $_GET['enabled'] ) ) . '</p></div>';
+} elseif ( isset( $_GET['disabled'] ) ) {
+ $_GET['disabled'] = absint( $_GET['disabled'] );
+ echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme disabled.', '%s themes disabled.', $_GET['disabled'] ), number_format_i18n( $_GET['disabled'] ) ) . '</p></div>';
+} elseif ( isset( $_GET['error'] ) && 'none' == $_GET['error'] ) {
+ echo '<div id="message" class="error"><p>' . __( 'No theme selected.' ) . '</p></div>';
+} ?>
+
+<p><?php _e( 'Network enabled themes are not shown on this screen.' ) ?></p>
+
+<form method="get" action="">
+<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?>
+<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
+</form>
+
+<?php $wp_list_table->views(); ?>
+
+<form method="post" action="site-themes.php?action=update-site">
+ <?php wp_nonce_field( 'edit-site' ); ?>
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
+
+<?php $wp_list_table->display(); ?>
+
+</form>
+
+</div>
+<?php include(ABSPATH . 'wp-admin/admin-footer.php'); ?>
--- /dev/null
+<?php
+/**
+ * Edit Site Users Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! current_user_can('manage_sites') )
+ wp_die(__('You do not have sufficient permissions to edit this site.'));
+
+$wp_list_table = _get_list_table('WP_Users_List_Table');
+$wp_list_table->prepare_items();
+
+$action = $wp_list_table->current_action();
+
+add_contextual_help($current_screen,
+ '<p>' . __('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.') . '</p>' .
+ '<p>' . __('<strong>Info</strong> - The domain and path are rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.') . '</p>' .
+ '<p>' . __('<strong>Users</strong> - This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.') . '</p>' .
+ '<p>' . sprintf( __('<strong>Themes</strong> - This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site’s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
+ '<p>' . __('<strong>Settings</strong> - This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.') . '</p>' .
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screens" target="_blank">Documentation on Site Management</a>') . '</p>' .
+ '<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
+);
+
+$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+
+if ( ! $id )
+ wp_die( __('Invalid site ID.') );
+
+$details = get_blog_details( $id );
+if ( !can_edit_network( $details->site_id ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+$is_main_site = is_main_site( $id );
+
+// get blog prefix
+$blog_prefix = $wpdb->get_blog_prefix( $id );
+
+// @todo This is a hack. Eventually, add API to WP_Roles allowing retrieval of roles for a particular blog.
+if ( ! empty($wp_roles->use_db) ) {
+ $editblog_roles = get_blog_option( $id, "{$blog_prefix}user_roles" );
+} else {
+ // Roles are stored in memory, not the DB.
+ $editblog_roles = $wp_roles->roles;
+}
+$default_role = get_blog_option( $id, 'default_role' );
+
+$action = $wp_list_table->current_action();
+
+if ( $action ) {
+ switch_to_blog( $id );
+
+ switch ( $action ) {
+ case 'newuser':
+ check_admin_referer( 'add-user', '_wpnonce_add-new-user' );
+ $user = $_POST['user'];
+ if ( !is_array( $_POST['user'] ) || empty( $user['username'] ) || empty( $user['email'] ) ) {
+ $update = 'err_new';
+ } else {
+ $password = wp_generate_password( 12, false);
+ $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
+
+ if ( false == $user_id ) {
+ $update = 'err_new_dup';
+ } else {
+ wp_new_user_notification( $user_id, $password );
+ add_user_to_blog( $id, $user_id, $_POST['new_role'] );
+ $update = 'newuser';
+ }
+ }
+ break;
+
+ case 'adduser':
+ check_admin_referer( 'add-user', '_wpnonce_add-user' );
+ if ( !empty( $_POST['newuser'] ) ) {
+ $update = 'adduser';
+ $newuser = $_POST['newuser'];
+ $userid = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . $wpdb->users . " WHERE user_login = %s", $newuser ) );
+ if ( $userid ) {
+ $user = $wpdb->get_var( "SELECT user_id FROM " . $wpdb->usermeta . " WHERE user_id='$userid' AND meta_key='{$blog_prefix}capabilities'" );
+ if ( $user == false )
+ add_user_to_blog( $id, $userid, $_POST['new_role'] );
+ else
+ $update = 'err_add_member';
+ } else {
+ $update = 'err_add_notfound';
+ }
+ } else {
+ $update = 'err_add_notfound';
+ }
+ break;
+
+ case 'remove':
+ if ( !current_user_can('remove_users') )
+ die(__('You can’t remove users.'));
+ check_admin_referer( 'bulk-users' );
+
+ $update = 'remove';
+ if ( isset( $_REQUEST['users'] ) ) {
+ $userids = $_REQUEST['users'];
+
+ foreach ( $userids as $user_id ) {
+ $user_id = (int) $user_id;
+ remove_user_from_blog( $user_id, $id );
+ }
+ } elseif ( isset( $_GET['user'] ) ) {
+ remove_user_from_blog( $_GET['user'] );
+ } else {
+ $update = 'err_remove';
+ }
+ break;
+
+ case 'promote':
+ check_admin_referer( 'bulk-users' );
+ $editable_roles = get_editable_roles();
+ if ( empty( $editable_roles[$_REQUEST['new_role']] ) )
+ wp_die(__('You can’t give users that role.'));
+
+ if ( isset( $_REQUEST['users'] ) ) {
+ $userids = $_REQUEST['users'];
+ $update = 'promote';
+ foreach ( $userids as $user_id ) {
+ $user_id = (int) $user_id;
+
+ // If the user doesn't already belong to the blog, bail.
+ if ( !is_user_member_of_blog( $user_id ) )
+ wp_die(__('Cheatin’ uh?'));
+
+ $user = new WP_User( $user_id );
+ $user->set_role( $_REQUEST['new_role'] );
+ }
+ } else {
+ $update = 'err_promote';
+ }
+ break;
+ }
+
+ restore_current_blog();
+ wp_redirect( add_query_arg( 'update', $update, wp_get_referer() ) );
+ exit();
+}
+
+if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) {
+ wp_redirect( wp_get_referer() );
+ exit();
+}
+
+add_screen_option( 'per_page', array( 'label' => _x( 'Users', 'users per page (screen options)' ) ) );
+
+$title = sprintf( __('Edit Site: %s'), get_blogaddress_by_id($id));
+$parent_file = 'sites.php';
+$submenu_file = 'sites.php';
+
+require('../admin-header.php'); ?>
+
+<div class="wrap">
+<?php screen_icon('ms-admin'); ?>
+<h2 id="edit-site"><?php echo $title ?></h2>
+<h3 class="nav-tab-wrapper">
+<?php
+$tabs = array(
+ 'site-info' => array( 'label' => __( 'Info' ), 'url' => 'site-info.php' ),
+ 'site-users' => array( 'label' => __( 'Users' ), 'url' => 'site-users.php' ),
+ 'site-themes' => array( 'label' => __( 'Themes' ), 'url' => 'site-themes.php' ),
+ 'site-settings' => array( 'label' => __( 'Settings' ), 'url' => 'site-settings.php' ),
+);
+foreach ( $tabs as $tab_id => $tab ) {
+ $class = ( $tab['url'] == $pagenow ) ? ' nav-tab-active' : '';
+ echo '<a href="' . $tab['url'] . '?id=' . $id .'" class="nav-tab' . $class . '">' . esc_html( $tab['label'] ) . '</a>';
+}
+?>
+</h3><?php
+
+if ( isset($_GET['update']) ) :
+ switch($_GET['update']) {
+ case 'adduser':
+ echo '<div id="message" class="updated"><p>' . __( 'User added.' ) . '</p></div>';
+ break;
+ case 'err_add_member':
+ echo '<div id="message" class="error"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';
+ break;
+ case 'err_add_notfound':
+ echo '<div id="message" class="error"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';
+ break;
+ case 'promote':
+ echo '<div id="message" class="updated"><p>' . __( 'Changed roles.' ) . '</p></div>';
+ break;
+ case 'err_promote':
+ echo '<div id="message" class="error"><p>' . __( 'Select a user to change role.' ) . '</p></div>';
+ break;
+ case 'remove':
+ echo '<div id="message" class="updated"><p>' . __( 'User removed from this site.' ) . '</p></div>';
+ break;
+ case 'err_remove':
+ echo '<div id="message" class="error"><p>' . __( 'Select a user to remove.' ) . '</p></div>';
+ break;
+ case 'newuser':
+ echo '<div id="message" class="updated"><p>' . __( 'User created.' ) . '</p></div>';
+ break;
+ case 'err_new':
+ echo '<div id="message" class="error"><p>' . __( 'Enter the username and email.' ) . '</p></div>';
+ break;
+ case 'err_new_dup':
+ echo '<div id="message" class="error"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';
+ break;
+ }
+endif; ?>
+
+<form class="search-form" action="" method="get">
+<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
+<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
+</form>
+
+<?php $wp_list_table->views(); ?>
+
+<form method="post" action="site-users.php?action=update-site">
+ <?php wp_nonce_field( 'edit-site' ); ?>
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
+
+<?php $wp_list_table->display(); ?>
+
+</form>
+
+<?php do_action( 'network_site_users_after_list_table', '' );?>
+
+<?php if ( current_user_can( 'promote_users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) : ?>
+<h4 id="add-user"><?php _e('Add User to This Site') ?></h4>
+ <?php if ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_users_add_new_form', true ) ) : ?>
+<p><?php _e( 'You may add from existing network users, or set up a new user to add to this site.' ); ?></p>
+ <?php else : ?>
+<p><?php _e( 'You may add from existing network users to this site.' ); ?></p>
+ <?php endif; ?>
+<h5 id="add-existing-user"><?php _e('Add Existing User') ?></h5>
+<form action="site-users.php?action=adduser" id="adduser" method="post">
+ <?php wp_nonce_field( 'edit-site' ); ?>
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
+ <table class="form-table">
+ <tr>
+ <th scope="row"><?php _e( 'Username' ); ?></th>
+ <td><input type="text" class="regular-text" name="newuser" id="newuser" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php _e( 'Role'); ?></th>
+ <td><select name="new_role" id="new_role_0">
+ <?php
+ reset( $editblog_roles );
+ foreach ( $editblog_roles as $role => $role_assoc ){
+ $name = translate_user_role( $role_assoc['name'] );
+ $selected = ( $role == $default_role ) ? 'selected="selected"' : '';
+ echo '<option ' . $selected . ' value="' . esc_attr( $role ) . '">' . esc_html( $name ) . '</option>';
+ }
+ ?>
+ </select></td>
+ </tr>
+ </table>
+ <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
+ <?php submit_button( __('Add User'), 'primary', 'add-user' ); ?>
+</form>
+<?php endif; ?>
+
+<?php if ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_users_add_new_form', true ) ) : ?>
+<h5 id="add-new-user"><?php _e('Add New User') ?></h5>
+<form action="<?php echo network_admin_url('site-users.php?action=newuser'); ?>" id="newuser" method="post">
+ <?php wp_nonce_field( 'edit-site' ); ?>
+ <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
+ <table class="form-table">
+ <tr>
+ <th scope="row"><?php _e( 'Username' ) ?></th>
+ <td><input type="text" class="regular-text" name="user[username]" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php _e( 'Email' ) ?></th>
+ <td><input type="text" class="regular-text" name="user[email]" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php _e( 'Role'); ?></th>
+ <td><select name="new_role" id="new_role_0">
+ <?php
+ reset( $editblog_roles );
+ foreach ( $editblog_roles as $role => $role_assoc ){
+ $name = translate_user_role( $role_assoc['name'] );
+ $selected = ( $role == $default_role ) ? 'selected="selected"' : '';
+ echo '<option ' . $selected . ' value="' . esc_attr( $role ) . '">' . esc_html( $name ) . '</option>';
+ }
+ ?>
+ </select></td>
+ </tr>
+ <tr class="form-field">
+ <td colspan="2"><?php _e( 'Username and password will be mailed to the above email address.' ) ?></td>
+ </tr>
+ </table>
+ <?php wp_nonce_field( 'add-user', '_wpnonce_add-new-user' ) ?>
+ <?php submit_button( __('Add New User'), 'primary', 'add-user' ); ?>
+</form>
+<?php endif; ?>
+</div>
+<?php
+require('../admin-footer.php');
--- /dev/null
+<?php
+/**
+ * Multisite sites administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! current_user_can( 'manage_sites' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+$wp_list_table = _get_list_table('WP_MS_Sites_List_Table');
+$pagenum = $wp_list_table->get_pagenum();
+
+$title = __( 'Sites' );
+$parent_file = 'sites.php';
+
+add_screen_option( 'per_page', array('label' => _x( 'Sites', 'sites per page (screen options)' )) );
+
+add_contextual_help($current_screen,
+ '<p>' . __('Add New takes you to the Add New Site screen. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.') . '</p>' .
+ '<p>' . __('This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.') . '</p>' .
+ '<p>' . __('Hovering over each site reveals seven options (three for the primary site):') . '</p>' .
+ '<ul><li>' . __('An Edit link to a separate Edit Site screen.') . '</li>' .
+ '<li>' . __('Dashboard leads to the Dashboard for that site.') . '</li>' .
+ '<li>' . __('Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.') . '</li>' .
+ '<li>' . __('Delete which is a permanent action after the confirmation screens.') . '</li>' .
+ '<li>' . __('Visit to go to the frontend site live.') . '</li></ul>' .
+ '<p>' . __('The site ID is used internally, and is not shown on the front end of the site or to users/viewers.') . '</p>' .
+ '<p>' . __('Clicking on bold settings can re-sort this table. The upper right icons switch between list and excerpt views.') . '</p>' .
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screens" target="_blank">Documentation on Site Management</a>') . '</p>' .
+ '<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
+);
+
+$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
+
+$msg = '';
+if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty( $_REQUEST['action'] ) ) {
+ switch ( $_REQUEST['action'] ) {
+ case 'all_notspam':
+ $msg = __( 'Sites removed from spam.' );
+ break;
+ case 'all_spam':
+ $msg = __( 'Sites marked as spam.' );
+ break;
+ case 'all_delete':
+ $msg = __( 'Sites deleted.' );
+ break;
+ case 'delete':
+ $msg = __( 'Site deleted.' );
+ break;
+ case 'not_deleted':
+ $msg = __( 'You do not have permission to delete that site.' );
+ break;
+ case 'archive':
+ $msg = __( 'Site archived.' );
+ break;
+ case 'unarchive':
+ $msg = __( 'Site unarchived.' );
+ break;
+ case 'activate':
+ $msg = __( 'Site activated.' );
+ break;
+ case 'deactivate':
+ $msg = __( 'Site deactivated.' );
+ break;
+ case 'unspam':
+ $msg = __( 'Site removed from spam.' );
+ break;
+ case 'spam':
+ $msg = __( 'Site marked as spam.' );
+ break;
+ default:
+ $msg = apply_filters( 'network_sites_updated_message_' . $_REQUEST['action'] , __( 'Settings saved.' ) );
+ break;
+ }
+ if ( $msg )
+ $msg = '<div class="updated" id="message"><p>' . $msg . '</p></div>';
+}
+
+$wp_list_table->prepare_items();
+
+$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
+}
+
+require_once( '../admin-header.php' );
+?>
+
+<div class="wrap">
+<?php screen_icon('ms-admin'); ?>
+<h2><?php _e('Sites') ?>
+<?php echo $msg; ?>
+<?php if ( current_user_can( 'create_sites') ) : ?>
+ <a href="<?php echo network_admin_url('site-new.php'); ?>" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'site' ); ?></a>
+<?php endif; ?>
+
+<?php if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) {
+ printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', esc_html( $s ) );
+} ?>
+</h2>
+
+<form action="" method="get" id="ms-search">
+<?php $wp_list_table->search_box( __( 'Search Sites' ), 'site' ); ?>
+<input type="hidden" name="action" value="blogs" />
+</form>
+
+<form id="form-site-list" action="edit.php?action=allblogs" method="post">
+ <?php $wp_list_table->display(); ?>
+</form>
+</div>
+<?php
+
+require_once( '../admin-footer.php' ); ?>
--- /dev/null
+<?php
+/**
+ * Theme editor network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+require( '../theme-editor.php' );
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Install theme network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+if ( isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) )
+ define( 'IFRAME_REQUEST', true );
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+require( '../theme-install.php' );
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Multisite themes administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+$menu_perms = get_site_option( 'menu_items', array() );
+
+if ( empty( $menu_perms['themes'] ) && ! is_super_admin() )
+ wp_die( __( 'Cheatin’ uh?' ) );
+
+if ( !current_user_can('manage_network_themes') )
+ wp_die( __( 'You do not have sufficient permissions to manage network themes.' ) );
+
+$wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
+$pagenum = $wp_list_table->get_pagenum();
+
+$action = $wp_list_table->current_action();
+
+$s = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
+
+// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
+$temp_args = array( 'enabled', 'disabled', 'deleted', 'error' );
+$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] );
+$referer = remove_query_arg( $temp_args, wp_get_referer() );
+
+if ( $action ) {
+ $allowed_themes = get_site_option( 'allowedthemes' );
+ switch ( $action ) {
+ case 'enable':
+ check_admin_referer('enable-theme_' . $_GET['theme']);
+ $allowed_themes[ $_GET['theme'] ] = true;
+ update_site_option( 'allowedthemes', $allowed_themes );
+ wp_redirect( add_query_arg( 'enabled', '1', $referer ) );
+ exit;
+ break;
+ case 'disable':
+ check_admin_referer('disable-theme_' . $_GET['theme']);
+ unset( $allowed_themes[ $_GET['theme'] ] );
+ update_site_option( 'allowedthemes', $allowed_themes );
+ wp_redirect( add_query_arg( 'disabled', '1', $referer ) );
+ exit;
+ break;
+ case 'enable-selected':
+ check_admin_referer('bulk-themes');
+ $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
+ if ( empty($themes) ) {
+ wp_redirect( add_query_arg( 'error', 'none', $referer ) );
+ exit;
+ }
+ foreach( (array) $themes as $theme )
+ $allowed_themes[ $theme ] = true;
+ update_site_option( 'allowedthemes', $allowed_themes );
+ wp_redirect( add_query_arg( 'enabled', count( $themes ), $referer ) );
+ exit;
+ break;
+ case 'disable-selected':
+ check_admin_referer('bulk-themes');
+ $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
+ if ( empty($themes) ) {
+ wp_redirect( add_query_arg( 'error', 'none', $referer ) );
+ exit;
+ }
+ foreach( (array) $themes as $theme )
+ unset( $allowed_themes[ $theme ] );
+ update_site_option( 'allowedthemes', $allowed_themes );
+ wp_redirect( add_query_arg( 'disabled', count( $themes ), $referer ) );
+ exit;
+ break;
+ case 'delete-selected':
+ if ( ! current_user_can( 'delete_themes' ) )
+ wp_die( __('You do not have sufficient permissions to delete themes for this site.') );
+ check_admin_referer( 'bulk-themes' );
+
+ $themes = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
+
+ if ( isset( $themes[ get_option( 'template' ) ] ) )
+ unset( $themes[ get_option( 'template' ) ] );
+ if ( isset( $themes[ get_option( 'stylesheet' ) ] ) )
+ unset( $themes[ get_option( 'stylesheet' ) ] );
+
+ if ( empty( $themes ) ) {
+ wp_redirect( add_query_arg( 'error', 'none', $referer ) );
+ exit;
+ }
+
+ $main_theme = get_current_theme();
+ $files_to_delete = $theme_info = array();
+ foreach ( $themes as $key => $theme ) {
+ $data = get_theme_data( WP_CONTENT_DIR . '/themes/' . $theme . '/style.css' );
+ if ( $data['Name'] == $main_theme ) {
+ unset( $themes[$key] );
+ } else {
+ $files_to_delete = array_merge( $files_to_delete, list_files( WP_CONTENT_DIR . "/themes/$theme" ) );
+ $theme_info[ $theme ] = $data;
+ }
+ }
+
+ if ( empty( $themes ) ) {
+ wp_redirect( add_query_arg( 'error', 'main', $referer ) );
+ exit;
+ }
+
+ include(ABSPATH . 'wp-admin/update.php');
+
+ $parent_file = 'themes.php';
+
+ if ( ! isset( $_REQUEST['verify-delete'] ) ) {
+ wp_enqueue_script( 'jquery' );
+ require_once( ABSPATH . 'wp-admin/admin-header.php' );
+ ?>
+ <div class="wrap">
+ <?php
+ $themes_to_delete = count( $themes );
+ screen_icon();
+ echo '<h2>' . _n( 'Delete Theme', 'Delete Themes', $themes_to_delete ) . '</h2>';
+ ?>
+ <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo _n( 'This theme may be active on other sites in the network.', 'These themes may be active on other sites in the network.', $themes_to_delete ); ?></p></div>
+ <p><?php echo _n( 'You are about to remove the following theme:', 'You are about to remove the following themes:', $themes_to_delete ); ?></p>
+ <ul class="ul-disc">
+ <?php foreach ( $theme_info as $theme )
+ echo '<li>', sprintf( __('<strong>%1$s</strong> by <em>%2$s</em>' ), esc_html( $theme['Name'] ), esc_html( $theme['AuthorName'] ) ), '</li>'; /* translators: 1: theme name, 2: theme author */ ?>
+ </ul>
+ <p><?php _e('Are you sure you wish to delete these themes?'); ?></p>
+ <form method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>" style="display:inline;">
+ <input type="hidden" name="verify-delete" value="1" />
+ <input type="hidden" name="action" value="delete-selected" />
+ <?php
+ foreach ( (array) $themes as $theme )
+ echo '<input type="hidden" name="checked[]" value="' . esc_attr($theme) . '" />';
+ ?>
+ <?php wp_nonce_field('bulk-themes') ?>
+ <?php submit_button( _n( 'Yes, Delete this theme', 'Yes, Delete these themes', $themes_to_delete ), 'button', 'submit', false ); ?>
+ </form>
+ <form method="post" action="<?php echo esc_url(wp_get_referer()); ?>" style="display:inline;">
+ <?php submit_button( __( 'No, Return me to the theme list' ), 'button', 'submit', false ); ?>
+ </form>
+
+ <p><a href="#" onclick="jQuery('#files-list').toggle(); return false;"><?php _e('Click to view entire list of files which will be deleted'); ?></a></p>
+ <div id="files-list" style="display:none;">
+ <ul class="code">
+ <?php
+ foreach ( (array) $files_to_delete as $file )
+ echo '<li>' . esc_html( str_replace( WP_CONTENT_DIR . "/themes", '', $file) ) . '</li>';
+ ?>
+ </ul>
+ </div>
+ </div>
+ <?php
+ require_once(ABSPATH . 'wp-admin/admin-footer.php');
+ exit;
+ } // Endif verify-delete
+
+ foreach ( $themes as $theme )
+ $delete_result = delete_theme( $theme, esc_url( add_query_arg( array('verify-delete' => 1), $_SERVER['REQUEST_URI'] ) ) );
+ $paged = ( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : 1;
+ wp_redirect( network_admin_url( "themes.php?deleted=".count( $themes )."&paged=$paged&s=$s" ) );
+ exit;
+ break;
+ }
+}
+
+$wp_list_table->prepare_items();
+
+$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
+}
+
+add_thickbox();
+
+add_screen_option( 'per_page', array('label' => _x( 'Themes', 'themes per page (screen options)' )) );
+
+add_contextual_help($current_screen,
+ '<p>' . __('This screen enables and disables the inclusion of themes available to choose in the Appearance menu for each site. It does not activate or deactivate which theme a site is currently using.') . '</p>' .
+ '<p>' . __('If the network admin disables a theme that is in use, it can still remain selected on that site. If another theme is chosen, the disabled theme will not appear in the site’s Appearance > Themes screen.') . '</p>' .
+ '<p>' . __('Themes can be enabled on a site by site basis by the network admin on the Edit Site screen you go to via the Edit action link on the Sites screen. Only network admins are able to install or edit themes.') . '</p>' .
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Themes_Screen" target="_blank">Documentation on Network Themes</a>') . '</p>' .
+ '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+);
+
+$title = __('Themes');
+$parent_file = 'themes.php';
+
+require_once(ABSPATH . 'wp-admin/admin-header.php');
+
+?>
+
+<div class="wrap">
+<?php screen_icon('themes'); ?>
+<h2><?php echo esc_html( $title ); if ( current_user_can('install_themes') ) { ?> <a href="theme-install.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'theme'); ?></a><?php }
+if ( $s )
+ printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( $s ) ); ?>
+</h2>
+
+<?php
+if ( isset( $_GET['enabled'] ) ) {
+ $_GET['enabled'] = absint( $_GET['enabled'] );
+ echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme enabled.', '%s themes enabled.', $_GET['enabled'] ), number_format_i18n( $_GET['enabled'] ) ) . '</p></div>';
+} elseif ( isset( $_GET['disabled'] ) ) {
+ $_GET['disabled'] = absint( $_GET['disabled'] );
+ echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme disabled.', '%s themes disabled.', $_GET['disabled'] ), number_format_i18n( $_GET['disabled'] ) ) . '</p></div>';
+} elseif ( isset( $_GET['deleted'] ) ) {
+ $_GET['deleted'] = absint( $_GET['deleted'] );
+ echo '<div id="message" class="updated"><p>' . sprintf( _nx( 'Theme deleted.', '%s themes deleted.', $_GET['deleted'], 'network' ), number_format_i18n( $_GET['deleted'] ) ) . '</p></div>';
+} elseif ( isset( $_GET['error'] ) && 'none' == $_GET['error'] ) {
+ echo '<div id="message" class="error"><p>' . __( 'No theme selected.' ) . '</p></div>';
+} elseif ( isset( $_GET['error'] ) && 'main' == $_GET['error'] ) {
+ echo '<div class="error"><p>' . __( 'You cannot delete a theme while it is active on the main site.' ) . '</p></div>';
+}
+
+?>
+
+<form method="get" action="">
+<?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?>
+</form>
+
+<?php $wp_list_table->views(); ?>
+
+<form method="post" action="">
+<input type="hidden" name="theme_status" value="<?php echo esc_attr($status) ?>" />
+<input type="hidden" name="paged" value="<?php echo esc_attr($page) ?>" />
+
+<?php $wp_list_table->display(); ?>
+</form>
+
+</div>
+
+<?php
+include(ABSPATH . 'wp-admin/admin-footer.php');
--- /dev/null
+<?php
+/**
+ * Updates network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+require( '../update-core.php' );
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Update/Install Plugin/Theme network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+if ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'update-selected', 'activate-plugin', 'update-selected-themes' ) ) )
+ define( 'IFRAME_REQUEST', true );
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+require( '../update.php' );
--- /dev/null
+<?php
+/**
+ * Multisite upgrade administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+require_once( ABSPATH . WPINC . '/http.php' );
+
+$title = __( 'Update Network' );
+$parent_file = 'upgrade.php';
+
+add_contextual_help($current_screen,
+ '<p>' . __('Only use this screen once you have updated to a new version of WordPress through Dashboard > Updates. Clicking the Update Network button will step through each site in the network, five at a time, and make sure any database updates are applied.') . '</p>' .
+ '<p>' . __('If a version update to core has not happened, clicking this button won’t affect anything.') . '</p>' .
+ '<p>' . __('If this process fails for any reason, users logging in to their sites will force the same update.') . '</p>' .
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Updates_Screen" target="_blank">Documentation on Update Network</a>') . '</p>' .
+ '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+);
+
+require_once('../admin-header.php');
+
+if ( ! current_user_can( 'manage_network' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+echo '<div class="wrap">';
+screen_icon('tools');
+echo '<h2>' . __( 'Update Network' ) . '</h2>';
+
+$action = isset($_GET['action']) ? $_GET['action'] : 'show';
+
+switch ( $action ) {
+ case "upgrade":
+ $n = ( isset($_GET['n']) ) ? intval($_GET['n']) : 0;
+
+ if ( $n < 5 ) {
+ global $wp_db_version;
+ update_site_option( 'wpmu_upgrade_site', $wp_db_version );
+ }
+
+ $blogs = $wpdb->get_results( "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' AND spam = '0' AND deleted = '0' AND archived = '0' ORDER BY registered DESC LIMIT {$n}, 5", ARRAY_A );
+ if ( empty( $blogs ) ) {
+ echo '<p>' . __( 'All done!' ) . '</p>';
+ break;
+ }
+ echo "<ul>";
+ foreach ( (array) $blogs as $details ) {
+ $siteurl = get_blog_option( $details['blog_id'], 'siteurl' );
+ echo "<li>$siteurl</li>";
+ $response = wp_remote_get( trailingslashit( $siteurl ) . "wp-admin/upgrade.php?step=upgrade_db", array( 'timeout' => 120, 'httpversion' => '1.1' ) );
+ if ( is_wp_error( $response ) )
+ wp_die( sprintf( __( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: <em>%2$s</em>' ), $siteurl, $response->get_error_message() ) );
+ do_action( 'after_mu_upgrade', $response );
+ do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] );
+ }
+ echo "</ul>";
+ ?><p><?php _e( 'If your browser doesn’t start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&n=<?php echo ($n + 5) ?>"><?php _e("Next Sites"); ?></a></p>
+ <script type='text/javascript'>
+ <!--
+ function nextpage() {
+ location.href = "upgrade.php?action=upgrade&n=<?php echo ($n + 5) ?>";
+ }
+ setTimeout( "nextpage()", 250 );
+ //-->
+ </script><?php
+ break;
+ case 'show':
+ default:
+ ?><p><?php _e( 'You can update all the sites on your network through this page. It works by calling the update script of each site automatically. Hit the link below to update.' ); ?></p>
+ <p><a class="button" href="upgrade.php?action=upgrade"><?php _e("Update Network"); ?></a></p><?php
+ do_action( 'wpmu_upgrade_page' );
+ break;
+}
+?>
+</div>
+
+<?php include('../admin-footer.php'); ?>
--- /dev/null
+<?php
+/**
+ * Edit user network administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+require( '../user-edit.php' );
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Add Site Administration Screen
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.1.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! current_user_can('create_users') )
+ wp_die(__('You do not have sufficient permissions to add users to this network.'));
+
+
+add_contextual_help($current_screen,
+ '<p>' . __('Add User will set up a new user account on the network and send them an email with their username and password.') . '</p>' .
+ '<p>' . __('Users who are signed up to the network without a site are added as subscribers to the main or primary dashboard site, giving them profile pages to manage their accounts. These users will only see Dashboard and My Sites in the main navigation until a site is created for them.') . '</p>' .
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Users_Screen" target="_blank">Documentation on Network Users</a>') . '</p>' .
+ '<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
+);
+
+if ( isset($_REQUEST['action']) && 'add-user' == $_REQUEST['action'] ) {
+ check_admin_referer( 'add-user', '_wpnonce_add-user' );
+ if ( ! current_user_can( 'manage_network_users' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+ if ( is_array( $_POST['user'] ) == false )
+ wp_die( __( 'Cannot create an empty user.' ) );
+ $user = $_POST['user'];
+ if ( empty($user['username']) && empty($user['email']) )
+ wp_die( __( 'Missing username and email.' ) );
+ elseif ( empty($user['username']) )
+ wp_die( __( 'Missing username.' ) );
+ elseif ( empty($user['email']) )
+ wp_die( __( 'Missing email.' ) );
+
+ $password = wp_generate_password( 12, false);
+ $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
+
+ if ( false == $user_id )
+ wp_die( __( 'Duplicated username or email address.' ) );
+ else
+ wp_new_user_notification( $user_id, $password );
+
+ wp_redirect( add_query_arg( array('update' => 'added'), 'user-new.php' ) );
+ exit;
+}
+
+if ( isset($_GET['update']) ) {
+ $messages = array();
+ if ( 'added' == $_GET['update'] )
+ $messages[] = __('User added.');
+}
+
+$title = __('Add New User');
+$parent_file = 'users.php';
+
+require('../admin-header.php'); ?>
+
+<div class="wrap">
+<?php screen_icon(); ?>
+<h2 id="add-new-user"><?php _e('Add New User') ?></h2>
+<?php
+if ( ! empty( $messages ) ) {
+ foreach ( $messages as $msg )
+ echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
+} ?>
+ <form action="<?php echo network_admin_url('user-new.php?action=add-user'); ?>" id="adduser" method="post">
+ <table class="form-table">
+ <tr class="form-field form-required">
+ <th scope="row"><?php _e( 'Username' ) ?></th>
+ <td><input type="text" class="regular-text" name="user[username]" /></td>
+ </tr>
+ <tr class="form-field form-required">
+ <th scope="row"><?php _e( 'Email' ) ?></th>
+ <td><input type="text" class="regular-text" name="user[email]" /></td>
+ </tr>
+ <tr class="form-field">
+ <td colspan="2"><?php _e( 'Username and password will be mailed to the above email address.' ) ?></td>
+ </tr>
+ </table>
+ <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
+ <?php submit_button( __('Add User'), 'primary', 'add-user' ); ?>
+ </form>
+</div>
+<?php
+require('../admin-footer.php');
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Multisite users administration panel.
+ *
+ * @package WordPress
+ * @subpackage Multisite
+ * @since 3.0.0
+ */
+
+/** Load WordPress Administration Bootstrap */
+require_once( './admin.php' );
+
+if ( ! is_multisite() )
+ wp_die( __( 'Multisite support is not enabled.' ) );
+
+if ( ! current_user_can( 'manage_network_users' ) )
+ wp_die( __( 'You do not have permission to access this page.' ) );
+
+$wp_list_table = _get_list_table('WP_MS_Users_List_Table');
+$pagenum = $wp_list_table->get_pagenum();
+$wp_list_table->prepare_items();
+$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+
+if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
+}
+$title = __( 'Users' );
+$parent_file = 'users.php';
+
+add_screen_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) );
+
+add_contextual_help($current_screen,
+ '<p>' . __('This table shows all users across the network and the sites to which they are assigned.') . '</p>' .
+ '<p>' . __('Hover over any user on the list to make the edit links appear. The Edit link on the left will take you to his or her Edit User profile page; the Edit link on the right by any site name goes to an Edit Site screen for that site.') . '</p>' .
+ '<p>' . __('You can also go to the user’s profile page by clicking on the individual username.') . '</p>' .
+ '<p>' . __('You can sort the table by clicking on any of the bold headings and switch between list and excerpt views by using the icons in the upper right.') . '</p>' .
+ '<p>' . __('The bulk action will permanently delete selected users, or mark/unmark those selected as spam. Spam users will have posts removed and will be unable to sign up again with the same email addresses.') . '</p>' .
+ '<p>' . __('You can make an existing user an additional super admin by going to the Edit User profile page and checking the box to grant that privilege.') . '</p>' .
+ '<p><strong>' . __('For more information:') . '</strong></p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Users_Screen" target="_blank">Documentation on Network Users</a>') . '</p>' .
+ '<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
+);
+
+require_once( '../admin-header.php' );
+
+if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty( $_REQUEST['action'] ) ) {
+ ?>
+ <div id="message" class="updated"><p>
+ <?php
+ switch ( $_REQUEST['action'] ) {
+ case 'delete':
+ _e( 'User deleted.' );
+ break;
+ case 'all_spam':
+ _e( 'Users marked as spam.' );
+ break;
+ case 'all_notspam':
+ _e( 'Users removed from spam.' );
+ break;
+ case 'all_delete':
+ _e( 'Users deleted.' );
+ break;
+ case 'add':
+ _e( 'User added.' );
+ break;
+ }
+ ?>
+ </p></div>
+ <?php
+}
+ ?>
+<div class="wrap">
+ <?php screen_icon(); ?>
+ <h2><?php esc_html_e( 'Users' );
+ if ( current_user_can( 'create_users') ) : ?>
+ <a href="<?php echo network_admin_url('user-new.php'); ?>" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a><?php
+ endif;
+
+ if ( !empty( $usersearch ) )
+ printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', esc_html( $usersearch ) );
+ ?>
+ </h2>
+
+ <?php $wp_list_table->views(); ?>
+
+ <form action="" method="get" class="search-form">
+ <?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
+ </form>
+
+ <form id="form-user-list" action='edit.php?action=allusers' method='post'>
+ <?php $wp_list_table->display(); ?>
+ </form>
+</div>
+
+<?php require_once( '../admin-footer.php' ); ?>
'<p>' . __('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.') . '</p>' .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Settings_Discussion_SubPanel" target="_blank">Discussion Settings Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Settings_Discussion_SubPanel" target="_blank">Documentation on Discussion Settings</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
<label for="comment_registration">
<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_option('comment_registration')); ?> />
<?php _e('Users must be registered and logged in to comment') ?>
-<?php if ( !get_option( 'users_can_register' ) && is_multisite() ) _e( ' (Signup has been disabled. Only members of this site can comment.)' ); ?>
+<?php if ( !get_option( 'users_can_register' ) && is_multisite() ) echo ' ' . __( '(Signup has been disabled. Only members of this site can comment.)' ); ?>
</label>
<br />
<p><label for="moderation_keys"><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP per line. It will match inside words, so “press” will match “WordPress”.') ?></label></p>
<p>
-<textarea name="moderation_keys" rows="10" cols="50" id="moderation_keys" class="large-text code"><?php form_option('moderation_keys'); ?></textarea>
+<textarea name="moderation_keys" rows="10" cols="50" id="moderation_keys" class="large-text code"><?php echo esc_textarea( get_option( 'moderation_keys' ) ); ?></textarea>
</p>
</fieldset></td>
</tr>
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Comment Blacklist') ?></span></legend>
<p><label for="blacklist_keys"><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be marked as spam. One word or IP per line. It will match inside words, so “press” will match “WordPress”.') ?></label></p>
<p>
-<textarea name="blacklist_keys" rows="10" cols="50" id="blacklist_keys" class="large-text code"><?php form_option('blacklist_keys'); ?></textarea>
+<textarea name="blacklist_keys" rows="10" cols="50" id="blacklist_keys" class="large-text code"><?php echo esc_textarea( get_option( 'blacklist_keys' ) ); ?></textarea>
</p>
</fieldset></td>
</tr>
'gravatar_default' => __('Gravatar Logo'),
'identicon' => __('Identicon (Generated)'),
'wavatar' => __('Wavatar (Generated)'),
- 'monsterid' => __('MonsterID (Generated)')
+ 'monsterid' => __('MonsterID (Generated)'),
+ 'retro' => __('Retro (Generated)')
);
$avatar_defaults = apply_filters('avatar_defaults', $avatar_defaults);
$default = get_option('avatar_default');
<?php do_settings_sections('discussion'); ?>
-<p class="submit">
-<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" />
-</p>
+<?php submit_button(); ?>
</form>
</div>
* Display JavaScript on the page.
*
* @package WordPress
- * @subpackage General_Settings_Panel
+ * @subpackage General_Settings_Screen
*/
function add_js() {
?>
jQuery(document).ready(function($){
$("input[name='date_format']").click(function(){
if ( "date_format_custom_radio" != $(this).attr("id") )
- $("input[name='date_format_custom']").val( $(this).val() );
+ $("input[name='date_format_custom']").val( $(this).val() ).siblings('.example').text( $(this).siblings('span').text() );
});
$("input[name='date_format_custom']").focus(function(){
$("#date_format_custom_radio").attr("checked", "checked");
$("input[name='time_format']").click(function(){
if ( "time_format_custom_radio" != $(this).attr("id") )
- $("input[name='time_format_custom']").val( $(this).val() );
+ $("input[name='time_format_custom']").val( $(this).val() ).siblings('.example').text( $(this).siblings('span').text() );
});
$("input[name='time_format_custom']").focus(function(){
$("#time_format_custom_radio").attr("checked", "checked");
});
+ $("input[name='date_format_custom'], input[name='time_format_custom']").change( function() {
+ var format = $(this);
+ format.siblings('img').css('visibility','visible');
+ $.post(ajaxurl, {
+ action: 'date_format_custom' == format.attr('name') ? 'date_format' : 'time_format',
+ date : format.val()
+ }, function(d) { format.siblings('img').css('visibility','hidden'); format.siblings('.example').text(d); } );
+ });
});
//]]>
</script>
<?php
}
-add_filter('admin_head', 'add_js');
+add_action('admin_head', 'add_js');
add_contextual_help($current_screen,
'<p>' . __('The fields on this screen determine some of the basics of your site setup.') . '</p>' .
<tr valign="top">
<th scope="row"><label for="new_admin_email"><?php _e('E-mail address') ?> </label></th>
<td><input name="new_admin_email" type="text" id="new_admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text code" />
-<span class="setting-description"><?php _e('This address is used for admin purposes. If you change this we will send you an e-mail at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>') ?></span>
+<span class="description"><?php _e('This address is used for admin purposes. If you change this we will send you an e-mail at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>') ?></span>
<?php
$new_admin_email = get_option( 'new_admin_email' );
if ( $new_admin_email && $new_admin_email != get_option('admin_email') ) : ?>
echo " checked='checked'";
$custom = false;
}
- echo ' /> ' . date_i18n( $format ) . "</label><br />\n";
+ echo ' /> <span>' . date_i18n( $format ) . "</span></label><br />\n";
}
echo ' <label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
checked( $custom );
- echo '/> ' . __('Custom:') . ' </label><input type="text" name="date_format_custom" value="' . esc_attr( get_option('date_format') ) . '" class="small-text" /> ' . date_i18n( get_option('date_format') ) . "\n";
+ echo '/> ' . __('Custom:') . ' </label><input type="text" name="date_format_custom" value="' . esc_attr( get_option('date_format') ) . '" class="small-text" /> <span class="example"> ' . date_i18n( get_option('date_format') ) . "</span> <img class='ajax-loading' src='" . esc_url( admin_url( 'images/wpspin_light.gif' ) ) . "' />\n";
- echo "\t<p>" . __('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date formatting</a>. Click “Save Changes” to update sample output.') . "</p>\n";
+ echo "\t<p>" . __('<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Documentation on date and time formatting</a>.') . "</p>\n";
?>
</fieldset>
</td>
echo " checked='checked'";
$custom = false;
}
- echo ' /> ' . date_i18n( $format ) . "</label><br />\n";
+ echo ' /> <span>' . date_i18n( $format ) . "</span></label><br />\n";
}
echo ' <label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"';
checked( $custom );
- echo '/> ' . __('Custom:') . ' </label><input type="text" name="time_format_custom" value="' . esc_attr( get_option('time_format') ) . '" class="small-text" /> ' . date_i18n( get_option('time_format') ) . "\n";
+ echo '/> ' . __('Custom:') . ' </label><input type="text" name="time_format_custom" value="' . esc_attr( get_option('time_format') ) . '" class="small-text" /> <span class="example"> ' . date_i18n( get_option('time_format') ) . "</span> <img class='ajax-loading' src='" . esc_url( admin_url( 'images/wpspin_light.gif' ) ) . "' />\n";
+ ;
?>
</fieldset>
</td>
<?php do_settings_sections('general'); ?>
-<p class="submit">
-<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" />
-</p>
+<?php submit_button(); ?>
</form>
</div>
wp_reset_vars(array('action', 'standalone', 'option_group_id'));
+if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {
+ // For backwards compat with plugins that don't use the Settings API and just set updated=1 in the redirect
+ add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated');
+}
+
settings_errors();
?>
\ No newline at end of file
add_contextual_help($current_screen,
'<p>' . __('You can set maximum sizes for images inserted into your written content; you can also insert an image as Full Size.') . '</p>' .
'<p>' . __('The Embed option allows you embed a video, image, or other media content into your content automatically by typing the URL (of the web page where the file lives) on its own line when you create your content.') . '</p>' .
- '<p>' . __('Uploading Options gives you folder and path choices for storing your files in your installation’s directory.') . '</p>' .
+ ( is_multisite() ? '' : '<p>' . __('Uploading Options gives you folder and path choices for storing your files in your installation’s directory.') . '</p>' ) .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Settings_Media_SubPanel" target="_blank">Documentation on Media Settings</a>') . '</p>' .
<tr valign="top">
<th scope="row"><?php _e('Auto-embeds'); ?></th>
-<td><fieldset><legend class="screen-reader-text"><span><?php _e('Attempt to automatically embed all plain text URLs'); ?></span></legend>
-<label for="embed_autourls"><input name="embed_autourls" type="checkbox" id="embed_autourls" value="1" <?php checked( '1', get_option('embed_autourls') ); ?>/> <?php _e('Attempt to automatically embed all plain text URLs'); ?></label>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e('When possible, embed the media content from a URL directly onto the page. For example: links to Flickr and YouTube.'); ?></span></legend>
+<label for="embed_autourls"><input name="embed_autourls" type="checkbox" id="embed_autourls" value="1" <?php checked( '1', get_option('embed_autourls') ); ?>/> <?php _e('When possible, embed the media content from a URL directly onto the page. For example: links to Flickr and YouTube.'); ?></label>
</fieldset></td>
</tr>
<?php do_settings_sections('media'); ?>
-<p class="submit">
- <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" />
-</p>
+<?php submit_button(); ?>
</form>
'<p>' . __('The Optional fields let you customize the “category” and “tag” base names that will appear in archive URLs. For example, the page listing all posts in the “Uncategorized” category could be <code>/topics/uncategorized</code> instead of <code>/category/uncategorized</code>.') . '</p>' .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Settings_Permalinks_SubPanel" target="_blank">Permalinks Settings Documentation</a>') . '</p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Using_Permalinks" target="_blank">Using Permalinks Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Settings_Permalinks_SubPanel" target="_blank">Documentation on Permalinks Settings</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Using_Permalinks" target="_blank">Documentation on Using Permalinks</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
* @subpackage Permalink_Settings_Panel
*/
function add_js() {
-?>
+ ?>
<script type="text/javascript">
//<![CDATA[
-function GetElementsWithClassName(elementName, className) {
-var allElements = document.getElementsByTagName(elementName);
-var elemColl = new Array();
-for (i = 0; i < allElements.length; i++) {
-if (allElements[i].className == className) {
-elemColl[elemColl.length] = allElements[i];
-}
-}
-return elemColl;
-}
-
-function upit() {
-var inputColl = GetElementsWithClassName('input', 'tog');
-var structure = document.getElementById('permalink_structure');
-var inputs = '';
-for (i = 0; i < inputColl.length; i++) {
-if ( inputColl[i].checked && inputColl[i].value != '') {
-inputs += inputColl[i].value + ' ';
-}
-}
-inputs = inputs.substr(0,inputs.length - 1);
-if ( 'custom' != inputs )
-structure.value = inputs;
-}
-
-function blurry() {
-if (!document.getElementById) return;
-
-var structure = document.getElementById('permalink_structure');
-structure.onfocus = function () { document.getElementById('custom_selection').checked = 'checked'; }
-
-var aInputs = document.getElementsByTagName('input');
-
-for (var i = 0; i < aInputs.length; i++) {
-aInputs[i].onclick = aInputs[i].onkeyup = upit;
-}
-}
-
-window.onload = blurry;
+jQuery(document).ready(function() {
+ jQuery('input:radio.tog').change(function() {
+ if ( 'custom' == this.value )
+ return;
+ jQuery('#permalink_structure').val( this.value );
+ });
+ jQuery('#permalink_structure').focus(function() {
+ jQuery("#custom_selection").attr('checked', 'checked');
+ });
+});
//]]>
</script>
<?php
$tag_base = $blog_prefix . preg_replace('#/+#', '/', '/' . str_replace( '#', '', $tag_base ) );
$wp_rewrite->set_tag_base( $tag_base );
}
+
+ create_initial_taxonomies();
}
$permalink_structure = get_option('permalink_structure');
<?php do_settings_sections('permalink'); ?>
-<p class="submit">
- <input type="submit" name="submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" />
-</p>
+<?php submit_button(); ?>
</form>
<?php if ( !is_multisite() ) { ?>
<?php if ( $iis7_permalinks ) :
<p><?php _e('If your <code>web.config</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so this is the url rewrite rule you should have in your <code>web.config</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this rule inside of the <code>/<configuration>/<system.webServer>/<rewrite>/<rules></code> element in <code>web.config</code> file.') ?></p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field('update-permalink') ?>
- <p><textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_html($wp_rewrite->iis7_url_rewrite_rules()); ?></textarea></p>
+ <p><textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea></p>
</form>
<p><?php _e('If you temporarily make your <code>web.config</code> file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.') ?></p>
<?php else : ?>
<p><?php _e('If the root directory of your site were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so this is the url rewrite rule you should have in your <code>web.config</code> file. Create a new file, called <code>web.config</code> in the root directory of your site. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this code into the <code>web.config</code> file.') ?></p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field('update-permalink') ?>
- <p><textarea rows="18" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_html($wp_rewrite->iis7_url_rewrite_rules(true)); ?></textarea></p>
+ <p><textarea rows="18" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules(true) ); ?></textarea></p>
</form>
<p><?php _e('If you temporarily make your site’s root directory writable for us to generate the <code>web.config</code> file automatically, do not forget to revert the permissions after the file has been created.') ?></p>
<?php endif; ?>
<p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field('update-permalink') ?>
- <p><textarea rows="6" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_html($wp_rewrite->mod_rewrite_rules()); ?></textarea></p>
+ <p><textarea rows="6" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->mod_rewrite_rules() ); ?></textarea></p>
</form>
<?php endif; ?>
<?php endif; ?>
'<p>' . __('When this setting is in effect a reminder is shown in the header of these administration screens that says, “Search Engines Blocked,” to remind you that your site is not being crawled.') . '</p>' .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Settings_Privacy_SubPanel" target="_blank">Privacy Settings Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Settings_Privacy_SubPanel" target="_blank">Documentation on Privacy Settings</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
<?php do_settings_sections('privacy'); ?>
-<p class="submit">
- <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" />
-</p>
+<?php submit_button(); ?>
</form>
</div>
$title = __( 'Reading Settings' );
$parent_file = 'options-general.php';
+/**
+ * Display JavaScript on the page.
+ *
+ * @package WordPress
+ * @subpackage Reading_Settings_Screen
+ */
+function add_js() {
+?>
+<script type="text/javascript">
+//<![CDATA[
+ jQuery(document).ready(function($){
+ var section = $('#front-static-pages'),
+ staticPage = section.find('input:radio[value="page"]'),
+ selects = section.find('select'),
+ check_disabled = function(){
+ selects.attr('disabled', staticPage.is(':checked') ? '' : 'disabled');
+ };
+ check_disabled();
+ section.find('input:radio').change(check_disabled);
+ });
+//]]>
+</script>
+<?php
+}
+add_action('admin_head', 'add_js');
+
add_contextual_help($current_screen,
'<p>' . __('This screen contains the settings that affect the display of your content.') . '</p>' .
'<p>' . sprintf(__('You can choose what’s displayed on the front page of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static home page, you first need to create two <a href="%s">Pages</a>. One will become the front page, and the other will be where your posts are displayed.'), 'post-new.php?post_type=page') . '</p>' .
'<p>' . __('You can also control the display of your content in RSS feeds, including the maximum numbers of posts to display, whether to show full text or a summary, and the character set encoding.') . '</p>' .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Settings_Reading_SubPanel" target="_blank">Reading Settings Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Settings_Reading_SubPanel" target="_blank">Documentation on Reading Settings</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
<?php if ( ! get_pages() ) : ?>
<input name="show_on_front" type="hidden" value="posts" />
<table class="form-table">
-<?php else :
+<?php
+ if ( 'posts' != get_option( 'show_on_front' ) ) :
+ update_option( 'show_on_front', 'posts' );
+ endif;
+
+else :
if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) )
update_option( 'show_on_front', 'posts' );
?>
<?php do_settings_sections( 'reading' ); ?>
-<p class="submit">
- <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes' ); ?>" />
-</p>
+<?php submit_button(); ?>
</form>
</div>
<?php include( './admin-footer.php' ); ?>
'<p>' . __('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.') . '</p>' .
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Settings_Writing_SubPanel" target="_blank">Writing Settings Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Settings_Writing_SubPanel" target="_blank">Documentation on Writing Settings</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
?>
</td>
</tr>
+<?php
+if ( current_theme_supports( 'post-formats' ) ) :
+ $post_formats = get_theme_support( 'post-formats' );
+ if ( is_array( $post_formats[0] ) ) :
+?>
+<tr valign="top">
+<th scope="row"><label for="default_post_format"><?php _e('Default Post Format') ?></label></th>
+<td>
+ <select name="default_post_format" id="default_post_format">
+ <option value="0"><?php _e('Standard'); ?></option>
+<?php foreach ( $post_formats[0] as $format ): ?>
+ <option<?php selected( get_option('default_post_format'), $format ); ?> value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>
+<?php endforeach; ?>
+ </select></label>
+</td>
+</tr>
+<?php endif; endif; ?>
<tr valign="top">
<th scope="row"><label for="default_link_category"><?php _e('Default Link Category') ?></label></th>
<td>
<p><label for="ping_sites"><?php _e('When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see <a href="http://codex.wordpress.org/Update_Services">Update Services</a> on the Codex. Separate multiple service <abbr title="Universal Resource Locator">URL</abbr>s with line breaks.') ?></label></p>
-<textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php form_option('ping_sites'); ?></textarea>
+<textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option('ping_sites') ); ?></textarea>
<?php else : ?>
<?php do_settings_sections('writing'); ?>
-<p class="submit">
- <input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e('Save Changes') ?>" />
-</p>
+<?php submit_button(); ?>
</form>
</div>
'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', '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', 'default_post_format', 'enable_app', 'enable_xmlrpc' ),
'options' => array( '' ) );
$mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass');
/**
* Redirect back to the settings page that was submitted
*/
- $goback = add_query_arg( 'updated', 'true', wp_get_referer() );
+ $goback = add_query_arg( 'settings-updated', 'true', wp_get_referer() );
wp_redirect( $goback );
exit;
}
<th scope='row'><label for='$name'>" . esc_html( $option->option_name ) . "</label></th>
<td>";
if ( strpos( $value, "\n" ) !== false )
- echo "<textarea class='$class' name='$name' id='$name' cols='30' rows='5'>" . wp_htmledit_pre( $value ) . "</textarea>";
+ echo "<textarea class='$class' name='$name' id='$name' cols='30' rows='5'>" . esc_textarea( $value ) . "</textarea>";
else
echo "<input class='regular-text $class' type='text' name='$name' id='$name' value='" . esc_attr( $value ) . "'" . disabled( $disabled, true, false ) . " />";
echo "</td>
endforeach;
?>
</table>
-<p class="submit"><input type="hidden" name="page_options" value="<?php echo esc_attr( implode( ',', $options_to_update ) ); ?>" /><input type="submit" name="Update" value="<?php esc_attr_e( 'Save Changes' ); ?>" class="button-primary" /></p>
+
+<input type="hidden" name="page_options" value="<?php echo esc_attr( implode( ',', $options_to_update ) ); ?>" />
+
+<?php submit_button( __( 'Save Changes' ), 'primary', 'Update' ); ?>
+
</form>
</div>
/** WordPress Administration Bootstrap */
require_once('./admin.php');
+if ( is_multisite() && ! is_network_admin() ) {
+ wp_redirect( network_admin_url( 'plugin-editor.php' ) );
+ exit();
+}
+
if ( !current_user_can('edit_plugins') )
wp_die( __('You do not have sufficient permissions to edit plugins for this site.') );
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");
+ wp_redirect( self_admin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") );
} else {
- wp_redirect("plugin-editor.php?file=$file&scrollto=$scrollto");
+ wp_redirect( self_admin_url("plugin-editor.php?file=$file&scrollto=$scrollto") );
}
exit;
if ( is_wp_error($error) )
wp_die( $error );
- if ( ! is_plugin_active($file) )
+ if ( ( ! empty( $_GET['networkwide'] ) && ! is_plugin_active_for_network($file) ) || ! is_plugin_active($file) )
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");
+ wp_redirect( self_admin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") );
exit;
}
'<p>' . __('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.') . '</p>' .
'<p>' . __('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.') . '</p>' .
'<p>' . __('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.') . '</p>' .
- '<p>' . __('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.') . '</p>' .
+ '<p>' . __('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 plugins, write your own from scratch, or just better understand their anatomy, check out the links below.') . '</p>' .
+ ( is_network_admin() ? '<p>' . __('Any edits to files from this screen will be reflected on all sites in the network.') . '</p>' : '' ) .
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Plugins_Editor_SubPanel" target="_blank">Documentation on Editing Plugins</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Writing_a_Plugin" target="_blank">Documentation on Writing Plugins</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
- require_once('./admin-header.php');
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
update_recently_edited(WP_PLUGIN_DIR . '/' . $file);
}
}
- $content = htmlspecialchars( $content );
+ $content = esc_textarea( $content );
?>
<?php if (isset($_GET['a'])) : ?>
<div id="message" class="updated"><p><?php _e('File edited successfully.') ?></p></div>
}
?>
</select>
- <input type="submit" name="Submit" value="<?php esc_attr_e('Select') ?>" class="button" />
+ <?php submit_button( __( 'Select' ), 'button', 'Submit', false ); ?>
</form>
</div>
<br class="clear" />
<?php } ?>
<p class="submit">
<?php
- if ( isset($_GET['phperror']) )
- echo "<input type='hidden' name='phperror' value='1' /><input type='submit' name='submit' class='button-primary' value='" . esc_attr__('Update File and Attempt to Reactivate') . "' tabindex='2' />";
- else
- echo "<input type='submit' name='submit' class='button-primary' value='" . esc_attr__('Update File') . "' tabindex='2' />";
+ if ( isset($_GET['phperror']) ) {
+ echo "<input type='hidden' name='phperror' value='1' />";
+ submit_button( __( 'Update File and Attempt to Reactivate' ), 'primary', 'submit', false, array( 'tabindex' => '2' ) );
+ } else {
+ submit_button( __( 'Update File' ), 'primary', 'submit', false, array( 'tabindex' => '2' ) );
+ }
?>
</p>
<?php else : ?>
<?php
break;
}
-include("./admin-footer.php");
+include(ABSPATH . "wp-admin/admin-footer.php");
* @package WordPress
* @subpackage Administration
*/
+// TODO route this pages via a specific iframe handler instead of the do_action below
+if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) )
+ define( 'IFRAME_REQUEST', true );
/** WordPress Administration Bootstrap */
require_once('./admin.php');
if ( ! current_user_can('install_plugins') )
wp_die(__('You do not have sufficient permissions to install plugins on this site.'));
-include(ABSPATH . 'wp-admin/includes/plugin-install.php');
+if ( is_multisite() && ! is_network_admin() ) {
+ wp_redirect( network_admin_url( 'plugin-install.php' ) );
+ exit();
+}
+
+$wp_list_table = _get_list_table('WP_Plugin_Install_List_Table');
+$pagenum = $wp_list_table->get_pagenum();
+$wp_list_table->prepare_items();
+$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
+}
$title = __('Install Plugins');
$parent_file = 'plugins.php';
-wp_reset_vars( array('tab', 'paged') );
-
-//These are the tabs which are shown on the page,
-$tabs = array();
-$tabs['dashboard'] = __('Search');
-if ( 'search' == $tab )
- $tabs['search'] = __('Search Results');
-$tabs['upload'] = __('Upload');
-$tabs['featured'] = _x('Featured','Plugin Installer');
-$tabs['popular'] = _x('Popular','Plugin Installer');
-$tabs['new'] = _x('Newest','Plugin Installer');
-$tabs['updated'] = _x('Recently Updated','Plugin Installer');
-
-$nonmenu_tabs = array('plugin-information'); //Valid actions to perform which do not have a Menu item.
-
-$tabs = apply_filters('install_plugins_tabs', $tabs );
-$nonmenu_tabs = apply_filters('install_plugins_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) ) ) {
- $tab_actions = array_keys($tabs);
- $tab = $tab_actions[0];
-}
-if ( empty($paged) )
- $paged = 1;
-
wp_enqueue_style( 'plugin-install' );
wp_enqueue_script( 'plugin-install' );
if ( 'plugin-information' != $tab )
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
-include('./admin-header.php');
+include(ABSPATH . 'wp-admin/admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
- <ul class="subsubsub">
-<?php
-$display_tabs = array();
-foreach ( (array)$tabs as $action => $text ) {
- $sep = ( end($tabs) != $text ) ? ' | ' : '';
- $class = ( $action == $tab ) ? ' class="current"' : '';
- $href = admin_url('plugin-install.php?tab=' . $action);
- echo "\t\t<li><a href='$href'$class>$text</a>$sep</li>\n";
-}
-?>
- </ul>
- <br class="clear" />
- <?php do_action('install_plugins_' . $tab, $paged); ?>
+<?php $wp_list_table->views(); ?>
+
+<br class="clear" />
+<?php do_action('install_plugins_' . $tab, $paged); ?>
</div>
<?php
-include('./admin-footer.php');
+include(ABSPATH . 'wp-admin/admin-footer.php');
+
/** WordPress Administration Bootstrap */
require_once('./admin.php');
+
if ( is_multisite() ) {
$menu_perms = get_site_option( 'menu_items', array() );
- if ( empty($menu_perms['plugins']) && ! is_super_admin() )
+ if ( empty( $menu_perms['plugins'] ) && ! is_super_admin() )
wp_die( __( 'Cheatin’ uh?' ) );
- else if ( $menu_perms['plugins'] != 1 && is_super_admin() )
- add_action( 'admin_notices', '_admin_notice_multisite_activate_plugins_page' );
}
-if ( ! current_user_can( 'activate_plugins' ) )
+if ( !current_user_can('activate_plugins') )
wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) );
-if ( isset($_POST['clear-recent-list']) )
- $action = 'clear-recent-list';
-elseif ( !empty($_REQUEST['action']) )
- $action = $_REQUEST['action'];
-elseif ( !empty($_REQUEST['action2']) )
- $action = $_REQUEST['action2'];
-else
- $action = false;
-
-$plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : '';
+$wp_list_table = _get_list_table('WP_Plugins_List_Table');
+$pagenum = $wp_list_table->get_pagenum();
-$default_status = get_user_option('plugins_last_view');
-if ( empty($default_status) )
- $default_status = 'all';
-$status = isset($_REQUEST['plugin_status']) ? $_REQUEST['plugin_status'] : $default_status;
-if ( !in_array($status, array('all', 'active', 'inactive', 'recent', 'upgrade', 'network', 'mustuse', 'dropins', 'search')) )
- $status = 'all';
-if ( $status != $default_status && 'search' != $status )
- update_user_meta($current_user->ID, 'plugins_last_view', $status);
+$action = $wp_list_table->current_action();
-$page = isset($_REQUEST['paged']) ? $_REQUEST['paged'] : 1;
+$plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : '';
+$s = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
-//Clean up request URI from temporary args for screen options/paging uri's to work as expected.
+// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
$_SERVER['REQUEST_URI'] = remove_query_arg(array('error', 'deleted', 'activate', 'activate-multi', 'deactivate', 'deactivate-multi', '_error_nonce'), $_SERVER['REQUEST_URI']);
-if ( !empty($action) ) {
+if ( $action ) {
$network_wide = false;
if ( ( isset( $_GET['networkwide'] ) || 'network-activate-selected' == $action ) && is_multisite() && current_user_can( 'manage_network_plugins' ) )
$network_wide = true;
check_admin_referer('activate-plugin_' . $plugin);
- $result = activate_plugin($plugin, 'plugins.php?error=true&plugin=' . $plugin, $network_wide);
+ $result = activate_plugin($plugin, self_admin_url('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;
+ $redirect = self_admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s");
wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect));
exit;
} else {
update_option('recently_activated', $recent);
}
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
+ wp_redirect( self_admin_url("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
+ wp_redirect( self_admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ); // overrides the ?error=true one above
}
exit;
break;
if ( ! current_user_can('activate_plugins') )
wp_die(__('You do not have sufficient permissions to activate plugins for this site.'));
- check_admin_referer('bulk-manage-plugins');
+ check_admin_referer('bulk-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.
+
+ // Only activate plugins which are not already active.
+ $check = $network_wide ? 'is_plugin_active_for_network' : 'is_plugin_active';
+ foreach ( $plugins as $i => $plugin )
+ if ( $check( $plugin ) )
+ unset( $plugins[ $i ] );
+
if ( empty($plugins) ) {
- wp_redirect("plugins.php?plugin_status=$status&paged=$page");
+ wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
exit;
}
- activate_plugins($plugins, 'plugins.php?error=true', $network_wide);
+ activate_plugins($plugins, self_admin_url('plugins.php?error=true'), $network_wide);
$recent = (array)get_option('recently_activated');
foreach ( $plugins as $plugin => $time)
update_option('recently_activated', $recent);
- wp_redirect("plugins.php?activate-multi=true&plugin_status=$status&paged=$page");
+ wp_redirect( self_admin_url("plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s") );
exit;
break;
case 'update-selected' :
- check_admin_referer( 'bulk-manage-plugins' );
+ check_admin_referer( 'bulk-plugins' );
if ( isset( $_GET['plugins'] ) )
$plugins = explode( ',', $_GET['plugins'] );
else
$plugins = array();
- $title = __( 'Upgrade Plugins' );
+ $title = __( 'Update Plugins' );
$parent_file = 'plugins.php';
- require_once( './admin-header.php' );
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
echo '<div class="wrap">';
screen_icon();
echo '<h2>' . esc_html( $title ) . '</h2>';
- $url = 'update.php?action=update-selected&plugins=' . urlencode( join(',', $plugins) );
+ $url = self_admin_url('update.php?action=update-selected&plugins=' . urlencode( join(',', $plugins) ));
$url = wp_nonce_url($url, 'bulk-update-plugins');
echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
echo '</div>';
- require_once( './admin-footer.php' );
+ require_once(ABSPATH . 'wp-admin/admin-footer.php');
exit;
break;
case 'error_scrape':
check_admin_referer('deactivate-plugin_' . $plugin);
deactivate_plugins($plugin);
update_option('recently_activated', array($plugin => time()) + (array)get_option('recently_activated'));
- if (headers_sent())
- echo "<meta http-equiv='refresh' content='" . esc_attr( "0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page" ) . "' />";
+ if ( headers_sent() )
+ echo "<meta http-equiv='refresh' content='" . esc_attr( "0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) . "' />";
else
- wp_redirect("plugins.php?deactivate=true&plugin_status=$status&paged=$page");
+ wp_redirect( self_admin_url("plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s") );
exit;
break;
case 'deactivate-selected':
if ( ! current_user_can('activate_plugins') )
wp_die(__('You do not have sufficient permissions to deactivate plugins for this site.'));
- check_admin_referer('bulk-manage-plugins');
+ check_admin_referer('bulk-plugins');
$plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();
$plugins = array_filter($plugins, 'is_plugin_active'); //Do not deactivate plugins which are already deactivated.
if ( empty($plugins) ) {
- wp_redirect("plugins.php?plugin_status=$status&paged=$page");
+ wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
exit;
}
$deactivated[ $plugin ] = time();
update_option('recently_activated', $deactivated + (array)get_option('recently_activated'));
- wp_redirect("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page");
+ wp_redirect( self_admin_url("plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s") );
exit;
break;
case 'delete-selected':
if ( ! current_user_can('delete_plugins') )
wp_die(__('You do not have sufficient permissions to delete plugins for this site.'));
- check_admin_referer('bulk-manage-plugins');
+ check_admin_referer('bulk-plugins');
//$_POST = from the plugin form; $_GET = from the FTP details screen.
$plugins = isset( $_REQUEST['checked'] ) ? (array) $_REQUEST['checked'] : array();
- $plugins = array_filter($plugins, create_function('$plugin', 'return !is_plugin_active($plugin);') ); //Do not allow to delete Activated plugins.
- if ( empty($plugins) ) {
- wp_redirect("plugins.php?plugin_status=$status&paged=$page");
+ if ( empty( $plugins ) ) {
+ wp_redirect( self_admin_url("plugins.php?plugin_status=$status&paged=$page&s=$s") );
+ exit;
+ }
+
+ $plugins = array_filter($plugins, 'is_plugin_inactive'); // Do not allow to delete Activated plugins.
+ if ( empty( $plugins ) ) {
+ wp_redirect( self_admin_url( "plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$s" ) );
exit;
}
if ( ! isset($_REQUEST['verify-delete']) ) {
wp_enqueue_script('jquery');
- require_once('./admin-header.php');
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
?>
<div class="wrap">
<?php
$files_to_delete = $plugin_info = array();
+ $have_non_network_plugins = false;
foreach ( (array) $plugins as $plugin ) {
if ( '.' == dirname($plugin) ) {
$files_to_delete[] = WP_PLUGIN_DIR . '/' . $plugin;
if( $data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin) ) {
$plugin_info[ $plugin ] = $data;
$plugin_info[ $plugin ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );
+ if ( ! $plugin_info[ $plugin ]['Network'] )
+ $have_non_network_plugins = true;
}
} else {
// Locate all the files in that folder
// Get plugins list from that folder
if ( $folder_plugins = get_plugins( '/' . dirname($plugin)) ) {
foreach( $folder_plugins as $plugin_file => $data ) {
- $plugin_info[ $plugin_file ] = $data;
+ $plugin_info[ $plugin_file ] = _get_plugin_data_markup_translate( $plugin_file, $data );
$plugin_info[ $plugin_file ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );
+ if ( ! $plugin_info[ $plugin_file ]['Network'] )
+ $have_non_network_plugins = true;
}
}
}
$plugins_to_delete = count( $plugin_info );
echo '<h2>' . _n( 'Delete Plugin', 'Delete Plugins', $plugins_to_delete ) . '</h2>';
?>
+ <?php if ( $have_non_network_plugins && is_network_admin() ) : ?>
+ <div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo _n( 'This plugin may be active on other sites in the network.', 'These plugins may be active on other sites in the network.', $plugins_to_delete ); ?></p></div>
+ <?php endif; ?>
<p><?php echo _n( 'You are about to remove the following plugin:', 'You are about to remove the following plugins:', $plugins_to_delete ); ?></p>
<ul class="ul-disc">
<?php
foreach ( $plugin_info as $plugin ) {
if ( $plugin['is_uninstallable'] ) {
/* translators: 1: plugin name, 2: plugin author */
- echo '<li>', sprintf( __( '<strong>%1$s</strong> by <em>%2$s</em> (will also <strong>delete its data</strong>)' ), esc_html($plugin['Name']), esc_html($plugin['Author']) ), '</li>';
+ echo '<li>', sprintf( __( '<strong>%1$s</strong> by <em>%2$s</em> (will also <strong>delete its data</strong>)' ), esc_html($plugin['Name']), esc_html($plugin['AuthorName']) ), '</li>';
$data_to_delete = true;
} else {
/* translators: 1: plugin name, 2: plugin author */
- echo '<li>', sprintf( __('<strong>%1$s</strong> by <em>%2$s</em>' ), esc_html($plugin['Name']), esc_html($plugin['Author']) ), '</li>';
+ echo '<li>', sprintf( __('<strong>%1$s</strong> by <em>%2$s</em>' ), esc_html($plugin['Name']), esc_html($plugin['AuthorName']) ), '</li>';
}
}
?>
<input type="hidden" name="verify-delete" value="1" />
<input type="hidden" name="action" value="delete-selected" />
<?php
- foreach ( (array)$plugins as $plugin )
+ foreach ( (array) $plugins as $plugin )
echo '<input type="hidden" name="checked[]" value="' . esc_attr($plugin) . '" />';
?>
- <?php wp_nonce_field('bulk-manage-plugins') ?>
- <input type="submit" name="submit" value="<?php $data_to_delete ? esc_attr_e('Yes, Delete these files and data') : esc_attr_e('Yes, Delete these files') ?>" class="button" />
+ <?php wp_nonce_field('bulk-plugins') ?>
+ <?php submit_button( $data_to_delete ? __( 'Yes, Delete these files and data' ) : __( 'Yes, Delete these files' ), 'button', 'submit', false ); ?>
</form>
<form method="post" action="<?php echo esc_url(wp_get_referer()); ?>" style="display:inline;">
- <input type="submit" name="submit" value="<?php esc_attr_e('No, Return me to the plugin list') ?>" class="button" />
+ <?php submit_button( __( 'No, Return me to the plugin list' ), 'button', 'submit', false ); ?>
</form>
<p><a href="#" onclick="jQuery('#files-list').toggle(); return false;"><?php _e('Click to view entire list of files which will be deleted'); ?></a></p>
</div>
</div>
<?php
- require_once('./admin-footer.php');
+ require_once(ABSPATH . 'wp-admin/admin-footer.php');
exit;
} //Endif verify-delete
$delete_result = delete_plugins($plugins);
- set_transient('plugins_delete_result_'.$user_ID, $delete_result); //Store the result in a cache rather than a URL param due to object type & length
- wp_redirect("plugins.php?deleted=true&plugin_status=$status&paged=$page");
+ set_transient('plugins_delete_result_' . $user_ID, $delete_result); //Store the result in a cache rather than a URL param due to object type & length
+ wp_redirect( self_admin_url("plugins.php?deleted=true&plugin_status=$status&paged=$page&s=$s") );
exit;
break;
case 'clear-recent-list':
}
}
+$wp_list_table->prepare_items();
+
+$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
+}
+
wp_enqueue_script('plugin-install');
add_thickbox();
+add_screen_option( 'per_page', array('label' => _x( 'Plugins', 'plugins per page (screen options)' )) );
+
add_contextual_help($current_screen,
'<p>' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '</p>' .
'<p>' . sprintf(__('You can find additional plugins for your site by using the <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="%2$s" target="_blank">WordPress Plugin Directory</a> directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your <code>/wp-content/plugins</code> directory. Once a plugin has been installed, you can activate it here.'), 'plugin-install.php', 'http://wordpress.org/extend/plugins/') . '</p>' .
);
$title = __('Plugins');
+$parent_file = 'plugins.php';
-require_once('./admin-header.php');
+require_once(ABSPATH . 'wp-admin/admin-header.php');
$invalid = validate_active_plugins();
if ( !empty($invalid) )
<?php if ( isset($_GET['error']) ) :
- if ( isset($_GET['charsout']) )
+ if ( isset( $_GET['main'] ) )
+ $errmsg = __( 'You cannot delete a plugin while it is active on the main site.' );
+ elseif ( isset($_GET['charsout']) )
$errmsg = sprintf(__('The plugin generated %d characters of <strong>unexpected output</strong> 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 <strong>fatal error</strong>.');
?>
<div id="message" class="updated"><p><?php echo $errmsg; ?></p>
<?php
- if ( !isset($_GET['charsout']) && wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $plugin) ) { ?>
- <iframe style="border:0" width="100%" height="70px" src="<?php echo admin_url('plugins.php?action=error_scrape&plugin=' . esc_attr($plugin) . '&_wpnonce=' . esc_attr($_GET['_error_nonce'])); ?>"></iframe>
+ if ( !isset( $_GET['main'] ) && !isset($_GET['charsout']) && wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $plugin) ) { ?>
+ <iframe style="border:0" width="100%" height="70px" src="<?php echo 'plugins.php?action=error_scrape&plugin=' . esc_attr($plugin) . '&_wpnonce=' . esc_attr($_GET['_error_nonce']); ?>"></iframe>
<?php
}
?>
<div class="wrap">
<?php screen_icon(); ?>
-<h2><?php echo esc_html( $title ); if ( current_user_can('install_plugins') ) { ?> <a href="plugin-install.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'plugin'); ?></a><?php } ?></h2>
-
-<?php
+<h2><?php echo esc_html( $title );
+if ( ( ! is_multisite() || is_network_admin() ) && current_user_can('install_plugins') ) { ?>
+<a href="<?php echo self_admin_url( 'plugin-install.php' ); ?>" class="button add-new-h2"><?php echo esc_html_x('Add New', 'plugin'); ?></a>
+<?php }
+if ( $s )
+ printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( $s ) ); ?>
+</h2>
-$all_plugins = apply_filters( 'all_plugins', get_plugins() );
-$search_plugins = array();
-$active_plugins = array();
-$inactive_plugins = array();
-$recent_plugins = array();
-$recently_activated = get_option('recently_activated', array());
-$upgrade_plugins = array();
-$network_plugins = array();
-$mustuse_plugins = $dropins_plugins = array();
-if ( ! is_multisite() || current_user_can('manage_network_plugins') ) {
- if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) )
- $mustuse_plugins = get_mu_plugins();
- if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) )
- $dropins_plugins = get_dropins();
-}
+<?php do_action( 'pre_current_active_plugins', $plugins['all'] ) ?>
-set_transient( 'plugin_slugs', array_keys($all_plugins), 86400 );
-
-// Clean out any plugins which were deactivated over a week ago.
-foreach ( $recently_activated as $key => $time )
- if ( $time + (7*24*60*60) < time() ) //1 week
- unset($recently_activated[ $key ]);
-if ( $recently_activated != get_option('recently_activated') ) //If array changed, update it.
- update_option('recently_activated', $recently_activated);
-$current = get_site_transient( 'update_plugins' );
-
-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?
- $recent_plugins[ $plugin_file ] = $plugin_data;
- $inactive_plugins[ $plugin_file ] = $plugin_data;
- }
+<?php $wp_list_table->views(); ?>
- if ( isset( $current->response[ $plugin_file ] ) )
- $upgrade_plugins[ $plugin_file ] = $plugin_data;
-}
+<form method="post" action="">
-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 ( !empty($_GET['s']) ) {
- function _search_plugins_filter_callback($plugin) {
- static $term;
- if ( is_null($term) )
- $term = stripslashes($_GET['s']);
- if ( stripos($plugin['Name'], $term) !== false ||
- stripos($plugin['Description'], $term) !== false ||
- stripos($plugin['Author'], $term) !== false ||
- stripos($plugin['PluginURI'], $term) !== false ||
- stripos($plugin['AuthorURI'], $term) !== false ||
- stripos($plugin['Version'], $term) !== false )
- return true;
- else
- return false;
- }
- $status = 'search';
- $search_plugins = array_filter($all_plugins, '_search_plugins_filter_callback');
- $total_search_plugins = count($search_plugins);
-}
+<?php $wp_list_table->search_box( __( 'Search Plugins' ), 'plugin' ); ?>
-$plugin_array_name = "${status}_plugins";
-if ( empty($$plugin_array_name) && !in_array($status, array('all', 'search')) ) {
- $status = 'all';
- $plugin_array_name = "${status}_plugins";
-}
-
-$plugins = &$$plugin_array_name;
-
-// Paging.
-$total_this_page = "total_{$status}_plugins";
-$total_this_page = $$total_this_page;
-$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 );
-
-$start = ($page - 1) * $plugins_per_page;
-
-$page_links = paginate_links( array(
- 'base' => add_query_arg( 'paged', '%#%' ),
- 'format' => '',
- 'prev_text' => __('«'),
- 'next_text' => __('»'),
- 'total' => ceil($total_this_page / $plugins_per_page),
- 'current' => $page
-));
-$page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
- number_format_i18n( $start + 1 ),
- number_format_i18n( min( $page * $plugins_per_page, $total_this_page ) ),
- '<span class="total-type-count">' . number_format_i18n( $total_this_page ) . '</span>',
- $page_links
-);
-
-/**
- * @ignore
- *
- * @param array $plugins
- * @param string $context
- */
-function print_plugins_table($plugins, $context = '') {
- global $page;
- $checkbox = ! in_array( $context, array( 'mustuse', 'dropins' ) ) ? '<input type="checkbox" />' : '';
-?>
-<table class="widefat" cellspacing="0" id="<?php echo $context ?>-plugins-table">
- <thead>
- <tr>
- <th scope="col" class="manage-column check-column"><?php echo $checkbox; ?></th>
- <th scope="col" class="manage-column"><?php _e('Plugin'); ?></th>
- <th scope="col" class="manage-column"><?php _e('Description'); ?></th>
- </tr>
- </thead>
-
- <tfoot>
- <tr>
- <th scope="col" class="manage-column check-column"><?php echo $checkbox; ?></th>
- <th scope="col" class="manage-column"><?php _e('Plugin'); ?></th>
- <th scope="col" class="manage-column"><?php _e('Description'); ?></th>
- </tr>
- </tfoot>
-
- <tbody class="plugins">
-<?php
-
- if ( empty($plugins) ) {
- echo '<tr>
- <td colspan="3">' . __('No plugins to show') . '</td>
- </tr>';
- }
- foreach ( (array)$plugins as $plugin_file => $plugin_data) {
- // 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 .= '<br/>' . $plugin_data['Name'];
- if ( true === ( $dropins[ $plugin_file ][1] ) ) { // Doesn't require a constant
- $is_active = true;
- $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
- } elseif ( constant( $dropins[ $plugin_file ][1] ) ) { // Constant is true
- $is_active = true;
- $description = '<p><strong>' . $dropins[ $plugin_file ][0] . '</strong></p>';
- } else {
- $is_active = false;
- $description = '<p><strong>' . $dropins[ $plugin_file ][0] . ' <span class="attention">' . __('Inactive:') . '</span></strong> ' . sprintf( __( 'Requires <code>%s</code> in <code>wp-config.php</code>.' ), "define('" . $dropins[ $plugin_file ][1] . "', true);" ) . '</p>';
- }
- if ( $plugin_data['Description'] )
- $description .= '<p>' . $plugin_data['Description'] . '</p>';
- } 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'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
- } else {
- $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>';
- }
- } else {
- if ( is_multisite() && is_network_only_plugin( $plugin_file ) )
- $actions['network_only'] = '<span title="' . __('This plugin can only be activated for all sites in a network') . '">' . __('Network Only') . '</span>';
- else
- $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>';
-
- if ( is_multisite() && current_user_can( 'manage_network_plugins' ) )
- $actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin for all sites in this network') . '" class="edit">' . __('Network Activate') . '</a>';
-
- if ( current_user_can('delete_plugins') )
- $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page, 'bulk-manage-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
- } // end if $is_active
-
- if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
- $actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
- } // 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 );
-
- $class = $is_active ? 'active' : 'inactive';
- $checkbox = in_array( $context, array( 'mustuse', 'dropins' ) ) ? '' : "<input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' />";
- if ( 'dropins' != $context ) {
- $description = '<p>' . $plugin_data['Description'] . '</p>';
- $plugin_name = $plugin_data['Name'];
- }
- echo "
- <tr class='$class'>
- <th scope='row' class='check-column'>$checkbox</th>
- <td class='plugin-title'><strong>$plugin_name</strong></td>
- <td class='desc'>$description</td>
- </tr>
- <tr class='$class second'>
- <td></td>
- <td class='plugin-title'>";
- echo '<div class="row-actions-visible">';
- foreach ( $actions as $action => $link ) {
- $sep = end($actions) == $link ? '' : ' | ';
- echo "<span class='$action'>$link$sep</span>";
- }
- echo "</div></td>
- <td class='desc'>";
- $plugin_meta = array();
- if ( !empty($plugin_data['Version']) )
- $plugin_meta[] = sprintf(__('Version %s'), $plugin_data['Version']);
- if ( !empty($plugin_data['Author']) ) {
- $author = $plugin_data['Author'];
- if ( !empty($plugin_data['AuthorURI']) )
- $author = '<a href="' . $plugin_data['AuthorURI'] . '" title="' . __( 'Visit author homepage' ) . '">' . $plugin_data['Author'] . '</a>';
- $plugin_meta[] = sprintf( __('By %s'), $author );
- }
- if ( ! empty($plugin_data['PluginURI']) )
- $plugin_meta[] = '<a href="' . $plugin_data['PluginURI'] . '" title="' . __( 'Visit plugin site' ) . '">' . __('Visit plugin site') . '</a>';
-
- $plugin_meta = apply_filters('plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $context);
- echo implode(' | ', $plugin_meta);
- echo "</td>
- </tr>\n";
-
- do_action( 'after_plugin_row', $plugin_file, $plugin_data, $context );
- do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $context );
- }
-?>
- </tbody>
-</table>
-<?php
-} //End print_plugins_table()
-
-/**
- * @ignore
- *
- * @param string $context
- */
-function print_plugin_actions($context, $field_name = 'action' ) {
- if ( in_array( $context, array( 'mustuse', 'dropins' ) ) )
- return;
-?>
- <div class="alignleft actions">
- <select name="<?php echo $field_name; ?>">
- <option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
- <?php if ( 'active' != $context ) : ?>
- <option value="activate-selected"><?php _e('Activate'); ?></option>
- <?php endif; ?>
- <?php if ( is_multisite() && 'network' != $context ) : ?>
- <option value="network-activate-selected"><?php _e('Network Activate'); ?></option>
- <?php endif; ?>
- <?php if ( 'inactive' != $context && 'recent' != $context ) : ?>
- <option value="deactivate-selected"><?php _e('Deactivate'); ?></option>
- <?php endif; ?>
- <?php if ( current_user_can( 'update_plugins' ) ) : ?>
- <option value="update-selected"><?php _e( 'Upgrade' ); ?></option>
- <?php endif; ?>
- <?php if ( current_user_can('delete_plugins') && ( 'active' != $context ) ) : ?>
- <option value="delete-selected"><?php _e('Delete'); ?></option>
- <?php endif; ?>
- </select>
- <input type="submit" name="doaction_active" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary action" />
- <?php if ( 'recent' == $context ) : ?>
- <input type="submit" name="clear-recent-list" value="<?php esc_attr_e('Clear List') ?>" class="button-secondary" />
- <?php endif; ?>
- </div>
-<?php
-}
-?>
-
-<form method="get" action="">
-<p class="search-box">
- <label class="screen-reader-text" for="plugin-search-input"><?php _e( 'Search Plugins' ); ?>:</label>
- <input type="text" id="plugin-search-input" name="s" value="<?php _admin_search_query(); ?>" />
- <input type="submit" value="<?php esc_attr_e( 'Search Installed Plugins' ); ?>" class="button" />
-</p>
-</form>
-
-<?php do_action( 'pre_current_active_plugins', $all_plugins ) ?>
-
-<form method="post" action="<?php echo admin_url('plugins.php') ?>">
-<?php wp_nonce_field('bulk-manage-plugins') ?>
<input type="hidden" name="plugin_status" value="<?php echo esc_attr($status) ?>" />
<input type="hidden" name="paged" value="<?php echo esc_attr($page) ?>" />
-<ul class="subsubsub">
-<?php
-$status_links = array();
-$class = ( 'all' == $status ) ? ' class="current"' : '';
-$status_links[] = "<li><a href='plugins.php?plugin_status=all' $class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_all_plugins, 'plugins' ), number_format_i18n( $total_all_plugins ) ) . '</a>';
-if ( ! empty($active_plugins) ) {
- $class = ( 'active' == $status ) ? ' class="current"' : '';
- $status_links[] = "<li><a href='plugins.php?plugin_status=active' $class>" . sprintf( _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', $total_active_plugins ), number_format_i18n( $total_active_plugins ) ) . '</a>';
-}
-if ( ! empty($recent_plugins) ) {
- $class = ( 'recent' == $status ) ? ' class="current"' : '';
- $status_links[] = "<li><a href='plugins.php?plugin_status=recent' $class>" . sprintf( _n( 'Recently Active <span class="count">(%s)</span>', 'Recently Active <span class="count">(%s)</span>', $total_recent_plugins ), number_format_i18n( $total_recent_plugins ) ) . '</a>';
-}
-if ( ! empty($inactive_plugins) ) {
- $class = ( 'inactive' == $status ) ? ' class="current"' : '';
- $status_links[] = "<li><a href='plugins.php?plugin_status=inactive' $class>" . sprintf( _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', $total_inactive_plugins ), number_format_i18n( $total_inactive_plugins ) ) . '</a>';
-}
-if ( ! empty($network_plugins) ) {
- $class = ( 'network' == $status ) ? ' class="current"' : '';
- $status_links[] = "<li><a href='plugins.php?plugin_status=network' $class>" . sprintf( _n( 'Network <span class="count">(%s)</span>', 'Network <span class="count">(%s)</span>', $total_network_plugins ), number_format_i18n( $total_network_plugins ) ) . '</a>';
-}
-if ( ! empty($mustuse_plugins) ) {
- $class = ( 'mustuse' == $status ) ? ' class="current"' : '';
- $status_links[] = "<li><a href='plugins.php?plugin_status=mustuse' $class>" . sprintf( _n( 'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', $total_mustuse_plugins ), number_format_i18n( $total_mustuse_plugins ) ) . '</a>';
-}
-if ( ! empty($dropins_plugins) ) {
- $class = ( 'dropins' == $status ) ? ' class="current"' : '';
- $status_links[] = "<li><a href='plugins.php?plugin_status=dropins' $class>" . sprintf( _n( 'Drop-ins <span class="count">(%s)</span>', 'Drop-ins <span class="count">(%s)</span>', $total_dropins_plugins ), number_format_i18n( $total_dropins_plugins ) ) . '</a>';
-}
-if ( ! empty($upgrade_plugins) ) {
- $class = ( 'upgrade' == $status ) ? ' class="current"' : '';
- $status_links[] = "<li><a href='plugins.php?plugin_status=upgrade' $class>" . sprintf( _n( 'Upgrade Available <span class="count">(%s)</span>', 'Upgrade Available <span class="count">(%s)</span>', $total_upgrade_plugins ), number_format_i18n( $total_upgrade_plugins ) ) . '</a>';
-}
-if ( ! empty($search_plugins) ) {
- $class = ( 'search' == $status ) ? ' class="current"' : '';
- $term = isset($_REQUEST['s']) ? urlencode(stripslashes($_REQUEST['s'])) : '';
- $status_links[] = "<li><a href='plugins.php?s=$term' $class>" . sprintf( _n( 'Search Results <span class="count">(%s)</span>', 'Search Results <span class="count">(%s)</span>', $total_search_plugins ), number_format_i18n( $total_search_plugins ) ) . '</a>';
-}
-echo implode( " |</li>\n", $status_links ) . '</li>';
-unset( $status_links );
-?>
-</ul>
-
<?php
if ( 'mustuse' == $status )
- echo '<div class="clear"></div><p>' . __( 'Files in the <code>/wp-content/mu-plugins</code> directory are executed automatically.' ) . '</p>';
+ echo '<br class="clear" /><p>' . __( 'Files in the <code>/wp-content/mu-plugins</code> directory are executed automatically.' ) . '</p>';
elseif ( 'dropins' == $status )
- echo '<div class="clear"></div><p>' . __( 'Drop-ins are advanced plugins in the <code>/wp-content</code> directory that replace WordPress functionality when present.' ) . '</p>';
-
-if ( !empty( $plugins ) && ( ! in_array( $status, array( 'mustuse', 'dropins' ) ) || $page_links ) ) :
+ echo '<br class="clear" /><p>' . __( 'Drop-ins are advanced plugins in the <code>/wp-content</code> directory that replace WordPress functionality when present.' ) . '</p>';
?>
-<div class="tablenav">
-<?php
-if ( $page_links )
- echo '<div class="tablenav-pages">', $page_links_text, '</div>';
-print_plugin_actions($status);
-?>
-</div>
-<div class="clear"></div>
-<?php
-endif;
-
-if ( $total_this_page > $plugins_per_page )
- $plugins = array_slice($plugins, $start, $plugins_per_page);
-
-print_plugins_table($plugins, $status);
-
-if ( !empty( $plugins ) && ! in_array( $status, array( 'mustuse', 'dropins' ) ) || $page_links ) {
-?>
-<div class="tablenav">
-<?php
-if ( $page_links )
- echo "<div class='tablenav-pages'>$page_links_text</div>";
-
-print_plugin_actions($status, "action2");
-?>
-</div>
-<?php } ?>
+<?php $wp_list_table->display(); ?>
</form>
-<?php if ( empty($all_plugins) ) : ?>
-<br class="clear" />
-<p><?php _e('You do not appear to have any plugins available at this time.') ?></p>
-<?php endif; ?>
-
</div>
<?php
-include('./admin-footer.php');
-?>
+include(ABSPATH . 'wp-admin/admin-footer.php');
$editing = true;
-if ( 'post' == $post_type && !current_user_can('edit_posts') ) {
- include('./admin-header.php'); ?>
-<div class="wrap">
-<p><?php printf(__('Since you’re a newcomer, you’ll have to wait for an admin to add the <code>edit_posts</code> capability to your user, in order to be authorized to post.<br />
-You can also <a href="mailto:%s?subject=Promotion?">e-mail the admin</a> to ask for a promotion.<br />
-When you’re promoted, just reload this page and you’ll be able to blog. :)'), get_option('admin_email')); ?>
-</p>
-</div>
-<?php
- include('./admin-footer.php');
- exit();
-}
+if ( ! current_user_can( $post_type_object->cap->edit_posts ) )
+ wp_die( __( 'Cheatin’ uh?' ) );
wp_enqueue_script('autosave');
// Show post form.
-if ( current_user_can($post_type_object->cap->edit_posts) ) {
- $post = get_default_post_to_edit( $post_type, true );
- $post_ID = $post->ID;
- include('edit-form-advanced.php');
-}
-
+$post = get_default_post_to_edit( $post_type, true );
+$post_ID = $post->ID;
+include('edit-form-advanced.php');
include('./admin-footer.php');
-?>
\ No newline at end of file
+?>
* @param int $post_id Optional. Post ID.
*/
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']) ) {
+ if ( isset($_POST['save']) || isset($_POST['publish']) ) {
$status = get_post_status( $post_id );
if ( isset( $_POST['publish'] ) ) {
}
wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );
+ exit;
}
if ( isset( $_POST['deletepost'] ) )
$editing = true;
if ( empty( $post_id ) ) {
- wp_redirect("post.php");
+ wp_redirect( admin_url('post.php') );
exit();
}
$parent_file = "edit.php";
$submenu_file = "edit.php";
} else {
- $parent_file = "edit.php?post_type=$post_type";
+ if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true )
+ $parent_file = $post_type_object->show_in_menu;
+ else
+ $parent_file = "edit.php?post_type=$post_type";
$submenu_file = "edit.php?post_type=$post_type";
}
break;
default:
- wp_redirect('edit.php');
+ wp_redirect( admin_url('edit.php') );
exit();
break;
} // end switch
* @subpackage Press_This
*/
+define('IFRAME_REQUEST' , true);
+
/** WordPress Administration Bootstrap */
require_once('./admin.php');
+
header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
if ( ! current_user_can('edit_posts') )
*/
function press_it() {
// define some basic variables
+ $quick = array();
$quick['post_status'] = 'draft'; // set as draft first
$quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null;
$quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null;
}
}
// set the post_content and status
- if ( isset( $_POST['publish'] ) && current_user_can( 'publish_posts' ) )
- $quick['post_status'] = 'publish';
- elseif ( isset( $_POST['review'] ) )
- $quick['post_status'] = 'pending';
- else
- $quick['post_status'] = 'draft';
+ $quick['post_status'] = isset($_POST['publish']) ? 'publish' : 'draft';
$quick['post_content'] = $content;
// error handling for media_sideload
if ( is_wp_error($upload) ) {
wp_delete_post($post_ID);
wp_die($upload);
} else {
+ // Post formats
+ if ( current_theme_supports( 'post-formats' ) && isset( $_POST['post_format'] ) ) {
+ $post_formats = get_theme_support( 'post-formats' );
+ if ( is_array( $post_formats ) ) {
+ $post_formats = $post_formats[0];
+ if ( in_array( $_POST['post_format'], $post_formats ) )
+ set_post_format( $post_ID, $_POST['post_format'] );
+ elseif ( '0' == $_POST['post_format'] )
+ set_post_format( $post_ID, false );
+ }
+ }
+
$quick['ID'] = $post_ID;
wp_update_post($quick);
}
<div class="postbox">
<h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2>
<div class="inside">
- <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo wp_htmledit_pre( $selection ); ?></textarea>
+ <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo esc_textarea( $selection ); ?></textarea>
<p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p>
</div>
</div>
//<![CDATA[
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};
-var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this';
+var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>;
var photostorage = false;
//]]>
</script>
do_action('admin_print_scripts');
do_action('admin_head');
- if ( user_can_richedit() )
+ if ( user_can_richedit() ) {
wp_tiny_mce( true, array( 'height' => '370' ) );
+ add_action( 'admin_print_footer_scripts', 'wp_tiny_mce_preload_dialogs', 30 );
+ }
?>
<script type="text/javascript">
function insert_plain_editor(text) {
<div class="photolist"></div>
<div id="submitdiv" class="stuffbox">
- <div class="handlediv" title="<?php _e( 'Click to toggle' ); ?>">
- <br/>
- </div>
- <h3><?php _e('Publish') ?></h3>
<div class="inside">
<p>
- <input class="button" type="submit" name="draft" value="<?php esc_attr_e('Save Draft') ?>" id="save" />
- <?php if ( current_user_can('publish_posts') ) { ?>
- <input class="button-primary" type="submit" name="publish" value="<?php esc_attr_e('Publish') ?>" id="publish" />
- <?php } else { ?>
- <br /><br /><input class="button-primary" type="submit" name="review" value="<?php esc_attr_e('Submit for Review') ?>" id="review" />
- <?php } ?>
+ <?php
+ submit_button( __( 'Save Draft' ), 'button', 'draft', false, array( 'id' => 'save' ) );
+ if ( current_user_can('publish_posts') ) {
+ submit_button( __( 'Publish' ), 'primary', 'publish', false );
+ } else {
+ echo '<br /><br />';
+ submit_button( __( 'Submit for Review' ), 'primary', 'review', false );
+ } ?>
<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" id="saving" style="display:none;" />
</p>
+ <?php if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) :
+ $post_formats = get_theme_support( 'post-formats' );
+ if ( is_array( $post_formats[0] ) ) :
+ $default_format = get_option( 'default_post_format', '0' );
+ ?>
+ <p>
+ <label for="post_format"><?php _e( 'Post Format:' ); ?>
+ <select name="post_format" id="post_format">
+ <option value="0"><?php _e( 'Standard' ); ?></option>
+ <?php foreach ( $post_formats[0] as $format ): ?>
+ <option<?php selected( $default_format, $format ); ?> value="<?php echo esc_attr( $format ); ?>"> <?php echo esc_html( get_post_format_string( $format ) ); ?></option>
+ <?php endforeach; ?>
+ </select></label>
+ </p>
+ <?php endif; endif; ?>
</div>
</div>
/**
* This is a profile page.
*
- * @since unknown
+ * @since 2.5.0
* @var bool
*/
define('IS_PROFILE_PAGE', true);
<br class="clear" />
-<h2><?php echo $title; ?></h2>
+<h3><?php echo $title; ?></h3>
<?php
require_once(ABSPATH . WPINC . '/load.php');
require_once(ABSPATH . WPINC . '/compat.php');
require_once(ABSPATH . WPINC . '/functions.php');
-require_once(ABSPATH . WPINC . '/classes.php');
+require_once(ABSPATH . WPINC . '/class-wp-error.php');
require_once(ABSPATH . WPINC . '/version.php');
if (!file_exists(ABSPATH . 'wp-config-sample.php'))
// We'll fail here if the values are no good.
require_wp_db();
- if ( !empty($wpdb->error) )
- wp_die($wpdb->error->get_error_message());
+ if ( ! empty( $wpdb->error ) ) {
+ $back = '<p class="step"><a href="setup-config.php?step=1" onclick="javascript:history.go(-1);return false;" class="button">Try Again</a></p>';
+ wp_die( $wpdb->error->get_error_message() . $back );
+ }
// Fetch or generate keys and salts.
$no_api = isset( $_POST['noapi'] );
+++ /dev/null
-<?php
-/**
- * Quick way to create a WordPress Post.
- *
- * @package WordPress
- * @subpackage Administration
- */
-
-/**
- * @var string
- * @name $mode
- */
-$mode = 'sidebar';
-
-/** WordPress Administration Bootstrap */
-require_once('./admin.php');
-
-if ( ! current_user_can('edit_posts') )
- wp_die(__('Cheatin’ uh?'));
-
-$post = get_default_post_to_edit();
-
-?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('blog_charset'); ?>" />
-<title><?php bloginfo('name') ?> › <?php _e('Sidebar'); ?></title>
-<style type="text/css" media="screen">
-body {
- font-size: 0.9em;
- margin: 0;
- padding: 0;
-}
-form {
- padding: 1%;
-}
-.tags-wrap p {
- font-size: 0.75em;
- margin-top: 0.4em;
-}
-.button-highlighted, #wphead, label {
- font-weight: bold;
-}
-#post-title, #tags-input, #content {
- width: 99%;
- padding: 2px;
-}
-#wphead {
- font-size: 1.4em;
- background-color: #E4F2FD;
- color: #555555;
- padding: 0.2em 1%;
-}
-#wphead p {
- margin: 3px;
-}
-.button {
- font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
- padding: 3px 5px;
- margin-right: 5px;
- font-size: 0.75em;
- line-height: 1.5em;
- border: 1px solid #80b5d0;
- -moz-border-radius: 3px;
- -khtml-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- cursor: pointer;
- background-color: #e5e5e5;
- color: #246;
-}
-.button:hover {
- border-color: #535353;
-}
-.updated {
- background-color: #FFFBCC;
- border: 1px solid #E6DB55;
- margin-bottom: 1em;
- padding: 0 0.6em;
-}
-.updated p {
- margin: 0.6em;
-}
-</style>
-</head>
-<body id="sidebar">
-<div id="wphead"><p><?php bloginfo('name') ?> › <?php _e('Sidebar'); ?></p></div>
-<form name="post" action="post.php" method="post">
-<div>
-<input type="hidden" name="action" value="post" />
-<input type="hidden" name="user_ID" value="<?php echo esc_attr($user_ID) ?>" />
-<input type="hidden" name="mode" value="sidebar" />
-<input type="hidden" name="ping_status" value="<?php echo esc_attr($post->ping_status); ?>" />
-<input type="hidden" name="comment_status" value="<?php echo esc_attr($post->comment_status); ?>" />
-<?php wp_nonce_field('add-post');
-
-if ( 'b' == $_GET['a'] )
- echo '<div class="updated"><p>' . __('Post published.') . '</p></div>';
-elseif ( 'c' == $_GET['a'] )
- echo '<div class="updated"><p>' . __('Post saved.') . '</p></div>';
-?>
-<p>
-<label for="post-title"><?php _e('Title:'); ?></label>
-<input type="text" name="post_title" id="post-title" size="20" tabindex="1" autocomplete="off" value="" />
-</p>
-
-<p>
-<label for="content"><?php _e('Post:'); ?></label>
-<textarea rows="8" cols="12" name="content" id="content" style="height:10em;line-height:1.4em;" tabindex="2"></textarea>
-</p>
-
-<div class="tags-wrap">
-<label for="tags-input"><?php _e('Tags:') ?></label>
-<input type="text" name="tags_input" id="tags-input" tabindex="3" value="" />
-<p><?php _e('Separate tags with commas'); ?></p>
-</div>
-
-<p>
-<input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" accesskey="s" class="button" value="<?php esc_attr_e('Save as Draft'); ?>" />
-<?php if ( current_user_can('publish_posts') ) : ?>
-<input name="publish" type="submit" id="publish" tabindex="6" accesskey="p" value="<?php esc_attr_e('Publish') ?>" class="button button-highlighted" />
-<?php endif; ?>
-</p>
-</div>
-</form>
-
-</body>
-</html>
/** WordPress Administration Bootstrap */
require_once('./admin.php');
+if ( is_multisite() && ! is_network_admin() ) {
+ wp_redirect( network_admin_url( 'theme-editor.php' ) );
+ exit();
+}
+
if ( !current_user_can('edit_themes') )
wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site.').'</p>');
$help .= '<p>' . __('After typing in your edits, click Update File.') . '</p>';
$help .= '<p>' . __('<strong>Advice:</strong> think very carefully about your site crashing if you are live-editing the theme currently in use.') . '</p>';
$help .= '<p>' . __('Upgrading to a newer version of the same theme will override changes made here. To avoid this, consider creating a <a href="http://codex.wordpress.org/Child_Themes" target="_blank">child theme</a> instead.') . '</p>';
+if ( is_network_admin() )
+ $help .= '<p>' . __('Any edits to files from this screen will be reflected on all sites in the network.') . '</p>';
$help .= '<p><strong>' . __('For more information:') . '</strong></p>';
$help .= '<p>' . __('<a href="http://codex.wordpress.org/Theme_Development" target="_blank">Documentation on Theme Development</a>') . '</p>';
$help .= '<p>' . __('<a href="http://codex.wordpress.org/Using_Themes" target="_blank">Documentation on Using Themes</a>') . '</p>';
if ( ! isset($themes[$theme]) )
wp_die(__('The requested theme does not exist.'));
-$allowed_files = array_merge($themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files']);
+$allowed_files = array_merge( $themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files'] );
-if (empty($file)) {
- $file = $allowed_files[0];
+if ( empty( $file ) ) {
+ if ( false !== array_search( $themes[$theme]['Stylesheet Dir'] . '/style.css', $allowed_files ) )
+ $file = $themes[$theme]['Stylesheet Dir'] . '/style.css';
+ else
+ $file = $allowed_files[0];
} else {
$file = stripslashes($file);
if ( 'theme' == $dir ) {
default:
- require_once('./admin-header.php');
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
update_recently_edited($file);
if ( !is_file($file) )
$error = 1;
+ $content = '';
if ( !$error && filesize($file) > 0 ) {
$f = fopen($file, 'r');
$content = fread($f, filesize($file));
$docs_select .= '</select>';
}
- $content = htmlspecialchars( $content );
+ $content = esc_textarea( $content );
}
?>
<?php endif;
$description = get_file_description($file);
-$desc_header = ( $description != $file_show ) ? "<strong>$description</strong> (%s)" : "%s";
+$desc_header = ( $description != $file_show ) ? "$description <span>($file_show)</span>" : $file_show;
+
+$is_child_theme = $themes[$theme]['Template'] != $themes[$theme]['Stylesheet'];
?>
<div class="wrap">
<?php screen_icon(); ?>
<div class="fileedit-sub">
<div class="alignleft">
-<big><?php echo sprintf($desc_header, $file_show); ?></big>
+<h3><?php echo $themes[$theme]['Name'] . ': ' . $desc_header; ?></h3>
</div>
<div class="alignright">
<form action="theme-editor.php" method="post">
}
?>
</select>
- <input type="submit" name="Submit" value="<?php esc_attr_e('Select') ?>" class="button" />
+ <?php submit_button( __( 'Select' ), 'button', 'Submit', false ); ?>
</form>
</div>
<br class="clear" />
</div>
<div id="templateside">
-
<?php
if ($allowed_files) :
?>
<h3><?php _e('Templates'); ?></h3>
+ <?php if ( $is_child_theme ) : ?>
+ <p class="howto"><?php printf( __( 'This child theme inherits templates from a parent theme, %s.' ), $themes[$theme]['Parent Theme'] ); ?></p>
+ <?php endif; ?>
<ul>
<?php
$template_mapping = array();
$template_dir = $themes[$theme]['Template Dir'];
foreach ( $themes[$theme]['Template Files'] as $template_file ) {
+ // Don't show parent templates.
+ if ( $is_child_theme && strpos( $template_file, trailingslashit( $template_dir ) ) === 0 )
+ continue;
+
$description = trim( get_file_description($template_file) );
$template_show = basename($template_file);
$filedesc = ( $description != $template_file ) ? "$description<br /><span class='nonessential'>($template_show)</span>" : "$description";
$filedesc = ( $template_file == $file ) ? "<span class='highlight'>$description<br /><span class='nonessential'>($template_show)</span></span>" : $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 ( false !== strpos( $template_file, $template_dir ) ) {
- $template_mapping[ $description ] = array( _get_template_edit_filename($template_file, $template_dir), $filedesc );
- }
- } else {
- $template_mapping[ $description ] = array( _get_template_edit_filename($template_file, $template_dir), $filedesc );
- }
+ $template_mapping[ $description ] = array( _get_template_edit_filename($template_file, $template_dir), $filedesc );
}
ksort( $template_mapping );
while ( list( $template_sorted_key, list( $template_file, $filedesc ) ) = each( $template_mapping ) ) :
$template_mapping = array();
$stylesheet_dir = $themes[$theme]['Stylesheet Dir'];
foreach ( $themes[$theme]['Stylesheet Files'] as $style_file ) {
+ // Don't show parent styles.
+ if ( $is_child_theme && strpos( $style_file, trailingslashit( $template_dir ) ) === 0 )
+ continue;
+
$description = trim( get_file_description($style_file) );
$style_show = basename($style_file);
$filedesc = ( $description != $style_file ) ? "$description<br /><span class='nonessential'>($style_show)</span>" : "$description";
<?php } ?>
<div>
-<?php if ( is_writeable($file) ) : ?>
- <p class="submit">
+ <?php if ( is_child_theme() && ! $is_child_theme && $themes[$theme]['Template'] == get_option('template') ) : ?>
+ <p><?php if ( is_writeable( $file ) ) { ?><strong><?php _e( 'Caution:' ); ?></strong><?php } ?>
+ <?php _e( 'This is a file in your current parent theme.' ); ?></p>
+ <?php endif; ?>
<?php
- echo "<input type='submit' name='submit' class='button-primary' value='" . esc_attr__('Update File') . "' tabindex='2' />";
-?>
-</p>
-<?php else : ?>
+ if ( is_writeable( $file ) ) :
+ submit_button( __( 'Update File' ), 'primary', 'submit', true, array( 'tabindex' => '2' ) );
+ else : ?>
<p><em><?php _e('You need to make this file writable before you can save your changes. See <a href="http://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.'); ?></em></p>
<?php endif; ?>
</div>
break;
}
-include("./admin-footer.php");
+include(ABSPATH . "wp-admin/admin-footer.php");
* @subpackage Administration
*/
+if ( !defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) )
+ define( 'IFRAME_REQUEST', true );
+
/** WordPress Administration Bootstrap */
require_once('./admin.php');
if ( ! current_user_can('install_themes') )
- wp_die(__('You do not have sufficient permissions to install themes on this site.'));
+ wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
+
+if ( is_multisite() && ! is_network_admin() ) {
+ wp_redirect( network_admin_url( 'theme-install.php' ) );
+ exit();
+}
-include(ABSPATH . 'wp-admin/includes/theme-install.php');
+$wp_list_table = _get_list_table('WP_Theme_Install_List_Table');
+$pagenum = $wp_list_table->get_pagenum();
+$wp_list_table->prepare_items();
+$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
+}
$title = __('Install Themes');
$parent_file = 'themes.php';
-$submenu_file = 'themes.php';
+if ( !is_network_admin() )
+ $submenu_file = 'themes.php';
-wp_reset_vars( array('tab', 'paged') );
wp_enqueue_style( 'theme-install' );
wp_enqueue_script( 'theme-install' );
add_thickbox();
wp_enqueue_script( 'theme-preview' );
-//These are the tabs which are shown on the page,
-$tabs = array();
-$tabs['dashboard'] = __('Search');
-if ( 'search' == $tab )
- $tabs['search'] = __('Search Results');
-$tabs['upload'] = __('Upload');
-$tabs['featured'] = _x('Featured','Theme Installer');
-//$tabs['popular'] = _x('Popular','Theme Installer');
-$tabs['new'] = _x('Newest','Theme Installer');
-$tabs['updated'] = _x('Recently Updated','Theme Installer');
-
-$nonmenu_tabs = array('theme-information'); //Valid actions to perform which do not have a Menu item.
-
-$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) ) ) {
- $tab_actions = array_keys($tabs);
- $tab = $tab_actions[0];
-}
-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.
$help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
add_contextual_help($current_screen, $help);
-include('./admin-header.php');
+include(ABSPATH . 'wp-admin/admin-header.php');
?>
<div class="wrap">
-<?php screen_icon(); ?>
-<h2><a href="themes.php" class="nav-tab"><?php echo esc_html_x('Manage Themes', 'theme'); ?></a><a href="theme-install.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a></h2>
+<?php
+screen_icon();
+
+if ( is_network_admin() ) : ?>
+<h2><?php echo esc_html( $title ); ?></h2>
+<?php else : ?>
+<h2 class="nav-tab-wrapper"><a href="themes.php" class="nav-tab"><?php echo esc_html_x('Manage Themes', 'theme'); ?></a><a href="theme-install.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a></h2>
- <ul class="subsubsub">
<?php
-$display_tabs = array();
-foreach ( (array)$tabs as $action => $text ) {
- $sep = ( end($tabs) != $text ) ? ' | ' : '';
- $class = ( $action == $tab ) ? ' class="current"' : '';
- $href = admin_url('theme-install.php?tab='. $action);
- echo "\t\t<li><a href='$href'$class>$text</a>$sep</li>\n";
-}
-?>
- </ul>
- <br class="clear" />
- <?php do_action('install_themes_' . $tab, $paged); ?>
+endif;
+
+$wp_list_table->views(); ?>
+
+<br class="clear" />
+<?php do_action('install_themes_' . $tab, $paged); ?>
</div>
<?php
-include('./admin-footer.php');
+include(ABSPATH . 'wp-admin/admin-footer.php');
+
if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') )
wp_die( __( 'Cheatin’ uh?' ) );
-if ( current_user_can('switch_themes') && isset($_GET['action']) ) {
+$wp_list_table = _get_list_table('WP_Themes_List_Table');
+
+if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) {
if ( 'activate' == $_GET['action'] ) {
check_admin_referer('switch-theme_' . $_GET['template']);
switch_theme($_GET['template'], $_GET['stylesheet']);
- wp_redirect('themes.php?activated=true');
+ wp_redirect( admin_url('themes.php?activated=true') );
exit;
- } else if ( 'delete' == $_GET['action'] ) {
+ } elseif ( 'delete' == $_GET['action'] ) {
check_admin_referer('delete-theme_' . $_GET['template']);
if ( !current_user_can('delete_themes') )
wp_die( __( 'Cheatin’ uh?' ) );
delete_theme($_GET['template']);
- wp_redirect('themes.php?deleted=true');
+ wp_redirect( admin_url('themes.php?deleted=true') );
exit;
}
}
+$wp_list_table->prepare_items();
+
$title = __('Manage Themes');
$parent_file = 'themes.php';
add_thickbox();
wp_enqueue_script( 'theme-preview' );
+wp_enqueue_script( 'theme' );
+wp_enqueue_style( 'theme-install' );
endif;
require_once('./admin-header.php');
-if ( is_multisite() && current_user_can('edit_themes') ) {
- ?><div id="message0" class="updated"><p><?php printf( __('Administrator: new themes must be activated in the <a href="%s">Network Themes</a> screen before they appear here.'), admin_url( 'ms-themes.php') ); ?></p></div><?php
-}
?>
<?php if ( ! validate_current_theme() ) : ?>
elseif ( isset($_GET['deleted']) ) : ?>
<div id="message3" class="updated"><p><?php _e('Theme deleted.') ?></p></div>
<?php endif; ?>
-<?php
-$themes = get_allowed_themes();
-$ct = current_theme_info();
-unset($themes[$ct->name]);
-
-uksort( $themes, "strnatcasecmp" );
-$theme_total = count( $themes );
-$per_page = 15;
-
-if ( isset( $_GET['pagenum'] ) )
- $page = absint( $_GET['pagenum'] );
-
-if ( empty($page) )
- $page = 1;
-
-$start = $offset = ( $page - 1 ) * $per_page;
-
-$page_links = paginate_links( array(
- 'base' => add_query_arg( 'pagenum', '%#%' ) . '#themenav',
- 'format' => '',
- 'prev_text' => __('«'),
- 'next_text' => __('»'),
- 'total' => ceil($theme_total / $per_page),
- 'current' => $page
-));
-$themes = array_slice( $themes, $start, $per_page );
-?>
-
-<div class="wrap">
-<?php screen_icon(); ?>
-<h2><a href="themes.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a><?php if ( current_user_can('install_themes') ) { ?><a href="theme-install.php" class="nav-tab"><?php echo esc_html_x('Install Themes', 'theme'); ?></a><?php } ?></h2>
+<div class="wrap"><?php
+screen_icon();
+if ( !is_multisite() ) : ?>
+<h2 class="nav-tab-wrapper">
+<a href="themes.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a>
+ <?php if ( current_user_can('install_themes') ) : ?>
+<a href="<?php echo admin_url( 'theme-install.php'); ?>" class="nav-tab"><?php echo esc_html_x('Install Themes', 'theme'); ?></a>
+ <?php endif;
+else : ?>
+<h2>
+<?php echo esc_html( $title ); ?>
+<?php endif; ?>
+</h2>
<h3><?php _e('Current Theme'); ?></h3>
<div id="current-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) ; ?></h4>
<p class="theme-description"><?php echo $ct->description; ?></p>
-<?php if ( current_user_can('edit_themes') && $ct->parent_theme ) { ?>
- <p><?php printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. 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); ?></p>
-<?php } else { ?>
- <p><?php printf(__('All of this theme’s files are located in <code>%2$s</code>.'), $ct->title, str_replace( WP_CONTENT_DIR, '', $ct->template_dir ), str_replace( WP_CONTENT_DIR, '', $ct->stylesheet_dir ) ); ?></p>
-<?php } ?>
-<?php if ( $ct->tags ) : ?>
-<p><?php _e('Tags:'); ?> <?php echo join(', ', $ct->tags); ?></p>
-<?php endif; ?>
+<div class="theme-options">
+ <span><?php _e( 'Options:' )?></span>
+ <?php
+ // Pretend you didn't see this.
+ $options = array();
+ if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) {
+ foreach ( (array) $submenu['themes.php'] as $item) {
+ $class = '';
+ if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] )
+ continue;
+ // 0 = name, 1 = capability, 2 = file
+ if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) ) $class = ' class="current"';
+
+ if ( !empty($submenu[$item[2]]) ) {
+ $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index.
+ $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]);
+ if ( file_exists(ABSPATH . PLUGINDIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook))
+ $options[] = "<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";
+ else
+ $options[] = "<a href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a>";
+ } else if ( current_user_can($item[1]) ) {
+ if ( file_exists(ABSPATH . 'wp-admin/' . $item[2]) ) {
+ $options[] = "<a href='{$item[2]}'$class>{$item[0]}</a>";
+ } else {
+ $options[] = "<a href='themes.php?page={$item[2]}'$class>{$item[0]}</a>";
+ }
+ }
+ }
+ }
+ echo implode ( ' | ', $options );
+
+ if ( $ct->tags ) : ?>
+ <p><?php _e('Tags:'); ?> <?php echo join(', ', $ct->tags); ?></p>
+ <?php endif; ?>
+</div>
<?php theme_update_available($ct); ?>
</div>
-<div class="clear"></div>
+<br class="clear" />
<?php
if ( ! current_user_can( 'switch_themes' ) ) {
echo '</div>';
exit;
}
?>
-<h3><?php _e('Available Themes'); ?></h3>
-<div class="clear"></div>
-
-<?php if ( $theme_total ) { ?>
-
-<?php if ( $page_links ) : ?>
-<div class="tablenav">
-<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
- number_format_i18n( $start + 1 ),
- number_format_i18n( min( $page * $per_page, $theme_total ) ),
- number_format_i18n( $theme_total ),
- $page_links
-); echo $page_links_text; ?></div>
-</div>
-<?php endif; ?>
-
-<table id="availablethemes" cellspacing="0" cellpadding="0">
-<?php
-$style = '';
-$theme_names = array_keys($themes);
-natcasesort($theme_names);
+<h3><?php _e('Available Themes'); ?></h3>
-$table = array();
-$rows = ceil(count($theme_names) / 3);
-for ( $row = 1; $row <= $rows; $row++ )
- for ( $col = 1; $col <= 3; $col++ )
- $table[$row][$col] = array_shift($theme_names);
+<?php if ( !empty( $_REQUEST['s'] ) || !empty( $_REQUEST['filter'] ) || $wp_list_table->has_items() ) : ?>
+
+<form class="search-form filter-form" action="" method="get">
+
+<p class="search-box">
+ <label class="screen-reader-text" for="theme-search-input"><?php _e('Search Themes'); ?>:</label>
+ <input type="text" id="theme-search-input" name="s" value="<?php _admin_search_query(); ?>" />
+ <?php submit_button( __( 'Search Themes' ), 'button', 'submit', false ); ?>
+ <a id="filter-click" href="?filter=1"><?php _e( 'Feature Filter' ); ?></a>
+</p>
+
+<br class="clear"/>
+
+<div id="filter-box" style="<?php if ( empty($_REQUEST['filter']) ) echo 'display: none;'; ?>">
+<?php $feature_list = get_theme_feature_list(); ?>
+ <div class="feature-filter">
+ <p class="install-help"><?php _e('Theme filters') ?></p>
+ <?php if ( !empty( $_REQUEST['filter'] ) ) : ?>
+ <input type="hidden" name="filter" value="1" />
+ <?php endif; ?>
+ <?php foreach ( $feature_list as $feature_name => $features ) :
+ $feature_name = esc_html( $feature_name ); ?>
+
+ <div class="feature-container">
+ <div class="feature-name"><?php echo $feature_name ?></div>
+
+ <ol class="feature-group">
+ <?php foreach ( $features as $key => $feature ) :
+ $feature_name = $feature;
+ $feature_name = esc_html( $feature_name );
+ $feature = esc_attr( $feature );
+ ?>
+ <li>
+ <input type="checkbox" name="features[]" id="feature-id-<?php echo $key; ?>" value="<?php echo $key; ?>" <?php checked( in_array( $key, $wp_list_table->features ) ); ?>/>
+ <label for="feature-id-<?php echo $key; ?>"><?php echo $feature_name; ?></label>
+ </li>
+ <?php endforeach; ?>
+ </ol>
+ </div>
+ <?php endforeach; ?>
+
+ <div class="feature-container">
+ <?php submit_button( __( 'Apply Filters' ), 'button-secondary submitter', 'submit', false, array( 'style' => 'margin-left: 120px' ) ); ?>
+
+ <small><a id="mini-filter-click" href="<?php echo esc_url( remove_query_arg( array('filter', 'features', 'submit') ) ); ?>"><?php _e( 'Close filters' )?></a></small>
+ </div>
+ <br/>
+ </div>
+ <br class="clear"/>
+</div>
-foreach ( $table as $row => $cols ) {
-?>
-<tr>
-<?php
-foreach ( $cols as $col => $theme_name ) {
- $class = array('available-theme');
- if ( $row == 1 ) $class[] = 'top';
- if ( $col == 1 ) $class[] = 'left';
- if ( $row == $rows ) $class[] = 'bottom';
- if ( $col == 3 ) $class[] = 'right';
-?>
- <td class="<?php echo join(' ', $class); ?>">
-<?php if ( !empty($theme_name) ) :
- $template = $themes[$theme_name]['Template'];
- $stylesheet = $themes[$theme_name]['Stylesheet'];
- $title = $themes[$theme_name]['Title'];
- $version = $themes[$theme_name]['Version'];
- $description = $themes[$theme_name]['Description'];
- $author = $themes[$theme_name]['Author'];
- $screenshot = $themes[$theme_name]['Screenshot'];
- $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
- $template_dir = $themes[$theme_name]['Template Dir'];
- $parent_theme = $themes[$theme_name]['Parent Theme'];
- $theme_root = $themes[$theme_name]['Theme Root'];
- $theme_root_uri = $themes[$theme_name]['Theme Root URI'];
- $preview_link = esc_url(get_option('home') . '/');
- if ( is_ssl() )
- $preview_link = str_replace( 'http://', 'https://', $preview_link );
- $preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), $preview_link ) );
- $preview_text = esc_attr( sprintf( __('Preview of “%s”'), $title ) );
- $tags = $themes[$theme_name]['Tags'];
- $thickbox_class = 'thickbox thickbox-preview';
- $activate_link = wp_nonce_url("themes.php?action=activate&template=".urlencode($template)."&stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template);
- $activate_text = esc_attr( sprintf( __('Activate “%s”'), $title ) );
- $actions = array();
- $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' . $activate_text . '">' . __('Activate') . '</a>';
- $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview “%s”'), $theme_name)) . '">' . __('Preview') . '</a>';
- if ( current_user_can('delete_themes') )
- $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&template=$stylesheet", 'delete-theme_' . $stylesheet) . '" onclick="' . "return confirm('" . esc_js(sprintf( __("You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete."), $theme_name )) . "');" . '">' . __('Delete') . '</a>';
- $actions = apply_filters('theme_action_links', $actions, $themes[$theme_name]);
-
- $actions = implode ( ' | ', $actions );
-?>
- <a href="<?php echo $preview_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
-<?php if ( $screenshot ) : ?>
- <img src="<?php echo $theme_root_uri . '/' . $stylesheet . '/' . $screenshot; ?>" alt="" />
-<?php endif; ?>
- </a>
-<h3><?php
- /* translators: 1: theme title, 2: theme version, 3: theme author */
- printf(__('%1$s %2$s by %3$s'), $title, $version, $author) ; ?></h3>
-<p class="description"><?php echo $description; ?></p>
-<span class='action-links'><?php echo $actions ?></span>
- <?php if ( current_user_can('edit_themes') && $parent_theme ) {
- /* translators: 1: theme title, 2: template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */ ?>
- <p><?php printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. 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); ?></p>
-<?php } else { ?>
- <p><?php printf(__('All of this theme’s files are located in <code>%2$s</code>.'), $title, str_replace( WP_CONTENT_DIR, '', $template_dir ), str_replace( WP_CONTENT_DIR, '', $stylesheet_dir ) ); ?></p>
-<?php } ?>
-<?php if ( $tags ) : ?>
-<p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p>
-<?php endif; ?>
- <?php theme_update_available( $themes[$theme_name] ); ?>
-<?php endif; // end if not empty theme_name ?>
- </td>
-<?php } // end foreach $cols ?>
-</tr>
-<?php } // end foreach $table ?>
-</table>
-<?php } else { ?>
-<p><?php
- if ( current_user_can('install_themes') )
- printf(__('You only have one theme installed right now. Live a little! You can choose from over 1,000 free themes in the WordPress.org Theme Directory at any time: just click on the <em><a href="%s">Install Themes</a></em> 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'));
- ?></p>
-<?php } // end if $theme_total?>
<br class="clear" />
-<?php if ( $page_links ) : ?>
-<div class="tablenav">
-<?php echo "<div class='tablenav-pages'>$page_links_text</div>"; ?>
-<br class="clear" />
-</div>
<?php endif; ?>
+<?php $wp_list_table->display(); ?>
+
+</form>
<br class="clear" />
<?php
if ( current_user_can('edit_themes') && count( $broken_themes ) ) {
?>
-<h2><?php _e('Broken Themes'); ?> <?php if ( is_multisite() ) _e( '(Site admin only)' ); ?></h2>
+<h3><?php _e('Broken Themes'); ?></h3>
<p><?php _e('The following themes are installed but incomplete. Themes must have a stylesheet and a template.'); ?></p>
<table id="broken-themes">
$title = __('Tools');
add_contextual_help($current_screen,
- '<p>' . __('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.') . '</p>' .
+ '<p>' . __('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. Clicking on it while on another website opens a popup window with all these options.') . '</p>' .
+ '<p>' . __('The Use This link for the Categories and Tags Converter will take you to the Import page, where that Converter is one of the plugins you can download. Once installed, the link on this page takes you to a screen where you can choose conversion either way.') . '</p>' .
'<p>' . __('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.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Tools_Tools_SubPanel" target="_blank">Tools Documentation</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Tools_Tools_SubPanel" target="_blank">Documentation on Tools</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
/** WordPress Administration Bootstrap */
require_once('./admin.php');
-if ( ! current_user_can('update_plugins') )
- wp_die(__('You do not have sufficient permissions to update plugins for this site.'));
+if ( is_multisite() && ! is_network_admin() ) {
+ wp_redirect( network_admin_url( 'update-core.php' ) );
+ exit();
+}
+
+if ( ! current_user_can( 'update_core' ) )
+ wp_die( __( 'You do not have sufficient permissions to update this site.' ) );
function list_core_update( $update ) {
global $wp_local_package, $wpdb;
echo '<input name="version" value="'. esc_attr($update->current) .'" type="hidden"/>';
echo '<input name="locale" value="'. esc_attr($update->locale) .'" type="hidden"/>';
if ( $show_buttons ) {
- echo '<input id="upgrade" class="button" type="submit" value="' . esc_attr($submit) . '" name="upgrade" /> ';
- echo '<a href="' . esc_url($update->package) . '" class="button">' . $download . '</a> ';
+ submit_button( $submit, 'button', 'upgrade', false );
+ echo ' <a href="' . esc_url($update->package) . '" class="button">' . $download . '</a> ';
}
if ( 'en_US' != $update->locale )
if ( !isset( $update->dismissed ) || !$update->dismissed )
- echo '<input id="dismiss" class="button" type="submit" value="' . esc_attr__('Hide this update') . '" name="dismiss" />';
+ submit_button( __('Hide this update'), 'button', 'dismiss', false );
else
- echo '<input id="undismiss" class="button" type="submit" value="' . esc_attr__('Bring back this update') . '" name="undismiss" />';
+ submit_button( __('Bring back this update'), 'button', 'undismiss', false );
echo '</p>';
if ( 'en_US' != $update->locale && ( !isset($wp_local_package) || $wp_local_package != $update->locale ) )
echo '<p class="hint">'.__('This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.').'</p>';
else if ( 'en_US' == $update->locale && get_locale() != 'en_US' ) {
- echo '<p class="hint">'.sprintf( __('You are about to install WordPress %s <strong>in English.</strong> There is a chance this upgrade will break your translation. You may prefer to wait for the localized version to be released.'), $update->current ).'</p>';
+ echo '<p class="hint">'.sprintf( __('You are about to install WordPress %s <strong>in English (US).</strong> There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.'), $update->current ).'</p>';
}
echo '</form>';
<?php
if ( $upgrade_error ) {
echo '<div class="error"><p>';
- _e('Please select one or more plugins to upgrade.');
+ if ( $upgrade_error == 'themes' )
+ _e('Please select one or more themes to update.');
+ else
+ _e('Please select one or more plugins to update.');
echo '</p></div>';
}
+ echo '<p>';
+ /* translators: %1 date, %2 time. */
+ printf( __('Last checked on %1$s at %2$s.'), date_i18n( get_option( 'date_format' ) ), date_i18n( get_option( 'time_format' ) ) );
+ echo ' <a class="button" href="' . esc_url( self_admin_url('update-core.php') ) . '">' . __( 'Check Again' ) . '</a>';
+ echo '</p>';
+
if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) {
echo '<h3>';
_e('You have the latest version of WordPress.');
echo '</h3>';
} else {
- echo '<div class="updated"><p>';
- _e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">backup your database and files</a>. For help with updates, visit the <a href="http://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
+ echo '<div class="updated inline"><p>';
+ _e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="http://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
echo '</p></div>';
echo '<h3 class="response">';
echo '<ul class="core-updates">';
$alternate = true;
foreach( (array) $updates as $update ) {
- $class = $alternate? ' class="alternate"' : '';
- $alternate = !$alternate;
- echo "<li $class>";
+ echo '<li>';
list_core_update( $update );
echo '</li>';
}
echo '<p>' . __( '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.' ) . '</p>';
dismissed_updates();
- list_plugin_updates();
- list_theme_updates();
+ if ( current_user_can( 'update_plugins' ) )
+ list_plugin_updates();
+ if ( current_user_can( 'update_themes' ) )
+ list_theme_updates();
do_action('core_upgrade_preamble');
echo '</div>';
}
echo "
<tr class='active'>
<th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th>
- <td class='plugin-title'><strong>{$plugin_data->Name}</strong>" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "</td>
+ <td><strong>{$plugin_data->Name}</strong><br />" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "</td>
</tr>";
}
?>
?>
<h3><?php _e( 'Themes' ); ?></h3>
<p><?php _e( 'The following themes have new versions available. Check the ones you want to update and then click “Update Themes”.' ); ?></p>
-<p><?php printf( __('<strong>Please Note:</strong> Any customizations you have made to the Themes files will be lost. Please consider using <a href="%s">child themes</a> for modifications.'), _x('http://codex.wordpress.org/Child_Themes', 'Link used in suggestion to use child themes in GUU') ); ?></p>
+<p><?php printf( __('<strong>Please Note:</strong> Any customizations you have made to theme files will be lost. Please consider using <a href="%s">child themes</a> for modifications.'), _x('http://codex.wordpress.org/Child_Themes', 'Link used in suggestion to use child themes in GUU') ); ?></p>
<form method="post" action="<?php echo $form_action; ?>" name="upgrade-themes" class="upgrade">
<?php wp_nonce_field('upgrade-core'); ?>
<p><input id="upgrade-themes" class="button" type="submit" value="<?php esc_attr_e('Update Themes'); ?>" name="upgrade" /></p>
}
?>
<div class="wrap">
- <?php screen_icon(); ?>
+ <?php screen_icon('tools'); ?>
<h2><?php _e('Update WordPress'); ?></h2>
<?php
if ( $wp_filesystem->errors->get_error_code() ) {
show_message( __('Installation Failed') );
} else {
show_message( __('WordPress updated successfully') );
- show_message( '<strong>' . __('Actions:') . '</strong> <a href="' . esc_url( admin_url() ) . '">' . __('Go to Dashboard') . '</a>' );
+ show_message( '<a href="' . esc_url( self_admin_url() ) . '">' . __('Go to Dashboard') . '</a>' );
}
echo '</div>';
}
return;
dismiss_core_update( $update );
wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') );
+ exit;
}
function do_undismiss_core_update() {
return;
undismiss_core_update( $version, $locale );
wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') );
+ exit;
}
function no_update_actions($actions) {
$action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
$upgrade_error = false;
-if ( 'do-plugin-upgrade' == $action && !isset($_GET['plugins']) && !isset($_POST['checked']) ) {
- $upgrade_error = true;
+if ( ( 'do-theme-upgrade' == $action || ( 'do-plugin-upgrade' == $action && ! isset( $_GET['plugins'] ) ) )
+ && ! isset( $_POST['checked'] ) ) {
+ $upgrade_error = $action == 'do-theme-upgrade' ? 'themes' : 'plugins';
$action = 'upgrade-core';
}
add_contextual_help($current_screen,
'<p>' . __('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.') . '</p>' .
'<p>' . __('Updating your WordPress installation is a simple one-click procedure; just click on the Update button when it says a new version is available.') . '</p>' .
- '<p>' . __('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.') . '</p>' .
+ '<p>' . __('To update 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.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Dashboard_Updates_SubPanel" target="_blank">Documentation on Updating WordPress</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
if ( 'upgrade-core' == $action ) {
+
wp_version_check();
- require_once('./admin-header.php');
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
core_upgrade_preamble();
+
} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
check_admin_referer('upgrade-core');
elseif ( isset( $_POST['undismiss'] ) )
do_undismiss_core_update();
- require_once('./admin-header.php');
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
if ( 'do-core-reinstall' == $action )
$reinstall = true;
else
do_core_upgrade($reinstall);
} elseif ( 'do-plugin-upgrade' == $action ) {
+
+ if ( ! current_user_can( 'update_plugins' ) )
+ wp_die( __( 'You do not have sufficient permissions to update this site.' ) );
+
check_admin_referer('upgrade-core');
if ( isset( $_GET['plugins'] ) ) {
} elseif ( isset( $_POST['checked'] ) ) {
$plugins = (array) $_POST['checked'];
} else {
- wp_redirect('update-core.php');
+ wp_redirect( admin_url('update-core.php') );
exit;
}
$title = __('Update Plugins');
- require_once('./admin-header.php');
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
echo '<div class="wrap">';
screen_icon('plugins');
echo '<h2>' . esc_html__('Update Plugins') . '</h2>';
echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>";
echo '</div>';
+
} elseif ( 'do-theme-upgrade' == $action ) {
+
+ if ( ! current_user_can( 'update_themes' ) )
+ wp_die( __( 'You do not have sufficient permissions to update this site.' ) );
+
check_admin_referer('upgrade-core');
if ( isset( $_GET['themes'] ) ) {
} elseif ( isset( $_POST['checked'] ) ) {
$themes = (array) $_POST['checked'];
} else {
- wp_redirect('update-core.php');
+ wp_redirect( admin_url('update-core.php') );
exit;
}
$title = __('Update Themes');
- require_once('./admin-header.php');
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
echo '<div class="wrap">';
screen_icon('themes');
echo '<h2>' . esc_html__('Update Themes') . '</h2>';
echo '</div>';
}
-include('./admin-footer.php');
+include(ABSPATH . 'wp-admin/admin-footer.php');
* @subpackage Administration
*/
+if ( ! defined( 'IFRAME_REQUEST' ) && isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'update-selected', 'activate-plugin', 'update-selected-themes' ) ) )
+ define( 'IFRAME_REQUEST', true );
+
/** WordPress Administration Bootstrap */
require_once('./admin.php');
$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();
check_admin_referer('upgrade-plugin_' . $plugin);
- $title = __('Upgrade Plugin');
+ $title = __('Update Plugin');
$parent_file = 'plugins.php';
$submenu_file = 'plugins.php';
- require_once('./admin-header.php');
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
$nonce = 'upgrade-plugin_' . $plugin;
$url = 'update.php?action=upgrade-plugin&plugin=' . $plugin;
$upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin( compact('title', 'nonce', 'url', 'plugin') ) );
$upgrader->upgrade($plugin);
- include('./admin-footer.php');
+ include(ABSPATH . 'wp-admin/admin-footer.php');
} elseif ('activate-plugin' == $action ) {
if ( ! current_user_can('update_plugins') )
check_admin_referer('activate-plugin_' . $plugin);
if ( ! isset($_GET['failure']) && ! isset($_GET['success']) ) {
- wp_redirect( 'update.php?action=activate-plugin&failure=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] );
- activate_plugin( $plugin, '', ! empty( $_GET['networkwide'] ) );
- wp_redirect( 'update.php?action=activate-plugin&success=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] );
+ wp_redirect( admin_url('update.php?action=activate-plugin&failure=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce']) );
+ activate_plugin( $plugin, '', ! empty( $_GET['networkwide'] ), true );
+ wp_redirect( admin_url('update.php?action=activate-plugin&success=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce']) );
die();
}
iframe_header( __('Plugin Reactivation'), true );
$title = __('Plugin Install');
$parent_file = 'plugins.php';
$submenu_file = 'plugin-install.php';
- require_once('./admin-header.php');
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
$title = sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version );
$nonce = 'install-plugin_' . $plugin;
$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
$upgrader->install($api->download_link);
- include('./admin-footer.php');
+ include(ABSPATH . 'wp-admin/admin-footer.php');
} elseif ( 'upload-plugin' == $action ) {
$title = __('Upload Plugin');
$parent_file = 'plugins.php';
$submenu_file = 'plugin-install.php';
- require_once('./admin-header.php');
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
$title = sprintf( __('Installing Plugin from uploaded file: %s'), basename( $file_upload->filename ) );
$nonce = 'plugin-upload';
$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) );
$upgrader->install( $file_upload->package );
- include('./admin-footer.php');
+ include(ABSPATH . 'wp-admin/admin-footer.php');
} elseif ( 'upgrade-theme' == $action ) {
add_thickbox();
wp_enqueue_script('theme-preview');
- $title = __('Upgrade Theme');
+ $title = __('Update Theme');
$parent_file = 'themes.php';
$submenu_file = 'themes.php';
- require_once('./admin-header.php');
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
$nonce = 'upgrade-theme_' . $theme;
$url = 'update.php?action=upgrade-theme&theme=' . $theme;
$upgrader = new Theme_Upgrader( new Theme_Upgrader_Skin( compact('title', 'nonce', 'url', 'theme') ) );
$upgrader->upgrade($theme);
- include('./admin-footer.php');
+ include(ABSPATH . 'wp-admin/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.' ) );
$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();
$title = __('Install Themes');
$parent_file = 'themes.php';
$submenu_file = 'themes.php';
- require_once('./admin-header.php');
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
$title = sprintf( __('Installing Theme: %s'), $api->name . ' ' . $api->version );
$nonce = 'install-theme_' . $theme;
$upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
$upgrader->install($api->download_link);
- include('./admin-footer.php');
+ include(ABSPATH . 'wp-admin/admin-footer.php');
} elseif ( 'upload-theme' == $action ) {
$submenu_file = 'theme-install.php';
add_thickbox();
wp_enqueue_script('theme-preview');
- require_once('./admin-header.php');
+ require_once(ABSPATH . 'wp-admin/admin-header.php');
$title = sprintf( __('Installing Theme from uploaded file: %s'), basename( $file_upload->filename ) );
$nonce = 'theme-upload';
$upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('type', 'title', 'nonce', 'url') ) );
$upgrader->install( $file_upload->package );
- include('./admin-footer.php');
+ include(ABSPATH . 'wp-admin/admin-footer.php');
} else {
do_action('update-custom_' . $action);
/**
* We are upgrading WordPress.
*
- * @since unknown
+ * @since 1.5.1
* @var bool
*/
define( 'WP_INSTALLING', true );
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" />
- <title><?php _e( 'WordPress › Upgrade' ); ?></title>
+ <title><?php _e( 'WordPress › Update' ); ?></title>
<?php
wp_admin_css( 'install', true );
wp_admin_css( 'ie', true );
<?php if ( get_option( 'db_version' ) == $wp_db_version || !is_blog_installed() ) : ?>
-<h2><?php _e( 'No Upgrade Required' ); ?></h2>
+<h2><?php _e( 'No Update Required' ); ?></h2>
<p><?php _e( 'Your WordPress database is already up-to-date!' ); ?></p>
<p class="step"><a class="button" href="<?php echo get_option( 'home' ); ?>/"><?php _e( 'Continue' ); ?></a></p>
<?php elseif ( !$php_compat || !$mysql_compat ) :
if ( !$mysql_compat && !$php_compat )
- printf( __('You cannot upgrade because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> 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 );
+ printf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> 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 <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version );
+ printf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> 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 <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version );
+ printf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version );
?>
<?php else :
switch ( $step ) :
$goback = esc_url_raw( $goback );
$goback = urlencode( $goback );
?>
-<h2><?php _e( 'Database Upgrade Required' ); ?></h2>
-<p><?php _e( 'WordPress has been updated! Before we send you on your way, we have to upgrade your database to the newest version.' ); ?></p>
-<p><?php _e( 'The upgrade process may take a little while, so please be patient.' ); ?></p>
-<p class="step"><a class="button" href="upgrade.php?step=1&backto=<?php echo $goback; ?>"><?php _e( 'Upgrade WordPress Database' ); ?></a></p>
+<h2><?php _e( 'Database Update Required' ); ?></h2>
+<p><?php _e( 'WordPress has been updated! Before we send you on your way, we have to update your database to the newest version.' ); ?></p>
+<p><?php _e( 'The update process may take a little while, so please be patient.' ); ?></p>
+<p class="step"><a class="button" href="upgrade.php?step=1&backto=<?php echo $goback; ?>"><?php _e( 'Update WordPress Database' ); ?></a></p>
<?php
break;
case 1:
wp_upgrade();
$backto = !empty($_GET['backto']) ? stripslashes( urldecode( $_GET['backto'] ) ) : __get_option( 'home' ) . '/';
- $backto = esc_url( $backto );
+ $backto = esc_url_raw( $backto );
$backto = wp_validate_redirect($backto, __get_option( 'home' ) . '/');
?>
-<h2><?php _e( 'Upgrade Complete' ); ?></h2>
- <p><?php _e( 'Your WordPress database has been successfully upgraded!' ); ?></p>
+<h2><?php _e( 'Update Complete' ); ?></h2>
+ <p><?php _e( 'Your WordPress database has been successfully updated!' ); ?></p>
<p class="step"><a class="button" href="<?php echo $backto; ?>"><?php _e( 'Continue' ); ?></a></p>
<!--
*/
/** WordPress Administration Bootstrap */
-require_once('./admin.php');
-wp_enqueue_script( 'wp-ajax-response' );
-wp_enqueue_script( 'jquery-ui-draggable' );
+require_once( './admin.php' );
if ( !current_user_can('upload_files') )
- wp_die(__('You do not have permission to upload files.'));
-
-if ( isset($_GET['find_detached']) ) {
- check_admin_referer('bulk-media');
-
- if ( !current_user_can('edit_posts') )
- wp_die( __('You are not allowed to scan for lost attachments.') );
-
- $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 ) ) ) . "') )");
-
- $_GET['detached'] = 1;
-
-} elseif ( isset($_GET['found_post_id']) && isset($_GET['media']) ) {
- check_admin_referer('bulk-media');
-
- if ( ! ( $parent_id = (int) $_GET['found_post_id'] ) )
- return;
-
- $parent = &get_post($parent_id);
- if ( !current_user_can('edit_post', $parent_id) )
- wp_die( __('You are not allowed to edit this post.') );
-
- $attach = array();
- foreach( (array) $_GET['media'] as $att_id ) {
- $att_id = (int) $att_id;
+ wp_die( __( 'You do not have permission to upload files.' ) );
- if ( !current_user_can('edit_post', $att_id) )
- continue;
+$wp_list_table = _get_list_table('WP_Media_List_Table');
+$pagenum = $wp_list_table->get_pagenum();
- $attach[] = $att_id;
- clean_attachment_cache($att_id);
- }
-
- if ( ! empty($attach) ) {
- $attach = implode(',', $attach);
- $attached = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = %d WHERE post_type = 'attachment' AND ID IN ($attach)", $parent_id) );
- }
-
- if ( isset($attached) ) {
- $location = 'upload.php';
- if ( $referer = wp_get_referer() ) {
- if ( false !== strpos($referer, 'upload.php') )
- $location = $referer;
- }
-
- $location = add_query_arg( array( 'attached' => $attached ) , $location );
- wp_redirect($location);
- exit;
- }
+// Handle bulk actions
+$doaction = $wp_list_table->current_action();
-} elseif ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
+if ( $doaction ) {
check_admin_referer('bulk-media');
- if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
+ if ( 'delete_all' == $doaction ) {
$post_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type='attachment' AND post_status = 'trash'" );
$doaction = 'delete';
- } elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['media']) || isset($_GET['ids']) ) ) {
- $post_ids = isset($_GET['media']) ? $_GET['media'] : explode(',', $_GET['ids']);
- $doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
- } else {
- wp_redirect($_SERVER['HTTP_REFERER']);
+ } elseif ( isset( $_REQUEST['media'] ) ) {
+ $post_ids = $_REQUEST['media'];
+ } elseif ( isset( $_REQUEST['ids'] ) ) {
+ $post_ids = explode( ',', $_REQUEST['ids'] );
}
$location = 'upload.php';
if ( $referer = wp_get_referer() ) {
- if ( false !== strpos($referer, 'upload.php') )
- $location = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'message', 'ids', 'posted'), $referer );
+ if ( false !== strpos( $referer, 'upload.php' ) )
+ $location = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'message', 'ids', 'posted' ), $referer );
}
switch ( $doaction ) {
+ case 'find_detached':
+ if ( !current_user_can('edit_posts') )
+ wp_die( __('You are not allowed to scan for lost attachments.') );
+
+ $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 ) ) ) . "' )
+ )
+ " );
+
+ $_REQUEST['detached'] = 1;
+ break;
+ case 'attach':
+ $parent_id = (int) $_REQUEST['found_post_id'];
+ if ( !$parent_id )
+ return;
+
+ $parent = &get_post( $parent_id );
+ if ( !current_user_can( 'edit_post', $parent_id ) )
+ wp_die( __( 'You are not allowed to edit this post.' ) );
+
+ $attach = array();
+ foreach ( (array) $_REQUEST['media'] as $att_id ) {
+ $att_id = (int) $att_id;
+
+ if ( !current_user_can( 'edit_post', $att_id ) )
+ continue;
+
+ $attach[] = $att_id;
+ clean_attachment_cache( $att_id );
+ }
+
+ if ( ! empty( $attach ) ) {
+ $attach = implode( ',', $attach );
+ $attached = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_parent = %d WHERE post_type = 'attachment' AND ID IN ( $attach )", $parent_id ) );
+ }
+
+ if ( isset( $attached ) ) {
+ $location = 'upload.php';
+ if ( $referer = wp_get_referer() ) {
+ if ( false !== strpos( $referer, 'upload.php' ) )
+ $location = $referer;
+ }
+
+ $location = add_query_arg( array( 'attached' => $attached ) , $location );
+ wp_redirect( $location );
+ exit;
+ }
+ break;
case 'trash':
- 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.') );
+ 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 ( !wp_trash_post($post_id) )
- wp_die( __('Error in moving to trash...') );
+ if ( !wp_trash_post( $post_id ) )
+ wp_die( __( 'Error in moving to trash...' ) );
}
- $location = add_query_arg( array( 'trashed' => count($post_ids), '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 ) {
- if ( !current_user_can('delete_post', $post_id) )
- wp_die( __('You are not allowed to move this post out of the trash.') );
+ 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 out of the trash.' ) );
- if ( !wp_untrash_post($post_id) )
- wp_die( __('Error in restoring from trash...') );
+ if ( !wp_untrash_post( $post_id ) )
+ wp_die( __( 'Error in restoring from trash...' ) );
}
- $location = add_query_arg('untrashed', count($post_ids), $location);
+ $location = add_query_arg( 'untrashed', count( $post_ids ), $location );
break;
case 'delete':
- foreach( (array) $post_ids as $post_id_del ) {
- if ( !current_user_can('delete_post', $post_id_del) )
- wp_die( __('You are not allowed to delete this post.') );
+ foreach ( (array) $post_ids as $post_id_del ) {
+ if ( !current_user_can( 'delete_post', $post_id_del ) )
+ wp_die( __( 'You are not allowed to delete this post.' ) );
- if ( !wp_delete_attachment($post_id_del) )
- wp_die( __('Error in deleting...') );
+ if ( !wp_delete_attachment( $post_id_del ) )
+ wp_die( __( 'Error in deleting...' ) );
}
- $location = add_query_arg('deleted', count($post_ids), $location);
+ $location = add_query_arg( 'deleted', count( $post_ids ), $location );
break;
}
- wp_redirect($location);
+ wp_redirect( $location );
exit;
-} elseif ( ! empty($_GET['_wp_http_referer']) ) {
- wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
+} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
+ wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
exit;
}
-$title = __('Media Library');
-$parent_file = 'upload.php';
-
-if ( ! isset( $_GET['paged'] ) || $_GET['paged'] < 1 )
- $_GET['paged'] = 1;
-
-if ( isset($_GET['detached']) ) {
-
- $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 );
-
- if ( !empty($lost) ) {
- $start = ( (int) $_GET['paged'] - 1 ) * $media_per_page;
- $page_links_total = ceil(count($lost) / $media_per_page);
- $lost = implode(',', $lost);
-
- $orphans = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_type = 'attachment' AND ID IN (%s) LIMIT %d, %d", $lost, $start, $media_per_page ) );
- } 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 ) );
- $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();
- $avail_post_mime_types = get_available_post_mime_types('attachment');
-
- if ( isset($_GET['post_mime_type']) && !array_intersect( (array) $_GET['post_mime_type'], array_keys($post_mime_types) ) )
- unset($_GET['post_mime_type']);
+$wp_list_table->prepare_items();
-} else {
- list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
+$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
}
-$is_trash = ( isset($_GET['status']) && $_GET['status'] == 'trash' );
+$title = __('Media Library');
+$parent_file = 'upload.php';
+
+wp_enqueue_script( 'wp-ajax-response' );
+wp_enqueue_script( 'jquery-ui-draggable' );
+wp_enqueue_script( 'media' );
-wp_enqueue_script('media');
+add_screen_option( 'per_page', array('label' => _x( 'Media items', 'items per page (screen options)' )) );
add_contextual_help( $current_screen,
- '<p>' . __('All the files you’ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the <em>Screen Options</em> tab to customize the display of this screen.') . '</p>' .
- '<p>' . __('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.') . '</p>' .
- '<p>' . __('Hovering over a row reveals action links: <em>Edit</em>, <em>Delete Permanently</em>, and <em>View</em>. Clicking <em>Edit</em> or on the media file’s name displays a simple screen to edit that individual file’s metadata. Clicking <em>Delete Permanently</em> will delete the file from the media library (as well as from any posts to which it is currently attached). <em>View</em> will take you to the display page for that file.') . '</p>' .
- '<p>' . __('If a media file has not been attached to any post, you will see that in the <em>Attached To</em> column, and can click on <em>Attach File</em> to launch a small popup that will allow you to search for a post and attach the file.') . '</p>' .
- '<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Media_Library_SubPanel" target="_blank">Media Library Documentation</a>') . '</p>' .
- '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+ '<p>' . __( 'All the files you’ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the <em>Screen Options</em> tab to customize the display of this screen.' ) . '</p>' .
+ '<p>' . __( '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.' ) . '</p>' .
+ '<p>' . __( 'Hovering over a row reveals action links: <em>Edit</em>, <em>Delete Permanently</em>, and <em>View</em>. Clicking <em>Edit</em> or on the media file’s name displays a simple screen to edit that individual file’s metadata. Clicking <em>Delete Permanently</em> will delete the file from the media library (as well as from any posts to which it is currently attached). <em>View</em> will take you to the display page for that file.' ) . '</p>' .
+ '<p>' . __( 'If a media file has not been attached to any post, you will see that in the <em>Attached To</em> column, and can click on <em>Attach File</em> to launch a small popup that will allow you to search for a post and attach the file.' ) . '</p>' .
+ '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
+ '<p>' . __( '<a href="http://codex.wordpress.org/Media_Library_SubPanel" target="_blank">Documentation on Media Library</a>' ) . '</p>' .
+ '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
);
require_once('./admin-header.php');
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?> <a href="media-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a> <?php
-if ( isset($_GET['s']) && $_GET['s'] )
+if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() ); ?>
</h2>
<div id="message" class="updated"><p><?php echo $message; ?></p></div>
<?php } ?>
-<ul class="subsubsub">
-<?php
-$type_links = array();
-$_num_posts = (array) wp_count_attachments();
-$_total_posts = array_sum($_num_posts) - $_num_posts['trash'];
-if ( !isset( $total_orphans ) )
- $total_orphans = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1" );
-$matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
-foreach ( $matches as $type => $reals )
- foreach ( $reals as $real )
- $num_posts[$type] = ( isset( $num_posts[$type] ) ) ? $num_posts[$type] + $_num_posts[$real] : $_num_posts[$real];
-
-$class = ( empty($_GET['post_mime_type']) && !isset($_GET['detached']) && !isset($_GET['status']) ) ? ' class="current"' : '';
-$type_links[] = "<li><a href='upload.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $_total_posts, 'uploaded files' ), number_format_i18n( $_total_posts ) ) . '</a>';
-foreach ( $post_mime_types as $mime_type => $label ) {
- $class = '';
-
- if ( !wp_match_mime_types($mime_type, $avail_post_mime_types) )
- continue;
-
- if ( !empty($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
- $class = ' class="current"';
- if ( !empty( $num_posts[$mime_type] ) )
- $type_links[] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';
-}
-$type_links[] = '<li><a href="upload.php?detached=1"' . ( isset($_GET['detached']) ? ' class="current"' : '' ) . '>' . sprintf( _nx( 'Unattached <span class="count">(%s)</span>', 'Unattached <span class="count">(%s)</span>', $total_orphans, 'detached files' ), number_format_i18n( $total_orphans ) ) . '</a>';
-
-if ( !empty($_num_posts['trash']) )
- $type_links[] = '<li><a href="upload.php?status=trash"' . ( (isset($_GET['status']) && $_GET['status'] == 'trash' ) ? ' class="current"' : '') . '>' . sprintf( _nx( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '</a>';
-
-echo implode( " |</li>\n", $type_links) . '</li>';
-unset($type_links);
-?>
-</ul>
-
-<form class="search-form" action="" method="get">
-<p class="search-box">
- <label class="screen-reader-text" for="media-search-input"><?php _e( 'Search Media' ); ?>:</label>
- <input type="text" id="media-search-input" name="s" value="<?php the_search_query(); ?>" />
- <input type="submit" value="<?php esc_attr_e( 'Search Media' ); ?>" class="button" />
-</p>
-</form>
+<?php $wp_list_table->views(); ?>
<form id="posts-filter" action="" method="get">
-<?php wp_nonce_field('bulk-media'); ?>
-<?php if ( have_posts() || isset( $orphans ) ) { ?>
-<div class="tablenav">
-<?php
-if ( ! isset($page_links_total) )
- $page_links_total = $wp_query->max_num_pages;
-
-$page_links = paginate_links( array(
- 'base' => add_query_arg( 'paged', '%#%' ),
- 'format' => '',
- 'prev_text' => __('«'),
- 'next_text' => __('»'),
- 'total' => $page_links_total,
- 'current' => $_GET['paged']
-));
-
-if ( $page_links ) : ?>
-<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%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; ?></div>
-<?php endif; ?>
-
-<div class="alignleft actions">
-<?php if ( ! isset( $orphans ) || ! empty( $orphans ) ) { ?>
-<select name="action" class="select-action">
-<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<?php if ( $is_trash ) { ?>
-<option value="untrash"><?php _e('Restore'); ?></option>
-<?php } if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) { ?>
-<option value="delete"><?php _e('Delete Permanently'); ?></option>
-<?php } else { ?>
-<option value="trash"><?php _e('Move to Trash'); ?></option>
-<?php } if ( isset($orphans) ) { ?>
-<option value="attach"><?php _e('Attach to a post'); ?></option>
-<?php } ?>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
-
-<?php
-if ( !is_singular() && !isset($_GET['detached']) && !$is_trash ) {
- $arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC";
-
- $arc_result = $wpdb->get_results( $arc_query );
-
- $month_count = count($arc_result);
-
- if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) : ?>
-<select name='m'>
-<option value='0'><?php _e('Show all dates'); ?></option>
-<?php
-foreach ($arc_result as $arc_row) {
- if ( $arc_row->yyear == 0 )
- continue;
- $arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
-
- if ( isset($_GET['m']) && ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] ) )
- $default = ' selected="selected"';
- else
- $default = '';
-
- echo "<option$default value='" . esc_attr("$arc_row->yyear$arc_row->mmonth") . "'>";
- echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";
- echo "</option>\n";
-}
-?>
-</select>
-<?php endif; // month_count ?>
-
-<?php do_action('restrict_manage_posts'); ?>
-
-<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
-
-<?php } // ! is_singular ?>
-
-<?php
-
-} // ! empty( $orphans )
-
-if ( isset($_GET['detached']) ) { ?>
- <input type="submit" id="find_detached" name="find_detached" value="<?php esc_attr_e('Scan for lost attachments'); ?>" class="button-secondary" />
-<?php } elseif ( isset($_GET['status']) && $_GET['status'] == 'trash' && current_user_can('edit_others_posts') ) { ?>
- <input type="submit" id="delete_all" name="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
-<?php } ?>
-
-</div>
-
-<br class="clear" />
-</div>
-
-<?php } // have_posts() || !empty( $orphans ) ?>
-
-<div class="clear"></div>
-
-<?php if ( ! empty( $orphans ) ) { ?>
-<table class="widefat" cellspacing="0">
-<thead>
-<tr>
- <th scope="col" class="check-column"><input type="checkbox" /></th>
- <th scope="col"></th>
- <th scope="col"><?php /* translators: column name in media */ _ex('Media', 'media column name'); ?></th>
- <th scope="col"><?php /* translators: column name in media */ _ex('Author', 'media column name'); ?></th>
- <th scope="col"><?php /* translators: column name in media */ _ex('Date Added', 'media column name'); ?></th>
-</tr>
-</thead>
-
-<tfoot>
-<tr>
- <th scope="col" class="check-column"><input type="checkbox" /></th>
- <th scope="col"></th>
- <th scope="col"><?php /* translators: column name in media */ _ex('Media', 'media column name'); ?></th>
- <th scope="col"><?php /* translators: column name in media */ _ex('Author', 'media column name'); ?></th>
- <th scope="col"><?php /* translators: column name in media */ _ex('Date Added', 'media column name'); ?></th>
-</tr>
-</tfoot>
-
-<tbody id="the-list" class="list:post">
-<?php
- foreach ( $orphans as $post ) {
- $class = 'alternate' == $class ? '' : 'alternate';
- $att_title = esc_html( _draft_or_post_title($post->ID) );
-?>
- <tr id='post-<?php echo $post->ID; ?>' class='<?php echo $class; ?>' valign="top">
- <th scope="row" class="check-column"><?php if ( current_user_can('edit_post', $post->ID) ) { ?><input type="checkbox" name="media[]" value="<?php echo esc_attr($post->ID); ?>" /><?php } ?></th>
-
- <td class="media-icon"><?php
- if ( $thumb = wp_get_attachment_image( $post->ID, array(80, 60), true ) ) { ?>
- <a href="media.php?action=edit&attachment_id=<?php echo $post->ID; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $thumb; ?></a>
-<?php } ?></td>
-
- <td class="media column-media"><strong><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />
- <?php
- if ( preg_match( '/^.*?\.(\w+)$/', get_attached_file( $post->ID ), $matches ) )
- echo esc_html( strtoupper( $matches[1] ) );
- else
- echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) );
- ?>
-
- <div class="row-actions">
- <?php
- $actions = array();
- if ( current_user_can('edit_post', $post->ID) )
- $actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
- if ( current_user_can('delete_post', $post->ID) )
- if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) {
- $actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-attachment_' . $post->ID) . "'>" . __('Trash') . "</a>";
- } else {
- $delete_ays = !MEDIA_TRASH ? " onclick='return showNotice.warn();'" : '';
- $actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-attachment_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
- }
- $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
- if ( current_user_can('edit_post', $post->ID) )
- $actions['attach'] = '<a href="#the-list" onclick="findPosts.open(\'media[]\',\''.$post->ID.'\');return false;" class="hide-if-no-js">'.__('Attach').'</a>';
- $actions = apply_filters( 'media_row_actions', $actions, $post );
- $action_count = count($actions);
- $i = 0;
- foreach ( $actions as $action => $link ) {
- ++$i;
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
- echo "<span class='$action'>$link$sep</span>";
- } ?>
- </div></td>
- <td class="author column-author"><?php $author = get_userdata($post->post_author); echo $author->display_name; ?></td>
-<?php if ( '0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name ) {
- $t_time = $h_time = __('Unpublished');
- } else {
- $t_time = get_the_time(__('Y/m/d g:i:s A'));
- $m_time = $post->post_date;
- $time = get_post_time( 'G', true );
- if ( ( abs($t_diff = time() - $time) ) < 86400 ) {
- if ( $t_diff < 0 )
- $h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
- else
- $h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
- } else {
- $h_time = mysql2date(__('Y/m/d'), $m_time);
- }
- } ?>
- <td class="date column-date"><?php echo $h_time ?></td>
- </tr>
-<?php } ?>
-</tbody>
-</table>
-<?php
+<?php $wp_list_table->search_box( __( 'Search Media' ), 'media' ); ?>
-} else {
- include( './edit-attachment-rows.php' );
-} ?>
+<?php $wp_list_table->display(); ?>
<div id="ajax-response"></div>
-
-<div class="tablenav">
-
-<?php
-if ( have_posts() || ! empty( $orphans ) ) {
-
-if ( $page_links )
- echo "<div class='tablenav-pages'>$page_links_text</div>";
-?>
-
-<div class="alignleft actions">
-<select name="action2" class="select-action">
-<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<?php if ($is_trash) { ?>
-<option value="untrash"><?php _e('Restore'); ?></option>
-<?php } if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) { ?>
-<option value="delete"><?php _e('Delete Permanently'); ?></option>
-<?php } else { ?>
-<option value="trash"><?php _e('Move to Trash'); ?></option>
-<?php } if (isset($orphans)) { ?>
-<option value="attach"><?php _e('Attach to a post'); ?></option>
-<?php } ?>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
-
-<?php if ( isset($_GET['status']) && $_GET['status'] == 'trash' && current_user_can('edit_others_posts') ) { ?>
- <input type="submit" id="delete_all2" name="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
-<?php } ?>
-</div>
-
-<?php } ?>
-<br class="clear" />
-</div>
<?php find_posts_div(); ?>
-</form>
<br class="clear" />
+</form>
</div>
<?php
wp_die( __('Invalid user ID.') );
wp_enqueue_script('user-profile');
-wp_enqueue_script('password-strength-meter');
$title = IS_PROFILE_PAGE ? __('Profile') : __('Edit User');
if ( current_user_can('edit_users') && !IS_PROFILE_PAGE )
$submenu_file = 'users.php';
else
$submenu_file = 'profile.php';
-$parent_file = 'users.php';
+
+if ( current_user_can('edit_users') && !is_user_admin() )
+ $parent_file = 'users.php';
+else
+ $parent_file = 'profile.php';
// contextual help - choose Help on the top right of admin panel to preview this.
add_contextual_help($current_screen,
$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' ) ) );
+ wp_redirect( add_query_arg( array('updated' => 'true'), self_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' ) ) );
+ wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );
die();
}
switch ($action) {
-case 'switchposts':
-
-check_admin_referer();
-
-/* TODO: Switch all posts from one user to another user */
-
-break;
-
case 'update':
check_admin_referer('update-user_' . $user_id);
$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' ] == '' ) {
+ if ( !is_network_admin() && null == $cap && $_POST[ 'role' ] == '' ) {
$_POST[ 'role' ] = 'contributor';
$delete_role = true;
}
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 ) )
+ if ( is_multisite() && is_network_admin() && !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";
- $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect);
+ if ( $wp_http_referer )
+ $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect);
wp_redirect($redirect);
exit;
}
if ( !current_user_can('edit_user', $user_id) )
wp_die(__('You do not have permission to edit this user.'));
-include ('admin-header.php');
+include (ABSPATH . 'wp-admin/admin-header.php');
?>
<?php if ( !IS_PROFILE_PAGE && is_super_admin( $profileuser->ID ) && current_user_can( 'manage_network_options' ) ) { ?>
<div id="message" class="updated">
<p><strong><?php _e('User updated.') ?></strong></p>
<?php if ( $wp_http_referer && !IS_PROFILE_PAGE ) : ?>
- <p><a href="users.php"><?php _e('← Back to Authors and Users'); ?></a></p>
+ <p><a href="<?php echo esc_url( $wp_http_referer ); ?>"><?php _e('← Back to Authors and Users'); ?></a></p>
<?php endif; ?>
</div>
<?php endif; ?>
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
-<form id="your-profile" action="<?php echo esc_url( admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post"<?php do_action('user_edit_form_tag'); ?>>
+<form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post"<?php do_action('user_edit_form_tag'); ?>>
<?php wp_nonce_field('update-user_' . $user_id) ?>
<?php if ( $wp_http_referer ) : ?>
<input type="hidden" name="wp_http_referer" value="<?php echo esc_url($wp_http_referer); ?>" />
if ( !( IS_PROFILE_PAGE && !$user_can_edit ) ) : ?>
<tr>
<th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th>
-<td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php if ( !empty($profileuser->comment_shortcuts) ) checked('true', $profileuser->comment_shortcuts); ?> /> <?php _e('Enable keyboard shortcuts for comment moderation.'); ?></label> <?php _e('<a href="http://codex.wordpress.org/Keyboard_Shortcuts">More information</a>'); ?></td>
+<td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php if ( !empty($profileuser->comment_shortcuts) ) checked('true', $profileuser->comment_shortcuts); ?> /> <?php _e('Enable keyboard shortcuts for comment moderation.'); ?></label> <?php _e('<a href="http://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">More information</a>'); ?></td>
</tr>
-<?php
-endif;
-do_action('personal_options', $profileuser);
-?>
+<?php endif; ?>
+<tr class="show-admin-bar">
+<th scope="row"><?php _e('Show Admin Bar')?></th>
+<td><fieldset><legend class="screen-reader-text"><span><?php _e('Show Admin Bar') ?></span></legend>
+<label for="admin_bar_front">
+<input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1" <?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> />
+<?php /* translators: Show admin bar when viewing site */ _e( 'when viewing site' ); ?></label><br />
+<label for="admin_bar_admin">
+<input name="admin_bar_admin" type="checkbox" id="admin_bar_admin" value="1" <?php checked( _get_admin_bar_pref( 'admin', $profileuser->ID ) ); ?> />
+<?php /* translators: Show admin bar in dashboard */ _e( 'in dashboard' ); ?></label>
+</td>
+</tr>
+<?php do_action('personal_options', $profileuser); ?>
</table>
<?php
if ( IS_PROFILE_PAGE )
<td><input type="text" name="user_login" id="user_login" value="<?php echo esc_attr($profileuser->user_login); ?>" disabled="disabled" class="regular-text" /> <span class="description"><?php _e('Usernames cannot be changed.'); ?></span></td>
</tr>
-<?php if ( !IS_PROFILE_PAGE ): ?>
+<?php if ( !IS_PROFILE_PAGE && !is_network_admin() ) : ?>
<tr><th><label for="role"><?php _e('Role:') ?></label></th>
<td><select name="role" id="role">
<?php
echo '<option value="" selected="selected">' . __('— No role for this site —') . '</option>';
?>
</select>
-<?php if ( is_multisite() && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?>
-<p><label><input type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( $profileuser->ID ) ); ?> /> <?php _e( 'Grant this user super admin privileges for the Network.'); ?></label></p>
-<?php } ?>
+<?php endif; //!IS_PROFILE_PAGE
+
+if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && !isset($super_admins) ) { ?>
+<tr><th><label for="role"><?php _e('Super Admin'); ?></label></th>
+<td>
+<?php if ( $profileuser->user_email != get_site_option( 'admin_email' ) ) : ?>
+<p><label><input type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( $profileuser->ID ) ); ?> /> <?php _e( 'Grant this user super admin privileges for the Network.' ); ?></label></p>
+<?php else : ?>
+<p><?php _e( 'Super admin privileges cannot be removed because this user has the network admin email.' ); ?></p>
+<?php endif; ?>
</td></tr>
-<?php endif; //!IS_PROFILE_PAGE ?>
+<?php } ?>
<tr>
<th><label for="first_name"><?php _e('First Name') ?></label></th>
$new_email = get_option( $current_user->ID . '_new_email' );
if ( $new_email && $new_email != $current_user->user_email ) : ?>
<div class="updated inline">
- <p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), $new_email['newemail'], esc_url( admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?></p>
+ <p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), $new_email['newemail'], esc_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?></p>
</div>
<?php endif; ?>
</td>
</tr>
<?php
- foreach (_wp_get_user_contactmethods() as $name => $desc) {
+ foreach (_wp_get_user_contactmethods( $profileuser ) as $name => $desc) {
?>
<tr>
<th><label for="<?php echo $name; ?>"><?php echo apply_filters('user_'.$name.'_label', $desc); ?></label></th>
<table class="form-table">
<tr>
<th><label for="description"><?php _e('Biographical Info'); ?></label></th>
- <td><textarea name="description" id="description" rows="5" cols="30"><?php echo esc_html($profileuser->description); ?></textarea><br />
+ <td><textarea name="description" id="description" rows="5" cols="30"><?php echo $profileuser->description; // textarea_escaped ?></textarea><br />
<span class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></span></td>
</tr>
</table>
<?php } ?>
-<p class="submit">
- <input type="hidden" name="action" value="update" />
- <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($user_id); ?>" />
- <input type="submit" class="button-primary" value="<?php IS_PROFILE_PAGE ? esc_attr_e('Update Profile') : esc_attr_e('Update User') ?>" name="submit" />
-</p>
+<input type="hidden" name="action" value="update" />
+<input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($user_id); ?>" />
+
+<?php submit_button( IS_PROFILE_PAGE ? __('Update Profile') : __('Update User') ); ?>
+
</form>
</div>
<?php
}
</script>
<?php
-include('./admin-footer.php');
+include( ABSPATH . 'wp-admin/admin-footer.php');
?>
/** WordPress Administration Bootstrap */
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() ) {
+ if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) )
+ wp_die( __( 'Cheatin’ uh?' ) );
+} elseif ( ! current_user_can( 'create_users' ) ) {
+ wp_die( __( 'Cheatin’ uh?' ) );
+}
if ( is_multisite() ) {
function admin_created_user_email( $text ) {
- return sprintf( __( "Hi,
-You've been invited to join '%s' at
-%s as a %s.
+ /* translators: 1: Site name, 2: site URL, 3: role */
+ return sprintf( __( 'Hi,
+You\'ve been invited to join \'%1$s\' at
+%2$s as a %3$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' ] ) );
+%%s' ), get_bloginfo('name'), site_url(), esc_html( $_REQUEST[ 'role' ] ) );
}
add_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email' );
}
if ( isset($_REQUEST['action']) && 'adduser' == $_REQUEST['action'] ) {
- check_admin_referer('add-user');
+ check_admin_referer( 'add-user', '_wpnonce_add-user' );
+
+ $user_details = null;
+ if ( false !== strpos($_REQUEST[ 'email' ], '@') ) {
+ $user_details = get_user_by('email', $_REQUEST[ 'email' ]);
+ } else {
+ if ( is_super_admin() ) {
+ $user_details = get_user_by('login', $_REQUEST[ 'email' ]);
+ } else {
+ wp_redirect( add_query_arg( array('update' => 'enter_email'), 'user-new.php' ) );
+ die();
+ }
+ }
+
+ if ( !$user_details ) {
+ wp_redirect( add_query_arg( array('update' => 'does_not_exist'), 'user-new.php' ) );
+ die();
+ }
+
+ if ( ! current_user_can('promote_user', $user_details->ID) )
+ wp_die(__('Cheatin’ uh?'));
+
+ // 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();
+} elseif ( isset($_REQUEST['action']) && 'createuser' == $_REQUEST['action'] ) {
+ check_admin_referer( 'create-user', '_wpnonce_create-user' );
+
+ if ( ! current_user_can('create_users') )
+ wp_die(__('Cheatin’ uh?'));
if ( !is_multisite() ) {
$user_id = add_user();
die();
}
} else {
- $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' );
+ // 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 {
- 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' );
- }
+ $redirect = add_query_arg( array('update' => 'newuserconfimation'), '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';
+$do_both = false;
+if ( is_multisite() && current_user_can('promote_users') && current_user_can('create_users') )
+ $do_both = true;
+
add_contextual_help($current_screen,
'<p>' . __('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:') . '</p>' .
'<ul>' .
wp_enqueue_script('wp-ajax-response');
wp_enqueue_script('user-profile');
-wp_enqueue_script('password-strength-meter');
require_once ('admin-header.php');
case "addexisting":
$messages[] = __('That user is already a member of this site.');
break;
+ case "does_not_exist":
+ $messages[] = __('The requested user does not exist.');
+ break;
+ case "does_not_exist":
+ $messages[] = __('Please enter a valid email address.');
+ break;
}
} else {
if ( 'add' == $_GET['update'] )
?>
<div class="wrap">
<?php screen_icon(); ?>
-<h2 id="add-new-user"><?php _e('Add New User') ?></h2>
+<h2 id="add-new-user"> <?php
+if ( current_user_can( 'create_users' ) ) {
+ echo _x( 'Add New User', 'user' );
+} elseif ( current_user_can( 'promote_users' ) ) {
+ echo _x( 'Add Existing User', 'user' );
+} ?>
+</h2>
<?php if ( isset($errors) && is_wp_error( $errors ) ) : ?>
<div class="error">
<div id="ajax-response"></div>
<?php
-if ( !is_multisite() ) {
- if ( get_option('users_can_register') )
- echo '<p>' . sprintf(__('Users can <a href="%1$s">register themselves</a> or you can manually create users here.'), site_url('wp-register.php')) . '</p>';
- else
- echo '<p>' . sprintf(__('Users cannot currently <a href="%1$s">register themselves</a>, but you can manually create users here.'), admin_url('options-general.php#users_can_register')) . '</p>';
-} else {
- echo '<p>' . __( 'You can add new users to your site in two ways:' ) . '<ol><li> ' . __( 'Enter the username and email address of an existing user on this site.' ) . '</li><li> ' . __( '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.' ) . '</li></ol></p>';
- echo '<p>' . __( '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.' ) . '</p>';
-}
+if ( is_multisite() ) {
+ if ( $do_both )
+ echo '<h3 id="add-existing-user">' . __('Add Existing User') . '</h3>';
+ if ( !is_super_admin() ) {
+ _e( 'Enter the email address of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' );
+ $label = __('E-mail');
+ } else {
+ _e( 'Enter the email address or username of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' );
+ $label = __('E-mail or Username');
+ }
?>
-<form action="#add-new-user" method="post" name="adduser" id="adduser" class="add:users: validate"<?php do_action('user_new_form_tag');?>>
-<?php wp_nonce_field('add-user') ?>
+<form action="" method="post" name="adduser" id="adduser" class="add:users: validate"<?php do_action('user_new_form_tag');?>>
+<input name="action" type="hidden" value="adduser" />
+<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
+
+<table class="form-table">
+ <tr class="form-field form-required">
+ <th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th>
+ <td><input name="email" type="text" id="adduser-email" value="" /></td>
+ </tr>
+ <tr class="form-field">
+ <th scope="row"><label for="adduser-role"><?php _e('Role'); ?></label></th>
+ <td><select name="role" id="adduser-role">
+ <?php wp_dropdown_roles( get_option('default_role') ); ?>
+ </select>
+ </td>
+ </tr>
+<?php if ( is_super_admin() ) { ?>
+ <tr>
+ <th scope="row"><label for="adduser-noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th>
+ <td><label for="adduser-noconfirmation"><input type="checkbox" name="noconfirmation" id="adduser-noconfirmation" value="1" /> <?php _e( 'Add the user without sending them a confirmation email.' ); ?></label></td>
+ </tr>
+<?php } ?>
+</table>
+<?php submit_button( __( 'Add Existing User '), 'primary', 'adduser', true, array( 'id' => 'addusersub' ) ); ?>
+</form>
+<?php
+} // is_multisite()
+
+if ( current_user_can( 'create_users') ) {
+ if ( $do_both )
+ echo '<h3 id="create-new-user">' . __( 'Add New User' ) . '</h3>';
+?>
+<p><?php _e('Create a brand new user and add it to this site.'); ?></p>
+<form action="" method="post" name="createuser" id="createuser" class="add:users: validate"<?php do_action('user_new_form_tag');?>>
+<input name="action" type="hidden" value="createuser" />
+<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ) ?>
<?php
-//Load up the passed data, else set to a default.
-foreach ( array('user_login' => 'login', 'first_name' => 'firstname', 'last_name' => 'lastname',
- 'email' => 'email', 'url' => 'uri', 'role' => 'role') as $post_field => $var ) {
+// Load up the passed data, else set to a default.
+foreach ( array( 'user_login' => 'login', 'first_name' => 'firstname', 'last_name' => 'lastname',
+ 'email' => 'email', 'url' => 'uri', 'role' => 'role', 'send_password' => 'send_password', 'noconfirmation' => 'ignore_pass' ) as $post_field => $var ) {
$var = "new_user_$var";
- if ( ! isset($$var) )
- $$var = isset($_POST[$post_field]) ? stripslashes($_POST[$post_field]) : '';
+ if( isset( $_POST['createuser'] ) ) {
+ if ( ! isset($$var) )
+ $$var = isset( $_POST[$post_field] ) ? stripslashes( $_POST[$post_field] ) : '';
+ } else {
+ $$var = false;
+ }
}
-$new_user_send_password = !$_POST || isset($_POST['send_password']);
+
?>
<table class="form-table">
<tr class="form-field form-required">
- <th scope="row"><label for="user_login"><?php _e('Username'); ?> <span class="description"><?php _e('(required)'); ?></span></label>
- <input name="action" type="hidden" id="action" value="adduser" /></th>
+ <th scope="row"><label for="user_login"><?php _e('Username'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th>
<td><input name="user_login" type="text" id="user_login" value="<?php echo esc_attr($new_user_login); ?>" aria-required="true" /></td>
</tr>
<tr class="form-field form-required">
</tr>
<tr>
<th scope="row"><label for="send_password"><?php _e('Send Password?') ?></label></th>
- <td><label for="send_password"><input type="checkbox" name="send_password" id="send_password" <?php checked($new_user_send_password, true); ?> /> <?php _e('Send this password to the new user by email.'); ?></label></td>
+ <td><label for="send_password"><input type="checkbox" name="send_password" id="send_password" <?php checked( $new_user_send_password ); ?> /> <?php _e('Send this password to the new user by email.'); ?></label></td>
</tr>
<?php endif; ?>
<?php } // !is_multisite ?>
<?php if ( is_multisite() && is_super_admin() ) { ?>
<tr>
<th scope="row"><label for="noconfirmation"><?php _e('Skip Confirmation Email') ?></label></th>
- <td><label for="noconfirmation"><input type="checkbox" name="noconfirmation" id="noconfirmation" value="1" /> <?php _e( 'Site administrators can add a user without sending the confirmation email.' ); ?></label></td>
+ <td><label for="noconfirmation"><input type="checkbox" name="noconfirmation" id="noconfirmation" value="1" <?php checked( $new_user_ignore_pass ); ?> /> <?php _e( 'Add the user without sending them a confirmation email.' ); ?></label></td>
</tr>
<?php } ?>
</table>
-<p class="submit">
- <input name="adduser" type="submit" id="addusersub" class="button-primary" value="<?php esc_attr_e('Add User') ?>" />
-</p>
-</form>
+<?php submit_button( __( 'Add New User '), 'primary', 'createuser', true, array( 'id' => 'createusersub' ) ); ?>
+
+</form>
+<?php } // current_user_can('create_users') ?>
</div>
<?php
include('./admin-footer.php');
--- /dev/null
+<?php
+/**
+ * WordPress User Administration Bootstrap
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+define('WP_USER_ADMIN', TRUE);
+
+require_once( dirname(dirname(__FILE__)) . '/admin.php');
+
+if ( ! is_multisite() ) {
+ wp_redirect( admin_url() );
+ exit;
+}
+
+if ( ! is_main_site() ) {
+ wp_redirect( user_admin_url() );
+ exit;
+}
+?>
--- /dev/null
+<?php
+/**
+ * Handle default dashboard widgets options AJAX.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+require_once( './admin.php' );
+
+require( '../index-extra.php' );
--- /dev/null
+<?php
+/**
+ * User Dashboard Administration Panel
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+require_once( './admin.php' );
+
+require( '../index.php' );
--- /dev/null
+<?php
+/**
+ * Build User Administration Menu.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+$menu[0] = array(__('Dashboard'), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'div');
+
+$menu[4] = array( '', 'exist', 'separator1', '', 'wp-menu-separator' );
+
+$menu[70] = array( __('Profile'), 'exist', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'div' );
+
+$menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator-last' );
+
+$_wp_real_parent_file['users.php'] = 'profile.php';
+$compat = array();
+$submenu = array();
+
+require_once(ABSPATH . 'wp-admin/includes/menu.php');
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * User Profile Administration Panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+require_once( './admin.php' );
+
+require( '../profile.php' );
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Edit user administration panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ * @since 3.1.0
+ */
+
+require_once( './admin.php' );
+
+require( '../user-edit.php' );
\ No newline at end of file
*/
/** WordPress Administration Bootstrap */
-require_once('./admin.php');
+require_once( './admin.php' );
-/** WordPress Registration API */
-require_once( ABSPATH . WPINC . '/registration.php');
-
-if ( !current_user_can('list_users') )
- wp_die(__('Cheatin’ uh?'));
+if ( ! current_user_can( 'list_users' ) )
+ wp_die( __( 'Cheatin’ uh?' ) );
+$wp_list_table = _get_list_table('WP_Users_List_Table');
+$pagenum = $wp_list_table->get_pagenum();
$title = __('Users');
$parent_file = 'users.php';
+add_screen_option( 'per_page', array('label' => _x( 'Users', 'users per page (screen options)' )) );
+
// contextual help - choose Help on the top right of admin panel to preview this.
add_contextual_help($current_screen,
- '<p>' . __('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.') . '</p>' .
+ '<p>' . __('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 in the dashboard navigation when they are logged in, based on their role.') . '</p>' .
'<p>' . __('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.') . '</p>' .
'<p>' . __('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.') . '</p>' .
'<p><strong>' . __('For more information:') . '</strong></p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Users_Authors_and_Users_SubPanel" target="_blank">Documentation on Authors and Users</a>') . '</p>' .
- '<p>' . __('<a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Roles and Capabilities Descriptions</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Users_Users_SubPanel" target="_blank">Documentation on Managing Users</a>') . '</p>' .
+ '<p>' . __('<a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Descriptions of Roles and Capabilities</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
-$update = $doaction = '';
-if ( isset($_REQUEST['action']) )
- $doaction = $_REQUEST['action'] ? $_REQUEST['action'] : $_REQUEST['action2'];
-
-if ( empty($doaction) ) {
- if ( isset($_GET['changeit']) && !empty($_GET['new_role']) )
- $doaction = 'promote';
-}
-
if ( empty($_REQUEST) ) {
$referer = '<input type="hidden" name="wp_http_referer" value="'. esc_attr(stripslashes($_SERVER['REQUEST_URI'])) . '" />';
} elseif ( isset($_REQUEST['wp_http_referer']) ) {
$referer = '';
}
-switch ($doaction) {
+$update = '';
+
+switch ( $wp_list_table->current_action() ) {
/* Bulk Dropdown menu Role changes */
case 'promote':
check_admin_referer('bulk-users');
+ if ( ! current_user_can( 'promote_users' ) )
+ wp_die( __( 'You can’t edit that user.' ) );
+
if ( empty($_REQUEST['users']) ) {
wp_redirect($redirect);
exit();
$go_delete = true;
}
}
- // @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 = '<select name="reassign_user">';
- foreach ( (array) $all_logins as $login )
- if ( $login->ID == $current_user->ID || !in_array($login->ID, $userids) )
- $user_dropdown .= "<option value=\"" . esc_attr($login->ID) . "\">{$login->user_login}</option>";
- $user_dropdown .= '</select>';
?>
</ul>
<?php if ( $go_delete ) : ?>
<li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" checked="checked" />
<?php _e('Delete all posts and links.'); ?></label></li>
<li><input type="radio" id="delete_option1" name="delete_option" value="reassign" />
- <?php echo '<label for="delete_option1">'.__('Attribute all posts and links to:')."</label> $user_dropdown"; ?></li>
+ <?php echo '<label for="delete_option1">'.__('Attribute all posts and links to:').'</label>';
+ wp_dropdown_users( array( 'name' => 'reassign_user', 'exclude' => array_diff( $userids, array($current_user->ID) ) ) ); ?></li>
</ul></fieldset>
<input type="hidden" name="action" value="dodelete" />
- <p class="submit"><input type="submit" name="submit" value="<?php esc_attr_e('Confirm Deletion'); ?>" class="button-secondary" /></p>
+ <?php submit_button( __('Confirm Deletion'), 'secondary' ); ?>
<?php else : ?>
<p><?php _e('There are no valid users selected for deletion.'); ?></p>
<?php endif; ?>
case 'doremove':
check_admin_referer('remove-users');
+ if ( ! is_multisite() )
+ wp_die( __( 'You can’t remove users.' ) );
+
if ( empty($_REQUEST['users']) ) {
wp_redirect($redirect);
exit;
}
- if ( !current_user_can('remove_users') )
- die(__('You can’t remove users.'));
+ if ( ! current_user_can( 'remove_users' ) )
+ wp_die( __( 'You can’t remove users.' ) );
$userids = $_REQUEST['users'];
check_admin_referer('bulk-users');
+ if ( ! is_multisite() )
+ wp_die( __( 'You can’t remove users.' ) );
+
if ( empty($_REQUEST['users']) && empty($_REQUEST['user']) ) {
wp_redirect($redirect);
exit();
?>
<?php if ( $go_remove ) : ?>
<input type="hidden" name="action" value="doremove" />
- <p class="submit"><input type="submit" name="submit" value="<?php esc_attr_e('Confirm Removal'); ?>" class="button-secondary" /></p>
+ <?php submit_button( __('Confirm Removal'), 'secondary' ); ?>
<?php else : ?>
<p><?php _e('There are no valid users selected for removal.'); ?></p>
<?php endif; ?>
exit;
}
+ $wp_list_table->prepare_items();
+ $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
+ if ( $pagenum > $total_pages && $total_pages > 0 ) {
+ wp_redirect( add_query_arg( 'paged', $total_pages ) );
+ exit;
+ }
include('./admin-header.php');
- $usersearch = isset($_GET['usersearch']) ? $_GET['usersearch'] : null;
- $userspage = isset($_GET['userspage']) ? $_GET['userspage'] : null;
- $role = isset($_GET['role']) ? $_GET['role'] : null;
-
- // Query the user IDs for this page
- $wp_user_search = new WP_User_Search($usersearch, $userspage, $role);
-
- // Query the post counts for this page
- $post_counts = count_many_users_posts($wp_user_search->get_results());
-
- // Query the users for this page
- cache_users($wp_user_search->get_results());
-
$messages = array();
if ( isset($_GET['update']) ) :
switch($_GET['update']) {
<div class="wrap">
<?php screen_icon(); ?>
-<h2><?php echo esc_html( $title ); if ( current_user_can( 'create_users' ) ) { ?> <a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'user'); ?></a><?php }
-if ( isset($_GET['usersearch']) && $_GET['usersearch'] )
- printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( $_GET['usersearch'] ) ); ?>
-</h2>
-
-<div class="filter">
-<form id="list-filter" action="" method="get">
-<ul class="subsubsub">
+<h2>
<?php
-$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[] = "<li><a href='users.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';
-foreach ( $wp_roles->get_names() as $this_role => $name ) {
- if ( !isset($avail_roles[$this_role]) )
- continue;
-
- $class = '';
-
- if ( $this_role == $role ) {
- $current_role = $role;
- $class = ' class="current"';
- }
-
- $name = translate_user_role( $name );
- /* translators: User role name with count */
- $name = sprintf( __('%1$s <span class="count">(%2$s)</span>'), $name, $avail_roles[$this_role] );
- $role_links[] = "<li><a href='users.php?role=$this_role'$class>$name</a>";
-}
-echo implode( " |</li>\n", $role_links) . '</li>';
-unset($role_links);
-?>
-</ul>
-</form>
-</div>
-
-<form class="search-form" action="" method="get">
-<p class="search-box">
- <label class="screen-reader-text" for="user-search-input"><?php _e( 'Search Users' ); ?>:</label>
- <input type="text" id="user-search-input" name="usersearch" value="<?php echo esc_attr($wp_user_search->search_term); ?>" />
- <input type="submit" value="<?php esc_attr_e( 'Search Users' ); ?>" class="button" />
-</p>
-</form>
-
-<form id="posts-filter" action="" method="get">
-<div class="tablenav">
-
-<?php if ( $wp_user_search->results_are_paged() ) : ?>
- <div class="tablenav-pages"><?php $wp_user_search->page_links(); ?></div>
-<?php endif; ?>
-
-<div class="alignleft actions">
-<select name="action">
-<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<?php if ( !is_multisite() && current_user_can('delete_users') ) { ?>
-<option value="delete"><?php _e('Delete'); ?></option>
-<?php } else { ?>
-<option value="remove"><?php _e('Remove'); ?></option>
-<?php } ?>
-</select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
-<label class="screen-reader-text" for="new_role"><?php _e('Change role to…') ?></label><select name="new_role" id="new_role"><option value=''><?php _e('Change role to…') ?></option><?php wp_dropdown_roles(); ?></select>
-<input type="submit" value="<?php esc_attr_e('Change'); ?>" name="changeit" class="button-secondary" />
-<?php wp_nonce_field('bulk-users'); ?>
-</div>
-
-<br class="clear" />
-</div>
-
- <?php if ( is_wp_error( $wp_user_search->search_errors ) ) : ?>
- <div class="error">
- <ul>
- <?php
- foreach ( $wp_user_search->search_errors->get_error_messages() as $message )
- echo "<li>$message</li>";
- ?>
- </ul>
- </div>
- <?php endif; ?>
-
-
-<?php if ( $wp_user_search->get_results() ) : ?>
-
- <?php if ( $wp_user_search->is_search() ) : ?>
- <p><a href="users.php"><?php _e('← Back to All Users'); ?></a></p>
- <?php endif; ?>
-
-<table class="widefat fixed" cellspacing="0">
-<thead>
-<tr class="thead">
-<?php print_column_headers('users') ?>
-</tr>
-</thead>
-
-<tfoot>
-<tr class="thead">
-<?php print_column_headers('users', false) ?>
-</tr>
-</tfoot>
-
-<tbody id="users" class="list:user user-list">
-<?php
-$style = '';
-foreach ( $wp_user_search->get_results() as $userid ) {
- $user_object = new WP_User($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, $post_counts[ $userid ] );
-}
-?>
-</tbody>
-</table>
-
-<div class="tablenav">
-
-<?php if ( $wp_user_search->results_are_paged() ) : ?>
- <div class="tablenav-pages"><?php $wp_user_search->page_links(); ?></div>
-<?php endif; ?>
+echo esc_html( $title );
+if ( current_user_can( 'create_users' ) ) { ?>
+ <a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
+<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
+ <a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
+<?php }
+
+if ( $usersearch )
+ printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( $usersearch ) ); ?>
+</h2>
-<div class="alignleft actions">
-<select name="action2">
-<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
-<?php if ( !is_multisite() && current_user_can('delete_users') ) { ?>
-<option value="delete"><?php _e('Delete'); ?></option>
-<?php } else { ?>
-<option value="remove"><?php _e('Remove'); ?></option>
-<?php } ?></select>
-<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
-</div>
+<?php $wp_list_table->views(); ?>
-<br class="clear" />
-</div>
+<form action="" method="get">
-<?php endif; ?>
+<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
+<?php $wp_list_table->display(); ?>
</form>
-</div>
<?php
if ( is_multisite() ) {
?>
<br class="clear" />
+</div>
<?php
break;
} // end of the $doaction switch
include('./admin-footer.php');
-?>
$help = '
<p>' . __('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.') . '</p>
- <p>' . __('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.') . '</p>
+ <p>' . __('The 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.') . '</p>
<p>' . __('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.') . '</p>
<p>' . __('Widgets may be used multiple times. You can give each widget a title, to display on your site, but it’s not required.') . '</p>
<p>' . __('Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.') . '</p>
<p>' . __('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.') . '</p>
';
$help .= '<p><strong>' . __('For more information:') . '</strong></p>';
-$help .= '<p>' . __('<a href="http://codex.wordpress.org/Appearance_Widgets_SubPanel" target="_blank">Widgets Documentation</a>') . '</p>';
+$help .= '<p>' . __('<a href="http://codex.wordpress.org/Appearance_Widgets_SubPanel" target="_blank">Documentation on Widgets</a>') . '</p>';
$help .= '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>';
add_contextual_help($current_screen, $help);
if ( isset($_POST['removewidget']) && $_POST['removewidget'] ) {
if ( !in_array($widget_id, $sidebar, true) ) {
- wp_redirect('widgets.php?error=0');
+ wp_redirect( admin_url('widgets.php?error=0') );
exit;
}
}
wp_set_sidebars_widgets($sidebars_widgets);
- wp_redirect('widgets.php?message=0');
+ wp_redirect( admin_url('widgets.php?message=0') );
exit;
}
</div>
<div class="widget-control-actions">
-<?php if ( isset($_GET['addnew']) ) { ?>
+<?php
+ if ( isset($_GET['addnew']) ) { ?>
<a href="widgets.php" class="button alignleft"><?php _e('Cancel'); ?></a>
-<?php } else { ?>
- <input type="submit" name="removewidget" class="button alignleft" value="<?php esc_attr_e('Delete'); ?>" />
-<?php } ?>
- <input type="submit" name="savewidget" class="button-primary alignright" value="<?php esc_attr_e('Save Widget'); ?>" />
+<?php
+ } else {
+ submit_button( __( 'Delete' ), 'button alignleft', 'removewidget', false );
+ }
+ submit_button( __( 'Save Widget' ), 'button-primary alignright', 'savewidget', false ); ?>
<input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($widget_id); ?>" />
<input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr($id_base); ?>" />
<input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr($multi_number); ?>" />
* @since 2.2.0
*/
function create_post() {
- global $blog_id, $user_ID;
+ global $user_ID;
$this->get_accepted_content_type($this->atom_content_types);
$parser = new AtomParser();
if ( !current_user_can($cap) )
$this->auth_required(__('Sorry, you do not have the right to edit/publish new posts.'));
- $blog_ID = (int ) $blog_id;
+ $blog_ID = get_current_blog_id();
$post_status = ($publish) ? 'publish' : 'draft';
$post_author = (int) $user_ID;
$post_title = $entry->title[1];
$filetype = wp_check_filetype($location);
if ( !isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']) )
- $this->internal_error(__('Error ocurred while accessing post metadata for file location.'));
+ $this->internal_error(__('Error occurred while accessing post metadata for file location.'));
// delete file
@unlink($location);
$filetype = wp_check_filetype($location);
if ( !isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']) )
- $this->internal_error(__('Error ocurred while accessing post metadata for file location.'));
+ $this->internal_error(__('Error occurred while accessing post metadata for file location.'));
status_header('200');
header('Content-Type: ' . $entry['post_mime_type']);
$location = "{$upload_dir['basedir']}/{$location}";
if (!isset($location) || 'attachment' != $entry['post_type'] || empty($filetype['ext']))
- $this->internal_error(__('Error ocurred while accessing post metadata for file location.'));
+ $this->internal_error(__('Error occurred while accessing post metadata for file location.'));
$fp = fopen("php://input", "rb");
$localfp = fopen($location, "w+");
require( './wp-load.php' );
wp_redirect( get_bloginfo( 'atom_url' ), 301 );
-
-?>
\ No newline at end of file
+exit;
+?>
$location = apply_filters('comment_post_redirect', $location, $comment);
wp_redirect($location);
-
+exit;
?>
require( './wp-load.php' );
wp_redirect( get_bloginfo( 'comments_rss2_url' ), 301 );
-
-?>
\ No newline at end of file
+exit;
+?>
/**\r
* WordPress Localized Language, defaults to English.\r
*\r
- * Change this to localize WordPress. A corresponding MO file for the chosen\r
+ * Change this to localize WordPress. A corresponding MO file for the chosen\r
* language must be installed to wp-content/languages. For example, install\r
- * de.mo to wp-content/languages and set WPLANG to 'de' to enable German\r
+ * de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German\r
* language support.\r
*/\r
-define ('WPLANG', '');\r
+define('WPLANG', '');\r
\r
/**\r
* For developers: WordPress debugging mode.\r
global $wp_version;
// all admin functions are disabled in old versions
- if ( version_compare( $wp_version, '3.0', '<' ) ) {
+ if ( !function_exists('is_multisite') && version_compare( $wp_version, '3.0', '<' ) ) {
function akismet_version_warning() {
echo "
- <div id='akismet-warning' class='updated fade'><p><strong>".sprintf(__('Akismet %s required WordPress 3.0 or higher.'), AKISMET_VERSION) ."</strong> ".sprintf(__('Please <a href="%s">upgrade WordPress</a> to a current version, or <a href="%s">downgrade to version 2.4 of the Akismet plugin</a>.'), 'http://codex.wordpress.org/Upgrading_WordPress', 'http://wordpress.org/extend/plugins/akismet/download/'). "</p></div>
+ <div id='akismet-warning' class='updated fade'><p><strong>".sprintf(__('Akismet %s requires WordPress 3.0 or higher.'), AKISMET_VERSION) ."</strong> ".sprintf(__('Please <a href="%s">upgrade WordPress</a> to a current version, or <a href="%s">downgrade to version 2.4 of the Akismet plugin</a>.'), 'http://codex.wordpress.org/Upgrading_WordPress', 'http://wordpress.org/extend/plugins/akismet/download/'). "</p></div>
";
}
add_action('admin_notices', 'akismet_version_warning');
else
$hook = 'dashboard_page_akismet-stats-display';
add_action('admin_head-'.$hook, 'akismet_stats_script');
- add_meta_box('akismet-status', __('Akismet Status'), 'akismet_comment_status_meta_box', 'comment', 'normal');
+ add_meta_box('akismet-status', __('Comment History'), 'akismet_comment_status_meta_box', 'comment', 'normal');
+ wp_register_style('akismet.css', AKISMET_PLUGIN_URL . 'akismet.css');
+ wp_enqueue_style('akismet.css');
+ wp_register_script('akismet.js', AKISMET_PLUGIN_URL . 'akismet.js', array('jquery'));
+ wp_enqueue_script('akismet.js');
}
add_action('admin_init', 'akismet_admin_init');
function akismet_config_page() {
if ( function_exists('add_submenu_page') )
add_submenu_page('plugins.php', __('Akismet Configuration'), __('Akismet Configuration'), 'manage_options', 'akismet-key-config', 'akismet_conf');
+}
+
+function akismet_plugin_action_links( $links, $file ) {
+ if ( $file == plugin_basename( dirname(__FILE__).'/akismet.php' ) ) {
+ $links[] = '<a href="plugins.php?page=akismet-key-config">'.__('Settings').'</a>';
+ }
+ return $links;
}
+add_filter( 'plugin_action_links', 'akismet_plugin_action_links', 10, 2 );
+
function akismet_conf() {
global $akismet_nonce, $wpcom_api_key;
check_admin_referer( $akismet_nonce );
$key = preg_replace( '/[^a-h0-9]/i', '', $_POST['key'] );
+ $home_url = parse_url( get_bloginfo('url') );
if ( empty($key) ) {
$key_status = 'empty';
$ms[] = 'new_key_empty';
delete_option('wordpress_api_key');
+ } elseif ( empty($home_url['host']) ) {
+ $key_status = 'empty';
+ $ms[] = 'bad_home_url';
} else {
$key_status = akismet_verify_key( $key );
}
update_option( 'akismet_discard_month', 'true' );
else
update_option( 'akismet_discard_month', 'false' );
+
+ if ( isset( $_POST['akismet_show_user_comments_approved'] ) )
+ update_option( 'akismet_show_user_comments_approved', 'true' );
+ else
+ update_option( 'akismet_show_user_comments_approved', 'false' );
+
} elseif ( isset($_POST['check']) ) {
akismet_get_server_connectivity(0);
}
$messages = array(
'new_key_empty' => array('color' => 'aa0', 'text' => __('Your key has been cleared.')),
- 'new_key_valid' => array('color' => '2d2', 'text' => __('Your key has been verified. Happy blogging!')),
- 'new_key_invalid' => array('color' => 'd22', 'text' => __('The key you entered is invalid. Please double-check it.')),
- 'new_key_failed' => array('color' => 'd22', 'text' => __('The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.')),
- 'no_connection' => array('color' => 'd22', 'text' => __('There was a problem connecting to the Akismet server. Please check your server configuration.')),
+ 'new_key_valid' => array('color' => '4AB915', 'text' => __('Your key has been verified. Happy blogging!')),
+ 'new_key_invalid' => array('color' => '888', 'text' => __('The key you entered is invalid. Please double-check it.')),
+ 'new_key_failed' => array('color' => '888', 'text' => __('The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.')),
+ 'no_connection' => array('color' => '888', 'text' => __('There was a problem connecting to the Akismet server. Please check your server configuration.')),
'key_empty' => array('color' => 'aa0', 'text' => sprintf(__('Please enter an API key. (<a href="%s" style="color:#fff">Get your key.</a>)'), 'http://akismet.com/get/')),
- 'key_valid' => array('color' => '2d2', 'text' => __('This key is valid.')),
- 'key_failed' => array('color' => 'aa0', 'text' => __('The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.')));
+ 'key_valid' => array('color' => '4AB915', 'text' => __('This key is valid.')),
+ 'key_failed' => array('color' => 'aa0', 'text' => __('The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.')),
+ 'bad_home_url' => array('color' => '888', 'text' => sprintf( __('Your WordPress home URL %s is invalid. Please fix the <a href="%s">home option</a>.'), esc_html( get_bloginfo('url') ), admin_url('options.php#home') ) ),
+ );
?>
<?php if ( !empty($_POST['submit'] ) ) : ?>
<div id="message" class="updated fade"><p><strong><?php _e('Options saved.') ?></strong></p></div>
<?php endif; ?>
<div class="wrap">
<h2><?php _e('Akismet Configuration'); ?></h2>
+<?php if (isset($_GET['message']) && $_GET['message'] == 'success') { ?>
+ <div class="updated below-h2" id="message"><p><?php _e( '<strong>Sign up success!</strong> Please check your email for your Akismet API Key and enter it below.' ); ?></p></div>
+<?php } ?>
<div class="narrow">
<form action="" method="post" id="akismet-conf" style="margin: auto; width: 400px; ">
<?php if ( !$wpcom_api_key ) { ?>
<?php } ?>
<?php } ?>
<?php akismet_nonce_field($akismet_nonce) ?>
-<p><label><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php if ( get_option('akismet_discard_month') == 'true' ) echo ' checked="checked" '; ?> /> <?php _e('Automatically discard spam comments on posts older than a month.'); ?></label></p>
+<p><label><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php if ( get_option('akismet_discard_month') == 'true' ) echo ' checked="checked" '; ?> /> <?php _e('Auto-delete spam submitted on posts more than a month old.'); ?></label></p>
+<p><label><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="true" type="checkbox" <?php if ( get_option('akismet_show_user_comments_approved') == 'true' ) echo ' checked="checked" '; ?> /> <?php _e('Show the number of comments you\'ve approved beside each comment author.'); ?></label></p>
<p class="submit"><input type="submit" name="submit" value="<?php _e('Update options »'); ?>" /></p>
</form>
<?php
if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') ) {
?>
- <p style="padding: .5em; background-color: #d22; color: #fff; font-weight:bold;"><?php _e('Network functions are disabled.'); ?></p>
+ <p style="padding: .5em; background-color: #888; color: #fff; font-weight:bold;"><?php _e('Network functions are disabled.'); ?></p>
<p><?php echo sprintf( __('Your web host or server administrator has disabled PHP\'s <code>fsockopen</code> or <code>gethostbynamel</code> functions. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet\'s system requirements</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
<?php
} else {
<?php
// all connections fail
} elseif ( $fail_count > 0 ) { ?>
- <p style="padding: .5em; background-color: #d22; color: #fff; font-weight:bold;"><?php _e('Unable to reach any Akismet servers.'); ?></p>
+ <p style="padding: .5em; background-color: #888; color: #fff; font-weight:bold;"><?php _e('Unable to reach any Akismet servers.'); ?></p>
<p><?php echo sprintf( __('A network problem or firewall is blocking all connections from your web server to Akismet.com. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
<?php
// all connections work
} else { ?>
- <p style="padding: .5em; background-color: #2d2; color: #fff; font-weight:bold;"><?php _e('All Akismet servers are available.'); ?></p>
+ <p style="padding: .5em; background-color: #4AB915; color: #fff; font-weight:bold;"><?php _e('All Akismet servers are available.'); ?></p>
<p><?php _e('Akismet is working correctly. All servers are accessible.'); ?></p>
<?php
}
} else {
?>
- <p style="padding: .5em; background-color: #d22; color: #fff; font-weight:bold;"><?php _e('Unable to find Akismet servers.'); ?></p>
+ <p style="padding: .5em; background-color: #888; color: #fff; font-weight:bold;"><?php _e('Unable to find Akismet servers.'); ?></p>
<p><?php echo sprintf( __('A DNS problem or firewall is preventing all access from your web server to Akismet.com. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
<?php
}
<?php
asort($servers);
foreach ( $servers as $ip => $status ) {
- $color = ( $status ? '#2d2' : '#d22');
+ $color = ( $status ? '#4AB915' : '#888');
?>
<tr>
<td><?php echo htmlspecialchars($ip); ?></td>
- <td style="padding: 0 .5em; font-weight:bold; color: #fff; background-color: <?php echo $color; ?>"><?php echo ($status ? __('No problems') : __('Obstructed') ); ?></td>
+ <td style="padding: 0 .5em; font-weight:bold; color: #fff; background-color: <?php echo $color; ?>"><?php echo ($status ? __('Accessible') : __('Re-trying') ); ?></td>
<?php
}
</table>
<p><?php if ( get_option('akismet_connectivity_time') ) echo sprintf( __('Last checked %s ago.'), human_time_diff( get_option('akismet_connectivity_time') ) ); ?></p>
<p class="submit"><input type="submit" name="check" value="<?php _e('Check network status »'); ?>" /></p>
+ <p><?php printf( __('<a href="%s" target="_blank">Click here</a> to confirm that <a href="%s" target="_blank">Akismet.com is up</a>.'), 'http://status.automattic.com/9931/136079/Akismet-API', 'http://status.automattic.com/9931/136079/Akismet-API' ); ?></p>
</form>
</div>
?>
<script type="text/javascript">
function resizeIframe() {
- var height = document.documentElement.clientHeight;
- height -= document.getElementById('akismet-stats-frame').offsetTop;
- height += 100; // magic padding
-
- document.getElementById('akismet-stats-frame').style.height = height +"px";
+
+ document.getElementById('akismet-stats-frame').style.height = "2500px";
};
function resizeIframeInit() {
function akismet_stats_display() {
global $akismet_api_host, $akismet_api_port, $wpcom_api_key;
- $blog = urlencode( get_option('home') );
+ $blog = urlencode( get_bloginfo('url') );
$url = 'http://';
if ( is_ssl() )
if ( !$count = get_option('akismet_spam_count') )
return;
$path = plugin_basename(__FILE__);
- echo '<h3>'.__('Spam').'</h3>';
+ echo '<h3>' . _x( 'Spam', 'comments' ) . '</h3>';
global $submenu;
if ( isset( $submenu['edit-comments.php'] ) )
$link = 'edit-comments.php';
else
$link = 'edit.php';
- echo '<p>'.sprintf(__('<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.'), 'http://akismet.com/', clean_url("$link?page=akismet-admin"), number_format_i18n($count) ).'</p>';
+ echo '<p>'.sprintf( _n( '<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.', '<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.', $count ), 'http://akismet.com/', clean_url("$link?page=akismet-admin"), number_format_i18n($count) ).'</p>';
}
add_action('activity_box_end', 'akismet_stats');
}
add_action('admin_notices', 'akismet_warning');
return;
- } elseif ( get_option('akismet_connectivity_time') && empty($_POST) && is_admin() && !akismet_server_connectivity_ok() ) {
+ } elseif ( ( empty($_SERVER['SCRIPT_FILENAME']) || basename($_SERVER['SCRIPT_FILENAME']) == 'edit-comments.php' ) && wp_next_scheduled('akismet_schedule_cron_recheck') ) {
function akismet_warning() {
- echo "
- <div id='akismet-warning' class='updated fade'><p><strong>".__('Akismet has detected a problem.')."</strong> ".sprintf(__('A server or network problem is preventing Akismet from working correctly. <a href="%1$s">Click here for more information</a> about how to fix the problem.'), "plugins.php?page=akismet-key-config")."</p></div>
+ global $wpdb;
+ $waiting = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->commentmeta WHERE meta_key = 'akismet_error'" ) );
+ $next_check = human_time_diff( wp_next_scheduled('akismet_schedule_cron_recheck') );
+ if ( $waiting > 0 )
+ echo "
+ <div id='akismet-warning' class='updated fade'><p><strong>".__('Akismet has detected a problem.')."</strong> ".sprintf(_n('A server or network problem prevented Akismet from checking %d comment. It has been temporarily held for moderation and will be automatically re-checked in %s.', 'A server or network problem prevented Akismet from checking %d comments. They have been temporarily held for moderation and will be automatically re-checked in %s.', $waiting), number_format_i18n( $waiting ), $next_check)."</p></div>
";
}
add_action('admin_notices', 'akismet_warning');
// FIXME placeholder
function akismet_comment_row_action( $a, $comment ) {
-
-
+
+ // failsafe for old WP versions
+ if ( !function_exists('add_comment_meta') )
+ return $a;
+
$akismet_result = get_comment_meta( $comment->comment_ID, 'akismet_result', true );
$user_result = get_comment_meta( $comment->comment_ID, 'akismet_user_result', true);
+ $comment_status = wp_get_comment_status( $comment->comment_ID );
$desc = null;
if ( !$user_result || $user_result == $akismet_result ) {
// Show the original Akismet result if the user hasn't overridden it, or if their decision was the same
- if ( $akismet_result == 'true' )
- $desc = 'Flagged as spam by Akismet';
- elseif ( $akismet_result == 'false' )
- $desc = 'Cleared by Akismet';
+ if ( $akismet_result == 'true' && $comment_status != 'spam' && $comment_status != 'trash' )
+ $desc = __( 'Flagged as spam by Akismet' );
+ elseif ( $akismet_result == 'false' && $comment_status == 'spam' )
+ $desc = __( 'Cleared by Akismet' );
} else {
$who = get_comment_meta( $comment->comment_ID, 'akismet_user', true );
if ( $user_result == 'true' )
else
$desc = sprintf( __('Un-spammed by %s'), $who );
}
-
+
+ // add a History item to the hover links, just after Edit
+ if ( $akismet_result ) {
+ $b = array();
+ foreach ( $a as $k => $item ) {
+ $b[ $k ] = $item;
+ if ( $k == 'edit' )
+ $b['history'] = '<a href="comment.php?action=editcomment&c='.$comment->comment_ID.'#akismet-status" title="'. esc_attr__( 'View comment history' ) . '"> '. __('History') . '</a>';
+ }
+
+ $a = $b;
+ }
+
if ( $desc )
- echo '<span style="background: #EEE; border: 1px solid #E4E4E4; margin-top: 3px; color: #999; padding: 1px 8px 2px 8px; -moz-border-radius:6px; border-radius:6px; -webkit-border-radius:6px; float: right; line-height: 1.2em;"><a href="comment.php?action=editcomment&c='.$comment->comment_ID.'#akismet-status" title="' . esc_attr__( 'View comment history' ) . '">'.htmlspecialchars($desc).'</a></span>';
+ echo '<span class="akismet-status" commentid="'.$comment->comment_ID.'"><a href="comment.php?action=editcomment&c='.$comment->comment_ID.'#akismet-status" title="' . esc_attr__( 'View comment history' ) . '">'.htmlspecialchars($desc).'</a></span>';
+
+ if ( apply_filters( 'akismet_show_user_comments_approved', get_option('akismet_show_user_comments_approved') ) == 'true' ) {
+ $comment_count = akismet_get_user_comments_approved( $comment->user_id, $comment->comment_author_email, $comment->comment_author, $comment->comment_author_url );
+ $comment_count = intval( $comment_count );
+ echo '<span class="akismet-user-comment-count" commentid="'.$comment->comment_ID.'" style="display:none;"><br><span class="akismet-user-comment-counts">'.sprintf( _n( '%s approved', '%s approved', $comment_count ), number_format_i18n( $comment_count ) ) . '</span></span>';
+ }
return $a;
}
add_filter( 'comment_row_actions', 'akismet_comment_row_action', 10, 2 );
-
function akismet_comment_status_meta_box($comment) {
$history = akismet_get_comment_history( $comment->comment_ID );
// END FIXME
+// call out URLS in comments
+function akismet_text_add_link_callback( $m ) {
+
+ // bare link?
+ if ( $m[4] == $m[2] )
+ return '<a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a>';
+ else
+ return '<span title="'.$m[2].'" class="comment-link"><a '.$m[1].' href="'.$m[2].'" '.$m[3].' class="comment-link">'.$m[4].'</a></span>';
+}
+
+function akismet_text_add_link_class( $comment_text ) {
+
+ return preg_replace_callback( '#<a ([^>]*)href="([^"]+)"([^>]*)>(.*?)</a>#i', 'akismet_text_add_link_callback', $comment_text );
+}
+
+add_filter('comment_text', 'akismet_text_add_link_class');
+
+
// WP 2.5+
function akismet_rightnow() {
global $submenu, $wp_db_version;
- $plural_func = '__ngettext';
- if ( function_exists( '_n' ) )
- $plural_func = '_n';
-
// clean_url was deprecated in WP 3.0
$esc_url = 'clean_url';
if ( function_exists( 'esc_url' ) )
$link = 'edit.php?page=akismet-admin';
if ( $count = get_option('akismet_spam_count') ) {
- $intro = sprintf( $plural_func(
- '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already,',
- '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already,',
+ $intro = sprintf( _n(
+ '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already. ',
+ '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already. ',
$count
), 'http://akismet.com/', number_format_i18n( $count ) );
} else {
- $intro = sprintf( __('<a href="%1$s">Akismet</a> blocks spam from getting to your blog,'), 'http://akismet.com/' );
+ $intro = sprintf( __('<a href="%1$s">Akismet</a> blocks spam from getting to your blog. '), 'http://akismet.com/' );
}
if ( $queue_count = akismet_spam_count() ) {
- $queue_text = sprintf( $plural_func(
- 'and there\'s <a href="%2$s">%1$s comment</a> in your spam queue right now.',
- 'and there are <a href="%2$s">%1$s comments</a> in your spam queue right now.',
+ $queue_text = sprintf( _n(
+ 'There\'s <a href="%2$s">%1$s comment</a> in your spam queue right now.',
+ 'There are <a href="%2$s">%1$s comments</a> in your spam queue right now.',
$queue_count
), number_format_i18n( $queue_count ), $esc_url($link) );
} else {
- $queue_text = sprintf( __( " but there's nothing in your <a href='%1\$s'>spam queue</a> at the moment." ), $esc_url($link) );
+ $queue_text = sprintf( __( "There's nothing in your <a href='%1\$s'>spam queue</a> at the moment." ), $esc_url($link) );
}
- // _c was deprecated in WP 2.9.0
- if ( function_exists( '_x' ) )
- $text = sprintf( _x( '%1$s%2$s', 'akismet_rightnow' ), $intro, $queue_text );
- else
- $text = sprintf( _c( '%1$s%2$s|akismet_rightnow' ), $intro, $queue_text );
-
+ $text = $intro . '<br />' . $queue_text;
echo "<p class='akismet-right-now'>$text</p>\n";
}
$comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_id'");
if ( !$comment ) // it was deleted
return;
- $comment->blog = get_option('home');
+
+ // use the original version stored in comment_meta if available
+ $as_submitted = get_comment_meta( $comment_id, 'akismet_as_submitted', true);
+ if ( $as_submitted && is_array($as_submitted) && isset($as_submitted['comment_content']) ) {
+ $comment = (object) array_merge( (array)$comment, $as_submitted );
+ }
+
+ $comment->blog = get_bloginfo('url');
$comment->blog_lang = get_locale();
$comment->blog_charset = get_option('blog_charset');
$comment->permalink = get_permalink($comment->comment_post_ID);
+ $comment->reporter_ip = $_SERVER['REMOTE_ADDR'];
if ( is_object($current_user) ) {
$comment->reporter = $current_user->user_login;
}
if ( isset( $comment->user_ID ) )
$comment->user_role = akismet_get_user_roles($comment->user_ID);
+ if ( akismet_test_mode() )
+ $comment->is_test = 'true';
+
$query_string = '';
foreach ( $comment as $key => $data )
$query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
$response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-ham", $akismet_api_port);
if ( $comment->reporter ) {
- akismet_update_comment_history( $comment_id, sprintf( __('%s un-spammed this comment'), $comment->reporter ), 'report-ham' );
+ akismet_update_comment_history( $comment_id, sprintf( __('%s reported this comment as not spam'), $comment->reporter ), 'report-ham' );
update_comment_meta( $comment_id, 'akismet_user_result', 'false' );
update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
- } else {
- akismet_update_comment_history( $comment_id, 'A plugin un-spammed this comment', 'report-ham' );
}
do_action('akismet_submit_nonspam_comment', $comment_id, $response[1]);
return;
if ( 'spam' != $comment->comment_approved )
return;
- $comment->blog = get_option('home');
+
+ // use the original version stored in comment_meta if available
+ $as_submitted = get_comment_meta( $comment_id, 'akismet_as_submitted', true);
+ if ( $as_submitted && is_array($as_submitted) && isset($as_submitted['comment_content']) ) {
+ $comment = (object) array_merge( (array)$comment, $as_submitted );
+ }
+
+ $comment->blog = get_bloginfo('url');
$comment->blog_lang = get_locale();
$comment->blog_charset = get_option('blog_charset');
$comment->permalink = get_permalink($comment->comment_post_ID);
+ $comment->reporter_ip = $_SERVER['REMOTE_ADDR'];
if ( is_object($current_user) ) {
$comment->reporter = $current_user->user_login;
}
}
$comment->user_role = '';
- if ( !isset( $comment->user_id ) )
+ if ( isset( $comment->user_ID ) )
$comment->user_role = akismet_get_user_roles($comment->user_ID);
+ if ( akismet_test_mode() )
+ $comment->is_test = 'true';
+
$query_string = '';
foreach ( $comment as $key => $data )
$query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
$response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-spam", $akismet_api_port);
if ( $comment->reporter ) {
- akismet_update_comment_history( $comment_id, sprintf( __('%s spammed this comment'), $comment->reporter ), 'report-spam' );
+ akismet_update_comment_history( $comment_id, sprintf( __('%s reported this comment as spam'), $comment->reporter ), 'report-spam' );
update_comment_meta( $comment_id, 'akismet_user_result', 'true' );
update_comment_meta( $comment_id, 'akismet_user', $comment->reporter );
- } else
- akismet_update_comment_history( $comment_id, 'A plugin spammed this comment', 'report-ham' );
+ }
do_action('akismet_submit_spam_comment', $comment_id, $response[1]);
}
function akismet_transition_comment_status( $new_status, $old_status, $comment ) {
if ( $new_status == $old_status )
return;
+
+ # we don't need to record a history item for deleted comments
+ if ( $new_status == 'delete' )
+ 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 );
+ if ( !is_admin() )
+ return;
+
+ if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) && !current_user_can( 'moderate_comments' ) )
+ return;
+
+ if ( defined('WP_IMPORTING') && WP_IMPORTING == true )
+ return;
+
+ global $current_user;
+ $reporter = '';
+ if ( is_object( $current_user ) )
+ $reporter = $current_user->user_login;
+
+ // Assumption alert:
+ // We want to submit comments to Akismet only when a moderator explicitly spams or approves it - not if the status
+ // is changed automatically by another plugin. Unfortunately WordPress doesn't provide an unambiguous way to
+ // determine why the transition_comment_status action was triggered. And there are several different ways by which
+ // to spam and unspam comments: bulk actions, ajax, links in moderation emails, the dashboard, and perhaps others.
+ // We'll assume that this is an explicit user action if POST or GET has an 'action' key.
+ if ( isset($_POST['action']) || isset($_GET['action']) ) {
+ if ( $new_status == 'spam' && ( $old_status == 'approved' || $old_status == 'unapproved' || !$old_status ) ) {
+ return akismet_submit_spam_comment( $comment->comment_ID );
+ } elseif ( $old_status == 'spam' && ( $new_status == 'approved' || $new_status == 'unapproved' ) ) {
+ return akismet_submit_nonspam_comment( $comment->comment_ID );
+ }
}
+
+ if ( !get_comment_meta( $comment->comment_ID, 'akismet_rechecking' ) )
+ akismet_update_comment_history( $comment->comment_ID, sprintf( __('%s changed the comment status to %s'), $reporter, $new_status ), 'status-' . $new_status );
}
add_action( 'transition_comment_status', 'akismet_transition_comment_status', 10, 3 );
$c['user_ip'] = $c['comment_author_IP'];
$c['user_agent'] = $c['comment_agent'];
$c['referrer'] = '';
- $c['blog'] = get_option('home');
+ $c['blog'] = get_bloginfo('url');
$c['blog_lang'] = get_locale();
$c['blog_charset'] = get_option('blog_charset');
$c['permalink'] = get_permalink($c['comment_post_ID']);
if ( isset( $c['user_ID'] ) )
$c['user_role'] = akismet_get_user_roles($c['user_ID']);
+ if ( akismet_test_mode() )
+ $c['is_test'] = 'true';
+
$id = (int) $c['comment_ID'];
$query_string = '';
}
add_action('admin_action_akismet_recheck_queue', 'akismet_recheck_queue');
+
+// Check connectivity between the WordPress blog and Akismet's servers.
+// Returns an associative array of server IP addresses, where the key is the IP address, and value is true (available) or false (unable to connect).
+function akismet_check_server_connectivity() {
+ global $akismet_api_host, $akismet_api_port, $wpcom_api_key;
+
+ $test_host = 'rest.akismet.com';
+
+ // Some web hosts may disable one or both functions
+ if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') )
+ return array();
+
+ $ips = gethostbynamel($test_host);
+ if ( !$ips || !is_array($ips) || !count($ips) )
+ return array();
+
+ $servers = array();
+ foreach ( $ips as $ip ) {
+ $response = akismet_verify_key( akismet_get_key(), $ip );
+ // even if the key is invalid, at least we know we have connectivity
+ if ( $response == 'valid' || $response == 'invalid' )
+ $servers[$ip] = true;
+ else
+ $servers[$ip] = false;
+ }
+
+ return $servers;
+}
+
+// Check the server connectivity and store the results in an option.
+// Cached results will be used if not older than the specified timeout in seconds; use $cache_timeout = 0 to force an update.
+// Returns the same associative array as akismet_check_server_connectivity()
+function akismet_get_server_connectivity( $cache_timeout = 86400 ) {
+ $servers = get_option('akismet_available_servers');
+ if ( (time() - get_option('akismet_connectivity_time') < $cache_timeout) && $servers !== false )
+ return $servers;
+
+ // There's a race condition here but the effect is harmless.
+ $servers = akismet_check_server_connectivity();
+ update_option('akismet_available_servers', $servers);
+ update_option('akismet_connectivity_time', time());
+ return $servers;
+}
+
+// Returns true if server connectivity was OK at the last check, false if there was a problem that needs to be fixed.
+function akismet_server_connectivity_ok() {
+ // skip the check on WPMU because the status page is hidden
+ global $wpcom_api_key;
+ if ( $wpcom_api_key )
+ return true;
+ $servers = akismet_get_server_connectivity();
+ return !( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) );
+}
+
--- /dev/null
+#submitted-on { position: relative; }
+#the-comment-list .author .akismet-user-comment-count { display: inline; }
+#dashboard_recent_comments .akismet-status { display: none; } /* never show the flagged by text on the dashboard */
+.akismet-status { float: right; }
+.akismet-status a { color: #AAA; font-style: italic; }
+span.comment-link a { text-decoration: underline; }
+span.comment-link:after { content: " " attr(title) " "; color: #aaa; text-decoration: none; }
--- /dev/null
+jQuery(document).ready(function () {
+ jQuery('.akismet-status').each(function () {
+ var thisId = jQuery(this).attr('commentid');
+ jQuery(this).prependTo('#comment-' + thisId + ' .column-comment div:first-child');
+ });
+ jQuery('.akismet-user-comment-count').each(function () {
+ var thisId = jQuery(this).attr('commentid');
+ jQuery(this).insertAfter('#comment-' + thisId + ' .author strong:first').show();
+ });
+});
/*
Plugin Name: Akismet
Plugin URI: http://akismet.com/
-Description: Akismet checks your comments against the Akismet web service to see if they look like spam or not. You need an <a href="http://akismet.com/get/">API key</a> to use it. You can review the spam it catches under "Comments." To show off your Akismet stats just put <code><?php akismet_counter(); ?></code> in your template. See also: <a href="http://wordpress.org/extend/plugins/stats/">WP Stats plugin</a>.
-Version: 2.4.0
+Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://akismet.com/get/?return=true">Sign up for an Akismet API key</a>, and 3) Go to your <a href="plugins.php?page=akismet-key-config">Akismet configuration</a> page, and save your API key.
+Version: 2.5.3
Author: Automattic
Author URI: http://automattic.com/wordpress-plugins/
-License: GPLv2
+License: GPLv2 or later
*/
/*
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; version 2 of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-define('AKISMET_VERSION', '2.4.0');
+define('AKISMET_VERSION', '2.5.3');
+define('AKISMET_PLUGIN_URL', plugin_dir_url( __FILE__ ));
/** If you hardcode a WP.com API key here, all key config screens will be hidden */
if ( defined('WPCOM_API_KEY') )
exit;
}
-if ( $wp_db_version <= 9872 )
- include_once( dirname(__FILE__) . '/legacy.php' );
+if ( isset($wp_db_version) && $wp_db_version <= 9872 )
+ include_once dirname( __FILE__ ) . '/legacy.php';
+
+include_once dirname( __FILE__ ) . '/widget.php';
+
+if ( is_admin() )
+ require_once dirname( __FILE__ ) . '/admin.php';
function akismet_init() {
global $wpcom_api_key, $akismet_api_host, $akismet_api_port;
$akismet_api_host = get_option('wordpress_api_key') . '.rest.akismet.com';
$akismet_api_port = 80;
- add_action('admin_menu', 'akismet_config_page');
- add_action('admin_menu', 'akismet_stats_page');
- akismet_admin_warnings();
}
add_action('init', 'akismet_init');
-function akismet_admin_init() {
- if ( function_exists( 'get_plugin_page_hook' ) )
- $hook = get_plugin_page_hook( 'akismet-stats-display', 'index.php' );
- else
- $hook = 'dashboard_page_akismet-stats-display';
- add_action('admin_head-'.$hook, 'akismet_stats_script');
-}
-add_action('admin_init', 'akismet_admin_init');
-
-if ( !function_exists('wp_nonce_field') ) {
- function akismet_nonce_field($action = -1) { return; }
- $akismet_nonce = -1;
-} else {
- function akismet_nonce_field($action = -1) { return wp_nonce_field($action); }
- $akismet_nonce = 'akismet-update-key';
-}
-
-if ( !function_exists('number_format_i18n') ) {
- function number_format_i18n( $number, $decimals = null ) { return number_format( $number, $decimals ); }
-}
-
-function akismet_config_page() {
- if ( function_exists('add_submenu_page') )
- add_submenu_page('plugins.php', __('Akismet Configuration'), __('Akismet Configuration'), 'manage_options', 'akismet-key-config', 'akismet_conf');
-
-}
-
-function akismet_conf() {
- global $akismet_nonce, $wpcom_api_key;
-
- if ( isset($_POST['submit']) ) {
- if ( function_exists('current_user_can') && !current_user_can('manage_options') )
- die(__('Cheatin’ uh?'));
-
- check_admin_referer( $akismet_nonce );
- $key = preg_replace( '/[^a-h0-9]/i', '', $_POST['key'] );
-
- if ( empty($key) ) {
- $key_status = 'empty';
- $ms[] = 'new_key_empty';
- delete_option('wordpress_api_key');
- } else {
- $key_status = akismet_verify_key( $key );
- }
-
- if ( $key_status == 'valid' ) {
- update_option('wordpress_api_key', $key);
- $ms[] = 'new_key_valid';
- } else if ( $key_status == 'invalid' ) {
- $ms[] = 'new_key_invalid';
- } else if ( $key_status == 'failed' ) {
- $ms[] = 'new_key_failed';
- }
-
- if ( isset( $_POST['akismet_discard_month'] ) )
- update_option( 'akismet_discard_month', 'true' );
- else
- update_option( 'akismet_discard_month', 'false' );
- } elseif ( isset($_POST['check']) ) {
- akismet_get_server_connectivity(0);
- }
-
- if ( empty( $key_status) || $key_status != 'valid' ) {
- $key = get_option('wordpress_api_key');
- if ( empty( $key ) ) {
- if ( empty( $key_status ) || $key_status != 'failed' ) {
- if ( akismet_verify_key( '1234567890ab' ) == 'failed' )
- $ms[] = 'no_connection';
- else
- $ms[] = 'key_empty';
- }
- $key_status = 'empty';
- } else {
- $key_status = akismet_verify_key( $key );
- }
- if ( $key_status == 'valid' ) {
- $ms[] = 'key_valid';
- } else if ( $key_status == 'invalid' ) {
- delete_option('wordpress_api_key');
- $ms[] = 'key_empty';
- } else if ( !empty($key) && $key_status == 'failed' ) {
- $ms[] = 'key_failed';
- }
- }
-
- $messages = array(
- 'new_key_empty' => array('color' => 'aa0', 'text' => __('Your key has been cleared.')),
- 'new_key_valid' => array('color' => '2d2', 'text' => __('Your key has been verified. Happy blogging!')),
- 'new_key_invalid' => array('color' => 'd22', 'text' => __('The key you entered is invalid. Please double-check it.')),
- 'new_key_failed' => array('color' => 'd22', 'text' => __('The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.')),
- 'no_connection' => array('color' => 'd22', 'text' => __('There was a problem connecting to the Akismet server. Please check your server configuration.')),
- 'key_empty' => array('color' => 'aa0', 'text' => sprintf(__('Please enter an API key. (<a href="%s" style="color:#fff">Get your key.</a>)'), 'http://akismet.com/get/')),
- 'key_valid' => array('color' => '2d2', 'text' => __('This key is valid.')),
- 'key_failed' => array('color' => 'aa0', 'text' => __('The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.')));
-?>
-<?php if ( !empty($_POST['submit'] ) ) : ?>
-<div id="message" class="updated fade"><p><strong><?php _e('Options saved.') ?></strong></p></div>
-<?php endif; ?>
-<div class="wrap">
-<h2><?php _e('Akismet Configuration'); ?></h2>
-<div class="narrow">
-<form action="" method="post" id="akismet-conf" style="margin: auto; width: 400px; ">
-<?php if ( !$wpcom_api_key ) { ?>
- <p><?php printf(__('For many people, <a href="%1$s">Akismet</a> will greatly reduce or even completely eliminate the comment and trackback spam you get on your site. If one does happen to get through, simply mark it as "spam" on the moderation screen and Akismet will learn from the mistakes. If you don\'t have an API key yet, you can get one at <a href="%2$s">Akismet.com</a>.'), 'http://akismet.com/', 'http://akismet.com/get/'); ?></p>
-
-<h3><label for="key"><?php _e('Akismet API Key'); ?></label></h3>
-<?php foreach ( $ms as $m ) : ?>
- <p style="padding: .5em; background-color: #<?php echo $messages[$m]['color']; ?>; color: #fff; font-weight: bold;"><?php echo $messages[$m]['text']; ?></p>
-<?php endforeach; ?>
-<p><input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo get_option('wordpress_api_key'); ?>" style="font-family: 'Courier New', Courier, mono; font-size: 1.5em;" /> (<?php _e('<a href="http://akismet.com/get/">What is this?</a>'); ?>)</p>
-<?php if ( isset( $invalid_key) && $invalid_key ) { ?>
-<h3><?php _e('Why might my key be invalid?'); ?></h3>
-<p><?php _e('This can mean one of two things, either you copied the key wrong or that the plugin is unable to reach the Akismet servers, which is most often caused by an issue with your web host around firewalls or similar.'); ?></p>
-<?php } ?>
-<?php } ?>
-<?php akismet_nonce_field($akismet_nonce) ?>
-<p><label><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php if ( get_option('akismet_discard_month') == 'true' ) echo ' checked="checked" '; ?> /> <?php _e('Automatically discard spam comments on posts older than a month.'); ?></label></p>
- <p class="submit"><input type="submit" name="submit" value="<?php _e('Update options »'); ?>" /></p>
-</form>
-
-<form action="" method="post" id="akismet-connectivity" style="margin: auto; width: 400px; ">
-
-<h3><?php _e('Server Connectivity'); ?></h3>
-<?php
- if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') ) {
- ?>
- <p style="padding: .5em; background-color: #d22; color: #fff; font-weight:bold;"><?php _e('Network functions are disabled.'); ?></p>
- <p><?php echo sprintf( __('Your web host or server administrator has disabled PHP\'s <code>fsockopen</code> or <code>gethostbynamel</code> functions. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet\'s system requirements</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
- <?php
- } else {
- $servers = akismet_get_server_connectivity();
- $fail_count = count($servers) - count( array_filter($servers) );
- if ( is_array($servers) && count($servers) > 0 ) {
- // some connections work, some fail
- if ( $fail_count > 0 && $fail_count < count($servers) ) { ?>
- <p style="padding: .5em; background-color: #aa0; color: #fff; font-weight:bold;"><?php _e('Unable to reach some Akismet servers.'); ?></p>
- <p><?php echo sprintf( __('A network problem or firewall is blocking some connections from your web server to Akismet.com. Akismet is working but this may cause problems during times of network congestion. Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
- <?php
- // all connections fail
- } elseif ( $fail_count > 0 ) { ?>
- <p style="padding: .5em; background-color: #d22; color: #fff; font-weight:bold;"><?php _e('Unable to reach any Akismet servers.'); ?></p>
- <p><?php echo sprintf( __('A network problem or firewall is blocking all connections from your web server to Akismet.com. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
- <?php
- // all connections work
- } else { ?>
- <p style="padding: .5em; background-color: #2d2; color: #fff; font-weight:bold;"><?php _e('All Akismet servers are available.'); ?></p>
- <p><?php _e('Akismet is working correctly. All servers are accessible.'); ?></p>
- <?php
- }
- } else {
- ?>
- <p style="padding: .5em; background-color: #d22; color: #fff; font-weight:bold;"><?php _e('Unable to find Akismet servers.'); ?></p>
- <p><?php echo sprintf( __('A DNS problem or firewall is preventing all access from your web server to Akismet.com. <strong>Akismet cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Akismet and firewalls</a>.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?></p>
- <?php
- }
- }
-
- if ( !empty($servers) ) {
-?>
-<table style="width: 100%;">
-<thead><th><?php _e('Akismet server'); ?></th><th><?php _e('Network Status'); ?></th></thead>
-<tbody>
-<?php
- asort($servers);
- foreach ( $servers as $ip => $status ) {
- $color = ( $status ? '#2d2' : '#d22');
- ?>
- <tr>
- <td><?php echo htmlspecialchars($ip); ?></td>
- <td style="padding: 0 .5em; font-weight:bold; color: #fff; background-color: <?php echo $color; ?>"><?php echo ($status ? __('No problems') : __('Obstructed') ); ?></td>
-
- <?php
- }
- }
-?>
-</tbody>
-</table>
- <p><?php if ( get_option('akismet_connectivity_time') ) echo sprintf( __('Last checked %s ago.'), human_time_diff( get_option('akismet_connectivity_time') ) ); ?></p>
- <p class="submit"><input type="submit" name="check" value="<?php _e('Check network status »'); ?>" /></p>
-</form>
-
-</div>
-</div>
-<?php
-}
-
-function akismet_stats_page() {
- if ( function_exists('add_submenu_page') )
- add_submenu_page('index.php', __('Akismet Stats'), __('Akismet Stats'), 'manage_options', 'akismet-stats-display', 'akismet_stats_display');
-
-}
-
-function akismet_stats_script() {
- ?>
-<script type="text/javascript">
-function resizeIframe() {
- var height = document.documentElement.clientHeight;
- height -= document.getElementById('akismet-stats-frame').offsetTop;
- height += 100; // magic padding
-
- document.getElementById('akismet-stats-frame').style.height = height +"px";
-
-};
-function resizeIframeInit() {
- document.getElementById('akismet-stats-frame').onload = resizeIframe;
- window.onresize = resizeIframe;
-}
-addLoadEvent(resizeIframeInit);
-</script><?php
-}
-
-
-function akismet_stats_display() {
- global $akismet_api_host, $akismet_api_port, $wpcom_api_key;
- $blog = urlencode( get_option('home') );
- $url = "http://".akismet_get_key().".web.akismet.com/1.0/user-stats.php?blog={$blog}";
- ?>
- <div class="wrap">
- <iframe src="<?php echo $url; ?>" width="100%" height="100%" frameborder="0" id="akismet-stats-frame"></iframe>
- </div>
- <?php
-}
-
-function akismet_stats() {
- if ( !function_exists('did_action') || did_action( 'rightnow_end' ) ) // We already displayed this info in the "Right Now" section
- return;
- if ( !$count = get_option('akismet_spam_count') )
- return;
- $path = plugin_basename(__FILE__);
- echo '<h3>'.__('Spam').'</h3>';
- global $submenu;
- if ( isset( $submenu['edit-comments.php'] ) )
- $link = 'edit-comments.php';
- else
- $link = 'edit.php';
- echo '<p>'.sprintf(__('<a href="%1$s">Akismet</a> has protected your site from <a href="%2$s">%3$s spam comments</a>.'), 'http://akismet.com/', clean_url("$link?page=akismet-admin"), number_format_i18n($count) ).'</p>';
-}
-add_action('activity_box_end', 'akismet_stats');
-
function akismet_get_key() {
global $wpcom_api_key;
if ( !empty($wpcom_api_key) )
return $response[1];
}
-// Check connectivity between the WordPress blog and Akismet's servers.
-// Returns an associative array of server IP addresses, where the key is the IP address, and value is true (available) or false (unable to connect).
-function akismet_check_server_connectivity() {
- global $akismet_api_host, $akismet_api_port, $wpcom_api_key;
-
- $test_host = 'rest.akismet.com';
-
- // Some web hosts may disable one or both functions
- if ( !function_exists('fsockopen') || !function_exists('gethostbynamel') )
- return array();
-
- $ips = gethostbynamel($test_host);
- if ( !$ips || !is_array($ips) || !count($ips) )
- return array();
-
- $servers = array();
- foreach ( $ips as $ip ) {
- $response = akismet_verify_key( akismet_get_key(), $ip );
- // even if the key is invalid, at least we know we have connectivity
- if ( $response == 'valid' || $response == 'invalid' )
- $servers[$ip] = true;
- else
- $servers[$ip] = false;
- }
-
- return $servers;
-}
-
-// Check the server connectivity and store the results in an option.
-// Cached results will be used if not older than the specified timeout in seconds; use $cache_timeout = 0 to force an update.
-// Returns the same associative array as akismet_check_server_connectivity()
-function akismet_get_server_connectivity( $cache_timeout = 86400 ) {
- $servers = get_option('akismet_available_servers');
- if ( (time() - get_option('akismet_connectivity_time') < $cache_timeout) && $servers !== false )
- return $servers;
-
- // There's a race condition here but the effect is harmless.
- $servers = akismet_check_server_connectivity();
- update_option('akismet_available_servers', $servers);
- update_option('akismet_connectivity_time', time());
- return $servers;
-}
-
-// Returns true if server connectivity was OK at the last check, false if there was a problem that needs to be fixed.
-function akismet_server_connectivity_ok() {
- // skip the check on WPMU because the status page is hidden
- global $wpcom_api_key;
- if ( $wpcom_api_key )
+// if we're in debug or test modes, use a reduced service level so as not to polute training or stats data
+function akismet_test_mode() {
+ if ( defined('AKISMET_TEST_MODE') && AKISMET_TEST_MODE )
return true;
- $servers = akismet_get_server_connectivity();
- return !( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) );
-}
-
-function akismet_admin_warnings() {
- global $wpcom_api_key;
- if ( !get_option('wordpress_api_key') && !$wpcom_api_key && !isset($_POST['submit']) ) {
- function akismet_warning() {
- echo "
- <div id='akismet-warning' class='updated fade'><p><strong>".__('Akismet is almost ready.')."</strong> ".sprintf(__('You must <a href="%1$s">enter your Akismet API key</a> for it to work.'), "plugins.php?page=akismet-key-config")."</p></div>
- ";
- }
- add_action('admin_notices', 'akismet_warning');
- return;
- } elseif ( get_option('akismet_connectivity_time') && empty($_POST) && is_admin() && !akismet_server_connectivity_ok() ) {
- function akismet_warning() {
- echo "
- <div id='akismet-warning' class='updated fade'><p><strong>".__('Akismet has detected a problem.')."</strong> ".sprintf(__('A server or network problem is preventing Akismet from working correctly. <a href="%1$s">Click here for more information</a> about how to fix the problem.'), "plugins.php?page=akismet-key-config")."</p></div>
- ";
- }
- add_action('admin_notices', 'akismet_warning');
- return;
- }
-}
-
-function akismet_get_host($host) {
- // if all servers are accessible, just return the host name.
- // if not, return an IP that was known to be accessible at the last check.
- if ( akismet_server_connectivity_ok() ) {
- return $host;
- } else {
- $ips = akismet_get_server_connectivity();
- // a firewall may be blocking access to some Akismet IPs
- if ( count($ips) > 0 && count(array_filter($ips)) < count($ips) ) {
- // use DNS to get current IPs, but exclude any known to be unreachable
- $dns = (array)gethostbynamel( rtrim($host, '.') . '.' );
- $dns = array_filter($dns);
- foreach ( $dns as $ip ) {
- if ( array_key_exists( $ip, $ips ) && empty( $ips[$ip] ) )
- unset($dns[$ip]);
- }
- // return a random IP from those available
- if ( count($dns) )
- return $dns[ array_rand($dns) ];
-
- }
- }
- // if all else fails try the host name
- return $host;
+ return false;
}
// return a comma-separated list of role names for the given user
if ( isset($comment_user->roles) )
$roles = join(',', $comment_user->roles);
}
-
+
+ if ( is_multisite() && is_super_admin( $user_id ) ) {
+ if ( empty( $roles ) ) {
+ $roles = 'super_admin';
+ } else {
+ $comment_user->roles[] = 'super_admin';
+ $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;
-
- $akismet_version = constant('AKISMET_VERSION');
-
- $http_request = "POST $path HTTP/1.0\r\n";
- $http_request .= "Host: $host\r\n";
- $http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n";
- $http_request .= "Content-Length: " . strlen($request) . "\r\n";
- $http_request .= "User-Agent: WordPress/$wp_version | Akismet/$akismet_version\r\n";
- $http_request .= "\r\n";
- $http_request .= $request;
-
+
+ $akismet_ua = "WordPress/{$wp_version} | ";
+ $akismet_ua .= 'Akismet/' . constant( 'AKISMET_VERSION' );
+
+ $content_length = strlen( $request );
+
$http_host = $host;
- // use a specific IP if provided - needed by akismet_check_server_connectivity()
- if ( $ip && long2ip(ip2long($ip)) ) {
+ // use a specific IP if provided
+ // needed by akismet_check_server_connectivity()
+ if ( $ip && long2ip( ip2long( $ip ) ) ) {
$http_host = $ip;
} else {
- $http_host = akismet_get_host($host);
+ $http_host = $host;
}
-
- $response = '';
- if( false != ( $fs = @fsockopen($http_host, $port, $errno, $errstr, 10) ) ) {
- fwrite($fs, $http_request);
-
- while ( !feof($fs) )
- $response .= fgets($fs, 1160); // One TCP-IP packet
- fclose($fs);
- $response = explode("\r\n\r\n", $response, 2);
+
+ // use the WP HTTP class if it is available
+ if ( function_exists( 'wp_remote_post' ) ) {
+ $http_args = array(
+ 'body' => $request,
+ 'headers' => array(
+ 'Content-Type' => 'application/x-www-form-urlencoded; ' .
+ 'charset=' . get_option( 'blog_charset' ),
+ 'Host' => $host,
+ 'User-Agent' => $akismet_ua
+ ),
+ 'httpversion' => '1.0',
+ 'timeout' => 15
+ );
+ $akismet_url = "http://{$http_host}{$path}";
+ $response = wp_remote_post( $akismet_url, $http_args );
+ if ( is_wp_error( $response ) )
+ return '';
+
+ return array( $response['headers'], $response['body'] );
+ } else {
+ $http_request = "POST $path HTTP/1.0\r\n";
+ $http_request .= "Host: $host\r\n";
+ $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . get_option('blog_charset') . "\r\n";
+ $http_request .= "Content-Length: {$content_length}\r\n";
+ $http_request .= "User-Agent: {$akismet_ua}\r\n";
+ $http_request .= "\r\n";
+ $http_request .= $request;
+
+ $response = '';
+ if( false != ( $fs = @fsockopen( $http_host, $port, $errno, $errstr, 10 ) ) ) {
+ fwrite( $fs, $http_request );
+
+ while ( !feof( $fs ) )
+ $response .= fgets( $fs, 1160 ); // One TCP-IP packet
+ fclose( $fs );
+ $response = explode( "\r\n\r\n", $response, 2 );
+ }
+ return $response;
}
- return $response;
}
// filter handler used to return a spam result to pre_comment_approved
// bump the counter here instead of when the filter is added to reduce the possibility of overcounting
if ( $incr = apply_filters('akismet_spam_count_incr', 1) )
update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );
+ // this is a one-shot deal
+ remove_filter( 'pre_comment_approved', 'akismet_result_spam' );
return 'spam';
}
+function akismet_result_hold( $approved ) {
+ // once only
+ remove_filter( 'pre_comment_approved', 'akismet_result_hold' );
+ return '0';
+}
+
+// how many approved comments does this author have?
+function akismet_get_user_comments_approved( $user_id, $comment_author_email, $comment_author, $comment_author_url ) {
+ global $wpdb;
+
+ if ( !empty($user_id) )
+ return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE user_id = %d AND comment_approved = 1", $user_id ) );
+
+ if ( !empty($comment_author_email) )
+ return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_author_email = %s AND comment_author = %s AND comment_author_url = %s AND comment_approved = 1", $comment_author_email, $comment_author, $comment_author_url ) );
+
+ return 0;
+}
+
+function akismet_microtime() {
+ $mtime = explode( ' ', microtime() );
+ return $mtime[1] + $mtime[0];
+}
+
+// log an event for a given comment, storing it in comment_meta
+function akismet_update_comment_history( $comment_id, $message, $event=null ) {
+ global $current_user;
+
+ // failsafe for old WP versions
+ if ( !function_exists('add_comment_meta') )
+ return false;
+
+ $user = '';
+ if ( is_object($current_user) && isset($current_user->user_login) )
+ $user = $current_user->user_login;
+
+ $event = array(
+ 'time' => akismet_microtime(),
+ 'message' => $message,
+ 'event' => $event,
+ 'user' => $user,
+ );
+
+ // $unique = false so as to allow multiple values per comment
+ $r = add_comment_meta( $comment_id, 'akismet_history', $event, false );
+}
+
+// get the full comment history for a given comment, as an array in reverse chronological order
+function akismet_get_comment_history( $comment_id ) {
+
+ // failsafe for old WP versions
+ if ( !function_exists('add_comment_meta') )
+ return false;
+
+ $history = get_comment_meta( $comment_id, 'akismet_history', false );
+ usort( $history, 'akismet_cmp_time' );
+ return $history;
+}
+
+function akismet_cmp_time( $a, $b ) {
+ return $a['time'] > $b['time'] ? -1 : 1;
+}
+
+// this fires on wp_insert_comment. we can't update comment_meta when akismet_auto_check_comment() runs
+// because we don't know the comment ID at that point.
+function akismet_auto_check_update_meta( $id, $comment ) {
+ global $akismet_last_comment;
+
+ // failsafe for old WP versions
+ if ( !function_exists('add_comment_meta') )
+ return false;
+
+ // wp_insert_comment() might be called in other contexts, so make sure this is the same comment
+ // as was checked by akismet_auto_check_comment
+ if ( is_object($comment) && !empty($akismet_last_comment) && is_array($akismet_last_comment) ) {
+ if ( intval($akismet_last_comment['comment_post_ID']) == intval($comment->comment_post_ID)
+ && $akismet_last_comment['comment_author'] == $comment->comment_author
+ && $akismet_last_comment['comment_author_email'] == $comment->comment_author_email ) {
+ // normal result: true or false
+ if ( $akismet_last_comment['akismet_result'] == 'true' ) {
+ update_comment_meta( $comment->comment_ID, 'akismet_result', 'true' );
+ akismet_update_comment_history( $comment->comment_ID, __('Akismet caught this comment as spam'), 'check-spam' );
+ if ( $comment->comment_approved != 'spam' )
+ akismet_update_comment_history( $comment->comment_ID, sprintf( __('Comment status was changed to %s'), $comment->comment_approved), 'status-changed'.$comment->comment_approved );
+ } elseif ( $akismet_last_comment['akismet_result'] == 'false' ) {
+ update_comment_meta( $comment->comment_ID, 'akismet_result', 'false' );
+ akismet_update_comment_history( $comment->comment_ID, __('Akismet cleared this comment'), 'check-ham' );
+ if ( $comment->comment_approved == 'spam' ) {
+ if ( wp_blacklist_check($comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent) )
+ akismet_update_comment_history( $comment->comment_ID, __('Comment was caught by wp_blacklist_check'), 'wp-blacklisted' );
+ else
+ akismet_update_comment_history( $comment->comment_ID, sprintf( __('Comment status was changed to %s'), $comment->comment_approved), 'status-changed-'.$comment->comment_approved );
+ }
+ // abnormal result: error
+ } else {
+ update_comment_meta( $comment->comment_ID, 'akismet_error', time() );
+ akismet_update_comment_history( $comment->comment_ID, sprintf( __('Akismet was unable to check this comment (response: %s), will automatically retry again later.'), $akismet_last_comment['akismet_result']), 'check-error' );
+ }
+
+ // record the complete original data as submitted for checking
+ if ( isset($akismet_last_comment['comment_as_submitted']) )
+ update_comment_meta( $comment->comment_ID, 'akismet_as_submitted', $akismet_last_comment['comment_as_submitted'] );
+ }
+ }
+}
+
+add_action( 'wp_insert_comment', 'akismet_auto_check_update_meta', 10, 2 );
+
+
function akismet_auto_check_comment( $commentdata ) {
- global $akismet_api_host, $akismet_api_port;
+ global $akismet_api_host, $akismet_api_port, $akismet_last_comment;
$comment = $commentdata;
$comment['user_ip'] = $_SERVER['REMOTE_ADDR'];
$comment['user_role'] = akismet_get_user_roles($comment['user_ID']);
+ $akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
+ $comment['akismet_comment_nonce'] = 'inactive';
+ if ( $akismet_nonce_option == 'true' || $akismet_nonce_option == '' ) {
+ $comment['akismet_comment_nonce'] = 'failed';
+ if ( isset( $_POST['akismet_comment_nonce'] ) && wp_verify_nonce( $_POST['akismet_comment_nonce'], 'akismet_comment_nonce_' . $comment['comment_post_ID'] ) )
+ $comment['akismet_comment_nonce'] = 'passed';
+
+ // comment reply in wp-admin
+ if ( isset( $_POST['_ajax_nonce-replyto-comment'] ) && check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' ) )
+ $comment['akismet_comment_nonce'] = 'passed';
+
+ }
+
+ if ( akismet_test_mode() )
+ $comment['is_test'] = 'true';
+
+ foreach ($_POST as $key => $value ) {
+ if ( is_string($value) )
+ $comment["POST_{$key}"] = $value;
+ }
+
$ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' );
- foreach ( $_SERVER as $key => $value )
+ foreach ( $_SERVER as $key => $value ) {
if ( !in_array( $key, $ignore ) && is_string($value) )
$comment["$key"] = $value;
else
$comment["$key"] = '';
+ }
$query_string = '';
foreach ( $comment as $key => $data )
$query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
+
+ $commentdata['comment_as_submitted'] = $comment;
$response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
$commentdata['akismet_result'] = $response[1];
// 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 );
- die;
+ wp_redirect( $_SERVER['HTTP_REFERER'] );
+ die();
}
}
+ // if the response is neither true nor false, hold the comment for moderation and schedule a recheck
+ if ( 'true' != $response[1] && 'false' != $response[1] ) {
+ add_filter('pre_comment_approved', 'akismet_result_hold');
+ wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
+ }
+
if ( function_exists('wp_next_scheduled') && function_exists('wp_schedule_event') ) {
// WP 2.1+: delete old comments daily
if ( !wp_next_scheduled('akismet_scheduled_delete') )
// WP 2.0: run this one time in ten
akismet_delete_old();
}
+ $akismet_last_comment = $commentdata;
return $commentdata;
}
+add_action('preprocess_comment', 'akismet_auto_check_comment', 1);
+
function akismet_delete_old() {
global $wpdb;
$now_gmt = current_time('mysql', 1);
$comment_ids = $wpdb->get_col("SELECT comment_id FROM $wpdb->comments WHERE DATE_SUB('$now_gmt', INTERVAL 15 DAY) > comment_date_gmt AND comment_approved = 'spam'");
if ( empty( $comment_ids ) )
return;
+
+ $comma_comment_ids = implode( ', ', array_map('intval', $comment_ids) );
do_action( 'delete_comment', $comment_ids );
- $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_id IN ( " . implode( ', ', $comment_ids ) . " )");
+ $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_id IN ( $comma_comment_ids )");
+ $wpdb->query("DELETE FROM $wpdb->commentmeta WHERE comment_id IN ( $comma_comment_ids )");
+ clean_comment_cache( $comment_ids );
$n = mt_rand(1, 5000);
if ( apply_filters('akismet_optimize_table', ($n == 11)) ) // lucky number
$wpdb->query("OPTIMIZE TABLE $wpdb->comments");
add_action('akismet_scheduled_delete', '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;
+function akismet_check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {
+ global $wpdb, $akismet_api_host, $akismet_api_port;
- $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_id'");
- if ( !$comment ) // it was deleted
- return;
- $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);
- if ( is_object($current_user) ) {
- $comment->reporter = $current_user->user_login;
- }
- if ( is_object($current_site) ) {
- $comment->site_domain = $current_site->domain;
- }
-
- $comment->user_role = '';
- if ( isset( $comment->user_ID ) )
- $comment->user_role = akismet_get_user_roles($comment->user_ID);
-
- $query_string = '';
- foreach ( $comment as $key => $data )
- $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
-
- $response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-ham", $akismet_api_port);
- do_action('akismet_submit_nonspam_comment', $comment_id, $response[1]);
-}
-
-function akismet_submit_spam_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;
- if ( 'spam' != $comment->comment_approved )
- return;
- $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);
- if ( is_object($current_user) ) {
- $comment->reporter = $current_user->user_login;
- }
- if ( is_object($current_site) ) {
- $comment->site_domain = $current_site->domain;
- }
-
- $comment->user_role = '';
- if ( !isset( $comment->user_id ) )
- $comment->user_role = akismet_get_user_roles($comment->user_ID);
+ $id = (int) $id;
+ $c = $wpdb->get_row( "SELECT * FROM $wpdb->comments WHERE comment_ID = '$id'", ARRAY_A );
+ if ( !$c )
+ return;
- $query_string = '';
- foreach ( $comment as $key => $data )
- $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
-
- $response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-spam", $akismet_api_port);
- do_action('akismet_submit_spam_comment', $comment_id, $response[1]);
-}
+ $c['user_ip'] = $c['comment_author_IP'];
+ $c['user_agent'] = $c['comment_agent'];
+ $c['referrer'] = '';
+ $c['blog'] = get_option('home');
+ $c['blog_lang'] = get_locale();
+ $c['blog_charset'] = get_option('blog_charset');
+ $c['permalink'] = get_permalink($c['comment_post_ID']);
+ $id = $c['comment_ID'];
+ if ( akismet_test_mode() )
+ $c['is_test'] = 'true';
+ $c['recheck_reason'] = $recheck_reason;
-add_action('preprocess_comment', 'akismet_auto_check_comment', 1);
+ $query_string = '';
+ foreach ( $c as $key => $data )
+ $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
-// 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 );
- }
+ $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
+ return $response[1];
}
-// 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 ); }
-
-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 ) {
+function akismet_cron_recheck() {
global $wpdb;
- if ( !$type ) { // total
- $count = wp_cache_get( 'akismet_spam_count', 'widget' );
- if ( false === $count ) {
- if ( function_exists('wp_count_comments') ) {
- $count = wp_count_comments();
- $count = $count->spam;
- } else {
- $count = (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam'");
+ delete_option('akismet_available_servers');
+
+ $comment_errors = $wpdb->get_col( "
+ SELECT comment_id
+ FROM {$wpdb->prefix}commentmeta
+ WHERE meta_key = 'akismet_error'
+ LIMIT 100
+ " );
+
+ foreach ( (array) $comment_errors as $comment_id ) {
+ // if the comment no longer exists, remove the meta entry from the queue to avoid getting stuck
+ if ( !get_comment( $comment_id ) ) {
+ delete_comment_meta( $comment_id, 'akismet_error' );
+ continue;
+ }
+
+ add_comment_meta( $comment_id, 'akismet_rechecking', true );
+ $status = akismet_check_db_comment( $comment_id, 'retry' );
+
+ $msg = '';
+ if ( $status == 'true' ) {
+ $msg = __( 'Akismet caught this comment as spam during an automatic retry.' );
+ } elseif ( $status == 'false' ) {
+ $msg = __( 'Akismet cleared this comment during an automatic retry.' );
+ }
+
+ // If we got back a legit response then update the comment history
+ // other wise just bail now and try again later. No point in
+ // re-trying all the comments once we hit one failure.
+ if ( !empty( $msg ) ) {
+ delete_comment_meta( $comment_id, 'akismet_error' );
+ akismet_update_comment_history( $comment_id, $msg, 'cron-retry' );
+ update_comment_meta( $comment_id, 'akismet_result', $status );
+ // make sure the comment status is still pending. if it isn't, that means the user has already moved it elsewhere.
+ $comment = get_comment( $comment_id );
+ if ( $comment && 'unapproved' == wp_get_comment_status( $comment_id ) ) {
+ if ( $status == 'true' ) {
+ wp_spam_comment( $comment_id );
+ } elseif ( $status == 'false' ) {
+ // comment is good, but it's still in the pending queue. depending on the moderation settings
+ // we may need to change it to approved.
+ if ( check_comment($comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent, $comment->comment_type) )
+ wp_set_comment_status( $comment_id, 1 );
+ }
}
- wp_cache_set( 'akismet_spam_count', $count, 'widget', 3600 );
+ } else {
+ delete_comment_meta( $comment_id, 'akismet_rechecking' );
+ wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
+ return;
}
- return $count;
- } elseif ( 'comments' == $type || 'comment' == $type ) { // comments
- $type = '';
- } else { // pingback, trackback, ...
- $type = $wpdb->escape( $type );
- }
-
- return (int) $wpdb->get_var("SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_approved = 'spam' AND comment_type='$type'");
-}
-
-
-// WP 2.5+
-function akismet_rightnow() {
- global $submenu, $wp_db_version;
-
- // clean_url was deprecated in WP 3.0
- $esc_url = 'clean_url';
- if ( function_exists( 'esc_url' ) )
- $esc_url = 'esc_url';
-
- if ( 8645 < $wp_db_version ) // 2.7
- $link = 'edit-comments.php?comment_status=spam';
- elseif ( isset( $submenu['edit-comments.php'] ) )
- $link = 'edit-comments.php?page=akismet-admin';
- else
- $link = 'edit.php?page=akismet-admin';
-
- if ( $count = get_option('akismet_spam_count') ) {
- $intro = sprintf( __ngettext(
- '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comment already,',
- '<a href="%1$s">Akismet</a> has protected your site from %2$s spam comments already,',
- $count
- ), 'http://akismet.com/', number_format_i18n( $count ) );
- } else {
- $intro = sprintf( __('<a href="%1$s">Akismet</a> blocks spam from getting to your blog,'), 'http://akismet.com/' );
}
-
- if ( $queue_count = akismet_spam_count() ) {
- $queue_text = sprintf( __ngettext(
- 'and there\'s <a href="%2$s">%1$s comment</a> in your spam queue right now.',
- 'and there are <a href="%2$s">%1$s comments</a> in your spam queue right now.',
- $queue_count
- ), number_format_i18n( $queue_count ), clean_url($link) );
- } else {
- $queue_text = sprintf( __( "but there's nothing in your <a href='%1\$s'>spam queue</a> at the moment." ), $esc_url($link) );
- }
-
- // _c was deprecated in WP 2.9.0
- if ( function_exists( '_x' ) )
- $text = sprintf( _x( '%1$s %2$s', 'akismet_rightnow' ), $intro, $queue_text );
- else
- $text = sprintf( _c( '%1$s %2$s|akismet_rightnow' ), $intro, $queue_text );
-
- echo "<p class='akismet-right-now'>$text</p>\n";
-}
-add_action('rightnow_end', 'akismet_rightnow');
-
-
-// For WP >= 2.5
-function akismet_check_for_spam_button($comment_status) {
- if ( 'approved' == $comment_status )
- return;
- if ( function_exists('plugins_url') )
- $link = 'admin.php?action=akismet_recheck_queue';
- else
- $link = 'edit-comments.php?page=akismet-admin&recheckqueue=true&noheader=true';
- echo "</div><div class='alignleft'><a class='button-secondary checkforspam' href='$link'>" . __('Check for Spam') . "</a>";
-}
-add_action('manage_comments_nav', 'akismet_check_for_spam_button');
-
-function akismet_recheck_queue() {
- global $wpdb, $akismet_api_host, $akismet_api_port;
-
- if ( ! ( isset( $_GET['recheckqueue'] ) || ( isset( $_REQUEST['action'] ) && 'akismet_recheck_queue' == $_REQUEST['action'] ) ) )
- return;
-
- $moderation = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = '0'", ARRAY_A );
- foreach ( (array) $moderation as $c ) {
- $c['user_ip'] = $c['comment_author_IP'];
- $c['user_agent'] = $c['comment_agent'];
- $c['referrer'] = '';
- $c['blog'] = get_option('home');
- $c['blog_lang'] = get_locale();
- $c['blog_charset'] = get_option('blog_charset');
- $c['permalink'] = get_permalink($c['comment_post_ID']);
-
- $c['user_role'] = '';
- if ( isset( $c['user_ID'] ) )
- $c['user_role'] = akismet_get_user_roles($c['user_ID']);
-
- $id = (int) $c['comment_ID'];
-
- $query_string = '';
- foreach ( $c as $key => $data )
- $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
-
- $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
- if ( 'true' == $response[1] ) {
- if ( function_exists('wp_set_comment_status') )
- wp_set_comment_status($id, 'spam');
- else
- $wpdb->query("UPDATE $wpdb->comments SET comment_approved = 'spam' WHERE comment_ID = $id");
-
- }
+ $remaining = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->commentmeta WHERE meta_key = 'akismet_error'" ) );
+ if ( $remaining && !wp_next_scheduled('akismet_schedule_cron_recheck') ) {
+ wp_schedule_single_event( time() + 1200, 'akismet_schedule_cron_recheck' );
}
- wp_redirect( $_SERVER['HTTP_REFERER'] );
- exit;
}
+add_action( 'akismet_schedule_cron_recheck', 'akismet_cron_recheck' );
-add_action('admin_action_akismet_recheck_queue', 'akismet_recheck_queue');
-
-function akismet_check_db_comment( $id ) {
- global $wpdb, $akismet_api_host, $akismet_api_port;
-
- $id = (int) $id;
- $c = $wpdb->get_row( "SELECT * FROM $wpdb->comments WHERE comment_ID = '$id'", ARRAY_A );
- if ( !$c )
- return;
-
- $c['user_ip'] = $c['comment_author_IP'];
- $c['user_agent'] = $c['comment_agent'];
- $c['referrer'] = '';
- $c['blog'] = get_option('home');
- $c['blog_lang'] = get_locale();
- $c['blog_charset'] = get_option('blog_charset');
- $c['permalink'] = get_permalink($c['comment_post_ID']);
- $id = $c['comment_ID'];
-
- $query_string = '';
- foreach ( $c as $key => $data )
- $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
-
- $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
- return $response[1];
+function akismet_add_comment_nonce( $post_id ) {
+ echo '<p style="display: none;">';
+ wp_nonce_field( 'akismet_comment_nonce_' . $post_id, 'akismet_comment_nonce', FALSE );
+ echo '</p>';
}
-// Widget stuff
-function widget_akismet_register() {
- if ( function_exists('register_sidebar_widget') ) :
- function widget_akismet($args) {
- extract($args);
- $options = get_option('widget_akismet');
- $count = number_format_i18n(get_option('akismet_spam_count'));
- ?>
- <?php echo $before_widget; ?>
- <?php echo $before_title . $options['title'] . $after_title; ?>
- <div id="akismetwrap"><div id="akismetstats"><a id="aka" href="http://akismet.com" title=""><?php printf( __( '%1$s %2$sspam comments%3$s %4$sblocked by%5$s<br />%6$sAkismet%7$s' ), '<span id="akismet1"><span id="akismetcount">' . $count . '</span>', '<span id="akismetsc">', '</span></span>', '<span id="akismet2"><span id="akismetbb">', '</span>', '<span id="akismeta">', '</span></span>' ); ?></a></div></div>
- <?php echo $after_widget; ?>
- <?php
- }
-
- function widget_akismet_style() {
- $plugin_dir = '/wp-content/plugins';
- if ( defined( 'PLUGINDIR' ) )
- $plugin_dir = '/' . PLUGINDIR;
-
- ?>
-<style type="text/css">
-#aka,#aka:link,#aka:hover,#aka:visited,#aka:active{color:#fff;text-decoration:none}
-#aka:hover{border:none;text-decoration:none}
-#aka:hover #akismet1{display:none}
-#aka:hover #akismet2,#akismet1{display:block}
-#akismet2{display:none;padding-top:2px}
-#akismeta{font-size:16px;font-weight:bold;line-height:18px;text-decoration:none}
-#akismetcount{display:block;font:15px Verdana,Arial,Sans-Serif;font-weight:bold;text-decoration:none}
-#akismetwrap #akismetstats{background:url(<?php echo get_option('siteurl'), $plugin_dir; ?>/akismet/akismet.gif) no-repeat top left;border:none;color:#fff;font:11px 'Trebuchet MS','Myriad Pro',sans-serif;height:40px;line-height:100%;overflow:hidden;padding:8px 0 0;text-align:center;width:120px}
-</style>
- <?php
- }
+$akismet_comment_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) );
- function widget_akismet_control() {
- $options = $newoptions = get_option('widget_akismet');
- if ( isset( $_POST['akismet-submit'] ) && $_POST["akismet-submit"] ) {
- $newoptions['title'] = strip_tags(stripslashes($_POST["akismet-title"]));
- if ( empty($newoptions['title']) ) $newoptions['title'] = __('Spam Blocked');
- }
- if ( $options != $newoptions ) {
- $options = $newoptions;
- update_option('widget_akismet', $options);
- }
- $title = htmlspecialchars($options['title'], ENT_QUOTES);
- ?>
- <p><label for="akismet-title"><?php _e('Title:'); ?> <input style="width: 250px;" id="akismet-title" name="akismet-title" type="text" value="<?php echo $title; ?>" /></label></p>
- <input type="hidden" id="akismet-submit" name="akismet-submit" value="1" />
- <?php
- }
+if ( $akismet_comment_nonce_option == 'true' || $akismet_comment_nonce_option == '' )
+ add_action( 'comment_form', 'akismet_add_comment_nonce' );
- if ( function_exists( 'wp_register_sidebar_widget' ) ) {
- wp_register_sidebar_widget( 'akismet', 'Akismet', 'widget_akismet', null, 'akismet');
- wp_register_widget_control( 'akismet', 'Akismet', 'widget_akismet_control', null, 75, 'akismet');
- } else {
- register_sidebar_widget('Akismet', 'widget_akismet', null, 'akismet');
- register_widget_control('Akismet', 'widget_akismet_control', null, 75, 'akismet');
- }
- if ( is_active_widget('widget_akismet') )
- add_action('wp_head', 'widget_akismet_style');
- endif;
+if ( '3.0.5' == $wp_version ) {
+ remove_filter( 'comment_text', 'wp_kses_data' );
+ if ( is_admin() )
+ add_filter( 'comment_text', 'wp_kses_post' );
}
-
-add_action('init', 'widget_akismet_register');
-
-// Counter for non-widget users
-function akismet_counter() {
- $plugin_dir = '/wp-content/plugins';
- if ( defined( 'PLUGINDIR' ) )
- $plugin_dir = '/' . PLUGINDIR;
-
-?>
-<style type="text/css">
-#akismetwrap #aka,#aka:link,#aka:hover,#aka:visited,#aka:active{color:#fff;text-decoration:none}
-#aka:hover{border:none;text-decoration:none}
-#aka:hover #akismet1{display:none}
-#aka:hover #akismet2,#akismet1{display:block}
-#akismet2{display:none;padding-top:2px}
-#akismeta{font-size:16px;font-weight:bold;line-height:18px;text-decoration:none}
-#akismetcount{display:block;font:15px Verdana,Arial,Sans-Serif;font-weight:bold;text-decoration:none}
-#akismetwrap #akismetstats{background:url(<?php echo get_option('siteurl'), $plugin_dir; ?>/akismet/akismet.gif) no-repeat top left;border:none;color:#fff;font:11px 'Trebuchet MS','Myriad Pro',sans-serif;height:40px;line-height:100%;overflow:hidden;padding:8px 0 0;text-align:center;width:120px}
-</style>
-<?php
-$count = number_format_i18n(get_option('akismet_spam_count'));
-?>
-<div id="akismetwrap"><div id="akismetstats"><a id="aka" href="http://akismet.com" title=""><div id="akismet1"><span id="akismetcount"><?php echo $count; ?></span> <span id="akismetsc"><?php _e('spam comments') ?></span></div> <div id="akismet2"><span id="akismetbb"><?php _e('blocked by') ?></span><br /><span id="akismeta">Akismet</span></div></a></div></div>
-<?php
-}
-
-?>
=== Akismet ===
-Contributors: matt, ryan, andy, mdawaffe, tellyworth, automattic
+Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, automattic
Tags: akismet, comments, spam
-Requires at least: 2.0
-Tested up to: 3.0
-Stable tag: 2.4.0
-License: GPLv2
+Requires at least: 3.0
+Tested up to: 3.1
+Stable tag: 2.5.3
+License: GPLv2 or later
Akismet checks your comments against the Akismet web service to see if they look like spam or not.
Akismet checks your comments against the Akismet web service to see if they look like spam or not and lets you
review the spam it catches under your blog's "Comments" admin screen.
-Want to show off how much spam Akismet has caught for you? Just put `<?php akismet_counter(); ?>` in your template.
+Major new features in Akismet 2.5 include:
-See also: [WP Stats plugin](http://wordpress.org/extend/plugins/stats/).
+* A comment status history, so you can easily see which comments were caught or cleared by Akismet, and which were spammed or unspammed by a moderator
+* Links are highlighted in the comment body, to reveal hidden or misleading links
+* If your web host is unable to reach Akismet's servers, the plugin will automatically retry when your connection is back up
+* Moderators can see the number of approved comments for each user
+* Spam and Unspam reports now include more information, to help improve accuracy
-PS: You'll need an [Akismet.com API key](http://akismet.com/get/) to use it.
+PS: You'll need an [Akismet.com API key](http://akismet.com/get/) to use it. Keys are free for personal blogs, with paid subscriptions available for businesses and commercial sites.
== Installation ==
== Changelog ==
+= 2.5.3 =
+* Specify the license is GPL v2 or later
+* Fix a bug that could result in orphaned commentmeta entries
+* Include hotfix for WordPress 3.0.5 filter issue
+
+= 2.5.2 =
+
+* Properly format the comment count for author counts
+* Look for super admins on multisite installs when looking up user roles
+* Increase the HTTP request timeout
+* Removed padding for author approved count
+* Fix typo in function name
+* Set Akismet stats iframe height to fixed 2500px. Better to have one tall scroll bar than two side by side.
+
+= 2.5.1 =
+
+* Fix a bug that caused the "Auto delete" option to fail to discard comments correctly
+* Remove the comment nonce form field from the 'Akismet Configuration' page in favor of using a filter, akismet_comment_nonce
+* Fixed padding bug in "author" column of posts screen
+* Added margin-top to "cleared by ..." badges on dashboard
+* Fix possible error when calling akismet_cron_recheck()
+* Fix more PHP warnings
+* Clean up XHTML warnings for comment nonce
+* Fix for possible condition where scheduled comment re-checks could get stuck
+* Clean up the comment meta details after deleting a comment
+* Only show the status badge if the comment status has been changed by someone/something other than Akismet
+* Show a 'History' link in the row-actions
+* Translation fixes
+* Reduced font-size on author name
+* Moved "flagged by..." notification to top right corner of comment container and removed heavy styling
+* Hid "flagged by..." notification while on dashboard
+
+= 2.5.0 =
+
+* Track comment actions under 'Akismet Status' on the edit comment screen
+* Fix a few remaining deprecated function calls ( props Mike Glendinning )
+* Use HTTPS for the stats IFRAME when wp-admin is using HTTPS
+* Use the WordPress HTTP class if available
+* Move the admin UI code to a separate file, only loaded when needed
+* Add cron retry feature, to replace the old connectivity check
+* Display Akismet status badge beside each comment
+* Record history for each comment, and display it on the edit page
+* Record the complete comment as originally submitted in comment_meta, to use when reporting spam and ham
+* Highlight links in comment content
+* New option, "Show the number of comments you've approved beside each comment author."
+* New option, "Use a nonce on the comment form."
+
= 2.4.0 =
* Spell out that the license is GPLv2
--- /dev/null
+<?php
+/**
+ * @package Akismet
+ */
+// Widget stuff
+function widget_akismet_register() {
+ if ( function_exists('register_sidebar_widget') ) :
+ function widget_akismet($args) {
+ extract($args);
+ $options = get_option('widget_akismet');
+ $count = get_option('akismet_spam_count');
+ ?>
+ <?php echo $before_widget; ?>
+ <?php echo $before_title . $options['title'] . $after_title; ?>
+ <div id="akismetwrap"><div id="akismetstats"><a id="aka" href="http://akismet.com" title=""><?php printf( _n( '%1$s%2$s%3$s %4$sspam comment%5$s %6$sblocked by%7$s<br />%8$sAkismet%9$s', '%1$s%2$s%3$s %4$sspam comments%5$s %6$sblocked by%7$s<br />%8$sAkismet%9$s', $count ), '<span id="akismet1"><span id="akismetcount">', number_format_i18n( $count ), '</span>', '<span id="akismetsc">', '</span></span>', '<span id="akismet2"><span id="akismetbb">', '</span>', '<span id="akismeta">', '</span></span>' ); ?></a></div></div>
+ <?php echo $after_widget; ?>
+ <?php
+ }
+
+ function widget_akismet_style() {
+ $plugin_dir = '/wp-content/plugins';
+ if ( defined( 'PLUGINDIR' ) )
+ $plugin_dir = '/' . PLUGINDIR;
+
+ ?>
+<style type="text/css">
+#aka,#aka:link,#aka:hover,#aka:visited,#aka:active{color:#fff;text-decoration:none}
+#aka:hover{border:none;text-decoration:none}
+#aka:hover #akismet1{display:none}
+#aka:hover #akismet2,#akismet1{display:block}
+#akismet2{display:none;padding-top:2px}
+#akismeta{font-size:16px;font-weight:bold;line-height:18px;text-decoration:none}
+#akismetcount{display:block;font:15px Verdana,Arial,Sans-Serif;font-weight:bold;text-decoration:none}
+#akismetwrap #akismetstats{background:url(<?php echo get_option('siteurl'), $plugin_dir; ?>/akismet/akismet.gif) no-repeat top left;border:none;color:#fff;font:11px 'Trebuchet MS','Myriad Pro',sans-serif;height:40px;line-height:100%;overflow:hidden;padding:8px 0 0;text-align:center;width:120px}
+</style>
+ <?php
+ }
+
+ function widget_akismet_control() {
+ $options = $newoptions = get_option('widget_akismet');
+ if ( isset( $_POST['akismet-submit'] ) && $_POST["akismet-submit"] ) {
+ $newoptions['title'] = strip_tags(stripslashes($_POST["akismet-title"]));
+ if ( empty($newoptions['title']) ) $newoptions['title'] = __('Spam Blocked');
+ }
+ if ( $options != $newoptions ) {
+ $options = $newoptions;
+ update_option('widget_akismet', $options);
+ }
+ $title = htmlspecialchars($options['title'], ENT_QUOTES);
+ ?>
+ <p><label for="akismet-title"><?php _e('Title:'); ?> <input style="width: 250px;" id="akismet-title" name="akismet-title" type="text" value="<?php echo $title; ?>" /></label></p>
+ <input type="hidden" id="akismet-submit" name="akismet-submit" value="1" />
+ <?php
+ }
+
+ if ( function_exists( 'wp_register_sidebar_widget' ) ) {
+ wp_register_sidebar_widget( 'akismet', 'Akismet', 'widget_akismet', null, 'akismet');
+ wp_register_widget_control( 'akismet', 'Akismet', 'widget_akismet_control', null, 75, 'akismet');
+ } else {
+ register_sidebar_widget('Akismet', 'widget_akismet', null, 'akismet');
+ register_widget_control('Akismet', 'widget_akismet_control', null, 75, 'akismet');
+ }
+ if ( is_active_widget('widget_akismet') )
+ add_action('wp_head', 'widget_akismet_style');
+ endif;
+}
+
+add_action('init', 'widget_akismet_register');
+
+// Counter for non-widget users
+function akismet_counter() {
+ $plugin_dir = '/wp-content/plugins';
+ if ( defined( 'PLUGINDIR' ) )
+ $plugin_dir = '/' . PLUGINDIR;
+
+?>
+<style type="text/css">
+#akismetwrap #aka,#aka:link,#aka:hover,#aka:visited,#aka:active{color:#fff;text-decoration:none}
+#aka:hover{border:none;text-decoration:none}
+#aka:hover #akismet1{display:none}
+#aka:hover #akismet2,#akismet1{display:block}
+#akismet2{display:none;padding-top:2px}
+#akismeta{font-size:16px;font-weight:bold;line-height:18px;text-decoration:none}
+#akismetcount{display:block;font:15px Verdana,Arial,Sans-Serif;font-weight:bold;text-decoration:none}
+#akismetwrap #akismetstats{background:url(<?php echo get_option('siteurl'), $plugin_dir; ?>/akismet/akismet.gif) no-repeat top left;border:none;color:#fff;font:11px 'Trebuchet MS','Myriad Pro',sans-serif;height:40px;line-height:100%;overflow:hidden;padding:8px 0 0;text-align:center;width:120px}
+</style>
+<?php
+$count = get_option('akismet_spam_count');
+printf( _n( '<div id="akismetwrap"><div id="akismetstats"><a id="aka" href="http://akismet.com" title=""><div id="akismet1"><span id="akismetcount">%1$s</span> <span id="akismetsc">spam comment</span></div> <div id="akismet2"><span id="akismetbb">blocked by</span><br /><span id="akismeta">Akismet</span></div></a></div></div>', '<div id="akismetwrap"><div id="akismetstats"><a id="aka" href="http://akismet.com" title=""><div id="akismet1"><span id="akismetcount">%1$s</span> <span id="akismetsc">spam comments</span></div> <div id="akismet2"><span id="akismetbb">blocked by</span><br /><span id="akismeta">Akismet</span></div></a></div></div>', $count ), number_format_i18n( $count ) );
+}
<?php
/**
* @package Hello_Dolly
- * @version 1.5.1
+ * @version 1.6
*/
/*
Plugin Name: Hello Dolly
-Plugin URI: http://wordpress.org/#
+Plugin URI: http://wordpress.org/extend/plugins/hello-dolly/
Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
Author: Matt Mullenweg
-Version: 1.5.1
+Version: 1.6
Author URI: http://ma.tt/
*/
Dolly'll never go away again";
// Here we split it into lines
- $lyrics = explode("\n", $lyrics);
+ $lyrics = explode( "\n", $lyrics );
// And then randomly choose a line
- return wptexturize( $lyrics[ mt_rand(0, count($lyrics) - 1) ] );
+ return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] );
}
// This just echoes the chosen line, we'll position it later
echo "<p id='dolly'>$chosen</p>";
}
-// Now we set that function up to execute when the admin_footer action is called
-add_action('admin_footer', 'hello_dolly');
+// Now we set that function up to execute when the admin_notices action is called
+add_action( 'admin_notices', 'hello_dolly' );
// We need some CSS to position the paragraph
function dolly_css() {
- // This makes sure that the posinioning is also good for right-to-left languages
- $x = ( is_rtl() ) ? 'left' : 'right';
+ // This makes sure that the positioning is also good for right-to-left languages
+ $x = is_rtl() ? 'left' : 'right';
echo "
<style type='text/css'>
#dolly {
- position: absolute;
- top: 4.5em;
+ float: $x;
+ padding-$x: 15px;
+ padding-top: 5px;
margin: 0;
- padding: 0;
- $x: 215px;
font-size: 11px;
}
</style>
";
}
-add_action('admin_head', 'dolly_css');
+add_action( 'admin_head', 'dolly_css' );
?>
<?php if ( is_day() ) : ?>
<?php printf( __( 'Daily Archives: <span>%s</span>', 'twentyten' ), get_the_date() ); ?>
<?php elseif ( is_month() ) : ?>
- <?php printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date('F Y') ); ?>
+ <?php printf( __( 'Monthly Archives: <span>%s</span>', 'twentyten' ), get_the_date( 'F Y' ) ); ?>
<?php elseif ( is_year() ) : ?>
- <?php printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date('Y') ); ?>
+ <?php printf( __( 'Yearly Archives: <span>%s</span>', 'twentyten' ), get_the_date( 'Y' ) ); ?>
<?php else : ?>
<?php _e( 'Blog Archives', 'twentyten' ); ?>
<?php endif; ?>
/* Run the loop for the archives page to output the posts.
* If you want to overload this in a child theme then include a file
- * called loop-archives.php and that will be used instead.
+ * called loop-archive.php and that will be used instead.
*/
get_template_part( 'loop', 'archive' );
?>
<div id="container" class="single-attachment">
<div id="content" role="main">
-<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
-
- <?php if ( ! empty( $post->post_parent ) ) : ?>
- <p class="page-title"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php esc_attr( printf( __( 'Return to %s', 'twentyten' ), get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php
- /* translators: %s - title of parent post */
- printf( __( '<span class="meta-nav">←</span> %s', 'twentyten' ), get_the_title( $post->post_parent ) );
- ?></a></p>
- <?php endif; ?>
-
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <h2 class="entry-title"><?php the_title(); ?></h2>
-
- <div class="entry-meta">
- <?php
- printf(__('<span class="%1$s">By</span> %2$s', 'twentyten'),
- 'meta-prep meta-prep-author',
- 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()
- )
- );
- ?>
- <span class="meta-sep">|</span>
- <?php
- printf( __('<span class="%1$s">Published</span> %2$s', 'twentyten'),
- 'meta-prep meta-prep-entry-date',
- sprintf( '<span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span>',
- esc_attr( get_the_time() ),
- get_the_date()
- )
- );
- if ( wp_attachment_is_image() ) {
- echo ' <span class="meta-sep">|</span> ';
- $metadata = wp_get_attachment_metadata();
- printf( __( 'Full size is %s pixels', 'twentyten'),
- sprintf( '<a href="%1$s" title="%2$s">%3$s × %4$s</a>',
- wp_get_attachment_url(),
- esc_attr( __('Link to full-size image', 'twentyten') ),
- $metadata['width'],
- $metadata['height']
- )
- );
- }
- ?>
- <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
- </div><!-- .entry-meta -->
-
- <div class="entry-content">
- <div class="entry-attachment">
-<?php if ( wp_attachment_is_image() ) :
- $attachments = array_values( get_children( array( '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();
- }
-?>
- <p class="attachment"><a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
- $attachment_size = apply_filters( 'twentyten_attachment_size', 900 );
- echo wp_get_attachment_image( $post->ID, array( $attachment_size, 9999 ) ); // filterable image width with, essentially, no limit for image height.
- ?></a></p>
-
- <div id="nav-below" class="navigation">
- <div class="nav-previous"><?php previous_image_link( false ); ?></div>
- <div class="nav-next"><?php next_image_link( false ); ?></div>
- </div><!-- #nav-below -->
-<?php else : ?>
- <a href="<?php echo wp_get_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a>
-<?php endif; ?>
- </div><!-- .entry-attachment -->
- <div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?></div>
-
-<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
-<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
-
- </div><!-- .entry-content -->
-
- <div class="entry-utility">
- <?php twentyten_posted_in(); ?>
- <?php edit_post_link( __( 'Edit', 'twentyten' ), ' <span class="edit-link">', '</span>' ); ?>
- </div><!-- .entry-utility -->
- </div><!-- #post-## -->
-
-<?php comments_template(); ?>
-
-<?php endwhile; ?>
+ <?php
+ /* Run the loop to output the attachment.
+ * If you want to overload this in a child theme then include a file
+ * called loop-attachment.php and that will be used instead.
+ */
+ get_template_part( 'loop', 'attachment' );
+ ?>
</div><!-- #content -->
</div><!-- #container -->
/*
Theme Name: Twenty Ten
-*/
-/*
-Used to style the TinyMCE editor.
+Description: Used to style the TinyMCE editor.
*/
html .mceContentBody {
- max-width:640px;
+ max-width: 640px;
}
* {
- font-family: Georgia, "Bitstream Charter", serif;
color: #444;
+ font-family: Georgia, "Bitstream Charter", serif;
line-height: 1.5;
}
p,
}
hr {
background-color: #e7e7e7;
- border:0;
+ border: 0;
+ clear: both;
height: 1px;
margin-bottom: 18px;
- clear:both;
}
/* Text elements */
p {
margin: 0 0 18px 1.5em;
}
ol ol {
- list-style:upper-alpha;
+ list-style: upper-alpha;
}
ol ol ol {
- list-style:lower-roman;
+ list-style: lower-roman;
}
ol ol ol ol {
- list-style:lower-alpha;
+ list-style: lower-alpha;
}
ul ul,
ol ol,
ul ol,
ol ul {
- margin-bottom:0;
+ margin-bottom: 0;
}
dl {
- margin:0 0 24px 0;
+ margin: 0 0 24px 0;
}
dt {
font-weight: bold;
margin-bottom: 18px;
}
strong {
- font-weight: bold;
color: #000;
+ font-weight: bold;
}
cite,
em,
i {
- font-style: italic;
border: none;
+ font-style: italic;
}
big {
font-size: 131.25%;
}
ins {
- background: #ffffcc;
+ background: #ffc;
border: none;
color: #333;
}
}
sup,
sub {
+ font-size: 10px;
height: 0;
line-height: 1;
- vertical-align: baseline;
position: relative;
- font-size: 10px;
+ vertical-align: baseline;
}
sup {
bottom: 1ex;
top: .5ex;
}
a:link {
- color:#0066cc;
+ color: #06c;
}
a:visited {
- color:#743399;
+ color: #743399;
}
a:active,
a:hover {
dd,
pre,
hr {
- margin-bottom:24px;
+ margin-bottom: 24px;
}
ul ul,
ol ol,
ul ol,
ol ul {
- margin-bottom:0;
+ margin-bottom: 0;
}
pre,
kbd,
h5,
h6 {
color: #000;
- margin: 0 0 20px 0;
- line-height: 1.5em;
font-weight: normal;
+ line-height: 1.5em;
+ margin: 0 0 20px 0;
}
h1 {
font-size: 2.4em;
}
table {
border: 1px solid #e7e7e7 !important;
- text-align: left;
- margin: 0 -1px 24px 0;
- width: 100%;
border-collapse: collapse;
border-spacing: 0;
+ margin: 0 -1px 24px 0;
+ text-align: left;
+ width: 100%;
}
tr th,
thead th {
border-top: 1px solid #e7e7e7 !important;
padding: 6px 24px;
}
-
-
img {
margin: 0;
- max-width: 640px;
+}
+img.size-auto,
+img.size-large,
+img.size-full,
+img.size-medium {
+ max-width: 100%;
+ height: auto;
}
.alignleft,
img.alignleft {
margin-bottom: 12px;
}
.wp-caption {
- border: none;
background: #f1f1f1;
+ border: none;
+ -khtml-border-radius: 0;
+ -moz-border-radius: 0;
+ -webkit-border-radius: 0;
+ border-radius: 0;
color: #888;
font-size: 12px;
line-height: 18px;
- text-align: center;
margin-bottom: 20px;
+ max-width: 632px !important; /* prevent too-wide images from breaking layout */
padding: 4px;
- -moz-border-radius: 0;
- -khtml-border-radius: 0;
- -webkit-border-radius: 0;
- border-radius: 0;
+ text-align: center;
}
.wp-caption img {
margin: 5px;
margin: 0 0 4px;
}
.wp-smiley {
- margin:0;
+ margin: 0;
}
\ No newline at end of file
?>
<div id="site-info">
- <a href="<?php echo home_url( '/' ) ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
+ <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<?php bloginfo( 'name' ); ?>
</a>
</div><!-- #site-info -->
<div id="site-generator">
<?php do_action( 'twentyten_credits' ); ?>
- <a href="<?php echo esc_url( __('http://wordpress.org/', 'twentyten') ); ?>"
- title="<?php esc_attr_e('Semantic Personal Publishing Platform', 'twentyten'); ?>" rel="generator">
- <?php printf( __('Proudly powered by %s.', 'twentyten'), 'WordPress' ); ?>
- </a>
+ <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentyten' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyten' ); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s.', 'twentyten' ), 'WordPress' ); ?></a>
</div><!-- #site-generator -->
</div><!-- #colophon -->
// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();
+ // Post Format support. You can also use the legacy "gallery" or "asides" (note the plural) categories.
+ add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
+
// This theme uses post thumbnails
add_theme_support( 'post-thumbnails' );
add_custom_background();
// Your changeable header business starts here
- define( 'HEADER_TEXTCOLOR', '' );
+ if ( ! defined( 'HEADER_TEXTCOLOR' ) )
+ 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' );
+ if ( ! defined( 'HEADER_IMAGE' ) )
+ 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.
set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
// Don't support text inside the header image.
- define( 'NO_HEADER_TEXT', true );
+ if ( ! defined( 'NO_HEADER_TEXT' ) )
+ 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.
/**
* Remove inline styles printed when the gallery shortcode is used.
*
- * Galleries are styled by the theme in Twenty Ten's style.css.
+ * Galleries are styled by the theme in Twenty Ten's style.css. This is just
+ * a simple filter call that tells WordPress to not use the default styles.
+ *
+ * @since Twenty Ten 1.2
+ */
+add_filter( 'use_default_gallery_style', '__return_false' );
+
+/**
+ * Deprecated way to remove inline styles printed when the gallery shortcode is used.
+ *
+ * This function is no longer needed or used. Use the use_default_gallery_style
+ * filter instead, as seen above.
*
* @since Twenty Ten 1.0
+ * @deprecated Deprecated in Twenty Ten 1.2 for WordPress 3.1
+ *
* @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' );
+// Backwards compatibility with WordPress 3.0.
+if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) )
+ add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
if ( ! function_exists( 'twentyten_comment' ) ) :
/**
<?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>
+ <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
<br />
<?php endif; ?>
case 'trackback' :
?>
<li class="post pingback">
- <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'twentyten'), ' ' ); ?></p>
+ <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p>
<?php
break;
endswitch;
* To override this in a child theme, remove the filter and optionally add your own
* function tied to the widgets_init action hook.
*
+ * This function uses a filter (show_recent_comments_widget_style) new in WordPress 3.1
+ * to remove the default style. Using Twenty Ten 1.2 in WordPress 3.0 will show the styles,
+ * but they won't have any effect on the widget in default Twenty Ten styling.
+ *
* @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_filter( 'show_recent_comments_widget_style', '__return_false' );
}
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.
+ * Prints HTML with meta information for the current post-date/time and author.
*
* @since Twenty Ten 1.0
*/
<?php
// Check if this is a post or page, if it has a thumbnail, and if it's a big one
- if ( is_singular() &&
+ if ( is_singular() && current_theme_supports( 'post-thumbnails' ) &&
has_post_thumbnail( $post->ID ) &&
( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ) ) &&
$image[1] >= HEADER_IMAGE_WIDTH ) :
// Houston, we have a new header image!
- echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
- else : ?>
+ echo get_the_post_thumbnail( $post->ID );
+ elseif ( get_header_image() ) : ?>
<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
<?php endif; ?>
</div><!-- #branding -->
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
- * It is used to display a page when nothing more specific matches a query.
+ * It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
# This file is distributed under the same license as the Twenty Ten package.
msgid ""
msgstr ""
-"Project-Id-Version: Twenty Ten 1.1\n"
+"Project-Id-Version: Twenty Ten 1.2\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/twentyten\n"
-"POT-Creation-Date: 2011-01-01 21:26:51+00:00\n"
+"POT-Creation-Date: 2011-02-22 08:27:25+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
-#. #-#-#-#-# twentyten.pot (Twenty Ten 1.1) #-#-#-#-#
+#: loop-attachment.php:21
+msgid "Return to %s"
+msgstr ""
+
+#: loop-attachment.php:23
+msgid "<span class=\"meta-nav\">←</span> %s"
+msgstr ""
+
+#: loop-attachment.php:32
+msgid "<span class=\"%1$s\">By</span> %2$s"
+msgstr ""
+
+#: loop-attachment.php:36 functions.php:476
+msgid "View all posts by %s"
+msgstr ""
+
+#: loop-attachment.php:43
+msgid "<span class=\"%1$s\">Published</span> %2$s"
+msgstr ""
+
+#: loop-attachment.php:53
+msgid "Full size is %s pixels"
+msgstr ""
+
+#: loop-attachment.php:56
+msgid "Link to full-size image"
+msgstr ""
+
+#: loop-attachment.php:63 loop-attachment.php:111 loop.php:100 loop.php:123
+#: loop.php:165 loop-page.php:30 loop-single.php:56
+msgid "Edit"
+msgstr ""
+
+#: loop-attachment.php:104 loop.php:115 loop.php:143 functions.php:248
+msgid "Continue reading <span class=\"meta-nav\">→</span>"
+msgstr ""
+
+#: loop-attachment.php:105 loop.php:144 loop-page.php:29 loop-single.php:34
+msgid "Pages:"
+msgstr ""
+
+#. #-#-#-#-# twentyten.pot (Twenty Ten 1.2) #-#-#-#-#
#. Theme URI of the plugin/theme
#: footer.php:33
msgid "http://wordpress.org/"
msgstr ""
-#: footer.php:34
+#: footer.php:33
msgid "Semantic Personal Publishing Platform"
msgstr ""
-#: footer.php:35
+#: footer.php:33
msgid "Proudly powered by %s."
msgstr ""
"will help."
msgstr ""
-#: loop.php:25 loop.php:173
+#: loop.php:25 loop.php:178
msgid "<span class=\"meta-nav\">←</span> Older posts"
msgstr ""
-#: loop.php:26 loop.php:174
+#: loop.php:26 loop.php:179
msgid "Newer posts <span class=\"meta-nav\">→</span>"
msgstr ""
"searching will help find a related post."
msgstr ""
-#: loop.php:60 loop.php:92
+#: loop.php:60 loop.php:95 loop.php:96
msgctxt "gallery category slug"
msgid "gallery"
msgstr ""
-#: loop.php:62 loop.php:83 loop.php:126
+#: loop.php:62 loop.php:83 loop.php:131
msgid "Permalink to %s"
msgstr ""
#: loop.php:82
-msgid "This gallery contains <a %1$s>%2$s photos</a>."
-msgstr ""
+msgid "This gallery contains <a %1$s>%2$s photo</a>."
+msgid_plural "This gallery contains <a %1$s>%2$s photos</a>."
+msgstr[0] ""
+msgstr[1] ""
-#: loop.php:92
-msgid "View posts in the Gallery category"
+#: loop.php:93
+msgid "View Galleries"
msgstr ""
-#: loop.php:92
+#: loop.php:93 loop.php:96
msgid "More Galleries"
msgstr ""
-#: loop.php:94 loop.php:117 loop.php:159
+#: loop.php:96
+msgid "View posts in the Gallery category"
+msgstr ""
+
+#: loop.php:99 loop.php:122 loop.php:164
msgid "Leave a comment"
msgstr ""
-#: loop.php:94 loop.php:117 loop.php:159
+#: loop.php:99 loop.php:122 loop.php:164
msgid "1 Comment"
msgstr ""
-#: loop.php:94 loop.php:117 loop.php:159
+#: loop.php:99 loop.php:122 loop.php:164
msgid "% Comments"
msgstr ""
-#: loop.php:95 loop.php:118 loop.php:160 page.php:32 attachment.php:60
-#: attachment.php:107 onecolumn-page.php:27 single.php:53
-msgid "Edit"
-msgstr ""
-
-#: loop.php:101
+#: loop.php:106
msgctxt "asides category slug"
msgid "asides"
msgstr ""
-#: loop.php:110 loop.php:138 functions.php:241 attachment.php:100
-msgid "Continue reading <span class=\"meta-nav\">→</span>"
-msgstr ""
-
-#: loop.php:139 page.php:31 attachment.php:101 onecolumn-page.php:26
-#: single.php:31
-msgid "Pages:"
-msgstr ""
-
-#: loop.php:146
+#: loop.php:151
msgid "<span class=\"%1$s\">Posted in</span> %2$s"
msgstr ""
-#: loop.php:155
+#: loop.php:160
msgid "<span class=\"%1$s\">Tagged</span> %2$s"
msgstr ""
-#: functions.php:97
+#: functions.php:100
msgid "Primary Navigation"
msgstr ""
-#: functions.php:133
+#: functions.php:140
msgid "Berries"
msgstr ""
-#: functions.php:139
+#: functions.php:146
msgid "Cherry Blossoms"
msgstr ""
-#: functions.php:145
+#: functions.php:152
msgid "Concave"
msgstr ""
-#: functions.php:151
+#: functions.php:158
msgid "Fern"
msgstr ""
-#: functions.php:157
+#: functions.php:164
msgid "Forest Floor"
msgstr ""
-#: functions.php:163
+#: functions.php:170
msgid "Inkwell"
msgstr ""
-#: functions.php:169
+#: functions.php:176
msgid "Path"
msgstr ""
-#: functions.php:175
+#: functions.php:182
msgid "Sunset"
msgstr ""
-#: functions.php:308
+#: functions.php:330
msgid "%s <span class=\"says\">says:</span>"
msgstr ""
-#: functions.php:311
+#: functions.php:333
msgid "Your comment is awaiting moderation."
msgstr ""
-#: functions.php:318
+#: functions.php:340
msgid "%1$s at %2$s"
msgstr ""
-#: functions.php:318 functions.php:335
+#: functions.php:340 functions.php:357
msgid "(Edit)"
msgstr ""
-#: functions.php:335
+#: functions.php:357
msgid "Pingback:"
msgstr ""
-#: functions.php:354
+#: functions.php:376
msgid "Primary Widget Area"
msgstr ""
-#: functions.php:356
+#: functions.php:378
msgid "The primary widget area"
msgstr ""
-#: functions.php:365
+#: functions.php:387
msgid "Secondary Widget Area"
msgstr ""
-#: functions.php:367
+#: functions.php:389
msgid "The secondary widget area"
msgstr ""
-#: functions.php:376
+#: functions.php:398
msgid "First Footer Widget Area"
msgstr ""
-#: functions.php:378
+#: functions.php:400
msgid "The first footer widget area"
msgstr ""
-#: functions.php:387
+#: functions.php:409
msgid "Second Footer Widget Area"
msgstr ""
-#: functions.php:389
+#: functions.php:411
msgid "The second footer widget area"
msgstr ""
-#: functions.php:398
+#: functions.php:420
msgid "Third Footer Widget Area"
msgstr ""
-#: functions.php:400
+#: functions.php:422
msgid "The third footer widget area"
msgstr ""
-#: functions.php:409
+#: functions.php:431
msgid "Fourth Footer Widget Area"
msgstr ""
-#: functions.php:411
+#: functions.php:433
msgid "The fourth footer widget area"
msgstr ""
-#: functions.php:442
+#: functions.php:467
msgid ""
"<span class=\"%1$s\">Posted on</span> %2$s <span class=\"meta-sep\">by</"
"span> %3$s"
msgstr ""
-#: functions.php:451 attachment.php:33
-msgid "View all posts by %s"
-msgstr ""
-
-#: functions.php:468
+#: functions.php:493
msgid ""
"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>."
msgstr ""
-#: functions.php:470
+#: functions.php:495
msgid ""
"This entry was posted in %1$s. Bookmark the <a href=\"%3$s\" title="
"\"Permalink to %4$s\" rel=\"bookmark\">permalink</a>."
msgstr ""
-#: functions.php:472
+#: functions.php:497
msgid ""
"Bookmark the <a href=\"%3$s\" title=\"Permalink to %4$s\" rel=\"bookmark"
"\">permalink</a>."
msgid "Author Archives: %s"
msgstr ""
-#: author.php:37 single.php:40
+#: author.php:37 loop-single.php:43
msgid "About %s"
msgstr ""
-#: attachment.php:18
-msgid "Return to %s"
-msgstr ""
-
-#: attachment.php:20
-msgid "<span class=\"meta-nav\">←</span> %s"
-msgstr ""
-
-#: attachment.php:29
-msgid "<span class=\"%1$s\">By</span> %2$s"
-msgstr ""
-
-#: attachment.php:40
-msgid "<span class=\"%1$s\">Published</span> %2$s"
-msgstr ""
-
-#: attachment.php:50
-msgid "Full size is %s pixels"
-msgstr ""
-
-#: attachment.php:53
-msgid "Link to full-size image"
-msgstr ""
-
#: search.php:16
msgid "Search Results for: %s"
msgstr ""
"different keywords."
msgstr ""
+#: loop-single.php:21 loop-single.php:61
+msgctxt "Previous post link"
+msgid "←"
+msgstr ""
+
+#: loop-single.php:22 loop-single.php:62
+msgctxt "Next post link"
+msgid "→"
+msgstr ""
+
+#: loop-single.php:47
+msgid "View all posts by %s <span class=\"meta-nav\">→</span>"
+msgstr ""
+
#: archive.php:33
msgid "Daily Archives: <span>%s</span>"
msgstr ""
msgid "Blog Archives"
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
-msgid "View all posts by %s <span class=\"meta-nav\">→</span>"
-msgstr ""
-
#. Theme Name of the plugin/theme
msgid "Twenty Ten"
msgstr ""
msgid ""
"black, blue, white, two-columns, fixed-width, custom-header, custom-"
"background, threaded-comments, sticky-post, translation-ready, microformats, "
-"rtl-language-support, editor-style"
+"rtl-language-support, editor-style, custom-menu"
msgstr ""
--- /dev/null
+<?php
+/**
+ * The loop that displays an attachment.
+ *
+ * The loop displays the posts and the post content. See
+ * http://codex.wordpress.org/The_Loop to understand it and
+ * http://codex.wordpress.org/Template_Tags to understand
+ * the tags used in it.
+ *
+ * This can be overridden in child themes with loop-attachment.php.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Ten
+ * @since Twenty Ten 1.2
+ */
+?>
+
+<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
+
+ <?php if ( ! empty( $post->post_parent ) ) : ?>
+ <p class="page-title"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php esc_attr( printf( __( 'Return to %s', 'twentyten' ), get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php
+ /* translators: %s - title of parent post */
+ printf( __( '<span class="meta-nav">←</span> %s', 'twentyten' ), get_the_title( $post->post_parent ) );
+ ?></a></p>
+ <?php endif; ?>
+
+ <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <h2 class="entry-title"><?php the_title(); ?></h2>
+
+ <div class="entry-meta">
+ <?php
+ printf( __( '<span class="%1$s">By</span> %2$s', 'twentyten' ),
+ 'meta-prep meta-prep-author',
+ 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()
+ )
+ );
+ ?>
+ <span class="meta-sep">|</span>
+ <?php
+ printf( __( '<span class="%1$s">Published</span> %2$s', 'twentyten' ),
+ 'meta-prep meta-prep-entry-date',
+ sprintf( '<span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span>',
+ esc_attr( get_the_time() ),
+ get_the_date()
+ )
+ );
+ if ( wp_attachment_is_image() ) {
+ echo ' <span class="meta-sep">|</span> ';
+ $metadata = wp_get_attachment_metadata();
+ printf( __( 'Full size is %s pixels', 'twentyten' ),
+ sprintf( '<a href="%1$s" title="%2$s">%3$s × %4$s</a>',
+ wp_get_attachment_url(),
+ esc_attr( __( 'Link to full-size image', 'twentyten' ) ),
+ $metadata['width'],
+ $metadata['height']
+ )
+ );
+ }
+ ?>
+ <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
+ </div><!-- .entry-meta -->
+
+ <div class="entry-content">
+ <div class="entry-attachment">
+<?php if ( wp_attachment_is_image() ) :
+ $attachments = array_values( get_children( array( '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();
+ }
+?>
+ <p class="attachment"><a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
+ $attachment_width = apply_filters( 'twentyten_attachment_size', 900 );
+ $attachment_height = apply_filters( 'twentyten_attachment_height', 900 );
+ echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) ); // filterable image width with, essentially, no limit for image height.
+ ?></a></p>
+
+ <div id="nav-below" class="navigation">
+ <div class="nav-previous"><?php previous_image_link( false ); ?></div>
+ <div class="nav-next"><?php next_image_link( false ); ?></div>
+ </div><!-- #nav-below -->
+<?php else : ?>
+ <a href="<?php echo wp_get_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a>
+<?php endif; ?>
+ </div><!-- .entry-attachment -->
+ <div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?></div>
+
+<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
+<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
+
+ </div><!-- .entry-content -->
+
+ <div class="entry-utility">
+ <?php twentyten_posted_in(); ?>
+ <?php edit_post_link( __( 'Edit', 'twentyten' ), ' <span class="edit-link">', '</span>' ); ?>
+ </div><!-- .entry-utility -->
+ </div><!-- #post-## -->
+
+<?php comments_template(); ?>
+
+<?php endwhile; // end of the loop. ?>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * The loop that displays a page.
+ *
+ * The loop displays the posts and the post content. See
+ * http://codex.wordpress.org/The_Loop to understand it and
+ * http://codex.wordpress.org/Template_Tags to understand
+ * the tags used in it.
+ *
+ * This can be overridden in child themes with loop-page.php.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Ten
+ * @since Twenty Ten 1.2
+ */
+?>
+
+<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
+
+ <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <?php if ( is_front_page() ) { ?>
+ <h2 class="entry-title"><?php the_title(); ?></h2>
+ <?php } else { ?>
+ <h1 class="entry-title"><?php the_title(); ?></h1>
+ <?php } ?>
+
+ <div class="entry-content">
+ <?php the_content(); ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
+ <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
+ </div><!-- .entry-content -->
+ </div><!-- #post-## -->
+
+ <?php comments_template( '', true ); ?>
+
+<?php endwhile; // end of the loop. ?>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * The loop that displays a single post.
+ *
+ * The loop displays the posts and the post content. See
+ * http://codex.wordpress.org/The_Loop to understand it and
+ * http://codex.wordpress.org/Template_Tags to understand
+ * the tags used in it.
+ *
+ * This can be overridden in child themes with loop-single.php.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Ten
+ * @since Twenty Ten 1.2
+ */
+?>
+
+<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
+
+ <div id="nav-above" class="navigation">
+ <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
+ <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
+ </div><!-- #nav-above -->
+
+ <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <h1 class="entry-title"><?php the_title(); ?></h1>
+
+ <div class="entry-meta">
+ <?php twentyten_posted_on(); ?>
+ </div><!-- .entry-meta -->
+
+ <div class="entry-content">
+ <?php the_content(); ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
+ </div><!-- .entry-content -->
+
+<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
+ <div id="entry-author-info">
+ <div id="author-avatar">
+ <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
+ </div><!-- #author-avatar -->
+ <div id="author-description">
+ <h2><?php printf( esc_attr__( 'About %s', 'twentyten' ), get_the_author() ); ?></h2>
+ <?php the_author_meta( 'description' ); ?>
+ <div id="author-link">
+ <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
+ <?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyten' ), get_the_author() ); ?>
+ </a>
+ </div><!-- #author-link -->
+ </div><!-- #author-description -->
+ </div><!-- #entry-author-info -->
+<?php endif; ?>
+
+ <div class="entry-utility">
+ <?php twentyten_posted_in(); ?>
+ <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
+ </div><!-- .entry-utility -->
+ </div><!-- #post-## -->
+
+ <div id="nav-below" class="navigation">
+ <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
+ <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
+ </div><!-- #nav-below -->
+
+ <?php comments_template( '', true ); ?>
+
+<?php endwhile; // end of the loop. ?>
\ No newline at end of file
*/ ?>
<?php while ( have_posts() ) : the_post(); ?>
-<?php /* How to display posts in the Gallery category. */ ?>
+<?php /* How to display posts of the Gallery format. The gallery category is the old way. */ ?>
- <?php if ( in_category( _x('gallery', 'gallery category slug', 'twentyten') ) ) : ?>
+ <?php if ( ( function_exists( 'get_post_format' ) && 'gallery' == get_post_format( $post->ID ) ) || in_category( _x( 'gallery', 'gallery category slug', 'twentyten' ) ) ) : ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div class="entry-content">
<?php if ( post_password_required() ) : ?>
<?php the_content(); ?>
-<?php else : ?>
- <?php
+<?php else : ?>
+ <?php
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
if ( $images ) :
$total_images = count( $images );
<div class="gallery-thumb">
<a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
</div><!-- .gallery-thumb -->
- <p><em><?php printf( __( 'This gallery contains <a %1$s>%2$s photos</a>.', 'twentyten' ),
+ <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyten' ),
'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
- $total_images
+ number_format_i18n( $total_images )
); ?></em></p>
<?php endif; ?>
<?php the_excerpt(); ?>
</div><!-- .entry-content -->
<div class="entry-utility">
- <a href="<?php echo get_term_link( _x('gallery', 'gallery category slug', 'twentyten'), 'category' ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
+ <?php if ( function_exists( 'get_post_format' ) && 'gallery' == get_post_format( $post->ID ) ) : ?>
+ <a href="<?php echo get_post_format_link( 'gallery' ); ?>" title="<?php esc_attr_e( 'View Galleries', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
+ <span class="meta-sep">|</span>
+ <?php elseif ( in_category( _x( 'gallery', 'gallery category slug', 'twentyten' ) ) ) : ?>
+ <a href="<?php echo get_term_link( _x( 'gallery', 'gallery category slug', 'twentyten' ), 'category' ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
<span class="meta-sep">|</span>
+ <?php endif; ?>
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-utility -->
</div><!-- #post-## -->
-<?php /* How to display posts in the asides category */ ?>
+<?php /* How to display posts of the Aside format. The asides category is the old way. */ ?>
- <?php elseif ( in_category( _x('asides', 'asides category slug', 'twentyten') ) ) : ?>
+ <?php elseif ( ( function_exists( 'get_post_format' ) && 'aside' == get_post_format( $post->ID ) ) || in_category( _x( 'asides', 'asides category slug', 'twentyten' ) ) ) : ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
<div id="container" class="one-column">
<div id="content" role="main">
-<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
-
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <h1 class="entry-title"><?php the_title(); ?></h1>
- <div class="entry-content">
- <?php the_content(); ?>
- <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
- <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
- </div><!-- .entry-content -->
- </div><!-- #post-## -->
-
- <?php comments_template( '', true ); ?>
-
-<?php endwhile; ?>
+ <?php
+ /* Run the loop to output the page.
+ * If you want to overload this in a child theme then include a file
+ * called loop-page.php and that will be used instead.
+ */
+ get_template_part( 'loop', 'page' );
+ ?>
</div><!-- #content -->
</div><!-- #container -->
<div id="container">
<div id="content" role="main">
-<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
-
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <?php if ( is_front_page() ) { ?>
- <h2 class="entry-title"><?php the_title(); ?></h2>
- <?php } else { ?>
- <h1 class="entry-title"><?php the_title(); ?></h1>
- <?php } ?>
-
- <div class="entry-content">
- <?php the_content(); ?>
- <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
- <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
- </div><!-- .entry-content -->
- </div><!-- #post-## -->
-
- <?php comments_template( '', true ); ?>
-
-<?php endwhile; ?>
+ <?php
+ /* Run the loop to output the page.
+ * If you want to overload this in a child theme then include a file
+ * called loop-page.php and that will be used instead.
+ */
+ get_template_part( 'loop', 'page' );
+ ?>
</div><!-- #content -->
</div><!-- #container -->
-------------------------------------------------------------- */
/* Text elements */
-ul {
+ul, ol {
margin: 0 1.5em 18px 0;
}
blockquote {
float: left;
font-style: normal;
}
+#branding img {
+ float: right;
+}
/* =Menu
-------------------------------------------------------------- */
* some default sidebar stuff just in case.
*/
if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>
-
+
<li id="search" class="widget-container widget_search">
<?php get_search_form(); ?>
</li>
<div id="container">
<div id="content" role="main">
-<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
-
- <div id="nav-above" class="navigation">
- <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
- <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
- </div><!-- #nav-above -->
-
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <h1 class="entry-title"><?php the_title(); ?></h1>
-
- <div class="entry-meta">
- <?php twentyten_posted_on(); ?>
- </div><!-- .entry-meta -->
-
- <div class="entry-content">
- <?php the_content(); ?>
- <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
- </div><!-- .entry-content -->
-
-<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
- <div id="entry-author-info">
- <div id="author-avatar">
- <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
- </div><!-- #author-avatar -->
- <div id="author-description">
- <h2><?php printf( esc_attr__( 'About %s', 'twentyten' ), get_the_author() ); ?></h2>
- <?php the_author_meta( 'description' ); ?>
- <div id="author-link">
- <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
- <?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyten' ), get_the_author() ); ?>
- </a>
- </div><!-- #author-link -->
- </div><!-- #author-description -->
- </div><!-- #entry-author-info -->
-<?php endif; ?>
-
- <div class="entry-utility">
- <?php twentyten_posted_in(); ?>
- <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
- </div><!-- .entry-utility -->
- </div><!-- #post-## -->
-
- <div id="nav-below" class="navigation">
- <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
- <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
- </div><!-- #nav-below -->
-
- <?php comments_template( '', true ); ?>
-
-<?php endwhile; // end of the loop. ?>
+ <?php
+ /* Run the loop to output the post.
+ * If you want to overload this in a child theme then include a file
+ * called loop-single.php and that will be used instead.
+ */
+ get_template_part( 'loop', 'single' );
+ ?>
</div><!-- #content -->
</div><!-- #container -->
Theme URI: http://wordpress.org/
Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable -- make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the "Asides" and "Gallery" categories, and has an optional one-column page template that removes the sidebar.
Author: the WordPress team
-Version: 1.1
-Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style
+Version: 1.2
+License: GNU General Public License
+License URI: license.txt
+Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu
*/
.pingback p,
.reply,
.widget-title,
-.wp-caption-text,
+.wp-caption-text {
+ font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
+}
input[type=submit] {
font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
}
clear: right;
float: right;
font-style: italic;
- margin: 14px 0 18px 0;
+ margin: 15px 0 18px 0;
width: 220px;
}
#branding img {
border-top: 4px solid #000;
border-bottom: 1px solid #000;
- clear: both;
display: block;
+ float: left;
}
width: 33%;
}
.page-link {
+ clear: both;
color: #000;
font-weight: bold;
margin: 0 0 22px 0;
/* =Asides
-------------------------------------------------------------- */
+.home #content .format-aside p,
.home #content .category-asides p {
font-size: 14px;
line-height: 20px;
margin-bottom: 10px;
margin-top: 0;
}
+.home .hentry.format-aside,
.home .hentry.category-asides {
padding: 0;
}
+.home #content .format-aside .entry-content,
.home #content .category-asides .entry-content {
padding-top: 0;
}
/* =Gallery listing
-------------------------------------------------------------- */
+.format-gallery .size-thumbnail img,
.category-gallery .size-thumbnail img {
border: 10px solid #f1f1f1;
margin-bottom: 0;
}
+.format-gallery .gallery-thumb,
.category-gallery .gallery-thumb {
float: left;
margin-right: 20px;
margin-top: -4px;
}
+.home #content .format-gallery .entry-utility,
.home #content .category-gallery .entry-utility {
padding-top: 4px;
}
/* =Images
-------------------------------------------------------------- */
-#content img {
- margin: 0;
- height: auto;
- max-width: 640px;
- width: auto;
-}
-#content .attachment img {
- max-width: 900px;
-}
-#content .alignleft,
-#content img.alignleft {
+/*
+Resize images to fit the main content area.
+- Applies only to images uploaded via WordPress by targeting size-* classes.
+- Other images will be left alone. Use "size-auto" class to apply to other images.
+*/
+img.size-auto,
+img.size-full,
+img.size-large,
+img.size-medium,
+.attachment img {
+ max-width: 100%; /* When images are too wide for containing element, force them to fit. */
+ height: auto; /* Override height to match resized width for correct aspect ratio. */
+}
+.alignleft,
+img.alignleft {
display: inline;
float: left;
margin-right: 24px;
margin-top: 4px;
}
-#content .alignright,
-#content img.alignright {
+.alignright,
+img.alignright {
display: inline;
float: right;
margin-left: 24px;
margin-top: 4px;
}
-#content .aligncenter,
-#content img.aligncenter {
+.aligncenter,
+img.aligncenter {
clear: both;
display: block;
margin-left: auto;
margin-right: auto;
}
-#content img.alignleft,
-#content img.alignright,
-#content img.aligncenter {
+img.alignleft,
+img.alignright,
+img.aligncenter {
margin-bottom: 12px;
}
-#content .wp-caption {
+.wp-caption {
background: #f1f1f1;
line-height: 18px;
margin-bottom: 20px;
+ max-width: 632px !important; /* prevent too-wide images from breaking layout */
padding: 4px;
text-align: center;
}
-#content .wp-caption img {
+.wp-caption img {
margin: 5px 5px 0;
}
-#content .wp-caption p.wp-caption-text {
+.wp-caption p.wp-caption-text {
color: #888;
font-size: 12px;
margin: 5px;
}
-#content .wp-smiley {
+.wp-smiley {
margin: 0;
}
-#content .gallery {
+.gallery {
margin: 0 auto 18px;
}
-#content .gallery .gallery-item {
+.gallery .gallery-item {
float: left;
margin-top: 0;
text-align: center;
width: 33%;
}
-#content .gallery img {
+.gallery-columns-2 .gallery-item {
+ width: 50%;
+}
+.gallery-columns-4 .gallery-item {
+ width: 25%;
+}
+.gallery img {
border: 2px solid #cfcfcf;
}
-#content .gallery .gallery-caption {
+.gallery-columns-2 .attachment-medium {
+ max-width: 92%;
+ height: auto;
+}
+.gallery-columns-4 .attachment-thumbnail {
+ max-width: 84%;
+ height: auto;
+}
+.gallery .gallery-caption {
color: #888;
font-size: 12px;
margin: 0 0 12px;
}
-#content .gallery dl {
+.gallery dl {
margin: 0;
}
-#content .gallery img {
+.gallery img {
border: 10px solid #f1f1f1;
}
-#content .gallery br+br {
+.gallery br+br {
display: none;
}
-#content .attachment img { /* single attachment images should be centered */
+#content .attachment img {/* single attachment images should be centered */
display: block;
margin: 0 auto;
}
list-style: square;
margin-left: 1.3em;
}
+.widget-area select {
+ max-width: 100%;
+}
.widget_search #s {/* This keeps the search inputs in line */
width: 60%;
}
require( './wp-load.php' );
wp_redirect( get_bloginfo( get_default_feed() . '_url' ), 301 );
-
-?>
\ No newline at end of file
+exit;
+?>
--- /dev/null
+<?php
+/**
+ * Admin Bar
+ *
+ * This code handles the building and rendering of the press bar.
+ */
+
+/**
+ * Instantiate the admin bar object and set it up as a global for access elsewhere.
+ *
+ * To hide the admin bar, you're looking in the wrong place. Unhooking this function will not
+ * properly remove the admin bar. For that, use show_admin_bar(false) or the show_admin_bar filter.
+ *
+ * @since 3.1.0
+ * @access private
+ * @return bool Whether the admin bar was successfully initialized.
+ */
+function _wp_admin_bar_init() {
+ global $wp_admin_bar;
+
+ if ( ! is_admin_bar_showing() )
+ return false;
+
+ /* Load the admin bar class code ready for instantiation */
+ require( ABSPATH . WPINC . '/class-wp-admin-bar.php' );
+
+ /* Instantiate the admin bar */
+ $admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' );
+ if ( class_exists( $admin_bar_class ) )
+ $wp_admin_bar = new $admin_bar_class;
+ else
+ return false;
+
+ $wp_admin_bar->initialize();
+ $wp_admin_bar->add_menus();
+
+ return true;
+}
+add_action( 'init', '_wp_admin_bar_init' ); // Don't remove. Wrong way to disable.
+
+/**
+ * Render the admin bar to the page based on the $wp_admin_bar->menu member var.
+ * This is called very late on the footer actions so that it will render after anything else being
+ * added to the footer.
+ *
+ * It includes the action "admin_bar_menu" which should be used to hook in and
+ * add new menus to the admin bar. That way you can be sure that you are adding at most optimal point,
+ * right before the admin bar is rendered. This also gives you access to the $post global, among others.
+ *
+ * @since 3.1.0
+ */
+function wp_admin_bar_render() {
+ global $wp_admin_bar;
+
+ if ( ! is_admin_bar_showing() || ! is_object( $wp_admin_bar ) )
+ return false;
+
+ $wp_admin_bar->load_user_locale_translations();
+
+ do_action_ref_array( 'admin_bar_menu', array( &$wp_admin_bar ) );
+
+ do_action( 'wp_before_admin_bar_render' );
+
+ $wp_admin_bar->render();
+
+ do_action( 'wp_after_admin_bar_render' );
+
+ $wp_admin_bar->unload_user_locale_translations();
+}
+add_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
+add_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
+
+/**
+ * Add the "My Account" menu and all submenus.
+ *
+ * @since 3.1.0
+ */
+function wp_admin_bar_my_account_menu() {
+ global $wp_admin_bar, $user_identity;
+
+ $user_id = get_current_user_id();
+
+ if ( 0 != $user_id ) {
+ /* Add the 'My Account' menu */
+ $avatar = get_avatar( get_current_user_id(), 16 );
+ $id = ( ! empty( $avatar ) ) ? 'my-account-with-avatar' : 'my-account';
+
+ $wp_admin_bar->add_menu( array( 'id' => $id, 'title' => $avatar . $user_identity, 'href' => get_edit_profile_url( $user_id ) ) );
+
+ /* Add the "My Account" sub menus */
+ $wp_admin_bar->add_menu( array( 'parent' => $id, 'title' => __( 'Edit My Profile' ), 'href' => get_edit_profile_url( $user_id ) ) );
+ if ( is_multisite() )
+ $wp_admin_bar->add_menu( array( 'parent' => $id, 'title' => __( 'Dashboard' ), 'href' => get_dashboard_url( $user_id ) ) );
+ else
+ $wp_admin_bar->add_menu( array( 'parent' => $id, 'title' => __( 'Dashboard' ), 'href' => admin_url() ) );
+ $wp_admin_bar->add_menu( array( 'parent' => $id, 'title' => __( 'Log Out' ), 'href' => wp_logout_url() ) );
+ }
+}
+
+/**
+ * Add the "My Sites/[Site Name]" menu and all submenus.
+ *
+ * @since 3.1.0
+ */
+function wp_admin_bar_my_sites_menu() {
+ global $wpdb, $wp_admin_bar;
+
+ /* Add the 'My Sites' menu if the user has more than one site. */
+ if ( count( $wp_admin_bar->user->blogs ) <= 1 )
+ return;
+
+ $wp_admin_bar->add_menu( array( 'id' => 'my-blogs', 'title' => __( 'My Sites' ), 'href' => admin_url( 'my-sites.php' ) ) );
+
+ $default = includes_url('images/wpmini-blue.png');
+
+ foreach ( (array) $wp_admin_bar->user->blogs as $blog ) {
+ // @todo Replace with some favicon lookup.
+ //$blavatar = '<img src="' . esc_url( blavatar_url( blavatar_domain( $blog->siteurl ), 'img', 16, $default ) ) . '" alt="Blavatar" width="16" height="16" />';
+ $blavatar = '<img src="' . esc_url($default) . '" alt="' . esc_attr__( 'Blavatar' ) . '" width="16" height="16" class="blavatar"/>';
+
+ $blogname = empty( $blog->blogname ) ? $blog->domain : $blog->blogname;
+
+ $wp_admin_bar->add_menu( array( 'parent' => 'my-blogs', 'id' => 'blog-' . $blog->userblog_id, 'title' => $blavatar . $blogname, 'href' => get_admin_url($blog->userblog_id) ) );
+ $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-d', 'title' => __( 'Dashboard' ), 'href' => get_admin_url($blog->userblog_id) ) );
+
+ if ( current_user_can_for_blog( $blog->userblog_id, 'edit_posts' ) ) {
+ $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-n', 'title' => __( 'New Post' ), 'href' => get_admin_url($blog->userblog_id, 'post-new.php') ) );
+ $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-c', 'title' => __( 'Manage Comments' ), 'href' => get_admin_url($blog->userblog_id, 'edit-comments.php') ) );
+ }
+
+ $wp_admin_bar->add_menu( array( 'parent' => 'blog-' . $blog->userblog_id, 'id' => 'blog-' . $blog->userblog_id . '-v', 'title' => __( 'Visit Site' ), 'href' => get_home_url($blog->userblog_id) ) );
+ }
+}
+
+/**
+ * Provide a shortlink.
+ *
+ * @since 3.1.0
+ */
+function wp_admin_bar_shortlink_menu() {
+ global $wp_admin_bar;
+
+ $short = wp_get_shortlink( 0, 'query' );
+ $id = 'get-shortlink';
+
+ if ( empty( $short ) )
+ return;
+
+ $html = '<input class="shortlink-input" type="text" readonly="readonly" value="' . esc_attr( $short ) . '" />';
+
+ $wp_admin_bar->add_menu( array(
+ 'id' => $id,
+ 'title' => __( 'Shortlink' ),
+ 'href' => $short,
+ 'meta' => array( 'html' => $html ),
+ ) );
+}
+
+/**
+ * Provide an edit link for posts and terms.
+ *
+ * @since 3.1.0
+ */
+function wp_admin_bar_edit_menu () {
+ global $wp_admin_bar;
+
+ $current_object = get_queried_object();
+
+ if ( empty($current_object) )
+ return;
+
+ if ( ! empty( $current_object->post_type ) && ( $post_type_object = get_post_type_object( $current_object->post_type ) ) && current_user_can( $post_type_object->cap->edit_post, $current_object->ID ) && $post_type_object->show_ui ) {
+ $wp_admin_bar->add_menu( array( 'id' => 'edit', 'title' => $post_type_object->labels->edit_item, 'href' => get_edit_post_link( $current_object->ID ) ) );
+ } elseif ( ! empty( $current_object->taxonomy ) && ( $tax = get_taxonomy( $current_object->taxonomy ) ) && current_user_can( $tax->cap->edit_terms ) && $tax->show_ui ) {
+ $wp_admin_bar->add_menu( array( 'id' => 'edit', 'title' => $tax->labels->edit_item, 'href' => get_edit_term_link( $current_object->term_id, $current_object->taxonomy ) ) );
+ }
+}
+
+/**
+ * Add "Add New" menu.
+ *
+ * @since 3.1.0
+ */
+function wp_admin_bar_new_content_menu() {
+ global $wp_admin_bar;
+
+ $actions = array();
+ foreach ( (array) get_post_types( array( 'show_ui' => true ), 'objects' ) as $ptype_obj ) {
+ if ( true !== $ptype_obj->show_in_menu || ! current_user_can( $ptype_obj->cap->edit_posts ) )
+ continue;
+
+ $actions[ 'post-new.php?post_type=' . $ptype_obj->name ] = array( $ptype_obj->labels->singular_name, $ptype_obj->cap->edit_posts, 'new-' . $ptype_obj->name );
+ }
+
+ if ( empty( $actions ) )
+ return;
+
+ $wp_admin_bar->add_menu( array( 'id' => 'new-content', 'title' => _x( 'Add New', 'admin bar menu group label' ), 'href' => admin_url( array_shift( array_keys( $actions ) ) ) ) );
+
+ foreach ( $actions as $link => $action ) {
+ $wp_admin_bar->add_menu( array( 'parent' => 'new-content', 'id' => $action[2], 'title' => $action[0], 'href' => admin_url($link) ) );
+ }
+}
+
+/**
+ * Add edit comments link with awaiting moderation count bubble.
+ *
+ * @since 3.1.0
+ */
+function wp_admin_bar_comments_menu() {
+ global $wp_admin_bar;
+
+ if ( !current_user_can('edit_posts') )
+ return;
+
+ $awaiting_mod = wp_count_comments();
+ $awaiting_mod = $awaiting_mod->moderated;
+
+ $awaiting_mod = $awaiting_mod ? "<span id='ab-awaiting-mod' class='pending-count'>" . number_format_i18n( $awaiting_mod ) . "</span>" : '';
+ $wp_admin_bar->add_menu( array( 'id' => 'comments', 'title' => sprintf( __('Comments %s'), $awaiting_mod ), 'href' => admin_url('edit-comments.php') ) );
+}
+
+/**
+ * Add "Appearance" menu with widget and nav menu submenu.
+ *
+ * @since 3.1.0
+ */
+function wp_admin_bar_appearance_menu() {
+ global $wp_admin_bar;
+
+ if ( !current_user_can('switch_themes') )
+ return;
+
+ $wp_admin_bar->add_menu( array( 'id' => 'appearance', 'title' => __('Appearance'), 'href' => admin_url('themes.php') ) );
+
+ if ( !current_user_can('edit_theme_options') )
+ return;
+
+ if ( current_theme_supports( 'widgets' ) )
+ $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) );
+
+ if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
+ $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __('Menus'), 'href' => admin_url('nav-menus.php') ) );
+}
+
+/**
+ * Provide an update link if theme/plugin/core updates are available.
+ *
+ * @since 3.1.0
+ */
+function wp_admin_bar_updates_menu() {
+ global $wp_admin_bar;
+
+ if ( !current_user_can('install_plugins') )
+ return;
+
+ $plugin_update_count = $theme_update_count = $wordpress_update_count = 0;
+ $update_plugins = get_site_transient( 'update_plugins' );
+ if ( !empty($update_plugins->response) )
+ $plugin_update_count = count( $update_plugins->response );
+ $update_themes = get_site_transient( 'update_themes' );
+ if ( !empty($update_themes->response) )
+ $theme_update_count = count( $update_themes->response );
+ /* @todo get_core_updates() is only available on admin page loads
+ $update_wordpress = get_core_updates( array('dismissed' => false) );
+ if ( !empty($update_wordpress) && !in_array( $update_wordpress[0]->response, array('development', 'latest') ) )
+ $wordpress_update_count = 1;
+ */
+
+ $update_count = $plugin_update_count + $theme_update_count + $wordpress_update_count;
+
+ if ( !$update_count )
+ return;
+
+ $update_title = array();
+ if ( $wordpress_update_count )
+ $update_title[] = sprintf(__('%d WordPress Update'), $wordpress_update_count);
+ if ( $plugin_update_count )
+ $update_title[] = sprintf(_n('%d Plugin Update', '%d Plugin Updates', $plugin_update_count), $plugin_update_count);
+ if ( $theme_update_count )
+ $update_title[] = sprintf(_n('%d Theme Update', '%d Themes Updates', $theme_update_count), $theme_update_count);
+
+ $update_title = !empty($update_title) ? esc_attr(implode(', ', $update_title)) : '';
+
+ $update_title = "<span title='$update_title'>";
+ $update_title .= sprintf( __('Updates %s'), "<span id='ab-updates' class='update-count'>" . number_format_i18n($update_count) . '</span>' );
+ $update_title .= '</span>';
+
+ $wp_admin_bar->add_menu( array( 'id' => 'updates', 'title' => $update_title, 'href' => network_admin_url( 'update-core.php' ) ) );
+}
+
+/**
+ * Style and scripts for the admin bar.
+ *
+ * @since 3.1.0
+ *
+ */
+function wp_admin_bar_header() { ?>
+<style type="text/css" media="print">#wpadminbar { display:none; }</style>
+<?php
+}
+
+/**
+ * Default admin bar callback.
+ *
+ * @since 3.1.0
+ *
+ */
+function _admin_bar_bump_cb() { ?>
+<style type="text/css">
+ html { margin-top: 28px !important; }
+ * html body { margin-top: 28px !important; }
+</style>
+<?php
+}
+
+/**
+ * Set the display status of the admin bar
+ *
+ * This can be called immediately upon plugin load. It does not need to be called from a function hooked to the init action.
+ *
+ * @since 3.1.0
+ *
+ * @param bool $show Whether to allow the admin bar to show.
+ * @return void
+ */
+function show_admin_bar( $show ) {
+ global $show_admin_bar;
+ $show_admin_bar = (bool) $show;
+}
+
+/**
+ * Determine whether the admin bar should be showing.
+ *
+ * @since 3.1.0
+ *
+ * @return bool Whether the admin bar should be showing.
+ */
+function is_admin_bar_showing() {
+ global $show_admin_bar;
+
+ /* For all these types of request we never want an admin bar period */
+ if ( defined('XMLRPC_REQUEST') || defined('APP_REQUEST') || defined('DOING_AJAX') || defined('IFRAME_REQUEST') )
+ return false;
+
+ if ( ! isset( $show_admin_bar ) ) {
+ if ( ! is_user_logged_in() ) {
+ $show_admin_bar = false;
+ } else {
+ $context = is_admin() ? 'admin' : 'front';
+ $show_admin_bar = _get_admin_bar_pref( $context );
+ }
+ }
+
+ $show_admin_bar = apply_filters( 'show_admin_bar', $show_admin_bar );
+
+ return $show_admin_bar;
+}
+
+/**
+ * Retrieve the admin bar display preference of a user based on context.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @param string $context Context of this preference check, either 'admin' or 'front'
+ * @param int $user Optional. ID of the user to check, defaults to 0 for current user
+ * @return bool Whether the admin bar should be showing for this user
+ */
+function _get_admin_bar_pref( $context, $user = 0 ) {
+ $pref = get_user_option( "show_admin_bar_{$context}", $user );
+ if ( false === $pref )
+ return 'admin' != $context || is_multisite();
+
+ return 'true' === $pref;
+}
+
+?>
\ No newline at end of file
else
$authordata = get_userdata( $user_id );
+ // Keys used as object vars cannot have dashes.
+ $field = str_replace('-', '', $field);
$field = strtolower($field);
$user_field = "user_$field";
}
/**
- * Retrieve the URL to the author page of the author of the current post.
+ * Retrieve the URL to the author page for the user with the ID provided.
*
* @since 2.1.0
* @uses $wp_rewrite WP_Rewrite
$link = $wp_rewrite->get_author_permastruct();
if ( empty($link) ) {
- $file = home_url() . '/';
+ $file = home_url( '/' );
$link = $file . '?author=' . $auth_ID;
} else {
if ( '' == $author_nicename ) {
$author_nicename = $user->user_nicename;
}
$link = str_replace('%author%', $author_nicename, $link);
- $link = home_url() . trailingslashit($link);
+ $link = home_url( user_trailingslashit( $link ) );
}
$link = apply_filters('author_link', $link, $author_id, $author_nicename);
* echoing.</li>
* <li>style (string) ('list'): Whether to display list of authors in list form
* or as a string.</li>
- * <li>html (bool) (true): Whether to list the items in html for or plaintext.
+ * <li>html (bool) (true): Whether to list the items in html form or plaintext.
* </li>
* </ul>
*
global $wpdb;
$defaults = array(
+ 'orderby' => 'name', 'order' => 'ASC', 'number' => '',
'optioncount' => false, 'exclude_admin' => true,
'show_fullname' => false, 'hide_empty' => true,
'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true,
'style' => 'list', 'html' => true
);
- $r = wp_parse_args( $args, $defaults );
- extract($r, EXTR_SKIP);
+ $args = wp_parse_args( $args, $defaults );
+ extract( $args, EXTR_SKIP );
+
$return = '';
- /** @todo Move select to get_authors(). */
- $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();
- }
+ $query_args = wp_array_slice_assoc( $args, array( 'orderby', 'order', 'number' ) );
+ $query_args['fields'] = 'ids';
+ $authors = get_users( $query_args );
$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 )
$author_count[$row->post_author] = $row->count;
- foreach ( (array) $authors as $author ) {
+ foreach ( $authors as $author_id ) {
+ $author = get_userdata( $author_id );
- $link = '';
+ if ( $exclude_admin && 'admin' == $author->display_name )
+ continue;
- $author = get_userdata( $author->ID );
- $posts = (isset($author_count[$author->ID])) ? $author_count[$author->ID] : 0;
- $name = $author->display_name;
+ $posts = isset( $author_count[$author->ID] ) ? $author_count[$author->ID] : 0;
- if ( $show_fullname && ($author->first_name != '' && $author->last_name != '') )
+ if ( !$posts && $hide_empty )
+ continue;
+
+ $link = '';
+
+ if ( $show_fullname && $author->first_name && $author->last_name )
$name = "$author->first_name $author->last_name";
+ else
+ $name = $author->display_name;
- if( !$html ) {
- if ( $posts == 0 ) {
- if ( ! $hide_empty )
- $return .= $name . ', ';
- } else
- $return .= $name . ', ';
+ if ( !$html ) {
+ $return .= $name . ', ';
- // No need to go further to process HTML.
- continue;
+ continue; // No need to go further to process HTML.
}
- if ( !($posts == 0 && $hide_empty) && 'list' == $style )
+ if ( 'list' == $style ) {
$return .= '<li>';
- if ( $posts == 0 ) {
- if ( ! $hide_empty )
- $link = $name;
- } else {
- $link = '<a href="' . get_author_posts_url($author->ID, $author->user_nicename) . '" title="' . esc_attr( sprintf(__("Posts by %s"), $author->display_name) ) . '">' . $name . '</a>';
-
- if ( (! empty($feed_image)) || (! empty($feed)) ) {
- $link .= ' ';
- if (empty($feed_image))
- $link .= '(';
- $link .= '<a href="' . get_author_feed_link($author->ID) . '"';
-
- if ( !empty($feed) ) {
- $title = ' title="' . esc_attr($feed) . '"';
- $alt = ' alt="' . esc_attr($feed) . '"';
- $name = $feed;
- $link .= $title;
- }
-
- $link .= '>';
-
- if ( !empty($feed_image) )
- $link .= "<img src=\"" . esc_url($feed_image) . "\" style=\"border: none;\"$alt$title" . ' />';
- else
- $link .= $name;
-
- $link .= '</a>';
-
- if ( empty($feed_image) )
- $link .= ')';
+ }
+
+ $link = '<a href="' . get_author_posts_url( $author->ID, $author->user_nicename ) . '" title="' . esc_attr( sprintf(__("Posts by %s"), $author->display_name) ) . '">' . $name . '</a>';
+
+ if ( !empty( $feed_image ) || !empty( $feed ) ) {
+ $link .= ' ';
+ if ( empty( $feed_image ) ) {
+ $link .= '(';
+ }
+
+ $link .= '<a href="' . get_author_feed_link( $author->ID ) . '"';
+
+ $alt = $title = '';
+ if ( !empty( $feed ) ) {
+ $title = ' title="' . esc_attr( $feed ) . '"';
+ $alt = ' alt="' . esc_attr( $feed ) . '"';
+ $name = $feed;
+ $link .= $title;
}
- if ( $optioncount )
- $link .= ' ('. $posts . ')';
+ $link .= '>';
+
+ if ( !empty( $feed_image ) )
+ $link .= '<img src="' . esc_url( $feed_image ) . '" style="border: none;"' . $alt . $title . ' />';
+ else
+ $link .= $name;
+
+ $link .= '</a>';
+ if ( empty( $feed_image ) )
+ $link .= ')';
}
- if ( $posts || ! $hide_empty )
- $return .= $link . ( ( 'list' == $style ) ? '</li>' : ', ' );
+ if ( $optioncount )
+ $link .= ' ('. $posts . ')';
+
+ $return .= $link;
+ $return .= ( 'list' == $style ) ? '</li>' : ', ';
}
- $return = trim($return, ', ');
+ $return = rtrim($return, ', ');
- if ( ! $echo )
+ if ( !$echo )
return $return;
+
echo $return;
}
*/
/**
- * Retrieve Bookmark data based on ID
+ * Retrieve Bookmark data
*
* @since 2.1.0
* @uses $wpdb Database Object
*
- * @param int $bookmark_id
+ * @param mixed $bookmark
* @param string $output Optional. Either OBJECT, ARRAY_N, or ARRAY_A constant
* @param string $filter Optional, default is 'raw'.
* @return array|object Type returned depends on $output value.
return $value;
if ( 'edit' == $context ) {
- $format_to_edit = array('link_notes');
$value = apply_filters("edit_$field", $value, $bookmark_id);
- if ( in_array($field, $format_to_edit) ) {
- $value = format_to_edit($value);
+ if ( 'link_notes' == $field ) {
+ $value = esc_html( $value ); // textarea_escaped
} else {
$value = esc_attr($value);
}
* @uses $wp_object_cache Object Cache Class
* @see WP_Object_Cache::replace()
*
- * @param int|string $id What to call the contents in the cache
+ * @param int|string $key What to call the contents in the cache
* @param mixed $data The contents to store in the cache
* @param string $flag Where to group the cache contents
* @param int $expire When to expire the cache contents
* @uses $wp_object_cache Object Cache Class
* @see WP_Object_Cache::set()
*
- * @param int|string $id What to call the contents in the cache
+ * @param int|string $key What to call the contents in the cache
* @param mixed $data The contents to store in the cache
* @param string $flag Where to group the cache contents
* @param int $expire When to expire the cache contents
* 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;
echo "<strong>Cache Hits:</strong> {$this->cache_hits}<br />";
echo "<strong>Cache Misses:</strong> {$this->cache_misses}<br />";
echo "</p>";
-
+ echo '<ul>';
foreach ($this->cache as $group => $cache) {
- echo "<p>";
- echo "<strong>Group:</strong> $group<br />";
- echo "<strong>Cache:</strong>";
- echo "<pre>";
- print_r($cache);
- echo "</pre>";
+ echo "<li><strong>Group:</strong> $group - ( " . number_format( strlen( serialize( $cache ) ) / 1024, 2 ) . 'k )</li>';
}
+ echo '</ul>';
}
/**
* @return null|false|string Null, if redirect not needed. False, if redirect
* not needed or the string of the URL
*/
-function redirect_canonical($requested_url=null, $do_redirect=true) {
- global $wp_rewrite, $is_IIS, $wp_query, $wpdb;
+function redirect_canonical( $requested_url = null, $do_redirect = true ) {
+ global $wp_rewrite, $is_iis7, $wp_query, $wpdb;
- if ( is_trackback() || is_search() || is_comments_popup() || is_admin() || $is_IIS || ( isset($_POST) && count($_POST) ) || is_preview() || is_robots() )
+ if ( is_trackback() || is_search() || is_comments_popup() || is_admin() || !empty($_POST) || is_preview() || is_robots() || ( $is_iis7 && !iis7_supports_permalinks() ) )
return;
if ( !$requested_url ) {
} 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]);
+ foreach ( $wp_query->tax_query->queries as $tax_query )
+ $term_count += count( $tax_query['terms'] );
$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) && $redirect['query'] ) {
- 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']);
+ 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 ( !empty($redirect['query']) ) {
+ 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);
} 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_category_by_path(get_query_var('category_name'));
// 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( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|rdf|atom|rss2)(/+)?$#', $redirect['path'] ) || preg_match( '#/comment-page-[0-9]+(/+)?$#', $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('#/(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
+ $redirect['path'] = preg_replace("#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/', $redirect['path']); // strip off any existing paging
+ $redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $redirect['path']); // strip off feed endings
+ $redirect['path'] = preg_replace('#/comment-page-[0-9]+?(/+)?$#', '/', $redirect['path']); // strip off any existing comment paging
}
$addl_path = '';
$redirect['query'] = remove_query_arg( 'paged', $redirect['query'] );
if ( !is_feed() ) {
if ( $paged > 1 && !is_single() ) {
- $addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit("page/$paged", 'paged');
+ $addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit("$wp_rewrite->pagination_base/$paged", 'paged');
} elseif ( !is_single() ) {
$addl_path = !empty( $addl_path ) ? trailingslashit($addl_path) : '';
}
$redirect['query'] = remove_query_arg( 'cpage', $redirect['query'] );
}
- $paged_redirect['path'] = user_trailingslashit( preg_replace('|/index.php/?$|', '/', $paged_redirect['path']) ); // strip off trailing /index.php/
- if ( !empty( $addl_path ) && $wp_rewrite->using_index_permalinks() && strpos($paged_redirect['path'], '/index.php/') === false )
- $paged_redirect['path'] = trailingslashit($paged_redirect['path']) . 'index.php/';
+ $redirect['path'] = user_trailingslashit( preg_replace('|/index.php/?$|', '/', $redirect['path']) ); // strip off trailing /index.php/
+ if ( !empty( $addl_path ) && $wp_rewrite->using_index_permalinks() && strpos($redirect['path'], '/index.php/') === false )
+ $redirect['path'] = trailingslashit($redirect['path']) . 'index.php/';
if ( !empty( $addl_path ) )
- $paged_redirect['path'] = trailingslashit($paged_redirect['path']) . $addl_path;
- $redirect_url = $paged_redirect['scheme'] . '://' . $paged_redirect['host'] . $paged_redirect['path'];
- $redirect['path'] = $paged_redirect['path'];
+ $redirect['path'] = trailingslashit($redirect['path']) . $addl_path;
+ $redirect_url = $redirect['scheme'] . '://' . $redirect['host'] . $redirect['path'];
}
}
// tack on any additional query vars
$redirect['query'] = preg_replace( '#^\??&*?#', '', $redirect['query'] );
if ( $redirect_url && !empty($redirect['query']) ) {
- if ( strpos($redirect_url, '?') !== false )
- $redirect_url .= '&';
- else
- $redirect_url .= '?';
- $redirect_url .= $redirect['query'];
+ parse_str( $redirect['query'], $_parsed_query );
+ $redirect = @parse_url($redirect_url);
+
+ if ( ! empty( $_parsed_query['name'] ) && ! empty( $redirect['query'] ) ) {
+ parse_str( $redirect['query'], $_parsed_redirect_query );
+
+ if ( empty( $_parsed_redirect_query['name'] ) )
+ unset( $_parsed_query['name'] );
+ }
+
+ $redirect_url = add_query_arg( $_parsed_query, $redirect_url );
}
if ( $redirect_url )
if ( !$redirect_url || $redirect_url == $requested_url )
return false;
-
- // Hex encoded octets are case-insensitive.
+
+ // Hex encoded octets are case-insensitive.
if ( false !== strpos($requested_url, '%') ) {
if ( !function_exists('lowercase_octets') ) {
- function lowercase_octets($matches) {
- return strtolower( $matches[0] );
- }
+ function lowercase_octets($matches) {
+ return strtolower( $matches[0] );
+ }
}
$requested_url = preg_replace_callback('|%[a-fA-F0-9][a-fA-F0-9]|', 'lowercase_octets', $requested_url);
}
if ( !get_query_var('name') )
return false;
- $where = $wpdb->prepare("post_name LIKE %s", get_query_var('name') . '%');
+ $where = $wpdb->prepare("post_name LIKE %s", like_escape( get_query_var('name') ) . '%');
// if any of post_type, year, monthnum, or day are set, use them to refine the query
if ( get_query_var('post_type') )
*
* @param int|string $id User's ID or username
* @param int $name Optional. User's username
+ * @param int $blog_id Optional Blog ID, defaults to current blog.
* @return WP_User
*/
- function WP_User( $id, $name = '' ) {
+ function WP_User( $id, $name = '', $blog_id = '' ) {
if ( empty( $id ) && empty( $name ) )
return;
}
$this->id = $this->ID;
- $this->_init_caps();
+ $this->for_blog( $blog_id );
}
/**
function set_role( $role ) {
foreach ( (array) $this->roles as $oldrole )
unset( $this->caps[$oldrole] );
+
+ if ( 1 == count( $this->roles ) && $role == $this->roles[0] )
+ return;
+
if ( !empty( $role ) ) {
$this->caps[$role] = true;
$this->roles = array( $role => true );
// Must have ALL requested caps
$capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args );
+ $capabilities['exist'] = true; // Everyone is allowed to exist
foreach ( (array) $caps as $cap ) {
//echo "Checking cap $cap<br />";
if ( empty( $capabilities[$cap] ) || !$capabilities[$cap] )
$caps[] = 'edit_users'; // Explicit due to primitive fall through
break;
case 'delete_post':
+ case 'delete_page':
$author_data = get_userdata( $user_id );
- //echo "post ID: {$args[0]}<br />";
$post = get_post( $args[0] );
$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_type->map_meta_cap ) {
+ $caps[] = $post_type->cap->$cap;
+ // Prior to 3.1 we would re-call map_meta_cap here.
+ if ( 'delete_post' == $cap )
+ $cap = $post_type->cap->$cap;
+ break;
}
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
+ // No author set yet, so default to current user for cap checks.
$post_author_data = $author_data;
}
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';
+ $caps[] = $post_type->cap->delete_published_posts;
} elseif ( 'trash' == $post->post_status ) {
if ('publish' == get_post_meta($post->ID, '_wp_trash_meta_status', true) )
- $caps[] = 'delete_published_posts';
+ $caps[] = $post_type->cap->delete_published_posts;
} else {
// If the post is draft...
- $caps[] = 'delete_posts';
+ $caps[] = $post_type->cap->delete_posts;
}
} else {
// The user is trying to edit someone else's post.
- $caps[] = 'delete_others_posts';
+ $caps[] = $post_type->cap->delete_others_posts;
// The post is published, extra cap required.
if ( 'publish' == $post->post_status )
- $caps[] = 'delete_published_posts';
+ $caps[] = $post_type->cap->delete_published_posts;
elseif ( 'private' == $post->post_status )
- $caps[] = 'delete_private_posts';
- }
- break;
- case 'delete_page':
- $author_data = get_userdata( $user_id );
- //echo "post ID: {$args[0]}<br />";
- $page = get_page( $args[0] );
- $page_author_data = get_userdata( $page->post_author );
- //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "<br />";
- // If the user is the author...
-
- if ('' != $page->post_author) {
- $page_author_data = get_userdata( $page->post_author );
- } else {
- //No author set yet so default to current user for cap checks
- $page_author_data = $author_data;
- }
-
- 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';
- } elseif ( 'trash' == $page->post_status ) {
- if ('publish' == get_post_meta($page->ID, '_wp_trash_meta_status', true) )
- $caps[] = 'delete_published_pages';
- } else {
- // If the page is draft...
- $caps[] = 'delete_pages';
- }
- } else {
- // The user is trying to edit someone else's page.
- $caps[] = 'delete_others_pages';
- // The page is published, extra cap required.
- if ( $page->post_status == 'publish' )
- $caps[] = 'delete_published_pages';
- elseif ( $page->post_status == 'private' )
- $caps[] = 'delete_private_pages';
+ $caps[] = $post_type->cap->delete_private_posts;
}
break;
// edit_post breaks down to edit_posts, edit_published_posts, or
// edit_others_posts
case 'edit_post':
+ case 'edit_page':
$author_data = get_userdata( $user_id );
- //echo "post ID: {$args[0]}<br />";
$post = get_post( $args[0] );
$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 );
+
+ if ( ! $post_type->map_meta_cap ) {
+ $caps[] = $post_type->cap->$cap;
+ // Prior to 3.1 we would re-call map_meta_cap here.
+ if ( 'edit_post' == $cap )
+ $cap = $post_type->cap->$cap;
+ break;
}
- $post_author_data = get_userdata( $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.
+ $post_author_data = $author_data;
+ }
+
//echo "current user id : $user_id, post author id: " . $post_author_data->ID . "<br />";
// If the user is the author...
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';
+ $caps[] = $post_type->cap->edit_published_posts;
} elseif ( 'trash' == $post->post_status ) {
if ('publish' == get_post_meta($post->ID, '_wp_trash_meta_status', true) )
- $caps[] = 'edit_published_posts';
+ $caps[] = $post_type->cap->edit_published_posts;
} else {
// If the post is draft...
- $caps[] = 'edit_posts';
+ $caps[] = $post_type->cap->edit_posts;
}
} else {
// The user is trying to edit someone else's post.
- $caps[] = 'edit_others_posts';
+ $caps[] = $post_type->cap->edit_others_posts;
// The post is published, extra cap required.
if ( 'publish' == $post->post_status )
- $caps[] = 'edit_published_posts';
+ $caps[] = $post_type->cap->edit_published_posts;
elseif ( 'private' == $post->post_status )
- $caps[] = 'edit_private_posts';
- }
- break;
- case 'edit_page':
- $author_data = get_userdata( $user_id );
- //echo "post ID: {$args[0]}<br />";
- $page = get_page( $args[0] );
- $page_author_data = get_userdata( $page->post_author );
- //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "<br />";
- // If the user is the author...
- 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';
- } elseif ( 'trash' == $page->post_status ) {
- if ('publish' == get_post_meta($page->ID, '_wp_trash_meta_status', true) )
- $caps[] = 'edit_published_pages';
- } else {
- // If the page is draft...
- $caps[] = 'edit_pages';
- }
- } else {
- // The user is trying to edit someone else's page.
- $caps[] = 'edit_others_pages';
- // The page is published, extra cap required.
- if ( 'publish' == $page->post_status )
- $caps[] = 'edit_published_pages';
- elseif ( 'private' == $page->post_status )
- $caps[] = 'edit_private_pages';
+ $caps[] = $post_type->cap->edit_private_posts;
}
break;
case 'read_post':
+ case 'read_page':
+ $author_data = get_userdata( $user_id );
$post = get_post( $args[0] );
$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 );
+
+ if ( ! $post_type->map_meta_cap ) {
+ $caps[] = $post_type->cap->$cap;
+ // Prior to 3.1 we would re-call map_meta_cap here.
+ if ( 'read_post' == $cap )
+ $cap = $post_type->cap->$cap;
+ break;
}
if ( 'private' != $post->post_status ) {
- $caps[] = 'read';
+ $caps[] = $post_type->cap->read;
break;
}
- $author_data = get_userdata( $user_id );
- $post_author_data = get_userdata( $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.
+ $post_author_data = $author_data;
+ }
+
if ( is_object( $post_author_data ) && $user_id == $post_author_data->ID )
- $caps[] = 'read';
+ $caps[] = $post_type->cap->read;
else
- $caps[] = 'read_private_posts';
+ $caps[] = $post_type->cap->read_private_posts;
break;
- case 'read_page':
- $page = get_page( $args[0] );
+ case 'edit_comment':
+ $comment = get_comment( $args[0] );
+ $post = get_post( $comment->comment_post_ID );
+ $post_type_object = get_post_type_object( $post->post_type );
- if ( 'private' != $page->post_status ) {
- $caps[] = 'read';
- break;
- }
-
- $author_data = get_userdata( $user_id );
- $page_author_data = get_userdata( $page->post_author );
- if ( is_object( $page_author_data ) && $user_id == $page_author_data->ID )
- $caps[] = 'read';
- else
- $caps[] = 'read_private_pages';
+ $caps = map_meta_cap( $post_type_object->cap->edit_post, $user_id, $post->ID );
break;
case 'unfiltered_upload':
if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS && ( !is_multisite() || is_super_admin( $user_id ) ) )
}
break;
case 'create_users':
- if ( is_multisite() && !get_site_option( 'add_new_users' ) )
- $caps[] = 'do_not_allow';
- else
+ if ( !is_multisite() )
+ $caps[] = $cap;
+ elseif ( is_super_admin() || get_site_option( 'add_new_users' ) )
$caps[] = $cap;
+ else
+ $caps[] = 'do_not_allow';
break;
default:
+ // Handle meta capabilities for custom post types.
+ $post_type_meta_caps = _post_type_meta_capabilities();
+ if ( isset( $post_type_meta_caps[ $cap ] ) ) {
+ $args = array_merge( array( $post_type_meta_caps[ $cap ], $user_id ), $args );
+ return call_user_func_array( 'map_meta_cap', $args );
+ }
+
// If no meta caps match, return the original cap.
$caps[] = $cap;
}
return call_user_func_array( array( &$author, 'has_cap' ), $args );
}
+/**
+ * Whether a particular user has capability or role.
+ *
+ * @since 3.1.0
+ *
+ * @param int|object $user User ID or object.
+ * @param string $capability Capability or role name.
+ * @return bool
+ */
+function user_can( $user, $capability ) {
+ if ( ! is_object( $user ) )
+ $user = new WP_User( $user );
+
+ if ( ! $user || ! $user->ID )
+ return false;
+
+ $args = array_slice( func_get_args(), 2 );
+ $args = array_merge( array( $capability ), $args );
+
+ return call_user_func_array( array( &$user, 'has_cap' ), $args );
+}
+
/**
* Retrieve role object.
*
*
* @param string $role Role name.
* @param string $display_name Display name for role.
- * @param array $capabilities List of capabilities.
+ * @param array $capabilities List of capabilities, e.g. array( 'edit_posts' => true, 'delete_posts' => false );
* @return null|WP_Role WP_Role object if role is added, null if already exists.
*/
function add_role( $role, $display_name, $capabilities = array() ) {
* @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 )
+ $user = new WP_User( $user_id );
+ else
+ $user = wp_get_current_user();
- if ( ! $user_id )
+ if ( empty( $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 ) )
* Retrieve category link URL.
*
* @since 1.0.0
- * @uses apply_filters() Calls 'category_link' filter on category link and category ID.
+ * @see get_term_link()
*
- * @param int $category_id Category ID.
- * @return string
+ * @param int|object $category Category ID or object.
+ * @return string Link on success, empty string if category does not exist.
*/
-function get_category_link( $category_id ) {
- global $wp_rewrite;
- $catlink = $wp_rewrite->get_category_permastruct();
+function get_category_link( $category ) {
+ if ( ! is_object( $category ) )
+ $category = (int) $category;
- if ( empty( $catlink ) ) {
- $catlink = home_url('?cat=' . $category_id);
- } else {
- $category = &get_category( $category_id );
- if ( is_wp_error( $category ) )
- return $category;
- $category_nicename = $category->slug;
-
- if ( $category->parent == $category_id ) // recursive recursion
- $category->parent = 0;
- elseif ($category->parent != 0 )
- $category_nicename = get_category_parents( $category->parent, false, '/', true ) . $category_nicename;
-
- $catlink = str_replace( '%category%', $category_nicename, $catlink );
- $catlink = home_url( user_trailingslashit( $catlink, 'category' ) );
- }
- return apply_filters( 'category_link', $catlink, $category_id );
+ $category = get_term_link( $category, 'category' );
+
+ if ( is_wp_error( $category ) )
+ return '';
+
+ return $category;
}
/**
if ( $nicename )
$name = $parent->slug;
else
- $name = $parent->cat_name;
+ $name = $parent->name;
if ( $parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited ) ) {
$visited[] = $parent->parent;
}
if ( $link )
- $chain .= '<a href="' . get_category_link( $parent->term_id ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $parent->cat_name ) ) . '">'.$name.'</a>' . $separator;
+ $chain .= '<a href="' . get_category_link( $parent->term_id ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $parent->name ) ) . '">'.$name.'</a>' . $separator;
else
$chain .= $name.$separator;
return $chain;
* @return array
*/
function get_the_category( $id = false ) {
- global $post;
-
- $id = (int) $id;
- if ( !$id )
- $id = (int) $post->ID;
-
- $categories = get_object_term_cache( $id, 'category' );
- if ( false === $categories ) {
- $categories = wp_get_object_terms( $id, 'category' );
- wp_cache_add($id, $categories, 'category_relationships');
- }
-
- if ( !empty( $categories ) )
- usort( $categories, '_usort_terms_by_name' );
- else
+ $categories = get_the_terms( $id, 'category' );
+ if ( ! $categories )
$categories = array();
- foreach ( (array) array_keys( $categories ) as $key ) {
+ $categories = array_values( $categories );
+
+ foreach ( array_keys( $categories ) as $key ) {
_make_cat_compat( $categories[$key] );
}
- return $categories;
+ // Filter name is plural because we return alot of categories not just one
+ return apply_filters( 'get_the_categories', $categories );
}
/**
break;
case '':
default:
- $thelist .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->cat_name.'</a></li>';
+ $thelist .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a></li>';
}
}
$thelist .= '</ul>';
case 'multiple':
if ( $category->parent )
$thelist .= get_category_parents( $category->parent, true, $separator );
- $thelist .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->cat_name.'</a>';
+ $thelist .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>' . $category->name.'</a>';
break;
case 'single':
$thelist .= '<a href="' . get_category_link( $category->term_id ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '" ' . $rel . '>';
if ( $category->parent )
$thelist .= get_category_parents( $category->parent, false, $separator );
- $thelist .= "$category->cat_name</a>";
+ $thelist .= "$category->name</a>";
break;
case '':
default:
*
* @since 1.2.0
*
- * @uses is_object_in_term()
- *
- * @param int|string|array $category. Category ID, name or slug, or array of said.
- * @param int|post object Optional. Post to check instead of the current post. @since 2.7.0
+ * @param int|string|array $category Category ID, name or slug, or array of said.
+ * @param int|object $_post Optional. Post to check instead of the current post. (since 2.7.0)
* @return bool True if the current post is in any of the given categories.
*/
-function in_category( $category, $_post = null ) {
+function in_category( $category, $post = null ) {
if ( empty( $category ) )
return false;
- if ( $_post ) {
- $_post = get_post( $_post );
- } else {
- $_post =& $GLOBALS['post'];
- }
-
- if ( !$_post )
- return false;
-
- $r = is_object_in_term( $_post->ID, 'category', $category );
- if ( is_wp_error( $r ) )
- return false;
- return $r;
+ return has_term( $category, 'category', $post );
}
/**
$output = '';
if ( $title_li && 'list' == $style )
- $output = '<li class="' . $class . '">' . $title_li . '<ul>';
+ $output = '<li class="' . esc_attr( $class ) . '">' . $title_li . '<ul>';
if ( empty( $categories ) ) {
if ( ! empty( $show_option_none ) ) {
$output .= $show_option_none;
}
} else {
- global $wp_query;
-
if( !empty( $show_option_all ) )
if ( 'list' == $style )
$output .= '<li><a href="' . get_bloginfo( 'url' ) . '">' . $show_option_all . '</a></li>';
else
$output .= '<a href="' . get_bloginfo( 'url' ) . '">' . $show_option_all . '</a>';
- if ( empty( $r['current_category'] ) && ( is_category() || is_tax() ) )
- $r['current_category'] = $wp_query->get_queried_object_id();
+ if ( empty( $r['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) {
+ $current_term_object = get_queried_object();
+ if ( $r['taxonomy'] == $current_term_object->taxonomy )
+ $r['current_category'] = get_queried_object_id();
+ }
if ( $hierarchical )
$depth = $r['depth'];
foreach ( $tags as $key => $tag ) {
if ( 'edit' == $args['link'] )
- $link = get_edit_tag_link( $tag->term_id, $args['taxonomy'] );
+ $link = get_edit_tag_link( $tag->term_id, $tag->taxonomy );
else
- $link = get_term_link( intval($tag->term_id), $args['taxonomy'] );
+ $link = get_term_link( intval($tag->term_id), $tag->taxonomy );
if ( is_wp_error( $link ) )
return false;
$tag_link = '#' != $tag->link ? esc_url( $tag->link ) : '#';
$tag_id = isset($tags[ $key ]->id) ? $tags[ $key ]->id : $key;
$tag_name = $tags[ $key ]->name;
- $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( $topic_count_text_callback( $real_count ) ) . "' style='font-size: " .
+ $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( call_user_func( $topic_count_text_callback, $real_count ) ) . "' style='font-size: " .
( $smallest + ( ( $count - $min_count ) * $font_step ) )
. "$unit;'>$tag_name</a>";
}
break;
endswitch;
- if ( $filter )
+ if ( $filter )
return apply_filters( 'wp_generate_tag_cloud', $return, $tags, $args );
- else
+ else
return $return;
}
+/**
+ * Callback for comparing tags based on name
+ *
+ * @since 3.1.0
+ * @access private
+ */
+function _wp_tag_cloud_name_sort_cb( $a, $b ) {
+ return strnatcasecmp( $a->name, $b->name );
+}
+
+/**
+ * Callback for comparing tags based on count
+ *
+ * @since 3.1.0
+ * @access private
+ */
+function _wp_tag_cloud_count_sort_cb( $a, $b ) {
+ return ( $a->count > $b->count );
+}
+
//
// Helper functions
//
return call_user_func_array(array( &$walker, 'walk' ), $args );
}
+/**
+ * Create HTML list of categories.
+ *
+ * @package WordPress
+ * @since 2.1.0
+ * @uses Walker
+ */
+class Walker_Category extends Walker {
+ /**
+ * @see Walker::$tree_type
+ * @since 2.1.0
+ * @var string
+ */
+ var $tree_type = 'category';
+
+ /**
+ * @see Walker::$db_fields
+ * @since 2.1.0
+ * @todo Decouple this
+ * @var array
+ */
+ var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
+
+ /**
+ * @see Walker::start_lvl()
+ * @since 2.1.0
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ * @param int $depth Depth of category. Used for tab indentation.
+ * @param array $args Will only append content if style argument value is 'list'.
+ */
+ function start_lvl(&$output, $depth, $args) {
+ if ( 'list' != $args['style'] )
+ return;
+
+ $indent = str_repeat("\t", $depth);
+ $output .= "$indent<ul class='children'>\n";
+ }
+
+ /**
+ * @see Walker::end_lvl()
+ * @since 2.1.0
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ * @param int $depth Depth of category. Used for tab indentation.
+ * @param array $args Will only append content if style argument value is 'list'.
+ */
+ function end_lvl(&$output, $depth, $args) {
+ if ( 'list' != $args['style'] )
+ return;
+
+ $indent = str_repeat("\t", $depth);
+ $output .= "$indent</ul>\n";
+ }
+
+ /**
+ * @see Walker::start_el()
+ * @since 2.1.0
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ * @param object $category Category data object.
+ * @param int $depth Depth of category in reference to parents.
+ * @param array $args
+ */
+ function start_el(&$output, $category, $depth, $args) {
+ extract($args);
+
+ $cat_name = esc_attr( $category->name );
+ $cat_name = apply_filters( 'list_cats', $cat_name, $category );
+ $link = '<a href="' . esc_attr( get_term_link($category) ) . '" ';
+ if ( $use_desc_for_title == 0 || empty($category->description) )
+ $link .= 'title="' . esc_attr( sprintf(__( 'View all posts filed under %s' ), $cat_name) ) . '"';
+ else
+ $link .= 'title="' . esc_attr( strip_tags( apply_filters( 'category_description', $category->description, $category ) ) ) . '"';
+ $link .= '>';
+ $link .= $cat_name . '</a>';
+
+ if ( !empty($feed_image) || !empty($feed) ) {
+ $link .= ' ';
+
+ if ( empty($feed_image) )
+ $link .= '(';
+
+ $link .= '<a href="' . get_term_feed_link( $category->term_id, $category->taxonomy, $feed_type ) . '"';
+
+ if ( empty($feed) ) {
+ $alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"';
+ } else {
+ $title = ' title="' . $feed . '"';
+ $alt = ' alt="' . $feed . '"';
+ $name = $feed;
+ $link .= $title;
+ }
+
+ $link .= '>';
+
+ if ( empty($feed_image) )
+ $link .= $name;
+ else
+ $link .= "<img src='$feed_image'$alt$title" . ' />';
+
+ $link .= '</a>';
+
+ if ( empty($feed_image) )
+ $link .= ')';
+ }
+
+ if ( !empty($show_count) )
+ $link .= ' (' . intval($category->count) . ')';
+
+ if ( !empty($show_date) )
+ $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);
+
+ if ( 'list' == $args['style'] ) {
+ $output .= "\t<li";
+ $class = 'cat-item cat-item-' . $category->term_id;
+ if ( !empty($current_category) ) {
+ $_current_category = get_term( $current_category, $category->taxonomy );
+ if ( $category->term_id == $current_category )
+ $class .= ' current-cat';
+ elseif ( $category->term_id == $_current_category->parent )
+ $class .= ' current-cat-parent';
+ }
+ $output .= ' class="' . $class . '"';
+ $output .= ">$link\n";
+ } else {
+ $output .= "\t$link<br />\n";
+ }
+ }
+
+ /**
+ * @see Walker::end_el()
+ * @since 2.1.0
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ * @param object $page Not used.
+ * @param int $depth Depth of category. Not used.
+ * @param array $args Only uses 'list' for whether should append to output.
+ */
+ function end_el(&$output, $page, $depth, $args) {
+ if ( 'list' != $args['style'] )
+ return;
+
+ $output .= "</li>\n";
+ }
+
+}
+
+/**
+ * Create HTML dropdown list of Categories.
+ *
+ * @package WordPress
+ * @since 2.1.0
+ * @uses Walker
+ */
+class Walker_CategoryDropdown extends Walker {
+ /**
+ * @see Walker::$tree_type
+ * @since 2.1.0
+ * @var string
+ */
+ var $tree_type = 'category';
+
+ /**
+ * @see Walker::$db_fields
+ * @since 2.1.0
+ * @todo Decouple this
+ * @var array
+ */
+ var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
+
+ /**
+ * @see Walker::start_el()
+ * @since 2.1.0
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ * @param object $category Category data object.
+ * @param int $depth Depth of category. Used for padding.
+ * @param array $args Uses 'selected', 'show_count', and 'show_last_update' keys, if they exist.
+ */
+ function start_el(&$output, $category, $depth, $args) {
+ $pad = str_repeat(' ', $depth * 3);
+
+ $cat_name = apply_filters('list_cats', $category->name, $category);
+ $output .= "\t<option class=\"level-$depth\" value=\"".$category->term_id."\"";
+ if ( $category->term_id == $args['selected'] )
+ $output .= ' selected="selected"';
+ $output .= '>';
+ $output .= $pad.$cat_name;
+ if ( $args['show_count'] )
+ $output .= ' ('. $category->count .')';
+ if ( $args['show_last_update'] ) {
+ $format = 'Y-m-d';
+ $output .= ' ' . gmdate($format, $category->last_update_timestamp);
+ }
+ $output .= "</option>\n";
+ }
+}
+
//
// Tags
//
* Retrieve the link to the tag.
*
* @since 2.3.0
- * @uses apply_filters() Calls 'tag_link' with tag link and tag ID as parameters.
+ * @see get_term_link()
*
- * @param int $tag_id Tag (term) ID.
- * @return string
+ * @param int|object $tag Tag ID or object.
+ * @return string Link on success, empty string if tag does not exist.
*/
-function get_tag_link( $tag_id ) {
- global $wp_rewrite;
- $taglink = $wp_rewrite->get_tag_permastruct();
+function get_tag_link( $tag ) {
+ if ( ! is_object( $tag ) )
+ $tag = (int) $tag;
+
+ $tag = get_term_link( $tag, 'post_tag' );
- $tag = &get_term( $tag_id, 'post_tag' );
if ( is_wp_error( $tag ) )
- return $tag;
- $slug = $tag->slug;
+ return '';
- if ( empty( $taglink ) ) {
- $file = get_option( 'home' ) . '/';
- $taglink = $file . '?tag=' . $slug;
- } else {
- $taglink = str_replace( '%tag%', $slug, $taglink );
- $taglink = get_option( 'home' ) . user_trailingslashit( $taglink, 'category' );
- }
- return apply_filters( 'tag_link', $taglink, $tag_id );
+ return $tag;
}
/**
*/
function term_description( $term = 0, $taxonomy = 'post_tag' ) {
if ( !$term && ( is_tax() || is_tag() || is_category() ) ) {
- global $wp_query;
- $term = $wp_query->get_queried_object();
+ $term = get_queried_object();
$taxonomy = $term->taxonomy;
$term = $term->term_id;
}
}
$terms = get_object_term_cache( $id, $taxonomy );
- if ( false === $terms )
+ if ( false === $terms ) {
$terms = wp_get_object_terms( $id, $taxonomy );
+ wp_cache_add($id, $terms, $taxonomy . '_relationships');
+ }
+
+ $terms = apply_filters( 'get_the_terms', $terms, $id, $taxonomy );
if ( empty( $terms ) )
return false;
*
* @since 2.5.0
*
- * @param int $id Term ID.
+ * @param int $id Post ID.
* @param string $taxonomy Taxonomy name.
* @param string $before Optional. Before list.
* @param string $sep Optional. Separate items using this.
* @param string $after Optional. After list.
* @return null|bool False on WordPress error. Returns null when displaying.
*/
-function the_terms( $id, $taxonomy, $before = '', $sep = ', ', $after = '' ) {
+function the_terms( $id = 0, $taxonomy, $before = '', $sep = ', ', $after = '' ) {
$term_list = get_the_term_list( $id, $taxonomy, $before, $sep, $after );
if ( is_wp_error( $term_list ) )
echo apply_filters('the_terms', $term_list, $taxonomy, $before, $sep, $after);
}
+
+/**
+ * Check if the current post has any of given category.
+ *
+ * @since 3.1.0
+ *
+ * @param string|int|array $tag Optional. The category name/term_id/slug or array of them to check for.
+ * @param int|object $post Optional. Post to check instead of the current post.
+ * @return bool True if the current post has any of the given categories (or any category, if no category specified).
+ */
+function has_category( $category = '', $post = null ) {
+ return has_term( $category, 'category', $post );
+}
+
/**
* Check if the current post has any of given tags.
*
*
* @since 2.6.0
*
- * @uses is_object_in_term()
- *
* @param string|int|array $tag Optional. The tag name/term_id/slug or array of them to check for.
- * @param int|post object Optional. Post to check instead of the current post. @since 2.7.0
- * @return bool True if the current post has any of the the given tags (or any tag, if no tag specified).
+ * @param int|object $post Optional. Post to check instead of the current post. (since 2.7.0)
+ * @return bool True if the current post has any of the given tags (or any tag, if no tag specified).
*/
-function has_tag( $tag = '', $_post = null ) {
- if ( $_post ) {
- $_post = get_post( $_post );
- } else {
- $_post =& $GLOBALS['post'];
- }
+function has_tag( $tag = '', $post = null ) {
+ return has_term( $tag, 'post_tag', $post );
+}
- if ( !$_post )
+/**
+ * Check if the current post has any of given terms.
+ *
+ * The given terms are checked against the post's terms' term_ids, names and slugs.
+ * Terms given as integers will only be checked against the post's terms' term_ids.
+ * If no terms are given, determines if post has any terms.
+ *
+ * @since 3.1.0
+ *
+ * @param string|int|array $term Optional. The term name/term_id/slug or array of them to check for.
+ * @param string $taxonomy Taxonomy name
+ * @param int|object $post Optional. Post to check instead of the current post.
+ * @return bool True if the current post has any of the given tags (or any tag, if no tag specified).
+ */
+function has_term( $term = '', $taxonomy = '', $post = null ) {
+ $post = get_post($post);
+
+ if ( !$post )
return false;
- $r = is_object_in_term( $_post->ID, 'post_tag', $tag );
+ $r = is_object_in_term( $post->ID, $taxonomy, $term );
if ( is_wp_error( $r ) )
return false;
+
return $r;
}
-?>
\ No newline at end of file
+?>
/* Cache */
-/**
- * Update the categories cache.
- *
- * This function does not appear to be used anymore or does not appear to be
- * needed. It might be a legacy function left over from when there was a need
- * for updating the category cache.
- *
- * @since 1.5.0
- *
- * @return bool Always return True
- */
-function update_category_cache() {
- return true;
-}
-
-
/**
* Remove the category cache data based on ID.
*
<?php
/**
- * IXR - The Inutio XML-RPC Library
+ * IXR - The Incutio XML-RPC Library
+ *
+ * Copyright (c) 2010, Incutio Ltd.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the name of Incutio Ltd. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @package IXR
* @since 1.5
*
- * @copyright Incutio Ltd 2002-2005
- * @version 1.7 (beta) 23rd May 2005
- * @author Simon Willison
- * @link http://scripts.incutio.com/xmlrpc/ Site
- * @link http://scripts.incutio.com/xmlrpc/manual.php Manual
- * @license BSD License http://www.opensource.org/licenses/bsd-license.php
+ * @copyright Incutio Ltd 2010 (http://www.incutio.com)
+ * @version 1.7.4 7th September 2010
+ * @author Simon Willison
+ * @link http://scripts.incutio.com/xmlrpc/ Site/manual
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
*/
/**
var $data;
var $type;
- function IXR_Value ($data, $type = false) {
+ function IXR_Value($data, $type = false)
+ {
$this->data = $data;
if (!$type) {
$type = $this->calculateType();
}
$this->type = $type;
if ($type == 'struct') {
- /* Turn all the values in the array in to new IXR_Value objects */
+ // Turn all the values in the array in to new IXR_Value objects
foreach ($this->data as $key => $value) {
$this->data[$key] = new IXR_Value($value);
}
}
}
- function calculateType() {
+ function calculateType()
+ {
if ($this->data === true || $this->data === false) {
return 'boolean';
}
if (is_double($this->data)) {
return 'double';
}
+
// Deal with IXR object types base64 and date
if (is_object($this->data) && is_a($this->data, 'IXR_Date')) {
return 'date';
if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) {
return 'base64';
}
+
// If it is a normal PHP object convert it in to a struct
if (is_object($this->data)) {
-
$this->data = get_object_vars($this->data);
return 'struct';
}
if (!is_array($this->data)) {
return 'string';
}
- /* We have an array - is it an array or a struct ? */
+
+ // We have an array - is it an array or a struct?
if ($this->isStruct($this->data)) {
return 'struct';
} else {
}
}
- function getXml() {
- /* Return XML for this value */
+ function getXml()
+ {
+ // Return XML for this value
switch ($this->type) {
case 'boolean':
return '<boolean>'.(($this->data) ? '1' : '0').'</boolean>';
return false;
}
- function isStruct($array) {
- /* Nasty function to check if an array is a struct or not */
+ /**
+ * Checks whether or not the supplied array is a struct or not
+ *
+ * @param unknown_type $array
+ * @return boolean
+ */
+ function isStruct($array)
+ {
$expected = 0;
foreach ($array as $key => $value) {
if ((string)$key != (string)$expected) {
}
/**
- * IXR_Message
+ * IXR_MESSAGE
*
* @package IXR
* @since 1.5
+ *
*/
-class IXR_Message {
+class IXR_Message
+{
var $message;
var $messageType; // methodCall / methodResponse / fault
var $faultCode;
var $faultString;
var $methodName;
var $params;
+
// Current variable stacks
var $_arraystructs = array(); // The stack used to keep track of the current array/struct
var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array
var $_currentTagContents;
// The XML parser
var $_parser;
- function IXR_Message (&$message) {
- $this->message = &$message;
- }
- function parse() {
- // first remove the XML declaration
- // this method avoids the RAM usage of preg_replace on very large messages
- $header = preg_replace( '/<\?xml.*?\?'.'>/', '', substr( $this->message, 0, 100 ), 1 );
- $this->message = substr_replace($this->message, $header, 0, 100);
+
+ function IXR_Message($message)
+ {
+ $this->message =& $message;
+ }
+
+ function parse()
+ {
+ // first remove the XML declaration
+ // merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages
+ $header = preg_replace( '/<\?xml.*?\?'.'>/', '', substr($this->message, 0, 100), 1);
+ $this->message = substr_replace($this->message, $header, 0, 100);
if (trim($this->message) == '') {
return false;
- }
+ }
$this->_parser = xml_parser_create();
// Set XML parser to take the case of tags in to account
xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false);
// Set XML parser callback functions
xml_set_object($this->_parser, $this);
xml_set_element_handler($this->_parser, 'tag_open', 'tag_close');
- xml_set_character_data_handler($this->_parser, 'cdata');
- $chunk_size = 262144; // 256Kb, parse in chunks to avoid the RAM usage on very large messages
- do {
- if ( strlen($this->message) <= $chunk_size )
- $final=true;
- $part = substr( $this->message, 0, $chunk_size );
- $this->message = substr( $this->message, $chunk_size );
- if ( !xml_parse( $this->_parser, $part, $final ) )
- return false;
- if ( $final )
- break;
- } while ( true );
- xml_parser_free($this->_parser);
+ xml_set_character_data_handler($this->_parser, 'cdata');
+ $chunk_size = 262144; // 256Kb, parse in chunks to avoid the RAM usage on very large messages
+ $final = false;
+ do {
+ if (strlen($this->message) <= $chunk_size) {
+ $final = true;
+ }
+ $part = substr($this->message, 0, $chunk_size);
+ $this->message = substr($this->message, $chunk_size);
+ if (!xml_parse($this->_parser, $part, $final)) {
+ return false;
+ }
+ if ($final) {
+ break;
+ }
+ } while (true);
+ xml_parser_free($this->_parser);
+
// Grab the error messages, if any
if ($this->messageType == 'fault') {
$this->faultCode = $this->params[0]['faultCode'];
$this->faultString = $this->params[0]['faultString'];
- }
+ }
return true;
}
- function tag_open($parser, $tag, $attr) {
+
+ function tag_open($parser, $tag, $attr)
+ {
$this->_currentTagContents = '';
$this->currentTag = $tag;
switch($tag) {
case 'fault':
$this->messageType = $tag;
break;
- /* Deal with stacks of arrays and structs */
+ /* Deal with stacks of arrays and structs */
case 'data': // data is to all intents and puposes more interesting than array
$this->_arraystructstypes[] = 'array';
$this->_arraystructs[] = array();
break;
}
}
- function cdata($parser, $cdata) {
+
+ function cdata($parser, $cdata)
+ {
$this->_currentTagContents .= $cdata;
}
- function tag_close($parser, $tag) {
+
+ function tag_close($parser, $tag)
+ {
$valueFlag = false;
switch($tag) {
case 'int':
case 'i4':
- $value = (int) trim($this->_currentTagContents);
+ $value = (int)trim($this->_currentTagContents);
$valueFlag = true;
break;
case 'double':
- $value = (double) trim($this->_currentTagContents);
+ $value = (double)trim($this->_currentTagContents);
$valueFlag = true;
break;
case 'string':
- $value = $this->_currentTagContents;
+ $value = (string)trim($this->_currentTagContents);
$valueFlag = true;
break;
case 'dateTime.iso8601':
$value = new IXR_Date(trim($this->_currentTagContents));
- // $value = $iso->getTimestamp();
$valueFlag = true;
break;
case 'value':
}
break;
case 'boolean':
- $value = (boolean) trim($this->_currentTagContents);
+ $value = (boolean)trim($this->_currentTagContents);
$valueFlag = true;
break;
case 'base64':
- $value = base64_decode( trim( $this->_currentTagContents ) );
+ $value = base64_decode($this->_currentTagContents);
$valueFlag = true;
break;
- /* Deal with stacks of arrays and structs */
+ /* Deal with stacks of arrays and structs */
case 'data':
case 'struct':
$value = array_pop($this->_arraystructs);
$this->methodName = trim($this->_currentTagContents);
break;
}
+
if ($valueFlag) {
if (count($this->_arraystructs) > 0) {
// Add value to struct or array
* @package IXR
* @since 1.5
*/
-class IXR_Server {
+class IXR_Server
+{
var $data;
var $callbacks = array();
var $message;
var $capabilities;
- function IXR_Server($callbacks = false, $data = false) {
+
+ function IXR_Server($callbacks = false, $data = false, $wait = false)
+ {
$this->setCapabilities();
if ($callbacks) {
$this->callbacks = $callbacks;
}
$this->setCallbacks();
- $this->serve($data);
+ if (!$wait) {
+ $this->serve($data);
+ }
}
- function serve($data = false) {
+
+ function serve($data = false)
+ {
if (!$data) {
+ if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] !== 'POST') {
+ header('Content-Type: text/plain'); // merged from WP #9093
+ die('XML-RPC server accepts POST requests only.');
+ }
+
global $HTTP_RAW_POST_DATA;
- if (!$HTTP_RAW_POST_DATA) {
- header( 'Content-Type: text/plain' );
- die('XML-RPC server accepts POST requests only.');
+ if (empty($HTTP_RAW_POST_DATA)) {
+ // workaround for a bug in PHP 5.2.2 - http://bugs.php.net/bug.php?id=41293
+ $data = file_get_contents('php://input');
+ } else {
+ $data =& $HTTP_RAW_POST_DATA;
}
- $data = &$HTTP_RAW_POST_DATA;
}
$this->message = new IXR_Message($data);
if (!$this->message->parse()) {
$this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall');
}
$result = $this->call($this->message->methodName, $this->message->params);
+
// Is the result an error?
if (is_a($result, 'IXR_Error')) {
$this->error($result);
}
+
// Encode the result
$r = new IXR_Value($result);
$resultxml = $r->getXml();
+
// Create the XML
$xml = <<<EOD
<methodResponse>
<params>
<param>
<value>
- $resultxml
+ $resultxml
</value>
</param>
</params>
</methodResponse>
EOD;
- // Send it
- $this->output($xml);
+ // Send it
+ $this->output($xml);
}
- function call($methodname, $args) {
+
+ function call($methodname, $args)
+ {
if (!$this->hasMethod($methodname)) {
- return new IXR_Error(-32601, 'server error. requested method '.
- $methodname.' does not exist.');
+ return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.');
}
$method = $this->callbacks[$methodname];
+
// Perform the callback and send the response
if (count($args) == 1) {
// If only one paramater just send that instead of the whole array
$args = $args[0];
}
+
// Are we dealing with a function or a method?
- if ( is_string( $method ) && 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)) {
- return new IXR_Error(-32601, 'server error. requested class method "'.
- $method.'" does not exist.');
+ return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.');
}
- // Call the method
+
+ //Call the method
$result = $this->$method($args);
} else {
// It's a function - does it exist?
if (is_array($method)) {
- if (!method_exists($method[0], $method[1])) {
- return new IXR_Error(-32601, 'server error. requested object method "'.
- $method[1].'" does not exist.');
+ if (!is_callable(array($method[0], $method[1]))) {
+ return new IXR_Error(-32601, 'server error. requested object method "'.$method[1].'" does not exist.');
}
} else if (!function_exists($method)) {
- return new IXR_Error(-32601, 'server error. requested function "'.
- $method.'" does not exist.');
+ return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.');
}
+
// Call the function
$result = call_user_func($method, $args);
}
return $result;
}
- function error($error, $message = false) {
+ function error($error, $message = false)
+ {
// Accepts either an error object or an error code and message
if ($message && !is_object($error)) {
$error = new IXR_Error($error, $message);
}
$this->output($error->getXml());
}
- function output($xml) {
+
+ function output($xml)
+ {
$xml = '<?xml version="1.0"?>'."\n".$xml;
$length = strlen($xml);
header('Connection: close');
echo $xml;
exit;
}
- function hasMethod($method) {
+
+ function hasMethod($method)
+ {
return in_array($method, array_keys($this->callbacks));
}
- function setCapabilities() {
+
+ function setCapabilities()
+ {
// Initialises capabilities array
$this->capabilities = array(
'xmlrpc' => array(
'specUrl' => 'http://www.xmlrpc.com/spec',
'specVersion' => 1
- ),
+ ),
'faults_interop' => array(
'specUrl' => 'http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php',
'specVersion' => 20010516
- ),
+ ),
'system.multicall' => array(
'specUrl' => 'http://www.xmlrpc.com/discuss/msgReader$1208',
'specVersion' => 1
- ),
+ ),
);
}
- function getCapabilities($args) {
+
+ function getCapabilities($args)
+ {
return $this->capabilities;
}
- function setCallbacks() {
+
+ function setCallbacks()
+ {
$this->callbacks['system.getCapabilities'] = 'this:getCapabilities';
$this->callbacks['system.listMethods'] = 'this:listMethods';
$this->callbacks['system.multicall'] = 'this:multiCall';
}
- function listMethods($args) {
+
+ function listMethods($args)
+ {
// Returns a list of methods - uses array_reverse to ensure user defined
// methods are listed before server defined methods
return array_reverse(array_keys($this->callbacks));
}
- function multiCall($methodcalls) {
+
+ function multiCall($methodcalls)
+ {
// See http://www.xmlrpc.com/discuss/msgReader$1208
$return = array();
foreach ($methodcalls as $call) {
* @package IXR
* @since 1.5
*/
-class IXR_Request {
+class IXR_Request
+{
var $method;
var $args;
var $xml;
- function IXR_Request($method, $args) {
+
+ function IXR_Request($method, $args)
+ {
$this->method = $method;
$this->args = $args;
$this->xml = <<<EOD
}
$this->xml .= '</params></methodCall>';
}
- function getLength() {
+
+ function getLength()
+ {
return strlen($this->xml);
}
- function getXml() {
+
+ function getXml()
+ {
return $this->xml;
}
}
*
* @package IXR
* @since 1.5
+ *
*/
-class IXR_Client {
+class IXR_Client
+{
var $server;
var $port;
var $path;
var $useragent;
- var $headers;
var $response;
var $message = false;
var $debug = false;
var $timeout;
+ var $headers = array();
+
// Storage place for an error message
var $error = false;
- function IXR_Client($server, $path = false, $port = 80, $timeout = false) {
+
+ function IXR_Client($server, $path = false, $port = 80, $timeout = 15)
+ {
if (!$path) {
// Assume we have been given a URL instead
$bits = parse_url($server);
$this->server = $bits['host'];
$this->port = isset($bits['port']) ? $bits['port'] : 80;
$this->path = isset($bits['path']) ? $bits['path'] : '/';
+
// Make absolutely sure we have a path
if (!$this->path) {
$this->path = '/';
$this->useragent = 'The Incutio XML-RPC PHP Library';
$this->timeout = $timeout;
}
- function query() {
+
+ function query()
+ {
$args = func_get_args();
$method = array_shift($args);
$request = new IXR_Request($method, $args);
$r = "\r\n";
$request = "POST {$this->path} HTTP/1.0$r";
- $this->headers['Host'] = $this->server;
- $this->headers['Content-Type'] = 'text/xml';
- $this->headers['User-Agent'] = $this->useragent;
- $this->headers['Content-Length']= $length;
+ // Merged from WP #8145 - allow custom headers
+ $this->headers['Host'] = $this->server;
+ $this->headers['Content-Type'] = 'text/xml';
+ $this->headers['User-Agent'] = $this->useragent;
+ $this->headers['Content-Length']= $length;
- foreach( $this->headers as $header => $value ) {
- $request .= "{$header}: {$value}{$r}";
- }
- $request .= $r;
+ foreach( $this->headers as $header => $value ) {
+ $request .= "{$header}: {$value}{$r}";
+ }
+ $request .= $r;
$request .= $xml;
+
// Now send the request
if ($this->debug) {
echo '<pre class="ixr_request">'.htmlspecialchars($request)."\n</pre>\n\n";
}
+
if ($this->timeout) {
$fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout);
} else {
$fp = @fsockopen($this->server, $this->port, $errno, $errstr);
}
if (!$fp) {
- $this->error = new IXR_Error(-32300, "transport error - could not open socket: $errno $errstr");
+ $this->error = new IXR_Error(-32300, 'transport error - could not open socket');
return false;
}
fputs($fp, $request);
$contents = '';
- $debug_contents = '';
+ $debugContents = '';
$gotFirstLine = false;
$gettingHeaders = true;
while (!feof($fp)) {
if (!$gotFirstLine) {
// Check line for '200'
if (strstr($line, '200') === false) {
- $this->error = new IXR_Error(-32301, 'transport error - HTTP status code was not 200');
+ $this->error = new IXR_Error(-32300, 'transport error - HTTP status code was not 200');
return false;
}
$gotFirstLine = true;
$gettingHeaders = false;
}
if (!$gettingHeaders) {
- // WP#12559 remove trim so as to not strip newlines from received response.
+ // merged from WP #12559 - remove trim
$contents .= $line;
}
if ($this->debug) {
- $debug_contents .= $line;
+ $debugContents .= $line;
}
}
if ($this->debug) {
- echo '<pre class="ixr_response">'.htmlspecialchars($debug_contents)."\n</pre>\n\n";
+ echo '<pre class="ixr_response">'.htmlspecialchars($debugContents)."\n</pre>\n\n";
}
+
// Now parse what we've got back
$this->message = new IXR_Message($contents);
if (!$this->message->parse()) {
$this->error = new IXR_Error(-32700, 'parse error. not well formed');
return false;
}
+
// Is the message a fault?
if ($this->message->messageType == 'fault') {
$this->error = new IXR_Error($this->message->faultCode, $this->message->faultString);
return false;
}
+
// Message must be OK
return true;
}
- function getResponse() {
+
+ function getResponse()
+ {
// methodResponses can only have one param - return that
return $this->message->params[0];
}
- function isError() {
+
+ function isError()
+ {
return (is_object($this->error));
}
- function getErrorCode() {
+
+ function getErrorCode()
+ {
return $this->error->code;
}
- function getErrorMessage() {
+
+ function getErrorMessage()
+ {
return $this->error->message;
}
}
+
/**
* IXR_Error
*
* @package IXR
* @since 1.5
*/
-class IXR_Error {
+class IXR_Error
+{
var $code;
var $message;
- function IXR_Error($code, $message) {
+
+ function IXR_Error($code, $message)
+ {
$this->code = $code;
- // WP adds htmlspecialchars(). See #5666
$this->message = htmlspecialchars($message);
}
- function getXml() {
+
+ function getXml()
+ {
$xml = <<<EOD
<methodResponse>
<fault>
var $minute;
var $second;
var $timezone;
- function IXR_Date($time) {
+
+ function IXR_Date($time)
+ {
// $time can be a PHP timestamp or an ISO one
if (is_numeric($time)) {
$this->parseTimestamp($time);
$this->parseIso($time);
}
}
- function parseTimestamp($timestamp) {
+
+ function parseTimestamp($timestamp)
+ {
$this->year = date('Y', $timestamp);
$this->month = date('m', $timestamp);
$this->day = date('d', $timestamp);
$this->hour = date('H', $timestamp);
$this->minute = date('i', $timestamp);
$this->second = date('s', $timestamp);
- // WP adds timezone. See #2036
$this->timezone = '';
}
- function parseIso($iso) {
+
+ function parseIso($iso)
+ {
$this->year = substr($iso, 0, 4);
$this->month = substr($iso, 4, 2);
$this->day = substr($iso, 6, 2);
$this->hour = substr($iso, 9, 2);
$this->minute = substr($iso, 12, 2);
$this->second = substr($iso, 15, 2);
- // WP adds timezone. See #2036
$this->timezone = substr($iso, 17);
}
- function getIso() {
- // WP adds timezone. See #2036
+
+ function getIso()
+ {
return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone;
}
- function getXml() {
+
+ function getXml()
+ {
return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>';
}
- function getTimestamp() {
+
+ function getTimestamp()
+ {
return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year);
}
}
* @package IXR
* @since 1.5
*/
-class IXR_Base64 {
+class IXR_Base64
+{
var $data;
- function IXR_Base64($data) {
+
+ function IXR_Base64($data)
+ {
$this->data = $data;
}
- function getXml() {
+
+ function getXml()
+ {
return '<base64>'.base64_encode($this->data).'</base64>';
}
}
* @package IXR
* @since 1.5
*/
-class IXR_IntrospectionServer extends IXR_Server {
+class IXR_IntrospectionServer extends IXR_Server
+{
var $signatures;
var $help;
- function IXR_IntrospectionServer() {
+
+ function IXR_IntrospectionServer()
+ {
$this->setCallbacks();
$this->setCapabilities();
$this->capabilities['introspection'] = array(
'Returns a documentation string for the specified method'
);
}
- function addCallback($method, $callback, $args, $help) {
+
+ function addCallback($method, $callback, $args, $help)
+ {
$this->callbacks[$method] = $callback;
$this->signatures[$method] = $args;
$this->help[$method] = $help;
}
- function call($methodname, $args) {
+
+ function call($methodname, $args)
+ {
// Make sure it's in an array
if ($args && !is_array($args)) {
$args = array($args);
}
+
// Over-rides default call method, adds signature check
if (!$this->hasMethod($methodname)) {
return new IXR_Error(-32601, 'server error. requested method "'.$this->message->methodName.'" not specified.');
$method = $this->callbacks[$methodname];
$signature = $this->signatures[$methodname];
$returnType = array_shift($signature);
+
// Check the number of arguments
if (count($args) != count($signature)) {
return new IXR_Error(-32602, 'server error. wrong number of method parameters');
}
+
// Check the argument types
$ok = true;
$argsbackup = $args;
// It passed the test - run the "real" method call
return parent::call($methodname, $argsbackup);
}
- function methodSignature($method) {
+
+ function methodSignature($method)
+ {
if (!$this->hasMethod($method)) {
return new IXR_Error(-32601, 'server error. requested method "'.$method.'" not specified.');
}
}
return $return;
}
- function methodHelp($method) {
+
+ function methodHelp($method)
+ {
return $this->help[$method];
}
}
* @package IXR
* @since 1.5
*/
-class IXR_ClientMulticall extends IXR_Client {
+class IXR_ClientMulticall extends IXR_Client
+{
var $calls = array();
- function IXR_ClientMulticall($server, $path = false, $port = 80) {
+
+ function IXR_ClientMulticall($server, $path = false, $port = 80)
+ {
parent::IXR_Client($server, $path, $port);
$this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)';
}
- function addCall() {
+
+ function addCall()
+ {
$args = func_get_args();
$methodName = array_shift($args);
$struct = array(
);
$this->calls[] = $struct;
}
- function query() {
+
+ function query()
+ {
// Prepare multicall, then call the parent::query() method
return parent::query('system.multicall', $this->calls);
}
if ( false !== $pre )
return $pre;
- $arrURL = parse_url($url);
+ $arrURL = parse_url( $url );
if ( empty( $url ) || empty( $arrURL['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.'));
+ 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') );
+ $homeURL = parse_url( get_bloginfo( 'url' ) );
$r['local'] = $homeURL['host'] == $arrURL['host'] || 'localhost' == $arrURL['host'];
- unset($homeURL);
+ unset( $homeURL );
if ( is_null( $r['headers'] ) )
$r['headers'] = array();
- if ( ! is_array($r['headers']) ) {
- $processedHeaders = WP_Http::processHeaders($r['headers']);
+ if ( ! is_array( $r['headers'] ) ) {
+ $processedHeaders = WP_Http::processHeaders( $r['headers'] );
$r['headers'] = $processedHeaders['headers'];
}
- if ( isset($r['headers']['User-Agent']) ) {
+ if ( isset( $r['headers']['User-Agent'] ) ) {
$r['user-agent'] = $r['headers']['User-Agent'];
- unset($r['headers']['User-Agent']);
+ unset( $r['headers']['User-Agent'] );
}
- if ( isset($r['headers']['user-agent']) ) {
+ if ( isset( $r['headers']['user-agent'] ) ) {
$r['user-agent'] = $r['headers']['user-agent'];
- unset($r['headers']['user-agent']);
+ unset( $r['headers']['user-agent'] );
}
// Construct Cookie: header if any cookies are set
$r['headers']['Accept-Encoding'] = WP_Http_Encoding::accept_encoding();
if ( empty($r['body']) ) {
+ $r['body'] = null;
// 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']) )
+ 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);
+ $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, '&');
+ $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']);
+ $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']);
+ $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);
+ $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);
+ $response = $transport->request( $url, $r );
- do_action( 'http_api_debug', $response, 'response', get_class($transport) );
+ do_action( 'http_api_debug', $response, 'response', get_class( $transport ) );
- if ( ! is_wp_error($response) )
+ if ( ! is_wp_error( $response ) )
return apply_filters( 'http_response', $response, $r, $url );
}
} else {
$newheaders[$key] = trim( $value );
}
- if ( 'set-cookie' == strtolower( $key ) )
+ if ( 'set-cookie' == $key )
$cookies[] = new WP_Http_Cookie( $value );
}
}
* 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.
+ * WP_ACCESSIBLE_HOSTS constant is a comma separated list of hostnames to allow, wildcard domains
+ * are supported, eg *.wordpress.org will allow for all subdomains of wordpress.org to be contacted.
*
* @since 2.8.0
* @link http://core.trac.wordpress.org/ticket/8927 Allow preventing external requests.
+ * @link http://core.trac.wordpress.org/ticket/14636 Allow wildcard domains in WP_ACCESSIBLE_HOSTS
*
* @param string $uri URI of url.
* @return bool True to block, false to allow.
return true;
static $accessible_hosts;
- if ( null == $accessible_hosts )
+ static $wildcard_regex = false;
+ 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.
+ if ( false !== strpos(WP_ACCESSIBLE_HOSTS, '*') ) {
+ $wildcard_regex = array();
+ foreach ( $accessible_hosts as $host )
+ $wildcard_regex[] = str_replace('\*', '[\w.]+?', preg_quote($host, '/'));
+ $wildcard_regex = '/^(' . implode('|', $wildcard_regex) . ')$/i';
+ }
+ }
+
+ if ( !empty($wildcard_regex) )
+ return !preg_match($wildcard_regex, $check['host']);
+ else
+ return !in_array( $check['host'], $accessible_hosts ); //Inverse logic, If its in the array, then we can't access it.
+
+
+
}
}
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']) ) {
+ } else 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']);
- } else if( isset($r['headers']['user-agent']) ) {
+ } else if ( isset($r['headers']['user-agent']) ) {
$r['user-agent'] = $r['headers']['user-agent'];
unset($r['headers']['user-agent']);
}
* @subpackage HTTP
* @since 2.7.0
*/
-class WP_Http_ExtHTTP {
+class WP_Http_ExtHttp {
/**
* Send a HTTP request to a URI using HTTP extension.
*
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']) ) {
+ } else 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']);
- } else if( isset($r['headers']['user-agent']) ) {
+ } else if ( isset($r['headers']['user-agent']) ) {
$r['user-agent'] = $r['headers']['user-agent'];
unset($r['headers']['user-agent']);
}
$theBody = substr( $theResponse, $headerLength );
else
$theBody = '';
- if ( false !== strrpos($theHeaders, "\r\n\r\n") ) {
+ if ( false !== strpos($theHeaders, "\r\n\r\n") ) {
$headerParts = explode("\r\n\r\n", $theHeaders);
$theHeaders = $headerParts[ count($headerParts) -1 ];
}
* <li>WP_PROXY_PASSWORD - Proxy password, if it requires authentication.</li>
* <li>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</li>
+ * through the proxy. The list should be presented in a comma separated list, wildcards using * are supported, eg. *.wordpress.org</li>
* </ol>
*
* An example can be as seen below.
* <code>
* define('WP_PROXY_HOST', '192.168.84.101');
* define('WP_PROXY_PORT', '8080');
- * define('WP_PROXY_BYPASS_HOSTS', 'localhost, www.example.com');
+ * define('WP_PROXY_BYPASS_HOSTS', 'localhost, www.example.com, *.wordpress.org');
* </code>
*
* @link http://core.trac.wordpress.org/ticket/4011 Proxy support ticket in WordPress.
+ * @link http://core.trac.wordpress.org/ticket/14636 Allow wildcard domains in WP_PROXY_BYPASS_HOSTS
* @since 2.8
*/
class WP_HTTP_Proxy {
* hosts that won't be sent through the proxy.
*
* @uses WP_PROXY_BYPASS_HOSTS
- * @since unknown
+ * @since 2.8.0
*
* @param string $uri URI to check.
* @return bool True, to send through the proxy and false if, the proxy should not be used.
return true;
static $bypass_hosts;
- if ( null == $bypass_hosts )
+ static $wildcard_regex = false;
+ if ( null == $bypass_hosts ) {
$bypass_hosts = preg_split('|,\s*|', WP_PROXY_BYPASS_HOSTS);
- return !in_array( $check['host'], $bypass_hosts );
+ if ( false !== strpos(WP_PROXY_BYPASS_HOSTS, '*') ) {
+ $wildcard_regex = array();
+ foreach ( $bypass_hosts as $host )
+ $wildcard_regex[] = str_replace('\*', '[\w.]+?', preg_quote($host, '/'));
+ $wildcard_regex = '/^(' . implode('|', $wildcard_regex) . ')$/i';
+ }
+ }
+
+ if ( !empty($wildcard_regex) )
+ return !preg_match($wildcard_regex, $check['host']);
+ else
+ return !in_array( $check['host'], $bypass_hosts );
}
}
/**
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
}
- $bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
+ $bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);
switch(true) {
case ((0x7F & $bytes) == $bytes):
case 2:
// return a UTF-16 character from a 2-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- return chr(0x07 & (ord($utf8{0}) >> 2))
- . chr((0xC0 & (ord($utf8{0}) << 6))
- | (0x3F & ord($utf8{1})));
+ return chr(0x07 & (ord($utf8[0]) >> 2))
+ . chr((0xC0 & (ord($utf8[0]) << 6))
+ | (0x3F & ord($utf8[1])));
case 3:
// return a UTF-16 character from a 3-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- return chr((0xF0 & (ord($utf8{0}) << 4))
- | (0x0F & (ord($utf8{1}) >> 2)))
- . chr((0xC0 & (ord($utf8{1}) << 6))
- | (0x7F & ord($utf8{2})));
+ return chr((0xF0 & (ord($utf8[0]) << 4))
+ | (0x0F & (ord($utf8[1]) >> 2)))
+ . chr((0xC0 & (ord($utf8[1]) << 6))
+ | (0x7F & ord($utf8[2])));
}
// ignoring UTF-32 for now, sorry
*/
for ($c = 0; $c < $strlen_var; ++$c) {
- $ord_var_c = ord($var{$c});
+ $ord_var_c = ord($var[$c]);
switch (true) {
case $ord_var_c == 0x08:
case $ord_var_c == 0x2F:
case $ord_var_c == 0x5C:
// double quote, slash, slosh
- $ascii .= '\\'.$var{$c};
+ $ascii .= '\\'.$var[$c];
break;
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
// characters U-00000000 - U-0000007F (same as ASCII)
- $ascii .= $var{$c};
+ $ascii .= $var[$c];
break;
case (($ord_var_c & 0xE0) == 0xC0):
break;
}
- $char = pack('C*', $ord_var_c, ord($var{$c + 1}));
+ $char = pack('C*', $ord_var_c, ord($var[$c + 1]));
$c += 1;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
- @ord($var{$c + 1}),
- @ord($var{$c + 2}));
+ @ord($var[$c + 1]),
+ @ord($var[$c + 2]));
$c += 2;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
- ord($var{$c + 1}),
- ord($var{$c + 2}),
- ord($var{$c + 3}));
+ ord($var[$c + 1]),
+ ord($var[$c + 2]),
+ ord($var[$c + 3]));
$c += 3;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
break;
}
$char = pack('C*', $ord_var_c,
- ord($var{$c + 1}),
- ord($var{$c + 2}),
- ord($var{$c + 3}),
- ord($var{$c + 4}));
+ ord($var[$c + 1]),
+ ord($var[$c + 2]),
+ ord($var[$c + 3]),
+ ord($var[$c + 4]));
$c += 4;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
- ord($var{$c + 1}),
- ord($var{$c + 2}),
- ord($var{$c + 3}),
- ord($var{$c + 4}),
- ord($var{$c + 5}));
+ ord($var[$c + 1]),
+ ord($var[$c + 2]),
+ ord($var[$c + 3]),
+ ord($var[$c + 4]),
+ ord($var[$c + 5]));
$c += 5;
$utf16 = $this->utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
for ($c = 0; $c < $strlen_chrs; ++$c) {
$substr_chrs_c_2 = substr($chrs, $c, 2);
- $ord_chrs_c = ord($chrs{$c});
+ $ord_chrs_c = ord($chrs[$c]);
switch (true) {
case $substr_chrs_c_2 == '\b':
case $substr_chrs_c_2 == '\\/':
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
- $utf8 .= $chrs{++$c};
+ $utf8 .= $chrs[++$c];
}
break;
break;
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
- $utf8 .= $chrs{$c};
+ $utf8 .= $chrs[$c];
break;
case ($ord_chrs_c & 0xE0) == 0xC0:
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
// array, or object notation
- if ($str{0} == '[') {
+ if ($str[0] == '[') {
$stk = array(SERVICES_JSON_IN_ARR);
$arr = array();
} else {
$top = end($stk);
$substr_chrs_c_2 = substr($chrs, $c, 2);
- if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
+ if (($c == $strlen_chrs) || (($chrs[$c] == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
// found a comma that is not inside a string, array, etc.,
// OR we've reached the end of the character list
$slice = substr($chrs, $top['where'], ($c - $top['where']));
}
- } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
+ } elseif ((($chrs[$c] == '"') || ($chrs[$c] == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
// found a quote, and we are not inside a string
- array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
+ array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs[$c]));
//print("Found start of string at {$c}\n");
- } elseif (($chrs{$c} == $top['delim']) &&
+ } elseif (($chrs[$c] == $top['delim']) &&
($top['what'] == SERVICES_JSON_IN_STR) &&
((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
// found a quote, we're in a string, and it's not escaped
array_pop($stk);
//print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
- } elseif (($chrs{$c} == '[') &&
+ } elseif (($chrs[$c] == '[') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-bracket, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
//print("Found start of array at {$c}\n");
- } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
+ } elseif (($chrs[$c] == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
// found a right-bracket, and we're in an array
array_pop($stk);
//print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
- } elseif (($chrs{$c} == '{') &&
+ } elseif (($chrs[$c] == '{') &&
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
// found a left-brace, and we are in an array, object, or slice
array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
//print("Found start of object at {$c}\n");
- } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
+ } elseif (($chrs[$c] == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
// found a right-brace, and we're in an object
array_pop($stk);
//print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
return false;
$title = ( !empty($data->title) ) ? $data->title : '';
- $return = '<img src="' . esc_url( $data->url ) . '" alt="' . esc_attr($title) . '" width="' . esc_attr($data->width) . '" height="' . esc_attr($data->height) . '" />';
+ $return = '<a href="' . esc_url( $url ) . '"><img src="' . esc_url( $data->url ) . '" alt="' . esc_attr($title) . '" width="' . esc_attr($data->width) . '" height="' . esc_attr($data->height) . '" /></a>';
break;
case 'video':
* An RFC 1939 compliant wrapper class for the POP3 protocol.
*
* Licensed under the GNU GPL. For full terms see the file COPYING.
+ * @license http://opensource.org/licenses/gpl-license.php GNU General Public License
*
* pop3 class
*
- * $Id: class-pop3.php 9503 2008-11-03 23:25:11Z ryan $
+ * $Id: class-pop3.php 17435 2011-02-09 17:35:36Z ryan $
*/
class POP3 {
$line = fgets($fp,$buffer);
while ( !ereg("^\.\r\n",$line))
{
- if ( $line{0} == '.' ) { $line = substr($line,1); }
+ if ( $line[0] == '.' ) { $line = substr($line,1); }
$MsgArray[$count] = $line;
$count++;
$line = fgets($fp,$buffer);
}
/**
- * Return the error message for the occured error
+ * Return the error message for the occurred error
*
* @access public
* @return string Error message
chr(176),
chr(39),
chr(128),
- "ä",
- "ö",
- "ü",
- "Ä",
- "Ö",
- "Ü",
- "ß",
+ chr(0xE4), // ANSI ä
+ chr(0xF6), // ANSI ö
+ chr(0xFC), // ANSI ü
+ chr(0xC4), // ANSI Ä
+ chr(0xD6), // ANSI Ö
+ chr(0xDC), // ANSI Ü
+ chr(0xDF), // ANSI ß
);
$text = preg_replace($search,$replace,$document);
--- /dev/null
+<?php
+class WP_Admin_Bar {
+ var $changed_locale = false;
+ var $menu;
+ var $need_to_change_locale = false;
+ var $proto = 'http://';
+ var $user;
+
+ function initialize() {
+ /* Set the protocol used throughout this code */
+ if ( is_ssl() )
+ $this->proto = 'https://';
+
+ $this->user = new stdClass;
+ $this->menu = new stdClass;
+
+ /* Populate settings we need for the menu based on the current user. */
+ $this->user->blogs = get_blogs_of_user( get_current_user_id() );
+ if ( is_multisite() ) {
+ $this->user->active_blog = get_active_blog_for_user( get_current_user_id() );
+ $this->user->domain = empty( $this->user->active_blog ) ? user_admin_url() : trailingslashit( get_home_url( $this->user->active_blog->blog_id ) );
+ $this->user->account_domain = $this->user->domain;
+ } else {
+ $this->user->active_blog = $this->user->blogs[get_current_blog_id()];
+ $this->user->domain = trailingslashit( home_url() );
+ $this->user->account_domain = $this->user->domain;
+ }
+ $this->user->locale = get_locale();
+
+ add_action( 'wp_head', 'wp_admin_bar_header' );
+
+ add_action( 'admin_head', 'wp_admin_bar_header' );
+
+ if ( current_theme_supports( 'admin-bar' ) ) {
+ $admin_bar_args = get_theme_support( 'admin-bar' ); // add_theme_support( 'admin-bar', array( 'callback' => '__return_false') );
+ $header_callback = $admin_bar_args[0]['callback'];
+ }
+
+ if ( empty($header_callback) )
+ $header_callback = '_admin_bar_bump_cb';
+
+ add_action('wp_head', $header_callback);
+
+ wp_enqueue_script( 'admin-bar' );
+ wp_enqueue_style( 'admin-bar' );
+
+ do_action( 'admin_bar_init' );
+ }
+
+ function add_menu( $args = array() ) {
+ $defaults = array(
+ 'title' => false,
+ 'href' => false,
+ 'parent' => false, // false for a root menu, pass the ID value for a submenu of that menu.
+ 'id' => false, // defaults to a sanitized title value.
+ 'meta' => false // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' );
+ );
+
+ $r = wp_parse_args( $args, $defaults );
+ extract( $r, EXTR_SKIP );
+
+ if ( empty( $title ) )
+ return false;
+
+ /* Make sure we have a valid ID */
+ if ( empty( $id ) )
+ $id = esc_attr( sanitize_title( trim( $title ) ) );
+
+ if ( ! empty( $parent ) ) {
+ /* Add the menu to the parent item */
+ $child = array( 'id' => $id, 'title' => $title, 'href' => $href );
+
+ if ( ! empty( $meta ) )
+ $child['meta'] = $meta;
+
+ $this->add_node( $parent, $this->menu, $child );
+ } else {
+ /* Add the menu item */
+ $this->menu->{$id} = array( 'title' => $title, 'href' => $href );
+
+ if ( ! empty( $meta ) )
+ $this->menu->{$id}['meta'] = $meta;
+ }
+ }
+
+ function remove_menu( $id ) {
+ return $this->remove_node( $id, $this->menu );
+ }
+
+ function render() {
+ ?>
+ <div id="wpadminbar">
+ <div class="quicklinks">
+ <ul>
+ <?php foreach ( (array) $this->menu as $id => $menu_item ) : ?>
+ <?php $this->recursive_render( $id, $menu_item ) ?>
+ <?php endforeach; ?>
+ </ul>
+ </div>
+
+ <div id="adminbarsearch-wrap">
+ <form action="<?php echo home_url(); ?>" method="get" id="adminbarsearch">
+ <input class="adminbar-input" name="s" id="adminbar-search" type="text" value="" maxlength="150" />
+ <input type="submit" class="adminbar-button" value="<?php _e('Search'); ?>"/>
+ </form>
+ </div>
+ </div>
+
+ <?php
+ /* Wipe the menu, might reduce memory usage, but probably not. */
+ $this->menu = null;
+ }
+
+ /* Helpers */
+ function recursive_render( $id, &$menu_item ) { ?>
+ <?php
+ $is_parent = ! empty( $menu_item['children'] );
+
+ $menuclass = $is_parent ? 'menupop' : '';
+ if ( ! empty( $menu_item['meta']['class'] ) )
+ $menuclass .= ' ' . $menu_item['meta']['class'];
+ ?>
+
+ <li id="<?php echo esc_attr( "wp-admin-bar-$id" ); ?>" class="<?php echo esc_attr( $menuclass ); ?>">
+ <a href="<?php echo esc_url( $menu_item['href'] ) ?>"<?php
+ if ( ! empty( $menu_item['meta']['onclick'] ) ) :
+ ?> onclick="<?php echo esc_js( $menu_item['meta']['onclick'] ); ?>"<?php
+ endif;
+ if ( ! empty( $menu_item['meta']['target'] ) ) :
+ ?> target="<?php echo esc_attr( $menu_item['meta']['target'] ); ?>"<?php
+ endif;
+ if ( ! empty( $menu_item['meta']['title'] ) ) :
+ ?> title="<?php echo esc_attr( $menu_item['meta']['title'] ); ?>"<?php
+ endif;
+
+ ?>><?php
+
+ if ( $is_parent ) :
+ ?><span><?php
+ endif;
+
+ echo $menu_item['title'];
+
+ if ( $is_parent ) :
+ ?></span><?php
+ endif;
+
+ ?></a>
+
+ <?php if ( $is_parent ) : ?>
+ <ul>
+ <?php foreach ( $menu_item['children'] as $child_id => $child_menu_item ) : ?>
+ <?php $this->recursive_render( $child_id, $child_menu_item ); ?>
+ <?php endforeach; ?>
+ </ul>
+ <?php endif; ?>
+
+ <?php if ( ! empty( $menu_item['meta']['html'] ) ) : ?>
+ <?php echo $menu_item['meta']['html']; ?>
+ <?php endif; ?>
+ </li><?php
+ }
+
+ function add_node( $parent_id, &$menu, $child ) {
+ foreach( $menu as $id => $menu_item ) {
+ if ( $parent_id == $id ) {
+ $menu->{$parent_id}['children']->{$child['id']} = $child;
+ $child = null;
+ return true;
+ }
+
+ if ( ! empty( $menu->{$id}['children'] ) )
+ $this->add_node( $parent_id, $menu->{$id}['children'], $child );
+ }
+
+ $child = null;
+
+ return false;
+ }
+
+ function add_menus() {
+ add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 10 );
+ add_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 );
+ add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 30 );
+ add_action( 'admin_bar_menu', 'wp_admin_bar_shortlink_menu', 80 );
+ add_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 70 );
+
+ if ( !is_network_admin() && !is_user_admin() ) {
+ add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 40 );
+ add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 50 );
+ add_action( 'admin_bar_menu', 'wp_admin_bar_appearance_menu', 60 );
+ }
+
+ do_action( 'add_admin_bar_menus' );
+ }
+
+ function remove_node( $id, &$menu ) {
+ if ( isset( $menu->$id ) ) {
+ unset( $menu->$id );
+ return true;
+ }
+
+ foreach( $menu as $menu_item_id => $menu_item ) {
+ if ( ! empty( $menu->{$menu_item_id}['children'] ) )
+ $this->remove_node( $id, $menu->{$menu_item_id}['children'] );
+ }
+
+ return false;
+ }
+
+ // TODO: Convert to a core feature for multisite or remove
+ function load_user_locale_translations() {
+ $this->need_to_change_locale = ( get_locale() != $this->user->locale );
+ if ( ! $this->need_to_change_locale )
+ return;
+ /*
+ $this->previous_translations = get_translations_for_domain( 'default' );
+ $this->adminbar_locale_filter = lambda( '$_', '$GLOBALS["wp_admin_bar"]->user->locale;' );
+ unload_textdomain( 'default' );
+ add_filter( 'locale', $this->adminbar_locale_filter );
+ load_default_textdomain();
+ $this->changed_locale = true;
+ */
+ }
+
+ function unload_user_locale_translations() {
+ global $l10n;
+ if ( ! $this->changed_locale )
+ return;
+ /*
+ remove_filter( 'locale', $this->adminbar_locale_filter );
+ $l10n['default'] = &$this->previous_translations;
+ */
+ }
+}
+?>
--- /dev/null
+<?php
+/**
+ * Send XML response back to AJAX request.
+ *
+ * @package WordPress
+ * @since 2.1.0
+ */
+class WP_Ajax_Response {
+ /**
+ * Store XML responses to send.
+ *
+ * @since 2.1.0
+ * @var array
+ * @access private
+ */
+ var $responses = array();
+
+ /**
+ * PHP4 Constructor - Passes args to {@link WP_Ajax_Response::add()}.
+ *
+ * @since 2.1.0
+ * @see WP_Ajax_Response::add()
+ *
+ * @param string|array $args Optional. Will be passed to add() method.
+ * @return WP_Ajax_Response
+ */
+ function WP_Ajax_Response( $args = '' ) {
+ if ( !empty($args) )
+ $this->add($args);
+ }
+
+ /**
+ * Append to XML response based on given arguments.
+ *
+ * The arguments that can be passed in the $args parameter are below. It is
+ * also possible to pass a WP_Error object in either the 'id' or 'data'
+ * argument. The parameter isn't actually optional, content should be given
+ * in order to send the correct response.
+ *
+ * 'what' argument is a string that is the XMLRPC response type.
+ * 'action' argument is a boolean or string that acts like a nonce.
+ * 'id' argument can be WP_Error or an integer.
+ * 'old_id' argument is false by default or an integer of the previous ID.
+ * 'position' argument is an integer or a string with -1 = top, 1 = bottom,
+ * html ID = after, -html ID = before.
+ * 'data' argument is a string with the content or message.
+ * 'supplemental' argument is an array of strings that will be children of
+ * the supplemental element.
+ *
+ * @since 2.1.0
+ *
+ * @param string|array $args Override defaults.
+ * @return string XML response.
+ */
+ function add( $args = '' ) {
+ $defaults = array(
+ 'what' => 'object', 'action' => false,
+ 'id' => '0', 'old_id' => false,
+ 'position' => 1,
+ 'data' => '', 'supplemental' => array()
+ );
+
+ $r = wp_parse_args( $args, $defaults );
+ extract( $r, EXTR_SKIP );
+ $position = preg_replace( '/[^a-z0-9:_-]/i', '', $position );
+
+ if ( is_wp_error($id) ) {
+ $data = $id;
+ $id = 0;
+ }
+
+ $response = '';
+ if ( is_wp_error($data) ) {
+ foreach ( (array) $data->get_error_codes() as $code ) {
+ $response .= "<wp_error code='$code'><![CDATA[" . $data->get_error_message($code) . "]]></wp_error>";
+ if ( !$error_data = $data->get_error_data($code) )
+ continue;
+ $class = '';
+ if ( is_object($error_data) ) {
+ $class = ' class="' . get_class($error_data) . '"';
+ $error_data = get_object_vars($error_data);
+ }
+
+ $response .= "<wp_error_data code='$code'$class>";
+
+ if ( is_scalar($error_data) ) {
+ $response .= "<![CDATA[$error_data]]>";
+ } elseif ( is_array($error_data) ) {
+ foreach ( $error_data as $k => $v )
+ $response .= "<$k><![CDATA[$v]]></$k>";
+ }
+
+ $response .= "</wp_error_data>";
+ }
+ } else {
+ $response = "<response_data><![CDATA[$data]]></response_data>";
+ }
+
+ $s = '';
+ if ( is_array($supplemental) ) {
+ foreach ( $supplemental as $k => $v )
+ $s .= "<$k><![CDATA[$v]]></$k>";
+ $s = "<supplemental>$s</supplemental>";
+ }
+
+ if ( false === $action )
+ $action = $_POST['action'];
+
+ $x = '';
+ $x .= "<response action='{$action}_$id'>"; // The action attribute in the xml output is formatted like a nonce action
+ $x .= "<$what id='$id' " . ( false === $old_id ? '' : "old_id='$old_id' " ) . "position='$position'>";
+ $x .= $response;
+ $x .= $s;
+ $x .= "</$what>";
+ $x .= "</response>";
+
+ $this->responses[] = $x;
+ return $x;
+ }
+
+ /**
+ * Display XML formatted responses.
+ *
+ * Sets the content type header to text/xml.
+ *
+ * @since 2.1.0
+ */
+ function send() {
+ header('Content-Type: text/xml');
+ echo "<?xml version='1.0' standalone='yes'?><wp_ajax>";
+ foreach ( (array) $this->responses as $response )
+ echo $response;
+ echo '</wp_ajax>';
+ die();
+ }
+}
+
+?>
--- /dev/null
+<?php
+/**
+ * WordPress Error API.
+ *
+ * Contains the WP_Error class and the is_wp_error() function.
+ *
+ * @package WordPress
+ */
+
+/**
+ * WordPress Error class.
+ *
+ * Container for checking for WordPress errors and error messages. Return
+ * WP_Error and use {@link is_wp_error()} to check if this class is returned.
+ * Many core WordPress functions pass this class in the event of an error and
+ * if not handled properly will result in code errors.
+ *
+ * @package WordPress
+ * @since 2.1.0
+ */
+class WP_Error {
+ /**
+ * Stores the list of errors.
+ *
+ * @since 2.1.0
+ * @var array
+ * @access private
+ */
+ var $errors = array();
+
+ /**
+ * Stores the list of data for error codes.
+ *
+ * @since 2.1.0
+ * @var array
+ * @access private
+ */
+ var $error_data = array();
+
+ /**
+ * PHP4 Constructor - Sets up error message.
+ *
+ * If code parameter is empty then nothing will be done. It is possible to
+ * add multiple messages to the same code, but with other methods in the
+ * class.
+ *
+ * All parameters are optional, but if the code parameter is set, then the
+ * data parameter is optional.
+ *
+ * @since 2.1.0
+ *
+ * @param string|int $code Error code
+ * @param string $message Error message
+ * @param mixed $data Optional. Error data.
+ * @return WP_Error
+ */
+ function WP_Error($code = '', $message = '', $data = '') {
+ if ( empty($code) )
+ return;
+
+ $this->errors[$code][] = $message;
+
+ if ( ! empty($data) )
+ $this->error_data[$code] = $data;
+ }
+
+ /**
+ * Retrieve all error codes.
+ *
+ * @since 2.1.0
+ * @access public
+ *
+ * @return array List of error codes, if avaiable.
+ */
+ function get_error_codes() {
+ if ( empty($this->errors) )
+ return array();
+
+ return array_keys($this->errors);
+ }
+
+ /**
+ * Retrieve first error code available.
+ *
+ * @since 2.1.0
+ * @access public
+ *
+ * @return string|int Empty string, if no error codes.
+ */
+ function get_error_code() {
+ $codes = $this->get_error_codes();
+
+ if ( empty($codes) )
+ return '';
+
+ return $codes[0];
+ }
+
+ /**
+ * Retrieve all error messages or error messages matching code.
+ *
+ * @since 2.1.0
+ *
+ * @param string|int $code Optional. Retrieve messages matching code, if exists.
+ * @return array Error strings on success, or empty array on failure (if using codee parameter).
+ */
+ function get_error_messages($code = '') {
+ // Return all messages if no code specified.
+ if ( empty($code) ) {
+ $all_messages = array();
+ foreach ( (array) $this->errors as $code => $messages )
+ $all_messages = array_merge($all_messages, $messages);
+
+ return $all_messages;
+ }
+
+ if ( isset($this->errors[$code]) )
+ return $this->errors[$code];
+ else
+ return array();
+ }
+
+ /**
+ * Get single error message.
+ *
+ * This will get the first message available for the code. If no code is
+ * given then the first code available will be used.
+ *
+ * @since 2.1.0
+ *
+ * @param string|int $code Optional. Error code to retrieve message.
+ * @return string
+ */
+ function get_error_message($code = '') {
+ if ( empty($code) )
+ $code = $this->get_error_code();
+ $messages = $this->get_error_messages($code);
+ if ( empty($messages) )
+ return '';
+ return $messages[0];
+ }
+
+ /**
+ * Retrieve error data for error code.
+ *
+ * @since 2.1.0
+ *
+ * @param string|int $code Optional. Error code.
+ * @return mixed Null, if no errors.
+ */
+ function get_error_data($code = '') {
+ if ( empty($code) )
+ $code = $this->get_error_code();
+
+ if ( isset($this->error_data[$code]) )
+ return $this->error_data[$code];
+ return null;
+ }
+
+ /**
+ * Append more error messages to list of error messages.
+ *
+ * @since 2.1.0
+ * @access public
+ *
+ * @param string|int $code Error code.
+ * @param string $message Error message.
+ * @param mixed $data Optional. Error data.
+ */
+ function add($code, $message, $data = '') {
+ $this->errors[$code][] = $message;
+ if ( ! empty($data) )
+ $this->error_data[$code] = $data;
+ }
+
+ /**
+ * Add data for error code.
+ *
+ * The error code can only contain one error data.
+ *
+ * @since 2.1.0
+ *
+ * @param mixed $data Error data.
+ * @param string|int $code Error code.
+ */
+ function add_data($data, $code = '') {
+ if ( empty($code) )
+ $code = $this->get_error_code();
+
+ $this->error_data[$code] = $data;
+ }
+}
+
+/**
+ * Check whether variable is a WordPress Error.
+ *
+ * Looks at the object and if a WP_Error class. Does not check to see if the
+ * parent is also WP_Error, so can't inherit WP_Error and still use this
+ * function.
+ *
+ * @since 2.1.0
+ *
+ * @param mixed $thing Check if unknown variable is WordPress Error object.
+ * @return bool True, if WP_Error. False, if not WP_Error.
+ */
+function is_wp_error($thing) {
+ if ( is_object($thing) && is_a($thing, 'WP_Error') )
+ return true;
+ return false;
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * WP_HTTP_IXR_Client
+ *
+ * @package WordPress
+ * @since 3.1.0
+ *
+ */
+class WP_HTTP_IXR_Client extends IXR_Client {
+ function WP_HTTP_IXR_Client($server, $path = false, $port = 80, $timeout = 15) {
+ if ( ! $path ) {
+ // Assume we have been given a URL instead
+ $bits = parse_url($server);
+ $this->scheme = $bits['scheme'];
+ $this->server = $bits['host'];
+ $this->port = isset($bits['port']) ? $bits['port'] : 80;
+ $this->path = !empty($bits['path']) ? $bits['path'] : '/';
+
+ // Make absolutely sure we have a path
+ if ( ! $this->path )
+ $this->path = '/';
+ } else {
+ $this->scheme = 'http';
+ $this->server = $server;
+ $this->path = $path;
+ $this->port = $port;
+ }
+ $this->useragent = 'The Incutio XML-RPC PHP Library';
+ $this->timeout = $timeout;
+ }
+
+ function query() {
+ $args = func_get_args();
+ $method = array_shift($args);
+ $request = new IXR_Request($method, $args);
+ $xml = $request->getXml();
+
+ $url = $this->scheme . '://' . $this->server . ':' . $this->port . $this->path;
+ $args = array(
+ 'headers' => array('Content-Type' => 'text/xml'),
+ 'user-agent' => $this->useragent,
+ 'body' => $xml,
+ );
+
+ // Merge Custom headers ala #8145
+ foreach ( $this->headers as $header => $value )
+ $args['headers'][$header] = $value;
+
+ if ( $this->timeout !== false )
+ $args['timeout'] = $this->timeout;
+
+ // Now send the request
+ if ( $this->debug )
+ echo '<pre class="ixr_request">' . htmlspecialchars($xml) . "\n</pre>\n\n";
+
+ $response = wp_remote_post($url, $args);
+
+ if ( is_wp_error($response) ) {
+ $errno = $response->get_error_code();
+ $errorstr = $response->get_error_message();
+ $this->error = new IXR_Error(-32300, "transport error: $errno $errorstr");
+ return false;
+ }
+
+ if ( $response['response']['code'] != 200 ) {
+ $this->error = new IXR_Error(-32301, "transport error - HTTP status code was not 200 ({$response['response']['code']})");
+ return false;
+ }
+
+ if ( $this->debug )
+ echo '<pre class="ixr_response">' . htmlspecialchars($response['body']) . "\n</pre>\n\n";
+
+ // Now parse what we've got back
+ $this->message = new IXR_Message( $response['body'] );
+ if ( ! $this->message->parse() ) {
+ // XML error
+ $this->error = new IXR_Error(-32700, 'parse error. not well formed');
+ return false;
+ }
+
+ // Is the message a fault?
+ if ( $this->message->messageType == 'fault' ) {
+ $this->error = new IXR_Error($this->message->faultCode, $this->message->faultString);
+ return false;
+ }
+
+ // Message must be OK
+ return true;
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * A class for displaying various tree-like structures.
+ *
+ * Extend the Walker class to use it, see examples at the below. Child classes
+ * do not need to implement all of the abstract methods in the class. The child
+ * only needs to implement the methods that are needed. Also, the methods are
+ * not strictly abstract in that the parameter definition needs to be followed.
+ * The child classes can have additional parameters.
+ *
+ * @package WordPress
+ * @since 2.1.0
+ * @abstract
+ */
+class Walker {
+ /**
+ * What the class handles.
+ *
+ * @since 2.1.0
+ * @var string
+ * @access public
+ */
+ var $tree_type;
+
+ /**
+ * DB fields to use.
+ *
+ * @since 2.1.0
+ * @var array
+ * @access protected
+ */
+ var $db_fields;
+
+ /**
+ * Max number of pages walked by the paged walker
+ *
+ * @since 2.7.0
+ * @var int
+ * @access protected
+ */
+ var $max_pages = 1;
+
+ /**
+ * Starts the list before the elements are added.
+ *
+ * Additional parameters are used in child classes. The args parameter holds
+ * additional values that may be used with the child class methods. This
+ * method is called at the start of the output list.
+ *
+ * @since 2.1.0
+ * @abstract
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ */
+ function start_lvl(&$output) {}
+
+ /**
+ * Ends the list of after the elements are added.
+ *
+ * Additional parameters are used in child classes. The args parameter holds
+ * additional values that may be used with the child class methods. This
+ * method finishes the list at the end of output of the elements.
+ *
+ * @since 2.1.0
+ * @abstract
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ */
+ function end_lvl(&$output) {}
+
+ /**
+ * Start the element output.
+ *
+ * Additional parameters are used in child classes. The args parameter holds
+ * additional values that may be used with the child class methods. Includes
+ * the element output also.
+ *
+ * @since 2.1.0
+ * @abstract
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ */
+ function start_el(&$output) {}
+
+ /**
+ * Ends the element output, if needed.
+ *
+ * Additional parameters are used in child classes. The args parameter holds
+ * additional values that may be used with the child class methods.
+ *
+ * @since 2.1.0
+ * @abstract
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ */
+ function end_el(&$output) {}
+
+ /**
+ * Traverse elements to create list from elements.
+ *
+ * Display one element if the element doesn't have any children otherwise,
+ * display the element and its children. Will only traverse up to the max
+ * depth and no ignore elements under that depth. It is possible to set the
+ * max depth to include all depths, see walk() method.
+ *
+ * This method shouldn't be called directly, use the walk() method instead.
+ *
+ * @since 2.5.0
+ *
+ * @param object $element Data object
+ * @param array $children_elements List of elements to continue traversing.
+ * @param int $max_depth Max depth to traverse.
+ * @param int $depth Depth of current element.
+ * @param array $args
+ * @param string $output Passed by reference. Used to append additional content.
+ * @return null Null on failure with no changes to parameters.
+ */
+ function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {
+
+ if ( !$element )
+ return;
+
+ $id_field = $this->db_fields['id'];
+
+ //display this element
+ if ( is_array( $args[0] ) )
+ $args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] );
+ $cb_args = array_merge( array(&$output, $element, $depth), $args);
+ call_user_func_array(array(&$this, 'start_el'), $cb_args);
+
+ $id = $element->$id_field;
+
+ // descend only when the depth is right and there are childrens for this element
+ if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) {
+
+ foreach( $children_elements[ $id ] as $child ){
+
+ if ( !isset($newlevel) ) {
+ $newlevel = true;
+ //start the child delimiter
+ $cb_args = array_merge( array(&$output, $depth), $args);
+ call_user_func_array(array(&$this, 'start_lvl'), $cb_args);
+ }
+ $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
+ }
+ unset( $children_elements[ $id ] );
+ }
+
+ if ( isset($newlevel) && $newlevel ){
+ //end the child delimiter
+ $cb_args = array_merge( array(&$output, $depth), $args);
+ call_user_func_array(array(&$this, 'end_lvl'), $cb_args);
+ }
+
+ //end this element
+ $cb_args = array_merge( array(&$output, $element, $depth), $args);
+ call_user_func_array(array(&$this, 'end_el'), $cb_args);
+ }
+
+ /**
+ * Display array of elements hierarchically.
+ *
+ * It is a generic function which does not assume any existing order of
+ * elements. max_depth = -1 means flatly display every element. max_depth =
+ * 0 means display all levels. max_depth > 0 specifies the number of
+ * display levels.
+ *
+ * @since 2.1.0
+ *
+ * @param array $elements
+ * @param int $max_depth
+ * @return string
+ */
+ function walk( $elements, $max_depth) {
+
+ $args = array_slice(func_get_args(), 2);
+ $output = '';
+
+ if ($max_depth < -1) //invalid parameter
+ return $output;
+
+ if (empty($elements)) //nothing to walk
+ return $output;
+
+ $id_field = $this->db_fields['id'];
+ $parent_field = $this->db_fields['parent'];
+
+ // flat display
+ if ( -1 == $max_depth ) {
+ $empty_array = array();
+ foreach ( $elements as $e )
+ $this->display_element( $e, $empty_array, 1, 0, $args, $output );
+ return $output;
+ }
+
+ /*
+ * need to display in hierarchical order
+ * 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.
+ */
+ $top_level_elements = array();
+ $children_elements = array();
+ foreach ( $elements as $e) {
+ if ( 0 == $e->$parent_field )
+ $top_level_elements[] = $e;
+ else
+ $children_elements[ $e->$parent_field ][] = $e;
+ }
+
+ /*
+ * when none of the elements is top level
+ * assume the first one must be root of the sub elements
+ */
+ if ( empty($top_level_elements) ) {
+
+ $first = array_slice( $elements, 0, 1 );
+ $root = $first[0];
+
+ $top_level_elements = array();
+ $children_elements = array();
+ foreach ( $elements as $e) {
+ if ( $root->$parent_field == $e->$parent_field )
+ $top_level_elements[] = $e;
+ else
+ $children_elements[ $e->$parent_field ][] = $e;
+ }
+ }
+
+ foreach ( $top_level_elements as $e )
+ $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );
+
+ /*
+ * if we are displaying all levels, and remaining children_elements is not empty,
+ * then we got orphans, which should be displayed regardless
+ */
+ if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) {
+ $empty_array = array();
+ foreach ( $children_elements as $orphans )
+ foreach( $orphans as $op )
+ $this->display_element( $op, $empty_array, 1, 0, $args, $output );
+ }
+
+ return $output;
+ }
+
+ /**
+ * paged_walk() - produce a page of nested elements
+ *
+ * Given an array of hierarchical elements, the maximum depth, a specific page number,
+ * and number of elements per page, this function first determines all top level root elements
+ * belonging to that page, then lists them and all of their children in hierarchical order.
+ *
+ * @package WordPress
+ * @since 2.7
+ * @param int $max_depth = 0 means display all levels; $max_depth > 0 specifies the number of display levels.
+ * @param int $page_num the specific page number, beginning with 1.
+ * @return XHTML of the specified page of elements
+ */
+ function paged_walk( $elements, $max_depth, $page_num, $per_page ) {
+
+ /* sanity check */
+ if ( empty($elements) || $max_depth < -1 )
+ return '';
+
+ $args = array_slice( func_get_args(), 4 );
+ $output = '';
+
+ $id_field = $this->db_fields['id'];
+ $parent_field = $this->db_fields['parent'];
+
+ $count = -1;
+ if ( -1 == $max_depth )
+ $total_top = count( $elements );
+ if ( $page_num < 1 || $per_page < 0 ) {
+ // No paging
+ $paging = false;
+ $start = 0;
+ if ( -1 == $max_depth )
+ $end = $total_top;
+ $this->max_pages = 1;
+ } else {
+ $paging = true;
+ $start = ( (int)$page_num - 1 ) * (int)$per_page;
+ $end = $start + $per_page;
+ if ( -1 == $max_depth )
+ $this->max_pages = ceil($total_top / $per_page);
+ }
+
+ // flat display
+ if ( -1 == $max_depth ) {
+ if ( !empty($args[0]['reverse_top_level']) ) {
+ $elements = array_reverse( $elements );
+ $oldstart = $start;
+ $start = $total_top - $end;
+ $end = $total_top - $oldstart;
+ }
+
+ $empty_array = array();
+ foreach ( $elements as $e ) {
+ $count++;
+ if ( $count < $start )
+ continue;
+ if ( $count >= $end )
+ break;
+ $this->display_element( $e, $empty_array, 1, 0, $args, $output );
+ }
+ return $output;
+ }
+
+ /*
+ * 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.
+ */
+ $top_level_elements = array();
+ $children_elements = array();
+ foreach ( $elements as $e) {
+ if ( 0 == $e->$parent_field )
+ $top_level_elements[] = $e;
+ else
+ $children_elements[ $e->$parent_field ][] = $e;
+ }
+
+ $total_top = count( $top_level_elements );
+ if ( $paging )
+ $this->max_pages = ceil($total_top / $per_page);
+ else
+ $end = $total_top;
+
+ if ( !empty($args[0]['reverse_top_level']) ) {
+ $top_level_elements = array_reverse( $top_level_elements );
+ $oldstart = $start;
+ $start = $total_top - $end;
+ $end = $total_top - $oldstart;
+ }
+ if ( !empty($args[0]['reverse_children']) ) {
+ foreach ( $children_elements as $parent => $children )
+ $children_elements[$parent] = array_reverse( $children );
+ }
+
+ foreach ( $top_level_elements as $e ) {
+ $count++;
+
+ //for the last page, need to unset earlier children in order to keep track of orphans
+ if ( $end >= $total_top && $count < $start )
+ $this->unset_children( $e, $children_elements );
+
+ if ( $count < $start )
+ continue;
+
+ if ( $count >= $end )
+ break;
+
+ $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );
+ }
+
+ if ( $end >= $total_top && count( $children_elements ) > 0 ) {
+ $empty_array = array();
+ foreach ( $children_elements as $orphans )
+ foreach( $orphans as $op )
+ $this->display_element( $op, $empty_array, 1, 0, $args, $output );
+ }
+
+ return $output;
+ }
+
+ function get_number_of_root_elements( $elements ){
+
+ $num = 0;
+ $parent_field = $this->db_fields['parent'];
+
+ foreach ( $elements as $e) {
+ if ( 0 == $e->$parent_field )
+ $num++;
+ }
+ return $num;
+ }
+
+ // unset all the children for a given top level element
+ function unset_children( $e, &$children_elements ){
+
+ if ( !$e || !$children_elements )
+ return;
+
+ $id_field = $this->db_fields['id'];
+ $id = $e->$id_field;
+
+ if ( !empty($children_elements[$id]) && is_array($children_elements[$id]) )
+ foreach ( (array) $children_elements[$id] as $child )
+ $this->unset_children( $child, $children_elements );
+
+ if ( isset($children_elements[$id]) )
+ unset( $children_elements[$id] );
+
+ }
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * XML-RPC protocol support for WordPress
+ *
+ * @package WordPress
+ */
+
+/**
+ * WordPress XMLRPC server implementation.
+ *
+ * Implements compatability for Blogger API, MetaWeblog API, MovableType, and
+ * pingback. Additional WordPress API for managing comments, pages, posts,
+ * options, etc.
+ *
+ * Since WordPress 2.6.0, WordPress XMLRPC server can be disabled in the
+ * administration panels.
+ *
+ * @package WordPress
+ * @subpackage Publishing
+ * @since 1.5.0
+ */
+class wp_xmlrpc_server extends IXR_Server {
+
+ /**
+ * Register all of the XMLRPC methods that XMLRPC server understands.
+ *
+ * PHP4 constructor and sets up server and method property. Passes XMLRPC
+ * methods through the 'xmlrpc_methods' filter to allow plugins to extend
+ * or replace XMLRPC methods.
+ *
+ * @since 1.5.0
+ *
+ * @return wp_xmlrpc_server
+ */
+ function wp_xmlrpc_server() {
+ $this->methods = array(
+ // WordPress API
+ 'wp.getUsersBlogs' => 'this:wp_getUsersBlogs',
+ 'wp.getPage' => 'this:wp_getPage',
+ 'wp.getPages' => 'this:wp_getPages',
+ 'wp.newPage' => 'this:wp_newPage',
+ 'wp.deletePage' => 'this:wp_deletePage',
+ 'wp.editPage' => 'this:wp_editPage',
+ 'wp.getPageList' => 'this:wp_getPageList',
+ 'wp.getAuthors' => 'this:wp_getAuthors',
+ 'wp.getCategories' => 'this:mw_getCategories', // Alias
+ 'wp.getTags' => 'this:wp_getTags',
+ 'wp.newCategory' => 'this:wp_newCategory',
+ 'wp.deleteCategory' => 'this:wp_deleteCategory',
+ 'wp.suggestCategories' => 'this:wp_suggestCategories',
+ 'wp.uploadFile' => 'this:mw_newMediaObject', // Alias
+ 'wp.getCommentCount' => 'this:wp_getCommentCount',
+ 'wp.getPostStatusList' => 'this:wp_getPostStatusList',
+ 'wp.getPageStatusList' => 'this:wp_getPageStatusList',
+ 'wp.getPageTemplates' => 'this:wp_getPageTemplates',
+ 'wp.getOptions' => 'this:wp_getOptions',
+ 'wp.setOptions' => 'this:wp_setOptions',
+ 'wp.getComment' => 'this:wp_getComment',
+ 'wp.getComments' => 'this:wp_getComments',
+ 'wp.deleteComment' => 'this:wp_deleteComment',
+ 'wp.editComment' => 'this:wp_editComment',
+ 'wp.newComment' => 'this:wp_newComment',
+ 'wp.getCommentStatusList' => 'this:wp_getCommentStatusList',
+ 'wp.getMediaItem' => 'this:wp_getMediaItem',
+ 'wp.getMediaLibrary' => 'this:wp_getMediaLibrary',
+ 'wp.getPostFormats' => 'this:wp_getPostFormats',
+
+ // Blogger API
+ 'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs',
+ 'blogger.getUserInfo' => 'this:blogger_getUserInfo',
+ 'blogger.getPost' => 'this:blogger_getPost',
+ 'blogger.getRecentPosts' => 'this:blogger_getRecentPosts',
+ 'blogger.getTemplate' => 'this:blogger_getTemplate',
+ 'blogger.setTemplate' => 'this:blogger_setTemplate',
+ 'blogger.newPost' => 'this:blogger_newPost',
+ 'blogger.editPost' => 'this:blogger_editPost',
+ 'blogger.deletePost' => 'this:blogger_deletePost',
+
+ // MetaWeblog API (with MT extensions to structs)
+ 'metaWeblog.newPost' => 'this:mw_newPost',
+ 'metaWeblog.editPost' => 'this:mw_editPost',
+ 'metaWeblog.getPost' => 'this:mw_getPost',
+ 'metaWeblog.getRecentPosts' => 'this:mw_getRecentPosts',
+ 'metaWeblog.getCategories' => 'this:mw_getCategories',
+ 'metaWeblog.newMediaObject' => 'this:mw_newMediaObject',
+
+ // MetaWeblog API aliases for Blogger API
+ // see http://www.xmlrpc.com/stories/storyReader$2460
+ 'metaWeblog.deletePost' => 'this:blogger_deletePost',
+ 'metaWeblog.getTemplate' => 'this:blogger_getTemplate',
+ 'metaWeblog.setTemplate' => 'this:blogger_setTemplate',
+ 'metaWeblog.getUsersBlogs' => 'this:blogger_getUsersBlogs',
+
+ // MovableType API
+ 'mt.getCategoryList' => 'this:mt_getCategoryList',
+ 'mt.getRecentPostTitles' => 'this:mt_getRecentPostTitles',
+ 'mt.getPostCategories' => 'this:mt_getPostCategories',
+ 'mt.setPostCategories' => 'this:mt_setPostCategories',
+ 'mt.supportedMethods' => 'this:mt_supportedMethods',
+ 'mt.supportedTextFilters' => 'this:mt_supportedTextFilters',
+ 'mt.getTrackbackPings' => 'this:mt_getTrackbackPings',
+ 'mt.publishPost' => 'this:mt_publishPost',
+
+ // PingBack
+ 'pingback.ping' => 'this:pingback_ping',
+ 'pingback.extensions.getPingbacks' => 'this:pingback_extensions_getPingbacks',
+
+ 'demo.sayHello' => 'this:sayHello',
+ 'demo.addTwoNumbers' => 'this:addTwoNumbers'
+ );
+
+ $this->initialise_blog_option_info( );
+ $this->methods = apply_filters('xmlrpc_methods', $this->methods);
+ }
+
+ function serve_request() {
+ $this->IXR_Server($this->methods);
+ }
+
+ /**
+ * Test XMLRPC API by saying, "Hello!" to client.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method Parameters.
+ * @return string
+ */
+ function sayHello($args) {
+ return 'Hello!';
+ }
+
+ /**
+ * Test XMLRPC API by adding two numbers for client.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method Parameters.
+ * @return int
+ */
+ function addTwoNumbers($args) {
+ $number1 = $args[0];
+ $number2 = $args[1];
+ return $number1 + $number2;
+ }
+
+ /**
+ * Check user's credentials.
+ *
+ * @since 1.5.0
+ *
+ * @param string $user_login User's username.
+ * @param string $user_pass User's password.
+ * @return bool Whether authentication passed.
+ * @deprecated use wp_xmlrpc_server::login
+ * @see wp_xmlrpc_server::login
+ */
+ 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 site. An admin user can enable them at %s'), admin_url('options-writing.php') ) );
+ return false;
+ }
+
+ if (!user_pass_ok($user_login, $user_pass)) {
+ $this->error = new IXR_Error(403, __('Bad login/pass combination.'));
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Log user in.
+ *
+ * @since 2.8
+ *
+ * @param string $username User's username.
+ * @param string $password User's password.
+ * @return mixed WP_User object if authentication passed, false otherwise
+ */
+ function login($username, $password) {
+ if ( !get_option( 'enable_xmlrpc' ) ) {
+ $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;
+ }
+
+ $user = wp_authenticate($username, $password);
+
+ if (is_wp_error($user)) {
+ $this->error = new IXR_Error(403, __('Bad login/pass combination.'));
+ return false;
+ }
+
+ wp_set_current_user( $user->ID );
+ return $user;
+ }
+
+ /**
+ * Sanitize string or array of strings for database.
+ *
+ * @since 1.5.2
+ *
+ * @param string|array $array Sanitize single string or array of strings.
+ * @return string|array Type matches $array and sanitized for the database.
+ */
+ function escape(&$array) {
+ global $wpdb;
+
+ if (!is_array($array)) {
+ return($wpdb->escape($array));
+ } else {
+ foreach ( (array) $array as $k => $v ) {
+ if ( is_array($v) ) {
+ $this->escape($array[$k]);
+ } else if ( is_object($v) ) {
+ //skip
+ } else {
+ $array[$k] = $wpdb->escape($v);
+ }
+ }
+ }
+ }
+
+ /**
+ * Retrieve custom fields for post.
+ *
+ * @since 2.5.0
+ *
+ * @param int $post_id Post ID.
+ * @return array Custom fields, if exist.
+ */
+ function get_custom_fields($post_id) {
+ $post_id = (int) $post_id;
+
+ $custom_fields = array();
+
+ foreach ( (array) has_meta($post_id) as $meta ) {
+ // Don't expose protected fields.
+ if ( strpos($meta['meta_key'], '_wp_') === 0 ) {
+ continue;
+ }
+
+ $custom_fields[] = array(
+ "id" => $meta['meta_id'],
+ "key" => $meta['meta_key'],
+ "value" => $meta['meta_value']
+ );
+ }
+
+ return $custom_fields;
+ }
+
+ /**
+ * Set custom fields for post.
+ *
+ * @since 2.5.0
+ *
+ * @param int $post_id Post ID.
+ * @param array $fields Custom fields.
+ */
+ function set_custom_fields($post_id, $fields) {
+ $post_id = (int) $post_id;
+
+ foreach ( (array) $fields as $meta ) {
+ if ( isset($meta['id']) ) {
+ $meta['id'] = (int) $meta['id'];
+
+ if ( isset($meta['key']) ) {
+ update_meta($meta['id'], $meta['key'], $meta['value']);
+ }
+ else {
+ delete_meta($meta['id']);
+ }
+ }
+ else {
+ $_POST['metakeyinput'] = $meta['key'];
+ $_POST['metavalue'] = $meta['value'];
+ add_meta($post_id);
+ }
+ }
+ }
+
+ /**
+ * Set up blog options property.
+ *
+ * Passes property through 'xmlrpc_blog_options' filter.
+ *
+ * @since 2.6.0
+ */
+ function initialise_blog_option_info( ) {
+ global $wp_version;
+
+ $this->blog_options = array(
+ // Read only options
+ 'software_name' => array(
+ 'desc' => __( 'Software Name' ),
+ 'readonly' => true,
+ 'value' => 'WordPress'
+ ),
+ 'software_version' => array(
+ 'desc' => __( 'Software Version' ),
+ 'readonly' => true,
+ 'value' => $wp_version
+ ),
+ 'blog_url' => array(
+ 'desc' => __( 'Site URL' ),
+ 'readonly' => true,
+ 'option' => 'siteurl'
+ ),
+
+ // Updatable options
+ 'time_zone' => array(
+ 'desc' => __( 'Time Zone' ),
+ 'readonly' => false,
+ 'option' => 'gmt_offset'
+ ),
+ 'blog_title' => array(
+ 'desc' => __( 'Site Title' ),
+ 'readonly' => false,
+ 'option' => 'blogname'
+ ),
+ 'blog_tagline' => array(
+ 'desc' => __( 'Site Tagline' ),
+ 'readonly' => false,
+ 'option' => 'blogdescription'
+ ),
+ 'date_format' => array(
+ 'desc' => __( 'Date Format' ),
+ 'readonly' => false,
+ 'option' => 'date_format'
+ ),
+ 'time_format' => array(
+ 'desc' => __( 'Time Format' ),
+ 'readonly' => false,
+ 'option' => 'time_format'
+ ),
+ 'users_can_register' => array(
+ 'desc' => __( 'Allow new users to sign up' ),
+ 'readonly' => false,
+ 'option' => 'users_can_register'
+ ),
+ 'thumbnail_size_w' => array(
+ 'desc' => __( 'Thumbnail Width' ),
+ 'readonly' => false,
+ 'option' => 'thumbnail_size_w'
+ ),
+ 'thumbnail_size_h' => array(
+ 'desc' => __( 'Thumbnail Height' ),
+ 'readonly' => false,
+ 'option' => 'thumbnail_size_h'
+ ),
+ 'thumbnail_crop' => array(
+ 'desc' => __( 'Crop thumbnail to exact dimensions' ),
+ 'readonly' => false,
+ 'option' => 'thumbnail_crop'
+ ),
+ 'medium_size_w' => array(
+ 'desc' => __( 'Medium size image width' ),
+ 'readonly' => false,
+ 'option' => 'medium_size_w'
+ ),
+ 'medium_size_h' => array(
+ 'desc' => __( 'Medium size image height' ),
+ 'readonly' => false,
+ 'option' => 'medium_size_h'
+ ),
+ 'large_size_w' => array(
+ 'desc' => __( 'Large size image width' ),
+ 'readonly' => false,
+ 'option' => 'large_size_w'
+ ),
+ 'large_size_h' => array(
+ 'desc' => __( 'Large size image height' ),
+ 'readonly' => false,
+ 'option' => 'large_size_h'
+ )
+ );
+
+ $this->blog_options = apply_filters( 'xmlrpc_blog_options', $this->blog_options );
+ }
+
+ /**
+ * Retrieve the blogs of the user.
+ *
+ * @since 2.6.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_getUsersBlogs( $args ) {
+ global $current_site;
+ // If this isn't on WPMU then just use blogger_getUsersBlogs
+ if ( !is_multisite() ) {
+ array_unshift( $args, 1 );
+ return $this->blogger_getUsersBlogs( $args );
+ }
+
+ $this->escape( $args );
+
+ $username = $args[0];
+ $password = $args[1];
+
+ 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 ) {
+ // Don't include blogs that aren't hosted at this site
+ if ( $blog->site_id != $current_site->id )
+ continue;
+
+ $blog_id = $blog->userblog_id;
+ switch_to_blog($blog_id);
+ $is_admin = current_user_can('manage_options');
+
+ $struct[] = array(
+ 'isAdmin' => $is_admin,
+ 'url' => get_option( 'home' ) . '/',
+ 'blogid' => (string) $blog_id,
+ 'blogName' => get_option( 'blogname' ),
+ 'xmlrpc' => site_url( 'xmlrpc.php' )
+ );
+
+ restore_current_blog( );
+ }
+
+ return $struct;
+ }
+
+ /**
+ * Retrieve page.
+ *
+ * @since 2.2.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_getPage($args) {
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $page_id = (int) $args[1];
+ $username = $args[2];
+ $password = $args[3];
+
+ if ( !$user = $this->login($username, $password) ) {
+ return $this->error;
+ }
+
+ 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');
+
+ // Lookup page info.
+ $page = get_page($page_id);
+
+ // If we found the page then format the data.
+ 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) ) {
+ $parent = get_page($page->post_parent);
+ $parent_title = $parent->post_title;
+ }
+
+ // Determine comment and ping settings.
+ $allow_comments = comments_open($page->ID) ? 1 : 0;
+ $allow_pings = pings_open($page->ID) ? 1 : 0;
+
+ // Format page date.
+ $page_date = mysql2date("Ymd\TH:i:s", $page->post_date, false);
+ $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' )
+ $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 ) {
+ $categories[] = get_cat_name($cat_id);
+ }
+
+ // Get the author info.
+ $author = get_userdata($page->post_author);
+
+ $page_template = get_post_meta( $page->ID, '_wp_page_template', true );
+ if ( empty( $page_template ) )
+ $page_template = 'default';
+
+ $page_struct = array(
+ "dateCreated" => new IXR_Date($page_date),
+ "userid" => $page->post_author,
+ "page_id" => $page->ID,
+ "page_status" => $page->post_status,
+ "description" => $full_page["main"],
+ "title" => $page->post_title,
+ "link" => $link,
+ "permaLink" => $link,
+ "categories" => $categories,
+ "excerpt" => $page->post_excerpt,
+ "text_more" => $full_page["extended"],
+ "mt_allow_comments" => $allow_comments,
+ "mt_allow_pings" => $allow_pings,
+ "wp_slug" => $page->post_name,
+ "wp_password" => $page->post_password,
+ "wp_author" => $author->display_name,
+ "wp_page_parent_id" => $page->post_parent,
+ "wp_page_parent_title" => $parent_title,
+ "wp_page_order" => $page->menu_order,
+ "wp_author_id" => $author->ID,
+ "wp_author_display_name" => $author->display_name,
+ "date_created_gmt" => new IXR_Date($page_date_gmt),
+ "custom_fields" => $this->get_custom_fields($page_id),
+ "wp_page_template" => $page_template
+ );
+
+ return($page_struct);
+ }
+ // If the page doesn't exist indicate that.
+ else {
+ return(new IXR_Error(404, __("Sorry, no such page.")));
+ }
+ }
+
+ /**
+ * Retrieve Pages.
+ *
+ * @since 2.2.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_getPages($args) {
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $num_pages = isset($args[3]) ? (int) $args[3] : 10;
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ if ( !current_user_can( 'edit_pages' ) )
+ return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) );
+
+ do_action('xmlrpc_call', 'wp.getPages');
+
+ $pages = get_posts( array('post_type' => 'page', 'post_status' => 'any', 'numberposts' => $num_pages) );
+ $num_pages = count($pages);
+
+ // If we have pages, put together their info.
+ if ( $num_pages >= 1 ) {
+ $pages_struct = array();
+
+ for ( $i = 0; $i < $num_pages; $i++ ) {
+ $page = wp_xmlrpc_server::wp_getPage(array(
+ $blog_id, $pages[$i]->ID, $username, $password
+ ));
+ $pages_struct[] = $page;
+ }
+
+ return($pages_struct);
+ }
+ // If no pages were found return an error.
+ else {
+ return(array());
+ }
+ }
+
+ /**
+ * Create new page.
+ *
+ * @since 2.2.0
+ *
+ * @param array $args Method parameters.
+ * @return unknown
+ */
+ function wp_newPage($args) {
+ // Items not escaped here will be escaped in newPost.
+ $username = $this->escape($args[1]);
+ $password = $this->escape($args[2]);
+ $page = $args[3];
+ $publish = $args[4];
+
+ 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") )
+ return(new IXR_Error(401, __("Sorry, you cannot add new pages.")));
+
+ // Mark this as content for a page.
+ $args[3]["post_type"] = "page";
+
+ // Let mw_newPost do all of the heavy lifting.
+ return($this->mw_newPost($args));
+ }
+
+ /**
+ * Delete page.
+ *
+ * @since 2.2.0
+ *
+ * @param array $args Method parameters.
+ * @return bool True, if success.
+ */
+ function wp_deletePage($args) {
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $page_id = (int) $args[3];
+
+ 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") )
+ return(new IXR_Error(404, __("Sorry, no such page.")));
+
+ // Make sure the user can delete pages.
+ 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 )
+ return(new IXR_Error(500, __("Failed to delete the page.")));
+
+ return(true);
+ }
+
+ /**
+ * Edit page.
+ *
+ * @since 2.2.0
+ *
+ * @param array $args Method parameters.
+ * @return unknown
+ */
+ function wp_editPage($args) {
+ // Items not escaped here will be escaped in editPost.
+ $blog_id = (int) $args[0];
+ $page_id = (int) $this->escape($args[1]);
+ $username = $this->escape($args[2]);
+ $password = $this->escape($args[3]);
+ $content = $args[4];
+ $publish = $args[5];
+
+ 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") )
+ 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) )
+ 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";
+
+ // Arrange args in the way mw_editPost understands.
+ $args = array(
+ $page_id,
+ $username,
+ $password,
+ $content,
+ $publish
+ );
+
+ // Let mw_editPost do all of the heavy lifting.
+ return($this->mw_editPost($args));
+ }
+
+ /**
+ * Retrieve page list.
+ *
+ * @since 2.2.0
+ *
+ * @param array $args Method parameters.
+ * @return unknown
+ */
+ function wp_getPageList($args) {
+ global $wpdb;
+
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ if ( !current_user_can( 'edit_pages' ) )
+ return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) );
+
+ do_action('xmlrpc_call', 'wp.getPageList');
+
+ // Get list of pages ids and titles
+ $page_list = $wpdb->get_results("
+ SELECT ID page_id,
+ post_title page_title,
+ post_parent page_parent_id,
+ post_date_gmt,
+ post_date,
+ post_status
+ FROM {$wpdb->posts}
+ WHERE post_type = 'page'
+ ORDER BY ID
+ ");
+
+ // The date needs to be formated properly.
+ $num_pages = count($page_list);
+ 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);
+
+ $page_list[$i]->dateCreated = new IXR_Date($post_date);
+ $page_list[$i]->date_created_gmt = new IXR_Date($post_date_gmt);
+
+ // For drafts use the GMT version of the date
+ if ( $page_list[$i]->post_status == 'draft' ) {
+ $page_list[$i]->date_created_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $page_list[$i]->post_date ), 'Ymd\TH:i:s' );
+ $page_list[$i]->date_created_gmt = new IXR_Date( $page_list[$i]->date_created_gmt );
+ }
+
+ unset($page_list[$i]->post_date_gmt);
+ unset($page_list[$i]->post_date);
+ unset($page_list[$i]->post_status);
+ }
+
+ return($page_list);
+ }
+
+ /**
+ * Retrieve authors list.
+ *
+ * @since 2.2.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_getAuthors($args) {
+
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ 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 site.")));
+
+ do_action('xmlrpc_call', 'wp.getAuthors');
+
+ $authors = array();
+ foreach ( get_users( array( 'fields' => array('ID','user_login','display_name') ) ) as $user ) {
+ $authors[] = array(
+ "user_id" => $user->ID,
+ "user_login" => $user->user_login,
+ "display_name" => $user->display_name
+ );
+ }
+
+ return $authors;
+ }
+
+ /**
+ * Get list of all tags
+ *
+ * @since 2.7
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_getTags( $args ) {
+ $this->escape( $args );
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ 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 site in order to view tags.' ) );
+
+ do_action( 'xmlrpc_call', 'wp.getKeywords' );
+
+ $tags = array( );
+
+ if ( $all_tags = get_tags() ) {
+ foreach( (array) $all_tags as $tag ) {
+ $struct['tag_id'] = $tag->term_id;
+ $struct['name'] = $tag->name;
+ $struct['count'] = $tag->count;
+ $struct['slug'] = $tag->slug;
+ $struct['html_url'] = esc_html( get_tag_link( $tag->term_id ) );
+ $struct['rss_url'] = esc_html( get_tag_feed_link( $tag->term_id ) );
+
+ $tags[] = $struct;
+ }
+ }
+
+ return $tags;
+ }
+
+ /**
+ * Create new category.
+ *
+ * @since 2.2.0
+ *
+ * @param array $args Method parameters.
+ * @return int Category ID.
+ */
+ function wp_newCategory($args) {
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $category = $args[3];
+
+ 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") )
+ 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"]) )
+ $category["slug"] = "";
+
+ // If no parent_id was provided make it empty
+ // so that it will be a top level page (no parent).
+ if ( !isset($category["parent_id"]) )
+ $category["parent_id"] = "";
+
+ // If no description was provided make it empty.
+ if ( empty($category["description"]) )
+ $category["description"] = "";
+
+ $new_category = array(
+ "cat_name" => $category["name"],
+ "category_nicename" => $category["slug"],
+ "category_parent" => $category["parent_id"],
+ "category_description" => $category["description"]
+ );
+
+ $cat_id = wp_insert_category($new_category, true);
+ if ( is_wp_error( $cat_id ) ) {
+ if ( 'term_exists' == $cat_id->get_error_code() )
+ return (int) $cat_id->get_error_data();
+ else
+ return(new IXR_Error(500, __("Sorry, the new category failed.")));
+ } elseif ( ! $cat_id ) {
+ return(new IXR_Error(500, __("Sorry, the new category failed.")));
+ }
+
+ return($cat_id);
+ }
+
+ /**
+ * Remove category.
+ *
+ * @since 2.5.0
+ *
+ * @param array $args Method parameters.
+ * @return mixed See {@link wp_delete_term()} for return info.
+ */
+ function wp_deleteCategory($args) {
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $category_id = (int) $args[3];
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ do_action('xmlrpc_call', 'wp.deleteCategory');
+
+ 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_term( $category_id, 'category' );
+ }
+
+ /**
+ * Retrieve category list.
+ *
+ * @since 2.2.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_suggestCategories($args) {
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $category = $args[3];
+ $max_results = (int) $args[4];
+
+ 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 site in order to view categories.' ) );
+
+ do_action('xmlrpc_call', 'wp.suggestCategories');
+
+ $category_suggestions = array();
+ $args = array('get' => 'all', 'number' => $max_results, 'name__like' => $category);
+ foreach ( (array) get_categories($args) as $cat ) {
+ $category_suggestions[] = array(
+ "category_id" => $cat->term_id,
+ "category_name" => $cat->name
+ );
+ }
+
+ return($category_suggestions);
+ }
+
+ /**
+ * Retrieve comment.
+ *
+ * @since 2.7.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_getComment($args) {
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $comment_id = (int) $args[3];
+
+ 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 site.' ) );
+
+ do_action('xmlrpc_call', 'wp.getComment');
+
+ if ( ! $comment = get_comment($comment_id) )
+ return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
+
+ // Format page date.
+ $comment_date = mysql2date("Ymd\TH:i:s", $comment->comment_date, false);
+ $comment_date_gmt = mysql2date("Ymd\TH:i:s", $comment->comment_date_gmt, false);
+
+ if ( '0' == $comment->comment_approved )
+ $comment_status = 'hold';
+ else if ( 'spam' == $comment->comment_approved )
+ $comment_status = 'spam';
+ else if ( '1' == $comment->comment_approved )
+ $comment_status = 'approve';
+ else
+ $comment_status = $comment->comment_approved;
+
+ $link = get_comment_link($comment);
+
+ $comment_struct = array(
+ "date_created_gmt" => new IXR_Date($comment_date_gmt),
+ "user_id" => $comment->user_id,
+ "comment_id" => $comment->comment_ID,
+ "parent" => $comment->comment_parent,
+ "status" => $comment_status,
+ "content" => $comment->comment_content,
+ "link" => $link,
+ "post_id" => $comment->comment_post_ID,
+ "post_title" => get_the_title($comment->comment_post_ID),
+ "author" => $comment->comment_author,
+ "author_url" => $comment->comment_author_url,
+ "author_email" => $comment->comment_author_email,
+ "author_ip" => $comment->comment_author_IP,
+ "type" => $comment->comment_type,
+ );
+
+ return $comment_struct;
+ }
+
+ /**
+ * Retrieve comments.
+ *
+ * @since 2.7.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_getComments($args) {
+ $raw_args = $args;
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $struct = $args[3];
+
+ 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.' ) );
+
+ do_action('xmlrpc_call', 'wp.getComments');
+
+ if ( isset($struct['status']) )
+ $status = $struct['status'];
+ else
+ $status = '';
+
+ $post_id = '';
+ if ( isset($struct['post_id']) )
+ $post_id = absint($struct['post_id']);
+
+ $offset = 0;
+ if ( isset($struct['offset']) )
+ $offset = absint($struct['offset']);
+
+ $number = 10;
+ if ( isset($struct['number']) )
+ $number = absint($struct['number']);
+
+ $comments = get_comments( array('status' => $status, 'post_id' => $post_id, 'offset' => $offset, 'number' => $number ) );
+ $num_comments = count($comments);
+
+ if ( ! $num_comments )
+ return array();
+
+ $comments_struct = array();
+
+ for ( $i = 0; $i < $num_comments; $i++ ) {
+ $comment = wp_xmlrpc_server::wp_getComment(array(
+ $raw_args[0], $raw_args[1], $raw_args[2], $comments[$i]->comment_ID,
+ ));
+ $comments_struct[] = $comment;
+ }
+
+ return $comments_struct;
+ }
+
+ /**
+ * Remove comment.
+ *
+ * @since 2.7.0
+ *
+ * @param array $args Method parameters.
+ * @return mixed {@link wp_delete_comment()}
+ */
+ function wp_deleteComment($args) {
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $comment_ID = (int) $args[3];
+
+ 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 site.' ) );
+
+ if ( !current_user_can( 'edit_comment', $comment_ID ) )
+ return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
+
+ do_action('xmlrpc_call', 'wp.deleteComment');
+
+ if ( ! get_comment($comment_ID) )
+ return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
+
+ return wp_delete_comment($comment_ID);
+ }
+
+ /**
+ * Edit comment.
+ *
+ * @since 2.7.0
+ *
+ * @param array $args Method parameters.
+ * @return bool True, on success.
+ */
+ function wp_editComment($args) {
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $comment_ID = (int) $args[3];
+ $content_struct = $args[4];
+
+ 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 site.' ) );
+
+ if ( !current_user_can( 'edit_comment', $comment_ID ) )
+ return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
+
+ do_action('xmlrpc_call', 'wp.editComment');
+
+ if ( ! get_comment($comment_ID) )
+ return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
+
+ if ( isset($content_struct['status']) ) {
+ $statuses = get_comment_statuses();
+ $statuses = array_keys($statuses);
+
+ if ( ! in_array($content_struct['status'], $statuses) )
+ return new IXR_Error( 401, __( 'Invalid comment status.' ) );
+ $comment_approved = $content_struct['status'];
+ }
+
+ // Do some timestamp voodoo
+ if ( !empty( $content_struct['date_created_gmt'] ) ) {
+ $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force
+ $comment_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
+ $comment_date_gmt = iso8601_to_datetime($dateCreated, 'GMT');
+ }
+
+ if ( isset($content_struct['content']) )
+ $comment_content = $content_struct['content'];
+
+ if ( isset($content_struct['author']) )
+ $comment_author = $content_struct['author'];
+
+ if ( isset($content_struct['author_url']) )
+ $comment_author_url = $content_struct['author_url'];
+
+ if ( isset($content_struct['author_email']) )
+ $comment_author_email = $content_struct['author_email'];
+
+ // We've got all the data -- post it:
+ $comment = compact('comment_ID', 'comment_content', 'comment_approved', 'comment_date', 'comment_date_gmt', 'comment_author', 'comment_author_email', 'comment_author_url');
+
+ $result = wp_update_comment($comment);
+ if ( is_wp_error( $result ) )
+ return new IXR_Error(500, $result->get_error_message());
+
+ if ( !$result )
+ return new IXR_Error(500, __('Sorry, the comment could not be edited. Something wrong happened.'));
+
+ return true;
+ }
+
+ /**
+ * Create new comment.
+ *
+ * @since 2.7.0
+ *
+ * @param array $args Method parameters.
+ * @return mixed {@link wp_new_comment()}
+ */
+ function wp_newComment($args) {
+ global $wpdb;
+
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $post = $args[3];
+ $content_struct = $args[4];
+
+ $allow_anon = apply_filters('xmlrpc_allow_anonymous_comments', false);
+
+ $user = $this->login($username, $password);
+
+ if ( !$user ) {
+ $logged_in = false;
+ if ( $allow_anon && get_option('comment_registration') )
+ return new IXR_Error( 403, __( 'You must be registered to comment' ) );
+ else if ( !$allow_anon )
+ return $this->error;
+ } else {
+ $logged_in = true;
+ }
+
+ if ( is_numeric($post) )
+ $post_id = absint($post);
+ else
+ $post_id = url_to_postid($post);
+
+ if ( ! $post_id )
+ return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+
+ if ( ! get_post($post_id) )
+ return new IXR_Error( 404, __( 'Invalid post ID.' ) );
+
+ $comment['comment_post_ID'] = $post_id;
+
+ if ( $logged_in ) {
+ $comment['comment_author'] = $wpdb->escape( $user->display_name );
+ $comment['comment_author_email'] = $wpdb->escape( $user->user_email );
+ $comment['comment_author_url'] = $wpdb->escape( $user->user_url );
+ $comment['user_ID'] = $user->ID;
+ } else {
+ $comment['comment_author'] = '';
+ if ( isset($content_struct['author']) )
+ $comment['comment_author'] = $content_struct['author'];
+
+ $comment['comment_author_email'] = '';
+ if ( isset($content_struct['author_email']) )
+ $comment['comment_author_email'] = $content_struct['author_email'];
+
+ $comment['comment_author_url'] = '';
+ if ( isset($content_struct['author_url']) )
+ $comment['comment_author_url'] = $content_struct['author_url'];
+
+ $comment['user_ID'] = 0;
+
+ if ( get_option('require_name_email') ) {
+ if ( 6 > strlen($comment['comment_author_email']) || '' == $comment['comment_author'] )
+ return new IXR_Error( 403, __( 'Comment author name and email are required' ) );
+ elseif ( !is_email($comment['comment_author_email']) )
+ return new IXR_Error( 403, __( 'A valid email address is required' ) );
+ }
+ }
+
+ $comment['comment_parent'] = isset($content_struct['comment_parent']) ? absint($content_struct['comment_parent']) : 0;
+
+ $comment['comment_content'] = isset($content_struct['content']) ? $content_struct['content'] : null;
+
+ do_action('xmlrpc_call', 'wp.newComment');
+
+ return wp_new_comment($comment);
+ }
+
+ /**
+ * Retrieve all of the comment status.
+ *
+ * @since 2.7.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_getCommentStatusList($args) {
+ $this->escape( $args );
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ 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 site.' ) );
+
+ do_action('xmlrpc_call', 'wp.getCommentStatusList');
+
+ return get_comment_statuses( );
+ }
+
+ /**
+ * Retrieve comment count.
+ *
+ * @since 2.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_getCommentCount( $args ) {
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $post_id = (int) $args[3];
+
+ 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 comments.' ) );
+
+ do_action('xmlrpc_call', 'wp.getCommentCount');
+
+ $count = wp_count_comments( $post_id );
+ return array(
+ "approved" => $count->approved,
+ "awaiting_moderation" => $count->moderated,
+ "spam" => $count->spam,
+ "total_comments" => $count->total_comments
+ );
+ }
+
+ /**
+ * Retrieve post statuses.
+ *
+ * @since 2.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_getPostStatusList( $args ) {
+ $this->escape( $args );
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ 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 site.' ) );
+
+ do_action('xmlrpc_call', 'wp.getPostStatusList');
+
+ return get_post_statuses( );
+ }
+
+ /**
+ * Retrieve page statuses.
+ *
+ * @since 2.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_getPageStatusList( $args ) {
+ $this->escape( $args );
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ 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 site.' ) );
+
+ do_action('xmlrpc_call', 'wp.getPageStatusList');
+
+ return get_page_statuses( );
+ }
+
+ /**
+ * Retrieve page templates.
+ *
+ * @since 2.6.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_getPageTemplates( $args ) {
+ $this->escape( $args );
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ 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 site.' ) );
+
+ $templates = get_page_templates( );
+ $templates['Default'] = 'default';
+
+ return $templates;
+ }
+
+ /**
+ * Retrieve blog options.
+ *
+ * @since 2.6.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function wp_getOptions( $args ) {
+ $this->escape( $args );
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $options = isset( $args[3] ) ? (array) $args[3] : array();
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ // If no specific options where asked for, return all of them
+ if ( count( $options ) == 0 )
+ $options = array_keys($this->blog_options);
+
+ return $this->_getOptions($options);
+ }
+
+ /**
+ * Retrieve blog options value from list.
+ *
+ * @since 2.6.0
+ *
+ * @param array $options Options to retrieve.
+ * @return array
+ */
+ function _getOptions($options) {
+ $data = array( );
+ 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'] ) ) {
+ $data[$option]['value'] = get_option( $data[$option]['option'] );
+ unset($data[$option]['option']);
+ }
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Update blog options.
+ *
+ * @since 2.6.0
+ *
+ * @param array $args Method parameters.
+ * @return unknown
+ */
+ function wp_setOptions( $args ) {
+ $this->escape( $args );
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $options = (array) $args[3];
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ 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 ) {
+ $option_names[] = $o_name;
+ if ( !array_key_exists( $o_name, $this->blog_options ) )
+ continue;
+
+ if ( $this->blog_options[$o_name]['readonly'] == true )
+ continue;
+
+ update_option( $this->blog_options[$o_name]['option'], $o_value );
+ }
+
+ //Now return the updated values
+ return $this->_getOptions($option_names);
+ }
+
+ /**
+ * Retrieve a media item by ID
+ *
+ * @since 3.1.0
+ *
+ * @param array $args Method parameters. Contains:
+ * - blog_id
+ * - username
+ * - password
+ * - attachment_id
+ * @return array. Assocciative array containing:
+ * - 'date_created_gmt'
+ * - 'parent'
+ * - 'link'
+ * - 'thumbnail'
+ * - 'title'
+ * - 'caption'
+ * - 'description'
+ * - 'metadata'
+ */
+ function wp_getMediaItem($args) {
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $attachment_id = (int) $args[3];
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ if ( !current_user_can( 'upload_files' ) )
+ return new IXR_Error( 403, __( 'You are not allowed to upload files on this site.' ) );
+
+ do_action('xmlrpc_call', 'wp.getMediaItem');
+
+ if ( ! $attachment = get_post($attachment_id) )
+ return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
+
+ // Format page date.
+ $attachment_date = mysql2date("Ymd\TH:i:s", $attachment->post_date, false);
+ $attachment_date_gmt = mysql2date("Ymd\TH:i:s", $attachment->post_date_gmt, false);
+
+ $link = wp_get_attachment_url($attachment->ID);
+ $thumbnail_link = wp_get_attachment_thumb_url($attachment->ID);
+
+ $attachment_struct = array(
+ "date_created_gmt" => new IXR_Date($attachment_date_gmt),
+ "parent" => $attachment->post_parent,
+ "link" => $link,
+ "thumbnail" => $thumbnail_link,
+ "title" => $attachment->post_title,
+ "caption" => $attachment->post_excerpt,
+ "description" => $attachment->post_content,
+ "metadata" => wp_get_attachment_metadata($attachment->ID),
+ );
+
+ return $attachment_struct;
+ }
+
+ /**
+ * Retrieves a collection of media library items (or attachments)
+ *
+ * Besides the common blog_id, username, and password arguments, it takes a filter
+ * array as last argument.
+ *
+ * Accepted 'filter' keys are 'parent_id', 'mime_type', 'offset', and 'number'.
+ *
+ * The defaults are as follows:
+ * - 'number' - Default is 5. Total number of media items to retrieve.
+ * - 'offset' - Default is 0. See {@link WP_Query::query()} for more.
+ * - 'parent_id' - Default is ''. The post where the media item is attached. Empty string shows all media items. 0 shows unattached media items.
+ * - 'mime_type' - Default is ''. Filter by mime type (e.g., 'image/jpeg', 'application/pdf')
+ *
+ * @since 3.1.0
+ *
+ * @param array $args Method parameters. Contains:
+ * - blog_id
+ * - username
+ * - password
+ * - filter
+ * @return array. Contains a collection of media items. See {@link wp_xmlrpc_server::wp_getMediaItem()} for a description of each item contents
+ */
+ function wp_getMediaLibrary($args) {
+ $raw_args = $args;
+ $this->escape($args);
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $struct = isset( $args[3] ) ? $args[3] : array() ;
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ if ( !current_user_can( 'upload_files' ) )
+ return new IXR_Error( 401, __( 'Sorry, you cannot upload files.' ) );
+
+ do_action('xmlrpc_call', 'wp.getMediaLibrary');
+
+ $parent_id = ( isset($struct['parent_id']) ) ? absint($struct['parent_id']) : '' ;
+ $mime_type = ( isset($struct['mime_type']) ) ? $struct['mime_type'] : '' ;
+ $offset = ( isset($struct['offset']) ) ? absint($struct['offset']) : 0 ;
+ $number = ( isset($struct['number']) ) ? absint($struct['number']) : -1 ;
+
+ $attachments = get_posts( array('post_type' => 'attachment', 'post_parent' => $parent_id, 'offset' => $offset, 'numberposts' => $number, 'post_mime_type' => $mime_type ) );
+ $num_attachments = count($attachments);
+
+ if ( ! $num_attachments )
+ return array();
+
+ $attachments_struct = array();
+
+ foreach ($attachments as $attachment )
+ $attachments_struct[] = $this->wp_getMediaItem( array( $raw_args[0], $raw_args[1], $raw_args[2], $attachment->ID ) );
+
+ return $attachments_struct;
+ }
+
+ /**
+ * Retrives a list of post formats used by the site
+ *
+ * @since 3.1
+ *
+ * @param array $args Method parameters. Contains:
+ * - blog_id
+ * - username
+ * - password
+ * @return array
+ */
+ function wp_getPostFormats( $args ) {
+ $this->escape( $args );
+
+ $blog_id = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ if ( !$user = $this->login( $username, $password ) )
+ return $this->error;
+
+ do_action( 'xmlrpc_call', 'wp.getPostFormats' );
+ return get_post_format_strings();
+ }
+
+ /* Blogger API functions.
+ * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/
+ */
+
+ /**
+ * Retrieve blogs that user owns.
+ *
+ * Will make more sense once we support multiple blogs.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @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) )
+ return $this->error;
+
+ do_action('xmlrpc_call', 'blogger.getUsersBlogs');
+
+ $is_admin = current_user_can('manage_options');
+
+ $struct = array(
+ 'isAdmin' => $is_admin,
+ 'url' => get_option('home') . '/',
+ 'blogid' => '1',
+ 'blogName' => get_option('blogname'),
+ 'xmlrpc' => site_url( 'xmlrpc.php' )
+ );
+
+ 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.
+ *
+ * Gives your client some info about you, so you don't have to.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function blogger_getUserInfo($args) {
+
+ $this->escape($args);
+
+ $username = $args[1];
+ $password = $args[2];
+
+ 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 site.' ) );
+
+ do_action('xmlrpc_call', 'blogger.getUserInfo');
+
+ $struct = array(
+ 'nickname' => $user->nickname,
+ 'userid' => $user->ID,
+ 'url' => $user->user_url,
+ 'lastname' => $user->last_name,
+ 'firstname' => $user->first_name
+ );
+
+ return $struct;
+ }
+
+ /**
+ * Retrieve post.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function blogger_getPost($args) {
+
+ $this->escape($args);
+
+ $post_ID = (int) $args[1];
+ $username = $args[2];
+ $password = $args[3];
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ 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');
+
+ $post_data = wp_get_single_post($post_ID, ARRAY_A);
+
+ $categories = implode(',', wp_get_post_categories($post_ID));
+
+ $content = '<title>'.stripslashes($post_data['post_title']).'</title>';
+ $content .= '<category>'.$categories.'</category>';
+ $content .= stripslashes($post_data['post_content']);
+
+ $struct = array(
+ 'userid' => $post_data['post_author'],
+ 'dateCreated' => new IXR_Date(mysql2date('Ymd\TH:i:s', $post_data['post_date'], false)),
+ 'content' => $content,
+ 'postid' => (string) $post_data['ID']
+ );
+
+ return $struct;
+ }
+
+ /**
+ * Retrieve list of recent posts.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function blogger_getRecentPosts($args) {
+
+ $this->escape($args);
+
+ // $args[0] = appkey - ignored
+ $blog_ID = (int) $args[1]; /* though we don't use it yet */
+ $username = $args[2];
+ $password = $args[3];
+ if ( isset( $args[4] ) )
+ $query = array( 'numberposts' => absint( $args[4] ) );
+ else
+ $query = array();
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ do_action('xmlrpc_call', 'blogger.getRecentPosts');
+
+ $posts_list = wp_get_recent_posts( $query );
+
+ 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'] ) )
+ continue;
+
+ $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false);
+ $categories = implode(',', wp_get_post_categories($entry['ID']));
+
+ $content = '<title>'.stripslashes($entry['post_title']).'</title>';
+ $content .= '<category>'.$categories.'</category>';
+ $content .= stripslashes($entry['post_content']);
+
+ $struct[] = array(
+ 'userid' => $entry['post_author'],
+ 'dateCreated' => new IXR_Date($post_date),
+ 'content' => $content,
+ 'postid' => (string) $entry['ID'],
+ );
+
+ }
+
+ $recent_posts = array();
+ for ( $j=0; $j<count($struct); $j++ ) {
+ array_push($recent_posts, $struct[$j]);
+ }
+
+ return $recent_posts;
+ }
+
+ /**
+ * Retrieve blog_filename content.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return string
+ */
+ function blogger_getTemplate($args) {
+
+ $this->escape($args);
+
+ $blog_ID = (int) $args[1];
+ $username = $args[2];
+ $password = $args[3];
+ $template = $args[4]; /* could be 'main' or 'archiveIndex', but we don't use it */
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ do_action('xmlrpc_call', 'blogger.getTemplate');
+
+ 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') . '/';
+ $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename);
+
+ $f = fopen($filename, 'r');
+ $content = fread($f, filesize($filename));
+ fclose($f);
+
+ /* so it is actually editable with a windows/mac client */
+ // FIXME: (or delete me) do we really want to cater to bad clients at the expense of good ones by BEEPing up their line breaks? commented. $content = str_replace("\n", "\r\n", $content);
+
+ return $content;
+ }
+
+ /**
+ * Updates the content of blog_filename.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return bool True when done.
+ */
+ function blogger_setTemplate($args) {
+
+ $this->escape($args);
+
+ $blog_ID = (int) $args[1];
+ $username = $args[2];
+ $password = $args[3];
+ $content = $args[4];
+ $template = $args[5]; /* could be 'main' or 'archiveIndex', but we don't use it */
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ do_action('xmlrpc_call', 'blogger.setTemplate');
+
+ 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') . '/';
+ $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename);
+
+ if ($f = fopen($filename, 'w+')) {
+ fwrite($f, $content);
+ fclose($f);
+ } else {
+ return new IXR_Error(500, __('Either the file is not writable, or something wrong happened. The file has not been updated.'));
+ }
+
+ return true;
+ }
+
+ /**
+ * Create new post.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return int
+ */
+ function blogger_newPost($args) {
+
+ $this->escape($args);
+
+ $blog_ID = (int) $args[1]; /* though we don't use it yet */
+ $username = $args[2];
+ $password = $args[3];
+ $content = $args[4];
+ $publish = $args[5];
+
+ 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 site.'));
+
+ $post_status = ($publish) ? 'publish' : 'draft';
+
+ $post_author = $user->ID;
+
+ $post_title = xmlrpc_getposttitle($content);
+ $post_category = xmlrpc_getpostcategory($content);
+ $post_content = xmlrpc_removepostdata($content);
+
+ $post_date = current_time('mysql');
+ $post_date_gmt = current_time('mysql', 1);
+
+ $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status');
+
+ $post_ID = wp_insert_post($post_data);
+ if ( is_wp_error( $post_ID ) )
+ return new IXR_Error(500, $post_ID->get_error_message());
+
+ 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 );
+
+ logIO('O', "Posted ! ID: $post_ID");
+
+ return $post_ID;
+ }
+
+ /**
+ * Edit a post.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return bool true when done.
+ */
+ function blogger_editPost($args) {
+
+ $this->escape($args);
+
+ $post_ID = (int) $args[1];
+ $username = $args[2];
+ $password = $args[3];
+ $content = $args[4];
+ $publish = $args[5];
+
+ 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' )
+ return new IXR_Error(404, __('Sorry, no such post.'));
+
+ $this->escape($actual_post);
+
+ if ( !current_user_can('edit_post', $post_ID) )
+ return new IXR_Error(401, __('Sorry, you do not have the right to edit this post.'));
+
+ extract($actual_post, EXTR_SKIP);
+
+ if ( ('publish' == $post_status) && !current_user_can('publish_posts') )
+ return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.'));
+
+ $post_title = xmlrpc_getposttitle($content);
+ $post_category = xmlrpc_getpostcategory($content);
+ $post_content = xmlrpc_removepostdata($content);
+
+ $postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt');
+
+ $result = wp_update_post($postdata);
+
+ 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;
+ }
+
+ /**
+ * Remove a post.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return bool True when post is deleted.
+ */
+ function blogger_deletePost($args) {
+ $this->escape($args);
+
+ $post_ID = (int) $args[1];
+ $username = $args[2];
+ $password = $args[3];
+ $publish = $args[4];
+
+ 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' )
+ return new IXR_Error(404, __('Sorry, no such post.'));
+
+ if ( !current_user_can('delete_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 )
+ return new IXR_Error(500, __('For some strange yet very annoying reason, this post could not be deleted.'));
+
+ return true;
+ }
+
+ /* MetaWeblog API functions
+ * specs on wherever Dave Winer wants them to be
+ */
+
+ /**
+ * Create a new post.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return int
+ */
+ function mw_newPost($args) {
+ $this->escape($args);
+
+ $blog_ID = (int) $args[0]; // we will support this in the near future
+ $username = $args[1];
+ $password = $args[2];
+ $content_struct = $args[3];
+ $publish = isset( $args[4] ) ? $args[4] : 0;
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ do_action('xmlrpc_call', 'metaWeblog.newPost');
+
+ $page_template = '';
+ if ( !empty( $content_struct['post_type'] ) ) {
+ if ( $content_struct['post_type'] == 'page' ) {
+ if ( $publish )
+ $cap = 'publish_pages';
+ elseif ('publish' == $content_struct['page_status'])
+ $cap = 'publish_pages';
+ else
+ $cap = 'edit_pages';
+ $error_message = __( 'Sorry, you are not allowed to publish pages on this site.' );
+ $post_type = 'page';
+ if ( !empty( $content_struct['wp_page_template'] ) )
+ $page_template = $content_struct['wp_page_template'];
+ } elseif ( $content_struct['post_type'] == 'post' ) {
+ if ( $publish )
+ $cap = 'publish_posts';
+ elseif ('publish' == $content_struct['post_status'])
+ $cap = 'publish_posts';
+ else
+ $cap = 'edit_posts';
+ $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
+ $post_type = 'post';
+ } else {
+ // No other post_type values are allowed here
+ return new IXR_Error( 401, __( 'Invalid post type.' ) );
+ }
+ } else {
+ if ( $publish )
+ $cap = 'publish_posts';
+ elseif ('publish' == $content_struct['post_status'])
+ $cap = 'publish_posts';
+ else
+ $cap = 'edit_posts';
+ $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
+ $post_type = 'post';
+ }
+
+ if ( !current_user_can( $cap ) )
+ return new IXR_Error( 401, $error_message );
+
+ // Check for a valid post format if one was given
+ if ( isset( $content_struct['wp_post_format'] ) ) {
+ $content_struct['wp_post_format'] = sanitize_key( $content_struct['wp_post_format'] );
+ if ( !array_key_exists( $content_struct['wp_post_format'], get_post_format_strings() ) ) {
+ return new IXR_Error( 404, __( 'Invalid post format' ) );
+ }
+ }
+
+ // Let WordPress generate the post_name (slug) unless
+ // one has been provided.
+ $post_name = "";
+ 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"]) )
+ $post_password = $content_struct["wp_password"];
+
+ // Only set a post parent if one was provided.
+ 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"]) )
+ $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 ) {
+ case "post":
+ 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") )
+ 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.")));
+ break;
+ }
+ $post_author = $content_struct["wp_author_id"];
+ }
+
+ $post_title = isset( $content_struct['title'] ) ? $content_struct['title'] : null;
+ $post_content = isset( $content_struct['description'] ) ? $content_struct['description'] : null;
+
+ $post_status = $publish ? 'publish' : 'draft';
+
+ if ( isset( $content_struct["{$post_type}_status"] ) ) {
+ switch ( $content_struct["{$post_type}_status"] ) {
+ case 'draft':
+ case 'private':
+ case 'publish':
+ $post_status = $content_struct["{$post_type}_status"];
+ break;
+ case 'pending':
+ // Pending is only valid for posts, not pages.
+ if ( $post_type === 'post' )
+ $post_status = $content_struct["{$post_type}_status"];
+ break;
+ default:
+ $post_status = $publish ? 'publish' : 'draft';
+ break;
+ }
+ }
+
+ $post_excerpt = isset($content_struct['mt_excerpt']) ? $content_struct['mt_excerpt'] : null;
+ $post_more = isset($content_struct['mt_text_more']) ? $content_struct['mt_text_more'] : null;
+
+ $tags_input = isset($content_struct['mt_keywords']) ? $content_struct['mt_keywords'] : null;
+
+ 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;
+ case "open":
+ $comment_status = "open";
+ break;
+ default:
+ $comment_status = get_option("default_comment_status");
+ break;
+ }
+ } else {
+ switch ( (int) $content_struct["mt_allow_comments"] ) {
+ case 0:
+ case 2:
+ $comment_status = "closed";
+ break;
+ case 1:
+ $comment_status = "open";
+ break;
+ default:
+ $comment_status = get_option("default_comment_status");
+ break;
+ }
+ }
+ } 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'] ) {
+ case "closed":
+ $ping_status = "closed";
+ break;
+ case "open":
+ $ping_status = "open";
+ break;
+ default:
+ $ping_status = get_option("default_ping_status");
+ break;
+ }
+ } else {
+ switch ( (int) $content_struct["mt_allow_pings"] ) {
+ case 0:
+ $ping_status = "closed";
+ break;
+ case 1:
+ $ping_status = "open";
+ break;
+ default:
+ $ping_status = get_option("default_ping_status");
+ break;
+ }
+ }
+ } else {
+ $ping_status = get_option("default_ping_status");
+ }
+
+ if ( $post_more )
+ $post_content = $post_content . "<!--more-->" . $post_more;
+
+ $to_ping = null;
+ if ( isset( $content_struct['mt_tb_ping_urls'] ) ) {
+ $to_ping = $content_struct['mt_tb_ping_urls'];
+ if ( is_array($to_ping) )
+ $to_ping = implode(' ', $to_ping);
+ }
+
+ // Do some timestamp voodoo
+ if ( !empty( $content_struct['date_created_gmt'] ) )
+ $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force
+ elseif ( !empty( $content_struct['dateCreated']) )
+ $dateCreated = $content_struct['dateCreated']->getIso();
+
+ if ( !empty( $dateCreated ) ) {
+ $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
+ $post_date_gmt = iso8601_to_datetime($dateCreated, 'GMT');
+ } else {
+ $post_date = current_time('mysql');
+ $post_date_gmt = current_time('mysql', 1);
+ }
+
+ $post_category = array();
+ if ( isset( $content_struct['categories'] ) ) {
+ $catnames = $content_struct['categories'];
+ logIO('O', 'Post cats: ' . var_export($catnames,true));
+
+ if ( is_array($catnames) ) {
+ foreach ($catnames as $cat) {
+ $post_category[] = get_cat_ID($cat);
+ }
+ }
+ }
+
+ // We've got all the data -- post it:
+ $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input', 'page_template');
+
+ $post_ID = wp_insert_post($postdata, true);
+ if ( is_wp_error( $post_ID ) )
+ return new IXR_Error(500, $post_ID->get_error_message());
+
+ 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 ( $content_struct['sticky'] == true )
+ stick_post( $post_ID );
+ elseif ( $content_struct['sticky'] == false )
+ unstick_post( $post_ID );
+ }
+
+ if ( isset($content_struct['custom_fields']) )
+ $this->set_custom_fields($post_ID, $content_struct['custom_fields']);
+
+ // Handle enclosures
+ $thisEnclosure = isset($content_struct['enclosure']) ? $content_struct['enclosure'] : null;
+ $this->add_enclosure_if_new($post_ID, $thisEnclosure);
+
+ $this->attach_uploads( $post_ID, $post_content );
+
+ // Handle post formats if assigned, value is validated earlier
+ // in this function
+ if ( isset( $content_struct['wp_post_format'] ) )
+ wp_set_post_terms( $post_ID, array( 'post-format-' . $content_struct['wp_post_format'] ), 'post_format' );
+
+ logIO('O', "Posted ! ID: $post_ID");
+
+ return strval($post_ID);
+ }
+
+ function add_enclosure_if_new($post_ID, $enclosure) {
+ if ( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) {
+
+ $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'];
+ $found = false;
+ foreach ( (array) get_post_custom($post_ID) as $key => $val) {
+ if ($key == 'enclosure') {
+ foreach ( (array) $val as $enc ) {
+ if ($enc == $encstring) {
+ $found = true;
+ break 2;
+ }
+ }
+ }
+ }
+ if (!$found)
+ add_post_meta( $post_ID, 'enclosure', $encstring );
+ }
+ }
+
+ /**
+ * Attach upload to a post.
+ *
+ * @since 2.1.0
+ *
+ * @param int $post_ID Post ID.
+ * @param string $post_content Post Content for attachment.
+ */
+ function attach_uploads( $post_ID, $post_content ) {
+ global $wpdb;
+
+ // 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 )
+ $wpdb->update($wpdb->posts, array('post_parent' => $post_ID), array('ID' => $file->ID) );
+ }
+ }
+ }
+
+ /**
+ * Edit a post.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return bool True on success.
+ */
+ function mw_editPost($args) {
+
+ $this->escape($args);
+
+ $post_ID = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $content_struct = $args[3];
+ $publish = $args[4];
+
+ 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 site.' );
+ $post_type = 'post';
+ $page_template = '';
+ if ( !empty( $content_struct['post_type'] ) ) {
+ if ( $content_struct['post_type'] == 'page' ) {
+ if ( $publish || 'publish' == $content_struct['page_status'] )
+ $cap = 'publish_pages';
+ else
+ $cap = 'edit_pages';
+ $error_message = __( 'Sorry, you are not allowed to publish pages on this site.' );
+ $post_type = 'page';
+ if ( !empty( $content_struct['wp_page_template'] ) )
+ $page_template = $content_struct['wp_page_template'];
+ } elseif ( $content_struct['post_type'] == 'post' ) {
+ if ( $publish || 'publish' == $content_struct['post_status'] )
+ $cap = 'publish_posts';
+ else
+ $cap = 'edit_posts';
+ $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
+ $post_type = 'post';
+ } else {
+ // No other post_type values are allowed here
+ return new IXR_Error( 401, __( 'Invalid post type.' ) );
+ }
+ } else {
+ if ( $publish || 'publish' == $content_struct['post_status'] )
+ $cap = 'publish_posts';
+ else
+ $cap = 'edit_posts';
+ $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
+ $post_type = 'post';
+ }
+
+ if ( !current_user_can( $cap ) )
+ return new IXR_Error( 401, $error_message );
+
+ // Check for a valid post format if one was given
+ if ( isset( $content_struct['wp_post_format'] ) ) {
+ $content_struct['wp_post_format'] = sanitize_key( $content_struct['wp_post_format'] );
+ if ( !array_key_exists( $content_struct['wp_post_format'], get_post_format_strings() ) ) {
+ return new IXR_Error( 404, __( 'Invalid post format' ) );
+ }
+ }
+
+ $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"]) )
+ 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"]) )
+ $post_name = $content_struct["wp_slug"];
+
+ // Only use a password if one was given.
+ 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"]) )
+ $post_parent = $content_struct["wp_page_parent_id"];
+
+ // Only set the menu_order if it was given.
+ 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 ) {
+ case "post":
+ 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") )
+ 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.")));
+ break;
+ }
+ $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"] ) {
+ case "closed":
+ $comment_status = "closed";
+ break;
+ case "open":
+ $comment_status = "open";
+ break;
+ default:
+ $comment_status = get_option("default_comment_status");
+ break;
+ }
+ } else {
+ switch ( (int) $content_struct["mt_allow_comments"] ) {
+ case 0:
+ case 2:
+ $comment_status = "closed";
+ break;
+ case 1:
+ $comment_status = "open";
+ break;
+ default:
+ $comment_status = get_option("default_comment_status");
+ break;
+ }
+ }
+ }
+
+ 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;
+ case "open":
+ $ping_status = "open";
+ break;
+ default:
+ $ping_status = get_option("default_ping_status");
+ break;
+ }
+ } else {
+ switch ( (int) $content_struct["mt_allow_pings"] ) {
+ case 0:
+ $ping_status = "closed";
+ break;
+ case 1:
+ $ping_status = "open";
+ break;
+ default:
+ $ping_status = get_option("default_ping_status");
+ break;
+ }
+ }
+ }
+
+ $post_title = isset( $content_struct['title'] ) ? $content_struct['title'] : null;
+ $post_content = isset( $content_struct['description'] ) ? $content_struct['description'] : null;
+
+ $post_category = array();
+ if ( isset( $content_struct['categories'] ) ) {
+ $catnames = $content_struct['categories'];
+ if ( is_array($catnames) ) {
+ foreach ($catnames as $cat) {
+ $post_category[] = get_cat_ID($cat);
+ }
+ }
+ }
+
+ $post_excerpt = isset( $content_struct['mt_excerpt'] ) ? $content_struct['mt_excerpt'] : null;
+ $post_more = isset( $content_struct['mt_text_more'] ) ? $content_struct['mt_text_more'] : null;
+
+ $post_status = $publish ? 'publish' : 'draft';
+ if ( isset( $content_struct["{$post_type}_status"] ) ) {
+ switch( $content_struct["{$post_type}_status"] ) {
+ case 'draft':
+ case 'private':
+ case 'publish':
+ $post_status = $content_struct["{$post_type}_status"];
+ break;
+ case 'pending':
+ // Pending is only valid for posts, not pages.
+ if ( $post_type === 'post' )
+ $post_status = $content_struct["{$post_type}_status"];
+ break;
+ default:
+ $post_status = $publish ? 'publish' : 'draft';
+ break;
+ }
+ }
+
+ $tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null;
+
+ if ( ('publish' == $post_status) ) {
+ if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') )
+ return new IXR_Error(401, __('Sorry, you do not have the right to publish this page.'));
+ else if ( !current_user_can('publish_posts') )
+ return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.'));
+ }
+
+ if ( $post_more )
+ $post_content = $post_content . "<!--more-->" . $post_more;
+
+ $to_ping = null;
+ if ( isset( $content_struct['mt_tb_ping_urls'] ) ) {
+ $to_ping = $content_struct['mt_tb_ping_urls'];
+ if ( is_array($to_ping) )
+ $to_ping = implode(' ', $to_ping);
+ }
+
+ // Do some timestamp voodoo
+ if ( !empty( $content_struct['date_created_gmt'] ) )
+ $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force
+ elseif ( !empty( $content_struct['dateCreated']) )
+ $dateCreated = $content_struct['dateCreated']->getIso();
+
+ if ( !empty( $dateCreated ) ) {
+ $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
+ $post_date_gmt = iso8601_to_datetime($dateCreated, 'GMT');
+ } else {
+ $post_date = $postdata['post_date'];
+ $post_date_gmt = $postdata['post_date_gmt'];
+ }
+
+ // We've got all the data -- post it:
+ $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input', 'page_template');
+
+ $result = wp_update_post($newpost, true);
+ if ( is_wp_error( $result ) )
+ return new IXR_Error(500, $result->get_error_message());
+
+ 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 ( $content_struct['sticky'] == true )
+ stick_post( $post_ID );
+ elseif ( $content_struct['sticky'] == false )
+ unstick_post( $post_ID );
+ }
+
+ if ( isset($content_struct['custom_fields']) )
+ $this->set_custom_fields($post_ID, $content_struct['custom_fields']);
+
+ // Handle enclosures
+ $thisEnclosure = isset($content_struct['enclosure']) ? $content_struct['enclosure'] : null;
+ $this->add_enclosure_if_new($post_ID, $thisEnclosure);
+
+ $this->attach_uploads( $ID, $post_content );
+
+ // Handle post formats if assigned, validation is handled
+ // earlier in this function
+ if ( isset( $content_struct['wp_post_format'] ) )
+ wp_set_post_terms( $post_ID, array( 'post-format-' . $content_struct['wp_post_format'] ), 'post_format' );
+
+ logIO('O',"(MW) Edited ! ID: $post_ID");
+
+ return true;
+ }
+
+ /**
+ * Retrieve post.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function mw_getPost($args) {
+
+ $this->escape($args);
+
+ $post_ID = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ 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');
+
+ $postdata = wp_get_single_post($post_ID, ARRAY_A);
+
+ if ($postdata['post_date'] != '') {
+ $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date'], false);
+ $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' )
+ $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);
+ foreach($catids as $catid)
+ $categories[] = get_cat_name($catid);
+
+ $tagnames = array();
+ $tags = wp_get_post_tags( $post_ID );
+ if ( !empty( $tags ) ) {
+ foreach ( $tags as $tag )
+ $tagnames[] = $tag->name;
+ $tagnames = implode( ', ', $tagnames );
+ } else {
+ $tagnames = '';
+ }
+
+ $post = get_extended($postdata['post_content']);
+ $link = post_permalink($postdata['ID']);
+
+ // Get the author info.
+ $author = get_userdata($postdata['post_author']);
+
+ $allow_comments = ('open' == $postdata['comment_status']) ? 1 : 0;
+ $allow_pings = ('open' == $postdata['ping_status']) ? 1 : 0;
+
+ // Consider future posts as published
+ if ( $postdata['post_status'] === 'future' )
+ $postdata['post_status'] = 'publish';
+
+ // Get post format
+ $post_format = get_post_format( $post_ID );
+ if ( empty( $post_format ) )
+ $post_format = 'standard';
+
+ $sticky = false;
+ if ( is_sticky( $post_ID ) )
+ $sticky = true;
+
+ $enclosure = array();
+ foreach ( (array) get_post_custom($post_ID) as $key => $val) {
+ if ($key == 'enclosure') {
+ foreach ( (array) $val as $enc ) {
+ $encdata = split("\n", $enc);
+ $enclosure['url'] = trim(htmlspecialchars($encdata[0]));
+ $enclosure['length'] = (int) trim($encdata[1]);
+ $enclosure['type'] = trim($encdata[2]);
+ break 2;
+ }
+ }
+ }
+
+ $resp = array(
+ 'dateCreated' => new IXR_Date($post_date),
+ 'userid' => $postdata['post_author'],
+ 'postid' => $postdata['ID'],
+ 'description' => $post['main'],
+ 'title' => $postdata['post_title'],
+ 'link' => $link,
+ 'permaLink' => $link,
+ // commented out because no other tool seems to use this
+ // 'content' => $entry['post_content'],
+ 'categories' => $categories,
+ 'mt_excerpt' => $postdata['post_excerpt'],
+ 'mt_text_more' => $post['extended'],
+ 'mt_allow_comments' => $allow_comments,
+ 'mt_allow_pings' => $allow_pings,
+ 'mt_keywords' => $tagnames,
+ 'wp_slug' => $postdata['post_name'],
+ 'wp_password' => $postdata['post_password'],
+ 'wp_author_id' => $author->ID,
+ 'wp_author_display_name' => $author->display_name,
+ 'date_created_gmt' => new IXR_Date($post_date_gmt),
+ 'post_status' => $postdata['post_status'],
+ 'custom_fields' => $this->get_custom_fields($post_ID),
+ 'wp_post_format' => $post_format,
+ 'sticky' => $sticky
+ );
+
+ if ( !empty($enclosure) ) $resp['enclosure'] = $enclosure;
+
+ return $resp;
+ } else {
+ return new IXR_Error(404, __('Sorry, no such post.'));
+ }
+ }
+
+ /**
+ * Retrieve list of recent posts.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function mw_getRecentPosts($args) {
+
+ $this->escape($args);
+
+ $blog_ID = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ if ( isset( $args[3] ) )
+ $query = array( 'numberposts' => absint( $args[3] ) );
+ else
+ $query = array();
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ do_action('xmlrpc_call', 'metaWeblog.getRecentPosts');
+
+ $posts_list = wp_get_recent_posts( $query );
+
+ if ( !$posts_list )
+ return array( );
+
+ foreach ($posts_list as $entry) {
+ 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' )
+ $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 )
+ $categories[] = get_cat_name($catid);
+
+ $tagnames = array();
+ $tags = wp_get_post_tags( $entry['ID'] );
+ if ( !empty( $tags ) ) {
+ foreach ( $tags as $tag ) {
+ $tagnames[] = $tag->name;
+ }
+ $tagnames = implode( ', ', $tagnames );
+ } else {
+ $tagnames = '';
+ }
+
+ $post = get_extended($entry['post_content']);
+ $link = post_permalink($entry['ID']);
+
+ // Get the post author info.
+ $author = get_userdata($entry['post_author']);
+
+ $allow_comments = ('open' == $entry['comment_status']) ? 1 : 0;
+ $allow_pings = ('open' == $entry['ping_status']) ? 1 : 0;
+
+ // Consider future posts as published
+ if ( $entry['post_status'] === 'future' )
+ $entry['post_status'] = 'publish';
+
+ // Get post format
+ $post_format = get_post_format( $entry['ID'] );
+ if ( empty( $post_format ) )
+ $post_format = 'standard';
+
+ $struct[] = array(
+ 'dateCreated' => new IXR_Date($post_date),
+ 'userid' => $entry['post_author'],
+ 'postid' => (string) $entry['ID'],
+ 'description' => $post['main'],
+ 'title' => $entry['post_title'],
+ 'link' => $link,
+ 'permaLink' => $link,
+ // commented out because no other tool seems to use this
+ // 'content' => $entry['post_content'],
+ 'categories' => $categories,
+ 'mt_excerpt' => $entry['post_excerpt'],
+ 'mt_text_more' => $post['extended'],
+ 'mt_allow_comments' => $allow_comments,
+ 'mt_allow_pings' => $allow_pings,
+ 'mt_keywords' => $tagnames,
+ 'wp_slug' => $entry['post_name'],
+ 'wp_password' => $entry['post_password'],
+ 'wp_author_id' => $author->ID,
+ 'wp_author_display_name' => $author->display_name,
+ 'date_created_gmt' => new IXR_Date($post_date_gmt),
+ 'post_status' => $entry['post_status'],
+ 'custom_fields' => $this->get_custom_fields($entry['ID']),
+ 'wp_post_format' => $post_format
+ );
+
+ }
+
+ $recent_posts = array();
+ for ( $j=0; $j<count($struct); $j++ ) {
+ array_push($recent_posts, $struct[$j]);
+ }
+
+ return $recent_posts;
+ }
+
+ /**
+ * Retrieve the list of categories on a given blog.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function mw_getCategories($args) {
+
+ $this->escape($args);
+
+ $blog_ID = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ 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 site in order to view categories.' ) );
+
+ do_action('xmlrpc_call', 'metaWeblog.getCategories');
+
+ $categories_struct = array();
+
+ if ( $cats = get_categories(array('get' => 'all')) ) {
+ foreach ( $cats as $cat ) {
+ $struct['categoryId'] = $cat->term_id;
+ $struct['parentId'] = $cat->parent;
+ $struct['description'] = $cat->name;
+ $struct['categoryDescription'] = $cat->description;
+ $struct['categoryName'] = $cat->name;
+ $struct['htmlUrl'] = esc_html(get_category_link($cat->term_id));
+ $struct['rssUrl'] = esc_html(get_category_feed_link($cat->term_id, 'rss2'));
+
+ $categories_struct[] = $struct;
+ }
+ }
+
+ return $categories_struct;
+ }
+
+ /**
+ * Uploads a file, following your settings.
+ *
+ * Adapted from a patch by Johann Richard.
+ *
+ * @link http://mycvs.org/archives/2004/06/30/file-upload-to-wordpress-in-ecto/
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function mw_newMediaObject($args) {
+ global $wpdb;
+
+ $blog_ID = (int) $args[0];
+ $username = $wpdb->escape($args[1]);
+ $password = $wpdb->escape($args[2]);
+ $data = $args[3];
+
+ $name = sanitize_file_name( $data['name'] );
+ $type = $data['type'];
+ $bits = $data['bits'];
+
+ logIO('O', '(MW) Received '.strlen($bits).' bytes');
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ do_action('xmlrpc_call', 'metaWeblog.newMediaObject');
+
+ if ( !current_user_can('upload_files') ) {
+ logIO('O', '(MW) User does not have upload_files capability');
+ $this->error = new IXR_Error(401, __('You are not allowed to upload files to this site.'));
+ return $this->error;
+ }
+
+ if ( $upload_err = apply_filters( "pre_upload_error", false ) )
+ return new IXR_Error(500, $upload_err);
+
+ if ( !empty($data["overwrite"]) && ($data["overwrite"] == true) ) {
+ // Get postmeta info on the object.
+ $old_file = $wpdb->get_row("
+ SELECT ID
+ FROM {$wpdb->posts}
+ WHERE post_title = '{$name}'
+ AND post_type = 'attachment'
+ ");
+
+ // Delete previous file.
+ wp_delete_attachment($old_file->ID);
+
+ // Make sure the new name is different by pre-pending the
+ // previous post id.
+ $filename = preg_replace("/^wpid\d+-/", "", $name);
+ $name = "wpid{$old_file->ID}-{$filename}";
+ }
+
+ $upload = wp_upload_bits($name, NULL, $bits);
+ if ( ! empty($upload['error']) ) {
+ $errorString = sprintf(__('Could not write file %1$s (%2$s)'), $name, $upload['error']);
+ logIO('O', '(MW) ' . $errorString);
+ return new IXR_Error(500, $errorString);
+ }
+ // Construct the attachment array
+ // attach to post_id 0
+ $post_id = 0;
+ $attachment = array(
+ 'post_title' => $name,
+ 'post_content' => '',
+ 'post_type' => 'attachment',
+ 'post_parent' => $post_id,
+ 'post_mime_type' => $type,
+ 'guid' => $upload[ 'url' ]
+ );
+
+ // Save the data
+ $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 ), 'upload' );
+ }
+
+ /* MovableType API functions
+ * specs on http://www.movabletype.org/docs/mtmanual_programmatic.html
+ */
+
+ /**
+ * Retrieve the post titles of recent posts.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function mt_getRecentPostTitles($args) {
+
+ $this->escape($args);
+
+ $blog_ID = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ if ( isset( $args[3] ) )
+ $query = array( 'numberposts' => absint( $args[3] ) );
+ else
+ $query = array();
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ do_action('xmlrpc_call', 'mt.getRecentPostTitles');
+
+ $posts_list = wp_get_recent_posts( $query );
+
+ 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'] ) )
+ 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' )
+ $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),
+ 'userid' => $entry['post_author'],
+ 'postid' => (string) $entry['ID'],
+ 'title' => $entry['post_title'],
+ 'date_created_gmt' => new IXR_Date($post_date_gmt)
+ );
+
+ }
+
+ $recent_posts = array();
+ for ( $j=0; $j<count($struct); $j++ ) {
+ array_push($recent_posts, $struct[$j]);
+ }
+
+ return $recent_posts;
+ }
+
+ /**
+ * Retrieve list of all categories on blog.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function mt_getCategoryList($args) {
+
+ $this->escape($args);
+
+ $blog_ID = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ 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 site in order to view categories.' ) );
+
+ do_action('xmlrpc_call', 'mt.getCategoryList');
+
+ $categories_struct = array();
+
+ if ( $cats = get_categories(array('hide_empty' => 0, 'hierarchical' => 0)) ) {
+ foreach ( $cats as $cat ) {
+ $struct['categoryId'] = $cat->term_id;
+ $struct['categoryName'] = $cat->name;
+
+ $categories_struct[] = $struct;
+ }
+ }
+
+ return $categories_struct;
+ }
+
+ /**
+ * Retrieve post categories.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function mt_getPostCategories($args) {
+
+ $this->escape($args);
+
+ $post_ID = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ 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');
+
+ $categories = array();
+ $catids = wp_get_post_categories(intval($post_ID));
+ // first listed category will be the primary category
+ $isPrimary = true;
+ foreach ( $catids as $catid ) {
+ $categories[] = array(
+ 'categoryName' => get_cat_name($catid),
+ 'categoryId' => (string) $catid,
+ 'isPrimary' => $isPrimary
+ );
+ $isPrimary = false;
+ }
+
+ return $categories;
+ }
+
+ /**
+ * Sets categories for a post.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return bool True on success.
+ */
+ function mt_setPostCategories($args) {
+
+ $this->escape($args);
+
+ $post_ID = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+ $categories = $args[3];
+
+ 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 ) {
+ $catids[] = $cat['categoryId'];
+ }
+
+ wp_set_post_categories($post_ID, $catids);
+
+ return true;
+ }
+
+ /**
+ * Retrieve an array of methods supported by this server.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function mt_supportedMethods($args) {
+
+ do_action('xmlrpc_call', 'mt.supportedMethods');
+
+ $supported_methods = array();
+ foreach ( $this->methods as $key => $value ) {
+ $supported_methods[] = $key;
+ }
+
+ return $supported_methods;
+ }
+
+ /**
+ * Retrieve an empty array because we don't support per-post text filters.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ */
+ function mt_supportedTextFilters($args) {
+ do_action('xmlrpc_call', 'mt.supportedTextFilters');
+ return apply_filters('xmlrpc_text_filters', array());
+ }
+
+ /**
+ * Retrieve trackbacks sent to a given post.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return mixed
+ */
+ function mt_getTrackbackPings($args) {
+
+ global $wpdb;
+
+ $post_ID = intval($args);
+
+ do_action('xmlrpc_call', 'mt.getTrackbackPings');
+
+ $actual_post = wp_get_single_post($post_ID, ARRAY_A);
+
+ 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 )
+ return array();
+
+ $trackback_pings = array();
+ foreach ( $comments as $comment ) {
+ if ( 'trackback' == $comment->comment_type ) {
+ $content = $comment->comment_content;
+ $title = substr($content, 8, (strpos($content, '</strong>') - 8));
+ $trackback_pings[] = array(
+ 'pingTitle' => $title,
+ 'pingURL' => $comment->comment_author_url,
+ 'pingIP' => $comment->comment_author_IP
+ );
+ }
+ }
+
+ return $trackback_pings;
+ }
+
+ /**
+ * Sets a post's publish status to 'publish'.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return int
+ */
+ function mt_publishPost($args) {
+
+ $this->escape($args);
+
+ $post_ID = (int) $args[0];
+ $username = $args[1];
+ $password = $args[2];
+
+ if ( !$user = $this->login($username, $password) )
+ return $this->error;
+
+ do_action('xmlrpc_call', 'mt.publishPost');
+
+ if ( !current_user_can('publish_posts') || !current_user_can('edit_post', $post_ID) )
+ return new IXR_Error(401, __('Sorry, you cannot publish this post.'));
+
+ $postdata = wp_get_single_post($post_ID,ARRAY_A);
+
+ $postdata['post_status'] = 'publish';
+
+ // retain old cats
+ $cats = wp_get_post_categories($post_ID);
+ $postdata['post_category'] = $cats;
+ $this->escape($postdata);
+
+ $result = wp_update_post($postdata);
+
+ return $result;
+ }
+
+ /* PingBack functions
+ * specs on www.hixie.ch/specs/pingback/pingback
+ */
+
+ /**
+ * Retrieves a pingback and registers it.
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function pingback_ping($args) {
+ global $wpdb;
+
+ do_action('xmlrpc_call', 'pingback.ping');
+
+ $this->escape($args);
+
+ $pagelinkedfrom = $args[0];
+ $pagelinkedto = $args[1];
+
+ $title = '';
+
+ $pagelinkedfrom = str_replace('&', '&', $pagelinkedfrom);
+ $pagelinkedto = str_replace('&', '&', $pagelinkedto);
+ $pagelinkedto = str_replace('&', '&', $pagelinkedto);
+
+ // 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 )
+ 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) ) {
+ $way = 'url_to_postid()';
+ } 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) ) {
+ // 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']) ) {
+ // an #anchor is there, it's either...
+ 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']) ) {
+ // ...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']) ) {
+ // ...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", like_escape( $title ) );
+ if (! ($post_ID = $wpdb->get_var($sql)) ) {
+ // returning unknown error '0' is better than die()ing
+ return new IXR_Error(0, '');
+ }
+ $way = 'from the fragment (title)';
+ }
+ } else {
+ // TODO: Attempt to extract a post ID from the given URL
+ 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.'));
+ }
+ $post_ID = (int) $post_ID;
+
+
+ logIO("O","(PB) URL='$pagelinkedto' ID='$post_ID' Found='$way'");
+
+ $post = get_post($post_ID);
+
+ if ( !$post ) // Post_ID not found
+ 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.'));
+
+ if ( $post_ID == url_to_postid($pagelinkedfrom) )
+ return new IXR_Error(0, __('The source URL and the target URL cannot both point to the same resource.'));
+
+ // Check if pings are on
+ if ( !pings_open($post) )
+ 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
+ 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);
+
+ // Let's check the remote site
+ $linea = wp_remote_fopen( $pagelinkedfrom );
+ if ( !$linea )
+ return new IXR_Error(16, __('The source URL does not exist.'));
+
+ $linea = apply_filters('pre_remote_source', $linea, $pagelinkedto);
+
+ // Work around bug in strip_tags():
+ $linea = str_replace('<!DOC', '<DOC', $linea);
+ $linea = preg_replace( '/[\s\r\n\t]+/', ' ', $linea ); // normalize spaces
+ $linea = preg_replace( "/ <(h1|h2|h3|h4|h5|h6|p|th|td|li|dt|dd|pre|caption|input|textarea|button|body)[^>]*>/", "\n\n", $linea );
+
+ preg_match('|<title>([^<]*?)</title>|is', $linea, $matchtitle);
+ $title = $matchtitle[1];
+ if ( empty( $title ) )
+ return new IXR_Error(32, __('We cannot find a title on that page.'));
+
+ $linea = strip_tags( $linea, '<a>' ); // just keep the tag we need
+
+ $p = explode( "\n\n", $linea );
+
+ $preg_target = preg_quote($pagelinkedto, '|');
+
+ foreach ( $p as $para ) {
+ if ( strpos($para, $pagelinkedto) !== false ) { // it exists, but is it a link?
+ preg_match("|<a[^>]+?".$preg_target."[^>]*>([^>]+?)</a>|", $para, $context);
+
+ // If the URL isn't in a link context, keep looking
+ if ( empty($context) )
+ continue;
+
+ // We're going to use this fake tag to mark the context in a bit
+ // the marker is needed in case the link text appears more than once in the paragraph
+ $excerpt = preg_replace('|\</?wpcontext\>|', '', $para);
+
+ // prevent really long link text
+ if ( strlen($context[1]) > 100 )
+ $context[1] = substr($context[1], 0, 100) . '...';
+
+ $marker = '<wpcontext>'.$context[1].'</wpcontext>'; // set up our marker
+ $excerpt= str_replace($context[0], $marker, $excerpt); // swap out the link for our marker
+ $excerpt = strip_tags($excerpt, '<wpcontext>'); // strip all tags but our context marker
+ $excerpt = trim($excerpt);
+ $preg_marker = preg_quote($marker, '|');
+ $excerpt = preg_replace("|.*?\s(.{0,100}$preg_marker.{0,100})\s.*|s", '$1', $excerpt);
+ $excerpt = strip_tags($excerpt); // YES, again, to remove the marker wrapper
+ break;
+ }
+ }
+
+ if ( empty($context) ) // Link to target not found
+ return new IXR_Error(17, __('The source URL does not contain a link to the target URL, and so cannot be used as a source.'));
+
+ $pagelinkedfrom = str_replace('&', '&', $pagelinkedfrom);
+
+ $context = '[...] ' . esc_html( $excerpt ) . ' [...]';
+ $pagelinkedfrom = $wpdb->escape( $pagelinkedfrom );
+
+ $comment_post_ID = (int) $post_ID;
+ $comment_author = $title;
+ $comment_author_email = '';
+ $this->escape($comment_author);
+ $comment_author_url = $pagelinkedfrom;
+ $comment_content = $context;
+ $this->escape($comment_content);
+ $comment_type = 'pingback';
+
+ $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_content', 'comment_type');
+
+ $comment_ID = wp_new_comment($commentdata);
+ do_action('pingback_post', $comment_ID);
+
+ return sprintf(__('Pingback from %1$s to %2$s registered. Keep the web talking! :-)'), $pagelinkedfrom, $pagelinkedto);
+ }
+
+ /**
+ * Retrieve array of URLs that pingbacked the given URL.
+ *
+ * Specs on http://www.aquarionics.com/misc/archives/blogite/0198.html
+ *
+ * @since 1.5.0
+ *
+ * @param array $args Method parameters.
+ * @return array
+ */
+ function pingback_extensions_getPingbacks($args) {
+
+ global $wpdb;
+
+ do_action('xmlrpc_call', 'pingback.extensions.getPingbacks');
+
+ $this->escape($args);
+
+ $url = $args;
+
+ $post_ID = url_to_postid($url);
+ 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 ) {
+ // 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 )
+ return array();
+
+ $pingbacks = array();
+ foreach ( $comments as $comment ) {
+ if ( 'pingback' == $comment->comment_type )
+ $pingbacks[] = $comment->comment_author_url;
+ }
+
+ return $pingbacks;
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * WordPress environment setup class.
+ *
+ * @package WordPress
+ * @since 2.0.0
+ */
+class WP {
+ /**
+ * Public query variables.
+ *
+ * Long list of public query variables.
+ *
+ * @since 2.0.0
+ * @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', 'post_type');
+
+ /**
+ * Private query variables.
+ *
+ * Long list of private query variables.
+ *
+ * @since 2.0.0
+ * @var array
+ */
+ var $private_query_vars = array('offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page', 'post__in', 'post__not_in');
+
+ /**
+ * Extra query variables set by the user.
+ *
+ * @since 2.1.0
+ * @var array
+ */
+ var $extra_query_vars = array();
+
+ /**
+ * Query variables for setting up the WordPress Query Loop.
+ *
+ * @since 2.0.0
+ * @var array
+ */
+ var $query_vars;
+
+ /**
+ * String parsed to set the query variables.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ var $query_string;
+
+ /**
+ * Permalink or requested URI.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ var $request;
+
+ /**
+ * Rewrite rule the request matched.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ var $matched_rule;
+
+ /**
+ * Rewrite query the request matched.
+ *
+ * @since 2.0.0
+ * @var string
+ */
+ var $matched_query;
+
+ /**
+ * Whether already did the permalink.
+ *
+ * @since 2.0.0
+ * @var bool
+ */
+ var $did_permalink = false;
+
+ /**
+ * Add name to list of public query variables.
+ *
+ * @since 2.1.0
+ *
+ * @param string $qv Query variable name.
+ */
+ function add_query_var($qv) {
+ if ( !in_array($qv, $this->public_query_vars) )
+ $this->public_query_vars[] = $qv;
+ }
+
+ /**
+ * Set the value of a query variable.
+ *
+ * @since 2.3.0
+ *
+ * @param string $key Query variable name.
+ * @param mixed $value Query variable value.
+ */
+ function set_query_var($key, $value) {
+ $this->query_vars[$key] = $value;
+ }
+
+ /**
+ * Parse request to find correct WordPress query.
+ *
+ * Sets up the query variables based on the request. There are also many
+ * filters and actions that can be used to further manipulate the result.
+ *
+ * @since 2.0.0
+ *
+ * @param array|string $extra_query_vars Set the extra query variables.
+ */
+ function parse_request($extra_query_vars = '') {
+ global $wp_rewrite;
+
+ $this->query_vars = array();
+ $post_type_query_vars = array();
+
+ if ( is_array($extra_query_vars) )
+ $this->extra_query_vars = & $extra_query_vars;
+ else if (! empty($extra_query_vars))
+ parse_str($extra_query_vars, $this->extra_query_vars);
+
+ // Process PATH_INFO, REQUEST_URI, and 404 for permalinks.
+
+ // Fetch the rewrite rules.
+ $rewrite = $wp_rewrite->wp_rewrite_rules();
+
+ if ( ! empty($rewrite) ) {
+ // If we match a rewrite rule, this will be cleared.
+ $error = '404';
+ $this->did_permalink = true;
+
+ if ( isset($_SERVER['PATH_INFO']) )
+ $pathinfo = $_SERVER['PATH_INFO'];
+ else
+ $pathinfo = '';
+ $pathinfo_array = explode('?', $pathinfo);
+ $pathinfo = str_replace("%", "%25", $pathinfo_array[0]);
+ $req_uri = $_SERVER['REQUEST_URI'];
+ $req_uri_array = explode('?', $req_uri);
+ $req_uri = $req_uri_array[0];
+ $self = $_SERVER['PHP_SELF'];
+ $home_path = parse_url(home_url());
+ if ( isset($home_path['path']) )
+ $home_path = $home_path['path'];
+ else
+ $home_path = '';
+ $home_path = trim($home_path, '/');
+
+ // Trim path info from the end and the leading home path from the
+ // front. For path info requests, this leaves us with the requesting
+ // filename, if any. For 404 requests, this leaves us with the
+ // requested permalink.
+ $req_uri = str_replace($pathinfo, '', $req_uri);
+ $req_uri = trim($req_uri, '/');
+ $req_uri = preg_replace("|^$home_path|", '', $req_uri);
+ $req_uri = trim($req_uri, '/');
+ $pathinfo = trim($pathinfo, '/');
+ $pathinfo = preg_replace("|^$home_path|", '', $pathinfo);
+ $pathinfo = trim($pathinfo, '/');
+ $self = trim($self, '/');
+ $self = preg_replace("|^$home_path|", '', $self);
+ $self = trim($self, '/');
+
+ // The requested permalink is in $pathinfo for path info requests and
+ // $req_uri for other requests.
+ if ( ! empty($pathinfo) && !preg_match('|^.*' . $wp_rewrite->index . '$|', $pathinfo) ) {
+ $request = $pathinfo;
+ } else {
+ // If the request uri is the index, blank it out so that we don't try to match it against a rule.
+ if ( $req_uri == $wp_rewrite->index )
+ $req_uri = '';
+ $request = $req_uri;
+ }
+
+ $this->request = $request;
+
+ // Look for matches.
+ $request_match = $request;
+ foreach ( (array) $rewrite as $match => $query) {
+ // Don't try to match against AtomPub calls
+ if ( $req_uri == 'wp-app.php' )
+ break;
+
+ // 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) )
+ $request_match = $req_uri . '/' . $request;
+
+ if ( preg_match("#^$match#", $request_match, $matches) ||
+ preg_match("#^$match#", urldecode($request_match), $matches) ) {
+ // Got a match.
+ $this->matched_rule = $match;
+
+ // Trim the query of everything up to the '?'.
+ $query = preg_replace("!^.+\?!", '', $query);
+
+ // Substitute the substring matches into the query.
+ $query = addslashes(WP_MatchesMapRegex::apply($query, $matches));
+
+ $this->matched_query = $query;
+
+ // Parse the query.
+ parse_str($query, $perma_query_vars);
+
+ // If we're processing a 404 request, clear the error var
+ // since we found something.
+ if ( isset($_GET['error']) )
+ unset($_GET['error']);
+
+ if ( isset($error) )
+ unset($error);
+
+ break;
+ }
+ }
+
+ // 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']) )
+ unset($_GET['error']);
+
+ if ( isset($error) )
+ unset($error);
+
+ if ( isset($perma_query_vars) && strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false )
+ unset($perma_query_vars);
+
+ $this->did_permalink = false;
+ }
+ }
+
+ $this->public_query_vars = apply_filters('query_vars', $this->public_query_vars);
+
+ foreach ( $GLOBALS['wp_post_types'] as $post_type => $t )
+ if ( $t->query_var )
+ $post_type_query_vars[$t->query_var] = $post_type;
+
+ foreach ( $this->public_query_vars as $wpvar ) {
+ if ( isset( $this->extra_query_vars[$wpvar] ) )
+ $this->query_vars[$wpvar] = $this->extra_query_vars[$wpvar];
+ elseif ( isset( $_POST[$wpvar] ) )
+ $this->query_vars[$wpvar] = $_POST[$wpvar];
+ elseif ( isset( $_GET[$wpvar] ) )
+ $this->query_vars[$wpvar] = $_GET[$wpvar];
+ elseif ( isset( $perma_query_vars[$wpvar] ) )
+ $this->query_vars[$wpvar] = $perma_query_vars[$wpvar];
+
+ if ( !empty( $this->query_vars[$wpvar] ) ) {
+ if ( ! is_array( $this->query_vars[$wpvar] ) ) {
+ $this->query_vars[$wpvar] = (string) $this->query_vars[$wpvar];
+ } else {
+ foreach ( $this->query_vars[$wpvar] as $vkey => $v ) {
+ if ( !is_object( $v ) ) {
+ $this->query_vars[$wpvar][$vkey] = (string) $v;
+ }
+ }
+ }
+
+ if ( isset($post_type_query_vars[$wpvar] ) ) {
+ $this->query_vars['post_type'] = $post_type_query_vars[$wpvar];
+ $this->query_vars['name'] = $this->query_vars[$wpvar];
+ }
+ }
+ }
+
+ // Convert urldecoded spaces back into +
+ foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t )
+ if ( $t->query_var && isset( $this->query_vars[$t->query_var] ) )
+ $this->query_vars[$t->query_var] = str_replace( ' ', '+', $this->query_vars[$t->query_var] );
+
+ // 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 ( ! is_array( $this->query_vars['post_type'] ) ) {
+ if ( ! in_array( $this->query_vars['post_type'], $queryable_post_types ) )
+ unset( $this->query_vars['post_type'] );
+ } else {
+ $this->query_vars['post_type'] = array_intersect( $this->query_vars['post_type'], $queryable_post_types );
+ }
+ }
+
+ foreach ( (array) $this->private_query_vars as $var) {
+ if ( isset($this->extra_query_vars[$var]) )
+ $this->query_vars[$var] = $this->extra_query_vars[$var];
+ }
+
+ if ( isset($error) )
+ $this->query_vars['error'] = $error;
+
+ $this->query_vars = apply_filters('request', $this->query_vars);
+
+ do_action_ref_array('parse_request', array(&$this));
+ }
+
+ /**
+ * Send additional HTTP headers for caching, content type, etc.
+ *
+ * Sets the X-Pingback header, 404 status (if 404), Content-type. If showing
+ * a feed, it will also send last-modified, etag, and 304 status if needed.
+ *
+ * @since 2.0.0
+ */
+ function send_headers() {
+ $headers = array('X-Pingback' => get_bloginfo('pingback_url'));
+ $status = null;
+ $exit_required = false;
+
+ if ( is_user_logged_in() )
+ $headers = array_merge($headers, wp_get_nocache_headers());
+ if ( !empty($this->query_vars['error']) && '404' == $this->query_vars['error'] ) {
+ $status = 404;
+ if ( !is_user_logged_in() )
+ $headers = array_merge($headers, wp_get_nocache_headers());
+ $headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
+ } else if ( empty($this->query_vars['feed']) ) {
+ $headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
+ } else {
+ // We're showing a feed, so WP is indeed the only thing that last changed
+ if ( !empty($this->query_vars['withcomments'])
+ || ( empty($this->query_vars['withoutcomments'])
+ && ( !empty($this->query_vars['p'])
+ || !empty($this->query_vars['name'])
+ || !empty($this->query_vars['page_id'])
+ || !empty($this->query_vars['pagename'])
+ || !empty($this->query_vars['attachment'])
+ || !empty($this->query_vars['attachment_id'])
+ )
+ )
+ )
+ $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0).' GMT';
+ else
+ $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT';
+ $wp_etag = '"' . md5($wp_last_modified) . '"';
+ $headers['Last-Modified'] = $wp_last_modified;
+ $headers['ETag'] = $wp_etag;
+
+ // Support for Conditional GET
+ if (isset($_SERVER['HTTP_IF_NONE_MATCH']))
+ $client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
+ else $client_etag = false;
+
+ $client_last_modified = empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? '' : trim($_SERVER['HTTP_IF_MODIFIED_SINCE']);
+ // If string is empty, return 0. If not, attempt to parse into a timestamp
+ $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0;
+
+ // Make a timestamp for our most recent modification...
+ $wp_modified_timestamp = strtotime($wp_last_modified);
+
+ if ( ($client_last_modified && $client_etag) ?
+ (($client_modified_timestamp >= $wp_modified_timestamp) && ($client_etag == $wp_etag)) :
+ (($client_modified_timestamp >= $wp_modified_timestamp) || ($client_etag == $wp_etag)) ) {
+ $status = 304;
+ $exit_required = true;
+ }
+ }
+
+ $headers = apply_filters('wp_headers', $headers, $this);
+
+ if ( ! empty( $status ) )
+ status_header( $status );
+ foreach( (array) $headers as $name => $field_value )
+ @header("{$name}: {$field_value}");
+
+ if ( $exit_required )
+ exit();
+
+ do_action_ref_array('send_headers', array(&$this));
+ }
+
+ /**
+ * Sets the query string property based off of the query variable property.
+ *
+ * The 'query_string' filter is deprecated, but still works. Plugins should
+ * use the 'request' filter instead.
+ *
+ * @since 2.0.0
+ */
+ function build_query_string() {
+ $this->query_string = '';
+ foreach ( (array) array_keys($this->query_vars) as $wpvar) {
+ if ( '' != $this->query_vars[$wpvar] ) {
+ $this->query_string .= (strlen($this->query_string) < 1) ? '' : '&';
+ if ( !is_scalar($this->query_vars[$wpvar]) ) // Discard non-scalars.
+ continue;
+ $this->query_string .= $wpvar . '=' . rawurlencode($this->query_vars[$wpvar]);
+ }
+ }
+
+ // query_string filter deprecated. Use request filter instead.
+ if ( has_filter('query_string') ) { // Don't bother filtering and parsing if no plugins are hooked in.
+ $this->query_string = apply_filters('query_string', $this->query_string);
+ parse_str($this->query_string, $this->query_vars);
+ }
+ }
+
+ /**
+ * 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
+ * WordPress environment.
+ *
+ * @global string $query_string Query string for the loop.
+ * @global int $more Only set, if single page or post.
+ * @global int $single If single page or post. Only set, if single page or post.
+ *
+ * @since 2.0.0
+ */
+ function register_globals() {
+ global $wp_query;
+ // Extract updated query vars back into global namespace.
+ foreach ( (array) $wp_query->query_vars as $key => $value) {
+ $GLOBALS[$key] = $value;
+ }
+
+ $GLOBALS['query_string'] = $this->query_string;
+ $GLOBALS['posts'] = & $wp_query->posts;
+ $GLOBALS['post'] = (isset($wp_query->post)) ? $wp_query->post : null;
+ $GLOBALS['request'] = $wp_query->request;
+
+ if ( is_single() || is_page() ) {
+ $GLOBALS['more'] = 1;
+ $GLOBALS['single'] = 1;
+ }
+ }
+
+ /**
+ * Set up the current user.
+ *
+ * @since 2.0.0
+ */
+ function init() {
+ wp_get_current_user();
+ }
+
+ /**
+ * Set up the Loop based on the query variables.
+ *
+ * @uses WP::$query_vars
+ * @since 2.0.0
+ */
+ function query_posts() {
+ global $wp_the_query;
+ $this->build_query_string();
+ $wp_the_query->query($this->query_vars);
+ }
+
+ /**
+ * 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.
+ *
+ * Otherwise, issue a 200.
+ *
+ * @since 2.0.0
+ */
+ function handle_404() {
+ global $wp_query;
+
+ if ( !is_admin() && ( 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_tax() || is_author() ) && $wp_query->get_queried_object() && !is_paged() ) {
+ if ( !is_404() )
+ status_header( 200 );
+ return;
+ }
+ $wp_query->set_404();
+ status_header( 404 );
+ nocache_headers();
+ } elseif ( !is_404() ) {
+ status_header( 200 );
+ }
+ }
+
+ /**
+ * Sets up all of the variables required by the WordPress environment.
+ *
+ * The action 'wp' has one parameter that references the WP object. It
+ * allows for accessing the properties and methods to further manipulate the
+ * object.
+ *
+ * @since 2.0.0
+ *
+ * @param string|array $query_args Passed to {@link parse_request()}
+ */
+ function main($query_args = '') {
+ $this->init();
+ $this->parse_request($query_args);
+ $this->send_headers();
+ $this->query_posts();
+ $this->handle_404();
+ $this->register_globals();
+ do_action_ref_array('wp', array(&$this));
+ }
+
+ /**
+ * PHP4 Constructor - Does nothing.
+ *
+ * Call main() method when ready to run setup.
+ *
+ * @since 2.0.0
+ *
+ * @return WP
+ */
+ function WP() {
+ // Empty.
+ }
+}
+
+/**
+ * Helper class to remove the need to use eval to replace $matches[] in query strings.
+ *
+ * @since 2.9.0
+ */
+class WP_MatchesMapRegex {
+ /**
+ * store for matches
+ *
+ * @access private
+ * @var array
+ */
+ var $_matches;
+
+ /**
+ * store for mapping result
+ *
+ * @access public
+ * @var string
+ */
+ var $output;
+
+ /**
+ * subject to perform mapping on (query string containing $matches[] references
+ *
+ * @access private
+ * @var string
+ */
+ var $_subject;
+
+ /**
+ * regexp pattern to match $matches[] references
+ *
+ * @var string
+ */
+ var $_pattern = '(\$matches\[[1-9]+[0-9]*\])'; // magic number
+
+ /**
+ * constructor
+ *
+ * @param string $subject subject if regex
+ * @param array $matches data to use in map
+ * @return self
+ */
+ function WP_MatchesMapRegex($subject, $matches) {
+ $this->_subject = $subject;
+ $this->_matches = $matches;
+ $this->output = $this->_map();
+ }
+
+ /**
+ * Substitute substring matches in subject.
+ *
+ * static helper function to ease use
+ *
+ * @access public
+ * @param string $subject subject
+ * @param array $matches data used for subsitution
+ * @return string
+ */
+ function apply($subject, $matches) {
+ $oSelf =& new WP_MatchesMapRegex($subject, $matches);
+ return $oSelf->output;
+ }
+
+ /**
+ * do the actual mapping
+ *
+ * @access private
+ * @return string
+ */
+ function _map() {
+ $callback = array(&$this, 'callback');
+ return preg_replace_callback($this->_pattern, $callback, $this->_subject);
+ }
+
+ /**
+ * preg_replace_callback hook
+ *
+ * @access public
+ * @param array $matches preg_replace regexp matches
+ * @return string
+ */
+ function callback($matches) {
+ $index = intval(substr($matches[0], 9, -1));
+ return ( isset( $this->_matches[$index] ) ? urlencode($this->_matches[$index]) : '' );
+ }
+
+}
+
+?>
*
* Process the items passed to it or the queue. Processes all dependencies.
*
- * @param mixed handles (optional) items to be processed. (void) processes queue, (string) process that item, (array of strings) process those items
+ * @param mixed $handles (optional) items to be processed. (void) processes queue, (string) process that item, (array of strings) process those items
* @return array Items that have been processed
*/
function do_items( $handles = false, $group = false ) {
- // Print the queue if nothing is passed. If a string is passed, print that script. If an array is passed, print those scripts.
+ // Print the queue if nothing is passed. If a string is passed, print that script. If an array is passed, print those scripts.
$handles = false === $handles ? $this->queue : (array) $handles;
$this->all_deps( $handles );
*
* Recursively builds array of items to process taking dependencies into account. Does NOT catch infinite loops.
*
-
- * @param mixed handles Accepts (string) dep name or (array of strings) dep names
- * @param bool recursion Used internally when function calls itself
+ *
+ * @param mixed $handles Accepts (string) dep name or (array of strings) dep names
+ * @param bool $recursion Used internally when function calls itself
*/
function all_deps( $handles, $recursion = false, $group = false ) {
if ( !$handles = (array) $handles )
*
* Adds the item only if no item of that name already exists
*
- * @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 ver (optional) Script version (used for cache busting)
+ * @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 $ver (optional) Script version (used for cache busting)
* @return array Hierarchical array of dependencies
*/
function add( $handle, $src, $deps = array(), $ver = false, $args = null ) {
*
* Adds data only if script has already been added
*
- * @param string handle Script name
- * @param string data_name Name of object in which to store extra data
- * @param array data Array of extra data
+ * @param string $handle Script name
+ * @param string $data_name Name of object in which to store extra data
+ * @param array $data Array of extra data
* @return bool success
*/
function add_data( $handle, $data_name, $data ) {
*
* Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.
*
- * @param mixed handles (optional) Scripts to be printed. (void) prints queue, (string) prints that script, (array of strings) prints those scripts.
- * @param int group (optional) If scripts were queued in groups prints this group number.
+ * @param mixed $handles (optional) Scripts to be printed. (void) prints queue, (string) prints that script, (array of strings) prints those scripts.
+ * @param int $group (optional) If scripts were queued in groups prints this group number.
* @return array Scripts that have been printed
*/
function print_scripts( $handles = false, $group = false ) {
*
* Localizes only if script has already been added
*
- * @param string handle Script name
- * @param string object_name Name of JS object to hold l10n info
- * @param array l10n Array of JS var name => localized string
+ * @param string $handle Script name
+ * @param string $object_name Name of JS object to hold l10n info
+ * @param array $l10n Array of JS var name => localized string
* @return bool Successful localization
*/
function localize( $handle, $object_name, $l10n ) {
if ( ! $this->default_dirs )
return true;
+ if ( 0 === strpos( $src, '/wp-includes/js/l10n' ) )
+ return false;
+
foreach ( (array) $this->default_dirs as $test ) {
if ( 0 === strpos($src, $test) )
return true;
+++ /dev/null
-<?php
-/**
- * Holds Most of the WordPress classes.
- *
- * Some of the other classes are contained in other files. For example, the
- * WordPress cache is in cache.php and the WordPress roles API is in
- * capabilities.php. The third party libraries are contained in their own
- * separate files.
- *
- * @package WordPress
- */
-
-/**
- * WordPress environment setup class.
- *
- * @package WordPress
- * @since 2.0.0
- */
-class WP {
- /**
- * Public query variables.
- *
- * Long list of public query variables.
- *
- * @since 2.0.0
- * @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', 'post_type');
-
- /**
- * Private query variables.
- *
- * Long list of private query variables.
- *
- * @since 2.0.0
- * @var array
- */
- var $private_query_vars = array('offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page');
-
- /**
- * Extra query variables set by the user.
- *
- * @since 2.1.0
- * @var array
- */
- var $extra_query_vars = array();
-
- /**
- * Query variables for setting up the WordPress Query Loop.
- *
- * @since 2.0.0
- * @var array
- */
- var $query_vars;
-
- /**
- * String parsed to set the query variables.
- *
- * @since 2.0.0
- * @var string
- */
- var $query_string;
-
- /**
- * Permalink or requested URI.
- *
- * @since 2.0.0
- * @var string
- */
- var $request;
-
- /**
- * Rewrite rule the request matched.
- *
- * @since 2.0.0
- * @var string
- */
- var $matched_rule;
-
- /**
- * Rewrite query the request matched.
- *
- * @since 2.0.0
- * @var string
- */
- var $matched_query;
-
- /**
- * Whether already did the permalink.
- *
- * @since 2.0.0
- * @var bool
- */
- var $did_permalink = false;
-
- /**
- * Add name to list of public query variables.
- *
- * @since 2.1.0
- *
- * @param string $qv Query variable name.
- */
- function add_query_var($qv) {
- if ( !in_array($qv, $this->public_query_vars) )
- $this->public_query_vars[] = $qv;
- }
-
- /**
- * Set the value of a query variable.
- *
- * @since 2.3.0
- *
- * @param string $key Query variable name.
- * @param mixed $value Query variable value.
- */
- function set_query_var($key, $value) {
- $this->query_vars[$key] = $value;
- }
-
- /**
- * Parse request to find correct WordPress query.
- *
- * Sets up the query variables based on the request. There are also many
- * filters and actions that can be used to further manipulate the result.
- *
- * @since 2.0.0
- *
- * @param array|string $extra_query_vars Set the extra query variables.
- */
- function parse_request($extra_query_vars = '') {
- global $wp_rewrite;
-
- $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;
- else if (! empty($extra_query_vars))
- parse_str($extra_query_vars, $this->extra_query_vars);
-
- // Process PATH_INFO, REQUEST_URI, and 404 for permalinks.
-
- // Fetch the rewrite rules.
- $rewrite = $wp_rewrite->wp_rewrite_rules();
-
- if ( ! empty($rewrite) ) {
- // If we match a rewrite rule, this will be cleared.
- $error = '404';
- $this->did_permalink = true;
-
- if ( isset($_SERVER['PATH_INFO']) )
- $pathinfo = $_SERVER['PATH_INFO'];
- else
- $pathinfo = '';
- $pathinfo_array = explode('?', $pathinfo);
- $pathinfo = str_replace("%", "%25", $pathinfo_array[0]);
- $req_uri = $_SERVER['REQUEST_URI'];
- $req_uri_array = explode('?', $req_uri);
- $req_uri = $req_uri_array[0];
- $self = $_SERVER['PHP_SELF'];
- $home_path = parse_url(home_url());
- if ( isset($home_path['path']) )
- $home_path = $home_path['path'];
- else
- $home_path = '';
- $home_path = trim($home_path, '/');
-
- // Trim path info from the end and the leading home path from the
- // front. For path info requests, this leaves us with the requesting
- // filename, if any. For 404 requests, this leaves us with the
- // requested permalink.
- $req_uri = str_replace($pathinfo, '', rawurldecode($req_uri));
- $req_uri = trim($req_uri, '/');
- $req_uri = preg_replace("|^$home_path|", '', $req_uri);
- $req_uri = trim($req_uri, '/');
- $pathinfo = trim($pathinfo, '/');
- $pathinfo = preg_replace("|^$home_path|", '', $pathinfo);
- $pathinfo = trim($pathinfo, '/');
- $self = trim($self, '/');
- $self = preg_replace("|^$home_path|", '', $self);
- $self = trim($self, '/');
-
- // The requested permalink is in $pathinfo for path info requests and
- // $req_uri for other requests.
- if ( ! empty($pathinfo) && !preg_match('|^.*' . $wp_rewrite->index . '$|', $pathinfo) ) {
- $request = $pathinfo;
- } else {
- // If the request uri is the index, blank it out so that we don't try to match it against a rule.
- if ( $req_uri == $wp_rewrite->index )
- $req_uri = '';
- $request = $req_uri;
- }
-
- $this->request = $request;
-
- // Look for matches.
- $request_match = $request;
- foreach ( (array) $rewrite as $match => $query) {
- // Don't try to match against AtomPub calls
- if ( $req_uri == 'wp-app.php' )
- break;
-
- // 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) )
- $request_match = $req_uri . '/' . $request;
-
- if ( preg_match("#^$match#", $request_match, $matches) ||
- preg_match("#^$match#", urldecode($request_match), $matches) ) {
- // Got a match.
- $this->matched_rule = $match;
-
- // Trim the query of everything up to the '?'.
- $query = preg_replace("!^.+\?!", '', $query);
-
- // Substitute the substring matches into the query.
- $query = addslashes(WP_MatchesMapRegex::apply($query, $matches));
-
- $this->matched_query = $query;
-
- // Parse the query.
- parse_str($query, $perma_query_vars);
-
- // If we're processing a 404 request, clear the error var
- // since we found something.
- if ( isset($_GET['error']) )
- unset($_GET['error']);
-
- if ( isset($error) )
- unset($error);
-
- break;
- }
- }
-
- // 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']) )
- unset($_GET['error']);
-
- if ( isset($error) )
- unset($error);
-
- if ( isset($perma_query_vars) && strpos($_SERVER['PHP_SELF'], 'wp-admin/') !== false )
- unset($perma_query_vars);
-
- $this->did_permalink = false;
- }
- }
-
- $this->public_query_vars = apply_filters('query_vars', $this->public_query_vars);
-
- foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t )
- if ( $t->query_var )
- $taxonomy_query_vars[$t->query_var] = $taxonomy;
-
- 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]) )
- $this->query_vars[$wpvar] = $this->extra_query_vars[$wpvar];
- elseif ( isset($GLOBALS[$wpvar]) )
- $this->query_vars[$wpvar] = $GLOBALS[$wpvar];
- elseif ( !empty($_POST[$wpvar]) )
- $this->query_vars[$wpvar] = $_POST[$wpvar];
- elseif ( !empty($_GET[$wpvar]) )
- $this->query_vars[$wpvar] = $_GET[$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 ( 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]) )
- $this->query_vars[$var] = $this->extra_query_vars[$var];
- elseif ( isset($GLOBALS[$var]) && '' != $GLOBALS[$var] )
- $this->query_vars[$var] = $GLOBALS[$var];
- }
-
- if ( isset($error) )
- $this->query_vars['error'] = $error;
-
- $this->query_vars = apply_filters('request', $this->query_vars);
-
- do_action_ref_array('parse_request', array(&$this));
- }
-
- /**
- * Send additional HTTP headers for caching, content type, etc.
- *
- * Sets the X-Pingback header, 404 status (if 404), Content-type. If showing
- * a feed, it will also send last-modified, etag, and 304 status if needed.
- *
- * @since 2.0.0
- */
- function send_headers() {
- $headers = array('X-Pingback' => get_bloginfo('pingback_url'));
- $status = null;
- $exit_required = false;
-
- if ( is_user_logged_in() )
- $headers = array_merge($headers, wp_get_nocache_headers());
- if ( !empty($this->query_vars['error']) && '404' == $this->query_vars['error'] ) {
- $status = 404;
- if ( !is_user_logged_in() )
- $headers = array_merge($headers, wp_get_nocache_headers());
- $headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
- } else if ( empty($this->query_vars['feed']) ) {
- $headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
- } else {
- // We're showing a feed, so WP is indeed the only thing that last changed
- if ( !empty($this->query_vars['withcomments'])
- || ( empty($this->query_vars['withoutcomments'])
- && ( !empty($this->query_vars['p'])
- || !empty($this->query_vars['name'])
- || !empty($this->query_vars['page_id'])
- || !empty($this->query_vars['pagename'])
- || !empty($this->query_vars['attachment'])
- || !empty($this->query_vars['attachment_id'])
- )
- )
- )
- $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0).' GMT';
- else
- $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT';
- $wp_etag = '"' . md5($wp_last_modified) . '"';
- $headers['Last-Modified'] = $wp_last_modified;
- $headers['ETag'] = $wp_etag;
-
- // Support for Conditional GET
- if (isset($_SERVER['HTTP_IF_NONE_MATCH']))
- $client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
- else $client_etag = false;
-
- $client_last_modified = empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? '' : trim($_SERVER['HTTP_IF_MODIFIED_SINCE']);
- // If string is empty, return 0. If not, attempt to parse into a timestamp
- $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0;
-
- // Make a timestamp for our most recent modification...
- $wp_modified_timestamp = strtotime($wp_last_modified);
-
- if ( ($client_last_modified && $client_etag) ?
- (($client_modified_timestamp >= $wp_modified_timestamp) && ($client_etag == $wp_etag)) :
- (($client_modified_timestamp >= $wp_modified_timestamp) || ($client_etag == $wp_etag)) ) {
- $status = 304;
- $exit_required = true;
- }
- }
-
- $headers = apply_filters('wp_headers', $headers, $this);
-
- if ( ! empty( $status ) )
- status_header( $status );
- foreach( (array) $headers as $name => $field_value )
- @header("{$name}: {$field_value}");
-
- if ($exit_required)
- exit();
-
- do_action_ref_array('send_headers', array(&$this));
- }
-
- /**
- * Sets the query string property based off of the query variable property.
- *
- * The 'query_string' filter is deprecated, but still works. Plugins should
- * use the 'request' filter instead.
- *
- * @since 2.0.0
- */
- function build_query_string() {
- $this->query_string = '';
- foreach ( (array) array_keys($this->query_vars) as $wpvar) {
- if ( '' != $this->query_vars[$wpvar] ) {
- $this->query_string .= (strlen($this->query_string) < 1) ? '' : '&';
- if ( !is_scalar($this->query_vars[$wpvar]) ) // Discard non-scalars.
- continue;
- $this->query_string .= $wpvar . '=' . rawurlencode($this->query_vars[$wpvar]);
- }
- }
-
- // query_string filter deprecated. Use request filter instead.
- if ( has_filter('query_string') ) { // Don't bother filtering and parsing if no plugins are hooked in.
- $this->query_string = apply_filters('query_string', $this->query_string);
- parse_str($this->query_string, $this->query_vars);
- }
- }
-
- /**
- * 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
- * WordPress environment.
- *
- * @global string $query_string Query string for the loop.
- * @global int $more Only set, if single page or post.
- * @global int $single If single page or post. Only set, if single page or post.
- *
- * @since 2.0.0
- */
- function register_globals() {
- global $wp_query;
- // Extract updated query vars back into global namespace.
- foreach ( (array) $wp_query->query_vars as $key => $value) {
- $GLOBALS[$key] = $value;
- }
-
- $GLOBALS['query_string'] = $this->query_string;
- $GLOBALS['posts'] = & $wp_query->posts;
- $GLOBALS['post'] = $wp_query->post;
- $GLOBALS['request'] = $wp_query->request;
-
- if ( is_single() || is_page() ) {
- $GLOBALS['more'] = 1;
- $GLOBALS['single'] = 1;
- }
- }
-
- /**
- * Set up the current user.
- *
- * @since 2.0.0
- */
- function init() {
- wp_get_current_user();
- }
-
- /**
- * Set up the Loop based on the query variables.
- *
- * @uses WP::$query_vars
- * @since 2.0.0
- */
- function query_posts() {
- global $wp_the_query;
- $this->build_query_string();
- $wp_the_query->query($this->query_vars);
- }
-
- /**
- * 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.
- *
- * Otherwise, issue a 200.
- *
- * @since 2.0.0
- */
- function handle_404() {
- global $wp_query;
-
- if ( !is_admin() && ( 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_tax() || is_author() ) && $wp_query->get_queried_object() && !is_paged() ) {
- if ( !is_404() )
- status_header( 200 );
- return;
- }
- $wp_query->set_404();
- status_header( 404 );
- nocache_headers();
- } elseif ( !is_404() ) {
- status_header( 200 );
- }
- }
-
- /**
- * Sets up all of the variables required by the WordPress environment.
- *
- * The action 'wp' has one parameter that references the WP object. It
- * allows for accessing the properties and methods to further manipulate the
- * object.
- *
- * @since 2.0.0
- *
- * @param string|array $query_args Passed to {@link parse_request()}
- */
- function main($query_args = '') {
- $this->init();
- $this->parse_request($query_args);
- $this->send_headers();
- $this->query_posts();
- $this->handle_404();
- $this->register_globals();
- do_action_ref_array('wp', array(&$this));
- }
-
- /**
- * PHP4 Constructor - Does nothing.
- *
- * Call main() method when ready to run setup.
- *
- * @since 2.0.0
- *
- * @return WP
- */
- function WP() {
- // Empty.
- }
-}
-
-/**
- * WordPress Error class.
- *
- * Container for checking for WordPress errors and error messages. Return
- * WP_Error and use {@link is_wp_error()} to check if this class is returned.
- * Many core WordPress functions pass this class in the event of an error and
- * if not handled properly will result in code errors.
- *
- * @package WordPress
- * @since 2.1.0
- */
-class WP_Error {
- /**
- * Stores the list of errors.
- *
- * @since 2.1.0
- * @var array
- * @access private
- */
- var $errors = array();
-
- /**
- * Stores the list of data for error codes.
- *
- * @since 2.1.0
- * @var array
- * @access private
- */
- var $error_data = array();
-
- /**
- * PHP4 Constructor - Sets up error message.
- *
- * If code parameter is empty then nothing will be done. It is possible to
- * add multiple messages to the same code, but with other methods in the
- * class.
- *
- * All parameters are optional, but if the code parameter is set, then the
- * data parameter is optional.
- *
- * @since 2.1.0
- *
- * @param string|int $code Error code
- * @param string $message Error message
- * @param mixed $data Optional. Error data.
- * @return WP_Error
- */
- function WP_Error($code = '', $message = '', $data = '') {
- if ( empty($code) )
- return;
-
- $this->errors[$code][] = $message;
-
- if ( ! empty($data) )
- $this->error_data[$code] = $data;
- }
-
- /**
- * Retrieve all error codes.
- *
- * @since 2.1.0
- * @access public
- *
- * @return array List of error codes, if avaiable.
- */
- function get_error_codes() {
- if ( empty($this->errors) )
- return array();
-
- return array_keys($this->errors);
- }
-
- /**
- * Retrieve first error code available.
- *
- * @since 2.1.0
- * @access public
- *
- * @return string|int Empty string, if no error codes.
- */
- function get_error_code() {
- $codes = $this->get_error_codes();
-
- if ( empty($codes) )
- return '';
-
- return $codes[0];
- }
-
- /**
- * Retrieve all error messages or error messages matching code.
- *
- * @since 2.1.0
- *
- * @param string|int $code Optional. Retrieve messages matching code, if exists.
- * @return array Error strings on success, or empty array on failure (if using codee parameter).
- */
- function get_error_messages($code = '') {
- // Return all messages if no code specified.
- if ( empty($code) ) {
- $all_messages = array();
- foreach ( (array) $this->errors as $code => $messages )
- $all_messages = array_merge($all_messages, $messages);
-
- return $all_messages;
- }
-
- if ( isset($this->errors[$code]) )
- return $this->errors[$code];
- else
- return array();
- }
-
- /**
- * Get single error message.
- *
- * This will get the first message available for the code. If no code is
- * given then the first code available will be used.
- *
- * @since 2.1.0
- *
- * @param string|int $code Optional. Error code to retrieve message.
- * @return string
- */
- function get_error_message($code = '') {
- if ( empty($code) )
- $code = $this->get_error_code();
- $messages = $this->get_error_messages($code);
- if ( empty($messages) )
- return '';
- return $messages[0];
- }
-
- /**
- * Retrieve error data for error code.
- *
- * @since 2.1.0
- *
- * @param string|int $code Optional. Error code.
- * @return mixed Null, if no errors.
- */
- function get_error_data($code = '') {
- if ( empty($code) )
- $code = $this->get_error_code();
-
- if ( isset($this->error_data[$code]) )
- return $this->error_data[$code];
- return null;
- }
-
- /**
- * Append more error messages to list of error messages.
- *
- * @since 2.1.0
- * @access public
- *
- * @param string|int $code Error code.
- * @param string $message Error message.
- * @param mixed $data Optional. Error data.
- */
- function add($code, $message, $data = '') {
- $this->errors[$code][] = $message;
- if ( ! empty($data) )
- $this->error_data[$code] = $data;
- }
-
- /**
- * Add data for error code.
- *
- * The error code can only contain one error data.
- *
- * @since 2.1.0
- *
- * @param mixed $data Error data.
- * @param string|int $code Error code.
- */
- function add_data($data, $code = '') {
- if ( empty($code) )
- $code = $this->get_error_code();
-
- $this->error_data[$code] = $data;
- }
-}
-
-/**
- * Check whether variable is a WordPress Error.
- *
- * Looks at the object and if a WP_Error class. Does not check to see if the
- * parent is also WP_Error, so can't inherit WP_Error and still use this
- * function.
- *
- * @since 2.1.0
- *
- * @param mixed $thing Check if unknown variable is WordPress Error object.
- * @return bool True, if WP_Error. False, if not WP_Error.
- */
-function is_wp_error($thing) {
- if ( is_object($thing) && is_a($thing, 'WP_Error') )
- return true;
- return false;
-}
-
-/**
- * A class for displaying various tree-like structures.
- *
- * Extend the Walker class to use it, see examples at the below. Child classes
- * do not need to implement all of the abstract methods in the class. The child
- * only needs to implement the methods that are needed. Also, the methods are
- * not strictly abstract in that the parameter definition needs to be followed.
- * The child classes can have additional parameters.
- *
- * @package WordPress
- * @since 2.1.0
- * @abstract
- */
-class Walker {
- /**
- * What the class handles.
- *
- * @since 2.1.0
- * @var string
- * @access public
- */
- var $tree_type;
-
- /**
- * DB fields to use.
- *
- * @since 2.1.0
- * @var array
- * @access protected
- */
- var $db_fields;
-
- /**
- * Max number of pages walked by the paged walker
- *
- * @since 2.7.0
- * @var int
- * @access protected
- */
- var $max_pages = 1;
-
- /**
- * Starts the list before the elements are added.
- *
- * Additional parameters are used in child classes. The args parameter holds
- * additional values that may be used with the child class methods. This
- * method is called at the start of the output list.
- *
- * @since 2.1.0
- * @abstract
- *
- * @param string $output Passed by reference. Used to append additional content.
- */
- function start_lvl(&$output) {}
-
- /**
- * Ends the list of after the elements are added.
- *
- * Additional parameters are used in child classes. The args parameter holds
- * additional values that may be used with the child class methods. This
- * method finishes the list at the end of output of the elements.
- *
- * @since 2.1.0
- * @abstract
- *
- * @param string $output Passed by reference. Used to append additional content.
- */
- function end_lvl(&$output) {}
-
- /**
- * Start the element output.
- *
- * Additional parameters are used in child classes. The args parameter holds
- * additional values that may be used with the child class methods. Includes
- * the element output also.
- *
- * @since 2.1.0
- * @abstract
- *
- * @param string $output Passed by reference. Used to append additional content.
- */
- function start_el(&$output) {}
-
- /**
- * Ends the element output, if needed.
- *
- * Additional parameters are used in child classes. The args parameter holds
- * additional values that may be used with the child class methods.
- *
- * @since 2.1.0
- * @abstract
- *
- * @param string $output Passed by reference. Used to append additional content.
- */
- function end_el(&$output) {}
-
- /**
- * Traverse elements to create list from elements.
- *
- * Display one element if the element doesn't have any children otherwise,
- * display the element and its children. Will only traverse up to the max
- * depth and no ignore elements under that depth. It is possible to set the
- * max depth to include all depths, see walk() method.
- *
- * This method shouldn't be called directly, use the walk() method instead.
- *
- * @since 2.5.0
- *
- * @param object $element Data object
- * @param array $children_elements List of elements to continue traversing.
- * @param int $max_depth Max depth to traverse.
- * @param int $depth Depth of current element.
- * @param array $args
- * @param string $output Passed by reference. Used to append additional content.
- * @return null Null on failure with no changes to parameters.
- */
- function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {
-
- if ( !$element )
- return;
-
- $id_field = $this->db_fields['id'];
-
- //display this element
- if ( is_array( $args[0] ) )
- $args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] );
- $cb_args = array_merge( array(&$output, $element, $depth), $args);
- call_user_func_array(array(&$this, 'start_el'), $cb_args);
-
- $id = $element->$id_field;
-
- // descend only when the depth is right and there are childrens for this element
- if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) {
-
- foreach( $children_elements[ $id ] as $child ){
-
- if ( !isset($newlevel) ) {
- $newlevel = true;
- //start the child delimiter
- $cb_args = array_merge( array(&$output, $depth), $args);
- call_user_func_array(array(&$this, 'start_lvl'), $cb_args);
- }
- $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
- }
- unset( $children_elements[ $id ] );
- }
-
- if ( isset($newlevel) && $newlevel ){
- //end the child delimiter
- $cb_args = array_merge( array(&$output, $depth), $args);
- call_user_func_array(array(&$this, 'end_lvl'), $cb_args);
- }
-
- //end this element
- $cb_args = array_merge( array(&$output, $element, $depth), $args);
- call_user_func_array(array(&$this, 'end_el'), $cb_args);
- }
-
- /**
- * Display array of elements hierarchically.
- *
- * It is a generic function which does not assume any existing order of
- * elements. max_depth = -1 means flatly display every element. max_depth =
- * 0 means display all levels. max_depth > 0 specifies the number of
- * display levels.
- *
- * @since 2.1.0
- *
- * @param array $elements
- * @param int $max_depth
- * @return string
- */
- function walk( $elements, $max_depth) {
-
- $args = array_slice(func_get_args(), 2);
- $output = '';
-
- if ($max_depth < -1) //invalid parameter
- return $output;
-
- if (empty($elements)) //nothing to walk
- return $output;
-
- $id_field = $this->db_fields['id'];
- $parent_field = $this->db_fields['parent'];
-
- // flat display
- if ( -1 == $max_depth ) {
- $empty_array = array();
- foreach ( $elements as $e )
- $this->display_element( $e, $empty_array, 1, 0, $args, $output );
- return $output;
- }
-
- /*
- * need to display in hierarchical order
- * 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.
- */
- $top_level_elements = array();
- $children_elements = array();
- foreach ( $elements as $e) {
- if ( 0 == $e->$parent_field )
- $top_level_elements[] = $e;
- else
- $children_elements[ $e->$parent_field ][] = $e;
- }
-
- /*
- * when none of the elements is top level
- * assume the first one must be root of the sub elements
- */
- if ( empty($top_level_elements) ) {
-
- $first = array_slice( $elements, 0, 1 );
- $root = $first[0];
-
- $top_level_elements = array();
- $children_elements = array();
- foreach ( $elements as $e) {
- if ( $root->$parent_field == $e->$parent_field )
- $top_level_elements[] = $e;
- else
- $children_elements[ $e->$parent_field ][] = $e;
- }
- }
-
- foreach ( $top_level_elements as $e )
- $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );
-
- /*
- * if we are displaying all levels, and remaining children_elements is not empty,
- * then we got orphans, which should be displayed regardless
- */
- if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) {
- $empty_array = array();
- foreach ( $children_elements as $orphans )
- foreach( $orphans as $op )
- $this->display_element( $op, $empty_array, 1, 0, $args, $output );
- }
-
- return $output;
- }
-
- /**
- * paged_walk() - produce a page of nested elements
- *
- * Given an array of hierarchical elements, the maximum depth, a specific page number,
- * and number of elements per page, this function first determines all top level root elements
- * belonging to that page, then lists them and all of their children in hierarchical order.
- *
- * @package WordPress
- * @since 2.7
- * @param $max_depth = 0 means display all levels; $max_depth > 0 specifies the number of display levels.
- * @param $page_num the specific page number, beginning with 1.
- * @return XHTML of the specified page of elements
- */
- function paged_walk( $elements, $max_depth, $page_num, $per_page ) {
-
- /* sanity check */
- if ( empty($elements) || $max_depth < -1 )
- return '';
-
- $args = array_slice( func_get_args(), 4 );
- $output = '';
-
- $id_field = $this->db_fields['id'];
- $parent_field = $this->db_fields['parent'];
-
- $count = -1;
- if ( -1 == $max_depth )
- $total_top = count( $elements );
- if ( $page_num < 1 || $per_page < 0 ) {
- // No paging
- $paging = false;
- $start = 0;
- if ( -1 == $max_depth )
- $end = $total_top;
- $this->max_pages = 1;
- } else {
- $paging = true;
- $start = ( (int)$page_num - 1 ) * (int)$per_page;
- $end = $start + $per_page;
- if ( -1 == $max_depth )
- $this->max_pages = ceil($total_top / $per_page);
- }
-
- // flat display
- if ( -1 == $max_depth ) {
- if ( !empty($args[0]['reverse_top_level']) ) {
- $elements = array_reverse( $elements );
- $oldstart = $start;
- $start = $total_top - $end;
- $end = $total_top - $oldstart;
- }
-
- $empty_array = array();
- foreach ( $elements as $e ) {
- $count++;
- if ( $count < $start )
- continue;
- if ( $count >= $end )
- break;
- $this->display_element( $e, $empty_array, 1, 0, $args, $output );
- }
- return $output;
- }
-
- /*
- * 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.
- */
- $top_level_elements = array();
- $children_elements = array();
- foreach ( $elements as $e) {
- if ( 0 == $e->$parent_field )
- $top_level_elements[] = $e;
- else
- $children_elements[ $e->$parent_field ][] = $e;
- }
-
- $total_top = count( $top_level_elements );
- if ( $paging )
- $this->max_pages = ceil($total_top / $per_page);
- else
- $end = $total_top;
-
- if ( !empty($args[0]['reverse_top_level']) ) {
- $top_level_elements = array_reverse( $top_level_elements );
- $oldstart = $start;
- $start = $total_top - $end;
- $end = $total_top - $oldstart;
- }
- if ( !empty($args[0]['reverse_children']) ) {
- foreach ( $children_elements as $parent => $children )
- $children_elements[$parent] = array_reverse( $children );
- }
-
- foreach ( $top_level_elements as $e ) {
- $count++;
-
- //for the last page, need to unset earlier children in order to keep track of orphans
- if ( $end >= $total_top && $count < $start )
- $this->unset_children( $e, $children_elements );
-
- if ( $count < $start )
- continue;
-
- if ( $count >= $end )
- break;
-
- $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );
- }
-
- if ( $end >= $total_top && count( $children_elements ) > 0 ) {
- $empty_array = array();
- foreach ( $children_elements as $orphans )
- foreach( $orphans as $op )
- $this->display_element( $op, $empty_array, 1, 0, $args, $output );
- }
-
- return $output;
- }
-
- function get_number_of_root_elements( $elements ){
-
- $num = 0;
- $parent_field = $this->db_fields['parent'];
-
- foreach ( $elements as $e) {
- if ( 0 == $e->$parent_field )
- $num++;
- }
- return $num;
- }
-
- // unset all the children for a given top level element
- function unset_children( $e, &$children_elements ){
-
- if ( !$e || !$children_elements )
- return;
-
- $id_field = $this->db_fields['id'];
- $id = $e->$id_field;
-
- if ( !empty($children_elements[$id]) && is_array($children_elements[$id]) )
- foreach ( (array) $children_elements[$id] as $child )
- $this->unset_children( $child, $children_elements );
-
- if ( isset($children_elements[$id]) )
- unset( $children_elements[$id] );
-
- }
-}
-
-/**
- * Create HTML list of pages.
- *
- * @package WordPress
- * @since 2.1.0
- * @uses Walker
- */
-class Walker_Page extends Walker {
- /**
- * @see Walker::$tree_type
- * @since 2.1.0
- * @var string
- */
- var $tree_type = 'page';
-
- /**
- * @see Walker::$db_fields
- * @since 2.1.0
- * @todo Decouple this.
- * @var array
- */
- var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');
-
- /**
- * @see Walker::start_lvl()
- * @since 2.1.0
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param int $depth Depth of page. Used for padding.
- */
- function start_lvl(&$output, $depth) {
- $indent = str_repeat("\t", $depth);
- $output .= "\n$indent<ul class='children'>\n";
- }
-
- /**
- * @see Walker::end_lvl()
- * @since 2.1.0
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param int $depth Depth of page. Used for padding.
- */
- function end_lvl(&$output, $depth) {
- $indent = str_repeat("\t", $depth);
- $output .= "$indent</ul>\n";
- }
-
- /**
- * @see Walker::start_el()
- * @since 2.1.0
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param object $page Page data object.
- * @param int $depth Depth of page. Used for padding.
- * @param int $current_page Page ID.
- * @param array $args
- */
- function start_el(&$output, $page, $depth, $args, $current_page) {
- if ( $depth )
- $indent = str_repeat("\t", $depth);
- else
- $indent = '';
-
- extract($args, EXTR_SKIP);
- $css_class = array('page_item', 'page-item-'.$page->ID);
- if ( !empty($current_page) ) {
- $_current_page = get_page( $current_page );
- if ( isset($_current_page->ancestors) && in_array($page->ID, (array) $_current_page->ancestors) )
- $css_class[] = 'current_page_ancestor';
- if ( $page->ID == $current_page )
- $css_class[] = 'current_page_item';
- elseif ( $_current_page && $page->ID == $_current_page->post_parent )
- $css_class[] = 'current_page_parent';
- } elseif ( $page->ID == get_option('page_for_posts') ) {
- $css_class[] = 'current_page_parent';
- }
-
- $css_class = implode(' ', apply_filters('page_css_class', $css_class, $page));
-
- $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" title="' . esc_attr( wp_strip_all_tags( apply_filters( 'the_title', $page->post_title, $page->ID ) ) ) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';
-
- if ( !empty($show_date) ) {
- if ( 'modified' == $show_date )
- $time = $page->post_modified;
- else
- $time = $page->post_date;
-
- $output .= " " . mysql2date($date_format, $time);
- }
- }
-
- /**
- * @see Walker::end_el()
- * @since 2.1.0
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param object $page Page data object. Not used.
- * @param int $depth Depth of page. Not Used.
- */
- function end_el(&$output, $page, $depth) {
- $output .= "</li>\n";
- }
-
-}
-
-/**
- * Create HTML dropdown list of pages.
- *
- * @package WordPress
- * @since 2.1.0
- * @uses Walker
- */
-class Walker_PageDropdown extends Walker {
- /**
- * @see Walker::$tree_type
- * @since 2.1.0
- * @var string
- */
- var $tree_type = 'page';
-
- /**
- * @see Walker::$db_fields
- * @since 2.1.0
- * @todo Decouple this
- * @var array
- */
- var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');
-
- /**
- * @see Walker::start_el()
- * @since 2.1.0
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param object $page Page data object.
- * @param int $depth Depth of page in reference to parent pages. Used for padding.
- * @param array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element.
- */
- function start_el(&$output, $page, $depth, $args) {
- $pad = str_repeat(' ', $depth * 3);
-
- $output .= "\t<option class=\"level-$depth\" value=\"$page->ID\"";
- if ( $page->ID == $args['selected'] )
- $output .= ' selected="selected"';
- $output .= '>';
- $title = esc_html($page->post_title);
- $output .= "$pad$title";
- $output .= "</option>\n";
- }
-}
-
-/**
- * Create HTML list of categories.
- *
- * @package WordPress
- * @since 2.1.0
- * @uses Walker
- */
-class Walker_Category extends Walker {
- /**
- * @see Walker::$tree_type
- * @since 2.1.0
- * @var string
- */
- var $tree_type = 'category';
-
- /**
- * @see Walker::$db_fields
- * @since 2.1.0
- * @todo Decouple this
- * @var array
- */
- var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
-
- /**
- * @see Walker::start_lvl()
- * @since 2.1.0
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param int $depth Depth of category. Used for tab indentation.
- * @param array $args Will only append content if style argument value is 'list'.
- */
- function start_lvl(&$output, $depth, $args) {
- if ( 'list' != $args['style'] )
- return;
-
- $indent = str_repeat("\t", $depth);
- $output .= "$indent<ul class='children'>\n";
- }
-
- /**
- * @see Walker::end_lvl()
- * @since 2.1.0
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param int $depth Depth of category. Used for tab indentation.
- * @param array $args Will only append content if style argument value is 'list'.
- */
- function end_lvl(&$output, $depth, $args) {
- if ( 'list' != $args['style'] )
- return;
-
- $indent = str_repeat("\t", $depth);
- $output .= "$indent</ul>\n";
- }
-
- /**
- * @see Walker::start_el()
- * @since 2.1.0
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param object $category Category data object.
- * @param int $depth Depth of category in reference to parents.
- * @param array $args
- */
- function start_el(&$output, $category, $depth, $args) {
- extract($args);
-
- $cat_name = esc_attr( $category->name);
- $cat_name = apply_filters( 'list_cats', $cat_name, $category );
- $link = '<a href="' . get_term_link( $category, $category->taxonomy ) . '" ';
- if ( $use_desc_for_title == 0 || empty($category->description) )
- $link .= 'title="' . sprintf(__( 'View all posts filed under %s' ), $cat_name) . '"';
- else
- $link .= 'title="' . esc_attr( strip_tags( apply_filters( 'category_description', $category->description, $category ) ) ) . '"';
- $link .= '>';
- $link .= $cat_name . '</a>';
-
- if ( (! empty($feed_image)) || (! empty($feed)) ) {
- $link .= ' ';
-
- if ( empty($feed_image) )
- $link .= '(';
-
- $link .= '<a href="' . get_term_feed_link( $category->term_id, $category->taxonomy, $feed_type ) . '"';
-
- if ( empty($feed) )
- $alt = ' alt="' . sprintf(__( 'Feed for all posts filed under %s' ), $cat_name ) . '"';
- else {
- $title = ' title="' . $feed . '"';
- $alt = ' alt="' . $feed . '"';
- $name = $feed;
- $link .= $title;
- }
-
- $link .= '>';
-
- if ( empty($feed_image) )
- $link .= $name;
- else
- $link .= "<img src='$feed_image'$alt$title" . ' />';
- $link .= '</a>';
- if ( empty($feed_image) )
- $link .= ')';
- }
-
- if ( isset($show_count) && $show_count )
- $link .= ' (' . intval($category->count) . ')';
-
- if ( isset($show_date) && $show_date ) {
- $link .= ' ' . gmdate('Y-m-d', $category->last_update_timestamp);
- }
-
- if ( isset($current_category) && $current_category )
- $_current_category = get_category( $current_category );
-
- if ( 'list' == $args['style'] ) {
- $output .= "\t<li";
- $class = 'cat-item cat-item-'.$category->term_id;
- if ( isset($current_category) && $current_category && ($category->term_id == $current_category) )
- $class .= ' current-cat';
- elseif ( isset($_current_category) && $_current_category && ($category->term_id == $_current_category->parent) )
- $class .= ' current-cat-parent';
- $output .= ' class="'.$class.'"';
- $output .= ">$link\n";
- } else {
- $output .= "\t$link<br />\n";
- }
- }
-
- /**
- * @see Walker::end_el()
- * @since 2.1.0
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param object $page Not used.
- * @param int $depth Depth of category. Not used.
- * @param array $args Only uses 'list' for whether should append to output.
- */
- function end_el(&$output, $page, $depth, $args) {
- if ( 'list' != $args['style'] )
- return;
-
- $output .= "</li>\n";
- }
-
-}
-
-/**
- * Create HTML dropdown list of Categories.
- *
- * @package WordPress
- * @since 2.1.0
- * @uses Walker
- */
-class Walker_CategoryDropdown extends Walker {
- /**
- * @see Walker::$tree_type
- * @since 2.1.0
- * @var string
- */
- var $tree_type = 'category';
-
- /**
- * @see Walker::$db_fields
- * @since 2.1.0
- * @todo Decouple this
- * @var array
- */
- var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
-
- /**
- * @see Walker::start_el()
- * @since 2.1.0
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param object $category Category data object.
- * @param int $depth Depth of category. Used for padding.
- * @param array $args Uses 'selected', 'show_count', and 'show_last_update' keys, if they exist.
- */
- function start_el(&$output, $category, $depth, $args) {
- $pad = str_repeat(' ', $depth * 3);
-
- $cat_name = apply_filters('list_cats', $category->name, $category);
- $output .= "\t<option class=\"level-$depth\" value=\"".$category->term_id."\"";
- if ( $category->term_id == $args['selected'] )
- $output .= ' selected="selected"';
- $output .= '>';
- $output .= $pad.$cat_name;
- if ( $args['show_count'] )
- $output .= ' ('. $category->count .')';
- if ( $args['show_last_update'] ) {
- $format = 'Y-m-d';
- $output .= ' ' . gmdate($format, $category->last_update_timestamp);
- }
- $output .= "</option>\n";
- }
-}
-
-/**
- * Send XML response back to AJAX request.
- *
- * @package WordPress
- * @since 2.1.0
- */
-class WP_Ajax_Response {
- /**
- * Store XML responses to send.
- *
- * @since 2.1.0
- * @var array
- * @access private
- */
- var $responses = array();
-
- /**
- * PHP4 Constructor - Passes args to {@link WP_Ajax_Response::add()}.
- *
- * @since 2.1.0
- * @see WP_Ajax_Response::add()
- *
- * @param string|array $args Optional. Will be passed to add() method.
- * @return WP_Ajax_Response
- */
- function WP_Ajax_Response( $args = '' ) {
- if ( !empty($args) )
- $this->add($args);
- }
-
- /**
- * Append to XML response based on given arguments.
- *
- * The arguments that can be passed in the $args parameter are below. It is
- * also possible to pass a WP_Error object in either the 'id' or 'data'
- * argument. The parameter isn't actually optional, content should be given
- * in order to send the correct response.
- *
- * 'what' argument is a string that is the XMLRPC response type.
- * 'action' argument is a boolean or string that acts like a nonce.
- * 'id' argument can be WP_Error or an integer.
- * 'old_id' argument is false by default or an integer of the previous ID.
- * 'position' argument is an integer or a string with -1 = top, 1 = bottom,
- * html ID = after, -html ID = before.
- * 'data' argument is a string with the content or message.
- * 'supplemental' argument is an array of strings that will be children of
- * the supplemental element.
- *
- * @since 2.1.0
- *
- * @param string|array $args Override defaults.
- * @return string XML response.
- */
- function add( $args = '' ) {
- $defaults = array(
- 'what' => 'object', 'action' => false,
- 'id' => '0', 'old_id' => false,
- 'position' => 1,
- 'data' => '', 'supplemental' => array()
- );
-
- $r = wp_parse_args( $args, $defaults );
- extract( $r, EXTR_SKIP );
- $position = preg_replace( '/[^a-z0-9:_-]/i', '', $position );
-
- if ( is_wp_error($id) ) {
- $data = $id;
- $id = 0;
- }
-
- $response = '';
- if ( is_wp_error($data) ) {
- foreach ( (array) $data->get_error_codes() as $code ) {
- $response .= "<wp_error code='$code'><![CDATA[" . $data->get_error_message($code) . "]]></wp_error>";
- if ( !$error_data = $data->get_error_data($code) )
- continue;
- $class = '';
- if ( is_object($error_data) ) {
- $class = ' class="' . get_class($error_data) . '"';
- $error_data = get_object_vars($error_data);
- }
-
- $response .= "<wp_error_data code='$code'$class>";
-
- if ( is_scalar($error_data) ) {
- $response .= "<![CDATA[$error_data]]>";
- } elseif ( is_array($error_data) ) {
- foreach ( $error_data as $k => $v )
- $response .= "<$k><![CDATA[$v]]></$k>";
- }
-
- $response .= "</wp_error_data>";
- }
- } else {
- $response = "<response_data><![CDATA[$data]]></response_data>";
- }
-
- $s = '';
- if ( is_array($supplemental) ) {
- foreach ( $supplemental as $k => $v )
- $s .= "<$k><![CDATA[$v]]></$k>";
- $s = "<supplemental>$s</supplemental>";
- }
-
- if ( false === $action )
- $action = $_POST['action'];
-
- $x = '';
- $x .= "<response action='{$action}_$id'>"; // The action attribute in the xml output is formatted like a nonce action
- $x .= "<$what id='$id' " . ( false === $old_id ? '' : "old_id='$old_id' " ) . "position='$position'>";
- $x .= $response;
- $x .= $s;
- $x .= "</$what>";
- $x .= "</response>";
-
- $this->responses[] = $x;
- return $x;
- }
-
- /**
- * Display XML formatted responses.
- *
- * Sets the content type header to text/xml.
- *
- * @since 2.1.0
- */
- function send() {
- header('Content-Type: text/xml');
- echo "<?xml version='1.0' standalone='yes'?><wp_ajax>";
- foreach ( (array) $this->responses as $response )
- echo $response;
- echo '</wp_ajax>';
- die();
- }
-}
-
-/**
- * Helper class to remove the need to use eval to replace $matches[] in query strings.
- *
- * @since 2.9.0
- */
-class WP_MatchesMapRegex {
- /**
- * store for matches
- *
- * @access private
- * @var array
- */
- var $_matches;
-
- /**
- * store for mapping result
- *
- * @access public
- * @var string
- */
- var $output;
-
- /**
- * subject to perform mapping on (query string containing $matches[] references
- *
- * @access private
- * @var string
- */
- var $_subject;
-
- /**
- * regexp pattern to match $matches[] references
- *
- * @var string
- */
- var $_pattern = '(\$matches\[[1-9]+[0-9]*\])'; // magic number
-
- /**
- * constructor
- *
- * @param string $subject subject if regex
- * @param array $matches data to use in map
- * @return self
- */
- function WP_MatchesMapRegex($subject, $matches) {
- $this->_subject = $subject;
- $this->_matches = $matches;
- $this->output = $this->_map();
- }
-
- /**
- * Substitute substring matches in subject.
- *
- * static helper function to ease use
- *
- * @access public
- * @param string $subject subject
- * @param array $matches data used for subsitution
- * @return string
- */
- function apply($subject, $matches) {
- $oSelf =& new WP_MatchesMapRegex($subject, $matches);
- return $oSelf->output;
- }
-
- /**
- * do the actual mapping
- *
- * @access private
- * @return string
- */
- function _map() {
- $callback = array(&$this, 'callback');
- return preg_replace_callback($this->_pattern, $callback, $this->_subject);
- }
-
- /**
- * preg_replace_callback hook
- *
- * @access public
- * @param array $matches preg_replace regexp matches
- * @return string
- */
- function callback($matches) {
- $index = intval(substr($matches[0], 9, -1));
- return ( isset( $this->_matches[$index] ) ? urlencode($this->_matches[$index]) : '' );
- }
-
-}
-
-?>
* @since 0.71
* @see get_comment_author_link() Echoes result
*
- * @param int The ID of the comment for which to print the author's link. Optional.
+ * @param int $comment_ID The ID of the comment for which to print the author's link. Optional.
*/
function comment_author_link( $comment_ID = 0 ) {
echo get_comment_author_link( $comment_ID );
* @return int The number of comments a post has
*/
function get_comments_number( $post_id = 0 ) {
- global $id;
- $post_id = (int) $post_id;
+ $post_id = absint( $post_id );
if ( !$post_id )
- $post_id = (int) $id;
+ $post_id = get_the_ID();
$post = get_post($post_id);
if ( ! isset($post->comment_count) )
* Display the language string for the number of comments the current post has.
*
* @since 0.71
- * @uses $id
* @uses apply_filters() Calls the 'comments_number' hook on the output and number of comments respectively.
*
* @param string $zero Text for no comments
* @param string $deprecated Not used.
*/
function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) {
- global $id;
-
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '1.3' );
- $number = get_comments_number($id);
+ $number = get_comments_number();
if ( $number > 1 )
$output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __('% Comments') : $more);
*/
function get_comment_text( $comment_ID = 0 ) {
$comment = get_comment( $comment_ID );
- return apply_filters('get_comment_text', $comment->comment_content);
+ return apply_filters( 'get_comment_text', $comment->comment_content, $comment );
}
/**
* @param int $comment_ID The ID of the comment for which to print the text. Optional.
*/
function comment_text( $comment_ID = 0 ) {
- echo apply_filters('comment_text', get_comment_text() );
+ $comment = get_comment( $comment_ID );
+ echo apply_filters( 'comment_text', get_comment_text( $comment_ID ), $comment );
}
/**
* @param string $pingbacktxt The string to display for pingback type
*/
function comment_type($commenttxt = false, $trackbacktxt = false, $pingbacktxt = false) {
- if ( false === $commenttxt ) $commenttxt = _x( 'Comment', 'noun' );
- if ( false === $trackbacktxt ) $trackbacktxt = __( 'Trackback' );
- if ( false === $pingbacktxt ) $pingbacktxt = __( 'Pingback' );
+ if ( false === $commenttxt ) $commenttxt = _x( 'Comment', 'noun' );
+ if ( false === $trackbacktxt ) $trackbacktxt = __( 'Trackback' );
+ if ( false === $pingbacktxt ) $pingbacktxt = __( 'Pingback' );
$type = get_comment_type();
switch( $type ) {
case 'trackback' :
*
* @since 1.5.0
* @uses apply_filters() Calls 'trackback_url' on the resulting trackback URL
- * @uses $id
*
* @return string The trackback URL after being filtered
*/
function get_trackback_url() {
- global $id;
if ( '' != get_option('permalink_structure') ) {
$tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback');
} else {
- $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . $id;
+ $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . get_the_ID();
}
return apply_filters('trackback_url', $tb_url);
}
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '2.5' );
+ if ( false !== stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') )
+ return;
+
echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
* @since 1.5.0
* @global array $comment List of comment objects for the current post
* @uses $wpdb
- * @uses $id
* @uses $post
* @uses $withcomments Will not try to get the comments if the post has none.
*
* lists of posts
*
* @since 0.71
- * @uses $id
* @uses $wpcommentspopupfile
* @uses $wpcommentsjavascript
* @uses $post
* @return null Returns null on single posts and pages.
*/
function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) {
- global $id, $wpcommentspopupfile, $wpcommentsjavascript;
+ global $wpcommentspopupfile, $wpcommentsjavascript;
+
+ $id = get_the_ID();
- if ( false === $zero ) $zero = __( 'No Comments' );
- if ( false === $one ) $one = __( '1 Comment' );
- if ( false === $more ) $more = __( '% Comments' );
- if ( false === $none ) $none = __( 'Comments Off' );
+ if ( false === $zero ) $zero = __( 'No Comments' );
+ if ( false === $one ) $one = __( '1 Comment' );
+ if ( false === $more ) $more = __( '% Comments' );
+ if ( false === $none ) $none = __( 'Comments Off' );
$number = get_comments_number( $id );
if ( get_option('comment_registration') && !$user_ID )
$link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $login_text . '</a>';
else
- $link = "<a rel='nofollow' class='comment-reply-link' href='" . esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
+ $link = "<a class='comment-reply-link' href='" . esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>";
return apply_filters('comment_reply_link', $before . $link . $after, $args, $comment, $post);
}
* @return string Hidden input HTML for replying to comments
*/
function get_comment_id_fields() {
- global $id;
+ $id = get_the_ID();
$replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
$result = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\n";
*
* @package WordPress
* @uses Walker
- * @since unknown
+ * @since 2.7.0
*/
class Walker_Comment extends Walker {
/**
* @see Walker::$tree_type
- * @since unknown
+ * @since 2.7.0
* @var string
*/
var $tree_type = 'comment';
/**
* @see Walker::$db_fields
- * @since unknown
+ * @since 2.7.0
* @var array
*/
var $db_fields = array ('parent' => 'comment_parent', 'id' => 'comment_ID');
/**
* @see Walker::start_lvl()
- * @since unknown
+ * @since 2.7.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param int $depth Depth of comment.
/**
* @see Walker::end_lvl()
- * @since unknown
+ * @since 2.7.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param int $depth Depth of comment.
/**
* @see Walker::start_el()
- * @since unknown
+ * @since 2.7.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $comment Comment data object.
<?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()) ?>
</div>
<?php if ($comment->comment_approved == '0') : ?>
- <em><?php _e('Your comment is awaiting moderation.') ?></em>
+ <em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.') ?></em>
<br />
<?php endif; ?>
/**
* @see Walker::end_el()
- * @since unknown
+ * @since 2.7.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $comment
if ( 1 == get_option('comment_moderation') )
return false; // If moderation is set to manual
+ $comment = apply_filters( 'comment_text', $comment );
+
// Check # of external links
if ( $max_links = get_option( 'comment_max_links' ) ) {
- $num_links = preg_match_all( '/<a [^>]*href/i', apply_filters( 'comment_text', $comment ), $out );
+ $num_links = preg_match_all( '/<a [^>]*href/i', $comment, $out );
$num_links = apply_filters( 'comment_max_links_url', $num_links, $url ); // provide for counting of $url as a link
if ( $num_links >= $max_links )
return false;
* @return array List of comments.
*/
function get_comments( $args = '' ) {
- global $wpdb;
+ $query = new WP_Comment_Query;
+ return $query->query( $args );
+}
- $defaults = array(
- 'author_email' => '',
- 'ID' => '',
- 'karma' => '',
- 'number' => '',
- 'offset' => '',
- 'orderby' => '',
- 'order' => 'DESC',
- 'parent' => '',
- 'post_ID' => '',
- 'post_id' => 0,
- 'status' => '',
- 'type' => '',
- 'user_id' => '',
- );
+/**
+ * WordPress Comment Query class.
+ *
+ * @since 3.1.0
+ */
+class WP_Comment_Query {
+
+ /**
+ * Execute the query
+ *
+ * @since 3.1.0
+ *
+ * @param string|array $query_vars
+ * @return int|array
+ */
+ function query( $query_vars ) {
+ global $wpdb;
+
+ $defaults = array(
+ 'author_email' => '',
+ 'ID' => '',
+ 'karma' => '',
+ 'number' => '',
+ 'offset' => '',
+ 'orderby' => '',
+ 'order' => 'DESC',
+ 'parent' => '',
+ 'post_ID' => '',
+ 'post_id' => 0,
+ 'status' => '',
+ 'type' => '',
+ 'user_id' => '',
+ 'search' => '',
+ 'count' => false
+ );
- $args = wp_parse_args( $args, $defaults );
- extract( $args, EXTR_SKIP );
-
- // $args can be whatever, only use the args defined in defaults to compute the key
- $key = md5( serialize( compact(array_keys($defaults)) ) );
- $last_changed = wp_cache_get('last_changed', 'comment');
- if ( !$last_changed ) {
- $last_changed = time();
- wp_cache_set('last_changed', $last_changed, 'comment');
- }
- $cache_key = "get_comments:$key:$last_changed";
+ $this->query_vars = wp_parse_args( $query_vars, $defaults );
+ do_action_ref_array( 'pre_get_comments', array( &$this ) );
+ extract( $this->query_vars, EXTR_SKIP );
- if ( $cache = wp_cache_get( $cache_key, 'comment' ) ) {
- return $cache;
- }
+ // $args can be whatever, only use the args defined in defaults to compute the key
+ $key = md5( serialize( compact(array_keys($defaults)) ) );
+ $last_changed = wp_cache_get('last_changed', 'comment');
+ if ( !$last_changed ) {
+ $last_changed = time();
+ wp_cache_set('last_changed', $last_changed, 'comment');
+ }
+ $cache_key = "get_comments:$key:$last_changed";
- $post_id = absint($post_id);
+ if ( $cache = wp_cache_get( $cache_key, 'comment' ) ) {
+ return $cache;
+ }
- if ( 'hold' == $status )
- $approved = "comment_approved = '0'";
- elseif ( 'approve' == $status )
- $approved = "comment_approved = '1'";
- elseif ( 'spam' == $status )
- $approved = "comment_approved = 'spam'";
- elseif ( 'trash' == $status )
- $approved = "comment_approved = 'trash'";
- else
- $approved = "( comment_approved = '0' OR comment_approved = '1' )";
-
- $order = ( 'ASC' == $order ) ? 'ASC' : 'DESC';
-
- if ( ! empty( $orderby ) ) {
- $ordersby = is_array($orderby) ? $orderby : preg_split('/[,\s]/', $orderby);
- $ordersby = array_intersect(
- $ordersby,
- array(
- 'comment_agent',
- 'comment_approved',
- 'comment_author',
- 'comment_author_email',
- 'comment_author_IP',
- 'comment_author_url',
- 'comment_content',
- 'comment_date',
- 'comment_date_gmt',
- 'comment_ID',
- 'comment_karma',
- 'comment_parent',
- 'comment_post_ID',
- 'comment_type',
- 'user_id',
- )
- );
- $orderby = empty( $ordersby ) ? 'comment_date_gmt' : implode(', ', $ordersby);
- } else {
- $orderby = 'comment_date_gmt';
- }
+ $post_id = absint($post_id);
+
+ if ( 'hold' == $status )
+ $approved = "comment_approved = '0'";
+ elseif ( 'approve' == $status )
+ $approved = "comment_approved = '1'";
+ elseif ( 'spam' == $status )
+ $approved = "comment_approved = 'spam'";
+ elseif ( 'trash' == $status )
+ $approved = "comment_approved = 'trash'";
+ else
+ $approved = "( comment_approved = '0' OR comment_approved = '1' )";
+
+ $order = ( 'ASC' == strtoupper($order) ) ? 'ASC' : 'DESC';
+
+ if ( ! empty( $orderby ) ) {
+ $ordersby = is_array($orderby) ? $orderby : preg_split('/[,\s]/', $orderby);
+ $ordersby = array_intersect(
+ $ordersby,
+ array(
+ 'comment_agent',
+ 'comment_approved',
+ 'comment_author',
+ 'comment_author_email',
+ 'comment_author_IP',
+ 'comment_author_url',
+ 'comment_content',
+ 'comment_date',
+ 'comment_date_gmt',
+ 'comment_ID',
+ 'comment_karma',
+ 'comment_parent',
+ 'comment_post_ID',
+ 'comment_type',
+ 'user_id',
+ )
+ );
+ $orderby = empty( $ordersby ) ? 'comment_date_gmt' : implode(', ', $ordersby);
+ } else {
+ $orderby = 'comment_date_gmt';
+ }
- $number = absint($number);
- $offset = absint($offset);
+ $number = absint($number);
+ $offset = absint($offset);
- if ( !empty($number) ) {
- if ( $offset )
- $number = 'LIMIT ' . $offset . ',' . $number;
+ if ( !empty($number) ) {
+ if ( $offset )
+ $limits = 'LIMIT ' . $offset . ',' . $number;
+ else
+ $limits = 'LIMIT ' . $number;
+ } else {
+ $limits = '';
+ }
+
+ if ( $count )
+ $fields = 'COUNT(*)';
else
- $number = 'LIMIT ' . $number;
+ $fields = '*';
+
+ $join = '';
+ $where = $approved;
+
+ if ( ! empty($post_id) )
+ $where .= $wpdb->prepare( ' AND comment_post_ID = %d', $post_id );
+ if ( '' !== $author_email )
+ $where .= $wpdb->prepare( ' AND comment_author_email = %s', $author_email );
+ if ( '' !== $karma )
+ $where .= $wpdb->prepare( ' AND comment_karma = %d', $karma );
+ if ( 'comment' == $type ) {
+ $where .= " AND comment_type = ''";
+ } elseif( 'pings' == $type ) {
+ $where .= ' AND comment_type IN ("pingback", "trackback")';
+ } elseif ( ! empty( $type ) ) {
+ $where .= $wpdb->prepare( ' AND comment_type = %s', $type );
+ }
+ if ( '' !== $parent )
+ $where .= $wpdb->prepare( ' AND comment_parent = %d', $parent );
+ if ( '' !== $user_id )
+ $where .= $wpdb->prepare( ' AND user_id = %d', $user_id );
+ if ( '' !== $search )
+ $where .= $this->get_search_sql( $search, array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' ) );
- } else {
- $number = '';
+ $pieces = array( 'fields', 'join', 'where', 'orderby', 'order', 'limits' );
+ $clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
+ foreach ( $pieces as $piece )
+ $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
+
+ $query = "SELECT $fields FROM $wpdb->comments $join WHERE $where ORDER BY $orderby $order $limits";
+
+ if ( $count )
+ return $wpdb->get_var( $query );
+
+ $comments = $wpdb->get_results( $query );
+ $comments = apply_filters_ref_array( 'the_comments', array( $comments, &$this ) );
+
+ wp_cache_add( $cache_key, $comments, 'comment' );
+
+ return $comments;
}
- $post_where = '';
-
- if ( ! empty($post_id) )
- $post_where .= $wpdb->prepare( 'comment_post_ID = %d AND ', $post_id );
- if ( '' !== $author_email )
- $post_where .= $wpdb->prepare( 'comment_author_email = %s AND ', $author_email );
- if ( '' !== $karma )
- $post_where .= $wpdb->prepare( 'comment_karma = %d AND ', $karma );
- if ( 'comment' == $type )
- $post_where .= "comment_type = '' AND ";
- elseif ( ! empty( $type ) )
- $post_where .= $wpdb->prepare( 'comment_type = %s AND ', $type );
- if ( '' !== $parent )
- $post_where .= $wpdb->prepare( 'comment_parent = %d AND ', $parent );
- if ( '' !== $user_id )
- $post_where .= $wpdb->prepare( 'user_id = %d AND ', $user_id );
-
- $comments = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE $post_where $approved ORDER BY $orderby $order $number" );
- wp_cache_add( $cache_key, $comments, 'comment' );
-
- return $comments;
+ /*
+ * Used internally to generate an SQL string for searching across multiple columns
+ *
+ * @access protected
+ * @since 3.1.0
+ *
+ * @param string $string
+ * @param array $cols
+ * @return string
+ */
+ function get_search_sql( $string, $cols ) {
+ $string = esc_sql( like_escape( $string ) );
+
+ $searches = array();
+ foreach ( $cols as $col )
+ $searches[] = "$col LIKE '%$string%'";
+
+ return ' AND (' . implode(' OR ', $searches) . ')';
+ }
}
/**
* @link http://codex.wordpress.org/Function_Reference/add_comment_meta
*
* @param int $comment_id Comment ID.
- * @param string $key Metadata name.
- * @param mixed $value Metadata value.
+ * @param string $meta_key Metadata name.
+ * @param mixed $meta_value Metadata value.
* @param bool $unique Optional, default is false. Whether the same key should not be added.
* @return bool False for failure. True for success.
*/
* @link http://codex.wordpress.org/Function_Reference/update_comment_meta
*
* @param int $comment_id Comment ID.
- * @param string $key Metadata key.
- * @param mixed $value Metadata value.
+ * @param string $meta_key Metadata key.
+ * @param mixed $meta_value Metadata value.
* @param mixed $prev_value Optional. Previous value to check before removing.
* @return bool False on failure, true if success.
*/
$approved = 'spam';
}
- $approved = apply_filters('pre_comment_approved', $approved);
+ $approved = apply_filters( 'pre_comment_approved', $approved, $commentdata );
return $approved;
}
// Call the hooks
if ( $new_status != $old_status ) {
do_action('transition_comment_status', $new_status, $old_status, $comment);
- do_action("comment_${old_status}_to_$new_status", $comment);
+ do_action("comment_{$old_status}_to_{$new_status}", $comment);
}
- do_action("comment_${new_status}_$comment->comment_type", $comment->comment_ID, $comment);
+ do_action("comment_{$new_status}_{$comment->comment_type}", $comment->comment_ID, $comment);
}
/**
if ( isset($_COOKIE['comment_author_url_'.COOKIEHASH]) )
$comment_author_url = $_COOKIE['comment_author_url_'.COOKIEHASH];
- return compact('comment_author', 'comment_author_email', 'comment_author_url');
+ return apply_filters('wp_get_current_commenter', compact('comment_author', 'comment_author_email', 'comment_author_url'));
}
/**
* and whether comment is approved by WordPress. Also has 'preprocess_comment'
* filter for processing the comment data before the function handles it.
*
+ * We use REMOTE_ADDR here directly. If you are behind a proxy, you should ensure
+ * that it is properly set, such as in wp-config.php, for your environment.
+ * See {@link http://core.trac.wordpress.org/ticket/9235}
+ *
* @since 1.5.0
* @uses apply_filters() Calls 'preprocess_comment' hook on $commentdata parameter array before processing
* @uses do_action() Calls 'comment_post' hook on $comment_ID returned from adding the comment and if the comment was approved.
$post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment
if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) )
- wp_notify_postauthor($comment_ID, empty( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' );
+ wp_notify_postauthor($comment_ID, isset( $commentdata['comment_type'] ) ? $commentdata['comment_type'] : '' );
}
return $comment_ID;
function pingback($content, $post_ID) {
global $wp_version;
include_once(ABSPATH . WPINC . '/class-IXR.php');
+ include_once(ABSPATH . WPINC . '/class-wp-http-ixr-client.php');
// original code by Mort (http://mort.mine.nu:8080)
$post_links = array();
if ( $test = @parse_url($link_test) ) {
if ( isset($test['query']) )
$post_links[] = $link_test;
- elseif ( ($test['path'] != '/') && ($test['path'] != '') )
+ elseif ( isset( $test['path'] ) && ( $test['path'] != '/' ) && ( $test['path'] != '' ) )
$post_links[] = $link_test;
}
endif;
do_action_ref_array('pre_ping', array(&$post_links, &$pung));
foreach ( (array) $post_links as $pagelinkedto ) {
- $pingback_server_url = discover_pingback_server_uri($pagelinkedto, 2048);
+ $pingback_server_url = discover_pingback_server_uri( $pagelinkedto );
if ( $pingback_server_url ) {
@ set_time_limit( 60 );
$pagelinkedfrom = get_permalink($post_ID);
// using a timeout of 3 seconds should be enough to cover slow servers
- $client = new IXR_Client($pingback_server_url);
+ $client = new WP_HTTP_IXR_Client($pingback_server_url);
$client->timeout = 3;
$client->useragent = apply_filters( 'pingback_useragent', $client->useragent . ' -- WordPress/' . $wp_version, $client->useragent, $pingback_server_url, $pagelinkedto, $pagelinkedfrom);
// when set to true, this outputs debug messages by itself
if ( is_wp_error( $response ) )
return;
- $tb_url = addslashes( $trackback_url );
- $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', '$tb_url') WHERE ID = %d", $ID) );
- return $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, '$tb_url', '')) WHERE ID = %d", $ID) );
+ $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', %s) WHERE ID = %d", $trackback_url, $ID) );
+ return $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d", $trackback_url, $ID) );
}
/**
function weblog_ping($server = '', $path = '') {
global $wp_version;
include_once(ABSPATH . WPINC . '/class-IXR.php');
+ include_once(ABSPATH . WPINC . '/class-wp-http-ixr-client.php');
// using a timeout of 3 seconds should be enough to cover slow servers
- $client = new IXR_Client($server, ((!strlen(trim($path)) || ('/' == $path)) ? false : $path));
+ $client = new WP_HTTP_IXR_Client($server, ((!strlen(trim($path)) || ('/' == $path)) ? false : $path));
$client->timeout = 3;
$client->useragent .= ' -- WordPress/'.$wp_version;
* @package WordPress
* @subpackage Cache
*
- * @param int|array $id Comment ID or array of comment IDs to remove from cache
+ * @param int|array $ids Comment ID or array of comment IDs to remove from cache
*/
function clean_comment_cache($ids) {
foreach ( (array) $ids as $id )
wp_cache_delete($id, 'comment');
+
+ wp_cache_set('last_changed', time(), 'comment');
}
/**
return;
$crons = _get_cron_array();
- $key = md5(serialize($args));
- $crons[$timestamp][$hook][$key] = array( 'schedule' => false, 'args' => $args );
+ $event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => false, 'args' => $args );
+ $event = apply_filters('schedule_event', $event);
+
+ // A plugin disallowed this event
+ if ( ! $event )
+ return false;
+
+ $key = md5(serialize($event->args));
+
+ $crons[$event->timestamp][$event->hook][$key] = array( 'schedule' => $event->schedule, 'args' => $event->args );
uksort( $crons, "strnatcasecmp" );
_set_cron_array( $crons );
}
* Valid values for the recurrence are hourly, daily and twicedaily. These can
* be extended using the cron_schedules filter in wp_get_schedules().
*
+ * Use wp_next_scheduled() to prevent duplicates
+ *
* @since 2.1.0
*
* @param int $timestamp Timestamp for when to run the event.
function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) {
$crons = _get_cron_array();
$schedules = wp_get_schedules();
- $key = md5(serialize($args));
+
if ( !isset( $schedules[$recurrence] ) )
return false;
- $crons[$timestamp][$hook][$key] = array( 'schedule' => $recurrence, 'args' => $args, 'interval' => $schedules[$recurrence]['interval'] );
+
+ $event = (object) array( 'hook' => $hook, 'timestamp' => $timestamp, 'schedule' => $recurrence, 'args' => $args, 'interval' => $schedules[$recurrence]['interval'] );
+ $event = apply_filters('schedule_event', $event);
+
+ // A plugin disallowed this event
+ if ( ! $event )
+ return false;
+
+ $key = md5(serialize($event->args));
+
+ $crons[$event->timestamp][$event->hook][$key] = array( 'schedule' => $event->schedule, 'args' => $event->args, 'interval' => $event->interval );
uksort( $crons, "strnatcasecmp" );
_set_cron_array( $crons );
}
$now = time();
- if ( $timestamp >= $now )
- $timestamp = $now + $interval;
- else
- $timestamp = $now + ($interval - (($now - $timestamp) % $interval));
+ if ( $timestamp >= $now )
+ $timestamp = $now + $interval;
+ else
+ $timestamp = $now + ($interval - (($now - $timestamp) % $interval));
wp_schedule_event( $timestamp, $recurrence, $hook, $args );
}
// Backward compatibility
// Previously this function took the arguments as discrete vars rather than an array like the rest of the API
if ( !is_array($args) ) {
- _deprecated_argument( __FUNCTION__, '3.0.0', __('This argument has changed to an array to match the behavior of the other cron functions.') );
+ _deprecated_argument( __FUNCTION__, '3.0', __('This argument has changed to an array to match the behavior of the other cron functions.') );
$args = array_slice( func_get_args(), 1 );
}
if ( defined('DOING_CRON') || isset($_GET['doing_wp_cron']) )
return;
- /*
- * do not even start the cron if local server timer has drifted
- * such as due to power failure, or misconfiguration
- */
- $timer_accurate = check_server_timer( $local_time );
- if ( !$timer_accurate )
- return;
-
/*
* multiple processes on multiple web servers can run this code concurrently
* try to make this as atomic as possible by setting doing_cron switch
update_option( 'cron', $new_cron );
return $new_cron;
}
-
-// stub for checking server timer accuracy, using outside standard time sources
-function check_server_timer( $local_time ) {
- return true;
-}
--- /dev/null
+#wpadminbar{direction:rtl;font-family:Tahoma,Arial,sans-serif;right:0;left:auto;}#wpadminbar .quicklinks ul{text-align:right;}#wpadminbar .quicklinks ul li{float:right;}#wpadminbar .quicklinks>ul>li>a{border-left:1px solid #686868;border-right:1px solid #808080;}#wpadminbar .quicklinks>ul>li:last-child>a{border-left:none;border-right:1px solid #808080;}#wpadminbar .quicklinks>ul>li:hover>a{border-right-color:#707070;border-left-color:#686868;}#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a img{margin:-2px -5px 0 23px;}#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul{left:auto;right:30px;}#wpadminbar .quicklinks .menupop li:hover>ul,#wpadminbar .quicklinks .menupop li.hover>ul{margin-right:100%;margin-left:0;}#wpadminbar .quicklinks .menupop a>span{background:url(../images/admin-bar-sprite-rtl.png?d=11122010) left -58px no-repeat;padding-right:0;padding-left:.8em;}#wpadminbar .quicklinks .menupop ul li a>span{background:url(../images/admin-bar-sprite-rtl.png?d=11122010) left -29px no-repeat;padding-right:0;padding-left:1.5em;}#wpadminbar .quicklinks a{font-family:Tahoma,Arial,Helvetica,sans-serif;}#wpadminbar .quicklinks .menupop li a img.blavatar{margin-right:0;margin-left:8px;}#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar>a{background:url(../images/admin-bar-sprite-rtl.png?d=11122010) top right no-repeat;}#wpadminbar .quicklinks li#wp-admin-bar-my-account>a,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar>a{border-right:none;border-left:1px solid #686868;}#wpadminbar #adminbarsearch{float:left;}#wpadminbar #adminbarsearch .adminbar-input{float:right;font-family:Tahoma,Arial,Helvetica,sans-serif;margin-right:0;margin-left:3px;-moz-box-shadow:inset 2px -2px 1px #cdcdcd;-webkit-box-shadow:inset -2px 2px 1px #cdcdcd;box-shadow:inset 2px -2px 1px #cdcdcd;}#wpadminbar #adminbarsearch .adminbar-button{float:right;font-family:Tahoma,Arial,Helvetica,sans-serif;}
\ No newline at end of file
--- /dev/null
+#wpadminbar {
+ direction: rtl;
+ font-family: Tahoma, Arial ,sans-serif;
+ right: 0;
+ left: auto;
+}
+
+#wpadminbar .quicklinks ul {
+ text-align: right;
+}
+
+#wpadminbar .quicklinks ul li {
+ float: right;
+}
+
+#wpadminbar .quicklinks > ul > li > a {
+ border-left: 1px solid #686868;
+ border-right: 1px solid #808080;
+}
+
+#wpadminbar .quicklinks > ul > li:last-child > a {
+ border-left: none;
+ border-right: 1px solid #808080;
+}
+
+#wpadminbar .quicklinks > ul > li:hover > a {
+ border-right-color: #707070;
+ border-left-color: #686868;
+}
+
+#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a img {
+ margin: -2px -5px 0 23px;
+}
+
+#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul {
+ left: auto;
+ right: 30px;
+}
+
+#wpadminbar .quicklinks .menupop li:hover > ul,
+#wpadminbar .quicklinks .menupop li.hover > ul {
+ margin-right: 100%;
+ margin-left: 0;
+}
+
+#wpadminbar .quicklinks .menupop a > span {
+ background: url(../images/admin-bar-sprite-rtl.png?d=11122010) left -58px no-repeat;
+ padding-right: 0;
+ padding-left: .8em;
+}
+
+#wpadminbar .quicklinks .menupop ul li a > span {
+ background: url(../images/admin-bar-sprite-rtl.png?d=11122010) left -29px no-repeat;
+ padding-right: 0;
+ padding-left: 1.5em;
+}
+
+#wpadminbar .quicklinks a {
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+}
+
+#wpadminbar .quicklinks .menupop li a img.blavatar {
+ margin-right: 0;
+ margin-left: 8px;
+}
+
+#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar > a {
+ background: url(../images/admin-bar-sprite-rtl.png?d=11122010) top right no-repeat;
+}
+
+#wpadminbar .quicklinks li#wp-admin-bar-my-account > a,
+#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar > a {
+ border-right: none;
+ border-left: 1px solid #686868;
+}
+
+#wpadminbar #adminbarsearch {
+ float: left;
+}
+
+#wpadminbar #adminbarsearch .adminbar-input {
+ float: right;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+ margin-right: 0;
+ margin-left: 3px;
+ -moz-box-shadow: inset 2px -2px 1px #cdcdcd;
+ -webkit-box-shadow: inset -2px 2px 1px #cdcdcd;
+ box-shadow: inset 2px -2px 1px #cdcdcd;
+}
+
+#wpadminbar #adminbarsearch .adminbar-button {
+ float: right;
+ font-family: Tahoma, Arial, Helvetica, sans-serif;
+}
--- /dev/null
+#wpadminbar *{height:auto;width:auto;margin:0;padding:0;position:static;text-transform:none;letter-spacing:normal;line-height:1;}#wpadminbar :before,#wpadminbar :after{content:normal;}#wpadminbar a,#wpadminbar a:hover,#wpadminbar a img,#wpadminbar a img:hover{outline:none;border:none;text-decoration:none;background:none;}#wpadminbar{direction:ltr;background-color:#777;background-image:-moz-linear-gradient(bottom,#666,#7f7f7f);background-image:-webkit-gradient(linear,left bottom,left top,from(#666),to(#7f7f7f));color:#ddd;font:normal 12px/28px Arial,Helvetica,sans-serif;height:28px;position:fixed;top:0;left:0;width:100%;z-index:99999;min-width:960px;}#wpadminbar ul,#wpadminbar ul li{background:none;list-style:none;margin:0;padding:0;position:relative;z-index:99999;}#wpadminbar .quicklinks ul{text-align:left;}#wpadminbar .quicklinks ul li{float:left;}#wpadminbar .quicklinks>ul>li>a{border-right:1px solid #686868;border-left:1px solid #808080;}#wpadminbar .quicklinks>ul>li:last-child>a{border-right:none;}#wpadminbar .quicklinks>ul>li:hover>a{border-left-color:#707070;}#wpadminbar .quicklinks a,#wpadminbar .shortlink-input{color:#ddd;height:28px;text-shadow:#555 0 -1px 0;display:block;font:normal 13px/28px Arial,Helvetica,sans-serif;padding:0 .85em;margin:0;}#wpadminbar .quicklinks a>span{line-height:28px;}#wpadminbar .quicklinks .menupop ul,#wpadminbar .shortlink-input{-moz-box-shadow:0 4px 8px rgba(0,0,0,0.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,0.1);box-shadow:0 4px 8px rgba(0,0,0,0.1);background:#fff;background:rgba(255,255,255,0.97);display:none;position:absolute;border:1px solid #dfdfdf;border-top:none;float:none;}#wpadminbar .selected .shortlink-input{display:block;}#wpadminbar .quicklinks .menupop ul li{float:none;}#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .shortlink-input{color:#555;text-shadow:none;white-space:nowrap;min-width:140px;}#wpadminbar .shortlink-input{width:200px;}#wpadminbar .quicklinks .menupop ul li:hover>a{color:#fff;text-shadow:#666 0 -1px 0;}#wpadminbar .quicklinks li:hover>ul,#wpadminbar .quicklinks li.hover>ul{display:block;}#wpadminbar .quicklinks .menupop li:hover>ul,#wpadminbar .quicklinks .menupop li.hover>ul{margin-left:100%;margin-top:-28px;}#wpadminbar .quicklinks li:hover,#wpadminbar .quicklinks .selected{background:#555;background:-moz-linear-gradient(bottom,#555,#3e3e3e);background:-webkit-gradient(linear,left bottom,left top,from(#555),to(#3e3e3e));}#wpadminbar .quicklinks .menupop li:hover{background:#888;background:-moz-linear-gradient(bottom,#888,#9d9d9d);background:-webkit-gradient(linear,left bottom,left top,from(#888),to(#9d9d9d));}#wpadminbar .quicklinks .menupop a>span{display:inline;background:url(../images/admin-bar-sprite.png?d=11122010) right -58px no-repeat;padding-right:.8em;}#wpadminbar .quicklinks .menupop ul li a>span{display:block;background:url(../images/admin-bar-sprite.png?d=11122010) right -29px no-repeat;padding-right:1.5em;}#wpadminbar .quicklinks a span#ab-awaiting-mod,#wpadminbar .quicklinks a span#ab-updates{background:#eee;color:#333;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:bold;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;}#wpadminbar .quicklinks a:hover span#ab-awaiting-mod,#wpadminbar .quicklinks a:hover span#ab-updates{background:#fff;color:#000;}#wpadminbar .quicklinks li#wp-admin-bar-my-account>a{border-left:none;}#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar>a{border-left:none;background:url(../images/admin-bar-sprite.png?d=11122010) top left no-repeat;}#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar>a img{display:inline;border:1px solid #999;vertical-align:middle;margin:-2px 23px 0 -5px;padding:0;background:#eee;float:none;}#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul{left:30px;}#wpadminbar .quicklinks .menupop li a img.blavatar{vertical-align:middle;margin:0 8px 0 0;padding:0;}#wpadminbar #adminbarsearch{float:right;height:18px;padding:3px;margin:0;}#wpadminbar #adminbarsearch .adminbar-input{width:140px;height:auto;float:left;font:12px Arial,Helvetica,sans-serif;color:#555;text-shadow:0 1px 0 #fff;border:1px solid #626262;padding:2px 3px;margin:0 3px 0 0;background:#ddd;-moz-box-shadow:inset 2px 2px 1px #cdcdcd;-webkit-box-shadow:inset 2px 2px 1px #cdcdcd;box-shadow:inset 2px 2px 1px #cdcdcd;-webkit-border-radius:0;-khtml-border-radius:0;-moz-border-radius:0;border-radius:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;outline:none;}#wpadminbar #adminbarsearch .adminbar-button{font:bold 12px Arial,Helvetica,sans-serif;color:#444;text-shadow:0 1px 0 #eee;cursor:pointer;float:left;background:#aaa;background:-moz-linear-gradient(bottom,#aaa,#cecece);background:-webkit-gradient(linear,left bottom,left top,from(#aaa),to(#cecece));-webkit-border-radius:10px;-khtml-border-radius:10px;-moz-border-radius:10px;border-radius:10px;border:1px solid #626262;padding:2px 13px;margin:0;width:auto;height:auto;}#wpadminbar #adminbarsearch .adminbar-button:active{background:#a0a0a0;background:-moz-linear-gradient(bottom,#a0a0a0,#c1c1c1);background:-webkit-gradient(linear,left bottom,left top,from(#a0a0a0),to(#c1c1c1));-moz-box-shadow:inset 1px 1px 1px #9b9b9b;-webkit-box-shadow:inset 1px 1px 1px #9b9b9b;box-shadow:inset 1px 1px 1px #9b9b9b;}#wpadminbar #adminbarsearch .adminbar-button:hover{color:#000;}#wpadminbar #adminbarsearch .adminbar-button::-moz-focus-inner{border:none;}* html #wpadminbar{overflow:hidden;position:absolute;}* html #wpadminbar .quicklinks ul li a{float:left;}* html #wpadminbar .menupop a span{background-image:none;}
\ No newline at end of file
--- /dev/null
+#wpadminbar * {
+ height: auto;
+ width: auto;
+ margin: 0;
+ padding: 0;
+ position: static;
+ text-transform: none;
+ letter-spacing: normal;
+ line-height: 1;
+}
+
+#wpadminbar :before,
+#wpadminbar :after {
+ content: normal;
+}
+
+#wpadminbar a,
+#wpadminbar a:hover,
+#wpadminbar a img,
+#wpadminbar a img:hover {
+ outline: none;
+ border: none;
+ text-decoration: none;
+ background: none;
+}
+
+#wpadminbar {
+ direction: ltr;
+ background-color: #777;
+ background-image: -moz-linear-gradient(bottom, #666, #7f7f7f);
+ background-image: -webkit-gradient(linear, left bottom, left top, from(#666), to(#7f7f7f));
+ color: #ddd;
+ font: normal 12px/28px Arial, Helvetica, sans-serif;
+ height: 28px;
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ z-index: 99999;
+ min-width: 960px;
+}
+
+#wpadminbar ul,
+#wpadminbar ul li {
+ background: none;
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ position: relative;
+ z-index: 99999;
+}
+
+#wpadminbar .quicklinks ul {
+ text-align: left;
+}
+
+#wpadminbar .quicklinks ul li {
+ float: left;
+}
+
+#wpadminbar .quicklinks > ul > li > a {
+ border-right: 1px solid #686868;
+ border-left: 1px solid #808080;
+}
+
+#wpadminbar .quicklinks > ul > li:last-child > a {
+ border-right: none;
+}
+
+#wpadminbar .quicklinks > ul > li:hover > a {
+ border-left-color: #707070;
+}
+
+#wpadminbar .quicklinks a,
+#wpadminbar .shortlink-input {
+ color: #ddd;
+ height: 28px;
+ text-shadow: #555 0px -1px 0px;
+ display: block;
+ font: normal 13px/28px Arial, Helvetica, sans-serif;
+ padding: 0 0.85em;
+ margin: 0;
+}
+
+#wpadminbar .quicklinks a > span {
+ line-height: 28px;
+}
+
+#wpadminbar .quicklinks .menupop ul,
+#wpadminbar .shortlink-input {
+ -moz-box-shadow: 0 4px 8px rgba(0,0,0,0.1);
+ -webkit-box-shadow: 0 4px 8px rgba(0,0,0,0.1);
+ box-shadow: 0 4px 8px rgba(0,0,0,0.1);
+ background: #fff;
+ background: rgba(255,255,255,0.97);
+ display: none;
+ position: absolute;
+ border: 1px solid #dfdfdf;
+ border-top: none;
+ float: none;
+}
+
+#wpadminbar .selected .shortlink-input {
+ display: block;
+}
+
+#wpadminbar .quicklinks .menupop ul li {
+ float: none;
+}
+
+#wpadminbar .quicklinks .menupop ul li a,
+#wpadminbar .shortlink-input {
+ color: #555;
+ text-shadow: none;
+ white-space: nowrap;
+ min-width: 140px;
+}
+
+#wpadminbar .shortlink-input {
+ width: 200px;
+}
+
+#wpadminbar .quicklinks .menupop ul li:hover > a {
+ color: #fff;
+ text-shadow: #666 0px -1px 0px;
+}
+
+#wpadminbar .quicklinks li:hover > ul,
+#wpadminbar .quicklinks li.hover > ul {
+ display: block;
+}
+
+#wpadminbar .quicklinks .menupop li:hover > ul,
+#wpadminbar .quicklinks .menupop li.hover > ul {
+ margin-left: 100%;
+ margin-top: -28px;
+}
+
+#wpadminbar .quicklinks li:hover,
+#wpadminbar .quicklinks .selected {
+ background: #555;
+ background: -moz-linear-gradient(bottom, #555, #3e3e3e);
+ background: -webkit-gradient(linear, left bottom, left top, from(#555), to(#3e3e3e));
+}
+
+#wpadminbar .quicklinks .menupop li:hover {
+ background: #888;
+ background: -moz-linear-gradient(bottom, #888, #9d9d9d);
+ background: -webkit-gradient(linear, left bottom, left top, from(#888), to(#9d9d9d));
+}
+
+#wpadminbar .quicklinks .menupop a > span {
+ display: inline;
+ background: url(../images/admin-bar-sprite.png?d=11122010) right -58px no-repeat;
+ padding-right: .8em;
+}
+
+#wpadminbar .quicklinks .menupop ul li a > span {
+ display: block;
+ background: url(../images/admin-bar-sprite.png?d=11122010) right -29px no-repeat;
+ padding-right: 1.5em;
+}
+
+#wpadminbar .quicklinks a span#ab-awaiting-mod,
+#wpadminbar .quicklinks a span#ab-updates {
+ background: #eee;
+ color: #333;
+ text-shadow: none;
+ display: inline;
+ padding: 2px 5px;
+ font-size: 10px;
+ font-weight: bold;
+ -moz-border-radius: 10px;
+ -khtml-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+}
+
+#wpadminbar .quicklinks a:hover span#ab-awaiting-mod,
+#wpadminbar .quicklinks a:hover span#ab-updates {
+ background: #fff;
+ color: #000;
+}
+
+#wpadminbar .quicklinks li#wp-admin-bar-my-account > a {
+ border-left: none;
+}
+
+#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar > a {
+ border-left: none;
+ background: url(../images/admin-bar-sprite.png?d=11122010) top left no-repeat;
+}
+
+#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar > a img {
+ display: inline;
+ border: 1px solid #999;
+ vertical-align: middle;
+ margin: -2px 23px 0 -5px;
+ padding: 0;
+ background: #eee;
+ float: none;
+}
+
+#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul {
+ left: 30px;
+}
+
+#wpadminbar .quicklinks .menupop li a img.blavatar {
+ vertical-align: middle;
+ margin: 0 8px 0 0;
+ padding: 0;
+}
+
+#wpadminbar #adminbarsearch {
+ float: right;
+ height: 18px;
+ padding: 3px;
+ margin: 0;
+}
+
+#wpadminbar #adminbarsearch .adminbar-input {
+ width: 140px;
+ height: auto;
+ float: left;
+ font: 12px Arial, Helvetica, sans-serif;
+ color: #555;
+ text-shadow: 0 1px 0 #fff;
+ border: 1px solid #626262;
+ padding: 2px 3px;
+ margin: 0 3px 0 0;
+ background: #ddd;
+ -moz-box-shadow: inset 2px 2px 1px #cdcdcd;
+ -webkit-box-shadow: inset 2px 2px 1px #cdcdcd;
+ box-shadow: inset 2px 2px 1px #cdcdcd;
+ -webkit-border-radius: 0;
+ -khtml-border-radius: 0;
+ -moz-border-radius: 0;
+ border-radius: 0;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+ outline: none;
+}
+
+#wpadminbar #adminbarsearch .adminbar-button {
+ font: bold 12px Arial, Helvetica, sans-serif;
+ color: #444;
+ text-shadow: 0px 1px 0px #eee;
+ cursor: pointer;
+ float: left;
+ background: #aaa;
+ background: -moz-linear-gradient(bottom, #aaa, #cecece);
+ background: -webkit-gradient(linear, left bottom, left top, from(#aaa), to(#cecece));
+ -webkit-border-radius: 10px;
+ -khtml-border-radius: 10px;
+ -moz-border-radius: 10px;
+ border-radius: 10px;
+ border: 1px solid #626262;
+ padding: 2px 13px;
+ margin: 0;
+ width: auto;
+ height: auto;
+}
+
+#wpadminbar #adminbarsearch .adminbar-button:active {
+ background: #a0a0a0;
+ background:-moz-linear-gradient(bottom, #a0a0a0, #c1c1c1);
+ background:-webkit-gradient(linear, left bottom, left top, from(#a0a0a0), to(#c1c1c1));
+ -moz-box-shadow: inset 1px 1px 1px #9b9b9b;
+ -webkit-box-shadow: inset 1px 1px 1px #9b9b9b;
+ box-shadow: inset 1px 1px 1px #9b9b9b;
+}
+
+#wpadminbar #adminbarsearch .adminbar-button:hover {
+ color: #000;
+}
+
+#wpadminbar #adminbarsearch .adminbar-button::-moz-focus-inner {
+ border: none;
+}
+
+
+/**
+ * IE 6-targeted rules
+ */
+* html #wpadminbar {
+ overflow: hidden;
+ position: absolute;
+}
+
+* html #wpadminbar .quicklinks ul li a {
+ float: left;
+}
+
+* html #wpadminbar .menupop a span {
+ background-image: none;
+}
--- /dev/null
+.ui-helper-hidden{display:none;}.ui-helper-hidden-accessible{position:absolute;left:-99999999px;}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none;}.ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden;}.ui-helper-clearfix{display:inline-block;}/* required comment for clearfix to work in Opera \*/ * html .ui-helper-clearfix{height:1%;}.ui-helper-clearfix{display:block;}/* end clearfix */ .ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0);}.ui-state-disabled{cursor:default!important;}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%;}.ui-resizable{position:relative;}.ui-resizable-handle{position:absolute;font-size:.1px;z-index:99999;display:block;}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none;}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0;}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0;}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%;}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%;}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px;}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px;}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px;}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px;}.wp-dialog{position:absolute;width:300px;overflow:hidden;}.wp-dialog .ui-dialog-titlebar{position:relative;}.wp-dialog .ui-dialog-titlebar-close span{display:block;margin:1px;}.wp-dialog .ui-dialog-content{position:relative;border:0;padding:0;background:none;overflow:auto;zoom:1;}.wp-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin:.5em 0 0 0;padding:.3em 1em .5em .4em;}.wp-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right;}.wp-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer;}.wp-dialog .ui-resizable-se{width:14px;height:14px;right:3px;bottom:3px;}.ui-draggable .ui-dialog-titlebar{cursor:move;}.wp-dialog{border:1px solid #999;-moz-box-shadow:0 0 16px rgba(0,0,0,0.3);-webkit-box-shadow:0 0 16px rgba(0,0,0,0.3);box-shadow:0 0 16px rgba(0,0,0,0.3);}.wp-dialog .ui-dialog-title{display:block;text-align:center;padding:1px 0 2px;}.wp-dialog .ui-dialog-titlebar{padding:0 1em;background-color:#444;font-weight:bold;font-size:11px;line-height:18px;color:#e5e5e5;}.wp-dialog{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;-khtml-border-top-right-radius:4px;border-top-right-radius:4px;}.wp-dialog .ui-dialog-titlebar{-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;-khtml-border-top-right-radius:3px;border-top-right-radius:3px;}.wp-dialog .ui-dialog-titlebar-close{position:absolute;width:29px;height:16px;top:2px;right:6px;background:url('../js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif') no-repeat -87px -16px;padding:0;}.wp-dialog .ui-dialog-titlebar-close:hover,.wp-dialog .ui-dialog-titlebar-close:focus{background-position:-87px -32px;}.ui-widget-overlay{background-color:#000;opacity:.6;filter:alpha(opacity=60);}
\ No newline at end of file
--- /dev/null
+/*
+ * jQuery UI CSS Framework @VERSION
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden { display: none; }
+.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
+.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
+.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
+.ui-helper-clearfix { display: inline-block; }
+/* required comment for clearfix to work in Opera \*/
+* html .ui-helper-clearfix { height:1%; }
+.ui-helper-clearfix { display:block; }
+/* end clearfix */
+.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled { cursor: default !important; }
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+
+/*
+ * jQuery UI Resizable
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Resizable#theming
+ */
+.ui-resizable { position: relative;}
+.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
+.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
+.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
+.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
+.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
+.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
+.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
+.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
+.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
+.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
+
+/*
+ * jQuery UI Dialog
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog#theming
+ */
+.wp-dialog { position: absolute; width: 300px; overflow: hidden; }
+.wp-dialog .ui-dialog-titlebar { position: relative; }
+.wp-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
+.wp-dialog .ui-dialog-content { position: relative; border: 0; padding: 0; background: none; overflow: auto; zoom: 1; }
+.wp-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
+.wp-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
+.wp-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
+.wp-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
+.ui-draggable .ui-dialog-titlebar { cursor: move; }
+
+
+
+/* WP jQuery Dialog Theme */
+.wp-dialog {
+ border: 1px solid #999;
+ -moz-box-shadow: 0px 0px 16px rgba( 0,0,0,0.3 );
+ -webkit-box-shadow: 0px 0px 16px rgba( 0,0,0,0.3 );
+ box-shadow: 0px 0px 16px rgba( 0,0,0,0.3 );
+}
+.wp-dialog .ui-dialog-title {
+ display: block;
+ text-align: center;
+ padding: 1px 0 2px;
+}
+.wp-dialog .ui-dialog-titlebar {
+ padding: 0 1em;
+ background-color: #444;
+ font-weight: bold;
+ font-size: 11px;
+ line-height: 18px;
+ color: #e5e5e5;
+}
+.wp-dialog {
+ -moz-border-radius-topleft: 4px;
+ -webkit-border-top-left-radius: 4px;
+ -khtml-border-top-left-radius: 4px;
+ border-top-left-radius: 4px;
+ -moz-border-radius-topright: 4px;
+ -webkit-border-top-right-radius: 4px;
+ -khtml-border-top-right-radius: 4px;
+ border-top-right-radius: 4px;
+}
+.wp-dialog .ui-dialog-titlebar {
+ -moz-border-radius-topleft: 3px;
+ -webkit-border-top-left-radius: 3px;
+ -khtml-border-top-left-radius: 3px;
+ border-top-left-radius: 3px;
+ -moz-border-radius-topright: 3px;
+ -webkit-border-top-right-radius: 3px;
+ -khtml-border-top-right-radius: 3px;
+ border-top-right-radius: 3px;
+}
+
+.wp-dialog .ui-dialog-titlebar-close {
+ position: absolute;
+ width: 29px;
+ height: 16px;
+ top: 2px;
+ right: 6px;
+ background: url('../js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif') no-repeat -87px -16px;
+ padding: 0;
+}
+.wp-dialog .ui-dialog-titlebar-close:hover,
+.wp-dialog .ui-dialog-titlebar-close:focus {
+ background-position: -87px -32px;
+}
+.ui-widget-overlay {
+ background-color: #000;
+ opacity: 0.6;
+ filter: alpha(opacity=60);
+}
\ No newline at end of file
list( $width, $height ) = wp_expand_dimensions( 425, 344, $attr['width'], $attr['height'] );
}
- return apply_filters( 'embed_googlevideo', '<embed type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=' . esc_attr($matches[2]) . '&hl=en&fs=true" style="width:' . esc_attr($width) . 'px;height:' . esc_attr($height) . 'px" allowFullScreen="true" allowScriptAccess="always"></embed>', $matches, $attr, $url, $rawattr );
+ return apply_filters( 'embed_googlevideo', '<embed type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=' . esc_attr($matches[2]) . '&hl=en&fs=true" style="width:' . esc_attr($width) . 'px;height:' . esc_attr($height) . 'px" allowFullScreen="true" allowScriptAccess="always" />', $matches, $attr, $url, $rawattr );
}
wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' );
// Strip, kses, special chars for string display
foreach ( array( 'term_name', 'comment_author_name', 'link_name', 'link_target', 'link_rel', 'user_display_name', 'user_first_name', 'user_last_name', 'user_nickname' ) as $filter ) {
- add_filter( $filter, 'sanitize_text_field' );
- add_filter( $filter, 'wp_kses_data' );
+ if ( is_admin() ) {
+ // These are expensive. Run only on admin pages for defense in depth.
+ add_filter( $filter, 'sanitize_text_field' );
+ add_filter( $filter, 'wp_kses_data' );
+ }
add_filter( $filter, '_wp_specialchars', 30 );
}
}
// Kses only for textarea admin displays
-foreach ( array( 'term_description', 'link_description', 'link_notes', 'user_description' ) as $filter ) {
- add_filter( $filter, 'wp_kses_data' );
-}
-if ( is_admin() )
+if ( is_admin() ) {
+ foreach ( array( 'term_description', 'link_description', 'link_notes', 'user_description' ) as $filter ) {
+ add_filter( $filter, 'wp_kses_data' );
+ }
add_filter( 'comment_text', 'wp_kses_post' );
+}
// Email saves
foreach ( array( 'pre_comment_author_email', 'pre_user_email' ) as $filter ) {
add_filter( $filter, 'wp_filter_kses' );
}
-// Email display
+// Email admin display
foreach ( array( 'comment_author_email', 'user_email' ) as $filter ) {
add_filter( $filter, 'sanitize_email' );
- add_filter( $filter, 'wp_kses_data' );
+ if ( is_admin() )
+ add_filter( $filter, 'wp_kses_data' );
}
// Save URL
// Display URL
foreach ( array( 'user_url', 'link_url', 'link_image', 'link_rss', 'comment_url' ) as $filter ) {
- add_filter( $filter, 'wp_strip_all_tags' );
+ if ( is_admin() )
+ add_filter( $filter, 'wp_strip_all_tags' );
add_filter( $filter, 'esc_url' );
- add_filter( $filter, 'wp_kses_data' );
+ if ( is_admin() )
+ add_filter( $filter, 'wp_kses_data' );
}
// Slugs
}
// Format WordPress
-foreach ( array( 'the_content', 'the_title', 'comment_text' ) as $filter )
+foreach ( array( 'the_content', 'the_title' ) as $filter )
add_filter( $filter, 'capital_P_dangit', 11 );
+add_filter( 'comment_text', 'capital_P_dangit', 31 );
// Format titles
foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description' ) as $filter ) {
add_filter( $filter, 'convert_chars' );
}
+// Pre save hierarchy
+add_filter( 'wp_insert_post_parent', 'wp_check_post_hierarchy_for_loops', 10, 2 );
+add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 );
+
// Display filters
add_filter( 'the_title', 'wptexturize' );
add_filter( 'the_title', 'convert_chars' );
add_filter( 'comment_excerpt', 'convert_chars' );
add_filter( 'list_cats', 'wptexturize' );
-add_filter( 'single_post_title', 'wptexturize' );
add_filter( 'wp_sprintf', 'wp_sprintf_l', 10, 2 );
add_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );
add_action( 'template_redirect', 'wp_shortlink_header', 11, 0 );
+// Login actions
+add_action( 'login_head', 'wp_print_head_scripts', 9 );
+add_action( 'login_footer', 'wp_print_footer_scripts' );
+
// Feed Generator Tags
foreach ( array( 'rss2_head', 'commentsrss2_head', 'rss_head', 'rdf_header', 'atom_head', 'comments_atom_head', 'opml_head', 'app_head' ) as $action ) {
add_action( $action, 'the_generator' );
add_action( 'admin_init', 'register_admin_color_schemes', 1);
add_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
+unset($filter, $action);
+
?>
<?php
-
/**
* Default Widgets
*
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
<p>
+ <input class="checkbox" type="checkbox" <?php echo $dropdown; ?> id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>" /> <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e('Display as dropdown'); ?></label>
+ <br/>
<input class="checkbox" type="checkbox" <?php echo $count; ?> id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>" /> <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e('Show post counts'); ?></label>
- <br />
- <input class="checkbox" type="checkbox" <?php echo $dropdown; ?> id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>" /> <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e('Display as a drop down'); ?></label>
</p>
<?php
}
function form( $instance ) {
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'text' => '' ) );
$title = strip_tags($instance['title']);
- $text = format_to_edit($instance['text']);
+ $text = esc_textarea($instance['text']);
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
<p><input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>"<?php checked( $dropdown ); ?> />
- <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e( 'Show as dropdown' ); ?></label><br />
+ <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e( 'Display as dropdown' ); ?></label><br />
<input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>"<?php checked( $count ); ?> />
<label for="<?php echo $this->get_field_id('count'); ?>"><?php _e( 'Show post counts' ); ?></label><br />
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title'], $instance, $this->id_base);
- if ( !$number = (int) $instance['number'] )
- $number = 10;
- else if ( $number < 1 )
- $number = 1;
- else if ( $number > 15 )
- $number = 15;
-
- $r = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'caller_get_posts' => 1));
+ if ( ! $number = absint( $instance['number'] ) )
+ $number = 10;
+
+ $r = new WP_Query(array('posts_per_page' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => true));
if ($r->have_posts()) :
?>
<?php echo $before_widget; ?>
function form( $instance ) {
$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
- if ( !isset($instance['number']) || !$number = (int) $instance['number'] )
- $number = 5;
+ $number = isset($instance['number']) ? absint($instance['number']) : 5;
?>
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
add_action( 'transition_comment_status', array(&$this, 'flush_widget_cache') );
}
- function recent_comments_style() { ?>
+ function recent_comments_style() {
+ if ( ! current_theme_supports( 'widgets' ) // Temp hack #14876
+ || ! apply_filters( 'show_recent_comments_widget_style', true, $this->id_base ) )
+ return;
+ ?>
<style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
<?php
}
$output = '';
$title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Comments') : $instance['title']);
- if ( ! $number = (int) $instance['number'] )
+ if ( ! $number = absint( $instance['number'] ) )
$number = 5;
- else if ( $number < 1 )
- $number = 1;
$comments = get_comments( array( 'number' => $number, 'status' => 'approve' ) );
$output .= $before_widget;
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
- $instance['number'] = (int) $new_instance['number'];
+ $instance['number'] = absint( $new_instance['number'] );
$this->flush_widget_cache();
$alloptions = wp_cache_get( 'alloptions', 'options' );
if ( empty($url) )
return;
+ // self-url destruction sequence
+ if ( $url == site_url() || $url == home_url() )
+ return;
+
$rss = fetch_feed($url);
$title = $instance['title'];
$desc = '';
$date = '';
if ( $show_date ) {
- $date = $item->get_date();
+ $date = $item->get_date( 'U' );
if ( $date ) {
- if ( $date_stamp = strtotime( $date ) )
- $date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date_stamp ) . '</span>';
- else
- $date = '';
+ $date = ' <span class="rss-date">' . date_i18n( get_option( 'date_format' ), $date ) . '</span>';
}
}
echo $before_widget;
if ( $title )
echo $before_title . $title . $after_title;
- echo '<div>';
+ echo '<div class="tagcloud">';
wp_tag_cloud( apply_filters('widget_tag_cloud_args', array('taxonomy' => $current_taxonomy) ) );
echo "</div>\n";
echo $after_widget;
* @see next_post_link()
*
* @param string $format
- * @param string $previous
+ * @param string $next
* @param string $title
* @param string $in_same_cat
- * @param int $limitprev
+ * @param int $limitnext
* @param string $excluded_categories
*/
function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') {
* @return bool|null
*/
function wp_get_linksbyname($category, $args = '') {
- _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()');
+ _deprecated_function(__FUNCTION__, '2.1', 'wp_list_bookmarks()');
$defaults = array(
'after' => '<br />',
* @deprecated Use the_permalink_rss()
* @see the_permalink_rss()
*
- * @param string $file
+ * @param string $deprecated
*/
function permalink_single_rss($deprecated = '') {
- _deprecated_function( __FUNCTION__, '0.0', 'the_permalink_rss()' );
+ _deprecated_function( __FUNCTION__, '2.3', 'the_permalink_rss()' );
the_permalink_rss();
}
* @return null|string
*/
function wp_get_links($args = '') {
- _deprecated_function( __FUNCTION__, '0.0', 'wp_list_bookmarks()' );
+ _deprecated_function( __FUNCTION__, '2.1', 'wp_list_bookmarks()' );
if ( strpos( $args, '=' ) === false ) {
$cat_id = $args;
return apply_filters('attachment_innerHTML', $innerHTML, $post->ID);
}
-/*
+/**
* Retrieve bookmark data based on ID.
*
* @since 2.0.0
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');
+ clean_user_cache( $user_id );
+ wp_cache_delete( $user_id, 'user_meta' );
if ( $cur && $cur->umeta_id )
do_action( 'deleted_usermeta', $cur->umeta_id, $user_id, $meta_key, $meta_value );
else
return false;
- wp_cache_delete($user_id, 'users');
+ clean_user_cache( $user_id );
+ wp_cache_delete( $user_id, 'user_meta' );
if ( !$cur )
do_action( 'added_usermeta', $wpdb->insert_id, $user_id, $meta_key, $meta_value );
return true;
}
+/**
+ * Get users for the blog.
+ *
+ * For setups that use the multi-blog feature. Can be used outside of the
+ * multi-blog feature.
+ *
+ * @since 2.2.0
+ * @deprecated 3.1.0
+ * @uses $wpdb WordPress database object for queries
+ * @uses $blog_id The Blog id of the blog for those that use more than one blog
+ *
+ * @param int $id Blog ID.
+ * @return array List of users that are part of that Blog ID
+ */
+function get_users_of_blog( $id = '' ) {
+ _deprecated_function( __FUNCTION__, '3.1', 'get_users()' );
+
+ global $wpdb, $blog_id;
+ if ( empty($id) )
+ $id = (int) $blog_id;
+ $blog_prefix = $wpdb->get_blog_prefix($id);
+ $users = $wpdb->get_results( "SELECT user_id, user_id AS ID, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE {$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY {$wpdb->usermeta}.user_id" );
+ return $users;
+}
+
/**
* Enable/disable automatic general feed link outputting.
*
_deprecated_function( __FUNCTION__, '3.0', 'term_exists()' );
return term_exists( $term, $taxonomy, $parent );
}
+
+/**
+ * Is the current admin page generated by a plugin?
+ *
+ * @since 1.5.0
+ * @deprecated 3.1
+ * @deprecated Use global $plugin_page and/or get_plugin_page_hookname() hooks.
+ *
+ * @global $plugin_page
+ *
+ * @return bool
+ */
+function is_plugin_page() {
+ _deprecated_function( __FUNCTION__, '3.1' );
+
+ global $plugin_page;
+
+ if ( isset($plugin_page) )
+ return true;
+
+ return false;
+}
+
+/**
+ * Update the categories cache.
+ *
+ * This function does not appear to be used anymore or does not appear to be
+ * needed. It might be a legacy function left over from when there was a need
+ * for updating the category cache.
+ *
+ * @since 1.5.0
+ * @deprecated 3.1
+ *
+ * @return bool Always return True
+ */
+function update_category_cache() {
+ _deprecated_function( __FUNCTION__, '3.1' );
+
+ return true;
+}
+
<comments><?php comments_link_feed(); ?></comments>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
<dc:creator><?php the_author() ?></dc:creator>
- <?php the_category_rss() ?>
+ <?php the_category_rss('rss2') ?>
<guid isPermaLink="false"><?php the_guid(); ?></guid>
<?php if (get_option('rss_use_excerpt')) : ?>
* @param string $feed_type The type of feed. rss2 | atom | rss | rdf
*/
function the_content_feed($feed_type = null) {
- echo get_the_content_feed();
+ echo get_the_content_feed($feed_type);
}
/**
*
* @package WordPress
* @subpackage Feed
- * @since unknown
+ * @since 2.5.0
*
* @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
*/
*
* @package WordPress
* @subpackage Feed
- * @since unknown
+ * @since 2.5.0
*
* @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
* @return bool|string false on failure or guid for comment on success.
$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)/', '/\'(\d+)/', '/(\s|\A|[([{<]|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/\b(\d+)x(\d+)\b/');
+ $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;
for ( $i = 0; $i < $stop; $i++ ) {
$curl = $textarr[$i];
- if ( !empty($curl) && '<' != $curl{0} && '[' != $curl{0}
+ if ( !empty($curl) && '<' != $curl[0] && '[' != $curl[0]
&& empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) {
// This is not a tag, nor is the texturization disabled
// static strings
* Only call _wptexturize_pushpop_element if first char is correct
* tag opening
*/
- if ('<' == $curl{0})
+ if ('<' == $curl[0])
_wptexturize_pushpop_element($curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>');
- elseif ('[' == $curl{0})
+ elseif ('[' == $curl[0])
_wptexturize_pushpop_element($curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']');
}
$pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee);
$pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee);
if ($br) {
- $pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', create_function('$matches', 'return str_replace("\n", "<WPPreserveNewline />", $matches[0]);'), $pee);
+ $pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee);
$pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks
$pee = str_replace('<WPPreserveNewline />', "\n", $pee);
}
return $pee;
}
+/**
+ * Newline preservation help function for wpautop
+ *
+ * @since 3.1.0
+ * @access private
+ * @param array $matches preg_replace_callback matches array
+ * @returns string
+ */
+function _autop_newline_preservation_helper( $matches ) {
+ return str_replace("\n", "<WPPreserveNewline />", $matches[0]);
+}
+
/**
* Don't auto-p wrap shortcodes that stand alone
*
chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',
chr(195).chr(130) => 'A', chr(195).chr(131) => 'A',
chr(195).chr(132) => 'A', chr(195).chr(133) => 'A',
- chr(195).chr(135) => 'C', chr(195).chr(136) => 'E',
- chr(195).chr(137) => 'E', chr(195).chr(138) => 'E',
- chr(195).chr(139) => 'E', chr(195).chr(140) => 'I',
- chr(195).chr(141) => 'I', chr(195).chr(142) => 'I',
- chr(195).chr(143) => 'I', chr(195).chr(145) => 'N',
+ chr(195).chr(134) => 'AE',chr(195).chr(135) => 'C',
+ chr(195).chr(136) => 'E', chr(195).chr(137) => 'E',
+ chr(195).chr(138) => 'E', chr(195).chr(139) => 'E',
+ chr(195).chr(140) => 'I', chr(195).chr(141) => 'I',
+ chr(195).chr(142) => 'I', chr(195).chr(143) => 'I',
+ chr(195).chr(144) => 'D', chr(195).chr(145) => 'N',
chr(195).chr(146) => 'O', chr(195).chr(147) => 'O',
chr(195).chr(148) => 'O', chr(195).chr(149) => 'O',
chr(195).chr(150) => 'O', chr(195).chr(153) => 'U',
chr(195).chr(154) => 'U', chr(195).chr(155) => 'U',
chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y',
- chr(195).chr(159) => 's', chr(195).chr(160) => 'a',
- chr(195).chr(161) => 'a', chr(195).chr(162) => 'a',
- chr(195).chr(163) => 'a', chr(195).chr(164) => 'a',
- chr(195).chr(165) => 'a', chr(195).chr(167) => 'c',
+ chr(195).chr(158) => 'TH',chr(195).chr(159) => 's',
+ chr(195).chr(160) => 'a', chr(195).chr(161) => 'a',
+ chr(195).chr(162) => 'a', chr(195).chr(163) => 'a',
+ chr(195).chr(164) => 'a', chr(195).chr(165) => 'a',
+ chr(195).chr(166) => 'ae',chr(195).chr(167) => 'c',
chr(195).chr(168) => 'e', chr(195).chr(169) => 'e',
chr(195).chr(170) => 'e', chr(195).chr(171) => 'e',
chr(195).chr(172) => 'i', chr(195).chr(173) => 'i',
chr(195).chr(174) => 'i', chr(195).chr(175) => 'i',
- chr(195).chr(177) => 'n', chr(195).chr(178) => 'o',
- chr(195).chr(179) => 'o', chr(195).chr(180) => 'o',
- chr(195).chr(181) => 'o', chr(195).chr(182) => 'o',
- chr(195).chr(182) => 'o', chr(195).chr(185) => 'u',
- chr(195).chr(186) => 'u', chr(195).chr(187) => 'u',
- chr(195).chr(188) => 'u', chr(195).chr(189) => 'y',
+ chr(195).chr(176) => 'd', chr(195).chr(177) => 'n',
+ chr(195).chr(178) => 'o', chr(195).chr(179) => 'o',
+ chr(195).chr(180) => 'o', chr(195).chr(181) => 'o',
+ chr(195).chr(182) => 'o', chr(195).chr(182) => 'o',
+ chr(195).chr(185) => 'u', chr(195).chr(186) => 'u',
+ chr(195).chr(187) => 'u', chr(195).chr(188) => 'u',
+ chr(195).chr(189) => 'y', chr(195).chr(190) => 'th',
chr(195).chr(191) => 'y',
// Decompositions for Latin Extended-A
chr(196).chr(128) => 'A', chr(196).chr(129) => 'a',
chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z',
chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z',
chr(197).chr(190) => 'z', chr(197).chr(191) => 's',
+ // Decompositions for Latin Extended-B
+ chr(200).chr(152) => 'S', chr(200).chr(153) => 's',
+ chr(200).chr(154) => 'T', chr(200).chr(155) => 't',
// Euro Sign
chr(226).chr(130).chr(172) => 'E',
// GBP (Pound) Sign
/**
* Sanitize username stripping out unsafe characters.
*
- * If $strict is true, only alphanumeric characters (as well as _, space, ., -,
- * @) are returned.
- * Removes tags, octets, entities, and if strict is enabled, will remove all
- * non-ASCII characters. After sanitizing, it passes the username, raw username
- * (the username in the parameter), and the strict parameter as parameters for
- * the filter.
+ * Removes tags, octets, entities, and if strict is enabled, will only keep
+ * alphanumeric, _, space, ., -, @. After sanitizing, it passes the username,
+ * raw username (the username in the parameter), and the value of $strict as
+ * parameters for the 'sanitize_user' filter.
*
* @since 2.0.0
* @uses apply_filters() Calls 'sanitize_user' hook on username, raw username,
if ( $strict )
$username = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $username );
+ $username = trim( $username );
// Consolidate contiguous whitespace
$username = preg_replace( '|\s+|', ' ', $username );
/**
* Sanitize a string key.
*
- * Keys are used as internal identifiers. They should be lowercase ASCII. Dashes and underscores are allowed.
+ * Keys are used as internal identifiers. Lowercase alphanumeric characters, dashes and underscores are allowed.
*
* @since 3.0.0
*
*/
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);
+ $key = strtolower( $key );
+ $key = preg_replace( '/[^a-z0-9_\-]/', '', $key );
+ return apply_filters( 'sanitize_key', $key, $raw_key );
}
/**
*
* @param string $title The string to be sanitized.
* @param string $fallback_title Optional. A title to use if $title is empty.
+ * @param string $context Optional. The operation for which the string is sanitized
* @return string The sanitized string.
*/
-function sanitize_title($title, $fallback_title = '') {
+function sanitize_title($title, $fallback_title = '', $context = 'save') {
$raw_title = $title;
- $title = strip_tags($title);
- $title = apply_filters('sanitize_title', $title, $raw_title);
+
+ if ( 'save' == $context )
+ $title = remove_accents($title);
+
+ $title = apply_filters('sanitize_title', $title, $raw_title, $context);
if ( '' === $title || false === $title )
$title = $fallback_title;
return $title;
}
+function sanitize_title_for_query($title) {
+ return sanitize_title($title, '', 'query');
+}
+
/**
* Sanitizes title, replacing whitespace with dashes.
*
// Restore octets.
$title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);
- $title = remove_accents($title);
if (seems_utf8($title)) {
if (function_exists('mb_strtolower')) {
$title = mb_strtolower($title, 'UTF-8');
* @since 2.0.4
*
* @author Leonard Lin <leonard@acm.org>
- * @license GPL v2.0
+ * @license GPL
* @copyright November 4, 2001
* @version 1.1
* @todo Make better - change loop condition to $text in 1.2
* Acts on text which is about to be edited.
*
* Unless $richedit is set, it is simply a holder for the 'format_to_edit'
- * filter. If $richedit is set true htmlspecialchars() will be run on the
- * content, converting special characters to HTMl entities.
+ * filter. If $richedit is set true htmlspecialchars(), through esc_textarea(),
+ * will be run on the content, converting special characters to HTML entities.
*
* @since 0.71
*
* @param bool $richedit Whether the $content should pass through htmlspecialchars(). Default false.
* @return string The text after the filter (and possibly htmlspecialchars()) has been run.
*/
-function format_to_edit($content, $richedit = false) {
- $content = apply_filters('format_to_edit', $content);
- if (! $richedit )
- $content = htmlspecialchars($content);
+function format_to_edit( $content, $richedit = false ) {
+ $content = apply_filters( 'format_to_edit', $content );
+ if ( ! $richedit )
+ $content = esc_textarea( $content );
return $content;
}
*/
function _make_url_clickable_cb($matches) {
$url = $matches[2];
+ $suffix = '';
+
+ /** Include parentheses in the URL only if paired **/
+ while ( substr_count( $url, '(' ) < substr_count( $url, ')' ) ) {
+ $suffix = strrchr( $url, ')' ) . $suffix;
+ $url = substr( $url, 0, strrpos( $url, ')' ) );
+ }
$url = esc_url($url);
if ( empty($url) )
return $matches[0];
- return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>";
+ return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>" . $suffix;
}
/**
function make_clickable($ret) {
$ret = ' ' . $ret;
// in testing, using arrays here was found to be faster
- $ret = preg_replace_callback('#(?<=[\s>])(\()?([\w]+?://(?:[\w\\x80-\\xff\#$%&~/=?@\[\](+-]|[.,;:](?![\s<]|(\))?([\s]|$))|(?(1)\)(?![\s<.,;:]|$)|\)))+)#is', '_make_url_clickable_cb', $ret);
+ $ret = preg_replace_callback('#(?<!=[\'"])(?<=[*\')+.,;:!&$\s>])(\()?([\w]+?://(?:[\w\\x80-\\xff\#%~/?@\[\]-]|[\'*(+.,;:!=&$](?![\b\)]|(\))?([\s]|$))|(?(1)\)(?![\s<.,;:]|$)|\)))+)#is', '_make_url_clickable_cb', $ret);
$ret = preg_replace_callback('#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret);
$ret = preg_replace_callback('#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret);
// this one is not in an array because we need it to run last, for cleanup of accidental links within links
return '';
}
- $siteurl = get_option( 'siteurl' );
-
$smiley = trim(reset($smiley));
$img = $wpsmiliestrans[$smiley];
$smiley_masked = esc_attr($smiley);
- $srcurl = apply_filters('smilies_src', "$siteurl/wp-includes/images/smilies/$img", $img, $siteurl);
+ $srcurl = apply_filters('smilies_src', includes_url("images/smilies/$img"), $img, site_url());
return " <img src='$srcurl' alt='$smiley_masked' class='wp-smiley' /> ";
}
$stop = count($textarr);// loop stuff
for ($i = 0; $i < $stop; $i++) {
$content = $textarr[$i];
- if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag
+ if ((strlen($content) > 0) && ('<' != $content[0])) { // If it's not a tag
$content = preg_replace_callback($wp_smiliessearch, 'translate_smiley', $content);
}
$output .= $content;
* @since 0.71
*
* @param string $email Email address to verify.
- * @param boolean $deprecated. Deprecated.
+ * @param boolean $deprecated Deprecated.
* @return string|bool Either false or the valid email address.
*/
function is_email( $email, $deprecated = false ) {
return $string;
} else {
$subject = str_replace('_', ' ', $matches[2]);
- $subject = preg_replace_callback('#\=([0-9a-f]{2})#i', create_function('$match', 'return chr(hexdec(strtolower($match[1])));'), $subject);
+ $subject = preg_replace_callback('#\=([0-9a-f]{2})#i', '_wp_iso_convert', $subject);
return $subject;
}
}
+/**
+ * Helper function to convert hex encoded chars to ascii
+ *
+ * @since 3.1.0
+ * @access private
+ * @param array $match the preg_replace_callback matches array
+ */
+function _wp_iso_convert( $match ) {
+ return chr( hexdec( strtolower( $match[1] ) ) );
+}
+
/**
* Returns a date in the GMT equivalent.
*
$sub = trim( $sub, " \t\n\r\0\x0B-" );
// Test for invalid characters
- $sub = preg_replace( '/^[^a-z0-9-]+$/i', '', $sub );
+ $sub = preg_replace( '/[^a-z0-9-]+/i', '', $sub );
// If there's anything left, add it to the valid subs
if ( '' !== $sub ) {
return apply_filters( 'attribute_escape', $safe_text, $text );
}
+/**
+ * Escaping for textarea values.
+ *
+ * @since 3.1
+ *
+ * @param string $text
+ * @return string
+ */
+function esc_textarea( $text ) {
+ $safe_text = htmlspecialchars( $text, ENT_QUOTES );
+ return apply_filters( 'esc_textarea', $safe_text, $text );
+}
+
/**
* Escape a HTML tag name.
*
$fragment = substr($pattern, $start, $end - $start);
// Fragment has a specifier
- if ( $pattern{$start} == '%' ) {
+ if ( $pattern[$start] == '%' ) {
// Find numbered arguments or take the next one in order
if ( preg_match('/^%(\d+)\$/', $fragment, $matches) ) {
$arg = isset($args[$matches[1]]) ? $args[$matches[1]] : '';
* @return string The processed content.
*/
function links_add_base_url( $content, $base, $attrs = array('src', 'href') ) {
+ global $_links_add_base;
+ $_links_add_base = $base;
$attrs = implode('|', (array)$attrs);
- return preg_replace_callback("!($attrs)=(['\"])(.+?)\\2!i",
- create_function('$m', 'return _links_add_base($m, "' . $base . '");'),
- $content);
+ return preg_replace_callback( "!($attrs)=(['\"])(.+?)\\2!i", '_links_add_base', $content );
}
/**
* @access private
*
* @param string $m The matched link.
- * @param string $base The base URL to prefix to links.
* @return string The processed link.
*/
-function _links_add_base($m, $base) {
+function _links_add_base($m) {
+ global $_links_add_base;
//1 = attribute name 2 = quotation mark 3 = URL
return $m[1] . '=' . $m[2] .
(strpos($m[3], 'http://') === false ?
- path_join($base, $m[3]) :
+ path_join($_links_add_base, $m[3]) :
$m[3])
. $m[2];
}
* @return string The processed content.
*/
function links_add_target( $content, $target = '_blank', $tags = array('a') ) {
+ global $_links_add_target;
+ $_links_add_target = $target;
$tags = implode('|', (array)$tags);
- return preg_replace_callback("!<($tags)(.+?)>!i",
- create_function('$m', 'return _links_add_target($m, "' . $target . '");'),
- $content);
+ return preg_replace_callback( "!<($tags)(.+?)>!i", '_links_add_target', $content );
}
/**
* @access private
*
* @param string $m The matched link.
- * @param string $target The Target to add to the links.
* @return string The processed link.
*/
-function _links_add_target( $m, $target ) {
+function _links_add_target( $m ) {
+ global $_links_add_target;
$tag = $m[1];
$link = preg_replace('|(target=[\'"](.*?)[\'"])|i', '', $m[2]);
- return '<' . $tag . $link . ' target="' . $target . '">';
+ return '<' . $tag . $link . ' target="' . esc_attr( $_links_add_target ) . '">';
}
// normalize EOL characters and strip duplicate whitespace
return apply_filters('sanitize_text_field', $filtered, $str);
}
+/**
+ * i18n friendly version of basename()
+ *
+ * @since 3.1.0
+ *
+ * @param string $path A path.
+ * @param string $suffix If the filename ends in suffix this will also be cut off.
+ * @return string
+ */
+function wp_basename( $path, $suffix = '' ) {
+ return urldecode( basename( str_replace( '%2F', '/', urlencode( $path ) ), $suffix ) );
+}
+
/**
* Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).
*
*
* @since 3.0.0
*/
-
function capital_P_dangit( $text ) {
// Simple replacement for titles
if ( 'the_title' === current_filter() )
if ( empty( $m ) )
return false;
- if ( 'G' == $dateformatstring ) {
+ if ( 'G' == $dateformatstring )
return strtotime( $m . ' +0000' );
- }
$i = strtotime( $m );
if ( 'U' == $dateformatstring )
return $i;
- if ( $translate)
- return date_i18n( $dateformatstring, $i );
+ if ( $translate )
+ return date_i18n( $dateformatstring, $i );
else
- return date( $dateformatstring, $i );
+ return date( $dateformatstring, $i );
}
/**
$dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
}
+ $timezone_formats = array( 'P', 'I', 'O', 'T', 'Z', 'e' );
+ $timezone_formats_re = implode( '|', $timezone_formats );
+ if ( preg_match( "/$timezone_formats_re/", $dateformatstring ) && wp_timezone_supported() ) {
+ $timezone_string = get_option( 'timezone_string' );
+ if ( $timezone_string ) {
+ $timezone_object = timezone_open( $timezone_string );
+ $date_object = date_create( null, $timezone_object );
+ foreach( $timezone_formats as $timezone_format ) {
+ if ( false !== strpos( $dateformatstring, $timezone_format ) ) {
+ $formatted = date_format( $date_object, $timezone_format );
+ $dateformatstring = ' '.$dateformatstring;
+ $dateformatstring = preg_replace( "/([^\\\])$timezone_format/", "\\1" . backslashit( $formatted ), $dateformatstring );
+ $dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
+ }
+ }
+ }
+ }
$j = @$datefunc( $dateformatstring, $i );
// allow plugins to redo this entirely for languages with untypical grammars
$j = apply_filters('date_i18n', $j, $req_format, $i, $gmt);
*/
function is_serialized( $data ) {
// if it isn't a string, it isn't serialized
- if ( !is_string( $data ) )
+ if ( ! is_string( $data ) )
return false;
$data = trim( $data );
- if ( 'N;' == $data )
+ if ( 'N;' == $data )
return true;
- if ( !preg_match( '/^([adObis]):/', $data, $badions ) )
+ $length = strlen( $data );
+ if ( $length < 4 )
+ return false;
+ if ( ':' !== $data[1] )
+ return false;
+ $lastc = $data[$length-1];
+ if ( ';' !== $lastc && '}' !== $lastc )
return false;
- switch ( $badions[1] ) {
+ $token = $data[0];
+ switch ( $token ) {
+ case 's' :
+ if ( '"' !== $data[$length-2] )
+ return false;
case 'a' :
case 'O' :
- case 's' :
- if ( preg_match( "/^{$badions[1]}:[0-9]+:.*[;}]\$/s", $data ) )
- return true;
- break;
+ return (bool) preg_match( "/^{$token}:[0-9]+:/s", $data );
case 'b' :
case 'i' :
case 'd' :
- if ( preg_match( "/^{$badions[1]}:[0-9.E-]+;\$/", $data ) )
- return true;
- break;
+ return (bool) preg_match( "/^{$token}:[0-9.E-]+;\$/", $data );
}
return false;
}
$alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" );
$wpdb->suppress_errors($suppress);
$alloptions = array();
- foreach ( (array) $alloptions_db as $o )
+ foreach ( (array) $alloptions_db as $o ) {
$alloptions[$o->option_name] = $o->option_value;
- if ( !defined( 'WP_INSTALLING' ) || !is_multisite() )
- wp_cache_add( 'alloptions', $alloptions, 'options' );
+ }
+ if ( !defined( 'WP_INSTALLING' ) || !is_multisite() )
+ wp_cache_add( 'alloptions', $alloptions, 'options' );
}
return $alloptions;
if ( empty($site_id) )
$site_id = $wpdb->siteid;
- $core_options = array('site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'dashboard_blog', 'can_compress_scripts', 'global_terms_enabled' );
+ $core_options = array('site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'can_compress_scripts', 'global_terms_enabled' );
$core_options_in = "'" . implode("', '", $core_options) . "'";
$options = $wpdb->get_results( $wpdb->prepare("SELECT meta_key, meta_value FROM $wpdb->sitemeta WHERE meta_key IN ($core_options_in) AND site_id = %d", $site_id) );
* @package WordPress
* @subpackage Option
* @since 1.0.0
- * @link http://alex.vort-x.net/blog/ Thanks Alex Stapleton
*
* @uses do_action() Calls 'add_option' hook before adding the option.
* @uses do_action() Calls 'add_option_$option' and 'added_option' hooks on success.
function delete_transient( $transient ) {
global $_wp_using_ext_object_cache;
- do_action( 'delete_transient_' . $transient, $transient );
+ do_action( 'delete_transient_' . $transient, $transient );
if ( $_wp_using_ext_object_cache ) {
$result = wp_cache_delete( $transient, 'transient' );
function set_transient( $transient, $value, $expiration = 0 ) {
global $_wp_using_ext_object_cache;
- $value = apply_filters( 'pre_set_transient_' . $transient, $value );
+ $value = apply_filters( 'pre_set_transient_' . $transient, $value );
if ( $_wp_using_ext_object_cache ) {
$result = wp_cache_set( $transient, $value, 'transient', $expiration );
*/
function do_enclose( $content, $post_ID ) {
global $wpdb;
+
+ //TODO: Tidy this ghetto code up and make the debug code optional
include_once( ABSPATH . WPINC . '/class-IXR.php' );
$log = debug_fopen( ABSPATH . 'enclosures.log', 'a' );
foreach ( $pung as $link_test ) {
if ( !in_array( $link_test, $post_links_temp[0] ) ) { // link no longer in post
- $mid = $wpdb->get_col( $wpdb->prepare("SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE (%s)", $post_ID, $link_test . '%') );
+ $mid = $wpdb->get_col( $wpdb->prepare("SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE (%s)", $post_ID, like_escape( $link_test ) . '%') );
do_action( 'delete_postmeta', $mid );
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id IN(%s)", implode( ',', $mid ) ) );
do_action( 'deleted_postmeta', $mid );
continue;
if ( isset( $test['query'] ) )
$post_links[] = $link_test;
- elseif ( $test['path'] != '/' && $test['path'] != '' )
+ elseif ( isset($test['path']) && ( $test['path'] != '/' ) && ($test['path'] != '' ) )
$post_links[] = $link_test;
}
}
foreach ( (array) $post_links as $url ) {
- if ( $url != '' && !$wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE (%s)", $post_ID, $url . '%' ) ) ) {
+ if ( $url != '' && !$wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE (%s)", $post_ID, like_escape( $url ) . '%' ) ) ) {
if ( $headers = wp_get_http_headers( $url) ) {
$len = (int) $headers['content-length'];
* @return int 1 when new day, 0 if not a new day.
*/
function is_new_day() {
- global $day, $previousday;
- if ( $day != $previousday )
+ global $currentday, $previousday;
+ if ( $currentday != $previousday )
return 1;
else
return 0;
* The several different headers cover the different ways cache prevention is handled
* by different browsers
*
- * @since 2.8
+ * @since 2.8.0
*
* @uses apply_filters()
* @return array The associative array of header names and field values.
);
if ( function_exists('apply_filters') ) {
- $headers = apply_filters('nocache_headers', $headers);
+ $headers = (array) apply_filters('nocache_headers', $headers);
}
return $headers;
}
*/
function nocache_headers() {
$headers = wp_get_nocache_headers();
- foreach( (array) $headers as $name => $field_value )
+ foreach( $headers as $name => $field_value )
@header("{$name}: {$field_value}");
}
if ( realpath($path) == $path )
return true;
- if ( strlen($path) == 0 || $path{0} == '.' )
+ if ( strlen($path) == 0 || $path[0] == '.' )
return false;
// windows allows absolute paths like this
* before the extension, and will continue adding numbers until the filename is
* unique.
*
- * The callback must accept two parameters, the first one is the directory and
- * the second is the filename. The callback must be a function.
+ * The callback is passed three parameters, the first one is the directory, the
+ * second is the filename, and the third is the extension.
*
- * @since 2.5
+ * @since 2.5.0
*
* @param string $dir
* @param string $filename
- * @param string $unique_filename_callback Function name, must be a function.
+ * @param mixed $unique_filename_callback Callback.
* @return string New filename, if given wasn't unique.
*/
function wp_unique_filename( $dir, $filename, $unique_filename_callback = null ) {
if ( $name === $ext )
$name = '';
- // Increment the file number until we have a unique file to save in $dir. Use $override['unique_filename_callback'] if supplied.
+ // Increment the file number until we have a unique file to save in $dir. Use callback if supplied.
if ( $unique_filename_callback && is_callable( $unique_filename_callback ) ) {
- $filename = $unique_filename_callback( $dir, $name );
+ $filename = call_user_func( $unique_filename_callback, $dir, $name, $ext );
} else {
$number = '';
$trans['edit']['plugin'] = array( __( 'Your attempt to edit this plugin file: “%s” has failed.' ), 'use_id' );
$trans['activate']['plugin'] = array( __( 'Your attempt to activate this plugin: “%s” has failed.' ), 'use_id' );
$trans['deactivate']['plugin'] = array( __( 'Your attempt to deactivate this plugin: “%s” has failed.' ), 'use_id' );
- $trans['upgrade']['plugin'] = array( __( 'Your attempt to upgrade this plugin: “%s” has failed.' ), 'use_id' );
+ $trans['upgrade']['plugin'] = array( __( 'Your attempt to update this plugin: “%s” has failed.' ), 'use_id' );
$trans['add']['post'] = array( __( 'Your attempt to add this post has failed.' ), false );
$trans['delete']['post'] = array( __( 'Your attempt to delete this post: “%s” has failed.' ), 'get_the_title' );
* @param string|array $args Optional arguements to control behaviour.
*/
function wp_die( $message, $title = '', $args = array() ) {
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
+ die('-1');
+
if ( function_exists( 'apply_filters' ) ) {
$function = apply_filters( 'wp_die_handler', '_default_wp_die_handler');
- }else {
+ } else {
$function = '_default_wp_die_handler';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- Ticket #11289, IE bug fix: always pad the error page with enough characters such that it is greater than 512 bytes, even after gzip compression abcdefghijklmnopqrstuvwxyz1234567890aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz11223344556677889900abacbcbdcdcededfefegfgfhghgihihjijikjkjlklkmlmlnmnmononpopoqpqprqrqsrsrtstsubcbcdcdedefefgfabcadefbghicjkldmnoepqrfstugvwxhyz1i234j567k890laabmbccnddeoeffpgghqhiirjjksklltmmnunoovppqwqrrxsstytuuzvvw0wxx1yyz2z113223434455666777889890091abc2def3ghi4jkl5mno6pqr7stu8vwx9yz11aab2bcc3dd4ee5ff6gg7hh8ii9j0jk1kl2lmm3nnoo4p5pq6qrr7ss8tt9uuvv0wwx1x2yyzz13aba4cbcb5dcdc6dedfef8egf9gfh0ghg1ihi2hji3jik4jkj5lkl6kml7mln8mnm9ono -->
-<html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) ) language_attributes(); ?>>
+<html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) && function_exists( 'is_rtl' ) ) language_attributes(); else echo "dir='$text_direction'"; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title ?></title>
return array_unique(array_map('absint', $list));
}
+/**
+ * Extract a slice of an array, given a list of keys
+ *
+ * @since 3.1.0
+ *
+ * @param array $array The original array
+ * @param array $keys The list of keys
+ * @return array The array slice
+ */
+function wp_array_slice_assoc( $array, $keys ) {
+ $slice = array();
+ foreach ( $keys as $key )
+ if ( isset( $array[ $key ] ) )
+ $slice[ $key ] = $array[ $key ];
+
+ return $slice;
+}
+
/**
* Filters a list of objects, based on a set of key => value arguments
*
* @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) )
+ if ( ! is_array( $list ) )
return array();
- if ( empty($args) )
- $args = array();
+ $list = wp_list_filter( $list, $args, $operator );
- if ( empty($args) && !$field )
- return $list; // nothing to do
+ if ( $field )
+ $list = wp_list_pluck( $list, $field );
- $count = count($args);
+ return $list;
+}
+/**
+ * Filters a list of objects, based on a set of key => value arguments
+ *
+ * @since 3.1.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:
+ * 'AND' means all elements from the array must match;
+ * 'OR' means only one element needs to match;
+ * 'NOT' means no elements may match.
+ * The default is 'AND'.
+ * @return array
+ */
+function wp_list_filter( $list, $args = array(), $operator = 'AND' ) {
+ if ( ! is_array( $list ) )
+ return array();
+
+ if ( empty( $args ) )
+ return $list;
+
+ $operator = strtoupper( $operator );
+ $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;
+ $matched = count( array_intersect_assoc( (array) $obj, $args ) );
+ if ( ( 'AND' == $operator && $matched == $count )
+ || ( 'OR' == $operator && $matched <= $count )
+ || ( 'NOT' == $operator && 0 == $matched ) ) {
+ $filtered[$key] = $obj;
}
}
return $filtered;
}
+/**
+ * Pluck a certain field out of each object in a list
+ *
+ * @since 3.1.0
+ *
+ * @param array $list A list of objects or arrays
+ * @param int|string $field A field from the object to place instead of the entire object
+ * @return array
+ */
+function wp_list_pluck( $list, $field ) {
+ foreach ( $list as $key => $value ) {
+ $value = (array) $value;
+ $list[ $key ] = $value[ $field ];
+ }
+
+ return $list;
+}
+
/**
* Determines if default embed handlers should be loaded.
*
ob_end_flush();
}
-/**
- * Load the correct database class file.
- *
- * This function is used to load the database class file either at runtime or by
- * wp-admin/setup-config.php We must globalise $wpdb to ensure that it is
- * defined globally by the inline code in wp-db.php.
- *
- * @since 2.5.0
- * @global $wpdb WordPress Database Object
- */
-function require_wp_db() {
- global $wpdb;
- if ( file_exists( WP_CONTENT_DIR . '/db.php' ) )
- require_once( WP_CONTENT_DIR . '/db.php' );
- else
- require_once( ABSPATH . WPINC . '/wp-db.php' );
-}
-
/**
* Load custom DB error or display WordPress DB error.
*
* to get the backtrace up to what file and function called the deprecated
* function.
*
- * The current behavior is to trigger an user error if WP_DEBUG is true.
+ * The current behavior is to trigger a user error if WP_DEBUG is true.
*
- * This function is to be used in every function in depreceated.php
+ * This function is to be used in every function that is deprecated.
*
* @package WordPress
* @subpackage Debug
* to get the backtrace up to what file and function included the deprecated
* file.
*
- * The current behavior is to trigger an user error if WP_DEBUG is true.
+ * The current behavior is to trigger a user error if WP_DEBUG is true.
*
- * This function is to be used in every file that is depreceated
+ * This function is to be used in every file that is deprecated.
*
* @package WordPress
* @subpackage Debug
* 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.
+ * The current behavior is to trigger a user error if WP_DEBUG is true.
*
* @package WordPress
* @subpackage Debug
}
}
+/**
+ * Marks something as being incorrectly called.
+ *
+ * There is a hook doing_it_wrong_run that will be called that can be used
+ * to get the backtrace up to what file and function called the deprecated
+ * function.
+ *
+ * The current behavior is to trigger a user error if WP_DEBUG is true.
+ *
+ * @package WordPress
+ * @subpackage Debug
+ * @since 3.1.0
+ * @access private
+ *
+ * @uses do_action() Calls 'doing_it_wrong_run' and passes the function arguments.
+ * @uses apply_filters() Calls 'doing_it_wrong_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 $message A message explaining what has been done incorrectly.
+ * @param string $version The version of WordPress where the message was added.
+ */
+function _doing_it_wrong( $function, $message, $version ) {
+
+ do_action( 'doing_it_wrong_run', $function, $message, $version );
+
+ // Allow plugin to filter the output error trigger
+ if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
+ $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
+ trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
+ }
+}
+
/**
* Is the server running earlier than 1.5.0 version of lighttpd
*
return $default;
}
+/**
+ * Check if IIS 7 supports pretty permalinks
+ *
+ * @since 2.8.0
+ *
+ * @return bool
+ */
+function iis7_supports_permalinks() {
+ global $is_iis7;
+
+ $supports_permalinks = false;
+ if ( $is_iis7 ) {
+ /* First we check if the DOMDocument class exists. If it does not exist,
+ * which is the case for PHP 4.X, then we cannot easily update the xml configuration file,
+ * hence we just bail out and tell user that pretty permalinks cannot be used.
+ * This is not a big issue because PHP 4.X is going to be depricated and for IIS it
+ * is recommended to use PHP 5.X NTS.
+ * Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When
+ * URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'.
+ * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs
+ * via ISAPI then pretty permalinks will not work.
+ */
+ $supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( php_sapi_name() == 'cgi-fcgi' );
+ }
+
+ return apply_filters('iis7_supports_permalinks', $supports_permalinks);
+}
+
/**
* File validates against allowed set of defined rules.
*
$schema = is_ssl() ? 'https://' : 'http://';
$url = preg_replace('|/wp-admin/.*|i', '', $schema . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
}
- return $url;
+ return rtrim($url, '/');
}
/**
function set_site_transient( $transient, $value, $expiration = 0 ) {
global $_wp_using_ext_object_cache;
- $value = apply_filters( 'pre_set_site_transient_' . $transient, $value );
+ $value = apply_filters( 'pre_set_site_transient_' . $transient, $value );
if ( $_wp_using_ext_object_cache ) {
$result = wp_cache_set( $transient, $value, 'site-transient', $expiration );
}
/**
- * Parse the file contents to retrieve its metadata.
- *
- * 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.
+ * Retrieve metadata from a file.
*
- * 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
- * the file contents when it has all of the required data.
+ * Searches for metadata in the first 8kiB of a file, such as a plugin or theme.
+ * Each piece of metadata must be on its own line. Fields can not span multple
+ * lines, the value will get cut at the end of the first line.
*
- * The first 8kiB of the file will be pulled in and if the file data is not
- * within that first 8kiB, then the author should correct their plugin file
- * and move the data headers to the top.
+ * If the file data is not within that first 8kiB, then the author should correct
+ * their plugin file and move the data headers to the top.
*
- * The file is assumed to have permissions to allow for scripts to read
- * the file. This is not checked however and the file is only opened for
- * reading.
+ * @see http://codex.wordpress.org/File_Header
*
* @since 2.9.0
- *
* @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 array $default_headers List of headers, in the format array('HeaderKey' => 'Header Name')
+ * @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.
fclose( $fp );
if ( $context != '' ) {
- $extra_headers = apply_filters( "extra_$context".'_headers', array() );
+ $extra_headers = apply_filters( "extra_{$context}_headers", array() );
$extra_headers = array_flip( $extra_headers );
foreach( $extra_headers as $key=>$value ) {
$extra_headers[$key] = $key;
}
- $all_headers = array_merge($extra_headers, $default_headers);
+ $all_headers = array_merge( $extra_headers, (array) $default_headers );
} else {
$all_headers = $default_headers;
}
-
foreach ( $all_headers as $field => $regex ) {
- preg_match( '/' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field});
+ preg_match( '/^[ \t\/*#]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field});
if ( !empty( ${$field} ) )
${$field} = _cleanup_header_comment( ${$field}[1] );
else
return $file_data;
}
-/*
+
+/**
* Used internally to tidy up the search terms
*
* @access private
}
}
+/**
+ * Finds hierarchy loops using a callback function that maps object IDs to parent IDs.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @param callback $callback function that accepts ( ID, $callback_args ) and outputs parent_ID
+ * @param int $start The ID to start the loop check at
+ * @param int $start_parent the parent_ID of $start to use instead of calling $callback( $start ). Use null to always use $callback
+ * @param array $callback_args optional additional arguments to send to $callback
+ * @return array IDs of all members of loop
+ */
+function wp_find_hierarchy_loop( $callback, $start, $start_parent, $callback_args = array() ) {
+ $override = is_null( $start_parent ) ? array() : array( $start => $start_parent );
+
+ if ( !$arbitrary_loop_member = wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override, $callback_args ) )
+ return array();
+
+ return wp_find_hierarchy_loop_tortoise_hare( $callback, $arbitrary_loop_member, $override, $callback_args, true );
+}
+
+/**
+ * Uses the "The Tortoise and the Hare" algorithm to detect loops.
+ *
+ * For every step of the algorithm, the hare takes two steps and the tortoise one.
+ * If the hare ever laps the tortoise, there must be a loop.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @param callback $callback function that accupts ( ID, callback_arg, ... ) and outputs parent_ID
+ * @param int $start The ID to start the loop check at
+ * @param array $override an array of ( ID => parent_ID, ... ) to use instead of $callback
+ * @param array $callback_args optional additional arguments to send to $callback
+ * @param bool $_return_loop Return loop members or just detect presence of loop?
+ * Only set to true if you already know the given $start is part of a loop
+ * (otherwise the returned array might include branches)
+ * @return mixed scalar ID of some arbitrary member of the loop, or array of IDs of all members of loop if $_return_loop
+ */
+function wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override = array(), $callback_args = array(), $_return_loop = false ) {
+ $tortoise = $hare = $evanescent_hare = $start;
+ $return = array();
+
+ // Set evanescent_hare to one past hare
+ // Increment hare two steps
+ while (
+ $tortoise
+ &&
+ ( $evanescent_hare = isset( $override[$hare] ) ? $override[$hare] : call_user_func_array( $callback, array_merge( array( $hare ), $callback_args ) ) )
+ &&
+ ( $hare = isset( $override[$evanescent_hare] ) ? $override[$evanescent_hare] : call_user_func_array( $callback, array_merge( array( $evanescent_hare ), $callback_args ) ) )
+ ) {
+ if ( $_return_loop )
+ $return[$tortoise] = $return[$evanescent_hare] = $return[$hare] = true;
+
+ // tortoise got lapped - must be a loop
+ if ( $tortoise == $evanescent_hare || $tortoise == $hare )
+ return $_return_loop ? $return : $tortoise;
+
+ // Increment tortoise by one step
+ $tortoise = isset( $override[$tortoise] ) ? $override[$tortoise] : call_user_func_array( $callback, array_merge( array( $tortoise ), $callback_args ) );
+ }
+
+ return false;
+}
+
?>
* @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 </head> or before </body>
+ * @param bool $in_footer (optional) Whether to enqueue the script before </head> or before </body>
* @return null
*/
function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
$wp_scripts->enqueue( $handle );
}
+/**
+ * Remove an enqueued script.
+ *
+ * @since WP 3.1
+ * @see WP_Scripts::dequeue() For parameter information.
+ */
+function wp_dequeue_script( $handle ) {
+ global $wp_scripts;
+ if ( !is_a($wp_scripts, 'WP_Scripts') )
+ $wp_scripts = new WP_Scripts();
+
+ $wp_scripts->dequeue( $handle );
+}
+
/**
* Check whether script has been added to WordPress Scripts.
*
$wp_styles->enqueue( $handle );
}
+/**
+ * Remove an enqueued style.
+ *
+ * @since WP 3.1
+ * @see WP_Styles::dequeue() For parameter information.
+ */
+function wp_dequeue_style( $handle ) {
+ global $wp_styles;
+ if ( !is_a($wp_styles, 'WP_Styles') )
+ $wp_styles = new WP_Styles();
+
+ $wp_styles->dequeue( $handle );
+}
+
/**
* Check whether style has been added to WordPress Styles.
*
function get_search_form($echo = true) {
do_action( 'get_search_form' );
- $search_form_template = locate_template(array('searchform.php'));
+ $search_form_template = locate_template('searchform.php');
if ( '' != $search_form_template ) {
require($search_form_template);
return;
*
* Returns the URL that allows the user to log out of the site
*
- * @since 2.7
+ * @since 2.7.0
* @uses wp_nonce_url() To protect against CSRF
* @uses site_url() To generate the log in URL
* @uses apply_filters() calls 'logout_url' hook on final logout url
*
* Returns the URL that allows the user to log in to the site
*
- * @since 2.7
+ * @since 2.7.0
* @uses site_url() To generate the log in URL
* @uses apply_filters() calls 'login_url' hook on final login url
*
$form = '
<form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . site_url( 'wp-login.php', 'login' ) . '" method="post">
- ' . apply_filters( 'login_form_top', '' ) . '
+ ' . apply_filters( 'login_form_top', '', $args ) . '
<p class="login-username">
<label for="' . esc_attr( $args['id_username'] ) . '">' . esc_html( $args['label_username'] ) . '</label>
<input type="text" name="log" id="' . esc_attr( $args['id_username'] ) . '" class="input" value="' . esc_attr( $args['value_username'] ) . '" size="20" tabindex="10" />
<label for="' . esc_attr( $args['id_password'] ) . '">' . esc_html( $args['label_password'] ) . '</label>
<input type="password" name="pwd" id="' . esc_attr( $args['id_password'] ) . '" class="input" value="" size="20" tabindex="20" />
</p>
- ' . apply_filters( 'login_form_middle', '' ) . '
+ ' . apply_filters( 'login_form_middle', '', $args ) . '
' . ( $args['remember'] ? '<p class="login-remember"><label><input name="rememberme" type="checkbox" id="' . esc_attr( $args['id_remember'] ) . '" value="forever" tabindex="90"' . ( $args['value_remember'] ? ' checked="checked"' : '' ) . ' /> ' . esc_html( $args['label_remember'] ) . '</label></p>' : '' ) . '
<p class="login-submit">
<input type="submit" name="wp-submit" id="' . esc_attr( $args['id_submit'] ) . '" class="button-primary" value="' . esc_attr( $args['label_log_in'] ) . '" tabindex="100" />
<input type="hidden" name="redirect_to" value="' . esc_attr( $args['redirect'] ) . '" />
</p>
- ' . apply_filters( 'login_form_bottom', '' ) . '
+ ' . apply_filters( 'login_form_bottom', '', $args ) . '
</form>';
if ( $args['echo'] )
*
* The possible values for the 'show' parameter are listed below.
* <ol>
- * <li><strong>url<strong> - Blog URI to homepage.</li>
+ * <li><strong>url</strong> - Blog URI to homepage.</li>
* <li><strong>wpurl</strong> - Blog URI path to WordPress.</li>
* <li><strong>description</strong> - Secondary title</li>
* </ol>
return $output;
}
+/**
+ * Retrieve the current blog id
+ *
+ * @since 3.1.0
+ *
+ * @return int Blog id
+ */
+function get_current_blog_id() {
+ global $blog_id;
+ return absint($blog_id);
+}
+
/**
* Display or retrieve page title for all areas of blog.
*
* @return string|null String on retrieve, null when displaying.
*/
function wp_title($sep = '»', $display = true, $seplocation = '') {
- global $wpdb, $wp_locale, $wp_query;
+ global $wpdb, $wp_locale;
- $cat = get_query_var('cat');
- $tag = get_query_var('tag_id');
- $category_name = get_query_var('category_name');
- $author = get_query_var('author');
- $author_name = get_query_var('author_name');
$m = get_query_var('m');
$year = get_query_var('year');
$monthnum = get_query_var('monthnum');
$t_sep = '%WP_TITILE_SEP%'; // Temporary separator, for accurate flipping, if necessary
- // If there's a category
- if ( !empty($cat) ) {
- // category exclusion
- if ( !stristr($cat,'-') )
- $title = apply_filters('single_cat_title', get_the_category_by_ID($cat));
- } elseif ( !empty($category_name) ) {
- if ( stristr($category_name,'/') ) {
- $category_name = explode('/',$category_name);
- if ( $category_name[count($category_name)-1] )
- $category_name = $category_name[count($category_name)-1]; // no trailing slash
- else
- $category_name = $category_name[count($category_name)-2]; // there was a trailling slash
- }
- $cat = get_term_by('slug', $category_name, 'category', OBJECT, 'display');
- if ( $cat )
- $title = apply_filters('single_cat_title', $cat->name);
+ // If there is a post
+ if ( is_single() || ( is_home() && !is_front_page() ) || ( is_page() && !is_front_page() ) ) {
+ $title = single_post_title( '', false );
}
- if ( !empty($tag) ) {
- $tag = get_term($tag, 'post_tag', OBJECT, 'display');
- if ( is_wp_error( $tag ) )
- return $tag;
- if ( ! empty($tag->name) )
- $title = apply_filters('single_tag_title', $tag->name);
+ // If there's a category or tag
+ if ( is_category() || is_tag() ) {
+ $title = single_term_title( '', false );
}
- // If there's an author
- if ( !empty($author) ) {
- $title = get_userdata($author);
- $title = $title->display_name;
+ // If there's a taxonomy
+ if ( is_tax() ) {
+ $term = get_queried_object();
+ $tax = get_taxonomy( $term->taxonomy );
+ $title = single_term_title( $tax->labels->name . $t_sep, false );
}
- if ( !empty($author_name) ) {
- // We do a direct query here because we don't cache by nicename.
- $title = $wpdb->get_var($wpdb->prepare("SELECT display_name FROM $wpdb->users WHERE user_nicename = %s", $author_name));
+
+ // If there's an author
+ if ( is_author() ) {
+ $author = get_queried_object();
+ $title = $author->display_name;
}
+ // If there's a post type archive
+ if ( is_post_type_archive() )
+ $title = post_type_archive_title( '', false );
+
// If there's a month
- if ( !empty($m) ) {
+ if ( is_archive() && !empty($m) ) {
$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 : "");
}
- if ( !empty($year) ) {
+ // If there's a year
+ if ( is_archive() && !empty($year) ) {
$title = $year;
if ( !empty($monthnum) )
$title .= $t_sep . $wp_locale->get_month($monthnum);
$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 = 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 );
- $term = $wp_query->get_queried_object();
- $term = $term->name;
- $title = $tax->labels->name . $t_sep . $term;
- }
-
- //If it's a search
+ // If it's a search
if ( is_search() ) {
/* translators: 1: separator, 2: search phrase */
$title = sprintf(__('Search Results %1$s %2$s'), $t_sep, strip_tags($search));
}
+ // If it's a 404 page
if ( is_404() ) {
$title = __('Page not found');
}
* Display or retrieve page title for post.
*
* This is optimized for single.php template file for displaying the post title.
- * Only useful for posts, does not support pages for example.
*
* It does not support placing the separator after the title, but by leaving the
* prefix parameter empty, you can set the title separator manually. The prefix
* be a space, the parameter value will need to have it at the end.
*
* @since 0.71
- * @uses $wpdb
*
* @param string $prefix Optional. What to display before the title.
* @param bool $display Optional, default is true. Whether to display or retrieve title.
* @return string|null Title when retrieving, null when displaying or failure.
*/
function single_post_title($prefix = '', $display = true) {
- global $wp_query, $post;
-
- if ( ! $post )
- $_post = $wp_query->get_queried_object();
- else
- $_post = $post;
+ $_post = get_queried_object();
if ( !isset($_post->post_title) )
return;
return $title;
}
+/**
+ * Display or retrieve title for a post type archive.
+ *
+ * This is optimized for archive.php and archive-{$post_type}.php template files
+ * for displaying the title of the post type.
+ *
+ * @since 3.1.0
+ *
+ * @param string $prefix Optional. What to display before the title.
+ * @param bool $display Optional, default is true. Whether to display or retrieve title.
+ * @return string|null Title when retrieving, null when displaying or failure.
+ */
+function post_type_archive_title( $prefix = '', $display = true ) {
+ if ( ! is_post_type_archive() )
+ return;
+
+ $post_type_obj = get_queried_object();
+ $title = apply_filters('post_type_archive_title', $post_type_obj->labels->name );
+
+ if ( $display )
+ echo $prefix . $title;
+ else
+ return $title;
+}
+
/**
* Display or retrieve page title for category archive.
*
* @param bool $display Optional, default is true. Whether to display or retrieve title.
* @return string|null Title when retrieving, null when displaying or failure.
*/
-function single_cat_title($prefix = '', $display = true ) {
- 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;
- }
+function single_cat_title( $prefix = '', $display = true ) {
+ return single_term_title( $prefix, $display );
}
/**
* @param bool $display Optional, default is true. Whether to display or retrieve title.
* @return string|null Title when retrieving, null when displaying or failure.
*/
-function single_tag_title($prefix = '', $display = true ) {
- global $wp_query;
- if ( !is_tag() )
+function single_tag_title( $prefix = '', $display = true ) {
+ return single_term_title( $prefix, $display );
+}
+
+/**
+ * Display or retrieve page title for taxonomy term archive.
+ *
+ * Useful for taxonomy term template files for displaying the taxonomy term page title.
+ * It has less overhead than {@link wp_title()}, because of its limited implementation.
+ *
+ * It does not support placing the separator after the title, but by leaving the
+ * prefix parameter empty, you can set the title separator manually. The prefix
+ * does not automatically place a space between the prefix, so if there should
+ * be a space, the parameter value will need to have it at the end.
+ *
+ * @since 3.1.0
+ *
+ * @param string $prefix Optional. What to display before the title.
+ * @param bool $display Optional, default is true. Whether to display or retrieve title.
+ * @return string|null Title when retrieving, null when displaying or failure.
+ */
+function single_term_title( $prefix = '', $display = true ) {
+ $term = get_queried_object();
+
+ if ( !$term )
return;
- $tag = $wp_query->get_queried_object();
+ if ( is_category() )
+ $term_name = apply_filters( 'single_cat_title', $term->name );
+ elseif ( is_tag() )
+ $term_name = apply_filters( 'single_tag_title', $term->name );
+ elseif ( is_tax() )
+ $term_name = apply_filters( 'single_term_title', $term->name );
+ else
+ return;
- if ( ! $tag )
+ if ( empty( $term_name ) )
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;
- }
+ if ( $display )
+ echo $prefix . $term_name;
+ else
+ return $term_name;
}
/**
// We need to get the month from MySQL
$thisyear = ''.intval(substr($m, 0, 4));
$d = (($w - 1) * 7) + 6; //it seems MySQL's weeks disagree with PHP's
- $thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('${thisyear}0101', INTERVAL $d DAY) ), '%m')");
+ $thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')");
} elseif ( !empty($m) ) {
$thisyear = ''.intval(substr($m, 0, 4));
if ( strlen($m) < 6 )
}
$unixmonth = mktime(0, 0 , 0, $thismonth, 1, $thisyear);
+ $last_day = date('t', $unixmonth);
// Get the next and previous month and year with at least one post
- $previous = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year
+ $previous = $wpdb->get_row("SELECT MONTH(post_date) AS month, YEAR(post_date) AS year
FROM $wpdb->posts
WHERE post_date < '$thisyear-$thismonth-01'
AND post_type = 'post' AND post_status = 'publish'
ORDER BY post_date DESC
LIMIT 1");
- $next = $wpdb->get_row("SELECT DISTINCT MONTH(post_date) AS month, YEAR(post_date) AS year
+ $next = $wpdb->get_row("SELECT MONTH(post_date) AS month, YEAR(post_date) AS year
FROM $wpdb->posts
- WHERE post_date > '$thisyear-$thismonth-01'
- AND MONTH( post_date ) != MONTH( '$thisyear-$thismonth-01' )
+ WHERE post_date > '$thisyear-$thismonth-{$last_day} 23:59:59'
AND post_type = 'post' AND post_status = 'publish'
- ORDER BY post_date ASC
+ ORDER BY post_date ASC
LIMIT 1");
/* translators: Calendar caption: 1: month name, 2: 4-digit year */
<tr>';
if ( $previous ) {
- $calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a href="' . get_month_link($previous->year, $previous->month) . '" title="' . sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($previous->month), date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year))) . '">« ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>';
+ $calendar_output .= "\n\t\t".'<td colspan="3" id="prev"><a href="' . get_month_link($previous->year, $previous->month) . '" title="' . esc_attr( sprintf(__('View posts for %1$s %2$s'), $wp_locale->get_month($previous->month), date('Y', mktime(0, 0 , 0, $previous->month, 1, $previous->year)))) . '">« ' . $wp_locale->get_month_abbrev($wp_locale->get_month($previous->month)) . '</a></td>';
} else {
$calendar_output .= "\n\t\t".'<td colspan="3" id="prev" class="pad"> </td>';
}
// Get days with posts
$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
- FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'
- AND YEAR(post_date) = '$thisyear'
+ FROM $wpdb->posts WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00'
AND post_type = 'post' AND post_status = 'publish'
- AND post_date < '" . current_time('mysql') . '\'', ARRAY_N);
+ AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59'", ARRAY_N);
if ( $dayswithposts ) {
foreach ( (array) $dayswithposts as $daywith ) {
$daywithpost[] = $daywith[0];
$ak_titles_for_day = array();
$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' "
- ."AND post_date < '".current_time('mysql')."' "
+ ."WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' "
+ ."AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59' "
."AND post_type = 'post' AND post_status = 'publish'"
);
if ( $ak_post_titles ) {
*
* 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.
*
* @return string|null Null if displaying, string if retrieving.
*/
function the_date( $d = '', $before = '', $after = '', $echo = true ) {
- global $day, $previousday;
+ global $currentday, $previousday;
$the_date = '';
- if ( $day != $previousday ) {
+ if ( $currentday != $previousday ) {
$the_date .= $before;
$the_date .= get_the_date( $d );
$the_date .= $after;
- $previousday = $day;
+ $previousday = $currentday;
$the_date = apply_filters('the_date', $the_date, $d, $before, $after);
*
* @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;
$the_weekday_date = '';
- if ( $day != $previousweekday ) {
+ if ( $currentday != $previousweekday ) {
$the_weekday_date .= $before;
$the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date, false));
$the_weekday_date .= $after;
- $previousweekday = $day;
+ $previousweekday = $currentday;
}
$the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date, $before, $after);
echo $the_weekday_date;
$href = get_post_comments_feed_link( $post->ID );
}
} elseif ( is_category() ) {
- $cat_id = intval( get_query_var('cat') );
+ $term = get_queried_object();
- $title = esc_attr(sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], get_cat_name( $cat_id ) ));
- $href = get_category_feed_link( $cat_id );
+ $title = esc_attr(sprintf( $args['cattitle'], get_bloginfo('name'), $args['separator'], $term->name ));
+ $href = get_category_feed_link( $term->term_id );
} elseif ( is_tag() ) {
- $tag_id = intval( get_query_var('tag_id') );
- $tag = get_tag( $tag_id );
+ $term = get_queried_object();
- $title = esc_attr(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $tag->name ));
- $href = get_tag_feed_link( $tag_id );
+ $title = esc_attr(sprintf( $args['tagtitle'], get_bloginfo('name'), $args['separator'], $term->name ));
+ $href = get_tag_feed_link( $term->term_id );
} elseif ( is_author() ) {
$author_id = intval( get_query_var('author') );
* @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 Optional 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;
* @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'));}
+ wp_admin_css_color( 'classic', __( 'Blue' ), admin_url( 'css/colors-classic.css' ),
+ array( '#5589aa', '#cfdfe9', '#d1e5ee', '#eff8ff' ) );
+ wp_admin_css_color( 'fresh', __( 'Gray' ), admin_url( 'css/colors-fresh.css' ),
+ array( '#7c7976', '#c6c6c6', '#e0e0e0', '#f1f1f1' ) );
+}
/**
* Display the URL of a WordPress admin CSS file.
* @since 2.3.0
* @uses $wp_styles WordPress Styles Object
*
- * @param string $file Style handle name or file name (without ".css" extension) relative to wp-admin/
+ * @param string $file Optional. Style handle name or file name (without ".css" extension) relative
+ * to wp-admin/. Defaults to 'wp-admin'.
* @param bool $force_echo Optional. Force the stylesheet link to be printed rather than enqueued.
*/
function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
function add_thickbox() {
wp_enqueue_script( 'thickbox' );
wp_enqueue_style( 'thickbox' );
+
+ if ( is_network_admin() )
+ add_action( 'admin_head', '_thickbox_path_admin_subfolder' );
}
/**
$gen = '<!-- generator="WordPress/' . get_bloginfo( 'version' ) . '" -->';
break;
case 'export':
- $gen = '<!-- generator="WordPress/' . get_bloginfo_rss('version') . '" created="'. date('Y-m-d H:i') . '"-->';
+ $gen = '<!-- generator="WordPress/' . get_bloginfo_rss('version') . '" created="'. date('Y-m-d H:i') . '" -->';
break;
}
return apply_filters( "get_the_generator_{$type}", $gen, $type );
*
* Compares the first two arguments and if identical marks as checked
*
- * @since 1.0
+ * @since 1.0.0
*
* @param mixed $checked One of the values to compare
* @param mixed $current (true) The other value to compare if not just true
*
* Compares the first two arguments and if identical marks as selected
*
- * @since 1.0
+ * @since 1.0.0
*
- * @param mixed selected One of the values to compare
+ * @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
*
* Compares the first two arguments and if identical marks as $type
*
- * @since 2.8
+ * @since 2.8.0
* @access private
*
* @param any $helper One of the values to compare
--- /dev/null
+(function(d, w) {
+ var addEvent = function( obj, type, fn ) {
+ if (obj.addEventListener)
+ obj.addEventListener(type, fn, false);
+ else if (obj.attachEvent)
+ obj.attachEvent('on' + type, function() { return fn.call(obj, window.event);});
+ },
+
+ aB, hc = new RegExp('\\bhover\\b', 'g'), q = [],
+ rselected = new RegExp('\\bselected\\b', 'g'),
+
+ /**
+ * Get the timeout ID of the given element
+ */
+ getTOID = function(el) {
+ var i = q.length;
+ while( i-- )
+ if ( q[i] && el == q[i][1] )
+ return q[i][0];
+ return false;
+ },
+
+ addHoverClass = function(t) {
+ var i, id, inA, hovering, ul, li,
+ ancestors = [],
+ ancestorLength = 0;
+
+ while ( t && t != aB && t != d ) {
+ if( 'LI' == t.nodeName.toUpperCase() ) {
+ ancestors[ ancestors.length ] = t;
+ id = getTOID(t);
+ if ( id )
+ clearTimeout( id );
+ t.className = t.className ? ( t.className.replace(hc, '') + ' hover' ) : 'hover';
+ hovering = t;
+ }
+ t = t.parentNode;
+ }
+
+ // Remove any selected classes.
+ if ( hovering && hovering.parentNode ) {
+ ul = hovering.parentNode;
+ if ( ul && 'UL' == ul.nodeName.toUpperCase() ) {
+ i = ul.childNodes.length;
+ while ( i-- ) {
+ li = ul.childNodes[i];
+ if ( li != hovering )
+ li.className = li.className ? li.className.replace( rselected, '' ) : '';
+ }
+ }
+ }
+
+ /* remove the hover class for any objects not in the immediate element's ancestry */
+ i = q.length;
+ while ( i-- ) {
+ inA = false;
+ ancestorLength = ancestors.length;
+ while( ancestorLength-- ) {
+ if ( ancestors[ ancestorLength ] == q[i][1] )
+ inA = true;
+ }
+
+ if ( ! inA )
+ q[i][1].className = q[i][1].className ? q[i][1].className.replace(hc, '') : '';
+ }
+ },
+
+ removeHoverClass = function(t) {
+ while ( t && t != aB && t != d ) {
+ if( 'LI' == t.nodeName.toUpperCase() ) {
+ (function(t) {
+ var to = setTimeout(function() {
+ t.className = t.className ? t.className.replace(hc, '') : '';
+ }, 500);
+ q[q.length] = [to, t];
+ })(t);
+ }
+ t = t.parentNode;
+ }
+ },
+
+ clickShortlink = function(e) {
+ var i, l, node,
+ t = e.target || e.srcElement;
+
+ // Make t the shortlink menu item, or return.
+ while ( true ) {
+ // Check if we've gone past the shortlink node,
+ // or if the user is clicking on the input.
+ if ( ! t || t == d || t == aB )
+ return;
+ // Check if we've found the shortlink node.
+ if ( t.id && t.id == 'wp-admin-bar-get-shortlink' )
+ break;
+ t = t.parentNode;
+ }
+
+ // IE doesn't support preventDefault, and does support returnValue
+ if ( e.preventDefault )
+ e.preventDefault();
+ e.returnValue = false;
+
+ if ( -1 == t.className.indexOf('selected') )
+ t.className += ' selected';
+
+ for ( i = 0, l = t.childNodes.length; i < l; i++ ) {
+ node = t.childNodes[i];
+ if ( node.className && -1 != node.className.indexOf('shortlink-input') ) {
+ node.focus();
+ node.select();
+ node.onblur = function() {
+ t.className = t.className ? t.className.replace( rselected, '' ) : '';
+ };
+ break;
+ }
+ }
+ return false;
+ };
+
+ addEvent(w, 'load', function() {
+ aB = d.getElementById('wpadminbar');
+
+ if ( d.body && aB ) {
+ d.body.appendChild( aB );
+
+ addEvent(aB, 'mouseover', function(e) {
+ addHoverClass( e.target || e.srcElement );
+ });
+
+ addEvent(aB, 'mouseout', function(e) {
+ removeHoverClass( e.target || e.srcElement );
+ });
+
+ addEvent(aB, 'click', clickShortlink );
+ }
+
+ if ( w.location.hash )
+ w.scrollBy(0,-32);
+ });
+})(document, window);
--- /dev/null
+(function(i,k){var c=function(n,m,d){if(n.addEventListener){n.addEventListener(m,d,false)}else{if(n.attachEvent){n.attachEvent("on"+m,function(){return d.call(n,window.event)})}}},e,f=new RegExp("\\bhover\\b","g"),a=[],j=new RegExp("\\bselected\\b","g"),g=function(m){var d=a.length;while(d--){if(a[d]&&m==a[d][1]){return a[d][0]}}return false},h=function(s){var n,d,q,m,p,r,u=[],o=0;while(s&&s!=e&&s!=i){if("LI"==s.nodeName.toUpperCase()){u[u.length]=s;d=g(s);if(d){clearTimeout(d)}s.className=s.className?(s.className.replace(f,"")+" hover"):"hover";m=s}s=s.parentNode}if(m&&m.parentNode){p=m.parentNode;if(p&&"UL"==p.nodeName.toUpperCase()){n=p.childNodes.length;while(n--){r=p.childNodes[n];if(r!=m){r.className=r.className?r.className.replace(j,""):""}}}}n=a.length;while(n--){q=false;o=u.length;while(o--){if(u[o]==a[n][1]){q=true}}if(!q){a[n][1].className=a[n][1].className?a[n][1].className.replace(f,""):""}}},l=function(d){while(d&&d!=e&&d!=i){if("LI"==d.nodeName.toUpperCase()){(function(m){var n=setTimeout(function(){m.className=m.className?m.className.replace(f,""):""},500);a[a.length]=[n,m]})(d)}d=d.parentNode}},b=function(p){var n,d,o,m=p.target||p.srcElement;while(true){if(!m||m==i||m==e){return}if(m.id&&m.id=="wp-admin-bar-get-shortlink"){break}m=m.parentNode}if(p.preventDefault){p.preventDefault()}p.returnValue=false;if(-1==m.className.indexOf("selected")){m.className+=" selected"}for(n=0,d=m.childNodes.length;n<d;n++){o=m.childNodes[n];if(o.className&&-1!=o.className.indexOf("shortlink-input")){o.focus();o.select();o.onblur=function(){m.className=m.className?m.className.replace(j,""):""};break}}return false};c(k,"load",function(){e=i.getElementById("wpadminbar");if(i.body&&e){i.body.appendChild(e);c(e,"mouseover",function(d){h(d.target||d.srcElement)});c(e,"mouseout",function(d){l(d.target||d.srcElement)});c(e,"click",b)}if(k.location.hash){k.scrollBy(0,-32)}})})(document,window);
\ No newline at end of file
else
t.addClass('button-disabled');
});
- $('#ajax-loading').css('visibility', 'visible');
+ if ( $(this).attr('id') == 'publish' )
+ $('#ajax-loading').css('visibility', 'visible');
+ else
+ $('#draft-ajax-loading').css('visibility', 'visible');
});
window.onbeforeunload = function(){
// delay that a bit to avoid some rare collisions while the DOM is being updated.
setTimeout(function(){
jQuery(':button, :submit', '#submitpost').removeAttr('disabled');
- jQuery('#ajax-loading').css('visibility', 'hidden');
+ jQuery('.ajax-loading').css('visibility', 'hidden');
}, 500);
}
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();
+ 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';
-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
+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")}});if(b(this).attr("id")=="publish"){b("#ajax-loading").css("visibility","visible")}else{b("#draft-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
-(function($){var abs=Math.abs,max=Math.max,min=Math.min,round=Math.round;function div(){return $('<div/>')}$.imgAreaSelect=function(img,options){var $img=$(img),imgLoaded,$box=div(),$area=div(),$border=div().add(div()).add(div()).add(div()),$outer=div().add(div()).add(div()).add(div()),$handles=$([]),$areaOpera,left,top,imgOfs,imgWidth,imgHeight,$parent,parOfs,zIndex=0,position='absolute',startX,startY,scaleX,scaleY,resizeMargin=10,resize,aspectRatio,shown,x1,y1,x2,y2,selection={x1:0,y1:0,x2:0,y2:0,width:0,height:0},$p,d,i,o,w,h,adjusted;function viewX(x){return x+imgOfs.left-parOfs.left}function viewY(y){return y+imgOfs.top-parOfs.top}function selX(x){return x-imgOfs.left+parOfs.left}function selY(y){return y-imgOfs.top+parOfs.top}function evX(event){return event.pageX-parOfs.left}function evY(event){return event.pageY-parOfs.top}function getSelection(noScale){var sx=noScale||scaleX,sy=noScale||scaleY;return{x1:round(selection.x1*sx),y1:round(selection.y1*sy),x2:round(selection.x2*sx),y2:round(selection.y2*sy),width:round(selection.x2*sx)-round(selection.x1*sx),height:round(selection.y2*sy)-round(selection.y1*sy)}}function setSelection(x1,y1,x2,y2,noScale){var sx=noScale||scaleX,sy=noScale||scaleY;selection={x1:round(x1/sx),y1:round(y1/sy),x2:round(x2/sx),y2:round(y2/sy)};selection.width=(x2=viewX(selection.x2))-(x1=viewX(selection.x1));selection.height=(y2=viewX(selection.y2))-(y1=viewX(selection.y1))}function adjust(){if(!$img.width())return;imgOfs={left:round($img.offset().left),top:round($img.offset().top)};imgWidth=$img.width();imgHeight=$img.height();if($().jquery=='1.3.2'&&$.browser.safari&&position=='fixed'){imgOfs.top+=max(document.documentElement.scrollTop,$('body').scrollTop());imgOfs.left+=max(document.documentElement.scrollLeft,$('body').scrollLeft())}parOfs=$.inArray($parent.css('position'),['absolute','relative'])+1?{left:round($parent.offset().left)-$parent.scrollLeft(),top:round($parent.offset().top)-$parent.scrollTop()}:position=='fixed'?{left:$(document).scrollLeft(),top:$(document).scrollTop()}:{left:0,top:0};left=viewX(0);top=viewY(0)}function update(resetKeyPress){if(!shown)return;$box.css({left:viewX(selection.x1),top:viewY(selection.y1)}).add($area).width(w=selection.width).height(h=selection.height);$area.add($border).add($handles).css({left:0,top:0});$border.width(max(w-$border.outerWidth()+$border.innerWidth(),0)).height(max(h-$border.outerHeight()+$border.innerHeight(),0));$($outer[0]).css({left:left,top:top,width:selection.x1,height:imgHeight});$($outer[1]).css({left:left+selection.x1,top:top,width:w,height:selection.y1});$($outer[2]).css({left:left+selection.x2,top:top,width:imgWidth-selection.x2,height:imgHeight});$($outer[3]).css({left:left+selection.x1,top:top+selection.y2,width:w,height:imgHeight-selection.y2});w-=$handles.outerWidth();h-=$handles.outerHeight();switch($handles.length){case 8:$($handles[4]).css({left:w/2});$($handles[5]).css({left:w,top:h/2});$($handles[6]).css({left:w/2,top:h});$($handles[7]).css({top:h/2});case 4:$handles.slice(1,3).css({left:w});$handles.slice(2,4).css({top:h})}if(resetKeyPress!==false){if($.imgAreaSelect.keyPress!=docKeyPress)$(document).unbind($.imgAreaSelect.keyPress,$.imgAreaSelect.onKeyPress);if(options.keys)$(document)[$.imgAreaSelect.keyPress]($.imgAreaSelect.onKeyPress=docKeyPress)}if($.browser.msie&&$border.outerWidth()-$border.innerWidth()==2){$border.css('margin',0);setTimeout(function(){$border.css('margin','auto')},0)}}function doUpdate(resetKeyPress){adjust();update(resetKeyPress);x1=viewX(selection.x1);y1=viewY(selection.y1);x2=viewX(selection.x2);y2=viewY(selection.y2)}function hide($elem,fn){options.fadeSpeed?$elem.fadeOut(options.fadeSpeed,fn):$elem.hide()}function areaMouseMove(event){var x=selX(evX(event))-selection.x1,y=selY(evY(event))-selection.y1;if(!adjusted){adjust();adjusted=true;$box.one('mouseout',function(){adjusted=false})}resize='';if(options.resizable){if(y<=resizeMargin)resize='n';else if(y>=selection.height-resizeMargin)resize='s';if(x<=resizeMargin)resize+='w';else if(x>=selection.width-resizeMargin)resize+='e'}$box.css('cursor',resize?resize+'-resize':options.movable?'move':'');if($areaOpera)$areaOpera.toggle()}function docMouseUp(event){$('body').css('cursor','');if(options.autoHide||selection.width*selection.height==0)hide($box.add($outer),function(){$(this).hide()});options.onSelectEnd(img,getSelection());$(document).unbind('mousemove',selectingMouseMove);$box.mousemove(areaMouseMove)}function areaMouseDown(event){if(event.which!=1)return false;adjust();if(resize){$('body').css('cursor',resize+'-resize');x1=viewX(selection[/w/.test(resize)?'x2':'x1']);y1=viewY(selection[/n/.test(resize)?'y2':'y1']);$(document).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove)}else if(options.movable){startX=left+selection.x1-evX(event);startY=top+selection.y1-evY(event);$box.unbind('mousemove',areaMouseMove);$(document).mousemove(movingMouseMove).one('mouseup',function(){options.onSelectEnd(img,getSelection());$(document).unbind('mousemove',movingMouseMove);$box.mousemove(areaMouseMove)})}else $img.mousedown(event);return false}function aspectRatioXY(){x2=max(left,min(left+imgWidth,x1+abs(y2-y1)*aspectRatio*(x2>x1||-1)));y2=round(max(top,min(top+imgHeight,y1+abs(x2-x1)/aspectRatio*(y2>y1||-1))));x2=round(x2)}function aspectRatioYX(){y2=max(top,min(top+imgHeight,y1+abs(x2-x1)/aspectRatio*(y2>y1||-1)));x2=round(max(left,min(left+imgWidth,x1+abs(y2-y1)*aspectRatio*(x2>x1||-1))));y2=round(y2)}function doResize(){if(abs(x2-x1)<options.minWidth){x2=x1-options.minWidth*(x2<x1||-1);if(x2<left)x1=left+options.minWidth;else if(x2>left+imgWidth)x1=left+imgWidth-options.minWidth}if(abs(y2-y1)<options.minHeight){y2=y1-options.minHeight*(y2<y1||-1);if(y2<top)y1=top+options.minHeight;else if(y2>top+imgHeight)y1=top+imgHeight-options.minHeight}x2=max(left,min(x2,left+imgWidth));y2=max(top,min(y2,top+imgHeight));if(aspectRatio)if(abs(x2-x1)/aspectRatio>abs(y2-y1))aspectRatioYX();else aspectRatioXY();if(abs(x2-x1)>options.maxWidth){x2=x1-options.maxWidth*(x2<x1||-1);if(aspectRatio)aspectRatioYX()}if(abs(y2-y1)>options.maxHeight){y2=y1-options.maxHeight*(y2<y1||-1);if(aspectRatio)aspectRatioXY()}selection={x1:selX(min(x1,x2)),x2:selX(max(x1,x2)),y1:selY(min(y1,y2)),y2:selY(max(y1,y2)),width:abs(x2-x1),height:abs(y2-y1)};update();options.onSelectChange(img,getSelection())}function selectingMouseMove(event){x2=resize==''||/w|e/.test(resize)||aspectRatio?evX(event):viewX(selection.x2);y2=resize==''||/n|s/.test(resize)||aspectRatio?evY(event):viewY(selection.y2);doResize();return false}function doMove(newX1,newY1){x2=(x1=newX1)+selection.width;y2=(y1=newY1)+selection.height;selection=$.extend(selection,{x1:selX(x1),y1:selY(y1),x2:selX(x2),y2:selY(y2)});update();options.onSelectChange(img,getSelection())}function movingMouseMove(event){x1=max(left,min(startX+evX(event),left+imgWidth-selection.width));y1=max(top,min(startY+evY(event),top+imgHeight-selection.height));doMove(x1,y1);event.preventDefault();return false}function startSelection(){adjust();x2=x1;y2=y1;doResize();resize='';if($outer.is(':not(:visible)'))$box.add($outer).hide().fadeIn(options.fadeSpeed||0);shown=true;$(document).unbind('mouseup',cancelSelection).mousemove(selectingMouseMove).one('mouseup',docMouseUp);$box.unbind('mousemove',areaMouseMove);options.onSelectStart(img,getSelection())}function cancelSelection(){$(document).unbind('mousemove',startSelection);hide($box.add($outer));selection={x1:selX(x1),y1:selY(y1),x2:selX(x1),y2:selY(y1),width:0,height:0};options.onSelectChange(img,getSelection());options.onSelectEnd(img,getSelection())}function imgMouseDown(event){if(event.which!=1||$outer.is(':animated'))return false;adjust();startX=x1=evX(event);startY=y1=evY(event);$(document).one('mousemove',startSelection).one('mouseup',cancelSelection);return false}function parentScroll(){doUpdate(false)}function imgLoad(){imgLoaded=true;setOptions(options=$.extend({classPrefix:'imgareaselect',movable:true,resizable:true,parent:'body',onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},options));$box.add($outer).css({visibility:''});if(options.show){shown=true;adjust();update();$box.add($outer).hide().fadeIn(options.fadeSpeed||0)}setTimeout(function(){options.onInit(img,getSelection())},0)}var docKeyPress=function(event){var k=options.keys,d,t,key=event.keyCode||event.which;d=!isNaN(k.alt)&&(event.altKey||event.originalEvent.altKey)?k.alt:!isNaN(k.ctrl)&&event.ctrlKey?k.ctrl:!isNaN(k.shift)&&event.shiftKey?k.shift:!isNaN(k.arrows)?k.arrows:10;if(k.arrows=='resize'||(k.shift=='resize'&&event.shiftKey)||(k.ctrl=='resize'&&event.ctrlKey)||(k.alt=='resize'&&(event.altKey||event.originalEvent.altKey))){switch(key){case 37:d=-d;case 39:t=max(x1,x2);x1=min(x1,x2);x2=max(t+d,x1);if(aspectRatio)aspectRatioYX();break;case 38:d=-d;case 40:t=max(y1,y2);y1=min(y1,y2);y2=max(t+d,y1);if(aspectRatio)aspectRatioXY();break;default:return}doResize()}else{x1=min(x1,x2);y1=min(y1,y2);switch(key){case 37:doMove(max(x1-d,left),y1);break;case 38:doMove(x1,max(y1-d,top));break;case 39:doMove(x1+min(d,imgWidth-selX(x2)),y1);break;case 40:doMove(x1,y1+min(d,imgHeight-selY(y2)));break;default:return}}return false};function styleOptions($elem,props){for(option in props)if(options[option]!==undefined)$elem.css(props[option],options[option])}function setOptions(newOptions){if(newOptions.parent)($parent=$(newOptions.parent)).append($box.add($outer));options=$.extend(options,newOptions);adjust();if(newOptions.handles!=null){$handles.remove();$handles=$([]);i=newOptions.handles?newOptions.handles=='corners'?4:8:0;while(i--)$handles=$handles.add(div());$handles.addClass(options.classPrefix+'-handle').css({position:'absolute',fontSize:0,zIndex:zIndex+1||1});if(!parseInt($handles.css('width')))$handles.width(5).height(5);if(o=options.borderWidth)$handles.css({borderWidth:o,borderStyle:'solid'});styleOptions($handles,{borderColor1:'border-color',borderColor2:'background-color',borderOpacity:'opacity'})}scaleX=options.imageWidth/imgWidth||1;scaleY=options.imageHeight/imgHeight||1;if(newOptions.x1!=null){setSelection(newOptions.x1,newOptions.y1,newOptions.x2,newOptions.y2);newOptions.show=!newOptions.hide}if(newOptions.keys)options.keys=$.extend({shift:1,ctrl:'resize'},newOptions.keys);$outer.addClass(options.classPrefix+'-outer');$area.addClass(options.classPrefix+'-selection');for(i=0;i++<4;)$($border[i-1]).addClass(options.classPrefix+'-border'+i);styleOptions($area,{selectionColor:'background-color',selectionOpacity:'opacity'});styleOptions($border,{borderOpacity:'opacity',borderWidth:'border-width'});styleOptions($outer,{outerColor:'background-color',outerOpacity:'opacity'});if(o=options.borderColor1)$($border[0]).css({borderStyle:'solid',borderColor:o});if(o=options.borderColor2)$($border[1]).css({borderStyle:'dashed',borderColor:o});$box.append($area.add($border).add($handles).add($areaOpera));if($.browser.msie){if(o=$outer.css('filter').match(/opacity=([0-9]+)/))$outer.css('opacity',o[1]/100);if(o=$border.css('filter').match(/opacity=([0-9]+)/))$border.css('opacity',o[1]/100)}if(newOptions.hide)hide($box.add($outer));else if(newOptions.show&&imgLoaded){shown=true;$box.add($outer).fadeIn(options.fadeSpeed||0);doUpdate()}aspectRatio=(d=(options.aspectRatio||'').split(/:/))[0]/d[1];if(options.disable||options.enable===false){$box.unbind('mousemove',areaMouseMove).unbind('mousedown',areaMouseDown);$img.add($outer).unbind('mousedown',imgMouseDown);$(window).unbind('resize',parentScroll);$img.add($img.parents()).unbind('scroll',parentScroll)}else if(options.enable||options.disable===false){if(options.resizable||options.movable)$box.mousemove(areaMouseMove).mousedown(areaMouseDown);if(!options.persistent)$img.add($outer).mousedown(imgMouseDown);$(window).resize(parentScroll);$img.add($img.parents()).scroll(parentScroll)}options.enable=options.disable=undefined}this.getOptions=function(){return options};this.setOptions=setOptions;this.getSelection=getSelection;this.setSelection=setSelection;this.update=doUpdate;$p=$img;while($p.length&&!$p.is('body')){if(!isNaN($p.css('z-index'))&&$p.css('z-index')>zIndex)zIndex=$p.css('z-index');if($p.css('position')=='fixed')position='fixed';$p=$p.parent()}if(!isNaN(options.zIndex))zIndex=options.zIndex;if($.browser.msie)$img.attr('unselectable','on');$.imgAreaSelect.keyPress=$.browser.msie||$.browser.safari?'keydown':'keypress';if($.browser.opera)$areaOpera=div().css({width:'100%',height:'100%',position:'absolute',zIndex:zIndex+2||2});$box.add($outer).css({visibility:'hidden',position:position,overflow:'hidden',zIndex:zIndex||'0'});$box.css({zIndex:zIndex+2||2});$area.add($border).css({position:'absolute'});img.complete||img.readyState=='complete'||!$img.is('img')?imgLoad():$img.one('load',imgLoad)};$.fn.imgAreaSelect=function(options){options=options||{};this.each(function(){if($(this).data('imgAreaSelect'))$(this).data('imgAreaSelect').setOptions(options);else{if(options.enable===undefined&&options.disable===undefined)options.enable=true;$(this).data('imgAreaSelect',new $.imgAreaSelect(this,options))}});if(options.instance)return $(this).data('imgAreaSelect');return this}})(jQuery);
\ No newline at end of file
+(function(e){var b=Math.abs,a=Math.max,d=Math.min,c=Math.round;function f(){return e("<div/>")}e.imgAreaSelect=function(q,S){var aw=e(q),U,ar=f(),af=f(),H=f().add(f()).add(f()).add(f()),Y=f().add(f()).add(f()).add(f()),L=e([]),R,n,p,az,N,j,A,M,B=0,ad="absolute",Q,P,aa,Z,V=10,I,T,K,y,aA,x,ay,v={x1:0,y1:0,x2:0,y2:0,width:0,height:0},l,aq,am,ag,ac,an,u;function G(h){return h+az.left-M.left}function F(h){return h+az.top-M.top}function E(h){return h-az.left+M.left}function z(h){return h-az.top+M.top}function ak(h){return h.pageX-M.left}function ai(h){return h.pageY-M.top}function D(h){var o=h||aa,i=h||Z;return{x1:c(v.x1*o),y1:c(v.y1*i),x2:c(v.x2*o),y2:c(v.y2*i),width:c(v.x2*o)-c(v.x1*o),height:c(v.y2*i)-c(v.y1*i)}}function ae(i,w,h,o,aB){var aD=aB||aa,aC=aB||Z;v={x1:c(i/aD),y1:c(w/aC),x2:c(h/aD),y2:c(o/aC)};v.width=(h=G(v.x2))-(i=G(v.x1));v.height=(o=G(v.y2))-(w=G(v.y1))}function ao(){if(!aw.width()){return}az={left:c(aw.offset().left),top:c(aw.offset().top)};N=aw.width();j=aw.height();if(e().jquery=="1.3.2"&&e.browser.safari&&ad=="fixed"){az.top+=a(document.documentElement.scrollTop,e("body").scrollTop());az.left+=a(document.documentElement.scrollLeft,e("body").scrollLeft())}M=e.inArray(A.css("position"),["absolute","relative"])+1?{left:c(A.offset().left)-A.scrollLeft(),top:c(A.offset().top)-A.scrollTop()}:ad=="fixed"?{left:e(document).scrollLeft(),top:e(document).scrollTop()}:{left:0,top:0};n=G(0);p=F(0)}function X(h){if(!K){return}ar.css({left:G(v.x1),top:F(v.y1)}).add(af).width(ac=v.width).height(an=v.height);af.add(H).add(L).css({left:0,top:0});H.width(a(ac-H.outerWidth()+H.innerWidth(),0)).height(a(an-H.outerHeight()+H.innerHeight(),0));e(Y[0]).css({left:n,top:p,width:v.x1,height:j});e(Y[1]).css({left:n+v.x1,top:p,width:ac,height:v.y1});e(Y[2]).css({left:n+v.x2,top:p,width:N-v.x2,height:j});e(Y[3]).css({left:n+v.x1,top:p+v.y2,width:ac,height:j-v.y2});ac-=L.outerWidth();an-=L.outerHeight();switch(L.length){case 8:e(L[4]).css({left:ac/2});e(L[5]).css({left:ac,top:an/2});e(L[6]).css({left:ac/2,top:an});e(L[7]).css({top:an/2});case 4:L.slice(1,3).css({left:ac});L.slice(2,4).css({top:an})}if(h!==false){if(e.imgAreaSelect.keyPress!=at){e(document).unbind(e.imgAreaSelect.keyPress,e.imgAreaSelect.onKeyPress)}if(S.keys){e(document)[e.imgAreaSelect.keyPress](e.imgAreaSelect.onKeyPress=at)}}if(e.browser.msie&&H.outerWidth()-H.innerWidth()==2){H.css("margin",0);setTimeout(function(){H.css("margin","auto")},0)}}function t(h){ao();X(h);y=G(v.x1);aA=F(v.y1);x=G(v.x2);ay=F(v.y2)}function ah(h,i){S.fadeSpeed?h.fadeOut(S.fadeSpeed,i):h.hide()}function C(i){var h=E(ak(i))-v.x1,o=z(ai(i))-v.y1;if(!u){ao();u=true;ar.one("mouseout",function(){u=false})}I="";if(S.resizable){if(o<=V){I="n"}else{if(o>=v.height-V){I="s"}}if(h<=V){I+="w"}else{if(h>=v.width-V){I+="e"}}}ar.css("cursor",I?I+"-resize":S.movable?"move":"");if(R){R.toggle()}}function aj(h){e("body").css("cursor","");if(S.autoHide||v.width*v.height==0){ah(ar.add(Y),function(){e(this).hide()})}S.onSelectEnd(q,D());e(document).unbind("mousemove",ab);ar.mousemove(C)}function s(h){if(h.which!=1){return false}ao();if(I){e("body").css("cursor",I+"-resize");y=G(v[/w/.test(I)?"x2":"x1"]);aA=F(v[/n/.test(I)?"y2":"y1"]);e(document).mousemove(ab).one("mouseup",aj);ar.unbind("mousemove",C)}else{if(S.movable){Q=n+v.x1-ak(h);P=p+v.y1-ai(h);ar.unbind("mousemove",C);e(document).mousemove(g).one("mouseup",function(){S.onSelectEnd(q,D());e(document).unbind("mousemove",g);ar.mousemove(C)})}else{aw.mousedown(h)}}return false}function r(){x=a(n,d(n+N,y+b(ay-aA)*T*(x>y||-1)));ay=c(a(p,d(p+j,aA+b(x-y)/T*(ay>aA||-1))));x=c(x)}function al(){ay=a(p,d(p+j,aA+b(x-y)/T*(ay>aA||-1)));x=c(a(n,d(n+N,y+b(ay-aA)*T*(x>y||-1))));ay=c(ay)}function av(){if(b(x-y)<S.minWidth){x=y-S.minWidth*(x<y||-1);if(x<n){y=n+S.minWidth}else{if(x>n+N){y=n+N-S.minWidth}}}if(b(ay-aA)<S.minHeight){ay=aA-S.minHeight*(ay<aA||-1);if(ay<p){aA=p+S.minHeight}else{if(ay>p+j){aA=p+j-S.minHeight}}}x=a(n,d(x,n+N));ay=a(p,d(ay,p+j));if(T){if(b(x-y)/T>b(ay-aA)){al()}else{r()}}if(b(x-y)>S.maxWidth){x=y-S.maxWidth*(x<y||-1);if(T){al()}}if(b(ay-aA)>S.maxHeight){ay=aA-S.maxHeight*(ay<aA||-1);if(T){r()}}v={x1:E(d(y,x)),x2:E(a(y,x)),y1:z(d(aA,ay)),y2:z(a(aA,ay)),width:b(x-y),height:b(ay-aA)};X();S.onSelectChange(q,D())}function ab(h){x=I==""||/w|e/.test(I)||T?ak(h):G(v.x2);ay=I==""||/n|s/.test(I)||T?ai(h):F(v.y2);av();return false}function O(h,i){x=(y=h)+v.width;ay=(aA=i)+v.height;v=e.extend(v,{x1:E(y),y1:z(aA),x2:E(x),y2:z(ay)});X();S.onSelectChange(q,D())}function g(h){y=a(n,d(Q+ak(h),n+N-v.width));aA=a(p,d(P+ai(h),p+j-v.height));O(y,aA);h.preventDefault();return false}function ax(){ao();x=y;ay=aA;av();I="";if(Y.is(":not(:visible)")){ar.add(Y).hide().fadeIn(S.fadeSpeed||0)}K=true;e(document).unbind("mouseup",ap).mousemove(ab).one("mouseup",aj);ar.unbind("mousemove",C);S.onSelectStart(q,D())}function ap(){e(document).unbind("mousemove",ax);ah(ar.add(Y));v={x1:E(y),y1:z(aA),x2:E(y),y2:z(aA),width:0,height:0};S.onSelectChange(q,D());S.onSelectEnd(q,D())}function m(h){if(h.which!=1||Y.is(":animated")){return false}ao();Q=y=ak(h);P=aA=ai(h);e(document).one("mousemove",ax).one("mouseup",ap);return false}function W(){t(false)}function au(){U=true;J(S=e.extend({classPrefix:"imgareaselect",movable:true,resizable:true,parent:"body",onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},S));ar.add(Y).css({visibility:""});if(S.show){K=true;ao();X();ar.add(Y).hide().fadeIn(S.fadeSpeed||0)}setTimeout(function(){S.onInit(q,D())},0)}var at=function(w){var h=S.keys,aB,o,i=w.keyCode||w.which;aB=!isNaN(h.alt)&&(w.altKey||w.originalEvent.altKey)?h.alt:!isNaN(h.ctrl)&&w.ctrlKey?h.ctrl:!isNaN(h.shift)&&w.shiftKey?h.shift:!isNaN(h.arrows)?h.arrows:10;if(h.arrows=="resize"||(h.shift=="resize"&&w.shiftKey)||(h.ctrl=="resize"&&w.ctrlKey)||(h.alt=="resize"&&(w.altKey||w.originalEvent.altKey))){switch(i){case 37:aB=-aB;case 39:o=a(y,x);y=d(y,x);x=a(o+aB,y);if(T){al()}break;case 38:aB=-aB;case 40:o=a(aA,ay);aA=d(aA,ay);ay=a(o+aB,aA);if(T){r()}break;default:return}av()}else{y=d(y,x);aA=d(aA,ay);switch(i){case 37:O(a(y-aB,n),aA);break;case 38:O(y,a(aA-aB,p));break;case 39:O(y+d(aB,N-E(x)),aA);break;case 40:O(y,aA+d(aB,j-z(ay)));break;default:return}}return false};function k(h,i){for(option in i){if(S[option]!==undefined){h.css(i[option],S[option])}}}function J(h){if(h.parent){(A=e(h.parent)).append(ar.add(Y))}S=e.extend(S,h);ao();if(h.handles!=null){L.remove();L=e([]);am=h.handles?h.handles=="corners"?4:8:0;while(am--){L=L.add(f())}L.addClass(S.classPrefix+"-handle").css({position:"absolute",fontSize:0,zIndex:B+1||1});if(!parseInt(L.css("width"))){L.width(5).height(5)}if(ag=S.borderWidth){L.css({borderWidth:ag,borderStyle:"solid"})}k(L,{borderColor1:"border-color",borderColor2:"background-color",borderOpacity:"opacity"})}aa=S.imageWidth/N||1;Z=S.imageHeight/j||1;if(h.x1!=null){ae(h.x1,h.y1,h.x2,h.y2);h.show=!h.hide}if(h.keys){S.keys=e.extend({shift:1,ctrl:"resize"},h.keys)}Y.addClass(S.classPrefix+"-outer");af.addClass(S.classPrefix+"-selection");for(am=0;am++<4;){e(H[am-1]).addClass(S.classPrefix+"-border"+am)}k(af,{selectionColor:"background-color",selectionOpacity:"opacity"});k(H,{borderOpacity:"opacity",borderWidth:"border-width"});k(Y,{outerColor:"background-color",outerOpacity:"opacity"});if(ag=S.borderColor1){e(H[0]).css({borderStyle:"solid",borderColor:ag})}if(ag=S.borderColor2){e(H[1]).css({borderStyle:"dashed",borderColor:ag})}ar.append(af.add(H).add(L).add(R));if(e.browser.msie){if(ag=Y.css("filter").match(/opacity=([0-9]+)/)){Y.css("opacity",ag[1]/100)}if(ag=H.css("filter").match(/opacity=([0-9]+)/)){H.css("opacity",ag[1]/100)}}if(h.hide){ah(ar.add(Y))}else{if(h.show&&U){K=true;ar.add(Y).fadeIn(S.fadeSpeed||0);t()}}T=(aq=(S.aspectRatio||"").split(/:/))[0]/aq[1];if(S.disable||S.enable===false){ar.unbind("mousemove",C).unbind("mousedown",s);aw.add(Y).unbind("mousedown",m);e(window).unbind("resize",W);aw.add(aw.parents()).unbind("scroll",W)}else{if(S.enable||S.disable===false){if(S.resizable||S.movable){ar.mousemove(C).mousedown(s)}if(!S.persistent){aw.add(Y).mousedown(m)}e(window).resize(W);aw.add(aw.parents()).scroll(W)}}S.enable=S.disable=undefined}this.getOptions=function(){return S};this.setOptions=J;this.getSelection=D;this.setSelection=ae;this.update=t;l=aw;while(l.length&&!l.is("body")){if(!isNaN(l.css("z-index"))&&l.css("z-index")>B){B=l.css("z-index")}if(l.css("position")=="fixed"){ad="fixed"}l=l.parent()}if(!isNaN(S.zIndex)){B=S.zIndex}if(e.browser.msie){aw.attr("unselectable","on")}e.imgAreaSelect.keyPress=e.browser.msie||e.browser.safari?"keydown":"keypress";if(e.browser.opera){R=f().css({width:"100%",height:"100%",position:"absolute",zIndex:B+2||2})}ar.add(Y).css({visibility:"hidden",position:ad,overflow:"hidden",zIndex:B||"0"});ar.css({zIndex:B+2||2});af.add(H).css({position:"absolute"});q.complete||q.readyState=="complete"||!aw.is("img")?au():aw.one("load",au)};e.fn.imgAreaSelect=function(g){g=g||{};this.each(function(){if(e(this).data("imgAreaSelect")){e(this).data("imgAreaSelect").setOptions(g)}else{if(g.enable===undefined&&g.disable===undefined){g.enable=true}e(this).data("imgAreaSelect",new e.imgAreaSelect(this,g))}});if(g.instance){return e(this).data("imgAreaSelect")}return this}})(jQuery);
\ No newline at end of file
-/**
- * Jcrop v.0.9.8 (minimized)
- * (c) 2008 Kelly Hallman and DeepLiquid.com
- * More information: http://deepliquid.com/content/Jcrop.html
- * Released under MIT License - this header must remain with code
- */
-
-
-(function($){$.Jcrop=function(obj,opt)
-{var obj=obj,opt=opt;if(typeof(obj)!=='object')obj=$(obj)[0];if(typeof(opt)!=='object')opt={};if(!('trackDocument'in opt))
-{opt.trackDocument=$.browser.msie?false:true;if($.browser.msie&&$.browser.version.split('.')[0]=='8')
-opt.trackDocument=true;}
-if(!('keySupport'in opt))
-opt.keySupport=$.browser.msie?false:true;var defaults={trackDocument:false,baseClass:'jcrop',addClass:null,bgColor:'black',bgOpacity:.6,borderOpacity:.4,handleOpacity:.5,handlePad:5,handleSize:9,handleOffset:5,edgeMargin:14,aspectRatio:0,keySupport:true,cornerHandles:true,sideHandles:true,drawBorders:true,dragEdges:true,boxWidth:0,boxHeight:0,boundary:8,animationDelay:20,swingSpeed:3,allowSelect:true,allowMove:true,allowResize:true,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){}};var options=defaults;setOptions(opt);var $origimg=$(obj);var $img=$origimg.clone().removeAttr('id').css({position:'absolute'});$img.width($origimg.width());$img.height($origimg.height());$origimg.after($img).hide();presize($img,options.boxWidth,options.boxHeight);var boundx=$img.width(),boundy=$img.height(),$div=$('<div />').width(boundx).height(boundy).addClass(cssClass('holder')).css({position:'relative',backgroundColor:options.bgColor}).insertAfter($origimg).append($img);;if(options.addClass)$div.addClass(options.addClass);var $img2=$('<img />').attr('src',$img.attr('src')).css('position','absolute').width(boundx).height(boundy);var $img_holder=$('<div />').width(pct(100)).height(pct(100)).css({zIndex:310,position:'absolute',overflow:'hidden'}).append($img2);var $hdl_holder=$('<div />').width(pct(100)).height(pct(100)).css('zIndex',320);var $sel=$('<div />').css({position:'absolute',zIndex:300}).insertBefore($img).append($img_holder,$hdl_holder);var bound=options.boundary;var $trk=newTracker().width(boundx+(bound*2)).height(boundy+(bound*2)).css({position:'absolute',top:px(-bound),left:px(-bound),zIndex:290}).mousedown(newSelection);var xlimit,ylimit,xmin,ymin;var xscale,yscale,enabled=true;var docOffset=getPos($img),btndown,lastcurs,dimmed,animating,shift_down;var Coords=function()
-{var x1=0,y1=0,x2=0,y2=0,ox,oy;function setPressed(pos)
-{var pos=rebound(pos);x2=x1=pos[0];y2=y1=pos[1];};function setCurrent(pos)
-{var pos=rebound(pos);ox=pos[0]-x2;oy=pos[1]-y2;x2=pos[0];y2=pos[1];};function getOffset()
-{return[ox,oy];};function moveOffset(offset)
-{var ox=offset[0],oy=offset[1];if(0>x1+ox)ox-=ox+x1;if(0>y1+oy)oy-=oy+y1;if(boundy<y2+oy)oy+=boundy-(y2+oy);if(boundx<x2+ox)ox+=boundx-(x2+ox);x1+=ox;x2+=ox;y1+=oy;y2+=oy;};function getCorner(ord)
-{var c=getFixed();switch(ord)
-{case'ne':return[c.x2,c.y];case'nw':return[c.x,c.y];case'se':return[c.x2,c.y2];case'sw':return[c.x,c.y2];}};function getFixed()
-{if(!options.aspectRatio)return getRect();var aspect=options.aspectRatio,min_x=options.minSize[0]/xscale,min_y=options.minSize[1]/yscale,max_x=options.maxSize[0]/xscale,max_y=options.maxSize[1]/yscale,rw=x2-x1,rh=y2-y1,rwa=Math.abs(rw),rha=Math.abs(rh),real_ratio=rwa/rha,xx,yy;if(max_x==0){max_x=boundx*10}
-if(max_y==0){max_y=boundy*10}
-if(real_ratio<aspect)
-{yy=y2;w=rha*aspect;xx=rw<0?x1-w:w+x1;if(xx<0)
-{xx=0;h=Math.abs((xx-x1)/aspect);yy=rh<0?y1-h:h+y1;}
-else if(xx>boundx)
-{xx=boundx;h=Math.abs((xx-x1)/aspect);yy=rh<0?y1-h:h+y1;}}
-else
-{xx=x2;h=rwa/aspect;yy=rh<0?y1-h:y1+h;if(yy<0)
-{yy=0;w=Math.abs((yy-y1)*aspect);xx=rw<0?x1-w:w+x1;}
-else if(yy>boundy)
-{yy=boundy;w=Math.abs(yy-y1)*aspect;xx=rw<0?x1-w:w+x1;}}
-if(xx>x1){if(xx-x1<min_x){xx=x1+min_x;}else if(xx-x1>max_x){xx=x1+max_x;}
-if(yy>y1){yy=y1+(xx-x1)/aspect;}else{yy=y1-(xx-x1)/aspect;}}else if(xx<x1){if(x1-xx<min_x){xx=x1-min_x}else if(x1-xx>max_x){xx=x1-max_x;}
-if(yy>y1){yy=y1+(x1-xx)/aspect;}else{yy=y1-(x1-xx)/aspect;}}
-if(xx<0){x1-=xx;xx=0;}else if(xx>boundx){x1-=xx-boundx;xx=boundx;}
-if(yy<0){y1-=yy;yy=0;}else if(yy>boundy){y1-=yy-boundy;yy=boundy;}
-return last=makeObj(flipCoords(x1,y1,xx,yy));};function rebound(p)
-{if(p[0]<0)p[0]=0;if(p[1]<0)p[1]=0;if(p[0]>boundx)p[0]=boundx;if(p[1]>boundy)p[1]=boundy;return[p[0],p[1]];};function flipCoords(x1,y1,x2,y2)
-{var xa=x1,xb=x2,ya=y1,yb=y2;if(x2<x1)
-{xa=x2;xb=x1;}
-if(y2<y1)
-{ya=y2;yb=y1;}
-return[Math.round(xa),Math.round(ya),Math.round(xb),Math.round(yb)];};function getRect()
-{var xsize=x2-x1;var ysize=y2-y1;if(xlimit&&(Math.abs(xsize)>xlimit))
-x2=(xsize>0)?(x1+xlimit):(x1-xlimit);if(ylimit&&(Math.abs(ysize)>ylimit))
-y2=(ysize>0)?(y1+ylimit):(y1-ylimit);if(ymin&&(Math.abs(ysize)<ymin))
-y2=(ysize>0)?(y1+ymin):(y1-ymin);if(xmin&&(Math.abs(xsize)<xmin))
-x2=(xsize>0)?(x1+xmin):(x1-xmin);if(x1<0){x2-=x1;x1-=x1;}
-if(y1<0){y2-=y1;y1-=y1;}
-if(x2<0){x1-=x2;x2-=x2;}
-if(y2<0){y1-=y2;y2-=y2;}
-if(x2>boundx){var delta=x2-boundx;x1-=delta;x2-=delta;}
-if(y2>boundy){var delta=y2-boundy;y1-=delta;y2-=delta;}
-if(x1>boundx){var delta=x1-boundy;y2-=delta;y1-=delta;}
-if(y1>boundy){var delta=y1-boundy;y2-=delta;y1-=delta;}
-return makeObj(flipCoords(x1,y1,x2,y2));};function makeObj(a)
-{return{x:a[0],y:a[1],x2:a[2],y2:a[3],w:a[2]-a[0],h:a[3]-a[1]};};return{flipCoords:flipCoords,setPressed:setPressed,setCurrent:setCurrent,getOffset:getOffset,moveOffset:moveOffset,getCorner:getCorner,getFixed:getFixed};}();var Selection=function()
-{var start,end,dragmode,awake,hdep=370;var borders={};var handle={};var seehandles=false;var hhs=options.handleOffset;if(options.drawBorders){borders={top:insertBorder('hline').css('top',$.browser.msie?px(-1):px(0)),bottom:insertBorder('hline'),left:insertBorder('vline'),right:insertBorder('vline')};}
-if(options.dragEdges){handle.t=insertDragbar('n');handle.b=insertDragbar('s');handle.r=insertDragbar('e');handle.l=insertDragbar('w');}
-options.sideHandles&&createHandles(['n','s','e','w']);options.cornerHandles&&createHandles(['sw','nw','ne','se']);function insertBorder(type)
-{var jq=$('<div />').css({position:'absolute',opacity:options.borderOpacity}).addClass(cssClass(type));$img_holder.append(jq);return jq;};function dragDiv(ord,zi)
-{var jq=$('<div />').mousedown(createDragger(ord)).css({cursor:ord+'-resize',position:'absolute',zIndex:zi});$hdl_holder.append(jq);return jq;};function insertHandle(ord)
-{return dragDiv(ord,hdep++).css({top:px(-hhs+1),left:px(-hhs+1),opacity:options.handleOpacity}).addClass(cssClass('handle'));};function insertDragbar(ord)
-{var s=options.handleSize,o=hhs,h=s,w=s,t=o,l=o;switch(ord)
-{case'n':case's':w=pct(100);break;case'e':case'w':h=pct(100);break;}
-return dragDiv(ord,hdep++).width(w).height(h).css({top:px(-t+1),left:px(-l+1)});};function createHandles(li)
-{for(i in li)handle[li[i]]=insertHandle(li[i]);};function moveHandles(c)
-{var midvert=Math.round((c.h/2)-hhs),midhoriz=Math.round((c.w/2)-hhs),north=west=-hhs+1,east=c.w-hhs,south=c.h-hhs,x,y;'e'in handle&&handle.e.css({top:px(midvert),left:px(east)})&&handle.w.css({top:px(midvert)})&&handle.s.css({top:px(south),left:px(midhoriz)})&&handle.n.css({left:px(midhoriz)});'ne'in handle&&handle.ne.css({left:px(east)})&&handle.se.css({top:px(south),left:px(east)})&&handle.sw.css({top:px(south)});'b'in handle&&handle.b.css({top:px(south)})&&handle.r.css({left:px(east)});};function moveto(x,y)
-{$img2.css({top:px(-y),left:px(-x)});$sel.css({top:px(y),left:px(x)});};function resize(w,h)
-{$sel.width(w).height(h);};function refresh()
-{var c=Coords.getFixed();Coords.setPressed([c.x,c.y]);Coords.setCurrent([c.x2,c.y2]);updateVisible();};function updateVisible()
-{if(awake)return update();};function update()
-{var c=Coords.getFixed();resize(c.w,c.h);moveto(c.x,c.y);options.drawBorders&&borders['right'].css({left:px(c.w-1)})&&borders['bottom'].css({top:px(c.h-1)});seehandles&&moveHandles(c);awake||show();options.onChange(unscale(c));};function show()
-{$sel.show();$img.css('opacity',options.bgOpacity);awake=true;};function release()
-{disableHandles();$sel.hide();$img.css('opacity',1);awake=false;};function showHandles()
-{if(seehandles)
-{moveHandles(Coords.getFixed());$hdl_holder.show();}};function enableHandles()
-{seehandles=true;if(options.allowResize)
-{moveHandles(Coords.getFixed());$hdl_holder.show();return true;}};function disableHandles()
-{seehandles=false;$hdl_holder.hide();};function animMode(v)
-{(animating=v)?disableHandles():enableHandles();};function done()
-{animMode(false);refresh();};var $track=newTracker().mousedown(createDragger('move')).css({cursor:'move',position:'absolute',zIndex:360})
-$img_holder.append($track);disableHandles();return{updateVisible:updateVisible,update:update,release:release,refresh:refresh,setCursor:function(cursor){$track.css('cursor',cursor);},enableHandles:enableHandles,enableOnly:function(){seehandles=true;},showHandles:showHandles,disableHandles:disableHandles,animMode:animMode,done:done};}();var Tracker=function()
-{var onMove=function(){},onDone=function(){},trackDoc=options.trackDocument;if(!trackDoc)
-{$trk.mousemove(trackMove).mouseup(trackUp).mouseout(trackUp);}
-function toFront()
-{$trk.css({zIndex:450});if(trackDoc)
-{$(document).mousemove(trackMove).mouseup(trackUp);}}
-function toBack()
-{$trk.css({zIndex:290});if(trackDoc)
-{$(document).unbind('mousemove',trackMove).unbind('mouseup',trackUp);}}
-function trackMove(e)
-{onMove(mouseAbs(e));};function trackUp(e)
-{e.preventDefault();e.stopPropagation();if(btndown)
-{btndown=false;onDone(mouseAbs(e));options.onSelect(unscale(Coords.getFixed()));toBack();onMove=function(){};onDone=function(){};}
-return false;};function activateHandlers(move,done)
-{btndown=true;onMove=move;onDone=done;toFront();return false;};function setCursor(t){$trk.css('cursor',t);};$img.before($trk);return{activateHandlers:activateHandlers,setCursor:setCursor};}();var KeyManager=function()
-{var $keymgr=$('<input type="radio" />').css({position:'absolute',left:'-30px'}).keypress(parseKey).blur(onBlur),$keywrap=$('<div />').css({position:'absolute',overflow:'hidden'}).append($keymgr);function watchKeys()
-{if(options.keySupport)
-{$keymgr.show();$keymgr.focus();}};function onBlur(e)
-{$keymgr.hide();};function doNudge(e,x,y)
-{if(options.allowMove){Coords.moveOffset([x,y]);Selection.updateVisible();};e.preventDefault();e.stopPropagation();};function parseKey(e)
-{if(e.ctrlKey)return true;shift_down=e.shiftKey?true:false;var nudge=shift_down?10:1;switch(e.keyCode)
-{case 37:doNudge(e,-nudge,0);break;case 39:doNudge(e,nudge,0);break;case 38:doNudge(e,0,-nudge);break;case 40:doNudge(e,0,nudge);break;case 27:Selection.release();break;case 9:return true;}
-return nothing(e);};if(options.keySupport)$keywrap.insertBefore($img);return{watchKeys:watchKeys};}();function px(n){return''+parseInt(n)+'px';};function pct(n){return''+parseInt(n)+'%';};function cssClass(cl){return options.baseClass+'-'+cl;};function getPos(obj)
-{var pos=$(obj).offset();return[pos.left,pos.top];};function mouseAbs(e)
-{return[(e.pageX-docOffset[0]),(e.pageY-docOffset[1])];};function myCursor(type)
-{if(type!=lastcurs)
-{Tracker.setCursor(type);lastcurs=type;}};function startDragMode(mode,pos)
-{docOffset=getPos($img);Tracker.setCursor(mode=='move'?mode:mode+'-resize');if(mode=='move')
-return Tracker.activateHandlers(createMover(pos),doneSelect);var fc=Coords.getFixed();var opp=oppLockCorner(mode);var opc=Coords.getCorner(oppLockCorner(opp));Coords.setPressed(Coords.getCorner(opp));Coords.setCurrent(opc);Tracker.activateHandlers(dragmodeHandler(mode,fc),doneSelect);};function dragmodeHandler(mode,f)
-{return function(pos){if(!options.aspectRatio)switch(mode)
-{case'e':pos[1]=f.y2;break;case'w':pos[1]=f.y2;break;case'n':pos[0]=f.x2;break;case's':pos[0]=f.x2;break;}
-else switch(mode)
-{case'e':pos[1]=f.y+1;break;case'w':pos[1]=f.y+1;break;case'n':pos[0]=f.x+1;break;case's':pos[0]=f.x+1;break;}
-Coords.setCurrent(pos);Selection.update();};};function createMover(pos)
-{var lloc=pos;KeyManager.watchKeys();return function(pos)
-{Coords.moveOffset([pos[0]-lloc[0],pos[1]-lloc[1]]);lloc=pos;Selection.update();};};function oppLockCorner(ord)
-{switch(ord)
-{case'n':return'sw';case's':return'nw';case'e':return'nw';case'w':return'ne';case'ne':return'sw';case'nw':return'se';case'se':return'nw';case'sw':return'ne';};};function createDragger(ord)
-{return function(e){if(options.disabled)return false;if((ord=='move')&&!options.allowMove)return false;btndown=true;startDragMode(ord,mouseAbs(e));e.stopPropagation();e.preventDefault();return false;};};function presize($obj,w,h)
-{var nw=$obj.width(),nh=$obj.height();if((nw>w)&&w>0)
-{nw=w;nh=(w/$obj.width())*$obj.height();}
-if((nh>h)&&h>0)
-{nh=h;nw=(h/$obj.height())*$obj.width();}
-xscale=$obj.width()/nw;yscale=$obj.height()/nh;$obj.width(nw).height(nh);};function unscale(c)
-{return{x:parseInt(c.x*xscale),y:parseInt(c.y*yscale),x2:parseInt(c.x2*xscale),y2:parseInt(c.y2*yscale),w:parseInt(c.w*xscale),h:parseInt(c.h*yscale)};};function doneSelect(pos)
-{var c=Coords.getFixed();if(c.w>options.minSelect[0]&&c.h>options.minSelect[1])
-{Selection.enableHandles();Selection.done();}
-else
-{Selection.release();}
-Tracker.setCursor(options.allowSelect?'crosshair':'default');};function newSelection(e)
-{if(options.disabled)return false;if(!options.allowSelect)return false;btndown=true;docOffset=getPos($img);Selection.disableHandles();myCursor('crosshair');var pos=mouseAbs(e);Coords.setPressed(pos);Tracker.activateHandlers(selectDrag,doneSelect);KeyManager.watchKeys();Selection.update();e.stopPropagation();e.preventDefault();return false;};function selectDrag(pos)
-{Coords.setCurrent(pos);Selection.update();};function newTracker()
-{var trk=$('<div></div>').addClass(cssClass('tracker'));$.browser.msie&&trk.css({opacity:0,backgroundColor:'white'});return trk;};function animateTo(a)
-{var x1=a[0]/xscale,y1=a[1]/yscale,x2=a[2]/xscale,y2=a[3]/yscale;if(animating)return;var animto=Coords.flipCoords(x1,y1,x2,y2);var c=Coords.getFixed();var animat=initcr=[c.x,c.y,c.x2,c.y2];var interv=options.animationDelay;var x=animat[0];var y=animat[1];var x2=animat[2];var y2=animat[3];var ix1=animto[0]-initcr[0];var iy1=animto[1]-initcr[1];var ix2=animto[2]-initcr[2];var iy2=animto[3]-initcr[3];var pcent=0;var velocity=options.swingSpeed;Selection.animMode(true);var animator=function()
-{return function()
-{pcent+=(100-pcent)/velocity;animat[0]=x+((pcent/100)*ix1);animat[1]=y+((pcent/100)*iy1);animat[2]=x2+((pcent/100)*ix2);animat[3]=y2+((pcent/100)*iy2);if(pcent<100)animateStart();else Selection.done();if(pcent>=99.8)pcent=100;setSelectRaw(animat);};}();function animateStart()
-{window.setTimeout(animator,interv);};animateStart();};function setSelect(rect)
-{setSelectRaw([rect[0]/xscale,rect[1]/yscale,rect[2]/xscale,rect[3]/yscale]);};function setSelectRaw(l)
-{Coords.setPressed([l[0],l[1]]);Coords.setCurrent([l[2],l[3]]);Selection.update();};function setOptions(opt)
-{if(typeof(opt)!='object')opt={};options=$.extend(options,opt);if(typeof(options.onChange)!=='function')
-options.onChange=function(){};if(typeof(options.onSelect)!=='function')
-options.onSelect=function(){};};function tellSelect()
-{return unscale(Coords.getFixed());};function tellScaled()
-{return Coords.getFixed();};function setOptionsNew(opt)
-{setOptions(opt);interfaceUpdate();};function disableCrop()
-{options.disabled=true;Selection.disableHandles();Selection.setCursor('default');Tracker.setCursor('default');};function enableCrop()
-{options.disabled=false;interfaceUpdate();};function cancelCrop()
-{Selection.done();Tracker.activateHandlers(null,null);};function destroy()
-{$div.remove();$origimg.show();};function interfaceUpdate(alt)
-{options.allowResize?alt?Selection.enableOnly():Selection.enableHandles():Selection.disableHandles();Tracker.setCursor(options.allowSelect?'crosshair':'default');Selection.setCursor(options.allowMove?'move':'default');$div.css('backgroundColor',options.bgColor);if('setSelect'in options){setSelect(opt.setSelect);Selection.done();delete(options.setSelect);}
-if('trueSize'in options){xscale=options.trueSize[0]/boundx;yscale=options.trueSize[1]/boundy;}
-xlimit=options.maxSize[0]||0;ylimit=options.maxSize[1]||0;xmin=options.minSize[0]||0;ymin=options.minSize[1]||0;if('outerImage'in options)
-{$img.attr('src',options.outerImage);delete(options.outerImage);}
-Selection.refresh();};$hdl_holder.hide();interfaceUpdate(true);var api={animateTo:animateTo,setSelect:setSelect,setOptions:setOptionsNew,tellSelect:tellSelect,tellScaled:tellScaled,disable:disableCrop,enable:enableCrop,cancel:cancelCrop,focus:KeyManager.watchKeys,getBounds:function(){return[boundx*xscale,boundy*yscale];},getWidgetSize:function(){return[boundx,boundy];},release:Selection.release,destroy:destroy};$origimg.data('Jcrop',api);return api;};$.fn.Jcrop=function(options)
-{function attachWhenDone(from)
-{var loadsrc=options.useImg||from.src;var img=new Image();img.onload=function(){$.Jcrop(from,options);};img.src=loadsrc;};if(typeof(options)!=='object')options={};this.each(function()
-{if($(this).data('Jcrop'))
-{if(options=='api')return $(this).data('Jcrop');else $(this).data('Jcrop').setOptions(options);}
-else attachWhenDone(this);});return this;};})(jQuery);
\ No newline at end of file
+(function(a){a.Jcrop=function(d,A){var d=d,A=A;if(typeof(d)!=="object"){d=a(d)[0]}if(typeof(A)!=="object"){A={}}if(!("trackDocument" in A)){A.trackDocument=a.browser.msie?false:true;if(a.browser.msie&&a.browser.version.split(".")[0]=="8"){A.trackDocument=true}}if(!("keySupport" in A)){A.keySupport=a.browser.msie?false:true}var U={trackDocument:false,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:0.6,borderOpacity:0.4,handleOpacity:0.5,handlePad:5,handleSize:9,handleOffset:5,edgeMargin:14,aspectRatio:0,keySupport:true,cornerHandles:true,sideHandles:true,drawBorders:true,dragEdges:true,boxWidth:0,boxHeight:0,boundary:8,animationDelay:20,swingSpeed:3,allowSelect:true,allowMove:true,allowResize:true,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){}};var H=U;z(A);var W=a(d);var al=W.clone().removeAttr("id").css({position:"absolute"});al.width(W.width());al.height(W.height());W.after(al).hide();T(al,H.boxWidth,H.boxHeight);var Q=al.width(),O=al.height(),Z=a("<div />").width(Q).height(O).addClass(C("holder")).css({position:"relative",backgroundColor:H.bgColor}).insertAfter(W).append(al);if(H.addClass){Z.addClass(H.addClass)}var I=a("<img />").attr("src",al.attr("src")).css("position","absolute").width(Q).height(O);var k=a("<div />").width(K(100)).height(K(100)).css({zIndex:310,position:"absolute",overflow:"hidden"}).append(I);var L=a("<div />").width(K(100)).height(K(100)).css("zIndex",320);var y=a("<div />").css({position:"absolute",zIndex:300}).insertBefore(al).append(k,L);var t=H.boundary;var b=ae().width(Q+(t*2)).height(O+(t*2)).css({position:"absolute",top:l(-t),left:l(-t),zIndex:290}).mousedown(ac);var x,ah,p,S;var M,e,n=true;var ad=D(al),r,an,am,B,ab;var aa=function(){var aq=0,aC=0,ap=0,aB=0,au,ar;function aw(aF){var aF=at(aF);ap=aq=aF[0];aB=aC=aF[1]}function av(aF){var aF=at(aF);au=aF[0]-ap;ar=aF[1]-aB;ap=aF[0];aB=aF[1]}function aE(){return[au,ar]}function ao(aH){var aG=aH[0],aF=aH[1];if(0>aq+aG){aG-=aG+aq}if(0>aC+aF){aF-=aF+aC}if(O<aB+aF){aF+=O-(aB+aF)}if(Q<ap+aG){aG+=Q-(ap+aG)}aq+=aG;ap+=aG;aC+=aF;aB+=aF}function ax(aF){var aG=aD();switch(aF){case"ne":return[aG.x2,aG.y];case"nw":return[aG.x,aG.y];case"se":return[aG.x2,aG.y2];case"sw":return[aG.x,aG.y2]}}function aD(){if(!H.aspectRatio){return aA()}var aH=H.aspectRatio,aO=H.minSize[0]/M,aN=H.minSize[1]/e,aG=H.maxSize[0]/M,aQ=H.maxSize[1]/e,aI=ap-aq,aP=aB-aC,aJ=Math.abs(aI),aK=Math.abs(aP),aL=aJ/aK,aF,aM;if(aG==0){aG=Q*10}if(aQ==0){aQ=O*10}if(aL<aH){aM=aB;w=aK*aH;aF=aI<0?aq-w:w+aq;if(aF<0){aF=0;h=Math.abs((aF-aq)/aH);aM=aP<0?aC-h:h+aC}else{if(aF>Q){aF=Q;h=Math.abs((aF-aq)/aH);aM=aP<0?aC-h:h+aC}}}else{aF=ap;h=aJ/aH;aM=aP<0?aC-h:aC+h;if(aM<0){aM=0;w=Math.abs((aM-aC)*aH);aF=aI<0?aq-w:w+aq}else{if(aM>O){aM=O;w=Math.abs(aM-aC)*aH;aF=aI<0?aq-w:w+aq}}}if(aF>aq){if(aF-aq<aO){aF=aq+aO}else{if(aF-aq>aG){aF=aq+aG}}if(aM>aC){aM=aC+(aF-aq)/aH}else{aM=aC-(aF-aq)/aH}}else{if(aF<aq){if(aq-aF<aO){aF=aq-aO}else{if(aq-aF>aG){aF=aq-aG}}if(aM>aC){aM=aC+(aq-aF)/aH}else{aM=aC-(aq-aF)/aH}}}if(aF<0){aq-=aF;aF=0}else{if(aF>Q){aq-=aF-Q;aF=Q}}if(aM<0){aC-=aM;aM=0}else{if(aM>O){aC-=aM-O;aM=O}}return last=az(ay(aq,aC,aF,aM))}function at(aF){if(aF[0]<0){aF[0]=0}if(aF[1]<0){aF[1]=0}if(aF[0]>Q){aF[0]=Q}if(aF[1]>O){aF[1]=O}return[aF[0],aF[1]]}function ay(aI,aK,aH,aJ){var aM=aI,aL=aH,aG=aK,aF=aJ;if(aH<aI){aM=aH;aL=aI}if(aJ<aK){aG=aJ;aF=aK}return[Math.round(aM),Math.round(aG),Math.round(aL),Math.round(aF)]}function aA(){var aG=ap-aq;var aF=aB-aC;if(x&&(Math.abs(aG)>x)){ap=(aG>0)?(aq+x):(aq-x)}if(ah&&(Math.abs(aF)>ah)){aB=(aF>0)?(aC+ah):(aC-ah)}if(S&&(Math.abs(aF)<S)){aB=(aF>0)?(aC+S):(aC-S)}if(p&&(Math.abs(aG)<p)){ap=(aG>0)?(aq+p):(aq-p)}if(aq<0){ap-=aq;aq-=aq}if(aC<0){aB-=aC;aC-=aC}if(ap<0){aq-=ap;ap-=ap}if(aB<0){aC-=aB;aB-=aB}if(ap>Q){var aH=ap-Q;aq-=aH;ap-=aH}if(aB>O){var aH=aB-O;aC-=aH;aB-=aH}if(aq>Q){var aH=aq-O;aB-=aH;aC-=aH}if(aC>O){var aH=aC-O;aB-=aH;aC-=aH}return az(ay(aq,aC,ap,aB))}function az(aF){return{x:aF[0],y:aF[1],x2:aF[2],y2:aF[3],w:aF[2]-aF[0],h:aF[3]-aF[1]}}return{flipCoords:ay,setPressed:aw,setCurrent:av,getOffset:aE,moveOffset:ao,getCorner:ax,getFixed:aD}}();var X=function(){var aw,ar,aC,aB,aK=370;var av={};var aO={};var aq=false;var aA=H.handleOffset;if(H.drawBorders){av={top:ax("hline").css("top",a.browser.msie?l(-1):l(0)),bottom:ax("hline"),left:ax("vline"),right:ax("vline")}}if(H.dragEdges){aO.t=aJ("n");aO.b=aJ("s");aO.r=aJ("e");aO.l=aJ("w")}H.sideHandles&&aF(["n","s","e","w"]);H.cornerHandles&&aF(["sw","nw","ne","se"]);function ax(aR){var aS=a("<div />").css({position:"absolute",opacity:H.borderOpacity}).addClass(C(aR));k.append(aS);return aS}function ap(aR,aS){var aT=a("<div />").mousedown(c(aR)).css({cursor:aR+"-resize",position:"absolute",zIndex:aS});L.append(aT);return aT}function aD(aR){return ap(aR,aK++).css({top:l(-aA+1),left:l(-aA+1),opacity:H.handleOpacity}).addClass(C("handle"))}function aJ(aT){var aW=H.handleSize,aX=aA,aV=aW,aS=aW,aU=aX,aR=aX;switch(aT){case"n":case"s":aS=K(100);break;case"e":case"w":aV=K(100);break}return ap(aT,aK++).width(aS).height(aV).css({top:l(-aU+1),left:l(-aR+1)})}function aF(aR){for(i in aR){aO[aR[i]]=aD(aR[i])}}function aH(aY){var aT=Math.round((aY.h/2)-aA),aS=Math.round((aY.w/2)-aA),aW=west=-aA+1,aV=aY.w-aA,aU=aY.h-aA,aR,aX;"e" in aO&&aO.e.css({top:l(aT),left:l(aV)})&&aO.w.css({top:l(aT)})&&aO.s.css({top:l(aU),left:l(aS)})&&aO.n.css({left:l(aS)});"ne" in aO&&aO.ne.css({left:l(aV)})&&aO.se.css({top:l(aU),left:l(aV)})&&aO.sw.css({top:l(aU)});"b" in aO&&aO.b.css({top:l(aU)})&&aO.r.css({left:l(aV)})}function az(aR,aS){I.css({top:l(-aS),left:l(-aR)});y.css({top:l(aS),left:l(aR)})}function aQ(aR,aS){y.width(aR).height(aS)}function at(){var aR=aa.getFixed();aa.setPressed([aR.x,aR.y]);aa.setCurrent([aR.x2,aR.y2]);aN()}function aN(){if(aB){return ay()}}function ay(){var aR=aa.getFixed();aQ(aR.w,aR.h);az(aR.x,aR.y);H.drawBorders&&av.right.css({left:l(aR.w-1)})&&av.bottom.css({top:l(aR.h-1)});aq&&aH(aR);aB||aP();H.onChange(Y(aR))}function aP(){y.show();al.css("opacity",H.bgOpacity);aB=true}function aL(){aM();y.hide();al.css("opacity",1);aB=false}function ao(){if(aq){aH(aa.getFixed());L.show()}}function aG(){aq=true;if(H.allowResize){aH(aa.getFixed());L.show();return true}}function aM(){aq=false;L.hide()}function aI(aR){(B=aR)?aM():aG()}function aE(){aI(false);at()}var au=ae().mousedown(c("move")).css({cursor:"move",position:"absolute",zIndex:360});k.append(au);aM();return{updateVisible:aN,update:ay,release:aL,refresh:at,setCursor:function(aR){au.css("cursor",aR)},enableHandles:aG,enableOnly:function(){aq=true},showHandles:ao,disableHandles:aM,animMode:aI,done:aE}}();var P=function(){var ap=function(){},ar=function(){},aq=H.trackDocument;if(!aq){b.mousemove(ao).mouseup(at).mouseout(at)}function ax(){b.css({zIndex:450});if(aq){a(document).mousemove(ao).mouseup(at)}}function aw(){b.css({zIndex:290});if(aq){a(document).unbind("mousemove",ao).unbind("mouseup",at)}}function ao(ay){ap(F(ay))}function at(ay){ay.preventDefault();ay.stopPropagation();if(r){r=false;ar(F(ay));H.onSelect(Y(aa.getFixed()));aw();ap=function(){};ar=function(){}}return false}function au(az,ay){r=true;ap=az;ar=ay;ax();return false}function av(ay){b.css("cursor",ay)}al.before(b);return{activateHandlers:au,setCursor:av}}();var ak=function(){var ar=a('<input type="radio" />').css({position:"absolute",left:"-30px"}).keypress(ao).blur(at),au=a("<div />").css({position:"absolute",overflow:"hidden"}).append(ar);function ap(){if(H.keySupport){ar.show();ar.focus()}}function at(av){ar.hide()}function aq(aw,av,ax){if(H.allowMove){aa.moveOffset([av,ax]);X.updateVisible()}aw.preventDefault();aw.stopPropagation()}function ao(aw){if(aw.ctrlKey){return true}ab=aw.shiftKey?true:false;var av=ab?10:1;switch(aw.keyCode){case 37:aq(aw,-av,0);break;case 39:aq(aw,av,0);break;case 38:aq(aw,0,-av);break;case 40:aq(aw,0,av);break;case 27:X.release();break;case 9:return true}return nothing(aw)}if(H.keySupport){au.insertBefore(al)}return{watchKeys:ap}}();function l(ao){return""+parseInt(ao)+"px"}function K(ao){return""+parseInt(ao)+"%"}function C(ao){return H.baseClass+"-"+ao}function D(ao){var ap=a(ao).offset();return[ap.left,ap.top]}function F(ao){return[(ao.pageX-ad[0]),(ao.pageY-ad[1])]}function E(ao){if(ao!=an){P.setCursor(ao);an=ao}}function f(aq,at){ad=D(al);P.setCursor(aq=="move"?aq:aq+"-resize");if(aq=="move"){return P.activateHandlers(R(at),o)}var ao=aa.getFixed();var ap=q(aq);var ar=aa.getCorner(q(ap));aa.setPressed(aa.getCorner(ap));aa.setCurrent(ar);P.activateHandlers(G(aq,ao),o)}function G(ap,ao){return function(aq){if(!H.aspectRatio){switch(ap){case"e":aq[1]=ao.y2;break;case"w":aq[1]=ao.y2;break;case"n":aq[0]=ao.x2;break;case"s":aq[0]=ao.x2;break}}else{switch(ap){case"e":aq[1]=ao.y+1;break;case"w":aq[1]=ao.y+1;break;case"n":aq[0]=ao.x+1;break;case"s":aq[0]=ao.x+1;break}}aa.setCurrent(aq);X.update()}}function R(ap){var ao=ap;ak.watchKeys();return function(aq){aa.moveOffset([aq[0]-ao[0],aq[1]-ao[1]]);ao=aq;X.update()}}function q(ao){switch(ao){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function c(ao){return function(ap){if(H.disabled){return false}if((ao=="move")&&!H.allowMove){return false}r=true;f(ao,F(ap));ap.stopPropagation();ap.preventDefault();return false}}function T(at,ap,ar){var ao=at.width(),aq=at.height();if((ao>ap)&&ap>0){ao=ap;aq=(ap/at.width())*at.height()}if((aq>ar)&&ar>0){aq=ar;ao=(ar/at.height())*at.width()}M=at.width()/ao;e=at.height()/aq;at.width(ao).height(aq)}function Y(ao){return{x:parseInt(ao.x*M),y:parseInt(ao.y*e),x2:parseInt(ao.x2*M),y2:parseInt(ao.y2*e),w:parseInt(ao.w*M),h:parseInt(ao.h*e)}}function o(ap){var ao=aa.getFixed();if(ao.w>H.minSelect[0]&&ao.h>H.minSelect[1]){X.enableHandles();X.done()}else{X.release()}P.setCursor(H.allowSelect?"crosshair":"default")}function ac(ao){if(H.disabled){return false}if(!H.allowSelect){return false}r=true;ad=D(al);X.disableHandles();E("crosshair");var ap=F(ao);aa.setPressed(ap);P.activateHandlers(aj,o);ak.watchKeys();X.update();ao.stopPropagation();ao.preventDefault();return false}function aj(ao){aa.setCurrent(ao);X.update()}function ae(){var ao=a("<div></div>").addClass(C("tracker"));a.browser.msie&&ao.css({opacity:0,backgroundColor:"white"});return ao}function s(aG){var aB=aG[0]/M,ap=aG[1]/e,aA=aG[2]/M,ao=aG[3]/e;if(B){return}var az=aa.flipCoords(aB,ap,aA,ao);var aE=aa.getFixed();var ar=initcr=[aE.x,aE.y,aE.x2,aE.y2];var aq=H.animationDelay;var ax=ar[0];var aw=ar[1];var aA=ar[2];var ao=ar[3];var aD=az[0]-initcr[0];var au=az[1]-initcr[1];var aC=az[2]-initcr[2];var at=az[3]-initcr[3];var ay=0;var av=H.swingSpeed;X.animMode(true);var aF=function(){return function(){ay+=(100-ay)/av;ar[0]=ax+((ay/100)*aD);ar[1]=aw+((ay/100)*au);ar[2]=aA+((ay/100)*aC);ar[3]=ao+((ay/100)*at);if(ay<100){aH()}else{X.done()}if(ay>=99.8){ay=100}ai(ar)}}();function aH(){window.setTimeout(aF,aq)}aH()}function J(ao){ai([ao[0]/M,ao[1]/e,ao[2]/M,ao[3]/e])}function ai(ao){aa.setPressed([ao[0],ao[1]]);aa.setCurrent([ao[2],ao[3]]);X.update()}function z(ao){if(typeof(ao)!="object"){ao={}}H=a.extend(H,ao);if(typeof(H.onChange)!=="function"){H.onChange=function(){}}if(typeof(H.onSelect)!=="function"){H.onSelect=function(){}}}function j(){return Y(aa.getFixed())}function ag(){return aa.getFixed()}function u(ao){z(ao);N()}function v(){H.disabled=true;X.disableHandles();X.setCursor("default");P.setCursor("default")}function V(){H.disabled=false;N()}function m(){X.done();P.activateHandlers(null,null)}function af(){Z.remove();W.show()}function N(ao){H.allowResize?ao?X.enableOnly():X.enableHandles():X.disableHandles();P.setCursor(H.allowSelect?"crosshair":"default");X.setCursor(H.allowMove?"move":"default");Z.css("backgroundColor",H.bgColor);if("setSelect" in H){J(A.setSelect);X.done();delete (H.setSelect)}if("trueSize" in H){M=H.trueSize[0]/Q;e=H.trueSize[1]/O}x=H.maxSize[0]||0;ah=H.maxSize[1]||0;p=H.minSize[0]||0;S=H.minSize[1]||0;if("outerImage" in H){al.attr("src",H.outerImage);delete (H.outerImage)}X.refresh()}L.hide();N(true);var g={animateTo:s,setSelect:J,setOptions:u,tellSelect:j,tellScaled:ag,disable:v,enable:V,cancel:m,focus:ak.watchKeys,getBounds:function(){return[Q*M,O*e]},getWidgetSize:function(){return[Q,O]},release:X.release,destroy:af};W.data("Jcrop",g);return g};a.fn.Jcrop=function(c){function b(f){var e=c.useImg||f.src;var d=new Image();d.onload=function(){a.Jcrop(f,c)};d.src=e}if(typeof(c)!=="object"){c={}}this.each(function(){if(a(this).data("Jcrop")){if(c=="api"){return a(this).data("Jcrop")}else{a(this).data("Jcrop").setOptions(c)}}else{b(this)}});return this}})(jQuery);
\ No newline at end of file
/*!
- * jQuery JavaScript Library v1.4.2
+ * jQuery JavaScript Library v1.4.4
* http://jquery.com/
*
* Copyright 2010, John Resig
* Copyright 2010, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
- * Date: Sat Feb 13 22:33:48 2010 -0500
+ * Date: Thu Nov 11 19:04:53 2010 -0500
*/
-(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<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
-e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
-j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
-"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
-true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\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<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
-c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
-L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
-"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
-a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
-d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
-a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
-!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
-true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-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="<input type='radio' name='radiotest' checked='checked'/>";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<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
-i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
-" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
-this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-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<d;j++){var i=
-e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=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<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
-null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=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<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
-fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
-d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
-"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
-a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
-isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
-{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
-if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-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;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
-!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
-toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
-u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
-function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
-if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){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<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
-for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
-1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
-CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
-relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
-l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
-h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=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 h<l[3]-0},gt:function(g,h,l){return h>l[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<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
-m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/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<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
-!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
-h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";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="<a href='#'></a>";
-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="<p class='TEST'></p>";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="<div class='test e'></div><div class='test'></div>";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<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
-gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
-c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},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<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-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=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
-a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_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<div>","</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},
+(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h=
+h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;k<J.length;k++){h=J[k];h.origType.replace(X,"")===a.type?f.push(h.selector):J.splice(k--,1)}f=c(a.target).closest(f,a.currentTarget);o=0;for(x=f.length;o<x;o++){r=f[o];for(k=0;k<J.length;k++){h=J[k];if(r.selector===h.selector&&(!A||A.test(h.namespace))){l=r.elem;e=null;if(h.preType==="mouseenter"||
+h.preType==="mouseleave"){a.type=h.preType;e=c(a.relatedTarget).closest(h.selector)[0]}if(!e||e!==l)C.push({elem:l,handleObj:h,level:r.level})}}}o=0;for(x=C.length;o<x;o++){f=C[o];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La,
+"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,
+e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(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 oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,
+"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+
+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j,
+s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,
+j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},
+toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j===
+-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false;
+if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K<Q;K++)if((j=arguments[K])!=null)for(s in j){v=G[s];z=j[s];if(G!==z)if(ga&&z&&(b.isPlainObject(z)||(H=b.isArray(z)))){if(H){H=false;v=v&&b.isArray(v)?v:[]}else v=v&&b.isPlainObject(v)?v:{};G[s]=b.extend(ga,v,z)}else if(z!==B)G[s]=z}return G};b.extend({noConflict:function(j){E.$=e;if(j)E.jQuery=d;return b},isReady:false,readyWait:1,ready:function(j){j===true&&b.readyWait--;
+if(!b.readyWait||j!==true&&!b.isReady){if(!t.body)return setTimeout(b.ready,1);b.isReady=true;if(!(j!==true&&--b.readyWait>0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload",
+b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&&
+!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&&
+l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H<G;){if(s.apply(j[H++],v)===false)break}else if(K)for(z in j){if(s.call(j[z],
+z,j[z])===false)break}else for(v=j[0];H<G&&s.call(v,H,v)!==false;v=j[++H]);return j},trim:O?function(j){return j==null?"":O.call(j)}:function(j){return j==null?"":j.toString().replace(k,"").replace(o,"")},makeArray:function(j,s){var v=s||[];if(j!=null){var z=b.type(j);j.length==null||z==="string"||z==="function"||z==="regexp"||b.isWindow(j)?M.call(v,j):b.merge(v,j)}return v},inArray:function(j,s){if(s.indexOf)return s.indexOf(j);for(var v=0,z=s.length;v<z;v++)if(s[v]===j)return v;return-1},merge:function(j,
+s){var v=j.length,z=0;if(typeof s.length==="number")for(var H=s.length;z<H;z++)j[v++]=s[z];else for(;s[z]!==B;)j[v++]=s[z++];j.length=v;return j},grep:function(j,s,v){var z=[],H;v=!!v;for(var G=0,K=j.length;G<K;G++){H=!!s(j[G],G);v!==H&&z.push(j[G])}return z},map:function(j,s,v){for(var z=[],H,G=0,K=j.length;G<K;G++){H=s(j[G],G,v);if(H!=null)z[z.length]=H}return z.concat.apply([],z)},guid:1,proxy:function(j,s,v){if(arguments.length===2)if(typeof s==="string"){v=j;j=v[s];s=B}else if(s&&!b.isFunction(s)){v=
+s;s=B}if(!s&&j)s=function(){return j.apply(v||this,arguments)};if(j)s.guid=j.guid=j.guid||s.guid||b.guid++;return s},access:function(j,s,v,z,H,G){var K=j.length;if(typeof s==="object"){for(var Q in s)b.access(j,Q,s[Q],z,H,v);return j}if(v!==B){z=!G&&z&&b.isFunction(v);for(Q=0;Q<K;Q++)H(j[Q],s,z?v.call(j[Q],Q,H(j[Q],s)):v,G);return j}return K?H(j[0],s):B},now:function(){return(new Date).getTime()},uaMatch:function(j){j=j.toLowerCase();j=L.exec(j)||g.exec(j)||i.exec(j)||j.indexOf("compatible")<0&&n.exec(j)||
+[];return{browser:j[1]||"",version:j[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(j,s){R["[object "+s+"]"]=s.toLowerCase()});m=b.uaMatch(m);if(m.browser){b.browser[m.browser]=true;b.browser.version=m.version}if(b.browser.webkit)b.browser.safari=true;if(D)b.inArray=function(j,s){return D.call(s,j)};if(!/\s/.test("\u00a0")){k=/^[\s\xA0]+/;o=/[\s\xA0]+$/}f=b(t);if(t.addEventListener)u=function(){t.removeEventListener("DOMContentLoaded",u,
+false);b.ready()};else if(t.attachEvent)u=function(){if(t.readyState==="complete"){t.detachEvent("onreadystatechange",u);b.ready()}};return E.jQuery=E.$=b}();(function(){c.support={};var a=t.documentElement,b=t.createElement("script"),d=t.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"),
+k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false,
+scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent=
+false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom=
+1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="<div style='width:4px;'></div>";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display=
+"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h=
+c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);
+else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h<l;h++){f=e[h].name;if(f.indexOf("data-")===0){f=f.substr(5);ka(this[0],f,d[f])}}}return d}else if(typeof a==="object")return this.each(function(){c.data(this,
+a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(b===B){d=this.triggerHandler("getData"+k[1]+"!",[k[0]]);if(d===B&&this.length){d=c.data(this[0],a);d=ka(this[0],a,d)}return d===B&&k[1]?this.data(k[0]):d}else return this.each(function(){var o=c(this),x=[k[0],b];o.triggerHandler("setData"+k[1]+"!",x);c.data(this,a,b);o.triggerHandler("changeData"+k[1]+"!",x)})},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 e=
+c.data(a,b);if(!d)return e||[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===B)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 sa=/[\n\t]/g,ha=/\s+/,Sa=/\r/g,Ta=/^(?:href|src|style)$/,Ua=/^(?:button|input)$/i,Va=/^(?:button|input|object|select|textarea)$/i,Wa=/^a(?:rea)?$/i,ta=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",
+colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(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(x){var r=c(this);r.addClass(a.call(this,x,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===
+1)if(f.className){for(var h=" "+f.className+" ",l=f.className,k=0,o=b.length;k<o;k++)if(h.indexOf(" "+b[k]+" ")<0)l+=" "+b[k];f.className=c.trim(l)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(o){var x=c(this);x.removeClass(a.call(this,o,x.attr("class")))});if(a&&typeof a==="string"||a===B)for(var b=(a||"").split(ha),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var h=(" "+f.className+" ").replace(sa," "),
+l=0,k=b.length;l<k;l++)h=h.replace(" "+b[l]+" "," ");f.className=c.trim(h)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(f){var h=c(this);h.toggleClass(a.call(this,f,h.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,h=0,l=c(this),k=b,o=a.split(ha);f=o[h++];){k=e?k:!l.hasClass(f);l[k?"addClass":"removeClass"](f)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,
+"__className__",this.className);this.className=this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(sa," ").indexOf(a)>-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";
+if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h<e;h++){var l=f[h];if(l.selected&&(c.support.optDisabled?!l.disabled:l.getAttribute("disabled")===null)&&(!l.parentNode.disabled||!c.nodeName(l.parentNode,"optgroup"))){a=c(l).val();if(b)return a;d.push(a)}}return d}if(ta.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Sa,"")}return B}var k=c.isFunction(a);return this.each(function(o){var x=c(this),r=a;if(this.nodeType===1){if(k)r=
+a.call(this,o,x.val());if(r==null)r="";else if(typeof r==="number")r+="";else if(c.isArray(r))r=c.map(r,function(C){return C==null?"":C+""});if(c.isArray(r)&&ta.test(this.type))this.checked=c.inArray(x.val(),r)>=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.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,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else 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:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0};
+c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,
+arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid=
+d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+
+c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h<A.length;h++){C=A[h];if(d.guid===C.guid){if(k||x.test(C.namespace)){e==null&&A.splice(h--,1);r.remove&&r.remove.call(a,C)}if(e!=null)break}}if(A.length===0||e!=null&&A.length===1){if(!r.teardown||r.teardown.call(a,o)===false)c.removeEvent(a,f,w.handle);delete I[f]}}else for(h=0;h<A.length;h++){C=A[h];if(k||x.test(C.namespace)){c.event.remove(a,r,C.handler,h);A.splice(h--,1)}}}if(c.isEmptyObject(I)){if(b=
+w.handle)b.elem=null;delete w.events;delete w.handle;if(typeof w==="function")c.removeData(a,J);else c.isEmptyObject(w)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===
+8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k===
+"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+
+d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f<l;f++){var k=d[f];if(b||e.test(k.namespace)){a.handler=k.handler;a.data=k.data;a.handleObj=k;k=k.handler.apply(this,h);if(k!==B){a.result=k;if(k===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;){e=this.props[--d];a[e]=b[e]}if(!a.target)a.target=a.srcElement||t;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=t.documentElement;d=t.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
+d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==B)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,Y(a.origType,a.selector),c.extend({},a,{handler:Ka,guid:a.handler.guid}))},remove:function(a){c.event.remove(this,
+Y(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=t.removeEventListener?function(a,b,d){a.removeEventListener&&a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent&&a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=a;this.type=a.type}else this.type=a;this.timeStamp=
+c.now();this[c.expando]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=ca;var a=this.originalEvent;if(a)if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=ca;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ca;this.stopPropagation()},isDefaultPrevented:U,isPropagationStopped:U,isImmediatePropagationStopped:U};
+var va=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},wa=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?wa:va,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?wa:va)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!==
+"form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length){a.liveFired=B;return la("submit",this,arguments)}});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13){a.liveFired=B;return la("submit",this,arguments)}})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var V,
+xa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired=
+B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.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 Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type===
+"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]===
+0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h<k;h++)c.event.add(this[h],d,l,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d,
+a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,e){return this.live(b,d,e,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d=
+1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var ya={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,e,f,h){var l,k=0,o,x,r=h||this.selector;h=h?this:c(this.context);if(typeof d===
+"object"&&!d.preventDefault){for(l in d)h[b](l,e,d[l],r);return this}if(c.isFunction(e)){f=e;e=B}for(d=(d||"").split(" ");(l=d[k++])!=null;){o=X.exec(l);x="";if(o){x=o[0];l=l.replace(X,"")}if(l==="hover")d.push("mouseenter"+x,"mouseleave"+x);else{o=l;if(l==="focus"||l==="blur"){d.push(ya[l]+x);l+=x}else l=(ya[l]||l)+x;if(b==="live"){x=0;for(var A=h.length;x<A;x++)c.event.add(h[x],"live."+Y(l,r),{data:e,selector:r,handler:f,origType:l,origHandler:f,preType:o})}else h.unbind("live."+Y(l,r),f)}}return this}});
+c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(d,e){if(e==null){e=d;d=null}return arguments.length>0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});
+(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1&&!q){y.sizcache=n;y.sizset=p}if(y.nodeName.toLowerCase()===i){F=y;break}y=y[g]}m[p]=F}}}function b(g,i,n,m,p,q){p=0;for(var u=m.length;p<u;p++){var y=m[p];if(y){var F=false;for(y=y[g];y;){if(y.sizcache===n){F=m[y.sizset];break}if(y.nodeType===1){if(!q){y.sizcache=n;y.sizset=p}if(typeof i!=="string"){if(y===i){F=true;break}}else if(k.filter(i,
+[y]).length>0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3];
+break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr,
+q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h=
+l;g.sort(w);if(h)for(var i=1;i<g.length;i++)g[i]===g[i-1]&&g.splice(i--,1)}return g};k.matches=function(g,i){return k(g,null,null,i)};k.matchesSelector=function(g,i){return k(i,null,null,[g]).length>0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p<q;p++){var u,y=o.order[p];if(u=o.leftMatch[y].exec(g)){var F=u[1];u.splice(1,1);if(F.substr(F.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");m=o.find[y](u,i,n);if(m!=null){g=g.replace(o.match[y],"");break}}}}m||(m=i.getElementsByTagName("*"));
+return{set:m,expr:g}};k.filter=function(g,i,n,m){for(var p,q,u=g,y=[],F=i,M=i&&i[0]&&k.isXML(i[0]);g&&i.length;){for(var N in o.filter)if((p=o.leftMatch[N].exec(g))!=null&&p[2]){var O,D,R=o.filter[N];D=p[1];q=false;p.splice(1,1);if(D.substr(D.length-1)!=="\\"){if(F===y)y=[];if(o.preFilter[N])if(p=o.preFilter[N](p,F,n,y,m,M)){if(p===true)continue}else q=O=true;if(p)for(var j=0;(D=F[j])!=null;j++)if(D){O=R(D,p,j,F);var s=m^!!O;if(n&&O!=null)if(s)q=true;else F[j]=false;else if(s){y.push(D);q=true}}if(O!==
+B){n||(F=y);g=g.replace(o.match[N],"");if(!q)return[];break}}}if(g===u)if(q==null)k.error(g);else break;u=g}return F};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var o=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
+POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},relative:{"+":function(g,i){var n=typeof i==="string",m=n&&!/\W/.test(i);n=n&&!m;if(m)i=i.toLowerCase();m=0;for(var p=g.length,q;m<p;m++)if(q=g[m]){for(;(q=q.previousSibling)&&q.nodeType!==1;);g[m]=n||q&&q.nodeName.toLowerCase()===
+i?q||false:q===i}n&&k.filter(i,g,true)},">":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p<q;p++){if(n=g[p]){n=n.parentNode;g[p]=n.nodeName.toLowerCase()===i?n:false}}else{for(;p<q;p++)if(n=g[p])g[p]=m?n.parentNode:n.parentNode===i;m&&k.filter(i,g,true)}},"":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=i=i.toLowerCase();q=a}q("parentNode",i,p,g,m,n)},"~":function(g,i,n){var m,p=e++,q=b;if(typeof i==="string"&&!/\W/.test(i)){m=
+i=i.toLowerCase();q=a}q("previousSibling",i,p,g,m,n)}},find:{ID:function(g,i,n){if(typeof i.getElementById!=="undefined"&&!n)return(g=i.getElementById(g[1]))&&g.parentNode?[g]:[]},NAME:function(g,i){if(typeof i.getElementsByName!=="undefined"){for(var n=[],m=i.getElementsByName(g[1]),p=0,q=m.length;p<q;p++)m[p].getAttribute("name")===g[1]&&n.push(m[p]);return n.length===0?null:n}},TAG:function(g,i){return i.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,i,n,m,p,q){g=" "+g[1].replace(/\\/g,
+"")+" ";if(q)return g;q=0;for(var u;(u=i[q])!=null;q++)if(u)if(p^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))n||m.push(u);else if(n)i[q]=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 i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n,
+m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.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,i,n){return!!k(n[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,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return i<n[3]-0},gt:function(g,i,n){return i>n[3]-0},nth:function(g,i,n){return n[3]-
+0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n<m;n++)if(i[n]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+p)},CHILD:function(g,i){var n=i[1],m=g;switch(n){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(n===
+"first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":n=i[2];var p=i[3];if(n===1&&p===0)return true;var q=i[0],u=g.parentNode;if(u&&(u.sizcache!==q||!g.nodeIndex)){var y=0;for(m=u.firstChild;m;m=m.nextSibling)if(m.nodeType===1)m.nodeIndex=++y;u.sizcache=q}m=g.nodeIndex-p;return n===0?m===0:m%n===0&&m/n>=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===
+i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]];
+if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m,
+g);else if(typeof g.length==="number")for(var p=g.length;n<p;n++)m.push(g[n]);else for(;g[n];n++)m.push(g[n]);return m}}var w,I;if(t.documentElement.compareDocumentPosition)w=function(g,i){if(g===i){h=true;return 0}if(!g.compareDocumentPosition||!i.compareDocumentPosition)return g.compareDocumentPosition?-1:1;return g.compareDocumentPosition(i)&4?-1:1};else{w=function(g,i){var n,m,p=[],q=[];n=g.parentNode;m=i.parentNode;var u=n;if(g===i){h=true;return 0}else if(n===m)return I(g,i);else if(n){if(!m)return 1}else return-1;
+for(;u;){p.unshift(u);u=u.parentNode}for(u=m;u;){q.unshift(u);u=u.parentNode}n=p.length;m=q.length;for(u=0;u<n&&u<m;u++)if(p[u]!==q[u])return I(p[u],q[u]);return u===n?I(g,q[u],-1):I(p[u],i,1)};I=function(g,i,n){if(g===i)return n;for(g=g.nextSibling;g;){if(g===i)return-1;g=g.nextSibling}return 1}}k.getText=function(g){for(var i="",n,m=0;g[m];m++){n=g[m];if(n.nodeType===3||n.nodeType===4)i+=n.nodeValue;else if(n.nodeType!==8)i+=k.getText(n.childNodes)}return i};(function(){var g=t.createElement("div"),
+i="script"+(new Date).getTime(),n=t.documentElement;g.innerHTML="<a name='"+i+"'/>";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g);
+n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="<a href='#'></a>";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&&
+function(){var g=k,i=t.createElement("div");i.innerHTML="<p class='TEST'></p>";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F||
+p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g=
+t.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition?
+function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n<u;n++)k(g,q[n],m);return k.filter(p,m)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=k.getText;c.isXMLDoc=k.isXML;
+c.contains=k.contains})();var Za=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,ab=/,/,Na=/^.[^:#\[\.,]*$/,bb=Array.prototype.slice,cb=c.expr.match.POS;c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++){d=b.length;c.find(a,this[e],b);if(e>0)for(var h=d;h<b.length;h++)for(var l=0;l<d;l++)if(b[l]===b[h]){b.splice(h--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,e=b.length;d<e;d++)if(c.contains(this,b[d]))return true})},
+not:function(a){return this.pushStack(ma(this,a,false),"not",a)},filter:function(a){return this.pushStack(ma(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e<f;e++){l=a[e];k[l]||(k[l]=c.expr.match.POS.test(l)?c(l,b||this.context):l)}for(;h&&h.ownerDocument&&h!==b;){for(l in k){e=k[l];if(e.jquery?e.index(h)>-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h=
+h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(h=this[e];h;)if(l?l.index(h)>-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},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){var d=typeof a==="string"?c(a,b||this.context):
+c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},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,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&
+e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===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 za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/<tbody/i,eb=/<|&#?\w+;/,Ca=/<(?:script|object|embed|option|style)/i,Da=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/\=([^="'>\s]+\/)>/g,P={option:[1,
+"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div<div>","</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!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).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;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
-this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
-u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
-1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||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;e<j;e++){var i=(e>0?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]==="<table>"&&!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=/<script(.|\s)*?\/script>/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("<div />").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<b;a++){var d=c.data(this[a],"olddisplay");
-this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").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<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
-"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
-animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
-j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
-this.each(function(){for(var f=d.length-1;f>=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.length;b++)a[b]()||a.splice(b--,1);a.length||
-c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
-function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
-this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
-k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
-f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
-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();
+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,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}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,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null;
+else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(e){this.empty().append(a)}}else c.isFunction(a)?this.each(function(f){var h=c(this);h.html(a.call(this,f,h.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=
+c(this),e=d.html();d.replaceWith(a.call(this,b,e))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){var e,f,h,l=a[0],k=[];if(!c.support.checkClone&&arguments.length===3&&typeof l==="string"&&Da.test(l))return this.each(function(){c(this).domManip(a,
+b,d,true)});if(c.isFunction(l))return this.each(function(x){var r=c(this);a[0]=l.call(this,x,b?r.html():B);r.domManip(a,b,d)});if(this[0]){e=l&&l.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,k);h=e.fragment;if(f=h.childNodes.length===1?h=h.firstChild:h.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var o=this.length;f<o;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):
+this[f]:this[f],f>0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",
+prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f<h;f++){var l=(f>0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument||
+b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1></$2>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]==="<table>"&&!x?r.childNodes:[];for(o=k.length-
+1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));
+d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i,
+jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,
+zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),
+h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b);
+if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=
+d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left;
+e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b===
+"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("<div>").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});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||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).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,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},
+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,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},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:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",
+script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||
+!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache=
+false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset;
+A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type",
+b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&&
+c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d||
+c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]=
+encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",
+[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),
+e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});
+if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",
+3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",qa(a.nodeName))}for(d=0;d<e;d++){a=this[d];b=a.style.display;if(b===""||b==="none")a.style.display=c.data(a,"olddisplay")||""}return this}},hide:function(a,b,d){if(a||a===0)return this.animate(S("hide",3),a,b,d);else{a=0;for(b=this.length;a<b;a++){d=c.css(this[a],"display");d!=="none"&&c.data(this[a],"olddisplay",
+d)}for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||e?this.each(function(){var f=e?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(S("toggle",3),a,b,d);return this},fadeTo:function(a,b,d,e){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d,e)},animate:function(a,b,d,e){var f=c.speed(b,
+d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===false?"each":"queue"](function(){var h=c.extend({},f),l,k=this.nodeType===1,o=k&&c(this).is(":hidden"),x=this;for(l in a){var r=c.camelCase(l);if(l!==r){a[r]=a[l];delete a[l];l=r}if(a[l]==="hide"&&o||a[l]==="show"&&!o)return h.complete.call(this);if(k&&(l==="height"||l==="width")){h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(c.css(this,"display")==="inline"&&c.css(this,"float")==="none")if(c.support.inlineBlockNeedsLayout)if(qa(this.nodeName)===
+"inline")this.style.display="inline-block";else{this.style.display="inline";this.style.zoom=1}else this.style.display="inline-block"}if(c.isArray(a[l])){(h.specialEasing=h.specialEasing||{})[l]=a[l][1];a[l]=a[l][0]}}if(h.overflow!=null)this.style.overflow="hidden";h.curAnim=c.extend({},a);c.each(a,function(A,C){var J=new c.fx(x,h,A);if(vb.test(C))J[C==="toggle"?o?"show":"hide":C](a);else{var w=wb.exec(C),I=J.cur()||0;if(w){var L=parseFloat(w[2]),g=w[3]||"px";if(g!=="px"){c.style(x,A,(L||1)+g);I=(L||
+1)/J.cur()*I;c.style(x,A,I+g)}if(w[1])L=(w[1]==="-="?-1:1)*L+I;J.custom(I,L,g)}else J.custom(I,C,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var e=d.length-1;e>=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b,
+d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a*
+Math.PI)/2+0.5)*e+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)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)}
+var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},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=c.now(),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 e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||
+this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,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.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(ba);ba=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===
+b.elem}).length};var xb=/^t(?:able|d|h)$/i,Ia=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in t.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(l){c.offset.setOffset(this,a,l)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,h=f.documentElement;if(!d||!c.contains(h,b))return d||{top:0,left:0};b=f.body;f=fa(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&
+h.scrollTop||b.scrollTop)-(h.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&h.scrollLeft||b.scrollLeft)-(h.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(x){c.offset.setOffset(this,a,x)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent,f=b.ownerDocument,h=f.documentElement,l=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle;
+for(var k=b.offsetTop,o=b.offsetLeft;(b=b.parentNode)&&b!==l&&b!==h;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;k-=b.scrollTop;o-=b.scrollLeft;if(b===e){k+=b.offsetTop;o+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&xb.test(b.nodeName))){k+=parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}e=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"){k+=
+parseFloat(d.borderTopWidth)||0;o+=parseFloat(d.borderLeftWidth)||0}d=d}if(d.position==="relative"||d.position==="static"){k+=l.offsetTop;o+=l.offsetLeft}if(c.offset.supportsFixedPosition&&d.position==="fixed"){k+=Math.max(h.scrollTop,l.scrollTop);o+=Math.max(h.scrollLeft,l.scrollLeft)}return{top:k,left:o}};c.offset={initialize:function(){var a=t.body,b=t.createElement("div"),d,e,f,h=parseFloat(c.css(a,"marginTop"))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",
+height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=
+f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==h;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.css(a,
+"marginTop"))||0;d+=parseFloat(c.css(a,"marginLeft"))||0}return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),h=f.offset(),l=c.css(a,"top"),k=c.css(a,"left"),o=e==="absolute"&&c.inArray("auto",[l,k])>-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a,
+e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.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(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();
+c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+
+b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window);jQuery.noConflict();
\ No newline at end of file
--- /dev/null
+/**
+ * jQuery.query - Query String Modification and Creation for jQuery
+ * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
+ * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
+ * Date: 2009/8/13
+ *
+ * @author Blair Mitchelmore
+ * @version 2.1.7
+ *
+ **/
+new function(e){var d=e.separator||"&";var c=e.spaces===false?false:true;var a=e.suffix===false?"":"[]";var g=e.prefix===false?false:true;var b=g?e.hash===true?"#":"?":"";var f=e.numbers===false?false:true;jQuery.query=new function(){var h=function(m,l){return m!=undefined&&m!==null&&(!!l?m.constructor==l:true)};var i=function(r){var l,q=/\[([^[]*)\]/g,n=/^([^[]+)(\[.*\])?$/.exec(r),o=n[1],p=[];while(l=q.exec(n[2])){p.push(l[1])}return[o,p]};var k=function(s,r,q){var t,p=r.shift();if(typeof s!="object"){s=null}if(p===""){if(!s){s=[]}if(h(s,Array)){s.push(r.length==0?q:k(null,r.slice(0),q))}else{if(h(s,Object)){var n=0;while(s[n++]!=null){}s[--n]=r.length==0?q:k(s[n],r.slice(0),q)}else{s=[];s.push(r.length==0?q:k(null,r.slice(0),q))}}}else{if(p&&p.match(/^\s*[0-9]+\s*$/)){var m=parseInt(p,10);if(!s){s=[]}s[m]=r.length==0?q:k(s[m],r.slice(0),q)}else{if(p){var m=p.replace(/^\s*|\s*$/g,"");if(!s){s={}}if(h(s,Array)){var l={};for(var n=0;n<s.length;++n){l[n]=s[n]}s=l}s[m]=r.length==0?q:k(s[m],r.slice(0),q)}else{return q}}}return s};var j=function(l){var m=this;m.keys={};if(l.queryObject){jQuery.each(l.get(),function(n,o){m.SET(n,o)})}else{jQuery.each(arguments,function(){var n=""+this;n=n.replace(/^[?#]/,"");n=n.replace(/[;&]$/,"");if(c){n=n.replace(/[+]/g," ")}jQuery.each(n.split(/[&;]/),function(){var o=decodeURIComponent(this.split("=")[0]||"");var p=decodeURIComponent(this.split("=")[1]||"");if(!o){return}if(f){if(/^[+-]?[0-9]+\.[0-9]*$/.test(p)){p=parseFloat(p)}else{if(/^[+-]?[0-9]+$/.test(p)){p=parseInt(p,10)}}}p=(!p&&p!==0)?true:p;if(p!==false&&p!==true&&typeof p!="number"){p=p}m.SET(o,p)})})}return m};j.prototype={queryObject:true,has:function(l,m){var n=this.get(l);return h(n,m)},GET:function(m){if(!h(m)){return this.keys}var l=i(m),n=l[0],p=l[1];var o=this.keys[n];while(o!=null&&p.length!=0){o=o[p.shift()]}return typeof o=="number"?o:o||""},get:function(l){var m=this.GET(l);if(h(m,Object)){return jQuery.extend(true,{},m)}else{if(h(m,Array)){return m.slice(0)}}return m},SET:function(m,r){var o=!h(r)?null:r;var l=i(m),n=l[0],q=l[1];var p=this.keys[n];this.keys[n]=k(p,q.slice(0),o);return this},set:function(l,m){return this.copy().SET(l,m)},REMOVE:function(l){return this.SET(l,null).COMPACT()},remove:function(l){return this.copy().REMOVE(l)},EMPTY:function(){var l=this;jQuery.each(l.keys,function(m,n){delete l.keys[m]});return l},load:function(l){var n=l.replace(/^.*?[#](.+?)(?:\?.+)?$/,"$1");var m=l.replace(/^.*?[?](.+?)(?:#.+)?$/,"$1");return new j(l.length==m.length?"":m,l.length==n.length?"":n)},empty:function(){return this.copy().EMPTY()},copy:function(){return new j(this)},COMPACT:function(){function l(o){var n=typeof o=="object"?h(o,Array)?[]:{}:o;if(typeof o=="object"){function m(r,p,q){if(h(r,Array)){r.push(q)}else{r[p]=q}}jQuery.each(o,function(p,q){if(!h(q)){return true}m(n,p,l(q))})}return n}this.keys=l(this.keys);return this},compact:function(){return this.copy().COMPACT()},toString:function(){var n=0,r=[],q=[],m=this;var o=function(s){s=s+"";if(c){s=s.replace(/ /g,"+")}return encodeURIComponent(s)};var l=function(s,t,u){if(!h(u)||u===false){return}var v=[o(t)];if(u!==true){v.push("=");v.push(o(u))}s.push(v.join(""))};var p=function(t,s){var u=function(v){return !s||s==""?[v].join(""):[s,"[",v,"]"].join("")};jQuery.each(t,function(v,w){if(typeof w=="object"){p(w,u(v))}else{l(q,u(v),w)}})};p(this.keys);if(q.length>0){r.push(b)}r.push(q.join(d));return r.join("")}};return new j(location.search,location.hash)}}(jQuery.query||{});
--- /dev/null
+/*!
+ * jQuery serializeObject - v0.2 - 1/20/2010
+ * http://benalman.com/projects/jquery-misc-plugins/
+ *
+ * Copyright (c) 2010 "Cowboy" Ben Alman
+ * Dual licensed under the MIT and GPL licenses.
+ * http://benalman.com/about/license/
+ */
+
+// Whereas .serializeArray() serializes a form into an array, .serializeObject()
+// serializes a form into an (arguably more useful) object.
+
+(function($,undefined){
+ '$:nomunge'; // Used by YUI compressor.
+
+ $.fn.serializeObject = function(){
+ var obj = {};
+
+ $.each( this.serializeArray(), function(i,o){
+ var n = o.name,
+ v = o.value;
+
+ obj[n] = obj[n] === undefined ? v
+ : $.isArray( obj[n] ) ? obj[n].concat( v )
+ : [ obj[n], v ];
+ });
+
+ return obj;
+ };
+
+})(jQuery);
-(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;i<cache.length;i++){if(cache[i]["q"]==q){cache.unshift(cache.splice(i,1)[0]);return cache[0]}}return false}function addToCache(q,items,size){var cached;while(cache.length&&(cacheSize+size>options.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.length;i++){html+="<li>"+items[i]+"</li>"}$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<tokens.length;i++){token=$.trim(tokens[i]);if(token){token=token.replace(new RegExp(q,"ig"),function(q){return'<span class="'+options.matchClass+'">'+q+"</span>"});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
+(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=a.trim(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;e<q.length;e++){if(q[e]["q"]==w){q.unshift(q.splice(e,1)[0]);return q[0]}}return false}function h(y,e,w){var x;while(q.length&&(p+w>g.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.length;w++){x+="<li>"+e[w]+"</li>"}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<A.length;y++){x=a.trim(A[y]);if(x){x=x.replace(new RegExp(z,"ig"),function(B){return'<span class="'+g.matchClass+'">'+B+"</span>"});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
--- /dev/null
+/*
+ * jQuery UI Button 1.8.9
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Button
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ */
+(function(a){var g,i=function(b){a(":ui-button",b.target.form).each(function(){var c=a(this).data("button");setTimeout(function(){c.refresh()},1)})},h=function(b){var c=b.name,d=b.form,e=a([]);if(c)e=d?a(d).find("[name='"+c+"']"):a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form});return e};a.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",
+i);if(typeof this.options.disabled!=="boolean")this.options.disabled=this.element.attr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var b=this,c=this.options,d=this.type==="checkbox"||this.type==="radio",e="ui-state-hover"+(!d?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",
+function(){if(!c.disabled){a(this).addClass("ui-state-hover");this===g&&a(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){c.disabled||a(this).removeClass(e)}).bind("focus.button",function(){a(this).addClass("ui-state-focus")}).bind("blur.button",function(){a(this).removeClass("ui-state-focus")});d&&this.element.bind("change.button",function(){b.refresh()});if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(c.disabled)return false;a(this).toggleClass("ui-state-active");
+b.buttonElement.attr("aria-pressed",b.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(c.disabled)return false;a(this).addClass("ui-state-active");b.buttonElement.attr("aria-pressed",true);var f=b.element[0];h(f).not(f).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed",false)});else{this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;a(this).addClass("ui-state-active");
+g=this;a(document).one("mouseup",function(){g=null})}).bind("mouseup.button",function(){if(c.disabled)return false;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(f){if(c.disabled)return false;if(f.keyCode==a.ui.keyCode.SPACE||f.keyCode==a.ui.keyCode.ENTER)a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(f){f.keyCode===a.ui.keyCode.SPACE&&a(this).click()})}this._setOption("disabled",
+c.disabled)},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type==="radio"){this.buttonElement=this.element.parents().last().find("label[for="+this.element.attr("id")+"]");this.element.addClass("ui-helper-hidden-accessible");var b=this.element.is(":checked");b&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",b)}else this.buttonElement=
+this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||
+this.buttonElement.removeAttr("title");a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);if(b==="disabled")c?this.element.attr("disabled",true):this.element.removeAttr("disabled");this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b);if(this.type==="radio")h(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
+true):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed",false)});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed",true):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed",false)},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var b=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
+c=a("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary;if(d.primary||d.secondary){b.addClass("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary"));d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>");d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>");if(!this.options.text){b.addClass(e?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary");
+this.hasTitle||b.attr("title",c)}}else b.addClass("ui-button-text-only")}}});a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()},
+destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery);
-/*
- * jQuery UI 1.7.3
+/*!
+ * jQuery UI 1.8.9
*
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
*
* 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.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;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){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);
+(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.9",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,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,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?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):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"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
+if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
+"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,
+d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
+c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&
+b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
/*
- * jQuery UI Dialog 1.7.3
+ * jQuery UI Dialog 1.8.9
*
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
*
* http://docs.jquery.com/UI/Dialog
*
* Depends:
- * ui.core.js
- * ui.draggable.js
- * ui.resizable.js
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * jquery.ui.button.js
+ * jquery.ui.draggable.js
+ * jquery.ui.mouse.js
+ * jquery.ui.position.js
+ * jquery.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("<div/>")).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("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('<a href="#"/>').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("<span/>")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("<span/>").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("<div></div>").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('<button type="button"></button>').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("<div></div>").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(e<d){return c(window).height()+"px"}else{return e+"px"}}else{return c(document).height()+"px"}},width:function(){if(c.browser.msie&&c.browser.version<7){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var e=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(d<e){return c(window).width()+"px"}else{return d+"px"}}else{return c(document).width()+"px"}},resize:function(){var d=c([]);c.each(c.ui.dialog.overlay.instances,function(){d=d.add(this)});d.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
+(function(c,j){var k={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},l={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&
+c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",
+-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),h=c('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role",
+"button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("<span></span>").addClass("ui-dialog-title").attr("id",e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=
+b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");a.uiDialog.remove();a.originalTitle&&
+a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==b.uiDialog[0]){e=c(this).css("z-index");
+isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);
+d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===f[0]&&e.shiftKey){g.focus(1);return false}}});
+c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a,function(f,
+h){h=c.isFunction(h)?{click:h,text:f}:h;f=c('<button type="button"></button>').attr(h,true).unbind("click").click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.fn.button&&f.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=
+d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,originalSize:f.originalSize,
+position:f.position,size:f.size}}a=a===j?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",f,b(h))},stop:function(f,
+h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length===
+1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f);if(g in k)e=true;if(g in
+l)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):e.removeClass("ui-dialog-disabled");
+break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=this.options,b,d,e=
+this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-b,0));this.uiDialog.is(":data(resizable)")&&
+this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.9",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length===
+0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()<c.ui.dialog.overlay.maxZ)return false})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),
+height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
+b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px"}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return a<b?c(window).width()+"px":a+"px"}else return c(document).width()+"px"},resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,
+function(){a=a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
/*
- * jQuery UI Draggable 1.7.3
+ * jQuery UI Draggable 1.8.9
*
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
*
* http://docs.jquery.com/UI/Draggables
*
* Depends:
- * ui.core.js
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
*/
-(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>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.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.7.3",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(c,e){var d=a(this).data("draggable"),f=d.options,b=a.extend({},e,{item:d.element});d.sortables=[];a(f.connectToSortable).each(function(){var g=a.data(this,"sortable");if(g&&!g.options.disabled){d.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",c,b)}})},stop:function(c,e){var d=a(this).data("draggable"),b=a.extend({},e,{item:d.element});a.each(d.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;d.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(c);this.instance.options.helper=this.instance.options._helper;if(d.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",c,b)}})},drag:function(c,f){var e=a(this).data("draggable"),b=this;var d=function(i){var n=this.offset.click.top,m=this.offset.click.left;var g=this.positionAbs.top,k=this.positionAbs.left;var j=i.height,l=i.width;var p=i.top,h=i.left;return a.ui.isOver(g+n,k+m,p,h,j,l)};a.each(e.sortables,function(g){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(b).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}if(this.instance.currentItem){this.instance._mouseDrag(c)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",c,this.instance._uiHash(this.instance));this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}e._trigger("fromSortable",c);e.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(c,d){var b=a("body"),e=a(this).data("draggable").options;if(b.css("cursor")){e._cursor=b.css("cursor")}b.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor){a("body").css("cursor",d._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){var d=a(this).data("draggable").options;a(d.iframeFix===true?"iframe":d.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').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<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop+f.scrollSpeed}else{if(d.pageY-c.overflowOffset.top<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop-f.scrollSpeed}}}if(!f.axis||f.axis!="y"){if((c.overflowOffset.left+c.scrollParent[0].offsetWidth)-d.pageX<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft+f.scrollSpeed}else{if(d.pageX-c.overflowOffset.left<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft-f.scrollSpeed}}}}else{if(!f.axis||f.axis!="x"){if(d.pageY-a(document).scrollTop()<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-f.scrollSpeed)}else{if(a(window).height()-(d.pageY-a(document).scrollTop())<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+f.scrollSpeed)}}}if(!f.axis||f.axis!="y"){if(d.pageX-a(document).scrollLeft()<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-f.scrollSpeed)}else{if(a(window).width()-(d.pageX-a(document).scrollLeft())<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+f.scrollSpeed)}}}}if(b!==false&&a.ui.ddmanager&&!f.dropBehaviour){a.ui.ddmanager.prepareOffsets(c,d)}}});a.ui.plugin.add("draggable","snap",{start:function(c,d){var b=a(this).data("draggable"),e=b.options;b.snapElements=[];a(e.snap.constructor!=String?(e.snap.items||":data(draggable)"):e.snap).each(function(){var g=a(this);var f=g.offset();if(this!=b.element[0]){b.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:f.top,left:f.left})}})},drag:function(u,p){var g=a(this).data("draggable"),q=g.options;var y=q.snapTolerance;var x=p.offset.left,w=x+g.helperProportions.width,f=p.offset.top,e=f+g.helperProportions.height;for(var v=g.snapElements.length-1;v>=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<x&&x<n+y&&m-y<f&&f<A+y)||(s-y<x&&x<n+y&&m-y<e&&e<A+y)||(s-y<w&&w<n+y&&m-y<f&&f<A+y)||(s-y<w&&w<n+y&&m-y<e&&e<A+y))){if(g.snapElements[v].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=false;continue}if(q.snapMode!="inner"){var c=Math.abs(m-e)<=y;var z=Math.abs(A-f)<=y;var j=Math.abs(s-w)<=y;var k=Math.abs(n-x)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s-g.helperProportions.width}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||z||j||k);if(q.snapMode!="outer"){var c=Math.abs(m-f)<=y;var z=Math.abs(A-e)<=y;var j=Math.abs(s-x)<=y;var k=Math.abs(n-w)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A-g.helperProportions.height,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[v].snapping&&(c||z||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=(c||z||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(b,c){var e=a(this).data("draggable").options;var d=a.makeArray(a(e.stack.group)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||e.stack.min)-(parseInt(a(f).css("zIndex"),10)||e.stack.min)});a(d).each(function(f){this.style.zIndex=e.stack.min+f});this[0].style.zIndex=e.stack.min+d.length}});a.ui.plugin.add("draggable","zIndex",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("zIndex")){e._zIndex=b.css("zIndex")}b.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex){a(c.helper).css("zIndex",d._zIndex)}}})})(jQuery);
+(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
+"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
+this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-
+this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();
+d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||
+this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&
+this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==
+a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||
+0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
+this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-
+(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment==
+"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?
+0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),
+10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor==
+Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():
+f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;
+if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])e=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/
+b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;e=this.originalPageX+Math.round((e-this.originalPageX)/b.grid[0])*b.grid[0];e=this.containment?!(e-this.offset.click.left<this.containment[0]||e-this.offset.click.left>this.containment[2])?e:!(e-this.offset.click.left<this.containment[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:g-this.offset.click.top-
+this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=
+this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.9"});
+d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var g=d.data(this,"sortable");if(g&&!g.options.disabled){c.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=
+0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=
+c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,
+true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=
+0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=
+a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","iframeFix",{start:function(){var a=d(this).data("draggable").options;d(a.iframeFix===true?"iframe":a.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},
+stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=
+document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-
+c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-
+(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable",
+"snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,g=b.offset.left,n=g+c.helperProportions.width,m=b.offset.top,o=m+c.helperProportions.height,h=
+c.snapElements.length-1;h>=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e<g&&g<k+e&&j-e<m&&m<l+e||i-e<g&&g<k+e&&j-e<o&&o<l+e||i-e<n&&n<k+e&&j-e<m&&m<l+e||i-e<n&&n<k+e&&j-e<o&&o<l+e){if(f.snapMode!="inner"){var p=Math.abs(j-o)<=e,q=Math.abs(l-m)<=e,r=Math.abs(i-n)<=e,s=Math.abs(k-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",
+{top:l,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k}).left-c.margins.left}var t=p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(j-m)<=e;q=Math.abs(l-o)<=e;r=Math.abs(i-g)<=e;s=Math.abs(k-n)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l-c.helperProportions.height,
+left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[h].snapping&&(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=p||q||r||s||t}else{c.snapElements[h].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,
+a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,
+b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
/*
- * jQuery UI Droppable 1.7.3
+ * jQuery UI Droppable 1.8.9
*
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
*
* http://docs.jquery.com/UI/Droppables
*
* Depends:
- * ui.core.js
- * ui.draggable.js
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * jquery.ui.mouse.js
+ * jquery.ui.draggable.js
*/
-(function(a){a.widget("ui.droppable",{_init:function(){var c=this.options,b=c.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&a.isFunction(this.options.accept)?this.options.accept:function(e){return e.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[this.options.scope]=a.ui.ddmanager.droppables[this.options.scope]||[];a.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++){if(b[c]==this){b.splice(c,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(b,c){if(b=="accept"){this.options.accept=c&&a.isFunction(c)?c:function(e){return e.is(c)}}else{a.widget.prototype._setData.apply(this,arguments)}},_activate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(b&&this._trigger("activate",c,this.ui(b)))},_deactivate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(b&&this._trigger("deactivate",c,this.ui(b)))},_over:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",c,this.ui(b))}},_out:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",c,this.ui(b))}},_drop:function(c,d){var b=d||a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return false}var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var f=a.data(this,"droppable");if(f.options.greedy&&a.ui.intersect(b,a.extend(f,{offset:f.element.offset()}),f.options.tolerance)){e=true;return false}});if(e){return false}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",c,this.ui(b));return this.element}return false},ui:function(b){return{draggable:(b.currentItem||b.element),helper:b.helper,position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs}}});a.extend(a.ui.droppable,{version:"1.7.3",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});a.ui.intersect=function(q,j,o){if(!j.offset){return false}var e=(q.positionAbs||q.position.absolute).left,d=e+q.helperProportions.width,n=(q.positionAbs||q.position.absolute).top,m=n+q.helperProportions.height;var g=j.offset.left,c=g+j.proportions.width,p=j.offset.top,k=p+j.proportions.height;switch(o){case"fit":return(g<e&&d<c&&p<n&&m<k);break;case"intersect":return(g<e+(q.helperProportions.width/2)&&d-(q.helperProportions.width/2)<c&&p<n+(q.helperProportions.height/2)&&m-(q.helperProportions.height/2)<k);break;case"pointer":var h=((q.positionAbs||q.position.absolute).left+(q.clickOffset||q.offset.click).left),i=((q.positionAbs||q.position.absolute).top+(q.clickOffset||q.offset.click).top),f=a.ui.isOver(i,h,p,g,j.proportions.height,j.proportions.width);return f;break;case"touch":return((n>=p&&n<=k)||(m>=p&&m<=k)||(n<p&&m>k))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(e<g&&d>c));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<b.length;d++){if(b[d].options.disabled||(e&&!b[d].options.accept.call(b[d].element[0],(e.currentItem||e.element)))){continue}for(var c=0;c<h.length;c++){if(h[c]==b[d].element[0]){b[d].proportions.height=0;continue droppablesLoop}}b[d].visible=b[d].element.css("display")!="none";if(!b[d].visible){continue}b[d].offset=b[d].element.offset();b[d].proportions={width:b[d].element[0].offsetWidth,height:b[d].element[0].offsetHeight};if(f=="mousedown"){b[d]._activate.call(b[d],g)}}},drop:function(b,c){var d=false;a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)){d=this._drop.call(this,c)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(b.currentItem||b.element))){this.isout=1;this.isover=0;this._deactivate.call(this,c)}});return d},drag:function(b,c){if(b.options.refreshPositions){a.ui.ddmanager.prepareOffsets(b,c)}a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var e=a.ui.intersect(b,this,this.options.tolerance);var g=!e&&this.isover==1?"isout":(e&&this.isover==0?"isover":null);if(!g){return}var f;if(this.options.greedy){var d=this.element.parents(":data(droppable):eq(0)");if(d.length){f=a.data(d[0],"droppable");f.greedyChild=(g=="isover"?1:0)}}if(f&&g=="isover"){f.isover=0;f.isout=1;f._out.call(f,c)}this[g]=1;this[g=="isout"?"isover":"isout"]=0;this[g=="isover"?"_over":"_out"].call(this,c);if(f&&g=="isout"){f.isout=0;f.isover=1;f._over.call(f,c)}})}}})(jQuery);
+(function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this);
+a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&
+this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
+this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,this.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=
+d.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",
+a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.9"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height;
+switch(c){case "fit":return i<=e&&g<=k&&j<=f&&h<=l;case "intersect":return i<e+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case "pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case "touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>=
+i&&e<=k||g>=i&&g<=k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].accept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f].element.css("display")!=
+"none";if(c[f].visible){c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight};e=="mousedown"&&c[f]._activate.call(c[f],b)}}},drop:function(a,b){var c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||
+a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance);if(c=!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e=
+d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})}}})(jQuery);
--- /dev/null
+/*!
+ * jQuery UI Mouse 1.8.9
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Mouse
+ *
+ * Depends:
+ * jquery.ui.widget.js
+ */
+(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(true===c.data(b.target,a.widgetName+".preventClickEvent")){c.removeData(b.target,a.widgetName+".preventClickEvent");b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=
+a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
+this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);
+return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&c.data(a.target,this.widgetName+".preventClickEvent",
+true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
--- /dev/null
+/*
+ * jQuery UI Position 1.8.9
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Position
+ */
+(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY,
+left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+=
+k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=
+m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=
+d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=
+a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b),
+g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
/*
- * jQuery UI Resizable 1.7.3
+ * jQuery UI Resizable 1.8.9
*
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizables
*
* Depends:
- * ui.core.js
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
*/
-(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('<div class="ui-wrapper" style="overflow: hidden;"></div>').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<k.length;f++){var h=c.trim(k[f]),d="ui-resizable-"+h;var g=c('<div class="ui-resizable-handle '+d+'"></div>');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.maxWidth<k.width),l=a(k.height)&&h.maxHeight&&(h.maxHeight<k.height),g=a(k.width)&&h.minWidth&&(h.minWidth>k.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<this._proportionallyResizeElements.length;e++){var g=this._proportionallyResizeElements[e];if(!this.borderDif){var d=[g.css("borderTopWidth"),g.css("borderRightWidth"),g.css("borderBottomWidth"),g.css("borderLeftWidth")],h=[g.css("paddingTop"),g.css("paddingRight"),g.css("paddingBottom"),g.css("paddingLeft")];this.borderDif=c.map(d,function(k,m){var l=parseInt(k,10)||0,n=parseInt(h[m],10)||0;return l+n})}if(c.browser.msie&&!(!(c(f).is(":hidden")||c(f).parents(":hidden").length))){continue}g.css({height:(f.height()-this.borderDif[0]-this.borderDif[2])||0,width:(f.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var e=this.element,h=this.options;this.elementOffset=e.offset();if(this._helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');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);
+(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,
+_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').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=a.handles||(!e(".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 c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor==
+String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection();
+this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};
+if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),
+d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=
+this.helper.offset();this.position={left:c,top:f};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:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:
+this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",
+b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;
+f={width:c.size.width-(f?0:c.sizeDiff.width),height:c.size.height-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",
+b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top=
+a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=l(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=l(b.width)&&a.minWidth&&a.minWidth>b.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,
+k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=[c.css("borderTopWidth"),
+c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)||0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=
+this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+
+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,
+arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,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}}});e.extend(e.ui.resizable,
+{version:"1.8.9"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,
+function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=
+(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=
+false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-
+a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",
+b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top",
+"Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,
+f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=
+a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+
+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&
+e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",
+height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=
+d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery);
/*
- * jQuery UI Selectable 1.7.3
+ * jQuery UI Selectable 1.8.9
*
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
*
* http://docs.jquery.com/UI/Selectables
*
* Depends:
- * ui.core.js
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.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.right<d||j.top>g||j.bottom<h))}else{if(e.tolerance=="fit"){k=(j.left>d&&j.right<b&&j.top>h&&j.bottom<g)}}if(k){if(j.selected){j.$element.removeClass("ui-selected");j.selected=false}if(j.unselecting){j.$element.removeClass("ui-unselecting");j.unselecting=false}if(!j.selecting){j.$element.addClass("ui-selecting");j.selecting=true;c._trigger("selecting",i,{selecting:j.element})}}else{if(j.selecting){if(i.metaKey&&j.startselected){j.$element.removeClass("ui-selecting");j.selecting=false;j.$element.addClass("ui-selected");j.selected=true}else{j.$element.removeClass("ui-selecting");j.selecting=false;if(j.startselected){j.$element.addClass("ui-unselecting");j.unselecting=true}c._trigger("unselecting",i,{unselecting:j.element})}}if(j.selected){if(!i.metaKey&&!j.startselected){j.$element.removeClass("ui-selected");j.selected=false;j.$element.addClass("ui-unselecting");j.unselecting=true;c._trigger("unselecting",i,{unselecting:j.element})}}}});return false},_mouseStop:function(d){var b=this;this.dragged=false;var c=this.options;a(".ui-unselecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-unselecting");e.unselecting=false;e.startselected=false;b._trigger("unselected",d,{unselected:e.element})});a(".ui-selecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-selecting").addClass("ui-selected");e.selecting=false;e.selected=true;e.startselected=true;b._trigger("selected",d,{selected:e.element})});this._trigger("stop",d);this.helper.remove();return false}}));a.extend(a.ui.selectable,{version:"1.7.3",defaults:{appendTo:"body",autoRefresh:true,cancel:":input,option",delay:0,distance:0,filter:"*",tolerance:"touch"}})})(jQuery);
+(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),
+selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX,
+c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting",
+c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d=
+this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.right<b||a.top>i||a.bottom<g);else if(d.tolerance=="fit")k=a.left>b&&a.right<h&&a.top>g&&a.bottom<i;if(k){if(a.selected){a.$element.removeClass("ui-selected");a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselecting");
+a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.selecting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");a.unselecting=true}f._trigger("unselecting",c,{unselecting:a.element})}if(a.selected)if(!c.metaKey&&
+!a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;f._trigger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d=
+e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.9"})})(jQuery);
/*
- * jQuery UI Sortable 1.7.3
+ * jQuery UI Sortable 1.8.9
*
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
*
* http://docs.jquery.com/UI/Sortables
*
* Depends:
- * ui.core.js
+ * jquery.ui.core.js
+ * jquery.ui.mouse.js
+ * jquery.ui.widget.js
*/
-(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<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop+g.scrollSpeed}else{if(f.pageY-this.overflowOffset.top<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop-g.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-f.pageX<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft+g.scrollSpeed}else{if(f.pageX-this.overflowOffset.left<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft-g.scrollSpeed}}}else{if(f.pageY-a(document).scrollTop()<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-g.scrollSpeed)}else{if(a(window).height()-(f.pageY-a(document).scrollTop())<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+g.scrollSpeed)}}if(f.pageX-a(document).scrollLeft()<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-g.scrollSpeed)}else{if(a(window).width()-(f.pageX-a(document).scrollLeft())<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+g.scrollSpeed)}}}if(b!==false&&a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,f)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var d=this.items.length-1;d>=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)<i&&(e+h)>f&&(e+h)<c;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>m[this.floating?"width":"height"])){return g}else{return(f<e+(this.helperProportions.width/2)&&d-(this.helperProportions.width/2)<c&&n<k+(this.helperProportions.height/2)&&j-(this.helperProportions.height/2)<i)}},_intersectsWithPointer:function(d){var e=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top,d.height),c=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left,d.width),g=e&&c,b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(!g){return false}return this.floating?(((f&&f=="right")||b=="down")?2:1):(b&&(b=="down"?2:1))},_intersectsWithSides:function(e){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+(e.height/2),e.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+(e.width/2),e.width),b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(this.floating&&f){return((f=="right"&&d)||(f=="left"&&!d))}else{return b&&((b=="down"&&c)||(b=="up"&&!c))}},_getDragVerticalDirection:function(){var b=this.positionAbs.top-this.lastPositionAbs.top;return b!=0&&(b>0?"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<this.items.length;c++){for(var b=0;b<d.length;b++){if(d[b]==this.items[c].item[0]){this.items.splice(c,1)}}}},_refreshItems:function(b){this.items=[];this.containers=[this];var h=this.items;var p=this;var f=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]];var l=this._connectWith();if(l){for(var e=l.length-1;e>=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<n;d++){var o=a(c[d]);o.data("sortable-item",k);h.push({item:o,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var d=this.items.length-1;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)<h){h=Math.abs(f-e);g=this.items[b]}}if(!g&&!this.options.dropOnEmpty){continue}this.currentContainer=this.containers[c];g?this._rearrange(d,g,null,true):this._rearrange(d,null,this.containers[c].element,true);this._trigger("change",d,this._uiHash());this.containers[c]._trigger("change",d,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[c]._trigger("over",d,this._uiHash(this));this.containers[c].containerCache.over=1}}else{if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",d,this._uiHash(this));this.containers[c].containerCache.over=0}}}},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c,this.currentItem])):(d.helper=="clone"?this.currentItem.clone():this.currentItem);if(!b.parents("body").length){a(d.appendTo!="parent"?d.appendTo:this.currentItem[0].parentNode)[0].appendChild(b[0])}if(b[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(b[0].style.width==""||d.forceHelperSize){b.width(this.currentItem.width())}if(b[0].style.height==""||d.forceHelperSize){b.height(this.currentItem.height())}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.currentItem.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)){var c=a(e.containment)[0];var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>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.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_rearrange:function(g,f,c,e){c?c[0].appendChild(this.placeholder[0]):f.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?f.item[0]:f.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var d=this,b=this.counter;window.setTimeout(function(){if(b==d.counter){d.refreshPositions(!e)}},0)},_clear:function(d,e){this.reverting=false;var f=[],b=this;if(!this._noFinalSort&&this.currentItem[0].parentNode){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var c in this._storedCSS){if(this._storedCSS[c]=="auto"||this._storedCSS[c]=="static"){this._storedCSS[c]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!e){f.push(function(g){this._trigger("receive",g,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!e){f.push(function(g){this._trigger("update",g,this._uiHash())})}if(!a.ui.contains(this.element[0],this.currentItem[0])){if(!e){f.push(function(g){this._trigger("remove",g,this._uiHash())})}for(var c=this.containers.length-1;c>=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<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}return false}if(!e){this._trigger("beforeStop",d,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!e){for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(c){var b=c||this;return{helper:b.helper,placeholder:b.placeholder||a([]),position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs,item:b.currentItem,sender:c?c.element:null}}}));a.extend(a.ui.sortable,{getter:"serialize toArray",version:"1.7.3",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);
+(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){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 a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,
+arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=
+c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);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");d.extend(this.offset,
+{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();
+if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",
+a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");
+if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+
+this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+
+b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+
+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,
+c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==
+document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-
+1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});
+this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&
+a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?
+"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?
+c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;
+return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=
+d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});
+return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=
+d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&this.helper)this.offset.parent=
+this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=
+e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];
+if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);
+c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===
+1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=
+this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):
+b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(a[0].style.width==""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==
+""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=
+this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
+10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions=
+{width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||
+document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,
+b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=
+document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():
+e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-
+this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<
+this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&
+this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=
+this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.currentItem[0].parentNode&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();
+this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove",f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],
+this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",
+g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);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(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||
+this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,
+originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.9"})})(jQuery);
/*
- * jQuery UI Tabs 1.7.3
+ * jQuery UI Tabs 1.8.9
*
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
*
* http://docs.jquery.com/UI/Tabs
*
* Depends:
- * ui.core.js
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
*/
-(function(c){var b=0,a=0;c.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(d,e){if(d=="selected"){if(this.options.collapsible&&e==this.options.selected){return}this.select(e)}else{this.options[d]=e;if(d=="deselectable"){this.options.collapsible=e}this._tabify()}},_tabId:function(d){return d.title&&d.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+(++b)},_sanitizeSelector:function(d){return d.replace(/:/g,"\\:")},_cookie:function(){var d=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+(++a));return c.cookie.apply(null,[d].concat(c.makeArray(arguments)))},_ui:function(e,d){return{tab:e,panel:d,index:this.anchors.index(e)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var d=c(this);d.html(d.data("label.tabs")).removeData("label.tabs")})},_tabify:function(q){this.list=this.element.children("ul:first");this.lis=c("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return c("a",this)[0]});this.panels=c([]);var r=this,f=this.options;var e=/^#.+/;this.anchors.each(function(u,o){var s=c(o).attr("href");var v=s.split("#")[0],w;if(v&&(v===location.toString().split("#")[0]||(w=c("base")[0])&&v===w.href)){s=o.hash;o.href=s}if(e.test(s)){r.panels=r.panels.add(r._sanitizeSelector(s))}else{if(s!="#"){c.data(o,"href.tabs",s);c.data(o,"load.tabs",s.replace(/#.*$/,""));var y=r._tabId(o);o.href="#"+y;var x=c("#"+y);if(!x.length){x=c(f.panelTemplate).attr("id",y).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(r.panels[u-1]||r.list);x.data("destroy.tabs",true)}r.panels=r.panels.add(x)}else{f.disabled.push(u)}}});if(q){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(f.selected===undefined){if(location.hash){this.anchors.each(function(s,o){if(o.hash==location.hash){f.selected=s;return false}})}if(typeof f.selected!="number"&&f.cookie){f.selected=parseInt(r._cookie(),10)}if(typeof f.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){f.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}f.selected=f.selected||0}else{if(f.selected===null){f.selected=-1}}f.selected=((f.selected>=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<this.anchors.length?1:-1))}f.disabled=c.map(c.grep(f.disabled,function(j,h){return j!=d}),function(j,h){return j>=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:"<div></div>",spinner:"<em>Loading…</em>",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});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<d.anchors.length?k:0)},f);if(j){j.stopPropagation()}});var g=d._unrotate||(d._unrotate=!h?function(j){if(j.clientX){d.rotate(null)}}:function(j){t=i.selected;e()});if(f){this.element.bind("tabsshow",e);this.anchors.bind(i.event+".tabs",g);e()}else{clearTimeout(d.rotation);this.element.unbind("tabsshow",e);this.anchors.unbind(i.event+".tabs",g);delete this._rotate;delete this._unrotate}}})})(jQuery);
+(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading…</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&&
+e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=
+d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]||
+(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){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(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected=
+this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
+if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
+this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+
+g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",
+function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")};
+this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected=
+-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
+d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},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 e=
+d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(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")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b,
+e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]);
+j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();
+if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1<this.anchors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(h){return h!=b}),function(h){return h>=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null,
+this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this},
+load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c,
+"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
+url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.9"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k<a.anchors.length?k:0)},b);j&&j.stopPropagation()});e=a._unrotate||(a._unrotate=!e?function(j){j.clientX&&
+a.rotate(null)}:function(){t=c.selected;h()});if(b){this.element.bind("tabsshow",h);this.anchors.bind(c.event+".tabs",e);h()}else{clearTimeout(a.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(c.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
--- /dev/null
+/*!
+ * jQuery UI Widget 1.8.9
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Widget
+ */
+(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
+a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
+e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
+this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
+widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
+enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
-/*
- http://www.JSON.org/json2.js
- 2009-08-17
-
- Public Domain.
-
- NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
- See http://www.JSON.org/js.html
-*/
-if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
+"use strict";if(!this.JSON){this.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
\ No newline at end of file
--- /dev/null
+//Used to ensure that Entities used in L10N strings are correct
+function convertEntities(o) {
+ var c, v;
+ c = function(s) {
+ if (/&[^;]+;/.test(s)) {
+ var e = document.createElement("div");
+ e.innerHTML = s;
+ return !e.firstChild ? s : e.firstChild.nodeValue;
+ }
+ return s;
+ }
+
+ if ( typeof o === 'string' ) {
+ return c(o);
+ } else if ( typeof o === 'object' ) {
+ for (v in o) {
+ if ( typeof o[v] === 'string' ) {
+ o[v] = c(o[v]);
+ }
+ }
+ }
+ return o;
+}
\ No newline at end of file
--- /dev/null
+function convertEntities(b){var d,a;d=function(c){if(/&[^;]+;/.test(c)){var f=document.createElement("div");f.innerHTML=c;return !f.firstChild?c:f.firstChild.nodeValue}return c};if(typeof b==="string"){return d(b)}else{if(typeof b==="object"){for(a in b){if(typeof b[a]==="string"){b[a]=d(b[a])}}}}return b};
\ No newline at end of file
-var topWin=window.dialogArguments||opener||parent||top;function fileDialogStart(){jQuery("#media-upload-error").empty()}function fileQueued(fileObj){jQuery(".media-blank").remove();if(jQuery("form.type-form #media-items").children().length==1&&jQuery(".hidden","#media-items").length>0){jQuery(".describe-toggle-on").show();jQuery(".describe-toggle-off").hide();jQuery(".slidetoggle").slideUp(200).siblings().removeClass("hidden")}jQuery("#media-items").append('<div id="media-item-'+fileObj.id+'" class="media-item child-of-'+post_id+'"><div class="progress"><div class="bar"></div></div><div class="filename original"><span class="percent"></span> '+fileObj.name+"</div></div>");jQuery(".progress","#media-item-"+fileObj.id).show();jQuery("#insert-gallery").attr("disabled","disabled");jQuery("#cancel-upload").attr("disabled","")}function uploadStart(fileObj){try{if(typeof topWin.tb_remove!="undefined"){topWin.jQuery("#TB_overlay").unbind("click",topWin.tb_remove)}}catch(e){}return true}function uploadProgress(fileObj,bytesDone,bytesTotal){var w=jQuery("#media-items").width()-2,item=jQuery("#media-item-"+fileObj.id);jQuery(".bar",item).width(w*bytesDone/bytesTotal);jQuery(".percent",item).html(Math.ceil(bytesDone/bytesTotal*100)+"%");if(bytesDone==bytesTotal){jQuery(".bar",item).html('<strong class="crunching">'+swfuploadL10n.crunching+"</strong>")}}function prepareMediaItem(fileObj,serverData){var f=(typeof shortform=="undefined")?1:2,item=jQuery("#media-item-"+fileObj.id);jQuery(".bar",item).remove();jQuery(".progress",item).hide();try{if(typeof topWin.tb_remove!="undefined"){topWin.jQuery("#TB_overlay").click(topWin.tb_remove)}}catch(e){}if(isNaN(serverData)||!serverData){item.append(serverData);prepareMediaItemInit(fileObj)}else{item.load("async-upload.php",{attachment_id:serverData,fetch:f},function(){prepareMediaItemInit(fileObj);updateMediaForm()})}}function prepareMediaItemInit(fileObj){var item=jQuery("#media-item-"+fileObj.id);jQuery(".thumbnail",item).clone().attr("className","pinkynail toggle").prependTo(item);jQuery(".filename.original",item).replaceWith(jQuery(".filename.new",item));jQuery("a.toggle",item).click(function(){jQuery(this).siblings(".slidetoggle").slideToggle(350,function(){var w=jQuery(window).height(),t=jQuery(this).offset().top,h=jQuery(this).height(),b;if(w&&t&&h){b=t+h;if(b>w&&(h+48)<w){window.scrollBy(0,b-w+13)}else{if(b>w){window.scrollTo(0,t-36)}}}});jQuery(this).siblings(".toggle").andSelf().toggle();jQuery(this).siblings("a.toggle").focus();return false});jQuery("a.delete",item).click(function(){jQuery.ajax({url:"admin-ajax.php",type:"post",success:deleteSuccess,error:deleteError,id:fileObj.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"trash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")}});return false});jQuery("a.undo",item).click(function(){jQuery.ajax({url:"admin-ajax.php",type:"post",id:fileObj.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"untrash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")},success:function(data,textStatus){var item=jQuery("#media-item-"+fileObj.id);if(type=jQuery("#type-of-"+fileObj.id).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-0+1)}if(item.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-0+1)}jQuery(".filename .trashnotice",item).remove();jQuery(".filename .title",item).css("font-weight","normal");jQuery("a.undo",item).addClass("hidden");jQuery("a.describe-toggle-on, .menu_order_input",item).show();item.css({backgroundColor:"#ceb"}).animate({backgroundColor:"#fff"},{queue:false,duration:500,complete:function(){jQuery(this).css({backgroundColor:""})}}).removeClass("undo")}});return false});jQuery("#media-item-"+fileObj.id+".startopen").removeClass("startopen").slideToggle(500).siblings(".toggle").toggle()}function itemAjaxError(id,html){var item=jQuery("#media-item-"+id);var filename=jQuery(".filename",item).text();item.html('<div class="error-div"><a class="dismiss" href="#">'+swfuploadL10n.dismiss+"</a><strong>"+swfuploadL10n.error_uploading.replace("%s",filename)+"</strong><br />"+html+"</div>");item.find("a.dismiss").click(function(){jQuery(this).parents(".media-item").slideUp(200,function(){jQuery(this).remove()})})}function deleteSuccess(data,textStatus){if(data=="-1"){return itemAjaxError(this.id,"You do not have permission. Has your session expired?")}if(data=="0"){return itemAjaxError(this.id,"Could not be deleted. Has it been deleted already?")}var id=this.id,item=jQuery("#media-item-"+id);if(type=jQuery("#type-of-"+id).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-1)}if(item.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-1)}if(jQuery("form.type-form #media-items").children().length==1&&jQuery(".hidden","#media-items").length>0){jQuery(".toggle").toggle();jQuery(".slidetoggle").slideUp(200).siblings().removeClass("hidden")}jQuery(".toggle",item).toggle();jQuery(".slidetoggle",item).slideUp(200).siblings().removeClass("hidden");item.css({backgroundColor:"#faa"}).animate({backgroundColor:"#f4f4f4"},{queue:false,duration:500}).addClass("undo");jQuery(".filename:empty",item).remove();jQuery(".filename .title",item).css("font-weight","bold");jQuery(".filename",item).append('<span class="trashnotice"> '+swfuploadL10n.deleted+" </span>").siblings("a.toggle").hide();jQuery(".filename",item).append(jQuery("a.undo",item).removeClass("hidden"));jQuery(".menu_order_input",item).hide();return}function deleteError(X,textStatus,errorThrown){}function updateMediaForm(){var one=jQuery("form.type-form #media-items").children(),items=jQuery("#media-items").children();if(one.length==1){jQuery(".slidetoggle",one).slideDown(500).siblings().addClass("hidden").filter(".toggle").toggle()}if(items.not(".media-blank").length>0){jQuery(".savebutton").show()}else{jQuery(".savebutton").hide()}if(items.length>1){jQuery(".insert-gallery").show()}else{jQuery(".insert-gallery").hide()}}function uploadSuccess(fileObj,serverData){if(serverData.match("media-upload-error")){jQuery("#media-item-"+fileObj.id).html(serverData);return}prepareMediaItem(fileObj,serverData);updateMediaForm();if(jQuery("#media-item-"+fileObj.id).hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(1*jQuery("#attachments-count").text()+1)}}function uploadComplete(fileObj){if(swfu.getStats().files_queued==0){jQuery("#cancel-upload").attr("disabled","disabled");jQuery("#insert-gallery").attr("disabled","")}}function wpQueueError(message){jQuery("#media-upload-error").show().text(message)}function wpFileError(fileObj,message){var item=jQuery("#media-item-"+fileObj.id);var filename=jQuery(".filename",item).text();item.html('<div class="error-div"><a class="dismiss" href="#">'+swfuploadL10n.dismiss+"</a><strong>"+swfuploadL10n.error_uploading.replace("%s",filename)+"</strong><br />"+message+"</div>");item.find("a.dismiss").click(function(){jQuery(this).parents(".media-item").slideUp(200,function(){jQuery(this).remove()})})}function fileQueueError(fileObj,error_code,message){if(error_code==SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){wpQueueError(swfuploadL10n.queue_limit_exceeded)}else{if(error_code==SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT){fileQueued(fileObj);wpFileError(fileObj,swfuploadL10n.file_exceeds_size_limit)}else{if(error_code==SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE){fileQueued(fileObj);wpFileError(fileObj,swfuploadL10n.zero_byte_file)}else{if(error_code==SWFUpload.QUEUE_ERROR.INVALID_FILETYPE){fileQueued(fileObj);wpFileError(fileObj,swfuploadL10n.invalid_filetype)}else{wpQueueError(swfuploadL10n.default_error)}}}}}function fileDialogComplete(num_files_queued){try{if(num_files_queued>0){this.startUpload()}}catch(ex){this.debug(ex)}}function switchUploader(s){var f=document.getElementById(swfu.customSettings.swfupload_element_id),h=document.getElementById(swfu.customSettings.degraded_element_id);if(s){f.style.display="block";h.style.display="none"}else{f.style.display="none";h.style.display="block"}}function swfuploadPreLoad(){if(!uploaderMode){switchUploader(1)}else{switchUploader(0)}}function swfuploadLoadFailed(){switchUploader(0);jQuery(".upload-html-bypass").hide()}function uploadError(fileObj,errorCode,message){switch(errorCode){case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:wpFileError(fileObj,swfuploadL10n.missing_upload_url);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:wpFileError(fileObj,swfuploadL10n.upload_limit_exceeded);break;case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:wpQueueError(swfuploadL10n.http_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:wpQueueError(swfuploadL10n.upload_failed);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:wpQueueError(swfuploadL10n.io_error);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:wpQueueError(swfuploadL10n.security_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:jQuery("#media-item-"+fileObj.id).remove();break;default:wpFileError(fileObj,swfuploadL10n.default_error)}}function cancelUpload(){swfu.cancelQueue()}jQuery(document).ready(function($){$('input[type="radio"]',"#media-items").live("click",function(){var tr=$(this).closest("tr");if($(tr).hasClass("align")){setUserSetting("align",$(this).val())}else{if($(tr).hasClass("image-size")){setUserSetting("imgsize",$(this).val())}}});$("button.button","#media-items").live("click",function(){var c=this.className||"";c=c.match(/url([^ '"]+)/);if(c&&c[1]){setUserSetting("urlbutton",c[1]);$(this).siblings(".urlfield").val($(this).attr("title"))}})});
\ No newline at end of file
+var topWin=window.dialogArguments||opener||parent||top;function fileDialogStart(){jQuery("#media-upload-error").empty()}function fileQueued(a){jQuery(".media-blank").remove();if(jQuery("form.type-form #media-items").children().length==1&&jQuery(".hidden","#media-items").length>0){jQuery(".describe-toggle-on").show();jQuery(".describe-toggle-off").hide();jQuery(".slidetoggle").slideUp(200).siblings().removeClass("hidden")}jQuery("#media-items").append('<div id="media-item-'+a.id+'" class="media-item child-of-'+post_id+'"><div class="progress"><div class="bar"></div></div><div class="filename original"><span class="percent"></span> '+a.name+"</div></div>");jQuery(".progress","#media-item-"+a.id).show();jQuery("#insert-gallery").attr("disabled","disabled");jQuery("#cancel-upload").attr("disabled","")}function uploadStart(a){try{if(typeof topWin.tb_remove!="undefined"){topWin.jQuery("#TB_overlay").unbind("click",topWin.tb_remove)}}catch(b){}return true}function uploadProgress(e,b,d){var a=jQuery("#media-items").width()-2,c=jQuery("#media-item-"+e.id);jQuery(".bar",c).width(a*b/d);jQuery(".percent",c).html(Math.ceil(b/d*100)+"%");if(b==d){jQuery(".bar",c).html('<strong class="crunching">'+swfuploadL10n.crunching+"</strong>")}}function prepareMediaItem(c,a){var d=(typeof shortform=="undefined")?1:2,b=jQuery("#media-item-"+c.id);jQuery(".bar",b).remove();jQuery(".progress",b).hide();try{if(typeof topWin.tb_remove!="undefined"){topWin.jQuery("#TB_overlay").click(topWin.tb_remove)}}catch(g){}if(isNaN(a)||!a){b.append(a);prepareMediaItemInit(c)}else{b.load("async-upload.php",{attachment_id:a,fetch:d},function(){prepareMediaItemInit(c);updateMediaForm()})}}function prepareMediaItemInit(b){var a=jQuery("#media-item-"+b.id);jQuery(".thumbnail",a).clone().attr("className","pinkynail toggle").prependTo(a);jQuery(".filename.original",a).replaceWith(jQuery(".filename.new",a));jQuery("a.toggle",a).click(function(){jQuery(this).siblings(".slidetoggle").slideToggle(350,function(){var d=jQuery(window).height(),e=jQuery(this).offset().top,f=jQuery(this).height(),c;if(d&&e&&f){c=e+f;if(c>d&&(f+48)<d){window.scrollBy(0,c-d+13)}else{if(c>d){window.scrollTo(0,e-36)}}}});jQuery(this).siblings(".toggle").andSelf().toggle();jQuery(this).siblings("a.toggle").focus();return false});jQuery("a.delete",a).click(function(){jQuery.ajax({url:"admin-ajax.php",type:"post",success:deleteSuccess,error:deleteError,id:b.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"trash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")}});return false});jQuery("a.undo",a).click(function(){jQuery.ajax({url:"admin-ajax.php",type:"post",id:b.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"untrash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")},success:function(d,e){var c=jQuery("#media-item-"+b.id);if(type=jQuery("#type-of-"+b.id).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-0+1)}if(c.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-0+1)}jQuery(".filename .trashnotice",c).remove();jQuery(".filename .title",c).css("font-weight","normal");jQuery("a.undo",c).addClass("hidden");jQuery("a.describe-toggle-on, .menu_order_input",c).show();c.css({backgroundColor:"#ceb"}).animate({backgroundColor:"#fff"},{queue:false,duration:500,complete:function(){jQuery(this).css({backgroundColor:""})}}).removeClass("undo")}});return false});jQuery("#media-item-"+b.id+".startopen").removeClass("startopen").slideToggle(500).siblings(".toggle").toggle()}function itemAjaxError(d,b){var c=jQuery("#media-item-"+d);var a=jQuery(".filename",c).text();c.html('<div class="error-div"><a class="dismiss" href="#">'+swfuploadL10n.dismiss+"</a><strong>"+swfuploadL10n.error_uploading.replace("%s",a)+"</strong><br />"+b+"</div>");c.find("a.dismiss").click(function(){jQuery(this).parents(".media-item").slideUp(200,function(){jQuery(this).remove()})})}function deleteSuccess(b,d){if(b=="-1"){return itemAjaxError(this.id,"You do not have permission. Has your session expired?")}if(b=="0"){return itemAjaxError(this.id,"Could not be deleted. Has it been deleted already?")}var c=this.id,a=jQuery("#media-item-"+c);if(type=jQuery("#type-of-"+c).val()){jQuery("#"+type+"-counter").text(jQuery("#"+type+"-counter").text()-1)}if(a.hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(jQuery("#attachments-count").text()-1)}if(jQuery("form.type-form #media-items").children().length==1&&jQuery(".hidden","#media-items").length>0){jQuery(".toggle").toggle();jQuery(".slidetoggle").slideUp(200).siblings().removeClass("hidden")}jQuery(".toggle",a).toggle();jQuery(".slidetoggle",a).slideUp(200).siblings().removeClass("hidden");a.css({backgroundColor:"#faa"}).animate({backgroundColor:"#f4f4f4"},{queue:false,duration:500}).addClass("undo");jQuery(".filename:empty",a).remove();jQuery(".filename .title",a).css("font-weight","bold");jQuery(".filename",a).append('<span class="trashnotice"> '+swfuploadL10n.deleted+" </span>").siblings("a.toggle").hide();jQuery(".filename",a).append(jQuery("a.undo",a).removeClass("hidden"));jQuery(".menu_order_input",a).hide();return}function deleteError(c,b,a){}function updateMediaForm(){var b=jQuery("form.type-form #media-items").children(),a=jQuery("#media-items").children();if(b.length==1){jQuery(".slidetoggle",b).slideDown(500).siblings().addClass("hidden").filter(".toggle").toggle()}if(a.not(".media-blank").length>0){jQuery(".savebutton").show()}else{jQuery(".savebutton").hide()}if(a.length>1){jQuery(".insert-gallery").show()}else{jQuery(".insert-gallery").hide()}}function uploadSuccess(b,a){if(a.match("media-upload-error")){jQuery("#media-item-"+b.id).html(a);return}prepareMediaItem(b,a);updateMediaForm();if(jQuery("#media-item-"+b.id).hasClass("child-of-"+post_id)){jQuery("#attachments-count").text(1*jQuery("#attachments-count").text()+1)}}function uploadComplete(a){if(swfu.getStats().files_queued==0){jQuery("#cancel-upload").attr("disabled","disabled");jQuery("#insert-gallery").attr("disabled","")}}function wpQueueError(a){jQuery("#media-upload-error").show().text(a)}function wpFileError(d,c){var b=jQuery("#media-item-"+d.id);var a=jQuery(".filename",b).text();b.html('<div class="error-div"><a class="dismiss" href="#">'+swfuploadL10n.dismiss+"</a><strong>"+swfuploadL10n.error_uploading.replace("%s",a)+"</strong><br />"+c+"</div>");b.find("a.dismiss").click(function(){jQuery(this).parents(".media-item").slideUp(200,function(){jQuery(this).remove()})})}function fileQueueError(c,a,b){if(a==SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){wpQueueError(swfuploadL10n.queue_limit_exceeded)}else{if(a==SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT){fileQueued(c);wpFileError(c,swfuploadL10n.file_exceeds_size_limit)}else{if(a==SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE){fileQueued(c);wpFileError(c,swfuploadL10n.zero_byte_file)}else{if(a==SWFUpload.QUEUE_ERROR.INVALID_FILETYPE){fileQueued(c);wpFileError(c,swfuploadL10n.invalid_filetype)}else{wpQueueError(swfuploadL10n.default_error)}}}}}function fileDialogComplete(b){try{if(b>0){this.startUpload()}}catch(a){this.debug(a)}}function switchUploader(b){var c=document.getElementById(swfu.customSettings.swfupload_element_id),a=document.getElementById(swfu.customSettings.degraded_element_id);if(b){c.style.display="block";a.style.display="none"}else{c.style.display="none";a.style.display="block"}}function swfuploadPreLoad(){if(!uploaderMode){switchUploader(1)}else{switchUploader(0)}}function swfuploadLoadFailed(){switchUploader(0);jQuery(".upload-html-bypass").hide()}function uploadError(b,c,a){switch(c){case SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL:wpFileError(b,swfuploadL10n.missing_upload_url);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:wpFileError(b,swfuploadL10n.upload_limit_exceeded);break;case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:wpQueueError(swfuploadL10n.http_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:wpQueueError(swfuploadL10n.upload_failed);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:wpQueueError(swfuploadL10n.io_error);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:wpQueueError(swfuploadL10n.security_error);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:jQuery("#media-item-"+b.id).remove();break;default:wpFileError(b,swfuploadL10n.default_error)}}function cancelUpload(){swfu.cancelQueue()}jQuery(document).ready(function(a){a('input[type="radio"]',"#media-items").live("click",function(){var b=a(this).closest("tr");if(a(b).hasClass("align")){setUserSetting("align",a(this).val())}else{if(a(b).hasClass("image-size")){setUserSetting("imgsize",a(this).val())}}});a("button.button","#media-items").live("click",function(){var b=this.className||"";b=b.match(/url([^ '"]+)/);if(b&&b[1]){setUserSetting("urlbutton",b[1]);a(this).siblings(".urlfield").val(a(this).attr("title"))}})});
\ No newline at end of file
--- /dev/null
+/**
+ * SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com
+ *
+ * mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/
+ *
+ * SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilzén and Mammon Media and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ */
+
+The MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
+++ /dev/null
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>blank_page</title>
-</head>
-<body class="mceContentBody">
-
-</body>
-</html>
s110:"110%",
s120:"120%",
s130:"130%",
-img_title:"Edit Image Title",
-caption:"Edit Image Caption",
-alt:"Edit Alternate Text"
+img_title:"Title",
+caption:"Caption",
+alt:"Alternate Text"
});
s110:"' . mce_escape( __('110%') ) . '",
s120:"' . mce_escape( __('120%') ) . '",
s130:"' . mce_escape( __('130%') ) . '",
-img_title:"' . mce_escape( __('Edit Image Title') ) . '",
-caption:"' . mce_escape( __('Edit Image Caption') ) . '",
-alt:"' . mce_escape( __('Edit Alternate Text') ) . '"
+img_title:"' . mce_escape( __('Title') ) . '",
+caption:"' . mce_escape( __('Caption') ) . '",
+alt:"' . mce_escape( __('Alternate Text') ) . '"
});
';
-(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(c,d){var e=this,f={},b;e.editor=c;c.addCommand("mceFullScreen",function(){var h,i=a.doc.documentElement;if(c.getParam("fullscreen_is_enabled")){if(c.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",e.resizeFunc);tinyMCE.get(c.getParam("fullscreen_editor_id")).setContent(c.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(c);a.remove("mce_fullscreen_container");i.style.overflow=c.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",c.getParam("fullscreen_overflow"));a.win.scrollTo(c.getParam("fullscreen_scrollx"),c.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(c.getParam("fullscreen_new_window")){h=a.win.open(d+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{h.resizeTo(screen.availWidth,screen.availHeight)}catch(g){}}else{tinyMCE.oldSettings=tinyMCE.settings;f.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";f.fullscreen_html_overflow=a.getStyle(i,"overflow",1);b=a.getViewPort();f.fullscreen_scrollx=b.x;f.fullscreen_scrolly=b.y;if(tinymce.isOpera&&f.fullscreen_overflow=="visible"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&f.fullscreen_overflow=="scroll"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&(f.fullscreen_html_overflow=="visible"||f.fullscreen_html_overflow=="scroll")){f.fullscreen_html_overflow="auto"}if(f.fullscreen_overflow=="0px"){f.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");i.style.overflow="hidden";b=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){b.h-=1}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+(tinymce.isIE6||(tinymce.isIE&&!a.boxModel)?"absolute":"fixed")+";top:0;left:0;width:"+b.w+"px;height:"+b.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(c.settings,function(j,k){f[k]=j});f.id="mce_fullscreen";f.width=n.clientWidth;f.height=n.clientHeight-15;f.fullscreen_is_enabled=true;f.fullscreen_editor_id=c.id;f.theme_advanced_resizing=false;f.save_onsavecallback=function(){c.setContent(tinyMCE.get(f.id).getContent({format:"raw"}),{format:"raw"});c.execCommand("mceSave")};tinymce.each(c.getParam("fullscreen_settings"),function(l,j){f[j]=l});if(f.theme_advanced_toolbar_location==="external"){f.theme_advanced_toolbar_location="top"}e.fullscreenEditor=new tinymce.Editor("mce_fullscreen",f);e.fullscreenEditor.onInit.add(function(){e.fullscreenEditor.setContent(c.getContent());e.fullscreenEditor.focus()});e.fullscreenEditor.render();tinyMCE.add(e.fullscreenEditor);e.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");e.fullscreenElement.update();e.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var j=tinymce.DOM.getViewPort();e.fullscreenEditor.theme.resizeTo(j.w,j.h)})}});c.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});c.onNodeChange.add(function(h,g){g.setActive("fullscreen",h.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
\ No newline at end of file
+(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(c,d){var e=this,f={},b;e.editor=c;c.addCommand("mceFullScreen",function(){var h,i=a.doc.documentElement;if(c.getParam("fullscreen_is_enabled")){if(c.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",e.resizeFunc);tinyMCE.get(c.getParam("fullscreen_editor_id")).setContent(c.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(c);a.remove("mce_fullscreen_container");i.style.overflow=c.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",c.getParam("fullscreen_overflow"));a.win.scrollTo(c.getParam("fullscreen_scrollx"),c.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(c.getParam("fullscreen_new_window")){h=a.win.open(d+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{h.resizeTo(screen.availWidth,screen.availHeight)}catch(g){}}else{tinyMCE.oldSettings=tinyMCE.settings;f.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";f.fullscreen_html_overflow=a.getStyle(i,"overflow",1);b=a.getViewPort();f.fullscreen_scrollx=b.x;f.fullscreen_scrolly=b.y;if(tinymce.isOpera&&f.fullscreen_overflow=="visible"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&f.fullscreen_overflow=="scroll"){f.fullscreen_overflow="auto"}if(tinymce.isIE&&(f.fullscreen_html_overflow=="visible"||f.fullscreen_html_overflow=="scroll")){f.fullscreen_html_overflow="auto"}if(f.fullscreen_overflow=="0px"){f.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");i.style.overflow="hidden";b=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){b.h-=1}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+(tinymce.isIE6||(tinymce.isIE&&!a.boxModel)?"absolute":"fixed")+";top:0;left:0;width:"+b.w+"px;height:"+b.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(c.settings,function(j,k){f[k]=j});f.id="mce_fullscreen";f.width=n.clientWidth;f.height=n.clientHeight-15;f.fullscreen_is_enabled=true;f.fullscreen_editor_id=c.id;f.theme_advanced_resizing=false;f.save_onsavecallback=function(){c.setContent(tinyMCE.get(f.id).getContent({format:"raw"}),{format:"raw"});c.execCommand("mceSave")};tinymce.each(c.getParam("fullscreen_settings"),function(l,j){f[j]=l});if(f.theme_advanced_toolbar_location==="external"){f.theme_advanced_toolbar_location="top"}e.fullscreenEditor=new tinymce.Editor("mce_fullscreen",f);e.fullscreenEditor.onInit.add(function(){e.fullscreenEditor.setContent(c.getContent());e.fullscreenEditor.focus()});e.fullscreenEditor.render();e.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");e.fullscreenElement.update();e.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var m=tinymce.DOM.getViewPort(),k=e.fullscreenEditor,j,l;j=k.dom.getSize(k.getContainer().firstChild);l=k.dom.getSize(k.getContainer().getElementsByTagName("iframe")[0]);k.theme.resizeTo(m.w-j.w+l.w,m.h-j.h+l.h)})}});c.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});c.onNodeChange.add(function(h,g){g.setActive("fullscreen",h.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
\ No newline at end of file
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <script type="text/javascript" src="../../tiny_mce.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../tiny_mce.js?ver=3392"></script>
<script type="text/javascript">
function patchCallback(settings, key) {
if (settings[key])
-(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(r,j){var y=this,i,k="",q=y.editor,g=0,s=0,h,m,n,o,l,v,x;r=r||{};j=j||{};if(!r.inline){return y.parent(r,j)}if(!r.type){y.bookmark=q.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();r.width=parseInt(r.width||320);r.height=parseInt(r.height||240)+(tinymce.isIE?8:0);r.min_width=parseInt(r.min_width||150);r.min_height=parseInt(r.min_height||100);r.max_width=parseInt(r.max_width||2000);r.max_height=parseInt(r.max_height||2000);r.left=r.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(r.width/2)));r.top=r.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(r.height/2)));r.movable=r.resizable=true;j.mce_width=r.width;j.mce_height=r.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=r.auto_focus;y.features=r;y.params=j;y.onOpen.dispatch(y,r,j);if(r.type){k+=" mceModal";if(r.type){k+=" mce"+r.type.substring(0,1).toUpperCase()+r.type.substring(1)}r.resizable=false}if(r.statusbar){k+=" mceStatusbar"}if(r.resizable){k+=" mceResizable"}if(r.minimizable){k+=" mceMinimizable"}if(r.maximizable){k+=" mceMaximizable"}if(r.movable){k+=" mceMovable"}y._addAll(d.doc.body,["div",{id:i,"class":q.settings.inlinepopups_skin||"clearlooks2",style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},r.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!r.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;s+=d.get(i+"_top").clientHeight;s+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:r.top,left:r.left,width:r.width+g,height:r.height+s});x=r.url||r.file;if(x){if(tinymce.relaxedDomain){x+=(x.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}x=tinymce._addVer(x)}if(!r.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:r.width,height:r.height});d.setAttrib(i+"_ifr","src",x)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(r.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",r.content.replace("\n","<br />"))}n=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=y.windows[i];y.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return y._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return y._startDrag(i,t,u.className.substring(13))}}}}}});o=a.add(i,"click",function(f){var p=f.target;y.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":y.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":r.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});v=y.windows[i]={id:i,mousedown_func:n,click_func:o,element:new b(i,{blocker:1,container:q.getContainer()}),iframeElement:new b(i+"_ifr"),features:r,deltaWidth:g,deltaHeight:s};v.iframeElement.on("focus",function(){y.focus(i)});if(y.count==0&&y.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(y.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:y.zIndex-1}});d.show("mceModalBlocker")}else{d.setStyle("mceModalBlocker","z-index",y.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}y.focus(i);y._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}y.count++;return v},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(j,l){var h=this,g,k=d.doc,f=0,i,l;l=h._findId(l||j);if(!h.windows[l]){h.parent(j);return}h.count--;if(h.count==0){d.remove("mceModalBlocker")}if(g=h.windows[l]){h.onClose.dispatch(h);a.remove(k,"mousedown",g.mousedownFunc);a.remove(k,"click",g.clickFunc);a.clear(l);a.clear(l+"_ifr");d.setAttrib(l+"_ifr","src",'javascript:""');g.element.remove();delete h.windows[l];e(h.windows,function(m){if(m.zIndex>f){i=m;f=m.zIndex}});if(i){h.focus(i.id)}}},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
\ No newline at end of file
+(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(r,j){var y=this,i,k="",q=y.editor,g=0,s=0,h,m,n,o,l,v,x;r=r||{};j=j||{};if(!r.inline){return y.parent(r,j)}if(!r.type){y.bookmark=q.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();r.width=parseInt(r.width||320);r.height=parseInt(r.height||240)+(tinymce.isIE?8:0);r.min_width=parseInt(r.min_width||150);r.min_height=parseInt(r.min_height||100);r.max_width=parseInt(r.max_width||2000);r.max_height=parseInt(r.max_height||2000);r.left=r.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(r.width/2)));r.top=r.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(r.height/2)));r.movable=r.resizable=true;j.mce_width=r.width;j.mce_height=r.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=r.auto_focus;y.features=r;y.params=j;y.onOpen.dispatch(y,r,j);if(r.type){k+=" mceModal";if(r.type){k+=" mce"+r.type.substring(0,1).toUpperCase()+r.type.substring(1)}r.resizable=false}if(r.statusbar){k+=" mceStatusbar"}if(r.resizable){k+=" mceResizable"}if(r.minimizable){k+=" mceMinimizable"}if(r.maximizable){k+=" mceMaximizable"}if(r.movable){k+=" mceMovable"}y._addAll(d.doc.body,["div",{id:i,"class":(q.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},r.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!r.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;s+=d.get(i+"_top").clientHeight;s+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:r.top,left:r.left,width:r.width+g,height:r.height+s});x=r.url||r.file;if(x){if(tinymce.relaxedDomain){x+=(x.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}x=tinymce._addVer(x)}if(!r.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:r.width,height:r.height});d.setAttrib(i+"_ifr","src",x)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(r.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",r.content.replace("\n","<br />"))}n=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=y.windows[i];y.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return y._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return y._startDrag(i,t,u.className.substring(13))}}}}}});o=a.add(i,"click",function(f){var p=f.target;y.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":y.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":r.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});v=y.windows[i]={id:i,mousedown_func:n,click_func:o,element:new b(i,{blocker:1,container:q.getContainer()}),iframeElement:new b(i+"_ifr"),features:r,deltaWidth:g,deltaHeight:s};v.iframeElement.on("focus",function(){y.focus(i)});if(y.count==0&&y.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(y.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:y.zIndex-1}});d.show("mceModalBlocker")}else{d.setStyle("mceModalBlocker","z-index",y.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}y.focus(i);y._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}y.count++;return v},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(j,l){var h=this,g,k=d.doc,f=0,i,l;l=h._findId(l||j);if(!h.windows[l]){h.parent(j);return}h.count--;if(h.count==0){d.remove("mceModalBlocker")}if(g=h.windows[l]){h.onClose.dispatch(h);a.remove(k,"mousedown",g.mousedownFunc);a.remove(k,"click",g.clickFunc);a.clear(l);a.clear(l+"_ifr");d.setAttrib(l+"_ifr","src",'javascript:""');g.element.remove();delete h.windows[l];e(h.windows,function(m){if(m.zIndex>f){i=m;f=m.zIndex}});if(i){h.focus(i.id)}}},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
\ No newline at end of file
/* Clearlooks 2 */
+
/* Reset */
-.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block;}
+.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block}
/* General */
.clearlooks2 {position:absolute; direction:ltr}
.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0}
.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px}
.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal}
-.clearlooks2 a:hover {font-weight:bold}
+.clearlooks2 a:hover {font-weight:bold;}
.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#E4F2FD}
.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px}
.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)}
.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px}
.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto}
.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)}
+
+/* IE9 fixes */
+.clearlooks2.ie9 .mceTop .mceCenter {clip:auto;}
+.clearlooks2.ie9 .mceMiddle {clip:auto;}
+.clearlooks2.ie9 .mceMiddle .mceLeft, .clearlooks2.ie9 .mceMiddle .mceRight {top: 23px;}
+.clearlooks2.ie9 .mceAlert .mceMiddle span, .clearlooks2.ie9 .mceConfirm .mceMiddle span {top:13px;}
+.clearlooks2.ie9 .mceModal .mceMiddle {top:23px}
+.clearlooks2.ie9 .mceModal .mceMiddle .mceLeft, .clearlooks2.ie9 .mceModal .mceMiddle .mceRight {top: 0}
+.clearlooks2.ie9 .mceMiddle .mceIcon {top:13px}
+.clearlooks2.ie9 .mceTop .mceCenter {top:0; right:auto; left:6px; width:calc(100%-12px)}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Template for dialogs</title>
-<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css?ver=327-1235" />
+<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css?ver=3392" />
</head>
<body>
+++ /dev/null
-.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;}
-.mceItemShockWave {background-image: url(../img/shockwave.gif);}
-.mceItemFlash {background-image:url(../img/flash.gif);}
-.mceItemQuickTime {background-image:url(../img/quicktime.gif);}
-.mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);}
-.mceItemRealMedia {background-image:url(../img/realmedia.gif);}
+++ /dev/null
-#id, #name, #hspace, #vspace, #class_name, #align { width: 100px }
-#hspace, #vspace { width: 50px }
-#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px }
-#flash_base, #flash_flashvars { width: 240px }
-#width, #height { width: 40px }
-#src, #media_type { width: 250px }
-#class { width: 120px }
-#prev { margin: 0; border: 1px solid black; width: 380px; height: 230px; overflow: auto }
-.panel_wrapper div.current { height: 390px; overflow: auto }
-#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none }
-.mceAddSelectValue { background-color: #DDDDDD }
-#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px }
-#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px }
-#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px }
-#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px }
-#qt_qtsrc { width: 200px }
+++ /dev/null
-(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.MediaPlugin",{init:function(b,c){var e=this;e.editor=b;e.url=c;function f(g){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(g.className)}b.onPreInit.add(function(){b.serializer.addRules("param[name|value|_mce_value]")});b.addCommand("mceMedia",function(){b.windowManager.open({file:c+"/media.htm",width:430+parseInt(b.getLang("media.delta_width",0)),height:470+parseInt(b.getLang("media.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("media",{title:"media.desc",cmd:"mceMedia"});b.onNodeChange.add(function(h,g,i){g.setActive("media",i.nodeName=="IMG"&&f(i))});b.onInit.add(function(){var g={mceItemFlash:"flash",mceItemShockWave:"shockwave",mceItemWindowsMedia:"windowsmedia",mceItemQuickTime:"quicktime",mceItemRealMedia:"realmedia"};b.selection.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.selection.onBeforeSetContent.add(e._objectsToSpans,e);if(b.settings.content_css!==false){b.dom.loadCSS(c+"/css/content.css")}if(b.theme&&b.theme.onResolveName){b.theme.onResolveName.add(function(h,i){if(i.name=="img"){a(g,function(l,j){if(b.dom.hasClass(i.node,j)){i.name=l;i.title=b.dom.getAttrib(i.node,"title");return false}})}})}if(b&&b.plugins.contextmenu){b.plugins.contextmenu.onContextMenu.add(function(i,h,j){if(j.nodeName=="IMG"&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(j.className)){h.add({title:"media.edit",icon:"media",cmd:"mceMedia"})}})}});b.onBeforeSetContent.add(e._objectsToSpans,e);b.onSetContent.add(function(){e._spansToImgs(b.getBody())});b.onPreProcess.add(function(g,i){var h=g.dom;if(i.set){e._spansToImgs(i.node);a(h.select("IMG",i.node),function(k){var j;if(f(k)){j=e._parse(k.title);h.setAttrib(k,"width",h.getAttrib(k,"width",j.width||100));h.setAttrib(k,"height",h.getAttrib(k,"height",j.height||100))}})}if(i.get){a(h.select("IMG",i.node),function(m){var l,j,k;if(g.getParam("media_use_script")){if(f(m)){m.className=m.className.replace(/mceItem/g,"mceTemp")}return}switch(m.className){case"mceItemFlash":l="d27cdb6e-ae6d-11cf-96b8-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="application/x-shockwave-flash";break;case"mceItemShockWave":l="166b1bca-3f9c-11cf-8075-444553540000";j="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0";k="application/x-director";break;case"mceItemWindowsMedia":l=g.getParam("media_wmp6_compatible")?"05589fa1-c356-11ce-bf01-00aa0055595a":"6bf52a52-394a-11d3-b153-00c04f79faa6";j="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701";k="application/x-mplayer2";break;case"mceItemQuickTime":l="02bf25d5-8c17-4b23-bc80-d3488abddc6b";j="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0";k="video/quicktime";break;case"mceItemRealMedia":l="cfcdaa03-8be4-11cf-b84b-0020afbbccfa";j="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0";k="audio/x-pn-realaudio-plugin";break}if(l){h.replace(e._buildObj({classid:l,codebase:j,type:k},m),m)}})}});b.onPostProcess.add(function(g,h){h.content=h.content.replace(/_mce_value=/g,"value=")});function d(g,h){h=new RegExp(h+'="([^"]+)"',"g").exec(g);return h?b.dom.decode(h[1]):""}b.onPostProcess.add(function(g,h){if(g.getParam("media_use_script")){h.content=h.content.replace(/<img[^>]+>/g,function(j){var i=d(j,"class");if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(i)){at=e._parse(d(j,"title"));at.width=d(j,"width");at.height=d(j,"height");j='<script type="text/javascript">write'+i.substring(7)+"({"+e._serialize(at)+"});<\/script>"}return j})}})},getInfo:function(){return{longname:"Media",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_objectsToSpans:function(b,e){var c=this,d=e.content;d=d.replace(/<script[^>]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(g,f,i){var h=c._parse(i);return'<img class="mceItem'+f+'" title="'+b.dom.encode(i)+'" src="'+c.url+'/img/trans.gif" width="'+h.width+'" height="'+h.height+'" />'});d=d.replace(/<object([^>]*)>/gi,'<span class="mceItemObject" $1>');d=d.replace(/<embed([^>]*)\/?>/gi,'<span class="mceItemEmbed" $1></span>');d=d.replace(/<embed([^>]*)>/gi,'<span class="mceItemEmbed" $1>');d=d.replace(/<\/(object)([^>]*)>/gi,"</span>");d=d.replace(/<\/embed>/gi,"");d=d.replace(/<param([^>]*)>/gi,function(g,f){return"<span "+f.replace(/value=/gi,"_mce_value=")+' class="mceItemParam"></span>'});d=d.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam"></span>');e.content=d},_buildObj:function(g,h){var d,c=this.editor,f=c.dom,e=this._parse(h.title),b;b=c.getParam("media_strict",true)&&g.type=="application/x-shockwave-flash";e.width=g.width=f.getAttrib(h,"width")||100;e.height=g.height=f.getAttrib(h,"height")||100;if(e.src){e.src=c.convertURL(e.src,"src",h)}if(b){d=f.create("span",{id:e.id,mce_name:"object",type:"application/x-shockwave-flash",data:e.src,style:f.getAttrib(h,"style"),width:g.width,height:g.height})}else{d=f.create("span",{id:e.id,mce_name:"object",classid:"clsid:"+g.classid,style:f.getAttrib(h,"style"),codebase:g.codebase,width:g.width,height:g.height})}a(e,function(j,i){if(!/^(width|height|codebase|classid|id|_cx|_cy)$/.test(i)){if(g.type=="application/x-mplayer2"&&i=="src"&&!e.url){i="url"}if(j){f.add(d,"span",{mce_name:"param",name:i,_mce_value:j})}}});if(!b){f.add(d,"span",tinymce.extend({mce_name:"embed",type:g.type,style:f.getAttrib(h,"style")},e))}return d},_spansToImgs:function(e){var d=this,f=d.editor.dom,b,c;a(f.select("span",e),function(g){if(f.getAttrib(g,"class")=="mceItemObject"){c=f.getAttrib(g,"classid").toLowerCase().replace(/\s+/g,"");switch(c){case"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000":f.replace(d._createImg("mceItemFlash",g),g);break;case"clsid:166b1bca-3f9c-11cf-8075-444553540000":f.replace(d._createImg("mceItemShockWave",g),g);break;case"clsid:6bf52a52-394a-11d3-b153-00c04f79faa6":case"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95":case"clsid:05589fa1-c356-11ce-bf01-00aa0055595a":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}return}if(f.getAttrib(g,"class")=="mceItemEmbed"){switch(f.getAttrib(g,"type")){case"application/x-shockwave-flash":f.replace(d._createImg("mceItemFlash",g),g);break;case"application/x-director":f.replace(d._createImg("mceItemShockWave",g),g);break;case"application/x-mplayer2":f.replace(d._createImg("mceItemWindowsMedia",g),g);break;case"video/quicktime":f.replace(d._createImg("mceItemQuickTime",g),g);break;case"audio/x-pn-realaudio-plugin":f.replace(d._createImg("mceItemRealMedia",g),g);break;default:f.replace(d._createImg("mceItemFlash",g),g)}}})},_createImg:function(c,h){var b,g=this.editor.dom,f={},e="",d;d=["id","name","width","height","bgcolor","align","flashvars","src","wmode","allowfullscreen","quality","data"];b=g.create("img",{src:this.url+"/img/trans.gif",width:g.getAttrib(h,"width")||100,height:g.getAttrib(h,"height")||100,style:g.getAttrib(h,"style"),"class":c});a(d,function(i){var j=g.getAttrib(h,i);if(j){f[i]=j}});a(g.select("span",h),function(i){if(g.hasClass(i,"mceItemParam")){f[g.getAttrib(i,"name")]=g.getAttrib(i,"_mce_value")}});if(f.movie){f.src=f.movie;delete f.movie}if(!f.src){f.src=f.data;delete f.data}h=g.select(".mceItemEmbed",h)[0];if(h){a(d,function(i){var j=g.getAttrib(h,i);if(j&&!f[i]){f[i]=j}})}delete f.width;delete f.height;b.title=this._serialize(f);return b},_parse:function(b){return tinymce.util.JSON.parse("{"+b+"}")},_serialize:function(b){return tinymce.util.JSON.serialize(b).replace(/[{}]/g,"")}});tinymce.PluginManager.add("media",tinymce.plugins.MediaPlugin)})();
\ No newline at end of file
+++ /dev/null
-/**
- * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
- */
-
-function writeFlash(p) {
- writeEmbed(
- 'D27CDB6E-AE6D-11cf-96B8-444553540000',
- 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
- 'application/x-shockwave-flash',
- p
- );
-}
-
-function writeShockWave(p) {
- writeEmbed(
- '166B1BCA-3F9C-11CF-8075-444553540000',
- 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
- 'application/x-director',
- p
- );
-}
-
-function writeQuickTime(p) {
- writeEmbed(
- '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
- 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
- 'video/quicktime',
- p
- );
-}
-
-function writeRealMedia(p) {
- writeEmbed(
- 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
- 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
- 'audio/x-pn-realaudio-plugin',
- p
- );
-}
-
-function writeWindowsMedia(p) {
- p.url = p.src;
- writeEmbed(
- '6BF52A52-394A-11D3-B153-00C04F79FAA6',
- 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
- 'application/x-mplayer2',
- p
- );
-}
-
-function writeEmbed(cls, cb, mt, p) {
- var h = '', n;
-
- h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
- h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
- h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
- h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
- h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
- h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
- h += '>';
-
- for (n in p)
- h += '<param name="' + n + '" value="' + p[n] + '">';
-
- h += '<embed type="' + mt + '"';
-
- for (n in p)
- h += n + '="' + p[n] + '" ';
-
- h += '></embed></object>';
-
- document.write(h);
-}
+++ /dev/null
-tinyMCEPopup.requireLangPack();
-
-var oldWidth, oldHeight, ed, url;
-
-if (url = tinyMCEPopup.getParam("media_external_list_url"))
- document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
-
-function init() {
- var pl = "", f, val;
- var type = "flash", fe, i;
-
- ed = tinyMCEPopup.editor;
-
- tinyMCEPopup.resizeToInnerSize();
- f = document.forms[0]
-
- fe = ed.selection.getNode();
- if (/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {
- pl = fe.title;
-
- switch (ed.dom.getAttrib(fe, 'class')) {
- case 'mceItemFlash':
- type = 'flash';
- break;
-
- case 'mceItemFlashVideo':
- type = 'flv';
- break;
-
- case 'mceItemShockWave':
- type = 'shockwave';
- break;
-
- case 'mceItemWindowsMedia':
- type = 'wmp';
- break;
-
- case 'mceItemQuickTime':
- type = 'qt';
- break;
-
- case 'mceItemRealMedia':
- type = 'rmp';
- break;
- }
-
- document.forms[0].insert.value = ed.getLang('update', 'Insert', true);
- }
-
- document.getElementById('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media');
- document.getElementById('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','qt_qtsrc','media','media');
- document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
-
- var html = getMediaListHTML('medialist','src','media','media');
- if (html == "")
- document.getElementById("linklistrow").style.display = 'none';
- else
- document.getElementById("linklistcontainer").innerHTML = html;
-
- // Resize some elements
- if (isVisible('filebrowser'))
- document.getElementById('src').style.width = '230px';
-
- // Setup form
- if (pl != "") {
- pl = tinyMCEPopup.editor.plugins.media._parse(pl);
-
- switch (type) {
- case "flash":
- setBool(pl, 'flash', 'play');
- setBool(pl, 'flash', 'loop');
- setBool(pl, 'flash', 'menu');
- setBool(pl, 'flash', 'swliveconnect');
- setStr(pl, 'flash', 'quality');
- setStr(pl, 'flash', 'scale');
- setStr(pl, 'flash', 'salign');
- setStr(pl, 'flash', 'wmode');
- setStr(pl, 'flash', 'base');
- setStr(pl, 'flash', 'flashvars');
- break;
-
- case "qt":
- setBool(pl, 'qt', 'loop');
- setBool(pl, 'qt', 'autoplay');
- setBool(pl, 'qt', 'cache');
- setBool(pl, 'qt', 'controller');
- setBool(pl, 'qt', 'correction');
- setBool(pl, 'qt', 'enablejavascript');
- setBool(pl, 'qt', 'kioskmode');
- setBool(pl, 'qt', 'autohref');
- setBool(pl, 'qt', 'playeveryframe');
- setBool(pl, 'qt', 'tarsetcache');
- setStr(pl, 'qt', 'scale');
- setStr(pl, 'qt', 'starttime');
- setStr(pl, 'qt', 'endtime');
- setStr(pl, 'qt', 'tarset');
- setStr(pl, 'qt', 'qtsrcchokespeed');
- setStr(pl, 'qt', 'volume');
- setStr(pl, 'qt', 'qtsrc');
- break;
-
- case "shockwave":
- setBool(pl, 'shockwave', 'sound');
- setBool(pl, 'shockwave', 'progress');
- setBool(pl, 'shockwave', 'autostart');
- setBool(pl, 'shockwave', 'swliveconnect');
- setStr(pl, 'shockwave', 'swvolume');
- setStr(pl, 'shockwave', 'swstretchstyle');
- setStr(pl, 'shockwave', 'swstretchhalign');
- setStr(pl, 'shockwave', 'swstretchvalign');
- break;
-
- case "wmp":
- setBool(pl, 'wmp', 'autostart');
- setBool(pl, 'wmp', 'enabled');
- setBool(pl, 'wmp', 'enablecontextmenu');
- setBool(pl, 'wmp', 'fullscreen');
- setBool(pl, 'wmp', 'invokeurls');
- setBool(pl, 'wmp', 'mute');
- setBool(pl, 'wmp', 'stretchtofit');
- setBool(pl, 'wmp', 'windowlessvideo');
- setStr(pl, 'wmp', 'balance');
- setStr(pl, 'wmp', 'baseurl');
- setStr(pl, 'wmp', 'captioningid');
- setStr(pl, 'wmp', 'currentmarker');
- setStr(pl, 'wmp', 'currentposition');
- setStr(pl, 'wmp', 'defaultframe');
- setStr(pl, 'wmp', 'playcount');
- setStr(pl, 'wmp', 'rate');
- setStr(pl, 'wmp', 'uimode');
- setStr(pl, 'wmp', 'volume');
- break;
-
- case "rmp":
- setBool(pl, 'rmp', 'autostart');
- setBool(pl, 'rmp', 'loop');
- setBool(pl, 'rmp', 'autogotourl');
- setBool(pl, 'rmp', 'center');
- setBool(pl, 'rmp', 'imagestatus');
- setBool(pl, 'rmp', 'maintainaspect');
- setBool(pl, 'rmp', 'nojava');
- setBool(pl, 'rmp', 'prefetch');
- setBool(pl, 'rmp', 'shuffle');
- setStr(pl, 'rmp', 'console');
- setStr(pl, 'rmp', 'controls');
- setStr(pl, 'rmp', 'numloop');
- setStr(pl, 'rmp', 'scriptcallbacks');
- break;
- }
-
- setStr(pl, null, 'src');
- setStr(pl, null, 'id');
- setStr(pl, null, 'name');
- setStr(pl, null, 'vspace');
- setStr(pl, null, 'hspace');
- setStr(pl, null, 'bgcolor');
- setStr(pl, null, 'align');
- setStr(pl, null, 'width');
- setStr(pl, null, 'height');
-
- if ((val = ed.dom.getAttrib(fe, "width")) != "")
- pl.width = f.width.value = val;
-
- if ((val = ed.dom.getAttrib(fe, "height")) != "")
- pl.height = f.height.value = val;
-
- oldWidth = pl.width ? parseInt(pl.width) : 0;
- oldHeight = pl.height ? parseInt(pl.height) : 0;
- } else
- oldWidth = oldHeight = 0;
-
- selectByValue(f, 'media_type', type);
- changedType(type);
- updateColor('bgcolor_pick', 'bgcolor');
-
- TinyMCE_EditableSelects.init();
- generatePreview();
-}
-
-function insertMedia() {
- var fe, f = document.forms[0], h;
-
- tinyMCEPopup.restoreSelection();
-
- if (!AutoValidator.validate(f)) {
- tinyMCEPopup.alert(ed.getLang('invalid_data'));
- return false;
- }
-
- f.width.value = f.width.value == "" ? 100 : f.width.value;
- f.height.value = f.height.value == "" ? 100 : f.height.value;
-
- fe = ed.selection.getNode();
- if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {
- switch (f.media_type.options[f.media_type.selectedIndex].value) {
- case "flash":
- fe.className = "mceItemFlash";
- break;
-
- case "flv":
- fe.className = "mceItemFlashVideo";
- break;
-
- case "shockwave":
- fe.className = "mceItemShockWave";
- break;
-
- case "qt":
- fe.className = "mceItemQuickTime";
- break;
-
- case "wmp":
- fe.className = "mceItemWindowsMedia";
- break;
-
- case "rmp":
- fe.className = "mceItemRealMedia";
- break;
- }
-
- if (fe.width != f.width.value || fe.height != f.height.value)
- ed.execCommand('mceRepaint');
-
- fe.title = serializeParameters();
- fe.width = f.width.value;
- fe.height = f.height.value;
- fe.style.width = f.width.value + (f.width.value.indexOf('%') == -1 ? 'px' : '');
- fe.style.height = f.height.value + (f.height.value.indexOf('%') == -1 ? 'px' : '');
- fe.align = f.align.options[f.align.selectedIndex].value;
- } else {
- h = '<img src="' + tinyMCEPopup.getWindowArg("plugin_url") + '/img/trans.gif"' ;
-
- switch (f.media_type.options[f.media_type.selectedIndex].value) {
- case "flash":
- h += ' class="mceItemFlash"';
- break;
-
- case "flv":
- h += ' class="mceItemFlashVideo"';
- break;
-
- case "shockwave":
- h += ' class="mceItemShockWave"';
- break;
-
- case "qt":
- h += ' class="mceItemQuickTime"';
- break;
-
- case "wmp":
- h += ' class="mceItemWindowsMedia"';
- break;
-
- case "rmp":
- h += ' class="mceItemRealMedia"';
- break;
- }
-
- h += ' title="' + serializeParameters() + '"';
- h += ' width="' + f.width.value + '"';
- h += ' height="' + f.height.value + '"';
- h += ' align="' + f.align.options[f.align.selectedIndex].value + '"';
-
- h += ' />';
-
- ed.execCommand('mceInsertContent', false, h);
- }
-
- tinyMCEPopup.close();
-}
-
-function updatePreview() {
- var f = document.forms[0], type;
-
- f.width.value = f.width.value || '320';
- f.height.value = f.height.value || '240';
-
- type = getType(f.src.value);
- selectByValue(f, 'media_type', type);
- changedType(type);
- generatePreview();
-}
-
-function getMediaListHTML() {
- if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) {
- var html = "";
-
- html += '<select id="linklist" name="linklist" style="width: 250px" onchange="this.form.src.value=this.options[this.selectedIndex].value;updatePreview();">';
- html += '<option value="">---</option>';
-
- for (var i=0; i<tinyMCEMediaList.length; i++)
- html += '<option value="' + tinyMCEMediaList[i][1] + '">' + tinyMCEMediaList[i][0] + '</option>';
-
- html += '</select>';
-
- return html;
- }
-
- return "";
-}
-
-function getType(v) {
- var fo, i, c, el, x, f = document.forms[0];
-
- fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';');
-
- // YouTube
- if (v.match(/watch\?v=(.+)(.*)/)) {
- f.width.value = '425';
- f.height.value = '350';
- f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1];
- return 'flash';
- }
-
- // Google video
- if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) {
- f.width.value = '425';
- f.height.value = '326';
- f.src.value = 'http://video.google.com/googleplayer.swf?docId=' + v.substring('http://video.google.com/videoplay?docid='.length) + '&hl=en';
- return 'flash';
- }
-
- for (i=0; i<fo.length; i++) {
- c = fo[i].split('=');
-
- el = c[1].split(',');
- for (x=0; x<el.length; x++)
- if (v.indexOf('.' + el[x]) != -1)
- return c[0];
- }
-
- return null;
-}
-
-function switchType(v) {
- var t = getType(v), d = document, f = d.forms[0];
-
- if (!t)
- return;
-
- selectByValue(d.forms[0], 'media_type', t);
- changedType(t);
-
- // Update qtsrc also
- if (t == 'qt' && f.src.value.toLowerCase().indexOf('rtsp://') != -1) {
- alert(ed.getLang("media_qt_stream_warn"));
-
- if (f.qt_qtsrc.value == '')
- f.qt_qtsrc.value = f.src.value;
- }
-}
-
-function changedType(t) {
- var d = document;
-
- d.getElementById('flash_options').style.display = 'none';
- d.getElementById('flv_options').style.display = 'none';
- d.getElementById('qt_options').style.display = 'none';
- d.getElementById('shockwave_options').style.display = 'none';
- d.getElementById('wmp_options').style.display = 'none';
- d.getElementById('rmp_options').style.display = 'none';
-
- if (t)
- d.getElementById(t + '_options').style.display = 'block';
-}
-
-function serializeParameters() {
- var d = document, f = d.forms[0], s = '';
-
- switch (f.media_type.options[f.media_type.selectedIndex].value) {
- case "flash":
- s += getBool('flash', 'play', true);
- s += getBool('flash', 'loop', true);
- s += getBool('flash', 'menu', true);
- s += getBool('flash', 'swliveconnect', false);
- s += getStr('flash', 'quality');
- s += getStr('flash', 'scale');
- s += getStr('flash', 'salign');
- s += getStr('flash', 'wmode');
- s += getStr('flash', 'base');
- s += getStr('flash', 'flashvars');
- break;
-
- case "qt":
- s += getBool('qt', 'loop', false);
- s += getBool('qt', 'autoplay', true);
- s += getBool('qt', 'cache', false);
- s += getBool('qt', 'controller', true);
- s += getBool('qt', 'correction', false, 'none', 'full');
- s += getBool('qt', 'enablejavascript', false);
- s += getBool('qt', 'kioskmode', false);
- s += getBool('qt', 'autohref', false);
- s += getBool('qt', 'playeveryframe', false);
- s += getBool('qt', 'targetcache', false);
- s += getStr('qt', 'scale');
- s += getStr('qt', 'starttime');
- s += getStr('qt', 'endtime');
- s += getStr('qt', 'target');
- s += getStr('qt', 'qtsrcchokespeed');
- s += getStr('qt', 'volume');
- s += getStr('qt', 'qtsrc');
- break;
-
- case "shockwave":
- s += getBool('shockwave', 'sound');
- s += getBool('shockwave', 'progress');
- s += getBool('shockwave', 'autostart');
- s += getBool('shockwave', 'swliveconnect');
- s += getStr('shockwave', 'swvolume');
- s += getStr('shockwave', 'swstretchstyle');
- s += getStr('shockwave', 'swstretchhalign');
- s += getStr('shockwave', 'swstretchvalign');
- break;
-
- case "wmp":
- s += getBool('wmp', 'autostart', true);
- s += getBool('wmp', 'enabled', false);
- s += getBool('wmp', 'enablecontextmenu', true);
- s += getBool('wmp', 'fullscreen', false);
- s += getBool('wmp', 'invokeurls', true);
- s += getBool('wmp', 'mute', false);
- s += getBool('wmp', 'stretchtofit', false);
- s += getBool('wmp', 'windowlessvideo', false);
- s += getStr('wmp', 'balance');
- s += getStr('wmp', 'baseurl');
- s += getStr('wmp', 'captioningid');
- s += getStr('wmp', 'currentmarker');
- s += getStr('wmp', 'currentposition');
- s += getStr('wmp', 'defaultframe');
- s += getStr('wmp', 'playcount');
- s += getStr('wmp', 'rate');
- s += getStr('wmp', 'uimode');
- s += getStr('wmp', 'volume');
- break;
-
- case "rmp":
- s += getBool('rmp', 'autostart', false);
- s += getBool('rmp', 'loop', false);
- s += getBool('rmp', 'autogotourl', true);
- s += getBool('rmp', 'center', false);
- s += getBool('rmp', 'imagestatus', true);
- s += getBool('rmp', 'maintainaspect', false);
- s += getBool('rmp', 'nojava', false);
- s += getBool('rmp', 'prefetch', false);
- s += getBool('rmp', 'shuffle', false);
- s += getStr('rmp', 'console');
- s += getStr('rmp', 'controls');
- s += getStr('rmp', 'numloop');
- s += getStr('rmp', 'scriptcallbacks');
- break;
- }
-
- s += getStr(null, 'id');
- s += getStr(null, 'name');
- s += getStr(null, 'src');
- s += getStr(null, 'align');
- s += getStr(null, 'bgcolor');
- s += getInt(null, 'vspace');
- s += getInt(null, 'hspace');
- s += getStr(null, 'width');
- s += getStr(null, 'height');
-
- s = s.length > 0 ? s.substring(0, s.length - 1) : s;
-
- return s;
-}
-
-function setBool(pl, p, n) {
- if (typeof(pl[n]) == "undefined")
- return;
-
- document.forms[0].elements[p + "_" + n].checked = pl[n] != 'false';
-}
-
-function setStr(pl, p, n) {
- var f = document.forms[0], e = f.elements[(p != null ? p + "_" : '') + n];
-
- if (typeof(pl[n]) == "undefined")
- return;
-
- if (e.type == "text")
- e.value = pl[n];
- else
- selectByValue(f, (p != null ? p + "_" : '') + n, pl[n]);
-}
-
-function getBool(p, n, d, tv, fv) {
- var v = document.forms[0].elements[p + "_" + n].checked;
-
- tv = typeof(tv) == 'undefined' ? 'true' : "'" + jsEncode(tv) + "'";
- fv = typeof(fv) == 'undefined' ? 'false' : "'" + jsEncode(fv) + "'";
-
- return (v == d) ? '' : n + (v ? ':' + tv + ',' : ":\'" + fv + "\',");
-}
-
-function getStr(p, n, d) {
- var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];
- var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;
-
- if (n == 'src')
- v = tinyMCEPopup.editor.convertURL(v, 'src', null);
-
- return ((n == d || v == '') ? '' : n + ":'" + jsEncode(v) + "',");
-}
-
-function getInt(p, n, d) {
- var e = document.forms[0].elements[(p != null ? p + "_" : "") + n];
- var v = e.type == "text" ? e.value : e.options[e.selectedIndex].value;
-
- return ((n == d || v == '') ? '' : n + ":" + v.replace(/[^0-9]+/g, '') + ",");
-}
-
-function jsEncode(s) {
- s = s.replace(new RegExp('\\\\', 'g'), '\\\\');
- s = s.replace(new RegExp('"', 'g'), '\\"');
- s = s.replace(new RegExp("'", 'g'), "\\'");
-
- return s;
-}
-
-function generatePreview(c) {
- var f = document.forms[0], p = document.getElementById('prev'), h = '', cls, pl, n, type, codebase, wp, hp, nw, nh;
-
- p.innerHTML = '<!-- x --->';
-
- nw = parseInt(f.width.value);
- nh = parseInt(f.height.value);
-
- if (f.width.value != "" && f.height.value != "") {
- if (f.constrain.checked) {
- if (c == 'width' && oldWidth != 0) {
- wp = nw / oldWidth;
- nh = Math.round(wp * nh);
- f.height.value = nh;
- } else if (c == 'height' && oldHeight != 0) {
- hp = nh / oldHeight;
- nw = Math.round(hp * nw);
- f.width.value = nw;
- }
- }
- }
-
- if (f.width.value != "")
- oldWidth = nw;
-
- if (f.height.value != "")
- oldHeight = nh;
-
- // After constrain
- pl = serializeParameters();
-
- switch (f.media_type.options[f.media_type.selectedIndex].value) {
- case "flash":
- cls = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
- codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';
- type = 'application/x-shockwave-flash';
- break;
-
- case "shockwave":
- cls = 'clsid:166B1BCA-3F9C-11CF-8075-444553540000';
- codebase = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';
- type = 'application/x-director';
- break;
-
- case "qt":
- cls = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';
- codebase = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';
- type = 'video/quicktime';
- break;
-
- case "wmp":
- cls = ed.getParam('media_wmp6_compatible') ? 'clsid:05589FA1-C356-11CE-BF01-00AA0055595A' : 'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6';
- codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
- type = 'application/x-mplayer2';
- break;
-
- case "rmp":
- cls = 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA';
- codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';
- type = 'audio/x-pn-realaudio-plugin';
- break;
- }
-
- if (pl == '') {
- p.innerHTML = '';
- return;
- }
-
- pl = tinyMCEPopup.editor.plugins.media._parse(pl);
-
- if (!pl.src) {
- p.innerHTML = '';
- return;
- }
-
- pl.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(pl.src);
- pl.width = !pl.width ? 100 : pl.width;
- pl.height = !pl.height ? 100 : pl.height;
- pl.id = !pl.id ? 'obj' : pl.id;
- pl.name = !pl.name ? 'eobj' : pl.name;
- pl.align = !pl.align ? '' : pl.align;
-
- // Avoid annoying warning about insecure items
- if (!tinymce.isIE || document.location.protocol != 'https:') {
- h += '<object classid="' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';
-
- for (n in pl) {
- h += '<param name="' + n + '" value="' + pl[n] + '">';
-
- // Add extra url parameter if it's an absolute URL
- if (n == 'src' && pl[n].indexOf('://') != -1)
- h += '<param name="url" value="' + pl[n] + '" />';
- }
- }
-
- h += '<embed type="' + type + '" ';
-
- for (n in pl)
- h += n + '="' + pl[n] + '" ';
-
- h += '></embed>';
-
- // Avoid annoying warning about insecure items
- if (!tinymce.isIE || document.location.protocol != 'https:')
- h += '</object>';
-
- p.innerHTML = "<!-- x --->" + h;
-}
-
-tinyMCEPopup.onInit.add(init);
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>{#media_dlg.title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
- <script type="text/javascript" src="js/media.js?ver=327-1235"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?ver=327-1235"></script>
- <script type="text/javascript" src="../../utils/validate.js?ver=327-1235"></script>
- <script type="text/javascript" src="../../utils/form_utils.js?ver=327-1235"></script>
- <script type="text/javascript" src="../../utils/editable_selects.js?ver=327-1235"></script>
- <link href="css/media.css?ver=327-1235" rel="stylesheet" type="text/css" />
-</head>
-<body style="display: none">
- <form onsubmit="insertMedia();return false;" action="#">
- <div class="tabs">
- <ul>
- <li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');generatePreview();" onmousedown="return false;">{#media_dlg.general}</a></span></li>
- <li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{#media_dlg.advanced}</a></span></li>
- </ul>
- </div>
-
- <div class="panel_wrapper">
- <div id="general_panel" class="panel current">
- <fieldset>
- <legend>{#media_dlg.general}</legend>
-
- <table border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td><label for="media_type">{#media_dlg.type}</label></td>
- <td>
- <select id="media_type" name="media_type" onchange="changedType(this.value);generatePreview();">
- <option value="flash">Flash</option>
- <!-- <option value="flv">Flash video (FLV)</option> -->
- <option value="qt">Quicktime</option>
- <option value="shockwave">Shockwave</option>
- <option value="wmp">Windows Media</option>
- <option value="rmp">Real Media</option>
- </select>
- </td>
- </tr>
- <tr>
- <td><label for="src">{#media_dlg.file}</label></td>
- <td>
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input id="src" name="src" type="text" value="" class="mceFocus" onchange="switchType(this.value);generatePreview();" /></td>
- <td id="filebrowsercontainer"> </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr id="linklistrow">
- <td><label for="linklist">{#media_dlg.list}</label></td>
- <td id="linklistcontainer"><select id="linklist"><option value=""></option></select></td>
- </tr>
- <tr>
- <td><label for="width">{#media_dlg.size}</label></td>
- <td>
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="text" id="width" name="width" value="" class="size" onchange="generatePreview('width');" /> x <input type="text" id="height" name="height" value="" class="size" onchange="generatePreview('height');" /></td>
- <td> <input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
- <td><label id="constrainlabel" for="constrain">{#media_dlg.constrain_proportions}</label></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset>
- <legend>{#media_dlg.preview}</legend>
- <div id="prev"></div>
- </fieldset>
- </div>
-
- <div id="advanced_panel" class="panel">
- <fieldset>
- <legend>{#media_dlg.advanced}</legend>
-
- <table border="0" cellpadding="4" cellspacing="0" width="100%">
- <tr>
- <td><label for="id">{#media_dlg.id}</label></td>
- <td><input type="text" id="id" name="id" onchange="generatePreview();" /></td>
- <td><label for="name">{#media_dlg.name}</label></td>
- <td><input type="text" id="name" name="name" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="align">{#media_dlg.align}</label></td>
- <td>
- <select id="align" name="align" onchange="generatePreview();">
- <option value="">{#not_set}</option>
- <option value="top">{#media_dlg.align_top}</option>
- <option value="right">{#media_dlg.align_right}</option>
- <option value="bottom">{#media_dlg.align_bottom}</option>
- <option value="left">{#media_dlg.align_left}</option>
- </select>
- </td>
-
- <td><label for="bgcolor">{#media_dlg.bgcolor}</label></td>
- <td>
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');generatePreview();" /></td>
- <td id="bgcolor_pickcontainer"> </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="vspace">{#media_dlg.vspace}</label></td>
- <td><input type="text" id="vspace" name="vspace" class="number" onchange="generatePreview();" /></td>
- <td><label for="hspace">{#media_dlg.hspace}</label></td>
- <td><input type="text" id="hspace" name="hspace" class="number" onchange="generatePreview();" /></td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset id="flash_options">
- <legend>{#media_dlg.flash_options}</legend>
-
- <table border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td><label for="flash_quality">{#media_dlg.quality}</label></td>
- <td>
- <select id="flash_quality" name="flash_quality" onchange="generatePreview();">
- <option value="">{#not_set}</option>
- <option value="high">high</option>
- <option value="low">low</option>
- <option value="autolow">autolow</option>
- <option value="autohigh">autohigh</option>
- <option value="best">best</option>
- </select>
- </td>
-
- <td><label for="flash_scale">{#media_dlg.scale}</label></td>
- <td>
- <select id="flash_scale" name="flash_scale" onchange="generatePreview();">
- <option value="">{#not_set}</option>
- <option value="showall">showall</option>
- <option value="noborder">noborder</option>
- <option value="exactfit">exactfit</option>
- <option value="noscale">noscale</option>
- </select>
- </td>
- </tr>
-
- <tr>
- <td><label for="flash_wmode">{#media_dlg.wmode}</label></td>
- <td>
- <select id="flash_wmode" name="flash_wmode" onchange="generatePreview();">
- <option value="">{#not_set}</option>
- <option value="window">window</option>
- <option value="opaque">opaque</option>
- <option value="transparent">transparent</option>
- </select>
- </td>
-
- <td><label for="flash_salign">{#media_dlg.salign}</label></td>
- <td>
- <select id="flash_salign" name="flash_salign" onchange="generatePreview();">
- <option value="">{#not_set}</option>
- <option value="l">{#media_dlg.align_left}</option>
- <option value="t">{#media_dlg.align_top}</option>
- <option value="r">{#media_dlg.align_right}</option>
- <option value="b">{#media_dlg.align_bottom}</option>
- <option value="tl">{#media_dlg.align_top_left}</option>
- <option value="tr">{#media_dlg.align_top_right}</option>
- <option value="bl">{#media_dlg.align_bottom_left}</option>
- <option value="br">{#media_dlg.align_bottom_right}</option>
- </select>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flash_play" name="flash_play" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="flash_play">{#media_dlg.play}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flash_loop" name="flash_loop" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="flash_loop">{#media_dlg.loop}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flash_menu" name="flash_menu" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="flash_menu">{#media_dlg.menu}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flash_swliveconnect" name="flash_swliveconnect" onchange="generatePreview();" /></td>
- <td><label for="flash_swliveconnect">{#media_dlg.liveconnect}</label></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
-
- <table>
- <tr>
- <td><label for="flash_base">{#media_dlg.base}</label></td>
- <td><input type="text" id="flash_base" name="flash_base" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="flash_flashvars">{#media_dlg.flashvars}</label></td>
- <td><input type="text" id="flash_flashvars" name="flash_flashvars" onchange="generatePreview();" /></td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset id="flv_options">
- <legend>{#media_dlg.flv_options}</legend>
-
- <table border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td><label for="flv_scalemode">{#media_dlg.flv_scalemode}</label></td>
- <td>
- <select id="flv_scalemode" name="flv_scalemode" onchange="generatePreview();">
- <option value="">{#not_set}</option>
- <option value="none">none</option>
- <option value="double">double</option>
- <option value="full">full</option>
- </select>
- </td>
-
- <td><label for="flv_buffer">{#media_dlg.flv_buffer}</label></td>
- <td><input type="text" id="flv_buffer" name="flv_buffer" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="flv_startimage">{#media_dlg.flv_startimage}</label></td>
- <td><input type="text" id="flv_startimage" name="flv_startimage" onchange="generatePreview();" /></td>
-
- <td><label for="flv_starttime">{#media_dlg.flv_starttime}</label></td>
- <td><input type="text" id="flv_starttime" name="flv_starttime" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="flv_defaultvolume">{#media_dlg.flv_defaultvolume}</label></td>
- <td><input type="text" id="flv_defaultvolume" name="flv_defaultvolume" onchange="generatePreview();" /></td>
-
-
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flv_hiddengui" name="flv_hiddengui" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="flv_hiddengui">{#media_dlg.flv_hiddengui}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flv_autostart" name="flv_autostart" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="flv_autostart">{#media_dlg.flv_autostart}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flv_loop" name="flv_loop" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="flv_loop">{#media_dlg.flv_loop}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flv_showscalemodes" name="flv_showscalemodes" onchange="generatePreview();" /></td>
- <td><label for="flv_showscalemodes">{#media_dlg.flv_showscalemodes}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flv_smoothvideo" name="flash_flv_flv_smoothvideosmoothvideo" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="flv_smoothvideo">{#media_dlg.flv_smoothvideo}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="flv_jscallback" name="flv_jscallback" onchange="generatePreview();" /></td>
- <td><label for="flv_jscallback">{#media_dlg.flv_jscallback}</label></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset id="qt_options">
- <legend>{#media_dlg.qt_options}</legend>
-
- <table border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="qt_loop" name="qt_loop" onchange="generatePreview();" /></td>
- <td><label for="qt_loop">{#media_dlg.loop}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="qt_autoplay" name="qt_autoplay" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="qt_autoplay">{#media_dlg.play}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="qt_cache" name="qt_cache" onchange="generatePreview();" /></td>
- <td><label for="qt_cache">{#media_dlg.cache}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="qt_controller" name="qt_controller" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="qt_controller">{#media_dlg.controller}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="qt_correction" name="qt_correction" onchange="generatePreview();" /></td>
- <td><label for="qt_correction">{#media_dlg.correction}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="qt_enablejavascript" name="qt_enablejavascript" onchange="generatePreview();" /></td>
- <td><label for="qt_enablejavascript">{#media_dlg.enablejavascript}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="qt_kioskmode" name="qt_kioskmode" onchange="generatePreview();" /></td>
- <td><label for="qt_kioskmode">{#media_dlg.kioskmode}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="qt_autohref" name="qt_autohref" onchange="generatePreview();" /></td>
- <td><label for="qt_autohref">{#media_dlg.autohref}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="qt_playeveryframe" name="qt_playeveryframe" onchange="generatePreview();" /></td>
- <td><label for="qt_playeveryframe">{#media_dlg.playeveryframe}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="qt_targetcache" name="qt_targetcache" onchange="generatePreview();" /></td>
- <td><label for="qt_targetcache">{#media_dlg.targetcache}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="qt_scale">{#media_dlg.scale}</label></td>
- <td><select id="qt_scale" name="qt_scale" class="mceEditableSelect" onchange="generatePreview();">
- <option value="">{#not_set}</option>
- <option value="tofit">tofit</option>
- <option value="aspect">aspect</option>
- </select>
- </td>
-
- <td colspan="2"> </td>
- </tr>
-
- <tr>
- <td><label for="qt_starttime">{#media_dlg.starttime}</label></td>
- <td><input type="text" id="qt_starttime" name="qt_starttime" onchange="generatePreview();" /></td>
-
- <td><label for="qt_endtime">{#media_dlg.endtime}</label></td>
- <td><input type="text" id="qt_endtime" name="qt_endtime" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="qt_target">{#media_dlg.target}</label></td>
- <td><input type="text" id="qt_target" name="qt_target" onchange="generatePreview();" /></td>
-
- <td><label for="qt_href">{#media_dlg.href}</label></td>
- <td><input type="text" id="qt_href" name="qt_href" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="qt_qtsrcchokespeed">{#media_dlg.qtsrcchokespeed}</label></td>
- <td><input type="text" id="qt_qtsrcchokespeed" name="qt_qtsrcchokespeed" onchange="generatePreview();" /></td>
-
- <td><label for="qt_volume">{#media_dlg.volume}</label></td>
- <td><input type="text" id="qt_volume" name="qt_volume" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="qt_qtsrc">{#media_dlg.qtsrc}</label></td>
- <td colspan="4">
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><input type="text" id="qt_qtsrc" name="qt_qtsrc" onchange="generatePreview();" /></td>
- <td id="qtsrcfilebrowsercontainer"> </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset id="wmp_options">
- <legend>{#media_dlg.wmp_options}</legend>
-
- <table border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="wmp_autostart" name="wmp_autostart" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="wmp_autostart">{#media_dlg.autostart}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="wmp_enabled" name="wmp_enabled" onchange="generatePreview();" /></td>
- <td><label for="wmp_enabled">{#media_dlg.enabled}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="wmp_enablecontextmenu" name="wmp_enablecontextmenu" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="wmp_enablecontextmenu">{#media_dlg.menu}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="wmp_fullscreen" name="wmp_fullscreen" onchange="generatePreview();" /></td>
- <td><label for="wmp_fullscreen">{#media_dlg.fullscreen}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="wmp_invokeurls" name="wmp_invokeurls" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="wmp_invokeurls">{#media_dlg.invokeurls}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="wmp_mute" name="wmp_mute" onchange="generatePreview();" /></td>
- <td><label for="wmp_mute">{#media_dlg.mute}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="wmp_stretchtofit" name="wmp_stretchtofit" onchange="generatePreview();" /></td>
- <td><label for="wmp_stretchtofit">{#media_dlg.stretchtofit}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="wmp_windowlessvideo" name="wmp_windowlessvideo" onchange="generatePreview();" /></td>
- <td><label for="wmp_windowlessvideo">{#media_dlg.windowlessvideo}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td><label for="wmp_balance">{#media_dlg.balance}</label></td>
- <td><input type="text" id="wmp_balance" name="wmp_balance" onchange="generatePreview();" /></td>
-
- <td><label for="wmp_baseurl">{#media_dlg.baseurl}</label></td>
- <td><input type="text" id="wmp_baseurl" name="wmp_baseurl" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="wmp_captioningid">{#media_dlg.captioningid}</label></td>
- <td><input type="text" id="wmp_captioningid" name="wmp_captioningid" onchange="generatePreview();" /></td>
-
- <td><label for="wmp_currentmarker">{#media_dlg.currentmarker}</label></td>
- <td><input type="text" id="wmp_currentmarker" name="wmp_currentmarker" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="wmp_currentposition">{#media_dlg.currentposition}</label></td>
- <td><input type="text" id="wmp_currentposition" name="wmp_currentposition" onchange="generatePreview();" /></td>
-
- <td><label for="wmp_defaultframe">{#media_dlg.defaultframe}</label></td>
- <td><input type="text" id="wmp_defaultframe" name="wmp_defaultframe" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="wmp_playcount">{#media_dlg.playcount}</label></td>
- <td><input type="text" id="wmp_playcount" name="wmp_playcount" onchange="generatePreview();" /></td>
-
- <td><label for="wmp_rate">{#media_dlg.rate}</label></td>
- <td><input type="text" id="wmp_rate" name="wmp_rate" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="wmp_uimode">{#media_dlg.uimode}</label></td>
- <td><input type="text" id="wmp_uimode" name="wmp_uimode" onchange="generatePreview();" /></td>
-
- <td><label for="wmp_volume">{#media_dlg.volume}</label></td>
- <td><input type="text" id="wmp_volume" name="wmp_volume" onchange="generatePreview();" /></td>
- </tr>
-
- </table>
- </fieldset>
-
- <fieldset id="rmp_options">
- <legend>{#media_dlg.rmp_options}</legend>
-
- <table border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="rmp_autostart" name="rmp_autostart" onchange="generatePreview();" /></td>
- <td><label for="rmp_autostart">{#media_dlg.autostart}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="rmp_loop" name="rmp_loop" onchange="generatePreview();" /></td>
- <td><label for="rmp_loop">{#media_dlg.loop}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="rmp_autogotourl" name="rmp_autogotourl" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="rmp_autogotourl">{#media_dlg.autogotourl}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="rmp_center" name="rmp_center" onchange="generatePreview();" /></td>
- <td><label for="rmp_center">{#media_dlg.center}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="rmp_imagestatus" name="rmp_imagestatus" checked="checked" onchange="generatePreview();" /></td>
- <td><label for="rmp_imagestatus">{#media_dlg.imagestatus}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="rmp_maintainaspect" name="rmp_maintainaspect" onchange="generatePreview();" /></td>
- <td><label for="rmp_maintainaspect">{#media_dlg.maintainaspect}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="rmp_nojava" name="rmp_nojava" onchange="generatePreview();" /></td>
- <td><label for="rmp_nojava">{#media_dlg.nojava}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="rmp_prefetch" name="rmp_prefetch" onchange="generatePreview();" /></td>
- <td><label for="rmp_prefetch">{#media_dlg.prefetch}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="rmp_shuffle" name="rmp_shuffle" onchange="generatePreview();" /></td>
- <td><label for="rmp_shuffle">{#media_dlg.shuffle}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
-
- </td>
- </tr>
-
- <tr>
- <td><label for="rmp_console">{#media_dlg.console}</label></td>
- <td><input type="text" id="rmp_console" name="rmp_console" onchange="generatePreview();" /></td>
-
- <td><label for="rmp_controls">{#media_dlg.controls}</label></td>
- <td><input type="text" id="rmp_controls" name="rmp_controls" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="rmp_numloop">{#media_dlg.numloop}</label></td>
- <td><input type="text" id="rmp_numloop" name="rmp_numloop" onchange="generatePreview();" /></td>
-
- <td><label for="rmp_scriptcallbacks">{#media_dlg.scriptcallbacks}</label></td>
- <td><input type="text" id="rmp_scriptcallbacks" name="rmp_scriptcallbacks" onchange="generatePreview();" /></td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset id="shockwave_options">
- <legend>{#media_dlg.shockwave_options}</legend>
-
- <table border="0" cellpadding="4" cellspacing="0">
- <tr>
- <td><label for="shockwave_swstretchstyle">{#media_dlg.swstretchstyle}</label></td>
- <td>
- <select id="shockwave_swstretchstyle" name="shockwave_swstretchstyle" onchange="generatePreview();">
- <option value="none">{#not_set}</option>
- <option value="meet">Meet</option>
- <option value="fill">Fill</option>
- <option value="stage">Stage</option>
- </select>
- </td>
-
- <td><label for="shockwave_swvolume">{#media_dlg.volume}</label></td>
- <td><input type="text" id="shockwave_swvolume" name="shockwave_swvolume" onchange="generatePreview();" /></td>
- </tr>
-
- <tr>
- <td><label for="shockwave_swstretchhalign">{#media_dlg.swstretchhalign}</label></td>
- <td>
- <select id="shockwave_swstretchhalign" name="shockwave_swstretchhalign" onchange="generatePreview();">
- <option value="none">{#not_set}</option>
- <option value="left">{#media_dlg.align_left}</option>
- <option value="center">{#media_dlg.align_center}</option>
- <option value="right">{#media_dlg.align_right}</option>
- </select>
- </td>
-
- <td><label for="shockwave_swstretchvalign">{#media_dlg.swstretchvalign}</label></td>
- <td>
- <select id="shockwave_swstretchvalign" name="shockwave_swstretchvalign" onchange="generatePreview();">
- <option value="none">{#not_set}</option>
- <option value="meet">Meet</option>
- <option value="fill">Fill</option>
- <option value="stage">Stage</option>
- </select>
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="shockwave_autostart" name="shockwave_autostart" onchange="generatePreview();" checked="checked" /></td>
- <td><label for="shockwave_autostart">{#media_dlg.autostart}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="shockwave_sound" name="shockwave_sound" onchange="generatePreview();" checked="checked" /></td>
- <td><label for="shockwave_sound">{#media_dlg.sound}</label></td>
- </tr>
- </table>
- </td>
- </tr>
-
-
- <tr>
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="shockwave_swliveconnect" name="shockwave_swliveconnect" onchange="generatePreview();" /></td>
- <td><label for="shockwave_swliveconnect">{#media_dlg.liveconnect}</label></td>
- </tr>
- </table>
- </td>
-
- <td colspan="2">
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td><input type="checkbox" class="checkbox" id="shockwave_progress" name="shockwave_progress" onchange="generatePreview();" checked="checked" /></td>
- <td><label for="shockwave_progress">{#media_dlg.progress}</label></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </fieldset>
- </div>
- </div>
-
- <div class="mceActionPanel">
- <div style="float: left">
- <input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
- </div>
-
- <div style="float: right">
- <input type="submit" id="insert" name="insert" value="{#insert}" />
- </div>
- </div>
- </form>
-</body>
-</html>
-(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.PastePlugin",{init:function(c,d){var e=this,b;e.editor=c;e.url=d;e.onPreProcess=new tinymce.util.Dispatcher(e);e.onPostProcess=new tinymce.util.Dispatcher(e);e.onPreProcess.add(e._preProcess);e.onPostProcess.add(e._postProcess);e.onPreProcess.add(function(h,i){c.execCallback("paste_preprocess",h,i)});e.onPostProcess.add(function(h,i){c.execCallback("paste_postprocess",h,i)});function g(i){var h=c.dom;e.onPreProcess.dispatch(e,i);i.node=h.create("div",0,i.content);e.onPostProcess.dispatch(e,i);i.content=c.serializer.serialize(i.node,{getInner:1});if(/<(p|h[1-6]|ul|ol)/.test(i.content)){e._insertBlockContent(c,h,i.content)}else{e._insert(i.content)}}c.addCommand("mceInsertClipboardContent",function(h,i){g(i)});function f(l){var p,k,i,j=c.selection,o=c.dom,h=c.getBody(),m;if(o.get("_mcePaste")){return}p=o.add(h,"div",{id:"_mcePaste"},"\uFEFF");if(h!=c.getDoc().body){m=o.getPos(c.selection.getStart(),h).y}else{m=h.scrollTop}o.setStyles(p,{position:"absolute",left:-10000,top:m,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){i=o.doc.body.createTextRange();i.moveToElementText(p);i.execCommand("Paste");o.remove(p);if(p.innerHTML==="\uFEFF"){c.execCommand("mcePasteWord");l.preventDefault();return}g({content:p.innerHTML});return tinymce.dom.Event.cancel(l)}else{k=c.selection.getRng();p=p.firstChild;i=c.getDoc().createRange();i.setStart(p,0);i.setEnd(p,1);j.setRng(i);window.setTimeout(function(){var q="",n=o.select("div[id=_mcePaste]");a(n,function(r){q+=(o.select("> span.Apple-style-span div",r)[0]||o.select("> span.Apple-style-span",r)[0]||r).innerHTML});a(n,function(r){o.remove(r)});if(k){j.setRng(k)}g({content:q})},0)}}if(c.getParam("paste_auto_cleanup_on_paste",true)){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){c.onKeyDown.add(function(h,i){if(((tinymce.isMac?i.metaKey:i.ctrlKey)&&i.keyCode==86)||(i.shiftKey&&i.keyCode==45)){f(i)}})}else{c.onPaste.addToTop(function(h,i){return f(i)})}}if(c.getParam("paste_block_drop")){c.onInit.add(function(){c.dom.bind(c.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(h){h.preventDefault();h.stopPropagation();return false})})}e._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(d,i){var b=this.editor,c=i.content,g,f;function g(h){a(h,function(j){if(j.constructor==RegExp){c=c.replace(j,"")}else{c=c.replace(j[0],j[1])}})}if(/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c)||i.wordContent){i.wordContent=true;g([/^\s*( )+/g,/( |<br[^>]*>)+\s*$/g]);if(b.getParam("paste_convert_middot_lists",true)){g([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+:\s*symbol[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<span[^>]+mso-list:[^>]+>)/gi,"$1__MCE_ITEM__"]])}g([/<!--[\s\S]+?-->/gi,/<\/?(img|font|meta|link|style|div|v:\w+)[^>]*>/gi,/<\\?\?xml[^>]*>/gi,/<\/?o:[^>]*>/gi,/ (id|name|language|type|on\w+|v:\w+)=\"([^\"]*)\"/gi,/ (id|name|language|type|on\w+|v:\w+)=(\w+)/gi,[/<(\/?)s>/gi,"<$1strike>"],/<script[^>]+>[\s\S]*?<\/script>/gi,[/ /g,"\u00a0"]]);if(!b.getParam("paste_retain_style_properties")){g([/<\/?(span)[^>]*>/gi])}}f=b.getParam("paste_strip_class_attributes");if(f!="none"){function e(l,h){var k,j="";if(f=="all"){return""}h=tinymce.explode(h," ");for(k=h.length-1;k>=0;k--){if(!/^(Mso)/i.test(h[k])){j+=(!j?"":" ")+h[k]}}return' class="'+j+'"'}g([[/ class=\"([^\"]*)\"/gi,e],[/ class=(\w+)/gi,e]])}if(b.getParam("paste_remove_spans")){g([/<\/?(span)[^>]*>/gi])}i.content=c},_postProcess:function(e,g){var d=this,c=d.editor,f=c.dom,b;if(g.wordContent){a(f.select("a",g.node),function(h){if(!h.href||h.href.indexOf("#_Toc")!=-1){f.remove(h,1)}});if(d.editor.getParam("paste_convert_middot_lists",true)){d._convertLists(e,g)}b=c.getParam("paste_retain_style_properties");if(tinymce.is(b,"string")){b=tinymce.explode(b)}a(f.select("*",g.node),function(l){var m={},j=0,k,n,h;if(b){for(k=0;k<b.length;k++){n=b[k];h=f.getStyle(l,n);if(h){m[n]=h;j++}}}f.setAttrib(l,"style","");if(b&&j>0){f.setStyles(l,m)}else{if(l.nodeName=="SPAN"&&!l.className){f.remove(l,true)}}})}if(c.getParam("paste_remove_styles")||(c.getParam("paste_remove_styles_if_webkit")&&tinymce.isWebKit)){a(f.select("*[style]",g.node),function(h){h.removeAttribute("style");h.removeAttribute("mce_style")})}else{if(tinymce.isWebKit){a(f.select("*",g.node),function(h){h.removeAttribute("mce_style")})}}},_convertLists:function(e,c){var g=e.editor.dom,f,j,b=-1,d,k=[],i,h;a(g.select("p",c.node),function(r){var n,s="",q,o,l,m;for(n=r.firstChild;n&&n.nodeType==3;n=n.nextSibling){s+=n.nodeValue}s=r.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(s)){q="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(s)){q="ol"}if(q){d=parseFloat(r.style.marginLeft||0);if(d>b){k.push(d)}if(!f||q!=i){f=g.create(q);g.insertAfter(f,r)}else{if(d>b){f=j.appendChild(g.create(q))}else{if(d<b){l=tinymce.inArray(k,d);m=g.getParents(f.parentNode,q);f=m[m.length-1-l]||f}}}a(g.select("span",r),function(t){var p=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(q=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){g.remove(t)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){g.remove(t)}}});o=r.innerHTML;if(q=="ul"){o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{o=r.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}j=f.appendChild(g.create("li",0,o));g.remove(r);b=d;i=q}else{f=b=0}});h=c.node.innerHTML;if(h.indexOf("__MCE_ITEM__")!=-1){c.node.innerHTML=h.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(h,e,i){var c,g,d=h.selection,m,j,b,k,f;function l(p){var o;if(tinymce.isIE){o=h.getDoc().body.createTextRange();o.moveToElementText(p);o.collapse(false);o.select()}else{d.select(p,1);d.collapse(false)}}this._insert('<span id="_marker"> </span>',1);g=e.get("_marker");c=e.getParent(g,"p,h1,h2,h3,h4,h5,h6,ul,ol,th,td");if(c&&!/TD|TH/.test(c.nodeName)){g=e.split(c,g);a(e.create("div",0,i).childNodes,function(o){m=g.parentNode.insertBefore(o.cloneNode(true),g)});l(m)}else{e.setOuterHTML(g,i);d.select(h.getBody(),1);d.collapse(0)}e.remove("_marker");j=d.getStart();b=e.getViewPort(h.getWin());k=h.dom.getPos(j).y;f=j.clientHeight;if(k<b.y||k+f>b.y+b.h){h.getDoc().body.scrollTop=k<b.y?k:k-b.h+25}},_insert:function(d,b){var c=this.editor;if(!c.selection.isCollapsed()){c.getDoc().execCommand("Delete",false,null)}c.execCommand(tinymce.isGecko?"insertHTML":"mceInsertContent",false,d,{skip_undo:b})},_legacySupport:function(){var c=this,b=c.editor;a(["mcePasteText","mcePasteWord"],function(d){b.addCommand(d,function(){b.windowManager.open({file:c.url+(d=="mcePasteText"?"/pastetext.htm":"/pasteword.htm"),width:parseInt(b.getParam("paste_dialog_width","450")),height:parseInt(b.getParam("paste_dialog_height","400")),inline:1})})});b.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});b.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"});b.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
\ No newline at end of file
+(function(){var c=tinymce.each,d=null,a={paste_auto_cleanup_on_paste:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_notifyalways:false,paste_text_linebreaktype:"p",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(e,f){return e.getParam(f,a[f])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(e,f){var g=this;g.editor=e;g.url=f;g.onPreProcess=new tinymce.util.Dispatcher(g);g.onPostProcess=new tinymce.util.Dispatcher(g);g.onPreProcess.add(g._preProcess);g.onPostProcess.add(g._postProcess);g.onPreProcess.add(function(j,k){e.execCallback("paste_preprocess",j,k)});g.onPostProcess.add(function(j,k){e.execCallback("paste_postprocess",j,k)});e.pasteAsPlainText=false;function i(l,j){var k=e.dom;g.onPreProcess.dispatch(g,l);l.node=k.create("div",0,l.content);g.onPostProcess.dispatch(g,l);l.content=e.serializer.serialize(l.node,{getInner:1});if((!j)&&(e.pasteAsPlainText)){g._insertPlainText(e,k,l.content);if(!b(e,"paste_text_sticky")){e.pasteAsPlainText=false;e.controlManager.setActive("pastetext",false)}}else{if(/<(p|h[1-6]|ul|ol)/.test(l.content)){g._insertBlockContent(e,k,l.content)}else{g._insert(l.content)}}}e.addCommand("mceInsertClipboardContent",function(j,k){i(k,true)});if(!b(e,"paste_text_use_dialog")){e.addCommand("mcePasteText",function(k,j){var l=tinymce.util.Cookie;e.pasteAsPlainText=!e.pasteAsPlainText;e.controlManager.setActive("pastetext",e.pasteAsPlainText);if((e.pasteAsPlainText)&&(!l.get("tinymcePasteText"))){if(b(e,"paste_text_sticky")){e.windowManager.alert(e.translate("paste.plaintext_mode_sticky"))}else{e.windowManager.alert(e.translate("paste.plaintext_mode_sticky"))}if(!b(e,"paste_text_notifyalways")){l.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}e.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});e.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function h(s){var m,q,k,l=e.selection,p=e.dom,r=e.getBody(),j;if(e.pasteAsPlainText&&(s.clipboardData||p.doc.dataTransfer)){s.preventDefault();i({content:(s.clipboardData||p.doc.dataTransfer).getData("Text").replace(/\r?\n/g,'<br />')});return}if(p.get("_mcePaste")){return}m=p.add(r,"div",{id:"_mcePaste","class":"mcePaste"},'\uFEFF<br _mce_bogus="1">');if(r!=e.getDoc().body){j=p.getPos(e.selection.getStart(),r).y}else{j=r.scrollTop}p.setStyles(m,{position:"absolute",left:-10000,top:j,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){k=p.doc.body.createTextRange();k.moveToElementText(m);k.execCommand("Paste");p.remove(m);if(m.innerHTML==="\uFEFF"){e.execCommand("mcePasteWord");s.preventDefault();return}i({content:m.innerHTML});return tinymce.dom.Event.cancel(s)}else{function o(n){n.preventDefault()}p.bind(e.getDoc(),"mousedown",o);p.bind(e.getDoc(),"keydown",o);q=e.selection.getRng();m=m.firstChild;k=e.getDoc().createRange();k.setStart(m,0);k.setEnd(m,1);l.setRng(k);window.setTimeout(function(){var t="",n=p.select("div.mcePaste");c(n,function(v){var u=v.firstChild;if(u&&u.nodeName=="DIV"&&u.style.marginTop&&u.style.backgroundColor){p.remove(u,1)}c(p.select("div.mcePaste",v),function(w){p.remove(w,1)});c(p.select("span.Apple-style-span",v),function(w){p.remove(w,1)});c(p.select("br[_mce_bogus]",v),function(w){p.remove(w)});t+=v.innerHTML});c(n,function(u){p.remove(u)});if(q){l.setRng(q)}i({content:t});p.unbind(e.getDoc(),"mousedown",o);p.unbind(e.getDoc(),"keydown",o)},0)}}if(b(e,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){e.onKeyDown.add(function(j,k){if(((tinymce.isMac?k.metaKey:k.ctrlKey)&&k.keyCode==86)||(k.shiftKey&&k.keyCode==45)){h(k)}})}else{e.onPaste.addToTop(function(j,k){return h(k)})}}if(b(e,"paste_block_drop")){e.onInit.add(function(){e.dom.bind(e.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(j){j.preventDefault();j.stopPropagation();return false})})}g._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(i,f){var l=this.editor,k=f.content,q=tinymce.grep,p=tinymce.explode,g=tinymce.trim,m,j;function e(h){c(h,function(o){if(o.constructor==RegExp){k=k.replace(o,"")}else{k=k.replace(o[0],o[1])}})}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(k)||f.wordContent){f.wordContent=true;e([/^\s*( )+/gi,/( |<br[^>]*>)+\s*$/gi]);if(b(l,"paste_convert_headers_to_strong")){k=k.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(l,"paste_convert_middot_lists")){e([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"]])}e([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{m=k.length;k=k.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(m!=k.length);if(b(l,"paste_retain_style_properties").replace(/^none$/i,"").length==0){k=k.replace(/<\/?span[^>]*>/gi,"")}else{e([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(u,h,t){var v=[],o=0,r=p(g(t).replace(/"/gi,"'"),";");c(r,function(s){var w,y,z=p(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":v[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":v[o++]="text-align:"+y;return;case"vert-align":v[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":v[o++]="color:"+y;return;case"mso-background":case"mso-highlight":v[o++]="background:"+y;return;case"mso-default-height":v[o++]="min-height:"+x(y);return;case"mso-default-width":v[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":v[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){v[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){v[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}v[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+v.join(";")+'"'}else{return h}}]])}}if(b(l,"paste_convert_headers_to_strong")){e([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}j=b(l,"paste_strip_class_attributes");if(j!=="none"){function n(r,o){if(j==="all"){return""}var h=q(p(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(s){return(/^(?!mso)/i.test(s))});return h.length?' class="'+h.join(" ")+'"':""}k=k.replace(/ class="([^"]+)"/gi,n);k=k.replace(/ class=(\w+)/gi,n)}if(b(l,"paste_remove_spans")){k=k.replace(/<\/?span[^>]*>/gi,"")}f.content=k},_postProcess:function(h,j){var g=this,f=g.editor,i=f.dom,e;if(j.wordContent){c(i.select("a",j.node),function(k){if(!k.href||k.href.indexOf("#_Toc")!=-1){i.remove(k,1)}});if(b(f,"paste_convert_middot_lists")){g._convertLists(h,j)}e=b(f,"paste_retain_style_properties");if((tinymce.is(e,"string"))&&(e!=="all")&&(e!=="*")){e=tinymce.explode(e.replace(/^none$/i,""));c(i.select("*",j.node),function(n){var o={},l=0,m,p,k;if(e){for(m=0;m<e.length;m++){p=e[m];k=i.getStyle(n,p);if(k){o[p]=k;l++}}}i.setAttrib(n,"style","");if(e&&l>0){i.setStyles(n,o)}else{if(n.nodeName=="SPAN"&&!n.className){i.remove(n,true)}}})}}if(b(f,"paste_remove_styles")||(b(f,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(i.select("*[style]",j.node),function(k){k.removeAttribute("style");k.removeAttribute("_mce_style")})}else{if(tinymce.isWebKit){c(i.select("*",j.node),function(k){k.removeAttribute("_mce_style")})}}},_convertLists:function(h,f){var j=h.editor.dom,i,m,e=-1,g,n=[],l,k;c(j.select("p",f.node),function(u){var r,v="",t,s,o,q;for(r=u.firstChild;r&&r.nodeType==3;r=r.nextSibling){v+=r.nodeValue}v=u.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o]\s*\u00a0*/.test(v)){t="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0{2,}/.test(v)){t="ol"}if(t){g=parseFloat(u.style.marginLeft||0);if(g>e){n.push(g)}if(!i||t!=l){i=j.create(t);j.insertAfter(i,u)}else{if(g>e){i=m.appendChild(j.create(t))}else{if(g<e){o=tinymce.inArray(n,g);q=j.getParents(i.parentNode,t);i=q[q.length-1-o]||i}}}c(j.select("span",u),function(w){var p=w.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(t=="ul"&&/^[\u2022\u00b7\u00a7\u00d8o]/.test(p)){j.remove(w)}else{if(/^[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){j.remove(w)}}});s=u.innerHTML;if(t=="ul"){s=u.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o]\s*( |\u00a0)+\s*/,"")}else{s=u.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}m=i.appendChild(j.create("li",0,s));j.remove(u);e=g;l=t}else{i=e=0}});k=f.node.innerHTML;if(k.indexOf("__MCE_ITEM__")!=-1){f.node.innerHTML=k.replace(/__MCE_ITEM__/g,"")}},_insertBlockContent:function(l,h,m){var f,j,g=l.selection,q,n,e,o,i,k="mce_marker";function p(t){var s;if(tinymce.isIE){s=l.getDoc().body.createTextRange();s.moveToElementText(t);s.collapse(false);s.select()}else{g.select(t,1);g.collapse(false)}}this._insert('<span id="'+k+'"></span>',1);j=h.get(k);f=h.getParent(j,"p,h1,h2,h3,h4,h5,h6,ul,ol,th,td");if(f&&!/TD|TH/.test(f.nodeName)){j=h.split(f,j);c(h.create("div",0,m).childNodes,function(r){q=j.parentNode.insertBefore(r.cloneNode(true),j)});p(q)}else{h.setOuterHTML(j,m);g.select(l.getBody(),1);g.collapse(0)}while(n=h.get(k)){h.remove(n)}n=g.getStart();e=h.getViewPort(l.getWin());o=l.dom.getPos(n).y;i=n.clientHeight;if(o<e.y||o+i>e.y+e.h){l.getDoc().body.scrollTop=o<e.y?o:o-e.h+25}},_insert:function(g,e){var f=this.editor,i=f.selection.getRng();if(!f.selection.isCollapsed()&&i.startContainer!=i.endContainer){f.getDoc().execCommand("Delete",false,null)}f.execCommand(tinymce.isGecko?"insertHTML":"mceInsertContent",false,g,{skip_undo:e})},_insertPlainText:function(j,x,v){var t,u,l,k,r,e,p,f,n=j.getWin(),z=j.getDoc(),s=j.selection,m=tinymce.is,y=tinymce.inArray,g=b(j,"paste_text_linebreaktype"),o=b(j,"paste_text_replacements");function q(h){c(h,function(i){if(i.constructor==RegExp){v=v.replace(i,"")}else{v=v.replace(i[0],i[1])}})}if((typeof(v)==="string")&&(v.length>0)){if(!d){d=("34,quot,38,amp,39,apos,60,lt,62,gt,"+j.serializer.settings.entities).split(",")}if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(v)){q([/[\n\r]+/g])}else{q([/\r+/g])}q([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/&(#\d+|[a-z0-9]{1,10});/gi,function(i,h){if(h.charAt(0)==="#"){return String.fromCharCode(h.slice(1))}else{return((i=y(d,h))>0)?String.fromCharCode(d[i-1]):" "}}],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"],/^\s+|\s+$/g]);v=x.encode(v);if(!s.isCollapsed()){z.execCommand("Delete",false,null)}if(m(o,"array")||(m(o,"array"))){q(o)}else{if(m(o,"string")){q(new RegExp(o,"gi"))}}if(g=="none"){q([[/\n+/g," "]])}else{if(g=="br"){q([[/\n/g,"<br />"]])}else{q([/^\s+|\s+$/g,[/\n\n/g,"</p><p>"],[/\n/g,"<br />"]])}}if((l=v.indexOf("</p><p>"))!=-1){k=v.lastIndexOf("</p><p>");r=s.getNode();e=[];do{if(r.nodeType==1){if(r.nodeName=="TD"||r.nodeName=="BODY"){break}e[e.length]=r}}while(r=r.parentNode);if(e.length>0){p=v.substring(0,l);f="";for(t=0,u=e.length;t<u;t++){p+="</"+e[t].nodeName.toLowerCase()+">";f+="<"+e[e.length-t-1].nodeName.toLowerCase()+">"}if(l==k){v=p+f+v.substring(l+7)}else{v=p+v.substring(l+4,k+4)+f+v.substring(k+7)}}}j.execCommand("mceInsertRawHTML",false,v+'<span id="_plain_text_marker"> </span>');window.setTimeout(function(){var h=x.get("_plain_text_marker"),B,i,A,w;s.select(h,false);z.execCommand("Delete",false,null);h=null;B=s.getStart();i=x.getViewPort(n);A=x.getPos(B).y;w=B.clientHeight;if((A<i.y)||(A+w>i.y+i.h)){z.body.scrollTop=A<i.y?A:A-i.h+25}},0)}},_legacySupport:function(){var f=this,e=f.editor;e.addCommand("mcePasteWord",function(){e.windowManager.open({file:f.url+"/pasteword.htm",width:parseInt(b(e,"paste_dialog_width")),height:parseInt(b(e,"paste_dialog_height")),inline:1})});if(b(e,"paste_text_use_dialog")){e.addCommand("mcePasteText",function(){e.windowManager.open({file:f.url+"/pastetext.htm",width:parseInt(b(e,"paste_dialog_width")),height:parseInt(b(e,"paste_dialog_height")),inline:1})})}e.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
\ No newline at end of file
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#paste.paste_text_desc}</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
- <script type="text/javascript" src="js/pastetext.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3392"></script>
+ <script type="text/javascript" src="js/pastetext.js?ver=3392"></script>
</head>
<body onresize="PasteTextDialog.resize();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="return PasteTextDialog.insert();" action="#">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{#paste.paste_word_desc}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
- <script type="text/javascript" src="js/pasteword.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3392"></script>
+ <script type="text/javascript" src="js/pasteword.js?ver=3392"></script>
</head>
<body onresize="PasteWordDialog.resize();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="return PasteWordDialog.insert();" action="#">
+++ /dev/null
-<!-- WebKit -->
\ No newline at end of file
+++ /dev/null
-(function(){var a=tinymce.dom.Event,c=tinymce.grep,d=tinymce.each,b=tinymce.inArray;function e(j,i,h){var g,k;g=j.createTreeWalker(i,NodeFilter.SHOW_ALL,null,false);while(k=g.nextNode()){if(h){if(!h(k)){return false}}if(k.nodeType==3&&k.nodeValue&&/[^\s\u00a0]+/.test(k.nodeValue)){return false}if(k.nodeType==1&&/^(HR|IMG|TABLE)$/.test(k.nodeName)){return false}}return true}tinymce.create("tinymce.plugins.Safari",{init:function(f){var g=this,h;if(!tinymce.isWebKit){return}g.editor=f;g.webKitFontSizes=["x-small","small","medium","large","x-large","xx-large","-webkit-xxx-large"];g.namedFontSizes=["xx-small","x-small","small","medium","large","x-large","xx-large"];f.addCommand("CreateLink",function(k,j){var m=f.selection.getNode(),l=f.dom,i;if(m&&(/^(left|right)$/i.test(l.getStyle(m,"float",1))||/^(left|right)$/i.test(l.getAttrib(m,"align")))){i=l.create("a",{href:j},m.cloneNode());m.parentNode.replaceChild(i,m);f.selection.select(i)}else{f.getDoc().execCommand("CreateLink",false,j)}});f.onKeyUp.add(function(j,o){var l,i,m,p,k;if(o.keyCode==46||o.keyCode==8){i=j.getBody();l=i.innerHTML;k=j.selection;if(i.childNodes.length==1&&!/<(img|hr)/.test(l)&&tinymce.trim(l.replace(/<[^>]+>/g,"")).length==0){j.setContent('<p><br mce_bogus="1" /></p>',{format:"raw"});p=i.firstChild;m=k.getRng();m.setStart(p,0);m.setEnd(p,0);k.setRng(m)}}});f.addCommand("FormatBlock",function(j,i){var l=f.dom,k=l.getParent(f.selection.getNode(),l.isBlock);if(k){l.replace(l.create(i),k,1)}else{f.getDoc().execCommand("FormatBlock",false,i)}});f.addCommand("mceInsertContent",function(j,i){f.getDoc().execCommand("InsertText",false,"mce_marker");f.getBody().innerHTML=f.getBody().innerHTML.replace(/mce_marker/g,f.dom.processHTML(i)+'<span id="_mce_tmp">XX</span>');f.selection.select(f.dom.get("_mce_tmp"));f.getDoc().execCommand("Delete",false," ")});f.onKeyPress.add(function(o,p){var q,v,r,l,j,k,i,u,m,t,s;if(p.keyCode==13){i=o.selection;q=i.getNode();if(p.shiftKey||o.settings.force_br_newlines&&q.nodeName!="LI"){g._insertBR(o);a.cancel(p)}if(v=h.getParent(q,"LI")){r=h.getParent(v,"OL,UL");u=o.getDoc();s=h.create("p");h.add(s,"br",{mce_bogus:"1"});if(e(u,v)){if(k=h.getParent(r.parentNode,"LI,OL,UL")){return}k=h.getParent(r,"p,h1,h2,h3,h4,h5,h6,div")||r;l=u.createRange();l.setStartBefore(k);l.setEndBefore(v);j=u.createRange();j.setStartAfter(v);j.setEndAfter(k);m=l.cloneContents();t=j.cloneContents();if(!e(u,t)){h.insertAfter(t,k)}h.insertAfter(s,k);if(!e(u,m)){h.insertAfter(m,k)}h.remove(k);k=s.firstChild;l=u.createRange();l.setStartBefore(k);l.setEndBefore(k);i.setRng(l);return a.cancel(p)}}}});f.onExecCommand.add(function(i,k){var j,m,n,l;if(k=="InsertUnorderedList"||k=="InsertOrderedList"){j=i.selection;m=i.dom;if(n=m.getParent(j.getNode(),function(o){return/^(H[1-6]|P|ADDRESS|PRE)$/.test(o.nodeName)})){l=j.getBookmark();m.remove(n,1);j.moveToBookmark(l)}}});f.onClick.add(function(i,j){j=j.target;if(j.nodeName=="IMG"){g.selElm=j;i.selection.select(j)}else{g.selElm=null}});f.onInit.add(function(){g._fixWebKitSpans()});f.onSetContent.add(function(){h=f.dom;d(["strong","b","em","u","strike","sub","sup","a"],function(i){d(c(h.select(i)).reverse(),function(l){var k=l.nodeName.toLowerCase(),j;if(k=="a"){if(l.name){h.replace(h.create("img",{mce_name:"a",name:l.name,"class":"mceItemAnchor"}),l)}return}switch(k){case"b":case"strong":if(k=="b"){k="strong"}j="font-weight: bold;";break;case"em":j="font-style: italic;";break;case"u":j="text-decoration: underline;";break;case"sub":j="vertical-align: sub;";break;case"sup":j="vertical-align: super;";break;case"strike":j="text-decoration: line-through;";break}h.replace(h.create("span",{mce_name:k,style:j,"class":"Apple-style-span"}),l,1)})})});f.onPreProcess.add(function(i,j){h=i.dom;d(c(j.node.getElementsByTagName("span")).reverse(),function(m){var k,l;if(j.get){if(h.hasClass(m,"Apple-style-span")){l=m.style.backgroundColor;switch(h.getAttrib(m,"mce_name")){case"font":if(!i.settings.convert_fonts_to_spans){h.setAttrib(m,"style","")}break;case"strong":case"em":case"sub":case"sup":h.setAttrib(m,"style","");break;case"strike":case"u":if(!i.settings.inline_styles){h.setAttrib(m,"style","")}else{h.setAttrib(m,"mce_name","")}break;default:if(!i.settings.inline_styles){h.setAttrib(m,"style","")}}if(l){m.style.backgroundColor=l}}}if(h.hasClass(m,"mceItemRemoved")){h.remove(m,1)}})});f.onPostProcess.add(function(i,j){j.content=j.content.replace(/<br \/><\/(h[1-6]|div|p|address|pre)>/g,"</$1>");j.content=j.content.replace(/ id=\"undefined\"/g,"")})},getInfo:function(){return{longname:"Safari compatibility",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_fixWebKitSpans:function(){var g=this,f=g.editor;a.add(f.getDoc(),"DOMNodeInserted",function(h){h=h.target;if(h&&h.nodeType==1){g._fixAppleSpan(h)}})},_fixAppleSpan:function(l){var g=this.editor,m=g.dom,i=this.webKitFontSizes,f=this.namedFontSizes,j=g.settings,h,k;if(m.getAttrib(l,"mce_fixed")){return}if(l.nodeName=="SPAN"&&l.className=="Apple-style-span"){h=l.style;if(!j.convert_fonts_to_spans){if(h.fontSize){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"size",b(i,h.fontSize)+1)}if(h.fontFamily){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"face",h.fontFamily)}if(h.color){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"color",m.toHex(h.color))}if(h.backgroundColor){m.setAttrib(l,"mce_name","font");m.setStyle(l,"background-color",h.backgroundColor)}}else{if(h.fontSize){m.setStyle(l,"fontSize",f[b(i,h.fontSize)])}}if(h.fontWeight=="bold"){m.setAttrib(l,"mce_name","strong")}if(h.fontStyle=="italic"){m.setAttrib(l,"mce_name","em")}if(h.textDecoration=="underline"){m.setAttrib(l,"mce_name","u")}if(h.textDecoration=="line-through"){m.setAttrib(l,"mce_name","strike")}if(h.verticalAlign=="super"){m.setAttrib(l,"mce_name","sup")}if(h.verticalAlign=="sub"){m.setAttrib(l,"mce_name","sub")}m.setAttrib(l,"mce_fixed","1")}},_insertBR:function(f){var j=f.dom,h=f.selection,i=h.getRng(),g;i.insertNode(g=j.create("br"));i.setStartAfter(g);i.setEndAfter(g);h.setRng(i);if(h.getSel().focusNode==g.previousSibling){h.select(j.insertAfter(j.doc.createTextNode("\u00a0"),g));h.collapse(1)}f.getWin().scrollTo(0,j.getPos(h.getRng().startContainer).y)}});tinymce.PluginManager.add("safari",tinymce.plugins.Safari)})();
\ No newline at end of file
$i += 2;
$output .= sprintf('\u%04s', bin2hex($this->_utf82utf16($char)));
} if (($byte & 0xF8) == 0xF0) {
- $char = pack('C*', $byte, ord($input[$i + 1]), ord($input[$i + 2], ord($input[$i + 3])));
+ $char = pack('C*', $byte, ord($input[$i + 1]), ord($input[$i + 2]), ord($input[$i + 3]));
$i += 3;
$output .= sprintf('\u%04s', bin2hex($this->_utf82utf16($char)));
} if (($byte & 0xFC) == 0xF8) {
- $char = pack('C*', $byte, ord($input[$i + 1]), ord($input[$i + 2], ord($input[$i + 3]), ord($input[$i + 4])));
+ $char = pack('C*', $byte, ord($input[$i + 1]), ord($input[$i + 2]), ord($input[$i + 3]), ord($input[$i + 4]));
$i += 4;
$output .= sprintf('\u%04s', bin2hex($this->_utf82utf16($char)));
} if (($byte & 0xFE) == 0xFC) {
- $char = pack('C*', $byte, ord($input[$i + 1]), ord($input[$i + 2], ord($input[$i + 3]), ord($input[$i + 4]), ord($input[$i + 5])));
+ $char = pack('C*', $byte, ord($input[$i + 1]), ord($input[$i + 2]), ord($input[$i + 3]), ord($input[$i + 4]), ord($input[$i + 5]));
$i += 5;
$output .= sprintf('\u%04s', bin2hex($this->_utf82utf16($char)));
} else if ($byte < 128)
<?php
/**
* config.php
+ *
* @package MCManager.includes
- * @author Moxiecode
- * @copyright Copyright © 2007, Moxiecode Systems AB, All rights reserved.
*/
// General settings
$config['general.engine'] = 'GoogleSpell';
-/**
- * $Id: editor_plugin_src.js 425 2007-11-21 15:17:39Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-(function() {
- var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM;
-
- tinymce.create('tinymce.plugins.SpellcheckerPlugin', {
- getInfo : function() {
- return {
- longname : 'Spellchecker',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- },
-
- init : function(ed, url) {
- var t = this, cm;
-
- t.url = url;
- t.editor = ed;
-
- // Register commands
- ed.addCommand('mceSpellCheck', function() {
- if (!t.active) {
- ed.setProgressState(1);
- t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) {
- if (r.length > 0) {
- t.active = 1;
- t._markWords(r);
- ed.setProgressState(0);
- ed.nodeChanged();
- } else {
- ed.setProgressState(0);
- ed.windowManager.alert('spellchecker.no_mpell');
- }
- });
- } else
- t._done();
- });
-
- ed.onInit.add(function() {
- if (ed.settings.content_css !== false)
- ed.dom.loadCSS(url + '/css/content.css');
- });
-
- ed.onClick.add(t._showMenu, t);
- ed.onContextMenu.add(t._showMenu, t);
- ed.onBeforeGetContent.add(function() {
- if (t.active)
- t._removeWords();
- });
-
- ed.onNodeChange.add(function(ed, cm) {
- cm.setActive('spellchecker', t.active);
- });
-
- ed.onSetContent.add(function() {
- t._done();
- });
-
- ed.onBeforeGetContent.add(function() {
- t._done();
- });
-
- ed.onBeforeExecCommand.add(function(ed, cmd) {
- if (cmd == 'mceFullScreen')
- t._done();
- });
-
- // Find selected language
- t.languages = {};
- each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) {
- if (k.indexOf('+') === 0) {
- k = k.substring(1);
- t.selectedLang = v;
- }
-
- t.languages[k] = v;
- });
- },
-
- createControl : function(n, cm) {
- var t = this, c, ed = t.editor;
-
- if (n == 'spellchecker') {
- c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t});
-
- c.onRenderMenu.add(function(c, m) {
- m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
- each(t.languages, function(v, k) {
- var o = {icon : 1}, mi;
-
- o.onclick = function() {
- mi.setSelected(1);
- t.selectedItem.setSelected(0);
- t.selectedItem = mi;
- t.selectedLang = v;
- };
-
- o.title = k;
- mi = m.add(o);
- mi.setSelected(v == t.selectedLang);
-
- if (v == t.selectedLang)
- t.selectedItem = mi;
- })
- });
-
- return c;
- }
- },
-
- // Internal functions
-
- _walk : function(n, f) {
- var d = this.editor.getDoc(), w;
-
- if (d.createTreeWalker) {
- w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false);
-
- while ((n = w.nextNode()) != null)
- f.call(this, n);
- } else
- tinymce.walk(n, f, 'childNodes');
- },
-
- _getSeparators : function() {
- var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');
-
- // Build word separator regexp
- for (i=0; i<str.length; i++)
- re += '\\' + str.charAt(i);
-
- return re;
- },
-
- _getWords : function() {
- var ed = this.editor, wl = [], tx = '', lo = {};
-
- // Get area text
- this._walk(ed.getBody(), function(n) {
- if (n.nodeType == 3)
- tx += n.nodeValue + ' ';
- });
-
- // Split words by separator
- tx = tx.replace(new RegExp('([0-9]|[' + this._getSeparators() + '])', 'g'), ' ');
- tx = tinymce.trim(tx.replace(/(\s+)/g, ' '));
-
- // Build word array and remove duplicates
- each(tx.split(' '), function(v) {
- if (!lo[v]) {
- wl.push(v);
- lo[v] = 1;
- }
- });
-
- return wl;
- },
-
- _removeWords : function(w) {
- var ed = this.editor, dom = ed.dom, se = ed.selection, b = se.getBookmark();
-
- each(dom.select('span').reverse(), function(n) {
- if (n && (dom.hasClass(n, 'mceItemHiddenSpellWord') || dom.hasClass(n, 'mceItemHidden'))) {
- if (!w || dom.decode(n.innerHTML) == w)
- dom.remove(n, 1);
- }
- });
-
- se.moveToBookmark(b);
- },
-
- _markWords : function(wl) {
- var r1, r2, r3, r4, r5, w = '', ed = this.editor, re = this._getSeparators(), dom = ed.dom, nl = [];
- var se = ed.selection, b = se.getBookmark();
-
- each(wl, function(v) {
- w += (w ? '|' : '') + v;
- });
-
- r1 = new RegExp('([' + re + '])(' + w + ')([' + re + '])', 'g');
- r2 = new RegExp('^(' + w + ')', 'g');
- r3 = new RegExp('(' + w + ')([' + re + ']?)$', 'g');
- r4 = new RegExp('^(' + w + ')([' + re + ']?)$', 'g');
- r5 = new RegExp('(' + w + ')([' + re + '])', 'g');
-
- // Collect all text nodes
- this._walk(this.editor.getBody(), function(n) {
- if (n.nodeType == 3) {
- nl.push(n);
- }
- });
-
- // Wrap incorrect words in spans
- each(nl, function(n) {
- var v;
-
- if (n.nodeType == 3) {
- v = n.nodeValue;
-
- if (r1.test(v) || r2.test(v) || r3.test(v) || r4.test(v)) {
- v = dom.encode(v);
- v = v.replace(r5, '<span class="mceItemHiddenSpellWord">$1</span>$2');
- v = v.replace(r3, '<span class="mceItemHiddenSpellWord">$1</span>$2');
-
- dom.replace(dom.create('span', {'class' : 'mceItemHidden'}, v), n);
- }
- }
- });
-
- se.moveToBookmark(b);
- },
-
- _showMenu : function(ed, e) {
- var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin());
-
- if (!m) {
- p1 = DOM.getPos(ed.getContentAreaContainer());
- //p2 = DOM.getPos(ed.getContainer());
-
- m = ed.controlManager.createDropMenu('spellcheckermenu', {
- offset_x : p1.x,
- offset_y : p1.y,
- 'class' : 'mceNoIcons'
- });
-
- t._menu = m;
- }
-
- if (dom.hasClass(e.target, 'mceItemHiddenSpellWord')) {
- m.removeAll();
- m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
-
- t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(e.target.innerHTML)], function(r) {
- m.removeAll();
-
- if (r.length > 0) {
- m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
- each(r, function(v) {
- m.add({title : v, onclick : function() {
- dom.replace(ed.getDoc().createTextNode(v), e.target);
- t._checkDone();
- }});
- });
-
- m.addSeparator();
- } else
- m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
-
- m.add({
- title : 'spellchecker.ignore_word',
- onclick : function() {
- dom.remove(e.target, 1);
- t._checkDone();
- }
- });
-
- m.add({
- title : 'spellchecker.ignore_words',
- onclick : function() {
- t._removeWords(dom.decode(e.target.innerHTML));
- t._checkDone();
- }
- });
-
- m.update();
- });
-
- ed.selection.select(e.target);
- p1 = dom.getPos(e.target);
- m.showMenu(p1.x, p1.y + e.target.offsetHeight - vp.y);
-
- return tinymce.dom.Event.cancel(e);
- } else
- m.hideMenu();
- },
-
- _checkDone : function() {
- var t = this, ed = t.editor, dom = ed.dom, o;
-
- each(dom.select('span'), function(n) {
- if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) {
- o = true;
- return false;
- }
- });
-
- if (!o)
- t._done();
- },
-
- _done : function() {
- var t = this, la = t.active;
-
- if (t.active) {
- t.active = 0;
- t._removeWords();
-
- if (t._menu)
- t._menu.hideMenu();
-
- if (la)
- t.editor.nodeChanged();
- }
- },
-
- _sendRPC : function(m, p, cb) {
- var t = this, url = t.editor.getParam("spellchecker_rpc_url", this.url+'/rpc.php');
-
- if (url == '{backend}') {
- t.editor.setProgressState(0);
- alert('Please specify: spellchecker_rpc_url');
- return;
- }
-
- JSONRequest.sendRPC({
- url : url,
- method : m,
- params : p,
- success : cb,
- error : function(e, x) {
- t.editor.setProgressState(0);
- t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText));
- }
- });
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin);
-})();
\ No newline at end of file
+(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;g.rpcUrl=e.getParam("spellchecker_rpc_url",this.url+'/rpc.php');if(g.rpcUrl=="{backend}"){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand("mceSpellCheck",function(){if(g.rpcUrl=="{backend}"){g.editor.getBody().spellcheck=g.active=!g.active;return}if(!g.active){e.setProgressState(1);g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);if(e.getParam("spellchecker_report_no_misspellings",true)){e.windowManager.alert("spellchecker.no_mpell")}}})}else{g._done()}});e.onInit.add(function(){if(e.settings.content_css!==false){e.dom.loadCSS(f+"/css/content.css")}});e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){if(f.rpcUrl=="{backend}"){if(f.hasSupport){g=d.createButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f})}return g}g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",'\\s!"#$%&()*+,-./:;<=>?@[]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');for(d=0;d<f.length;d++){e+="\\"+f.charAt(d)}return e},_getWords:function(){var e=this.editor,g=[],d="",f={},h=[];this._walk(e.getBody(),function(i){if(i.nodeType==3){d+=i.nodeValue+" "}});if(e.getParam("spellchecker_word_pattern")){h=d.match("("+e.getParam("spellchecker_word_pattern")+")","gi")}else{d=d.replace(new RegExp("([0-9]|["+this._getSeparators()+"])","g")," ");d=tinymce.trim(d.replace(/(\s+)/g," "));h=d.split(" ")}c(h,function(i){if(!f[i]){g.push(i);f[i]=1}});return g},_removeWords:function(e){var f=this.editor,h=f.dom,g=f.selection,d=g.getBookmark();c(h.select("span").reverse(),function(i){if(i&&(h.hasClass(i,"mceItemHiddenSpellWord")||h.hasClass(i,"mceItemHidden"))){if(!e||h.decode(i.innerHTML)==e){h.remove(i,1)}}});g.moveToBookmark(d)},_markWords:function(o){var i,h,g,f,e,n="",k=this.editor,p=this._getSeparators(),j=k.dom,d=[];var l=k.selection,m=l.getBookmark();c(o,function(q){n+=(n?"|":"")+q});i=new RegExp("(["+p+"])("+n+")(["+p+"])","g");h=new RegExp("^("+n+")","g");g=new RegExp("("+n+")(["+p+"]?)$","g");f=new RegExp("^("+n+")(["+p+"]?)$","g");e=new RegExp("("+n+")(["+p+"])","g");this._walk(this.editor.getBody(),function(q){if(q.nodeType==3){d.push(q)}});c(d,function(r){var q;if(r.nodeType==3){q=r.nodeValue;if(i.test(q)||h.test(q)||g.test(q)||f.test(q)){q=j.encode(q);q=q.replace(e,'<span class="mceItemHiddenSpellWord">$1</span>$2');q=q.replace(g,'<span class="mceItemHiddenSpellWord">$1</span>$2');j.replace(j.create("span",{"class":"mceItemHidden"},q),r)}}});l.moveToBookmark(m)},_showMenu:function(g,i){var h=this,g=h.editor,d=h._menu,k,j=g.dom,f=j.getViewPort(g.getWin());if(!d){k=b.getPos(g.getContentAreaContainer());d=g.controlManager.createDropMenu("spellcheckermenu",{offset_x:k.x,offset_y:k.y,"class":"mceNoIcons"});h._menu=d}if(j.hasClass(i.target,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);h._sendRPC("getSuggestions",[h.selectedLang,j.decode(i.target.innerHTML)],function(l){var e;d.removeAll();if(l.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(l,function(m){d.add({title:m,onclick:function(){j.replace(g.getDoc().createTextNode(m),i.target);h._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}e=h.editor.getParam("spellchecker_enable_ignore_rpc","");d.add({title:"spellchecker.ignore_word",onclick:function(){var m=i.target.innerHTML;j.remove(i.target,1);h._checkDone();if(ignore_rpc){g.setProgressState(1);h._sendRPC("ignoreWord",[h.selectedLang,m],function(n){g.setProgressState(0)})}}});d.add({title:"spellchecker.ignore_words",onclick:function(){var m=i.target.innerHTML;h._removeWords(j.decode(m));h._checkDone();if(ignore_rpc){g.setProgressState(1);h._sendRPC("ignoreWords",[h.selectedLang,m],function(n){g.setProgressState(0)})}}});if(h.editor.getParam("spellchecker_enable_learn_rpc")){d.add({title:"spellchecker.learn_word",onclick:function(){var m=i.target.innerHTML;j.remove(i.target,1);h._checkDone();g.setProgressState(1);h._sendRPC("learnWord",[h.selectedLang,m],function(n){g.setProgressState(0)})}})}d.update()});g.selection.select(i.target);k=j.getPos(i.target);d.showMenu(k.x,k.y+i.target.offsetHeight-f.y);return tinymce.dom.Event.cancel(i)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||("Error response: "+h.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})();
\ No newline at end of file
* @param String $default_value Default value to return if value not found.
* @return String request value by name without magic quoting or default value.
*/
-function getRequestParam($name, $default_value = false, $sanitize = false) {
+function getRequestParam($name, $default_value = false) {
if (!isset($_REQUEST[$name]))
return $default_value;
$newarray = array();
foreach ($_REQUEST[$name] as $name => $value)
- $newarray[formatParam($name, $sanitize)] = formatParam($value, $sanitize);
+ $newarray[$name] = $value;
return $newarray;
}
- return formatParam($_REQUEST[$name], $sanitize);
+ return $_REQUEST[$name];
}
function &getLogger() {
<?php
/**
- * $Id: rpc.php 822 2008-04-28 13:45:03Z spocke $
+ * $Id: rpc.php 915 2008-09-03 08:45:28Z spocke $
*
* @package MCManager.includes
* @author Moxiecode
// Return JSON encoded string
echo $json->encode($output);
-?>
\ No newline at end of file
+?>
-(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(i){o=c.getParent(l.id,"form");n=o.elements;if(o){d(n,function(s,r){if(s.id==l.id){j=r;return false}});if(i>0){for(m=j+1;m<n.length;m++){if(n[m].type!="hidden"){return n[m]}}}else{for(m=j-1;m>=0;m--){if(n[m].type!="hidden"){return n[m]}}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(l=tinymce.EditorManager.get(n.id||n.name)){l.focus()}else{window.setTimeout(function(){window.focus();n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}f.onInit.add(function(){d(c.select("a:first,a:last",f.getContainer()),function(i){a.add(i,"focus",function(){f.focus()})})})},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})();
\ No newline at end of file
+(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(i){o=c.getParent(l.id,"form");n=o.elements;if(o){d(n,function(s,r){if(s.id==l.id){j=r;return false}});if(i>0){for(m=j+1;m<n.length;m++){if(n[m].type!="hidden"){return n[m]}}}else{for(m=j-1;m>=0;m--){if(n[m].type!="hidden"){return n[m]}}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(l=tinymce.get(n.id||n.name)){l.focus()}else{window.setTimeout(function(){window.focus();n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}f.onInit.add(function(){d(c.select("a:first,a:last",f.getContainer()),function(i){a.add(i,"focus",function(){f.focus()})})})},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})();
\ No newline at end of file
});
ed.addCommand('WP_Help', function() {
- ed.windowManager.open({
- url : tinymce.baseURL + '/wp-mce-help.php',
- width : 450,
- height : 420,
- inline : 1
- });
+ ed.windowManager.open({
+ url : tinymce.baseURL + '/wp-mce-help.php',
+ width : 450,
+ height : 420,
+ inline : 1
});
+ });
ed.addCommand('WP_Adv', function() {
var cm = ed.controlManager, id = cm.get(tbId).id;
}
});
- // Add Media buttons to fullscreen
- ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
- var DOM = tinymce.DOM;
- if ( 'mceFullScreen' != cmd ) return;
- if ( 'mce_fullscreen' != ed.id && DOM.get('add_audio') && DOM.get('add_video') && DOM.get('add_image') && DOM.get('add_media') )
- ed.settings.theme_advanced_buttons1 += ',|,add_image,add_video,add_audio,add_media';
- });
-
- // Add class "alignleft", "alignright" and "aligncenter" when selecting align for images.
- ed.addCommand('JustifyLeft', function() {
- var n = ed.selection.getNode();
-
- if ( n.nodeName != 'IMG' )
- ed.editorCommands.mceJustify('JustifyLeft', 'left');
- else ed.plugins.wordpress.do_align(n, 'alignleft');
- });
-
- ed.addCommand('JustifyRight', function() {
- var n = ed.selection.getNode();
+ // Add Media buttons to fullscreen and handle align buttons for image captions
+ ed.onBeforeExecCommand.add(function(ed, cmd, ui, val, o) {
+ var DOM = tinymce.DOM, n, DL, DIV, cls, a, align;
+ if ( 'mceFullScreen' == cmd ) {
+ if ( 'mce_fullscreen' != ed.id && DOM.get('add_audio') && DOM.get('add_video') && DOM.get('add_image') && DOM.get('add_media') )
+ ed.settings.theme_advanced_buttons1 += ',|,add_image,add_video,add_audio,add_media';
+ }
- if ( n.nodeName != 'IMG' )
- ed.editorCommands.mceJustify('JustifyRight', 'right');
- else ed.plugins.wordpress.do_align(n, 'alignright');
+ if ( 'JustifyLeft' == cmd || 'JustifyRight' == cmd || 'JustifyCenter' == cmd ) {
+ n = ed.selection.getNode();
+
+ if ( n.nodeName == 'IMG' ) {
+ align = cmd.substr(7).toLowerCase();
+ a = 'align' + align;
+ DL = ed.dom.getParent(n, 'dl.wp-caption');
+ DIV = ed.dom.getParent(n, 'div.mceTemp');
+
+ if ( DL && DIV ) {
+ cls = ed.dom.hasClass(DL, a) ? 'alignnone' : a;
+ DL.className = DL.className.replace(/align[^ '"]+\s?/g, '');
+ ed.dom.addClass(DL, cls);
+
+ if (cls == 'aligncenter')
+ ed.dom.addClass(DIV, 'mceIEcenter');
+ else
+ ed.dom.removeClass(DIV, 'mceIEcenter');
+
+ o.terminate = true;
+ ed.execCommand('mceRepaint');
+ } else {
+ if ( ed.dom.hasClass(n, a) )
+ ed.dom.addClass(n, 'alignnone');
+ else
+ ed.dom.removeClass(n, 'alignnone');
+ }
+ }
+ }
});
+
+ ed.onInit.add(function(ed) {
+ // make sure these run last
+ ed.onNodeChange.add( function(ed, cm, e) {
+ var DL;
+
+ if ( e.nodeName == 'IMG' ) {
+ DL = ed.dom.getParent(e, 'dl.wp-caption');
+ } else if ( e.nodeName == 'DIV' && ed.dom.hasClass(e, 'mceTemp') ) {
+ DL = e.firstChild;
+
+ if ( ! ed.dom.hasClass(DL, 'wp-caption') )
+ DL = false;
+ }
+
+ if ( DL ) {
+ if ( ed.dom.hasClass(DL, 'alignleft') )
+ cm.setActive('justifyleft', 1);
+ else if ( ed.dom.hasClass(DL, 'alignright') )
+ cm.setActive('justifyright', 1);
+ else if ( ed.dom.hasClass(DL, 'aligncenter') )
+ cm.setActive('justifycenter', 1);
+ }
+ });
- ed.addCommand('JustifyCenter', function() {
- var n = ed.selection.getNode(), P = ed.dom.getParent(n, 'p'), DL = ed.dom.getParent(n, 'dl');
-
- if ( n.nodeName == 'IMG' && ( P || DL ) )
- ed.plugins.wordpress.do_align(n, 'aligncenter');
- else ed.editorCommands.mceJustify('JustifyCenter', 'center');
+ // remove invalid parent paragraphs when pasting HTML and/or switching to the HTML editor and back
+ ed.onBeforeSetContent.add(function(ed, o) {
+ if ( o.content ) {
+ o.content = o.content.replace(/<p>\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi, '<$1$2>');
+ o.content = o.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi, '</$1>');
+ }
+ });
});
// Word count if script is loaded
this.mceTout = 0;
},
- do_align : function(n, a) {
- var P, DL, DIV, cls, c, ed = tinyMCE.activeEditor;
-
- if ( /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className) )
- return;
-
- P = ed.dom.getParent(n, 'p');
- DL = ed.dom.getParent(n, 'dl');
- DIV = ed.dom.getParent(n, 'div');
-
- if ( DL && DIV ) {
- cls = ed.dom.hasClass(DL, a) ? 'alignnone' : a;
- DL.className = DL.className.replace(/align[^ '"]+\s?/g, '');
- ed.dom.addClass(DL, cls);
- c = (cls == 'aligncenter') ? ed.dom.addClass(DIV, 'mceIEcenter') : ed.dom.removeClass(DIV, 'mceIEcenter');
- } else if ( P ) {
- cls = ed.dom.hasClass(n, a) ? 'alignnone' : a;
- n.className = n.className.replace(/align[^ '"]+\s?/g, '');
- ed.dom.addClass(n, cls);
- if ( cls == 'aligncenter' )
- ed.dom.setStyle(P, 'textAlign', 'center');
- else if (P.style && P.style.textAlign == 'center')
- ed.dom.setStyle(P, 'textAlign', '');
- }
-
- ed.execCommand('mceRepaint');
- },
-
// Resizes the iframe by a relative height value
_resizeIframe : function(ed, tb_id, dy) {
var ifr = ed.getContentAreaContainer().firstChild;
// Replace morebreak with images
ed.onBeforeSetContent.add(function(ed, o) {
- o.content = o.content.replace(/<!--more(.*?)-->/g, moreHTML);
- o.content = o.content.replace(/<!--nextpage-->/g, nextpageHTML);
+ if ( o.content ) {
+ o.content = o.content.replace(/<!--more(.*?)-->/g, moreHTML);
+ o.content = o.content.replace(/<!--nextpage-->/g, nextpageHTML);
+ }
});
// Replace images with morebreak
-(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.WordPress",{mceTout:0,init:function(c,d){var e=this,h=c.getParam("wordpress_adv_toolbar","toolbar2"),g=0,f,b;f='<img src="'+d+'/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';if(getUserSetting("hidetb","0")=="1"){c.settings.wordpress_adv_hidden=0}c.onPostRender.add(function(){var i=c.controlManager.get(h);if(c.getParam("wordpress_adv_hidden",1)&&i){a.hide(i.id);e._resizeIframe(c,h,28)}});c.addCommand("WP_More",function(){c.execCommand("mceInsertContent",0,f)});c.addCommand("WP_Page",function(){c.execCommand("mceInsertContent",0,b)});c.addCommand("WP_Help",function(){c.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});c.addCommand("WP_Adv",function(){var i=c.controlManager,j=i.get(h).id;if("undefined"==j){return}if(a.isHidden(j)){i.setActive("wp_adv",1);a.show(j);e._resizeIframe(c,h,-28);c.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{i.setActive("wp_adv",0);a.hide(j);e._resizeIframe(c,h,28);c.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});c.addButton("wp_more",{title:"wordpress.wp_more_desc",image:d+"/img/more.gif",cmd:"WP_More"});c.addButton("wp_page",{title:"wordpress.wp_page_desc",image:d+"/img/page.gif",cmd:"WP_Page"});c.addButton("wp_help",{title:"wordpress.wp_help_desc",image:d+"/img/help.gif",cmd:"WP_Help"});c.addButton("wp_adv",{title:"wordpress.wp_adv_desc",image:d+"/img/toolbars.gif",cmd:"WP_Adv"});c.addButton("add_media",{title:"wordpress.add_media",image:d+"/img/media.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_media").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_image",{title:"wordpress.add_image",image:d+"/img/image.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_image").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_video",{title:"wordpress.add_video",image:d+"/img/video.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_video").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_audio",{title:"wordpress.add_audio",image:d+"/img/audio.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_audio").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.onBeforeExecCommand.add(function(i,l,k,m){var j=tinymce.DOM;if("mceFullScreen"!=l){return}if("mce_fullscreen"!=i.id&&j.get("add_audio")&&j.get("add_video")&&j.get("add_image")&&j.get("add_media")){i.settings.theme_advanced_buttons1+=",|,add_image,add_video,add_audio,add_media"}});c.addCommand("JustifyLeft",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyLeft","left")}else{c.plugins.wordpress.do_align(i,"alignleft")}});c.addCommand("JustifyRight",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyRight","right")}else{c.plugins.wordpress.do_align(i,"alignright")}});c.addCommand("JustifyCenter",function(){var k=c.selection.getNode(),j=c.dom.getParent(k,"p"),i=c.dom.getParent(k,"dl");if(k.nodeName=="IMG"&&(j||i)){c.plugins.wordpress.do_align(k,"aligncenter")}else{c.editorCommands.mceJustify("JustifyCenter","center")}});if("undefined"!=typeof wpWordCount){c.onKeyUp.add(function(i,j){if(j.keyCode==g){return}if(13==j.keyCode||8==g||46==g){wpWordCount.wc(i.getContent({format:"raw"}))}g=j.keyCode})}c.onSaveContent.add(function(i,j){if(typeof(switchEditors)=="object"){if(i.isHidden()){j.content=j.element.value}else{j.content=switchEditors.pre_wpautop(j.content)}}});e._handleMoreBreak(c,d);c.addShortcut("alt+shift+c",c.getLang("justifycenter_desc"),"JustifyCenter");c.addShortcut("alt+shift+r",c.getLang("justifyright_desc"),"JustifyRight");c.addShortcut("alt+shift+l",c.getLang("justifyleft_desc"),"JustifyLeft");c.addShortcut("alt+shift+j",c.getLang("justifyfull_desc"),"JustifyFull");c.addShortcut("alt+shift+q",c.getLang("blockquote_desc"),"mceBlockQuote");c.addShortcut("alt+shift+u",c.getLang("bullist_desc"),"InsertUnorderedList");c.addShortcut("alt+shift+o",c.getLang("numlist_desc"),"InsertOrderedList");c.addShortcut("alt+shift+d",c.getLang("striketrough_desc"),"Strikethrough");c.addShortcut("alt+shift+n",c.getLang("spellchecker.desc"),"mceSpellCheck");c.addShortcut("alt+shift+a",c.getLang("link_desc"),"mceLink");c.addShortcut("alt+shift+s",c.getLang("unlink_desc"),"unlink");c.addShortcut("alt+shift+m",c.getLang("image_desc"),"mceImage");c.addShortcut("alt+shift+g",c.getLang("fullscreen.desc"),"mceFullScreen");c.addShortcut("alt+shift+z",c.getLang("wp_adv_desc"),"WP_Adv");c.addShortcut("alt+shift+h",c.getLang("help_desc"),"WP_Help");c.addShortcut("alt+shift+t",c.getLang("wp_more_desc"),"WP_More");c.addShortcut("alt+shift+p",c.getLang("wp_page_desc"),"WP_Page");c.addShortcut("ctrl+s",c.getLang("save_desc"),function(){if("function"==typeof autosave){autosave()}});if(tinymce.isWebKit){c.addShortcut("alt+shift+b",c.getLang("bold_desc"),"Bold");c.addShortcut("alt+shift+i",c.getLang("italic_desc"),"Italic")}c.onInit.add(function(i){tinymce.dom.Event.add(i.getWin(),"scroll",function(j){i.plugins.wordpress._hideButtons()});tinymce.dom.Event.add(i.getBody(),"dragstart",function(j){i.plugins.wordpress._hideButtons()})});c.onBeforeExecCommand.add(function(i,k,j,l){i.plugins.wordpress._hideButtons()});c.onSaveContent.add(function(i,j){i.plugins.wordpress._hideButtons()});c.onMouseDown.add(function(i,j){if(j.target.nodeName!="IMG"){i.plugins.wordpress._hideButtons()}})},getInfo:function(){return{longname:"WordPress Plugin",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"3.0"}},_setEmbed:function(b){return b.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g,function(d,c){return'<img width="300" height="200" src="'+tinymce.baseURL+'/plugins/wordpress/img/trans.gif" class="wp-oembed mceItemNoResize" alt="'+c+'" title="'+c+'" />'})},_getEmbed:function(b){return b.replace(/<img[^>]+>/g,function(c){if(c.indexOf('class="wp-oembed')!=-1){var d=c.match(/alt="([^\"]+)"/);if(d[1]){c="[embed]"+d[1]+"[/embed]"}}return c})},_showButtons:function(f,d){var g=tinyMCE.activeEditor,i,h,b,j=tinymce.DOM,e,c;b=g.dom.getViewPort(g.getWin());i=j.getPos(g.getContentAreaContainer());h=g.dom.getPos(f);e=Math.max(h.x-b.x,0)+i.x;c=Math.max(h.y-b.y,0)+i.y;j.setStyles(d,{top:c+5+"px",left:e+5+"px",display:"block"});if(this.mceTout){clearTimeout(this.mceTout)}this.mceTout=setTimeout(function(){g.plugins.wordpress._hideButtons()},5000)},_hideButtons:function(){if(!this.mceTout){return}if(document.getElementById("wp_editbtns")){tinymce.DOM.hide("wp_editbtns")}if(document.getElementById("wp_gallerybtns")){tinymce.DOM.hide("wp_gallerybtns")}clearTimeout(this.mceTout);this.mceTout=0},do_align:function(j,d){var h,f,g,b,i,e=tinyMCE.activeEditor;if(/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(j.className)){return}h=e.dom.getParent(j,"p");f=e.dom.getParent(j,"dl");g=e.dom.getParent(j,"div");if(f&&g){b=e.dom.hasClass(f,d)?"alignnone":d;f.className=f.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(f,b);i=(b=="aligncenter")?e.dom.addClass(g,"mceIEcenter"):e.dom.removeClass(g,"mceIEcenter")}else{if(h){b=e.dom.hasClass(j,d)?"alignnone":d;j.className=j.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(j,b);if(b=="aligncenter"){e.dom.setStyle(h,"textAlign","center")}else{if(h.style&&h.style.textAlign=="center"){e.dom.setStyle(h,"textAlign","")}}}}e.execCommand("mceRepaint")},_resizeIframe:function(c,e,b){var d=c.getContentAreaContainer().firstChild;a.setStyle(d,"height",d.clientHeight+b);c.theme.deltaHeight+=b},_handleMoreBreak:function(c,d){var e,b;e='<img src="'+d+'/img/trans.gif" alt="$1" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';c.onInit.add(function(){c.dom.loadCSS(d+"/css/content.css")});c.onPostRender.add(function(){if(c.theme.onResolveName){c.theme.onResolveName.add(function(f,g){if(g.node.nodeName=="IMG"){if(c.dom.hasClass(g.node,"mceWPmore")){g.name="wpmore"}if(c.dom.hasClass(g.node,"mceWPnextpage")){g.name="wppage"}}})}});c.onBeforeSetContent.add(function(f,g){g.content=g.content.replace(/<!--more(.*?)-->/g,e);g.content=g.content.replace(/<!--nextpage-->/g,b)});c.onPostProcess.add(function(f,g){if(g.get){g.content=g.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mceWPmore')!==-1){var h,j=(h=i.match(/alt="(.*?)"/))?h[1]:"";i="<!--more"+j+"-->"}if(i.indexOf('class="mceWPnextpage')!==-1){i="<!--nextpage-->"}return i})}});c.onNodeChange.add(function(g,f,h){f.setActive("wp_page",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPnextpage"));f.setActive("wp_more",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPmore"))})}});tinymce.PluginManager.add("wordpress",tinymce.plugins.WordPress)})();
\ No newline at end of file
+(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.WordPress",{mceTout:0,init:function(c,d){var e=this,h=c.getParam("wordpress_adv_toolbar","toolbar2"),g=0,f,b;f='<img src="'+d+'/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';if(getUserSetting("hidetb","0")=="1"){c.settings.wordpress_adv_hidden=0}c.onPostRender.add(function(){var i=c.controlManager.get(h);if(c.getParam("wordpress_adv_hidden",1)&&i){a.hide(i.id);e._resizeIframe(c,h,28)}});c.addCommand("WP_More",function(){c.execCommand("mceInsertContent",0,f)});c.addCommand("WP_Page",function(){c.execCommand("mceInsertContent",0,b)});c.addCommand("WP_Help",function(){c.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});c.addCommand("WP_Adv",function(){var i=c.controlManager,j=i.get(h).id;if("undefined"==j){return}if(a.isHidden(j)){i.setActive("wp_adv",1);a.show(j);e._resizeIframe(c,h,-28);c.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{i.setActive("wp_adv",0);a.hide(j);e._resizeIframe(c,h,28);c.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});c.addButton("wp_more",{title:"wordpress.wp_more_desc",image:d+"/img/more.gif",cmd:"WP_More"});c.addButton("wp_page",{title:"wordpress.wp_page_desc",image:d+"/img/page.gif",cmd:"WP_Page"});c.addButton("wp_help",{title:"wordpress.wp_help_desc",image:d+"/img/help.gif",cmd:"WP_Help"});c.addButton("wp_adv",{title:"wordpress.wp_adv_desc",image:d+"/img/toolbars.gif",cmd:"WP_Adv"});c.addButton("add_media",{title:"wordpress.add_media",image:d+"/img/media.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_media").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_image",{title:"wordpress.add_image",image:d+"/img/image.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_image").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_video",{title:"wordpress.add_video",image:d+"/img/video.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_video").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_audio",{title:"wordpress.add_audio",image:d+"/img/audio.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_audio").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.onBeforeExecCommand.add(function(p,m,s,l,j){var v=tinymce.DOM,k,i,r,u,t,q;if("mceFullScreen"==m){if("mce_fullscreen"!=p.id&&v.get("add_audio")&&v.get("add_video")&&v.get("add_image")&&v.get("add_media")){p.settings.theme_advanced_buttons1+=",|,add_image,add_video,add_audio,add_media"}}if("JustifyLeft"==m||"JustifyRight"==m||"JustifyCenter"==m){k=p.selection.getNode();if(k.nodeName=="IMG"){q=m.substr(7).toLowerCase();t="align"+q;i=p.dom.getParent(k,"dl.wp-caption");r=p.dom.getParent(k,"div.mceTemp");if(i&&r){u=p.dom.hasClass(i,t)?"alignnone":t;i.className=i.className.replace(/align[^ '"]+\s?/g,"");p.dom.addClass(i,u);if(u=="aligncenter"){p.dom.addClass(r,"mceIEcenter")}else{p.dom.removeClass(r,"mceIEcenter")}j.terminate=true;p.execCommand("mceRepaint")}else{if(p.dom.hasClass(k,t)){p.dom.addClass(k,"alignnone")}else{p.dom.removeClass(k,"alignnone")}}}}});c.onInit.add(function(i){i.onNodeChange.add(function(k,j,m){var l;if(m.nodeName=="IMG"){l=k.dom.getParent(m,"dl.wp-caption")}else{if(m.nodeName=="DIV"&&k.dom.hasClass(m,"mceTemp")){l=m.firstChild;if(!k.dom.hasClass(l,"wp-caption")){l=false}}}if(l){if(k.dom.hasClass(l,"alignleft")){j.setActive("justifyleft",1)}else{if(k.dom.hasClass(l,"alignright")){j.setActive("justifyright",1)}else{if(k.dom.hasClass(l,"aligncenter")){j.setActive("justifycenter",1)}}}}});i.onBeforeSetContent.add(function(j,k){if(k.content){k.content=k.content.replace(/<p>\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi,"<$1$2>");k.content=k.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi,"</$1>")}})});if("undefined"!=typeof wpWordCount){c.onKeyUp.add(function(i,j){if(j.keyCode==g){return}if(13==j.keyCode||8==g||46==g){wpWordCount.wc(i.getContent({format:"raw"}))}g=j.keyCode})}c.onSaveContent.add(function(i,j){if(typeof(switchEditors)=="object"){if(i.isHidden()){j.content=j.element.value}else{j.content=switchEditors.pre_wpautop(j.content)}}});e._handleMoreBreak(c,d);c.addShortcut("alt+shift+c",c.getLang("justifycenter_desc"),"JustifyCenter");c.addShortcut("alt+shift+r",c.getLang("justifyright_desc"),"JustifyRight");c.addShortcut("alt+shift+l",c.getLang("justifyleft_desc"),"JustifyLeft");c.addShortcut("alt+shift+j",c.getLang("justifyfull_desc"),"JustifyFull");c.addShortcut("alt+shift+q",c.getLang("blockquote_desc"),"mceBlockQuote");c.addShortcut("alt+shift+u",c.getLang("bullist_desc"),"InsertUnorderedList");c.addShortcut("alt+shift+o",c.getLang("numlist_desc"),"InsertOrderedList");c.addShortcut("alt+shift+d",c.getLang("striketrough_desc"),"Strikethrough");c.addShortcut("alt+shift+n",c.getLang("spellchecker.desc"),"mceSpellCheck");c.addShortcut("alt+shift+a",c.getLang("link_desc"),"mceLink");c.addShortcut("alt+shift+s",c.getLang("unlink_desc"),"unlink");c.addShortcut("alt+shift+m",c.getLang("image_desc"),"mceImage");c.addShortcut("alt+shift+g",c.getLang("fullscreen.desc"),"mceFullScreen");c.addShortcut("alt+shift+z",c.getLang("wp_adv_desc"),"WP_Adv");c.addShortcut("alt+shift+h",c.getLang("help_desc"),"WP_Help");c.addShortcut("alt+shift+t",c.getLang("wp_more_desc"),"WP_More");c.addShortcut("alt+shift+p",c.getLang("wp_page_desc"),"WP_Page");c.addShortcut("ctrl+s",c.getLang("save_desc"),function(){if("function"==typeof autosave){autosave()}});if(tinymce.isWebKit){c.addShortcut("alt+shift+b",c.getLang("bold_desc"),"Bold");c.addShortcut("alt+shift+i",c.getLang("italic_desc"),"Italic")}c.onInit.add(function(i){tinymce.dom.Event.add(i.getWin(),"scroll",function(j){i.plugins.wordpress._hideButtons()});tinymce.dom.Event.add(i.getBody(),"dragstart",function(j){i.plugins.wordpress._hideButtons()})});c.onBeforeExecCommand.add(function(i,k,j,l){i.plugins.wordpress._hideButtons()});c.onSaveContent.add(function(i,j){i.plugins.wordpress._hideButtons()});c.onMouseDown.add(function(i,j){if(j.target.nodeName!="IMG"){i.plugins.wordpress._hideButtons()}})},getInfo:function(){return{longname:"WordPress Plugin",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"3.0"}},_setEmbed:function(b){return b.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g,function(d,c){return'<img width="300" height="200" src="'+tinymce.baseURL+'/plugins/wordpress/img/trans.gif" class="wp-oembed mceItemNoResize" alt="'+c+'" title="'+c+'" />'})},_getEmbed:function(b){return b.replace(/<img[^>]+>/g,function(c){if(c.indexOf('class="wp-oembed')!=-1){var d=c.match(/alt="([^\"]+)"/);if(d[1]){c="[embed]"+d[1]+"[/embed]"}}return c})},_showButtons:function(f,d){var g=tinyMCE.activeEditor,i,h,b,j=tinymce.DOM,e,c;b=g.dom.getViewPort(g.getWin());i=j.getPos(g.getContentAreaContainer());h=g.dom.getPos(f);e=Math.max(h.x-b.x,0)+i.x;c=Math.max(h.y-b.y,0)+i.y;j.setStyles(d,{top:c+5+"px",left:e+5+"px",display:"block"});if(this.mceTout){clearTimeout(this.mceTout)}this.mceTout=setTimeout(function(){g.plugins.wordpress._hideButtons()},5000)},_hideButtons:function(){if(!this.mceTout){return}if(document.getElementById("wp_editbtns")){tinymce.DOM.hide("wp_editbtns")}if(document.getElementById("wp_gallerybtns")){tinymce.DOM.hide("wp_gallerybtns")}clearTimeout(this.mceTout);this.mceTout=0},_resizeIframe:function(c,e,b){var d=c.getContentAreaContainer().firstChild;a.setStyle(d,"height",d.clientHeight+b);c.theme.deltaHeight+=b},_handleMoreBreak:function(c,d){var e,b;e='<img src="'+d+'/img/trans.gif" alt="$1" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';c.onInit.add(function(){c.dom.loadCSS(d+"/css/content.css")});c.onPostRender.add(function(){if(c.theme.onResolveName){c.theme.onResolveName.add(function(f,g){if(g.node.nodeName=="IMG"){if(c.dom.hasClass(g.node,"mceWPmore")){g.name="wpmore"}if(c.dom.hasClass(g.node,"mceWPnextpage")){g.name="wppage"}}})}});c.onBeforeSetContent.add(function(f,g){if(g.content){g.content=g.content.replace(/<!--more(.*?)-->/g,e);g.content=g.content.replace(/<!--nextpage-->/g,b)}});c.onPostProcess.add(function(f,g){if(g.get){g.content=g.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mceWPmore')!==-1){var h,j=(h=i.match(/alt="(.*?)"/))?h[1]:"";i="<!--more"+j+"-->"}if(i.indexOf('class="mceWPnextpage')!==-1){i="<!--nextpage-->"}return i})}});c.onNodeChange.add(function(g,f,h){f.setActive("wp_page",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPnextpage"));f.setActive("wp_more",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPmore"))})}});tinymce.PluginManager.add("wordpress",tinymce.plugins.WordPress)})();
\ No newline at end of file
--- /dev/null
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function($) {
+ var wpDialogFn = function( fn ) {
+ return function() {
+ if ( this.features.wpDialog )
+ return fn.apply( this, arguments );
+ else
+ return this.parent.apply( this, arguments );
+ };
+ };
+
+ tinymce.create('tinymce.plugins.WPDialogs', {
+ init : function(ed, url) {
+ // Replace window manager
+ ed.onBeforeRenderUI.add(function() {
+ ed.windowManager = new tinymce.WPWindowManager(ed);
+ });
+ },
+
+ getInfo : function() {
+ return {
+ longname : 'WPDialogs',
+ author : 'WordPress',
+ authorurl : 'http://wordpress.org',
+ infourl : 'http://wordpress.org',
+ version : '0.1'
+ };
+ }
+ });
+
+ $(document).ready(function() {
+ $.widget("wp.wpdialog", $.ui.dialog, {
+ open: function() {
+ // Initialize tinyMCEPopup if it exists.
+ if ( tinyMCEPopup )
+ tinyMCEPopup.init();
+ // Open the dialog.
+ $.ui.dialog.prototype.open.apply( this, arguments );
+ // WebKit leaves focus in the TinyMCE editor unless we shift focus.
+ this.element.focus();
+ this._trigger('refresh');
+ }
+ });
+ });
+
+ tinymce.create('tinymce.WPWindowManager:tinymce.InlineWindowManager', {
+ WPWindowManager : function(ed) {
+ this.parent(ed);
+ },
+
+ open : function(f, p) {
+ var t = this, element;
+ // Can't use wpDialogFn here; this.features isn't set yet.
+ if ( ! f.wpDialog )
+ return this.parent( f, p );
+ else if ( ! f.id )
+ return;
+
+ element = $('#' + f.id);
+ if ( ! element.length )
+ return;
+
+ t.features = f;
+ t.params = p;
+ t.onOpen.dispatch(t, f, p);
+ t.element = t.windows[ f.id ] = element;
+
+ // Store selection
+ t.bookmark = t.editor.selection.getBookmark(1);
+
+ element.wpdialog({
+ title: f.title,
+ width: f.width,
+ height: f.height,
+ modal: true,
+ dialogClass: 'wp-dialog',
+ zIndex: 300000
+ });
+ },
+ close : wpDialogFn(function() {
+ this.element.wpdialog('close');
+ })
+ });
+
+ // Register plugin
+ tinymce.PluginManager.add('wpdialogs', tinymce.plugins.WPDialogs);
+})(jQuery);
+
--- /dev/null
+(function(b){var a=function(c){return function(){if(this.features.wpDialog){return c.apply(this,arguments)}else{return this.parent.apply(this,arguments)}}};tinymce.create("tinymce.plugins.WPDialogs",{init:function(c,d){c.onBeforeRenderUI.add(function(){c.windowManager=new tinymce.WPWindowManager(c)})},getInfo:function(){return{longname:"WPDialogs",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"0.1"}}});b(document).ready(function(){b.widget("wp.wpdialog",b.ui.dialog,{open:function(){if(tinyMCEPopup){tinyMCEPopup.init()}b.ui.dialog.prototype.open.apply(this,arguments);this.element.focus();this._trigger("refresh")}})});tinymce.create("tinymce.WPWindowManager:tinymce.InlineWindowManager",{WPWindowManager:function(c){this.parent(c)},open:function(e,g){var d=this,c;if(!e.wpDialog){return this.parent(e,g)}else{if(!e.id){return}}c=b("#"+e.id);if(!c.length){return}d.features=e;d.params=g;d.onOpen.dispatch(d,e,g);d.element=d.windows[e.id]=c;d.bookmark=d.editor.selection.getBookmark(1);c.wpdialog({title:e.title,width:e.width,height:e.height,modal:true,dialogClass:"wp-dialog",zIndex:300000})},close:a(function(){this.element.wpdialog("close")})});tinymce.PluginManager.add("wpdialogs",tinymce.plugins.WPDialogs)})(jQuery);
\ No newline at end of file
--- /dev/null
+/**
+ * popup.js
+ *
+ * An altered version of tinyMCEPopup to work in the same window as tinymce.
+ *
+ * ------------------------------------------------------------------
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+// Some global instances
+
+/**
+ * TinyMCE popup/dialog helper class. This gives you easy access to the
+ * parent editor instance and a bunch of other things. It's higly recommended
+ * that you load this script into your dialogs.
+ *
+ * @static
+ * @class tinyMCEPopup
+ */
+var tinyMCEPopup = {
+ /**
+ * Initializes the popup this will be called automatically.
+ *
+ * @method init
+ */
+ init : function() {
+ var t = this, w, ti;
+
+ // Find window & API
+ w = t.getWin();
+ tinymce = w.tinymce;
+ tinyMCE = w.tinyMCE;
+ t.editor = tinymce.EditorManager.activeEditor;
+ t.params = t.editor.windowManager.params;
+ t.features = t.editor.windowManager.features;
+ t.dom = tinymce.dom;
+
+ // Setup on init listeners
+ t.listeners = [];
+ t.onInit = {
+ add : function(f, s) {
+ t.listeners.push({func : f, scope : s});
+ }
+ };
+
+ t.isWindow = false;
+ t.id = t.features.id;
+ t.editor.windowManager.onOpen.dispatch(t.editor.windowManager, window);
+ },
+
+ /**
+ * Returns the reference to the parent window that opened the dialog.
+ *
+ * @method getWin
+ * @return {Window} Reference to the parent window that opened the dialog.
+ */
+ getWin : function() {
+ return window;
+ },
+
+ /**
+ * Returns a window argument/parameter by name.
+ *
+ * @method getWindowArg
+ * @param {String} n Name of the window argument to retrive.
+ * @param {String} dv Optional default value to return.
+ * @return {String} Argument value or default value if it wasn't found.
+ */
+ getWindowArg : function(n, dv) {
+ var v = this.params[n];
+
+ return tinymce.is(v) ? v : dv;
+ },
+
+ /**
+ * Returns a editor parameter/config option value.
+ *
+ * @method getParam
+ * @param {String} n Name of the editor config option to retrive.
+ * @param {String} dv Optional default value to return.
+ * @return {String} Parameter value or default value if it wasn't found.
+ */
+ getParam : function(n, dv) {
+ return this.editor.getParam(n, dv);
+ },
+
+ /**
+ * Returns a language item by key.
+ *
+ * @method getLang
+ * @param {String} n Language item like mydialog.something.
+ * @param {String} dv Optional default value to return.
+ * @return {String} Language value for the item like "my string" or the default value if it wasn't found.
+ */
+ getLang : function(n, dv) {
+ return this.editor.getLang(n, dv);
+ },
+
+ /**
+ * Executed a command on editor that opened the dialog/popup.
+ *
+ * @method execCommand
+ * @param {String} cmd Command to execute.
+ * @param {Boolean} ui Optional boolean value if the UI for the command should be presented or not.
+ * @param {Object} val Optional value to pass with the comman like an URL.
+ * @param {Object} a Optional arguments object.
+ */
+ execCommand : function(cmd, ui, val, a) {
+ a = a || {};
+ a.skip_focus = 1;
+
+ this.restoreSelection();
+ return this.editor.execCommand(cmd, ui, val, a);
+ },
+
+ /**
+ * Resizes the dialog to the inner size of the window. This is needed since various browsers
+ * have different border sizes on windows.
+ *
+ * @method resizeToInnerSize
+ */
+ resizeToInnerSize : function() {
+ var t = this;
+
+ // Detach it to workaround a Chrome specific bug
+ // https://sourceforge.net/tracker/?func=detail&atid=635682&aid=2926339&group_id=103281
+ setTimeout(function() {
+ var vp = t.dom.getViewPort(window);
+
+ t.editor.windowManager.resizeBy(
+ t.getWindowArg('mce_width') - vp.w,
+ t.getWindowArg('mce_height') - vp.h,
+ t.id || window
+ );
+ }, 0);
+ },
+
+ /**
+ * Will executed the specified string when the page has been loaded. This function
+ * was added for compatibility with the 2.x branch.
+ *
+ * @method executeOnLoad
+ * @param {String} s String to evalutate on init.
+ */
+ executeOnLoad : function(s) {
+ this.onInit.add(function() {
+ eval(s);
+ });
+ },
+
+ /**
+ * Stores the current editor selection for later restoration. This can be useful since some browsers
+ * looses it's selection if a control element is selected/focused inside the dialogs.
+ *
+ * @method storeSelection
+ */
+ storeSelection : function() {
+ this.editor.windowManager.bookmark = tinyMCEPopup.editor.selection.getBookmark(1);
+ },
+
+ /**
+ * Restores any stored selection. This can be useful since some browsers
+ * looses it's selection if a control element is selected/focused inside the dialogs.
+ *
+ * @method restoreSelection
+ */
+ restoreSelection : function() {
+ var t = tinyMCEPopup;
+
+ if (!t.isWindow && tinymce.isIE)
+ t.editor.selection.moveToBookmark(t.editor.windowManager.bookmark);
+ },
+
+ /**
+ * Loads a specific dialog language pack. If you pass in plugin_url as a arugment
+ * when you open the window it will load the <plugin url>/langs/<code>_dlg.js lang pack file.
+ *
+ * @method requireLangPack
+ */
+ requireLangPack : function() {
+ var t = this, u = t.getWindowArg('plugin_url') || t.getWindowArg('theme_url');
+
+ if (u && t.editor.settings.language && t.features.translate_i18n !== false) {
+ u += '/langs/' + t.editor.settings.language + '_dlg.js';
+
+ if (!tinymce.ScriptLoader.isDone(u)) {
+ document.write('<script type="text/javascript" src="' + tinymce._addVer(u) + '"></script>');
+ tinymce.ScriptLoader.markDone(u);
+ }
+ }
+ },
+
+ /**
+ * Executes a color picker on the specified element id. When the user
+ * then selects a color it will be set as the value of the specified element.
+ *
+ * @method pickColor
+ * @param {DOMEvent} e DOM event object.
+ * @param {string} element_id Element id to be filled with the color value from the picker.
+ */
+ pickColor : function(e, element_id) {
+ this.execCommand('mceColorPicker', true, {
+ color : document.getElementById(element_id).value,
+ func : function(c) {
+ document.getElementById(element_id).value = c;
+
+ try {
+ document.getElementById(element_id).onchange();
+ } catch (ex) {
+ // Try fire event, ignore errors
+ }
+ }
+ });
+ },
+
+ /**
+ * Opens a filebrowser/imagebrowser this will set the output value from
+ * the browser as a value on the specified element.
+ *
+ * @method openBrowser
+ * @param {string} element_id Id of the element to set value in.
+ * @param {string} type Type of browser to open image/file/flash.
+ * @param {string} option Option name to get the file_broswer_callback function name from.
+ */
+ openBrowser : function(element_id, type, option) {
+ tinyMCEPopup.restoreSelection();
+ this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window);
+ },
+
+ /**
+ * Creates a confirm dialog. Please don't use the blocking behavior of this
+ * native version use the callback method instead then it can be extended.
+ *
+ * @method confirm
+ * @param {String} t Title for the new confirm dialog.
+ * @param {function} cb Callback function to be executed after the user has selected ok or cancel.
+ * @param {Object} s Optional scope to execute the callback in.
+ */
+ confirm : function(t, cb, s) {
+ this.editor.windowManager.confirm(t, cb, s, window);
+ },
+
+ /**
+ * Creates a alert dialog. Please don't use the blocking behavior of this
+ * native version use the callback method instead then it can be extended.
+ *
+ * @method alert
+ * @param {String} t Title for the new alert dialog.
+ * @param {function} cb Callback function to be executed after the user has selected ok.
+ * @param {Object} s Optional scope to execute the callback in.
+ */
+ alert : function(tx, cb, s) {
+ this.editor.windowManager.alert(tx, cb, s, window);
+ },
+
+ /**
+ * Closes the current window.
+ *
+ * @method close
+ */
+ close : function() {
+ var t = this;
+
+ // To avoid domain relaxing issue in Opera
+ function close() {
+ t.editor.windowManager.close(window);
+ t.editor = null;
+ };
+
+ if (tinymce.isOpera)
+ t.getWin().setTimeout(close, 0);
+ else
+ close();
+ },
+
+ // Internal functions
+
+ _restoreSelection : function() {
+ var e = window.event.srcElement;
+
+ if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button'))
+ tinyMCEPopup.restoreSelection();
+ },
+
+/* _restoreSelection : function() {
+ var e = window.event.srcElement;
+
+ // If user focus a non text input or textarea
+ if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text')
+ tinyMCEPopup.restoreSelection();
+ },*/
+
+ _onDOMLoaded : function() {
+ var t = tinyMCEPopup, ti = document.title, bm, h, nv;
+
+ if (t.domLoaded)
+ return;
+
+ t.domLoaded = 1;
+
+ tinyMCEPopup.init();
+
+ // Translate page
+ if (t.features.translate_i18n !== false) {
+ h = document.body.innerHTML;
+
+ // Replace a=x with a="x" in IE
+ if (tinymce.isIE)
+ h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"')
+
+ document.dir = t.editor.getParam('directionality','');
+
+ if ((nv = t.editor.translate(h)) && nv != h)
+ document.body.innerHTML = nv;
+
+ if ((nv = t.editor.translate(ti)) && nv != ti)
+ document.title = ti = nv;
+ }
+
+ document.body.style.display = '';
+
+ // Restore selection in IE when focus is placed on a non textarea or input element of the type text
+ if (tinymce.isIE) {
+ document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection);
+
+ // Add base target element for it since it would fail with modal dialogs
+ t.dom.add(t.dom.select('head')[0], 'base', {target : '_self'});
+ }
+
+ t.restoreSelection();
+
+ // Set inline title
+ if (!t.isWindow)
+ t.editor.windowManager.setTitle(window, ti);
+ else
+ window.focus();
+
+ if (!tinymce.isIE && !t.isWindow) {
+ tinymce.dom.Event._add(document, 'focus', function() {
+ t.editor.windowManager.focus(t.id);
+ });
+ }
+
+ // Patch for accessibility
+ tinymce.each(t.dom.select('select'), function(e) {
+ e.onkeydown = tinyMCEPopup._accessHandler;
+ });
+
+ // Call onInit
+ // Init must be called before focus so the selection won't get lost by the focus call
+ tinymce.each(t.listeners, function(o) {
+ o.func.call(o.scope, t.editor);
+ });
+
+ // Move focus to window
+ if (t.getWindowArg('mce_auto_focus', true)) {
+ window.focus();
+
+ // Focus element with mceFocus class
+ tinymce.each(document.forms, function(f) {
+ tinymce.each(f.elements, function(e) {
+ if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) {
+ e.focus();
+ return false; // Break loop
+ }
+ });
+ });
+ }
+
+ document.onkeyup = tinyMCEPopup._closeWinKeyHandler;
+ },
+
+ _accessHandler : function(e) {
+ e = e || window.event;
+
+ if (e.keyCode == 13 || e.keyCode == 32) {
+ e = e.target || e.srcElement;
+
+ if (e.onchange)
+ e.onchange();
+
+ return tinymce.dom.Event.cancel(e);
+ }
+ },
+
+ _closeWinKeyHandler : function(e) {
+ e = e || window.event;
+
+ if (e.keyCode == 27)
+ tinyMCEPopup.close();
+ },
+
+ _wait : function() {
+ // Use IE method
+ if (document.attachEvent) {
+ document.attachEvent("onreadystatechange", function() {
+ if (document.readyState === "complete") {
+ document.detachEvent("onreadystatechange", arguments.callee);
+ tinyMCEPopup._onDOMLoaded();
+ }
+ });
+
+ if (document.documentElement.doScroll && window == window.top) {
+ (function() {
+ if (tinyMCEPopup.domLoaded)
+ return;
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch (ex) {
+ setTimeout(arguments.callee, 0);
+ return;
+ }
+
+ tinyMCEPopup._onDOMLoaded();
+ })();
+ }
+
+ document.attachEvent('onload', tinyMCEPopup._onDOMLoaded);
+ } else if (document.addEventListener) {
+ window.addEventListener('DOMContentLoaded', tinyMCEPopup._onDOMLoaded, false);
+ window.addEventListener('load', tinyMCEPopup._onDOMLoaded, false);
+ }
+ }
+};
--- /dev/null
+var tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=tinymce.dom;b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=false;b.id=b.features.id;b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return window},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},0)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);a.editor=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;tinyMCEPopup.init();if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};
\ No newline at end of file
});
});
+ // resize the caption <dl> when the image is soft-resized by the user (only possible in Firefox and IE)
ed.onMouseUp.add(function(ed, e) {
if ( tinymce.isWebKit || tinymce.isOpera )
return;
- if ( ed.dom.getParent(e.target, 'div.mceTemp') || ed.dom.is(e.target, 'div.mceTemp') ) {
+ if ( ed.dom.getParent(e.target, 'div.mceTemp') || ed.dom.is(e.target, 'div.mceTemp') ) {
window.setTimeout(function(){
- var ed = tinyMCE.activeEditor, n = ed.selection.getNode(), DL = ed.dom.getParent(n, 'dl.wp-caption');
+ var ed = tinyMCE.activeEditor, n = ed.selection.getNode(), DL, width;
- if ( DL && n.width != ( parseInt(ed.dom.getStyle(DL, 'width'), 10) - 10 ) ) {
- ed.dom.setStyle(DL, 'width', parseInt(n.width, 10) + 10);
- ed.execCommand('mceRepaint');
+ if ( 'IMG' == n.nodeName ) {
+ DL = ed.dom.getParent(n, 'dl.wp-caption');
+ width = ed.dom.getAttrib(n, 'width') || n.width;
+ width = parseInt(width, 10);
+
+ if ( DL && width != ( parseInt(ed.dom.getStyle(DL, 'width'), 10) - 10 ) ) {
+ ed.dom.setStyle(DL, 'width', 10 + width);
+ ed.execCommand('mceRepaint');
+ }
}
}, 100);
}
});
+ // show editimage buttons
ed.onMouseDown.add(function(ed, e) {
var p;
}
});
+ // when pressing Return inside a caption move the cursor to a new parapraph under it
ed.onKeyPress.add(function(ed, e) {
- var DL, DIV, P;
+ var n, DL, DIV, P;
- if ( e.keyCode == 13 && (DL = ed.dom.getParent(ed.selection.getNode(), 'DL')) && ed.dom.hasClass(DL, 'wp-caption') ) {
- P = ed.dom.create('p', {}, ' ');
- if ( (DIV = DL.parentNode) && DIV.nodeName == 'DIV' )
- ed.dom.insertAfter( P, DIV );
- else
- ed.dom.insertAfter( P, DL );
+ if ( e.keyCode == 13 ) {
+ n = ed.selection.getNode();
+ DL = ed.dom.getParent(n, 'dl.wp-caption');
+ DIV = ed.dom.getParent(DL, 'div.mceTemp');
- if ( P.firstChild )
- ed.selection.select(P.firstChild);
- else
- ed.selection.select(P);
-
- tinymce.dom.Event.cancel(e);
- return false;
+ if ( DL && DIV ) {
+ P = ed.dom.create('p', {}, ' ');
+ ed.dom.insertAfter( P, DIV );
+
+ if ( P.firstChild )
+ ed.selection.select(P.firstChild);
+ else
+ ed.selection.select(P);
+
+ tinymce.dom.Event.cancel(e);
+ return false;
+ }
}
});
},
_do_shcode : function(co) {
- return co.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g, function(a,b,c){
+ return co.replace(/(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?[\s\u00a0]*/g, function(a,b,c){
var id, cls, w, cap, div_cls;
b = b.replace(/\\'|\\'|\\'/g, ''').replace(/\\"|\\"/g, '"');
-(function(){tinymce.create("tinymce.plugins.wpEditImage",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_EditImage",function(){var h=a.selection.getNode(),f=tinymce.DOM.getViewPort(),g=f.h,d=(720<f.w)?720:f.w,e=a.dom.getAttrib(h,"class");if(e.indexOf("mceItem")!=-1||e.indexOf("wpGallery")!=-1||h.nodeName!="IMG"){return}tb_show("",b+"/editimage.html?ver=321&TB_iframe=true");tinymce.DOM.setStyles("TB_window",{width:(d-50)+"px",height:(g-45)+"px","margin-left":"-"+parseInt(((d-50)/2),10)+"px"});if(!tinymce.isIE6){tinymce.DOM.setStyles("TB_window",{top:"20px",marginTop:"0"})}tinymce.DOM.setStyles("TB_iframeContent",{width:(d-50)+"px",height:(g-75)+"px"});tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")});a.onInit.add(function(d){tinymce.dom.Event.add(d.getBody(),"dragstart",function(f){if(!tinymce.isGecko&&f.target.nodeName=="IMG"&&d.dom.getParent(f.target,"dl.wp-caption")){return tinymce.dom.Event.cancel(f)}})});a.onMouseUp.add(function(d,f){if(tinymce.isWebKit||tinymce.isOpera){return}if(d.dom.getParent(f.target,"div.mceTemp")||d.dom.is(f.target,"div.mceTemp")){window.setTimeout(function(){var e=tinyMCE.activeEditor,h=e.selection.getNode(),g=e.dom.getParent(h,"dl.wp-caption");if(g&&h.width!=(parseInt(e.dom.getStyle(g,"width"),10)-10)){e.dom.setStyle(g,"width",parseInt(h.width,10)+10);e.execCommand("mceRepaint")}},100)}});a.onMouseDown.add(function(d,g){var f;if(g.target.nodeName=="IMG"&&d.dom.getAttrib(g.target,"class").indexOf("mceItem")==-1){d.plugins.wordpress._showButtons(g.target,"wp_editbtns");if(tinymce.isGecko&&(f=d.dom.getParent(g.target,"dl.wp-caption"))&&d.dom.hasClass(f.parentNode,"mceTemp")){d.selection.select(f.parentNode)}}});a.onKeyPress.add(function(d,i){var f,h,g;if(i.keyCode==13&&(f=d.dom.getParent(d.selection.getNode(),"DL"))&&d.dom.hasClass(f,"wp-caption")){g=d.dom.create("p",{}," ");if((h=f.parentNode)&&h.nodeName=="DIV"){d.dom.insertAfter(g,h)}else{d.dom.insertAfter(g,f)}if(g.firstChild){d.selection.select(g.firstChild)}else{d.selection.select(g)}tinymce.dom.Event.cancel(i);return false}});a.onBeforeSetContent.add(function(d,e){e.content=c._do_shcode(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_shcode(e.content)}})},_do_shcode:function(a){return a.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g,function(g,d,k){var j,f,e,h,i;d=d.replace(/\\'|\\'|\\'/g,"'").replace(/\\"|\\"/g,""");k=k.replace(/\\'|\\'/g,"'").replace(/\\"/g,""");j=d.match(/id=['"]([^'"]+)/i);f=d.match(/align=['"]([^'"]+)/i);e=d.match(/width=['"]([0-9]+)/);h=d.match(/caption=['"]([^'"]+)/i);j=(j&&j[1])?j[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";h=(h&&h[1])?h[1]:"";if(!e||!h){return k}i=(f=="aligncenter")?"mceTemp mceIEcenter":"mceTemp";return'<div class="'+i+'" draggable><dl id="'+j+'" class="wp-caption '+f+'" style="width: '+(10+parseInt(e))+'px"><dt class="wp-caption-dt">'+k+'</dt><dd class="wp-caption-dd">'+h+"</dd></dl></div>"})},_get_shcode:function(a){return a.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['"]([^'"]+)/i);f=d.match(/class=['"]([^'"]+)/i);e=j.match(/width=['"]([0-9]+)/);i=(i&&i[1])?i[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";if(!e||!h){return j}f=f.match(/align[^ '"]+/)||"alignnone";h=h.replace(/<\S[^<>]*>/gi,"").replace(/'/g,"'").replace(/"/g,""");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},_createButtons:function(){var b=this,a=tinyMCE.activeEditor,d=tinymce.DOM,e,c;d.remove("wp_editbtns");d.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});e=d.add("wp_editbtns","img",{src:b.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.edit_img")});tinymce.dom.Event.add(e,"mousedown",function(g){var f=tinyMCE.activeEditor;f.windowManager.bookmark=f.selection.getBookmark("simple");f.execCommand("WP_EditImage")});c=d.add("wp_editbtns","img",{src:b.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.del_img")});tinymce.dom.Event.add(c,"mousedown",function(i){var f=tinyMCE.activeEditor,g=f.selection.getNode(),h;if(g.nodeName=="IMG"&&f.dom.getAttrib(g,"class").indexOf("mceItem")==-1){if((h=f.dom.getParent(g,"div"))&&f.dom.hasClass(h,"mceTemp")){f.dom.remove(h)}else{if((h=f.dom.getParent(g,"A"))&&h.childNodes.length==1){f.dom.remove(h)}else{f.dom.remove(g)}}f.execCommand("mceRepaint");return false}})},getInfo:function(){return{longname:"Edit Image",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpeditimage",tinymce.plugins.wpEditImage)})();
\ No newline at end of file
+(function(){tinymce.create("tinymce.plugins.wpEditImage",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_EditImage",function(){var h=a.selection.getNode(),f=tinymce.DOM.getViewPort(),g=f.h,d=(720<f.w)?720:f.w,e=a.dom.getAttrib(h,"class");if(e.indexOf("mceItem")!=-1||e.indexOf("wpGallery")!=-1||h.nodeName!="IMG"){return}tb_show("",b+"/editimage.html?ver=321&TB_iframe=true");tinymce.DOM.setStyles("TB_window",{width:(d-50)+"px",height:(g-45)+"px","margin-left":"-"+parseInt(((d-50)/2),10)+"px"});if(!tinymce.isIE6){tinymce.DOM.setStyles("TB_window",{top:"20px",marginTop:"0"})}tinymce.DOM.setStyles("TB_iframeContent",{width:(d-50)+"px",height:(g-75)+"px"});tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")});a.onInit.add(function(d){tinymce.dom.Event.add(d.getBody(),"dragstart",function(f){if(!tinymce.isGecko&&f.target.nodeName=="IMG"&&d.dom.getParent(f.target,"dl.wp-caption")){return tinymce.dom.Event.cancel(f)}})});a.onMouseUp.add(function(d,f){if(tinymce.isWebKit||tinymce.isOpera){return}if(d.dom.getParent(f.target,"div.mceTemp")||d.dom.is(f.target,"div.mceTemp")){window.setTimeout(function(){var e=tinyMCE.activeEditor,i=e.selection.getNode(),g,h;if("IMG"==i.nodeName){g=e.dom.getParent(i,"dl.wp-caption");h=e.dom.getAttrib(i,"width")||i.width;h=parseInt(h,10);if(g&&h!=(parseInt(e.dom.getStyle(g,"width"),10)-10)){e.dom.setStyle(g,"width",10+h);e.execCommand("mceRepaint")}}},100)}});a.onMouseDown.add(function(d,g){var f;if(g.target.nodeName=="IMG"&&d.dom.getAttrib(g.target,"class").indexOf("mceItem")==-1){d.plugins.wordpress._showButtons(g.target,"wp_editbtns");if(tinymce.isGecko&&(f=d.dom.getParent(g.target,"dl.wp-caption"))&&d.dom.hasClass(f.parentNode,"mceTemp")){d.selection.select(f.parentNode)}}});a.onKeyPress.add(function(d,i){var j,f,h,g;if(i.keyCode==13){j=d.selection.getNode();f=d.dom.getParent(j,"dl.wp-caption");h=d.dom.getParent(f,"div.mceTemp");if(f&&h){g=d.dom.create("p",{}," ");d.dom.insertAfter(g,h);if(g.firstChild){d.selection.select(g.firstChild)}else{d.selection.select(g)}tinymce.dom.Event.cancel(i);return false}}});a.onBeforeSetContent.add(function(d,e){e.content=c._do_shcode(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_shcode(e.content)}})},_do_shcode:function(a){return a.replace(/(?:<p>)?\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\](?:<\/p>)?[\s\u00a0]*/g,function(g,d,k){var j,f,e,h,i;d=d.replace(/\\'|\\'|\\'/g,"'").replace(/\\"|\\"/g,""");k=k.replace(/\\'|\\'/g,"'").replace(/\\"/g,""");j=d.match(/id=['"]([^'"]+)/i);f=d.match(/align=['"]([^'"]+)/i);e=d.match(/width=['"]([0-9]+)/);h=d.match(/caption=['"]([^'"]+)/i);j=(j&&j[1])?j[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";h=(h&&h[1])?h[1]:"";if(!e||!h){return k}i=(f=="aligncenter")?"mceTemp mceIEcenter":"mceTemp";return'<div class="'+i+'" draggable><dl id="'+j+'" class="wp-caption '+f+'" style="width: '+(10+parseInt(e))+'px"><dt class="wp-caption-dt">'+k+'</dt><dd class="wp-caption-dd">'+h+"</dd></dl></div>"})},_get_shcode:function(a){return a.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['"]([^'"]+)/i);f=d.match(/class=['"]([^'"]+)/i);e=j.match(/width=['"]([0-9]+)/);i=(i&&i[1])?i[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";if(!e||!h){return j}f=f.match(/align[^ '"]+/)||"alignnone";h=h.replace(/<\S[^<>]*>/gi,"").replace(/'/g,"'").replace(/"/g,""");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},_createButtons:function(){var b=this,a=tinyMCE.activeEditor,d=tinymce.DOM,e,c;d.remove("wp_editbtns");d.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});e=d.add("wp_editbtns","img",{src:b.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.edit_img")});tinymce.dom.Event.add(e,"mousedown",function(g){var f=tinyMCE.activeEditor;f.windowManager.bookmark=f.selection.getBookmark("simple");f.execCommand("WP_EditImage")});c=d.add("wp_editbtns","img",{src:b.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:a.getLang("wpeditimage.del_img")});tinymce.dom.Event.add(c,"mousedown",function(i){var f=tinyMCE.activeEditor,g=f.selection.getNode(),h;if(g.nodeName=="IMG"&&f.dom.getAttrib(g,"class").indexOf("mceItem")==-1){if((h=f.dom.getParent(g,"div"))&&f.dom.hasClass(h,"mceTemp")){f.dom.remove(h)}else{if((h=f.dom.getParent(g,"A"))&&h.childNodes.length==1){f.dom.remove(h)}else{f.dom.remove(g)}}f.execCommand("mceRepaint");return false}})},getInfo:function(){return{longname:"Edit Image",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpeditimage",tinymce.plugins.wpEditImage)})();
\ No newline at end of file
--- /dev/null
+#wp-link #internal-toggle{padding-right:18px;padding-left:0;}#wp-link label span{text-align:left;padding-left:5px;padding-right:0;}#wp-link .link-search-wrapper span{float:right;}#wp-link .link-search-wrapper input[type="text"]{float:right;}#wp-link .link-search-wrapper img.waiting{margin:8px 4px 0 1px;float:right;}#wp-link .link-target{margin:0 87px 0 0;}#wp-link .item-info{left:5px;right:auto;top:4px;bottom:0;}#wp-link #search-panel{float:right;}#wp-link-cancel{float:right;}#wp-link-update{float:left;}#wp-link .toggle-arrow{background-position:bottom right;}#wp-link .toggle-arrow-active{background-position:center right;}
\ No newline at end of file
--- /dev/null
+#wp-link #internal-toggle {
+ padding-right: 18px;
+ padding-left: 0;
+}
+
+#wp-link label span {
+ text-align: left;
+ padding-left: 5px;
+ padding-right: 0;
+}
+
+#wp-link .link-search-wrapper span {
+ float: right;
+}
+
+#wp-link .link-search-wrapper input[type="text"] {
+ float: right;
+}
+
+#wp-link .link-search-wrapper img.waiting {
+ margin: 8px 4px 0 1px;
+ float: right;
+}
+
+#wp-link .link-target {
+ margin: 0 87px 0 0;
+}
+
+#wp-link .item-info {
+ left: 5px;
+ right: auto;
+ top: 4px;
+ bottom: 0;
+}
+
+#wp-link #search-panel {
+ float: right;
+}
+
+#wp-link-cancel {
+ float: right;
+}
+
+#wp-link-update {
+ float: left;
+}
+
+#wp-link .toggle-arrow {
+ background-position: bottom right;
+}
+
+#wp-link .toggle-arrow-active {
+ background-position: center right;
+}
\ No newline at end of file
--- /dev/null
+#wp-link{line-height:1.4em;font-size:12px;}#wp-link ol,#wp-link ul{list-style:none;margin:0;padding:0;}#wp-link input[type="text"]{-webkit-box-sizing:border-box;}#wp-link input[type="text"],#wp-link textarea{border-width:1px;border-style:solid;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;font-size:12px;margin:1px;padding:3px;}#wp-link #link-options{padding:10px 0 14px;border-bottom:1px solid #dfdfdf;margin:0 6px 14px;}#wp-link p.howto{margin:3px;}#wp-link #internal-toggle{display:inline-block;cursor:pointer;padding-left:18px;}#wp-link .toggle-arrow{background:transparent url('../img/toggle-arrow.png') top left no-repeat;height:23px;line-height:23px;}#wp-link .toggle-arrow-active{background-position:center left;}#wp-link label input[type="text"]{width:360px;margin-top:5px;}#wp-link label span{display:inline-block;width:80px;text-align:right;padding-right:5px;}#wp-link .link-search-wrapper{margin:5px 6px 9px;display:block;overflow:hidden;}#wp-link .link-search-wrapper span{float:left;margin-top:6px;}#wp-link .link-search-wrapper input[type="text"]{float:left;width:220px;}#wp-link .link-search-wrapper img.waiting{margin:8px 1px 0 4px;float:left;display:none;}#wp-link .link-target{width:auto;padding:3px 0 0;margin:0 0 0 87px;font-size:11px;}#wp-link .query-results{border:1px #dfdfdf solid;margin:0 5px 5px;background:#fff;height:185px;overflow:auto;position:relative;}#wp-link li,#wp-link .query-notice{clear:both;margin-bottom:0;border-bottom:1px solid #f1f1f1;color:#333;padding:4px 6px;cursor:pointer;position:relative;}#wp-link li:hover{background:#eaf2fa;color:#151515;}#wp-link li.unselectable{border-bottom:1px solid #dfdfdf;}#wp-link li.unselectable:hover{background:#fff;cursor:auto;color:#333;}#wp-link li.selected{background:#ddd;color:#333;}#wp-link li.selected .item-title{font-weight:bold;}#wp-link .item-title{display:inline-block;width:80%;}#wp-link .item-info{text-transform:uppercase;color:#666;font-size:11px;position:absolute;right:5px;top:4px;bottom:0;}#wp-link #search-results{display:none;}#wp-link #search-panel{float:left;width:100%;}#wp-link .river-waiting{display:none;padding:10px 0;}#wp-link .river-waiting img.waiting{margin:0 auto;display:block;}#wp-link .submitbox{padding:5px 10px;font-size:11px;overflow:auto;height:29px;}#wp-link-cancel{line-height:25px;float:left;}#wp-link-update{line-height:23px;float:right;}
\ No newline at end of file
--- /dev/null
+#wp-link {
+ line-height: 1.4em;
+ font-size: 12px;
+}
+
+#wp-link ol,
+#wp-link ul {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+
+#wp-link input[type="text"] {
+ -webkit-box-sizing: border-box;
+}
+
+#wp-link input[type="text"],
+#wp-link textarea {
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 4px;
+ -khtml-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ border-radius: 4px;
+ font-size: 12px;
+ margin: 1px;
+ padding: 3px;
+}
+
+#wp-link #link-options {
+ padding: 10px 0 14px;
+ border-bottom: 1px solid #dfdfdf;
+ margin: 0 6px 14px;
+}
+#wp-link p.howto {
+ margin: 3px;
+}
+#wp-link #internal-toggle {
+ display: inline-block;
+ cursor: pointer;
+ padding-left: 18px;
+}
+#wp-link .toggle-arrow {
+ background: transparent url( '../img/toggle-arrow.png' ) top left no-repeat;
+ height: 23px;
+ line-height: 23px;
+}
+#wp-link .toggle-arrow-active {
+ background-position: center left;
+}
+#wp-link label input[type="text"] {
+ width: 360px;
+ margin-top: 5px;
+}
+#wp-link label span {
+ display: inline-block;
+ width: 80px;
+ text-align: right;
+ padding-right: 5px;
+}
+#wp-link .link-search-wrapper {
+ margin: 5px 6px 9px;
+ display: block;
+ overflow: hidden;
+}
+#wp-link .link-search-wrapper span {
+ float: left;
+ margin-top: 6px;
+}
+#wp-link .link-search-wrapper input[type="text"] {
+ float: left;
+ width: 220px;
+}
+#wp-link .link-search-wrapper img.waiting {
+ margin: 8px 1px 0 4px;
+ float: left;
+ display: none;
+}
+#wp-link .link-target {
+ width: auto;
+ padding: 3px 0 0;
+ margin: 0 0 0 87px;
+ font-size: 11px;
+}
+#wp-link .query-results {
+ border: 1px #dfdfdf solid;
+ margin: 0 5px 5px;
+ background: #fff;
+ height: 185px;
+ overflow: auto;
+ position: relative;
+}
+#wp-link li,
+#wp-link .query-notice {
+ clear: both;
+ margin-bottom: 0;
+ border-bottom: 1px solid #f1f1f1;
+ color: #333;
+ padding: 4px 6px;
+ cursor: pointer;
+ position: relative;
+}
+#wp-link li:hover {
+ background: #eaf2fa;
+ color: #151515;
+}
+#wp-link li.unselectable {
+ border-bottom: 1px solid #dfdfdf;
+}
+#wp-link li.unselectable:hover {
+ background: #fff;
+ cursor: auto;
+ color: #333;
+}
+#wp-link li.selected {
+ background: #ddd;
+ color: #333;
+}
+#wp-link li.selected .item-title {
+ font-weight: bold;
+}
+#wp-link .item-title {
+ display: inline-block;
+ width: 80%;
+}
+#wp-link .item-info {
+ text-transform: uppercase;
+ color: #666;
+ font-size: 11px;
+ position: absolute;
+ right: 5px;
+ top: 4px;
+ bottom: 0;
+}
+#wp-link #search-results {
+ display: none;
+}
+#wp-link #search-panel {
+ float: left;
+ width: 100%;
+}
+#wp-link .river-waiting {
+ display: none;
+ padding: 10px 0;
+}
+#wp-link .river-waiting img.waiting {
+ margin: 0 auto;
+ display: block;
+}
+#wp-link .submitbox {
+ padding: 5px 10px;
+ font-size: 11px;
+ overflow: auto;
+ height: 29px;
+}
+#wp-link-cancel {
+ line-height: 25px;
+ float: left;
+}
+#wp-link-update {
+ line-height: 23px;
+ float: right;
+}
\ No newline at end of file
--- /dev/null
+(function() {
+ tinymce.create('tinymce.plugins.wpLink', {
+ /**
+ * Initializes the plugin, this will be executed after the plugin has been created.
+ * This call is done before the editor instance has finished it's initialization so use the onInit event
+ * of the editor instance to intercept that event.
+ *
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
+ * @param {string} url Absolute URL to where the plugin is located.
+ */
+ init : function(ed, url) {
+ var disabled = true;
+
+ // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
+ ed.addCommand('WP_Link', function() {
+ if ( disabled )
+ return;
+ ed.windowManager.open({
+ id : 'wp-link',
+ width : 480,
+ height : "auto",
+ wpDialog : true,
+ title : ed.getLang('advlink.link_desc')
+ }, {
+ plugin_url : url // Plugin absolute URL
+ });
+ });
+
+ // Register example button
+ ed.addButton('link', {
+ title : ed.getLang('advanced.link_desc'),
+ cmd : 'WP_Link'
+ });
+
+ ed.addShortcut('alt+shift+a', ed.getLang('advanced.link_desc'), 'WP_Link');
+
+ ed.onNodeChange.add(function(ed, cm, n, co) {
+ disabled = co && n.nodeName != 'A';
+ });
+ },
+ /**
+ * Returns information about the plugin as a name/value array.
+ * The current keys are longname, author, authorurl, infourl and version.
+ *
+ * @return {Object} Name/value array containing information about the plugin.
+ */
+ getInfo : function() {
+ return {
+ longname : 'WordPress Link Dialog',
+ author : 'WordPress',
+ authorurl : 'http://wordpress.org',
+ infourl : '',
+ version : "1.0"
+ };
+ }
+ });
+
+ // Register plugin
+ tinymce.PluginManager.add('wplink', tinymce.plugins.wpLink);
+})();
\ No newline at end of file
--- /dev/null
+(function(){tinymce.create("tinymce.plugins.wpLink",{init:function(a,b){var c=true;a.addCommand("WP_Link",function(){if(c){return}a.windowManager.open({id:"wp-link",width:480,height:"auto",wpDialog:true,title:a.getLang("advlink.link_desc")},{plugin_url:b})});a.addButton("link",{title:a.getLang("advanced.link_desc"),cmd:"WP_Link"});a.addShortcut("alt+shift+a",a.getLang("advanced.link_desc"),"WP_Link");a.onNodeChange.add(function(e,d,g,f){c=f&&g.nodeName!="A"})},getInfo:function(){return{longname:"WordPress Link Dialog",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wplink",tinymce.plugins.wpLink)})();
\ No newline at end of file
--- /dev/null
+var wpLink;
+
+(function($){
+ var inputs = {}, rivers = {}, ed, River, Query;
+
+ wpLink = {
+ timeToTriggerRiver: 150,
+ minRiverAJAXDuration: 200,
+ riverBottomThreshold: 5,
+ keySensitivity: 100,
+ lastSearch: '',
+ init : function() {
+ inputs.dialog = $('#wp-link');
+ inputs.submit = $('#wp-link-submit');
+ // URL
+ inputs.url = $('#url-field');
+ // Secondary options
+ inputs.title = $('#link-title-field');
+ // Advanced Options
+ inputs.openInNewTab = $('#link-target-checkbox');
+ inputs.search = $('#search-field');
+ // Build Rivers
+ rivers.search = new River( $('#search-results') );
+ rivers.recent = new River( $('#most-recent-results') );
+ rivers.elements = $('.query-results', inputs.dialog);
+
+ // Bind event handlers
+ inputs.dialog.keydown( wpLink.keydown );
+ inputs.dialog.keyup( wpLink.keyup );
+ inputs.submit.click( function(e){
+ wpLink.update();
+ e.preventDefault();
+ });
+ $('#wp-link-cancel').click( wpLink.cancel );
+ $('#internal-toggle').click( wpLink.toggleInternalLinking );
+
+ rivers.elements.bind('river-select', wpLink.updateFields );
+
+ inputs.search.keyup( wpLink.searchInternalLinks );
+
+ inputs.dialog.bind('wpdialogrefresh', wpLink.refresh);
+ },
+
+ refresh : function() {
+ var e;
+ ed = tinyMCEPopup.editor;
+
+ // Refresh rivers (clear links, check visibility)
+ rivers.search.refresh();
+ rivers.recent.refresh();
+
+ tinyMCEPopup.restoreSelection();
+
+ // If link exists, select proper values.
+ if ( e = ed.dom.getParent(ed.selection.getNode(), 'A') ) {
+ // Set URL and description.
+ inputs.url.val( e.href );
+ inputs.title.val( ed.dom.getAttrib(e, 'title') );
+ // Set open in new tab.
+ if ( "_blank" == ed.dom.getAttrib(e, 'target') )
+ inputs.openInNewTab.attr('checked','checked');
+ // Update save prompt.
+ inputs.submit.val( wpLinkL10n.update );
+
+ // If there's no link, set the default values.
+ } else {
+ wpLink.setDefaultValues();
+ // Update save prompt.
+ inputs.submit.val( wpLinkL10n.save );
+ }
+
+ tinyMCEPopup.storeSelection();
+ // Focus the URL field and highlight its contents.
+ // If this is moved above the selection changes,
+ // IE will show a flashing cursor over the dialog.
+ inputs.url.focus()[0].select();
+ // Load the most recent results if this is the first time opening the panel.
+ if ( ! rivers.recent.ul.children().length )
+ rivers.recent.ajax();
+ },
+
+ cancel : function() {
+ tinyMCEPopup.close();
+ },
+
+ update : function() {
+ var ed = tinyMCEPopup.editor,
+ attrs = {
+ href : inputs.url.val(),
+ title : inputs.title.val(),
+ target : inputs.openInNewTab.attr('checked') ? '_blank' : ''
+ }, e, b;
+
+ tinyMCEPopup.restoreSelection();
+ e = ed.dom.getParent(ed.selection.getNode(), 'A');
+
+ // If the values are empty, unlink and return
+ if ( ! attrs.href || attrs.href == 'http://' ) {
+ if ( e ) {
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");
+ b = ed.selection.getBookmark();
+ ed.dom.remove(e, 1);
+ ed.selection.moveToBookmark(b);
+ tinyMCEPopup.execCommand("mceEndUndoLevel");
+ tinyMCEPopup.close();
+ }
+ return;
+ }
+
+ tinyMCEPopup.execCommand("mceBeginUndoLevel");
+
+ if (e == null) {
+ ed.getDoc().execCommand("unlink", false, null);
+ tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
+
+ tinymce.each(ed.dom.select("a"), function(n) {
+ if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {
+ e = n;
+ ed.dom.setAttribs(e, attrs);
+ }
+ });
+
+ // Sometimes WebKit lets a user create a link where
+ // they shouldn't be able to. In this case, CreateLink
+ // injects "#mce_temp_url#" into their content. Fix it.
+ if ( $(e).text() == '#mce_temp_url#' ) {
+ ed.dom.remove(e);
+ e = null;
+ }
+ } else {
+ ed.dom.setAttribs(e, attrs);
+ }
+
+ // Don't move caret if selection was image
+ if ( e && (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') ) {
+ ed.focus();
+ ed.selection.select(e);
+ ed.selection.collapse(0);
+ tinyMCEPopup.storeSelection();
+ }
+
+ tinyMCEPopup.execCommand("mceEndUndoLevel");
+ tinyMCEPopup.close();
+ },
+
+ updateFields : function( e, li, originalEvent ) {
+ inputs.url.val( li.children('.item-permalink').val() );
+ inputs.title.val( li.hasClass('no-title') ? '' : li.children('.item-title').text() );
+ if ( originalEvent && originalEvent.type == "click" )
+ inputs.url.focus();
+ },
+ setDefaultValues : function() {
+ // Set URL and description to defaults.
+ // Leave the new tab setting as-is.
+ inputs.url.val('http://');
+ inputs.title.val('');
+ },
+
+ searchInternalLinks : function() {
+ var t = $(this), waiting,
+ search = t.val();
+
+ if ( search.length > 2 ) {
+ rivers.recent.hide();
+ rivers.search.show();
+
+ // Don't search if the keypress didn't change the title.
+ if ( wpLink.lastSearch == search )
+ return;
+
+ wpLink.lastSearch = search;
+ waiting = t.siblings('img.waiting').show();
+
+ rivers.search.change( search );
+ rivers.search.ajax( function(){ waiting.hide(); });
+ } else {
+ rivers.search.hide();
+ rivers.recent.show();
+ }
+ },
+
+ next : function() {
+ rivers.search.next();
+ rivers.recent.next();
+ },
+ prev : function() {
+ rivers.search.prev();
+ rivers.recent.prev();
+ },
+
+ keydown : function( event ) {
+ var fn, key = $.ui.keyCode;
+
+ switch( event.which ) {
+ case key.UP:
+ fn = 'prev';
+ case key.DOWN:
+ fn = fn || 'next';
+ clearInterval( wpLink.keyInterval );
+ wpLink[ fn ]();
+ wpLink.keyInterval = setInterval( wpLink[ fn ], wpLink.keySensitivity );
+ break;
+ default:
+ return;
+ }
+ event.preventDefault();
+ },
+ keyup: function( event ) {
+ var key = $.ui.keyCode;
+
+ switch( event.which ) {
+ case key.ESCAPE:
+ wpLink.cancel();
+ break;
+ case key.UP:
+ case key.DOWN:
+ clearInterval( wpLink.keyInterval );
+ break;
+ default:
+ return;
+ }
+ event.preventDefault();
+ },
+
+ delayedCallback : function( func, delay ) {
+ var timeoutTriggered, funcTriggered, funcArgs, funcContext;
+
+ if ( ! delay )
+ return func;
+
+ setTimeout( function() {
+ if ( funcTriggered )
+ return func.apply( funcContext, funcArgs );
+ // Otherwise, wait.
+ timeoutTriggered = true;
+ }, delay);
+
+ return function() {
+ if ( timeoutTriggered )
+ return func.apply( this, arguments );
+ // Otherwise, wait.
+ funcArgs = arguments;
+ funcContext = this;
+ funcTriggered = true;
+ };
+ },
+
+ toggleInternalLinking : function( event ) {
+ var panel = $('#search-panel'),
+ widget = inputs.dialog.wpdialog('widget'),
+ // We're about to toggle visibility; it's currently the opposite
+ visible = !panel.is(':visible'),
+ win = $(window);
+
+ $(this).toggleClass('toggle-arrow-active', visible);
+
+ inputs.dialog.height('auto');
+ panel.slideToggle( 300, function() {
+ setUserSetting('wplink', visible ? '1' : '0');
+ inputs[ visible ? 'search' : 'url' ].focus();
+
+ // Move the box if the box is now expanded, was opened in a collapsed state,
+ // and if it needs to be moved. (Judged by bottom not being positive or
+ // bottom being smaller than top.)
+ var scroll = win.scrollTop(),
+ top = widget.offset().top,
+ bottom = top + widget.outerHeight(),
+ diff = bottom - win.height();
+
+ if ( diff > scroll ) {
+ widget.animate({'top': diff < top ? top - diff : scroll }, 200);
+ }
+ });
+ event.preventDefault();
+ }
+ }
+
+ River = function( element, search ) {
+ var self = this;
+ this.element = element;
+ this.ul = element.children('ul');
+ this.waiting = element.find('.river-waiting');
+
+ this.change( search );
+ this.refresh();
+
+ element.scroll( function(){ self.maybeLoad(); });
+ element.delegate('li', 'click', function(e){ self.select( $(this), e ); });
+ };
+
+ $.extend( River.prototype, {
+ refresh: function() {
+ this.deselect();
+ this.visible = this.element.is(':visible');
+ },
+ show: function() {
+ if ( ! this.visible ) {
+ this.deselect();
+ this.element.show();
+ this.visible = true;
+ }
+ },
+ hide: function() {
+ this.element.hide();
+ this.visible = false;
+ },
+ // Selects a list item and triggers the river-select event.
+ select: function( li, event ) {
+ var liHeight, elHeight, liTop, elTop;
+
+ if ( li.hasClass('unselectable') || li == this.selected )
+ return;
+
+ this.deselect();
+ this.selected = li.addClass('selected');
+ // Make sure the element is visible
+ liHeight = li.outerHeight();
+ elHeight = this.element.height();
+ liTop = li.position().top;
+ elTop = this.element.scrollTop();
+
+ if ( liTop < 0 ) // Make first visible element
+ this.element.scrollTop( elTop + liTop );
+ else if ( liTop + liHeight > elHeight ) // Make last visible element
+ this.element.scrollTop( elTop + liTop - elHeight + liHeight );
+
+ // Trigger the river-select event
+ this.element.trigger('river-select', [ li, event, this ]);
+ },
+ deselect: function() {
+ if ( this.selected )
+ this.selected.removeClass('selected');
+ this.selected = false;
+ },
+ prev: function() {
+ if ( ! this.visible )
+ return;
+
+ var to;
+ if ( this.selected ) {
+ to = this.selected.prev('li');
+ if ( to.length )
+ this.select( to );
+ }
+ },
+ next: function() {
+ if ( ! this.visible )
+ return;
+
+ var to = this.selected ? this.selected.next('li') : $('li:not(.unselectable):first', this.element);
+ if ( to.length )
+ this.select( to );
+ },
+ ajax: function( callback ) {
+ var self = this,
+ delay = this.query.page == 1 ? 0 : wpLink.minRiverAJAXDuration,
+ response = wpLink.delayedCallback( function( results, params ) {
+ self.process( results, params );
+ if ( callback )
+ callback( results, params );
+ }, delay );
+
+ this.query.ajax( response );
+ },
+ change: function( search ) {
+ if ( this.query && this._search == search )
+ return;
+
+ this._search = search;
+ this.query = new Query( search );
+ this.element.scrollTop(0);
+ },
+ process: function( results, params ) {
+ var list = '', alt = true, classes = '',
+ firstPage = params.page == 1;
+
+ if ( !results ) {
+ if ( firstPage ) {
+ list += '<li class="unselectable"><span class="item-title"><em>'
+ + wpLinkL10n.noMatchesFound
+ + '</em></span></li>';
+ }
+ } else {
+ $.each( results, function() {
+ classes = alt ? 'alternate' : '';
+ classes += this['title'] ? '' : ' no-title';
+ list += classes ? '<li class="' + classes + '">' : '<li>';
+ list += '<input type="hidden" class="item-permalink" value="' + this['permalink'] + '" />';
+ list += '<span class="item-title">';
+ list += this['title'] ? this['title'] : wpLinkL10n.noTitle;
+ list += '</span><span class="item-info">' + this['info'] + '</span></li>';
+ alt = ! alt;
+ });
+ }
+
+ this.ul[ firstPage ? 'html' : 'append' ]( list );
+ },
+ maybeLoad: function() {
+ var self = this,
+ el = this.element,
+ bottom = el.scrollTop() + el.height();
+
+ if ( ! this.query.ready() || bottom < this.ul.height() - wpLink.riverBottomThreshold )
+ return;
+
+ setTimeout(function() {
+ var newTop = el.scrollTop(),
+ newBottom = newTop + el.height();
+
+ if ( ! self.query.ready() || newBottom < self.ul.height() - wpLink.riverBottomThreshold )
+ return;
+
+ self.waiting.show();
+ el.scrollTop( newTop + self.waiting.outerHeight() );
+
+ self.ajax( function() { self.waiting.hide(); });
+ }, wpLink.timeToTriggerRiver );
+ }
+ });
+
+ Query = function( search ) {
+ this.page = 1;
+ this.allLoaded = false;
+ this.querying = false;
+ this.search = search;
+ };
+
+ $.extend( Query.prototype, {
+ ready: function() {
+ return !( this.querying || this.allLoaded );
+ },
+ ajax: function( callback ) {
+ var self = this,
+ query = {
+ action : 'wp-link-ajax',
+ page : this.page,
+ '_ajax_linking_nonce' : $('#_ajax_linking_nonce').val()
+ };
+
+ if ( this.search )
+ query.search = this.search;
+
+ this.querying = true;
+
+ $.post( ajaxurl, query, function(r) {
+ self.page++;
+ self.querying = false;
+ self.allLoaded = !r;
+ callback( r, query );
+ }, "json" );
+ }
+ });
+
+ $(document).ready( wpLink.init );
+})(jQuery);
\ No newline at end of file
--- /dev/null
+var wpLink;(function(f){var b={},e={},d,a,c;wpLink={timeToTriggerRiver:150,minRiverAJAXDuration:200,riverBottomThreshold:5,keySensitivity:100,lastSearch:"",init:function(){b.dialog=f("#wp-link");b.submit=f("#wp-link-submit");b.url=f("#url-field");b.title=f("#link-title-field");b.openInNewTab=f("#link-target-checkbox");b.search=f("#search-field");e.search=new a(f("#search-results"));e.recent=new a(f("#most-recent-results"));e.elements=f(".query-results",b.dialog);b.dialog.keydown(wpLink.keydown);b.dialog.keyup(wpLink.keyup);b.submit.click(function(g){wpLink.update();g.preventDefault()});f("#wp-link-cancel").click(wpLink.cancel);f("#internal-toggle").click(wpLink.toggleInternalLinking);e.elements.bind("river-select",wpLink.updateFields);b.search.keyup(wpLink.searchInternalLinks);b.dialog.bind("wpdialogrefresh",wpLink.refresh)},refresh:function(){var g;d=tinyMCEPopup.editor;e.search.refresh();e.recent.refresh();tinyMCEPopup.restoreSelection();if(g=d.dom.getParent(d.selection.getNode(),"A")){b.url.val(g.href);b.title.val(d.dom.getAttrib(g,"title"));if("_blank"==d.dom.getAttrib(g,"target")){b.openInNewTab.attr("checked","checked")}b.submit.val(wpLinkL10n.update)}else{wpLink.setDefaultValues();b.submit.val(wpLinkL10n.save)}tinyMCEPopup.storeSelection();b.url.focus()[0].select();if(!e.recent.ul.children().length){e.recent.ajax()}},cancel:function(){tinyMCEPopup.close()},update:function(){var h=tinyMCEPopup.editor,i={href:b.url.val(),title:b.title.val(),target:b.openInNewTab.attr("checked")?"_blank":""},j,g;tinyMCEPopup.restoreSelection();j=h.dom.getParent(h.selection.getNode(),"A");if(!i.href||i.href=="http://"){if(j){tinyMCEPopup.execCommand("mceBeginUndoLevel");g=h.selection.getBookmark();h.dom.remove(j,1);h.selection.moveToBookmark(g);tinyMCEPopup.execCommand("mceEndUndoLevel");tinyMCEPopup.close()}return}tinyMCEPopup.execCommand("mceBeginUndoLevel");if(j==null){h.getDoc().execCommand("unlink",false,null);tinyMCEPopup.execCommand("CreateLink",false,"#mce_temp_url#",{skip_undo:1});tinymce.each(h.dom.select("a"),function(k){if(h.dom.getAttrib(k,"href")=="#mce_temp_url#"){j=k;h.dom.setAttribs(j,i)}});if(f(j).text()=="#mce_temp_url#"){h.dom.remove(j);j=null}}else{h.dom.setAttribs(j,i)}if(j&&(j.childNodes.length!=1||j.firstChild.nodeName!="IMG")){h.focus();h.selection.select(j);h.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand("mceEndUndoLevel");tinyMCEPopup.close()},updateFields:function(i,h,g){b.url.val(h.children(".item-permalink").val());b.title.val(h.hasClass("no-title")?"":h.children(".item-title").text());if(g&&g.type=="click"){b.url.focus()}},setDefaultValues:function(){b.url.val("http://");b.title.val("")},searchInternalLinks:function(){var h=f(this),i,g=h.val();if(g.length>2){e.recent.hide();e.search.show();if(wpLink.lastSearch==g){return}wpLink.lastSearch=g;i=h.siblings("img.waiting").show();e.search.change(g);e.search.ajax(function(){i.hide()})}else{e.search.hide();e.recent.show()}},next:function(){e.search.next();e.recent.next()},prev:function(){e.search.prev();e.recent.prev()},keydown:function(i){var h,g=f.ui.keyCode;switch(i.which){case g.UP:h="prev";case g.DOWN:h=h||"next";clearInterval(wpLink.keyInterval);wpLink[h]();wpLink.keyInterval=setInterval(wpLink[h],wpLink.keySensitivity);break;default:return}i.preventDefault()},keyup:function(h){var g=f.ui.keyCode;switch(h.which){case g.ESCAPE:wpLink.cancel();break;case g.UP:case g.DOWN:clearInterval(wpLink.keyInterval);break;default:return}h.preventDefault()},delayedCallback:function(i,g){var l,k,j,h;if(!g){return i}setTimeout(function(){if(k){return i.apply(h,j)}l=true},g);return function(){if(l){return i.apply(this,arguments)}j=arguments;h=this;k=true}},toggleInternalLinking:function(h){var g=f("#search-panel"),i=b.dialog.wpdialog("widget"),k=!g.is(":visible"),j=f(window);f(this).toggleClass("toggle-arrow-active",k);b.dialog.height("auto");g.slideToggle(300,function(){setUserSetting("wplink",k?"1":"0");b[k?"search":"url"].focus();var l=j.scrollTop(),o=i.offset().top,m=o+i.outerHeight(),n=m-j.height();if(n>l){i.animate({top:n<o?o-n:l},200)}});h.preventDefault()}};a=function(i,h){var g=this;this.element=i;this.ul=i.children("ul");this.waiting=i.find(".river-waiting");this.change(h);this.refresh();i.scroll(function(){g.maybeLoad()});i.delegate("li","click",function(j){g.select(f(this),j)})};f.extend(a.prototype,{refresh:function(){this.deselect();this.visible=this.element.is(":visible")},show:function(){if(!this.visible){this.deselect();this.element.show();this.visible=true}},hide:function(){this.element.hide();this.visible=false},select:function(h,k){var j,i,l,g;if(h.hasClass("unselectable")||h==this.selected){return}this.deselect();this.selected=h.addClass("selected");j=h.outerHeight();i=this.element.height();l=h.position().top;g=this.element.scrollTop();if(l<0){this.element.scrollTop(g+l)}else{if(l+j>i){this.element.scrollTop(g+l-i+j)}}this.element.trigger("river-select",[h,k,this])},deselect:function(){if(this.selected){this.selected.removeClass("selected")}this.selected=false},prev:function(){if(!this.visible){return}var g;if(this.selected){g=this.selected.prev("li");if(g.length){this.select(g)}}},next:function(){if(!this.visible){return}var g=this.selected?this.selected.next("li"):f("li:not(.unselectable):first",this.element);if(g.length){this.select(g)}},ajax:function(j){var h=this,i=this.query.page==1?0:wpLink.minRiverAJAXDuration,g=wpLink.delayedCallback(function(k,l){h.process(k,l);if(j){j(k,l)}},i);this.query.ajax(g)},change:function(g){if(this.query&&this._search==g){return}this._search=g;this.query=new c(g);this.element.scrollTop(0)},process:function(h,l){var i="",j=true,g="",k=l.page==1;if(!h){if(k){i+='<li class="unselectable"><span class="item-title"><em>'+wpLinkL10n.noMatchesFound+"</em></span></li>"}}else{f.each(h,function(){g=j?"alternate":"";g+=this["title"]?"":" no-title";i+=g?'<li class="'+g+'">':"<li>";i+='<input type="hidden" class="item-permalink" value="'+this["permalink"]+'" />';i+='<span class="item-title">';i+=this["title"]?this["title"]:wpLinkL10n.noTitle;i+='</span><span class="item-info">'+this["info"]+"</span></li>";j=!j})}this.ul[k?"html":"append"](i)},maybeLoad:function(){var h=this,i=this.element,g=i.scrollTop()+i.height();if(!this.query.ready()||g<this.ul.height()-wpLink.riverBottomThreshold){return}setTimeout(function(){var j=i.scrollTop(),k=j+i.height();if(!h.query.ready()||k<h.ul.height()-wpLink.riverBottomThreshold){return}h.waiting.show();i.scrollTop(j+h.waiting.outerHeight());h.ajax(function(){h.waiting.hide()})},wpLink.timeToTriggerRiver)}});c=function(g){this.page=1;this.allLoaded=false;this.querying=false;this.search=g};f.extend(c.prototype,{ready:function(){return !(this.querying||this.allLoaded)},ajax:function(i){var g=this,h={action:"wp-link-ajax",page:this.page,_ajax_linking_nonce:f("#_ajax_linking_nonce").val()};if(this.search){h.search=this.search}this.querying=true;f.post(ajaxurl,h,function(j){g.page++;g.querying=false;g.allLoaded=!j;i(j,h)},"json")}});f(document).ready(wpLink.init)})(jQuery);
\ No newline at end of file
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.about_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?ver=327-1235"></script>
- <script type="text/javascript" src="js/about.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3392"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3392"></script>
+ <script type="text/javascript" src="js/about.js?ver=3392"></script>
</head>
<body id="about" style="display: none">
<div class="tabs">
<div class="mceActionPanel">
<div style="float: right">
- <input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" />
+ <input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" />
</div>
</div>
</body>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.anchor_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
- <script type="text/javascript" src="js/anchor.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3392"></script>
+ <script type="text/javascript" src="js/anchor.js?ver=3392"></script>
</head>
<body style="display: none">
<form onsubmit="AnchorDialog.update();return false;" action="#">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.charmap_title}</title>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
- <script type="text/javascript" src="js/charmap.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3392"></script>
+ <script type="text/javascript" src="js/charmap.js?ver=3392"></script>
</head>
<body id="charmap" style="display:none">
<table align="center" border="0" cellspacing="0" cellpadding="2">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.colorpicker_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?ver=327-1235"></script>
- <script type="text/javascript" src="js/color_picker.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3392"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3392"></script>
+ <script type="text/javascript" src="js/color_picker.js?ver=3392"></script>
</head>
<body id="colorpicker" style="display: none">
<form onsubmit="insertAction();return false" action="#">
-(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";if(j.settings.convert_fonts_to_spans){o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}j.onInit.add(function(){j.onNodeChange.add(l._nodeChanged,l);if(j.settings.content_css!==false){j.dom.loadCSS(j.baseURI.toAbsolute("themes/advanced/skins/"+j.settings.skin+"/content.css"))}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(j){var i=this.editor,k=i.controlManager.get("styleselect");if(k.getLength()==0){f(i.dom.getClasses(),function(l){k.add(l["class"],l["class"])})}},_createStyleSelect:function(m){var j=this,i=j.editor,k=i.controlManager,l=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(n){if(l.selectedValue===n){i.execCommand("mceSetStyleInfo",0,{command:"removeformat"});l.select();return false}else{i.execCommand("mceSetCSSClass",0,n)}}});if(l){f(i.getParam("theme_advanced_styles","","hash"),function(o,n){if(o){l.add(j.editor.translate(n),o)}});l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",j._importClasses,j);b.add(p.id+"_text","mousedown",j._importClasses,j);b.add(p.id+"_open","focus",j._importClasses,j);b.add(p.id+"_open","mousedown",j._importClasses,j)}else{b.add(p.id,"focus",j._importClasses,j)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",cmd:"FontName"});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){if(i.fontSize){k.execCommand("FontSize",false,i.fontSize)}else{f(m.settings.theme_advanced_font_sizes,function(p,o){if(p["class"]){j.push(p["class"])}});k.editorCommands._applyInlineStyle("span",{"class":i["class"]},{check_classes:j})}}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;m=j=d.create("span",{id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=d.stdMode?u.getElementsByTagName("tr"):u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_tbl");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,l){var j=this.editor,k=j.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr"),m;i=Math.max(k.theme_advanced_resizing_min_width||100,i);l=Math.max(k.theme_advanced_resizing_min_height||100,l);i=Math.min(k.theme_advanced_resizing_max_width||65535,i);l=Math.min(k.theme_advanced_resizing_max_height||65535,l);m=n.clientHeight-o.clientHeight;d.setStyle(o,"height",l-m);d.setStyles(n,{width:i,height:l})},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(n.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(w,k){var z=this,p,m,r=z.editor,A=z.settings,y,j=r.controlManager,u,l,q=[],x;x=A.theme_advanced_toolbar_align.toLowerCase();x="mce"+z._ufirst(x);l=d.add(d.add(w,"tr"),"td",{"class":"mceToolbar "+x});if(!r.getParam("accessibility_focus")){q.push(d.createHTML("a",{href:"#",onfocus:"tinyMCE.get('"+r.id+"').focus();"},"<!-- IE -->"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},"<!-- IE -->"));for(p=1;(y=A["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(A["theme_advanced_buttons"+p+"_add"]){y+=","+A["theme_advanced_buttons"+p+"_add"]}if(A["theme_advanced_buttons"+p+"_add_before"]){y=A["theme_advanced_buttons"+p+"_add_before"]+","+y}z._addControls(y,m);q.push(m.renderHTML());k.deltaHeight-=A.theme_advanced_row_height}q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row"},w.theme_advanced_path?p.translate("advanced.path")+": ":" ");d.add(k,"a",{href:"#",accesskey:"x"});if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}if(w.theme_advanced_resize_horizontal){r.style.width=Math.max(10,n.cw)+"px"}r.style.height=Math.max(10,n.ch)+"px";d.get(p.id+"_ifr").style.height=Math.max(10,parseInt(n.ch)+v.deltaHeight)+"px"})}p.onPostRender.add(function(){b.add(p.id+"_resize","mousedown",function(x){var z,t,o,s,y,r;z=d.get(p.id+"_tbl");o=z.clientWidth;s=z.clientHeight;miw=w.theme_advanced_resizing_min_width||100;mih=w.theme_advanced_resizing_min_height||100;maw=w.theme_advanced_resizing_max_width||65535;mah=w.theme_advanced_resizing_max_height||65535;t=d.add(d.get(p.id+"_parent"),"div",{"class":"mcePlaceHolder"});d.setStyles(t,{width:o,height:s});d.hide(z);d.show(t);i={x:x.screenX,y:x.screenY,w:o,h:s,dx:null,dy:null};q=b.add(d.doc,"mousemove",function(B){var n,A;i.dx=B.screenX-i.x;i.dy=B.screenY-i.y;n=Math.max(miw,i.w+i.dx);A=Math.max(mih,i.h+i.dy);n=Math.min(maw,n);A=Math.min(mah,A);if(w.theme_advanced_resize_horizontal){t.style.width=n+"px"}t.style.height=A+"px";return b.cancel(B)});u=b.add(d.doc,"mouseup",function(n){var A;b.remove(d.doc,"mousemove",q);b.remove(d.doc,"mouseup",u);z.style.display="";d.remove(t);if(i.dx===null){return}A=d.get(p.id+"_ifr");if(w.theme_advanced_resize_horizontal){z.style.width=Math.max(10,i.w+i.dx)+"px"}z.style.height=Math.max(10,i.h+i.dy)+"px";A.style.height=Math.max(10,A.clientHeight+i.dy)+"px";if(w.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+p.id+"_size",{cw:i.w+i.dx,ch:i.h+i.dy})}});return b.cancel(x)})})}j.deltaHeight-=21;k=m=null},_nodeChanged:function(l,u,k,q){var y=this,i,r=0,x,m,z=y.settings,w,j,o;if(z.readonly){return}e.each(y.stateControls,function(n){u.setActive(n,l.queryCommandState(y.controls[n][1]))});u.setActive("visualaid",l.hasVisual);u.setDisabled("undo",!l.undoManager.hasUndo()&&!l.typing);u.setDisabled("redo",!l.undoManager.hasRedo());u.setDisabled("outdent",!l.queryCommandState("Outdent"));i=d.getParent(k,"A");if(m=u.get("link")){if(!i||!i.name){m.setDisabled(!i&&q);m.setActive(!!i)}}if(m=u.get("unlink")){m.setDisabled(!i&&q);m.setActive(!!i&&!i.name)}if(m=u.get("anchor")){m.setActive(!!i&&i.name);if(e.isWebKit){i=d.getParent(k,"IMG");m.setActive(!!i&&d.getAttrib(i,"mce_name")=="a")}}i=d.getParent(k,"IMG");if(m=u.get("image")){m.setActive(!!i&&k.className.indexOf("mceItem")==-1)}if(m=u.get("styleselect")){if(k.className){y._importClasses();m.select(k.className)}else{m.select()}}if(m=u.get("formatselect")){i=d.getParent(k,d.isBlock);if(i){m.select(i.nodeName.toLowerCase())}}if(l.settings.convert_fonts_to_spans){l.dom.getParent(k,function(p){if(p.nodeName==="SPAN"){if(!w&&p.className){w=p.className}if(!j&&p.style.fontSize){j=p.style.fontSize}if(!o&&p.style.fontFamily){o=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}}return false});if(m=u.get("fontselect")){m.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==o})}if(m=u.get("fontsizeselect")){m.select(function(n){if(n.fontSize&&n.fontSize===j){return true}if(n["class"]&&n["class"]===w){return true}})}}else{if(m=u.get("fontselect")){m.select(l.queryCommandValue("FontName"))}if(m=u.get("fontsizeselect")){x=l.queryCommandValue("FontSize");m.select(function(n){return n.fontSize==x})}}if(z.theme_advanced_path&&z.theme_advanced_statusbar_location){i=d.get(l.id+"_path")||d.add(l.id+"_path_row","span",{id:l.id+"_path"});d.setHTML(i,"");l.dom.getParent(k,function(A){var p=A.nodeName.toLowerCase(),s,v,t="";if(A.nodeType!=1||A.nodeName==="BR"||(d.hasClass(A,"mceItemHidden")||d.hasClass(A,"mceItemRemoved"))){return}if(x=d.getAttrib(A,"mce_name")){p=x}if(e.isIE&&A.scopeName!=="HTML"){p=A.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(x=d.getAttrib(A,"src")){t+="src: "+x+" "}break;case"a":if(x=d.getAttrib(A,"name")){t+="name: "+x+" ";p+="#"+x}if(x=d.getAttrib(A,"href")){t+="href: "+x+" "}break;case"font":if(z.convert_fonts_to_spans){p="span"}if(x=d.getAttrib(A,"face")){t+="font: "+x+" "}if(x=d.getAttrib(A,"size")){t+="size: "+x+" "}if(x=d.getAttrib(A,"color")){t+="color: "+x+" "}break;case"span":if(x=d.getAttrib(A,"style")){t+="style: "+x+" "}break}if(x=d.getAttrib(A,"id")){t+="id: "+x+" "}if(x=A.className){x=x.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,"");if(x&&x.indexOf("mceItem")==-1){t+="class: "+x+" ";if(d.isBlock(A)||p=="img"||p=="span"){p+="."+x}}}p=p.replace(/(html:)/g,"");p={name:p,node:A,title:t};y.onResolveName.dispatch(y,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",onmousedown:"return false;",title:t,"class":"mcePath_"+(r++)},p);if(i.hasChildNodes()){i.insertBefore(d.doc.createTextNode(" \u00bb "),i.firstChild);i.insertBefore(v,i.firstChild)}else{i.appendChild(v)}},l.getBody())}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:e.baseURL+"/themes/advanced/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:e.baseURL+"/themes/advanced/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:e.baseURL+"/themes/advanced/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce));
\ No newline at end of file
+(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l)}if(j.settings.content_css!==false){j.dom.loadCSS(j.baseURI.toAbsolute(k+"/skins/"+j.settings.skin+"/content.css"))}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",attributes:{"class":n["class"]},selector:"*"});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(o){var p,n=[];f(l.items,function(q){n.push(q.value)});i.focus();i.undoManager.add();p=i.formatter.matchAll(n);if(!o||p[0]==o){i.formatter.remove(p[0])}else{i.formatter.apply(o)}i.undoManager.add();i.nodeChanged();return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r,selector:"*"});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){var m=k.items[k.selectedIndex];if(!l&&m){i.execCommand("FontName",false,m.value);return}i.execCommand("FontName",false,l);k.select(function(n){return l==n});return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){var o=n.items[n.selectedIndex];if(!i&&o){o=o.value;if(o["class"]){k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}return}if(i["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:i["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,i.fontSize)}n.select(function(p){return i==p});return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",cmd:"FormatBlock"});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;m=j=d.create("span",{id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=d.stdMode?u.getElementsByTagName("tr"):u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_tbl");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,m,k){var j=this.editor,l=this.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr");i=Math.max(l.theme_advanced_resizing_min_width||100,i);m=Math.max(l.theme_advanced_resizing_min_height||100,m);i=Math.min(l.theme_advanced_resizing_max_width||65535,i);m=Math.min(l.theme_advanced_resizing_max_height||65535,m);d.setStyle(n,"height","");d.setStyle(o,"height",m);if(l.theme_advanced_resize_horizontal){d.setStyle(n,"width","");d.setStyle(o,"width",i);if(i<n.clientWidth){i=n.clientWidth;d.setStyle(o,"width",n.clientWidth)}}if(k&&l.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+j.id+"_size",{cw:i,ch:m})}},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(n.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(w,k){var z=this,p,m,r=z.editor,A=z.settings,y,j=r.controlManager,u,l,q=[],x;x=A.theme_advanced_toolbar_align.toLowerCase();x="mce"+z._ufirst(x);l=d.add(d.add(w,"tr"),"td",{"class":"mceToolbar "+x});if(!r.getParam("accessibility_focus")){q.push(d.createHTML("a",{href:"#",onfocus:"tinyMCE.get('"+r.id+"').focus();"},"<!-- IE -->"))}q.push(d.createHTML("a",{href:"#",accesskey:"q",title:r.getLang("advanced.toolbar_focus")},"<!-- IE -->"));for(p=1;(y=A["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(A["theme_advanced_buttons"+p+"_add"]){y+=","+A["theme_advanced_buttons"+p+"_add"]}if(A["theme_advanced_buttons"+p+"_add_before"]){y=A["theme_advanced_buttons"+p+"_add_before"]+","+y}z._addControls(y,m);q.push(m.renderHTML());k.deltaHeight-=A.theme_advanced_row_height}q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row"},w.theme_advanced_path?p.translate("advanced.path")+": ":" ");d.add(k,"a",{href:"#",accesskey:"x"});if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+"_resize","click",function(n){n.preventDefault()});b.add(p.id+"_resize","mousedown",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){G.preventDefault();n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,"mousemove",t);b.remove(p.getDoc(),"mousemove",r);b.remove(d.doc,"mouseup",s);b.remove(p.getDoc(),"mouseup",o);n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E,true)}D.preventDefault();C=D.screenX;z=D.screenY;x=d.get(v.editor.id+"_ifr");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,"mousemove",y);r=b.add(p.getDoc(),"mousemove",y);s=b.add(d.doc,"mouseup",B);o=b.add(p.getDoc(),"mouseup",B)})})}j.deltaHeight-=21;k=m=null},_nodeChanged:function(r,z,l,x,j){var C=this,i,y=0,B,u,D=C.settings,A,k,w,m,q;e.each(C.stateControls,function(n){z.setActive(n,r.queryCommandState(C.controls[n][1]))});function o(p){var s,n=j.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}z.setActive("visualaid",r.hasVisual);z.setDisabled("undo",!r.undoManager.hasUndo()&&!r.typing);z.setDisabled("redo",!r.undoManager.hasRedo());z.setDisabled("outdent",!r.queryCommandState("Outdent"));i=o("A");if(u=z.get("link")){if(!i||!i.name){u.setDisabled(!i&&x);u.setActive(!!i)}}if(u=z.get("unlink")){u.setDisabled(!i&&x);u.setActive(!!i&&!i.name)}if(u=z.get("anchor")){u.setActive(!!i&&i.name)}i=o("IMG");if(u=z.get("image")){u.setActive(!!i&&l.className.indexOf("mceItem")==-1)}if(u=z.get("styleselect")){C._importClasses();m=[];f(u.items,function(n){m.push(n.value)});q=r.formatter.matchAll(m);u.select(q[0])}if(u=z.get("formatselect")){i=o(d.isBlock);if(i){u.select(i.nodeName.toLowerCase())}}o(function(p){if(p.nodeName==="SPAN"){if(!A&&p.className){A=p.className}if(!k&&p.style.fontSize){k=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}}return false});if(u=z.get("fontselect")){u.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(u=z.get("fontsizeselect")){if(D.theme_advanced_runtime_fontsize&&!k&&!A){k=r.dom.getStyle(l,"fontSize",true)}u.select(function(n){if(n.fontSize&&n.fontSize===k){return true}if(n["class"]&&n["class"]===A){return true}})}if(D.theme_advanced_path&&D.theme_advanced_statusbar_location){i=d.get(r.id+"_path")||d.add(r.id+"_path_row","span",{id:r.id+"_path"});d.setHTML(i,"");o(function(E){var p=E.nodeName.toLowerCase(),s,v,t="";if(E.nodeType!=1||E.nodeName==="BR"||(d.hasClass(E,"mceItemHidden")||d.hasClass(E,"mceItemRemoved"))){return}if(B=d.getAttrib(E,"mce_name")){p=B}if(e.isIE&&E.scopeName!=="HTML"){p=E.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(B=d.getAttrib(E,"src")){t+="src: "+B+" "}break;case"a":if(B=d.getAttrib(E,"name")){t+="name: "+B+" ";p+="#"+B}if(B=d.getAttrib(E,"href")){t+="href: "+B+" "}break;case"font":if(B=d.getAttrib(E,"face")){t+="font: "+B+" "}if(B=d.getAttrib(E,"size")){t+="size: "+B+" "}if(B=d.getAttrib(E,"color")){t+="color: "+B+" "}break;case"span":if(B=d.getAttrib(E,"style")){t+="style: "+B+" "}break}if(B=d.getAttrib(E,"id")){t+="id: "+B+" "}if(B=E.className){B=B.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(B){t+="class: "+B+" ";if(d.isBlock(E)||p=="img"||p=="span"){p+="."+B}}}p=p.replace(/(html:)/g,"");p={name:p,node:E,title:t};C.onResolveName.dispatch(C,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",onmousedown:"return false;",title:t,"class":"mcePath_"+(y++)},p);if(i.hasChildNodes()){i.insertBefore(d.doc.createTextNode(" \u00bb "),i.firstChild);i.insertBefore(v,i.firstChild)}else{i.appendChild(v)}},r.getBody())}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce));
\ No newline at end of file
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.image_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?ver=327-1235"></script>
- <script type="text/javascript" src="../../utils/form_utils.js?ver=327-1235"></script>
- <script type="text/javascript" src="js/image.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3392"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3392"></script>
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3392"></script>
+ <script type="text/javascript" src="js/image.js?ver=3392"></script>
</head>
<body id="image" style="display: none">
<form onsubmit="ImageDialog.update();return false;" action="#">
var action, elm, f = document.forms[0];
this.editor = ed;
- elm = ed.dom.getParent(ed.selection.getNode(), 'A,IMG');
+ elm = ed.dom.getParent(ed.selection.getNode(), 'A');
v = ed.dom.getAttrib(elm, 'name');
if (v) {
},
update : function() {
- var ed = this.editor;
-
+ var ed = this.editor, elm, name = document.forms[0].anchorName.value;
+
tinyMCEPopup.restoreSelection();
if (this.action != 'update')
ed.selection.collapse(1);
- // Webkit acts weird if empty inline element is inserted so we need to use a image instead
- if (tinymce.isWebKit)
- ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('img', {mce_name : 'a', name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}));
+ elm = ed.dom.getParent(ed.selection.getNode(), 'A');
+ if (elm)
+ elm.name = name;
else
- ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : document.forms[0].anchorName.value, 'class' : 'mceItemAnchor'}, ''));
+ ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, ''));
tinyMCEPopup.close();
}
+/**
+ * charmap.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
tinyMCEPopup.requireLangPack();
var charmap = [
}
// Merge
- st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st));
- this.styleVal = dom.serializeStyle(st);
+ st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img');
+ this.styleVal = dom.serializeStyle(st, 'img');
}
},
setWrap('off');
}
-var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
-
function resizeInputs() {
- var el = document.getElementById('htmlSource');
+ var vp = tinyMCEPopup.dom.getViewPort(window), el;
- if (!tinymce.isIE) {
- wHeight = self.innerHeight - 65;
- wWidth = self.innerWidth - 16;
- } else {
- wHeight = document.body.clientHeight - 70;
- wWidth = document.body.clientWidth - 16;
- }
+ el = document.getElementById('htmlSource');
- el.style.height = Math.abs(wHeight) + 'px';
- el.style.width = Math.abs(wWidth) + 'px';
+ if (el) {
+ el.style.width = (vp.w - 20) + 'px';
+ el.style.height = (vp.h - 65) + 'px';
+ }
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{#advanced_dlg.link_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
- <script type="text/javascript" src="../../utils/mctabs.js?ver=327-1235"></script>
- <script type="text/javascript" src="../../utils/form_utils.js?ver=327-1235"></script>
- <script type="text/javascript" src="../../utils/validate.js?ver=327-1235"></script>
- <script type="text/javascript" src="js/link.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3392"></script>
+ <script type="text/javascript" src="../../utils/mctabs.js?ver=3392"></script>
+ <script type="text/javascript" src="../../utils/form_utils.js?ver=3392"></script>
+ <script type="text/javascript" src="../../utils/validate.js?ver=3392"></script>
+ <script type="text/javascript" src="js/link.js?ver=3392"></script>
</head>
<body id="link" style="display: none">
<form onsubmit="LinkDialog.update();return false;" action="#">
h5 {font-size: .83em}
h6 {font-size: .75em}
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
-a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;}
-img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;}
+a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat 0 0;}
+span.mceItemNbsp {background: #DDD}
+td.mceSelected, th.mceSelected {background-color:#3399ff !important}
img {border:0;}
table {cursor:default}
table td, table th {cursor:text}
del {color:red; text-decoration:line-through}
cite {border-bottom:1px dashed blue}
acronym {border-bottom:1px dotted #CCC; cursor:help}
-abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help}
+abbr {border-bottom:1px dashed #CCC; cursor:help}
/* IE */
* html body {
scrollbar-shadow-color:#F0F0EE;
scrollbar-track-color:#F5F5F5;
}
+
+img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
+font[face=mceinline] {font-family:inherit !important}
background:url(img/buttons.png) 0 -26px;
cursor:pointer;
padding-bottom:2px;
+float:left;
}
-#insert {background:url(img/buttons.png) 0 -52px;}
-#cancel {background:url(img/buttons.png) 0 0;}
+#insert {background:url(img/buttons.png) 0 -52px}
+#cancel {background:url(img/buttons.png) 0 0; float:right}
/* Browse */
a.pickcolor, a.browse {text-decoration:none}
#colorpicker #namedcolors {width:150px;}
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
#colorpicker #colornamecontainer {margin-top:5px;}
-#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
\ No newline at end of file
+#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
.defaultSkin table td {vertical-align:middle}
/* Containers */
-.defaultSkin table {background:#F0F0EE}
+.defaultSkin table {direction:ltr; background:#F0F0EE}
.defaultSkin iframe {display:block; background:#FFF}
.defaultSkin .mceToolbar {height:26px}
.defaultSkin .mceLeft {text-align:left}
.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC}
.defaultSkin .mceStatusbar {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}
.defaultSkin .mceStatusbar div {float:left; margin:2px}
-.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize}
+.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
.defaultSkin .mceStatusbar a:hover {text-decoration:underline}
.defaultSkin table.mceToolbar {margin-left:3px}
.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px}
.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}
/* ListBox */
-.defaultSkin .mceListBox {direction:ltr}
.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}
.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}
.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr}
.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block}
.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;}
-.defaultSkin .mceSplitButton span.mceAction {width:20px; background:url(../../img/icons.gif) 20px 20px;}
+.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);}
.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;}
.defaultSkin .mceSplitButton span.mceOpen {display:none}
.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0}
/* Progress,Resize */
.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF}
.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
-.defaultSkin .mcePlaceHolder {border:1px dotted gray}
/* Formats */
.defaultSkin .mce_formatPreview a {font-size:10px}
.defaultSkin span.mce_del {background-position:-940px -20px}
.defaultSkin span.mce_ins {background-position:-960px -20px}
.defaultSkin span.mce_pagebreak {background-position:0 -40px}
-.defaultSkin .mce_spellchecker span.mceAction {background-position:-540px -20px}
+.defaultSkin span.mce_restoredraft {background-position:-20px -40px}
+.defaultSkin span.mce_spellchecker {background-position:-540px -20px}
h5 {font-size: .83em}
h6 {font-size: .75em}
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
-a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;}
-img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;}
+a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;}
+span.mceItemNbsp {background: #DDD}
+td.mceSelected, th.mceSelected {background-color:#3399ff !important}
img {border:0;}
table {cursor:default}
table td, table th {cursor:text}
del {color:red; text-decoration:line-through}
cite {border-bottom:1px dashed blue}
acronym {border-bottom:1px dotted #CCC; cursor:help}
-abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help}
+abbr {border-bottom:1px dashed #CCC; cursor:help}
/* IE */
* html body {
scrollbar-shadow-color:#F0F0EE;
scrollbar-track-color:#F5F5F5;
}
+
+img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
+font[face=mceinline] {font-family:inherit !important}
background:url(../default/img/buttons.png) 0 -26px;
cursor:pointer;
padding-bottom:2px;
+float:left;
}
-#insert {background:url(../default/img/buttons.png) 0 -52px;}
-#cancel {background:url(../default/img/buttons.png) 0 0;}
+#insert {background:url(../default/img/buttons.png) 0 -52px}
+#cancel {background:url(../default/img/buttons.png) 0 0; float:right}
/* Browse */
a.pickcolor, a.browse {text-decoration:none}
.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD}
.o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px}
.o2k7Skin .mceStatusbar div {float:left; padding:2px}
-.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize}
+.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
.o2k7Skin .mceStatusbar a:hover {text-decoration:underline}
.o2k7Skin table.mceToolbar {margin-left:3px}
.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;}
.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px}
.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)}
.o2k7Skin .mceSplitButton a.mceAction {width:22px}
-.o2k7Skin .mceSplitButton span.mceAction {width:22px; background:url(../../img/icons.gif) 20px 20px}
+.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)}
.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0}
.o2k7Skin .mceSplitButton span.mceOpen {display:none}
.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px}
/* Progress,Resize */
.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}
.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
-.o2k7Skin .mcePlaceHolder {border:1px dotted gray}
/* Formats */
.o2k7Skin .mce_formatPreview a {font-size:10px}
.o2k7Skin span.mce_del {background-position:-940px -20px}
.o2k7Skin span.mce_ins {background-position:-960px -20px}
.o2k7Skin span.mce_pagebreak {background-position:0 -40px}
-.o2k7Skin .mce_spellchecker span.mceAction {background-position:-540px -20px}
+.o2k7Skin span.mce_restoredraft {background-position:-20px -40px}
+.o2k7Skin span.mce_spellchecker {background-position:-540px -20px}
padding: 1px 2px;
}
.wp_themeSkin .mceSplitButton span.mceAction {
- background: url(../../img/icons.gif) 20px 20px;
+ background-image: url(../../img/icons.gif);
+ background-repeat: no-repeat;
+ background-color: transparent;
width:20px;
}
.wp_themeSkin .mceSplitButton a.mceOpen {
.wp_themeSkin span.mce_del {background-position:-940px -20px}
.wp_themeSkin span.mce_ins {background-position:-960px -20px}
.wp_themeSkin span.mce_pagebreak {background-position:0 -40px}
-.wp_themeSkin .mce_spellchecker span.mceAction {background-position:-540px -20px}
+.wp_themeSkin span.mce_spellchecker {background-position:-540px -20px}
/* border */
.wp_themeSkin .mceExternalToolbar,
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{#advanced_dlg.code_title}</title>
- <script type="text/javascript" src="../../tiny_mce_popup.js?ver=327-1235"></script>
- <script type="text/javascript" src="js/source_editor.js?ver=327-1235"></script>
+ <script type="text/javascript" src="../../tiny_mce_popup.js?ver=3392"></script>
+ <script type="text/javascript" src="js/source_editor.js?ver=3392"></script>
</head>
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="saveContent();return false;" action="#">
-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<a.length;h++){if(m=a[h].href){if(/^https?:\/\/[^\/]+$/.test(m)){m+="/"}f=m?m.match(/.*\//)[0]:""}}function c(d){if(d.src&&/tiny_mce(|_gzip|_jquery|_prototype)(_dev|_src)?.js/.test(d.src)){if(/_(src|dev)\.js/g.test(d.src)){o.suffix="_src"}if((e=d.src.indexOf("?"))!=-1){o.query=d.src.substring(e+1)}o.baseURL=d.src.substring(0,d.src.lastIndexOf("/"));if(f&&o.baseURL.indexOf("://")==-1&&o.baseURL.indexOf("/")!==0){o.baseURL=f+o.baseURL}return o.baseURL}return null}a=k.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}g=k.getElementsByTagName("head")[0];if(g){a=g.getElementsByTagName("script");for(h=0;h<a.length;h++){if(c(a[h])){return}}}return},is:function(b,a){var c=typeof(b);if(!a){return c!="undefined"}if(a=="array"&&(b.hasOwnProperty&&b instanceof Array)){return true}return c==a},each:function(d,a,c){var e,b;if(!d){return 0}c=c||d;if(typeof(d.length)!="undefined"){for(e=0,b=d.length;e<b;e++){if(a.call(c,d[e],e,d)===false){return 0}}}else{for(e in d){if(d.hasOwnProperty(e)){if(a.call(c,d[e],e,d)===false){return 0}}}}return 1},map:function(b,c){var d=[];tinymce.each(b,function(a){d.push(c(a))});return d},grep:function(b,c){var d=[];tinymce.each(b,function(a){if(!c||c(a)){d.push(a)}});return d},inArray:function(c,d){var e,b;if(c){for(e=0,b=c.length;e<b;e++){if(c[e]===d){return e}}}return -1},extend:function(f,d){var c,b=arguments;for(c=1;c<b.length;c++){d=b[c];tinymce.each(d,function(a,e){if(typeof(a)!=="undefined"){f[e]=a}})}return f},trim:function(a){return(a?""+a:"").replace(/^\s*|\s*$/g,"")},create:function(j,a){var i=this,b,e,f,g,d,h=0;j=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(j);f=j[3].match(/(^|\.)(\w+)$/i)[2];e=i.createNS(j[3].replace(/\.\w+$/,""));if(e[f]){return}if(j[2]=="static"){e[f]=a;if(this.onCreate){this.onCreate(j[2],j[3],e[f])}return}if(!a[f]){a[f]=function(){};h=1}e[f]=a[f];i.extend(e[f].prototype,a);if(j[5]){b=i.resolve(j[5]).prototype;g=j[5].match(/\.(\w+)$/i)[1];d=e[f];if(h){e[f]=function(){return b[g].apply(this,arguments)}}else{e[f]=function(){this.parent=b[g];return d.apply(this,arguments)}}e[f].prototype[f]=e[f];i.each(b,function(c,k){e[f].prototype[k]=b[k]});i.each(a,function(c,k){if(b[k]){e[f].prototype[k]=function(){this.parent=b[k];return c.apply(this,arguments)}}else{if(k!=f){e[f].prototype[k]=c}}})}i.each(a["static"],function(c,k){e[f][k]=c});if(this.onCreate){this.onCreate(j[2],j[3],e[f].prototype)}},walk:function(c,b,d,a){a=a||this;if(c){if(d){c=c[d]}tinymce.each(c,function(f,e){if(b.call(a,f,e,d)===false){return false}tinymce.walk(f,b,d,a)})}},createNS:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0;b<d.length;b++){a=d[b];if(!c[a]){c[a]={}}c=c[a]}return c},resolve:function(d,c){var b,a;c=c||window;d=d.split(".");for(b=0,a=d.length;b<a;b++){c=c[d[b]];if(!c){break}}return c},addUnload:function(e,d){var c=this,a=window;e={func:e,scope:d||this};if(!c.unloads){function b(){var f=c.unloads,h,i;if(f){for(i in f){h=f[i];if(h&&h.func){h.func.call(h.scope,1)}}if(a.detachEvent){a.detachEvent("onbeforeunload",g);a.detachEvent("onunload",b)}else{if(a.removeEventListener){a.removeEventListener("unload",b,false)}}c.unloads=h=f=a=b=0;if(window.CollectGarbage){window.CollectGarbage()}}}function g(){var h=document;if(h.readyState=="interactive"){function f(){h.detachEvent("onstop",f);if(b){b()}h=0}if(h){h.attachEvent("onstop",f)}window.setTimeout(function(){if(h){h.detachEvent("onstop",f)}},0)}}if(a.attachEvent){a.attachEvent("onunload",b);a.attachEvent("onbeforeunload",g)}else{if(a.addEventListener){a.addEventListener("unload",b,false)}}c.unloads=[e]}else{c.unloads.push(e)}return e},removeUnload:function(c){var a=this.unloads,b=null;tinymce.each(a,function(e,d){if(e&&e.func==c){a.splice(d,1);b=c;return false}});return b},explode:function(a,b){return a?tinymce.map(a.split(b||","),tinymce.trim):a},_addVer:function(b){var a;if(!this.query){return b}a=(b.indexOf("?")==-1?"?":"&")+this.query;if(b.indexOf("#")==-1){return b+a}return b.replace("#",a+"#")}};window.tinymce=tinymce;tinymce._init();tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=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="[";c<e.length;c++){a+=(c>0?",":"")+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+"</"+m+">"}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="<br />"+g;m.removeChild(m.firstChild)}catch(n){while(m.firstChild){m.firstChild.removeNode()}h=f.create("div");h.innerHTML="<br />"+g;e(h.childNodes,function(r,p){if(p){m.appendChild(r)}})}}if(f.settings.fix_ie_paragraphs){g=g.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 mce_keep="true"> </p>')}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(/<p ([^>]+)>|<p>/ig,'<div $1 mce_tmp="1">');g=g.replace(/<\/p>/g,"</div>");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<q.childNodes.length;h++){l.appendChild(q.childNodes[h].cloneNode(true))}q.swapNode(l)}}}}}else{m.innerHTML=g}return g})},processHTML:function(j){var g=this,i=g.settings,k=[];if(!i.process_html){return j}if(c.isGecko){j=j.replace(/<(\/?)strong>|<strong( [^>]+)>/gi,"<$1b$2>");j=j.replace(/<(\/?)em>|<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(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>");if(i.keep_values){if(/<script|noscript|style/i.test(j)){function f(h){h=h.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");h=h.replace(/^[\r\n]*|[\r\n]*$/g,"");h=h.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");h=h.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return h}j=j.replace(/<script([^>]+|)>([\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="<!--\nMCE_SCRIPT:"+(k.length-1)+"\n// -->"}return"<mce:script"+m+">"+l+"</mce:script>"});j=j.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi,function(h,m,l){if(l){k.push(f(l));l="<!--\nMCE_SCRIPT:"+(k.length-1)+"\n-->"}return"<mce:style"+m+">"+l+"</mce:style><style "+m+' mce_bogus="1">'+l+"</style>"});j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,m,l){return"<mce:noscript"+m+"><!--"+g.encode(l).replace(/--/g,"--")+"--></mce:noscript>"})}j=j.replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->");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(p<o){return -1}else{return 1}}}q=k;while(q&&q.parentNode!=m){q=q.parentNode}if(q){l=0;j=m.firstChild;while(j!=q&&l<p){l++;j=j.nextSibling}if(p<=l){return -1}else{return 1}}q=m;while(q&&q.parentNode!=k){q=q.parentNode}if(q){l=0;j=k.firstChild;while(j!=q&&l<o){l++;j=j.nextSibling}if(l<o){return -1}else{return 1}}r=this.dom.findCommonAncestor(m,k);t=m;while(t&&t.parentNode!=r){t=t.parentNode}if(!t){t=r}s=k;while(s&&s.parentNode!=r){s=s.parentNode}if(!s){s=r}if(t==s){return 0}j=r.firstChild;while(j){if(j==t){return -1}if(j==s){return 1}j=j.nextSibling}},_setEndPoint:function(k,q,p){var l=this,j,m;if(k){l.startContainer=q;l.startOffset=p}else{l.endContainer=q;l.endOffset=p}j=l.endContainer;while(j.parentNode){j=j.parentNode}m=l.startContainer;while(m.parentNode){m=m.parentNode}if(m!=j){l.collapse(k)}else{if(l._compareBoundaryPoints(l.startContainer,l.startOffset,l.endContainer,l.endOffset)>0){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;y<u.length;y++){w=u[y];if(y>0&&(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<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(x,e,y){var w,u;if(!x){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.match[v].exec(x))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");w=f.find[v](u,e,y);if(w!=null){x=x.replace(f.match[v],"");break}}}}if(!w){w=e.getElementsByTagName("*")}return{set:w,expr:x}};b.filter=function(A,z,D,t){var s=A,F=[],x=z,v,e,w=z&&z[0]&&o(z[0]);while(A&&z.length){for(var y in f.filter){if((v=f.match[y].exec(A))!=null){var r=f.filter[y],E,C;e=false;if(x==F){F=[]}if(f.preFilter[y]){v=f.preFilter[y](v,x,D,F,t,w);if(!v){e=E=true}else{if(v===true){continue}}}if(v){for(var u=0;(C=x[u])!=null;u++){if(C){E=r(C,v,u,x);var B=t^!!E;if(D&&E!=null){if(B){e=true}else{x[u]=false}}else{if(B){F.push(C);e=true}}}}}if(E!==undefined){if(!D){x=F}A=A.replace(f.match[y],"");if(!e){return[]}break}}}if(A==s){if(e==null){throw"Syntax error, unrecognized expression: "+A}else{break}}s=A}return x};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,e,w){var u=typeof e==="string",y=u&&!/\W/.test(e),v=u&&!y;if(y&&!w){e=e.toUpperCase()}for(var t=0,s=x.length,r;t<s;t++){if((r=x[t])){while((r=r.previousSibling)&&r.nodeType!==1){}x[t]=v||r&&r.nodeName===e?r||false:r===e}}if(v){b.filter(e,x,true)}},">":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<e;s++){var v=w[s];if(v){var t=v.parentNode;w[s]=t.nodeName===r?t:false}}}else{for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){w[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,w,true)}}},"":function(t,r,v){var s=i++,e=q;if(!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=i++,e=q;if(typeof r==="string"&&!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v,w){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,w,x){t=" "+t[1].replace(/\\/g,"")+" ";if(x){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(w^(v.className&&(" "+v.className+" ").indexOf(t)>=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 r<e[3]-0},gt:function(s,r,e){return r>e[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<e;t++){if(v[t]===w){return false}}return true}}}},CHILD:function(e,t){var w=t[1],r=e;switch(w){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(w=="first"){return true}r=e;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],z=t[3];if(s==1&&z==0){return true}var v=t[0],y=e.parentNode;if(y&&(y.sizcache!==v||!e.nodeIndex)){var u=0;for(r=y.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}y.sizcache=v}var x=e.nodeIndex-z;if(s==0){return x==0}else{return(x%s==0&&x/s>=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<e;s++){r.push(u[s])}}else{for(var s=0;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){n=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){var s=r.sourceIndex-e.sourceIndex;if(s===0){n=true}return s}}else{if(document.createRange){c=function(t,r){var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){n=true}return u}}}}(function(){var r=document.createElement("div"),s="script"+(new Date).getTime();r.innerHTML="<a name='"+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="<a href='#'></a>";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="<p class='TEST'></p>";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="<div class='test e'></div><div class='test'></div>";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;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName===w){u=e;break}e=e[r]}A[t]=u}}}function q(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof w!=="string"){if(e===w){u=true;break}}else{if(b.filter(w,[e]).length>0){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<r;w++){b(e,s[w],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=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<arguments.length;k++){j.push(arguments[k])}j=f[h].apply(f,j);c.update(h);return j}})},on:function(e,d,c){return a.dom.Event.add(this.id,e,d,c)},getXY:function(){return{x:parseInt(this.getStyle("left")),y:parseInt(this.getStyle("top"))}},getSize:function(){var c=this.dom.get(this.id);return{w:parseInt(this.getStyle("width")||c.clientWidth),h:parseInt(this.getStyle("height")||c.clientHeight)}},moveTo:function(c,d){this.setStyles({left:c,top:d})},moveBy:function(c,e){var d=this.getXY();this.moveTo(d.x+c,d.y+e)},resizeTo:function(c,d){this.setStyles({width:c,height:d})},resizeBy:function(c,e){var d=this.getSize();this.resizeTo(d.w+c,d.h+e)},update:function(d){var e=this,c,f=e.dom;if(a.isIE6&&e.settings.blocker){d=d||"";if(d.indexOf("get")===0||d.indexOf("has")===0||d.indexOf("is")===0){return}if(d=="remove"){f.remove(e.blocker);return}if(!e.blocker){e.blocker=f.uniqueId();c=f.add(e.settings.container||f.getRoot(),"iframe",{id:e.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});f.setStyle(c,"opacity",0)}else{c=f.get(e.blocker)}f.setStyle(c,"left",e.getStyle("left",1));f.setStyle(c,"top",e.getStyle("top",1));f.setStyle(c,"width",e.getStyle("width",1));f.setStyle(c,"height",e.getStyle("height",1));f.setStyle(c,"display",e.getStyle("display",1));f.setStyle(c,"zIndex",parseInt(e.getStyle("zIndex",1)||0)-1)}}})})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(i,g){var f=this,j=f.getRng(),l,k=f.win.document;g=g||{format:"html"};g.set=true;i=g.content=f.dom.processHTML(i);f.onBeforeSetContent.dispatch(f,g);i=g.content;if(j.insertNode){i+='<span id="__caret">_</span>';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>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/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("</"+b+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");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("<![CDATA["+b+"]]>");this.count++},writeComment:function(b){this._writeAttributesEnd();this.writeRaw("<!-- "+b+"-->");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(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}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<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(y=0;y<w.length;y++){l=i.dom.select(w[y],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){z=m(t,"LI");if(!z){z=i.dom.create("li");z.innerHTML=" ";z.appendChild(t);q.insertBefore(z,q.firstChild)}else{z.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){if(!e.isOpera||opera.buildNumber()>=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;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16);o+="\\u"+"0000".substring(k.length)+k}if(!o){n.settings.entity_encoding="raw";return}n.entitiesRE=new RegExp("["+o+"]","g");n.entityLookup=h},setValidChildRules:function(h){this.childRules=null;this.addValidChildRules(h)},addValidChildRules:function(k){var j=this,l,h,i;if(!k){return}l="A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment";h="A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment";i="H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP";f(k.split(","),function(n){var o=n.split(/\[|\]/),m;n="";f(o[1].split("|"),function(p){if(n){n+="|"}switch(p){case"%itrans":p=h;break;case"%itrans_na":p=h.substring(2);break;case"%istrict":p=l;break;case"%istrict_na":p=l.substring(2);break;case"%btrans":p=i;break;case"%bstrict":p=i;break}n+=p});m=new RegExp("^("+n.toLowerCase()+")$","i");f(o[0].split("/"),function(p){j.childRules=j.childRules||{};j.childRules[p]=m})});k="";f(j.childRules,function(n,m){if(k){k+="|"}k+=m});j.parentElementsRE=new RegExp("^("+k.toLowerCase()+")$","i")},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){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<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var w=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(w){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(r,q){var m,k=this,p,i,j,l;k._setup();q=q||{};q.format=q.format||"html";k.processObj=q;if(d){l=[];f(r.getElementsByTagName("option"),function(o){var h=k.dom.getAttrib(o,"selected");l.push(h?h:null)})}r=r.cloneNode(true);if(d){f(r.getElementsByTagName("option"),function(o,h){k.dom.setAttrib(o,"selected",l[h])})}j=r.ownerDocument.implementation;if(j.createHTMLDocument&&(e.isOpera&&opera.buildNumber()>=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[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<noscript[^>]*>)(.*?)(<\/noscript>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=j.replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1> </p>":"<p$1> </p>");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,"</$1>")}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,"</$1>\n");j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=j.replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>");if(k.entity_encoding=="raw"){j=j.replace(/<p> <\/p>|<p([^>]+)> <\/p>/g,"<p$1>\u00a0</p>")}j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return"<noscript"+p+">"+i.dom.decode(o.replace(/<!--|-->/g,""))+"</noscript>"})}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<E;F++){G=B[F];y=z._getAttrib(D,G);if(y!==null){x.writeAttribute(G.name,y)}}}if(r.validAttribsRE){B=z.dom.getAttribs(D);for(F=B.length-1;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+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(j.entitiesRE,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);h.addValidChildRules(i.valid_child_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(tinymce){var each=tinymce.each,Event=tinymce.dom.Event;tinymce.create("tinymce.dom.ScriptLoader",{ScriptLoader:function(s){this.settings=s||{};this.queue=[];this.lookup={}},isDone:function(u){return this.lookup[u]?this.lookup[u].state==2:0},markDone:function(u){this.lookup[u]={state:2,url:u}},add:function(u,cb,s,pr){var t=this,lo=t.lookup,o;if(o=lo[u]){if(cb&&o.state==2){cb.call(s||this)}return o}o={state:0,url:u,func:cb,scope:s||this};if(pr){t.queue.unshift(o)}else{t.queue.push(o)}lo[u]=o;return o},load:function(u,cb,s){var t=this,o;if(o=t.lookup[u]){if(cb&&o.state==2){cb.call(s||t)}return o}function loadScript(u){if(Event.domLoaded||t.settings.strict_mode){tinymce.util.XHR.send({url:tinymce._addVer(u),error:t.settings.error,async:false,success:function(co){t.eval(co)}})}else{document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"><\/script>')}}if(!tinymce.is(u,"string")){each(u,function(u){loadScript(u)});if(cb){cb.call(s||t)}}else{loadScript(u);if(cb){cb.call(s||t)}}},loadQueue:function(cb,s){var t=this;if(!t.queueLoading){t.queueLoading=1;t.queueCallbacks=[];t.loadScripts(t.queue,function(){t.queueLoading=0;if(cb){cb.call(s||t)}each(t.queueCallbacks,function(o){o.func.call(o.scope)})})}else{if(cb){t.queueCallbacks.push({func:cb,scope:s||t})}}},eval:function(co){var w=window;if(!w.execScript){try{eval.call(w,co)}catch(ex){eval(co,w)}}else{w.execScript(co)}},loadScripts:function(sc,cb,s){var t=this,lo=t.lookup;function done(o){o.state=2;if(o.func){o.func.call(o.scope||t)}}function allDone(){var l;l=sc.length;each(sc,function(o){o=lo[o.url];if(o.state===2){done(o);l--}else{load(o)}});if(l===0&&cb){cb.call(s||t);cb=0}}function load(o){if(o.state>0){return}o.state=1;tinymce.dom.ScriptLoader.loadScript(o.url,function(){done(o);allDone()})}each(sc,function(o){var u=o.url;if(!lo[u]){lo[u]=o;t.queue.push(o)}else{o=lo[u]}if(o.state>0){return}if(!Event.domLoaded&&!t.settings.strict_mode){var ix,ol="";if(cb||o.func){o.state=1;ix=tinymce.dom.ScriptLoader._addOnLoad(function(){done(o);allDone()});if(tinymce.isIE){ol=' onreadystatechange="'}else{ol=' onload="'}ol+="tinymce.dom.ScriptLoader._onLoad(this,'"+u+"',"+ix+');"'}document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"'+ol+"><\/script>");if(!o.func){done(o)}}else{load(o)}});allDone()},"static":{_addOnLoad:function(f){var t=this;t._funcs=t._funcs||[];t._funcs.push(f);return t._funcs.length-1},_onLoad:function(e,u,ix){if(!tinymce.isIE||e.readyState=="complete"){this._funcs[ix].call(this)}},loadScript:function(u,cb){var id=tinymce.DOM.uniqueId(),e;function done(){Event.clear(id);tinymce.DOM.remove(id);if(cb){cb.call(document,u);cb=0}}if(tinymce.isIE){tinymce.util.XHR.send({url:tinymce._addVer(u),async:false,success:function(co){window.execScript(co);done()}})}else{e=tinymce.DOM.create("script",{id:id,type:"text/javascript",src:tinymce._addVer(u)});Event.add(e,"load",done);(document.getElementsByTagName("head")[0]||document.body).appendChild(e)}}}});tinymce.ScriptLoader=new tinymce.dom.ScriptLoader()})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(w){var h,t,s;w=w.target;if(w&&(w=c.getParent(w,"tr"))){h=z.items[w.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(w&&c.hasClass(w,m+"ItemSub")){t=c.getRect(w);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(h){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(l){var i=-1,j,k=l.keyCode;e(f.items,function(m,n){if(f.selectedValue==m.value){i=n}});if(k==38){j=f.items[i-1]}else{if(k==40){j=f.items[i+1]}else{if(k==13){j=f.selectedValue;f.selectedValue=null;f.settings.onselect(j);return b.cancel(l)}}}if(j){f.hideMenu();f.select(j.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return c.get(this.id).options.length-1},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}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,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(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:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',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<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,removeformat_selector:"span,b,strong,em,i,font,u,strike"},r);q.documentBaseURI=new n.util.URI(r.document_base_url||n.documentBaseURL,{base_uri:tinyMCE.baseURI});q.baseURI=i.baseURI;q.execCallback("setup",q)},render:function(u){var v=this,w=v.settings,x=v.id,q=n.ScriptLoader;if(!k.domLoaded){k.add(document,"init",function(){v.render()});return}if(!u){w.strict_loading_mode=1;tinyMCE.settings=w}if(!v.getElement()){return}if(w.strict_loading_mode){q.settings.strict_mode=w.strict_loading_mode;n.DOM.settings.strict=1}if(!/TEXTAREA|INPUT/i.test(v.getElement().nodeName)&&w.hidden_input&&o.getParent(x,"form")){o.insertAfter(o.create("input",{type:"hidden",name:x}),x)}if(n.WindowManager){v.windowManager=new n.WindowManager(v)}if(w.encoding=="xml"){v.onGetContent.add(function(s,t){if(t.save){t.content=o.encode(t.content)}})}if(w.add_form_submit_trigger){v.onSubmit.addToTop(function(){if(v.initialized){v.save();v.isNotDirty=1}})}if(w.add_unload_trigger){v._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(v.initialized&&!v.destroyed&&!v.isHidden()){v.save({format:"raw",no_events:true})}})}n.addUnload(v.destroy,v);if(w.submit_patch){v.onBeforeRenderUI.add(function(){var s=v.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){v.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){i.triggerSave();v.isNotDirty=1;return v.formElement._mceOldSubmit(v.formElement)}}s=null})}function r(){if(w.language){q.add(n.baseURL+"/langs/"+w.language+".js")}if(w.theme&&w.theme.charAt(0)!="-"&&!h.urls[w.theme]){h.load(w.theme,"themes/"+w.theme+"/editor_template"+n.suffix+".js")}j(g(w.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(!e&&s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+n.suffix+".js")}});q.loadQueue(function(){if(!v.removed){v.init()}})}r()},init:function(){var v,F=this,G=F.settings,C,z,B=F.getElement(),r,q,D,y,A,E;i.add(F);if(G.theme){G.theme=G.theme.replace(/-/,"");r=h.get(G.theme);F.theme=new r();if(F.theme.init&&G.init_theme){F.theme.init(F,h.urls[G.theme]||n.documentBaseURL.replace(/\/$/,""))}}j(g(G.plugins.replace(/\-/g,"")),function(w){var H=c.get(w),t=c.urls[w]||n.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(F,t);F.plugins[w]=s;if(s.init){s.init(F,t)}}});if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new n.ControlManager(F);F.undoManager=new n.UndoManager(F);F.undoManager.onAdd.add(function(t,s){if(!s.initial){return F.onChange.dispatch(F,s,t)}});F.undoManager.onUndo.add(function(t,s){return F.onUndo.dispatch(F,s,t)});F.undoManager.onRedo.add(function(t,s){return F.onRedo.dispatch(F,s,t)});if(G.custom_undo_redo){F.onExecCommand.add(function(t,w,u,H,s){if(w!="Undo"&&w!="Redo"&&w!="mceRepaint"&&(!s||!s.skip_undo)){F.undoManager.add()}})}F.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){F.nodeChanged()}});if(a){function x(s,t){if(!t||!t.initial){F.execCommand("mceRepaint")}}F.onUndo.add(x);F.onRedo.add(x);F.onSetContent.add(x)}F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui){C=G.width||B.style.width||B.offsetWidth;z=G.height||B.style.height||B.offsetHeight;F.orgDisplay=B.style.display;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C)+(r.deltaWidth||0),100)}if(E.test(""+z)){z=Math.max(parseInt(z)+(r.deltaHeight||0),100)}r=F.theme.renderUI({targetNode:B,width:C,height:z,deltaWidth:G.delta_width,deltaHeight:G.delta_height});F.editorContainer=r.editorContainer}if(document.domain&&location.hostname!=document.domain){n.relaxedDomain=document.domain}o.setStyles(r.sizeContainer||r.editorContainer,{width:C,height:z});z=(r.iframeHeight||z)+(typeof(z)=="number"?(r.deltaHeight||0):"");if(z<100){z=100}F.iframeHTML=G.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(G.document_base_url!=n.documentBaseURL){F.iframeHTML+='<base href="'+F.documentBaseURI.getURI()+'" />'}F.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(n.relaxedDomain){F.iframeHTML+='<script type="text/javascript">document.domain = "'+n.relaxedDomain+'";<\/script>'}y=G.body_id||"tinymce";if(y.indexOf("=")!=-1){y=F.getParam("body_id","","hash");y=y[F.id]||y}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='</head><body id="'+y+'" class="mceContentBody '+A+'"></body></html>';if(n.relaxedDomain){if(b||(n.isOpera&&parseFloat(opera.version())>=9.5)){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(n.isOpera){D='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}v=o.add(r.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",style:{width:"100%",height:z}});F.contentAreaContainer=r.iframeContainer;o.get(r.editorContainer).style.display=F.orgDisplay;o.get(F.id).style.display="none";if(!b||!n.relaxedDomain){F.setupIframe()}B=v=r=null},setupIframe:function(){var z=this,A=z.settings,u=o.get(z.id),v=z.getDoc(),r,x;if(!b||!n.relaxedDomain){v.open();v.write(z.iframeHTML);v.close()}if(!b){try{if(!A.readonly){v.designMode="On"}}catch(w){}}if(b){x=z.getBody();o.hide(x);if(!A.readonly){x.contentEditable=true}o.show(x)}z.dom=new n.dom.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1});z.serializer=new n.dom.Serializer(f(A,{valid_elements:A.verify_html===false?"*[*]":A.valid_elements,dom:z.dom}));z.selection=new n.dom.Selection(z.dom,z.getWin(),z.serializer);z.forceBlocks=new n.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new n.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.custom_elements){function y(s,t){j(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";j(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.convert_fonts_to_spans){z._convertFonts()}if(A.inline_styles){z._convertInlineElements()}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){k.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function q(s,t){j(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){q(s)}});z.onSetContent.add(z.selection.onSetContent.add(q));if(!A.readonly){try{v.designMode="Off";v.designMode="On"}catch(w){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.undoManager.add({initial:true});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){n.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=i.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);u=null},focus:function(r){var u,q=this,s=q.settings.content_editable;if(!r){if(!s&&(!b||q.selection.getNode().ownerDocument!=q.getDoc())){q.getWin().focus()}}if(i.activeEditor!=q){if((u=i.activeEditor)!=null){u.onDeactivate.dispatch(u,q)}q.onActivate.dispatch(q,u)}i._setActive(q)},execCallback:function(v){var q=this,u=q.settings[v],r;if(!u){return}if(q.callbackLookup&&(r=q.callbackLookup[v])){u=r.func;r=r.scope}if(d(u,"string")){r=u.replace(/\.\w+$/,"");r=r?n.resolve(r):0;u=n.resolve(u);q.callbackLookup=q.callbackLookup||{};q.callbackLookup[v]={func:u,scope:r}}return u.apply(r||q,Array.prototype.slice.call(arguments,1))},translate:function(q){var t=this.settings.language||"en",r=i.i18n;if(!q){return""}return r[t+"."+q]||q.replace(/{\#([^}]+)\}/g,function(u,s){return r[t+"."+s]||"{#"+s+"}"})},getLang:function(r,q){return i.i18n[(this.settings.language||"en")+"."+r]||(d(q)?q:"{#"+r+"}")},getParam:function(w,s,q){var t=n.trim,r=d(this.settings[w])?this.settings[w]:s,u;if(q==="hash"){u={};if(d(r,"string")){j(r.indexOf("=")>0?r.split(/[;,](?![^=;,]*(?:[;,]|$))/):r.split(","),function(x){x=x.split("=");if(x.length>1){u[t(x[0])]=t(x[1])}else{u[t(x[0])]=t(x)}})}else{u=r}return u}return r},nodeChanged:function(u){var q=this,r=q.selection,v=r.getNode()||q.getBody();if(q.initialized){q.onNodeChange.dispatch(q,u?u.controlManager||q.controlManager:q.controlManager,b&&v.ownerDocument!=q.getDoc()?q.getBody():v,r.isCollapsed(),u)}},addButton:function(u,r){var q=this;q.buttons=q.buttons||{};q.buttons[u]=r},addCommand:function(t,r,q){this.execCommands[t]={func:r,scope:q||this}},addQueryStateHandler:function(t,r,q){this.queryStateCommands[t]={func:r,scope:q||this}},addQueryValueHandler:function(t,r,q){this.queryValueCommands[t]={func:r,scope:q||this}},addShortcut:function(s,v,q,u){var r=this,w;if(!r.settings.custom_shortcuts){return false}r.shortcuts=r.shortcuts||{};if(d(q,"string")){w=q;q=function(){r.execCommand(w,false,null)}}if(d(q,"object")){w=q;q=function(){r.execCommand(w[0],w[1],w[2])}}j(g(s),function(t){var x={func:q,scope:u||this,desc:v,alt:false,ctrl:false,shift:false};j(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});r.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,w,z,q){var u=this,v=0,y,r;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!q||!q.skip_focus)){u.focus()}y={};u.onBeforeExecCommand.dispatch(u,x,w,z,y);if(y.terminate){return false}if(u.execCallback("execcommand_callback",u.id,u.selection.getNode(),x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(y=u.execCommands[x]){r=y.func.call(y.scope,w,z);if(r!==true){u.onExecCommand.dispatch(u,x,w,z,q);return r}}j(u.plugins,function(s){if(s.execCommand&&s.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);v=1;return false}});if(v){return true}if(u.theme&&u.theme.execCommand&&u.theme.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(n.GlobalCommands.execCommand(u,x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}if(u.editorCommands.execCommand(x,w,z)){u.onExecCommand.dispatch(u,x,w,z,q);return true}u.getDoc().execCommand(x,w,z);u.onExecCommand.dispatch(u,x,w,z,q)},queryCommandState:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryStateCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandState(w);if(v!==-1){return v}try{return this.getDoc().queryCommandState(w)}catch(q){}},queryCommandValue:function(w){var r=this,v,u;if(r._isHidden()){return}if(v=r.queryValueCommands[w]){u=v.func.call(v.scope);if(u!==true){return u}}v=r.editorCommands.queryCommandValue(w);if(d(v)){return v}try{return this.getDoc().queryCommandValue(w)}catch(q){}},show:function(){var q=this;o.show(q.getContainer());o.hide(q.id);q.load()},hide:function(){var q=this,r=q.getDoc();if(b&&r){r.execCommand("SelectAll")}q.save();o.hide(q.getContainer());o.setStyle(q.id,"display",q.orgDisplay)},isHidden:function(){return !o.isHidden(this.id)},setProgressState:function(q,r,s){this.onSetProgressState.dispatch(this,q,r,s);return q},load:function(u){var q=this,s=q.getElement(),r;if(s){u=u||{};u.load=true;r=q.setContent(d(s.value)?s.value:s.innerHTML,u);u.element=s;if(!u.no_events){q.onLoadContent.dispatch(q,u)}u.element=s=null;return r}},save:function(v){var q=this,u=q.getElement(),r,s;if(!u||!q.initialized){return}v=v||{};v.save=true;if(!v.no_events){q.undoManager.typing=0;q.undoManager.add()}v.element=u;r=v.content=q.getContent(v);if(!v.no_events){q.onSaveContent.dispatch(q,v)}r=v.content;if(!/TEXTAREA|INPUT/i.test(u.nodeName)){u.innerHTML=r;if(s=o.getParent(q.id,"form")){j(s.elements,function(t){if(t.name==q.id){t.value=r;return false}})}}else{u.value=r}v.element=u=null;return r},setContent:function(r,s){var q=this;s=s||{};s.format=s.format||"html";s.set=true;s.content=r;if(!s.no_events){q.onBeforeSetContent.dispatch(q,s)}if(!n.isIE&&(r.length===0||/^\s+$/.test(r))){s.content=q.dom.setHTML(q.getBody(),'<br mce_bogus="1" />');s.format="raw"}s.content=q.dom.setHTML(q.getBody(),n.trim(s.content));if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;s.content=q.dom.setHTML(q.getBody(),q.serializer.serialize(q.getBody(),s))}if(!s.no_events){q.onSetContent.dispatch(q,s)}return s.content},getContent:function(s){var q=this,r;s=s||{};s.format=s.format||"html";s.get=true;if(!s.no_events){q.onBeforeGetContent.dispatch(q,s)}if(s.format!="raw"&&q.settings.cleanup){s.getInner=true;r=q.serializer.serialize(q.getBody(),s)}else{r=q.getBody().innerHTML}r=r.replace(/^\s*|\s*$/g,"");s.content=r;if(!s.no_events){q.onGetContent.dispatch(q,s)}return s.content},isDirty:function(){var q=this;return n.trim(q.startContent)!=n.trim(q.getContent({format:"raw",no_events:1}))&&!q.isNotDirty},getContainer:function(){var q=this;if(!q.container){q.container=o.get(q.editorContainer||q.id+"_parent")}return q.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return o.get(this.settings.content_element||this.id)},getWin:function(){var q=this,r;if(!q.contentWindow){r=o.get(q.id+"_ifr");if(r){q.contentWindow=r.contentWindow}}return q.contentWindow},getDoc:function(){var r=this,q;if(!r.contentDocument){q=r.getWin();if(q){r.contentDocument=q.document}}return r.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(q,x,w){var r=this,v=r.settings;if(v.urlconverter_callback){return r.execCallback("urlconverter_callback",q,w,true,x)}if(!v.convert_urls||(w&&w.nodeName=="LINK")||q.indexOf("file:")===0){return q}if(v.relative_urls){return r.documentBaseURI.toRelative(q)}q=r.documentBaseURI.toAbsolute(q,v.remove_script_host);return q},addVisual:function(u){var q=this,r=q.settings;u=u||q.getBody();if(!d(q.hasVisual)){q.hasVisual=r.visual}j(q.dom.select("table,a",u),function(t){var s;switch(t.nodeName){case"TABLE":s=q.dom.getAttrib(t,"border");if(!s||s=="0"){if(q.hasVisual){q.dom.addClass(t,r.visual_table_class)}else{q.dom.removeClass(t,r.visual_table_class)}}return;case"A":s=q.dom.getAttrib(t,"name");if(s){if(q.hasVisual){q.dom.addClass(t,"mceItemAnchor")}else{q.dom.removeClass(t,"mceItemAnchor")}}return}});q.onVisualAid.dispatch(q,u,q.hasVisual)},remove:function(){var q=this,r=q.getContainer();q.removed=1;q.hide();q.execCallback("remove_instance_callback",q);q.onRemove.dispatch(q);q.onExecCommand.listeners=[];i.remove(q);o.remove(r)},destroy:function(r){var q=this;if(q.destroyed){return}if(!r){n.removeUnload(q.destroy);tinyMCE.onBeforeUnload.remove(q._beforeUnload);if(q.theme&&q.theme.destroy){q.theme.destroy()}q.controlManager.destroy();q.selection.destroy();q.dom.destroy();if(!q.settings.content_editable){k.clear(q.getWin());k.clear(q.getDoc())}k.clear(q.getBody());k.clear(q.formElement)}if(q.formElement){q.formElement.submit=q.formElement._mceOldSubmit;q.formElement._mceOldSubmit=null}q.contentAreaContainer=q.formElement=q.container=q.settings.content_element=q.bodyElement=q.contentDocument=q.contentWindow=null;if(q.selection){q.selection=q.selection.win=q.selection.dom=q.selection.dom.doc=null}q.destroyed=1},_addEvents:function(){var w=this,v,y=w.settings,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function u(t,A){var s=t.type;if(w.removed){return}if(w.onEvent.dispatch(w,t,A)!==false){w[x[t.fakeType||t.type]].dispatch(w,t,A)}}j(x,function(t,s){switch(s){case"contextmenu":if(n.isOpera){w.dom.bind(w.getBody(),"mousedown",function(A){if(A.ctrlKey){A.fakeType="contextmenu";u(A)}})}else{w.dom.bind(w.getBody(),s,u)}break;case"paste":w.dom.bind(w.getBody(),s,function(A){u(A)});break;case"submit":case"reset":w.dom.bind(w.getElement().form||o.getParent(w.id,"form"),s,u);break;default:w.dom.bind(y.content_editable?w.getBody():w.getDoc(),s,u)}});w.dom.bind(y.content_editable?w.getBody():(a?w.getDoc():w.getWin()),"focus",function(s){w.focus(true)});if(n.isGecko){w.dom.bind(w.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("mce_src"))){t.src=w.documentBaseURI.toAbsolute(s)}})}if(a){function q(){var B=this,D=B.getDoc(),C=B.settings;if(a&&!C.readonly){if(B._isHidden()){try{if(!C.content_editable){D.designMode="On"}}catch(A){}}try{D.execCommand("styleWithCSS",0,false)}catch(A){if(!B._isHidden()){try{D.execCommand("useCSS",0,true)}catch(A){}}}if(!C.table_inline_editing){try{D.execCommand("enableInlineTableEditing",false,false)}catch(A){}}if(!C.object_resizing){try{D.execCommand("enableObjectResizing",false,false)}catch(A){}}}}w.onBeforeExecCommand.add(q);w.onMouseDown.add(q)}w.onMouseUp.add(w.nodeChanged);w.onClick.add(w.nodeChanged);w.onKeyUp.add(function(s,t){var A=t.keyCode;if((A>=33&&A<=36)||(A>=37&&A<=40)||A==13||A==45||A==46||A==8||(n.isMac&&(A==91||A==93))||t.ctrlKey){w.nodeChanged()}});w.onReset.add(function(){w.setContent(w.startContent,{format:"raw"})});if(y.custom_shortcuts){if(y.custom_undo_redo_keyboard_shortcuts){w.addShortcut("ctrl+z",w.getLang("undo_desc"),"Undo");w.addShortcut("ctrl+y",w.getLang("redo_desc"),"Redo")}if(a){w.addShortcut("ctrl+b",w.getLang("bold_desc"),"Bold");w.addShortcut("ctrl+i",w.getLang("italic_desc"),"Italic");w.addShortcut("ctrl+u",w.getLang("underline_desc"),"Underline")}for(v=1;v<=6;v++){w.addShortcut("ctrl+"+v,"",["FormatBlock",false,"<h"+v+">"])}w.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);w.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);w.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function z(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}j(w.shortcuts,function(A){if(n.isMac&&A.ctrl!=t.metaKey){return}else{if(!n.isMac&&A.ctrl!=t.ctrlKey){return}}if(A.alt!=t.altKey){return}if(A.shift!=t.shiftKey){return}if(t.keyCode==A.keyCode||(t.charCode&&t.charCode==A.charCode)){s=A;return false}});return s}w.onKeyUp.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyPress.add(function(s,t){var A=z(t);if(A){return k.cancel(t)}});w.onKeyDown.add(function(s,t){var A=z(t);if(A){A.func.call(A.scope);return k.cancel(t)}})}if(n.isIE){w.dom.bind(w.getDoc(),"controlselect",function(A){var t=w.resizeInfo,s;A=A.target;if(A.nodeName!=="IMG"){return}if(t){w.dom.unbind(t.node,t.ev,t.cb)}if(!w.dom.hasClass(A,"mceItemNoResize")){ev="resizeend";s=w.dom.bind(A,ev,function(C){var B;C=C.target;if(B=w.dom.getStyle(C,"width")){w.dom.setAttrib(C,"width",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"width","")}if(B=w.dom.getStyle(C,"height")){w.dom.setAttrib(C,"height",B.replace(/[^0-9%]+/g,""));w.dom.setStyle(C,"height","")}})}else{ev="resizestart";s=w.dom.bind(A,"resizestart",k.cancel,k)}t=w.resizeInfo={node:A,ev:ev,cb:s}});w.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(w.selection.getRng().item){w.selection.getRng().item(0).removeNode();return k.cancel(t)}}})}if(n.isOpera){w.onClick.add(function(s,t){k.prevent(t)})}if(y.custom_undo_redo){function r(){w.undoManager.typing=0;w.undoManager.add()}if(n.isIE){w.dom.bind(w.getWin(),"blur",function(s){var t;if(w.selection){t=w.selection.getNode();if(!w.removed&&t.ownerDocument&&t.ownerDocument!=w.getDoc()){r()}}})}else{w.dom.bind(w.getDoc(),"blur",function(){if(w.selection&&!w.removed){r()}})}w.onMouseDown.add(r);w.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){w.undoManager.typing=0;w.undoManager.add()}});w.onKeyDown.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45){if(w.undoManager.typing){w.undoManager.add();w.undoManager.typing=0}return}if(!w.undoManager.typing){w.undoManager.add();w.undoManager.typing=1}})}},_convertInlineElements:function(){var z=this,B=z.settings,r=z.dom,y,w,u,A,q;function x(s,t){if(!B.inline_styles){return}if(t.get){j(z.dom.select("table,u,strike",t.node),function(v){switch(v.nodeName){case"TABLE":if(y=r.getAttrib(v,"height")){r.setStyle(v,"height",y);r.setAttrib(v,"height","")}break;case"U":case"STRIKE":v.style.textDecoration=v.nodeName=="U"?"underline":"line-through";r.setAttrib(v,"mce_style","");r.setAttrib(v,"mce_name","span");break}})}else{if(t.set){j(z.dom.select("table,span",t.node).reverse(),function(v){if(v.nodeName=="TABLE"){if(y=r.getStyle(v,"height")){r.setAttrib(v,"height",y.replace(/[^0-9%]+/g,""))}}else{if(v.style.textDecoration=="underline"){u="u"}else{if(v.style.textDecoration=="line-through"){u="strike"}else{u=""}}if(u){v.style.textDecoration="";r.setAttrib(v,"mce_style","");w=r.create(u,{style:r.getAttrib(v,"style")});r.replace(w,v,1)}}})}}}z.onPreProcess.add(x);if(!B.cleanup_on_startup){z.onSetContent.add(function(s,t){if(t.initial){x(z,{node:z.getBody(),set:1})}})}},_convertFonts:function(){var w=this,x=w.settings,z=w.dom,v,r,q,u;if(!x.inline_styles){return}v=[8,10,12,14,18,24,36];r=["xx-small","x-small","small","medium","large","x-large","xx-large"];if(q=x.font_size_style_values){q=g(q)}if(u=x.font_size_classes){u=g(u)}function y(B){var C,A,t,s;if(!x.inline_styles){return}t=w.dom.select("font",B);for(s=t.length-1;s>=0;s--){C=t[s];A=z.create("span",{style:z.getAttrib(C,"style"),"class":z.getAttrib(C,"class")});z.setStyles(A,{fontFamily:z.getAttrib(C,"face"),color:z.getAttrib(C,"color"),backgroundColor:C.style.backgroundColor});if(C.size){if(q){z.setStyle(A,"fontSize",q[parseInt(C.size)-1])}else{z.setAttrib(A,"class",u[parseInt(C.size)-1])}}z.setAttrib(A,"mce_style","");z.replace(A,C,1)}}w.onPreProcess.add(function(s,t){if(t.get){y(t.node)}});w.onSetContent.add(function(s,t){if(t.initial){y(t.node)}})},_isHidden:function(){var q;if(!a){return 0}q=this.selection.getSel();return(!q||!q.rangeCount||q.rangeCount==0)},_fixNesting:function(r){var t=[],q;r=r.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(u,s,w){var v;if(s==="/"){if(!t.length){return""}if(w!==t[t.length-1].tag){for(q=t.length-1;q>=0;q--){if(t[q].tag===w){t[q].close=1;break}}return""}else{t.pop();if(t.length&&t[t.length-1].close){u=u+"</"+t[t.length-1].tag+">";t.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(w)){return u}if(/\/>$/.test(u)){return u}t.push({tag:w})}return u});for(q=t.length-1;q>=0;q--){r+="</"+t[q].tag+">"}return r}})})(tinymce);(function(d){var f=d.each,c=d.isIE,a=d.isGecko,b=d.isOpera,e=d.isWebKit;d.create("tinymce.EditorCommands",{EditorCommands:function(g){this.editor=g},execCommand:function(k,j,l){var h=this,g=h.editor,i;switch(k){case"mceResetDesignMode":case"mceBeginUndoLevel":return true;case"unlink":h.UnLink();return true;case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":h.mceJustify(k,k.substring(7).toLowerCase());return true;default:i=this[k];if(i){i.call(this,j,l);return true}}return false},Indent:function(){var g=this.editor,l=g.dom,j=g.selection,k,h,i;h=g.settings.indentation;i=/[a-z%]+$/i.exec(h);h=parseInt(h);if(g.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(j.getSelectedBlocks(),function(m){l.setStyle(m,"paddingLeft",(parseInt(m.style.paddingLeft||0)+h)+i)});return}g.getDoc().execCommand("Indent",false,null);if(c){l.getParent(j.getNode(),function(m){if(m.nodeName=="BLOCKQUOTE"){m.dir=m.style.cssText=""}})}},Outdent:function(){var h=this.editor,m=h.dom,k=h.selection,l,g,i,j;i=h.settings.indentation;j=/[a-z%]+$/i.exec(i);i=parseInt(i);if(h.settings.inline_styles&&(!this.queryStateInsertUnorderedList()&&!this.queryStateInsertOrderedList())){f(k.getSelectedBlocks(),function(n){g=Math.max(0,parseInt(n.style.paddingLeft||0)-i);m.setStyle(n,"paddingLeft",g?g+j:"")});return}h.getDoc().execCommand("Outdent",false,null)},mceSetContent:function(h,g){this.editor.setContent(g)},mceToggleVisualAid:function(){var g=this.editor;g.hasVisual=!g.hasVisual;g.addVisual()},mceReplaceContent:function(h,g){var i=this.editor.selection;i.setContent(g.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(i,h){var g=this.editor,j=g.selection,k=g.dom.getParent(j.getNode(),"a");if(d.is(h,"string")){h={href:h}}function l(m){f(h,function(o,n){g.dom.setAttrib(m,n,o)})}if(!k){g.execCommand("CreateLink",false,"javascript:mctmp(0);");f(g.dom.select("a[href=javascript:mctmp(0);]"),function(m){l(m)})}else{if(h.href){l(k)}else{g.dom.remove(k,1)}}},UnLink:function(){var g=this.editor,h=g.selection;if(h.isCollapsed()){h.select(h.getNode())}g.getDoc().execCommand("unlink",false,null);h.collapse(0)},FontName:function(i,h){var j=this,g=j.editor,k=g.selection,l;if(!h){if(k.isCollapsed()){k.select(k.getNode())}}else{if(g.settings.convert_fonts_to_spans){j._applyInlineStyle("span",{style:{fontFamily:h}})}else{g.getDoc().execCommand("FontName",false,h)}}},FontSize:function(j,i){var h=this.editor,l=h.settings,k,g;if(l.convert_fonts_to_spans&&i>=1&&i<=7){g=d.explode(l.font_size_style_values);k=d.explode(l.font_size_classes);if(k){i=k[i-1]||i}else{i=g[i-1]||i}}if(i>=1&&i<=7){h.getDoc().execCommand("FontSize",false,i)}else{this._applyInlineStyle("span",{style:{fontSize:i}})}},queryCommandValue:function(h){var g=this["queryValue"+h];if(g){return g.call(this,h)}return false},queryCommandState:function(h){var g;switch(h){case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":return this.queryStateJustify(h,h.substring(7).toLowerCase());default:if(g=this["queryState"+h]){return g.call(this,h)}}return -1},_queryState:function(h){try{return this.editor.getDoc().queryCommandState(h)}catch(g){}},_queryVal:function(h){try{return this.editor.getDoc().queryCommandValue(h)}catch(g){}},queryValueFontSize:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontSize}if(!g&&(b||e)){if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.size}return g}return g||this._queryVal("FontSize")},queryValueFontName:function(){var h=this.editor,g=0,i;if(i=h.dom.getParent(h.selection.getNode(),"font")){g=i.face}if(i=h.dom.getParent(h.selection.getNode(),"span")){g=i.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}if(!g){g=this._queryVal("FontName")}return g},mceJustify:function(o,p){var k=this.editor,m=k.selection,g=m.getNode(),q=g.nodeName,h,j,i=k.dom,l;if(k.settings.inline_styles&&this.queryStateJustify(o,p)){l=1}h=i.getParent(g,k.dom.isBlock);if(q=="IMG"){if(p=="full"){return}if(l){if(p=="center"){i.setStyle(h||g.parentNode,"textAlign","")}i.setStyle(g,"float","");this.mceRepaint();return}if(p=="center"){if(h&&/^(TD|TH)$/.test(h.nodeName)){h=0}if(!h||h.childNodes.length>1){j=i.create("p");j.appendChild(g.cloneNode(false));if(h){i.insertAfter(j,h)}else{i.insertAfter(j,g)}i.remove(g);g=j.firstChild;h=j}i.setStyle(h,"textAlign",p);i.setStyle(g,"float","")}else{i.setStyle(g,"float",p);i.setStyle(h||g.parentNode,"textAlign","")}this.mceRepaint();return}if(k.settings.inline_styles&&k.settings.forced_root_block){if(l){p=""}f(m.getSelectedBlocks(i.getParent(m.getStart(),i.isBlock),i.getParent(m.getEnd(),i.isBlock)),function(n){i.setAttrib(n,"align","");i.setStyle(n,"textAlign",p=="full"?"justify":p)});return}else{if(!l){k.getDoc().execCommand(o,false,null)}}if(k.settings.inline_styles){if(l){i.getParent(k.selection.getNode(),function(r){if(r.style&&r.style.textAlign){i.setStyle(r,"textAlign","")}});return}f(i.select("*"),function(s){var r=s.align;if(r){if(r=="full"){r="justify"}i.setStyle(s,"textAlign",r);i.setAttrib(s,"align","")}})}},mceSetCSSClass:function(h,g){this.mceSetStyleInfo(0,{command:"setattrib",name:"class",value:g})},getSelectedElement:function(){var w=this,o=w.editor,n=o.dom,s=o.selection,h=s.getRng(),l,k,u,p,j,g,q,i,x,v;if(s.isCollapsed()||h.item){return s.getNode()}v=o.settings.merge_styles_invalid_parents;if(d.is(v,"string")){v=new RegExp(v,"i")}if(c){l=h.duplicate();l.collapse(true);u=l.parentElement();k=h.duplicate();k.collapse(false);p=k.parentElement();if(u!=p){l.move("character",1);u=l.parentElement()}if(u==p){l=h.duplicate();l.moveToElementText(u);if(l.compareEndPoints("StartToStart",h)==0&&l.compareEndPoints("EndToEnd",h)==0){return v&&v.test(u.nodeName)?null:u}}}else{function m(r){return n.getParent(r,"*")}u=h.startContainer;p=h.endContainer;j=h.startOffset;g=h.endOffset;if(!h.collapsed){if(u==p){if(j-g<2){if(u.hasChildNodes()){i=u.childNodes[j];return v&&v.test(i.nodeName)?null:i}}}}if(u.nodeType!=3||p.nodeType!=3){return null}if(j==0){i=m(u);if(i&&i.firstChild!=u){i=null}}if(j==u.nodeValue.length){q=u.nextSibling;if(q&&q.nodeType==1){i=u.nextSibling}}if(g==0){q=p.previousSibling;if(q&&q.nodeType==1){x=q}}if(g==p.nodeValue.length){x=m(p);if(x&&x.lastChild!=p){x=null}}if(i==x){return v&&i&&v.test(i.nodeName)?null:i}}return null},mceSetStyleInfo:function(n,m){var q=this,h=q.editor,j=h.getDoc(),g=h.dom,i,k,r=h.selection,p=m.wrapper||"span",k=r.getBookmark(),o;function l(t,s){if(t.nodeType==1){switch(m.command){case"setattrib":return g.setAttrib(t,m.name,m.value);case"setstyle":return g.setStyle(t,m.name,m.value);case"removeformat":return g.setAttrib(t,"class","")}}}o=h.settings.merge_styles_invalid_parents;if(d.is(o,"string")){o=new RegExp(o,"i")}if((i=q.getSelectedElement())&&!h.settings.force_span_wrappers){l(i,1)}else{j.execCommand("FontName",false,"__");f(g.select("span,font"),function(u){var s,t;if(g.getAttrib(u,"face")=="__"||u.style.fontFamily==="__"){s=g.create(p,{mce_new:"1"});l(s);f(u.childNodes,function(v){s.appendChild(v.cloneNode(true))});g.replace(s,u)}})}f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!g.getAttrib(t,"mce_new")){s=g.getParent(t,"*[mce_new]");if(s){g.remove(t,1)}}});f(g.select(p).reverse(),function(t){var s=t.parentNode;if(!s||!g.getAttrib(t,"mce_new")){return}if(h.settings.force_span_wrappers&&s.nodeName!="SPAN"){return}if(s.nodeName==p.toUpperCase()&&s.childNodes.length==1){return g.remove(s,1)}if(t.nodeType==1&&(!o||!o.test(s.nodeName))&&s.childNodes.length==1){l(s);g.setAttrib(t,"class","")}});f(g.select(p).reverse(),function(s){if(g.getAttrib(s,"mce_new")||(g.getAttribs(s).length<=1&&s.className==="")){if(!g.getAttrib(s,"class")&&!g.getAttrib(s,"style")){return g.remove(s,1)}g.setAttrib(s,"mce_new","")}});r.moveToBookmark(k)},queryStateJustify:function(k,h){var g=this.editor,j=g.selection.getNode(),i=g.dom;if(j&&j.nodeName=="IMG"){if(i.getStyle(j,"float")==h){return 1}return j.parentNode.style.textAlign==h}j=i.getParent(g.selection.getStart(),function(l){return l.nodeType==1&&l.style.textAlign});if(h=="full"){h="justify"}if(g.settings.inline_styles){return(j&&j.style.textAlign==h)}return this._queryState(k)},ForeColor:function(i,h){var g=this.editor;if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{color:h}});return}else{g.getDoc().execCommand("ForeColor",false,h)}},HiliteColor:function(i,k){var h=this,g=h.editor,j=g.getDoc();if(g.settings.convert_fonts_to_spans){this._applyInlineStyle("span",{style:{backgroundColor:k}});return}function l(n){if(!a){return}try{j.execCommand("styleWithCSS",0,n)}catch(m){j.execCommand("useCSS",0,!n)}}if(a||b){l(true);j.execCommand("hilitecolor",false,k);l(false)}else{j.execCommand("BackColor",false,k)}},FormatBlock:function(n,h){var o=this,l=o.editor,p=l.selection,j=l.dom,g,k,m;function i(q){return/^(P|DIV|H[1-6]|ADDRESS|BLOCKQUOTE|PRE)$/.test(q.nodeName)}g=j.getParent(p.getNode(),function(q){return i(q)});if(g){if((c&&i(g.parentNode))||g.nodeName=="DIV"){k=l.dom.create(h);f(j.getAttribs(g),function(q){j.setAttrib(k,q.nodeName,j.getAttrib(g,q.nodeName))});m=p.getBookmark();j.replace(k,g,1);p.moveToBookmark(m);l.nodeChanged();return}}h=l.settings.forced_root_block?(h||"<p>"):h;if(h.indexOf("<")==-1){h="<"+h+">"}if(d.isGecko){h=h.replace(/<(div|blockquote|code|dt|dd|dl|samp)>/gi,"$1")}l.getDoc().execCommand("FormatBlock",false,h)},mceCleanup:function(){var h=this.editor,i=h.selection,g=i.getBookmark();h.setContent(h.getContent());i.moveToBookmark(g)},mceRemoveNode:function(j,k){var h=this.editor,i=h.selection,g,l=k||i.getNode();if(l==h.getBody()){return}g=i.getBookmark();h.dom.remove(l,1);i.moveToBookmark(g);h.nodeChanged()},mceSelectNodeDepth:function(i,j){var g=this.editor,h=g.selection,k=0;g.dom.getParent(h.getNode(),function(l){if(l.nodeType==1&&k++==j){h.select(l);g.nodeChanged();return false}},g.getBody())},mceSelectNode:function(h,g){this.editor.selection.select(g)},mceInsertContent:function(g,h){this.editor.selection.setContent(h)},mceInsertRawHTML:function(h,i){var g=this.editor;g.selection.setContent("tiny_mce_marker");g.setContent(g.getContent().replace(/tiny_mce_marker/g,i))},mceRepaint:function(){var i,g,j=this.editor;if(d.isGecko){try{i=j.selection;g=i.getBookmark(true);if(i.getSel()){i.getSel().selectAllChildren(j.getBody())}i.collapse(true);i.moveToBookmark(g)}catch(h){}}},queryStateUnderline:function(){var g=this.editor,h=g.selection.getNode();if(h&&h.nodeName=="A"){return false}return this._queryState("Underline")},queryStateOutdent:function(){var g=this.editor,h;if(g.settings.inline_styles){if((h=g.dom.getParent(g.selection.getStart(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}if((h=g.dom.getParent(g.selection.getEnd(),g.dom.isBlock))&&parseInt(h.style.paddingLeft)>0){return true}}return this.queryStateInsertUnorderedList()||this.queryStateInsertOrderedList()||(!g.settings.inline_styles&&!!g.dom.getParent(g.selection.getNode(),"BLOCKQUOTE"))},queryStateInsertUnorderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),"UL")},queryStateInsertOrderedList:function(){return this.editor.dom.getParent(this.editor.selection.getNode(),"OL")},queryStatemceBlockQuote:function(){return !!this.editor.dom.getParent(this.editor.selection.getStart(),function(g){return g.nodeName==="BLOCKQUOTE"})},_applyInlineStyle:function(o,j,m){var q=this,n=q.editor,l=n.dom,i,p={},k,r;o=o.toUpperCase();if(m&&m.check_classes&&j["class"]){m.check_classes.push(j["class"])}function h(){f(l.select(o).reverse(),function(t){var s=0;f(l.getAttribs(t),function(u){if(u.nodeName.substring(0,1)!="_"&&l.getAttrib(t,u.nodeName)!=""){s++}});if(s==0){l.remove(t,1)}})}function g(){var s;f(l.select("span,font"),function(t){if(t.style.fontFamily=="mceinline"||t.face=="mceinline"){if(!s){s=n.selection.getBookmark()}j._mce_new="1";l.replace(l.create(o,j),t,1)}});f(l.select(o+"[_mce_new]"),function(u){function t(v){if(v.nodeType==1){f(j.style,function(x,w){l.setStyle(v,w,"")});if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(v,w)}})}}}f(l.select(o,u),t);if(u.parentNode&&u.parentNode.nodeType==1&&u.parentNode.childNodes.length==1){t(u.parentNode)}l.getParent(u.parentNode,function(v){if(v.nodeType==1){if(j.style){f(j.style,function(y,x){var w;if(!p[x]&&(w=l.getStyle(v,x))){if(w===y){l.setStyle(u,x,"")}p[x]=1}})}if(j["class"]&&v.className&&m){f(m.check_classes,function(w){if(l.hasClass(v,w)){l.removeClass(u,w)}})}}return false});u.removeAttribute("_mce_new")});h();n.selection.moveToBookmark(s);return !!s}n.focus();n.getDoc().execCommand("FontName",false,"mceinline");g();if(k=q._applyInlineStyle.keyhandler){n.onKeyUp.remove(k);n.onKeyPress.remove(k);n.onKeyDown.remove(k);n.onSetContent.remove(q._applyInlineStyle.chandler)}if(n.selection.isCollapsed()){if(!c){f(l.getParents(n.selection.getNode(),"span"),function(s){f(j.style,function(u,t){var w;if(w=l.getStyle(s,t)){if(w==u){l.setStyle(s,t,"");r=2;return false}r=1;return false}});if(r){return false}});if(r==2){i=n.selection.getBookmark();h();n.selection.moveToBookmark(i);window.setTimeout(function(){n.nodeChanged()},1);return}}q._pendingStyles=d.extend(q._pendingStyles||{},j.style);q._applyInlineStyle.chandler=n.onSetContent.add(function(){delete q._pendingStyles});q._applyInlineStyle.keyhandler=k=function(s){if(q._pendingStyles){j.style=q._pendingStyles;delete q._pendingStyles}if(g()){n.onKeyDown.remove(q._applyInlineStyle.keyhandler);n.onKeyPress.remove(q._applyInlineStyle.keyhandler)}if(s.type=="keyup"){n.onKeyUp.remove(q._applyInlineStyle.keyhandler)}};n.onKeyDown.add(k);n.onKeyPress.add(k);n.onKeyUp.add(k)}else{q._pendingStyles=0}}})})(tinymce);(function(a){a.create("tinymce.UndoManager",{index:0,data:null,typing:0,UndoManager:function(c){var d=this,b=a.util.Dispatcher;d.editor=c;d.data=[];d.onAdd=new b(this);d.onUndo=new b(this);d.onRedo=new b(this)},add:function(d){var g=this,f,e=g.editor,c,h=e.settings,j;d=d||{};d.content=d.content||e.getContent({format:"raw",no_events:1});d.content=d.content.replace(/^\s*|\s*$/g,"");j=g.data[g.index>0&&(g.index==0||g.index==g.data.length)?g.index-1:g.index];if(!d.initial&&j&&d.content==j.content){return null}if(h.custom_undo_redo_levels){if(g.data.length>h.custom_undo_redo_levels){for(f=0;f<g.data.length-1;f++){g.data[f]=g.data[f+1]}g.data.length--;g.index=g.data.length}}if(h.custom_undo_redo_restore_selection&&!d.initial){d.bookmark=c=d.bookmark||e.selection.getBookmark()}if(g.index<g.data.length){g.index++}if(g.data.length===0&&!d.initial){return null}g.data.length=g.index+1;g.data[g.index++]=d;if(d.initial){g.index=0}if(g.data.length==2&&g.data[0].initial){g.data[0].bookmark=c}g.onAdd.dispatch(g,d);e.isNotDirty=0;return d},undo:function(){var e=this,c=e.editor,b=b,d;if(e.typing){e.add();e.typing=0}if(e.index>0){if(e.index==e.data.length&&e.index>1){d=e.index;e.typing=0;if(!e.add()){e.index=d}--e.index}b=e.data[--e.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);e.onUndo.dispatch(e,b)}return b},redo:function(){var d=this,c=d.editor,b=null;if(d.index<d.data.length-1){b=d.data[++d.index];c.setContent(b.content,{format:"raw"});c.selection.moveToBookmark(b.bookmark);d.onRedo.dispatch(d,b)}return b},clear:function(){var b=this;b.data=[];b.index=0;b.typing=0;b.add({initial:true})},hasUndo:function(){return this.index!=0||this.typing},hasRedo:function(){return this.index<this.data.length-1}})})(tinymce);(function(i){var h,c,a,b,g,f;h=i.dom.Event;c=i.isIE;a=i.isGecko;b=i.isOpera;g=i.each;f=i.extend;function e(k,l){var j=l.ownerDocument.createRange();j.setStart(k.endContainer,k.endOffset);j.setEndAfter(l);return j.cloneContents().textContent.length==0}function d(j){j=j.innerHTML;j=j.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");j=j.replace(/<[^>]+>/g,"");return j.replace(/[ \t\r\n]+/g,"")==""}i.create("tinymce.ForceBlocks",{ForceBlocks:function(k){var l=this,m=k.settings,n;l.editor=k;l.dom=k.dom;n=(m.forced_root_block||"p").toLowerCase();m.element=n.toUpperCase();k.onPreInit.add(l.setup,l);l.reOpera=new RegExp("(\\u00a0| | )</"+n+">","gi");l.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,n),"gi");l.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,n),"gi");l.reNbsp2BR2=new RegExp("<%p()([^>]+)>( | )<\\/%p>|<%p>( | )<\\/%p>".replace(/%p/g,n),"gi");l.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,n),"gi");function j(p,q){if(b){q.content=q.content.replace(l.reOpera,"</"+n+">")}q.content=q.content.replace(l.rePadd,"<"+n+"$1$2$3$4$5$6>\u00a0</"+n+">");if(!c&&!b&&q.set){q.content=q.content.replace(l.reNbsp2BR1,"<"+n+"$1$2><br /></"+n+">");q.content=q.content.replace(l.reNbsp2BR2,"<"+n+"$1$2><br /></"+n+">")}else{q.content=q.content.replace(l.reBR2Nbsp,"<"+n+"$1$2>\u00a0</"+n+">")}}k.onBeforeSetContent.add(j);k.onPostProcess.add(j);if(m.forced_root_block){k.onInit.add(l.forceRoots,l);k.onSetContent.add(l.forceRoots,l);k.onBeforeGetContent.add(l.forceRoots,l)}},setup:function(){var k=this,j=k.editor,l=j.settings;if(l.forced_root_block){j.onKeyUp.add(k.forceRoots,k);j.onPreProcess.add(k.forceRoots,k)}if(l.force_br_newlines){if(c){j.onKeyPress.add(function(o,q){var r,p=o.selection;if(q.keyCode==13&&p.getNode().nodeName!="LI"){p.setContent('<br id="__" /> ',{format:"raw"});r=o.dom.get("__");r.removeAttribute("id");p.select(r);p.collapse();return h.cancel(q)}})}return}if(!c&&l.force_p_newlines){j.onKeyPress.add(function(n,o){if(o.keyCode==13&&!o.shiftKey){if(!k.insertPara(o)){h.cancel(o)}}});if(a){j.onKeyDown.add(function(n,o){if((o.keyCode==8||o.keyCode==46)&&!o.shiftKey){k.backspaceDelete(o,o.keyCode==8)}})}}function m(o,n){var p=j.dom.create(n);g(o.attributes,function(q){if(q.specified&&q.nodeValue){p.setAttribute(q.nodeName.toLowerCase(),q.nodeValue)}});g(o.childNodes,function(q){p.appendChild(q.cloneNode(true))});o.parentNode.replaceChild(p,o);return p}j.onPreProcess.add(function(n,p){g(n.dom.select("p,h1,h2,h3,h4,h5,h6,div",p.node),function(o){if(d(o)){g(n.dom.select("span,em,strong,b,i",p.node),function(q){if(!q.hasChildNodes()){q.appendChild(n.getDoc().createTextNode("\u00a0"));return false}})}})});if(c){if(l.element!="P"){j.onKeyPress.add(function(n,o){k.lastElm=n.selection.getNode().nodeName});j.onKeyUp.add(function(p,r){var t,q=p.selection,s=q.getNode(),o=p.getBody();if(o.childNodes.length===1&&s.nodeName=="P"){s=m(s,l.element);q.select(s);q.collapse();p.nodeChanged()}else{if(r.keyCode==13&&!r.shiftKey&&k.lastElm!="P"){t=p.dom.getParent(s,"p");if(t){m(t,l.element);p.nodeChanged()}}}})}}},find:function(p,l,m){var k=this.editor,j=k.getDoc().createTreeWalker(p,4,null,false),o=-1;while(p=j.nextNode()){o++;if(l==0&&p==m){return o}if(l==1&&o==m){return p}}return -1},forceRoots:function(p,D){var u=this,p=u.editor,H=p.getBody(),E=p.getDoc(),K=p.selection,v=K.getSel(),w=K.getRng(),I=-2,o,B,j,k,F=-16777215;var G,l,J,A,x,m=H.childNodes,z,y,q;for(z=m.length-1;z>=0;z--){G=m[z];if(G.nodeType===3||(!u.dom.isBlock(G)&&G.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test(G.nodeName))){if(!l){if(G.nodeType!=3||/[^\s]/g.test(G.nodeValue)){if(I==-2&&w){if(!c){if(w.startContainer.nodeType==1&&(y=w.startContainer.childNodes[w.startOffset])&&y.nodeType==1){q=y.getAttribute("id");y.setAttribute("id","__mce")}else{if(p.dom.getParent(w.startContainer,function(n){return n===H})){B=w.startOffset;j=w.endOffset;I=u.find(H,0,w.startContainer);o=u.find(H,0,w.endContainer)}}}else{k=E.body.createTextRange();k.moveToElementText(H);k.collapse(1);J=k.move("character",F)*-1;k=w.duplicate();k.collapse(1);A=k.move("character",F)*-1;k=w.duplicate();k.collapse(0);x=(k.move("character",F)*-1)-A;I=A-J;o=x}}l=p.dom.create(p.settings.forced_root_block);G.parentNode.replaceChild(l,G);l.appendChild(G)}}else{if(l.hasChildNodes()){l.insertBefore(G,l.firstChild)}else{l.appendChild(G)}}}else{l=null}}if(I!=-2){if(!c){l=H.getElementsByTagName(p.settings.element)[0];w=E.createRange();if(I!=-1){w.setStart(u.find(H,1,I),B)}else{w.setStart(l,0)}if(o!=-1){w.setEnd(u.find(H,1,o),j)}else{w.setEnd(l,0)}if(v){v.removeAllRanges();v.addRange(w)}}else{try{w=v.createRange();w.moveToElementText(H);w.collapse(1);w.moveStart("character",I);w.moveEnd("character",o);w.select()}catch(C){}}}else{if(!c&&(y=p.dom.get("__mce"))){if(q){y.setAttribute("id",q)}else{y.removeAttribute("id")}w=E.createRange();w.setStartBefore(y);w.setEndBefore(y);K.setRng(w)}}},getParentBlock:function(k){var j=this.dom;return j.getParent(k,j.isBlock)},insertPara:function(N){var B=this,p=B.editor,J=p.dom,O=p.getDoc(),S=p.settings,C=p.selection.getSel(),D=C.getRangeAt(0),R=O.body;var G,H,E,L,K,m,k,o,u,j,z,Q,l,q,F,I=J.getViewPort(p.getWin()),x,A,w;G=O.createRange();G.setStart(C.anchorNode,C.anchorOffset);G.collapse(true);H=O.createRange();H.setStart(C.focusNode,C.focusOffset);H.collapse(true);E=G.compareBoundaryPoints(G.START_TO_END,H)<0;L=E?C.anchorNode:C.focusNode;K=E?C.anchorOffset:C.focusOffset;m=E?C.focusNode:C.anchorNode;k=E?C.focusOffset:C.anchorOffset;if(L===m&&/^(TD|TH)$/.test(L.nodeName)){if(L.firstChild.nodeName=="BR"){J.remove(L.firstChild)}if(L.childNodes.length==0){p.dom.add(L,S.element,null,"<br />");Q=p.dom.add(L,S.element,null,"<br />")}else{F=L.innerHTML;L.innerHTML="";p.dom.add(L,S.element,null,F);Q=p.dom.add(L,S.element,null,"<br />")}D=O.createRange();D.selectNodeContents(Q);D.collapse(1);p.selection.setRng(D);return false}if(L==R&&m==R&&R.firstChild&&p.dom.isBlock(R.firstChild)){L=m=L.firstChild;K=k=0;G=O.createRange();G.setStart(L,0);H=O.createRange();H.setStart(m,0)}L=L.nodeName=="HTML"?O.body:L;L=L.nodeName=="BODY"?L.firstChild:L;m=m.nodeName=="HTML"?O.body:m;m=m.nodeName=="BODY"?m.firstChild:m;o=B.getParentBlock(L);u=B.getParentBlock(m);j=o?o.nodeName:S.element;if(B.dom.getParent(o,"ol,ul,pre")){return true}if(o&&(o.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(J.getStyle(o,"position",1)))){j=S.element;o=null}if(u&&(u.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(J.getStyle(o,"position",1)))){j=S.element;u=null}if(/(TD|TABLE|TH|CAPTION)/.test(j)||(o&&j=="DIV"&&/left|right/gi.test(J.getStyle(o,"float",1)))){j=S.element;o=u=null}z=(o&&o.nodeName==j)?o.cloneNode(0):p.dom.create(j);Q=(u&&u.nodeName==j)?u.cloneNode(0):p.dom.create(j);Q.removeAttribute("id");if(/^(H[1-6])$/.test(j)&&e(D,o)){Q=p.dom.create(S.element)}F=l=L;do{if(F==R||F.nodeType==9||B.dom.isBlock(F)||/(TD|TABLE|TH|CAPTION)/.test(F.nodeName)){break}l=F}while((F=F.previousSibling?F.previousSibling:F.parentNode));F=q=m;do{if(F==R||F.nodeType==9||B.dom.isBlock(F)||/(TD|TABLE|TH|CAPTION)/.test(F.nodeName)){break}q=F}while((F=F.nextSibling?F.nextSibling:F.parentNode));if(l.nodeName==j){G.setStart(l,0)}else{G.setStartBefore(l)}G.setEnd(L,K);z.appendChild(G.cloneContents()||O.createTextNode(""));try{H.setEndAfter(q)}catch(M){}H.setStart(m,k);Q.appendChild(H.cloneContents()||O.createTextNode(""));D=O.createRange();if(!l.previousSibling&&l.parentNode.nodeName==j){D.setStartBefore(l.parentNode)}else{if(G.startContainer.nodeName==j&&G.startOffset==0){D.setStartBefore(G.startContainer)}else{D.setStart(G.startContainer,G.startOffset)}}if(!q.nextSibling&&q.parentNode.nodeName==j){D.setEndAfter(q.parentNode)}else{D.setEnd(H.endContainer,H.endOffset)}D.deleteContents();if(b){p.getWin().scrollTo(0,I.y)}if(z.firstChild&&z.firstChild.nodeName==j){z.innerHTML=z.firstChild.innerHTML}if(Q.firstChild&&Q.firstChild.nodeName==j){Q.innerHTML=Q.firstChild.innerHTML}if(d(z)){z.innerHTML="<br />"}function P(y,s){var r=[],U,T,t;y.innerHTML="";if(S.keep_styles){T=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(T.nodeName)){U=T.cloneNode(false);J.setAttrib(U,"id","");r.push(U)}}while(T=T.parentNode)}if(r.length>0){for(t=r.length-1,U=y;t>=0;t--){U=U.appendChild(r[t])}r[0].innerHTML=b?" ":"<br />";return r[0]}else{y.innerHTML=b?" ":"<br />"}}if(d(Q)){w=P(Q,m)}if(b&&parseFloat(opera.version())<9.5){D.insertNode(z);D.insertNode(Q)}else{D.insertNode(Q);D.insertNode(z)}Q.normalize();z.normalize();function v(r){return O.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,false).nextNode()||r}D=O.createRange();D.selectNodeContents(a?v(w||Q):w||Q);D.collapse(1);C.removeAllRanges();C.addRange(D);x=p.dom.getPos(Q).y;A=Q.clientHeight;if(x<I.y||x+A>I.y+I.h){p.getWin().scrollTo(0,x<I.y?x:x-I.h+25)}return false},backspaceDelete:function(o,x){var z=this,m=z.editor,s=m.getBody(),l=m.dom,k,p=m.selection,j=p.getRng(),q=j.startContainer,k,u,v;if(q&&m.dom.isBlock(q)&&!/^(TD|TH)$/.test(q.nodeName)&&x){if(q.childNodes.length==0||(q.childNodes.length==1&&q.firstChild.nodeName=="BR")){k=q;while((k=k.previousSibling)&&!m.dom.isBlock(k)){}if(k){if(q!=s.firstChild){u=m.dom.doc.createTreeWalker(k,NodeFilter.SHOW_TEXT,null,false);while(v=u.nextNode()){k=v}j=m.getDoc().createRange();j.setStart(k,k.nodeValue?k.nodeValue.length:0);j.setEnd(k,k.nodeValue?k.nodeValue.length:0);p.setRng(j);m.dom.remove(q)}return h.cancel(o)}}}function y(n){var r;n=n.target;if(n&&n.parentNode&&n.nodeName=="BR"&&(k=z.getParentBlock(n))){r=n.previousSibling;h.remove(s,"DOMNodeInserted",y);if(r&&r.nodeType==3&&/\s+$/.test(r.nodeValue)){return}if(n.previousSibling||n.nextSibling){m.dom.remove(n)}}}h._add(s,"DOMNodeInserted",y);window.setTimeout(function(){h._remove(s,"DOMNodeInserted",y)},1)}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){i.execCommand(p.cmd,p.ui||false,p.value)}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.CommandManager=function(){var c={},b={},d={};function e(i,h,g,f){if(typeof(h)=="string"){h=[h]}a.each(h,function(j){i[j.toLowerCase()]={func:g,scope:f}})}a.extend(this,{add:function(h,g,f){e(c,h,g,f)},addQueryStateHandler:function(h,g,f){e(b,h,g,f)},addQueryValueHandler:function(h,g,f){e(d,h,g,f)},execCommand:function(g,j,i,h,f){if(j=c[j.toLowerCase()]){if(j.func.call(g||j.scope,i,h,f)!==false){return true}}},queryCommandValue:function(){if(cmd=d[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=b[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})};a.GlobalCommands=new a.CommandManager()})(tinymce);(function(b){function a(i,d,h,m){var j,g,e,l,f;function k(p,o){do{if(p.parentNode==o){return p}p=p.parentNode}while(p)}function c(o){m(o);b.walk(o,m,"childNodes")}j=i.findCommonAncestor(d,h);e=k(d,j)||d;l=k(h,j)||h;for(g=d;g&&g!=e;g=g.parentNode){for(f=g.nextSibling;f;f=f.nextSibling){c(f)}}if(e!=l){for(g=e.nextSibling;g&&g!=l;g=g.nextSibling){c(g)}}else{c(e)}for(g=h;g&&g!=l;g=g.parentNode){for(f=g.previousSibling;f;f=f.previousSibling){c(f)}}}b.GlobalCommands.add("RemoveFormat",function(){var m=this,l=m.dom,u=m.selection,d=u.getRng(1),e=[],h,f,j,q,g,o,c,i;function k(s){var r;l.getParent(s,function(v){if(l.is(v,m.getParam("removeformat_selector"))){r=v}return l.isBlock(v)},m.getBody());return r}function p(r){if(l.is(r,m.getParam("removeformat_selector"))){e.push(r)}}function t(r){p(r);b.walk(r,p,"childNodes")}h=u.getBookmark();q=d.startContainer;o=d.endContainer;g=d.startOffset;c=d.endOffset;q=q.nodeType==1?q.childNodes[Math.min(g,q.childNodes.length-1)]:q;o=o.nodeType==1?o.childNodes[Math.min(g==c?c:c-1,o.childNodes.length-1)]:o;if(q==o){f=k(q);if(q.nodeType==3){if(f&&f.nodeType==1){i=q.splitText(g);i.splitText(c-g);l.split(f,i);u.moveToBookmark(h)}return}t(l.split(f,q)||q)}else{f=k(q);j=k(o);if(f){if(q.nodeType==3){if(g==q.nodeValue.length){q.nodeValue+="\uFEFF"}q=q.splitText(g)}}if(j){if(o.nodeType==3){o.splitText(c)}}if(f&&f==j){l.replace(l.create("span",{id:"__end"},o.cloneNode(true)),o)}if(f){f=l.split(f,q)}else{f=q}if(i=l.get("__end")){o=i;j=k(o)}if(j){j=l.split(j,o)}else{j=o}a(l,f,j,p);if(q.nodeValue=="\uFEFF"){q.nodeValue=""}t(o);t(q)}b.each(e,function(r){l.remove(r,1)});l.remove("__end",1);u.moveToBookmark(h)})})(tinymce);(function(a){a.GlobalCommands.add("mceBlockQuote",function(){var j=this,o=j.selection,f=j.dom,l,k,e,d,p,c,m,h,b;function g(i){return f.getParent(i,function(q){return q.nodeName==="BLOCKQUOTE"})}l=f.getParent(o.getStart(),f.isBlock);k=f.getParent(o.getEnd(),f.isBlock);if(p=g(l)){if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}if(g(k)){m=p.cloneNode(false);while(e=k.nextSibling){m.appendChild(e.parentNode.removeChild(e))}}if(m){f.insertAfter(m,p)}b=o.getSelectedBlocks(l,k);for(h=b.length-1;h>=0;h--){f.insertAfter(b[h],p)}if(/^\s*$/.test(p.innerHTML)){f.remove(p,1)}if(m&&/^\s*$/.test(m.innerHTML)){f.remove(m,1)}if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(0);if(f.getParent(o.getStart(),f.isBlock)!=l){c=o.getRng();c.move("character",-1);c.select()}}}else{j.selection.moveToBookmark(d)}return}if(a.isIE&&!l&&!k){j.getDoc().execCommand("Indent");e=g(o.getNode());e.style.margin=e.dir="";return}if(!l||!k){return}if(l!=k||l.childNodes.length>1||(l.childNodes.length==1&&l.firstChild.nodeName!="BR")){d=o.getBookmark()}a.each(o.getSelectedBlocks(g(o.getStart()),g(o.getEnd())),function(i){if(i.nodeName=="BLOCKQUOTE"&&!p){p=i;return}if(!p){p=f.create("blockquote");i.parentNode.insertBefore(p,i)}if(i.nodeName=="BLOCKQUOTE"&&p){e=i.firstChild;while(e){p.appendChild(e.cloneNode(true));e=e.nextSibling}f.remove(i);return}p.appendChild(f.remove(i))});if(!d){if(!a.isIE){c=j.getDoc().createRange();c.setStart(l,0);c.setEnd(l,0);o.setRng(c)}else{o.select(l);o.collapse(1)}}else{o.moveToBookmark(d)}})})(tinymce);(function(a){a.each(["Cut","Copy","Paste"],function(b){a.GlobalCommands.add(b,function(){var c=this,e=c.getDoc();try{e.execCommand(b,false,null);if(!e.queryCommandEnabled(b)){throw"Error"}}catch(d){if(a.isGecko){c.windowManager.confirm(c.getLang("clipboard_msg"),function(f){if(f){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{c.windowManager.alert(c.getLang("clipboard_no_support"))}}})})})(tinymce);(function(a){a.GlobalCommands.add("InsertHorizontalRule",function(){if(a.isOpera){return this.getDoc().execCommand("InsertHorizontalRule",false,"")}this.selection.setContent("<hr />")})})(tinymce);(function(){var a=tinymce.GlobalCommands;a.add(["mceEndUndoLevel","mceAddUndoLevel"],function(){this.undoManager.add()});a.add("Undo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.undo();b.nodeChanged();return true}return false});a.add("Redo",function(){var b=this;if(b.settings.custom_undo_redo){b.undoManager.redo();b.nodeChanged();return true}return false})})();
+(function(d){var a=/^\s*|\s*$/g,e,c="B".replace(/A(.)|B/,"$1")==="$1";var b={majorVersion:"@@tinymce_major_version@@",minorVersion:"@@tinymce_minor_version@@",releaseDate:"@@tinymce_release_date@@",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=d.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);if(d.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m<f.length;m++){if(r=f[m].href){if(/^https?:\/\/[^\/]+$/.test(r)){r+="/"}k=r?r.match(/.*\//)[0]:""}}function h(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){s.suffix="_src"}if((j=i.src.indexOf("?"))!=-1){s.query=i.src.substring(j+1)}s.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(k&&s.baseURL.indexOf("://")==-1&&s.baseURL.indexOf("/")!==0){s.baseURL=k+s.baseURL}return s.baseURL}return null}f=q.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}l=q.getElementsByTagName("head")[0];if(l){f=l.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}}return},is:function(g,f){if(!f){return g!==e}if(f=="array"&&(g.hasOwnProperty&&g instanceof Array)){return true}return typeof(g)==f},each:function(i,f,h){var j,g;if(!i){return 0}h=h||i;if(i.length!==e){for(j=0,g=i.length;j<g;j++){if(f.call(h,i[j],j,i)===false){return 0}}}else{for(j in i){if(i.hasOwnProperty(j)){if(f.call(h,i[j],j,i)===false){return 0}}}}return 1},map:function(g,h){var i=[];b.each(g,function(f){i.push(h(f))});return i},grep:function(g,h){var i=[];b.each(g,function(f){if(!h||h(f)){i.push(f)}});return i},inArray:function(g,h){var j,f;if(g){for(j=0,f=g.length;j<f;j++){if(g[j]===h){return j}}}return -1},extend:function(k,j){var h,g,f=arguments;for(h=1,g=f.length;h<g;h++){j=f[h];b.each(j,function(i,l){if(i!==e){k[l]=i}})}return k},trim:function(f){return(f?""+f:"").replace(a,"")},create:function(n,f){var m=this,g,i,j,k,h,l=0;n=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(n);j=n[3].match(/(^|\.)(\w+)$/i)[2];i=m.createNS(n[3].replace(/\.\w+$/,""));if(i[j]){return}if(n[2]=="static"){i[j]=f;if(this.onCreate){this.onCreate(n[2],n[3],i[j])}return}if(!f[j]){f[j]=function(){};l=1}i[j]=f[j];m.extend(i[j].prototype,f);if(n[5]){g=m.resolve(n[5]).prototype;k=n[5].match(/\.(\w+)$/i)[1];h=i[j];if(l){i[j]=function(){return g[k].apply(this,arguments)}}else{i[j]=function(){this.parent=g[k];return h.apply(this,arguments)}}i[j].prototype[j]=i[j];m.each(g,function(o,p){i[j].prototype[p]=g[p]});m.each(f,function(o,p){if(g[p]){i[j].prototype[p]=function(){this.parent=g[p];return o.apply(this,arguments)}}else{if(p!=j){i[j].prototype[p]=o}}})}m.each(f["static"],function(o,p){i[j][p]=o});if(this.onCreate){this.onCreate(n[2],n[3],i[j].prototype)}},walk:function(i,h,j,g){g=g||this;if(i){if(j){i=i[j]}b.each(i,function(k,f){if(h.call(g,k,f,j)===false){return false}b.walk(k,h,j,g)})}},createNS:function(j,h){var g,f;h=h||d;j=j.split(".");for(g=0;g<j.length;g++){f=j[g];if(!h[f]){h[f]={}}h=h[f]}return h},resolve:function(j,h){var g,f;h=h||d;j=j.split(".");for(g=0,f=j.length;g<f;g++){h=h[j[g]];if(!h){break}}return h},addUnload:function(j,i){var h=this;j={func:j,scope:i||this};if(!h.unloads){function g(){var f=h.unloads,l,m;if(f){for(m in f){l=f[m];if(l&&l.func){l.func.call(l.scope,1)}}if(d.detachEvent){d.detachEvent("onbeforeunload",k);d.detachEvent("onunload",g)}else{if(d.removeEventListener){d.removeEventListener("unload",g,false)}}h.unloads=l=f=w=g=0;if(d.CollectGarbage){CollectGarbage()}}}function k(){var l=document;if(l.readyState=="interactive"){function f(){l.detachEvent("onstop",f);if(g){g()}l=0}if(l){l.attachEvent("onstop",f)}d.setTimeout(function(){if(l){l.detachEvent("onstop",f)}},0)}}if(d.attachEvent){d.attachEvent("onunload",g);d.attachEvent("onbeforeunload",k)}else{if(d.addEventListener){d.addEventListener("unload",g,false)}}h.unloads=[j]}else{h.unloads.push(j)}return j},removeUnload:function(i){var g=this.unloads,h=null;b.each(g,function(j,f){if(j&&j.func==i){g.splice(f,1);h=i;return false}});return h},explode:function(f,g){return f?b.map(f.split(g||","),b.trim):f},_addVer:function(g){var f;if(!this.query){return g}f=(g.indexOf("?")==-1?"?":"&")+this.query;if(g.indexOf("#")==-1){return g+f}return g.replace("#",f+"#")},_replace:function(h,f,g){if(c){return g.replace(h,function(){var l=f,j=arguments,k;for(k=0;k<j.length-2;k++){if(j[k]===e){l=l.replace(new RegExp("\\$"+k,"g"),"")}else{l=l.replace(new RegExp("\\$"+k,"g"),j[k])}}return l})}return g.replace(h,f)}};b._init();d.tinymce=d.tinyMCE=b})(window);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=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="[";c<e.length;c++){a+=(c>0?",":"")+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(m){var k=m.each,j=m.is,i=m.isWebKit,d=m.isIE,a=/^(H[1-6R]|P|DIV|ADDRESS|PRE|FORM|T(ABLE|BODY|HEAD|FOOT|H|R|D)|LI|OL|UL|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|NOSCRIPT|MENU|ISINDEX|SAMP)$/,e=g("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),f=g("src,href,style,coords,shape"),c={"&":"&",'"':""","<":"<",">":">"},n=/[<>&\"]/g,b=/^([a-z0-9],?)+$/i,h=/<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)(\s*\/?)>/g,l=/(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;function g(q){var p={},o;q=q.split(",");for(o=q.length;o>=0;o--){p[q[o]]=1}return p}m.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(u,q){var p=this,o;p.doc=u;p.win=window;p.files={};p.cssFlicker=false;p.counter=0;p.stdMode=u.documentMode>=8;p.boxModel=!m.isIE||u.compatMode=="CSS1Compat"||p.stdMode;p.settings=q=m.extend({keep_values:false,hex_colors:1,process_html:1},q);if(m.isIE6){try{u.execCommand("BackgroundImageCache",false,true)}catch(r){p.cssFlicker=true}}if(q.valid_styles){p._styles={};k(q.valid_styles,function(t,s){p._styles[s]=m.explode(t)})}m.addUnload(p.destroy,p)},getRoot:function(){var o=this,p=o.settings;return(p&&o.get(p.root_element))||o.doc.body},getViewPort:function(p){var q,o;p=!p?this.win:p;q=p.document;o=this.boxModel?q.documentElement:q.body;return{x:p.pageXOffset||o.scrollLeft,y:p.pageYOffset||o.scrollTop,w:p.innerWidth||o.clientWidth,h:p.innerHeight||o.clientHeight}},getRect:function(s){var r,o=this,q;s=o.get(s);r=o.getPos(s);q=o.getSize(s);return{x:r.x,y:r.y,w:q.w,h:q.h}},getSize:function(r){var p=this,o,q;r=p.get(r);o=p.getStyle(r,"width");q=p.getStyle(r,"height");if(o.indexOf("px")===-1){o=0}if(q.indexOf("px")===-1){q=0}return{w:parseInt(o)||r.offsetWidth||r.clientWidth,h:parseInt(q)||r.offsetHeight||r.clientHeight}},getParent:function(q,p,o){return this.getParents(q,p,o,false)},getParents:function(z,v,s,y){var q=this,p,u=q.settings,x=[];z=q.get(z);y=y===undefined;if(u.strict_root){s=s||q.getRoot()}if(j(v,"string")){p=v;if(v==="*"){v=function(o){return o.nodeType==1}}else{v=function(o){return q.is(o,p)}}}while(z){if(z==s||!z.nodeType||z.nodeType===9){break}if(!v||v(z)){if(y){x.push(z)}else{return z}}z=z.parentNode}return y?x:null},get:function(o){var p;if(o&&this.doc&&typeof(o)=="string"){p=o;o=this.doc.getElementById(o);if(o&&o.id!==p){return this.doc.getElementsByName(p)[1]}}return o},getNext:function(p,o){return this._findSib(p,o,"nextSibling")},getPrev:function(p,o){return this._findSib(p,o,"previousSibling")},select:function(q,p){var o=this;return m.dom.Sizzle(q,o.get(p)||o.get(o.settings.root_element)||o.doc,[])},is:function(q,o){var p;if(q.length===undefined){if(o==="*"){return q.nodeType==1}if(b.test(o)){o=o.toLowerCase().split(/,/);q=q.nodeName.toLowerCase();for(p=o.length-1;p>=0;p--){if(o[p]==q){return true}}return false}}return m.dom.Sizzle.matches(o,q.nodeType?[q]:q).length>0},add:function(s,v,o,r,u){var q=this;return this.run(s,function(y){var x,t;x=j(v,"string")?q.doc.createElement(v):v;q.setAttribs(x,o);if(r){if(r.nodeType){x.appendChild(r)}else{q.setHTML(x,r)}}return !u?y.appendChild(x):x})},create:function(q,o,p){return this.add(this.doc.createElement(q),q,o,p,1)},createHTML:function(v,p,s){var u="",r=this,q;u+="<"+v;for(q in p){if(p.hasOwnProperty(q)){u+=" "+q+'="'+r.encode(p[q])+'"'}}if(typeof(s)!="undefined"){return u+">"+s+"</"+v+">"}return u+" />"},remove:function(o,p){return this.run(o,function(r){var q,s;q=r.parentNode;if(!q){return null}if(p){while(s=r.firstChild){if(!m.isIE||s.nodeType!==3||s.nodeValue){q.insertBefore(s,r)}else{r.removeChild(s)}}}return q.removeChild(r)})},setStyle:function(r,o,p){var q=this;return q.run(r,function(v){var u,t;u=v.style;o=o.replace(/-(\D)/g,function(x,s){return s.toUpperCase()});if(q.pixelStyles.test(o)&&(m.is(p,"number")||/^[\-0-9\.]+$/.test(p))){p+="px"}switch(o){case"opacity":if(d){u.filter=p===""?"":"alpha(opacity="+(p*100)+")";if(!r.currentStyle||!r.currentStyle.hasLayout){u.display="inline-block"}}u[o]=u["-moz-opacity"]=u["-khtml-opacity"]=p||"";break;case"float":d?u.styleFloat=p:u.cssFloat=p;break;default:u[o]=p||""}if(q.settings.update_styles){q.setAttrib(v,"_mce_style")}})},getStyle:function(r,o,q){r=this.get(r);if(!r){return false}if(this.doc.defaultView&&q){o=o.replace(/[A-Z]/g,function(s){return"-"+s});try{return this.doc.defaultView.getComputedStyle(r,null).getPropertyValue(o)}catch(p){return null}}o=o.replace(/-(\D)/g,function(t,s){return s.toUpperCase()});if(o=="float"){o=d?"styleFloat":"cssFloat"}if(r.currentStyle&&q){return r.currentStyle[o]}return r.style[o]},setStyles:function(u,v){var q=this,r=q.settings,p;p=r.update_styles;r.update_styles=0;k(v,function(o,s){q.setStyle(u,s,o)});r.update_styles=p;if(r.update_styles){q.setAttrib(u,r.cssText)}},setAttrib:function(q,r,o){var p=this;if(!q||!r){return}if(p.settings.strict){r=r.toLowerCase()}return this.run(q,function(u){var t=p.settings;switch(r){case"style":if(!j(o,"string")){k(o,function(s,x){p.setStyle(u,x,s)});return}if(t.keep_values){if(o&&!p._isRes(o)){u.setAttribute("_mce_style",o,2)}else{u.removeAttribute("_mce_style",2)}}u.style.cssText=o;break;case"class":u.className=o||"";break;case"src":case"href":if(t.keep_values){if(t.url_converter){o=t.url_converter.call(t.url_converter_scope||p,o,r,u)}p.setAttrib(u,"_mce_"+r,o,2)}break;case"shape":u.setAttribute("_mce_style",o);break}if(j(o)&&o!==null&&o.length!==0){u.setAttribute(r,""+o,2)}else{u.removeAttribute(r,2)}})},setAttribs:function(q,r){var p=this;return this.run(q,function(o){k(r,function(s,t){p.setAttrib(o,t,s)})})},getAttrib:function(r,s,q){var o,p=this;r=p.get(r);if(!r||r.nodeType!==1){return false}if(!j(q)){q=""}if(/^(src|href|style|coords|shape)$/.test(s)){o=r.getAttribute("_mce_"+s);if(o){return o}}if(d&&p.props[s]){o=r[p.props[s]];o=o&&o.nodeValue?o.nodeValue:o}if(!o){o=r.getAttribute(s,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(s)){if(r[p.props[s]]===true&&o===""){return s}return o?s:""}if(r.nodeName==="FORM"&&r.getAttributeNode(s)){return r.getAttributeNode(s).nodeValue}if(s==="style"){o=o||r.style.cssText;if(o){o=p.serializeStyle(p.parseStyle(o),r.nodeName);if(p.settings.keep_values&&!p._isRes(o)){r.setAttribute("_mce_style",o)}}}if(i&&s==="class"&&o){o=o.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(d){switch(s){case"rowspan":case"colspan":if(o===1){o=""}break;case"size":if(o==="+0"||o===20||o===0){o=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(o===0){o=""}break;case"hspace":if(o===-1){o=""}break;case"maxlength":case"tabindex":if(o===32768||o===2147483647||o==="32768"){o=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(o===65535){return s}return q;case"shape":o=o.toLowerCase();break;default:if(s.indexOf("on")===0&&o){o=m._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+o)}}}return(o!==undefined&&o!==null&&o!=="")?""+o:q},getPos:function(A,s){var p=this,o=0,z=0,u,v=p.doc,q;A=p.get(A);s=s||v.body;if(A){if(d&&!p.stdMode){A=A.getBoundingClientRect();u=p.boxModel?v.documentElement:v.body;o=p.getStyle(p.select("html")[0],"borderWidth");o=(o=="medium"||p.boxModel&&!p.isIE6)&&2||o;return{x:A.left+u.scrollLeft-o,y:A.top+u.scrollTop-o}}q=A;while(q&&q!=s&&q.nodeType){o+=q.offsetLeft||0;z+=q.offsetTop||0;q=q.offsetParent}q=A.parentNode;while(q&&q!=s&&q.nodeType){o-=q.scrollLeft||0;z-=q.scrollTop||0;q=q.parentNode}}return{x:o,y:z}},parseStyle:function(r){var u=this,v=u.settings,x={};if(!r){return x}function p(D,A,C){var z,B,o,y;z=x[D+"-top"+A];if(!z){return}B=x[D+"-right"+A];if(z!=B){return}o=x[D+"-bottom"+A];if(B!=o){return}y=x[D+"-left"+A];if(o!=y){return}x[C]=y;delete x[D+"-top"+A];delete x[D+"-right"+A];delete x[D+"-bottom"+A];delete x[D+"-left"+A]}function q(y,s,o,A){var z;z=x[s];if(!z){return}z=x[o];if(!z){return}z=x[A];if(!z){return}x[y]=x[s]+" "+x[o]+" "+x[A];delete x[s];delete x[o];delete x[A]}r=r.replace(/&(#?[a-z0-9]+);/g,"&$1_MCE_SEMI_");k(r.split(";"),function(s){var o,t=[];if(s){s=s.replace(/_MCE_SEMI_/g,";");s=s.replace(/url\([^\)]+\)/g,function(y){t.push(y);return"url("+t.length+")"});s=s.split(":");o=m.trim(s[1]);o=o.replace(/url\(([^\)]+)\)/g,function(z,y){return t[parseInt(y)-1]});o=o.replace(/rgb\([^\)]+\)/g,function(y){return u.toHex(y)});if(v.url_converter){o=o.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g,function(y,z){return"url("+v.url_converter.call(v.url_converter_scope||u,u.decode(z),"style",null)+")"})}x[m.trim(s[0]).toLowerCase()]=o}});p("border","","border");p("border","-width","border-width");p("border","-color","border-color");p("border","-style","border-style");p("padding","","padding");p("margin","","margin");q("border","border-width","border-style","border-color");if(d){if(x.border=="medium none"){x.border=""}}return x},serializeStyle:function(v,p){var q=this,r="";function u(s,o){if(o&&s){if(o.indexOf("-")===0){return}switch(o){case"font-weight":if(s==700){s="bold"}break;case"color":case"background-color":s=s.toLowerCase();break}r+=(r?" ":"")+o+": "+s+";"}}if(p&&q._styles){k(q._styles["*"],function(o){u(v[o],o)});k(q._styles[p.toLowerCase()],function(o){u(v[o],o)})}else{k(v,u)}return r},loadCSS:function(o){var q=this,r=q.doc,p;if(!o){o=""}p=q.select("head")[0];k(o.split(","),function(s){var t;if(q.files[s]){return}q.files[s]=true;t=q.create("link",{rel:"stylesheet",href:m._addVer(s)});if(d&&r.documentMode&&r.recalc){t.onload=function(){r.recalc();t.onload=null}}p.appendChild(t)})},addClass:function(o,p){return this.run(o,function(q){var r;if(!p){return 0}if(this.hasClass(q,p)){return q.className}r=this.removeClass(q,p);return q.className=(r!=""?(r+" "):"")+p})},removeClass:function(q,r){var o=this,p;return o.run(q,function(t){var s;if(o.hasClass(t,r)){if(!p){p=new RegExp("(^|\\s+)"+r+"(\\s+|$)","g")}s=t.className.replace(p," ");s=m.trim(s!=" "?s:"");t.className=s;if(!s){t.removeAttribute("class");t.removeAttribute("className")}return s}return t.className})},hasClass:function(p,o){p=this.get(p);if(!p||!o){return false}return(" "+p.className+" ").indexOf(" "+o+" ")!==-1},show:function(o){return this.setStyle(o,"display","block")},hide:function(o){return this.setStyle(o,"display","none")},isHidden:function(o){o=this.get(o);return !o||o.style.display=="none"||this.getStyle(o,"display")=="none"},uniqueId:function(o){return(!o?"mce_":o)+(this.counter++)},setHTML:function(q,p){var o=this;return this.run(q,function(v){var r,t,s,z,u,r;p=o.processHTML(p);if(d){function y(){while(v.firstChild){v.firstChild.removeNode()}try{v.innerHTML="<br />"+p;v.removeChild(v.firstChild)}catch(x){r=o.create("div");r.innerHTML="<br />"+p;k(r.childNodes,function(B,A){if(A){v.appendChild(B)}})}}if(o.settings.fix_ie_paragraphs){p=p.replace(/<p><\/p>|<p([^>]+)><\/p>|<p[^\/+]\/>/gi,'<p$1 _mce_keep="true"> </p>')}y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("p");for(t=s.length-1,r=0;t>=0;t--){z=s[t];if(!z.hasChildNodes()){if(!z._mce_keep){r=1;break}z.removeAttribute("_mce_keep")}}}if(r){p=p.replace(/<p ([^>]+)>|<p>/ig,'<div $1 _mce_tmp="1">');p=p.replace(/<\/p>/gi,"</div>");y();if(o.settings.fix_ie_paragraphs){s=v.getElementsByTagName("DIV");for(t=s.length-1;t>=0;t--){z=s[t];if(z._mce_tmp){u=o.doc.createElement("p");z.cloneNode(false).outerHTML.replace(/([a-z0-9\-_]+)=/gi,function(A,x){var B;if(x!=="_mce_tmp"){B=z.getAttribute(x);if(!B&&x==="class"){B=z.className}u.setAttribute(x,B)}});for(r=0;r<z.childNodes.length;r++){u.appendChild(z.childNodes[r].cloneNode(true))}z.swapNode(u)}}}}}else{v.innerHTML=p}return p})},processHTML:function(r){var p=this,q=p.settings,v=[];if(!q.process_html){return r}if(d){r=r.replace(/'/g,"'");r=r.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/gi,"")}r=m._replace(/<a( )([^>]+)\/>|<a\/>/gi,"<a$1$2></a>",r);if(q.keep_values){if(/<script|noscript|style/i.test(r)){function o(t){t=t.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n");t=t.replace(/^[\r\n]*|[\r\n]*$/g,"");t=t.replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"");t=t.replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"");return t}r=r.replace(/<script([^>]+|)>([\s\S]*?)<\/script>/gi,function(s,x,t){if(!x){x=' type="text/javascript"'}x=x.replace(/src=\"([^\"]+)\"?/i,function(y,z){if(q.url_converter){z=p.encode(q.url_converter.call(q.url_converter_scope||p,p.decode(z),"src","script"))}return'_mce_src="'+z+'"'});if(m.trim(t)){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n// -->"}return"<mce:script"+x+">"+t+"</mce:script>"});r=r.replace(/<style([^>]+|)>([\s\S]*?)<\/style>/gi,function(s,x,t){if(t){v.push(o(t));t="<!--\nMCE_SCRIPT:"+(v.length-1)+"\n-->"}return"<mce:style"+x+">"+t+"</mce:style><style "+x+' _mce_bogus="1">'+t+"</style>"});r=r.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(s,x,t){return"<mce:noscript"+x+"><!--"+p.encode(t).replace(/--/g,"--")+"--></mce:noscript>"})}r=m._replace(/<!\[CDATA\[([\s\S]+)\]\]>/g,"<!--[CDATA[$1]]-->",r);function u(s){return s.replace(h,function(y,z,x,t){return"<"+z+x.replace(l,function(B,A,E,D,C){var F;A=A.toLowerCase();E=E||D||C||"";if(e[A]){if(E==="false"||E==="0"){return}return A+'="'+A+'"'}if(f[A]&&x.indexOf("_mce_"+A)==-1){F=p.decode(E);if(q.url_converter&&(A=="src"||A=="href")){F=q.url_converter.call(q.url_converter_scope||p,F,A,z)}if(A=="style"){F=p.serializeStyle(p.parseStyle(F),A)}return A+'="'+E+'" _mce_'+A+'="'+p.encode(F)+'"'}return B})+t+">"})}r=u(r);r=r.replace(/MCE_SCRIPT:([0-9]+)/g,function(t,s){return v[s]})}return r},getOuterHTML:function(o){var p;o=this.get(o);if(!o){return null}if(o.outerHTML!==undefined){return o.outerHTML}p=(o.ownerDocument||this.doc).createElement("body");p.appendChild(o.cloneNode(true));return p.innerHTML},setOuterHTML:function(r,p,s){var o=this;function q(u,t,x){var y,v;v=x.createElement("body");v.innerHTML=t;y=v.lastChild;while(y){o.insertAfter(y.cloneNode(true),u);y=y.previousSibling}o.remove(u)}return this.run(r,function(u){u=o.get(u);if(u.nodeType==1){s=s||u.ownerDocument||o.doc;if(d){try{if(d&&u.nodeType==1){u.outerHTML=p}else{q(u,p,s)}}catch(t){q(u,p,s)}}else{q(u,p,s)}}})},decode:function(p){var q,r,o;if(/&[\w#]+;/.test(p)){q=this.doc.createElement("div");q.innerHTML=p;r=q.firstChild;o="";if(r){do{o+=r.nodeValue}while(r=r.nextSibling)}return o||p}return p},encode:function(o){return(""+o).replace(n,function(p){return c[p]})},insertAfter:function(o,p){p=this.get(p);return this.run(o,function(r){var q,s;q=p.parentNode;s=p.nextSibling;if(s){q.insertBefore(r,s)}else{q.appendChild(r)}return r})},isBlock:function(o){if(o.nodeType&&o.nodeType!==1){return false}o=o.nodeName||o;return a.test(o)},replace:function(s,r,p){var q=this;if(j(r,"array")){s=s.cloneNode(true)}return q.run(r,function(t){if(p){k(m.grep(t.childNodes),function(o){s.appendChild(o)})}return t.parentNode.replaceChild(s,t)})},rename:function(r,o){var q=this,p;if(r.nodeName!=o.toUpperCase()){p=q.create(o);k(q.getAttribs(r),function(s){q.setAttrib(p,s.nodeName,q.getAttrib(r,s.nodeName))});q.replace(p,r,1)}return p||r},findCommonAncestor:function(q,o){var r=q,p;while(r){p=o;while(p&&r!=p){p=p.parentNode}if(r==p){break}r=r.parentNode}if(!r&&q.ownerDocument){return q.ownerDocument.documentElement}return r},toHex:function(o){var q=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(o);function p(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}if(q){o="#"+p(q[1])+p(q[2])+p(q[3]);return o}return o},getClasses:function(){var s=this,o=[],r,u={},v=s.settings.class_filter,q;if(s.classes){return s.classes}function x(t){k(t.imports,function(y){x(y)});k(t.cssRules||t.rules,function(y){switch(y.type||1){case 1:if(y.selectorText){k(y.selectorText.split(","),function(z){z=z.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(z)||!/\.[\w\-]+$/.test(z)){return}q=z;z=m._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",z);if(v&&!(z=v(z,q))){return}if(!u[z]){o.push({"class":z});u[z]=1}})}break;case 3:x(y.styleSheet);break}})}try{k(s.doc.styleSheets,x)}catch(p){}if(o.length>0){s.classes=o}return o},run:function(u,r,q){var p=this,v;if(p.doc&&typeof(u)==="string"){u=p.get(u)}if(!u){return false}q=q||this;if(!u.nodeType&&(u.length||u.length===0)){v=[];k(u,function(s,o){if(s){if(typeof(s)=="string"){s=p.doc.getElementById(s)}v.push(r.call(q,s,o))}});return v}return r.call(q,u)},getAttribs:function(q){var p;q=this.get(q);if(!q){return[]}if(d){p=[];if(q.nodeName=="OBJECT"){return q.attributes}if(q.nodeName==="OPTION"&&this.getAttrib(q,"selected")){p.push({specified:1,nodeName:"selected"})}q.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(o){p.push({specified:1,nodeName:o})});return p}return q.attributes},destroy:function(p){var o=this;if(o.events){o.events.destroy()}o.win=o.doc=o.root=o.events=null;if(!p){m.removeUnload(o.destroy)}},createRng:function(){var o=this.doc;return o.createRange?o.createRange():new m.dom.Range(this)},nodeIndex:function(s,t){var o=0,q,r,p;if(s){for(q=s.nodeType,s=s.previousSibling,r=s;s;s=s.previousSibling){p=s.nodeType;if(t&&p==3){if(p==q||!s.nodeValue.length){continue}}o++;q=p}}return o},split:function(u,s,y){var z=this,o=z.createRng(),v,q,x;function p(A){var t,r=A.childNodes;if(A.nodeType==1&&A.getAttribute("_mce_type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){p(r[t])}if(A.nodeType!=9){if(A.nodeType==3&&A.nodeValue.length>0){if(!z.isBlock(A.parentNode)||m.trim(A.nodeValue).length>0){return}}if(A.nodeType==1){r=A.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("_mce_type")=="bookmark"){A.parentNode.insertBefore(r[0],A)}if(r.length||/^(br|hr|input|img)$/i.test(A.nodeName)){return}}z.remove(A)}return A}if(u&&s){o.setStart(u.parentNode,z.nodeIndex(u));o.setEnd(s.parentNode,z.nodeIndex(s));v=o.extractContents();o=z.createRng();o.setStart(s.parentNode,z.nodeIndex(s)+1);o.setEnd(u.parentNode,z.nodeIndex(u)+1);q=o.extractContents();x=u.parentNode;x.insertBefore(p(v),u);if(y){x.replaceChild(y,s)}else{x.insertBefore(s,u)}x.insertBefore(p(q),u);z.remove(u);return y||s}},bind:function(s,o,r,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.add(s,o,r,q||this)},unbind:function(r,o,q){var p=this;if(!p.events){p.events=new m.dom.EventUtils()}return p.events.remove(r,o,q)},_findSib:function(r,o,p){var q=this,s=o;if(r){if(j(s,"string")){s=function(t){return q.is(t,o)}}for(r=r[p];r;r=r[p]){if(s(r)){return r}}}return null},_isRes:function(o){return/^(top|left|bottom|right|width|height)/i.test(o)||/;\s*(top|left|bottom|right|width|height)/i.test(o)}});m.DOM=new m.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(W,X){var Z=N[h],Y=N[U],V=N[P],t=N[z];if(W===0){return G(Z,Y,Z,Y)}if(W===1){return G(Z,Y,V,t)}if(W===2){return G(V,t,V,t)}if(W===3){return G(V,t,Z,Y)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z<Y){return -1}return 1}aa=V;while(aa&&aa.parentNode!=X){aa=aa.parentNode}if(aa){W=0;t=X.firstChild;while(t!=aa&&W<Z){W++;t=t.nextSibling}if(Z<=W){return -1}return 1}aa=X;while(aa&&aa.parentNode!=V){aa=aa.parentNode}if(aa){W=0;t=V.firstChild;while(t!=aa&&W<Y){W++;t=t.nextSibling}if(W<Y){return -1}return 1}ab=c.findCommonAncestor(X,V);ad=X;while(ad&&ad.parentNode!=ab){ad=ad.parentNode}if(!ad){ad=ab}ac=V;while(ac&&ac.parentNode!=ab){ac=ac.parentNode}if(!ac){ac=ab}if(ad==ac){return 0}t=ab.firstChild;while(t){if(t==ad){return -1}if(t==ac){return 1}t=t.nextSibling}}function B(V,Y,X){var t,W;if(V){N[h]=Y;N[U]=X}else{N[P]=Y;N[z]=X}t=N[P];while(t.parentNode){t=t.parentNode}W=N[h];while(W.parentNode){W=W.parentNode}if(W==t){if(G(N[h],N[U],N[P],N[z])>0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(g){var i=this,j="\uFEFF",e,h,d=g.dom,c=true,f=false;function b(){var n=g.getRng(),k=d.createRng(),m,o;m=n.item?n.item(0):n.parentElement();if(m.ownerDocument!=d.doc){return k}if(n.item||!m.hasChildNodes()){k.setStart(m.parentNode,d.nodeIndex(m));k.setEnd(k.startContainer,k.startOffset+1);return k}o=g.isCollapsed();function l(s){var u,q,t,p,A=0,x,y,z,r,v;r=n.duplicate();r.collapse(s);u=d.create("a");z=r.parentElement();if(!z.hasChildNodes()){k[s?"setStart":"setEnd"](z,0);return}z.appendChild(u);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){k[s?"setStartAfter":"setEndAfter"](z);d.remove(u);return}p=tinymce.grep(z.childNodes);x=p.length-1;while(A<=x){y=Math.floor((A+x)/2);z.insertBefore(u,p[y]);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){A=y+1}else{if(v<0){x=y-1}else{found=true;break}}}q=v>0||y==0?u.nextSibling:u.previousSibling;if(q.nodeType==1){d.remove(u);t=d.nodeIndex(q);q=q.parentNode;if(!s||y>0){t++}}else{if(v>0||y==0){r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=r.text.length}else{r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=q.nodeValue.length-r.text.length}d.remove(u)}k[s?"setStart":"setEnd"](q,t)}l(true);if(!o){l()}return k}this.addRange=function(k){var p,n,m,r,u,s,t=g.dom.doc,o=t.body;function l(B){var x,A,v,z,y;v=d.create("a");x=B?m:u;A=B?r:s;z=p.duplicate();if(x==t){x=o;A=0}if(x.nodeType==3){x.parentNode.insertBefore(v,x);z.moveToElementText(v);z.moveStart("character",A);d.remove(v);p.setEndPoint(B?"StartToStart":"EndToEnd",z)}else{y=x.childNodes;if(y.length){if(A>=y.length){d.insertAfter(v,y[y.length-1])}else{x.insertBefore(v,y[A])}z.moveToElementText(v)}else{v=t.createTextNode(j);x.appendChild(v);z.moveToElementText(v.parentNode);z.collapse(c)}p.setEndPoint(B?"StartToStart":"EndToEnd",z);d.remove(v)}}this.destroy();m=k.startContainer;r=k.startOffset;u=k.endContainer;s=k.endOffset;p=o.createTextRange();if(m==u&&m.nodeType==1&&r==s-1){if(r==s-1){try{n=o.createControlRange();n.addElement(m.childNodes[r]);n.select();n.scrollIntoView();return}catch(q){}}}l(true);l();p.select();p.scrollIntoView()};this.getRangeAt=function(){if(!e||!tinymce.dom.RangeUtils.compareRanges(h,g.getRng())){e=b();h=g.getRng()}try{e.startContainer.nextSibling}catch(k){e=b();h=null}return e};this.destroy=function(){h=e=null}}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,o=false,i=true;[0,0].sort(function(){i=false;return 0});var b=function(v,e,z,A){z=z||[];e=e||document;var C=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!v||typeof v!=="string"){return z}var x=[],s,E,H,r,u=true,t=b.isXML(e),B=v,D,G,F,y;do{p.exec("");s=p.exec(B);if(s){B=s[3];x.push(s[1]);if(s[2]){r=s[3];break}}}while(s);if(x.length>1&&k.exec(v)){if(x.length===2&&f.relative[x[0]]){E=h(x[0]+x[1],e)}else{E=f.relative[x[0]]?[e]:b(x.shift(),e);while(x.length){v=x.shift();if(f.relative[v]){v+=x.shift()}E=h(v,E)}}}else{if(!A&&x.length>1&&e.nodeType===9&&!t&&f.match.ID.test(x[0])&&!f.match.ID.test(x[x.length-1])){D=b.find(x.shift(),e,t);e=D.expr?b.filter(D.expr,D.set)[0]:D.set[0]}if(e){D=A?{expr:x.pop(),set:a(A)}:b.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&e.parentNode?e.parentNode:e,t);E=D.expr?b.filter(D.expr,D.set):D.set;if(x.length>0){H=a(E)}else{u=false}while(x.length){G=x.pop();F=G;if(!f.relative[G]){G=""}else{F=x.pop()}if(F==null){F=e}f.relative[G](H,F,t)}}else{H=x=[]}}if(!H){H=E}if(!H){b.error(G||v)}if(d.call(H)==="[object Array]"){if(!u){z.push.apply(z,H)}else{if(e&&e.nodeType===1){for(y=0;H[y]!=null;y++){if(H[y]&&(H[y]===true||H[y].nodeType===1&&b.contains(e,H[y]))){z.push(E[y])}}}else{for(y=0;H[y]!=null;y++){if(H[y]&&H[y].nodeType===1){z.push(E[y])}}}}}else{a(H,z)}if(r){b(r,C,z,A);b.uniqueSort(z)}return z};b.uniqueSort=function(r){if(c){o=i;r.sort(c);if(o){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}return r};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(y,e,z){var x;if(!y){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.leftMatch[v].exec(y))){var r=u[1];u.splice(1,1);if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");x=f.find[v](u,e,z);if(x!=null){y=y.replace(f.match[v],"");break}}}}if(!x){x=e.getElementsByTagName("*")}return{set:x,expr:y}};b.filter=function(C,B,F,u){var s=C,H=[],z=B,x,e,y=B&&B[0]&&b.isXML(B[0]);while(C&&B.length){for(var A in f.filter){if((x=f.leftMatch[A].exec(C))!=null&&x[2]){var r=f.filter[A],G,E,t=x[1];e=false;x.splice(1,1);if(t.substr(t.length-1)==="\\"){continue}if(z===H){H=[]}if(f.preFilter[A]){x=f.preFilter[A](x,z,F,H,u,y);if(!x){e=G=true}else{if(x===true){continue}}}if(x){for(var v=0;(E=z[v])!=null;v++){if(E){G=r(E,x,v,z);var D=u^!!G;if(F&&G!=null){if(D){e=true}else{z[v]=false}}else{if(D){H.push(E);e=true}}}}}if(G!==undefined){if(!F){z=H}C=C.replace(f.match[A],"");if(!e){return[]}break}}}if(C===s){if(e==null){b.error(C)}else{break}}s=C}return z};b.error=function(e){throw"Syntax error, unrecognized expression: "+e};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,r){var t=typeof r==="string",v=t&&!/\W/.test(r),y=t&&!v;if(v){r=r.toLowerCase()}for(var s=0,e=x.length,u;s<e;s++){if((u=x[s])){while((u=u.previousSibling)&&u.nodeType!==1){}x[s]=y||u&&u.nodeName.toLowerCase()===r?u||false:u===r}}if(y){b.filter(r,x,true)}},">":function(x,r){var u=typeof r==="string",v,s=0,e=x.length;if(u&&!/\W/.test(r)){r=r.toLowerCase();for(;s<e;s++){v=x[s];if(v){var t=v.parentNode;x[s]=t.nodeName.toLowerCase()===r?t:false}}}else{for(;s<e;s++){v=x[s];if(v){x[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,x,true)}}},"":function(t,r,v){var s=j++,e=q,u;if(typeof r==="string"&&!/\W/.test(r)){r=r.toLowerCase();u=r;e=n}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=j++,e=q,u;if(typeof r==="string"&&!/\W/.test(r)){r=r.toLowerCase();u=r;e=n}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,x,y){t=" "+t[1].replace(/\\/g,"")+" ";if(y){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(x^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(t)>=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){return r[1].toLowerCase()},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]=j++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&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((p.exec(u[3])||"").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.toLowerCase()==="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 r<e[3]-0},gt:function(s,r,e){return r>e[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(s,y,x,z){var e=y[1],r=f.filters[e];if(r){return r(s,x,y,z)}else{if(e==="contains"){return(s.textContent||s.innerText||b.getText([s])||"").indexOf(y[3])>=0}else{if(e==="not"){var t=y[3];for(var v=0,u=t.length;v<u;v++){if(t[v]===s){return false}}return true}else{b.error("Syntax error, unrecognized expression: "+e)}}}},CHILD:function(e,t){var x=t[1],r=e;switch(x){case"only":case"first":while((r=r.previousSibling)){if(r.nodeType===1){return false}}if(x==="first"){return true}r=e;case"last":while((r=r.nextSibling)){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],A=t[3];if(s===1&&A===0){return true}var v=t[0],z=e.parentNode;if(z&&(z.sizcache!==v||!e.nodeIndex)){var u=0;for(r=z.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}z.sizcache=v}var y=e.nodeIndex-A;if(s===0){return y===0}else{return(y%s===0&&y/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName.toLowerCase()===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),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!==r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.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 k=f.match.POS,g=function(r,e){return"\\"+(e-0+1)};for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+(/(?![^\[]*\])(?![^\(]*\))/.source));f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source.replace(/\\(\d+)/g,g))}var a=function(r,e){r=Array.prototype.slice.call(r,0);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(l){a=function(u,t){var r=t||[],s=0;if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var e=u.length;s<e;s++){r.push(u[s])}}else{for(;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){if(!r.compareDocumentPosition||!e.compareDocumentPosition){if(r==e){o=true}return r.compareDocumentPosition?-1:1}var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){o=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){if(!r.sourceIndex||!e.sourceIndex){if(r==e){o=true}return r.sourceIndex?-1:1}var s=r.sourceIndex-e.sourceIndex;if(s===0){o=true}return s}}else{if(document.createRange){c=function(t,r){if(!t.ownerDocument||!r.ownerDocument){if(t==r){o=true}return t.ownerDocument?-1:1}var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.setStart(t,0);s.setEnd(t,0);e.setStart(r,0);e.setEnd(r,0);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){o=true}return u}}}}b.getText=function(e){var r="",t;for(var s=0;e[s];s++){t=e[s];if(t.nodeType===3||t.nodeType===4){r+=t.nodeValue}else{if(t.nodeType!==8){r+=b.getText(t.childNodes)}}}return r};(function(){var r=document.createElement("div"),s="script"+(new Date()).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){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);e=r=null})();(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="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!b.isXML(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}s=null})()}(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(!e.getElementsByClassName||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])}};e=null})();function n(r,x,v,A,y,z){for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName.toLowerCase()===x){u=e;break}e=e[r]}A[t]=u}}}function q(r,x,v,A,y,z){for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof x!=="string"){if(e===x){u=true;break}}else{if(b.filter(x,[e]).length>0){u=e;break}}}e=e[r]}A[t]=u}}}b.contains=document.compareDocumentPosition?function(r,e){return !!(r.compareDocumentPosition(e)&16)}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};b.isXML=function(e){var r=(e?e.ownerDocument||e:0).documentElement;return r?r.nodeName!=="HTML":false};var h=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x<r;x++){b(e,s[x],t)}return b.filter(u,t)};window.tinymce.dom.Sizzle=b})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=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){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}if(c.isIE&&i.boxModel){this._fixIESelection()}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(j,i){var g=this,k=g.getRng(),n,l=g.win.document;i=i||{format:"html"};i.set=true;j=i.content=g.dom.processHTML(j);g.onBeforeSetContent.dispatch(g,i);j=i.content;if(k.insertNode){j+='<span id="__caret">_</span>';if(k.startContainer==l&&k.endContainer==l){l.body.innerHTML=j}else{k.deleteContents();if(l.body.childNodes.length==0){l.body.innerHTML=j}else{if(k.createContextualFragment){k.insertNode(k.createContextualFragment(j))}else{var m=l.createDocumentFragment(),f=l.createElement("div");m.appendChild(f);f.outerHTML=j;k.insertNode(m)}}}n=g.dom.get("__caret");k=l.createRange();k.setStartBefore(n);k.setEndBefore(n);g.setRng(k);g.dom.remove("__caret")}else{if(k.item){l.execCommand("Delete",false,null);k=g.getRng()}k.pasteHTML(j)}g.onSetContent.dispatch(g,i)},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}if(h&&h.nodeName=="BODY"){return h.firstChild||h}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(q,r){var u=this,m=u.dom,g,j,i,n,h,o,p,l="\uFEFF",s;function f(v,x){var t=0;d(m.select(v),function(z,y){if(z==x){t=y}});return t}if(q==2){function k(){var v=u.getRng(true),t=m.getRoot(),x={};function y(B,G){var A=B[G?"startContainer":"endContainer"],F=B[G?"startOffset":"endOffset"],z=[],C,E,D=0;if(A.nodeType==3){if(r){for(C=A.previousSibling;C&&C.nodeType==3;C=C.previousSibling){F+=C.nodeValue.length}}z.push(F)}else{E=A.childNodes;if(F>=E.length&&E.length){D=1;F=Math.max(0,E.length-1)}z.push(u.dom.nodeIndex(E[F],r)+D)}for(;A&&A!=t;A=A.parentNode){z.push(u.dom.nodeIndex(A,r))}return z}x.start=y(v,true);if(!u.isCollapsed()){x.end=y(v)}return x}return k()}if(q){return{rng:u.getRng()}}g=u.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();s="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();g.collapse();g.pasteHTML('<span _mce_type="bookmark" id="'+i+'_start" style="'+s+'">'+l+"</span>");if(!n){j.collapse(false);j.pasteHTML('<span _mce_type="bookmark" id="'+i+'_end" style="'+s+'">'+l+"</span>")}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=u.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_end",style:s},l))}g.collapse(true);g.insertNode(m.create("span",{_mce_type:"bookmark",id:i+"_start",style:s},l))}u.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(r.tridentSel){r.tridentSel.destroy()}if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(u.length){x=u[t[v]]}}if(z){f.setStart(x,t[0])}else{f.setEnd(x,t[0])}}}g(true);g();r.setRng(f)}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3&&!c.isOpera){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(!a&&l.isBlock(t)&&!t.innerHTML){t.innerHTML='<br _mce_bogus="1" />'}return t}k("start");k("end");if(j){f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g);return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||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(l){var g=this,h,i,k,j=g.win.document;if(l&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():j.createRange())}}catch(f){}if(c.isIE&&i.setStart&&j.selection.createRange().item){k=j.selection.createRange().item(0);i=j.createRange();i.setStartBefore(k);i.setEndAfter(k)}if(!i){i=j.createRange?j.createRange():j.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;h.removeAllRanges();h.addRange(i);g.selectedRange=h.getRangeAt(0)}}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 g=this,f=g.getRng(),h=g.getSel(),i;if(f.setStart){if(!f){return g.dom.getRoot()}i=f.commonAncestorContainer;if(!f.collapsed){if(f.startContainer==f.endContainer){if(f.startOffset-f.endOffset<2){if(f.startContainer.hasChildNodes()){i=f.startContainer.childNodes[f.startOffset]}}}if(c.isWebKit&&h.anchorNode&&h.anchorNode.nodeType==1){return h.anchorNode.childNodes[h.anchorOffset]}}if(i&&i.nodeType==3){return i.parentNode}return i}return f.item?f.item(0):f.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)}},_fixIESelection:function(){var m=this.dom,l=m.doc,g=l.body,i,j;l.documentElement.unselectable=true;function k(n,q){var o=g.createTextRange();try{o.moveToPoint(n,q)}catch(p){o=null}return o}function h(o){var n;if(o.button){n=k(o.x,o.y);if(n){if(n.compareEndPoints("StartToStart",j)>0){n.setEndPoint("StartToStart",j)}else{n.setEndPoint("EndToEnd",j)}n.select()}}else{f()}}function f(){m.unbind(l,"mouseup",f);m.unbind(l,"mousemove",h);i=0}m.bind(l,"mousedown",function(n){if(n.target.nodeName==="HTML"){if(i){f()}i=1;j=k(n.x,n.y);if(j){m.bind(l,"mouseup",f);m.bind(l,"mousemove",h);m.win.focus();j.select()}}})}})})(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[^>]*>|<\/html>|<html\/>|<!DOCTYPE[^>]+>/g,"");b=b.replace(/ ?\/>/g," />");if(this.valid){b=b.replace(/\%MCGT%/g,">")}return b}})})(tinymce);(function(c){var d=/[&\"<>]/g,b=/[<>&]/g,a={"&":"&",'"':""","<":"<",">":">"};c.create("tinymce.dom.StringWriter",{str:null,tags:null,count:0,settings:null,indent:null,StringWriter:function(e){this.settings=c.extend({indent_char:" ",indentation:0},e);this.reset()},reset:function(){this.indent="";this.str="";this.tags=[];this.count=0},writeStartElement:function(e){this._writeAttributesEnd();this.writeRaw("<"+e);this.tags.push(e);this.inAttr=true;this.count++;this.elementCount=this.count;this.attrs={}},writeAttribute:function(g,e){var f=this;if(!f.attrs[g]){f.writeRaw(" "+f.encode(g,true)+'="'+f.encode(e,true)+'"');f.attrs[g]=e}},writeEndElement:function(){var e;if(this.tags.length>0){e=this.tags.pop();if(this._writeAttributesEnd(1)){this.writeRaw("</"+e+">")}if(this.settings.indentation>0){this.writeRaw("\n")}}},writeFullEndElement:function(){if(this.tags.length>0){this._writeAttributesEnd();this.writeRaw("</"+this.tags.pop()+">");if(this.settings.indentation>0){this.writeRaw("\n")}}},writeText:function(e){this._writeAttributesEnd();this.writeRaw(this.encode(e));this.count++},writeCDATA:function(e){this._writeAttributesEnd();this.writeRaw("<![CDATA["+e+"]]>");this.count++},writeComment:function(e){this._writeAttributesEnd();this.writeRaw("<!--"+e+"-->");this.count++},writeRaw:function(e){this.str+=e},encode:function(f,e){return f.replace(e?d:b,function(g){return a[g]})},getContent:function(){return this.str},_writeAttributesEnd:function(e){if(!this.inAttr){return}this.inAttr=false;if(e&&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()}if(e.isIE&&document.documentMode>8){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,invalid_elements:0,fix_table_elements:1,fix_list_elements:true,fix_content_duplication:true,convert_fonts_to_spans:false,font_size_classes: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;i.schema=j.schema;if(j.entity_encoding=="named"&&!j.entities){j.entity_encoding="raw"}if(j.remove_redundant_brs){i.onPostProcess.add(function(k,l){l.content=l.content.replace(/(<br \/>\s*)+<\/(p|h[1-6]|div|li)>/gi,function(n,m,o){if(/^<br \/>\s*<\//.test(n)){return"</"+o+">"}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,z,y=["ol","ul"],u,t,q,k=/^(OL|UL)$/,A;function m(r,x){var o=x.split(","),p;while((r=r.previousSibling)!=null){for(p=0;p<o.length;p++){if(r.nodeName==o[p]){return r}}}return null}for(z=0;z<y.length;z++){l=i.dom.select(y[z],s.node);for(u=0;u<l.length;u++){t=l[u];q=t.parentNode;if(k.test(q.nodeName)){A=m(t,"LI");if(!A){A=i.dom.create("li");A.innerHTML=" ";A.appendChild(t);q.insertBefore(A,q.firstChild)}else{A.appendChild(t)}}}}})}if(j.fix_table_elements){i.onPreProcess.add(function(k,l){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(o){var n=this,j,m,h={},k;if(n.entityLookup){return}j=o.split(",");for(m=0;m<j.length;m+=2){k=j[m];if(k==34||k==38||k==60||k==62){continue}h[String.fromCharCode(j[m])]=j[m+1];k=parseInt(j[m]).toString(16)}n.entityLookup=h},setRules:function(i){var h=this;h._setup();h.rules={};h.wildRules=[];h.validElements={};return h.addRules(i)},addRules:function(i){var h=this,j;if(!i){return}h._setup();f(i.split(","),function(m){var q=m.split(/\[|\]/),l=q[0].split("/"),r,k,o,n=[];if(j){k=e.extend([],j.attribs)}if(q.length>1){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<k.length;t++){if(k[t].name==u[2]){k.splice(t,1);return}}}switch(u[3]){case"=":p.defaultVal=u[4]||"";break;case":":p.forcedVal=u[4];break;case"<":p.validVals=u[4].split("?");break}if(/[*.?]/.test(u[2])){o=o||[];p.nameRE=new RegExp("^"+c(u[2])+"$");o.push(p)}else{p.name=u[2];k.push(p)}n.push(u[2])})}f(l,function(v,u){var y=v.charAt(0),t=1,p={};if(j){if(j.noEmpty){p.noEmpty=j.noEmpty}if(j.fullEnd){p.fullEnd=j.fullEnd}if(j.padd){p.padd=j.padd}}switch(y){case"-":p.noEmpty=true;break;case"+":p.fullEnd=true;break;case"#":p.padd=true;break;default:t=0}l[u]=v=v.substring(t);h.validElements[v]=1;if(/[*.?]/.test(l[0])){p.nameRE=new RegExp("^"+c(l[0])+"$");h.wildRules=h.wildRules||{};h.wildRules.push(p)}else{p.name=l[0];if(l[0]=="@"){j=p}h.rules[v]=p}p.attribs=k;if(r){p.requiredAttribs=r}if(o){v="";f(n,function(s){if(v){v+="|"}v+="("+c(s)+")"});p.validAttribsRE=new RegExp("^"+v.toLowerCase()+"$");p.wildAttribs=o}})});i="";f(h.validElements,function(m,l){if(i){i+="|"}if(l!="@"){i+=l}});h.validElementsRE=new RegExp("^("+c(i.toLowerCase())+")$")},findRule:function(m){var j=this,l=j.rules,h,k;j._setup();k=l[m];if(k){return k}l=j.wildRules;for(h=0;h<l.length;h++){if(l[h].nameRE.test(m)){return l[h]}}return null},findAttribRule:function(h,l){var j,k=h.wildAttribs;for(j=0;j<k.length;j++){if(k[j].nameRE.test(l)){return k[j]}}return null},serialize:function(r,q){var m,k=this,p,i,j,l;k._setup();q=q||{};q.format=q.format||"html";k.processObj=q;if(d){l=[];f(r.getElementsByTagName("option"),function(o){var h=k.dom.getAttrib(o,"selected");l.push(h?h:null)})}r=r.cloneNode(true);if(d){f(r.getElementsByTagName("option"),function(o,h){k.dom.setAttrib(o,"selected",l[h])})}j=r.ownerDocument.implementation;if(j.createHTMLDocument){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._info=q;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[^>]*>)(.*?)(<\/script>)/g},{pattern:/(<noscript[^>]*>)(.*?)(<\/noscript>)/g},{pattern:/(<style[^>]*>)(.*?)(<\/style>)/g},{pattern:/(<pre[^>]*>)(.*?)(<\/pre>)/g,encode:1},{pattern:/(<!--\[CDATA\[)(.*?)(\]\]-->)/g}]});j=l.content;if(k.entity_encoding!=="raw"){j=i._encode(j)}if(!n.set){j=e._replace(/<p>\s+<\/p>|<p([^>]+)>\s+<\/p>/g,k.entity_encoding=="numeric"?"<p$1> </p>":"<p$1> </p>",j);if(k.remove_linebreaks){j=j.replace(/\r?\n|\r/g," ");j=e._replace(/(<[^>]+>)\s+/g,"$1 ",j);j=e._replace(/\s+(<\/[^>]+>)/g," $1",j);j=e._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=e._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=e._replace(/\s+<\/(p|h[1-6]|blockquote|hr|div|table|tbody|tr|td|body|head|html|title|meta|style|pre|script|link|object)>/g,"</$1>",j)}if(k.apply_source_formatting&&k.indent_mode=="simple"){j=e._replace(/<(\/?)(ul|hr|table|meta|link|tbody|tr|object|body|head|html|map)(|[^>]+)>\s*/g,"\n<$1$2$3>\n",j);j=e._replace(/\s*<(p|h[1-6]|blockquote|div|title|style|pre|script|td|li|area)(|[^>]+)>/g,"\n<$1$2>",j);j=e._replace(/<\/(p|h[1-6]|blockquote|div|title|style|pre|script|td|li)>\s*/g,"</$1>\n",j);j=j.replace(/\n\n/g,"\n")}}j=i._unprotect(j,l);j=e._replace(/<!--\[CDATA\[([\s\S]+)\]\]-->/g,"<![CDATA[$1]]>",j);if(k.entity_encoding=="raw"){j=e._replace(/<p> <\/p>|<p([^>]+)> <\/p>/g,"<p$1>\u00a0</p>",j)}j=j.replace(/<noscript([^>]+|)>([\s\S]*?)<\/noscript>/g,function(h,p,o){return"<noscript"+p+">"+i.dom.decode(o.replace(/<!--|-->/g,""))+"</noscript>"})}n.content=j},_serializeNode:function(E,J){var A=this,B=A.settings,y=A.writer,q,j,u,G,F,I,C,h,z,k,r,D,p,m,H,o,x;if(!B.node_filter||B.node_filter(E)){switch(E.nodeType){case 1:if(E.hasAttribute?E.hasAttribute("_mce_bogus"):E.getAttribute("_mce_bogus")){return}p=H=false;q=E.hasChildNodes();k=E.getAttribute("_mce_name")||E.nodeName.toLowerCase();o=E.getAttribute("_mce_type");if(o){if(!A._info.cleanup){p=true;return}else{H=1}}if(d){x=E.scopeName;if(x&&x!=="HTML"&&x!=="html"){k=x+":"+k}}if(k.indexOf("mce:")===0){k=k.substring(4)}if(!H){if(!A.validElementsRE||!A.validElementsRE.test(k)||(A.invalidElementsRE&&A.invalidElementsRE.test(k))||J){p=true;break}}if(d){if(B.fix_content_duplication){if(E._mce_serialized==A.key){return}E._mce_serialized=A.key}if(k.charAt(0)=="/"){k=k.substring(1)}}else{if(a){if(E.nodeName==="BR"&&E.getAttribute("type")=="_moz"){return}}}if(B.validate_children){if(A.elementName&&!A.schema.isValid(A.elementName,k)){p=true;break}A.elementName=k}r=A.findRule(k);if(!r){p=true;break}k=r.name||k;m=B.closed.test(k);if((!q&&r.noEmpty)||(d&&!k)){p=true;break}if(r.requiredAttribs){I=r.requiredAttribs;for(G=I.length-1;G>=0;G--){if(this.dom.getAttrib(E,I[G])!==""){break}}if(G==-1){p=true;break}}y.writeStartElement(k);if(r.attribs){for(G=0,C=r.attribs,F=C.length;G<F;G++){I=C[G];z=A._getAttrib(E,I);if(z!==null){y.writeAttribute(I.name,z)}}}if(r.validAttribsRE){C=A.dom.getAttribs(E);for(G=C.length-1;G>-1;G--){h=C[G];if(h.specified){I=h.nodeName.toLowerCase();if(B.invalid_attrs.test(I)||!r.validAttribsRE.test(I)){continue}D=A.findAttribRule(r,I);z=A._getAttrib(E,D,I);if(z!==null){y.writeAttribute(I,z)}}}}if(o&&H){y.writeAttribute("_mce_type",o)}if(k==="script"&&e.trim(E.innerHTML)){y.writeText("// ");y.writeCDATA(E.innerHTML.replace(/<!--|-->|<\[CDATA\[|\]\]>/g,""));q=false;break}if(r.padd){if(q&&(u=E.firstChild)&&u.nodeType===1&&E.childNodes.length===1){if(u.hasAttribute?u.hasAttribute("_mce_bogus"):u.getAttribute("_mce_bogus")){y.writeText("\u00a0")}}else{if(!q){y.writeText("\u00a0")}}}break;case 3:if(B.validate_children&&A.elementName&&!A.schema.isValid(A.elementName,"#text")){return}return y.writeText(E.nodeValue);case 4:return y.writeCDATA(E.nodeValue);case 8:return y.writeComment(E.nodeValue)}}else{if(E.nodeType==1){q=E.hasChildNodes()}}if(q&&!m){u=E.firstChild;while(u){A._serializeNode(u);A.elementName=k;u=u.nextSibling}}if(!p){if(!m){y.writeFullEndElement()}else{y.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+"<!--mce:"+(j.items.length-1)+"-->"+p}))});return j},_unprotect:function(i,j){i=i.replace(/\<!--mce:([0-9]+)--\>/g,function(k,h){return j.items[parseInt(h)]});j.items=[];return i},_encode:function(m){var j=this,k=j.settings,i;if(k.entity_encoding!=="raw"){if(k.entity_encoding.indexOf("named")!=-1){j.setEntities(k.entities);i=j.entityLookup;m=m.replace(/[\u007E-\uFFFF]/g,function(h){var l;if(l=i[h]){h="&"+l+";"}return h})}if(k.entity_encoding.indexOf("numeric")!=-1){m=m.replace(/[\u007E-\uFFFF]/g,function(h){return"&#"+h.charCodeAt(0)+";"})}}return m},_setup:function(){var h=this,i=this.settings;if(h.done){return}h.done=1;h.setRules(i.valid_elements);h.addRules(i.extended_valid_elements);if(i.invalid_elements){h.invalidElementsRE=new RegExp("^("+c(i.invalid_elements.replace(/,/g,"|").toLowerCase())+")$")}if(i.attrib_value_filter){h.attribValueFilter=i.attribValueFilter}},_getAttrib:function(m,j,h){var l,k;h=h||j.name;if(j.forcedVal&&(k=j.forcedVal)){if(k==="{$uid}"){return this.dom.uniqueId()}return k}k=this.dom.getAttrib(m,h);switch(h){case"rowspan":case"colspan":if(k=="1"){k=""}break}if(this.attribValueFilter){k=this.attribValueFilter(h,k,m)}if(j.validVals){for(l=j.validVals.length-1;l>=0;l--){if(k==j.validVals[l]){break}}if(l==-1){return null}}if(k===""&&typeof(j.defaultVal)!="undefined"){k=j.defaultVal;if(k==="{$uid}"){return this.dom.uniqueId()}return k}else{if(h=="class"&&this.processObj.get){k=k.replace(/\s?mceItem\w+\s?/g,"")}}if(k===""){return null}return k}})})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,u){var v=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}u()}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(x){var t=q.create("script",{type:"text/javascript"});t.text=x;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()}});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});if(!a.isIE){s.onload=p}s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}};(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","lastSibling",e))}};(function(){var a={};function b(f,e){var d;function c(g){return g.replace(/[A-Z]+/g,function(h){return c(f[h])})}for(d in f){if(f.hasOwnProperty(d)){f[d]=c(f[d])}}c(e).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]/g,function(l,g,j){var h,k={};j=j.split(/\|/);for(h=j.length-1;h>=0;h--){k[j[h]]=1}a[g]=k})}b({Z:"#|H|K|N|O|P",Y:"#|X|form|R|Q",X:"p|T|div|U|W|isindex|fieldset|table",W:"pre|hr|blockquote|address|center|noframes",U:"ul|ol|dl|menu|dir",ZC:"#|p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"#|X|S|Q",S:"R|P",ZA:"#|a|G|J|M|O|P",R:"#|a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe"},"script[]style[]object[#|param|X|form|a|H|K|N|O|Q]param[]p[S]a[Z]br[]span[S]bdo[S]applet[#|param|X|form|a|H|K|N|O|Q]h1[S]img[]map[X|form|Q|area]h2[S]iframe[#|X|form|a|H|K|N|O|Q]h3[S]tt[S]i[S]b[S]u[S]s[S]strike[S]big[S]small[S]font[S]basefont[]em[S]strong[S]dfn[S]code[S]q[S]samp[S]kbd[S]var[S]cite[S]abbr[S]acronym[S]sub[S]sup[S]input[]select[optgroup|option]optgroup[option]option[]textarea[]label[S]button[#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[S]ins[#|X|form|a|H|K|N|O|Q]h5[S]del[#|X|form|a|H|K|N|O|Q]h6[S]div[#|X|form|a|H|K|N|O|Q]ul[li]li[#|X|form|a|H|K|N|O|Q]ol[li]dl[dt|dd]dt[S]dd[#|X|form|a|H|K|N|O|Q]menu[li]dir[li]pre[ZA]hr[]blockquote[#|X|form|a|H|K|N|O|Q]address[S|p]center[#|X|form|a|H|K|N|O|Q]noframes[#|X|form|a|H|K|N|O|Q]isindex[]fieldset[#|legend|X|form|a|H|K|N|O|Q]legend[S]table[caption|col|colgroup|thead|tfoot|tbody|tr]caption[S]col[]colgroup[col]thead[tr]tr[th|td]th[#|X|form|a|H|K|N|O|Q]form[#|X|a|H|K|N|O|Q]noscript[#|X|form|a|H|K|N|O|Q]td[#|X|form|a|H|K|N|O|Q]tfoot[tr]tbody[tr]area[]base[]body[#|X|form|a|H|K|N|O|Q]");tinymce.dom.Schema=function(){var c=this,d=a;c.isValid=function(f,e){var g=d[f];return !!(g&&(!e||g[e]))}}})();(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,r){var h=d.startContainer,k=d.startOffset,s=d.endContainer,l=d.endOffset,i,f,n,g,q,p,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(t){r([t])});return}function o(v,u,t){var x=[];for(;v&&v!=t;v=v[u]){x.push(v)}return x}function m(u,t){do{if(u.parentNode==t){return u}u=u.parentNode}while(u)}function j(v,u,x){var t=x?"nextSibling":"previousSibling";for(g=v,q=g.parentNode;g&&g!=u;g=q){q=g.parentNode;p=o(g==v?g:g[t],t);if(p.length){if(!x){p.reverse()}r(p)}}}if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[k]}if(s.nodeType==1&&s.hasChildNodes()){s=s.childNodes[Math.min(k==l?l:l-1,s.childNodes.length-1)]}i=c.findCommonAncestor(h,s);if(h==s){return r([h])}for(g=h;g;g=g.parentNode){if(g==s){return j(h,i,true)}if(g==i){break}}for(g=s;g;g=g.parentNode){if(g==h){return j(s,i)}if(g==i){break}}f=m(h,i)||h;n=m(s,i)||s;j(h,f,true);p=o(f==h?f:f.nextSibling,"nextSibling",n==s?n.nextSibling:n);if(p.length){r(p)}j(s,n)}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&c.startOffset==b.startOffset}}return false}})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(e,d){this.id=e;this.settings=d=d||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=d.scope||this;this.disabled=0;this.active=0},setDisabled:function(d){var f;if(d!=this.disabled){f=b.get(this.id);if(f&&this.settings.unavailable_prefix){if(d){this.prevTitle=f.title;f.title=this.settings.unavailable_prefix+": "+f.title}else{f.title=this.prevTitle}}this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(b,a){this.parent(b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator"},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}z.onShowMenu.dispatch(z);if(A.keyboard_focus){a.add(o,"keydown",z._keyHandler,z);c.select("a","menu_"+z.id)[0].focus();z._focusIdx=0}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);a.remove(h,"mouseover",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000"});k=c.add(g,"div",{id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_keyHandler:function(j){var i=this,h=j.keyCode;function g(m){var k=i._focusIdx+m,l=c.select("a","menu_"+i.id)[k];if(l){i._focusIdx=k;l.focus()}}switch(h){case 38:g(-1);return;case 40:g(1);return;case 13:return;case 27:return this.hideMenu()}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,"td");i=p=c.add(i,"a",{href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(d,c){this.parent(d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" />'+c+"</a>"}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")+"</a>"}return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(h,g){var f=this;f.parent(h,g);f.items=[];f.onChange=new a(f);f.onPostRender=new a(f);f.onAdd=new a(f);f.onRenderMenu=new d.util.Dispatcher(this);f.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle")}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<table id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("a",{id:f.id+"_text",href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},"<span></span>")+"</td>";i+="</tr></tbody></table>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(g.hideMenu,g);f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id+"_text","focus",function(){if(!f._focused){f.keyDownHandler=b.add(f.id+"_text","keydown",function(k){var h=-1,i,j=k.keyCode;e(f.items,function(l,m){if(f.selectedValue==l.value){h=m}});if(j==38){i=f.items[h-1]}else{if(j==40){i=f.items[h+1]}else{if(j==13){i=f.selectedValue;f.selectedValue=null;f.settings.onselect(i);return b.cancel(k)}}}if(i){f.hideMenu();f.select(i.value)}})}f._focused=1});b.add(f.id+"_text","blur",function(){b.remove(f.id+"_text","keydown",f.keyDownHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox"},g);return g},postRender:function(){var g=this,h;g.rendered=true;function f(j){var i=g.items[j.target.selectedIndex-1];if(i&&(i=i.value)){g.onChange.dispatch(g,i);if(g.settings.onselect){g.settings.onselect(i)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(j){var i;b.remove(g.id,"change",h);i=b.add(g.id,"blur",function(){b.add(g.id,"change",f);b.remove(g.id,"blur",i)});if(j.keyCode==13||j.keyCode==32){f(j);return b.cancel(j)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,e){this.parent(f,e);this.onRenderMenu=new c.util.Dispatcher(this);e.menu_container=e.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(f.hideMenu,f);f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(f,e){this.parent(f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,"class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}i+="<td>"+b.createHTML("a",{id:f.id+"_action",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]});i+="<td>"+b.createHTML("a",{id:f.id+"_open",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";return b.createHTML("table",{id:f.id,"class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",onmousedown:"return false;",title:g.title},i)},postRender:function(){var e=this,f=e.settings;if(f.onclick){a.add(e.id+"_action","click",function(){if(!e.isDisabled()){f.onclick(e.value)}})}a.add(e.id+"_open","click",e.showMenu,e);a.add(e.id+"_open","focus",function(){e._focused=1});a.add(e.id+"_open","blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(h,g){var f=this;f.parent(h,g);f.settings=g=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},f.settings);f.onShowMenu=new d.util.Dispatcher(f);f.onHideMenu=new d.util.Dispatcher(f);f.value=g.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.onHideMenu.dispatch(f);f.isMenuVisible=0},renderMenu:function(){var k=this,f,j=0,l=k.settings,p,h,o,g;g=c.add(l.menu_container,"div",{id:k.id+"_menu","class":l.menu_class+" "+l["class"],style:"position:absolute;left:0;top:-1000px;"});f=c.add(g,"div",{"class":l["class"]+" mceSplitButtonMenu"});c.add(f,"span",{"class":"mceMenuLine"});p=c.add(f,"table",{"class":"mceColorSplitMenu"});h=c.add(p,"tbody");j=0;e(b(l.colors,"array")?l.colors:l.colors.split(","),function(i){i=i.replace(/^#/,"");if(!j--){o=c.add(h,"tr");j=l.grid_width-1}p=c.add(o,"td");p=c.add(p,"a",{href:"javascript:;",style:{backgroundColor:"#"+i},_mce_color:"#"+i})});if(l.more_colors_func){p=c.add(h,"tr");p=c.add(p,"td",{colspan:l.grid_width,"class":"mceMoreColors"});p=c.add(p,"a",{id:k.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},l.more_colors_title);a.add(p,"click",function(i){l.more_colors_func.call(l.more_colors_scope||this);return a.cancel(i)})}c.addClass(f,"mceColorSplitMenu");a.add(k.id+"_menu","click",function(i){var m;i=i.target;if(i.nodeName=="A"&&(m=i.getAttribute("_mce_color"))){k.setColor(m)}return a.cancel(i)});return g},setColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g;f.hideMenu();f.settings.onselect(g)},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);tinymce.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var l=this,e="",g,j,b=tinymce.DOM,m=l.settings,d,a,f,k;k=l.controls;for(d=0;d<k.length;d++){j=k[d];a=k[d-1];f=k[d+1];if(d===0){g="mceToolbarStart";if(j.Button){g+=" mceToolbarStartButton"}else{if(j.SplitButton){g+=" mceToolbarStartSplitButton"}else{if(j.ListBox){g+=" mceToolbarStartListBox"}}}e+=b.createHTML("td",{"class":g},b.createHTML("span",null,"<!-- IE -->"))}if(a&&j.ListBox){if(a.Button||a.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarEnd"},b.createHTML("span",null,"<!-- IE -->"))}}if(b.stdMode){e+='<td style="position: relative">'+j.renderHTML()+"</td>"}else{e+="<td>"+j.renderHTML()+"</td>"}if(f&&j.ListBox){if(f.Button||f.SplitButton){e+=b.createHTML("td",{"class":"mceToolbarStart"},b.createHTML("span",null,"<!-- IE -->"))}}}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,"<!-- IE -->"));return b.createHTML("table",{id:l.id,"class":"mceToolbar"+(m["class"]?" "+m["class"]:""),cellpadding:"0",cellspacing:"0",align:l.settings.align||""},"<tbody><tr>"+e+"</tr></tbody>")}});(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){return this.lookup[d]},requireLangPack:function(e){var d=b.settings;if(d&&d.language){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},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("/"));if(!f.lookup[h]){b.ScriptLoader.add(e,d,g)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE){function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(m){var n=m.DOM,j=m.dom.Event,f=m.extend,k=m.util.Dispatcher,i=m.each,a=m.isGecko,b=m.isIE,e=m.isWebKit,d=m.is,h=m.ThemeManager,c=m.PluginManager,o=m.inArray,l=m.grep,g=m.explode;m.create("tinymce.Editor",{Editor:function(r,q){var p=this;p.id=p.editorId=r;p.execCommands={};p.queryStateCommands={};p.queryValueCommands={};p.isNotDirty=false;p.plugins={};i(["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){p[s]=new k(p)});p.settings=q=f({id:r,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:m.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:m.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual_table_class:"mceItemTable",visual:1,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<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite],-table[border|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value|tabindex|accesskey],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true},q);p.documentBaseURI=new m.util.URI(q.document_base_url||m.documentBaseURL,{base_uri:tinyMCE.baseURI});p.baseURI=m.baseURI;p.execCallback("setup",p)},render:function(r){var u=this,v=u.settings,x=u.id,p=m.ScriptLoader;if(!j.domLoaded){j.add(document,"init",function(){u.render()});return}tinyMCE.settings=v;if(!u.getElement()){return}if(m.isIDevice){return}if(!/TEXTAREA|INPUT/i.test(u.getElement().nodeName)&&v.hidden_input&&n.getParent(x,"form")){n.insertAfter(n.create("input",{type:"hidden",name:x}),x)}if(m.WindowManager){u.windowManager=new m.WindowManager(u)}if(v.encoding=="xml"){u.onGetContent.add(function(s,t){if(t.save){t.content=n.encode(t.content)}})}if(v.add_form_submit_trigger){u.onSubmit.addToTop(function(){if(u.initialized){u.save();u.isNotDirty=1}})}if(v.add_unload_trigger){u._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(u.initialized&&!u.destroyed&&!u.isHidden()){u.save({format:"raw",no_events:true})}})}m.addUnload(u.destroy,u);if(v.submit_patch){u.onBeforeRenderUI.add(function(){var s=u.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){u.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){m.triggerSave();u.isNotDirty=1;return u.formElement._mceOldSubmit(u.formElement)}}s=null})}function q(){if(v.language){p.add(m.baseURL+"/langs/"+v.language+".js")}if(v.theme&&v.theme.charAt(0)!="-"&&!h.urls[v.theme]){h.load(v.theme,"themes/"+v.theme+"/editor_template"+m.suffix+".js")}i(g(v.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+m.suffix+".js")}});p.loadQueue(function(){if(!u.removed){u.init()}})}q()},init:function(){var r,E=this,F=E.settings,B,y,A=E.getElement(),q,p,C,x,z,D;m.add(E);if(F.theme){F.theme=F.theme.replace(/-/,"");q=h.get(F.theme);E.theme=new q();if(E.theme.init&&F.init_theme){E.theme.init(E,h.urls[F.theme]||m.documentBaseURL.replace(/\/$/,""))}}i(g(F.plugins.replace(/\-/g,"")),function(G){var H=c.get(G),t=c.urls[G]||m.documentBaseURL.replace(/\/$/,""),s;if(H){s=new H(E,t);E.plugins[G]=s;if(s.init){s.init(E,t)}}});if(F.popup_css!==false){if(F.popup_css){F.popup_css=E.documentBaseURI.toAbsolute(F.popup_css)}else{F.popup_css=E.baseURI.toAbsolute("themes/"+F.theme+"/skins/"+F.skin+"/dialog.css")}}if(F.popup_css_add){F.popup_css+=","+E.documentBaseURI.toAbsolute(F.popup_css_add)}E.controlManager=new m.ControlManager(E);if(F.custom_undo_redo){E.onBeforeExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){if(!E.undoManager.hasUndo()){E.undoManager.add()}}});E.onExecCommand.add(function(t,G,u,H,s){if(G!="Undo"&&G!="Redo"&&G!="mceRepaint"&&(!s||!s.skip_undo)){E.undoManager.add()}})}E.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){E.nodeChanged()}});if(a){function v(s,t){if(!t||!t.initial){E.execCommand("mceRepaint")}}E.onUndo.add(v);E.onRedo.add(v);E.onSetContent.add(v)}E.onBeforeRenderUI.dispatch(E,E.controlManager);if(F.render_ui){B=F.width||A.style.width||A.offsetWidth;y=F.height||A.style.height||A.offsetHeight;E.orgDisplay=A.style.display;D=/^[0-9\.]+(|px)$/i;if(D.test(""+B)){B=Math.max(parseInt(B)+(q.deltaWidth||0),100)}if(D.test(""+y)){y=Math.max(parseInt(y)+(q.deltaHeight||0),100)}q=E.theme.renderUI({targetNode:A,width:B,height:y,deltaWidth:F.delta_width,deltaHeight:F.delta_height});E.editorContainer=q.editorContainer}if(document.domain&&location.hostname!=document.domain){m.relaxedDomain=document.domain}n.setStyles(q.sizeContainer||q.editorContainer,{width:B,height:y});y=(q.iframeHeight||y)+(typeof(y)=="number"?(q.deltaHeight||0):"");if(y<100){y=100}E.iframeHTML=F.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(F.document_base_url!=m.documentBaseURL){E.iframeHTML+='<base href="'+E.documentBaseURI.getURI()+'" />'}E.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(m.relaxedDomain){E.iframeHTML+='<script type="text/javascript">document.domain = "'+m.relaxedDomain+'";<\/script>'}x=F.body_id||"tinymce";if(x.indexOf("=")!=-1){x=E.getParam("body_id","","hash");x=x[E.id]||x}z=F.body_class||"";if(z.indexOf("=")!=-1){z=E.getParam("body_class","","hash");z=z[E.id]||""}E.iframeHTML+='</head><body id="'+x+'" class="mceContentBody '+z+'"></body></html>';if(m.relaxedDomain){if(b||(m.isOpera&&parseFloat(opera.version())>=9.5)){C='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+E.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}else{if(m.isOpera){C='javascript:(function(){document.open();document.domain="'+document.domain+'";document.close();ed.setupIframe();})()'}}}r=n.add(q.iframeContainer,"iframe",{id:E.id+"_ifr",src:C||'javascript:""',frameBorder:"0",style:{width:"100%",height:y}});E.contentAreaContainer=q.iframeContainer;n.get(q.editorContainer).style.display=E.orgDisplay;n.get(E.id).style.display="none";if(!b||!m.relaxedDomain){E.setupIframe()}A=r=q=null},setupIframe:function(){var z=this,A=z.settings,r=n.get(z.id),u=z.getDoc(),q,x;if(!b||!m.relaxedDomain){u.open();u.write(z.iframeHTML);u.close()}if(!b){try{if(!A.readonly){u.designMode="On"}}catch(v){}}if(b){x=z.getBody();n.hide(x);if(!A.readonly){x.contentEditable=true}n.show(x)}z.dom=new m.dom.DOMUtils(z.getDoc(),{keep_values:true,url_converter:z.convertURL,url_converter_scope:z,hex_colors:A.force_hex_style_colors,class_filter:A.class_filter,update_styles:1,fix_ie_paragraphs:1,valid_styles:A.valid_styles});z.schema=new m.dom.Schema();z.serializer=new m.dom.Serializer(f(A,{valid_elements:A.verify_html===false?"*[*]":A.valid_elements,dom:z.dom,schema:z.schema}));z.selection=new m.dom.Selection(z.dom,z.getWin(),z.serializer);z.formatter=new m.Formatter(this);z.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img,table",styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img",styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b"}],italic:[{inline:"em"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"u"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){z.formatter.register(s,{block:s,remove:"all"})});z.formatter.register(z.settings.formats);z.undoManager=new m.UndoManager(z);z.undoManager.onAdd.add(function(t,s){if(!s.initial){return z.onChange.dispatch(z,s,t)}});z.undoManager.onUndo.add(function(t,s){return z.onUndo.dispatch(z,s,t)});z.undoManager.onRedo.add(function(t,s){return z.onRedo.dispatch(z,s,t)});z.forceBlocks=new m.ForceBlocks(z,{forced_root_block:A.forced_root_block});z.editorCommands=new m.EditorCommands(z);z.serializer.onPreProcess.add(function(s,t){return z.onPreProcess.dispatch(z,t,s)});z.serializer.onPostProcess.add(function(s,t){return z.onPostProcess.dispatch(z,t,s)});z.onPreInit.dispatch(z);if(!A.gecko_spellcheck){z.getBody().spellcheck=0}if(!A.readonly){z._addEvents()}z.controlManager.onPostRender.dispatch(z,z.controlManager);z.onPostRender.dispatch(z);if(A.directionality){z.getBody().dir=A.directionality}if(A.nowrap){z.getBody().style.whiteSpace="nowrap"}if(A.custom_elements){function y(s,t){i(g(A.custom_elements),function(B){var C;if(B.indexOf("~")===0){B=B.substring(1);C="span"}else{C="div"}t.content=t.content.replace(new RegExp("<("+B+")([^>]*)>","g"),"<"+C+' _mce_name="$1"$2>');t.content=t.content.replace(new RegExp("</("+B+")>","g"),"</"+C+">")})}z.onBeforeSetContent.add(y);z.onPostProcess.add(function(s,t){if(t.set){y(s,t)}})}if(A.handle_node_change_callback){z.onNodeChange.add(function(t,s,B){z.execCallback("handle_node_change_callback",z.id,B,-1,-1,true,z.selection.isCollapsed())})}if(A.save_callback){z.onSaveContent.add(function(s,B){var t=z.execCallback("save_callback",z.id,B.content,z.getBody());if(t){B.content=t}})}if(A.onchange_callback){z.onChange.add(function(t,s){z.execCallback("onchange_callback",z,s)})}if(A.convert_newlines_to_brs){z.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(A.fix_nesting&&b){z.onBeforeSetContent.add(function(s,t){t.content=z._fixNesting(t.content)})}if(A.preformatted){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(A.verify_css_classes){z.serializer.attribValueFilter=function(D,B){var C,t;if(D=="class"){if(!z.classesRE){t=z.dom.getClasses();if(t.length>0){C="";i(t,function(s){C+=(C?"|":"")+s["class"]});z.classesRE=new RegExp("("+C+")","gi")}}return !z.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(B)||z.classesRE.test(B)?B:""}return B}}if(A.cleanup_callback){z.onBeforeSetContent.add(function(s,t){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)});z.onPreProcess.add(function(s,t){if(t.set){z.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){z.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});z.onPostProcess.add(function(s,t){if(t.set){t.content=z.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=z.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(A.save_callback){z.onGetContent.add(function(s,t){if(t.save){t.content=z.execCallback("save_callback",z.id,t.content,z.getBody())}})}if(A.handle_event_callback){z.onEvent.add(function(s,t,B){if(z.execCallback("handle_event_callback",t,s,B)===false){j.cancel(t)}})}z.onSetContent.add(function(){z.addVisual(z.getBody())});if(A.padd_empty_editor){z.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>( | |\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function p(s,t){i(s.dom.select("a"),function(C){var B=C.parentNode;if(s.dom.isBlock(B)&&B.lastChild===C){s.dom.add(B,"br",{_mce_bogus:1})}})}z.onExecCommand.add(function(s,t){if(t==="CreateLink"){p(s)}});z.onSetContent.add(z.selection.onSetContent.add(p));if(!A.readonly){try{u.designMode="Off";u.designMode="On"}catch(v){}}}setTimeout(function(){if(z.removed){return}z.load({initial:true,format:(A.cleanup_on_startup?"html":"raw")});z.startContent=z.getContent({format:"raw"});z.initialized=true;z.onInit.dispatch(z);z.execCallback("setupcontent_callback",z.id,z.getBody(),z.getDoc());z.execCallback("init_instance_callback",z);z.focus(true);z.nodeChanged({initial:1});if(A.content_css){m.each(g(A.content_css),function(s){z.dom.loadCSS(z.documentBaseURI.toAbsolute(s))})}if(A.auto_focus){setTimeout(function(){var s=m.get(A.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);r=null},focus:function(s){var x,q=this,v=q.settings.content_editable,r,p,u=q.getDoc();if(!s){r=q.selection.getRng();if(r.item){p=r.item(0)}if(!v){q.getWin().focus()}if(p&&p.ownerDocument==u){r=u.body.createControlRange();r.addElement(p);r.select()}}if(m.activeEditor!=q){if((x=m.activeEditor)!=null){x.onDeactivate.dispatch(x,q)}q.onActivate.dispatch(q,x)}m._setActive(q)},execCallback:function(u){var p=this,r=p.settings[u],q;if(!r){return}if(p.callbackLookup&&(q=p.callbackLookup[u])){r=q.func;q=q.scope}if(d(r,"string")){q=r.replace(/\.\w+$/,"");q=q?m.resolve(q):0;r=m.resolve(r);p.callbackLookup=p.callbackLookup||{};p.callbackLookup[u]={func:r,scope:q}}return r.apply(q||p,Array.prototype.slice.call(arguments,1))},translate:function(p){var r=this.settings.language||"en",q=m.i18n;if(!p){return""}return q[r+"."+p]||p.replace(/{\#([^}]+)\}/g,function(t,s){return q[r+"."+s]||"{#"+s+"}"})},getLang:function(q,p){return m.i18n[(this.settings.language||"en")+"."+q]||(d(p)?p:"{#"+q+"}")},getParam:function(u,r,p){var s=m.trim,q=d(this.settings[u])?this.settings[u]:r,t;if(p==="hash"){t={};if(d(q,"string")){i(q.indexOf("=")>0?q.split(/[;,](?![^=;,]*(?:[;,]|$))/):q.split(","),function(x){x=x.split("=");if(x.length>1){t[s(x[0])]=s(x[1])}else{t[s(x[0])]=s(x)}})}else{t=q}return t}return q},nodeChanged:function(r){var p=this,q=p.selection,u=(b?q.getNode():q.getStart())||p.getBody();if(p.initialized){r=r||{};u=b&&u.ownerDocument!=p.getDoc()?p.getBody():u;r.parents=[];p.dom.getParent(u,function(s){if(s.nodeName=="BODY"){return true}r.parents.push(s)});p.onNodeChange.dispatch(p,r?r.controlManager||p.controlManager:p.controlManager,u,q.isCollapsed(),r)}},addButton:function(r,q){var p=this;p.buttons=p.buttons||{};p.buttons[r]=q},addCommand:function(r,q,p){this.execCommands[r]={func:q,scope:p||this}},addQueryStateHandler:function(r,q,p){this.queryStateCommands[r]={func:q,scope:p||this}},addQueryValueHandler:function(r,q,p){this.queryValueCommands[r]={func:q,scope:p||this}},addShortcut:function(r,u,p,s){var q=this,v;if(!q.settings.custom_shortcuts){return false}q.shortcuts=q.shortcuts||{};if(d(p,"string")){v=p;p=function(){q.execCommand(v,false,null)}}if(d(p,"object")){v=p;p=function(){q.execCommand(v[0],v[1],v[2])}}i(g(r),function(t){var x={func:p,scope:s||this,desc:u,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});q.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,v,z,p){var r=this,u=0,y,q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!p||!p.skip_focus)){r.focus()}y={};r.onBeforeExecCommand.dispatch(r,x,v,z,y);if(y.terminate){return false}if(r.execCallback("execcommand_callback",r.id,r.selection.getNode(),x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(y=r.execCommands[x]){q=y.func.call(y.scope,v,z);if(q!==true){r.onExecCommand.dispatch(r,x,v,z,p);return q}}i(r.plugins,function(s){if(s.execCommand&&s.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);u=1;return false}});if(u){return true}if(r.theme&&r.theme.execCommand&&r.theme.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(m.GlobalCommands.execCommand(r,x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(r.editorCommands.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}r.getDoc().execCommand(x,v,z);r.onExecCommand.dispatch(r,x,v,z,p)},queryCommandState:function(u){var q=this,v,r;if(q._isHidden()){return}if(v=q.queryStateCommands[u]){r=v.func.call(v.scope);if(r!==true){return r}}v=q.editorCommands.queryCommandState(u);if(v!==-1){return v}try{return this.getDoc().queryCommandState(u)}catch(p){}},queryCommandValue:function(v){var q=this,u,r;if(q._isHidden()){return}if(u=q.queryValueCommands[v]){r=u.func.call(u.scope);if(r!==true){return r}}u=q.editorCommands.queryCommandValue(v);if(d(u)){return u}try{return this.getDoc().queryCommandValue(v)}catch(p){}},show:function(){var p=this;n.show(p.getContainer());n.hide(p.id);p.load()},hide:function(){var p=this,q=p.getDoc();if(b&&q){q.execCommand("SelectAll")}p.save();n.hide(p.getContainer());n.setStyle(p.id,"display",p.orgDisplay)},isHidden:function(){return !n.isHidden(this.id)},setProgressState:function(p,q,r){this.onSetProgressState.dispatch(this,p,q,r);return p},load:function(s){var p=this,r=p.getElement(),q;if(r){s=s||{};s.load=true;q=p.setContent(d(r.value)?r.value:r.innerHTML,s);s.element=r;if(!s.no_events){p.onLoadContent.dispatch(p,s)}s.element=r=null;return q}},save:function(u){var p=this,s=p.getElement(),q,r;if(!s||!p.initialized){return}u=u||{};u.save=true;if(!u.no_events){p.undoManager.typing=0;p.undoManager.add()}u.element=s;q=u.content=p.getContent(u);if(!u.no_events){p.onSaveContent.dispatch(p,u)}q=u.content;if(!/TEXTAREA|INPUT/i.test(s.nodeName)){s.innerHTML=q;if(r=n.getParent(p.id,"form")){i(r.elements,function(t){if(t.name==p.id){t.value=q;return false}})}}else{s.value=q}u.element=s=null;return q},setContent:function(q,r){var p=this;r=r||{};r.format=r.format||"html";r.set=true;r.content=q;if(!r.no_events){p.onBeforeSetContent.dispatch(p,r)}if(!m.isIE&&(q.length===0||/^\s+$/.test(q))){r.content=p.dom.setHTML(p.getBody(),'<br _mce_bogus="1" />');r.format="raw"}r.content=p.dom.setHTML(p.getBody(),m.trim(r.content));if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;r.content=p.dom.setHTML(p.getBody(),p.serializer.serialize(p.getBody(),r))}if(!r.no_events){p.onSetContent.dispatch(p,r)}return r.content},getContent:function(r){var p=this,q;r=r||{};r.format=r.format||"html";r.get=true;if(!r.no_events){p.onBeforeGetContent.dispatch(p,r)}if(r.format!="raw"&&p.settings.cleanup){r.getInner=true;q=p.serializer.serialize(p.getBody(),r)}else{q=p.getBody().innerHTML}q=q.replace(/^\s*|\s*$/g,"");r.content=q;if(!r.no_events){p.onGetContent.dispatch(p,r)}return r.content},isDirty:function(){var p=this;return m.trim(p.startContent)!=m.trim(p.getContent({format:"raw",no_events:1}))&&!p.isNotDirty},getContainer:function(){var p=this;if(!p.container){p.container=n.get(p.editorContainer||p.id+"_parent")}return p.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return n.get(this.settings.content_element||this.id)},getWin:function(){var p=this,q;if(!p.contentWindow){q=n.get(p.id+"_ifr");if(q){p.contentWindow=q.contentWindow}}return p.contentWindow},getDoc:function(){var q=this,p;if(!q.contentDocument){p=q.getWin();if(p){q.contentDocument=p.document}}return q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(p,x,v){var q=this,r=q.settings;if(r.urlconverter_callback){return q.execCallback("urlconverter_callback",p,v,true,x)}if(!r.convert_urls||(v&&v.nodeName=="LINK")||p.indexOf("file:")===0){return p}if(r.relative_urls){return q.documentBaseURI.toRelative(p)}p=q.documentBaseURI.toAbsolute(p,r.remove_script_host);return p},addVisual:function(r){var p=this,q=p.settings;r=r||p.getBody();if(!d(p.hasVisual)){p.hasVisual=q.visual}i(p.dom.select("table,a",r),function(t){var s;switch(t.nodeName){case"TABLE":s=p.dom.getAttrib(t,"border");if(!s||s=="0"){if(p.hasVisual){p.dom.addClass(t,q.visual_table_class)}else{p.dom.removeClass(t,q.visual_table_class)}}return;case"A":s=p.dom.getAttrib(t,"name");if(s){if(p.hasVisual){p.dom.addClass(t,"mceItemAnchor")}else{p.dom.removeClass(t,"mceItemAnchor")}}return}});p.onVisualAid.dispatch(p,r,p.hasVisual)},remove:function(){var p=this,q=p.getContainer();p.removed=1;p.hide();p.execCallback("remove_instance_callback",p);p.onRemove.dispatch(p);p.onExecCommand.listeners=[];m.remove(p);n.remove(q)},destroy:function(q){var p=this;if(p.destroyed){return}if(!q){m.removeUnload(p.destroy);tinyMCE.onBeforeUnload.remove(p._beforeUnload);if(p.theme&&p.theme.destroy){p.theme.destroy()}p.controlManager.destroy();p.selection.destroy();p.dom.destroy();if(!p.settings.content_editable){j.clear(p.getWin());j.clear(p.getDoc())}j.clear(p.getBody());j.clear(p.formElement)}if(p.formElement){p.formElement.submit=p.formElement._mceOldSubmit;p.formElement._mceOldSubmit=null}p.contentAreaContainer=p.formElement=p.container=p.settings.content_element=p.bodyElement=p.contentDocument=p.contentWindow=null;if(p.selection){p.selection=p.selection.win=p.selection.dom=p.selection.dom.doc=null}p.destroyed=1},_addEvents:function(){var z=this,r,A=z.settings,q=z.dom,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function p(t,B){var s=t.type;if(z.removed){return}if(z.onEvent.dispatch(z,t,B)!==false){z[x[t.fakeType||t.type]].dispatch(z,t,B)}}i(x,function(t,s){switch(s){case"contextmenu":if(m.isOpera){q.bind(z.getBody(),"mousedown",function(B){if(B.ctrlKey){B.fakeType="contextmenu";p(B)}})}else{q.bind(z.getBody(),s,p)}break;case"paste":q.bind(z.getBody(),s,function(B){p(B)});break;case"submit":case"reset":q.bind(z.getElement().form||n.getParent(z.id,"form"),s,p);break;default:q.bind(A.content_editable?z.getBody():z.getDoc(),s,p)}});q.bind(A.content_editable?z.getBody():(a?z.getDoc():z.getWin()),"focus",function(s){z.focus(true)});if(m.isGecko){q.bind(z.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("_mce_src"))){t.src=z.documentBaseURI.toAbsolute(s)}})}if(a){function u(){var C=this,E=C.getDoc(),D=C.settings;if(a&&!D.readonly){if(C._isHidden()){try{if(!D.content_editable){E.designMode="On"}}catch(B){}}try{E.execCommand("styleWithCSS",0,false)}catch(B){if(!C._isHidden()){try{E.execCommand("useCSS",0,true)}catch(B){}}}if(!D.table_inline_editing){try{E.execCommand("enableInlineTableEditing",false,false)}catch(B){}}if(!D.object_resizing){try{E.execCommand("enableObjectResizing",false,false)}catch(B){}}}}z.onBeforeExecCommand.add(u);z.onMouseDown.add(u)}if(m.isWebKit){z.onClick.add(function(s,t){t=t.target;if(t.nodeName=="IMG"||(t.nodeName=="A"&&q.hasClass(t,"mceItemAnchor"))){z.selection.getSel().setBaseAndExtent(t,0,t,1);z.nodeChanged()}})}z.onMouseUp.add(z.nodeChanged);z.onKeyUp.add(function(s,t){var B=t.keyCode;if((B>=33&&B<=36)||(B>=37&&B<=40)||B==13||B==45||B==46||B==8||(m.isMac&&(B==91||B==93))||t.ctrlKey){z.nodeChanged()}});z.onReset.add(function(){z.setContent(z.startContent,{format:"raw"})});if(A.custom_shortcuts){if(A.custom_undo_redo_keyboard_shortcuts){z.addShortcut("ctrl+z",z.getLang("undo_desc"),"Undo");z.addShortcut("ctrl+y",z.getLang("redo_desc"),"Redo")}z.addShortcut("ctrl+b",z.getLang("bold_desc"),"Bold");z.addShortcut("ctrl+i",z.getLang("italic_desc"),"Italic");z.addShortcut("ctrl+u",z.getLang("underline_desc"),"Underline");for(r=1;r<=6;r++){z.addShortcut("ctrl+"+r,"",["FormatBlock",false,"h"+r])}z.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);z.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);z.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function v(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(z.shortcuts,function(B){if(m.isMac&&B.ctrl!=t.metaKey){return}else{if(!m.isMac&&B.ctrl!=t.ctrlKey){return}}if(B.alt!=t.altKey){return}if(B.shift!=t.shiftKey){return}if(t.keyCode==B.keyCode||(t.charCode&&t.charCode==B.charCode)){s=B;return false}});return s}z.onKeyUp.add(function(s,t){var B=v(t);if(B){return j.cancel(t)}});z.onKeyPress.add(function(s,t){var B=v(t);if(B){return j.cancel(t)}});z.onKeyDown.add(function(s,t){var B=v(t);if(B){B.func.call(B.scope);return j.cancel(t)}})}if(m.isIE){q.bind(z.getDoc(),"controlselect",function(B){var t=z.resizeInfo,s;B=B.target;if(B.nodeName!=="IMG"){return}if(t){q.unbind(t.node,t.ev,t.cb)}if(!q.hasClass(B,"mceItemNoResize")){ev="resizeend";s=q.bind(B,ev,function(D){var C;D=D.target;if(C=q.getStyle(D,"width")){q.setAttrib(D,"width",C.replace(/[^0-9%]+/g,""));q.setStyle(D,"width","")}if(C=q.getStyle(D,"height")){q.setAttrib(D,"height",C.replace(/[^0-9%]+/g,""));q.setStyle(D,"height","")}})}else{ev="resizestart";s=q.bind(B,"resizestart",j.cancel,j)}t=z.resizeInfo={node:B,ev:ev,cb:s}});z.onKeyDown.add(function(s,t){switch(t.keyCode){case 8:if(z.selection.getRng().item){s.dom.remove(z.selection.getRng().item(0));return j.cancel(t)}}})}if(m.isOpera){z.onClick.add(function(s,t){j.prevent(t)})}if(A.custom_undo_redo){function y(){z.undoManager.typing=0;z.undoManager.add()}q.bind(z.getDoc(),"focusout",function(s){if(!z.removed&&z.undoManager.typing){y()}});z.onKeyUp.add(function(s,t){if((t.keyCode>=33&&t.keyCode<=36)||(t.keyCode>=37&&t.keyCode<=40)||t.keyCode==13||t.keyCode==45||t.ctrlKey){y()}});z.onKeyDown.add(function(t,E){var s,D,C;if(b&&E.keyCode==46){s=z.selection.getRng();if(s.parentElement){D=s.parentElement();if(E.ctrlKey){s.moveEnd("word",1);s.select()}z.selection.getSel().clear();if(s.parentElement()==D){C=z.selection.getBookmark();try{D.innerHTML=D.innerHTML}catch(B){}z.selection.moveToBookmark(C)}E.preventDefault();return}}if((E.keyCode>=33&&E.keyCode<=36)||(E.keyCode>=37&&E.keyCode<=40)||E.keyCode==13||E.keyCode==45){if(z.undoManager.typing){y()}return}if(!z.undoManager.typing){z.undoManager.add();z.undoManager.typing=1}});z.onMouseDown.add(function(){if(z.undoManager.typing){y()}})}},_isHidden:function(){var p;if(!a){return 0}p=this.selection.getSel();return(!p||!p.rangeCount||p.rangeCount==0)},_fixNesting:function(q){var r=[],p;q=q.replace(/<(\/)?([^\s>]+)[^>]*?>/g,function(t,s,v){var u;if(s==="/"){if(!r.length){return""}if(v!==r[r.length-1].tag){for(p=r.length-1;p>=0;p--){if(r[p].tag===v){r[p].close=1;break}}return""}else{r.pop();if(r.length&&r[r.length-1].close){t=t+"</"+r[r.length-1].tag+">";r.pop()}}}else{if(/^(br|hr|input|meta|img|link|param)$/i.test(v)){return t}if(/\/>$/.test(t)){return t}r.push({tag:v})}return t});for(p=r.length-1;p>=0;p--){q+="</"+r[p].tag+">"}return q}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var l=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,o;function q(y,x,v){var u;y=y.toLowerCase();if(u=j.exec[y]){u(y,x,v);return a}return b}function m(v){var u;v=v.toLowerCase();if(u=j.state[v]){return u(v)}return -1}function h(v){var u;v=v.toLowerCase();if(u=j.value[v]){return u(v)}return b}function t(u,v){v=v||"exec";d(u,function(y,x){d(x.toLowerCase().split(","),function(z){j[v][z]=y})})}c.extend(this,{execCommand:q,queryCommandState:m,queryCommandValue:h,addCommands:t});function f(x,v,u){if(v===e){v=b}if(u===e){u=null}return n.getDoc().execCommand(x,v,u)}function s(u){return n.formatter.match(u)}function r(u,v){n.formatter.toggle(u,v?{value:v}:e)}function i(u){o=p.getBookmark(u)}function g(){p.moveToBookmark(o)}t({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(y){var x=n.getDoc(),u;try{f(y)}catch(v){u=a}if(u||!x.queryCommandSupported(y)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(z){if(z){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(u){if(p.isCollapsed()){p.select(p.getNode())}f(u);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){var v=u.substring(7);d("left,center,right,full".split(","),function(x){if(v!=x){n.formatter.remove("align"+x)}});r("align"+v)},"InsertUnorderedList,InsertOrderedList":function(x){var u,v;f(x);u=l.getParent(p.getNode(),"ol,ul");if(u){v=u.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(v.nodeName)){i();l.split(v,u);g()}}},"Bold,Italic,Underline,Strikethrough":function(u){r(u)},"ForeColor,HiliteColor,FontName":function(x,v,u){r(x,u)},FontSize:function(y,x,v){var u,z;if(v>=1&&v<=7){z=c.explode(k.font_size_style_values);u=c.explode(k.font_size_classes);if(u){v=u[v-1]||v}else{v=z[v-1]||v}}r(y,v)},RemoveFormat:function(u){n.formatter.remove(u)},mceBlockQuote:function(u){r("blockquote")},FormatBlock:function(x,v,u){return r(u||"p")},mceCleanup:function(){var u=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(u)},mceRemoveNode:function(y,x,v){var u=v||p.getNode();if(u!=n.getBody()){i();n.dom.remove(u,a);g()}},mceSelectNodeDepth:function(y,x,v){var u=0;l.getParent(p.getNode(),function(z){if(z.nodeType==1&&u++==v){p.select(z);return b}},n.getBody())},mceSelectNode:function(x,v,u){p.select(u)},mceInsertContent:function(x,v,u){p.setContent(u)},mceInsertRawHTML:function(x,v,u){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return u}))},mceSetContent:function(x,v,u){n.setContent(u)},"Indent,Outdent":function(y){var v,u,x;v=k.indentation;u=/[a-z%]+$/i.exec(v);v=parseInt(v);if(!m("InsertUnorderedList")&&!m("InsertOrderedList")){d(p.getSelectedBlocks(),function(z){if(y=="outdent"){x=Math.max(0,parseInt(z.style.paddingLeft||0)-v);l.setStyle(z,"paddingLeft",x?x+u:"")}else{l.setStyle(z,"paddingLeft",(parseInt(z.style.paddingLeft||0)+v)+u)}})}else{f(y)}},mceRepaint:function(){var v;if(c.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(u){}}},mceToggleFormat:function(x,v,u){n.formatter.toggle(u)},InsertHorizontalRule:function(){p.setContent("<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(x,v,u){p.setContent(u.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(y,x,v){var u=l.getParent(p.getNode(),"a");if(c.is(v,"string")){v={href:v}}if(!u){f("CreateLink",b,"javascript:mctmp(0);");d(l.select("a[href=javascript:mctmp(0);]"),function(z){l.setAttribs(z,v)})}else{if(v.href){l.setAttribs(u,v)}else{n.dom.remove(u,a)}}},selectAll:function(){var v=l.getRoot(),u=l.createRng();u.setStart(v,0);u.setEnd(v,v.childNodes.length);n.selection.setRng(u)}});t({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){return s("align"+u.substring(7))},"Bold,Italic,Underline,Strikethrough":function(u){return s(u)},mceBlockQuote:function(){return s("blockquote")},Outdent:function(){var u;if(k.inline_styles){if((u=l.getParent(p.getStart(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}if((u=l.getParent(p.getEnd(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}}return m("InsertUnorderedList")||m("InsertOrderedList")||(!k.inline_styles&&!!l.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(u){return l.getParent(p.getNode(),u=="insertunorderedlist"?"UL":"OL")}},"state");t({"FontSize,FontName":function(x){var v=0,u;if(u=l.getParent(p.getNode(),"span")){if(x=="fontsize"){v=u.style.fontSize}else{v=u.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return v}},"value");if(k.custom_undo_redo){t({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(e){var c,d=0,g=[];function f(){return b.trim(e.getContent({format:"raw",no_events:1}))}return c={typing:0,onAdd:new a(c),onUndo:new a(c),onRedo:new a(c),add:function(l){var h,j=e.settings,k;l=l||{};l.content=f();k=g[d];if(k&&k.content==l.content){if(d>0||g.length==1){return null}}if(j.custom_undo_redo_levels){if(g.length>j.custom_undo_redo_levels){for(h=0;h<g.length-1;h++){g[h]=g[h+1]}g.length--;d=g.length}}l.bookmark=e.selection.getBookmark(2,true);if(d<g.length-1){if(d==0){g=[]}else{g.length=d+1}}g.push(l);d=g.length-1;c.onAdd.dispatch(c,l);e.isNotDirty=0;return l},undo:function(){var j,h;if(c.typing){c.add();c.typing=0}if(d>0){j=g[--d];e.setContent(j.content,{format:"raw"});e.selection.moveToBookmark(j.bookmark);c.onUndo.dispatch(c,j)}return j},redo:function(){var h;if(d<g.length-1){h=g[++d];e.setContent(h.content,{format:"raw"});e.selection.moveToBookmark(h.bookmark);c.onRedo.dispatch(c,h)}return h},clear:function(){g=[];d=c.typing=0},hasUndo:function(){return d>0||c.typing},hasRedo:function(){return d<g.length-1}}}})(tinymce);(function(m){var k=m.dom.Event,c=m.isIE,a=m.isGecko,b=m.isOpera,j=m.each,i=m.extend,d=true,h=false;function l(p){var q,o,n;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(p.nodeName)){if(q){o=p.cloneNode(false);o.appendChild(q);q=o}else{q=n=p.cloneNode(false)}q.removeAttribute("id")}}while(p=p.parentNode);if(q){return{wrapper:q,inner:n}}}function g(o,p){var n=p.ownerDocument.createRange();n.setStart(o.endContainer,o.endOffset);n.setEndAfter(p);return n.cloneContents().textContent.length==0}function f(o){o=o.innerHTML;o=o.replace(/<(img|hr|table|input|select|textarea)[ \>]/gi,"-");o=o.replace(/<[^>]+>/g,"");return o.replace(/[ \u00a0\t\r\n]+/g,"")==""}function e(p,r,n){var o,q;if(f(n)){o=r.getParent(n,"ul,ol");if(!r.getParent(o.parentNode,"ul,ol")){r.split(o,n);q=r.create("p",0,'<br _mce_bogus="1" />');r.replace(q,n);p.select(q,1)}return h}return d}m.create("tinymce.ForceBlocks",{ForceBlocks:function(o){var p=this,q=o.settings,r;p.editor=o;p.dom=o.dom;r=(q.forced_root_block||"p").toLowerCase();q.element=r.toUpperCase();o.onPreInit.add(p.setup,p);p.reOpera=new RegExp("(\\u00a0| | )</"+r+">","gi");p.rePadd=new RegExp("<p( )([^>]+)><\\/p>|<p( )([^>]+)\\/>|<p( )([^>]+)>\\s+<\\/p>|<p><\\/p>|<p\\/>|<p>\\s+<\\/p>".replace(/p/g,r),"gi");p.reNbsp2BR1=new RegExp("<p( )([^>]+)>[\\s\\u00a0]+<\\/p>|<p>[\\s\\u00a0]+<\\/p>".replace(/p/g,r),"gi");p.reNbsp2BR2=new RegExp("<%p()([^>]+)>( | )<\\/%p>|<%p>( | )<\\/%p>".replace(/%p/g,r),"gi");p.reBR2Nbsp=new RegExp("<p( )([^>]+)>\\s*<br \\/>\\s*<\\/p>|<p>\\s*<br \\/>\\s*<\\/p>".replace(/p/g,r),"gi");function n(s,t){if(b){t.content=t.content.replace(p.reOpera,"</"+r+">")}t.content=m._replace(p.rePadd,"<"+r+"$1$2$3$4$5$6>\u00a0</"+r+">",t.content);if(!c&&!b&&t.set){t.content=t.content.replace(p.reNbsp2BR1,"<"+r+"$1$2><br /></"+r+">");t.content=t.content.replace(p.reNbsp2BR2,"<"+r+"$1$2><br /></"+r+">")}else{t.content=m._replace(p.reBR2Nbsp,"<"+r+"$1$2>\u00a0</"+r+">",t.content)}}o.onBeforeSetContent.add(n);o.onPostProcess.add(n);if(q.forced_root_block){o.onInit.add(p.forceRoots,p);o.onSetContent.add(p.forceRoots,p);o.onBeforeGetContent.add(p.forceRoots,p)}},setup:function(){var o=this,n=o.editor,q=n.settings,u=n.dom,p=n.selection;if(q.forced_root_block){n.onBeforeExecCommand.add(o.forceRoots,o);n.onKeyUp.add(o.forceRoots,o);n.onPreProcess.add(o.forceRoots,o)}if(q.force_br_newlines){if(c){n.onKeyPress.add(function(s,t){var v;if(t.keyCode==13&&p.getNode().nodeName!="LI"){p.setContent('<br id="__" /> ',{format:"raw"});v=u.get("__");v.removeAttribute("id");p.select(v);p.collapse();return k.cancel(t)}})}}if(q.force_p_newlines){if(!c){n.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!o.insertPara(t)){k.cancel(t)}})}else{m.addUnload(function(){o._previousFormats=0});n.onKeyPress.add(function(s,t){o._previousFormats=0;if(t.keyCode==13&&!t.shiftKey&&s.selection.isCollapsed()&&q.keep_styles){o._previousFormats=l(s.selection.getStart())}});n.onKeyUp.add(function(t,x){if(x.keyCode==13&&!x.shiftKey){var v=t.selection.getStart(),s=o._previousFormats;if(!v.hasChildNodes()&&s){v=u.getParent(v,u.isBlock);if(v&&v.nodeName!="LI"){v.innerHTML="";if(o._previousFormats){v.appendChild(s.wrapper);s.inner.innerHTML="\uFEFF"}else{v.innerHTML="\uFEFF"}p.select(v,1);t.getDoc().execCommand("Delete",false,null);o._previousFormats=0}}}})}if(a){n.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){o.backspaceDelete(t,t.keyCode==8)}})}}if(m.isWebKit){function r(t){var s=p.getRng(),v,z=u.create("div",null," "),y,x=u.getViewPort(t.getWin()).h;s.insertNode(v=u.create("br"));s.setStartAfter(v);s.setEndAfter(v);p.setRng(s);if(p.getSel().focusNode==v.previousSibling){p.select(u.insertAfter(u.doc.createTextNode("\u00a0"),v));p.collapse(d)}u.insertAfter(z,v);y=u.getPos(z).y;u.remove(z);if(y>x){t.getWin().scrollTo(0,y)}}n.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||(q.force_br_newlines&&!u.getParent(p.getNode(),"h1,h2,h3,h4,h5,h6,ol,ul")))){r(s);k.cancel(t)}})}n.onPreProcess.add(function(s,t){j(u.select("p,h1,h2,h3,h4,h5,h6,div",t.node),function(v){if(f(v)){j(u.select("span,em,strong,b,i",t.node),function(x){if(!x.hasChildNodes()){x.appendChild(s.getDoc().createTextNode("\u00a0"));return h}})}})});if(c){if(q.element!="P"){n.onKeyPress.add(function(s,t){o.lastElm=p.getNode().nodeName});n.onKeyUp.add(function(t,v){var y,x=p.getNode(),s=t.getBody();if(s.childNodes.length===1&&x.nodeName=="P"){x=u.rename(x,q.element);p.select(x);p.collapse();t.nodeChanged()}else{if(v.keyCode==13&&!v.shiftKey&&o.lastElm!="P"){y=u.getParent(x,"p");if(y){u.rename(y,q.element);t.nodeChanged()}}}})}}},find:function(v,q,r){var p=this.editor,o=p.getDoc().createTreeWalker(v,4,null,h),u=-1;while(v=o.nextNode()){u++;if(q==0&&v==r){return u}if(q==1&&u==r){return v}}return -1},forceRoots:function(x,I){var z=this,x=z.editor,M=x.getBody(),J=x.getDoc(),P=x.selection,A=P.getSel(),B=P.getRng(),N=-2,v,G,o,p,K=-16777215;var L,q,O,F,C,u=M.childNodes,E,D,y;for(E=u.length-1;E>=0;E--){L=u[E];if(L.nodeType===1&&L.getAttribute("_mce_type")){q=null;continue}if(L.nodeType===3||(!z.dom.isBlock(L)&&L.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test(L.nodeName))){if(!q){if(L.nodeType!=3||/[^\s]/g.test(L.nodeValue)){if(N==-2&&B){if(!c||B.setStart){if(B.startContainer.nodeType==1&&(D=B.startContainer.childNodes[B.startOffset])&&D.nodeType==1){y=D.getAttribute("id");D.setAttribute("id","__mce")}else{if(x.dom.getParent(B.startContainer,function(n){return n===M})){G=B.startOffset;o=B.endOffset;N=z.find(M,0,B.startContainer);v=z.find(M,0,B.endContainer)}}}else{if(B.item){p=J.body.createTextRange();p.moveToElementText(B.item(0));B=p}p=J.body.createTextRange();p.moveToElementText(M);p.collapse(1);O=p.move("character",K)*-1;p=B.duplicate();p.collapse(1);F=p.move("character",K)*-1;p=B.duplicate();p.collapse(0);C=(p.move("character",K)*-1)-F;N=F-O;v=C}}q=x.dom.create(x.settings.forced_root_block);L.parentNode.replaceChild(q,L);q.appendChild(L)}}else{if(q.hasChildNodes()){q.insertBefore(L,q.firstChild)}else{q.appendChild(L)}}}else{q=null}}if(N!=-2){if(!c||B.setStart){q=M.getElementsByTagName(x.settings.element)[0];B=J.createRange();if(N!=-1){B.setStart(z.find(M,1,N),G)}else{B.setStart(q,0)}if(v!=-1){B.setEnd(z.find(M,1,v),o)}else{B.setEnd(q,0)}if(A){A.removeAllRanges();A.addRange(B)}}else{try{B=A.createRange();B.moveToElementText(M);B.collapse(1);B.moveStart("character",N);B.moveEnd("character",v);B.select()}catch(H){}}}else{if((!c||B.setStart)&&(D=x.dom.get("__mce"))){if(y){D.setAttribute("id",y)}else{D.removeAttribute("id")}B=J.createRange();B.setStartBefore(D);B.setEndBefore(D);P.setRng(B)}}},getParentBlock:function(p){var o=this.dom;return o.getParent(p,o.isBlock)},insertPara:function(S){var G=this,x=G.editor,O=x.dom,T=x.getDoc(),X=x.settings,H=x.selection.getSel(),I=H.getRangeAt(0),W=T.body;var L,M,J,Q,P,u,p,v,A,o,E,V,q,z,K,N=O.getViewPort(x.getWin()),D,F,C;L=T.createRange();L.setStart(H.anchorNode,H.anchorOffset);L.collapse(d);M=T.createRange();M.setStart(H.focusNode,H.focusOffset);M.collapse(d);J=L.compareBoundaryPoints(L.START_TO_END,M)<0;Q=J?H.anchorNode:H.focusNode;P=J?H.anchorOffset:H.focusOffset;u=J?H.focusNode:H.anchorNode;p=J?H.focusOffset:H.anchorOffset;if(Q===u&&/^(TD|TH)$/.test(Q.nodeName)){if(Q.firstChild.nodeName=="BR"){O.remove(Q.firstChild)}if(Q.childNodes.length==0){x.dom.add(Q,X.element,null,"<br />");V=x.dom.add(Q,X.element,null,"<br />")}else{K=Q.innerHTML;Q.innerHTML="";x.dom.add(Q,X.element,null,K);V=x.dom.add(Q,X.element,null,"<br />")}I=T.createRange();I.selectNodeContents(V);I.collapse(1);x.selection.setRng(I);return h}if(Q==W&&u==W&&W.firstChild&&x.dom.isBlock(W.firstChild)){Q=u=Q.firstChild;P=p=0;L=T.createRange();L.setStart(Q,0);M=T.createRange();M.setStart(u,0)}Q=Q.nodeName=="HTML"?T.body:Q;Q=Q.nodeName=="BODY"?Q.firstChild:Q;u=u.nodeName=="HTML"?T.body:u;u=u.nodeName=="BODY"?u.firstChild:u;v=G.getParentBlock(Q);A=G.getParentBlock(u);o=v?v.nodeName:X.element;if(K=G.dom.getParent(v,"li,pre")){if(K.nodeName=="LI"){return e(x.selection,G.dom,K)}return d}if(v&&(v.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(O.getStyle(v,"position",1)))){o=X.element;v=null}if(A&&(A.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(O.getStyle(v,"position",1)))){o=X.element;A=null}if(/(TD|TABLE|TH|CAPTION)/.test(o)||(v&&o=="DIV"&&/left|right/gi.test(O.getStyle(v,"float",1)))){o=X.element;v=A=null}E=(v&&v.nodeName==o)?v.cloneNode(0):x.dom.create(o);V=(A&&A.nodeName==o)?A.cloneNode(0):x.dom.create(o);V.removeAttribute("id");if(/^(H[1-6])$/.test(o)&&g(I,v)){V=x.dom.create(X.element)}K=q=Q;do{if(K==W||K.nodeType==9||G.dom.isBlock(K)||/(TD|TABLE|TH|CAPTION)/.test(K.nodeName)){break}q=K}while((K=K.previousSibling?K.previousSibling:K.parentNode));K=z=u;do{if(K==W||K.nodeType==9||G.dom.isBlock(K)||/(TD|TABLE|TH|CAPTION)/.test(K.nodeName)){break}z=K}while((K=K.nextSibling?K.nextSibling:K.parentNode));if(q.nodeName==o){L.setStart(q,0)}else{L.setStartBefore(q)}L.setEnd(Q,P);E.appendChild(L.cloneContents()||T.createTextNode(""));try{M.setEndAfter(z)}catch(R){}M.setStart(u,p);V.appendChild(M.cloneContents()||T.createTextNode(""));I=T.createRange();if(!q.previousSibling&&q.parentNode.nodeName==o){I.setStartBefore(q.parentNode)}else{if(L.startContainer.nodeName==o&&L.startOffset==0){I.setStartBefore(L.startContainer)}else{I.setStart(L.startContainer,L.startOffset)}}if(!z.nextSibling&&z.parentNode.nodeName==o){I.setEndAfter(z.parentNode)}else{I.setEnd(M.endContainer,M.endOffset)}I.deleteContents();if(b){x.getWin().scrollTo(0,N.y)}if(E.firstChild&&E.firstChild.nodeName==o){E.innerHTML=E.firstChild.innerHTML}if(V.firstChild&&V.firstChild.nodeName==o){V.innerHTML=V.firstChild.innerHTML}if(f(E)){E.innerHTML="<br />"}function U(y,s){var r=[],Z,Y,t;y.innerHTML="";if(X.keep_styles){Y=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(Y.nodeName)){Z=Y.cloneNode(h);O.setAttrib(Z,"id","");r.push(Z)}}while(Y=Y.parentNode)}if(r.length>0){for(t=r.length-1,Z=y;t>=0;t--){Z=Z.appendChild(r[t])}r[0].innerHTML=b?" ":"<br />";return r[0]}else{y.innerHTML=b?" ":"<br />"}}if(f(V)){C=U(V,u)}if(b&&parseFloat(opera.version())<9.5){I.insertNode(E);I.insertNode(V)}else{I.insertNode(V);I.insertNode(E)}V.normalize();E.normalize();function B(r){return T.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,h).nextNode()||r}I=T.createRange();I.selectNodeContents(a?B(C||V):C||V);I.collapse(1);H.removeAllRanges();H.addRange(I);D=x.dom.getPos(V).y;F=V.clientHeight;if(D<N.y||D+F>N.y+N.h){x.getWin().scrollTo(0,D<N.y?D:D-N.h+25)}return h},backspaceDelete:function(v,C){var D=this,u=D.editor,z=u.getBody(),s=u.dom,q,x=u.selection,p=x.getRng(),y=p.startContainer,q,A,B,o;if(!C&&p.collapsed&&y.nodeType==1&&p.startOffset==y.childNodes.length){o=new m.dom.TreeWalker(y.lastChild,y);for(q=y.lastChild;q;q=o.prev()){if(q.nodeType==3){p.setStart(q,q.nodeValue.length);p.collapse(true);x.setRng(p);return}}}if(y&&u.dom.isBlock(y)&&!/^(TD|TH)$/.test(y.nodeName)&&C){if(y.childNodes.length==0||(y.childNodes.length==1&&y.firstChild.nodeName=="BR")){q=y;while((q=q.previousSibling)&&!u.dom.isBlock(q)){}if(q){if(y!=z.firstChild){A=u.dom.doc.createTreeWalker(q,NodeFilter.SHOW_TEXT,null,h);while(B=A.nextNode()){q=B}p=u.getDoc().createRange();p.setStart(q,q.nodeValue?q.nodeValue.length:0);p.setEnd(q,q.nodeValue?q.nodeValue.length:0);x.setRng(p);u.dom.remove(y)}return k.cancel(v)}}}}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){function b(){var d={},c={},e={};function f(j,i,h,g){if(typeof(i)=="string"){i=[i]}a.each(i,function(k){j[k.toLowerCase()]={func:h,scope:g}})}a.extend(this,{add:function(i,h,g){f(d,i,h,g)},addQueryStateHandler:function(i,h,g){f(c,i,h,g)},addQueryValueHandler:function(i,h,g){f(e,i,h,g)},execCommand:function(h,k,j,i,g){if(k=d[k.toLowerCase()]){if(k.func.call(h||k.scope,j,i,g)!==false){return true}}},queryCommandValue:function(){if(cmd=e[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}},queryCommandState:function(){if(cmd=c[cmd.toLowerCase()]){return cmd.func.call(scope||cmd.scope,ui,value,args)}}})}a.GlobalCommands=new b()})(tinymce);(function(a){a.Formatter=function(T){var K={},M=a.each,c=T.dom,p=T.selection,s=a.dom.TreeWalker,I=new a.dom.RangeUtils(c),d=T.schema.isValid,E=c.isBlock,k=T.settings.forced_root_block,r=c.nodeIndex,D="\uFEFF",e=/^(src|href|style)$/,Q=false,A=true,o,N={apply:[],remove:[]};function y(U){return U instanceof Array}function l(V,U){return c.getParents(V,U,c.getRoot())}function b(U){return U.nodeType===1&&(U.face==="mceinline"||U.style.fontFamily==="mceinline")}function P(U){return U?K[U]:K}function j(U,V){if(U){if(typeof(U)!=="string"){M(U,function(X,W){j(W,X)})}else{V=V.length?V:[V];M(V,function(W){if(W.deep===o){W.deep=!W.selector}if(W.split===o){W.split=!W.selector||W.inline}if(W.remove===o&&W.selector&&!W.inline){W.remove="none"}if(W.selector&&W.inline){W.mixed=true;W.block_expand=true}if(typeof(W.classes)==="string"){W.classes=W.classes.split(/\s+/)}});K[U]=V}}}function R(W,ac,Y){var Z=P(W),ad=Z[0],ab,V,aa;function X(ag){var af=ag.startContainer,aj=ag.startOffset,ai,ah;if(af.nodeType==1||af.nodeValue===""){af=af.nodeType==1?af.childNodes[aj]:af;if(af){ai=new s(af,af.parentNode);for(ah=ai.current();ah;ah=ai.next()){if(ah.nodeType==3&&!f(ah)){ag.setStart(ah,0);break}}}}return ag}function U(ag,af){af=af||ad;if(ag){M(af.styles,function(ai,ah){c.setStyle(ag,ah,q(ai,ac))});M(af.attributes,function(ai,ah){c.setAttrib(ag,ah,q(ai,ac))});M(af.classes,function(ah){ah=q(ah,ac);if(!c.hasClass(ag,ah)){c.addClass(ag,ah)}})}}function ae(ag){var af=[],ai,ah;ai=ad.inline||ad.block;ah=c.create(ai);U(ah);I.walk(ag,function(aj){var ak;function al(am){var ap=am.nodeName.toLowerCase(),ao=am.parentNode.nodeName.toLowerCase(),an;if(g(ap,"br")){ak=0;if(ad.block){c.remove(am)}return}if(ad.wrapper&&v(am,W,ac)){ak=0;return}if(ad.block&&!ad.wrapper&&F(ap)){am=c.rename(am,ai);U(am);af.push(am);ak=0;return}if(ad.selector){M(Z,function(aq){if(c.is(am,aq.selector)&&!b(am)){U(am,aq);an=true}});if(!ad.inline||an){ak=0;return}}if((ad.wrap_links!==false||ap!="a")&&d(ai,ap)&&d(ao,ai)){if(!ak){ak=ah.cloneNode(Q);am.parentNode.insertBefore(ak,am);af.push(ak)}ak.appendChild(am)}else{ak=0;M(a.grep(am.childNodes),al);ak=0}}M(aj,al)});M(af,function(al){var aj;function am(ao){var an=0;M(ao.childNodes,function(ap){if(!f(ap)&&!G(ap)){an++}});return an}function ak(an){var ap,ao;M(an.childNodes,function(aq){if(aq.nodeType==1&&!G(aq)&&!b(aq)){ap=aq;return Q}});if(ap&&h(ap,ad)){ao=ap.cloneNode(Q);U(ao);c.replace(ao,an,A);c.remove(ap,1)}return ao||an}aj=am(al);if(aj===0){c.remove(al,1);return}if(ad.inline||ad.wrapper){if(!ad.exact&&aj===1){al=ak(al)}M(Z,function(an){M(c.select(an.inline,al),function(ao){S(an,ac,ao,an.exact?ao:null)})});if(v(al.parentNode,W,ac)){c.remove(al,1);al=0;return A}if(ad.merge_with_parents){c.getParent(al.parentNode,function(an){if(v(an,W,ac)){c.remove(al,1);al=0;return A}})}if(al){al=t(B(al),al);al=t(al,B(al,A))}}})}if(ad){if(Y){V=c.createRng();V.setStartBefore(Y);V.setEndAfter(Y);ae(n(V,Z))}else{if(!p.isCollapsed()||!ad.inline){ab=p.getBookmark();ae(n(p.getRng(A),Z));p.moveToBookmark(ab);p.setRng(X(p.getRng(A)));T.nodeChanged()}else{O("apply",W,ac)}}}}function z(W,af,Z){var aa=P(W),ah=aa[0],ae,ad,V;function Y(ak){var aj=ak.startContainer,ap=ak.startOffset,ao,an,al,am;if(aj.nodeType==3&&ap>=aj.nodeValue.length-1){aj=aj.parentNode;ap=r(aj)+1}if(aj.nodeType==1){al=aj.childNodes;aj=al[Math.min(ap,al.length-1)];ao=new s(aj);if(ap>al.length-1){ao.next()}for(an=ao.current();an;an=ao.next()){if(an.nodeType==3&&!f(an)){am=c.create("a",null,D);an.parentNode.insertBefore(am,an);ak.setStart(an,0);p.setRng(ak);c.remove(am);return}}}}function X(am){var al,ak,aj;al=a.grep(am.childNodes);for(ak=0,aj=aa.length;ak<aj;ak++){if(S(aa[ak],af,am,am)){break}}if(ah.deep){for(ak=0,aj=al.length;ak<aj;ak++){X(al[ak])}}}function ab(aj){var ak;M(l(aj.parentNode).reverse(),function(al){var am;if(!ak&&al.id!="_start"&&al.id!="_end"){am=v(al,W,af);if(am&&am.split!==false){ak=al}}});return ak}function U(am,aj,ao,ar){var at,aq,ap,al,an,ak;if(am){ak=am.parentNode;for(at=aj.parentNode;at&&at!=ak;at=at.parentNode){aq=at.cloneNode(Q);for(an=0;an<aa.length;an++){if(S(aa[an],af,aq,aq)){aq=0;break}}if(aq){if(ap){aq.appendChild(ap)}if(!al){al=aq}ap=aq}}if(ar&&(!ah.mixed||!E(am))){aj=c.split(am,aj)}if(ap){ao.parentNode.insertBefore(ap,ao);al.appendChild(ao)}}return aj}function ag(aj){return U(ab(aj),aj,aj,true)}function ac(al){var ak=c.get(al?"_start":"_end"),aj=ak[al?"firstChild":"lastChild"];if(G(aj)){aj=aj[al?"firstChild":"lastChild"]}c.remove(ak,true);return aj}function ai(aj){var ak,al;aj=n(aj,aa,A);if(ah.split){ak=H(aj,A);al=H(aj);if(ak!=al){ak=L(ak,"span",{id:"_start",_mce_type:"bookmark"});al=L(al,"span",{id:"_end",_mce_type:"bookmark"});ag(ak);ag(al);ak=ac(A);al=ac()}else{ak=al=ag(ak)}aj.startContainer=ak.parentNode;aj.startOffset=r(ak);aj.endContainer=al.parentNode;aj.endOffset=r(al)+1}I.walk(aj,function(am){M(am,function(an){X(an)})})}if(Z){V=c.createRng();V.setStartBefore(Z);V.setEndAfter(Z);ai(V);return}if(!p.isCollapsed()||!ah.inline){ae=p.getBookmark();ai(p.getRng(A));p.moveToBookmark(ae);if(i(W,af,p.getStart())){Y(p.getRng(true))}T.nodeChanged()}else{O("remove",W,af)}}function C(U,W,V){if(i(U,W,V)){z(U,W,V)}else{R(U,W,V)}}function v(V,U,aa,Y){var W=P(U),ab,Z,X;function ac(ag,ai,aj){var af,ah,ad=ai[aj],ae;if(ad){if(ad.length===o){for(af in ad){if(ad.hasOwnProperty(af)){if(aj==="attributes"){ah=c.getAttrib(ag,af)}else{ah=J(ag,af)}if(Y&&!ah&&!ai.exact){return}if((!Y||ai.exact)&&!g(ah,q(ad[af],aa))){return}}}}else{for(ae=0;ae<ad.length;ae++){if(aj==="attributes"?c.getAttrib(ag,ad[ae]):J(ag,ad[ae])){return ai}}}}return ai}if(W&&V){for(Z=0;Z<W.length;Z++){ab=W[Z];if(h(V,ab)&&ac(V,ab,"attributes")&&ac(V,ab,"styles")){if(X=ab.classes){for(Z=0;Z<X.length;Z++){if(!c.hasClass(V,X[Z])){return}}}return ab}}}}function i(W,Z,Y){var V,X;function U(aa){aa=c.getParent(aa,function(ab){return !!v(ab,W,Z,true)});return v(aa,W,Z)}if(Y){return U(Y)}if(p.isCollapsed()){for(X=N.apply.length-1;X>=0;X--){if(N.apply[X].name==W){return true}}for(X=N.remove.length-1;X>=0;X--){if(N.remove[X].name==W){return false}}return U(p.getNode())}Y=p.getNode();if(U(Y)){return A}V=p.getStart();if(V!=Y){if(U(V)){return A}}return Q}function u(ab,aa){var Y,Z=[],X={},W,V,U;if(p.isCollapsed()){for(V=0;V<ab.length;V++){for(W=N.remove.length-1;W>=0;W--){U=ab[V];if(N.remove[W].name==U){X[U]=true;break}}}for(W=N.apply.length-1;W>=0;W--){for(V=0;V<ab.length;V++){U=ab[V];if(!X[U]&&N.apply[W].name==U){X[U]=true;Z.push(U)}}}}Y=p.getStart();c.getParent(Y,function(ae){var ad,ac;for(ad=0;ad<ab.length;ad++){ac=ab[ad];if(!X[ac]&&v(ae,ac,aa)){X[ac]=true;Z.push(ac)}}});return Z}function x(Y){var aa=P(Y),X,W,Z,V,U;if(aa){X=p.getStart();W=l(X);for(V=aa.length-1;V>=0;V--){U=aa[V].selector;if(!U){return A}for(Z=W.length-1;Z>=0;Z--){if(c.is(W[Z],U)){return A}}}}return Q}a.extend(this,{get:P,register:j,apply:R,remove:z,toggle:C,match:i,matchAll:u,matchNode:v,canApply:x});function h(U,V){if(g(U,V.inline)){return A}if(g(U,V.block)){return A}if(V.selector){return c.is(U,V.selector)}}function g(V,U){V=V||"";U=U||"";V=""+(V.nodeName||V);U=""+(U.nodeName||U);return V.toLowerCase()==U.toLowerCase()}function J(V,U){var W=c.getStyle(V,U);if(U=="color"||U=="backgroundColor"){W=c.toHex(W)}if(U=="fontWeight"&&W==700){W="bold"}return""+W}function q(U,V){if(typeof(U)!="string"){U=U(V)}else{if(V){U=U.replace(/%(\w+)/g,function(X,W){return V[W]||X})}}return U}function f(U){return U&&U.nodeType===3&&/^([\s\r\n]+|)$/.test(U.nodeValue)}function L(W,V,U){var X=c.create(V,U);W.parentNode.insertBefore(X,W);X.appendChild(W);return X}function n(U,ac,X){var W=U.startContainer,Z=U.startOffset,af=U.endContainer,aa=U.endOffset,ae,ab;function ad(ai,aj,ag,ah){var ak,al;ah=ah||c.getRoot();for(;;){ak=ai.parentNode;if(ak==ah||(!ac[0].block_expand&&E(ak))){return ai}for(ae=ak[aj];ae&&ae!=ai;ae=ae[ag]){if(ae.nodeType==1&&!G(ae)){return ai}if(ae.nodeType==3&&!f(ae)){return ai}}ai=ai.parentNode}return ai}if(W.nodeType==1&&W.hasChildNodes()){ab=W.childNodes.length-1;W=W.childNodes[Z>ab?ab:Z];if(W.nodeType==3){Z=0}}if(af.nodeType==1&&af.hasChildNodes()){ab=af.childNodes.length-1;af=af.childNodes[aa>ab?ab:aa-1];if(af.nodeType==3){aa=af.nodeValue.length}}if(G(W.parentNode)){W=W.parentNode}if(G(W)){W=W.nextSibling||W}if(G(af.parentNode)){af=af.parentNode}if(G(af)){af=af.previousSibling||af}if(ac[0].inline||ac[0].block_expand){W=ad(W,"firstChild","nextSibling");af=ad(af,"lastChild","previousSibling")}if(ac[0].selector&&ac[0].expand!==Q&&!ac[0].inline){function Y(ah,ag){var ai,aj,ak;if(ah.nodeType==3&&ah.nodeValue.length==0&&ah[ag]){ah=ah[ag]}ai=l(ah);for(aj=0;aj<ai.length;aj++){for(ak=0;ak<ac.length;ak++){if(c.is(ai[aj],ac[ak].selector)){return ai[aj]}}}return ah}W=Y(W,"previousSibling");af=Y(af,"nextSibling")}if(ac[0].block||ac[0].selector){function V(ah,ag,aj){var ai;if(!ac[0].wrapper){ai=c.getParent(ah,ac[0].block)}if(!ai){ai=c.getParent(ah.nodeType==3?ah.parentNode:ah,E)}if(ai&&ac[0].wrapper){ai=l(ai,"ul,ol").reverse()[0]||ai}if(!ai){ai=ah;while(ai[ag]&&!E(ai[ag])){ai=ai[ag];if(g(ai,"br")){break}}}return ai||ah}W=V(W,"previousSibling");af=V(af,"nextSibling");if(ac[0].block){if(!E(W)){W=ad(W,"firstChild","nextSibling")}if(!E(af)){af=ad(af,"lastChild","previousSibling")}}}if(W.nodeType==1){Z=r(W);W=W.parentNode}if(af.nodeType==1){aa=r(af)+1;af=af.parentNode}return{startContainer:W,startOffset:Z,endContainer:af,endOffset:aa}}function S(aa,Z,X,U){var W,V,Y;if(!h(X,aa)){return Q}if(aa.remove!="all"){M(aa.styles,function(ac,ab){ac=q(ac,Z);if(typeof(ab)==="number"){ab=ac;U=0}if(!U||g(J(U,ab),ac)){c.setStyle(X,ab,"")}Y=1});if(Y&&c.getAttrib(X,"style")==""){X.removeAttribute("style");X.removeAttribute("_mce_style")}M(aa.attributes,function(ad,ab){var ac;ad=q(ad,Z);if(typeof(ab)==="number"){ab=ad;U=0}if(!U||g(c.getAttrib(U,ab),ad)){if(ab=="class"){ad=c.getAttrib(X,ab);if(ad){ac="";M(ad.split(/\s+/),function(ae){if(/mce\w+/.test(ae)){ac+=(ac?" ":"")+ae}});if(ac){c.setAttrib(X,ab,ac);return}}}if(ab=="class"){X.removeAttribute("className")}if(e.test(ab)){X.removeAttribute("_mce_"+ab)}X.removeAttribute(ab)}});M(aa.classes,function(ab){ab=q(ab,Z);if(!U||c.hasClass(U,ab)){c.removeClass(X,ab)}});V=c.getAttribs(X);for(W=0;W<V.length;W++){if(V[W].nodeName.indexOf("_")!==0){return Q}}}if(aa.remove!="none"){m(X,aa);return A}}function m(W,X){var U=W.parentNode,V;if(X.block){if(!k){function Y(aa,Z,ab){aa=B(aa,Z,ab);return !aa||(aa.nodeName=="BR"||E(aa))}if(E(W)&&!E(U)){if(!Y(W,Q)&&!Y(W.firstChild,A,1)){W.insertBefore(c.create("br"),W.firstChild)}if(!Y(W,A)&&!Y(W.lastChild,Q,1)){W.appendChild(c.create("br"))}}}else{if(U==c.getRoot()){if(!X.list_block||!g(W,X.list_block)){M(a.grep(W.childNodes),function(Z){if(d(k,Z.nodeName.toLowerCase())){if(!V){V=L(Z,k)}else{V.appendChild(Z)}}else{V=0}})}}}}if(X.selector&&X.inline&&!g(X.inline,W)){return}c.remove(W,1)}function B(V,U,W){if(V){U=U?"nextSibling":"previousSibling";for(V=W?V:V[U];V;V=V[U]){if(V.nodeType==1||!f(V)){return V}}}}function G(U){return U&&U.nodeType==1&&U.getAttribute("_mce_type")=="bookmark"}function t(Y,X){var U,W,V;function aa(ad,ac){if(ad.nodeName!=ac.nodeName){return Q}function ab(af){var ag={};M(c.getAttribs(af),function(ah){var ai=ah.nodeName.toLowerCase();if(ai.indexOf("_")!==0&&ai!=="style"){ag[ai]=c.getAttrib(af,ai)}});return ag}function ae(ai,ah){var ag,af;for(af in ai){if(ai.hasOwnProperty(af)){ag=ah[af];if(ag===o){return Q}if(ai[af]!=ag){return Q}delete ah[af]}}for(af in ah){if(ah.hasOwnProperty(af)){return Q}}return A}if(!ae(ab(ad),ab(ac))){return Q}if(!ae(c.parseStyle(c.getAttrib(ad,"style")),c.parseStyle(c.getAttrib(ac,"style")))){return Q}return A}if(Y&&X){function Z(ac,ab){for(W=ac;W;W=W[ab]){if(W.nodeType==3&&!f(W)){return ac}if(W.nodeType==1&&!G(W)){return W}}return ac}Y=Z(Y,"previousSibling");X=Z(X,"nextSibling");if(aa(Y,X)){for(W=Y.nextSibling;W&&W!=X;){V=W;W=W.nextSibling;Y.appendChild(V)}c.remove(X);M(a.grep(X.childNodes),function(ab){Y.appendChild(ab)});return Y}}return X}function F(U){return/^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(U)}function H(V,Y){var U,X,W;U=V[Y?"startContainer":"endContainer"];X=V[Y?"startOffset":"endOffset"];if(U.nodeType==1){W=U.childNodes.length-1;if(!Y&&X){X--}U=U.childNodes[X>W?W:X]}return U}function O(Z,V,Y){var W,U=N[Z],aa=N[Z=="apply"?"remove":"apply"];function ab(){return N.apply.length||N.remove.length}function X(){N.apply=[];N.remove=[]}function ac(ad){M(N.apply.reverse(),function(ae){R(ae.name,ae.vars,ad)});M(N.remove.reverse(),function(ae){z(ae.name,ae.vars,ad)});c.remove(ad,1);X()}for(W=U.length-1;W>=0;W--){if(U[W].name==V){return}}U.push({name:V,vars:Y});for(W=aa.length-1;W>=0;W--){if(aa[W].name==V){aa.splice(W,1)}}if(ab()){T.getDoc().execCommand("FontName",false,"mceinline");N.lastRng=p.getRng();M(c.select("font,span"),function(ae){var ad;if(b(ae)){ad=p.getBookmark();ac(ae);p.moveToBookmark(ad);T.nodeChanged()}});if(!N.isListening&&ab()){N.isListening=true;M("onKeyDown,onKeyUp,onKeyPress,onMouseUp".split(","),function(ad){T[ad].addToTop(function(ae,af){if(ab()&&!a.dom.RangeUtils.compareRanges(N.lastRng,p.getRng())){M(c.select("font,span"),function(ah){var ai,ag;if(b(ah)){ai=ah.firstChild;if(ai){ac(ah);ag=c.createRng();ag.setStart(ai,ai.nodeValue.length);ag.setEnd(ai,ai.nodeValue.length);p.setRng(ag);ae.nodeChanged()}else{c.remove(ah)}}});if(af.type=="keyup"||af.type=="mouseup"){X()}}})})}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_style_values);function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});
\ No newline at end of file
// Uncomment and change this document.domain value if you are loading the script cross subdomains
// document.domain = 'moxiecode.com';
-var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var e=this,g,a=document.body,c=e.dom.getViewPort(window),d,f;d=e.getWindowArg("mce_width")-c.w;f=e.getWindowArg("mce_height")-c.h;if(e.isWindow){window.resizeBy(d,f)}else{e.editor.windowManager.resizeBy(d,f,e.id)}},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
\ No newline at end of file
+var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},0)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
\ No newline at end of file
/**
- * $Id: editable_selects.js 867 2008-06-09 20:33:40Z spocke $
+ * editable_selects.js
*
- * Makes select boxes editable.
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
*
- * @author Moxiecode
- * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
*/
var TinyMCE_EditableSelects = {
/**
- * $Id: form_utils.js 1184 2009-08-11 11:47:27Z spocke $
+ * form_utils.js
*
- * Various form utilitiy functions.
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
*
- * @author Moxiecode
- * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
*/
var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
/**
- * $Id: mctabs.js 758 2008-03-30 13:53:29Z spocke $
+ * mctabs.js
*
- * Moxiecode DHTML Tabs script.
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
*
- * @author Moxiecode
- * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
*/
function MCTabs() {
/**
- * $Id: validate.js 758 2008-03-30 13:53:29Z spocke $
+ * validate.js
*
- * Various form validation methods.
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
*
- * @author Moxiecode
- * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
*/
/**
<h2><?php _e('About TinyMCE'); ?></h2>
<p><?php _e('Version:'); ?> <span id="version"></span> (<span id="date"></span>)</p>
- <p><?php printf(__('TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under %sLGPL</a> by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.'), '<a href="'.home_url('/wp-includes/js/tinymce/license.txt').'" target="_blank" title="'.__('GNU Library General Public Licence').'">') ?></p>
+ <p><?php printf(__('TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under %sLGPL</a> by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.'), '<a href="'.home_url('/wp-includes/js/tinymce/license.txt').'" target="_blank" title="'.esc_attr__('GNU Library General Public Licence').'">') ?></p>
<p><?php _e('Copyright © 2003-2007, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.') ?></p>
<p><?php _e('For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.') ?></p>
element = $('#' + s.element);
isClass = element.toggleClass(s.dimClass).is('.' + s.dimClass);
color = wpList.getColor( element );
- element.toggleClass( s.dimClass )
+ element.toggleClass( s.dimClass );
dimColor = isClass ? s.dimAddColor : s.dimDelColor;
if ( 'none' != dimColor ) {
element
e = $(e);
var list = $(this), old = false, _s = { pos: 0, id: 0, oldId: null }, ba, ref, color;
- if ( 'string' == typeof s ) { s = { what: s }; }
+
+ if ( 'string' == typeof s )
+ s = { what: s };
+
s = $.extend(_s, this.wpList.settings, s);
- if ( !e.size() || !s.what ) { return false; }
- if ( s.oldId ) { old = $('#' + s.what + '-' + s.oldId); }
- if ( s.id && ( s.id != s.oldId || !old || !old.size() ) ) { $('#' + s.what + '-' + s.id).remove(); }
+
+ if ( !e.size() || !s.what )
+ return false;
+
+ if ( s.oldId )
+ old = $('#' + s.what + '-' + s.oldId);
+
+ if ( s.id && ( s.id != s.oldId || !old || !old.size() ) )
+ $('#' + s.what + '-' + s.id).remove();
if ( old && old.size() ) {
old.before(e);
},
process: function(el) {
- var list = this;
- $("[class^=add:" + list.id + ":]", el || null)
- .filter('form').submit( function() { return list.wpList.add(this); } ).end()
- .not('form').click( function() { return list.wpList.add(this); } );
- $("[class^=delete:" + list.id + ":]", el || null).click( function() { return list.wpList.del(this); } );
- $("[class^=dim:" + list.id + ":]", el || null).click( function() { return list.wpList.dim(this); } );
+ var list = this,
+ $el = $(el || document);
+
+ $el.delegate( "form[class^=add:" + list.id + ":]", 'submit', function(){
+ return list.wpList.add(this);
+ });
+
+ $el.delegate( "[class^=add:" + list.id + ":]:not(form)", 'click', function(){
+ return list.wpList.add(this);
+ });
+
+ $el.delegate( "[class^=delete:" + list.id + ":]", 'click', function(){
+ return list.wpList.del(this);
+ });
+
+ $el.delegate( "[class^=dim:" + list.id + ":]", 'click', function(){
+ return list.wpList.dim(this);
+ });
},
recolor: function() {
-(function(b){var a={add:"ajaxAdd",del:"ajaxDel",dim:"ajaxDim",process:"process",recolor:"recolor"},c;c={settings:{url:ajaxurl,type:"POST",response:"ajax-response",what:"",alt:"alternate",altOffset:0,addColor:null,delColor:null,dimAddColor:null,dimDelColor:null,confirm:null,addBefore:null,addAfter:null,delBefore:null,delAfter:null,dimBefore:null,dimAfter:null},nonce:function(g,f){var d=wpAjax.unserialize(g.attr("href"));return f.nonce||d._ajax_nonce||b("#"+f.element+" input[name=_ajax_nonce]").val()||d._wpnonce||b("#"+f.element+" input[name=_wpnonce]").val()||0},parseClass:function(h,f){var i=[],d;try{d=b(h).attr("class")||"";d=d.match(new RegExp(f+":[\\S]+"));if(d){i=d[0].split(":")}}catch(g){}return i},pre:function(i,g,d){var f,h;g=b.extend({},this.wpList.settings,{element:null,nonce:0,target:i.get(0)},g||{});if(b.isFunction(g.confirm)){if("add"!=d){f=b("#"+g.element).css("backgroundColor");b("#"+g.element).css("backgroundColor","#FF9966")}h=g.confirm.call(this,i,g,d,f);if("add"!=d){b("#"+g.element).css("backgroundColor",f)}if(!h){return false}}return g},ajaxAdd:function(j,f){j=b(j);f=f||{};var h=this,d=c.parseClass(j,"add"),k,g,i;f=c.pre.call(h,j,f,"add");f.element=d[2]||j.attr("id")||f.element||null;if(d[3]){f.addColor="#"+d[3]}else{f.addColor=f.addColor||"#FFFF33"}if(!f){return false}if(!j.is("[class^=add:"+h.id+":]")){return !c.add.call(h,j,f)}if(!f.element){return true}f.action="add-"+f.what;f.nonce=c.nonce(j,f);k=b("#"+f.element+" :input").not("[name=_ajax_nonce], [name=_wpnonce], [name=action]");g=wpAjax.validateForm("#"+f.element);if(!g){return false}f.data=b.param(b.extend({_ajax_nonce:f.nonce,action:f.action},wpAjax.unserialize(d[4]||"")));i=b.isFunction(k.fieldSerialize)?k.fieldSerialize():k.serialize();if(i){f.data+="&"+i}if(b.isFunction(f.addBefore)){f=f.addBefore(f);if(!f){return true}}if(!f.data.match(/_ajax_nonce=[a-f0-9]+/)){return true}f.success=function(l){var e=wpAjax.parseAjaxResponse(l,f.response,f.element),m;if(!e||e.errors){return false}if(true===e){return true}jQuery.each(e.responses,function(){c.add.call(h,this.data,b.extend({},f,{pos:this.position||0,id:this.id||0,oldId:this.oldId||null}))});if(b.isFunction(f.addAfter)){m=this.complete;this.complete=function(n,o){var p=b.extend({xml:n,status:o,parsed:e},f);f.addAfter(l,p);if(b.isFunction(m)){m(n,o)}}}h.wpList.recolor();b(h).trigger("wpListAddEnd",[f,h.wpList]);c.clear.call(h,"#"+f.element)};b.ajax(f);return false},ajaxDel:function(i,g){i=b(i);g=g||{};var h=this,d=c.parseClass(i,"delete"),f;g=c.pre.call(h,i,g,"delete");g.element=d[2]||g.element||null;if(d[3]){g.delColor="#"+d[3]}else{g.delColor=g.delColor||"#faa"}if(!g||!g.element){return false}g.action="delete-"+g.what;g.nonce=c.nonce(i,g);g.data=b.extend({action:g.action,id:g.element.split("-").pop(),_ajax_nonce:g.nonce},wpAjax.unserialize(d[4]||""));if(b.isFunction(g.delBefore)){g=g.delBefore(g,h);if(!g){return true}}if(!g.data._ajax_nonce){return true}f=b("#"+g.element);if("none"!=g.delColor){f.css("backgroundColor",g.delColor).fadeOut(350,function(){h.wpList.recolor();b(h).trigger("wpListDelEnd",[g,h.wpList])})}else{h.wpList.recolor();b(h).trigger("wpListDelEnd",[g,h.wpList])}g.success=function(j){var e=wpAjax.parseAjaxResponse(j,g.response,g.element),k;if(!e||e.errors){f.stop().stop().css("backgroundColor","#faa").show().queue(function(){h.wpList.recolor();b(this).dequeue()});return false}if(b.isFunction(g.delAfter)){k=this.complete;this.complete=function(l,m){f.queue(function(){var n=b.extend({xml:l,status:m,parsed:e},g);g.delAfter(j,n);if(b.isFunction(k)){k(l,m)}}).dequeue()}}};b.ajax(g);return false},ajaxDim:function(k,h){if(b(k).parent().css("display")=="none"){return false}k=b(k);h=h||{};var j=this,d=c.parseClass(k,"dim"),g,l,f,i;h=c.pre.call(j,k,h,"dim");h.element=d[2]||h.element||null;h.dimClass=d[3]||h.dimClass||null;if(d[4]){h.dimAddColor="#"+d[4]}else{h.dimAddColor=h.dimAddColor||"#FFFF33"}if(d[5]){h.dimDelColor="#"+d[5]}else{h.dimDelColor=h.dimDelColor||"#FF3333"}if(!h||!h.element||!h.dimClass){return true}h.action="dim-"+h.what;h.nonce=c.nonce(k,h);h.data=b.extend({action:h.action,id:h.element.split("-").pop(),dimClass:h.dimClass,_ajax_nonce:h.nonce},wpAjax.unserialize(d[6]||""));if(b.isFunction(h.dimBefore)){h=h.dimBefore(h);if(!h){return true}}g=b("#"+h.element);l=g.toggleClass(h.dimClass).is("."+h.dimClass);f=c.getColor(g);g.toggleClass(h.dimClass);i=l?h.dimAddColor:h.dimDelColor;if("none"!=i){g.animate({backgroundColor:i},"fast").queue(function(){g.toggleClass(h.dimClass);b(this).dequeue()}).animate({backgroundColor:f},{complete:function(){b(this).css("backgroundColor","");b(j).trigger("wpListDimEnd",[h,j.wpList])}})}else{b(j).trigger("wpListDimEnd",[h,j.wpList])}if(!h.data._ajax_nonce){return true}h.success=function(m){var e=wpAjax.parseAjaxResponse(m,h.response,h.element),n;if(!e||e.errors){g.stop().stop().css("backgroundColor","#FF3333")[l?"removeClass":"addClass"](h.dimClass).show().queue(function(){j.wpList.recolor();b(this).dequeue()});return false}if(b.isFunction(h.dimAfter)){n=this.complete;this.complete=function(o,p){g.queue(function(){var q=b.extend({xml:o,status:p,parsed:e},h);h.dimAfter(m,q);if(b.isFunction(n)){n(o,p)}}).dequeue()}}};b.ajax(h);return false},getColor:function(e){if(e.constructor==Object){e=e.get(0)}var f=e,d,g=new RegExp("rgba\\(\\s*0,\\s*0,\\s*0,\\s*0\\s*\\)","i");do{d=jQuery.curCSS(f,"backgroundColor");if(d!=""&&d!="transparent"&&!d.match(g)||jQuery.nodeName(f,"body")){break}}while(f=f.parentNode);return d||"#ffffff"},add:function(k,g){k=b(k);var i=b(this),d=false,j={pos:0,id:0,oldId:null},l,h,f;if("string"==typeof g){g={what:g}}g=b.extend(j,this.wpList.settings,g);if(!k.size()||!g.what){return false}if(g.oldId){d=b("#"+g.what+"-"+g.oldId)}if(g.id&&(g.id!=g.oldId||!d||!d.size())){b("#"+g.what+"-"+g.id).remove()}if(d&&d.size()){d.before(k);d.remove()}else{if(isNaN(g.pos)){l="after";if("-"==g.pos.substr(0,1)){g.pos=g.pos.substr(1);l="before"}h=i.find("#"+g.pos);if(1===h.size()){h[l](k)}else{i.append(k)}}else{if(g.pos<0){i.prepend(k)}else{i.append(k)}}}if(g.alt){if((i.children(":visible").index(k[0])+g.altOffset)%2){k.removeClass(g.alt)}else{k.addClass(g.alt)}}if("none"!=g.addColor){f=c.getColor(k);k.css("backgroundColor",g.addColor).animate({backgroundColor:f},{complete:function(){b(this).css("backgroundColor","")}})}i.each(function(){this.wpList.process(k)});return k},clear:function(h){var g=this,f,d;h=b(h);if(g.wpList&&h.parents("#"+g.id).size()){return}h.find(":input").each(function(){if(b(this).parents(".form-no-clear").size()){return}f=this.type.toLowerCase();d=this.tagName.toLowerCase();if("text"==f||"password"==f||"textarea"==d){this.value=""}else{if("checkbox"==f||"radio"==f){this.checked=false}else{if("select"==d){this.selectedIndex=null}}}})},process:function(d){var e=this;b("[class^=add:"+e.id+":]",d||null).filter("form").submit(function(){return e.wpList.add(this)}).end().not("form").click(function(){return e.wpList.add(this)});b("[class^=delete:"+e.id+":]",d||null).click(function(){return e.wpList.del(this)});b("[class^=dim:"+e.id+":]",d||null).click(function(){return e.wpList.dim(this)})},recolor:function(){var f=this,e,d;if(!f.wpList.settings.alt){return}e=b(".list-item:visible",f);if(!e.size()){e=b(f).children(":visible")}d=[":even",":odd"];if(f.wpList.settings.altOffset%2){d.reverse()}e.filter(d[0]).addClass(f.wpList.settings.alt).end().filter(d[1]).removeClass(f.wpList.settings.alt)},init:function(){var d=this;d.wpList.process=function(e){d.each(function(){this.wpList.process(e)})};d.wpList.recolor=function(){d.each(function(){this.wpList.recolor()})}}};b.fn.wpList=function(d){this.each(function(){var e=this;this.wpList={settings:b.extend({},c.settings,{what:c.parseClass(this,"list")[1]||""},d)};b.each(a,function(g,h){e.wpList[g]=function(i,f){return c[h].call(e,i,f)}})});c.init.call(this);this.wpList.process();return this}})(jQuery);
\ No newline at end of file
+(function(b){var a={add:"ajaxAdd",del:"ajaxDel",dim:"ajaxDim",process:"process",recolor:"recolor"},c;c={settings:{url:ajaxurl,type:"POST",response:"ajax-response",what:"",alt:"alternate",altOffset:0,addColor:null,delColor:null,dimAddColor:null,dimDelColor:null,confirm:null,addBefore:null,addAfter:null,delBefore:null,delAfter:null,dimBefore:null,dimAfter:null},nonce:function(g,f){var d=wpAjax.unserialize(g.attr("href"));return f.nonce||d._ajax_nonce||b("#"+f.element+" input[name=_ajax_nonce]").val()||d._wpnonce||b("#"+f.element+" input[name=_wpnonce]").val()||0},parseClass:function(h,f){var i=[],d;try{d=b(h).attr("class")||"";d=d.match(new RegExp(f+":[\\S]+"));if(d){i=d[0].split(":")}}catch(g){}return i},pre:function(i,g,d){var f,h;g=b.extend({},this.wpList.settings,{element:null,nonce:0,target:i.get(0)},g||{});if(b.isFunction(g.confirm)){if("add"!=d){f=b("#"+g.element).css("backgroundColor");b("#"+g.element).css("backgroundColor","#FF9966")}h=g.confirm.call(this,i,g,d,f);if("add"!=d){b("#"+g.element).css("backgroundColor",f)}if(!h){return false}}return g},ajaxAdd:function(j,f){j=b(j);f=f||{};var h=this,d=c.parseClass(j,"add"),k,g,i;f=c.pre.call(h,j,f,"add");f.element=d[2]||j.attr("id")||f.element||null;if(d[3]){f.addColor="#"+d[3]}else{f.addColor=f.addColor||"#FFFF33"}if(!f){return false}if(!j.is("[class^=add:"+h.id+":]")){return !c.add.call(h,j,f)}if(!f.element){return true}f.action="add-"+f.what;f.nonce=c.nonce(j,f);k=b("#"+f.element+" :input").not("[name=_ajax_nonce], [name=_wpnonce], [name=action]");g=wpAjax.validateForm("#"+f.element);if(!g){return false}f.data=b.param(b.extend({_ajax_nonce:f.nonce,action:f.action},wpAjax.unserialize(d[4]||"")));i=b.isFunction(k.fieldSerialize)?k.fieldSerialize():k.serialize();if(i){f.data+="&"+i}if(b.isFunction(f.addBefore)){f=f.addBefore(f);if(!f){return true}}if(!f.data.match(/_ajax_nonce=[a-f0-9]+/)){return true}f.success=function(l){var e=wpAjax.parseAjaxResponse(l,f.response,f.element),m;if(!e||e.errors){return false}if(true===e){return true}jQuery.each(e.responses,function(){c.add.call(h,this.data,b.extend({},f,{pos:this.position||0,id:this.id||0,oldId:this.oldId||null}))});if(b.isFunction(f.addAfter)){m=this.complete;this.complete=function(n,o){var p=b.extend({xml:n,status:o,parsed:e},f);f.addAfter(l,p);if(b.isFunction(m)){m(n,o)}}}h.wpList.recolor();b(h).trigger("wpListAddEnd",[f,h.wpList]);c.clear.call(h,"#"+f.element)};b.ajax(f);return false},ajaxDel:function(i,g){i=b(i);g=g||{};var h=this,d=c.parseClass(i,"delete"),f;g=c.pre.call(h,i,g,"delete");g.element=d[2]||g.element||null;if(d[3]){g.delColor="#"+d[3]}else{g.delColor=g.delColor||"#faa"}if(!g||!g.element){return false}g.action="delete-"+g.what;g.nonce=c.nonce(i,g);g.data=b.extend({action:g.action,id:g.element.split("-").pop(),_ajax_nonce:g.nonce},wpAjax.unserialize(d[4]||""));if(b.isFunction(g.delBefore)){g=g.delBefore(g,h);if(!g){return true}}if(!g.data._ajax_nonce){return true}f=b("#"+g.element);if("none"!=g.delColor){f.css("backgroundColor",g.delColor).fadeOut(350,function(){h.wpList.recolor();b(h).trigger("wpListDelEnd",[g,h.wpList])})}else{h.wpList.recolor();b(h).trigger("wpListDelEnd",[g,h.wpList])}g.success=function(j){var e=wpAjax.parseAjaxResponse(j,g.response,g.element),k;if(!e||e.errors){f.stop().stop().css("backgroundColor","#faa").show().queue(function(){h.wpList.recolor();b(this).dequeue()});return false}if(b.isFunction(g.delAfter)){k=this.complete;this.complete=function(l,m){f.queue(function(){var n=b.extend({xml:l,status:m,parsed:e},g);g.delAfter(j,n);if(b.isFunction(k)){k(l,m)}}).dequeue()}}};b.ajax(g);return false},ajaxDim:function(k,h){if(b(k).parent().css("display")=="none"){return false}k=b(k);h=h||{};var j=this,d=c.parseClass(k,"dim"),g,l,f,i;h=c.pre.call(j,k,h,"dim");h.element=d[2]||h.element||null;h.dimClass=d[3]||h.dimClass||null;if(d[4]){h.dimAddColor="#"+d[4]}else{h.dimAddColor=h.dimAddColor||"#FFFF33"}if(d[5]){h.dimDelColor="#"+d[5]}else{h.dimDelColor=h.dimDelColor||"#FF3333"}if(!h||!h.element||!h.dimClass){return true}h.action="dim-"+h.what;h.nonce=c.nonce(k,h);h.data=b.extend({action:h.action,id:h.element.split("-").pop(),dimClass:h.dimClass,_ajax_nonce:h.nonce},wpAjax.unserialize(d[6]||""));if(b.isFunction(h.dimBefore)){h=h.dimBefore(h);if(!h){return true}}g=b("#"+h.element);l=g.toggleClass(h.dimClass).is("."+h.dimClass);f=c.getColor(g);g.toggleClass(h.dimClass);i=l?h.dimAddColor:h.dimDelColor;if("none"!=i){g.animate({backgroundColor:i},"fast").queue(function(){g.toggleClass(h.dimClass);b(this).dequeue()}).animate({backgroundColor:f},{complete:function(){b(this).css("backgroundColor","");b(j).trigger("wpListDimEnd",[h,j.wpList])}})}else{b(j).trigger("wpListDimEnd",[h,j.wpList])}if(!h.data._ajax_nonce){return true}h.success=function(m){var e=wpAjax.parseAjaxResponse(m,h.response,h.element),n;if(!e||e.errors){g.stop().stop().css("backgroundColor","#FF3333")[l?"removeClass":"addClass"](h.dimClass).show().queue(function(){j.wpList.recolor();b(this).dequeue()});return false}if(b.isFunction(h.dimAfter)){n=this.complete;this.complete=function(o,p){g.queue(function(){var q=b.extend({xml:o,status:p,parsed:e},h);h.dimAfter(m,q);if(b.isFunction(n)){n(o,p)}}).dequeue()}}};b.ajax(h);return false},getColor:function(e){if(e.constructor==Object){e=e.get(0)}var f=e,d,g=new RegExp("rgba\\(\\s*0,\\s*0,\\s*0,\\s*0\\s*\\)","i");do{d=jQuery.curCSS(f,"backgroundColor");if(d!=""&&d!="transparent"&&!d.match(g)||jQuery.nodeName(f,"body")){break}}while(f=f.parentNode);return d||"#ffffff"},add:function(k,g){k=b(k);var i=b(this),d=false,j={pos:0,id:0,oldId:null},l,h,f;if("string"==typeof g){g={what:g}}g=b.extend(j,this.wpList.settings,g);if(!k.size()||!g.what){return false}if(g.oldId){d=b("#"+g.what+"-"+g.oldId)}if(g.id&&(g.id!=g.oldId||!d||!d.size())){b("#"+g.what+"-"+g.id).remove()}if(d&&d.size()){d.before(k);d.remove()}else{if(isNaN(g.pos)){l="after";if("-"==g.pos.substr(0,1)){g.pos=g.pos.substr(1);l="before"}h=i.find("#"+g.pos);if(1===h.size()){h[l](k)}else{i.append(k)}}else{if(g.pos<0){i.prepend(k)}else{i.append(k)}}}if(g.alt){if((i.children(":visible").index(k[0])+g.altOffset)%2){k.removeClass(g.alt)}else{k.addClass(g.alt)}}if("none"!=g.addColor){f=c.getColor(k);k.css("backgroundColor",g.addColor).animate({backgroundColor:f},{complete:function(){b(this).css("backgroundColor","")}})}i.each(function(){this.wpList.process(k)});return k},clear:function(h){var g=this,f,d;h=b(h);if(g.wpList&&h.parents("#"+g.id).size()){return}h.find(":input").each(function(){if(b(this).parents(".form-no-clear").size()){return}f=this.type.toLowerCase();d=this.tagName.toLowerCase();if("text"==f||"password"==f||"textarea"==d){this.value=""}else{if("checkbox"==f||"radio"==f){this.checked=false}else{if("select"==d){this.selectedIndex=null}}}})},process:function(e){var f=this,d=b(e||document);d.delegate("form[class^=add:"+f.id+":]","submit",function(){return f.wpList.add(this)});d.delegate("[class^=add:"+f.id+":]:not(form)","click",function(){return f.wpList.add(this)});d.delegate("[class^=delete:"+f.id+":]","click",function(){return f.wpList.del(this)});d.delegate("[class^=dim:"+f.id+":]","click",function(){return f.wpList.dim(this)})},recolor:function(){var f=this,e,d;if(!f.wpList.settings.alt){return}e=b(".list-item:visible",f);if(!e.size()){e=b(f).children(":visible")}d=[":even",":odd"];if(f.wpList.settings.altOffset%2){d.reverse()}e.filter(d[0]).addClass(f.wpList.settings.alt).end().filter(d[1]).removeClass(f.wpList.settings.alt)},init:function(){var d=this;d.wpList.process=function(e){d.each(function(){this.wpList.process(e)})};d.wpList.recolor=function(){d.each(function(){this.wpList.recolor()})}}};b.fn.wpList=function(d){this.each(function(){var e=this;this.wpList={settings:b.extend({},c.settings,{what:c.parseClass(this,"list")[1]||""},d)};b.each(a,function(g,h){e.wpList[g]=function(i,f){return c[h].call(e,i,f)}})});c.init.call(this);this.wpList.process();return this}})(jQuery);
\ No newline at end of file
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or visit
* http://www.gnu.org/licenses/gpl.html
- *
+ *
* [kses strips evil scripts!]
*
* Added wp_ prefix to avoid conflicts with existing kses users
*
* @package External
* @subpackage KSES
+ *
*/
/**
global $pass_allowed_html, $pass_allowed_protocols;
$pass_allowed_html = $allowed_html;
$pass_allowed_protocols = $allowed_protocols;
- return preg_replace_callback('%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%',
- create_function('$match', 'global $pass_allowed_html, $pass_allowed_protocols; return wp_kses_split2($match[1], $pass_allowed_html, $pass_allowed_protocols);'), $string);
+ return preg_replace_callback( '%((<!--.*?(-->|$))|(<[^>]*(>|$)|>))%', '_wp_kses_split_callback', $string );
+}
+
+/**
+ * Callback for wp_kses_split.
+ *
+ * @since 3.1.0
+ * @access private
+ */
+function _wp_kses_split_callback( $match ) {
+ global $pass_allowed_html, $pass_allowed_protocols;
+ return wp_kses_split2( $match[1], $pass_allowed_html, $pass_allowed_protocols );
}
/**
* );
* ...
* $message = $messages[$type];
- * $usable_text = sprintf(_n($message[0], $message[1], $count), $count);
+ * $usable_text = sprintf( translate_nooped_plural( $message, $count ), $count );
*
* @since 2.5
- * @param $single Single form to be i18ned
- * @param $plural Plural form to be i18ned
+ * @param string $single Single form to be i18ned
+ * @param string $plural Plural form to be i18ned
* @return array array($single, $plural)
*/
-function _n_noop( $single, $plural ) {
- return array( $single, $plural );
+function _n_noop( $singular, $plural ) {
+ return array( 0 => $singular, 1 => $plural, 'singular' => $singular, 'plural' => $plural, 'context' => null );
}
/**
*
* @see _n_noop()
*/
-function _nx_noop( $single, $plural, $context ) {
- return array( $single, $plural, $context );
+function _nx_noop( $singular, $plural, $context ) {
+ return array( 0 => $singular, 1 => $plural, 2 => $context, 'singular' => $singular, 'plural' => $plural, 'context' => $context );
+}
+
+/**
+ * Translate the result of _n_noop() or _nx_noop()
+ *
+ * @since 3.1
+ * @param array $nooped_plural array with singular, plural and context keys, usually the result of _n_noop() or _nx_noop()
+ * @param int $count number of objects
+ * @param string $domain Optional. The domain identifier the text should be retrieved in
+ */
+function translate_nooped_plural( $nooped_plural, $count, $domain = 'default' ) {
+ if ( $nooped_plural['context'] )
+ return _nx( $nooped_plural['singular'], $nooped_plural['plural'], $count, $nooped_plural['context'], $domain );
+ else
+ return _n( $nooped_plural['singular'], $nooped_plural['plural'], $count, $domain );
}
/**
* @since 2.2.0
* @uses $wp_rewrite
*
- * @param $string String a URL with or without a trailing slash.
- * @param $type_of_url String the type of URL being considered (e.g. single, category, etc) for use in the filter.
+ * @param string $string URL with or without a trailing slash.
+ * @param string $type_of_url The type of URL being considered (e.g. single, category, etc) for use in the filter.
* @return string
*/
function user_trailingslashit($string, $type_of_url = '') {
$string = untrailingslashit($string);
// Note that $type_of_url can be one of following:
- // single, single_trackback, single_feed, single_paged, feed, category, page, year, month, day, paged
+ // single, single_trackback, single_feed, single_paged, feed, category, page, year, month, day, paged, post_type_archive
$string = apply_filters('user_trailingslashit', $string, $type_of_url);
return $string;
}
$slug = $post->post_name;
- $draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
+ $draft_or_pending = isset($post->post_status) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
$post_type = get_post_type_object($post->post_type);
- if ( !empty($post_link) && ( ( isset($post->post_status) && !$draft_or_pending ) || $sample ) ) {
+ if ( !empty($post_link) && ( !$draft_or_pending || $sample ) ) {
if ( ! $leavename ) {
if ( $post_type->hierarchical )
$slug = get_page_uri($id);
else
$post = &get_post($id);
+ $draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
+
$link = $wp_rewrite->get_page_permastruct();
- if ( '' != $link && ( ( isset($post->post_status) && 'draft' != $post->post_status && 'pending' != $post->post_status ) || $sample ) ) {
- if ( ! $leavename )
+ if ( !empty($link) && ( ( isset($post->post_status) && !$draft_or_pending ) || $sample ) ) {
+ if ( ! $leavename ) {
$link = str_replace('%pagename%', get_page_uri($id), $link);
+ }
+
$link = home_url($link);
$link = user_trailingslashit($link, 'page');
} else {
* @param string $feed Optional. Feed type.
* @return string
*/
-function get_post_comments_feed_link($post_id = '', $feed = '') {
- global $id;
+function get_post_comments_feed_link($post_id = 0, $feed = '') {
+ $post_id = absint( $post_id );
- if ( empty($post_id) )
- $post_id = (int) $id;
+ if ( ! $post_id )
+ $post_id = get_the_ID();
- if ( empty($feed) )
+ if ( empty( $feed ) )
$feed = get_default_feed();
if ( '' != get_option('permalink_structure') ) {
* @since 2.7.0
*
* @param int $tag_id Tag ID
+ * @param string $taxonomy Taxonomy
* @return string
*/
-function get_edit_tag_link( $tag_id = 0, $taxonomy = 'post_tag' ) {
- global $post_type;
- $tax = get_taxonomy($taxonomy);
- if ( !current_user_can($tax->cap->edit_terms) )
- return;
-
- $tag = get_term($tag_id, $taxonomy);
-
- $location = admin_url('edit-tags.php?action=edit&taxonomy=' . $taxonomy . '&' . (!empty($post_type) ? 'post_type=' . $post_type .'&' : '') .'tag_ID=' . $tag->term_id);
- return apply_filters( 'get_edit_tag_link', $location );
+function get_edit_tag_link( $tag_id, $taxonomy = 'post_tag' ) {
+ return apply_filters( 'get_edit_tag_link', get_edit_term_link( $tag_id, $taxonomy ) );
}
/**
* @param string $before Optional. Display before edit link.
* @param string $after Optional. Display after edit link.
* @param int|object $tag Tag object or ID
- * @return string|null HTML content, if $echo is set to false.
+ * @return string HTML content.
*/
function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) {
- $tax = get_taxonomy('post_tag');
- if ( !current_user_can($tax->cap->edit_terms) )
+ $link = edit_term_link( $link, '', '', false, $tag );
+ echo $before . apply_filters( 'edit_tag_link', $link ) . $after;
+}
+
+/**
+ * Retrieve edit term url.
+ *
+ * @since 3.1.0
+ *
+ * @param int $term_id Term ID
+ * @param string $taxonomy Taxonomy
+ * @param string $object_type The object type
+ * @return string
+ */
+function get_edit_term_link( $term_id, $taxonomy, $object_type = '' ) {
+ $tax = get_taxonomy( $taxonomy );
+ if ( !current_user_can( $tax->cap->edit_terms ) )
return;
- $tag = get_term($tag, 'post_tag');
+ $term = get_term( $term_id, $taxonomy );
- if ( empty($link) )
+ $args = array(
+ 'action' => 'edit',
+ 'taxonomy' => $taxonomy,
+ 'tag_ID' => $term->term_id,
+ );
+
+ if ( $object_type )
+ $args['post_type'] = $object_type;
+
+ $location = add_query_arg( $args, admin_url( 'edit-tags.php' ) );
+
+ return apply_filters( 'get_edit_term_link', $location, $term_id, $taxonomy, $object_type );
+}
+
+/**
+ * Display or retrieve edit term link with formatting.
+ *
+ * @since 3.1.0
+ *
+ * @param string $link Optional. Anchor text.
+ * @param string $before Optional. Display before edit link.
+ * @param string $after Optional. Display after edit link.
+ * @param object $term Term object
+ * @return string HTML content.
+ */
+function edit_term_link( $link = '', $before = '', $after = '', $term = null, $echo = true ) {
+ if ( is_null( $term ) ) {
+ $term = get_queried_object();
+ }
+
+ $tax = get_taxonomy( $term->taxonomy );
+ if ( !current_user_can($tax->cap->edit_terms) )
+ return;
+
+ if ( empty( $link ) )
$link = __('Edit This');
- $link = '<a href="' . get_edit_tag_link( $tag->term_id ) . '" title="' . __( 'Edit Tag' ) . '">' . $link . '</a>';
- echo $before . apply_filters( 'edit_tag_link', $link, $tag->term_id ) . $after;
+ $link = '<a href="' . get_edit_term_link( $term->term_id, $term->taxonomy ) . '" title="' . $link . '">' . $link . '</a>';
+ $link = $before . apply_filters( 'edit_term_link', $link, $term->term_id ) . $after;
+
+ if ( $echo )
+ echo $link;
+ else
+ return $link;
}
/**
return $link;
}
+/**
+ * Retrieve the permalink for a post type archive.
+ *
+ * @since 3.1.0
+ *
+ * @param string $post_type Post type
+ * @return string
+ */
+function get_post_type_archive_link( $post_type ) {
+ global $wp_rewrite;
+ if ( ! $post_type_obj = get_post_type_object( $post_type ) )
+ return false;
+
+ if ( ! $post_type_obj->has_archive )
+ return false;
+
+ if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) ) {
+ $struct = ( true === $post_type_obj->has_archive ) ? $post_type_obj->rewrite['slug'] : $post_type_obj->has_archive;
+ if ( $post_type_obj->rewrite['with_front'] )
+ $struct = $wp_rewrite->front . $struct;
+ $link = home_url( user_trailingslashit( $struct, 'post_type_archive' ) );
+ } else {
+ $link = home_url( '?post_type=' . $post_type );
+ }
+
+ return apply_filters( 'post_type_archive_link', $link, $post_type );
+}
+
+/**
+ * Retrieve the permalink for a post type archive feed.
+ *
+ * @since 3.1.0
+ *
+ * @param string $post_type Post type
+ * @param string $feed Optional. Feed type
+ * @return string
+ */
+function get_post_type_archive_feed_link( $post_type, $feed = '' ) {
+ $default_feed = get_default_feed();
+ if ( empty( $feed ) )
+ $feed = $default_feed;
+
+ if ( ! $link = get_post_type_archive_link( $post_type ) )
+ return false;
+ $post_type_obj = get_post_type_object( $post_type );
+ if ( $post_type_obj->rewrite['feeds'] && get_option( 'permalink_structure' ) ) {
+ $link = trailingslashit($link);
+ $link .= 'feed/';
+ if ( $feed != $default_feed )
+ $link .= "$feed/";
+ } else {
+ $link = add_query_arg( 'feed', $feed, $link );
+ }
+
+ return apply_filters( 'post_type_archive_feed_link', $link, $feed );
+}
+
/**
* Retrieve edit posts link for post.
*
*/
function get_delete_post_link( $id = 0, $deprecated = '', $force_delete = false ) {
if ( ! empty( $deprecated ) )
- _deprecated_argument( __FUNCTION__, '3.0.0' );
+ _deprecated_argument( __FUNCTION__, '3.0' );
if ( !$post = &get_post( $id ) )
return;
*/
function get_edit_comment_link( $comment_id = 0 ) {
$comment = &get_comment( $comment_id );
- $post = &get_post( $comment->comment_post_ID );
- if ( $post->post_type == 'page' ) {
- if ( !current_user_can( 'edit_page', $post->ID ) )
- return;
- } else {
- if ( !current_user_can( 'edit_post', $post->ID ) )
- return;
- }
+ if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
+ return;
$location = admin_url('comment.php?action=editcomment&c=') . $comment->comment_ID;
return apply_filters( 'get_edit_comment_link', $location );
* @return string|null HTML content, if $echo is set to false.
*/
function edit_comment_link( $link = null, $before = '', $after = '' ) {
- global $comment, $post;
+ global $comment;
- if ( $post->post_type == 'page' ) {
- if ( !current_user_can( 'edit_page', $post->ID ) )
- return;
- } else {
- if ( !current_user_can( 'edit_post', $post->ID ) )
- return;
- }
+ if ( !current_user_can( 'edit_comment', $comment->comment_ID ) )
+ return;
if ( null === $link )
$link = __('Edit This');
- $link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>';
+ $link = '<a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . esc_attr__( 'Edit comment' ) . '">' . $link . '</a>';
echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after;
}
if ( empty($link) )
$link = __('Edit This');
- $link = '<a href="' . get_edit_bookmark_link( $link ) . '" title="' . __( 'Edit Link' ) . '">' . $link . '</a>';
+ $link = '<a href="' . get_edit_bookmark_link( $bookmark ) . '" title="' . esc_attr__( 'Edit Link' ) . '">' . $link . '</a>';
echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after;
}
// Navigation links
/**
- * Retrieve previous post link that is adjacent to current post.
+ * Retrieve previous post that is adjacent to current post.
*
* @since 1.5.0
*
- * @param bool $in_same_cat Optional. Whether link should be in same category.
+ * @param bool $in_same_cat Optional. Whether post should be in same category.
* @param string $excluded_categories Optional. Excluded categories IDs.
- * @return string
+ * @return mixed Post object if successful. Null if global $post is not set. Empty string if no corresponding post exists.
*/
function get_previous_post($in_same_cat = false, $excluded_categories = '') {
return get_adjacent_post($in_same_cat, $excluded_categories);
}
/**
- * Retrieve next post link that is adjacent to current post.
+ * Retrieve next post that is adjacent to current post.
*
* @since 1.5.0
*
- * @param bool $in_same_cat Optional. Whether link should be in same category.
+ * @param bool $in_same_cat Optional. Whether post should be in same category.
* @param string $excluded_categories Optional. Excluded categories IDs.
- * @return string
+ * @return mixed Post object if successful. Null if global $post is not set. Empty string if no corresponding post exists.
*/
function get_next_post($in_same_cat = false, $excluded_categories = '') {
return get_adjacent_post($in_same_cat, $excluded_categories, false);
}
/**
- * Retrieve adjacent post link.
+ * Retrieve adjacent post.
*
- * Can either be next or previous post link.
+ * Can either be next or previous post.
*
* @since 2.5.0
*
- * @param bool $in_same_cat Optional. Whether link should be in same category.
+ * @param bool $in_same_cat Optional. Whether post should be in same category.
* @param string $excluded_categories Optional. Excluded categories IDs.
* @param bool $previous Optional. Whether to retrieve previous post.
- * @return string
+ * @return mixed Post object if successful. Null if global $post is not set. Empty string if no corresponding post exists.
*/
function get_adjacent_post($in_same_cat = false, $excluded_categories = '', $previous = true) {
global $post, $wpdb;
/**
* Retrieve boundary post.
*
- * Boundary being either the first or last post by publish date within the contraitns specified
+ * Boundary being either the first or last post by publish date within the constraints specified
* by in same category or excluded categories.
*
* @since 2.8.0
*
* @param bool $in_same_cat Optional. Whether returned post should be in same category.
* @param string $excluded_categories Optional. Excluded categories IDs.
- * @param bool $previous Optional. Whether to retrieve first post.
+ * @param bool $start Optional. Whether to retrieve first or last post.
* @return object
*/
function get_boundary_post($in_same_cat = false, $excluded_categories = '', $start = true) {
$order = $start ? 'ASC' : 'DESC';
- return get_posts( array('numberposts' => 1, 'no_found_rows' => true, 'order' => $order, 'orderby' => 'ID', 'category' => $categories) );
+ return get_posts( array('numberposts' => 1, 'category' => $categories, 'order' => $order, 'update_post_term_cache' => false, 'update_post_meta_cache' => false) );
}
/**
* @param string $title Optional. Link title format.
* @param bool $in_same_cat Optional. Whether link should be in same category.
* @param string $excluded_categories Optional. Excluded categories IDs.
- * @param bool $start Optional, default is true. Whether display link to first post.
+ * @param bool $start Optional, default is true. Whether display link to first or last post.
* @return string
*/
function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) {
- $posts = get_boundary_post($in_same_cat,$excluded_categories,$start);
+ $posts = get_boundary_post($in_same_cat, $excluded_categories, $start);
// If there is no post stop.
if ( empty($posts) )
return;
$query_string = '';
}
- $request = preg_replace( '|page/\d+/?$|', '', $request);
+ $request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request);
$request = preg_replace( '|^index\.php|', '', $request);
$request = ltrim($request, '/');
$base .= 'index.php/';
if ( $pagenum > 1 ) {
- $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/' . $pagenum, 'paged' );
+ $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . "/" . $pagenum, 'paged' );
}
$result = $base . $request . $query_string;
$nextpage = intval($paged) + 1;
- if ( !is_single() && ( empty($paged) || $nextpage <= $max_page) ) {
+ if ( !is_single() && ( $nextpage <= $max_page ) ) {
$attr = apply_filters( 'next_posts_link_attributes', '' );
return '<a href="' . next_posts( $max_page, false ) . "\" $attr>" . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $label) . '</a>';
}
$scheme = is_ssl() && !is_admin() ? 'https' : 'http';
if ( empty( $blog_id ) || !is_multisite() )
- $home = get_option( 'home' );
+ $url = get_option( 'home' );
else
- $home = get_blog_option( $blog_id, 'home' );
+ $url = get_blog_option( $blog_id, 'home' );
- $url = str_replace( 'http://', "$scheme://", $home );
+ if ( 'http' != $scheme )
+ $url = str_replace( 'http://', "$scheme://", $url );
if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
$url .= '/' . ltrim( $path, '/' );
else
$url = get_blog_option( $blog_id, 'siteurl' );
- $url = str_replace( 'http://', "{$scheme}://", $url );
+ if ( 'http' != $scheme )
+ $url = str_replace( 'http://', "{$scheme}://", $url );
if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
$url .= '/' . ltrim( $path, '/' );
$scheme = ( is_ssl() ? 'https' : 'http' );
}
- $url = 'http://' . $current_site->domain . $current_site->path;
-
- $url = str_replace( 'http://', "{$scheme}://", $url );
+ $url = $scheme . '://' . $current_site->domain . $current_site->path;
if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
$url .= ltrim($path, '/');
if ( !in_array($scheme, array('http', 'https')) )
$scheme = is_ssl() && !is_admin() ? 'https' : 'http';
- $url = 'http://' . $current_site->domain . $current_site->path;
-
- $url = str_replace( 'http://', "$scheme://", $url );
+ $url = $scheme . '://' . $current_site->domain . $current_site->path;
if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
$url .= ltrim( $path, '/' );
* @return string Admin url link with optional path appended
*/
function network_admin_url( $path = '', $scheme = 'admin' ) {
- $url = network_site_url('wp-admin/', $scheme);
+ if ( ! is_multisite() )
+ return admin_url( $path, $scheme );
+
+ $url = network_site_url('wp-admin/network/', $scheme);
if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
$url .= ltrim($path, '/');
return apply_filters('network_admin_url', $url, $path);
}
+/**
+ * Retrieve the url to the admin area for the current user.
+ *
+ * @package WordPress
+ * @since 3.0.0
+ *
+ * @param string $path Optional path relative to the admin url
+ * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
+ * @return string Admin url link with optional path appended
+*/
+function user_admin_url( $path = '', $scheme = 'admin' ) {
+ $url = network_site_url('wp-admin/user/', $scheme);
+
+ if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
+ $url .= ltrim($path, '/');
+
+ return apply_filters('user_admin_url', $url, $path);
+}
+
+/**
+ * Retrieve the url to the admin area for either the current blog or the network depending on context.
+ *
+ * @package WordPress
+ * @since 3.1.0
+ *
+ * @param string $path Optional path relative to the admin url
+ * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
+ * @return string Admin url link with optional path appended
+*/
+function self_admin_url($path = '', $scheme = 'admin') {
+ if ( is_network_admin() )
+ return network_admin_url($path, $scheme);
+ elseif ( is_user_admin() )
+ return user_admin_url($path, $scheme);
+ else
+ return admin_url($path, $scheme);
+}
+
+/**
+ * Get the URL to the user's dashboard.
+ *
+ * If a user does not belong to any sites, the global user dashboard is used. If the user belongs to the current site,
+ * the dashboard for the current site is returned. If the user cannot edit the current site, the dashboard to the user's
+ * primary blog is returned.
+ *
+ * @since 3.1.0
+ *
+ * @param int $user_id User ID
+ * @param string $path Optional path relative to the dashboard. Use only paths known to both blog and user admins.
+ * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
+ * @return string Dashboard url link with optional path appended
+ */
+function get_dashboard_url( $user_id, $path = '', $scheme = 'admin' ) {
+ $user_id = (int) $user_id;
+
+ $blogs = get_blogs_of_user( $user_id );
+ if ( empty($blogs) ) {
+ $url = user_admin_url( $path, $scheme );
+ } elseif ( ! is_multisite() ) {
+ $url = admin_url( $path, $scheme );
+ } else {
+ $current_blog = get_current_blog_id();
+ if ( $current_blog && in_array($current_blog, array_keys($blogs)) ) {
+ $url = admin_url( $path, $scheme );
+ } else {
+ $active = get_active_blog_for_user( $user_id );
+ if ( $active )
+ $url = get_admin_url( $active->blog_id, $path, $scheme );
+ else
+ $url = user_admin_url( $path, $scheme );
+ }
+ }
+
+ return apply_filters( 'user_dashboard_url', $url, $user_id, $path, $scheme);
+}
+
+/**
+ * Get the URL to the user's profile editor.
+ *
+ * @since 3.1.0
+ *
+ * @param int $user User ID
+ * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
+ * @return string Dashboard url link with optional path appended
+ */
+function get_edit_profile_url( $user, $scheme = 'admin' ) {
+ $user = (int) $user;
+
+ if ( is_user_admin() )
+ $url = user_admin_url( 'profile.php', $scheme );
+ elseif ( is_network_admin() )
+ $url = network_admin_url( 'profile.php', $scheme );
+ else
+ $url = get_dashboard_url( $user, 'profile.php', $scheme );
+
+ return apply_filters( 'edit_profile_url', $url, $user, $scheme);
+}
+
/**
* Output rel=canonical for singular queries
*
* @since 3.0.0.
*
* @param int $id A post or blog id. Default is 0, which means the current post or blog.
- * @param string $contex Whether the id is a 'blog' id, 'post' id, or 'media' id. If 'post', the post_type of the post is consulted. If 'query', the current query is consulted to determine the id and context. Default is 'post'.
+ * @param string $context Whether the id is a 'blog' id, 'post' id, or 'media' id. If 'post', the post_type of the post is consulted. If 'query', the current query is consulted to determine the id and context. Default is 'post'.
* @param bool $allow_slugs Whether to allow post slugs in the shortlink. It is up to the plugin how and whether to honor this.
* @return string A shortlink or an empty string if no shortlink exists for the requested resource or if shortlinks are not enabled.
*/
if ( empty( $shortlink ) )
return;
- echo "<link rel='shortlink' href='" . esc_url( $shortlink ) . "' />\n";
+ echo "<link rel='shortlink' href='" . esc_url_raw( $shortlink ) . "' />\n";
}
/**
* @uses wp_get_shortlink()
*/
function wp_shortlink_header() {
- if ( headers_sent() )
+ if ( headers_sent() )
return;
$shortlink = wp_get_shortlink(0, 'query');
*/
function wp_debug_mode() {
if ( WP_DEBUG ) {
+ // E_DEPRECATED is a core PHP constant in PHP 5.3. Don't define this yourself.
+ // The two statements are equivalent, just one is for 5.3+ and for less than 5.3.
if ( defined( 'E_DEPRECATED' ) )
error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT );
else
}
}
+/**
+ * Load the correct database class file.
+ *
+ * This function is used to load the database class file either at runtime or by
+ * wp-admin/setup-config.php. We must globalize $wpdb to ensure that it is
+ * defined globally by the inline code in wp-db.php.
+ *
+ * @since 2.5.0
+ * @global $wpdb WordPress Database Object
+ */
+function require_wp_db() {
+ global $wpdb;
+
+ require_once( ABSPATH . WPINC . '/wp-db.php' );
+ if ( file_exists( WP_CONTENT_DIR . '/db.php' ) )
+ require_once( WP_CONTENT_DIR . '/db.php' );
+
+ if ( isset( $wpdb ) )
+ return;
+
+ $wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );
+}
+
/**
* Sets the database table prefix and the format specifiers for database table columns.
*
wp_cache_init();
if ( function_exists( 'wp_cache_add_global_groups' ) ) {
- wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts' ) );
+ wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts' ) );
wp_cache_add_non_persistent_groups( array( 'comment', 'counts', 'plugins' ) );
}
}
if ( ! is_blog_installed() && ! defined( 'WP_INSTALLING' ) )
wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) );
} elseif ( ! is_blog_installed() && false === strpos( $_SERVER['PHP_SELF'], 'install.php' ) && !defined( 'WP_INSTALLING' ) ) {
- if ( defined( 'WP_SITEURL' ) )
- $link = WP_SITEURL . '/wp-admin/install.php';
- elseif ( false !== strpos( $_SERVER['PHP_SELF'], 'wp-admin' ) )
- $link = preg_replace( '|/wp-admin/?.*?$|', '/', $_SERVER['PHP_SELF'] ) . 'wp-admin/install.php';
- else
- $link = preg_replace( '|/[^/]+?$|', '/', $_SERVER['PHP_SELF'] ) . 'wp-admin/install.php';
+
+ $link = wp_guess_url() . '/wp-admin/install.php';
+
require( ABSPATH . WPINC . '/kses.php' );
require( ABSPATH . WPINC . '/pluggable.php' );
require( ABSPATH . WPINC . '/formatting.php' );
$plugins = array();
$active_plugins = (array) get_option( 'active_plugins', array() );
- // Get active network plugins
- if ( is_multisite() ) {
- $active_sitewide_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
- if ( !empty($active_sitewide_plugins) ) {
- $active_plugins = array_merge( $active_plugins, array_keys( $active_sitewide_plugins ) );
- sort( $active_plugins );
- }
- }
-
// Check for hacks file if the option is enabled
if ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) ) {
_deprecated_file( 'my-hacks.php', '1.5' );
if ( empty( $active_plugins ) || defined( 'WP_INSTALLING' ) )
return $plugins;
+ $network_plugins = is_multisite() ? wp_get_active_network_plugins() : false;
+
foreach ( $active_plugins as $plugin ) {
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
+ // not already included as a network plugin
+ && ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins ) )
)
$plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
}
}
/**
- * Whether the current request is in WordPress admin Panel
+ * Whether the current request is for a network or blog admin page
*
* 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.
return false;
}
+/**
+ * Whether the current request is for a blog admin screen /wp-admin/
+ *
+ * Does not inform on whether the user is a blog admin! Use capability checks to
+ * tell if the user should be accessing a section or not.
+ *
+ * @since 3.1.0
+ *
+ * @return bool True if inside WordPress network administration pages.
+ */
+function is_blog_admin() {
+ if ( defined( 'WP_BLOG_ADMIN' ) )
+ return WP_BLOG_ADMIN;
+ return false;
+}
+
+/**
+ * Whether the current request is for a network admin screen /wp-admin/network/
+ *
+ * Does not inform on whether the user is a network admin! Use capability checks to
+ * tell if the user should be accessing a section or not.
+ *
+ * @since 3.1.0
+ *
+ * @return bool True if inside WordPress network administration pages.
+ */
+function is_network_admin() {
+ if ( defined( 'WP_NETWORK_ADMIN' ) )
+ return WP_NETWORK_ADMIN;
+ return false;
+}
+
+/**
+ * Whether the current request is for a user admin screen /wp-admin/user/
+ *
+ * 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 3.1.0
+ *
+ * @return bool True if inside WordPress user administration pages.
+ */
+function is_user_admin() {
+ if ( defined( 'WP_USER_ADMIN' ) )
+ return WP_USER_ADMIN;
+ return false;
+}
+
/**
* Whether Multisite support is enabled
*
$meta = wp_get_attachment_metadata($id);
$width = $height = 0;
$is_intermediate = false;
+ $img_url_basename = wp_basename($img_url);
// plugins can use this to provide resize services
if ( $out = apply_filters('image_downsize', false, $id, $size) )
// try for a new style intermediate size
if ( $intermediate = image_get_intermediate_size($id, $size) ) {
- $img_url = str_replace(basename($img_url), $intermediate['file'], $img_url);
+ $img_url = str_replace($img_url_basename, $intermediate['file'], $img_url);
$width = $intermediate['width'];
$height = $intermediate['height'];
$is_intermediate = true;
elseif ( $size == 'thumbnail' ) {
// fall back to the old thumbnail
if ( ($thumb_file = wp_get_attachment_thumb_file($id)) && $info = getimagesize($thumb_file) ) {
- $img_url = str_replace(basename($img_url), basename($thumb_file), $img_url);
+ $img_url = str_replace($img_url_basename, wp_basename($thumb_file), $img_url);
$width = $info[0];
$height = $info[1];
$is_intermediate = true;
/**
* Registers a new image size
*/
-function add_image_size( $name, $width = 0, $height = 0, $crop = FALSE ) {
+function add_image_size( $name, $width = 0, $height = 0, $crop = false ) {
global $_wp_additional_image_sizes;
- $_wp_additional_image_sizes[$name] = array( 'width' => absint( $width ), 'height' => absint( $height ), 'crop' => !!$crop );
+ $_wp_additional_image_sizes[$name] = array( 'width' => absint( $width ), 'height' => absint( $height ), 'crop' => (bool) $crop );
}
/**
* Registers an image size for the post thumbnail
*/
-function set_post_thumbnail_size( $width = 0, $height = 0, $crop = FALSE ) {
+function set_post_thumbnail_size( $width = 0, $height = 0, $crop = false ) {
add_image_size( 'post-thumbnail', $width, $height, $crop );
}
$info = pathinfo($file);
$dir = $info['dirname'];
$ext = $info['extension'];
- $name = basename($file, ".{$ext}");
+ $name = wp_basename($file, ".$ext");
+
if ( !is_null($dest_path) and $_dest_path = realpath($dest_path) )
$dir = $_dest_path;
$destfilename = "{$dir}/{$name}-{$suffix}.{$ext}";
if ( !is_wp_error($resized_file) && $resized_file && $info = getimagesize($resized_file) ) {
$resized_file = apply_filters('image_make_intermediate_size', $resized_file);
return array(
- 'file' => basename( $resized_file ),
+ 'file' => wp_basename( $resized_file ),
'width' => $info[0],
'height' => $info[1],
);
if ( $icon && $src = wp_mime_type_icon($attachment_id) ) {
$icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' );
- $src_file = $icon_dir . '/' . basename($src);
+ $src_file = $icon_dir . '/' . wp_basename($src);
@list($width, $height) = getimagesize($src_file);
}
if ( $src && $width && $height )
$selector = "gallery-{$instance}";
- $output = apply_filters('gallery_style', "
+ $gallery_style = $gallery_div = '';
+ if ( apply_filters( 'use_default_gallery_style', true ) )
+ $gallery_style = "
<style type='text/css'>
#{$selector} {
margin: auto;
float: {$float};
margin-top: 10px;
text-align: center;
- width: {$itemwidth}%; }
+ width: {$itemwidth}%;
+ }
#{$selector} img {
border: 2px solid #cfcfcf;
}
margin-left: 0;
}
</style>
- <!-- see gallery_shortcode() in wp-includes/media.php -->
- <div id='$selector' class='gallery galleryid-{$id}'>");
+ <!-- see gallery_shortcode() in wp-includes/media.php -->";
+ $size_class = sanitize_html_class( $size );
+ $gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>";
+ $output = apply_filters( 'gallery_style', $gallery_style . "\n\t\t" . $gallery_div );
$i = 0;
foreach ( $attachments as $id => $attachment ) {
</{$icontag}>";
if ( $captiontag && trim($attachment->post_excerpt) ) {
$output .= "
- <{$captiontag} class='gallery-caption'>
+ <{$captiontag} class='wp-caption-text gallery-caption'>
" . wptexturize($attachment->post_excerpt) . "
</{$captiontag}>";
}
*
* @since 2.9.0
*
- * @param $mime_type string
+ * @param string $mime_type
* @return bool
*/
function gd_edit_image_support($mime_type) {
*
* @since 2.9.0
*
- * @param $width
- * @param $height
+ * @param int $width Image width
+ * @param int $height Image height
* @return image resource
*/
function wp_imagecreatetruecolor($width, $height) {
function run_shortcode( $content ) {
global $shortcode_tags;
- // Backup current registered shortcodes and clear them all out
+ // Back up current registered shortcodes and clear them all out
$orig_shortcode_tags = $shortcode_tags;
remove_all_shortcodes();
$rawattr = $attr;
$attr = wp_parse_args( $attr, wp_embed_defaults() );
+ // kses converts & into & and we need to undo this
+ // See http://core.trac.wordpress.org/ticket/11311
+ $url = str_replace( '&', '&', $url );
+
// Look for known internal handlers
ksort( $this->handlers );
foreach ( $this->handlers as $priority => $handlers ) {
return $this->maybe_make_link( $url );
if ( !empty($cache) )
- return apply_filters( 'embed_oembed_html', $cache, $url, $attr );
+ return apply_filters( 'embed_oembed_html', $cache, $url, $attr, $post_ID );
}
// Use oEmbed to get the HTML
// If there was a result, return it
if ( $html )
- return apply_filters( 'embed_oembed_html', $html, $url, $attr );
+ return apply_filters( 'embed_oembed_html', $html, $url, $attr, $post_ID );
}
// Still unknown
require_once( ABSPATH . WPINC . '/class-oembed.php' );
$oembed = _wp_oembed_get_object();
$oembed->providers[$format] = array( $provider, $regex );
-}
+}
\ No newline at end of file
// expected_slashed ($meta_key)
$meta_key = stripslashes($meta_key);
+ $meta_value = stripslashes_deep($meta_value);
+
+ $check = apply_filters( "add_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $unique );
+ if ( null !== $check )
+ return (bool) $check;
if ( $unique && $wpdb->get_var( $wpdb->prepare(
"SELECT COUNT(*) FROM $table WHERE meta_key = %s AND $column = %d",
return false;
$_meta_value = $meta_value;
- $meta_value = maybe_serialize( stripslashes_deep($meta_value) );
+ $meta_value = maybe_serialize( $meta_value );
+
+ do_action( "add_{$meta_type}_meta", $object_id, $meta_key, $_meta_value );
$wpdb->insert( $table, array(
$column => $object_id,
// expected_slashed ($meta_key)
$meta_key = stripslashes($meta_key);
+ $meta_value = stripslashes_deep($meta_value);
+
+ $check = apply_filters( "update_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $prev_value );
+ if ( null !== $check )
+ return (bool) $check;
if ( ! $meta_id = $wpdb->get_var( $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s AND $column = %d", $meta_key, $object_id ) ) )
return add_metadata($meta_type, $object_id, $meta_key, $meta_value);
}
$_meta_value = $meta_value;
- $meta_value = maybe_serialize( stripslashes_deep($meta_value) );
+ $meta_value = maybe_serialize( $meta_value );
$data = compact( 'meta_value' );
$where = array( $column => $object_id, 'meta_key' => $meta_key );
$id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
// expected_slashed ($meta_key)
$meta_key = stripslashes($meta_key);
- $meta_value = maybe_serialize( stripslashes_deep($meta_value) );
+ $meta_value = stripslashes_deep($meta_value);
+
+ $check = apply_filters( "delete_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $delete_all );
+ if ( null !== $check )
+ return (bool) $check;
+
+ $_meta_value = $meta_value;
+ $meta_value = maybe_serialize( $meta_value );
$query = $wpdb->prepare( "SELECT $id_column FROM $table WHERE meta_key = %s", $meta_key );
if ( !count( $meta_ids ) )
return false;
+ do_action( "delete_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
+
$query = "DELETE FROM $table WHERE $id_column IN( " . implode( ',', $meta_ids ) . " )";
$count = $wpdb->query($query);
if ( 'user' == $meta_type )
clean_user_cache($object_id);
- do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $meta_value );
+ do_action( "deleted_{$meta_type}_meta", $meta_ids, $object_id, $meta_key, $_meta_value );
return true;
}
if ( !$object_id = absint($object_id) )
return false;
+ $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single );
+ if ( null !== $check ) {
+ if ( $single && is_array( $check ) )
+ return $check[0];
+ else
+ return $check;
+ }
+
$meta_cache = wp_cache_get($object_id, $meta_type . '_meta');
if ( !$meta_cache ) {
- update_meta_cache($meta_type, $object_id);
- $meta_cache = wp_cache_get($object_id, $meta_type . '_meta');
+ $meta_cache = update_meta_cache( $meta_type, array( $object_id ) );
+ $meta_cache = $meta_cache[$object_id];
}
- if ( ! $meta_key )
+ if ( !$meta_key )
return $meta_cache;
if ( isset($meta_cache[$meta_key]) ) {
$cache_key = $meta_type . '_meta';
$ids = array();
+ $cache = array();
foreach ( $object_ids as $id ) {
- if ( false === wp_cache_get($id, $cache_key) )
+ $cached_object = wp_cache_get( $id, $cache_key );
+ if ( false === $cached_object )
$ids[] = $id;
+ else
+ $cache[$id] = $cached_object;
}
if ( empty( $ids ) )
- return false;
+ return $cache;
// Get meta info
$id_list = join(',', $ids);
- $cache = array();
$meta_list = $wpdb->get_results( $wpdb->prepare("SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list)",
$meta_type), ARRAY_A );
foreach ( $ids as $id ) {
if ( ! isset($cache[$id]) )
$cache[$id] = array();
+ wp_cache_add( $id, $cache[$id], $cache_key );
}
- foreach ( array_keys($cache) as $object)
- wp_cache_set($object, $cache[$object], $cache_key);
-
return $cache;
}
+/**
+ * Given a meta query, generates SQL clauses to be appended to a main query
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @param array $meta_query List of metadata queries. A single query is an associative array:
+ * - 'key' string The meta key
+ * - 'value' string|array The meta value
+ * - 'compare' (optional) string How to compare the key to the value.
+ * Possible values: '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'.
+ * Default: '='
+ * - 'type' string (optional) The type of the value.
+ * Possible values: 'NUMERIC', 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED'.
+ * Default: 'CHAR'
+ *
+ * @param string $meta_type
+ * @param string $primary_table
+ * @param string $primary_id_column
+ * @param object $context (optional) The main query object
+ * @return array( 'join' => $join_sql, 'where' => $where_sql )
+ */
+function _get_meta_sql( $meta_query, $meta_type, $primary_table, $primary_id_column, $context = null ) {
+ global $wpdb;
+
+ if ( ! $meta_table = _get_meta_table( $meta_type ) )
+ return false;
+
+ $meta_id_column = esc_sql( $meta_type . '_id' );
+
+ $join = '';
+ $where = '';
+ $i = 0;
+ foreach ( $meta_query as $q ) {
+ $meta_key = isset( $q['key'] ) ? trim( $q['key'] ) : '';
+ $meta_value = isset( $q['value'] ) ? $q['value'] : '';
+ $meta_compare = isset( $q['compare'] ) ? strtoupper( $q['compare'] ) : '=';
+ $meta_type = isset( $q['type'] ) ? strtoupper( $q['type'] ) : 'CHAR';
+
+ if ( ! in_array( $meta_compare, array( '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) )
+ $meta_compare = '=';
+
+ if ( 'NUMERIC' == $meta_type )
+ $meta_type = 'SIGNED';
+ elseif ( ! in_array( $meta_type, array( 'BINARY', 'CHAR', 'DATE', 'DATETIME', 'DECIMAL', 'SIGNED', 'TIME', 'UNSIGNED' ) ) )
+ $meta_type = 'CHAR';
+
+ if ( empty( $meta_key ) && empty( $meta_value ) )
+ continue;
+
+ $alias = $i ? 'mt' . $i : $meta_table;
+
+ $join .= "\nINNER JOIN $meta_table";
+ $join .= $i ? " AS $alias" : '';
+ $join .= " ON ($primary_table.$primary_id_column = $alias.$meta_id_column)";
+
+ $i++;
+
+ if ( !empty( $meta_key ) )
+ $where .= $wpdb->prepare( " AND $alias.meta_key = %s", $meta_key );
+
+ if ( in_array( $meta_compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) {
+ if ( ! is_array( $meta_value ) )
+ $meta_value = preg_split( '/[,\s]+/', $meta_value );
+ } else {
+ $meta_value = trim( $meta_value );
+ }
+
+ if ( empty( $meta_value ) )
+ continue;
+
+ if ( 'IN' == substr( $meta_compare, -2) ) {
+ $meta_compare_string = '(' . substr( str_repeat( ',%s', count( $meta_value ) ), 1 ) . ')';
+ } elseif ( 'BETWEEN' == substr( $meta_compare, -7) ) {
+ $meta_value = array_slice( $meta_value, 0, 2 );
+ $meta_compare_string = '%s AND %s';
+ } elseif ( 'LIKE' == substr( $meta_compare, -4 ) ) {
+ $meta_value = '%' . like_escape( $meta_value ) . '%';
+ $meta_compare_string = '%s';
+ } else {
+ $meta_compare_string = '%s';
+ }
+
+ // @todo Temporary hack to support empty values. Do not use outside of core.
+ if ( '_wp_zero_value' == $meta_value )
+ $meta_value = 0;
+
+ $where .= $wpdb->prepare( " AND CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string}", $meta_value );
+ }
+
+ return apply_filters_ref_array( 'get_meta_sql', array( compact( 'join', 'where' ), $meta_query, $meta_type, $primary_table, $primary_id_column, &$context ) );
+}
+
+/**
+ * Populates the $meta_query property
+ *
+ * @access private
+ * @since 3.1.0
+ *
+ * @param array $qv The query variables
+ */
+function _parse_meta_query( &$qv ) {
+ $meta_query = array();
+
+ // Simple query needs to be first for orderby=meta_value to work correctly
+ foreach ( array( 'key', 'value', 'compare', 'type' ) as $key ) {
+ if ( !empty( $qv[ "meta_$key" ] ) )
+ $meta_query[0][ $key ] = $qv[ "meta_$key" ];
+ }
+
+ if ( !empty( $qv['meta_query'] ) && is_array( $qv['meta_query'] ) ) {
+ $meta_query = array_merge( $meta_query, $qv['meta_query'] );
+ }
+
+ $qv['meta_query'] = $meta_query;
+}
+
/**
* Retrieve the name of the metadata table for the specified object type.
*
* @since 2.9.0
* @uses $wpdb WordPress database object for queries.
*
- * @param string $meta_type Type of object to get metadata table for (e.g., comment, post, or user)
+ * @param string $type Type of object to get metadata table for (e.g., comment, post, or user)
* @return mixed Metadata table name, or false if no metadata table exists
*/
function _get_meta_table($type) {
*
* @package WordPress
* @subpackage Multisite
- * @since 3.0.0
+ * @since MU
*/
-// @todo use update_blog_details
+/**
+ * Update the last_updated field for the current blog.
+ *
+ * @since MU
+ */
function wpmu_update_blogs_date() {
global $wpdb;
+ // TODO: use update_blog_details
+
$wpdb->update( $wpdb->blogs, array('last_updated' => current_time('mysql', true)), array('blog_id' => $wpdb->blogid) );
refresh_blog_details( $wpdb->blogid );
do_action( 'wpmu_blog_updated', $wpdb->blogid );
}
+/**
+ * Get a full blog URL, given a blog id.
+ *
+ * @since MU
+ *
+ * @param int $blog_id Blog ID
+ * @return string
+ */
function get_blogaddress_by_id( $blog_id ) {
$bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details!
return esc_url( 'http://' . $bloginfo->domain . $bloginfo->path );
}
+/**
+ * Get a full blog URL, given a blog name.
+ *
+ * @since MU
+ *
+ * @param string $blogname The (subdomain or directory) name
+ * @return string
+ */
function get_blogaddress_by_name( $blogname ) {
global $current_site;
return esc_url( $url . '/' );
}
-function get_blogaddress_by_domain( $domain, $path ){
+/**
+ * Get a full blog URL, given a domain and a path.
+ *
+ * @since MU
+ *
+ * @param string $domain
+ * @param string $path
+ * @return string
+ */
+function get_blogaddress_by_domain( $domain, $path ) {
if ( is_subdomain_install() ) {
$url = "http://".$domain.$path;
} else {
return esc_url( $url );
}
+/**
+ * Given a blog's (subdomain or directory) name, retrieve it's id.
+ *
+ * @since MU
+ *
+ * @param string $name
+ * @return int A blog id
+ */
function get_id_from_blogname( $name ) {
global $wpdb, $current_site;
$blog_id = wp_cache_get( "get_id_from_blogname_" . $name, 'blog-details' );
/**
* Retrieve the details for a blog from the blogs table and blog options.
*
- * @since 3.0.0
+ * @since MU
+ *
* @param int|string|array $fields A blog ID, a blog name, or an array of fields to query against.
* @param bool $get_all Whether to retrieve all details or only the details in the blogs table. Default is true.
* @return object Blog details.
/**
* Clear the blog details cache.
*
- * @since 3.0.0
+ * @since MU
*
* @param int $blog_id Blog ID
*/
/**
* Update the details for a blog. Updates the blogs table for a given blog id.
*
- * @since 3.0.0
+ * @since MU
*
* @param int $blog_id Blog ID
* @param array $details Array of details keyed by blogs table field names.
}
if ( isset($details[ 'public' ]) )
- update_blog_option( $blog_id, 'blog_public', $details[ 'public' ], false );
+ update_blog_option( $blog_id, 'blog_public', $details[ 'public' ] );
refresh_blog_details($blog_id);
* $blog_id. It returns $value.
* The 'option_$option' filter in get_option() is not called.
*
- * @since NA
- * @package WordPress MU
- * @subpackage Option
+ * @since MU
* @uses apply_filters() Calls 'blog_option_$optionname' with the option name value.
*
* @param int $blog_id is the id of the blog.
- * @param string $setting Name of option to retrieve. Should already be SQL-escaped
+ * @param string $setting Name of option to retrieve. Should already be SQL-escaped.
* @param string $default (optional) Default value returned if option not found.
* @return mixed Value set for the option.
*/
if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting )
$value = untrailingslashit( $value );
- if (! @unserialize( $value ) )
- $value = stripslashes( $value );
-
return apply_filters( 'blog_option_' . $setting, maybe_unserialize( $value ), $blog_id );
}
+/**
+ * Add an option for a particular blog.
+ *
+ * @since MU
+ *
+ * @param int $id The blog id
+ * @param string $key The option key
+ * @param mixed $value The option value
+ */
function add_blog_option( $id, $key, $value ) {
$id = (int) $id;
wp_cache_set( $id."-".$key."-blog_option", $value, 'site-options' );
}
+/**
+ * Delete an option for a particular blog.
+ *
+ * @since MU
+ *
+ * @param int $id The blog id
+ * @param string $key The option key
+ */
function delete_blog_option( $id, $key ) {
$id = (int) $id;
wp_cache_set( $id."-".$key."-blog_option", '', 'site-options' );
}
-function update_blog_option( $id, $key, $value, $refresh = true ) {
+/**
+ * Update an option for a particular blog.
+ *
+ * @since MU
+ *
+ * @param int $id The blog id
+ * @param string $key The option key
+ * @param mixed $value The option value
+ */
+function update_blog_option( $id, $key, $value, $deprecated = null ) {
$id = (int) $id;
+ if ( null !== $deprecated )
+ _deprecated_argument( __FUNCTION__, '3.1' );
+
switch_to_blog($id);
update_option( $key, $value );
restore_current_blog();
- if ( $refresh == true )
- refresh_blog_details( $id );
+ refresh_blog_details( $id );
+
wp_cache_set( $id."-".$key."-blog_option", $value, 'site-options');
}
+/**
+ * Switch the current blog.
+ *
+ * This function is useful if you need to pull posts, or other information,
+ * from other blogs. You can switch back afterwards using restore_current_blog().
+ *
+ * Things that aren't switched:
+ * - autoloaded options. See #14992
+ * - plugins. See #14941
+ *
+ * @see restore_current_blog()
+ * @since MU
+ *
+ * @param int $new_blog The id of the blog you want to switch to. Default: current blog
+ * @param bool $validate Whether to check if $new_blog exists before proceeding
+ * @return bool True on success, False if the validation failed
+ */
function switch_to_blog( $new_blog, $validate = false ) {
global $wpdb, $table_prefix, $blog_id, $switched, $switched_stack, $wp_roles, $wp_object_cache;
$wp_roles->__construct();
$wpdb->suppress_errors( false );
}
-
+
if ( did_action('init') ) {
- $current_user = wp_get_current_user();
+ $current_user = wp_get_current_user();
if ( is_object( $current_user ) )
$current_user->for_blog( $blog_id );
}
if ( is_array( $global_groups ) )
wp_cache_add_global_groups( $global_groups );
else
- wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'site-transient', 'global-posts' ) );
+ wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts' ) );
wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' ));
}
return true;
}
+/**
+ * Restore the current blog, after calling switch_to_blog()
+ *
+ * @see switch_to_blog()
+ * @since MU
+ *
+ * @return bool True on success, False if we're already on the current blog
+ */
function restore_current_blog() {
global $table_prefix, $wpdb, $blog_id, $switched, $switched_stack, $wp_roles, $wp_object_cache;
if ( is_array( $global_groups ) )
wp_cache_add_global_groups( $global_groups );
else
- wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'site-transient' ) );
+ wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss', 'global-posts' ) );
wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' ));
}
return true;
}
+/**
+ * Check if a particular blog is archived.
+ *
+ * @since MU
+ *
+ * @param int $id The blog id
+ * @return string Whether the blog is archived or not
+ */
function is_archived( $id ) {
return get_blog_status($id, 'archived');
}
+/**
+ * Update the 'archived' status of a particular blog.
+ *
+ * @since MU
+ *
+ * @param int $id The blog id
+ * @param string $archived The new status
+ * @return string $archived
+ */
function update_archived( $id, $archived ) {
update_blog_status($id, 'archived', $archived);
return $archived;
/**
* Update a blog details field.
*
- * @since 3.0.0
+ * @since MU
*
* @param int $blog_id BLog ID
* @param string $pref A field name
* @param string $value Value for $pref
- * @param bool $refresh Whether to refresh the blog details cache. Default is true.
+ * @return string $value
*/
-function update_blog_status( $blog_id, $pref, $value, $refresh = true ) {
+function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
global $wpdb;
+ if ( null !== $deprecated )
+ _deprecated_argument( __FUNCTION__, '3.1' );
+
if ( !in_array( $pref, array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id') ) )
return $value;
$wpdb->update( $wpdb->blogs, array($pref => $value, 'last_updated' => current_time('mysql', true)), array('blog_id' => $blog_id) );
- if ( $refresh )
- refresh_blog_details($blog_id);
+ refresh_blog_details($blog_id);
- if ( $pref == 'spam' ) {
- if ( $value == 1 )
- do_action( "make_spam_blog", $blog_id );
- else
- do_action( "make_ham_blog", $blog_id );
- }
+ if ( 'spam' == $pref )
+ ( $value == 1 ) ? do_action( 'make_spam_blog', $blog_id ) : do_action( 'make_ham_blog', $blog_id );
+ elseif ( 'mature' == $pref )
+ ( $value == 1 ) ? do_action( 'mature_blog', $blog_id ) : do_action( 'unmature_blog', $blog_id );
+ elseif ( 'archived' == $pref )
+ ( $value == 1 ) ? do_action( 'archive_blog', $blog_id ) : do_action( 'unarchive_blog', $blog_id );
+ elseif ( 'archived' == $pref )
+ ( $value == 1 ) ? do_action( 'archive_blog', $blog_id ) : do_action( 'unarchive_blog', $blog_id );
return $value;
}
+/**
+ * Get a blog details field.
+ *
+ * @since MU
+ *
+ * @param int $id The blog id
+ * @param string $pref A field name
+ * @return bool $value
+ */
function get_blog_status( $id, $pref ) {
global $wpdb;
return $wpdb->get_var( $wpdb->prepare("SELECT %s FROM {$wpdb->blogs} WHERE blog_id = %d", $pref, $id) );
}
+/**
+ * Get a list of most recently updated blogs.
+ *
+ * @since MU
+ *
+ * @param mixed $deprecated Not used
+ * @param int $start The offset
+ * @param int $quantity The maximum number of blogs to retrieve. Default is 40.
+ * @return array The list of blogs
+ */
function get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) {
global $wpdb;
+
+ if ( ! empty( $deprecated ) )
+ _deprecated_argument( __FUNCTION__, 'MU' ); // never used
+
return $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND last_updated != '0000-00-00 00:00:00' ORDER BY last_updated DESC limit %d, %d", $wpdb->siteid, $start, $quantity ) , ARRAY_A );
}
add_action( 'private_to_published', 'wpmu_update_blogs_date' );
add_action( 'publish_phone', 'wpmu_update_blogs_date' );
add_action( 'publish_post', 'wpmu_update_blogs_date' );
+add_action( 'admin_init', 'wp_schedule_update_network_counts');
+add_action( 'update_network_counts', 'wp_update_network_counts');
// Files
add_filter( 'wp_upload_bits', 'upload_is_file_too_big' );
add_filter( 'upload_size_limit', 'upload_size_limit_filter' );
// Mail
-add_filter( 'wp_mail_from', 'wordpressmu_wp_mail_from' );
add_action( 'phpmailer_init', 'fix_phpmailer_messageid' );
// Disable somethings by default for multisite
add_filter( 'enable_post_by_email_configuration', '__return_false' );
if ( ! defined('EDIT_ANY_USER') || ! EDIT_ANY_USER ) // back compat constant.
add_filter( 'enable_edit_any_user_configuration', '__return_false' );
+add_filter( 'force_filtered_html_on_import', '__return_true' );
// WP_HOME and WP_SITEURL should not have any effect in MS
remove_filter( 'option_siteurl', '_config_wp_siteurl' );
*/
/**
- * @since unknown
+ * @since MU
* @deprecated 3.0.0
* @deprecated Use wp_generate_password()
* @see wp_generate_password()
/**
* @since MU
* @deprecated 3.0.0
- * @deprecated Don't use this, really.
+ * @deprecated No alternative available. For performance reasons this function is not recommended.
*/
function get_blog_list( $start = 0, $num = 10, $deprecated = '' ) {
- _deprecated_function( __FUNCTION__, '3.0', "Don't use this, really." );
+ _deprecated_function( __FUNCTION__, '3.0' );
global $wpdb;
$blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A );
/**
* @since MU
* @deprecated 3.0.0
- * @deprecated Don't use this, really.
+ * @deprecated No alternative available. For performance reasons this function is not recommended.
*/
function get_most_active_blogs( $num = 10, $display = true ) {
- _deprecated_function( __FUNCTION__, '3.0', "Don't use this, really." );
+ _deprecated_function( __FUNCTION__, '3.0' );
$blogs = get_blog_list( 0, 'all', false ); // $blog_id -> $details
if ( is_array( $blogs ) ) {
* @since 3.0.0
*/
+/**
+ * Gets the network's site and user counts.
+ *
+ * @since MU 1.0
+ * @uses get_blog_count()
+ * @uses get_user_count()
+ *
+ * @return array Site and user count for the network.
+ */
function get_sitestats() {
global $wpdb;
$stats['blogs'] = get_blog_count();
+ $stats['users'] = get_user_count();
- $count_ts = get_site_option( 'user_count_ts' );
- if ( time() - $count_ts > 3600 ) {
- $count = $wpdb->get_var( "SELECT COUNT(ID) FROM $wpdb->users" );
- update_site_option( 'user_count', $count );
- update_site_option( 'user_count_ts', time() );
- } else {
- $count = get_site_option( 'user_count' );
- }
- $stats['users'] = $count;
return $stats;
}
+/**
+ * Get the admin for a domain/path combination.
+ *
+ * @since MU 1.0
+ *
+ * @param string $sitedomain Optional. Site domain.
+ * @param string $path Optional. Site path.
+ * @return array The network admins
+ */
function get_admin_users_for_domain( $sitedomain = '', $path = '' ) {
global $wpdb;
return false;
}
-function get_blogs_of_user( $id, $all = false ) {
- global $wpdb;
-
- $cache_suffix = $all ? '_all' : '_short';
- $return = wp_cache_get( 'blogs_of_user_' . $id . $cache_suffix, 'users' );
- if ( $return )
- return apply_filters( 'get_blogs_of_user', $return, $id, $all );
-
- $user = get_userdata( (int) $id );
- if ( !$user )
- return false;
-
- $blogs = $match = array();
- $prefix_length = strlen($wpdb->base_prefix);
- foreach ( (array) $user as $key => $value ) {
- if ( $prefix_length && substr($key, 0, $prefix_length) != $wpdb->base_prefix )
- continue;
- if ( substr($key, -12, 12) != 'capabilities' )
- continue;
- if ( preg_match( '/^' . $wpdb->base_prefix . '((\d+)_)?capabilities$/', $key, $match ) ) {
- if ( count( $match ) > 2 )
- $blog_id = $match[ 2 ];
- else
- $blog_id = 1;
- $blog = get_blog_details( $blog_id );
- if ( $blog && isset( $blog->domain ) && ( $all == true || $all == false && ( $blog->archived == 0 && $blog->spam == 0 && $blog->deleted == 0 ) ) ) {
- $blogs[ $blog_id ]->userblog_id = $blog_id;
- $blogs[ $blog_id ]->blogname = $blog->blogname;
- $blogs[ $blog_id ]->domain = $blog->domain;
- $blogs[ $blog_id ]->path = $blog->path;
- $blogs[ $blog_id ]->site_id = $blog->site_id;
- $blogs[ $blog_id ]->siteurl = $blog->siteurl;
- }
- }
- }
-
- wp_cache_add( 'blogs_of_user_' . $id . $cache_suffix, $blogs, 'users', 5 );
- return apply_filters( 'get_blogs_of_user', $blogs, $id, $all );
-}
-
-function get_active_blog_for_user( $user_id ) { // get an active blog for user - either primary blog or from blogs list
+/**
+ * Get one of a user's active blogs
+ *
+ * Returns the user's primary blog, if she has one and
+ * it is active. If it's inactive, function returns another
+ * active blog of the user. If none are found, the user
+ * is added as a Subscriber to the Dashboard Blog and that blog
+ * is returned.
+ *
+ * @since MU 1.0
+ * @uses get_blogs_of_user()
+ * @uses add_user_to_blog()
+ * @uses get_blog_details()
+ *
+ * @param int $user_id The unique ID of the user
+ * @return object The blog object
+ */
+function get_active_blog_for_user( $user_id ) {
global $wpdb;
$blogs = get_blogs_of_user( $user_id );
- if ( empty( $blogs ) ) {
- $details = get_dashboard_blog();
- add_user_to_blog( $details->blog_id, $user_id, 'subscriber' );
- update_user_meta( $user_id, 'primary_blog', $details->blog_id );
- wp_cache_delete( $user_id, 'users' );
- return $details;
- }
+ if ( empty( $blogs ) )
+ return null;
+
+ if ( !is_multisite() )
+ return $blogs[$wpdb->blogid];
$primary_blog = get_user_meta( $user_id, 'primary_blog', true );
- $details = get_dashboard_blog();
- if ( $primary_blog ) {
- $blogs = get_blogs_of_user( $user_id );
- if ( isset( $blogs[ $primary_blog ] ) == false ) {
- add_user_to_blog( $details->blog_id, $user_id, 'subscriber' );
- update_user_meta( $user_id, 'primary_blog', $details->blog_id );
- wp_cache_delete( $user_id, 'users' );
+ $first_blog = current($blogs);
+ if ( false !== $primary_blog ) {
+ if ( ! isset( $blogs[ $primary_blog ] ) ) {
+ update_user_meta( $user_id, 'primary_blog', $first_blog->userblog_id );
+ $primary = $first_blog;
} else {
- $details = get_blog_details( $primary_blog );
+ $primary = get_blog_details( $primary_blog );
}
} else {
- add_user_to_blog( $details->blog_id, $user_id, 'subscriber' ); // Add subscriber permission for dashboard blog
- update_user_meta( $user_id, 'primary_blog', $details->blog_id );
+ //TODO Review this call to add_user_to_blog too - to get here the user must have a role on this blog?
+ add_user_to_blog( $first_blog->userblog_id, $user_id, 'subscriber' );
+ update_user_meta( $user_id, 'primary_blog', $first_blog->userblog_id );
+ $primary = $first_blog;
}
- if ( ( is_object( $details ) == false ) || ( is_object( $details ) && $details->archived == 1 || $details->spam == 1 || $details->deleted == 1 ) ) {
+ if ( ( ! is_object( $primary ) ) || ( is_object( $primary ) && $primary->archived == 1 || $primary->spam == 1 || $primary->deleted == 1 ) ) {
$blogs = get_blogs_of_user( $user_id, true ); // if a user's primary blog is shut down, check their other blogs.
$ret = false;
if ( is_array( $blogs ) && count( $blogs ) > 0 ) {
$details = get_blog_details( $blog_id );
if ( is_object( $details ) && $details->archived == 0 && $details->spam == 0 && $details->deleted == 0 ) {
$ret = $blog;
- $changed = false;
- if ( get_user_meta( $user_id , 'primary_blog', true ) != $blog_id ) {
+ if ( get_user_meta( $user_id , 'primary_blog', true ) != $blog_id )
update_user_meta( $user_id, 'primary_blog', $blog_id );
- $changed = true;
- }
- if ( !get_user_meta($user_id , 'source_domain', true) ) {
+ if ( !get_user_meta($user_id , 'source_domain', true) )
update_user_meta( $user_id, 'source_domain', $blog->domain );
- $changed = true;
- }
- if ( $changed )
- wp_cache_delete( $user_id, 'users' );
break;
}
}
} else {
- // Should never get here
- $dashboard_blog = get_dashboard_blog();
- add_user_to_blog( $dashboard_blog->blog_id, $user_id, 'subscriber' ); // Add subscriber permission for dashboard blog
- update_user_meta( $user_id, 'primary_blog', $dashboard_blog->blog_id );
- return $dashboard_blog;
+ return null;
}
return $ret;
} else {
- return $details;
+ return $primary;
}
}
+/**
+ * Find out whether a user is a member of a given blog.
+ *
+ * @since MU 1.1
+ * @uses get_blogs_of_user()
+ *
+ * @param int $user_id The unique ID of the user
+ * @param int $blog Optional. If no blog_id is provided, current site is used
+ * @return bool
+ */
function is_user_member_of_blog( $user_id, $blog_id = 0 ) {
$user_id = (int) $user_id;
$blog_id = (int) $blog_id;
return false;
}
+/**
+ * The number of active users in your installation.
+ *
+ * The count is cached and updated twice daily. This is not a live count.
+ *
+ * @since MU 2.7
+ *
+ * @return int
+ */
function get_user_count() {
- global $wpdb;
-
- $count_ts = get_site_option( 'user_count_ts' );
- if ( time() - $count_ts > 3600 ) {
- $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'") );
- update_site_option( 'user_count', $count );
- update_site_option( 'user_count_ts', time() );
- }
-
- $count = get_site_option( 'user_count' );
-
- return $count;
+ return get_site_option( 'user_count' );
}
+/**
+ * The number of active sites on your installation.
+ *
+ * The count is cached and updated twice daily. This is not a live count.
+ *
+ * @since MU 1.0
+ *
+ * @param int $id Optional. A site_id.
+ * @return int
+ */
function get_blog_count( $id = 0 ) {
- global $wpdb;
-
- if ( $id == 0 )
- $id = $wpdb->siteid;
-
- $count_ts = get_site_option( 'blog_count_ts' );
- if ( time() - $count_ts > 3600 ) {
- $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(blog_id) as c FROM $wpdb->blogs WHERE site_id = %d AND spam = '0' AND deleted = '0' and archived = '0'", $id) );
- update_site_option( 'blog_count', $count );
- update_site_option( 'blog_count_ts', time() );
- }
-
- $count = get_site_option( 'blog_count' );
-
- return $count;
+ return get_site_option( 'blog_count' );
}
+/**
+ * Get a blog post from any site on the network.
+ *
+ * @since MU 1.0
+ *
+ * @param int $blog_id ID of the blog.
+ * @param int $post_id ID of the post you're looking for.
+ * @return object The post.
+ */
function get_blog_post( $blog_id, $post_id ) {
global $wpdb;
return $post;
}
+/**
+ * Add a user to a blog.
+ *
+ * Use the 'add_user_to_blog' action to fire an event when
+ * users are added to a blog.
+ *
+ * @since MU 1.0
+ *
+ * @param int $blog_id ID of the blog you're adding the user to.
+ * @param int $user_id ID of the user you're adding.
+ * @param string $role The role you want the user to have
+ * @return bool
+ */
function add_user_to_blog( $blog_id, $user_id, $role ) {
switch_to_blog($blog_id);
$user = new WP_User($user_id);
- if ( empty( $user->ID ) )
+ if ( empty( $user->ID ) ) {
+ restore_current_blog();
return new WP_Error('user_does_not_exist', __('That user does not exist.'));
+ }
if ( !get_user_meta($user_id, 'primary_blog', true) ) {
update_user_meta($user_id, 'primary_blog', $blog_id);
return true;
}
+/**
+ * Remove a user from a blog.
+ *
+ * Use the 'remove_user_from_blog' action to fire an event when
+ * users are removed from a blog.
+ *
+ * Accepts an optional $reassign parameter, if you want to
+ * reassign the user's blog posts to another user upon removal.
+ *
+ * @since MU 1.0
+ *
+ * @param int $user_id ID of the user you're removing.
+ * @param int $blog_id ID of the blog you're removing the user from.
+ * @param string $reassign Optional. A user to whom to reassign posts.
+ * @return bool
+ */
function remove_user_from_blog($user_id, $blog_id = '', $reassign = '') {
global $wpdb;
switch_to_blog($blog_id);
// wp_revoke_user($user_id);
$user = new WP_User($user_id);
- if ( empty( $user->ID ) )
+ if ( empty( $user->ID ) ) {
+ restore_current_blog();
return new WP_Error('user_does_not_exist', __('That user does not exist.'));
+ }
$user->remove_all_caps();
restore_current_blog();
}
+/**
+ * Create an empty blog.
+ *
+ * @since MU 1.0
+ * @uses install_blog()
+ *
+ * @param string $domain The new blog's domain.
+ * @param string $path The new blog's path.
+ * @param string $string The new blog's title.
+ * @param int $site Optional. Defaults to 1.
+ * @return int The ID of the newly created blog
+ */
function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) {
$domain = addslashes( $domain );
$weblog_title = addslashes( $weblog_title );
if ( domain_exists($domain, $path, $site_id) )
return __( 'Error: Site URL already taken.' );
- // Need to backup wpdb table names, and create a new wp_blogs entry for new blog.
+ // Need to back up wpdb table names, and create a new wp_blogs entry for new blog.
// Need to get blog_id from wp_blogs, and create new table names.
// Must restore table names at the end of function.
return $blog_id;
}
+/**
+ * Get the permalink for a post on another blog.
+ *
+ * @since MU 1.0
+ *
+ * @param int $_blog_id ID of the source blog.
+ * @param int $post_id ID of the desired post.
+ * @return string The post's permalink
+ */
function get_blog_permalink( $_blog_id, $post_id ) {
$key = "{$_blog_id}-{$post_id}-blog_permalink";
$link = wp_cache_get( $key, 'site-options' );
return $link;
}
+/**
+ * Get a blog's numeric ID from its URL.
+ *
+ * On a subdirectory installation like example.com/blog1/,
+ * $domain will be the root 'example.com' and $path the
+ * subdirectory '/blog1/'. With subdomains like blog1.example.com,
+ * $domain is 'blog1.example.com' and $path is '/'.
+ *
+ * @since MU 2.6.5
+ *
+ * @param string $domain
+ * @param string $path Optional. Not required for subdomain installations.
+ * @return int
+ */
function get_blog_id_from_url( $domain, $path = '/' ) {
global $wpdb;
return $id;
}
-// wpmu admin functions
+// Admin functions
+/**
+ * Redirect a user based on $_GET or $_POST arguments.
+ *
+ * The function looks for redirect arguments in the following order:
+ * 1) $_GET['ref']
+ * 2) $_POST['ref']
+ * 3) $_SERVER['HTTP_REFERER']
+ * 4) $_GET['redirect']
+ * 5) $_POST['redirect']
+ * 6) $url
+ *
+ * @since MU
+ * @uses wpmu_admin_redirect_add_updated_param()
+ *
+ * @param string $url
+ */
function wpmu_admin_do_redirect( $url = '' ) {
$ref = '';
if ( isset( $_GET['ref'] ) )
exit();
}
+/**
+ * Adds an 'updated=true' argument to a URL.
+ *
+ * @since MU
+ *
+ * @param string $url
+ * @return string
+ */
function wpmu_admin_redirect_add_updated_param( $url = '' ) {
if ( strpos( $url, 'updated=true' ) === false ) {
if ( strpos( $url, '?' ) === false )
return $url;
}
-function is_blog_user( $blog_id = 0 ) {
- global $wpdb;
-
- $current_user = wp_get_current_user();
- if ( !$blog_id )
- $blog_id = $wpdb->blogid;
-
- $cap_key = $wpdb->base_prefix . $blog_id . '_capabilities';
-
- if ( is_array($current_user->$cap_key) && in_array(1, $current_user->$cap_key) )
- return true;
-
- return false;
-}
-
+/**
+ * Checks an email address against a list of banned domains.
+ *
+ * This function checks against the Banned Email Domains list
+ * at wp-admin/network/settings.php. The check is only run on
+ * self-registrations; user creation at wp-admin/network/users.php
+ * bypasses this check.
+ *
+ * @since MU
+ *
+ * @param string $user_email The email provided by the user at registration.
+ * @return bool Returns true when the email address is banned.
+ */
function is_email_address_unsafe( $user_email ) {
$banned_names = get_site_option( 'banned_email_domains' );
if ($banned_names && !is_array( $banned_names ))
return false;
}
+/**
+ * Processes new user registrations.
+ *
+ * Checks the data provided by the user during signup. Verifies
+ * the validity and uniqueness of user names and user email addresses,
+ * and checks email addresses against admin-provided domain
+ * whitelists and blacklists.
+ *
+ * The hook 'wpmu_validate_user_signup' provides an easy way
+ * to modify the signup process. The value $result, which is passed
+ * to the hook, contains both the user-provided info and the error
+ * messages created by the function. 'wpmu_validate_user_signup' allows
+ * you to process the data in any way you'd like, and unset the
+ * relevant errors if necessary.
+ *
+ * @since MU
+ * @uses is_email_address_unsafe()
+ * @uses username_exists()
+ * @uses email_exists()
+ *
+ * @param string $user_name The login name provided by the user.
+ * @param string $user_email The email provided by the user.
+ * @return array Contains username, email, and error messages.
+ */
function wpmu_validate_user_signup($user_name, $user_email) {
global $wpdb;
preg_match( '/[a-z0-9]+/', $user_name, $maybe );
if ( $user_name != $orig_username || $user_name != $maybe[0] ) {
- $errors->add( 'user_name', __( "Only the lowercase letters a-z and numbers allowed" ) );
+ $errors->add( 'user_name', __( 'Only lowercase letters (a-z) and numbers are allowed.' ) );
$user_name = $orig_username;
}
return apply_filters('wpmu_validate_user_signup', $result);
}
+/**
+ * Processes new site registrations.
+ *
+ * Checks the data provided by the user during blog signup. Verifies
+ * the validity and uniqueness of blog paths and domains.
+ *
+ * This function prevents the current user from registering a new site
+ * with a blogname equivalent to another user's login name. Passing the
+ * $user parameter to the function, where $user is the other user, is
+ * effectively an override of this limitation.
+ *
+ * Filter 'wpmu_validate_blog_signup' if you want to modify
+ * the way that WordPress validates new site signups.
+ *
+ * @since MU
+ * @uses domain_exists()
+ * @uses username_exists()
+ *
+ * @param string $blogname The blog name provided by the user. Must be unique.
+ * @param string $blog_title The blog title provided by the user.
+ * @return array Contains the new site data and error messages.
+ */
function wpmu_validate_blog_signup($blogname, $blog_title, $user = '') {
global $wpdb, $domain, $base, $current_site;
return apply_filters('wpmu_validate_blog_signup', $result);
}
-// Record signup information for future activation. wpmu_validate_signup() should be run
-// on the inputs before calling wpmu_signup().
+/**
+ * Record site signup information for future activation.
+ *
+ * @since MU
+ * @uses wpmu_signup_blog_notification()
+ *
+ * @param string $domain The requested domain.
+ * @param string $path The requested path.
+ * @param string $title The requested site title.
+ * @param string $user The user's requested login name.
+ * @param string $user_email The user's email address.
+ * @param array $meta By default, contains the requested privacy setting and lang_id.
+ */
function wpmu_signup_blog($domain, $path, $title, $user, $user_email, $meta = '') {
global $wpdb;
wpmu_signup_blog_notification($domain, $path, $title, $user, $user_email, $key, $meta);
}
+/**
+ * Record user signup information for future activation.
+ *
+ * This function is used when user registration is open but
+ * new site registration is not.
+ *
+ * @since MU
+ * @uses wpmu_signup_user_notification()
+ *
+ * @param string $user The user's requested login name.
+ * @param string $user_email The user's email address.
+ * @param array $meta By default, this is an empty array.
+ */
function wpmu_signup_user($user, $user_email, $meta = '') {
global $wpdb;
wpmu_signup_user_notification($user, $user_email, $key, $meta);
}
-// Notify user of signup success.
+/**
+ * Notify user of signup success.
+ *
+ * This is the notification function used when site registration
+ * is enabled.
+ *
+ * Filter 'wpmu_signup_blog_notification' to bypass this function or
+ * replace it with your own notification behavior.
+ *
+ * Filter 'wpmu_signup_blog_notification_email' and
+ * 'wpmu_signup_blog_notification_email' to change the content
+ * and subject line of the email sent to newly registered users.
+ *
+ * @since MU
+ *
+ * @param string $domain The new blog domain.
+ * @param string $path The new blog path.
+ * @param string $title The site title.
+ * @param string $user The user's login name.
+ * @param string $user_email The user's email address.
+ * @param array $meta By default, contains the requested privacy setting and lang_id.
+ * @param string $key The activation key created in wpmu_signup_blog()
+ * @return bool
+ */
function wpmu_signup_blog_notification($domain, $path, $title, $user, $user_email, $key, $meta = '') {
global $current_site;
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
- $message = sprintf( apply_filters( 'wpmu_signup_blog_notification_email', __( "To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your site here:\n\n%s" ) ), $activate_url, esc_url( "http://{$domain}{$path}" ), $key );
+ $message = sprintf(
+ apply_filters( 'wpmu_signup_blog_notification_email',
+ __( "To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your site here:\n\n%s" ),
+ $domain, $path, $title, $user, $user_email, $key, $meta
+ ),
+ $activate_url,
+ esc_url( "http://{$domain}{$path}" ),
+ $key
+ );
// TODO: Don't hard code activation link.
- $subject = sprintf( apply_filters( 'wpmu_signup_blog_notification_subject', __( '[%1$s] Activate %2$s' ) ), $from_name, esc_url( 'http://' . $domain . $path ) );
+ $subject = sprintf(
+ apply_filters( 'wpmu_signup_blog_notification_subject',
+ __( '[%1$s] Activate %2$s' ),
+ $domain, $path, $title, $user, $user_email, $key, $meta
+ ),
+ $from_name,
+ esc_url( 'http://' . $domain . $path )
+ );
wp_mail($user_email, $subject, $message, $message_headers);
return true;
}
+/**
+ * Notify user of signup success.
+ *
+ * This is the notification function used when no new site has
+ * been requested.
+ *
+ * Filter 'wpmu_signup_user_notification' to bypass this function or
+ * replace it with your own notification behavior.
+ *
+ * Filter 'wpmu_signup_user_notification_email' and
+ * 'wpmu_signup_user_notification_subject' to change the content
+ * and subject line of the email sent to newly registered users.
+ *
+ * @since MU
+ *
+ * @param string $user The user's login name.
+ * @param string $user_email The user's email address.
+ * @param array $meta By default, an empty array.
+ * @param string $key The activation key created in wpmu_signup_user()
+ * @return bool
+ */
function wpmu_signup_user_notification($user, $user_email, $key, $meta = '') {
if ( !apply_filters('wpmu_signup_user_notification', $user, $user_email, $key, $meta) )
return false;
$admin_email = 'support@' . $_SERVER['SERVER_NAME'];
$from_name = get_site_option( 'site_name' ) == '' ? 'WordPress' : esc_html( get_site_option( 'site_name' ) );
$message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
- $message = sprintf( apply_filters( 'wpmu_signup_user_notification_email', __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n" ) ), site_url( "wp-activate.php?key=$key" ), $key );
+ $message = sprintf(
+ apply_filters( 'wpmu_signup_user_notification_email',
+ __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n" ),
+ $user, $user_email, $key, $meta
+ ),
+ site_url( "wp-activate.php?key=$key" ),
+ $key
+ );
// TODO: Don't hard code activation link.
- $subject = sprintf( __( apply_filters( 'wpmu_signup_user_notification_subject', '[%1$s] Activate %2$s' ) ), $from_name, $user);
+ $subject = sprintf(
+ apply_filters( 'wpmu_signup_user_notification_subject',
+ __( '[%1$s] Activate %2$s' ),
+ $user, $user_email, $key, $meta
+ ),
+ $from_name,
+ $user
+ );
wp_mail($user_email, $subject, $message, $message_headers);
return true;
}
+/**
+ * Activate a signup.
+ *
+ * Hook to 'wpmu_activate_user' or 'wpmu_activate_blog' for events
+ * that should happen only when users or sites are self-created (since
+ * those actions are not called when users and sites are created
+ * by a Super Admin).
+ *
+ * @since MU
+ * @uses wp_generate_password()
+ * @uses wpmu_welcome_user_notification()
+ * @uses add_user_to_blog()
+ * @uses add_new_user_to_blog()
+ * @uses wpmu_create_user()
+ * @uses wpmu_create_blog()
+ * @uses wpmu_welcome_notification()
+ *
+ * @param string $key The activation key provided to the user.
+ * @return array An array containing information about the activated user and/or blog
+ */
function wpmu_activate_signup($key) {
global $wpdb, $current_site;
$signup = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->signups WHERE activation_key = %s", $key) );
- if ( empty($signup) )
- return new WP_Error('invalid_key', __('Invalid activation key.'));
+ if ( empty( $signup ) )
+ return new WP_Error( 'invalid_key', __( 'Invalid activation key.' ) );
- if ( $signup->active )
- return new WP_Error('already_active', __('The site is already active.'), $signup);
+ if ( $signup->active ) {
+ if ( empty( $signup->domain ) )
+ return new WP_Error( 'already_active', __( 'The user is already active.' ), $signup );
+ else
+ return new WP_Error( 'already_active', __( 'The site is already active.' ), $signup );
+ }
$meta = unserialize($signup->meta);
$user_login = $wpdb->escape($signup->user_login);
$user_email = $wpdb->escape($signup->user_email);
- $password = wp_generate_password();
+ $password = wp_generate_password( 12, false );
$user_id = username_exists($user_login);
return new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), $signup);
wpmu_welcome_user_notification($user_id, $password, $meta);
- $user_site = get_site_option( 'dashboard_blog', $current_site->blog_id );
-
- if ( $user_site == false )
- add_user_to_blog( '1', $user_id, get_site_option( 'default_user_role', 'subscriber' ) );
- else
- add_user_to_blog( $user_site, $user_id, get_site_option( 'default_user_role', 'subscriber' ) );
add_new_user_to_blog( $user_id, $user_email, $meta );
do_action('wpmu_activate_user', $user_id, $password, $meta);
return array('blog_id' => $blog_id, 'user_id' => $user_id, 'password' => $password, 'title' => $signup->title, 'meta' => $meta);
}
+/**
+ * Create a user.
+ *
+ * This function runs when a user self-registers as well as when
+ * a Super Admin creates a new user. Hook to 'wpmu_new_user' for events
+ * that should affect all new users, but only on Multisite (otherwise
+ * use 'user_register').
+ *
+ * @since MU
+ * @uses wp_create_user()
+ *
+ * @param string $user_name The new user's login name.
+ * @param string $password The new user's password.
+ * @param string $email The new user's email address.
+ * @return mixed Returns false on failure, or int $user_id on success
+ */
function wpmu_create_user( $user_name, $password, $email) {
$user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
return $user_id;
}
+/**
+ * Create a site.
+ *
+ * This function runs when a user self-registers a new site as well
+ * as when a Super Admin creates a new site. Hook to 'wpmu_new_blog'
+ * for events that should affect all new sites.
+ *
+ * On subdirectory installs, $domain is the same as the main site's
+ * domain, and the path is the subdirectory name (eg 'example.com'
+ * and '/blog1/'). On subdomain installs, $domain is the new subdomain +
+ * root domain (eg 'blog1.example.com'), and $path is '/'.
+ *
+ * @since MU
+ * @uses domain_exists()
+ * @uses insert_blog()
+ * @uses wp_install_defaults()
+ * @uses add_user_to_blog()
+ *
+ * @param string $domain The new site's domain.
+ * @param string $path The new site's path.
+ * @param string $title The new site's title.
+ * @param int $user_id The user ID of the new site's admin.
+ * @param array $meta Optional. Used to set initial site options.
+ * @param int $site_id Optional. Only relevant on multi-network installs.
+ * @return mixed Returns WP_Error object on failure, int $blog_id on success
+ */
function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1) {
$domain = preg_replace( '/\s+/', '', sanitize_user( $domain, true ) );
add_option( 'WPLANG', get_site_option( 'WPLANG' ) );
update_option( 'blog_public', (int)$meta['public'] );
- if ( !is_super_admin() && get_user_meta( $user_id, 'primary_blog', true ) == get_site_option( 'dashboard_blog', 1 ) )
+ if ( !is_super_admin() && ! get_user_meta( $user_id, 'primary_blog', true ) )
update_user_meta( $user_id, 'primary_blog', $blog_id );
restore_current_blog();
return $blog_id;
}
+/**
+ * Notifies the network admin that a new site has been activated.
+ *
+ * Filter 'newblog_notify_siteadmin' to change the content of
+ * the notification email.
+ *
+ * @since MU
+ *
+ * @param int $blog_id The new site's ID.
+ * @return bool
+ */
function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {
if ( get_site_option( 'registrationnotification' ) != 'yes' )
return false;
if ( is_email($email) == false )
return false;
- $options_site_url = esc_url(network_admin_url('ms-options.php'));
+ $options_site_url = esc_url(network_admin_url('settings.php'));
switch_to_blog( $blog_id );
$blogname = get_option( 'blogname' );
return true;
}
+/**
+ * Notifies the network admin that a new user has been activated.
+ *
+ * Filter 'newuser_notify_siteadmin' to change the content of
+ * the notification email.
+ *
+ * @since MU
+ *
+ * @param int $user_id The new user's ID.
+ * @return bool
+ */
function newuser_notify_siteadmin( $user_id ) {
if ( get_site_option( 'registrationnotification' ) != 'yes' )
return false;
$user = new WP_User($user_id);
- $options_site_url = esc_url(network_admin_url('ms-options.php'));
+ $options_site_url = esc_url(network_admin_url('settings.php'));
$msg = sprintf(__('New User: %1s
Remote IP: %2s
return true;
}
+/**
+ * Check whether a blogname is already taken.
+ *
+ * Used during the new site registration process to ensure
+ * that each blogname is unique.
+ *
+ * @since MU
+ *
+ * @param string $domain The domain to be checked.
+ * @param string $path The path to be checked.
+ * @param int $site_id Optional. Relevant only on multi-network installs.
+ * @return int
+ */
function domain_exists($domain, $path, $site_id = 1) {
global $wpdb;
return $wpdb->get_var( $wpdb->prepare("SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s AND site_id = %d", $domain, $path, $site_id) );
}
+/**
+ * Store basic site info in the blogs table.
+ *
+ * This function creates a row in the wp_blogs table and returns
+ * the new blog's ID. It is the first step in creating a new blog.
+ *
+ * @since MU
+ *
+ * @param string $domain The domain of the new site.
+ * @param string $path The path of the new site.
+ * @param int $site_id Unless you're running a multi-network install, be sure to set this value to 1.
+ * @return int The ID of the new row
+ */
function insert_blog($domain, $path, $site_id) {
global $wpdb;
return $wpdb->insert_id;
}
-// Install an empty blog. wpdb should already be switched.
+/**
+ * Install an empty blog.
+ *
+ * Creates the new blog tables and options. If calling this function
+ * directly, be sure to use switch_to_blog() first, so that $wpdb
+ * points to the new blog.
+ *
+ * @since MU
+ * @uses make_db_current_silent()
+ * @uses populate_roles()
+ *
+ * @param int $blog_id The value returned by insert_blog().
+ * @param string $blog_title The title of the new site.
+ */
function install_blog($blog_id, $blog_title = '') {
global $wpdb, $table_prefix, $wp_roles;
$wpdb->suppress_errors();
update_option('siteurl', $url);
update_option('home', $url);
update_option('fileupload_url', $url . "files" );
- update_option('upload_path', "wp-content/blogs.dir/" . $blog_id . "/files");
+ update_option('upload_path', UPLOADBLOGSDIR . "/$blog_id/files");
update_option('blogname', stripslashes( $blog_title ) );
update_option('admin_email', '');
$wpdb->update( $wpdb->options, array('option_value' => ''), array('option_name' => 'admin_email') );
$wpdb->suppress_errors( false );
}
-// Deprecated, use wp_install_defaults()
-// should be switched already as $blog_id is ignored.
+/**
+ * Set blog defaults.
+ *
+ * This function creates a row in the wp_blogs table.
+ *
+ * @since MU
+ * @deprecated MU
+ * @deprecated Use wp_install_defaults()
+ * @uses wp_install_defaults()
+ *
+ * @param int $blog_id Ignored in this function.
+ * @param int $user_id
+ */
function install_blog_defaults($blog_id, $user_id) {
global $wpdb;
$wpdb->suppress_errors( false );
}
+/**
+ * Notify a user that her blog activation has been successful.
+ *
+ * Filter 'wpmu_welcome_notification' to disable or bypass.
+ *
+ * Filter 'update_welcome_email' and 'update_welcome_subject' to
+ * modify the content and subject line of the notification email.
+ *
+ * @since MU
+ *
+ * @param int $blog_id
+ * @param int $user_id
+ * @param string $password
+ * @param string $title The new blog's title
+ * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization.
+ * @return bool
+ */
function wpmu_welcome_notification($blog_id, $user_id, $password, $title, $meta = '') {
global $current_site;
return true;
}
+/**
+ * Notify a user that her account activation has been successful.
+ *
+ * Filter 'wpmu_welcome_user_notification' to disable or bypass.
+ *
+ * Filter 'update_welcome_user_email' and 'update_welcome_user_subject' to
+ * modify the content and subject line of the notification email.
+ *
+ * @since MU
+ *
+ * @param int $user_id
+ * @param string $password
+ * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization.
+ * @return bool
+ */
function wpmu_welcome_user_notification($user_id, $password, $meta = '') {
global $current_site;
return true;
}
+/**
+ * Get the current site info.
+ *
+ * Returns an object containing the ID, domain, path, and site_name
+ * of the site being viewed.
+ *
+ * @since MU
+ *
+ * @return object
+ */
function get_current_site() {
global $current_site;
return $current_site;
}
+/**
+ * Get a numeric user ID from either an email address or a login.
+ *
+ * @since MU
+ * @uses is_email()
+ *
+ * @param string $string
+ * @return int
+ */
function get_user_id_from_string( $string ) {
$user_id = 0;
if ( is_email( $string ) ) {
return $user_id;
}
+/**
+ * Get a user's most recent post.
+ *
+ * Walks through each of a user's blogs to find the post with
+ * the most recent post_date_gmt.
+ *
+ * @since MU
+ * @uses get_blogs_of_user()
+ *
+ * @param int $user_id
+ * @return array Contains the blog_id, post_id, post_date_gmt, and post_gmt_ts
+ */
function get_most_recent_post_of_user( $user_id ) {
global $wpdb;
return $most_recent_post;
}
-/* Misc functions */
+// Misc functions
+
+/**
+ * Get the size of a directory.
+ *
+ * A helper function that is used primarily to check whether
+ * a blog has exceeded its allowed upload space.
+ *
+ * @since MU
+ * @uses recurse_dirsize()
+ *
+ * @param string $directory
+ * @return int
+ */
function get_dirsize( $directory ) {
$dirsize = get_transient( 'dirsize_cache' );
if ( is_array( $dirsize ) && isset( $dirsize[ $directory ][ 'size' ] ) )
return $dirsize[ $directory ][ 'size' ];
}
+/**
+ * Get the size of a directory recursively.
+ *
+ * Used by get_dirsize() to get a directory's size when it contains
+ * other directories.
+ *
+ * @since MU
+ *
+ * @param string $directory
+ * @return int
+ */
function recurse_dirsize( $directory ) {
$size = 0;
return $size;
}
+/**
+ * Check whether a blog has used its allotted upload space.
+ *
+ * Used by get_dirsize() to get a directory's size when it contains
+ * other directories.
+ *
+ * @since MU
+ * @uses get_dirsize()
+ *
+ * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
+ * @return int
+ */
function upload_is_user_over_quota( $echo = true ) {
if ( get_site_option( 'upload_space_check_disabled' ) )
- return true;
+ return false;
$spaceAllowed = get_space_allowed();
if ( empty( $spaceAllowed ) || !is_numeric( $spaceAllowed ) )
}
}
+/**
+ * Check an array of MIME types against a whitelist.
+ *
+ * WordPress ships with a set of allowed upload filetypes,
+ * which is defined in wp-includes/functions.php in
+ * get_allowed_mime_types(). This function is used to filter
+ * that list against the filetype whitelist provided by Multisite
+ * Super Admins at wp-admin/network/settings.php.
+ *
+ * @since MU
+ *
+ * @param array $mimes
+ * @return array
+ */
function check_upload_mimes( $mimes ) {
$site_exts = explode( ' ', get_site_option( 'upload_filetypes' ) );
foreach ( $site_exts as $ext ) {
return $site_mimes;
}
+/**
+ * Update a blog's post count.
+ *
+ * WordPress MS stores a blog's post count as an option so as
+ * to avoid extraneous COUNTs when a blog's details are fetched
+ * with get_blog_details(). This function is called when posts
+ * are published to make sure the count stays current.
+ *
+ * @since MU
+ */
function update_posts_count( $deprecated = '' ) {
global $wpdb;
update_option( 'post_count', (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_status = 'publish' and post_type = 'post'" ) );
}
+/**
+ * Logs user registrations.
+ *
+ * @since MU
+ *
+ * @param int $blog_id
+ * @param int $user_id
+ */
function wpmu_log_new_registrations( $blog_id, $user_id ) {
global $wpdb;
$user = new WP_User( (int) $user_id );
$wpdb->insert( $wpdb->registration_log, array('email' => $user->user_email, 'IP' => preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] ), 'blog_id' => $blog_id, 'date_registered' => current_time('mysql')) );
}
+/**
+ * Get the remaining upload space for this blog.
+ *
+ * @since MU
+ * @uses upload_is_user_over_quota()
+ * @uses get_space_allowed()
+ * @uses get_dirsize()
+ *
+ * @param int $size
+ * @return int
+ */
function fix_import_form_size( $size ) {
if ( upload_is_user_over_quota( false ) == true )
return 0;
return $global_id;
}
+/**
+ * Ensure that the current site's domain is listed in the allowed redirect host list.
+ *
+ * @see wp_validate_redirect()
+ * @since MU
+ *
+ * @return array The current site's domain
+ */
function redirect_this_site( $deprecated = '' ) {
global $current_site;
return array( $current_site->domain );
}
+/**
+ * Check whether an upload is too big.
+ *
+ * @since MU
+ *
+ * @param array $upload
+ * @return mixed If the upload is under the size limit, $upload is returned. Otherwise returns an error message.
+ */
function upload_is_file_too_big( $upload ) {
if ( is_array( $upload ) == false || defined( 'WP_IMPORTING' ) )
return $upload;
return $upload;
}
-function wordpressmu_wp_mail_from( $email ) {
- if ( strpos( $email, 'wordpress@' ) !== false )
- $email = get_option( 'admin_email' );
- return $email;
-}
-
+/**
+ * Add a nonce field to the signup page.
+ *
+ * @since MU
+ * @uses wp_nonce_field()
+ */
function signup_nonce_fields() {
$id = mt_rand();
echo "<input type='hidden' name='signup_form_id' value='{$id}' />";
wp_nonce_field('signup_form_' . $id, '_signup_form', false);
}
+/**
+ * Process the signup nonce created in signup_nonce_fields().
+ *
+ * @since MU
+ * @uses wp_create_nonce()
+ *
+ * @param array $result
+ * @return array
+ */
function signup_nonce_check( $result ) {
if ( !strpos( $_SERVER[ 'PHP_SELF' ], 'wp-signup.php' ) )
return $result;
return $result;
}
+/**
+ * Correct 404 redirects when NOBLOGREDIRECT is defined.
+ *
+ * @since MU
+ */
function maybe_redirect_404() {
global $current_site;
if ( is_main_site() && is_404() && defined( 'NOBLOGREDIRECT' ) && ( $destination = apply_filters( 'blog_redirect_404', NOBLOGREDIRECT ) ) ) {
}
}
+/**
+ * Add a new user to a blog by visiting /newbloguser/username/.
+ *
+ * This will only work when the user's details are saved as an option
+ * keyed as 'new_user_x', where 'x' is the username of the user to be
+ * added, as when a user is invited through the regular WP Add User interface.
+ *
+ * @since MU
+ * @uses add_existing_user_to_blog()
+ */
function maybe_add_existing_user_to_blog() {
if ( false === strpos( $_SERVER[ 'REQUEST_URI' ], '/newbloguser/' ) )
return false;
wp_die( sprintf(__('You have been added to this site. Please visit the <a href="%s">homepage</a> or <a href="%s">login</a> using your username and password.'), site_url(), admin_url() ), __('Success') );
}
+/**
+ * Add a user to a blog based on details from maybe_add_existing_user_to_blog().
+ *
+ * @since MU
+ * @uses add_user_to_blog()
+ *
+ * @param array $details
+ */
function add_existing_user_to_blog( $details = false ) {
+ global $blog_id;
+
if ( is_array( $details ) ) {
- $result = add_user_to_blog( '', $details[ 'user_id' ], $details[ 'role' ] );
+ $result = add_user_to_blog( $blog_id, $details[ 'user_id' ], $details[ 'role' ] );
do_action( 'added_existing_user', $details[ 'user_id' ], $result );
}
return $result;
}
+/**
+ * Add a newly created user to the appropriate blog
+ *
+ * @since MU
+ *
+ * @param int $user_id
+ * @param string $email
+ * @param array $meta
+ */
function add_new_user_to_blog( $user_id, $email, $meta ) {
global $current_site;
if ( $meta[ 'add_to_blog' ] ) {
$blog_id = $meta[ 'add_to_blog' ];
$role = $meta[ 'new_role' ];
- remove_user_from_blog($user_id, $current_site->blogid); // remove user from main blog.
+ remove_user_from_blog($user_id, $current_site->blog_id); // remove user from main blog.
add_user_to_blog( $blog_id, $user_id, $role );
update_user_meta( $user_id, 'primary_blog', $blog_id );
}
}
+/**
+ * Correct From host on outgoing mail to match the site domain
+ *
+ * @since MU
+ */
function fix_phpmailer_messageid( $phpmailer ) {
global $current_site;
$phpmailer->Hostname = $current_site->domain;
}
+/**
+ * Check to see whether a user is marked as a spammer, based on username
+ *
+ * @since MU
+ * @uses get_current_user_id()
+ * @uses get_user_id_from_string()
+ *
+ * @param string $username
+ * @return bool
+ */
function is_user_spammy( $username = 0 ) {
if ( $username == 0 ) {
$user_id = get_current_user_id();
return ( isset( $u->spam ) && $u->spam == 1 );
}
+/**
+ * Update this blog's 'public' setting in the global blogs table.
+ *
+ * Public blogs have a setting of 1, private blogs are 0.
+ *
+ * @since MU
+ * @uses update_blog_status()
+ *
+ * @param int $old_value
+ * @param int $value The new public value
+ * @return bool
+ */
function update_blog_public( $old_value, $value ) {
global $wpdb;
do_action('update_blog_public');
}
add_action('update_option_blog_public', 'update_blog_public', 10, 2);
-/* Redirect all hits to "dashboard" blog to wp-admin/ Dashboard. */
-function redirect_mu_dashboard() {
- global $current_site, $current_blog;
-
- $dashboard_blog = get_dashboard_blog();
- if ( $current_blog->blog_id == $dashboard_blog->blog_id && $dashboard_blog->blog_id != $current_site->blog_id ) {
- $protocol = ( is_ssl() ? 'https://' : 'http://' );
- wp_redirect( $protocol . $dashboard_blog->domain . trailingslashit( $dashboard_blog->path ) . 'wp-admin/' );
- die();
- }
-}
-add_action( 'template_redirect', 'redirect_mu_dashboard' );
-
+/**
+ * Get the "dashboard blog", the blog where users without a blog edit their profile data.
+ *
+ * @since MU
+ * @uses get_blog_details()
+ *
+ * @return int
+ */
function get_dashboard_blog() {
if ( $blog = get_site_option( 'dashboard_blog' ) )
return get_blog_details( $blog );
return get_blog_details( $GLOBALS['current_site']->blog_id );
}
+/**
+ * Check whether a usermeta key has to do with the current blog.
+ *
+ * @since MU
+ * @uses wp_get_current_user()
+ *
+ * @param string $key
+ * @param int $user_id Optional. Defaults to current user.
+ * @param int $blog_id Optional. Defaults to current blog.
+ * @return bool
+ */
function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {
global $wpdb;
return false;
}
+/**
+ * Check whether users can self-register, based on Network settings.
+ *
+ * @since MU
+ *
+ * @return bool
+ */
function users_can_register_signup_filter() {
$registration = get_site_option('registration');
if ( $registration == 'all' || $registration == 'user' )
}
add_filter('option_users_can_register', 'users_can_register_signup_filter');
+/**
+ * Ensure that the welcome message is not empty. Currently unused.
+ *
+ * @since MU
+ *
+ * @param string $text
+ * @return string
+ */
function welcome_user_msg_filter( $text ) {
if ( !$text ) {
return __( 'Dear User,
return $url;
}
-?>
+/**
+ * Schedule update of the network-wide counts for the current network.
+ *
+ * @since 3.1.0
+ */
+function wp_schedule_update_network_counts() {
+ if ( !is_main_site() )
+ return;
+
+ if ( !wp_next_scheduled('update_network_counts') && !defined('WP_INSTALLING') )
+ wp_schedule_event(time(), 'twicedaily', 'update_network_counts');
+}
+
+/**
+ * Update the network-wide counts for the current network.
+ *
+ * @since 3.1.0
+ */
+function wp_update_network_counts() {
+ global $wpdb;
+
+ $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(blog_id) as c FROM $wpdb->blogs WHERE site_id = %d AND spam = '0' AND deleted = '0' and archived = '0'", $wpdb->siteid) );
+ update_site_option( 'blog_count', $count );
+
+ $count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(ID) as c FROM $wpdb->users WHERE spam = '0' AND deleted = '0'") );
+ update_site_option( 'user_count', $count );
+}
+
+?>
\ No newline at end of file
return false;
}
+/**
+ * Returns array of network plugin files to be included in global scope.
+ *
+ * The default directory is wp-content/plugins. To change the default directory
+ * manually, define <code>WP_PLUGIN_DIR</code> and <code>WP_PLUGIN_URL</code>
+ * in wp-config.php.
+ *
+ * @access private
+ * @since 3.1.0
+ * @return array Files to include
+ */
+function wp_get_active_network_plugins() {
+ $active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
+ if ( empty( $active_plugins ) )
+ return array();
+
+ $plugins = array();
+ $active_plugins = array_keys( $active_plugins );
+ sort( $active_plugins );
+
+ foreach ( $active_plugins as $plugin ) {
+ 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
+ )
+ $plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
+ }
+ return $plugins;
+}
+
/**
* Checks status of current blog.
*
return true;
if ( '1' == $current_blog->deleted ) {
- if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) ) {
+ if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) )
return WP_CONTENT_DIR . '/blog-deleted.php';
- } else {
- header( 'HTTP/1.1 410 Gone' );
- wp_die( /*WP_I18N_USER_DELETED_BLOG*/'This user has elected to delete their account and the content is no longer available.'/*/WP_I18N_USER_DELETED_BLOG*/ );
- }
+ else
+ wp_die( __( 'This user has elected to delete their account and the content is no longer available.' ), '', array( 'response' => 410 ) );
}
if ( '2' == $current_blog->deleted ) {
if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) )
return WP_CONTENT_DIR . '/blog-inactive.php';
else
- wp_die( sprintf( /*WP_I18N_BLOG_NOT_ACTIVATED*/'This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.'/*/WP_I18N_BLOG_NOT_ACTIVATED*/, str_replace( '@', ' AT ', get_site_option( 'admin_email', "support@{$current_site->domain}" ) ) ) );
+ wp_die( sprintf( __( 'This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.' ), str_replace( '@', ' AT ', get_site_option( 'admin_email', "support@{$current_site->domain}" ) ) ) );
}
if ( $current_blog->archived == '1' || $current_blog->spam == '1' ) {
- if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) ) {
+ if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) )
return WP_CONTENT_DIR . '/blog-suspended.php';
- } else {
- header( 'HTTP/1.1 410 Gone' );
- wp_die( /*WP_I18N_ARCHIVED*/'This site has been archived or suspended.'/*/WP_I18N_ARCHIVED*/ );
- }
+ else
+ wp_die( __( 'This site has been archived or suspended.' ), '', array( 'response' => 410 ) );
}
return true;
*/
function get_current_site_name( $current_site ) {
global $wpdb;
- $current_site->site_name = wp_cache_get( $current_site->id . ':current_site_name', 'site-options' );
+
+ $current_site->site_name = wp_cache_get( $current_site->id . ':site_name', 'site-options' );
if ( ! $current_site->site_name ) {
- $current_site->site_name = wp_cache_get( $current_site->id . ':site_name', 'site-options' );
- if ( ! $current_site->site_name ) {
- $current_site->site_name = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = %d AND meta_key = 'site_name'", $current_site->id ) );
- if ( ! $current_site->site_name )
- $current_site->site_name = ucfirst( $current_site->domain );
- }
- wp_cache_set( $current_site->id . ':current_site_name', $current_site->site_name, 'site-options' );
+ $current_site->site_name = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = %d AND meta_key = 'site_name'", $current_site->id ) );
+ if ( ! $current_site->site_name )
+ $current_site->site_name = ucfirst( $current_site->domain );
}
+ wp_cache_set( $current_site->id . ':site_name', $current_site->site_name, 'site-options' );
+
return $current_site;
}
if ( $current_blog )
wp_cache_set( 'current_blog_' . $domain, $current_blog, 'site-options' );
}
- if ( $current_blog && $current_blog->site_id != $current_site->id )
+ if ( $current_blog && $current_blog->site_id != $current_site->id ) {
$current_site = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->site WHERE id = %d", $current_blog->site_id ) );
- else
+ if ( ! isset( $current_site->blog_id ) )
+ $current_site->blog_id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s", $current_site->domain, $current_site->path ) );
+ } else
$blogname = substr( $domain, 0, strpos( $domain, '.' ) );
} else {
$blogname = htmlspecialchars( substr( $_SERVER[ 'REQUEST_URI' ], strlen( $path ) ) );
if ( $current_blog )
wp_cache_set( 'current_blog_' . $domain . $path, $current_blog, 'site-options' );
}
+ unset($reserved_blognames);
}
if ( ! defined( 'WP_INSTALLING' ) && is_subdomain_install() && ! is_object( $current_blog ) ) {
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$classes[] = 'menu-item-' . $item->ID;
- $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
+ $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
$class_names = ' class="' . esc_attr( $class_names ) . '"';
$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
* container - Whether to wrap the ul, and what to wrap it with. Defaults to 'div'.
* container_class - the class that is applied to the container. Defaults to 'menu-{menu slug}-container'.
* container_id - The ID that is applied to the container. Defaults to blank.
- * fallback_cb - If the menu doesn't exists, a callback function will fire. Defaults to 'wp_page_menu'.
+ * fallback_cb - If the menu doesn't exists, a callback function will fire. Defaults to 'wp_page_menu'. Set to false for no fallback.
* before - Text before the link text.
* after - Text after the link text.
* link_before - Text before the link.
* depth - how many levels of the hierarchy are to be included. 0 means all. Defaults to 0.
* walker - allows a custom walker to be specified.
* theme_location - the location in the theme to be used. Must be registered with register_nav_menu() in order to be selectable by the user.
+ * items_wrap - How the list items should be wrapped. Defaults to a ul with an id and class. Uses printf() format with numbered placeholders.
*
* @since 3.0.0
*
static $menu_id_slugs = array();
$defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'container_id' => '', 'menu_class' => 'menu', 'menu_id' => '',
- 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '',
+ 'echo' => true, 'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
'depth' => 0, 'walker' => '', 'theme_location' => '' );
$args = wp_parse_args( $args, $defaults );
// If no menu was found or if the menu has no items and no location was requested, call the fallback_cb if it exists
if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) && !$args->theme_location ) )
- && ( function_exists($args->fallback_cb) || is_callable( $args->fallback_cb ) ) )
+ && $args->fallback_cb && is_callable( $args->fallback_cb ) )
return call_user_func( $args->fallback_cb, (array) $args );
// If no fallback function was specified and the menu doesn't exists, bail.
unset($menu_items);
+ $sorted_menu_items = apply_filters( 'wp_nav_menu_objects', $sorted_menu_items, $args );
+
$items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args );
unset($sorted_menu_items);
// Attributes
if ( ! empty( $args->menu_id ) ) {
- $slug = $args->menu_id;
+ $wrap_id = $args->menu_id;
} else {
- $slug = 'menu-' . $menu->slug;
- while ( in_array( $slug, $menu_id_slugs ) ) {
- if ( preg_match( '#-(\d+)$#', $slug, $matches ) )
- $slug = preg_replace('#-(\d+)$#', '-' . ++$matches[1], $slug);
+ $wrap_id = 'menu-' . $menu->slug;
+ while ( in_array( $wrap_id, $menu_id_slugs ) ) {
+ if ( preg_match( '#-(\d+)$#', $wrap_id, $matches ) )
+ $wrap_id = preg_replace('#-(\d+)$#', '-' . ++$matches[1], $wrap_id );
else
- $slug = $slug . '-1';
+ $wrap_id = $wrap_id . '-1';
}
}
- $menu_id_slugs[] = $slug;
- $attributes = ' id="' . $slug . '"';
- $attributes .= $args->menu_class ? ' class="'. $args->menu_class .'"' : '';
+ $menu_id_slugs[] = $wrap_id;
- $nav_menu .= '<ul'. $attributes .'>';
+ $wrap_class = $args->menu_class ? $args->menu_class : '';
// Allow plugins to hook into the menu to add their own <li>'s
$items = apply_filters( 'wp_nav_menu_items', $items, $args );
$items = apply_filters( "wp_nav_menu_{$menu->slug}_items", $items, $args );
- $nav_menu .= $items;
- unset($items);
- $nav_menu .= '</ul>';
+ $nav_menu .= sprintf( $args->items_wrap, esc_attr( $wrap_id ), esc_attr( $wrap_class ), $items );
+ unset( $items );
if ( $show_container )
$nav_menu .= '</' . $args->container . '>';
$possible_object_parents = array_filter( $possible_object_parents );
+ $front_page_url = home_url();
+
foreach ( (array) $menu_items as $key => $menu_item ) {
+
+ $menu_items[$key]->current = false;
+
$classes = (array) $menu_item->classes;
$classes[] = 'menu-item';
$classes[] = 'menu-item-type-' . $menu_item->type;
+ $classes[] = 'menu-item-object-' . $menu_item->object;
// if the menu item corresponds to a taxonomy term for the currently-queried non-hierarchical post object
if ( $wp_query->is_singular && 'taxonomy' == $menu_item->type && in_array( $menu_item->object_id, $possible_object_parents ) ) {
)
) {
$classes[] = 'current-menu-item';
+ $menu_items[$key]->current = true;
$_anc_id = (int) $menu_item->db_id;
while(
// if the menu item corresponds to the currently-requested URL
} elseif ( 'custom' == $menu_item->object ) {
- $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
- $item_url = strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url;
- $_indexless_current = preg_replace( '/index.php$/', '', $current_url );
-
+ $current_url = untrailingslashit( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
+ $item_url = untrailingslashit( strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url );
+ $_indexless_current = untrailingslashit( preg_replace( '/index.php$/', '', $current_url ) );
+
if ( in_array( $item_url, array( $current_url, $_indexless_current ) ) ) {
$classes[] = 'current-menu-item';
+ $menu_items[$key]->current = true;
$_anc_id = (int) $menu_item->db_id;
while(
}
if ( in_array( home_url(), array( untrailingslashit( $current_url ), untrailingslashit( $_indexless_current ) ) ) ) {
- // Back compat for home limk to match wp_page_menu()
+ // Back compat for home link to match wp_page_menu()
$classes[] = 'current_page_item';
}
$active_parent_item_ids[] = (int) $menu_item->menu_item_parent;
$active_parent_object_ids[] = (int) $menu_item->post_parent;
$active_object = $menu_item->object;
+
+ // give front page item current-menu-item class when extra query arguments involved
+ } elseif ( $item_url == $front_page_url && is_front_page() ) {
+ $classes[] = 'current-menu-item';
}
-
+
if ( untrailingslashit($item_url) == home_url() )
$classes[] = 'menu-item-home';
}
// set parent's class
foreach ( (array) $menu_items as $key => $parent_item ) {
$classes = (array) $parent_item->classes;
+ $menu_items[$key]->current_item_ancestor = false;
+ $menu_items[$key]->current_item_parent = false;
if (
isset( $parent_item->type ) &&
'post_type' == $parent_item->type &&
! empty( $queried_object->post_type ) &&
is_post_type_hierarchical( $queried_object->post_type ) &&
- in_array( $parent_item->object_id, $queried_object->ancestors )
+ in_array( $parent_item->object_id, $queried_object->ancestors ) &&
+ $parent_item->object != $queried_object->ID
) ||
// ancestral term
(
'taxonomy' == $parent_item->type &&
isset( $possible_taxonomy_ancestors[ $parent_item->object ] ) &&
- in_array( $parent_item->object_id, $possible_taxonomy_ancestors[ $parent_item->object ] )
+ in_array( $parent_item->object_id, $possible_taxonomy_ancestors[ $parent_item->object ] ) &&
+ (
+ ! isset( $queried_object->term_id ) ||
+ $parent_item->object_id != $queried_object->term_id
+ )
)
)
) {
if ( in_array( intval( $parent_item->db_id ), $active_ancestor_item_ids ) ) {
$classes[] = 'current-menu-ancestor';
+ $menu_items[$key]->current_item_ancestor = true;
}
- if ( in_array( $parent_item->db_id, $active_parent_item_ids ) )
+ if ( in_array( $parent_item->db_id, $active_parent_item_ids ) ) {
$classes[] = 'current-menu-parent';
+ $menu_items[$key]->current_item_parent = true;
+ }
if ( in_array( $parent_item->object_id, $active_parent_object_ids ) )
$classes[] = 'current-' . $active_object . '-parent';
return $id;
}
add_filter( 'nav_menu_item_id', '_nav_menu_item_id_use_once', 10, 2 );
-
-?>
*
* @since 3.0.0
*
- * @param $args array Array of arguments passed on to get_terms().
+ * @param array $args Array of arguments passed on to get_terms().
* @return array menu objects
*/
function wp_get_nav_menus( $args = array() ) {
'meta_value' => $object_id,
'post_status' => 'any',
'post_type' => 'nav_menu_item',
- 'showposts' => -1,
+ 'posts_per_page' => -1,
)
);
foreach( (array) $menu_items as $menu_item ) {
return;
if ( ! $user = wp_validate_auth_cookie() ) {
- if ( is_admin() || empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) {
+ if ( is_blog_admin() || is_network_admin() || empty($_COOKIE[LOGGED_IN_COOKIE]) || !$user = wp_validate_auth_cookie($_COOKIE[LOGGED_IN_COOKIE], 'logged_in') ) {
wp_set_current_user(0);
return false;
}
if ( '' === $secure )
$secure = is_ssl();
+ $secure = apply_filters('secure_auth_cookie', $secure, $user_id);
+ $secure_logged_in_cookie = apply_filters('secure_logged_in_cookie', false, $user_id, $secure);
+
if ( $secure ) {
$auth_cookie_name = SECURE_AUTH_COOKIE;
$scheme = 'secure_auth';
if ( version_compare(phpversion(), '5.2.0', 'ge') ) {
setcookie($auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true);
setcookie($auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true);
- setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, false, true);
+ setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true);
if ( COOKIEPATH != SITECOOKIEPATH )
- setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, false, true);
+ setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true);
} else {
$cookie_domain = COOKIE_DOMAIN;
if ( !empty($cookie_domain) )
$cookie_domain .= '; HttpOnly';
setcookie($auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, $cookie_domain, $secure);
setcookie($auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, $cookie_domain, $secure);
- setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, $cookie_domain);
+ setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, $cookie_domain, $secure_logged_in_cookie);
if ( COOKIEPATH != SITECOOKIEPATH )
- setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, $cookie_domain);
+ setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, $cookie_domain, $secure_logged_in_cookie);
}
}
endif;
$secure = ( is_ssl() || force_ssl_admin() );
+ $secure = apply_filters('secure_auth_redirect', $secure);
+
// If https is required and request is http, redirect
if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
}
}
- if ( $user_id = wp_validate_auth_cookie( '', apply_filters( 'auth_redirect_scheme', '' ) ) ) {
+ if ( is_user_admin() )
+ $scheme = 'logged_in';
+ else
+ $scheme = apply_filters( 'auth_redirect_scheme', '' );
+
+ if ( $user_id = wp_validate_auth_cookie( '', $scheme) ) {
do_action('auth_redirect', $user_id);
// If the user wants ssl but the session is not ssl, redirect.
if ( !function_exists('wp_redirect') ) :
/**
- * Redirects to another page, with a workaround for the IIS Set-Cookie bug.
+ * Redirects to another page.
*
- * @link http://support.microsoft.com/kb/q176113/
* @since 1.5.1
* @uses apply_filters() Calls 'wp_redirect' hook on $location and $status.
*
$location = wp_sanitize_redirect($location);
- if ( $is_IIS ) {
- header("Refresh: 0;url=$location");
- } else {
- if ( php_sapi_name() != 'cgi-fcgi' )
- status_header($status); // This causes problems on IIS and some FastCGI setups
- header("Location: $location", true, $status);
- }
+ if ( !$is_IIS && php_sapi_name() != 'cgi-fcgi' )
+ status_header($status); // This causes problems on IIS and some FastCGI setups
+
+ header("Location: $location", true, $status);
}
endif;
* @param string $comment_type Optional. The comment type either 'comment' (default), 'trackback', or 'pingback'
* @return bool False if user email does not exist. True on completion.
*/
-function wp_notify_postauthor($comment_id, $comment_type='') {
- $comment = get_comment($comment_id);
- $post = get_post($comment->comment_post_ID);
- $user = get_userdata( $post->post_author );
+function wp_notify_postauthor( $comment_id, $comment_type = '' ) {
+ $comment = get_comment( $comment_id );
+ $post = get_post( $comment->comment_post_ID );
+ $author = get_userdata( $post->post_author );
+
+ // The comment was left by the author
+ if ( $comment->user_id == $post->post_author )
+ return false;
- if ( $comment->user_id == $post->post_author ) return false; // The author moderated a comment on his own post
+ // The author moderated a comment on his own post
+ if ( $post->post_author == get_current_user_id() )
+ return false;
- if ('' == $user->user_email) return false; // If there's no email to send the comment to
+ // If there's no email to send the comment to
+ if ( '' == $author->user_email )
+ return false;
$comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
$notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
$notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
$notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n";
- $notify_message .= sprintf( __('Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
+ $notify_message .= sprintf( __('Whois : http://whois.arin.net/rest/ip/%s'), $comment->comment_author_IP ) . "\r\n";
$notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
$notify_message .= __('You can see all comments on this post here: ') . "\r\n";
/* translators: 1: blog name, 2: post title */
$subject = sprintf( __('[%1$s] Pingback: "%2$s"'), $blogname, $post->post_title );
}
$notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
+ $notify_message .= sprintf( __('Permalink: %s'), get_permalink( $comment->comment_post_ID ) . '#comment-' . $comment_id ) . "\r\n";
if ( EMPTY_TRASH_DAYS )
$notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "\r\n";
else
$subject = apply_filters('comment_notification_subject', $subject, $comment_id);
$message_headers = apply_filters('comment_notification_headers', $message_headers, $comment_id);
- @wp_mail($user->user_email, $subject, $notify_message, $message_headers);
+ @wp_mail( $author->user_email, $subject, $notify_message, $message_headers );
return true;
}
function wp_notify_moderator($comment_id) {
global $wpdb;
- if( get_option( "moderation_notify" ) == 0 )
+ if ( 0 == get_option( 'moderation_notify' ) )
return true;
- $comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID=%d LIMIT 1", $comment_id));
- $post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID=%d LIMIT 1", $comment->comment_post_ID));
+ $comment = get_comment($comment_id);
+ $post = get_post($comment->comment_post_ID);
+ $user = get_userdata( $post->post_author );
+ // Send to the administation and to the post author if the author can modify the comment.
+ $email_to = array( get_option('admin_email') );
+ if ( user_can($user->ID, 'edit_comment', $comment_id) && !empty($user->user_email) && ( get_option('admin_email') != $user->user_email) )
+ $email_to[] = $user->user_email;
$comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
$comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");
$notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
$notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";
$notify_message .= sprintf( __('URL : %s'), $comment->comment_author_url ) . "\r\n";
- $notify_message .= sprintf( __('Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";
+ $notify_message .= sprintf( __('Whois : http://whois.arin.net/rest/ip/%s'), $comment->comment_author_IP ) . "\r\n";
$notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
break;
}
$notify_message .= admin_url("edit-comments.php?comment_status=moderated") . "\r\n";
$subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), $blogname, $post->post_title );
- $admin_email = get_option('admin_email');
$message_headers = '';
$notify_message = apply_filters('comment_moderation_text', $notify_message, $comment_id);
$subject = apply_filters('comment_moderation_subject', $subject, $comment_id);
$message_headers = apply_filters('comment_moderation_headers', $message_headers);
- @wp_mail($admin_email, $subject, $notify_message, $message_headers);
+ foreach ( $email_to as $email )
+ @wp_mail($email, $subject, $notify_message, $message_headers);
return true;
}
$host = 'https://secure.gravatar.com';
} else {
if ( !empty($email) )
- $host = sprintf( "http://%d.gravatar.com", ( hexdec( $email_hash{0} ) % 2 ) );
+ $host = sprintf( "http://%d.gravatar.com", ( hexdec( $email_hash[0] ) % 2 ) );
else
$host = 'http://0.gravatar.com';
}
* @since 2.7
*
* @param string $file
- * @param callback $callback The callback to run when the hook is called.
+ * @param callback $callback The callback to run when the hook is called. Must be a static method or function.
*/
-function register_uninstall_hook($file, $callback) {
+function register_uninstall_hook( $file, $callback ) {
+ if ( is_array( $callback ) && is_object( $callback[0] ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Only a static class method or function can be used in an uninstall hook.' ), '3.1' );
+ return;
+ }
+
// The option should not be autoloaded, because it is not needed in most
// cases. Emphasis should be put on using the 'uninstall.php' way of
// uninstalling the plugin.
* @param string $tag Used in counting how many hooks were applied
* @param callback $function Used for creating unique id
* @param int|bool $priority Used in counting how many hooks were applied. If === false and $function is an object reference, we return the unique id only if it already has one, false otherwise.
- * @param string $type filter or action
* @return string|bool Unique ID for usage as array key or false if $priority === false and $function is an object reference, and it does not already have a uniqe id.
*/
function _wp_filter_build_unique_id($tag, $function, $priority) {
/**
* Sets the endianness of the file.
*
- * @param $endian string 'big' or 'little'
+ * @param string $endian 'big' or 'little'
*/
function setEndian($endian) {
$this->endian = $endian;
* Display the ID of the current item in the WordPress Loop.
*
* @since 0.71
- * @uses $id
*/
function the_ID() {
- global $id;
- echo $id;
+ echo get_the_ID();
}
/**
* Retrieve the ID of the current item in the WordPress Loop.
*
* @since 2.1.0
- * @uses $id
+ * @uses $post
*
- * @return unknown
+ * @return int
*/
function get_the_ID() {
- global $id;
- return $id;
+ global $post;
+ return $post->ID;
}
/**
* @return string
*/
function get_the_content($more_link_text = null, $stripteaser = 0) {
- global $id, $post, $more, $page, $pages, $multipage, $preview;
+ global $post, $more, $page, $pages, $multipage, $preview;
if ( null === $more_link_text )
$more_link_text = __( '(more...)' );
$output .= $teaser;
if ( count($content) > 1 ) {
if ( $more ) {
- $output .= '<span id="more-' . $id . '"></span>' . $content[1];
+ $output .= '<span id="more-' . $post->ID . '"></span>' . $content[1];
} else {
if ( ! empty($more_link_text) )
- $output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink() . "#more-$id\" class=\"more-link\">$more_link_text</a>", $more_link_text );
+ $output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text );
$output = force_balance_tags($output);
}
}
if ( $preview ) // preview fix for javascript bug with foreign languages
- $output = preg_replace_callback('/\%u([0-9A-F]{4})/', create_function('$match', 'return "&#" . base_convert($match[1], 16, 10) . ";";'), $output);
+ $output = preg_replace_callback('/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output);
return $output;
}
+/**
+ * Preview fix for javascript bug with foreign languages
+ *
+ * @since 3.1.0
+ * @access private
+ * @param array $match Match array from preg_replace_callback
+ * @returns string
+ */
+function _convert_urlencoded_to_entities( $match ) {
+ return '&#' . base_convert( $match[1], 16, 10 ) . ';';
+}
+
/**
* Display the post excerpt.
*
$classes[] = 'post-' . $post->ID;
$classes[] = $post->post_type;
$classes[] = 'type-' . $post->post_type;
+ $classes[] = 'status-' . $post->post_status;
+
+ // Post Format
+ $post_format = get_post_format( $post->ID );
+
+ if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
+ if ( $post_format && !is_wp_error($post_format) )
+ $classes[] = 'format-' . sanitize_html_class( $post_format );
+ else
+ $classes[] = 'format-standard';
+ }
+
+ // post requires password
+ if ( post_password_required($post->ID) )
+ $classes[] = 'post-password-required';
// sticky for Sticky Posts
if ( is_sticky($post->ID) && is_home() && !is_paged() )
$classes[] = 'sticky';
- // hentry for hAtom compliace
+ // hentry for hAtom compliance
$classes[] = 'hentry';
// Categories
- foreach ( (array) get_the_category($post->ID) as $cat ) {
- if ( empty($cat->slug ) )
- continue;
- $classes[] = 'category-' . sanitize_html_class($cat->slug, $cat->cat_ID);
+ if ( is_object_in_taxonomy( $post->post_type, 'category' ) ) {
+ foreach ( (array) get_the_category($post->ID) as $cat ) {
+ if ( empty($cat->slug ) )
+ continue;
+ $classes[] = 'category-' . sanitize_html_class($cat->slug, $cat->term_id);
+ }
}
// Tags
- foreach ( (array) get_the_tags($post->ID) as $tag ) {
- if ( empty($tag->slug ) )
- continue;
- $classes[] = 'tag-' . sanitize_html_class($tag->slug, $tag->term_id);
+ if ( is_object_in_taxonomy( $post->post_type, 'post_tag' ) ) {
+ foreach ( (array) get_the_tags($post->ID) as $tag ) {
+ if ( empty($tag->slug ) )
+ continue;
+ $classes[] = 'tag-' . sanitize_html_class($tag->slug, $tag->term_id);
+ }
}
if ( !empty($class) ) {
$classes[] = 'single-' . sanitize_html_class($post->post_type, $post_id);
$classes[] = 'postid-' . $post_id;
+ // Post Format
+ $post_format = get_post_format( $post->ID );
+
+ if ( $post_format && !is_wp_error($post_format) )
+ $classes[] = 'single-format-' . sanitize_html_class( $post_format );
+ else
+ $classes[] = 'single-format-standard';
+
if ( is_attachment() ) {
$mime_type = get_post_mime_type($post_id);
$mime_prefix = array( 'application/', 'image/', 'text/', 'audio/', 'video/', 'music/' );
$classes[] = 'attachment-' . str_replace( $mime_prefix, '', $mime_type );
}
} elseif ( is_archive() ) {
- if ( is_author() ) {
+ if ( is_post_type_archive() ) {
+ $classes[] = 'post-type-archive';
+ $classes[] = 'post-type-archive-' . sanitize_html_class( get_query_var( 'post_type' ) );
+ } else if ( is_author() ) {
$author = $wp_query->get_queried_object();
$classes[] = 'author';
$classes[] = 'author-' . sanitize_html_class( $author->user_nicename , $author->ID );
+ $classes[] = 'author-' . $author->ID;
} elseif ( is_category() ) {
$cat = $wp_query->get_queried_object();
$classes[] = 'category';
- $classes[] = 'category-' . sanitize_html_class( $cat->slug, $cat->cat_ID );
+ $classes[] = 'category-' . sanitize_html_class( $cat->slug, $cat->term_id );
+ $classes[] = 'category-' . $cat->term_id;
} elseif ( is_tag() ) {
$tags = $wp_query->get_queried_object();
$classes[] = 'tag';
$classes[] = 'tag-' . sanitize_html_class( $tags->slug, $tags->term_id );
+ $classes[] = 'tag-' . $tags->term_id;
+ } elseif ( is_tax() ) {
+ $term = $wp_query->get_queried_object();
+ $classes[] = 'tax-' . sanitize_html_class( $term->taxonomy );
+ $classes[] = 'term-' . sanitize_html_class( $term->slug, $term->term_id );
+ $classes[] = 'term-' . $term->term_id;
}
} elseif ( is_page() ) {
$classes[] = 'page';
if ( is_user_logged_in() )
$classes[] = 'logged-in';
+ if ( is_admin_bar_showing() )
+ $classes[] = 'admin-bar';
+
$page = $wp_query->get( 'page' );
if ( !$page || $page < 2)
$classes[] = 'author-paged-' . $page;
elseif ( is_search() )
$classes[] = 'search-paged-' . $page;
+ elseif ( is_post_type_archive() )
+ $classes[] = 'post-type-paged-' . $page;
}
if ( !empty( $class ) ) {
$r = apply_filters( 'wp_link_pages_args', $r );
extract( $r, EXTR_SKIP );
- global $post, $page, $numpages, $multipage, $more, $pagenow;
+ global $page, $numpages, $multipage, $more, $pagenow;
$output = '';
if ( $multipage ) {
$j = str_replace('%',$i,$pagelink);
$output .= ' ';
if ( ($i != $page) || ((!$more) && ($page==1)) ) {
- if ( 1 == $i ) {
- $output .= '<a href="' . get_permalink() . '">';
- } else {
- if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
- $output .= '<a href="' . add_query_arg('page', $i, get_permalink()) . '">';
- elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID )
- $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit('page/' . $i, 'single_paged'). '">';
- else
- $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">';
- }
-
+ $output .= _wp_link_page($i);
}
- $output .= $link_before;
- $output .= $j;
- $output .= $link_after;
+ $output .= $link_before . $j . $link_after;
if ( ($i != $page) || ((!$more) && ($page==1)) )
$output .= '</a>';
}
$output .= $before;
$i = $page - 1;
if ( $i && $more ) {
- if ( 1 == $i ) {
- $output .= '<a href="' . get_permalink() . '">';
- } else {
- if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
- $output .= '<a href="' . add_query_arg('page', $i, get_permalink()) . '">';
- elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID )
- $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit('page/' . $i, 'single_paged'). '">';
- else
- $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">';
- }
+ $output .= _wp_link_page($i);
$output .= $link_before. $previouspagelink . $link_after . '</a>';
}
$i = $page + 1;
if ( $i <= $numpages && $more ) {
- if ( 1 == $i ) {
- $output .= '<a href="' . get_permalink() . '">';
- } else {
- if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
- $output .= '<a href="' . add_query_arg('page', $i, get_permalink()) . '">';
- elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID )
- $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit('page/' . $i, 'single_paged'). '">';
- else
- $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">';
- }
+ $output .= _wp_link_page($i);
$output .= $link_before. $nextpagelink . $link_after . '</a>';
}
$output .= $after;
return $output;
}
+/**
+ * Helper function for wp_link_pages().
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @param int $i Page number.
+ * @return string Link.
+ */
+function _wp_link_page( $i ) {
+ global $post, $wp_rewrite;
+
+ if ( 1 == $i ) {
+ $url = get_permalink();
+ } else {
+ if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
+ $url = add_query_arg( 'page', $i, get_permalink() );
+ elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID )
+ $url = trailingslashit(get_permalink()) . user_trailingslashit("$wp_rewrite->pagination_base/" . $i, 'single_paged');
+ else
+ $url = trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged');
+ }
+
+ return '<a href="' . esc_url( $url ) . '">';
+}
//
// Post-meta: Custom per-post fields.
echo "<ul class='post-meta'>\n";
foreach ( (array) $keys as $key ) {
$keyt = trim($key);
- if ( '_' == $keyt{0} )
+ if ( '_' == $keyt[0] )
continue;
$values = array_map('trim', get_post_custom_values($key));
$value = implode($values,', ');
return call_user_func_array(array(&$walker, 'walk'), $args);
}
+/**
+ * Create HTML list of pages.
+ *
+ * @package WordPress
+ * @since 2.1.0
+ * @uses Walker
+ */
+class Walker_Page extends Walker {
+ /**
+ * @see Walker::$tree_type
+ * @since 2.1.0
+ * @var string
+ */
+ var $tree_type = 'page';
+
+ /**
+ * @see Walker::$db_fields
+ * @since 2.1.0
+ * @todo Decouple this.
+ * @var array
+ */
+ var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');
+
+ /**
+ * @see Walker::start_lvl()
+ * @since 2.1.0
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ * @param int $depth Depth of page. Used for padding.
+ */
+ function start_lvl(&$output, $depth) {
+ $indent = str_repeat("\t", $depth);
+ $output .= "\n$indent<ul class='children'>\n";
+ }
+
+ /**
+ * @see Walker::end_lvl()
+ * @since 2.1.0
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ * @param int $depth Depth of page. Used for padding.
+ */
+ function end_lvl(&$output, $depth) {
+ $indent = str_repeat("\t", $depth);
+ $output .= "$indent</ul>\n";
+ }
+
+ /**
+ * @see Walker::start_el()
+ * @since 2.1.0
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ * @param object $page Page data object.
+ * @param int $depth Depth of page. Used for padding.
+ * @param int $current_page Page ID.
+ * @param array $args
+ */
+ function start_el(&$output, $page, $depth, $args, $current_page) {
+ if ( $depth )
+ $indent = str_repeat("\t", $depth);
+ else
+ $indent = '';
+
+ extract($args, EXTR_SKIP);
+ $css_class = array('page_item', 'page-item-'.$page->ID);
+ if ( !empty($current_page) ) {
+ $_current_page = get_page( $current_page );
+ _get_post_ancestors($_current_page);
+ if ( isset($_current_page->ancestors) && in_array($page->ID, (array) $_current_page->ancestors) )
+ $css_class[] = 'current_page_ancestor';
+ if ( $page->ID == $current_page )
+ $css_class[] = 'current_page_item';
+ elseif ( $_current_page && $page->ID == $_current_page->post_parent )
+ $css_class[] = 'current_page_parent';
+ } elseif ( $page->ID == get_option('page_for_posts') ) {
+ $css_class[] = 'current_page_parent';
+ }
+
+ $css_class = implode(' ', apply_filters('page_css_class', $css_class, $page));
+
+ $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_permalink($page->ID) . '" title="' . esc_attr( wp_strip_all_tags( apply_filters( 'the_title', $page->post_title, $page->ID ) ) ) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';
+
+ if ( !empty($show_date) ) {
+ if ( 'modified' == $show_date )
+ $time = $page->post_modified;
+ else
+ $time = $page->post_date;
+
+ $output .= " " . mysql2date($date_format, $time);
+ }
+ }
+
+ /**
+ * @see Walker::end_el()
+ * @since 2.1.0
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ * @param object $page Page data object. Not used.
+ * @param int $depth Depth of page. Not Used.
+ */
+ function end_el(&$output, $page, $depth) {
+ $output .= "</li>\n";
+ }
+
+}
+
+/**
+ * Create HTML dropdown list of pages.
+ *
+ * @package WordPress
+ * @since 2.1.0
+ * @uses Walker
+ */
+class Walker_PageDropdown extends Walker {
+ /**
+ * @see Walker::$tree_type
+ * @since 2.1.0
+ * @var string
+ */
+ var $tree_type = 'page';
+
+ /**
+ * @see Walker::$db_fields
+ * @since 2.1.0
+ * @todo Decouple this
+ * @var array
+ */
+ var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');
+
+ /**
+ * @see Walker::start_el()
+ * @since 2.1.0
+ *
+ * @param string $output Passed by reference. Used to append additional content.
+ * @param object $page Page data object.
+ * @param int $depth Depth of page in reference to parent pages. Used for padding.
+ * @param array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element.
+ */
+ function start_el(&$output, $page, $depth, $args) {
+ $pad = str_repeat(' ', $depth * 3);
+
+ $output .= "\t<option class=\"level-$depth\" value=\"$page->ID\"";
+ if ( $page->ID == $args['selected'] )
+ $output .= ' selected="selected"';
+ $output .= '>';
+ $title = esc_html($page->post_title);
+ $title = apply_filters( 'list_pages', $page->post_title );
+ $output .= "$pad$title";
+ $output .= "</option>\n";
+ }
+}
+
//
// Attachments
//
* @param int $post_id Optional. Post ID.
* @return bool Whether post has an image attached.
*/
-function has_post_thumbnail( $post_id = NULL ) {
- global $id;
- $post_id = ( NULL === $post_id ) ? $id : $post_id;
- return !! get_post_thumbnail_id( $post_id );
+function has_post_thumbnail( $post_id = null ) {
+ $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
+ return (bool) get_post_thumbnail_id( $post_id );
}
/**
* @param int $post_id Optional. Post ID.
* @return int
*/
-function get_post_thumbnail_id( $post_id = NULL ) {
- global $id;
- $post_id = ( NULL === $post_id ) ? $id : $post_id;
+function get_post_thumbnail_id( $post_id = null ) {
+ $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
return get_post_meta( $post_id, '_thumbnail_id', true );
}
* @param string|array $attr Optional. Query string or array of attributes.
*/
function the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) {
- echo get_the_post_thumbnail( NULL, $size, $attr );
+ echo get_the_post_thumbnail( null, $size, $attr );
}
/**
* @param int $post_id Optional. Post ID.
* @param string $size Optional. Image size. Defaults to 'thumbnail'.
* @param string|array $attr Optional. Query string or array of attributes.
- */
-function get_the_post_thumbnail( $post_id = NULL, $size = 'post-thumbnail', $attr = '' ) {
- global $id;
- $post_id = ( NULL === $post_id ) ? $id : $post_id;
+ */
+function get_the_post_thumbnail( $post_id = null, $size = 'post-thumbnail', $attr = '' ) {
+ $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
$post_thumbnail_id = get_post_thumbnail_id( $post_id );
$size = apply_filters( 'post_thumbnail_size', $size );
if ( $post_thumbnail_id ) {
return apply_filters( 'post_thumbnail_html', $html, $post_id, $post_thumbnail_id, $size, $attr );
}
-?>
\ No newline at end of file
+?>
/**
* Creates the initial post types when 'init' action is fired.
+ *
+ * @since 2.9.0
*/
function create_initial_post_types() {
register_post_type( 'post', array(
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
+ 'map_meta_cap' => true,
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
- 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions' ),
+ 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats' ),
) );
register_post_type( 'page', array(
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'page',
+ 'map_meta_cap' => true,
'hierarchical' => true,
'rewrite' => false,
'query_var' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'media.php?attachment_id=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
+ 'map_meta_cap' => true,
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
- 'can_export' => false,
'show_in_nav_menus' => false,
) );
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
'_edit_link' => 'revision.php?revision=%d', /* internal use only. don't use this when registering your own post type. */
'capability_type' => 'post',
+ 'map_meta_cap' => true,
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
+ 'can_export' => false,
) );
register_post_type( 'nav_menu_item', array(
),
'public' => false,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
- 'capability_type' => 'post',
'hierarchical' => false,
'rewrite' => false,
'query_var' => false,
* @param string $output Optional. Constant for return type, either OBJECT (default), ARRAY_A, ARRAY_N.
* @return array|bool False on failure and the type will be determined by $output parameter.
*/
-function &get_children($args = '', $output = OBJECT) {
+function get_children($args = '', $output = OBJECT) {
$kids = array();
if ( empty( $args ) ) {
if ( isset( $GLOBALS['post'] ) ) {
update_post_cache($children);
foreach ( $children as $key => $child )
- $kids[$child->ID] =& $children[$key];
+ $kids[$child->ID] = $children[$key];
if ( $output == OBJECT ) {
return $kids;
return false;
}
+/**
+ * Retrieve the format slug for a post
+ *
+ * @since 3.1.0
+ *
+ * @param int|object $post A post
+ *
+ * @return mixed The format if successful. False if no format is set. WP_Error if errors.
+ */
+function get_post_format( $post = null ) {
+ $post = get_post($post);
+
+ if ( ! post_type_supports( $post->post_type, 'post-formats' ) )
+ return false;
+
+ $_format = get_the_terms( $post->ID, 'post_format' );
+
+ if ( empty( $_format ) )
+ return false;
+
+ $format = array_shift( $_format );
+
+ return ( str_replace('post-format-', '', $format->slug ) );
+}
+
+/**
+ * Check if a post has a particular format
+ *
+ * @since 3.1.0
+ * @uses has_term()
+ *
+ * @param string $format The format to check for
+ * @param object|id $post The post to check. If not supplied, defaults to the current post if used in the loop.
+ * @return bool True if the post has the format, false otherwise.
+ */
+function has_post_format( $format, $post = null ) {
+ return has_term('post-format-' . sanitize_key($format), 'post_format', $post);
+}
+
+/**
+ * Assign a format to a post
+ *
+ * @since 3.1.0
+ *
+ * @param int|object $post The post for which to assign a format
+ * @param string $format A format to assign. Use an empty string or array to remove all formats from the post.
+ * @return mixed WP_Error on error. Array of affected term IDs on success.
+ */
+function set_post_format( $post, $format ) {
+ $post = get_post($post);
+
+ if ( empty($post) )
+ return new WP_Error('invalid_post', __('Invalid post'));
+
+ if ( !empty($format) ) {
+ $format = sanitize_key($format);
+ if ( 'standard' == $format || !in_array( $format, array_keys( get_post_format_slugs() ) ) )
+ $format = '';
+ else
+ $format = 'post-format-' . $format;
+ }
+
+ return wp_set_post_terms($post->ID, $format, 'post_format');
+}
+
/**
* Retrieve the post status based on the Post ID.
*
* Optional $args contents:
*
* label - A descriptive name for the post status marked for translation. Defaults to $post_status.
- * public - Whether posts of this status should be shown in the admin UI. Defaults to true.
+ * public - Whether posts of this status should be shown in the front end of the site. Defaults to true.
* exclude_from_search - Whether to exclude posts with this post status from search results. Defaults to true.
+ * show_in_admin_all_list - Whether to include posts in the edit listing for their post type
+ * show_in_admin_status_list - Show in the list of statuses with post counts at the top of the edit
+ * listings, e.g. All (12) | Published (9) | My Custom Status (2) ...
+ *
+ * Arguments prefixed with an _underscore shouldn't be used by plugins and themes.
*
* @package WordPress
* @subpackage Post
$args = wp_parse_args($args, $defaults);
$args = (object) $args;
- $post_status = sanitize_user($post_status, true);
+ $post_status = sanitize_key($post_status);
$args->name = $post_status;
if ( null === $args->public && null === $args->internal && null === $args->protected && null === $args->private )
* @see register_post_status
* @see get_post_statuses
*
- * @param string $post_type The name of a registered post status
+ * @param string $post_status The name of a registered post status
* @return object A post status object
*/
function get_post_status_object( $post_status ) {
* @since 3.0.0
* @see get_post_type_object
*
- * @param string $post Post type name
+ * @param string $post_type Post type name
* @return bool Whether post type is hierarchical.
*/
function is_post_type_hierarchical( $post_type ) {
* @since 3.0.0
* @uses get_post_type_object()
*
- * @param string Post type name
+ * @param string $post_type Post type name
* @return bool Whether post type is registered.
*/
function post_type_exists( $post_type ) {
/**
* Register a post type. Do not use before init.
*
- * A simple function for creating or modifying a post type based on the
+ * A function for creating or modifying a post type based on the
* parameters given. The function will accept an array (second optional
* parameter), along with a string for the post type name.
*
- *
* Optional $args contents:
*
* - label - Name of the post type shown in the menu. Usually plural. If not set, labels['name'] will be used.
* - description - A short descriptive summary of what the post type is. Defaults to blank.
* - public - Whether posts of this type should be shown in the admin UI. Defaults to false.
- * - exclude_from_search - Whether to exclude posts with this post type from search results. Defaults to true if the type is not public, false if the type is public.
- * - publicly_queryable - Whether post_type queries can be performed from the front page. Defaults to whatever public is set as.
- * - show_ui - Whether to generate a default UI for managing this post type. Defaults to true if the type is public, false if the type is not public.
+ * - exclude_from_search - Whether to exclude posts with this post type from search results.
+ * Defaults to true if the type is not public, false if the type is public.
+ * - publicly_queryable - Whether post_type queries can be performed from the front page.
+ * Defaults to whatever public is set as.
+ * - show_ui - Whether to generate a default UI for managing this post type. Defaults to true
+ * if the type is public, false if the type is not public.
+ * - show_in_menu - Where to show the post type in the admin menu. True for a top level menu,
+ * false for no menu, or can be a top level page like 'tools.php' or 'edit.php?post_type=page'.
+ * show_ui must be true.
* - menu_position - The position in the menu order the post type should appear. Defaults to the bottom.
* - menu_icon - The url to the icon to be used for this menu. Defaults to use the posts icon.
- * - capability_type - The post type to use for checking read, edit, and delete capabilities. Defaults to "post".
- * - capabilities - Array of capabilities for this post type. You can see accepted values in {@link get_post_type_capabilities()}. By default the capability_type is used to construct capabilities.
+ * - capability_type - The string to use to build the read, edit, and delete capabilities. Defaults to 'post'.
+ * May be passed as an array to allow for alternative plurals when using this argument as a base to construct the
+ * capabilities, e.g. array('story', 'stories').
+ * - capabilities - Array of capabilities for this post type. By default the capability_type is used
+ * as a base to construct capabilities. You can see accepted values in {@link get_post_type_capabilities()}.
+ * - map_meta_cap - Whether to use the internal default meta capability handling. Defaults to false.
* - hierarchical - Whether the post type is hierarchical. Defaults to false.
- * - supports - An alias for calling add_post_type_support() directly. See add_post_type_support() for Documentation. Defaults to none.
- * - register_meta_box_cb - Provide a callback function that will be called when setting up the meta boxes for the edit form. Do remove_meta_box() and add_meta_box() calls in the callback.
- * - taxonomies - An array of taxonomy identifiers that will be registered for the post type. Default is no taxonomies. Taxonomies can be registered later with register_taxonomy() or register_taxonomy_for_object_type().
- * - labels - An array of labels for this post type. You can see accepted values in {@link get_post_type_labels()}. By default post labels are used for non-hierarchical types and page labels for hierarchical ones.
+ * - supports - An alias for calling add_post_type_support() directly. See {@link add_post_type_support()}
+ * for documentation. Defaults to none.
+ * - register_meta_box_cb - Provide a callback function that will be called when setting up the
+ * meta boxes for the edit form. Do remove_meta_box() and add_meta_box() calls in the callback.
+ * - taxonomies - An array of taxonomy identifiers that will be registered for the post type.
+ * Default is no taxonomies. Taxonomies can be registered later with register_taxonomy() or
+ * register_taxonomy_for_object_type().
+ * - labels - An array of labels for this post type. By default post labels are used for non-hierarchical
+ * types and page labels for hierarchical ones. You can see accepted values in {@link get_post_type_labels()}.
* - permalink_epmask - The default rewrite endpoint bitmasks.
- * - rewrite - false to prevent rewrite, or array('slug'=>$slug) to customize permastruct; default will use $post_type as slug.
+ * - has_archive - True to enable post type archives. Will generate the proper rewrite rules if rewrite is enabled.
+ * - rewrite - false to prevent rewrite. Defaults to true. Use array('slug'=>$slug) to customize permastruct;
+ * default will use $post_type as slug. Other options include 'with_front', 'feeds', and 'pages'.
* - query_var - false to prevent queries, or string to value of the query var to use for this post type
* - can_export - true allows this post type to be exported.
* - show_in_nav_menus - true makes this post type available for selection in navigation menus.
- * - _builtin - true if this post type is a native or "built-in" post_type. THIS IS FOR INTERNAL USE ONLY!
- * - _edit_link - URL segement to use for edit link of this post type. Set to 'post.php?post=%d'. THIS IS FOR INTERNAL USE ONLY!
+ * - _builtin - true if this post type is a native or "built-in" post_type. THIS IS FOR INTERNAL USE ONLY!
+ * - _edit_link - URL segement to use for edit link of this post type. THIS IS FOR INTERNAL USE ONLY!
*
* @since 2.9.0
* @uses $wp_post_types Inserts new post type object into the list
*
* @param string $post_type Name of the post type.
* @param array|string $args See above description.
- * @return object the registered post type object
+ * @return object|WP_Error the registered post type object, or an error object
*/
function register_post_type($post_type, $args = array()) {
global $wp_post_types, $wp_rewrite, $wp;
// Args prefixed with an underscore are reserved for internal use.
$defaults = array(
'labels' => array(), 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null,
- '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'capabilities' => array(), 'hierarchical' => false,
- 'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null,
+ 'capability_type' => 'post', 'capabilities' => array(), 'map_meta_cap' => null,
+ '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'hierarchical' => false,
+ 'public' => false, 'rewrite' => true, 'has_archive' => false, 'query_var' => true,
+ 'supports' => array(), 'register_meta_box_cb' => null,
'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null,
- 'permalink_epmask' => EP_PERMALINK, 'can_export' => true, 'show_in_nav_menus' => null
+ 'permalink_epmask' => EP_PERMALINK, 'can_export' => true, 'show_in_nav_menus' => null, 'show_in_menu' => null,
);
$args = wp_parse_args($args, $defaults);
$args = (object) $args;
- $post_type = sanitize_user($post_type, true);
+ $post_type = sanitize_key($post_type);
$args->name = $post_type;
+ if ( strlen( $post_type ) > 20 )
+ return new WP_Error( 'post_type_too_long', __( 'Post types cannot exceed 20 characters in length' ) );
+
// If not set, default to the setting for public.
if ( null === $args->publicly_queryable )
$args->publicly_queryable = $args->public;
if ( null === $args->show_ui )
$args->show_ui = $args->public;
+ // If not set, default to the setting for show_ui.
+ if ( null === $args->show_in_menu || ! $args->show_ui )
+ $args->show_in_menu = $args->show_ui;
+
// Whether to show this type in nav-menus.php. Defaults to the setting for public.
if ( null === $args->show_in_nav_menus )
$args->show_in_nav_menus = $args->public;
if ( null === $args->exclude_from_search )
$args->exclude_from_search = !$args->public;
- if ( empty($args->capability_type) )
- $args->capability_type = 'post';
+ // Back compat with quirky handling in version 3.0. #14122
+ if ( empty( $args->capabilities ) && null === $args->map_meta_cap && in_array( $args->capability_type, array( 'post', 'page' ) ) )
+ $args->map_meta_cap = true;
+
+ if ( null === $args->map_meta_cap )
+ $args->map_meta_cap = false;
$args->cap = get_post_type_capabilities( $args );
unset($args->capabilities);
+ if ( is_array( $args->capability_type ) )
+ $args->capability_type = $args->capability_type[0];
+
if ( ! empty($args->supports) ) {
add_post_type_support($post_type, $args->supports);
unset($args->supports);
}
if ( false !== $args->rewrite && '' != get_option('permalink_structure') ) {
- if ( !is_array($args->rewrite) )
+ if ( ! is_array( $args->rewrite ) )
$args->rewrite = array();
- if ( !isset($args->rewrite['slug']) )
+ if ( empty( $args->rewrite['slug'] ) )
$args->rewrite['slug'] = $post_type;
- if ( !isset($args->rewrite['with_front']) )
+ if ( ! isset( $args->rewrite['with_front'] ) )
$args->rewrite['with_front'] = true;
+ if ( ! isset( $args->rewrite['pages'] ) )
+ $args->rewrite['pages'] = true;
+ if ( ! isset( $args->rewrite['feeds'] ) || ! $args->has_archive )
+ $args->rewrite['feeds'] = (bool) $args->has_archive;
+
if ( $args->hierarchical )
$wp_rewrite->add_rewrite_tag("%$post_type%", '(.+?)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name=");
else
$wp_rewrite->add_rewrite_tag("%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name=");
+
+ if ( $args->has_archive ) {
+ $archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive;
+ $wp_rewrite->add_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' );
+ if ( $args->rewrite['feeds'] && $wp_rewrite->feeds ) {
+ $feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')';
+ $wp_rewrite->add_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
+ $wp_rewrite->add_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
+ }
+ if ( $args->rewrite['pages'] )
+ $wp_rewrite->add_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' );
+ }
+
$wp_rewrite->add_permastruct($post_type, "{$args->rewrite['slug']}/%$post_type%", $args->rewrite['with_front'], $args->permalink_epmask);
}
/**
* Builds an object with all post type capabilities out of a post type object
*
- * Accepted keys of the capabilities array in the post type object:
- * - edit_post - The meta capability that controls editing a particular object of this post type. Defaults to "edit_ . $capability_type" (edit_post).
- * - edit_posts - The capability that controls editing objects of this post type as a class. Defaults to "edit_ . $capability_type . s" (edit_posts).
- * - edit_others_posts - The capability that controls editing objects of this post type that are owned by other users. Defaults to "edit_others_ . $capability_type . s" (edit_others_posts).
- * - publish_posts - The capability that controls publishing objects of this post type. Defaults to "publish_ . $capability_type . s" (publish_posts).
- * - read_post - The meta capability that controls reading a particular object of this post type. Defaults to "read_ . $capability_type" (read_post).
- * - read_private_posts - The capability that controls reading private posts. Defaults to "read_private . $capability_type . s" (read_private_posts).
- * - delete_post - The meta capability that controls deleting a particular object of this post type. Defaults to "delete_ . $capability_type" (delete_post).
- *
+ * Post type capabilities use the 'capability_type' argument as a base, if the
+ * capability is not set in the 'capabilities' argument array or if the
+ * 'capabilities' argument is not supplied.
+ *
+ * The capability_type argument can optionally be registered as an array, with
+ * the first value being singular and the second plural, e.g. array('story, 'stories')
+ * Otherwise, an 's' will be added to the value for the plural form. After
+ * registration, capability_type will always be a string of the singular value.
+ *
+ * By default, seven keys are accepted as part of the capabilities array:
+ *
+ * - edit_post, read_post, and delete_post are meta capabilities, which are then
+ * generally mapped to corresponding primitive capabilities depending on the
+ * context, which would be the post being edited/read/deleted and the user or
+ * role being checked. Thus these capabilities would generally not be granted
+ * directly to users or roles.
+ *
+ * - edit_posts - Controls whether objects of this post type can be edited.
+ * - edit_others_posts - Controls whether objects of this type owned by other users
+ * can be edited. If the post type does not support an author, then this will
+ * behave like edit_posts.
+ * - publish_posts - Controls publishing objects of this post type.
+ * - read_private_posts - Controls whether private objects can be read.
+
+ * These four primitive capabilities are checked in core in various locations.
+ * There are also seven other primitive capabilities which are not referenced
+ * directly in core, except in map_meta_cap(), which takes the three aforementioned
+ * meta capabilities and translates them into one or more primitive capabilities
+ * that must then be checked against the user or role, depending on the context.
+ *
+ * - read - Controls whether objects of this post type can be read.
+ * - delete_posts - Controls whether objects of this post type can be deleted.
+ * - delete_private_posts - Controls whether private objects can be deleted.
+ * - delete_published_posts - Controls whether published objects can be deleted.
+ * - delete_others_posts - Controls whether objects owned by other users can be
+ * can be deleted. If the post type does not support an author, then this will
+ * behave like delete_posts.
+ * - edit_private_posts - Controls whether private objects can be edited.
+ * - edit_published_posts - Controls whether published objects can be deleted.
+ *
+ * These additional capabilities are only used in map_meta_cap(). Thus, they are
+ * only assigned by default if the post type is registered with the 'map_meta_cap'
+ * argument set to true (default is false).
+ *
+ * @see map_meta_cap()
* @since 3.0.0
- * @param object $args
+ *
+ * @param object $args Post type registration arguments
* @return object object with all the capabilities as member variables
*/
function get_post_type_capabilities( $args ) {
- $defaults = array(
- 'edit_post' => 'edit_' . $args->capability_type,
- 'edit_posts' => 'edit_' . $args->capability_type . 's',
- 'edit_others_posts' => 'edit_others_' . $args->capability_type . 's',
- 'publish_posts' => 'publish_' . $args->capability_type . 's',
- 'read_post' => 'read_' . $args->capability_type,
- 'read_private_posts' => 'read_private_' . $args->capability_type . 's',
- 'delete_post' => 'delete_' . $args->capability_type,
+ if ( ! is_array( $args->capability_type ) )
+ $args->capability_type = array( $args->capability_type, $args->capability_type . 's' );
+
+ // Singular base for meta capabilities, plural base for primitive capabilities.
+ list( $singular_base, $plural_base ) = $args->capability_type;
+
+ $default_capabilities = array(
+ // Meta capabilities
+ 'edit_post' => 'edit_' . $singular_base,
+ 'read_post' => 'read_' . $singular_base,
+ 'delete_post' => 'delete_' . $singular_base,
+ // Primitive capabilities used outside of map_meta_cap():
+ 'edit_posts' => 'edit_' . $plural_base,
+ 'edit_others_posts' => 'edit_others_' . $plural_base,
+ 'publish_posts' => 'publish_' . $plural_base,
+ 'read_private_posts' => 'read_private_' . $plural_base,
);
- $labels = array_merge( $defaults, $args->capabilities );
- return (object) $labels;
+
+ // Primitive capabilities used within map_meta_cap():
+ if ( $args->map_meta_cap ) {
+ $default_capabilities_for_mapping = array(
+ 'read' => 'read',
+ 'delete_posts' => 'delete_' . $plural_base,
+ 'delete_private_posts' => 'delete_private_' . $plural_base,
+ 'delete_published_posts' => 'delete_published_' . $plural_base,
+ 'delete_others_posts' => 'delete_others_' . $plural_base,
+ 'edit_private_posts' => 'edit_private_' . $plural_base,
+ 'edit_published_posts' => 'edit_published_' . $plural_base,
+ );
+ $default_capabilities = array_merge( $default_capabilities, $default_capabilities_for_mapping );
+ }
+
+ $capabilities = array_merge( $default_capabilities, $args->capabilities );
+
+ // Remember meta capabilities for future reference.
+ if ( $args->map_meta_cap )
+ _post_type_meta_capabilities( $capabilities );
+
+ return (object) $capabilities;
+}
+
+/**
+ * Stores or returns a list of post type meta caps for map_meta_cap().
+ *
+ * @since 3.1.0
+ * @access private
+ */
+function _post_type_meta_capabilities( $capabilities = null ) {
+ static $meta_caps = array();
+ if ( null === $capabilities )
+ return $meta_caps;
+ foreach ( $capabilities as $core => $custom ) {
+ if ( in_array( $core, array( 'read_post', 'delete_post', 'edit_post' ) ) )
+ $meta_caps[ $custom ] = $core;
+ }
}
/**
* - not_found_in_trash - Default is No posts found in Trash/No pages found in Trash
* - parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical ones the default is Parent Page:
*
- * Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages.)
+ * Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages).
*
* @since 3.0.0
* @param object $post_type_object
'new_item' => array( __('New Post'), __('New Page') ),
'view_item' => array( __('View Post'), __('View Page') ),
'search_items' => array( __('Search Posts'), __('Search Pages') ),
- 'not_found' => array( __('No posts found'), __('No pages found') ),
- 'not_found_in_trash' => array( __('No posts found in Trash'), __('No pages found in Trash') ),
- 'parent_item_colon' => array( null, __('Parent Page:') )
+ 'not_found' => array( __('No posts found.'), __('No pages found.') ),
+ 'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ),
+ 'parent_item_colon' => array( null, __('Parent Page:') ),
);
+ $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
return _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults );
}
* Builds an object with custom-something object (post type, taxonomy) labels out of a custom-something object
*
* @access private
+ * @since 3.0.0
*/
function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) {
if ( !isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) )
$object->labels['singular_name'] = $object->labels['name'];
- $defaults = array_map( create_function( '$x', $object->hierarchical? 'return $x[1];' : 'return $x[0];' ), $nohier_vs_hier_defaults );
+ if ( !isset( $object->labels['menu_name'] ) && isset( $object->labels['name'] ) )
+ $object->labels['menu_name'] = $object->labels['name'];
+
+ foreach ( $nohier_vs_hier_defaults as $key => $value )
+ $defaults[$key] = $object->hierarchical ? $value[1] : $value[0];
+
$labels = array_merge( $defaults, $object->labels );
return (object)$labels;
}
+/**
+ * Adds submenus for post types.
+ *
+ * @access private
+ * @since 3.1.0
+ */
+function _add_post_type_submenus() {
+ foreach ( get_post_types( array( 'show_ui' => true ) ) as $ptype ) {
+ $ptype_obj = get_post_type_object( $ptype );
+ // Submenus only.
+ if ( ! $ptype_obj->show_in_menu || $ptype_obj->show_in_menu === true )
+ continue;
+ add_submenu_page( $ptype_obj->show_in_menu, $ptype_obj->labels->name, $ptype_obj->labels->menu_name, $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype" );
+ }
+}
+add_action( 'admin_menu', '_add_post_type_submenus' );
+
/**
* Register support of certain features for a post type.
*
$r = wp_parse_args( $args, $defaults );
if ( empty( $r['post_status'] ) )
$r['post_status'] = ( 'attachment' == $r['post_type'] ) ? 'inherit' : 'publish';
- if ( ! empty($r['numberposts']) )
+ if ( ! empty($r['numberposts']) && empty($r['posts_per_page']) )
$r['posts_per_page'] = $r['numberposts'];
if ( ! empty($r['category']) )
$r['cat'] = $r['category'];
} elseif ( ! empty($r['exclude']) )
$r['post__not_in'] = wp_parse_id_list( $r['exclude'] );
- $r['caller_get_posts'] = true;
+ $r['ignore_sticky_posts'] = true;
+ $r['no_found_rows'] = true;
$get_posts = new WP_Query;
return $get_posts->query($r);
* @link http://codex.wordpress.org/Function_Reference/add_post_meta
*
* @param int $post_id Post ID.
- * @param string $key Metadata name.
- * @param mixed $value Metadata value.
+ * @param string $meta_key Metadata name.
+ * @param mixed $meta_value Metadata value.
* @param bool $unique Optional, default is false. Whether the same key should not be added.
* @return bool False for failure. True for success.
*/
*
* If the meta field for the post does not exist, it will be added.
*
- * @since 1.5
+ * @since 1.5.0
* @uses $wpdb
* @link http://codex.wordpress.org/Function_Reference/update_post_meta
*
* @param int $post_id Post ID.
- * @param string $key Metadata key.
- * @param mixed $value Metadata value.
+ * @param string $meta_key Metadata key.
+ * @param mixed $meta_value Metadata value.
* @param mixed $prev_value Optional. Previous value to check before removing.
* @return bool False on failure, true if success.
*/
* @param int $post_id post ID
* @return array
*/
-function get_post_custom($post_id = 0) {
- global $id;
-
- if ( !$post_id )
- $post_id = (int) $id;
+function get_post_custom( $post_id = 0 ) {
+ $post_id = absint( $post_id );
- $post_id = (int) $post_id;
+ if ( ! $post_id )
+ $post_id = get_the_ID();
- if ( ! wp_cache_get($post_id, 'post_meta') )
- update_postmeta_cache($post_id);
+ if ( ! wp_cache_get( $post_id, 'post_meta' ) )
+ update_postmeta_cache( $post_id );
- return wp_cache_get($post_id, 'post_meta');
+ return wp_cache_get( $post_id, 'post_meta' );
}
/**
* @param int $post_id Optional. Post ID.
* @return bool Whether post is sticky.
*/
-function is_sticky($post_id = null) {
- global $id;
+function is_sticky( $post_id = 0 ) {
+ $post_id = absint( $post_id );
- $post_id = absint($post_id);
+ if ( ! $post_id )
+ $post_id = get_the_ID();
- if ( !$post_id )
- $post_id = absint($id);
-
- $stickies = get_option('sticky_posts');
+ $stickies = get_option( 'sticky_posts' );
- if ( !is_array($stickies) )
+ if ( ! is_array( $stickies ) )
return false;
- if ( in_array($post_id, $stickies) )
+ if ( in_array( $post_id, $stickies ) )
return true;
return false;
* when calling filters.
*
* @since 2.3.0
- * @uses apply_filters() Calls 'edit_$field' and '${field_no_prefix}_edit_pre' passing $value and
+ * @uses apply_filters() Calls 'edit_$field' and '{$field_no_prefix}_edit_pre' passing $value and
* $post_id if $context == 'edit' and field name prefix == 'post_'.
*
* @uses apply_filters() Calls 'edit_post_$field' passing $value and $post_id if $context == 'db'.
* @uses apply_filters() Calls 'pre_$field' passing $value if $context == 'db' and field name prefix == 'post_'.
- * @uses apply_filters() Calls '${field}_pre' passing $value if $context == 'db' and field name prefix != 'post_'.
+ * @uses apply_filters() Calls '{$field}_pre' passing $value if $context == 'db' and field name prefix != 'post_'.
*
* @uses apply_filters() Calls '$field' passing $value, $post_id and $context if $context == anything
* other than 'raw', 'edit' and 'db' and field name prefix == 'post_'.
$format_to_edit = array('post_content', 'post_excerpt', 'post_title', 'post_password');
if ( $prefixed ) {
- $value = apply_filters("edit_$field", $value, $post_id);
+ $value = apply_filters("edit_{$field}", $value, $post_id);
// Old school
- $value = apply_filters("${field_no_prefix}_edit_pre", $value, $post_id);
+ $value = apply_filters("{$field_no_prefix}_edit_pre", $value, $post_id);
} else {
- $value = apply_filters("edit_post_$field", $value, $post_id);
+ $value = apply_filters("edit_post_{$field}", $value, $post_id);
}
if ( in_array($field, $format_to_edit) ) {
}
} else if ( 'db' == $context ) {
if ( $prefixed ) {
- $value = apply_filters("pre_$field", $value);
- $value = apply_filters("${field_no_prefix}_save_pre", $value);
+ $value = apply_filters("pre_{$field}", $value);
+ $value = apply_filters("{$field_no_prefix}_save_pre", $value);
} else {
- $value = apply_filters("pre_post_$field", $value);
- $value = apply_filters("${field}_pre", $value);
+ $value = apply_filters("pre_post_{$field}", $value);
+ $value = apply_filters("{$field}_pre", $value);
}
} else {
// Use display filters by default.
if ( $prefixed )
$value = apply_filters($field, $value, $post_id, $context);
else
- $value = apply_filters("post_$field", $value, $post_id, $context);
+ $value = apply_filters("post_{$field}", $value, $post_id, $context);
}
if ( 'attribute' == $context )
*
* @since 2.5.0
*
- * @param string|array $mime_types List of mime types or comma separated string of mime types.
+ * @param string|array $post_mime_types List of mime types or comma separated string of mime types.
* @param string $table_alias Optional. Specify a table alias, if needed.
* @return string The SQL AND clause for mime searching.
*/
* @uses do_action() on 'trashed_post' after trashing
* @uses wp_delete_post() if trash is disabled
*
- * @param int $postid Post ID.
+ * @param int $post_id Post ID.
* @return mixed False on failure
*/
function wp_trash_post($post_id = 0) {
* @uses do_action() on 'untrash_post' before undeletion
* @uses do_action() on 'untrashed_post' after undeletion
*
- * @param int $postid Post ID.
+ * @param int $post_id Post ID.
* @return mixed False on failure
*/
function wp_untrash_post($post_id = 0) {
* Retrieve number of recent posts.
*
* @since 1.0.0
- * @uses $wpdb
+ * @uses wp_parse_args()
+ * @uses get_posts()
*
- * @param int $num Optional, default is 10. Number of posts to get.
- * @return array List of posts.
+ * @param string $deprecated Deprecated.
+ * @param array $args Optional. Overrides defaults.
+ * @param string $output Optional.
+ * @return unknown.
*/
-function wp_get_recent_posts($num = 10) {
- global $wpdb;
+function wp_get_recent_posts( $args = array(), $output = ARRAY_A ) {
+
+ if ( is_numeric( $args ) ) {
+ _deprecated_argument( __FUNCTION__, '3.1', __( 'Passing an integer number of posts is deprecated. Pass an array of arguments instead.' ) );
+ $args = array( 'numberposts' => absint( $args ) );
+ }
+
+ // Set default arguments
+ $defaults = array(
+ 'numberposts' => 10, 'offset' => 0,
+ 'category' => 0, 'orderby' => 'post_date',
+ 'order' => 'DESC', 'include' => '',
+ 'exclude' => '', 'meta_key' => '',
+ 'meta_value' =>'', 'post_type' => 'post', 'post_status' => 'draft, publish, future, pending, private',
+ 'suppress_filters' => true
+ );
+
+ $r = wp_parse_args( $args, $defaults );
- // Set the limit clause, if we got a limit
- $num = (int) $num;
- if ( $num ) {
- $limit = "LIMIT $num";
+ $results = get_posts( $r );
+
+ // Backward compatibility. Prior to 3.1 expected posts to be returned in array
+ if ( ARRAY_A == $output ){
+ foreach( $results as $key => $result ) {
+ $results[$key] = get_object_vars( $result );
+ }
+ return $results ? $results : array();
}
- $sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'post' AND post_status IN ( 'draft', 'publish', 'future', 'pending', 'private' ) ORDER BY post_date DESC $limit";
- $result = $wpdb->get_results($sql, ARRAY_A);
+ return $results ? $results : false;
- return $result ? $result : array();
}
/**
$post = get_post($postid, $mode);
- if (
+ if (
( OBJECT == $mode && empty( $post->ID ) ) ||
( OBJECT != $mode && empty( $post['ID'] ) )
)
* 'post_excerpt' - Post excerpt.
*
* @since 1.0.0
- * @link http://core.trac.wordpress.org/ticket/9084 Bug report on 'wp_insert_post_data' filter.
* @uses $wpdb
* @uses $wp_rewrite
* @uses $user_ID
- *
* @uses do_action() Calls 'pre_post_update' on post ID if this is an update.
* @uses do_action() Calls 'edit_post' action on post ID and post data if this is an update.
- * @uses do_action() Calls 'save_post' and 'wp_insert_post' on post id and post data just before
- * returning.
- *
- * @uses apply_filters() Calls 'wp_insert_post_data' passing $data, $postarr prior to database
- * update or insert.
+ * @uses do_action() Calls 'save_post' and 'wp_insert_post' on post id and post data just before returning.
+ * @uses apply_filters() Calls 'wp_insert_post_data' passing $data, $postarr prior to database update or insert.
* @uses wp_transition_post_status()
*
- * @param array $postarr Optional. Overrides defaults.
+ * @param array $postarr Elements that make up post to insert.
* @param bool $wp_error Optional. Allow return of WP_Error on failure.
* @return int|WP_Error The value 0 or WP_Error on failure. The post ID on success.
*/
-function wp_insert_post($postarr = array(), $wp_error = false) {
+function wp_insert_post($postarr, $wp_error = false) {
global $wpdb, $wp_rewrite, $user_ID;
$defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID,
else
$post_parent = 0;
- if ( !empty($post_ID) ) {
- if ( $post_parent == $post_ID ) {
- // Post can't be its own parent
- $post_parent = 0;
- } elseif ( !empty($post_parent) ) {
- $parent_post = get_post($post_parent);
- // Check for circular dependency
- if ( isset( $parent_post->post_parent ) && $parent_post->post_parent == $post_ID )
- $post_parent = 0;
- }
- }
+ // Check the post_parent to see if it will cause a hierarchy loop
+ $post_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, compact( array_keys( $postarr ) ), $postarr );
if ( isset($menu_order) )
$menu_order = (int) $menu_order;
/**
* Computes a unique slug for the post, when given the desired slug and some post details.
*
+ * @since 2.8.0
+ *
* @global wpdb $wpdb
* @global WP_Rewrite $wp_rewrite
* @param string $slug the desired slug (post_name)
$check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND ID != %d LIMIT 1";
$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_ID ) );
- if ( $post_name_check || in_array( $slug, $feeds ) ) {
+ if ( $post_name_check || in_array( $slug, $feeds ) || apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $slug ) ) {
$suffix = 2;
do {
$alt_post_name = substr ($slug, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
$check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode( "', '", esc_sql( $hierarchical_post_types ) ) . "' ) AND ID != %d AND post_parent = %d LIMIT 1";
$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_ID, $post_parent ) );
- if ( $post_name_check || in_array( $slug, $feeds ) || preg_match( '@^(page)?\d+$@', $slug ) ) {
+ if ( $post_name_check || in_array( $slug, $feeds ) || preg_match( "@^($wp_rewrite->pagination_base)?\d+$@", $slug ) || apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent ) ) {
$suffix = 2;
do {
$alt_post_name = substr( $slug, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
$check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1";
$post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID ) );
- if ( $post_name_check || in_array( $slug, $feeds ) ) {
+ if ( $post_name_check || in_array( $slug, $feeds ) || apply_filters( 'wp_unique_post_slug_is_bad_flat_slug', false, $slug, $post_type ) ) {
$suffix = 2;
do {
$alt_post_name = substr( $slug, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
* @param int $post_id Post ID.
* @param string $tags The tags to set for the post, separated by commas.
* @param bool $append If true, don't delete existing tags, just add on. If false, replace the tags with the new tags.
- * @return bool|null Will return false if $post_id is not an integer or is 0. Will return null otherwise
+ * @return mixed Array of affected term IDs. WP_Error or false on failure.
*/
function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) {
return wp_set_post_terms( $post_id, $tags, 'post_tag', $append);
* @param int $post_id Post ID.
* @param string $tags The tags to set for the post, separated by commas.
* @param bool $append If true, don't delete existing tags, just add on. If false, replace the tags with the new tags.
- * @return bool|null Will return false if $post_id is not an integer or is 0. Will return null otherwise
+ * @return mixed Array of affected term IDs. WP_Error or false on failure.
*/
function wp_set_post_terms( $post_id = 0, $tags = '', $taxonomy = 'post_tag', $append = false ) {
$post_id = (int) $post_id;
$tags = array_unique( $tags );
}
- wp_set_object_terms($post_id, $tags, $taxonomy, $append);
+ return wp_set_object_terms($post_id, $tags, $taxonomy, $append);
}
/**
*
* @uses do_action() Calls 'transition_post_status' on $new_status, $old_status and
* $post if there is a status change.
- * @uses do_action() Calls '${old_status}_to_$new_status' on $post if there is a status change.
- * @uses do_action() Calls '${new_status}_$post->post_type' on post ID and $post.
+ * @uses do_action() Calls '{$old_status}_to_{$new_status}' on $post if there is a status change.
+ * @uses do_action() Calls '{$new_status}_{$post->post_type}' on post ID and $post.
*
* @param string $new_status Transition to this post status.
* @param string $old_status Previous post status.
*/
function wp_transition_post_status($new_status, $old_status, $post) {
do_action('transition_post_status', $new_status, $old_status, $post);
- do_action("${old_status}_to_$new_status", $post);
- do_action("${new_status}_$post->post_type", $post->ID, $post);
+ do_action("{$old_status}_to_{$new_status}", $post);
+ do_action("{$new_status}_{$post->post_type}", $post->ID, $post);
}
//
$pung[] = trim( $enclosure[ 0 ] );
}
}
- $pung = apply_filters('get_enclosed', $pung);
+ $pung = apply_filters('get_enclosed', $pung, $post_id);
return $pung;
}
*/
function get_page_by_path($page_path, $output = OBJECT, $post_type = 'page') {
global $wpdb;
+ $null = null;
$page_path = rawurlencode(urldecode($page_path));
$page_path = str_replace('%2F', '/', $page_path);
$page_path = str_replace('%20', ' ', $page_path);
$pages = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = %s AND (post_type = %s OR post_type = 'attachment')", $leaf_path, $post_type ));
if ( empty($pages) )
- return null;
+ return $null;
foreach ( $pages as $page ) {
$path = '/' . $leaf_path;
$curpage = $page;
while ( $curpage->post_parent != 0 ) {
- $curpage = $wpdb->get_row( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = %d and post_type = %s", $curpage->post_parent, $post_type ));
+ $post_parent = $curpage->post_parent;
+ $curpage = wp_cache_get( $post_parent, 'posts' );
+ if ( false === $curpage )
+ $curpage = $wpdb->get_row( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE ID = %d and post_type = %s", $post_parent, $post_type ) );
$path = '/' . $curpage->post_name . $path;
}
return get_page($page->ID, $output, $post_type);
}
- return null;
+ return $null;
}
/**
*
* @since 2.0.0
*
- * @param array $posts Posts array.
- * @param int $parent Parent page ID.
+ * @param array $pages Posts array.
+ * @param int $page_id Parent page ID.
* @return array A list arranged by hierarchy. Children immediately follow their parents.
*/
function &get_page_hierarchy( &$pages, $page_id = 0 ) {
-
if ( empty( $pages ) ) {
$result = array();
return $result;
$children = array();
foreach ( (array) $pages as $p ) {
-
$parent_id = intval( $p->post_parent );
$children[ $parent_id ][] = $p;
- }
+ }
- $result = array();
- _page_traverse_name( $page_id, $children, $result );
+ $result = array();
+ _page_traverse_name( $page_id, $children, $result );
return $result;
}
* function to traverse and return all the nested children post names of a root page.
* $children contains parent-chilren relations
*
+ * @since 2.9.0
*/
function _page_traverse_name( $page_id, &$children, &$result ){
-
if ( isset( $children[ $page_id ] ) ){
-
foreach( (array)$children[ $page_id ] as $child ) {
-
$result[ $child->ID ] = $child->post_name;
_page_traverse_name( $child->ID, $children, $result );
}
*
* @param string|array $object Arguments to override defaults.
* @param string $file Optional filename.
- * @param int $post_parent Parent post ID.
+ * @param int $parent Parent post ID.
* @return int Attachment ID.
*/
function wp_insert_attachment($object, $file = false, $parent = 0) {
* @uses $wpdb
* @uses do_action() Calls 'delete_attachment' hook on Attachment ID.
*
- * @param int $postid Attachment ID.
+ * @param int $post_id Attachment ID.
* @param bool $force_delete Whether to bypass trash and force deletion. Defaults to false.
* @return mixed False on failure. Post data on success.
*/
foreach ( $backup_sizes as $size ) {
$del_file = path_join( dirname($meta['file']), $size['file'] );
$del_file = apply_filters('wp_delete_file', $del_file);
- @ unlink( path_join($uploadpath['basedir'], $del_file) );
+ @ unlink( path_join($uploadpath['basedir'], $del_file) );
}
}
if ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) { //Get upload directory
if ( 0 === strpos($file, $uploads['basedir']) ) //Check that the upload base exists in the file location
$url = str_replace($uploads['basedir'], $uploads['baseurl'], $file); //replace file location with url location
- elseif ( false !== strpos($file, 'wp-content/uploads') )
- $url = $uploads['baseurl'] . substr( $file, strpos($file, 'wp-content/uploads') + 18 );
- else
- $url = $uploads['baseurl'] . "/$file"; //Its a newly uploaded file, therefor $file is relative to the basedir.
+ elseif ( false !== strpos($file, 'wp-content/uploads') )
+ $url = $uploads['baseurl'] . substr( $file, strpos($file, 'wp-content/uploads') + 18 );
+ else
+ $url = $uploads['baseurl'] . "/$file"; //Its a newly uploaded file, therefor $file is relative to the basedir.
}
}
if ( empty($url) ) //If any of the above options failed, Fallback on the GUID as used pre-2.7, not recomended to rely upon this.
$url = get_the_guid( $post->ID );
- if ( 'attachment' != $post->post_type || empty($url) )
+ $url = apply_filters( 'wp_get_attachment_url', $url, $post->ID );
+
+ if ( 'attachment' != $post->post_type || empty( $url ) )
return false;
- return apply_filters( 'wp_get_attachment_url', $url, $post->ID );
+ return $url;
}
/**
}
/**
- * Checked for changed slugs for published posts and save old slug.
+ * Checked for changed slugs for published post objects and save the old slug.
*
- * The function is used along with form POST data. It checks for the wp-old-slug
- * POST field. Will only be concerned with published posts and the slug actually
- * changing.
+ * The function is used when a post object of any type is updated,
+ * by comparing the current and previous post objects.
*
* If the slug was changed and not already part of the old slugs then it will be
* added to the post meta field ('_wp_old_slug') for storing old slugs for that
* post.
*
- * The most logically usage of this function is redirecting changed posts, so
+ * The most logically usage of this function is redirecting changed post objects, so
* that those that linked to an changed post will be redirected to the new post.
*
* @since 2.1.0
*
* @param int $post_id Post ID.
+ * @param object $post The Post Object
+ * @param object $post_before The Previous Post Object
* @return int Same as $post_id
*/
function wp_check_for_changed_slugs($post_id, $post, $post_before) {
if ( $post->post_name == $post_before->post_name )
return;
- // we're only concerned with published posts
- if ( $post->post_status != 'publish' || $post->post_type != 'post' )
+ // we're only concerned with published, non-hierarchical objects
+ if ( $post->post_status != 'publish' || is_post_type_hierarchical( $post->post_type ) )
return;
$old_slugs = (array) get_post_meta($post_id, '_wp_old_slug');
// if we haven't added this old slug before, add it now
- if ( !in_array($post_before->post_name, $old_slugs) )
+ if ( !empty( $post_before->post_name ) && !in_array($post_before->post_name, $old_slugs) )
add_post_meta($post_id, '_wp_old_slug', $post_before->post_name);
// if the new slug was used previously, delete it from the list
*
* @since 0.71
*
- * @uses $wpdb
- * @uses $blog_id
* @uses apply_filters() Calls 'get_lastpostdate' filter
*
- * @global mixed $cache_lastpostdate Stores the last post date
- * @global mixed $pagenow The current page being viewed
- *
* @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
* @return string The date of the last post.
*/
function get_lastpostdate($timezone = 'server') {
- global $cache_lastpostdate, $wpdb, $blog_id;
- $add_seconds_server = date('Z');
- if ( !isset($cache_lastpostdate[$blog_id][$timezone]) ) {
- switch(strtolower($timezone)) {
- case 'gmt':
- $lastpostdate = $wpdb->get_var("SELECT post_date_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_date_gmt DESC LIMIT 1");
- break;
- case 'blog':
- $lastpostdate = $wpdb->get_var("SELECT post_date FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_date_gmt DESC LIMIT 1");
- break;
- case 'server':
- $lastpostdate = $wpdb->get_var("SELECT DATE_ADD(post_date_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_date_gmt DESC LIMIT 1");
- break;
- }
- $cache_lastpostdate[$blog_id][$timezone] = $lastpostdate;
- } else {
- $lastpostdate = $cache_lastpostdate[$blog_id][$timezone];
- }
- return apply_filters( 'get_lastpostdate', $lastpostdate, $timezone );
+ return apply_filters( 'get_lastpostdate', _get_last_post_time( $timezone, 'date' ), $timezone );
}
/**
* 'gmt' is when the last post was modified in GMT time.
*
* @since 1.2.0
- * @uses $wpdb
- * @uses $blog_id
* @uses apply_filters() Calls 'get_lastpostmodified' filter
*
* @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
* @return string The date the post was last modified.
*/
function get_lastpostmodified($timezone = 'server') {
+ $lastpostmodified = _get_last_post_time( $timezone, 'modified' );
+
+ $lastpostdate = get_lastpostdate($timezone);
+ if ( $lastpostdate > $lastpostmodified )
+ $lastpostmodified = $lastpostdate;
+
+ return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone );
+}
+
+/**
+ * Retrieve latest post date data based on timezone.
+ *
+ * @access private
+ * @since 3.1.0
+ *
+ * @param string $timezone The location to get the time. Can be 'gmt', 'blog', or 'server'.
+ * @param string $field Field to check. Can be 'date' or 'modified'.
+ * @return string The date.
+ */
+function _get_last_post_time( $timezone, $field ) {
global $wpdb;
- $add_seconds_server = date('Z');
+ if ( !in_array( $field, array( 'date', 'modified' ) ) )
+ return false;
+
$timezone = strtolower( $timezone );
- $lastpostmodified = wp_cache_get( "lastpostmodified:$timezone", 'timeinfo' );
- if ( $lastpostmodified )
- return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone );
+ $key = "lastpost{$field}:$timezone";
- switch ( strtolower($timezone) ) {
- case 'gmt':
- $lastpostmodified = $wpdb->get_var("SELECT post_modified_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_modified_gmt DESC LIMIT 1");
- break;
- case 'blog':
- $lastpostmodified = $wpdb->get_var("SELECT post_modified FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_modified_gmt DESC LIMIT 1");
- break;
- case 'server':
- $lastpostmodified = $wpdb->get_var("SELECT DATE_ADD(post_modified_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_modified_gmt DESC LIMIT 1");
- break;
- }
+ $date = wp_cache_get( $key, 'timeinfo' );
- $lastpostdate = get_lastpostdate($timezone);
- if ( $lastpostdate > $lastpostmodified )
- $lastpostmodified = $lastpostdate;
+ if ( !$date ) {
+ $add_seconds_server = date('Z');
- if ( $lastpostmodified )
- wp_cache_set( "lastpostmodified:$timezone", $lastpostmodified, 'timeinfo' );
+ $post_types = get_post_types( array( 'publicly_queryable' => true ) );
+ array_walk( $post_types, array( &$wpdb, 'escape_by_ref' ) );
+ $post_types = "'" . implode( "', '", $post_types ) . "'";
- return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone );
+ switch ( $timezone ) {
+ case 'gmt':
+ $date = $wpdb->get_var("SELECT post_{$field}_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1");
+ break;
+ case 'blog':
+ $date = $wpdb->get_var("SELECT post_{$field} FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1");
+ break;
+ case 'server':
+ $date = $wpdb->get_var("SELECT DATE_ADD(post_{$field}_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1");
+ break;
+ }
+
+ if ( $date )
+ wp_cache_set( $key, $date, 'timeinfo' );
+ }
+
+ return $date;
}
/**
$id = (int) $id;
+ if ( 0 === $id )
+ return;
+
wp_cache_delete($id, 'posts');
wp_cache_delete($id, 'post_meta');
do_action('clean_post_cache', $id);
if ( $children = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d", $id) ) ) {
- foreach( $children as $cid )
+ foreach ( $children as $cid ) {
+ // Loop detection
+ if ( $cid == $id )
+ continue;
clean_post_cache( $cid );
+ }
}
if ( is_multisite() )
if ( empty($post_type) )
$post_type = 'post';
- if ( !is_array($post_type) && 'any' != $post_type && $update_term_cache )
- update_object_term_cache($post_ids, $post_type);
+ if ( $update_term_cache ) {
+ if ( is_array($post_type) ) {
+ $ptypes = $post_type;
+ } elseif ( 'any' == $post_type ) {
+ // Just use the post_types in the supplied posts.
+ foreach ( $posts as $post )
+ $ptypes[] = $post->post_type;
+ $ptypes = array_unique($ptypes);
+ } else {
+ $ptypes = array($post_type);
+ }
+
+ if ( ! empty($ptypes) )
+ update_object_term_cache($post_ids, $ptypes);
+ }
if ( $update_meta_cache )
update_postmeta_cache($post_ids);
// If published posts changed clear the lastpostmodified cache
if ( 'publish' == $new_status || 'publish' == $old_status) {
- wp_cache_delete( 'lastpostmodified:server', 'timeinfo' );
- wp_cache_delete( 'lastpostmodified:gmt', 'timeinfo' );
- wp_cache_delete( 'lastpostmodified:blog', 'timeinfo' );
+ foreach ( array( 'server', 'gmt', 'blog' ) as $timezone ) {
+ wp_cache_delete( "lastpostmodified:$timezone", 'timeinfo' );
+ wp_cache_delete( "lastpostdate:$timezone", 'timeinfo' );
+ }
}
// Always clears the hook in case the post status bounced from future to draft.
* complete. The post parent will be an ancestor and the parent of the post
* parent will be an ancestor. There will only be two ancestors at the most.
*
- * @since unknown
+ * @since 2.5.0
* @access private
* @uses $wpdb
*
$id = $_post->ancestors[] = $_post->post_parent;
while ( $ancestor = $wpdb->get_var( $wpdb->prepare("SELECT `post_parent` FROM $wpdb->posts WHERE ID = %d LIMIT 1", $id) ) ) {
- if ( $id == $ancestor )
+ // Loop detection: If the ancestor has been seen before, break.
+ if ( ( $ancestor == $_post->ID ) || in_array($ancestor, $_post->ancestors) )
break;
$id = $_post->ancestors[] = $ancestor;
}
* @uses wp_delete_post()
*
* @param int|object $revision_id Revision ID or revision object.
- * @param array $fields Optional. What fields to restore from. Defaults to all.
- * @return mixed Null if error, false if no fields to restore, (int) post ID if success.
+ * @return mixed Null or WP_Error if error, deleted post if success.
*/
function wp_delete_post_revision( $revision_id ) {
if ( !$revision = wp_get_post_revision( $revision_id ) )
add_filter('the_preview', '_set_preview');
}
}
+
+/**
+ * Returns the post's parent's post_ID
+ *
+ * @since 3.1.0
+ *
+ * @param int $post_id
+ *
+ * @return int|bool false on error
+ */
+function wp_get_post_parent_id( $post_ID ) {
+ $post = get_post( $post_ID );
+ if ( !$post || is_wp_error( $post ) )
+ return false;
+ return (int) $post->post_parent;
+}
+
+/**
+ * Checks the given subset of the post hierarchy for hierarchy loops.
+ * Prevents loops from forming and breaks those that it finds.
+ *
+ * Attached to the wp_insert_post_parent filter.
+ *
+ * @since 3.1.0
+ * @uses wp_find_hierarchy_loop()
+ *
+ * @param int $post_parent ID of the parent for the post we're checking.
+ * @parem int $post_ID ID of the post we're checking.
+ *
+ * @return int The new post_parent for the post.
+ */
+function wp_check_post_hierarchy_for_loops( $post_parent, $post_ID ) {
+ // Nothing fancy here - bail
+ if ( !$post_parent )
+ return 0;
+
+ // New post can't cause a loop
+ if ( empty( $post_ID ) )
+ return $post_parent;
+
+ // Can't be its own parent
+ if ( $post_parent == $post_ID )
+ return 0;
+
+ // Now look for larger loops
+
+ if ( !$loop = wp_find_hierarchy_loop( 'wp_get_post_parent_id', $post_ID, $post_parent ) )
+ return $post_parent; // No loop
+
+ // Setting $post_parent to the given value causes a loop
+ if ( isset( $loop[$post_ID] ) )
+ return 0;
+
+ // There's a loop, but it doesn't contain $post_ID. Break the loop.
+ foreach ( array_keys( $loop ) as $loop_member )
+ wp_update_post( array( 'ID' => $loop_member, 'post_parent' => 0 ) );
+
+ return $post_parent;
+}
+
+/**
+ * Returns an array of post format slugs to their translated and pretty display versions
+ *
+ * @since 3.1.0
+ *
+ * @return array The array of translations
+ */
+function get_post_format_strings() {
+ $strings = array(
+ 'standard' => _x( 'Standard', 'Post format' ), // Special case. any value that evals to false will be considered standard
+ 'aside' => _x( 'Aside', 'Post format' ),
+ 'chat' => _x( 'Chat', 'Post format' ),
+ 'gallery' => _x( 'Gallery', 'Post format' ),
+ 'link' => _x( 'Link', 'Post format' ),
+ 'image' => _x( 'Image', 'Post format' ),
+ 'quote' => _x( 'Quote', 'Post format' ),
+ 'status' => _x( 'Status', 'Post format' ),
+ 'video' => _x( 'Video', 'Post format' ),
+ 'audio' => _x( 'Audio', 'Post format' ),
+ );
+ return $strings;
+}
+
+/**
+ * Retrieves an array of post format slugs.
+ *
+ * @since 3.1.0
+ *
+ * @return array The array of post format slugs.
+ */
+function get_post_format_slugs() {
+ // 3.2-early: use array_combine() and array_keys( get_post_format_strings() )
+ $slugs = array(
+ 'standard' => 'standard', // Special case. any value that evals to false will be considered standard
+ 'aside' => 'aside',
+ 'chat' => 'chat',
+ 'gallery' => 'gallery',
+ 'link' => 'link',
+ 'image' => 'image',
+ 'quote' => 'quote',
+ 'status' => 'status',
+ 'video' => 'video',
+ 'audio' => 'audio',
+ );
+ return $slugs;
+}
+
+/**
+ * Returns a pretty, translated version of a post format slug
+ *
+ * @since 3.1.0
+ *
+ * @param string $slug A post format slug
+ * @return string The translated post format name
+ */
+function get_post_format_string( $slug ) {
+ $strings = get_post_format_strings();
+ if ( !$slug )
+ return $strings['standard'];
+ else
+ return ( isset( $strings[$slug] ) ) ? $strings[$slug] : '';
+}
+
+/**
+ * Sets a post thumbnail.
+ *
+ * @since 3.1.0
+ *
+ * @param int|object $post Post ID or object where thumbnail should be attached.
+ * @param int $thumbnail_id Thumbnail to attach.
+ * @return bool True on success, false on failure.
+ */
+function set_post_thumbnail( $post, $thumbnail_id ) {
+ $post = get_post( $post );
+ $thumbnail_id = absint( $thumbnail_id );
+ if ( $post && $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 );
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
+ * Returns a link to a post format index.
+ *
+ * @since 3.1.0
+ *
+ * @param $format string Post format
+ * @return string Link
+ */
+function get_post_format_link( $format ) {
+ $term = get_term_by('slug', 'post-format-' . $format, 'post_format' );
+ if ( ! $term || is_wp_error( $term ) )
+ return false;
+ return get_term_link( $term );
+}
+
+/**
+ * Filters the request to allow for the format prefix.
+ *
+ * @access private
+ * @since 3.1.0
+ */
+function _post_format_request( $qvs ) {
+ if ( ! isset( $qvs['post_format'] ) )
+ return $qvs;
+ $slugs = get_post_format_slugs();
+ if ( isset( $slugs[ $qvs['post_format'] ] ) )
+ $qvs['post_format'] = 'post-format-' . $slugs[ $qvs['post_format'] ];
+ $tax = get_taxonomy( 'post_format' );
+ $qvs['post_type'] = $tax->object_type;
+ return $qvs;
+}
+add_filter( 'request', '_post_format_request' );
+
+/**
+ * Filters the post format term link to remove the format prefix.
+ *
+ * @access private
+ * @since 3.1.0
+ */
+function _post_format_link( $link, $term, $taxonomy ) {
+ global $wp_rewrite;
+ if ( 'post_format' != $taxonomy )
+ return $link;
+ if ( $wp_rewrite->get_extra_permastruct( $taxonomy ) ) {
+ return str_replace( "/{$term->slug}", '/' . str_replace( 'post-format-', '', $term->slug ), $link );
+ } else {
+ $link = remove_query_arg( 'post_format', $link );
+ return add_query_arg( 'post_format', str_replace( 'post-format-', '', $term->slug ), $link );
+ }
+}
+add_filter( 'term_link', '_post_format_link', 10, 3 );
+
+/**
+ * Remove the post format prefix from the name property of the term object created by get_term().
+ *
+ * @access private
+ * @since 3.1.0
+ */
+function _post_format_get_term( $term ) {
+ if ( isset( $term->slug ) ) {
+ $term->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
+ }
+ return $term;
+}
+add_filter( 'get_post_format', '_post_format_get_term' );
+
+/**
+ * Remove the post format prefix from the name property of the term objects created by get_terms().
+ *
+ * @access private
+ * @since 3.1.0
+ */
+function _post_format_get_terms( $terms, $taxonomies, $args ) {
+ if ( in_array( 'post_format', (array) $taxonomies ) ) {
+ if ( isset( $args['fields'] ) && 'names' == $args['fields'] ) {
+ foreach( $terms as $order => $name ) {
+ $terms[$order] = get_post_format_string( str_replace( 'post-format-', '', $name ) );
+ }
+ } else {
+ foreach ( (array) $terms as $order => $term ) {
+ if ( isset( $term->taxonomy ) && 'post_format' == $term->taxonomy ) {
+ $terms[$order]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
+ }
+ }
+ }
+ }
+ return $terms;
+}
+add_filter( 'get_terms', '_post_format_get_terms', 10, 3 );
+
+/**
+ * Remove the post format prefix from the name property of the term objects created by wp_get_object_terms().
+ *
+ * @access private
+ * @since 3.1.0
+ */
+function _post_format_wp_get_object_terms( $terms ) {
+ foreach ( (array) $terms as $order => $term ) {
+ if ( isset( $term->taxonomy ) && 'post_format' == $term->taxonomy ) {
+ $terms[$order]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
+ }
+ }
+ return $terms;
+}
+add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' );
+
+?>
\ No newline at end of file
return $wp_query->get($var);
}
+
+/**
+ * Retrieve the currently-queried object. Wrapper for $wp_query->get_queried_object()
+ *
+ * @uses WP_Query::get_queried_object
+ *
+ * @since 3.1.0
+ * @access public
+ *
+ * @return object
+ */
+function get_queried_object() {
+ global $wp_query;
+ return $wp_query->get_queried_object();
+}
+
+/**
+ * Retrieve ID of the current queried object. Wrapper for $wp_query->get_queried_object_id()
+ *
+ * @uses WP_Query::get_queried_object_id()
+ *
+ * @since 3.1.0
+ * @access public
+ *
+ * @return int
+ */
+function get_queried_object_id() {
+ global $wp_query;
+ return $wp_query->get_queried_object_id();
+}
+
/**
* Set query variable.
*
*/
/**
- * Is query requesting an archive page.
+ * Is the query for an archive page?
*
+ * Month, Year, Category, Author, Post Type archive...
+ *
+ * @see WP_Query::is_archive()
* @since 1.5.0
* @uses $wp_query
*
- * @return bool True if page is archive.
+ * @return bool
*/
function is_archive() {
global $wp_query;
- return $wp_query->is_archive;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_archive();
}
/**
- * Is query requesting an attachment page.
+ * Is the query for a post type archive page?
*
- * @since 2.0.0
+ * @see WP_Query::is_post_type_archive()
+ * @since 3.1.0
* @uses $wp_query
*
- * @return bool True if page is attachment.
+ * @param mixed $post_types Optional. Post type or array of posts types to check against.
+ * @return bool
*/
-function is_attachment() {
+function is_post_type_archive( $post_types = '' ) {
global $wp_query;
- return $wp_query->is_attachment;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_post_type_archive( $post_types );
}
/**
- * Is query requesting an author page.
+ * Is the query for an attachment page?
*
- * If the $author parameter is specified then the check will be expanded to
- * include whether the queried author matches the one given in the parameter.
- * You can match against integers and against strings.
+ * @see WP_Query::is_attachment()
+ * @since 2.0.0
+ * @uses $wp_query
*
- * If matching against an integer, the ID should be used of the author for the
- * test. If the $author is an ID and matches the author page user ID, then
- * 'true' will be returned.
+ * @return bool
+ */
+function is_attachment() {
+ global $wp_query;
+
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_attachment();
+}
+
+/**
+ * Is the query for an author archive page?
*
- * If matching against strings, then the test will be matched against both the
- * nickname and user nicename and will return true on success.
+ * If the $author parameter is specified, this function will additionally
+ * check if the query is for one of the authors specified.
*
+ * @see WP_Query::is_author()
* @since 1.5.0
* @uses $wp_query
*
- * @param string|int $author Optional. Is current page this author.
- * @return bool True if page is author or $author (if set).
+ * @param mixed $author Optional. User ID, nickname, nicename, or array of User IDs, nicknames, and nicenames
+ * @return bool
*/
-function is_author($author = '') {
+function is_author( $author = '' ) {
global $wp_query;
- if ( !$wp_query->is_author )
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
return false;
+ }
- if ( empty($author) )
- return true;
-
- $author_obj = $wp_query->get_queried_object();
-
- $author = (array) $author;
-
- if ( in_array( $author_obj->ID, $author ) )
- return true;
- elseif ( in_array( $author_obj->nickname, $author ) )
- return true;
- elseif ( in_array( $author_obj->user_nicename, $author ) )
- return true;
-
- return false;
+ return $wp_query->is_author( $author );
}
/**
- * Whether current page query contains a category name or given category name.
+ * Is the query for a category archive page?
*
- * The category list can contain category IDs, names, or category slugs. If any
- * of them are part of the query, then it will return true.
+ * If the $category parameter is specified, this function will additionally
+ * check if the query is for one of the categories specified.
*
+ * @see WP_Query::is_category()
* @since 1.5.0
* @uses $wp_query
*
- * @param string|array $category Optional.
+ * @param mixed $category Optional. Category ID, name, slug, or array of Category IDs, names, and slugs.
* @return bool
*/
-function is_category($category = '') {
+function is_category( $category = '' ) {
global $wp_query;
- if ( !$wp_query->is_category )
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
return false;
+ }
- if ( empty($category) )
- return true;
-
- $cat_obj = $wp_query->get_queried_object();
-
- $category = (array) $category;
-
- if ( in_array( $cat_obj->term_id, $category ) )
- return true;
- elseif ( in_array( $cat_obj->name, $category ) )
- return true;
- elseif ( in_array( $cat_obj->slug, $category ) )
- return true;
-
- return false;
+ return $wp_query->is_category( $category );
}
/**
- * Whether the current page query has the given tag slug or contains tag.
+ * Is the query for a tag archive page?
+ *
+ * If the $tag parameter is specified, this function will additionally
+ * check if the query is for one of the tags specified.
*
+ * @see WP_Query::is_tag()
* @since 2.3.0
* @uses $wp_query
*
- * @param string|array $slug Optional. Single tag or list of tags to check for.
+ * @param mixed $slug Optional. Tag slug or array of slugs.
* @return bool
*/
function is_tag( $slug = '' ) {
global $wp_query;
- if ( !$wp_query->is_tag )
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
return false;
+ }
- if ( empty( $slug ) )
- return true;
-
- $tag_obj = $wp_query->get_queried_object();
-
- $slug = (array) $slug;
-
- if ( in_array( $tag_obj->slug, $slug ) )
- return true;
-
- return false;
+ return $wp_query->is_tag( $slug );
}
/**
- * Whether the current query is for the given taxonomy and/or term.
+ * Is the query for a taxonomy archive page?
+ *
+ * If the $taxonomy parameter is specified, this function will additionally
+ * check if the query is for that specific $taxonomy.
*
- * If no taxonomy argument is set, returns true if any taxonomy is queried.
- * If the taxonomy argument is passed but no term argument, returns true
- * if the taxonomy or taxonomies in the argument are being queried.
- * If both taxonomy and term arguments are passed, returns true
- * if the current query is for a term contained in the terms argument
- * which has a taxonomy contained in the taxonomy argument.
+ * If the $term parameter is specified in addition to the $taxonomy parameter,
+ * this function will additionally check if the query is for one of the terms
+ * specified.
*
+ * @see WP_Query::is_tax()
* @since 2.5.0
* @uses $wp_query
*
- * @param string|array $taxonomy Optional. Taxonomy slug or slugs to check in current query.
- * @param int|array|string $term. Optional. A single or array of, The term's ID, Name or Slug
+ * @param mixed $taxonomy Optional. Taxonomy slug or slugs.
+ * @param mixed $term Optional. Term ID, name, slug or array of Term IDs, names, and slugs.
* @return bool
*/
function is_tax( $taxonomy = '', $term = '' ) {
- global $wp_query, $wp_taxonomies;
-
- $queried_object = $wp_query->get_queried_object();
- $tax_array = array_intersect(array_keys($wp_taxonomies), (array) $taxonomy);
- $term_array = (array) $term;
+ global $wp_query;
- if ( !$wp_query->is_tax )
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
return false;
+ }
- if ( empty( $taxonomy ) )
- return true;
-
- if ( empty( $term ) ) // Only a Taxonomy provided
- return isset($queried_object->taxonomy) && count( $tax_array ) && in_array($queried_object->taxonomy, $tax_array);
-
- return isset($queried_object->term_id) &&
- count(array_intersect(
- array($queried_object->term_id, $queried_object->name, $queried_object->slug),
- $term_array
- ));
+ return $wp_query->is_tax( $taxonomy, $term );
}
/**
* Whether the current URL is within the comments popup window.
*
+ * @see WP_Query::is_comments_popup()
* @since 1.5.0
* @uses $wp_query
*
function is_comments_popup() {
global $wp_query;
- return $wp_query->is_comments_popup;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_comments_popup();
}
/**
- * Whether current URL is based on a date.
+ * Is the query for a date archive?
*
+ * @see WP_Query::is_date()
* @since 1.5.0
* @uses $wp_query
*
function is_date() {
global $wp_query;
- return $wp_query->is_date;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_date();
}
/**
- * Whether current blog URL contains a day.
+ * Is the query for a day archive?
*
+ * @see WP_Query::is_day()
* @since 1.5.0
* @uses $wp_query
*
function is_day() {
global $wp_query;
- return $wp_query->is_day;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_day();
}
/**
- * Whether current page query is feed URL.
+ * Is the query for a feed?
*
+ * @see WP_Query::is_feed()
* @since 1.5.0
* @uses $wp_query
*
+ * @param string|array $feeds Optional feed types to check.
* @return bool
*/
-function is_feed() {
+function is_feed( $feeds = '' ) {
global $wp_query;
- return $wp_query->is_feed;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_feed( $feeds );
}
/**
- * Whether current page query is comment feed URL.
+ * Is the query for a comments feed?
*
+ * @see WP_Query::is_comments_feed()
* @since 3.0.0
* @uses $wp_query
*
function is_comment_feed() {
global $wp_query;
- return $wp_query->is_comment_feed;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_comment_feed();
}
/**
- * Whether current page query is the front of the site.
+ * Is the query for the front page of the site?
+ *
+ * This is for what is displayed at your site's main URL.
+ *
+ * Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_on_front'.
+ *
+ * If you set a static page for the front page of your site, this function will return
+ * true when viewing that page.
*
+ * Otherwise the same as @see is_home()
+ *
+ * @see WP_Query::is_front_page()
* @since 2.5.0
* @uses is_home()
* @uses get_option()
* @return bool True, if front of site.
*/
function is_front_page() {
- // most likely case
- if ( 'posts' == get_option('show_on_front') && is_home() )
- return true;
- elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') && is_page(get_option('page_on_front')) )
- return true;
- else
+ global $wp_query;
+
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
return false;
+ }
+
+ return $wp_query->is_front_page();
}
/**
- * Whether current page view is the blog homepage.
+ * Is the query for the blog homepage?
+ *
+ * This is the page which shows the time based blog content of your site.
+ *
+ * Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_for_posts'.
+ *
+ * If you set a static page for the front page of your site, this function will return
+ * true only on the page you set as the "Posts page".
*
- * This is the page which is showing the time based blog content of your site
- * so if you set a static page for the front page of your site then this will
- * only be true on the page which you set as the "Posts page" in Reading Settings.
+ * @see is_front_page()
*
+ * @see WP_Query::is_home()
* @since 1.5.0
* @uses $wp_query
*
function is_home() {
global $wp_query;
- return $wp_query->is_home;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_home();
}
/**
- * Whether current page query contains a month.
+ * Is the query for a month archive?
*
+ * @see WP_Query::is_month()
* @since 1.5.0
* @uses $wp_query
*
function is_month() {
global $wp_query;
- return $wp_query->is_month;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_month();
}
/**
- * Whether query is page or contains given page(s).
+ * Is the query for a single page?
*
- * Calls the function without any parameters will only test whether the current
- * query is of the page type. Either a list or a single item can be tested
- * against for whether the query is a page and also is the value or one of the
- * values in the page parameter.
+ * If the $page parameter is specified, this function will additionally
+ * check if the query is for one of the pages specified.
*
- * The parameter can contain the page ID, page title, or page name. The
- * parameter can also be an array of those three values.
+ * @see is_single()
+ * @see is_singular()
*
+ * @see WP_Query::is_page()
* @since 1.5.0
* @uses $wp_query
*
- * @param mixed $page Either page or list of pages to test against.
+ * @param mixed $page Page ID, title, slug, or array of such.
* @return bool
*/
-function is_page($page = '') {
+function is_page( $page = '' ) {
global $wp_query;
- if ( !$wp_query->is_page )
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
return false;
+ }
- if ( empty($page) )
- return true;
-
- $page_obj = $wp_query->get_queried_object();
-
- $page = (array) $page;
-
- if ( in_array( $page_obj->ID, $page ) )
- return true;
- elseif ( in_array( $page_obj->post_title, $page ) )
- return true;
- else if ( in_array( $page_obj->post_name, $page ) )
- return true;
-
- return false;
+ return $wp_query->is_page( $page );
}
/**
- * Whether query contains multiple pages for the results.
+ * Is the query for paged result and not for the first page?
*
+ * @see WP_Query::is_paged()
* @since 1.5.0
* @uses $wp_query
*
function is_paged() {
global $wp_query;
- return $wp_query->is_paged;
-}
-
-/**
- * Whether the current page was created by a plugin.
- *
- * The plugin can set this by using the global $plugin_page and setting it to
- * true.
- *
- * @since 1.5.0
- * @global bool $plugin_page Used by plugins to tell the query that current is a plugin page.
- *
- * @return bool
- */
-function is_plugin_page() {
- global $plugin_page;
-
- if ( isset($plugin_page) )
- return true;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
- return false;
+ return $wp_query->is_paged();
}
/**
- * Whether the current query is preview of post or page.
+ * Is the query for a post or page preview?
*
+ * @see WP_Query::is_preview()
* @since 2.0.0
* @uses $wp_query
*
function is_preview() {
global $wp_query;
- return $wp_query->is_preview;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_preview();
}
/**
- * Whether the current query post is robots.
+ * Is the query for the robots file?
*
+ * @see WP_Query::is_robots()
* @since 2.1.0
* @uses $wp_query
*
function is_robots() {
global $wp_query;
- return $wp_query->is_robots;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_robots();
}
/**
- * Whether current query is the result of a user search.
+ * Is the query for a search?
*
+ * @see WP_Query::is_search()
* @since 1.5.0
* @uses $wp_query
*
function is_search() {
global $wp_query;
- return $wp_query->is_search;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_search();
}
/**
- * Whether the current page query is single page.
+ * Is the query for a single post?
*
- * The parameter can contain the post ID, post title, or post name. The
- * parameter can also be an array of those three values.
+ * Works for any post type, except attachments and pages
*
- * This applies to other post types, attachments, pages, posts. Just means that
- * the current query has only a single object.
+ * If the $post parameter is specified, this function will additionally
+ * check if the query is for one of the Posts specified.
*
+ * @see is_page()
+ * @see is_singular()
+ *
+ * @see WP_Query::is_single()
* @since 1.5.0
* @uses $wp_query
*
- * @param mixed $post Either post or list of posts to test against.
+ * @param mixed $post Post ID, title, slug, or array of such.
* @return bool
*/
-function is_single($post = '') {
+function is_single( $post = '' ) {
global $wp_query;
- if ( !$wp_query->is_single )
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
return false;
+ }
- if ( empty($post) )
- return true;
-
- $post_obj = $wp_query->get_queried_object();
-
- $post = (array) $post;
-
- if ( in_array( $post_obj->ID, $post ) )
- return true;
- elseif ( in_array( $post_obj->post_title, $post ) )
- return true;
- elseif ( in_array( $post_obj->post_name, $post ) )
- return true;
-
- return false;
+ return $wp_query->is_single( $post );
}
/**
- * Whether is single post, is a page, or is an attachment.
+ * Is the query for a single post of any post type (post, attachment, page, ... )?
+ *
+ * If the $post_types parameter is specified, this function will additionally
+ * check if the query is for one of the Posts Types specified.
+ *
+ * @see is_page()
+ * @see is_single()
*
+ * @see WP_Query::is_singular()
* @since 1.5.0
* @uses $wp_query
*
- * @param string|array $post_types Optional. Post type or types to check in current query.
+ * @param mixed $post_types Optional. Post Type or array of Post Types
* @return bool
*/
-function is_singular($post_types = '') {
+function is_singular( $post_types = '' ) {
global $wp_query;
- if ( empty($post_types) || !$wp_query->is_singular )
- return $wp_query->is_singular;
-
- $post_obj = $wp_query->get_queried_object();
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
- return in_array($post_obj->post_type, (array) $post_types);
+ return $wp_query->is_singular( $post_types );
}
/**
- * Whether the query contains a time.
+ * Is the query for a specific time?
*
+ * @see WP_Query::is_time()
* @since 1.5.0
* @uses $wp_query
*
function is_time() {
global $wp_query;
- return $wp_query->is_time;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_time();
}
/**
- * Whether the query is a trackback.
+ * Is the query for a trackback endpoint call?
*
+ * @see WP_Query::is_trackback()
* @since 1.5.0
* @uses $wp_query
*
function is_trackback() {
global $wp_query;
- return $wp_query->is_trackback;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_trackback();
}
/**
- * Whether the query contains a year.
+ * Is the query for a specific year?
*
+ * @see WP_Query::is_year()
* @since 1.5.0
* @uses $wp_query
*
function is_year() {
global $wp_query;
- return $wp_query->is_year;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_year();
}
/**
- * Whether current page query is a 404 and no results for WordPress query.
+ * Is the query a 404 (returns no results)?
*
+ * @see WP_Query::is_404()
* @since 1.5.0
* @uses $wp_query
*
- * @return bool True, if nothing is found matching WordPress Query.
+ * @return bool
*/
function is_404() {
global $wp_query;
- return $wp_query->is_404;
+ if ( ! isset( $wp_query ) ) {
+ _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
+ return false;
+ }
+
+ return $wp_query->is_404();
}
/*
class WP_Query {
/**
- * Query string
+ * Query vars set by the user
*
* @since 1.5.0
* @access public
- * @var string
+ * @var array
*/
var $query;
/**
- * Query search variables set by the user.
+ * Query vars, after parsing
*
* @since 1.5.0
* @access public
*/
var $query_vars = array();
+ /**
+ * Taxonomy query, as passed to get_tax_sql()
+ *
+ * @since 3.1.0
+ * @access public
+ * @var object WP_Tax_Query
+ */
+ var $tax_query;
+
/**
* Holds the data for a single object that is queried.
*
*
* @since 1.5.0
* @access public
- * @var int
+ * @var object
*/
var $post;
*/
var $is_comments_popup = false;
+ /**
+ * Set if query is paged
+ *
+ * @since 1.5.0
+ * @access public
+ * @var bool
+ */
+ var $is_paged = false;
+
/**
* Set if query is part of administration page.
*
*/
var $is_posts_page = false;
+ /**
+ * Set if query is for a post type archive.
+ *
+ * @since 3.1.0
+ * @access public
+ * @var bool
+ */
+ var $is_post_type_archive = false;
+
+ /**
+ * Whether the tax query has been parsed once.
+ *
+ * @since 3.1.0
+ * @access private
+ * @var bool
+ */
+ var $parsed_tax_query = false;
+
/**
* Resets query flags to false.
*
*/
function init_query_flags() {
$this->is_single = false;
+ $this->is_preview = false;
$this->is_page = false;
$this->is_archive = false;
$this->is_date = false;
$this->is_trackback = false;
$this->is_home = false;
$this->is_404 = false;
+ $this->is_comments_popup = false;
$this->is_paged = false;
$this->is_admin = false;
$this->is_attachment = false;
$this->is_singular = false;
$this->is_robots = false;
$this->is_posts_page = false;
+ $this->is_post_type_archive = false;
}
/**
$this->post_count = 0;
$this->current_post = -1;
$this->in_the_loop = false;
+ unset( $this->request );
+ unset( $this->post );
+ unset( $this->comments );
+ unset( $this->comment );
+ $this->comment_count = 0;
+ $this->current_comment = -1;
+ $this->found_posts = 0;
+ $this->max_num_pages = 0;
+ $this->max_num_comment_pages = 0;
$this->init_query_flags();
}
* @access public
*/
function parse_query_vars() {
- $this->parse_query('');
+ $this->parse_query();
}
/**
, 'preview'
, 's'
, 'sentence'
+ , 'fields'
);
foreach ( $keys as $key ) {
- if ( !isset($array[$key]))
+ if ( !isset($array[$key]) )
$array[$key] = '';
}
'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and');
foreach ( $array_keys as $key ) {
- if ( !isset($array[$key]))
+ if ( !isset($array[$key]) )
$array[$key] = array();
}
return $array;
* @since 1.5.0
* @access public
*
- * @param string|array $query
+ * @param string|array $query Optional query.
*/
- function parse_query($query) {
- if ( !empty($query) || !isset($this->query) ) {
+ function parse_query( $query = '' ) {
+ if ( ! empty( $query ) ) {
$this->init();
- if ( is_array($query) )
- $this->query_vars = $query;
- else
- parse_str($query, $this->query_vars);
- $this->query = $query;
+ $this->query = $this->query_vars = wp_parse_args( $query );
+ } elseif ( ! isset( $this->query ) ) {
+ $this->query = $this->query_vars;
}
$this->query_vars = $this->fill_query_vars($this->query_vars);
} elseif ( '' != $qv['static'] || '' != $qv['pagename'] || !empty($qv['page_id']) ) {
$this->is_page = true;
$this->is_single = false;
- } elseif ( !empty($qv['s']) ) {
- $this->is_search = true;
} else {
- // Look for archive queries. Dates, categories, authors.
+ // Look for archive queries. Dates, categories, authors, search, post type archives.
+
+ if ( !empty($qv['s']) ) {
+ $this->is_search = true;
+ }
if ( '' !== $qv['second'] ) {
$this->is_time = true;
$this->is_date = true;
}
- if ( empty($qv['cat']) || ($qv['cat'] == '0') ) {
- $this->is_category = false;
- } else {
- if ( strpos($qv['cat'], '-') !== false ) {
- $this->is_category = false;
- } else {
- $this->is_category = true;
- }
- }
-
- if ( '' != $qv['category_name'] ) {
- $this->is_category = true;
- }
-
- if ( !is_array($qv['category__in']) || empty($qv['category__in']) ) {
- $qv['category__in'] = array();
- } else {
- $qv['category__in'] = array_map('absint', $qv['category__in']);
- $this->is_category = true;
- }
-
- if ( !is_array($qv['category__not_in']) || empty($qv['category__not_in']) ) {
- $qv['category__not_in'] = array();
- } else {
- $qv['category__not_in'] = array_map('absint', $qv['category__not_in']);
- }
-
- if ( !is_array($qv['category__and']) || empty($qv['category__and']) ) {
- $qv['category__and'] = array();
- } else {
- $qv['category__and'] = array_map('absint', $qv['category__and']);
- $this->is_category = true;
- }
-
- if ( '' != $qv['tag'] )
- $this->is_tag = true;
-
- $qv['tag_id'] = absint($qv['tag_id']);
- if ( !empty($qv['tag_id']) )
- $this->is_tag = true;
-
- if ( !is_array($qv['tag__in']) || empty($qv['tag__in']) ) {
- $qv['tag__in'] = array();
- } else {
- $qv['tag__in'] = array_map('absint', $qv['tag__in']);
- $this->is_tag = true;
- }
-
- if ( !is_array($qv['tag__not_in']) || empty($qv['tag__not_in']) ) {
- $qv['tag__not_in'] = array();
- } else {
- $qv['tag__not_in'] = array_map('absint', $qv['tag__not_in']);
- }
-
- if ( !is_array($qv['tag__and']) || empty($qv['tag__and']) ) {
- $qv['tag__and'] = array();
- } else {
- $qv['tag__and'] = array_map('absint', $qv['tag__and']);
- $this->is_category = true;
- }
-
- if ( !is_array($qv['tag_slug__in']) || empty($qv['tag_slug__in']) ) {
- $qv['tag_slug__in'] = array();
- } else {
- $qv['tag_slug__in'] = array_map('sanitize_title', $qv['tag_slug__in']);
- $this->is_tag = true;
- }
+ $this->parsed_tax_query = false;
+ $this->parse_tax_query( $qv );
- if ( !is_array($qv['tag_slug__and']) || empty($qv['tag_slug__and']) ) {
- $qv['tag_slug__and'] = array();
- } else {
- $qv['tag_slug__and'] = array_map('sanitize_title', $qv['tag_slug__and']);
- $this->is_tag = true;
- }
-
- if ( empty($qv['taxonomy']) || empty($qv['term']) ) {
- $this->is_tax = false;
- foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) {
- if ( $t->query_var && isset($qv[$t->query_var]) && '' != $qv[$t->query_var] ) {
- $qv['taxonomy'] = $taxonomy;
- $qv['term'] = $qv[$t->query_var];
- $this->is_tax = true;
- break;
+ foreach ( $this->tax_query->queries as $tax_query ) {
+ if ( 'IN' == $tax_query['operator'] ) {
+ switch ( $tax_query['taxonomy'] ) {
+ case 'category':
+ $this->is_category = true;
+ break;
+ case 'post_tag':
+ $this->is_tag = true;
+ break;
+ default:
+ $this->is_tax = true;
}
}
- } else {
- $this->is_tax = true;
}
+ unset( $tax_query );
+
+ _parse_meta_query( $qv );
if ( empty($qv['author']) || ($qv['author'] == '0') ) {
$this->is_author = false;
$this->is_author = true;
}
- if ( '' != $qv['author_name'] ) {
+ if ( '' != $qv['author_name'] )
$this->is_author = true;
+
+ if ( !empty( $qv['post_type'] ) && ! is_array( $qv['post_type'] ) ) {
+ $post_type_obj = get_post_type_object( $qv['post_type'] );
+ if ( ! empty( $post_type_obj->has_archive ) )
+ $this->is_post_type_archive = true;
}
- if ( ($this->is_date || $this->is_author || $this->is_category || $this->is_tag || $this->is_tax) )
+ if ( $this->is_post_type_archive || $this->is_date || $this->is_author || $this->is_category || $this->is_tag || $this->is_tax )
$this->is_archive = true;
}
// Correct is_* for page_on_front and page_for_posts
if ( $this->is_home && 'page' == get_option('show_on_front') && get_option('page_on_front') ) {
- $_query = wp_parse_args($query);
+ $_query = wp_parse_args($this->query);
+ // pagename can be set and empty depending on matched rewrite rules. Ignore an empty pagename.
+ if ( isset($_query['pagename']) && '' == $_query['pagename'] )
+ unset($_query['pagename']);
if ( empty($_query) || !array_diff( array_keys($_query), array('preview', 'page', 'paged', 'cpage') ) ) {
$this->is_page = true;
$this->is_home = false;
if ( !empty($qv['post_type']) ) {
if ( is_array($qv['post_type']) )
- $qv['post_type'] = array_map('sanitize_user', $qv['post_type'], array(true));
+ $qv['post_type'] = array_map('sanitize_key', $qv['post_type']);
else
- $qv['post_type'] = sanitize_user($qv['post_type'], true);
+ $qv['post_type'] = sanitize_key($qv['post_type']);
}
if ( !empty($qv['post_status']) )
if ( '404' == $qv['error'] )
$this->set_404();
- if ( !empty($query) )
- do_action_ref_array('parse_query', array(&$this));
+ do_action_ref_array('parse_query', array(&$this));
}
- /**
- * Sets the 404 property and saves whether query is feed.
+ /*
+ * Parses various taxonomy related query vars.
*
- * @since 2.0.0
- * @access public
+ * @access protected
+ * @since 3.1.0
+ *
+ * @param array &$q The query variables
*/
- function set_404() {
- $is_feed = $this->is_feed;
+ function parse_tax_query( &$q ) {
+ if ( ! empty( $q['tax_query'] ) && is_array( $q['tax_query'] ) ) {
+ $tax_query = $q['tax_query'];
+ } else {
+ $tax_query = array();
+ }
- $this->init_query_flags();
- $this->is_404 = true;
+ if ( !empty($q['taxonomy']) && !empty($q['term']) ) {
+ $tax_query[] = array(
+ 'taxonomy' => $q['taxonomy'],
+ 'terms' => array( $q['term'] ),
+ 'field' => 'slug',
+ );
+ }
- $this->is_feed = $is_feed;
- }
+ foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) {
+ if ( $t->query_var && !empty( $q[$t->query_var] ) ) {
+ $tax_query_defaults = array(
+ 'taxonomy' => $taxonomy,
+ 'field' => 'slug',
+ );
- /**
- * Retrieve query variable.
- *
- * @since 1.5.0
- * @access public
- *
- * @param string $query_var Query variable key.
- * @return mixed
- */
- function get($query_var) {
- if ( isset($this->query_vars[$query_var]) )
- return $this->query_vars[$query_var];
+ if ( isset( $t->rewrite['hierarchical'] ) && $t->rewrite['hierarchical'] ) {
+ $q[$t->query_var] = wp_basename( $q[$t->query_var] );
+ }
- return '';
- }
+ $term = $q[$t->query_var];
- /**
- * Set query variable.
- *
- * @since 1.5.0
- * @access public
- *
- * @param string $query_var Query variable key.
- * @param mixed $value Query variable value.
- */
- function set($query_var, $value) {
+ if ( strpos($term, '+') !== false ) {
+ $terms = preg_split( '/[+]+/', $term );
+ foreach ( $terms as $term ) {
+ $tax_query[] = array_merge( $tax_query_defaults, array(
+ 'terms' => array( $term )
+ ) );
+ }
+ } else {
+ $tax_query[] = array_merge( $tax_query_defaults, array(
+ 'terms' => preg_split( '/[,]+/', $term )
+ ) );
+ }
+ }
+ }
+
+ // Category stuff
+ if ( !empty($q['cat']) && '0' != $q['cat'] && !$this->is_singular && !$this->parsed_tax_query ) {
+ $q['cat'] = ''.urldecode($q['cat']).'';
+ $q['cat'] = addslashes_gpc($q['cat']);
+ $cat_array = preg_split('/[,\s]+/', $q['cat']);
+ $q['cat'] = '';
+ $req_cats = array();
+ foreach ( (array) $cat_array as $cat ) {
+ $cat = intval($cat);
+ $req_cats[] = $cat;
+ $in = ($cat > 0);
+ $cat = abs($cat);
+ if ( $in ) {
+ $q['category__in'][] = $cat;
+ $q['category__in'] = array_merge( $q['category__in'], get_term_children($cat, 'category') );
+ } else {
+ $q['category__not_in'][] = $cat;
+ $q['category__not_in'] = array_merge( $q['category__not_in'], get_term_children($cat, 'category') );
+ }
+ }
+ $q['cat'] = implode(',', $req_cats);
+ }
+
+ if ( !empty($q['category__in']) ) {
+ $q['category__in'] = array_map('absint', array_unique( (array) $q['category__in'] ) );
+ $tax_query[] = array(
+ 'taxonomy' => 'category',
+ 'terms' => $q['category__in'],
+ 'field' => 'term_id',
+ 'include_children' => false
+ );
+ }
+
+ if ( !empty($q['category__not_in']) ) {
+ $q['category__not_in'] = array_map('absint', array_unique( (array) $q['category__not_in'] ) );
+ $tax_query[] = array(
+ 'taxonomy' => 'category',
+ 'terms' => $q['category__not_in'],
+ 'operator' => 'NOT IN',
+ 'include_children' => false
+ );
+ }
+
+ if ( !empty($q['category__and']) ) {
+ $q['category__and'] = array_map('absint', array_unique( (array) $q['category__and'] ) );
+ $tax_query[] = array(
+ 'taxonomy' => 'category',
+ 'terms' => $q['category__and'],
+ 'field' => 'term_id',
+ 'operator' => 'AND',
+ 'include_children' => false
+ );
+ }
+
+ // Tag stuff
+ if ( '' != $q['tag'] && !$this->is_singular && !$this->parsed_tax_query ) {
+ if ( strpos($q['tag'], ',') !== false ) {
+ $tags = preg_split('/[,\s]+/', $q['tag']);
+ foreach ( (array) $tags as $tag ) {
+ $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
+ $q['tag_slug__in'][] = $tag;
+ }
+ } else if ( preg_match('/[+\s]+/', $q['tag']) || !empty($q['cat']) ) {
+ $tags = preg_split('/[+\s]+/', $q['tag']);
+ foreach ( (array) $tags as $tag ) {
+ $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
+ $q['tag_slug__and'][] = $tag;
+ }
+ } else {
+ $q['tag'] = sanitize_term_field('slug', $q['tag'], 0, 'post_tag', 'db');
+ $q['tag_slug__in'][] = $q['tag'];
+ }
+ }
+
+ if ( !empty($q['tag_id']) ) {
+ $q['tag_id'] = absint( $q['tag_id'] );
+ $tax_query[] = array(
+ 'taxonomy' => 'post_tag',
+ 'terms' => $q['tag_id']
+ );
+ }
+
+ if ( !empty($q['tag__in']) ) {
+ $q['tag__in'] = array_map('absint', array_unique( (array) $q['tag__in'] ) );
+ $tax_query[] = array(
+ 'taxonomy' => 'post_tag',
+ 'terms' => $q['tag__in']
+ );
+ }
+
+ if ( !empty($q['tag__not_in']) ) {
+ $q['tag__not_in'] = array_map('absint', array_unique( (array) $q['tag__not_in'] ) );
+ $tax_query[] = array(
+ 'taxonomy' => 'post_tag',
+ 'terms' => $q['tag__not_in'],
+ 'operator' => 'NOT IN'
+ );
+ }
+
+ if ( !empty($q['tag__and']) ) {
+ $q['tag__and'] = array_map('absint', array_unique( (array) $q['tag__and'] ) );
+ $tax_query[] = array(
+ 'taxonomy' => 'post_tag',
+ 'terms' => $q['tag__and'],
+ 'operator' => 'AND'
+ );
+ }
+
+ if ( !empty($q['tag_slug__in']) ) {
+ $q['tag_slug__in'] = array_map('sanitize_title', (array) $q['tag_slug__in']);
+ $tax_query[] = array(
+ 'taxonomy' => 'post_tag',
+ 'terms' => $q['tag_slug__in'],
+ 'field' => 'slug'
+ );
+ }
+
+ if ( !empty($q['tag_slug__and']) ) {
+ $q['tag_slug__and'] = array_map('sanitize_title', (array) $q['tag_slug__and']);
+ $tax_query[] = array(
+ 'taxonomy' => 'post_tag',
+ 'terms' => $q['tag_slug__and'],
+ 'field' => 'slug',
+ 'operator' => 'AND'
+ );
+ }
+
+ $this->parsed_tax_query = true;
+
+ $this->tax_query = new WP_Tax_Query( $tax_query );
+ }
+
+ /**
+ * Sets the 404 property and saves whether query is feed.
+ *
+ * @since 2.0.0
+ * @access public
+ */
+ function set_404() {
+ $is_feed = $this->is_feed;
+
+ $this->init_query_flags();
+ $this->is_404 = true;
+
+ $this->is_feed = $is_feed;
+ }
+
+ /**
+ * Retrieve query variable.
+ *
+ * @since 1.5.0
+ * @access public
+ *
+ * @param string $query_var Query variable key.
+ * @return mixed
+ */
+ function get($query_var) {
+ if ( isset($this->query_vars[$query_var]) )
+ return $this->query_vars[$query_var];
+
+ return '';
+ }
+
+ /**
+ * Set query variable.
+ *
+ * @since 1.5.0
+ * @access public
+ *
+ * @param string $query_var Query variable key.
+ * @param mixed $value Query variable value.
+ */
+ function set($query_var, $value) {
$this->query_vars[$query_var] = $value;
}
function &get_posts() {
global $wpdb, $user_ID, $_wp_using_ext_object_cache;
+ $this->parse_query();
+
do_action_ref_array('pre_get_posts', array(&$this));
// Shorthand.
// First let's clear some variables
$distinct = '';
- $whichcat = '';
$whichauthor = '';
$whichmimetype = '';
$where = '';
$join = '';
$search = '';
$groupby = '';
- $fields = "$wpdb->posts.*";
+ $fields = '';
$post_status_join = false;
$page = 1;
- if ( !isset($q['caller_get_posts']) )
- $q['caller_get_posts'] = false;
+ if ( isset( $q['caller_get_posts'] ) ) {
+ _deprecated_argument( 'WP_Query', '3.1', __( '"caller_get_posts" is deprecated. Use "ignore_sticky_posts" instead.' ) );
+ if ( !isset( $q['ignore_sticky_posts'] ) )
+ $q['ignore_sticky_posts'] = $q['caller_get_posts'];
+ }
+
+ if ( !isset( $q['ignore_sticky_posts'] ) )
+ $q['ignore_sticky_posts'] = false;
if ( !isset($q['suppress_filters']) )
$q['suppress_filters'] = false;
else
$q['no_found_rows'] = false;
+ switch ( $q['fields'] ) {
+ case 'ids':
+ $fields = "$wpdb->posts.ID";
+ break;
+ case 'id=>parent':
+ $fields = "$wpdb->posts.ID, $wpdb->posts.post_parent";
+ break;
+ default:
+ $fields = "$wpdb->posts.*";
+ }
+
// If a month is specified in the querystring, load that month
if ( $q['m'] ) {
$q['m'] = '' . preg_replace('|[^0-9]|', '', $q['m']);
}
if ( '' != $q['name'] ) {
- $q['name'] = sanitize_title($q['name']);
+ $q['name'] = sanitize_title_for_query( $q['name'] );
$where .= " AND $wpdb->posts.post_name = '" . $q['name'] . "'";
} elseif ( '' != $q['pagename'] ) {
if ( isset($this->queried_object_id) ) {
$page_for_posts = get_option('page_for_posts');
if ( ('page' != get_option('show_on_front') ) || empty($page_for_posts) || ( $reqpage != $page_for_posts ) ) {
- $q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename'])));
- $page_paths = '/' . trim($q['pagename'], '/');
- $q['pagename'] = sanitize_title(basename($page_paths));
+ $q['pagename'] = sanitize_title_for_query( wp_basename( $q['pagename'] ) );
$q['name'] = $q['pagename'];
$where .= " AND ($wpdb->posts.ID = '$reqpage')";
$reqpage_obj = get_page($reqpage);
}
}
} elseif ( '' != $q['attachment'] ) {
- $q['attachment'] = str_replace('%2F', '/', urlencode(urldecode($q['attachment'])));
- $attach_paths = '/' . trim($q['attachment'], '/');
- $q['attachment'] = sanitize_title(basename($attach_paths));
+ $q['attachment'] = sanitize_title_for_query( wp_basename( $q['attachment'] ) );
$q['name'] = $q['attachment'];
$where .= " AND $wpdb->posts.post_name = '" . $q['attachment'] . "'";
}
$n = !empty($q['exact']) ? '' : '%';
$searchand = '';
foreach( (array) $q['search_terms'] as $term ) {
- $term = addslashes_gpc($term);
+ $term = esc_sql( like_escape( $term ) );
$search .= "{$searchand}(($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}'))";
$searchand = ' AND ';
}
- $term = esc_sql($q['s']);
+ $term = esc_sql( like_escape( $q['s'] ) );
if ( empty($q['sentence']) && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] )
$search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";
// Allow plugins to contextually add/remove/modify the search section of the database query
$search = apply_filters_ref_array('posts_search', array( $search, &$this ) );
- // Category stuff
-
- if ( empty($q['cat']) || ($q['cat'] == '0') ||
- // Bypass cat checks if fetching specific posts
- $this->is_singular ) {
- $whichcat = '';
- } else {
- $q['cat'] = ''.urldecode($q['cat']).'';
- $q['cat'] = addslashes_gpc($q['cat']);
- $cat_array = preg_split('/[,\s]+/', $q['cat']);
- $q['cat'] = '';
- $req_cats = array();
- foreach ( (array) $cat_array as $cat ) {
- $cat = intval($cat);
- $req_cats[] = $cat;
- $in = ($cat > 0);
- $cat = abs($cat);
- if ( $in ) {
- $q['category__in'][] = $cat;
- $q['category__in'] = array_merge($q['category__in'], get_term_children($cat, 'category'));
- } else {
- $q['category__not_in'][] = $cat;
- $q['category__not_in'] = array_merge($q['category__not_in'], get_term_children($cat, 'category'));
- }
- }
- $q['cat'] = implode(',', $req_cats);
- }
+ // Taxonomies
+ $this->parse_tax_query( $q );
- if ( !empty($q['category__in']) ) {
- $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
- $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'category' ";
- $include_cats = "'" . implode("', '", $q['category__in']) . "'";
- $whichcat .= " AND $wpdb->term_taxonomy.term_id IN ($include_cats) ";
- }
+ $clauses = $this->tax_query->get_sql( $wpdb->posts, 'ID' );
- if ( !empty($q['category__not_in']) ) {
- $cat_string = "'" . implode("', '", $q['category__not_in']) . "'";
- $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'category' AND tt.term_id IN ($cat_string) )";
- }
-
- // Category stuff for nice URLs
- if ( '' != $q['category_name'] && !$this->is_singular ) {
- $q['category_name'] = implode('/', array_map('sanitize_title', explode('/', $q['category_name'])));
- $reqcat = get_category_by_path($q['category_name']);
- $q['category_name'] = str_replace('%2F', '/', urlencode(urldecode($q['category_name'])));
- $cat_paths = '/' . trim($q['category_name'], '/');
- $q['category_name'] = sanitize_title(basename($cat_paths));
-
- $cat_paths = '/' . trim(urldecode($q['category_name']), '/');
- $q['category_name'] = sanitize_title(basename($cat_paths));
- $cat_paths = explode('/', $cat_paths);
- $cat_path = '';
- foreach ( (array) $cat_paths as $pathdir )
- $cat_path .= ( $pathdir != '' ? '/' : '' ) . sanitize_title($pathdir);
-
- //if we don't match the entire hierarchy fallback on just matching the nicename
- if ( empty($reqcat) )
- $reqcat = get_category_by_path($q['category_name'], false);
-
- if ( !empty($reqcat) )
- $reqcat = $reqcat->term_id;
- else
- $reqcat = 0;
-
- $q['cat'] = $reqcat;
+ $join .= $clauses['join'];
+ $where .= $clauses['where'];
- $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
- $whichcat = " AND $wpdb->term_taxonomy.taxonomy = 'category' ";
- $in_cats = array($q['cat']);
- $in_cats = array_merge($in_cats, get_term_children($q['cat'], 'category'));
- $in_cats = "'" . implode("', '", $in_cats) . "'";
- $whichcat .= "AND $wpdb->term_taxonomy.term_id IN ($in_cats)";
- $groupby = "{$wpdb->posts}.ID";
- }
-
- // Tags
- if ( '' != $q['tag'] ) {
- if ( strpos($q['tag'], ',') !== false ) {
- $tags = preg_split('/[,\s]+/', $q['tag']);
- foreach ( (array) $tags as $tag ) {
- $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
- $q['tag_slug__in'][] = $tag;
- }
- } else if ( preg_match('/[+\s]+/', $q['tag']) || !empty($q['cat']) ) {
- $tags = preg_split('/[+\s]+/', $q['tag']);
- foreach ( (array) $tags as $tag ) {
- $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
- $q['tag_slug__and'][] = $tag;
- }
- } else {
- $q['tag'] = sanitize_term_field('slug', $q['tag'], 0, 'post_tag', 'db');
- $q['tag_slug__in'][] = $q['tag'];
+ if ( $this->is_tax ) {
+ if ( empty($post_type) ) {
+ $post_type = 'any';
+ $post_status_join = true;
+ } elseif ( in_array('attachment', (array) $post_type) ) {
+ $post_status_join = true;
}
}
- if ( !empty($q['category__in']) || !empty($q['meta_key']) || !empty($q['tag__in']) || !empty($q['tag_slug__in']) ) {
- $groupby = "{$wpdb->posts}.ID";
- }
-
- if ( !empty($q['tag__in']) && empty($q['cat']) ) {
- $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) ";
- $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' ";
- $include_tags = "'" . implode("', '", $q['tag__in']) . "'";
- $whichcat .= " AND $wpdb->term_taxonomy.term_id IN ($include_tags) ";
- $reqtag = term_exists( $q['tag__in'][0], 'post_tag' );
- if ( !empty($reqtag) )
- $q['tag_id'] = $reqtag['term_id'];
- }
-
- if ( !empty($q['tag_slug__in']) && empty($q['cat']) ) {
- $join = " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) INNER JOIN $wpdb->terms ON ($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id) ";
- $whichcat .= " AND $wpdb->term_taxonomy.taxonomy = 'post_tag' ";
- $include_tags = "'" . implode("', '", $q['tag_slug__in']) . "'";
- $whichcat .= " AND $wpdb->terms.slug IN ($include_tags) ";
- $reqtag = get_term_by( 'slug', $q['tag_slug__in'][0], 'post_tag' );
- if ( !empty($reqtag) )
- $q['tag_id'] = $reqtag->term_id;
- }
-
- if ( !empty($q['tag__not_in']) ) {
- $tag_string = "'" . implode("', '", $q['tag__not_in']) . "'";
- $whichcat .= " AND $wpdb->posts.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships AS tr INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'post_tag' AND tt.term_id IN ($tag_string) )";
- }
-
- // Tag and slug intersections.
- $intersections = array('category__and' => 'category', 'tag__and' => 'post_tag', 'tag_slug__and' => 'post_tag', 'tag__in' => 'post_tag', 'tag_slug__in' => 'post_tag');
- $tagin = array('tag__in', 'tag_slug__in'); // These are used to make some exceptions below
- foreach ( $intersections as $item => $taxonomy ) {
- if ( empty($q[$item]) ) continue;
- if ( in_array($item, $tagin) && empty($q['cat']) ) continue; // We should already have what we need if categories aren't being used
+ // Back-compat
+ if ( !empty($this->tax_query->queries) ) {
+ $tax_query_in_and = wp_list_filter( $this->tax_query->queries, array( 'operator' => 'NOT IN' ), 'NOT' );
+ if ( !empty( $tax_query_in_and ) ) {
+ if ( !isset( $q['taxonomy'] ) ) {
+ foreach ( $tax_query_in_and as $a_tax_query ) {
+ if ( !in_array( $a_tax_query['taxonomy'], array( 'category', 'post_tag' ) ) ) {
+ $q['taxonomy'] = $a_tax_query['taxonomy'];
+ if ( 'slug' == $a_tax_query['field'] )
+ $q['term'] = $a_tax_query['terms'][0];
+ else
+ $q['term_id'] = $a_tax_query['terms'][0];
- if ( $item != 'category__and' ) {
- $reqtag = term_exists( $q[$item][0], 'post_tag' );
- if ( !empty($reqtag) )
- $q['tag_id'] = $reqtag['term_id'];
- }
-
- if ( in_array( $item, array('tag_slug__and', 'tag_slug__in' ) ) )
- $taxonomy_field = 'slug';
- else
- $taxonomy_field = 'term_id';
-
- $q[$item] = array_unique($q[$item]);
- $tsql = "SELECT p.ID FROM $wpdb->posts p INNER JOIN $wpdb->term_relationships tr ON (p.ID = tr.object_id) INNER JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) INNER JOIN $wpdb->terms t ON (tt.term_id = t.term_id)";
- $tsql .= " WHERE tt.taxonomy = '$taxonomy' AND t.$taxonomy_field IN ('" . implode("', '", $q[$item]) . "')";
- if ( !in_array($item, $tagin) ) { // This next line is only helpful if we are doing an and relationship
- $tsql .= " GROUP BY p.ID HAVING count(p.ID) = " . count($q[$item]);
- }
- $post_ids = $wpdb->get_col($tsql);
-
- if ( count($post_ids) )
- $whichcat .= " AND $wpdb->posts.ID IN (" . implode(', ', $post_ids) . ") ";
- else {
- $whichcat = " AND 0 = 1";
- break;
- }
- }
-
- // Taxonomies
- if ( $this->is_tax ) {
- if ( '' != $q['taxonomy'] ) {
- $taxonomy = $q['taxonomy'];
- $tt[$taxonomy] = $q['term'];
- } else {
- foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) {
- if ( $t->query_var && '' != $q[$t->query_var] ) {
- $tt[$taxonomy] = $q[$t->query_var];
- break;
+ break;
+ }
}
}
- }
- $terms = get_terms($taxonomy, array('slug' => $tt[$taxonomy], 'hide_empty' => !is_taxonomy_hierarchical($taxonomy)));
-
- if ( is_wp_error($terms) || empty($terms) ) {
- $whichcat = " AND 0 ";
- } else {
- foreach ( $terms as $term ) {
- $term_ids[] = $term->term_id;
- if ( is_taxonomy_hierarchical($taxonomy) ) {
- $children = get_term_children($term->term_id, $taxonomy);
- $term_ids = array_merge($term_ids, $children);
+ $cat_query = wp_list_filter( $tax_query_in_and, array( 'taxonomy' => 'category' ) );
+ if ( !empty( $cat_query ) ) {
+ $cat_query = reset( $cat_query );
+ $the_cat = get_term_by( $cat_query['field'], $cat_query['terms'][0], 'category' );
+ if ( $the_cat ) {
+ $this->set( 'cat', $the_cat->term_id );
+ $this->set( 'category_name', $the_cat->slug );
}
+ unset( $the_cat );
}
- $post_ids = get_objects_in_term($term_ids, $taxonomy);
- if ( !is_wp_error($post_ids) && !empty($post_ids) ) {
- $whichcat .= " AND $wpdb->posts.ID IN (" . implode(', ', $post_ids) . ") ";
- if ( empty($post_type) ) {
- $post_type = 'any';
- $post_status_join = true;
- } elseif ( in_array('attachment', (array)$post_type) ) {
- $post_status_join = true;
+ unset( $cat_query );
+
+ $tag_query = wp_list_filter( $tax_query_in_and, array( 'taxonomy' => 'post_tag' ) );
+ if ( !empty( $tag_query ) ) {
+ $tag_query = reset( $tag_query );
+ $the_tag = get_term_by( $tag_query['field'], $tag_query['terms'][0], 'post_tag' );
+ if ( $the_tag ) {
+ $this->set( 'tag_id', $the_tag->term_id );
}
- } else {
- $whichcat = " AND 0 ";
+ unset( $the_tag );
}
+ unset( $tag_query );
}
}
+ if ( !empty( $this->tax_query->queries ) || !empty( $q['meta_key'] ) ) {
+ $groupby = "{$wpdb->posts}.ID";
+ }
+
// Author/user stuff
if ( empty($q['author']) || ($q['author'] == '0') ) {
$q['author_name'] = $q['author_name'][count($q['author_name'])-2]; // there was a trailling slash
}
}
- $q['author_name'] = sanitize_title($q['author_name']);
+ $q['author_name'] = sanitize_title_for_query( $q['author_name'] );
$q['author'] = get_user_by('slug', $q['author_name']);
if ( $q['author'] )
$q['author'] = $q['author']->ID;
$whichmimetype = wp_post_mime_type_where($q['post_mime_type'], $table_alias);
}
- $where .= $search . $whichcat . $whichauthor . $whichmimetype;
+ $where .= $search . $whichauthor . $whichmimetype;
if ( empty($q['order']) || ((strtoupper($q['order']) != 'ASC') && (strtoupper($q['order']) != 'DESC')) )
$q['order'] = 'DESC';
$q['orderby'] = "$wpdb->posts.post_date ".$q['order'];
}
- if ( is_array($post_type) ) {
+ if ( is_array( $post_type ) ) {
$post_type_cap = 'multiple_post_type';
} else {
- $post_type_object = get_post_type_object ( $post_type );
- if ( !empty($post_type_object) )
- $post_type_cap = $post_type_object->capability_type;
- else
+ $post_type_object = get_post_type_object( $post_type );
+ if ( empty( $post_type_object ) )
$post_type_cap = $post_type;
}
$post_type_object = get_post_type_object ( 'post' );
}
- if ( !empty($post_type_object) ) {
- $post_type_cap = $post_type_object->capability_type;
+ if ( ! empty( $post_type_object ) ) {
$edit_cap = $post_type_object->cap->edit_post;
$read_cap = $post_type_object->cap->read_post;
$edit_others_cap = $post_type_object->cap->edit_others_posts;
$where .= ')';
}
- // postmeta queries
- if ( ! empty($q['meta_key']) || ! empty($q['meta_value']) )
- $join .= " JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) ";
- if ( ! empty($q['meta_key']) )
- $where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_key = %s ", $q['meta_key']);
- if ( ! empty($q['meta_value']) ) {
- if ( empty($q['meta_compare']) || ! in_array($q['meta_compare'], array('=', '!=', '>', '>=', '<', '<=')) )
- $q['meta_compare'] = '=';
-
- $where .= $wpdb->prepare("AND $wpdb->postmeta.meta_value {$q['meta_compare']} %s ", $q['meta_value']);
+ if ( !empty( $q['meta_query'] ) ) {
+ $clauses = call_user_func_array( '_get_meta_sql', array( $q['meta_query'], 'post', $wpdb->posts, 'ID', &$this) );
+ $join .= $clauses['join'];
+ $where .= $clauses['where'];
}
// Apply filters on where and join prior to paging so that any
$orderby = $q['orderby'];
+ $pieces = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
+
// Apply post-paging filters on where and join. Only plugins that
// manipulate paging queries should use these hooks.
if ( !$q['suppress_filters'] ) {
$distinct = apply_filters_ref_array( 'posts_distinct', array( $distinct, &$this ) );
$limits = apply_filters_ref_array( 'post_limits', array( $limits, &$this ) );
$fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) );
+
+ // Filter all clauses at once, for convenience
+ $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );
+ foreach ( $pieces as $piece )
+ $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
}
// Announce current selection parameters. For use by caching plugins.
// Filter again for the benefit of caching plugins. Regular plugins should use the hooks above.
if ( !$q['suppress_filters'] ) {
- $where = apply_filters_ref_array( 'posts_where_request', array( $where, &$this ) );
+ $where = apply_filters_ref_array( 'posts_where_request', array( $where, &$this ) );
$groupby = apply_filters_ref_array( 'posts_groupby_request', array( $groupby, &$this ) );
- $join = apply_filters_ref_array( 'posts_join_request', array( $join, &$this ) );
+ $join = apply_filters_ref_array( 'posts_join_request', array( $join, &$this ) );
$orderby = apply_filters_ref_array( 'posts_orderby_request', array( $orderby, &$this ) );
$distinct = apply_filters_ref_array( 'posts_distinct_request', array( $distinct, &$this ) );
$fields = apply_filters_ref_array( 'posts_fields_request', array( $fields, &$this ) );
$limits = apply_filters_ref_array( 'post_limits_request', array( $limits, &$this ) );
+
+ // Filter all clauses at once, for convenience
+ $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) );
+ foreach ( $pieces as $piece )
+ $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
}
if ( ! empty($groupby) )
$groupby = 'GROUP BY ' . $groupby;
if ( !empty( $orderby ) )
$orderby = 'ORDER BY ' . $orderby;
+
$found_rows = '';
if ( !$q['no_found_rows'] && !empty($limits) )
$found_rows = 'SQL_CALC_FOUND_ROWS';
if ( !$q['suppress_filters'] )
$this->request = apply_filters_ref_array('posts_request', array( $this->request, &$this ) );
+ if ( 'ids' == $q['fields'] ) {
+ $this->posts = $wpdb->get_col($this->request);
+
+ return $this->posts;
+ }
+
+ if ( 'id=>parent' == $q['fields'] ) {
+ $this->posts = $wpdb->get_results($this->request);
+
+ $r = array();
+ foreach ( $this->posts as $post )
+ $r[ $post->ID ] = $post->post_parent;
+
+ return $r;
+ }
+
$this->posts = $wpdb->get_results($this->request);
+
// Raw results filter. Prior to status checks.
if ( !$q['suppress_filters'] )
$this->posts = apply_filters_ref_array('posts_results', array( $this->posts, &$this ) );
// Put sticky posts at the top of the posts array
$sticky_posts = get_option('sticky_posts');
- if ( $this->is_home && $page <= 1 && is_array($sticky_posts) && !empty($sticky_posts) && !$q['caller_get_posts'] ) {
+ if ( $this->is_home && $page <= 1 && is_array($sticky_posts) && !empty($sticky_posts) && !$q['ignore_sticky_posts'] ) {
$num_posts = count($this->posts);
$sticky_offset = 0;
// Loop over posts and relocate stickies to the front.
* @param string $query URL query string.
* @return array List of posts.
*/
- function &query($query) {
- $this->parse_query($query);
+ function &query( $query ) {
+ $this->init();
+ $this->query = $this->query_vars = wp_parse_args( $query );
return $this->get_posts();
}
$this->queried_object = NULL;
$this->queried_object_id = 0;
- if ( $this->is_category ) {
- $cat = $this->get('cat');
- $category = &get_category($cat);
- if ( is_wp_error( $category ) )
- return NULL;
- $this->queried_object = &$category;
- $this->queried_object_id = (int) $cat;
- } elseif ( $this->is_tag ) {
- $tag_id = $this->get('tag_id');
- $tag = &get_term($tag_id, 'post_tag');
- if ( is_wp_error( $tag ) )
- return NULL;
- $this->queried_object = &$tag;
- $this->queried_object_id = (int) $tag_id;
- } elseif ( $this->is_tax ) {
- $tax = $this->get('taxonomy');
- $slug = $this->get('term');
- $term = &get_terms($tax, array( 'slug' => $slug, 'hide_empty' => false ) );
- if ( is_wp_error($term) || empty($term) )
- return NULL;
- $term = $term[0];
- $this->queried_object = $term;
- $this->queried_object_id = $term->term_id;
+ if ( $this->is_category || $this->is_tag || $this->is_tax ) {
+ $tax_query_in_and = wp_list_filter( $this->tax_query->queries, array( 'operator' => 'NOT IN' ), 'NOT' );
+
+ $query = reset( $tax_query_in_and );
+
+ if ( 'term_id' == $query['field'] )
+ $term = get_term( reset( $query['terms'] ), $query['taxonomy'] );
+ else
+ $term = get_term_by( $query['field'], reset( $query['terms'] ), $query['taxonomy'] );
+
+ if ( $term && ! is_wp_error($term) ) {
+ $this->queried_object = $term;
+ $this->queried_object_id = (int) $term->term_id;
+ }
+ } elseif ( $this->is_post_type_archive ) {
+ $this->queried_object = get_post_type_object( $this->get('post_type') );
} elseif ( $this->is_posts_page ) {
$page_for_posts = get_option('page_for_posts');
$this->queried_object = & get_page( $page_for_posts );
$this->queried_object_id = (int) $this->queried_object->ID;
- } elseif ( $this->is_single && !is_null($this->post) ) {
- $this->queried_object = $this->post;
- $this->queried_object_id = (int) $this->post->ID;
- } elseif ( $this->is_page && !is_null($this->post) ) {
+ } elseif ( $this->is_singular && !is_null($this->post) ) {
$this->queried_object = $this->post;
$this->queried_object_id = (int) $this->post->ID;
} elseif ( $this->is_author ) {
- $author_id = (int) $this->get('author');
- $author = get_userdata($author_id);
- $this->queried_object = $author;
- $this->queried_object_id = $author_id;
+ $this->queried_object_id = (int) $this->get('author');
+ $this->queried_object = get_userdata( $this->queried_object_id );
}
return $this->queried_object;
$this->query($query);
}
}
+
+ /**
+ * Is the query for an archive page?
+ *
+ * Month, Year, Category, Author, Post Type archive...
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_archive() {
+ return (bool) $this->is_archive;
+ }
+
+ /**
+ * Is the query for a post type archive page?
+ *
+ * @since 3.1.0
+ *
+ * @param mixed $post_types Optional. Post type or array of posts types to check against.
+ * @return bool
+ */
+ function is_post_type_archive( $post_types = '' ) {
+ if ( empty( $post_types ) || !$this->is_post_type_archive )
+ return (bool) $this->is_post_type_archive;
+
+ $post_type_object = $this->get_queried_object();
+
+ return in_array( $post_type_object->name, (array) $post_types );
+ }
+
+ /**
+ * Is the query for an attachment page?
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_attachment() {
+ return (bool) $this->is_attachment;
+ }
+
+ /**
+ * Is the query for an author archive page?
+ *
+ * If the $author parameter is specified, this function will additionally
+ * check if the query is for one of the authors specified.
+ *
+ * @since 3.1.0
+ *
+ * @param mixed $author Optional. User ID, nickname, nicename, or array of User IDs, nicknames, and nicenames
+ * @return bool
+ */
+ function is_author( $author = '' ) {
+ if ( !$this->is_author )
+ return false;
+
+ if ( empty($author) )
+ return true;
+
+ $author_obj = $this->get_queried_object();
+
+ $author = (array) $author;
+
+ if ( in_array( $author_obj->ID, $author ) )
+ return true;
+ elseif ( in_array( $author_obj->nickname, $author ) )
+ return true;
+ elseif ( in_array( $author_obj->user_nicename, $author ) )
+ return true;
+
+ return false;
+ }
+
+ /**
+ * Is the query for a category archive page?
+ *
+ * If the $category parameter is specified, this function will additionally
+ * check if the query is for one of the categories specified.
+ *
+ * @since 3.1.0
+ *
+ * @param mixed $category Optional. Category ID, name, slug, or array of Category IDs, names, and slugs.
+ * @return bool
+ */
+ function is_category( $category = '' ) {
+ if ( !$this->is_category )
+ return false;
+
+ if ( empty($category) )
+ return true;
+
+ $cat_obj = $this->get_queried_object();
+
+ $category = (array) $category;
+
+ if ( in_array( $cat_obj->term_id, $category ) )
+ return true;
+ elseif ( in_array( $cat_obj->name, $category ) )
+ return true;
+ elseif ( in_array( $cat_obj->slug, $category ) )
+ return true;
+
+ return false;
+ }
+
+ /**
+ * Is the query for a tag archive page?
+ *
+ * If the $tag parameter is specified, this function will additionally
+ * check if the query is for one of the tags specified.
+ *
+ * @since 3.1.0
+ *
+ * @param mixed $slug Optional. Tag slug or array of slugs.
+ * @return bool
+ */
+ function is_tag( $slug = '' ) {
+ if ( !$this->is_tag )
+ return false;
+
+ if ( empty( $slug ) )
+ return true;
+
+ $tag_obj = $this->get_queried_object();
+
+ $slug = (array) $slug;
+
+ if ( in_array( $tag_obj->slug, $slug ) )
+ return true;
+
+ return false;
+ }
+
+ /**
+ * Is the query for a taxonomy archive page?
+ *
+ * If the $taxonomy parameter is specified, this function will additionally
+ * check if the query is for that specific $taxonomy.
+ *
+ * If the $term parameter is specified in addition to the $taxonomy parameter,
+ * this function will additionally check if the query is for one of the terms
+ * specified.
+ *
+ * @since 3.1.0
+ *
+ * @param mixed $taxonomy Optional. Taxonomy slug or slugs.
+ * @param mixed $term. Optional. Term ID, name, slug or array of Term IDs, names, and slugs.
+ * @return bool
+ */
+ function is_tax( $taxonomy = '', $term = '' ) {
+ global $wp_taxonomies;
+
+ if ( !$this->is_tax )
+ return false;
+
+ if ( empty( $taxonomy ) )
+ return true;
+
+ $queried_object = $this->get_queried_object();
+ $tax_array = array_intersect( array_keys( $wp_taxonomies ), (array) $taxonomy );
+ $term_array = (array) $term;
+
+ if ( empty( $term ) ) // Only a Taxonomy provided
+ return isset( $queried_object->taxonomy ) && count( $tax_array ) && in_array( $queried_object->taxonomy, $tax_array );
+
+ return isset( $queried_object->term_id ) &&
+ count( array_intersect(
+ array( $queried_object->term_id, $queried_object->name, $queried_object->slug ),
+ $term_array
+ ) );
+ }
+
+ /**
+ * Whether the current URL is within the comments popup window.
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_comments_popup() {
+ return (bool) $this->is_comments_popup;
+ }
+
+ /**
+ * Is the query for a date archive?
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_date() {
+ return (bool) $this->is_date;
+ }
+
+
+ /**
+ * Is the query for a day archive?
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_day() {
+ return (bool) $this->is_day;
+ }
+
+ /**
+ * Is the query for a feed?
+ *
+ * @since 3.1.0
+ *
+ * @param string|array $feeds Optional feed types to check.
+ * @return bool
+ */
+ function is_feed( $feeds = '' ) {
+ if ( empty( $feeds ) || ! $this->is_feed )
+ return (bool) $this->is_feed;
+ $qv = $this->get( 'feed' );
+ if ( 'feed' == $qv )
+ $qv = get_default_feed();
+ return in_array( $qv, (array) $feeds );
+ }
+
+ /**
+ * Is the query for a comments feed?
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_comment_feed() {
+ return (bool) $this->is_comment_feed;
+ }
+
+ /**
+ * Is the query for the front page of the site?
+ *
+ * This is for what is displayed at your site's main URL.
+ *
+ * Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_on_front'.
+ *
+ * If you set a static page for the front page of your site, this function will return
+ * true when viewing that page.
+ *
+ * Otherwise the same as @see WP_Query::is_home()
+ *
+ * @since 3.1.0
+ * @uses is_home()
+ * @uses get_option()
+ *
+ * @return bool True, if front of site.
+ */
+ function is_front_page() {
+ // most likely case
+ if ( 'posts' == get_option( 'show_on_front') && $this->is_home() )
+ return true;
+ elseif ( 'page' == get_option( 'show_on_front') && get_option( 'page_on_front' ) && $this->is_page( get_option( 'page_on_front' ) ) )
+ return true;
+ else
+ return false;
+ }
+
+ /**
+ * Is the query for the blog homepage?
+ *
+ * This is the page which shows the time based blog content of your site.
+ *
+ * Depends on the site's "Front page displays" Reading Settings 'show_on_front' and 'page_for_posts'.
+ *
+ * If you set a static page for the front page of your site, this function will return
+ * true only on the page you set as the "Posts page".
+ *
+ * @see WP_Query::is_front_page()
+ *
+ * @since 3.1.0
+ *
+ * @return bool True if blog view homepage.
+ */
+ function is_home() {
+ return (bool) $this->is_home;
+ }
+
+ /**
+ * Is the query for a month archive?
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_month() {
+ return (bool) $this->is_month;
+ }
+
+ /**
+ * Is the query for a single page?
+ *
+ * If the $page parameter is specified, this function will additionally
+ * check if the query is for one of the pages specified.
+ *
+ * @see WP_Query::is_single()
+ * @see WP_Query::is_singular()
+ *
+ * @since 3.1.0
+ *
+ * @param mixed $page Page ID, title, slug, or array of such.
+ * @return bool
+ */
+ function is_page( $page = '' ) {
+ if ( !$this->is_page )
+ return false;
+
+ if ( empty( $page ) )
+ return true;
+
+ $page_obj = $this->get_queried_object();
+
+ $page = (array) $page;
+
+ if ( in_array( $page_obj->ID, $page ) )
+ return true;
+ elseif ( in_array( $page_obj->post_title, $page ) )
+ return true;
+ else if ( in_array( $page_obj->post_name, $page ) )
+ return true;
+
+ return false;
+ }
+
+ /**
+ * Is the query for paged result and not for the first page?
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_paged() {
+ return (bool) $this->is_paged;
+ }
+
+ /**
+ * Is the query for a post or page preview?
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_preview() {
+ return (bool) $this->is_preview;
+ }
+
+ /**
+ * Is the query for the robots file?
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_robots() {
+ return (bool) $this->is_robots;
+ }
+
+ /**
+ * Is the query for a search?
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_search() {
+ return (bool) $this->is_search;
+ }
+
+ /**
+ * Is the query for a single post?
+ *
+ * Works for any post type, except attachments and pages
+ *
+ * If the $post parameter is specified, this function will additionally
+ * check if the query is for one of the Posts specified.
+ *
+ * @see WP_Query::is_page()
+ * @see WP_Query::is_singular()
+ *
+ * @since 3.1.0
+ *
+ * @param mixed $post Post ID, title, slug, or array of such.
+ * @return bool
+ */
+ function is_single( $post = '' ) {
+ if ( !$this->is_single )
+ return false;
+
+ if ( empty($post) )
+ return true;
+
+ $post_obj = $this->get_queried_object();
+
+ $post = (array) $post;
+
+ if ( in_array( $post_obj->ID, $post ) )
+ return true;
+ elseif ( in_array( $post_obj->post_title, $post ) )
+ return true;
+ elseif ( in_array( $post_obj->post_name, $post ) )
+ return true;
+
+ return false;
+ }
+
+ /**
+ * Is the query for a single post of any post type (post, attachment, page, ... )?
+ *
+ * If the $post_types parameter is specified, this function will additionally
+ * check if the query is for one of the Posts Types specified.
+ *
+ * @see WP_Query::is_page()
+ * @see WP_Query::is_single()
+ *
+ * @since 3.1.0
+ *
+ * @param mixed $post_types Optional. Post Type or array of Post Types
+ * @return bool
+ */
+ function is_singular( $post_types = '' ) {
+ if ( empty( $post_types ) || !$this->is_singular )
+ return (bool) $this->is_singular;
+
+ $post_obj = $this->get_queried_object();
+
+ return in_array( $post_obj->post_type, (array) $post_types );
+ }
+
+ /**
+ * Is the query for a specific time?
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_time() {
+ return (bool) $this->is_time;
+ }
+
+ /**
+ * Is the query for a trackback endpoint call?
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_trackback() {
+ return (bool) $this->is_trackback;
+ }
+
+ /**
+ * Is the query for a specific year?
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_year() {
+ return (bool) $this->is_year;
+ }
+
+ /**
+ * Is the query a 404 (returns no results)?
+ *
+ * @since 3.1.0
+ *
+ * @return bool
+ */
+ function is_404() {
+ return (bool) $this->is_404;
+ }
}
/**
if ( is_404() && '' != $wp_query->query_vars['name'] ) :
global $wpdb;
- $query = "SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND meta_key = '_wp_old_slug' AND meta_value='" . $wp_query->query_vars['name'] . "'";
+ // Guess the current post_type based on the query vars.
+ if ( get_query_var('post_type') )
+ $post_type = get_query_var('post_type');
+ elseif ( !empty($wp_query->query_vars['pagename']) )
+ $post_type = 'page';
+ else
+ $post_type = 'post';
+
+ // Do not attempt redirect for hierarchical post types
+ if ( is_post_type_hierarchical( $post_type ) )
+ return;
+
+ $query = $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta, $wpdb->posts WHERE ID = post_id AND post_type = %s AND meta_key = '_wp_old_slug' AND meta_value = %s", $post_type, $wp_query->query_vars['name']);
// if year, monthnum, or day have been specified, make our query more precise
// just in case there are multiple identical _wp_old_slug values
if ( '' != $wp_query->query_vars['year'] )
- $query .= " AND YEAR(post_date) = '{$wp_query->query_vars['year']}'";
+ $query .= $wpdb->prepare(" AND YEAR(post_date) = %d", $wp_query->query_vars['year']);
if ( '' != $wp_query->query_vars['monthnum'] )
- $query .= " AND MONTH(post_date) = '{$wp_query->query_vars['monthnum']}'";
+ $query .= $wpdb->prepare(" AND MONTH(post_date) = %d", $wp_query->query_vars['monthnum']);
if ( '' != $wp_query->query_vars['day'] )
- $query .= " AND DAYOFMONTH(post_date) = '{$wp_query->query_vars['day']}'";
+ $query .= $wpdb->prepare(" AND DAYOFMONTH(post_date) = %d", $wp_query->query_vars['day']);
$id = (int) $wpdb->get_var($query);
- if ( !$id )
+ if ( ! $id )
return;
$link = get_permalink($id);
* @return bool True when finished.
*/
function setup_postdata($post) {
- global $id, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages;
+ global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages;
$id = (int) $post->ID;
$authordata = get_userdata($post->post_author);
- $day = mysql2date('d.m.y', $post->post_date, false);
+ $currentday = mysql2date('d.m.y', $post->post_date, false);
$currentmonth = mysql2date('m', $post->post_date, false);
$numpages = 1;
$page = get_query_var('page');
<?php
/**
- * Deprecated. Use registration.php.
+ * Deprecated. No longer needed.
*
* @package WordPress
*/
-_deprecated_file( basename(__FILE__), '2.1', WPINC . '/registration.php' );
-require_once(ABSPATH . WPINC . '/registration.php');
-?>
+_deprecated_file( basename(__FILE__), '2.1', null, __( 'This file no longer needs to be included.' ) );
+?>
\ No newline at end of file
<?php
/**
- * User Registration API
+ * Deprecated. No longer needed.
*
* @package WordPress
*/
-
-/**
- * Checks whether the given username exists.
- *
- * @since 2.0.0
- *
- * @param string $username Username.
- * @return null|int The user's ID on success, and null on failure.
- */
-function username_exists( $username ) {
- if ( $user = get_userdatabylogin( $username ) ) {
- return $user->ID;
- } else {
- return null;
- }
-}
-
-/**
- * Checks whether the given email exists.
- *
- * @since 2.1.0
- * @uses $wpdb
- *
- * @param string $email Email.
- * @return bool|int The user's ID on success, and false on failure.
- */
-function email_exists( $email ) {
- if ( $user = get_user_by_email($email) )
- return $user->ID;
-
- return false;
-}
-
-/**
- * Checks whether an username is valid.
- *
- * @since 2.0.1
- * @uses apply_filters() Calls 'validate_username' hook on $valid check and $username as parameters
- *
- * @param string $username Username.
- * @return bool Whether username given is valid
- */
-function validate_username( $username ) {
- $sanitized = sanitize_user( $username, true );
- $valid = ( $sanitized == $username );
- return apply_filters( 'validate_username', $valid, $username );
-}
-
-/**
- * Insert an user into the database.
- *
- * Can update a current user or insert a new user based on whether the user's ID
- * is present.
- *
- * Can be used to update the user's info (see below), set the user's role, and
- * set the user's preference on whether they want the rich editor on.
- *
- * Most of the $userdata array fields have filters associated with the values.
- * The exceptions are 'rich_editing', 'role', 'jabber', 'aim', 'yim',
- * 'user_registered', and 'ID'. The filters have the prefix 'pre_user_' followed
- * by the field name. An example using 'description' would have the filter
- * called, 'pre_user_description' that can be hooked into.
- *
- * The $userdata array can contain the following fields:
- * 'ID' - An integer that will be used for updating an existing user.
- * 'user_pass' - A string that contains the plain text password for the user.
- * 'user_login' - A string that contains the user's username for logging in.
- * 'user_nicename' - A string that contains a nicer looking name for the user.
- * The default is the user's username.
- * 'user_url' - A string containing the user's URL for the user's web site.
- * 'user_email' - A string containing the user's email address.
- * 'display_name' - A string that will be shown on the site. Defaults to user's
- * username. It is likely that you will want to change this, for both
- * appearance and security through obscurity (that is if you don't use and
- * delete the default 'admin' user).
- * 'nickname' - The user's nickname, defaults to the user's username.
- * 'first_name' - The user's first name.
- * 'last_name' - The user's last name.
- * 'description' - A string containing content about the user.
- * 'rich_editing' - A string for whether to enable the rich editor. False
- * if not empty.
- * 'user_registered' - The date the user registered. Format is 'Y-m-d H:i:s'.
- * 'role' - A string used to set the user's role.
- * 'jabber' - User's Jabber account.
- * 'aim' - User's AOL IM account.
- * 'yim' - User's Yahoo IM account.
- *
- * @since 2.0.0
- * @uses $wpdb WordPress database layer.
- * @uses apply_filters() Calls filters for most of the $userdata fields with the prefix 'pre_user'. See note above.
- * @uses do_action() Calls 'profile_update' hook when updating giving the user's ID
- * @uses do_action() Calls 'user_register' hook when creating a new user giving the user's ID
- *
- * @param array $userdata An array of user data.
- * @return int|WP_Error The newly created user's ID or a WP_Error object if the user could not be created.
- */
-function wp_insert_user($userdata) {
- global $wpdb;
-
- extract($userdata, EXTR_SKIP);
-
- // Are we updating or creating?
- if ( !empty($ID) ) {
- $ID = (int) $ID;
- $update = true;
- $old_user_data = get_userdata($ID);
- } else {
- $update = false;
- // Hash the password
- $user_pass = wp_hash_password($user_pass);
- }
-
- $user_login = sanitize_user($user_login, true);
- $user_login = apply_filters('pre_user_login', $user_login);
-
- //Remove any non-printable chars from the login string to see if we have ended up with an empty username
- $user_login = trim($user_login);
-
- if ( empty($user_login) )
- return new WP_Error('empty_user_login', __('Cannot create a user with an empty login name.') );
-
- if ( !$update && username_exists( $user_login ) )
- return new WP_Error('existing_user_login', __('This username is already registered.') );
-
- if ( empty($user_nicename) )
- $user_nicename = sanitize_title( $user_login );
- $user_nicename = apply_filters('pre_user_nicename', $user_nicename);
-
- if ( empty($user_url) )
- $user_url = '';
- $user_url = apply_filters('pre_user_url', $user_url);
-
- if ( empty($user_email) )
- $user_email = '';
- $user_email = apply_filters('pre_user_email', $user_email);
-
- if ( !$update && ! defined( 'WP_IMPORTING' ) && email_exists($user_email) )
- return new WP_Error('existing_user_email', __('This email address is already registered.') );
-
- if ( empty($display_name) )
- $display_name = $user_login;
- $display_name = apply_filters('pre_user_display_name', $display_name);
-
- if ( empty($nickname) )
- $nickname = $user_login;
- $nickname = apply_filters('pre_user_nickname', $nickname);
-
- if ( empty($first_name) )
- $first_name = '';
- $first_name = apply_filters('pre_user_first_name', $first_name);
-
- if ( empty($last_name) )
- $last_name = '';
- $last_name = apply_filters('pre_user_last_name', $last_name);
-
- if ( empty($description) )
- $description = '';
- $description = apply_filters('pre_user_description', $description);
-
- if ( empty($rich_editing) )
- $rich_editing = 'true';
-
- if ( empty($comment_shortcuts) )
- $comment_shortcuts = 'false';
-
- if ( empty($admin_color) )
- $admin_color = 'fresh';
- $admin_color = preg_replace('|[^a-z0-9 _.\-@]|i', '', $admin_color);
-
- if ( empty($use_ssl) )
- $use_ssl = 0;
-
- if ( empty($user_registered) )
- $user_registered = gmdate('Y-m-d H:i:s');
-
- $user_nicename_check = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1" , $user_nicename, $user_login));
-
- if ( $user_nicename_check ) {
- $suffix = 2;
- while ($user_nicename_check) {
- $alt_user_nicename = $user_nicename . "-$suffix";
- $user_nicename_check = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1" , $alt_user_nicename, $user_login));
- $suffix++;
- }
- $user_nicename = $alt_user_nicename;
- }
-
- $data = compact( 'user_pass', 'user_email', 'user_url', 'user_nicename', 'display_name', 'user_registered' );
- $data = stripslashes_deep( $data );
-
- if ( $update ) {
- $wpdb->update( $wpdb->users, $data, compact( 'ID' ) );
- $user_id = (int) $ID;
- } else {
- $wpdb->insert( $wpdb->users, $data + compact( 'user_login' ) );
- $user_id = (int) $wpdb->insert_id;
- }
-
- update_user_meta( $user_id, 'first_name', $first_name);
- update_user_meta( $user_id, 'last_name', $last_name);
- update_user_meta( $user_id, 'nickname', $nickname );
- update_user_meta( $user_id, 'description', $description );
- update_user_meta( $user_id, 'rich_editing', $rich_editing);
- update_user_meta( $user_id, 'comment_shortcuts', $comment_shortcuts);
- update_user_meta( $user_id, 'admin_color', $admin_color);
- update_user_meta( $user_id, 'use_ssl', $use_ssl);
-
- foreach ( _wp_get_user_contactmethods() as $method => $name ) {
- if ( empty($$method) )
- $$method = '';
-
- update_user_meta( $user_id, $method, $$method );
- }
-
- if ( isset($role) ) {
- $user = new WP_User($user_id);
- $user->set_role($role);
- } elseif ( !$update ) {
- $user = new WP_User($user_id);
- $user->set_role(get_option('default_role'));
- }
-
- wp_cache_delete($user_id, 'users');
- wp_cache_delete($user_login, 'userlogins');
-
- if ( $update )
- do_action('profile_update', $user_id, $old_user_data);
- else
- do_action('user_register', $user_id);
-
- return $user_id;
-}
-
-/**
- * Update an user in the database.
- *
- * It is possible to update a user's password by specifying the 'user_pass'
- * value in the $userdata parameter array.
- *
- * If $userdata does not contain an 'ID' key, then a new user will be created
- * and the new user's ID will be returned.
- *
- * If current user's password is being updated, then the cookies will be
- * cleared.
- *
- * @since 2.0.0
- * @see wp_insert_user() For what fields can be set in $userdata
- * @uses wp_insert_user() Used to update existing user or add new one if user doesn't exist already
- *
- * @param array $userdata An array of user data.
- * @return int The updated user's ID.
- */
-function wp_update_user($userdata) {
- $ID = (int) $userdata['ID'];
-
- // First, get all of the original fields
- $user = get_userdata($ID);
-
- // Escape data pulled from DB.
- $user = add_magic_quotes(get_object_vars($user));
-
- // If password is changing, hash it now.
- if ( ! empty($userdata['user_pass']) ) {
- $plaintext_pass = $userdata['user_pass'];
- $userdata['user_pass'] = wp_hash_password($userdata['user_pass']);
- }
-
- wp_cache_delete($user[ 'user_email' ], 'useremail');
-
- // Merge old and new fields with new fields overwriting old ones.
- $userdata = array_merge($user, $userdata);
- $user_id = wp_insert_user($userdata);
-
- // Update the cookies if the password changed.
- $current_user = wp_get_current_user();
- if ( $current_user->id == $ID ) {
- if ( isset($plaintext_pass) ) {
- wp_clear_auth_cookie();
- wp_set_auth_cookie($ID);
- }
- }
-
- return $user_id;
-}
-
-/**
- * A simpler way of inserting an user into the database.
- *
- * Creates a new user with just the username, password, and email. For a more
- * detail creation of a user, use wp_insert_user() to specify more infomation.
- *
- * @since 2.0.0
- * @see wp_insert_user() More complete way to create a new 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.
- */
-function wp_create_user($username, $password, $email = '') {
- $user_login = esc_sql( $username );
- $user_email = esc_sql( $email );
- $user_pass = $password;
-
- $userdata = compact('user_login', 'user_email', 'user_pass');
- return wp_insert_user($userdata);
-}
-
-
-/**
- * Set up the default contact methods
- *
- * @access private
- * @since
- *
- * @return array $user_contactmethods Array of contact methods and their labels.
- */
-function _wp_get_user_contactmethods() {
- $user_contactmethods = array(
- 'aim' => __('AIM'),
- 'yim' => __('Yahoo IM'),
- 'jabber' => __('Jabber / Google Talk')
- );
- return apply_filters('user_contactmethods',$user_contactmethods);
-}
-
-?>
+_deprecated_file( basename(__FILE__), '3.1', null, __( 'This file no longer needs to be included.' ) );
+?>
\ No newline at end of file
*/
function add_rewrite_tag($tagname, $regex) {
//validation
- if ( strlen($tagname) < 3 || $tagname{0} != '%' || $tagname{strlen($tagname)-1} != '%' )
+ if ( strlen($tagname) < 3 || $tagname[0] != '%' || $tagname[strlen($tagname)-1] != '%' )
return;
$qv = trim($tagname, '%');
* The endpoints are added to the end of the request. So a request matching
* "/2008/10/14/my_post/myep/", the endpoint will be "/myep/".
*
- * Be sure to flush the rewrite rules (wp_rewrite->flush()) when your plugin gets
+ * Be sure to flush the rewrite rules (wp_rewrite->flush_rules()) when your plugin gets
* activated (register_activation_hook()) and deactivated (register_deactivation_hook())
*
* @since 2.1.0
if ( empty($rewrite) )
return 0;
- // $url cleanup by Mark Jaquith
- // This fixes things like #anchors, ?query=strings, missing 'www.',
- // added 'www.', or added 'index.php/' that will mess up our WP_Query
- // and return a false negative
-
// Get rid of the #anchor
$url_split = explode('#', $url);
$url = $url_split[0];
} else {
// Chop off /path/to/blog
$home_path = parse_url(home_url());
- $home_path = $home_path['path'];
+ $home_path = isset( $home_path['path'] ) ? $home_path['path'] : '' ;
$url = str_replace($home_path, '', $url);
}
$request = $url;
- // Done with cleanup
-
// Look for matches.
$request_match = $request;
foreach ( (array)$rewrite as $match => $query) {
// Do the query
$query = new WP_Query($query);
- if ( $query->is_single || $query->is_page )
+ if ( !empty($query->posts) && $query->is_singular )
return $query->post->ID;
else
return 0;
*/
var $use_trailing_slashes;
- /**
- * Customized or default category permalink base ( example.com/xx/tagname ).
- *
- * @since 1.5.0
- * @access private
- * @var string
- */
- var $category_base;
-
- /**
- * Customized or default tag permalink base ( example.com/xx/tagname ).
- *
- * @since 2.3.0
- * @access private
- * @var string
- */
- var $tag_base;
-
- /**
- * Permalink request structure for categories.
- *
- * @since 1.5.0
- * @access private
- * @var string
- */
- var $category_structure;
-
- /**
- * Permalink request structure for tags.
- *
- * @since 2.3.0
- * @access private
- * @var string
- */
- var $tag_structure;
-
/**
* Permalink author request base ( example.com/author/authorname ).
*
*/
var $comments_base = 'comments';
+ /**
+ * Pagination permalink base.
+ *
+ * @since 3.1.0
+ * @access private
+ * @var string
+ */
+ var $pagination_base = 'page';
+
/**
* Feed permalink base.
*
/**
* Endpoints permalinks
*
- * @since unknown
+ * @since 2.1.0
* @access private
* @var array
*/
'%second%',
'%postname%',
'%post_id%',
- '%category%',
- '%tag%',
'%author%',
'%pagename%',
'%search%'
'([0-9]{1,2})',
'([^/]+)',
'([0-9]+)',
- '(.+?)',
- '(.+?)',
'([^/]+)',
'([^/]+?)',
'(.+)'
'second=',
'name=',
'p=',
- 'category_name=',
- 'tag=',
'author_name=',
'pagename=',
's='
* @return bool|string False on failure. Category permalink structure.
*/
function get_category_permastruct() {
- if ( isset($this->category_structure) )
- return $this->category_structure;
-
- if ( empty($this->permalink_structure) ) {
- $this->category_structure = '';
- return false;
- }
-
- if ( empty($this->category_base) )
- $this->category_structure = trailingslashit( $this->front . 'category' );
- else
- $this->category_structure = trailingslashit( '/' . $this->root . $this->category_base );
-
- $this->category_structure .= '%category%';
-
- return $this->category_structure;
+ return $this->get_extra_permastruct('category');
}
/**
* @return bool|string False on failure. Tag permalink structure.
*/
function get_tag_permastruct() {
- if ( isset($this->tag_structure) )
- return $this->tag_structure;
-
- if ( empty($this->permalink_structure) ) {
- $this->tag_structure = '';
- return false;
- }
-
- if ( empty($this->tag_base) )
- $this->tag_structure = trailingslashit( $this->front . 'tag' );
- else
- $this->tag_structure = trailingslashit( '/' . $this->root . $this->tag_base );
-
- $this->tag_structure .= '%tag%';
-
- return $this->tag_structure;
+ return $this->get_extra_permastruct('post_tag');
}
/**
* Retrieve extra permalink structure by name.
*
- * @since unknown
+ * @since 2.5.0
* @access public
*
* @param string $name Permalink structure name.
//build a regex to match the trackback and page/xx parts of URLs
$trackbackregex = 'trackback/?$';
- $pageregex = 'page/?([0-9]{1,})/?$';
+ $pageregex = $this->pagination_base . '/?([0-9]{1,})/?$';
$commentregex = 'comment-page-([0-9]{1,})/?$';
//build up an array of endpoint regexes to append => queries to append
$search_rewrite = $this->generate_rewrite_rules($search_structure, EP_SEARCH);
$search_rewrite = apply_filters('search_rewrite_rules', $search_rewrite);
- // Categories
- $category_rewrite = $this->generate_rewrite_rules($this->get_category_permastruct(), EP_CATEGORIES);
- $category_rewrite = apply_filters('category_rewrite_rules', $category_rewrite);
-
- // Tags
- $tag_rewrite = $this->generate_rewrite_rules($this->get_tag_permastruct(), EP_TAGS);
- $tag_rewrite = apply_filters('tag_rewrite_rules', $tag_rewrite);
-
// Authors
$author_rewrite = $this->generate_rewrite_rules($this->get_author_permastruct(), EP_AUTHORS);
$author_rewrite = apply_filters('author_rewrite_rules', $author_rewrite);
$page_rewrite = apply_filters('page_rewrite_rules', $page_rewrite);
// Extra permastructs
- foreach ( $this->extra_permastructs as $permastruct ) {
+ foreach ( $this->extra_permastructs as $permastructname => $permastruct ) {
if ( is_array($permastruct) )
- $this->extra_rules_top = array_merge($this->extra_rules_top, $this->generate_rewrite_rules($permastruct[0], $permastruct[1]));
+ $rules = $this->generate_rewrite_rules($permastruct[0], $permastruct[1]);
else
- $this->extra_rules_top = array_merge($this->extra_rules_top, $this->generate_rewrite_rules($permastruct, EP_NONE));
+ $rules = $this->generate_rewrite_rules($permastruct, EP_NONE);
+
+ $rules = apply_filters($permastructname . '_rewrite_rules', $rules);
+ if ( 'post_tag' == $permastructname )
+ $rules = apply_filters('tag_rewrite_rules', $rules);
+
+ $this->extra_rules_top = array_merge($this->extra_rules_top, $rules);
}
// Put them together.
if ( $this->use_verbose_page_rules )
- $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $default_feeds, $registration_pages, $page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $tag_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $this->extra_rules);
+ $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $default_feeds, $registration_pages, $page_rewrite, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $this->extra_rules);
else
- $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $default_feeds, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $category_rewrite, $tag_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules);
+ $this->rules = array_merge($this->extra_rules_top, $robots_rewrite, $default_feeds, $registration_pages, $root_rewrite, $comments_rewrite, $search_rewrite, $author_rewrite, $date_rewrite, $post_rewrite, $page_rewrite, $this->extra_rules);
do_action_ref_array('generate_rewrite_rules', array(&$this));
$this->rules = apply_filters('rewrite_rules_array', $this->rules);
* These are added along with the extra rewrite rules that are merged to the
* top.
*
- * @since unknown
+ * @since 2.5.0
* @access public
*
* @param string $name Name for permalink structure.
*
* @since 2.0.1
* @access public
- * @param $hard bool Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard).
+ * @param bool $hard Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard).
*/
function flush_rules($hard = true) {
delete_option('rewrite_rules');
$this->root = '';
if ( $this->using_index_permalinks() )
$this->root = $this->index . '/';
- $this->category_base = get_option( 'category_base' );
- $this->tag_base = get_option( 'tag_base' );
- unset($this->category_structure);
unset($this->author_structure);
unset($this->date_structure);
unset($this->page_structure);
* @param string $category_base Category permalink structure base.
*/
function set_category_base($category_base) {
- if ( $category_base != $this->category_base ) {
+ if ( $category_base != get_option('category_base') ) {
update_option('category_base', $category_base);
$this->init();
}
* @param string $tag_base Tag permalink structure base.
*/
function set_tag_base( $tag_base ) {
- if ( $tag_base != $this->tag_base ) {
+ if ( $tag_base != get_option( 'tag_base') ) {
update_option( 'tag_base', $tag_base );
$this->init();
}
/**
* Build Magpie object based on RSS from URL.
*
- * @since unknown
+ * @since 1.5.0
* @package External
* @subpackage MagpieRSS
*
/**
* Retrieve URL headers and content using WP HTTP Request API.
*
- * @since unknown
+ * @since 1.5.0
* @package External
* @subpackage MagpieRSS
*
/**
* Retrieve
*
- * @since unknown
+ * @since 1.5.0
* @package External
* @subpackage MagpieRSS
*
/**
* Set up constants with default values, unless user overrides.
*
- * @since unknown
+ * @since 1.5.0
* @package External
* @subpackage MagpieRSS
*/
/**
* Display all RSS items in a HTML ordered list.
*
- * @since unknown
+ * @since 1.5.0
* @package External
* @subpackage MagpieRSS
*
'<li><a href="%1$s" title="%2$s">%3$s</a></li>',
esc_url( $item['link'] ),
esc_attr( strip_tags( $item['description'] ) ),
- htmlentities( $item['title'] )
+ esc_html( $item['title'] )
);
}
* to display. You can't display all of them like you can with wp_rss()
* function.
*
- * @since unknown
+ * @since 1.5.0
* @package External
* @subpackage MagpieRSS
*
foreach ( (array) $rss->items as $item ) {
echo "<li>\n";
echo "<a href='$item[link]' title='$item[description]'>";
- echo htmlentities($item['title']);
+ echo esc_html($item['title']);
echo "</a><br />\n";
echo "</li>\n";
}
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
- $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' );
+ // Always ensure that we have the convertEntities function
+ $scripts->add( 'l10n', "/wp-includes/js/l10n$suffix.js", false, '20101110' );
+ $scripts->enqueue( 'l10n' );
- $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20100531' );
+ $scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20101110' );
+
+ $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20101211' );
$scripts->add_data( 'common', 'group', 1 );
$scripts->localize( 'common', 'commonL10n', array(
'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete."),
$scripts->add_data( 'sack', 'group', 1 );
$scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", false, '20090307' );
+ $scripts->add_data( 'quicktags', 'group', 1 );
$scripts->localize( 'quicktags', 'quicktagsL10n', array(
'quickLinks' => __('(Quick Links)'),
'wordLookup' => __('Enter a word to look up:'),
$scripts->add( 'colorpicker', "/wp-includes/js/colorpicker$suffix.js", array('prototype'), '3517m' );
- $scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", false, '20091124' );
+ $scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array('utils','jquery'), '20091124' );
$scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6.1');
'l10n_print_after' => 'try{convertEntities(wpAjax);}catch(e){};'
) );
- $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20100410' );
+ $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20101004' );
$scripts->add_data( 'autosave', 'group', 1 );
- $scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20091128' );
+ $scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20101222' );
$scripts->add_data( 'wp-lists', 'group', 1 );
$scripts->add( 'scriptaculous-root', '/wp-includes/js/scriptaculous/wp-scriptaculous.js', array('prototype'), '1.8.3');
// not used in core, replaced by Jcrop.js
$scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop'), '20070118');
- $scripts->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.4.2');
+ $scripts->add( 'jquery', '/wp-includes/js/jquery/jquery.js', false, '1.4.4');
- $scripts->add( 'jquery-ui-core', '/wp-includes/js/jquery/ui.core.js', array('jquery'), '1.7.3' );
+ $scripts->add( 'jquery-ui-core', '/wp-includes/js/jquery/ui.core.js', array('jquery'), '1.8.9' );
$scripts->add_data( 'jquery-ui-core', 'group', 1 );
- $scripts->add( 'jquery-ui-tabs', '/wp-includes/js/jquery/ui.tabs.js', array('jquery-ui-core'), '1.7.3' );
+ $scripts->add( 'jquery-ui-position', '/wp-includes/js/jquery/ui.position.js', array('jquery'), '1.8.9' );
+ $scripts->add_data( 'jquery-ui-position', 'group', 1 );
+
+ $scripts->add( 'jquery-ui-widget', '/wp-includes/js/jquery/ui.widget.js', array('jquery'), '1.8.9' );
+ $scripts->add_data( 'jquery-ui-widget', 'group', 1 );
+
+ $scripts->add( 'jquery-ui-mouse', '/wp-includes/js/jquery/ui.mouse.js', array('jquery', 'jquery-ui-widget'), '1.8.9' );
+ $scripts->add_data( 'jquery-ui-mouse', 'group', 1 );
+
+ $scripts->add( 'jquery-ui-button', '/wp-includes/js/jquery/ui.button.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.8.9' );
+ $scripts->add_data( 'jquery-ui-button', 'group', 1 );
+
+ $scripts->add( 'jquery-ui-tabs', '/wp-includes/js/jquery/ui.tabs.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.8.9' );
$scripts->add_data( 'jquery-ui-tabs', 'group', 1 );
- $scripts->add( 'jquery-ui-sortable', '/wp-includes/js/jquery/ui.sortable.js', array('jquery-ui-core'), '1.7.3' );
+ $scripts->add( 'jquery-ui-sortable', '/wp-includes/js/jquery/ui.sortable.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.8.9' );
$scripts->add_data( 'jquery-ui-sortable', 'group', 1 );
- $scripts->add( 'jquery-ui-draggable', '/wp-includes/js/jquery/ui.draggable.js', array('jquery-ui-core'), '1.7.3' );
+ $scripts->add( 'jquery-ui-draggable', '/wp-includes/js/jquery/ui.draggable.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.8.9' );
$scripts->add_data( 'jquery-ui-draggable', 'group', 1 );
- $scripts->add( 'jquery-ui-droppable', '/wp-includes/js/jquery/ui.droppable.js', array('jquery-ui-core'), '1.7.3' );
+ $scripts->add( 'jquery-ui-droppable', '/wp-includes/js/jquery/ui.droppable.js', array('jquery-ui-core', 'jquery-ui-mouse', 'jquery-ui-draggable'), '1.8.9' );
$scripts->add_data( 'jquery-ui-droppable', 'group', 1 );
- $scripts->add( 'jquery-ui-selectable', '/wp-includes/js/jquery/ui.selectable.js', array('jquery-ui-core'), '1.7.3' );
+ $scripts->add( 'jquery-ui-selectable', '/wp-includes/js/jquery/ui.selectable.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.8.9' );
$scripts->add_data( 'jquery-ui-selectable', 'group', 1 );
- $scripts->add( 'jquery-ui-resizable', '/wp-includes/js/jquery/ui.resizable.js', array('jquery-ui-core'), '1.7.3' );
+ $scripts->add( 'jquery-ui-resizable', '/wp-includes/js/jquery/ui.resizable.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.8.9' );
$scripts->add_data( 'jquery-ui-resizable', 'group', 1 );
- $scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui.dialog.js', array('jquery-ui-resizable', 'jquery-ui-draggable'), '1.7.3' );
+ $scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui.dialog.js', array('jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position'), '1.8.9' );
$scripts->add_data( 'jquery-ui-dialog', 'group', 1 );
// deprecated, not used in core, most functionality is included in jQuery 1.3
$scripts->add( 'jquery-color', "/wp-includes/js/jquery/jquery.color$suffix.js", array('jquery'), '2.0-4561m');
$scripts->add_data( 'jquery-color', 'group', 1 );
- $scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array('jquery'), '1.1-20090125');
+ $scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array('jquery'), '1.1-20110113');
$scripts->add_data( 'suggest', 'group', 1 );
$scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20m');
$scripts->add_data( 'schedule', 'group', 1 );
+ $scripts->add( 'jquery-query', "/wp-includes/js/jquery/jquery.query.js", array('jquery'), '2.1.7' );
+ $scripts->add_data( 'jquery-query', 'group', 1 );
+
+ $scripts->add( 'jquery-serialize-object', "/wp-includes/js/jquery/jquery.serialize-object.js", array('jquery'), '0.2' );
+ $scripts->add_data( 'jquery-serialize-object', 'group', 1 );
+
$scripts->add( 'jquery-hotkeys', "/wp-includes/js/jquery/jquery.hotkeys$suffix.js", array('jquery'), '0.0.2m' );
$scripts->add_data( 'jquery-hotkeys', 'group', 1 );
) );
- $scripts->add( 'jcrop', "/wp-includes/js/jcrop/jquery.Jcrop$suffix.js", array('jquery'), '0.9.8');
+ $scripts->add( 'jcrop', "/wp-includes/js/jcrop/jquery.Jcrop$suffix.js", array('jquery'), '0.9.8-20110113');
$scripts->add( 'swfobject', "/wp-includes/js/swfobject.js", false, '2.2');
- $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2201');
+ $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2201-20110113');
$scripts->add( 'swfupload-swfobject', '/wp-includes/js/swfupload/plugins/swfupload.swfobject.js', array('swfupload', 'swfobject'), '2201');
$scripts->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2201');
$scripts->add( 'swfupload-speed', '/wp-includes/js/swfupload/plugins/swfupload.speed.js', array('swfupload'), '2201');
'dismiss' => __('Dismiss'),
'crunching' => __('Crunching…'),
'deleted' => __('moved to the trash.'),
+ 'error_uploading' => __('“%s” has failed to upload due to an error'),
'l10n_print_after' => 'try{convertEntities(swfuploadL10n);}catch(e){};',
- 'error_uploading' => __('“%s” has failed to upload due to an error')
) );
$scripts->add( 'comment-reply', "/wp-includes/js/comment-reply$suffix.js", false, '20090102');
- $scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", false, '20090817');
+ $scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", false, '20110113');
- $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.1' );
+ $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.1-20110113' );
$scripts->add_data( 'imgareaselect', 'group', 1 );
+ $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), '20101027' );
+ $scripts->add_data( 'password-strength-meter', 'group', 1 );
+ $scripts->localize( 'password-strength-meter', 'pwsL10n', array(
+ 'empty' => __('Strength indicator'),
+ 'short' => __('Very weak'),
+ 'bad' => __('Weak'),
+ /* translators: password strength */
+ 'good' => _x('Medium', 'password strength'),
+ 'strong' => __('Strong'),
+ 'mismatch' => __('Mismatch'),
+ 'l10n_print_after' => 'try{convertEntities(pwsL10n);}catch(e){};'
+ ) );
+
+ $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20110113' );
+ $scripts->add_data( 'user-profile', 'group', 1 );
+
+ $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", false, '20110131' );
+ $scripts->add_data( 'admin-bar', 'group', 1 );
+
+ $scripts->add( 'wplink', "/wp-includes/js/tinymce/plugins/wplink/js/wplink$suffix.js", array('jquery'), '20110111' );
+ $scripts->localize( 'wplink', 'wpLinkL10n', array(
+ 'update' => __('Update'),
+ 'save' => __('Add Link'),
+ 'noTitle' => __('(no title)'),
+ 'noMatchesFound' => __('No matches found.'),
+ 'l10n_print_after' => 'try{convertEntities(wpLinkL10n);}catch(e){};',
+ ) );
+
+ $scripts->add( 'wpdialogs-popup', "/wp-includes/js/tinymce/plugins/wpdialogs/js/popup$suffix.js", array( 'jquery-ui-dialog' ), '20101119' );
+
if ( is_admin() ) {
$scripts->add( 'ajaxcat', "/wp-admin/js/cat$suffix.js", array( 'wp-lists' ), '20090102' );
$scripts->add_data( 'ajaxcat', 'group', 1 );
$scripts->add( 'admin-categories', "/wp-admin/js/categories$suffix.js", array('wp-lists'), '20091201' );
$scripts->add_data( 'admin-categories', 'group', 1 );
- $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('jquery', 'wp-ajax-response'), '20100213' );
+ $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('jquery', 'wp-ajax-response'), '20101216' );
$scripts->add_data( 'admin-tags', 'group', 1 );
$scripts->localize( 'admin-tags', 'tagsl10n', array(
'noPerm' => __('You do not have permission to do that.'),
$scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20090106' );
$scripts->add_data( 'admin-custom-fields', 'group', 1 );
- $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), '20100331' );
- $scripts->add_data( 'password-strength-meter', 'group', 1 );
- $scripts->localize( 'password-strength-meter', 'pwsL10n', array(
- 'empty' => __('Strength indicator'),
- 'short' => __('Very weak'),
- 'bad' => __('Weak'),
- /* translators: password strength */
- 'good' => _x('Medium', 'password strength'),
- 'strong' => __('Strong'),
- 'mismatch' => __('Mismatch'),
- 'l10n_print_after' => 'try{convertEntities(pwsL10n);}catch(e){};'
- ) );
-
- $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array('jquery'), '20100301' );
- $scripts->add_data( 'user-profile', 'group', 1 );
-
- $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20100418' );
+ $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags', 'jquery-query'), '20110122' );
$scripts->add_data( 'admin-comments', 'group', 1 );
$scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
$scripts->localize( 'post', 'postL10n', array(
'tagsUsed' => __('Tags used on this post:'),
'add' => esc_attr(__('Add')),
- 'addTag' => esc_attr(__('Add new tag')),
+ 'addTag' => esc_attr(__('Add new Tag')),
'separate' => __('Separate tags with commas'),
'ok' => __('OK'),
'cancel' => __('Cancel'),
'endcomm' => __('No more comments found.'),
'publish' => __('Publish'),
'schedule' => __('Schedule'),
- 'updatePost' => __('Update Post'),
- 'updatePage' => __('Update Page'),
+ 'update' => __('Update'),
'savePending' => __('Save as Pending'),
'saveDraft' => __('Save Draft'),
'private' => __('Private'),
$scripts->add( 'admin-gallery', "/wp-admin/js/gallery$suffix.js", array( 'jquery-ui-sortable' ), '20090516' );
- $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '20091023' );
+ $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox' ), '20110113' );
$scripts->add_data( 'media-upload', 'group', 1 );
- $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), '20090824' );
+ $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), '20101007' );
$scripts->add_data( 'admin-widgets', 'group', 1 );
$scripts->add( 'word-count', "/wp-admin/js/word-count$suffix.js", array( 'jquery' ), '20090422' );
'l10n_print_after' => 'try{convertEntities(wordCountL10n);}catch(e){};'
));
+ $scripts->add( 'theme', "/wp-admin/js/theme$suffix.js", array( 'thickbox' ), '20110118' );
+ $scripts->add_data( 'theme', 'group', 1 );
+
$scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20100407' );
$scripts->add_data( 'theme-preview', 'group', 1 );
- $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), '20091202' );
+ $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), '20110113' );
$scripts->add_data( 'inline-edit-post', 'group', 1 );
$scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
'error' => __('Error while saving the changes.'),
'l10n_print_after' => 'try{convertEntities(inlineEditL10n);}catch(e){};'
) );
- $scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery' ), '20090623' );
+ $scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery' ), '20100615' );
$scripts->add_data( 'inline-edit-tax', 'group', 1 );
$scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array(
'error' => __('Error while saving the changes.'),
'l10n_print_after' => 'try{convertEntities(inlineEditL10n);}catch(e){};'
) );
- $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'thickbox' ), '20100407' );
+ $scripts->add( 'plugin-install', "/wp-admin/js/plugin-install$suffix.js", array( 'jquery', 'thickbox' ), '20110113' );
$scripts->add_data( 'plugin-install', 'group', 1 );
$scripts->localize( 'plugin-install', 'plugininstallL10n', array(
'plugin_information' => __('Plugin Information:'),
$scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' );
- $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20100523' );
+ $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20110113' );
$scripts->add_data( 'dashboard', 'group', 1 );
$scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), '20090102' );
$scripts->add( 'list-revisions', "/wp-includes/js/wp-list-revisions$suffix.js", null, '20091223' );
- $scripts->add( 'media', "/wp-admin/js/media$suffix.js", array( 'jquery-ui-draggable' ), '20100524' );
+ $scripts->add( 'media', "/wp-admin/js/media$suffix.js", array( 'jquery-ui-draggable' ), '20101022' );
$scripts->add_data( 'media', 'group', 1 );
$scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), '20091111' );
'setThumbnail' => __( 'Use as featured image' ),
'saving' => __( 'Saving...' ),
'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ),
- 'done' => __( 'Done' )
+ 'done' => __( 'Done' ),
+ 'l10n_print_after' => 'try{convertEntities(setPostThumbnailL10n);}catch(e){};'
) );
// Navigation Menus
- $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100611' );
+ $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array('jquery-ui-sortable'), '20100814' );
$scripts->localize( 'nav-menu', 'navMenuL10n', array(
'noResultsFound' => _x('No results found.', 'search results'),
'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ),
'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'),
+ 'l10n_print_after' => 'try{convertEntities(navMenuL10n);}catch(e){};'
) );
- $scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array('farbtastic'), '20100531' );
+ $scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array('farbtastic'), '20101025' );
$scripts->add_data( 'custom-background', 'group', 1 );
}
}
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
- $rtl_styles = array( 'wp-admin', 'global', 'colors', 'colors-fresh', 'colors-classic', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'plugin-install', 'nav-menu', 'farbtastic' );
+ $rtl_styles = array( 'wp-admin', 'global', 'colors', 'colors-fresh', 'colors-classic', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'plugin-install', 'nav-menu', 'farbtastic', 'admin-bar', 'wplink', 'theme-install' );
// Any rtl stylesheets that don't have a .dev version for ltr
$no_suffix = array( 'farbtastic' );
- $styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20100614' );
+ $styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20110214' );
- $styles->add( 'ie', "/wp-admin/css/ie$suffix.css", array(), '20100610' );
+ $styles->add( 'ie', "/wp-admin/css/ie$suffix.css", array(), '20101102' );
$styles->add_data( 'ie', 'conditional', 'lte IE 7' );
// all colors stylesheets need to have the same query strings (cache manifest compat)
- $colors_version = '20100610';
+ $colors_version = '20110121';
// Register "meta" stylesheet for admin colors. All colors-* style sheets should have the same version string.
$styles->add( 'colors', true, array(), $colors_version );
$styles->add( 'colors-fresh', "/wp-admin/css/colors-fresh$suffix.css", array(), $colors_version );
$styles->add( 'colors-classic', "/wp-admin/css/colors-classic$suffix.css", array(), $colors_version );
- $styles->add( 'ms', "/wp-admin/css/ms$suffix.css", array(), '20100528' );
- $styles->add( 'global', "/wp-admin/css/global$suffix.css", array(), '20100108' );
- $styles->add( 'media', "/wp-admin/css/media$suffix.css", array(), '20100519' );
- $styles->add( 'widgets', "/wp-admin/css/widgets$suffix.css", array(), '20100610' );
- $styles->add( 'dashboard', "/wp-admin/css/dashboard$suffix.css", array(), '20100424' );
- $styles->add( 'install', "/wp-admin/css/install$suffix.css", array(), '20100605' ); // Readme as well
- $styles->add( 'theme-editor', "/wp-admin/css/theme-editor$suffix.css", array(), '20100514' );
- $styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array(), '20100424' );
+ $styles->add( 'ms', "/wp-admin/css/ms$suffix.css", array(), '20101213' );
+ $styles->add( 'global', "/wp-admin/css/global$suffix.css", array(), '20110121' );
+ $styles->add( 'media', "/wp-admin/css/media$suffix.css", array(), '20110121' );
+ $styles->add( 'widgets', "/wp-admin/css/widgets$suffix.css", array(), '20110104' );
+ $styles->add( 'dashboard', "/wp-admin/css/dashboard$suffix.css", array(), '20110121' );
+ $styles->add( 'install', "/wp-admin/css/install$suffix.css", array(), '20110121' ); // Readme as well
+ $styles->add( 'theme-editor', "/wp-admin/css/theme-editor$suffix.css", array(), '20101203' );
+ $styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array(), '20110121' );
$styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20090514' );
- $styles->add( 'login', "/wp-admin/css/login$suffix.css", array(), '20100601' );
- $styles->add( 'plugin-install', "/wp-admin/css/plugin-install$suffix.css", array(), '20100402' );
- $styles->add( 'theme-install', "/wp-admin/css/theme-install$suffix.css", array(), '20100523' );
- $styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' );
+ $styles->add( 'login', "/wp-admin/css/login$suffix.css", array(), '20110121' );
+ $styles->add( 'plugin-install', "/wp-admin/css/plugin-install$suffix.css", array(), '20101230' );
+ $styles->add( 'theme-install', "/wp-admin/css/theme-install$suffix.css", array(), '20101226' );
+ $styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.3u' );
$styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
$styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
- $styles->add( 'nav-menu', "/wp-admin/css/nav-menu$suffix.css", array(), '20100611' );
+ $styles->add( 'nav-menu', "/wp-admin/css/nav-menu$suffix.css", array(), '20100907' );
+ $styles->add( 'admin-bar', "/wp-includes/css/admin-bar$suffix.css", array(), '20110122' );
+ $styles->add( 'wp-jquery-ui-dialog', "/wp-includes/css/jquery-ui-dialog$suffix.css", array(), '20101224' );
+ $styles->add( 'wplink', "/wp-includes/js/tinymce/plugins/wplink/css/wplink$suffix.css", array(), '20101224' );
foreach ( $rtl_styles as $rtl_style ) {
$styles->add_data( $rtl_style, 'rtl', true );
$wp_scripts = new WP_Scripts();
script_concat_settings();
+ $wp_scripts->do_items( 'l10n' );
$wp_scripts->do_concat = $concatenate_scripts;
$wp_scripts->do_head_items();
register_taxonomy( 'category', 'post', array(
'hierarchical' => true,
'update_count_callback' => '_update_post_term_count',
- 'query_var' => false,
- 'rewrite' => false,
+ 'query_var' => 'category_name',
+ 'rewrite' => did_action( 'init' ) ? array(
+ 'hierarchical' => true,
+ 'slug' => get_option('category_base') ? get_option('category_base') : 'category',
+ 'with_front' => false) : false,
'public' => true,
'show_ui' => true,
'_builtin' => true,
- ) ) ;
+ ) );
register_taxonomy( 'post_tag', 'post', array(
'hierarchical' => false,
'update_count_callback' => '_update_post_term_count',
- 'query_var' => false,
- 'rewrite' => false,
+ 'query_var' => 'tag',
+ 'rewrite' => did_action( 'init' ) ? array(
+ 'slug' => get_option('tag_base') ? get_option('tag_base') : 'tag',
+ 'with_front' => false) : false,
'public' => true,
'show_ui' => true,
'_builtin' => true,
) );
register_taxonomy( 'nav_menu', 'nav_menu_item', array(
+ 'public' => false,
'hierarchical' => false,
'labels' => array(
'name' => __( 'Navigation Menus' ),
'show_ui' => false,
'_builtin' => true,
'show_in_nav_menus' => false,
- ) ) ;
+ ) );
register_taxonomy( 'link_category', 'link', array(
'hierarchical' => false,
'labels' => array(
- 'name' => __( 'Categories' ),
- 'singular_name' => __( 'Category' ),
- 'update_item' => __( 'Update Category' ),
+ 'name' => __( 'Link Categories' ),
+ 'singular_name' => __( 'Link Category' ),
+ 'search_items' => __( 'Search Link Categories' ),
+ 'popular_items' => null,
+ 'all_items' => __( 'All Link Categories' ),
+ 'edit_item' => __( 'Edit Link Category' ),
+ 'update_item' => __( 'Update Link Category' ),
+ 'add_new_item' => __( 'Add New Link Category' ),
+ 'new_item_name' => __( 'New Link Category Name' ),
+ 'separate_items_with_commas' => null,
+ 'add_or_remove_items' => null,
+ 'choose_from_most_used' => null,
),
'query_var' => false,
'rewrite' => false,
'public' => false,
'show_ui' => false,
'_builtin' => true,
- ) ) ;
+ ) );
+
+ $rewrite = false;
+ if ( did_action( 'init' ) ) {
+ $rewrite = apply_filters( 'post_format_rewrite_base', 'type' );
+ $rewrite = $rewrite ? array( 'slug' => $rewrite ) : false;
+ }
+
+ register_taxonomy( 'post_format', 'post', array(
+ 'public' => true,
+ 'hierarchical' => false,
+ 'labels' => array(
+ 'name' => _x( 'Format', 'post format' ),
+ 'singular_name' => _x( 'Format', 'post format' ),
+ ),
+ 'query_var' => true,
+ 'rewrite' => $rewrite,
+ 'show_ui' => false,
+ '_builtin' => true,
+ 'show_in_nav_menus' => false,
+ ) );
}
add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority
$args['rewrite'] = wp_parse_args($args['rewrite'], array(
'slug' => sanitize_title_with_dashes($taxonomy),
'with_front' => true,
+ 'hierarchical' => false
));
- $wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=");
- $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']);
+
+ if ( $args['hierarchical'] && $args['rewrite']['hierarchical'] )
+ $tag = '(.+?)';
+ else
+ $tag = '([^/]+)';
+
+ $wp_rewrite->add_rewrite_tag("%$taxonomy%", $tag, $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term=");
+ $wp_rewrite->add_permastruct($taxonomy, "{$wp_rewrite->root}{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']);
}
if ( is_null($args['show_ui']) )
$wp_taxonomies[$taxonomy] = (object) $args;
// register callback handling for metabox
- add_filter('wp_ajax_add-'.$taxonomy, '_wp_ajax_add_hierarchical_term');
+ add_filter('wp_ajax_add-' . $taxonomy, '_wp_ajax_add_hierarchical_term');
}
/**
'add_or_remove_items' => array( __( 'Add or remove tags' ), null ),
'choose_from_most_used' => array( __( 'Choose from the most used tags' ), null ),
);
+ $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
return _get_custom_object_labels( $tax, $nohier_vs_hier_defaults );
}
return $object_ids;
}
+/**
+ * Given a taxonomy query, generates SQL to be appended to a main query.
+ *
+ * @since 3.1.0
+ *
+ * @see WP_Tax_Query
+ *
+ * @param array $tax_query A compact tax query
+ * @param string $primary_table
+ * @param string $primary_id_column
+ * @return array
+ */
+function get_tax_sql( $tax_query, $primary_table, $primary_id_column ) {
+ $tax_query_obj = new WP_Tax_Query( $tax_query );
+ return $tax_query_obj->get_sql( $primary_table, $primary_id_column );
+}
+
+/**
+ * Container class for a multiple taxonomy query.
+ *
+ * @since 3.1.0
+ */
+class WP_Tax_Query {
+
+ /**
+ * List of taxonomy queries. A single taxonomy query is an associative array:
+ * - 'taxonomy' string The taxonomy being queried
+ * - 'terms' string|array The list of terms
+ * - 'field' string (optional) Which term field is being used.
+ * Possible values: 'term_id', 'slug' or 'name'
+ * Default: 'term_id'
+ * - 'operator' string (optional)
+ * Possible values: 'IN' and 'NOT IN'.
+ * Default: 'IN'
+ * - 'include_children' bool (optional) Whether to include child terms.
+ * Default: true
+ *
+ * @since 3.1.0
+ * @access public
+ * @var array
+ */
+ var $queries = array();
+
+ /**
+ * The relation between the queries. Can be one of 'AND' or 'OR'.
+ *
+ * @since 3.1.0
+ * @access public
+ * @var string
+ */
+ var $relation;
+
+ /**
+ * PHP4 type constructor.
+ *
+ * Parses a compact tax query and sets defaults.
+ *
+ * @since 3.1.0
+ * @access public
+ *
+ * @param array $tax_query A compact tax query:
+ * array(
+ * 'relation' => 'OR',
+ * array(
+ * 'taxonomy' => 'tax1',
+ * 'terms' => array( 'term1', 'term2' ),
+ * 'field' => 'slug',
+ * ),
+ * array(
+ * 'taxonomy' => 'tax2',
+ * 'terms' => array( 'term-a', 'term-b' ),
+ * 'field' => 'slug',
+ * ),
+ * )
+ *
+ * @return WP_Tax_Query
+ */
+ function WP_Tax_Query( $tax_query ) {
+ if ( isset( $tax_query['relation'] ) && strtoupper( $tax_query['relation'] ) == 'OR' ) {
+ $this->relation = 'OR';
+ } else {
+ $this->relation = 'AND';
+ }
+
+ $defaults = array(
+ 'taxonomy' => '',
+ 'terms' => array(),
+ 'include_children' => true,
+ 'field' => 'term_id',
+ 'operator' => 'IN',
+ );
+
+ foreach ( $tax_query as $query ) {
+ if ( ! is_array( $query ) )
+ continue;
+
+ $query = array_merge( $defaults, $query );
+
+ $query['terms'] = (array) $query['terms'];
+
+ $this->queries[] = $query;
+ }
+ }
+
+ /**
+ * Generates SQL clauses to be appended to a main query.
+ *
+ * @since 3.1.0
+ * @access public
+ *
+ * @param string $primary_table
+ * @param string $primary_id_column
+ * @return array
+ */
+ function get_sql( $primary_table, $primary_id_column ) {
+ global $wpdb;
+
+ $join = '';
+ $where = array();
+ $i = 0;
+
+ foreach ( $this->queries as $query ) {
+ extract( $query );
+
+ if ( ! taxonomy_exists( $taxonomy ) )
+ return array( 'join' => '', 'where' => ' AND 0 = 1');
+
+ $terms = array_unique( (array) $terms );
+
+ if ( empty( $terms ) )
+ continue;
+
+ if ( is_taxonomy_hierarchical( $taxonomy ) && $include_children ) {
+ $this->_transform_terms( $terms, $taxonomy, $field, 'term_id' );
+
+ $children = array();
+ foreach ( $terms as $term ) {
+ $children = array_merge( $children, get_term_children( $term, $taxonomy ) );
+ $children[] = $term;
+ }
+ $terms = $children;
+
+ $this->_transform_terms( $terms, $taxonomy, 'term_id', 'term_taxonomy_id' );
+ }
+ else {
+ $this->_transform_terms( $terms, $taxonomy, $field, 'term_taxonomy_id' );
+ }
+
+ if ( 'IN' == $operator ) {
+
+ if ( empty( $terms ) ) {
+ if ( 'OR' == $this->relation )
+ continue;
+ else
+ return array( 'join' => '', 'where' => ' AND 0 = 1' );
+ }
+
+ $terms = implode( ',', $terms );
+
+ $alias = $i ? 'tt' . $i : $wpdb->term_relationships;
+
+ $join .= " INNER JOIN $wpdb->term_relationships";
+ $join .= $i ? " AS $alias" : '';
+ $join .= " ON ($primary_table.$primary_id_column = $alias.object_id)";
+
+ $where[] = "$alias.term_taxonomy_id $operator ($terms)";
+ } elseif ( 'NOT IN' == $operator ) {
+
+ if ( empty( $terms ) )
+ continue;
+
+ $terms = implode( ',', $terms );
+
+ $where[] = "$primary_table.$primary_id_column NOT IN (
+ SELECT object_id
+ FROM $wpdb->term_relationships
+ WHERE term_taxonomy_id IN ($terms)
+ )";
+ } elseif ( 'AND' == $operator ) {
+
+ if ( empty( $terms ) )
+ continue;
+
+ $num_terms = count( $terms );
+
+ $terms = implode( ',', $terms );
+
+ $where[] = "$primary_table.$primary_id_column IN (
+ SELECT object_id
+ FROM $wpdb->term_relationships
+ WHERE term_taxonomy_id IN ($terms)
+ GROUP BY object_id HAVING COUNT(object_id) = $num_terms
+ )";
+ }
+
+ $i++;
+ }
+
+ if ( !empty( $where ) )
+ $where = ' AND ( ' . implode( " $this->relation ", $where ) . ' )';
+ else
+ $where = '';
+
+ return compact( 'join', 'where' );
+ }
+
+ /**
+ * Transforms a list of terms, from one field to another.
+ *
+ * @since 3.1.0
+ * @access private
+ *
+ * @param array &$terms The list of terms
+ * @param string $taxonomy The taxonomy of the terms
+ * @param string $field The initial field
+ * @param string $resulting_field The resulting field
+ */
+ function _transform_terms( &$terms, $taxonomy, $field, $resulting_field ) {
+ global $wpdb;
+
+ if ( empty( $terms ) )
+ return;
+
+ if ( $field == $resulting_field )
+ return;
+
+ $resulting_field = esc_sql( $resulting_field );
+
+ switch ( $field ) {
+ case 'slug':
+ case 'name':
+ $terms = "'" . implode( "','", array_map( 'sanitize_title_for_query', $terms ) ) . "'";
+ $terms = $wpdb->get_col( "
+ SELECT $wpdb->term_taxonomy.$resulting_field
+ FROM $wpdb->term_taxonomy
+ INNER JOIN $wpdb->terms USING (term_id)
+ WHERE taxonomy = '$taxonomy'
+ AND $wpdb->terms.$field IN ($terms)
+ " );
+ break;
+
+ default:
+ $terms = implode( ',', array_map( 'intval', $terms ) );
+ $terms = $wpdb->get_col( "
+ SELECT $resulting_field
+ FROM $wpdb->term_taxonomy
+ WHERE taxonomy = '$taxonomy'
+ AND term_id IN ($terms)
+ " );
+ }
+ }
+}
+
/**
* Get all Term data from database by Term ID.
*
* @uses _get_term_hierarchy()
* @uses get_term_children() Used to get the children of both $taxonomy and the parent $term
*
- * @param string $term ID of Term to get children
+ * @param string $term_id ID of Term to get children
* @param string $taxonomy Taxonomy Name
* @return array|WP_Error List of Term Objects. WP_Error returned if $taxonomy does not exist
*/
* @uses $wpdb
* @uses wp_parse_args() Merges the defaults with those defined by $args and allows for strings.
*
- * @param string|array Taxonomy name or list of Taxonomy names
+ * @param string|array $taxonomies Taxonomy name or list of Taxonomy names
* @param string|array $args The values of what to search for when returning terms
* @return array|WP_Error List of Term Objects and their children. Will return WP_Error, if any of $taxonomies do not exist.
*/
$taxonomies = array($taxonomies);
}
- foreach ( (array) $taxonomies as $taxonomy ) {
+ foreach ( $taxonomies as $taxonomy ) {
if ( ! taxonomy_exists($taxonomy) ) {
$error = & new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));
return $error;
}
}
- $in_taxonomies = "'" . implode("', '", $taxonomies) . "'";
-
$defaults = array('orderby' => 'name', 'order' => 'ASC',
'hide_empty' => true, 'exclude' => array(), 'exclude_tree' => array(), 'include' => array(),
'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '',
$args['hierarchical'] = false;
$args['pad_counts'] = false;
}
+
+ $args = apply_filters( 'get_terms_args', $args, $taxonomies );
+
extract($args, EXTR_SKIP);
if ( $child_of ) {
else
$order = '';
- $where = '';
+ $where = "tt.taxonomy IN ('" . implode("', '", $taxonomies) . "')";
$inclusions = '';
if ( !empty($include) ) {
$exclude = '';
if ( !empty( $exclude_tree ) ) {
$excluded_trunks = wp_parse_id_list($exclude_tree);
foreach ( $excluded_trunks as $extrunk ) {
- $excluded_children = (array) get_terms($taxonomies[0], array('child_of' => intval($extrunk), 'fields' => 'ids'));
+ $excluded_children = (array) get_terms($taxonomies[0], array('child_of' => intval($extrunk), 'fields' => 'ids', 'hide_empty' => 0));
$excluded_children[] = $extrunk;
foreach( $excluded_children as $exterm ) {
if ( empty($exclusions) )
}
if ( !empty($name__like) )
- $where .= " AND t.name LIKE '{$name__like}%'";
+ $where .= " AND t.name LIKE '" . like_escape( $name__like ) . "%'";
if ( '' !== $parent ) {
$parent = (int) $parent;
// don't limit the query results when we have to descend the family tree
if ( ! empty($number) && ! $hierarchical && empty( $child_of ) && '' === $parent ) {
if ( $offset )
- $limit = 'LIMIT ' . $offset . ',' . $number;
+ $limits = 'LIMIT ' . $offset . ',' . $number;
else
- $limit = 'LIMIT ' . $number;
+ $limits = 'LIMIT ' . $number;
} else {
- $limit = '';
+ $limits = '';
}
if ( !empty($search) ) {
$selects = array();
switch ( $fields ) {
- case 'all':
- $selects = array('t.*', 'tt.*');
- break;
- case 'ids':
+ case 'all':
+ $selects = array('t.*', 'tt.*');
+ break;
+ case 'ids':
case 'id=>parent':
- $selects = array('t.term_id', 'tt.parent', 'tt.count');
- break;
- case 'names':
- $selects = array('t.term_id', 'tt.parent', 'tt.count', 't.name');
- break;
- case 'count':
+ $selects = array('t.term_id', 'tt.parent', 'tt.count');
+ break;
+ case 'names':
+ $selects = array('t.term_id', 'tt.parent', 'tt.count', 't.name');
+ break;
+ case 'count':
$orderby = '';
$order = '';
- $selects = array('COUNT(*)');
- }
- $select_this = implode(', ', apply_filters( 'get_terms_fields', $selects, $args ));
+ $selects = array('COUNT(*)');
+ }
+
+ $_fields = $fields;
- $query = "SELECT $select_this FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ($in_taxonomies) $where $orderby $order $limit";
+ $fields = implode(', ', apply_filters( 'get_terms_fields', $selects, $args ));
+
+ $join = "INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id";
+
+ $pieces = array( 'fields', 'join', 'where', 'orderby', 'order', 'limits' );
+ $clauses = apply_filters( 'terms_clauses', compact( $pieces ), $taxonomies, $args );
+ foreach ( $pieces as $piece )
+ $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
+
+ $query = "SELECT $fields FROM $wpdb->terms AS t $join WHERE $where $orderby $order $limits";
+
+ $fields = $_fields;
if ( 'count' == $fields ) {
$term_count = $wpdb->get_var($query);
}
if ( empty($terms) ) {
- wp_cache_add( $cache_key, array(), 'terms' );
+ wp_cache_add( $cache_key, array(), 'terms', 86400 ); // one day
$terms = apply_filters('get_terms', array(), $taxonomies, $args);
return $terms;
}
$terms = array_slice($terms, $offset, $number);
}
- wp_cache_add( $cache_key, $terms, 'terms' );
+ wp_cache_add( $cache_key, $terms, 'terms', 86400 ); // one day
$terms = apply_filters('get_terms', $terms, $taxonomies, $args);
return $terms;
return $value;
if ( 'edit' == $context ) {
- $value = apply_filters("edit_term_$field", $value, $term_id, $taxonomy);
- $value = apply_filters("edit_${taxonomy}_$field", $value, $term_id);
+ $value = apply_filters("edit_term_{$field}", $value, $term_id, $taxonomy);
+ $value = apply_filters("edit_{$taxonomy}_{$field}", $value, $term_id);
if ( 'description' == $field )
- $value = format_to_edit($value);
+ $value = esc_html($value); // textarea_escaped
else
$value = esc_attr($value);
} else if ( 'db' == $context ) {
- $value = apply_filters("pre_term_$field", $value, $taxonomy);
- $value = apply_filters("pre_${taxonomy}_$field", $value);
+ $value = apply_filters("pre_term_{$field}", $value, $taxonomy);
+ $value = apply_filters("pre_{$taxonomy}_{$field}", $value);
// Back compat filters
if ( 'slug' == $field )
$value = apply_filters('pre_category_nicename', $value);
} else if ( 'rss' == $context ) {
- $value = apply_filters("term_${field}_rss", $value, $taxonomy);
- $value = apply_filters("${taxonomy}_${field}_rss", $value);
+ $value = apply_filters("term_{$field}_rss", $value, $taxonomy);
+ $value = apply_filters("{$taxonomy}_{$field}_rss", $value);
} else {
// Use display filters by default.
- $value = apply_filters("term_$field", $value, $term_id, $taxonomy, $context);
- $value = apply_filters("${taxonomy}_$field", $value, $term_id, $context);
+ $value = apply_filters("term_{$field}", $value, $term_id, $taxonomy, $context);
+ $value = apply_filters("{$taxonomy}_{$field}", $value, $term_id, $context);
}
if ( 'attribute' == $context )
}
/**
- * Will unlink the term from the taxonomy.
+ * Will unlink the object from the taxonomy or taxonomies.
*
- * Will remove the term's relationship to the taxonomy, not the term or taxonomy
- * itself. The term and taxonomy will still exist. Will require the term's
- * object ID to perform the operation.
+ * Will remove all relationships between the object and any terms in
+ * a particular taxonomy or taxonomies. Does not remove the term or
+ * taxonomy itself.
*
* @package WordPress
* @subpackage Taxonomy
* @uses $wpdb
*
* @param int $object_id The term Object Id that refers to the term
- * @param string|array $taxonomy List of Taxonomy Names or single Taxonomy name.
+ * @param string|array $taxonomies List of Taxonomy Names or single Taxonomy name.
*/
function wp_delete_object_term_relationships( $object_id, $taxonomies ) {
global $wpdb;
$tt_id = $ids['term_taxonomy_id'];
$defaults = array();
+
+ if ( 'category' == $taxonomy ) {
+ $defaults['default'] = get_option( 'default_category' );
+ if ( $defaults['default'] == $term )
+ return 0; // Don't delete the default category
+ }
+
$args = wp_parse_args($args, $defaults);
extract($args, EXTR_SKIP);
- if ( isset($default) ) {
+ if ( isset( $default ) ) {
$default = (int) $default;
if ( ! term_exists($default, $taxonomy) )
unset($default);
wp_set_object_terms($object, $terms, $taxonomy);
}
+ // Clean the relationship caches for all object types using this term
+ $tax_object = get_taxonomy( $taxonomy );
+ foreach ( $tax_object->object_type as $object_type )
+ clean_object_term_cache( $objects, $object_type );
+
do_action( 'delete_term_taxonomy', $tt_id );
$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $tt_id ) );
do_action( 'deleted_term_taxonomy', $tt_id );
return true;
}
+/**
+ * Deletes one existing category.
+ *
+ * @since 2.0.0
+ * @uses wp_delete_term()
+ *
+ * @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 ) {
+ return wp_delete_term( $cat_ID, 'category' );
+}
+
/**
* Retrieves the terms associated with the given object(s), in the supplied taxonomies.
*
* @since 2.3.0
* @uses $wpdb
*
- * @param int|array $object_id The id of the object(s) to retrieve.
+ * @param int|array $object_ids The ID(s) of the object(s) to retrieve.
* @param string|array $taxonomies The taxonomies to retrieve terms from.
* @param array|string $args Change what is returned
* @return array|WP_Error The requested term data or empty array if no terms found. WP_Error if $taxonomy does not exist.
* @uses $wpdb
*
* @param int $object_id The object to relate to.
- * @param array|int|string $term The slug or id of the term, will replace all existing
+ * @param array|int|string $terms The slug or id of the term, will replace all existing
* related terms in this taxonomy.
* @param array|string $taxonomy The context in which to relate the term to the object.
* @param bool $append If false will delete difference of terms.
}
}
+ // Check $parent to see if it will cause a hierarchy loop
+ $parent = apply_filters( 'wp_update_term_parent', $parent, $term_id, $taxonomy, compact( array_keys( $args ) ), $args );
+
// Check for duplicate slug
$id = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE slug = %s", $slug ) );
if ( $id && ($id != $term_id) ) {
*
* @since 2.5.0
*
+ * @uses apply_filters() Calls 'term_link' with term link and term object, and taxonomy parameters.
+ * @uses apply_filters() For the post_tag Taxonomy, Calls 'tag_link' with tag link and tag ID as parameters.
+ * @uses apply_filters() For the category Taxonomy, Calls 'category_link' filter on category link and category ID.
+ *
* @param object|int|string $term
- * @param string $taxonomy
- * @return string HTML link to taxonomy term archive
+ * @param string $taxonomy (optional if $term is object)
+ * @return string|WP_Error HTML link to taxonomy term archive on success, WP_Error if term does not exist.
*/
-function get_term_link( $term, $taxonomy ) {
+function get_term_link( $term, $taxonomy = '') {
global $wp_rewrite;
if ( !is_object($term) ) {
if ( is_wp_error( $term ) )
return $term;
- // use legacy functions for core taxonomies until they are fully plugged in
- if ( $taxonomy == 'category' )
- return get_category_link((int) $term->term_id);
- if ( $taxonomy == 'post_tag' )
- return get_tag_link((int) $term->term_id);
+ $taxonomy = $term->taxonomy;
$termlink = $wp_rewrite->get_extra_permastruct($taxonomy);
$slug = $term->slug;
+ $t = get_taxonomy($taxonomy);
if ( empty($termlink) ) {
- $t = get_taxonomy($taxonomy);
if ( $t->query_var )
$termlink = "?$t->query_var=$slug";
else
$termlink = "?taxonomy=$taxonomy&term=$slug";
$termlink = home_url($termlink);
} else {
- $termlink = str_replace("%$taxonomy%", $slug, $termlink);
+ if ( $t->rewrite['hierarchical'] ) {
+ $hierarchical_slugs = array();
+ $ancestors = get_ancestors($term->term_id, $taxonomy);
+ foreach ( (array)$ancestors as $ancestor ) {
+ $ancestor_term = get_term($ancestor, $taxonomy);
+ $hierarchical_slugs[] = $ancestor_term->slug;
+ }
+ $hierarchical_slugs = array_reverse($hierarchical_slugs);
+ $hierarchical_slugs[] = $slug;
+ $termlink = str_replace("%$taxonomy%", implode('/', $hierarchical_slugs), $termlink);
+ } else {
+ $termlink = str_replace("%$taxonomy%", $slug, $termlink);
+ }
$termlink = home_url( user_trailingslashit($termlink, 'category') );
}
+ // Back Compat filters.
+ if ( 'post_tag' == $taxonomy )
+ $termlink = apply_filters( 'tag_link', $termlink, $term->term_id );
+ elseif ( 'category' == $taxonomy )
+ $termlink = apply_filters( 'category_link', $termlink, $term->term_id );
+
return apply_filters('term_link', $termlink, $term, $taxonomy);
}
* 'before' : default is empty string. Display before taxonomies list.
* 'sep' : default is empty string. Separate every taxonomy with value in this.
* 'after' : default is empty string. Display this after the taxonomies list.
+ * 'template' : The template to use for displaying the taxonomy terms.
*
* @since 2.5.0
* @uses get_the_taxonomies()
'before' => '',
'sep' => ' ',
'after' => '',
+ 'template' => '%s: %l.'
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
- echo $before . join($sep, get_the_taxonomies($post)) . $after;
+ echo $before . join($sep, get_the_taxonomies($post, $r)) . $after;
}
/**
* @since 2.5.0
*
* @param int $post Optional. Post ID or will use Global Post ID (in loop).
+ * @param array $args Override the defaults.
* @return array
*/
-function get_the_taxonomies($post = 0) {
+function get_the_taxonomies($post = 0, $args = array() ) {
if ( is_int($post) )
$post =& get_post($post);
elseif ( !is_object($post) )
$post =& $GLOBALS['post'];
+ $args = wp_parse_args( $args, array(
+ 'template' => '%s: %l.',
+ ) );
+ extract( $args, EXTR_SKIP );
+
$taxonomies = array();
if ( !$post )
return $taxonomies;
- $template = apply_filters('taxonomy_template', '%s: %l.');
-
foreach ( get_object_taxonomies($post) as $taxonomy ) {
$t = (array) get_taxonomy($taxonomy);
if ( empty($t['label']) )
$links = array();
foreach ( $terms as $term )
- $links[] = "<a href='" . esc_attr(get_term_link($term, $taxonomy)) . "'>$term->name</a>";
+ $links[] = "<a href='" . esc_attr( get_term_link($term) ) . "'>$term->name</a>";
if ( $links )
$taxonomies[$taxonomy] = wp_sprintf($t['template'], $t['label'], $links, $terms);
* @uses get_object_term_cache()
* @uses wp_get_object_terms()
*
- * @param int $object_id. ID of the object (post ID, link ID, ...)
- * @param string $taxonomy. Single taxonomy name
+ * @param int $object_id ID of the object (post ID, link ID, ...)
+ * @param string $taxonomy Single taxonomy name
* @param int|string|array $terms Optional. Term term_id, name, slug or array of said
* @return bool|WP_Error. WP_Error on input error.
*/
* @uses get_object_taxonomies()
*
* @param string $object_type Object type string
- * @param string $taxonomy. Single taxonomy name
+ * @param string $taxonomy Single taxonomy name
* @return bool True if object is associated with the taxonomy, otherwise false.
*/
function is_object_in_taxonomy($object_type, $taxonomy) {
return false;
}
+
+/**
+ * Get an array of ancestor IDs for a given object.
+ *
+ * @param int $object_id The ID of the object
+ * @param string $object_type The type of object for which we'll be retrieving ancestors.
+ * @return array of ancestors from lowest to highest in the hierarchy.
+ */
+function get_ancestors($object_id = 0, $object_type = '') {
+ $object_id = (int) $object_id;
+
+ $ancestors = array();
+
+ if ( empty( $object_id ) ) {
+ return apply_filters('get_ancestors', $ancestors, $object_id, $object_type);
+ }
+
+ if ( is_taxonomy_hierarchical( $object_type ) ) {
+ $term = get_term($object_id, $object_type);
+ while ( ! is_wp_error($term) && ! empty( $term->parent ) && ! in_array( $term->parent, $ancestors ) ) {
+ $ancestors[] = (int) $term->parent;
+ $term = get_term($term->parent, $object_type);
+ }
+ } elseif ( null !== get_post_type_object( $object_type ) ) {
+ $object = get_post($object_id);
+ if ( ! is_wp_error( $object ) && isset( $object->ancestors ) && is_array( $object->ancestors ) )
+ $ancestors = $object->ancestors;
+ else {
+ while ( ! is_wp_error($object) && ! empty( $object->post_parent ) && ! in_array( $object->post_parent, $ancestors ) ) {
+ $ancestors[] = (int) $object->post_parent;
+ $object = get_post($object->post_parent);
+ }
+ }
+ }
+
+ return apply_filters('get_ancestors', $ancestors, $object_id, $object_type);
+}
+
+/**
+ * Returns the term's parent's term_ID
+ *
+ * @since 3.1.0
+ *
+ * @param int $term_id
+ * @param string $taxonomy
+ *
+ * @return int|bool false on error
+ */
+function wp_get_term_taxonomy_parent_id( $term_id, $taxonomy ) {
+ $term = get_term( $term_id, $taxonomy );
+ if ( !$term || is_wp_error( $term ) )
+ return false;
+ return (int) $term->parent;
+}
+
+/**
+ * Checks the given subset of the term hierarchy for hierarchy loops.
+ * Prevents loops from forming and breaks those that it finds.
+ *
+ * Attached to the wp_update_term_parent filter.
+ *
+ * @since 3.1.0
+ * @uses wp_find_hierarchy_loop()
+ *
+ * @param int $parent term_id of the parent for the term we're checking.
+ * @param int $term_id The term we're checking.
+ * @param string $taxonomy The taxonomy of the term we're checking.
+ *
+ * @return int The new parent for the term.
+ */
+function wp_check_term_hierarchy_for_loops( $parent, $term_id, $taxonomy ) {
+ // Nothing fancy here - bail
+ if ( !$parent )
+ return 0;
+
+ // Can't be its own parent
+ if ( $parent == $term_id )
+ return 0;
+
+ // Now look for larger loops
+
+ if ( !$loop = wp_find_hierarchy_loop( 'wp_get_term_taxonomy_parent_id', $term_id, $parent, array( $taxonomy ) ) )
+ return $parent; // No loop
+
+ // Setting $parent to the given value causes a loop
+ if ( isset( $loop[$term_id] ) )
+ return 0;
+
+ // There's a loop, but it doesn't contain $term_id. Break the loop.
+ foreach ( array_keys( $loop ) as $loop_member )
+ wp_update_term( $loop_member, $taxonomy, array( 'parent' => 0 ) );
+
+ return $parent;
+}
* @package WordPress
* @subpackage Theme_Compat
* @deprecated 3.0
- *
+ *
* This file is here for Backwards compatibility with old themes and will be removed in a future version
- *
+ *
*/
_deprecated_file( sprintf( __( 'Theme without %1$s' ), basename(__FILE__) ), '3.0', null, sprintf( __('Please include a %1$s template in your theme.'), basename(__FILE__) ) );
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php foreach ($comments as $comment) { ?>
<li id="comment-<?php comment_ID() ?>">
<?php comment_text() ?>
- <p><cite><?php comment_type(__('Comment'), __('Trackback'), __('Pingback')); ?> <?php printf(__('by %1$s — %2$s @ <a href="#comment-%3$s">%4$s</a>'), get_comment_author_link(), get_comment_date(), get_comment_ID(), get_comment_time()); ?></cite></p>
+ <p><cite><?php comment_type(); ?> <?php printf(__('by %1$s — %2$s @ <a href="#comment-%3$s">%4$s</a>'), get_comment_author_link(), get_comment_date(), get_comment_ID(), get_comment_time()); ?></cite></p>
</li>
<?php } // end for each comment ?>
* @package WordPress
* @subpackage Theme_Compat
* @deprecated 3.0
- *
+ *
* This file is here for Backwards compatibility with old themes and will be removed in a future version
- *
+ *
*/
_deprecated_file( sprintf( __( 'Theme without %1$s' ), basename(__FILE__) ), '3.0', null, sprintf( __('Please include a %1$s template in your theme.'), basename(__FILE__) ) );
// Do not delete these lines
if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
-
+
if ( post_password_required() ) { ?>
- <p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.'); ?></p>
+ <p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.'); ?></p>
<?php
return;
}
<h3><?php comment_form_title( __('Leave a Reply'), __('Leave a Reply to %s' ) ); ?></h3>
-<div id="cancel-comment-reply">
+<div id="cancel-comment-reply">
<small><?php cancel_comment_reply_link() ?></small>
-</div>
+</div>
<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
<p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.'), wp_login_url( get_permalink() )); ?></p>
<p><textarea name="comment" id="comment" cols="58" rows="10" tabindex="4"></textarea></p>
<p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Submit Comment'); ?>" />
-<?php comment_id_fields(); ?>
+<?php comment_id_fields(); ?>
</p>
<?php do_action('comment_form', $post->ID); ?>
* @package WordPress
* @subpackage Theme_Compat
* @deprecated 3.0
- *
+ *
* This file is here for Backwards compatibility with old themes and will be removed in a future version
- *
+ *
*/
_deprecated_file( sprintf( __( 'Theme without %1$s' ), basename(__FILE__) ), '3.0', null, sprintf( __('Please include a %1$s template in your theme.'), basename(__FILE__) ) );
?>
* @package WordPress
* @subpackage Theme_Compat
* @deprecated 3.0
- *
+ *
* This file is here for Backwards compatibility with old themes and will be removed in a future version
- *
+ *
*/
_deprecated_file( sprintf( __( 'Theme without %1$s' ), basename(__FILE__) ), '3.0', null, sprintf( __('Please include a %1$s template in your theme.'), basename(__FILE__) ) );
?>
* @package WordPress
* @subpackage Theme_Compat
* @deprecated 3.0
- *
+ *
* This file is here for Backwards compatibility with old themes and will be removed in a future version
- *
+ *
*/
_deprecated_file( sprintf( __( 'Theme without %1$s' ), basename(__FILE__) ), '3.0', null, sprintf( __('Please include a %1$s template in your theme.'), basename(__FILE__) ) );
?>
* The description will have the tags filtered with the following HTML elements
* whitelisted. The <b>'a'</b> element with the <em>href</em> and <em>title</em>
* attributes. The <b>abbr</b> element with the <em>title</em> attribute. The
- * <b>acronym<b> element with the <em>title</em> attribute allowed. The
+ * <b>acronym</b> element with the <em>title</em> attribute allowed. The
* <b>code</b>, <b>em</b>, and <b>strong</b> elements also allowed.
*
* The style.css file must contain theme name, theme URI, and description. The
if ( empty( $theme_data['AuthorURI'] ) ) {
$theme_data['Author'] = $theme_data['AuthorName'];
} else {
- $theme_data['Author'] = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $theme_data['AuthorURI'], __( 'Visit author homepage' ), $theme_data['AuthorName'] );
+ $theme_data['Author'] = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', $theme_data['AuthorURI'], esc_attr__( 'Visit author homepage' ), $theme_data['AuthorName'] );
}
}
if ( isset($wp_themes) )
return $wp_themes;
- /* Register the default root as a theme directory */
- register_theme_directory( get_theme_root() );
-
if ( !$theme_files = search_theme_directories() )
return false;
$template_files = array_unique($template_files);
$stylesheet_files = array_unique($stylesheet_files);
- $template_dir = dirname($template_files[0]);
- $stylesheet_dir = dirname($stylesheet_files[0]);
+ $template_dir = $template_directory;
+ $stylesheet_dir = $theme_root . '/' . $stylesheet;
if ( empty($template_dir) )
$template_dir = '/';
// Check for theme name collision. This occurs if a theme is copied to
// a new theme directory and the theme header is not updated. Whichever
// theme is first keeps the name. Subsequent themes get a suffix applied.
- // The Default and Classic themes always trump their pretenders.
+ // The Twenty Ten, Default and Classic themes always trump their pretenders.
if ( isset($wp_themes[$name]) ) {
- if ( ('WordPress Default' == $name || 'WordPress Classic' == $name) &&
- ('default' == $stylesheet || 'classic' == $stylesheet) ) {
+ $trump_cards = array(
+ 'classic' => 'WordPress Classic',
+ 'default' => 'WordPress Default',
+ 'twentyten' => 'Twenty Ten',
+ );
+ if ( isset( $trump_cards[ $stylesheet ] ) && $name == $trump_cards[ $stylesheet ] ) {
// If another theme has claimed to be one of our default themes, move
// them aside.
$suffix = $wp_themes[$name]['Stylesheet'];
*
* @since 2.9.0
*
- * @return array Theme roots
+ * @return array|string An arry of theme roots keyed by template/stylesheet or a single theme root if all themes have the same root.
*/
function get_theme_roots() {
+ global $wp_theme_directories;
+
+ if ( count($wp_theme_directories) <= 1 )
+ return '/themes';
+
$theme_roots = get_site_transient( 'theme_roots' );
if ( false === $theme_roots ) {
get_themes();
$theme_names = array_keys($themes);
$current_template = get_option('template');
$current_stylesheet = get_option('stylesheet');
- $current_theme = 'WordPress Default';
+ $current_theme = 'Twenty Ten';
if ( $themes ) {
foreach ( (array) $theme_names as $theme_name ) {
while ( ($theme_dir = readdir($themes_dir)) !== false ) {
if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) {
- if ( $theme_dir{0} == '.' || $theme_dir == 'CVS' )
+ if ( $theme_dir[0] == '.' || $theme_dir == 'CVS' )
continue;
$stylish_dir = @opendir($theme_root . '/' . $theme_dir);
$found_subdir_themes = false;
while ( ($theme_subdir = readdir($theme_subdirs)) !== false ) {
if ( is_dir( $subdir . '/' . $theme_subdir) && is_readable($subdir . '/' . $theme_subdir) ) {
- if ( $theme_subdir{0} == '.' || $theme_subdir == 'CVS' )
+ if ( $theme_subdir[0] == '.' || $theme_subdir == 'CVS' )
continue;
$stylish_dir = @opendir($subdir . '/' . $theme_subdir);
* Does not have trailing slash.
*
* @since 1.5.0
- * @param $stylesheet_or_template The stylesheet or template name of the theme
* @uses apply_filters() Calls 'theme_root' filter on path.
*
+ * @param string $stylesheet_or_template The stylesheet or template name of the theme
* @return string Theme path.
*/
function get_theme_root( $stylesheet_or_template = false ) {
- if ($stylesheet_or_template) {
- $theme_roots = get_theme_roots();
-
- if ( ! empty( $theme_roots[$stylesheet_or_template] ) )
- $theme_root = WP_CONTENT_DIR . $theme_roots[$stylesheet_or_template];
+ if ( $stylesheet_or_template ) {
+ if ( $theme_root = get_raw_theme_root($stylesheet_or_template) )
+ $theme_root = WP_CONTENT_DIR . $theme_root;
else
$theme_root = WP_CONTENT_DIR . '/themes';
} else {
* Does not have trailing slash.
*
* @since 1.5.0
- * @param $stylesheet_or_template The stylesheet or template name of the theme
*
+ * @param string $stylesheet_or_template The stylesheet or template name of the theme
* @return string Themes URI.
*/
function get_theme_root_uri( $stylesheet_or_template = false ) {
- $theme_roots = get_theme_roots();
-
- if ( isset( $theme_roots[$stylesheet_or_template] ) && $theme_roots[$stylesheet_or_template] )
- $theme_root_uri = content_url( $theme_roots[$stylesheet_or_template] );
- else
+ if ( $stylesheet_or_template ) {
+ if ( $theme_root = get_raw_theme_root($stylesheet_or_template) )
+ $theme_root_uri = content_url( $theme_root );
+ else
+ $theme_root_uri = content_url( 'themes' );
+ } else {
$theme_root_uri = content_url( 'themes' );
+ }
return apply_filters( 'theme_root_uri', $theme_root_uri, get_option('siteurl'), $stylesheet_or_template );
}
/**
- * Retrieve path to file without the use of extension.
+ * Get the raw theme root relative to the content directory with no filters applied.
*
- * Used to quickly retrieve the path of file without including the file
- * extension. It will also check the parent template, if the file exists, with
- * the use of {@link locate_template()}. Allows for more generic file location
- * without the use of the other get_*_template() functions.
+ * @since 3.1.0
+ *
+ * @param string $stylesheet_or_template The stylesheet or template name of the theme
+ * @return string Theme root
+ */
+function get_raw_theme_root( $stylesheet_or_template, $no_cache = false ) {
+ global $wp_theme_directories;
+
+ if ( count($wp_theme_directories) <= 1 )
+ return '/themes';
+
+ $theme_root = false;
+
+ // If requesting the root for the current theme, consult options to avoid calling get_theme_roots()
+ if ( !$no_cache ) {
+ if ( get_option('stylesheet') == $stylesheet_or_template )
+ $theme_root = get_option('stylesheet_root');
+ elseif ( get_option('template') == $stylesheet_or_template )
+ $theme_root = get_option('template_root');
+ }
+
+ if ( empty($theme_root) ) {
+ $theme_roots = get_theme_roots();
+ if ( !empty($theme_roots[$stylesheet_or_template]) )
+ $theme_root = $theme_roots[$stylesheet_or_template];
+ }
+
+ return $theme_root;
+}
+
+/**
+ * Retrieve path to a template
*
- * Can be used with include() or require() to retrieve path.
- * <code>
- * if( '' != get_query_template( '404' ) )
- * include( get_query_template( '404' ) );
- * </code>
- * or the same can be accomplished with
- * <code>
- * if( '' != get_404_template() )
- * include( get_404_template() );
- * </code>
+ * Used to quickly retrieve the path of a template without including the file
+ * extension. It will also check the parent theme, if the file exists, with
+ * the use of {@link locate_template()}. Allows for more generic template location
+ * without the use of the other get_*_template() functions.
*
* @since 1.5.0
*
* @param string $type Filename without extension.
+ * @param array $templates An optional list of template candidates
* @return string Full path to file.
*/
-function get_query_template($type) {
+function get_query_template( $type, $templates = array() ) {
$type = preg_replace( '|[^a-z0-9-]+|', '', $type );
- return apply_filters("{$type}_template", locate_template(array("{$type}.php")));
+
+ if ( empty( $templates ) )
+ $templates = array("{$type}.php");
+
+ return apply_filters( "{$type}_template", locate_template( $templates ) );
}
/**
* @return string
*/
function get_archive_template() {
- return get_query_template('archive');
+ $post_type = get_query_var( 'post_type' );
+
+ $templates = array();
+
+ if ( $post_type )
+ $templates[] = "archive-{$post_type}.php";
+ $templates[] = 'archive.php';
+
+ return get_query_template( 'archive', $templates );
}
/**
* @return string
*/
function get_author_template() {
- $author_id = absint( get_query_var( 'author' ) );
- $author = get_user_by( 'id', $author_id );
- $author = $author->user_nicename;
+ $author = get_queried_object();
$templates = array();
- if ( $author )
- $templates[] = "author-{$author}.php";
- if ( $author_id )
- $templates[] = "author-{$author_id}.php";
+ $templates[] = "author-{$author->user_nicename}.php";
+ $templates[] = "author-{$author->ID}.php";
$templates[] = 'author.php';
- $template = locate_template( $templates );
- return apply_filters( 'author_template', $template );
+ return get_query_template( 'author', $templates );
}
/**
* @return string
*/
function get_category_template() {
- $cat_ID = absint( get_query_var('cat') );
- $category = get_category( $cat_ID );
+ $category = get_queried_object();
$templates = array();
- if ( !is_wp_error($category) )
- $templates[] = "category-{$category->slug}.php";
-
- $templates[] = "category-$cat_ID.php";
+ $templates[] = "category-{$category->slug}.php";
+ $templates[] = "category-{$category->term_id}.php";
$templates[] = "category.php";
- $template = locate_template($templates);
- return apply_filters('category_template', $template);
+ return get_query_template( 'category', $templates );
}
/**
* @return string
*/
function get_tag_template() {
- $tag_id = absint( get_query_var('tag_id') );
- $tag_name = get_query_var('tag');
+ $tag = get_queried_object();
$templates = array();
- if ( $tag_name )
- $templates[] = "tag-$tag_name.php";
- if ( $tag_id )
- $templates[] = "tag-$tag_id.php";
+ $templates[] = "tag-{$tag->slug}.php";
+ $templates[] = "tag-{$tag->term_id}.php";
$templates[] = "tag.php";
- $template = locate_template($templates);
- return apply_filters('tag_template', $template);
+ return get_query_template( 'tag', $templates );
}
/**
* template is used. If none of the files exist, then it will fall back on to
* index.php.
*
- * @since unknown (2.6.0 most likely)
+ * @since 2.5.0
* @uses apply_filters() Calls 'taxonomy_template' filter on found path.
*
* @return string
*/
function get_taxonomy_template() {
- $taxonomy = get_query_var('taxonomy');
- $term = get_query_var('term');
+ $term = get_queried_object();
+ $taxonomy = $term->taxonomy;
$templates = array();
- if ( $taxonomy && $term )
- $templates[] = "taxonomy-$taxonomy-$term.php";
- if ( $taxonomy )
- $templates[] = "taxonomy-$taxonomy.php";
+ $templates[] = "taxonomy-$taxonomy-{$term->slug}.php";
+ $templates[] = "taxonomy-$taxonomy.php";
$templates[] = "taxonomy.php";
- $template = locate_template($templates);
- return apply_filters('taxonomy_template', $template);
+ return get_query_template( 'taxonomy', $templates );
}
/**
* @return string
*/
function get_home_template() {
- $template = locate_template(array('home.php', 'index.php'));
- return apply_filters('home_template', $template);
+ $templates = array( 'home.php', 'index.php' );
+
+ return get_query_template( 'home', $templates );
}
/**
* @return string
*/
function get_front_page_template() {
- return apply_filters( 'front_page_template', locate_template( array('front-page.php') ) );
+ $templates = array('front-page.php');
+
+ return get_query_template( 'front_page', $templates );
}
/**
* @return string
*/
function get_page_template() {
- global $wp_query;
-
- $id = (int) $wp_query->get_queried_object_id();
+ $id = get_queried_object_id();
$template = get_post_meta($id, '_wp_page_template', true);
$pagename = get_query_var('pagename');
if ( !$pagename && $id > 0 ) {
// If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
- $post = $wp_query->get_queried_object();
+ $post = get_queried_object();
$pagename = $post->post_name;
}
$templates[] = "page-$id.php";
$templates[] = "page.php";
- return apply_filters('page_template', locate_template($templates));
+ return get_query_template( 'page', $templates );
}
/**
* @return string
*/
function get_single_template() {
- global $wp_query;
+ $object = get_queried_object();
- $object = $wp_query->get_queried_object();
- $templates = array('single-' . $object->post_type . '.php', 'single.php');
- return apply_filters('single_template', locate_template($templates));
+ $templates = array();
+
+ $templates[] = "single-{$object->post_type}.php";
+ $templates[] = "single.php";
+
+ return get_query_template( 'single', $templates );
}
/**
* @return string
*/
function get_comments_popup_template() {
- $template = locate_template(array("comments-popup.php"));
+ $template = get_query_template( 'comments_popup', array( 'comments-popup.php' ) );
// Backward compat code will be removed in a future release
if ('' == $template)
$template = ABSPATH . WPINC . '/theme-compat/comments-popup.php';
- return apply_filters('comments_popup_template', $template);
+ return $template;
}
/**
*
* @since 2.7.0
*
- * @param array $template_names Array of template files to search for in priority order.
+ * @param string|array $template_names Template file(s) to search for, in order.
* @param bool $load If true the template file will be loaded if it is found.
* @param bool $require_once Whether to require_once or require. Default true. Has no effect if $load is false.
* @return string The template filename if one is located.
*/
function locate_template($template_names, $load = false, $require_once = true ) {
- if ( !is_array($template_names) )
- return '';
-
$located = '';
- foreach ( $template_names as $template_name ) {
+ foreach ( (array) $template_names as $template_name ) {
if ( !$template_name )
continue;
if ( file_exists(STYLESHEETPATH . '/' . $template_name)) {
if ( !current_user_can( 'switch_themes' ) )
return;
+ // Admin Thickbox requests
+ if ( isset( $_GET['preview_iframe'] ) )
+ show_admin_bar( false );
+
$_GET['template'] = preg_replace('|[^a-z0-9_./-]|i', '', $_GET['template']);
if ( validate_file($_GET['template']) )
/**
* Switches current theme to new template and stylesheet names.
*
- * @since unknown
+ * @since 2.5.0
* @uses do_action() Calls 'switch_theme' action on updated theme display name.
*
* @param string $template Template name
* @param string $stylesheet Stylesheet name.
*/
function switch_theme($template, $stylesheet) {
+ global $wp_theme_directories;
+
update_option('template', $template);
update_option('stylesheet', $stylesheet);
+ if ( count($wp_theme_directories) > 1 ) {
+ update_option('template_root', get_raw_theme_root($template, true));
+ update_option('stylesheet_root', get_raw_theme_root($stylesheet, true));
+ }
delete_option('current_theme');
$theme = get_current_theme();
+ if ( is_admin() && false === get_option( "theme_mods_$stylesheet" ) ) {
+ $default_theme_mods = (array) get_option( "mods_$theme" );
+ add_option( "theme_mods_$stylesheet", $default_theme_mods );
+ }
do_action('switch_theme', $theme);
}
return false;
}
+ if ( is_child_theme() && ! file_exists( get_stylesheet_directory() . '/style.css' ) ) {
+ switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME );
+ return false;
+ }
+
return true;
}
+/**
+ * Retrieve all theme modifications.
+ *
+ * @since 3.1.0
+ *
+ * @return array Theme modifications.
+ */
+function get_theme_mods() {
+ $theme_slug = get_option( 'stylesheet' );
+ if ( false === ( $mods = get_option( "theme_mods_$theme_slug" ) ) ) {
+ $theme_name = get_current_theme();
+ $mods = get_option( "mods_$theme_name" ); // Deprecated location.
+ if ( is_admin() && false !== $mods ) {
+ update_option( "theme_mods_$theme_slug", $mods );
+ delete_option( "mods_$theme_name" );
+ }
+ }
+ return $mods;
+}
+
/**
* Retrieve theme modification value for the current theme.
*
* @param bool|string $default
* @return string
*/
-function get_theme_mod($name, $default = false) {
- $theme = get_current_theme();
-
- $mods = get_option( "mods_$theme" );
+function get_theme_mod( $name, $default = false ) {
+ $mods = get_theme_mods();
- if ( isset($mods[$name]) )
- return apply_filters( "theme_mod_$name", $mods[$name] );
+ if ( isset( $mods[ $name ] ) )
+ return apply_filters( "theme_mod_$name", $mods[ $name ] );
- return apply_filters( "theme_mod_$name", sprintf($default, get_template_directory_uri(), get_stylesheet_directory_uri()) );
+ return apply_filters( "theme_mod_$name", sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() ) );
}
/**
* @param string $name Theme modification name.
* @param string $value theme modification value.
*/
-function set_theme_mod($name, $value) {
- $theme = get_current_theme();
-
- $mods = get_option("mods_$theme");
+function set_theme_mod( $name, $value ) {
+ $mods = get_theme_mods();
- $mods[$name] = $value;
+ $mods[ $name ] = $value;
- update_option("mods_$theme", $mods);
- wp_cache_delete("mods_$theme", 'options');
+ $theme = get_option( 'stylesheet' );
+ update_option( "theme_mods_$theme", $mods );
}
/**
* @return null
*/
function remove_theme_mod( $name ) {
- $theme = get_current_theme();
-
- $mods = get_option("mods_$theme");
+ $mods = get_theme_mods();
- if ( !isset($mods[$name]) )
+ if ( ! isset( $mods[ $name ] ) )
return;
- unset($mods[$name]);
+ unset( $mods[ $name ] );
- if ( empty($mods) )
+ if ( empty( $mods ) )
return remove_theme_mods();
- update_option("mods_$theme", $mods);
- wp_cache_delete("mods_$theme", 'options');
+ $theme = get_option( 'stylesheet' );
+ update_option( "theme_mods_$theme", $mods );
}
/**
* @since 2.1.0
*/
function remove_theme_mods() {
- $theme = get_current_theme();
-
- delete_option("mods_$theme");
+ delete_option( 'theme_mods_' . get_option( 'stylesheet' ) );
+ delete_option( 'mods_' . get_current_theme() );
}
/**
* @return string
*/
function get_header_image() {
- $default = defined('HEADER_IMAGE') ? HEADER_IMAGE : '';
+ $default = defined( 'HEADER_IMAGE' ) ? HEADER_IMAGE : '';
- return get_theme_mod('header_image', $default);
+ $url = get_theme_mod( 'header_image', $default );
+
+ if ( is_ssl() )
+ $url = str_replace( 'http://', 'https://', $url );
+ else
+ $url = str_replace( 'https://', 'http://', $url );
+
+ return $url;
}
/**
* @param callback $admin_header_callback Call on custom header administration screen.
* @param callback $admin_image_div_callback Output a custom header image div on the custom header administration screen. Optional.
*/
-function add_custom_image_header($header_callback, $admin_header_callback, $admin_image_div_callback = '') {
- if ( ! empty($header_callback) )
+function add_custom_image_header( $header_callback, $admin_header_callback, $admin_image_div_callback = '' ) {
+ if ( ! empty( $header_callback ) )
add_action('wp_head', $header_callback);
- add_theme_support( 'custom-header' );
+ add_theme_support( 'custom-header', array( 'callback' => $header_callback ) );
+ add_theme_support( 'custom-header-uploads' );
if ( ! is_admin() )
return;
- require_once(ABSPATH . 'wp-admin/custom-header.php');
- $GLOBALS['custom_image_header'] =& new Custom_Image_Header($admin_header_callback, $admin_image_div_callback);
- add_action('admin_menu', array(&$GLOBALS['custom_image_header'], 'init'));
+
+ global $custom_image_header;
+
+ require_once( ABSPATH . 'wp-admin/custom-header.php' );
+ $custom_image_header = new Custom_Image_Header( $admin_header_callback, $admin_image_div_callback );
+ add_action( 'admin_menu', array( &$custom_image_header, 'init' ) );
+}
+
+/**
+ * Remove image header support.
+ *
+ * @since 3.1.0
+ * @see add_custom_image_header()
+ *
+ * @return bool Whether support was removed.
+ */
+function remove_custom_image_header() {
+ if ( ! current_theme_supports( 'custom-header' ) )
+ return false;
+
+ $callback = get_theme_support( 'custom-header' );
+ remove_action( 'wp_head', $callback[0]['callback'] );
+ _remove_theme_support( 'custom-header' );
+ remove_theme_support( 'custom-header-uploads' );
+
+ if ( is_admin() ) {
+ remove_action( 'admin_menu', array( &$GLOBALS['custom_image_header'], 'init' ) );
+ unset( $GLOBALS['custom_image_header'] );
+ }
+
+ return true;
}
/**
* @see register_default_headers()
* @since 3.0.0
*
- * @param string|array The header string id (key of array) to remove, or an array thereof.
+ * @param string|array $header The header string id (key of array) to remove, or an array thereof.
* @return True on success, false on failure.
*/
function unregister_default_headers( $header ) {
* @param callback $admin_header_callback Call on custom background administration screen.
* @param callback $admin_image_div_callback Output a custom background image div on the custom background administration screen. Optional.
*/
-function add_custom_background($header_callback = '', $admin_header_callback = '', $admin_image_div_callback = '') {
- if ( isset($GLOBALS['custom_background']) )
+function add_custom_background( $header_callback = '', $admin_header_callback = '', $admin_image_div_callback = '' ) {
+ if ( isset( $GLOBALS['custom_background'] ) )
return;
- if ( empty($header_callback) )
+ if ( empty( $header_callback ) )
$header_callback = '_custom_background_cb';
- add_action('wp_head', $header_callback);
+ add_action( 'wp_head', $header_callback );
- add_theme_support( 'custom-background' );
+ add_theme_support( 'custom-background', array( 'callback' => $header_callback ) );
if ( ! is_admin() )
return;
- require_once(ABSPATH . 'wp-admin/custom-background.php');
- $GLOBALS['custom_background'] =& new Custom_Background($admin_header_callback, $admin_image_div_callback);
- add_action('admin_menu', array(&$GLOBALS['custom_background'], 'init'));
+ require_once( ABSPATH . 'wp-admin/custom-background.php' );
+ $GLOBALS['custom_background'] =& new Custom_Background( $admin_header_callback, $admin_image_div_callback );
+ add_action( 'admin_menu', array( &$GLOBALS['custom_background'], 'init' ) );
+}
+
+/**
+ * Remove custom background support.
+ *
+ * @since 3.1.0
+ * @see add_custom_background()
+ *
+ * @return bool Whether support was removed.
+ */
+function remove_custom_background() {
+ if ( ! current_theme_supports( 'custom-background' ) )
+ return false;
+
+ $callback = get_theme_support( 'custom-background' );
+ remove_action( 'wp_head', $callback[0]['callback'] );
+ _remove_theme_support( 'custom-background' );
+
+ if ( is_admin() ) {
+ remove_action( 'admin_menu', array( &$GLOBALS['custom_background'], 'init' ) );
+ unset( $GLOBALS['custom_background'] );
+ }
+
+ return true;
}
/**
* the theme root. It also accepts an array of stylesheets.
* It is optional and defaults to 'editor-style.css'.
*
+ * Supports RTL stylesheets automatically by searching for the -rtl prefix, e.g.
+ * editor-style-rtl.css. If an array of stylesheets is passed to add_editor_style(),
+ * RTL is only added for the first stylesheet.
+ *
* @since 3.0.0
*
* @param mixed $stylesheet Optional. Stylesheet name or array thereof, relative to theme root.
$editor_styles = array_merge( $editor_styles, $stylesheet );
}
+/**
+ * Removes all visual editor stylesheets.
+ *
+ * @since 3.1.0
+ *
+ * @return bool True on success, false if there were no stylesheets to remove.
+ */
+function remove_editor_styles() {
+ if ( ! current_theme_supports( 'editor-style' ) )
+ return false;
+ _remove_theme_support( 'editor-style' );
+ if ( is_admin() )
+ $GLOBALS['editor_styles'] = array();
+ return true;
+}
+
/**
* Allows a theme to register its support of a certain feature
*
$_wp_theme_features[$feature] = true;
else
$_wp_theme_features[$feature] = array_slice( func_get_args(), 1 );
+
+ if ( $feature == 'post-formats' && is_array( $_wp_theme_features[$feature][0] ) )
+ $_wp_theme_features[$feature][0] = array_intersect( $_wp_theme_features[$feature][0], array_keys( get_post_format_slugs() ) );
+}
+
+/**
+ * Gets the theme support arguments passed when registering that support
+ *
+ * @since 3.1
+ * @param string $feature the feature to check
+ * @return array The array of extra arguments
+ */
+function get_theme_support( $feature ) {
+ global $_wp_theme_features;
+ if ( !isset( $_wp_theme_features[$feature] ) )
+ return false;
+ else
+ return $_wp_theme_features[$feature];
}
/**
// Blacklist: for internal registrations not used directly by themes.
if ( in_array( $feature, array( 'custom-background', 'custom-header', 'editor-style', 'widgets', 'menus' ) ) )
return false;
+ return _remove_theme_support( $feature );
+}
+/**
+ * Do not use. Removes theme support internally, ignorant of the blacklist.
+ *
+ * @access private
+ * @since 3.1.0
+ */
+function _remove_theme_support( $feature ) {
global $_wp_theme_features;
if ( ! isset( $_wp_theme_features[$feature] ) )
else
$mysql_version = 'N/A';
- $num_blogs = 1;
- $wp_install = home_url( '/' );
- $multisite_enabled = 0;
- $user_count = count_users( );
if ( is_multisite( ) ) {
+ $user_count = get_user_count( );
$num_blogs = get_blog_count( );
$wp_install = network_site_url( );
$multisite_enabled = 1;
+ } else {
+ $user_count = count_users( );
+ $multisite_enabled = 0;
+ $num_blogs = 1;
+ $wp_install = home_url( '/' );
}
$local_package = isset( $wp_local_package )? $wp_local_package : '';
*
* @package WordPress
* @since 2.3.0
- * @uses $wp_version Used to notidy the WordPress version.
+ * @uses $wp_version Used to notify the WordPress version.
*
* @return mixed Returns null if update is unsupported. Returns false if check is too soon.
*/
*
* @package WordPress
* @since 2.7.0
- * @uses $wp_version Used to notidy the WordPress version.
+ * @uses $wp_version Used to notify the WordPress version.
*
* @return mixed Returns null if update is unsupported. Returns false if check is too soon.
*/
wp_update_themes();
}
+/**
+ * Schedule core, theme, and plugin update checks.
+ *
+ * @since 3.1.0
+ */
+function wp_schedule_update_checks() {
+ if ( !wp_next_scheduled('wp_version_check') && !defined('WP_INSTALLING') )
+ wp_schedule_event(time(), 'twicedaily', 'wp_version_check');
+
+ if ( !wp_next_scheduled('wp_update_plugins') && !defined('WP_INSTALLING') )
+ wp_schedule_event(time(), 'twicedaily', 'wp_update_plugins');
+
+ if ( !wp_next_scheduled('wp_update_themes') && !defined('WP_INSTALLING') )
+ wp_schedule_event(time(), 'twicedaily', 'wp_update_themes');
+}
+
+if ( ! is_main_site() )
+ return;
+
add_action( 'admin_init', '_maybe_update_core' );
add_action( 'wp_version_check', 'wp_version_check' );
add_action( 'admin_init', '_maybe_update_themes' );
add_action( 'wp_update_themes', 'wp_update_themes' );
-if ( !wp_next_scheduled('wp_version_check') && !defined('WP_INSTALLING') )
- wp_schedule_event(time(), 'twicedaily', 'wp_version_check');
-
-if ( !wp_next_scheduled('wp_update_plugins') && !defined('WP_INSTALLING') )
- wp_schedule_event(time(), 'twicedaily', 'wp_update_plugins');
-
-if ( !wp_next_scheduled('wp_update_themes') && !defined('WP_INSTALLING') )
- wp_schedule_event(time(), 'twicedaily', 'wp_update_themes');
+add_action('init', 'wp_schedule_update_checks');
?>
if ( '' === $secure_cookie )
$secure_cookie = is_ssl();
+ $secure_cookie = apply_filters('secure_signon_cookie', $secure_cookie, $credentials);
+
global $auth_secure_cookie; // XXX ugly hack to pass this to wp_authenticate_cookie
$auth_secure_cookie = $secure_cookie;
return $userdata;
if ( !wp_check_password($password, $userdata->user_pass, $userdata->ID) )
- return new WP_Error('incorrect_password', sprintf(__('<strong>ERROR</strong>: Incorrect password. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), site_url('wp-login.php?action=lostpassword', 'login')));
+ return new WP_Error( 'incorrect_password', sprintf( __( '<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s" title="Password Lost and Found">Lost your password</a>?' ),
+ $username, site_url( 'wp-login.php?action=lostpassword', 'login' ) ) );
$user = new WP_User($userdata->ID);
return $user;
* Number of posts written by a list of users.
*
* @since 3.0.0
- * @param array $userid User ID number list.
+ * @param array $users User ID number list.
* @return array Amount of posts each user has written.
*/
function count_many_users_posts($users) {
}
/**
- * Get users for the blog.
+ * WordPress User Query class.
*
- * For setups that use the multi-blog feature. Can be used outside of the
- * multi-blog feature.
+ * @since 3.1.0
+ */
+class WP_User_Query {
+
+ /**
+ * List of found user ids
+ *
+ * @since 3.1.0
+ * @access private
+ * @var array
+ */
+ var $results;
+
+ /**
+ * Total number of found users for the current query
+ *
+ * @since 3.1.0
+ * @access private
+ * @var int
+ */
+ var $total_users = 0;
+
+ // SQL clauses
+ var $query_fields;
+ var $query_from;
+ var $query_where;
+ var $query_orderby;
+ var $query_limit;
+
+ /**
+ * PHP4 constructor
+ */
+ function WP_User_Query( $query = null ) {
+ $this->__construct( $query );
+ }
+
+ /**
+ * PHP5 constructor
+ *
+ * @since 3.1.0
+ *
+ * @param string|array $args The query variables
+ * @return WP_User_Query
+ */
+ function __construct( $query = null ) {
+ if ( !empty( $query ) ) {
+ $this->query_vars = wp_parse_args( $query, array(
+ 'blog_id' => $GLOBALS['blog_id'],
+ 'role' => '',
+ 'meta_key' => '',
+ 'meta_value' => '',
+ 'meta_compare' => '',
+ 'include' => array(),
+ 'exclude' => array(),
+ 'search' => '',
+ 'orderby' => 'login',
+ 'order' => 'ASC',
+ 'offset' => '', 'number' => '',
+ 'count_total' => true,
+ 'fields' => 'all',
+ 'who' => ''
+ ) );
+
+ $this->prepare_query();
+ $this->query();
+ }
+ }
+
+ /**
+ * Prepare the query variables
+ *
+ * @since 3.1.0
+ * @access private
+ */
+ function prepare_query() {
+ global $wpdb;
+
+ $qv = &$this->query_vars;
+
+ if ( is_array( $qv['fields'] ) ) {
+ $qv['fields'] = array_unique( $qv['fields'] );
+
+ $this->query_fields = array();
+ foreach ( $qv['fields'] as $field )
+ $this->query_fields[] = $wpdb->users . '.' . esc_sql( $field );
+ $this->query_fields = implode( ',', $this->query_fields );
+ } elseif ( 'all' == $qv['fields'] ) {
+ $this->query_fields = "$wpdb->users.*";
+ } else {
+ $this->query_fields = "$wpdb->users.ID";
+ }
+
+ $this->query_from = "FROM $wpdb->users";
+ $this->query_where = "WHERE 1=1";
+
+ // sorting
+ if ( in_array( $qv['orderby'], array('nicename', 'email', 'url', 'registered') ) ) {
+ $orderby = 'user_' . $qv['orderby'];
+ } elseif ( in_array( $qv['orderby'], array('user_nicename', 'user_email', 'user_url', 'user_registered') ) ) {
+ $orderby = $qv['orderby'];
+ } elseif ( 'name' == $qv['orderby'] || 'display_name' == $qv['orderby'] ) {
+ $orderby = 'display_name';
+ } elseif ( 'post_count' == $qv['orderby'] ) {
+ // todo: avoid the JOIN
+ $where = get_posts_by_author_sql('post');
+ $this->query_from .= " LEFT OUTER JOIN (
+ SELECT post_author, COUNT(*) as post_count
+ FROM wp_posts
+ $where
+ GROUP BY post_author
+ ) p ON ({$wpdb->users}.ID = p.post_author)
+ ";
+ $orderby = 'post_count';
+ } elseif ( 'ID' == $qv['orderby'] || 'id' == $qv['orderby'] ) {
+ $orderby = 'ID';
+ } else {
+ $orderby = 'user_login';
+ }
+
+ $qv['order'] = strtoupper( $qv['order'] );
+ if ( 'ASC' == $qv['order'] )
+ $order = 'ASC';
+ else
+ $order = 'DESC';
+ $this->query_orderby = "ORDER BY $orderby $order";
+
+ // limit
+ if ( $qv['number'] ) {
+ if ( $qv['offset'] )
+ $this->query_limit = $wpdb->prepare("LIMIT %d, %d", $qv['offset'], $qv['number']);
+ else
+ $this->query_limit = $wpdb->prepare("LIMIT %d", $qv['number']);
+ }
+
+ $search = trim( $qv['search'] );
+ if ( $search ) {
+ $leading_wild = ( ltrim($search, '*') != $search );
+ $trailing_wild = ( rtrim($search, '*') != $search );
+ if ( $leading_wild && $trailing_wild )
+ $wild = 'both';
+ elseif ( $leading_wild )
+ $wild = 'leading';
+ elseif ( $trailing_wild )
+ $wild = 'trailing';
+ else
+ $wild = false;
+ if ( $wild )
+ $search = trim($search, '*');
+
+ if ( false !== strpos( $search, '@') )
+ $search_columns = array('user_email');
+ elseif ( is_numeric($search) )
+ $search_columns = array('user_login', 'ID');
+ elseif ( preg_match('|^https?://|', $search) )
+ $search_columns = array('user_url');
+ else
+ $search_columns = array('user_login', 'user_nicename');
+
+ $this->query_where .= $this->get_search_sql( $search, $search_columns, $wild );
+ }
+
+ $blog_id = absint( $qv['blog_id'] );
+
+ if ( 'authors' == $qv['who'] && $blog_id ) {
+ $qv['meta_key'] = $wpdb->get_blog_prefix( $blog_id ) . 'user_level';
+ $qv['meta_value'] = '_wp_zero_value'; // Hack to pass '0'
+ $qv['meta_compare'] = '!=';
+ $qv['blog_id'] = $blog_id = 0; // Prevent extra meta query
+ }
+
+ _parse_meta_query( $qv );
+
+ $role = trim( $qv['role'] );
+
+ if ( $blog_id && ( $role || is_multisite() ) ) {
+ $cap_meta_query = array();
+ $cap_meta_query['key'] = $wpdb->get_blog_prefix( $blog_id ) . 'capabilities';
+
+ if ( $role ) {
+ $cap_meta_query['value'] = '"' . $role . '"';
+ $cap_meta_query['compare'] = 'like';
+ }
+
+ $qv['meta_query'][] = $cap_meta_query;
+ }
+
+ if ( !empty( $qv['meta_query'] ) ) {
+ $clauses = call_user_func_array( '_get_meta_sql', array( $qv['meta_query'], 'user', $wpdb->users, 'ID', &$this ) );
+ $this->query_from .= $clauses['join'];
+ $this->query_where .= $clauses['where'];
+ }
+
+ if ( !empty( $qv['include'] ) ) {
+ $ids = implode( ',', wp_parse_id_list( $qv['include'] ) );
+ $this->query_where .= " AND $wpdb->users.ID IN ($ids)";
+ } elseif ( !empty($qv['exclude']) ) {
+ $ids = implode( ',', wp_parse_id_list( $qv['exclude'] ) );
+ $this->query_where .= " AND $wpdb->users.ID NOT IN ($ids)";
+ }
+
+ do_action_ref_array( 'pre_user_query', array( &$this ) );
+ }
+
+ /**
+ * Execute the query, with the current variables
+ *
+ * @since 3.1.0
+ * @access private
+ */
+ function query() {
+ global $wpdb;
+
+ if ( is_array( $this->query_vars['fields'] ) || 'all' == $this->query_vars['fields'] ) {
+ $this->results = $wpdb->get_results("SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit");
+ } else {
+ $this->results = $wpdb->get_col("SELECT $this->query_fields $this->query_from $this->query_where $this->query_orderby $this->query_limit");
+ }
+
+ if ( $this->query_vars['count_total'] )
+ $this->total_users = $wpdb->get_var("SELECT COUNT(*) $this->query_from $this->query_where");
+
+ if ( !$this->results )
+ return;
+
+ if ( 'all_with_meta' == $this->query_vars['fields'] ) {
+ cache_users( $this->results );
+
+ $r = array();
+ foreach ( $this->results as $userid )
+ $r[ $userid ] = new WP_User( $userid, '', $this->query_vars['blog_id'] );
+
+ $this->results = $r;
+ }
+ }
+
+ /*
+ * Used internally to generate an SQL string for searching across multiple columns
+ *
+ * @access protected
+ * @since 3.1.0
+ *
+ * @param string $string
+ * @param array $cols
+ * @param bool $wild Whether to allow wildcard searches. Default is false for Network Admin, true for
+ * single site. Single site allows leading and trailing wildcards, Network Admin only trailing.
+ * @return string
+ */
+ function get_search_sql( $string, $cols, $wild = false ) {
+ $string = esc_sql( $string );
+
+ $searches = array();
+ $leading_wild = ( 'leading' == $wild || 'both' == $wild ) ? '%' : '';
+ $trailing_wild = ( 'trailing' == $wild || 'both' == $wild ) ? '%' : '';
+ foreach ( $cols as $col ) {
+ if ( 'ID' == $col )
+ $searches[] = "$col = '$string'";
+ else
+ $searches[] = "$col LIKE '$leading_wild" . like_escape($string) . "$trailing_wild'";
+ }
+
+ return ' AND (' . implode(' OR ', $searches) . ')';
+ }
+
+ /**
+ * Return the list of users
+ *
+ * @since 3.1.0
+ * @access public
+ *
+ * @return array
+ */
+ function get_results() {
+ return $this->results;
+ }
+
+ /**
+ * Return the total number of users for the current query
+ *
+ * @since 3.1.0
+ * @access public
+ *
+ * @return array
+ */
+ function get_total() {
+ return $this->total_users;
+ }
+}
+
+/**
+ * Retrieve list of users matching criteria.
*
- * @since 2.2.0
- * @uses $wpdb WordPress database object for queries
- * @uses $blog_id The Blog id of the blog for those that use more than one blog
+ * @since 3.1.0
+ * @uses $wpdb
+ * @uses WP_User_Query See for default arguments and information.
*
- * @param int $id Blog ID.
- * @return array List of users that are part of that Blog ID
+ * @param array $args Optional.
+ * @return array List of users.
*/
-function get_users_of_blog( $id = '' ) {
- global $wpdb, $blog_id;
- if ( empty($id) )
- $id = (int) $blog_id;
- $blog_prefix = $wpdb->get_blog_prefix($id);
- $users = $wpdb->get_results( "SELECT user_id, user_id AS ID, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE {$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY {$wpdb->usermeta}.user_id" );
- return $users;
+function get_users( $args = array() ) {
+
+ $args = wp_parse_args( $args );
+ $args['count_total'] = false;
+
+ $user_search = new WP_User_Query($args);
+
+ return (array) $user_search->get_results();
+}
+
+/**
+ * Get the blogs a user belongs to.
+ *
+ * @since 3.0.0
+ *
+ * @param int $id User Id
+ * @param bool $all Whether to retrieve all blogs or only blogs that are not marked as deleted, archived, or spam.
+ * @return array A list of the user's blogs. False if the user was not found or an empty array if the user has no blogs.
+ */
+function get_blogs_of_user( $id, $all = false ) {
+ global $wpdb;
+
+ if ( !is_multisite() ) {
+ $blog_id = get_current_blog_id();
+ $blogs = array();
+ $blogs[ $blog_id ]->userblog_id = $blog_id;
+ $blogs[ $blog_id ]->blogname = get_option('blogname');
+ $blogs[ $blog_id ]->domain = '';
+ $blogs[ $blog_id ]->path = '';
+ $blogs[ $blog_id ]->site_id = 1;
+ $blogs[ $blog_id ]->siteurl = get_option('siteurl');
+ return $blogs;
+ }
+
+ $blogs = wp_cache_get( 'blogs_of_user-' . $id, 'users' );
+
+ // Try priming the new cache from the old cache
+ if ( false === $blogs ) {
+ $cache_suffix = $all ? '_all' : '_short';
+ $blogs = wp_cache_get( 'blogs_of_user_' . $id . $cache_suffix, 'users' );
+ if ( is_array( $blogs ) ) {
+ $blogs = array_keys( $blogs );
+ if ( $all )
+ wp_cache_set( 'blogs_of_user-' . $id, $blogs, 'users' );
+ }
+ }
+
+ if ( false === $blogs ) {
+ $user = get_userdata( (int) $id );
+ if ( !$user )
+ return false;
+
+ $blogs = $match = array();
+ $prefix_length = strlen($wpdb->base_prefix);
+ foreach ( (array) $user as $key => $value ) {
+ if ( $prefix_length && substr($key, 0, $prefix_length) != $wpdb->base_prefix )
+ continue;
+ if ( substr($key, -12, 12) != 'capabilities' )
+ continue;
+ if ( preg_match( '/^' . $wpdb->base_prefix . '((\d+)_)?capabilities$/', $key, $match ) ) {
+ if ( count( $match ) > 2 )
+ $blogs[] = (int) $match[ 2 ];
+ else
+ $blogs[] = 1;
+ }
+ }
+ wp_cache_set( 'blogs_of_user-' . $id, $blogs, 'users' );
+ }
+
+ $blog_deets = array();
+ foreach ( (array) $blogs as $blog_id ) {
+ $blog = get_blog_details( $blog_id );
+ if ( $blog && isset( $blog->domain ) && ( $all == true || $all == false && ( $blog->archived == 0 && $blog->spam == 0 && $blog->deleted == 0 ) ) ) {
+ $blog_deets[ $blog_id ]->userblog_id = $blog_id;
+ $blog_deets[ $blog_id ]->blogname = $blog->blogname;
+ $blog_deets[ $blog_id ]->domain = $blog->domain;
+ $blog_deets[ $blog_id ]->path = $blog->path;
+ $blog_deets[ $blog_id ]->site_id = $blog->site_id;
+ $blog_deets[ $blog_id ]->siteurl = $blog->siteurl;
+ }
+ }
+
+ return apply_filters( 'get_blogs_of_user', $blog_deets, $id, $all );
+}
+
+/**
+ * Checks if the current user belong to a given blog.
+ *
+ * @since 3.0.0
+ *
+ * @param int $blog_id Blog ID
+ * @return bool True if the current users belong to $blog_id, false if not.
+ */
+function is_blog_user( $blog_id = 0 ) {
+ global $wpdb;
+
+ $current_user = wp_get_current_user();
+ if ( !$blog_id )
+ $blog_id = $wpdb->blogid;
+
+ $cap_key = $wpdb->base_prefix . $blog_id . '_capabilities';
+
+ if ( is_array($current_user->$cap_key) && in_array(1, $current_user->$cap_key) )
+ return true;
+
+ return false;
}
/**
* @link http://codex.wordpress.org/Function_Reference/add_user_meta
*
* @param int $user_id Post ID.
- * @param string $key Metadata name.
- * @param mixed $value Metadata value.
+ * @param string $meta_key Metadata name.
+ * @param mixed $meta_value Metadata value.
* @param bool $unique Optional, default is false. Whether the same key should not be added.
* @return bool False for failure. True for success.
*/
* @link http://codex.wordpress.org/Function_Reference/update_user_meta
*
* @param int $user_id Post ID.
- * @param string $key Metadata key.
- * @param mixed $value Metadata value.
+ * @param string $meta_key Metadata key.
+ * @param mixed $meta_value Metadata value.
* @param mixed $prev_value Optional. Previous value to check before removing.
* @return bool False on failure, true if success.
*/
* Count number of users who have each of the user roles.
*
* Assumes there are neither duplicated nor orphaned capabilities meta_values.
- * Assumes role names are unique phrases. Same assumption made by WP_User_Search::prepare_query()
+ * Assumes role names are unique phrases. Same assumption made by WP_User_Query::prepare_query()
* Using $strategy = 'time' this is CPU-intensive and should handle around 10^7 users.
* Using $strategy = 'memory' this is memory-intensive and should handle around 10^5 users, but see WP Bug #12257.
*
* @return array Includes a grand total and an array of counts indexed by role strings.
*/
function count_users($strategy = 'time') {
- global $wpdb, $blog_id, $wp_roles;
+ global $wpdb, $wp_roles;
// Initialize
- $id = (int) $blog_id;
+ $id = get_current_blog_id();
$blog_prefix = $wpdb->get_blog_prefix($id);
$result = array();
* The available arguments are as follows:
* <ol>
* <li>show_option_all - Text to show all and whether HTML option exists.</li>
- * <li>show_option_none - Text for show none and whether HTML option exists.
- * </li>
- * <li>orderby - SQL order by clause for what order the users appear. Default is
- * 'display_name'.</li>
+ * <li>show_option_none - Text for show none and whether HTML option exists.</li>
+ * <li>hide_if_only_one_author - Don't create the dropdown if there is only one user.</li>
+ * <li>orderby - SQL order by clause for what order the users appear. Default is 'display_name'.</li>
* <li>order - Default is 'ASC'. Can also be 'DESC'.</li>
* <li>include - User IDs to include.</li>
* <li>exclude - User IDs to exclude.</li>
* <li>multi - Default is 'false'. Whether to skip the ID attribute on the 'select' element. A 'true' value is overridden when id argument is set.</li>
- * <li>show - Default is 'display_name'. User table column to display. If the selected item is empty then the user_login will be displayed in parentesis</li>
+ * <li>show - Default is 'display_name'. User table column to display. If the selected item is empty then the user_login will be displayed in parentheses</li>
* <li>echo - Default is '1'. Whether to display or retrieve content.</li>
* <li>selected - Which User ID is selected.</li>
+ * <li>include_selected - Always include the selected user ID in the dropdown. Default is false.</li>
* <li>name - Default is 'user'. Name attribute of select element.</li>
* <li>id - Default is the value of the 'name' parameter. ID attribute of select element.</li>
* <li>class - Class attribute of select element.</li>
* <li>blog_id - ID of blog (Multisite only). Defaults to ID of current blog.</li>
+ * <li>who - Which users to query. Currently only 'authors' is supported. Default is all users.</li>
* </ol>
*
* @since 2.3.0
* @return string|null Null on display. String of HTML content on retrieve.
*/
function wp_dropdown_users( $args = '' ) {
- global $wpdb;
$defaults = array(
- 'show_option_all' => '', 'show_option_none' => '',
+ 'show_option_all' => '', 'show_option_none' => '', 'hide_if_only_one_author' => '',
'orderby' => 'display_name', 'order' => 'ASC',
'include' => '', 'exclude' => '', 'multi' => 0,
'show' => 'display_name', 'echo' => 1,
- 'selected' => 0, 'name' => 'user', 'class' => '', 'blog_id' => $GLOBALS['blog_id'],
- 'id' => '',
+ 'selected' => 0, 'name' => 'user', 'class' => '', 'id' => '',
+ 'blog_id' => $GLOBALS['blog_id'], 'who' => '', 'include_selected' => false
);
$defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0;
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
- $blog_prefix = $wpdb->get_blog_prefix( $blog_id );
- $query = "SELECT {$wpdb->users}.* FROM $wpdb->users, $wpdb->usermeta WHERE {$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND meta_key = '{$blog_prefix}capabilities'";
-
- $query_where = array();
-
- if ( is_array($include) )
- $include = join(',', $include);
- $include = preg_replace('/[^0-9,]/', '', $include); // (int)
- if ( $include )
- $query_where[] = "ID IN ($include)";
-
- if ( is_array($exclude) )
- $exclude = join(',', $exclude);
- $exclude = preg_replace('/[^0-9,]/', '', $exclude); // (int)
- if ( $exclude )
- $query_where[] = "ID NOT IN ($exclude)";
-
- if ( $query_where )
- $query .= " AND " . join(' AND', $query_where);
-
- $query .= " ORDER BY $orderby $order";
-
- $users = $wpdb->get_results( $query );
+ $query_args = wp_array_slice_assoc( $r, array( 'blog_id', 'include', 'exclude', 'orderby', 'order', 'who' ) );
+ $query_args['fields'] = array( 'ID', $show );
+ $users = get_users( $query_args );
$output = '';
- if ( !empty($users) ) {
+ if ( !empty($users) && ( empty($hide_if_only_one_author) || count($users) > 1 ) ) {
$name = esc_attr( $name );
if ( $multi && ! $id )
$id = '';
$output .= "\t<option value='-1'$_selected>$show_option_none</option>\n";
}
+ $found_selected = false;
foreach ( (array) $users as $user ) {
$user->ID = (int) $user->ID;
$_selected = selected( $user->ID, $selected, false );
+ if ( $_selected )
+ $found_selected = true;
+ $display = !empty($user->$show) ? $user->$show : '('. $user->user_login . ')';
+ $output .= "\t<option value='$user->ID'$_selected>" . esc_html($display) . "</option>\n";
+ }
+
+ if ( $include_selected && ! $found_selected && ( $selected > 0 ) ) {
+ $user = get_userdata( $selected );
+ $_selected = selected( $user->ID, $selected, false );
$display = !empty($user->$show) ? $user->$show : '('. $user->user_login . ')';
$output .= "\t<option value='$user->ID'$_selected>" . esc_html($display) . "</option>\n";
}
* @return array of arrays. The array is indexed by user_id, containing $metavalues object arrays.
*/
function get_user_metavalues($ids) {
- global $wpdb;
-
- $clean = array_map('intval', $ids);
- if ( 0 == count($clean) )
- return $objects;
+ $objects = array();
- $list = implode(',', $clean);
+ $ids = array_map('intval', $ids);
+ foreach ( $ids as $id )
+ $objects[$id] = array();
- $show = $wpdb->hide_errors();
- $metavalues = $wpdb->get_results("SELECT user_id, meta_key, meta_value FROM $wpdb->usermeta WHERE user_id IN ($list)");
- $wpdb->show_errors($show);
+ $metas = update_meta_cache('user', $ids);
- $objects = array();
- foreach($clean as $id) {
- $objects[$id] = array();
- }
- foreach($metavalues as $meta_object) {
- $objects[$meta_object->user_id][] = $meta_object;
+ foreach ( $metas as $id => $meta ) {
+ foreach ( $meta as $key => $metavalues ) {
+ foreach ( $metavalues as $value ) {
+ $objects[$id][] = (object)array( 'user_id' => $id, 'meta_key' => $key, 'meta_value' => $value);
+ }
+ }
}
return $objects;
*/
function _fill_many_users( &$users ) {
$ids = array();
- foreach($users as $user_object) {
+ foreach( $users as $user_object ) {
$ids[] = $user_object->ID;
}
- $metas = get_user_metavalues($ids);
+ $metas = get_user_metavalues($ids);
- foreach($users as $user_object) {
- if (isset($metas[$user_object->ID])) {
- _fill_single_user($user_object, $metas[$user_object->ID]);
+ foreach ( $users as $user_object ) {
+ if ( isset($metas[$user_object->ID]) ) {
+ _fill_single_user($user_object, $metas[$user_object->ID]);
}
}
}
* when calling filters.
*
* @since 2.3.0
- * @uses apply_filters() Calls 'edit_$field' and '${field_no_prefix}_edit_pre' passing $value and
+ * @uses apply_filters() Calls 'edit_$field' and '{$field_no_prefix}_edit_pre' passing $value and
* $user_id if $context == 'edit' and field name prefix == 'user_'.
*
* @uses apply_filters() Calls 'edit_user_$field' passing $value and $user_id if $context == 'db'.
* @uses apply_filters() Calls 'pre_$field' passing $value if $context == 'db' and field name prefix == 'user_'.
- * @uses apply_filters() Calls '${field}_pre' passing $value if $context == 'db' and field name prefix != 'user_'.
+ * @uses apply_filters() Calls '{$field}_pre' passing $value if $context == 'db' and field name prefix != 'user_'.
*
* @uses apply_filters() Calls '$field' passing $value, $user_id and $context if $context == anything
* other than 'raw', 'edit' and 'db' and field name prefix == 'user_'.
if ( 'edit' == $context ) {
if ( $prefixed ) {
- $value = apply_filters("edit_$field", $value, $user_id);
+ $value = apply_filters("edit_{$field}", $value, $user_id);
} else {
- $value = apply_filters("edit_user_$field", $value, $user_id);
+ $value = apply_filters("edit_user_{$field}", $value, $user_id);
}
if ( 'description' == $field )
- $value = esc_html($value);
+ $value = esc_html( $value ); // textarea_escaped?
else
$value = esc_attr($value);
} else if ( 'db' == $context ) {
if ( $prefixed ) {
- $value = apply_filters("pre_$field", $value);
+ $value = apply_filters("pre_{$field}", $value);
} else {
- $value = apply_filters("pre_user_$field", $value);
+ $value = apply_filters("pre_user_{$field}", $value);
}
} else {
// Use display filters by default.
if ( $prefixed )
$value = apply_filters($field, $value, $user_id, $context);
else
- $value = apply_filters("user_$field", $value, $user_id, $context);
+ $value = apply_filters("user_{$field}", $value, $user_id, $context);
}
if ( 'user_url' == $field )
wp_cache_delete($user->user_login, 'userlogins');
wp_cache_delete($user->user_email, 'useremail');
wp_cache_delete($user->user_nicename, 'userslugs');
+ wp_cache_delete('blogs_of_user-' . $id, 'users');
+}
+
+/**
+ * Checks whether the given username exists.
+ *
+ * @since 2.0.0
+ *
+ * @param string $username Username.
+ * @return null|int The user's ID on success, and null on failure.
+ */
+function username_exists( $username ) {
+ if ( $user = get_userdatabylogin( $username ) ) {
+ return $user->ID;
+ } else {
+ return null;
+ }
+}
+
+/**
+ * Checks whether the given email exists.
+ *
+ * @since 2.1.0
+ * @uses $wpdb
+ *
+ * @param string $email Email.
+ * @return bool|int The user's ID on success, and false on failure.
+ */
+function email_exists( $email ) {
+ if ( $user = get_user_by_email($email) )
+ return $user->ID;
+
+ return false;
+}
+
+/**
+ * Checks whether an username is valid.
+ *
+ * @since 2.0.1
+ * @uses apply_filters() Calls 'validate_username' hook on $valid check and $username as parameters
+ *
+ * @param string $username Username.
+ * @return bool Whether username given is valid
+ */
+function validate_username( $username ) {
+ $sanitized = sanitize_user( $username, true );
+ $valid = ( $sanitized == $username );
+ return apply_filters( 'validate_username', $valid, $username );
+}
+
+/**
+ * Insert an user into the database.
+ *
+ * Can update a current user or insert a new user based on whether the user's ID
+ * is present.
+ *
+ * Can be used to update the user's info (see below), set the user's role, and
+ * set the user's preference on whether they want the rich editor on.
+ *
+ * Most of the $userdata array fields have filters associated with the values.
+ * The exceptions are 'rich_editing', 'role', 'jabber', 'aim', 'yim',
+ * 'user_registered', and 'ID'. The filters have the prefix 'pre_user_' followed
+ * by the field name. An example using 'description' would have the filter
+ * called, 'pre_user_description' that can be hooked into.
+ *
+ * The $userdata array can contain the following fields:
+ * 'ID' - An integer that will be used for updating an existing user.
+ * 'user_pass' - A string that contains the plain text password for the user.
+ * 'user_login' - A string that contains the user's username for logging in.
+ * 'user_nicename' - A string that contains a nicer looking name for the user.
+ * The default is the user's username.
+ * 'user_url' - A string containing the user's URL for the user's web site.
+ * 'user_email' - A string containing the user's email address.
+ * 'display_name' - A string that will be shown on the site. Defaults to user's
+ * username. It is likely that you will want to change this, for both
+ * appearance and security through obscurity (that is if you don't use and
+ * delete the default 'admin' user).
+ * 'nickname' - The user's nickname, defaults to the user's username.
+ * 'first_name' - The user's first name.
+ * 'last_name' - The user's last name.
+ * 'description' - A string containing content about the user.
+ * 'rich_editing' - A string for whether to enable the rich editor. False
+ * if not empty.
+ * 'user_registered' - The date the user registered. Format is 'Y-m-d H:i:s'.
+ * 'role' - A string used to set the user's role.
+ * 'jabber' - User's Jabber account.
+ * 'aim' - User's AOL IM account.
+ * 'yim' - User's Yahoo IM account.
+ *
+ * @since 2.0.0
+ * @uses $wpdb WordPress database layer.
+ * @uses apply_filters() Calls filters for most of the $userdata fields with the prefix 'pre_user'. See note above.
+ * @uses do_action() Calls 'profile_update' hook when updating giving the user's ID
+ * @uses do_action() Calls 'user_register' hook when creating a new user giving the user's ID
+ *
+ * @param array $userdata An array of user data.
+ * @return int|WP_Error The newly created user's ID or a WP_Error object if the user could not be created.
+ */
+function wp_insert_user($userdata) {
+ global $wpdb;
+
+ extract($userdata, EXTR_SKIP);
+
+ // Are we updating or creating?
+ if ( !empty($ID) ) {
+ $ID = (int) $ID;
+ $update = true;
+ $old_user_data = get_userdata($ID);
+ } else {
+ $update = false;
+ // Hash the password
+ $user_pass = wp_hash_password($user_pass);
+ }
+
+ $user_login = sanitize_user($user_login, true);
+ $user_login = apply_filters('pre_user_login', $user_login);
+
+ //Remove any non-printable chars from the login string to see if we have ended up with an empty username
+ $user_login = trim($user_login);
+
+ if ( empty($user_login) )
+ return new WP_Error('empty_user_login', __('Cannot create a user with an empty login name.') );
+
+ if ( !$update && username_exists( $user_login ) )
+ return new WP_Error('existing_user_login', __('This username is already registered.') );
+
+ if ( empty($user_nicename) )
+ $user_nicename = sanitize_title( $user_login );
+ $user_nicename = apply_filters('pre_user_nicename', $user_nicename);
+
+ if ( empty($user_url) )
+ $user_url = '';
+ $user_url = apply_filters('pre_user_url', $user_url);
+
+ if ( empty($user_email) )
+ $user_email = '';
+ $user_email = apply_filters('pre_user_email', $user_email);
+
+ if ( !$update && ! defined( 'WP_IMPORTING' ) && email_exists($user_email) )
+ return new WP_Error('existing_user_email', __('This email address is already registered.') );
+
+ if ( empty($display_name) )
+ $display_name = $user_login;
+ $display_name = apply_filters('pre_user_display_name', $display_name);
+
+ if ( empty($nickname) )
+ $nickname = $user_login;
+ $nickname = apply_filters('pre_user_nickname', $nickname);
+
+ if ( empty($first_name) )
+ $first_name = '';
+ $first_name = apply_filters('pre_user_first_name', $first_name);
+
+ if ( empty($last_name) )
+ $last_name = '';
+ $last_name = apply_filters('pre_user_last_name', $last_name);
+
+ if ( empty($description) )
+ $description = '';
+ $description = apply_filters('pre_user_description', $description);
+
+ if ( empty($rich_editing) )
+ $rich_editing = 'true';
+
+ if ( empty($comment_shortcuts) )
+ $comment_shortcuts = 'false';
+
+ if ( empty($admin_color) )
+ $admin_color = 'fresh';
+ $admin_color = preg_replace('|[^a-z0-9 _.\-@]|i', '', $admin_color);
+
+ if ( empty($use_ssl) )
+ $use_ssl = 0;
+
+ if ( empty($user_registered) )
+ $user_registered = gmdate('Y-m-d H:i:s');
+
+ if ( empty($show_admin_bar_front) )
+ $show_admin_bar_front = 'true';
+
+ if ( empty($show_admin_bar_admin) )
+ $show_admin_bar_admin = is_multisite() ? 'true' : 'false';
+
+ $user_nicename_check = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1" , $user_nicename, $user_login));
+
+ if ( $user_nicename_check ) {
+ $suffix = 2;
+ while ($user_nicename_check) {
+ $alt_user_nicename = $user_nicename . "-$suffix";
+ $user_nicename_check = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1" , $alt_user_nicename, $user_login));
+ $suffix++;
+ }
+ $user_nicename = $alt_user_nicename;
+ }
+
+ $data = compact( 'user_pass', 'user_email', 'user_url', 'user_nicename', 'display_name', 'user_registered' );
+ $data = stripslashes_deep( $data );
+
+ if ( $update ) {
+ $wpdb->update( $wpdb->users, $data, compact( 'ID' ) );
+ $user_id = (int) $ID;
+ } else {
+ $wpdb->insert( $wpdb->users, $data + compact( 'user_login' ) );
+ $user_id = (int) $wpdb->insert_id;
+ }
+
+ update_user_meta( $user_id, 'first_name', $first_name );
+ update_user_meta( $user_id, 'last_name', $last_name );
+ update_user_meta( $user_id, 'nickname', $nickname );
+ update_user_meta( $user_id, 'description', $description );
+ update_user_meta( $user_id, 'rich_editing', $rich_editing );
+ update_user_meta( $user_id, 'comment_shortcuts', $comment_shortcuts );
+ update_user_meta( $user_id, 'admin_color', $admin_color );
+ update_user_meta( $user_id, 'use_ssl', $use_ssl );
+ update_user_meta( $user_id, 'show_admin_bar_front', $show_admin_bar_front );
+ update_user_meta( $user_id, 'show_admin_bar_admin', $show_admin_bar_admin );
+
+ $user = new WP_User($user_id);
+
+ foreach ( _wp_get_user_contactmethods( $user ) as $method => $name ) {
+ if ( empty($$method) )
+ $$method = '';
+
+ update_user_meta( $user_id, $method, $$method );
+ }
+
+ if ( isset($role) )
+ $user->set_role($role);
+ elseif ( !$update )
+ $user->set_role(get_option('default_role'));
+
+ wp_cache_delete($user_id, 'users');
+ wp_cache_delete($user_login, 'userlogins');
+
+ if ( $update )
+ do_action('profile_update', $user_id, $old_user_data);
+ else
+ do_action('user_register', $user_id);
+
+ return $user_id;
+}
+
+/**
+ * Update an user in the database.
+ *
+ * It is possible to update a user's password by specifying the 'user_pass'
+ * value in the $userdata parameter array.
+ *
+ * If $userdata does not contain an 'ID' key, then a new user will be created
+ * and the new user's ID will be returned.
+ *
+ * If current user's password is being updated, then the cookies will be
+ * cleared.
+ *
+ * @since 2.0.0
+ * @see wp_insert_user() For what fields can be set in $userdata
+ * @uses wp_insert_user() Used to update existing user or add new one if user doesn't exist already
+ *
+ * @param array $userdata An array of user data.
+ * @return int The updated user's ID.
+ */
+function wp_update_user($userdata) {
+ $ID = (int) $userdata['ID'];
+
+ // First, get all of the original fields
+ $user = get_userdata($ID);
+
+ // Escape data pulled from DB.
+ $user = add_magic_quotes(get_object_vars($user));
+
+ // If password is changing, hash it now.
+ if ( ! empty($userdata['user_pass']) ) {
+ $plaintext_pass = $userdata['user_pass'];
+ $userdata['user_pass'] = wp_hash_password($userdata['user_pass']);
+ }
+
+ wp_cache_delete($user[ 'user_email' ], 'useremail');
+
+ // Merge old and new fields with new fields overwriting old ones.
+ $userdata = array_merge($user, $userdata);
+ $user_id = wp_insert_user($userdata);
+
+ // Update the cookies if the password changed.
+ $current_user = wp_get_current_user();
+ if ( $current_user->id == $ID ) {
+ if ( isset($plaintext_pass) ) {
+ wp_clear_auth_cookie();
+ wp_set_auth_cookie($ID);
+ }
+ }
+
+ return $user_id;
+}
+
+/**
+ * A simpler way of inserting an user into the database.
+ *
+ * Creates a new user with just the username, password, and email. For a more
+ * detail creation of a user, use wp_insert_user() to specify more infomation.
+ *
+ * @since 2.0.0
+ * @see wp_insert_user() More complete way to create a new 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.
+ */
+function wp_create_user($username, $password, $email = '') {
+ $user_login = esc_sql( $username );
+ $user_email = esc_sql( $email );
+ $user_pass = $password;
+
+ $userdata = compact('user_login', 'user_email', 'user_pass');
+ return wp_insert_user($userdata);
+}
+
+
+/**
+ * Set up the default contact methods
+ *
+ * @access private
+ * @since
+ *
+ * @param object $user User data object (optional)
+ * @return array $user_contactmethods Array of contact methods and their labels.
+ */
+function _wp_get_user_contactmethods( $user = null ) {
+ $user_contactmethods = array(
+ 'aim' => __('AIM'),
+ 'yim' => __('Yahoo IM'),
+ 'jabber' => __('Jabber / Google Talk')
+ );
+ return apply_filters( 'user_contactmethods', $user_contactmethods, $user );
}
?>
// On which page are we ?
if ( is_admin() ) {
// wp-admin pages are checked more carefully
- preg_match('#/wp-admin/?(.*?)$#i', $PHP_SELF, $self_matches);
+ if ( is_network_admin() )
+ preg_match('#/wp-admin/network/?(.*?)$#i', $PHP_SELF, $self_matches);
+ elseif ( is_user_admin() )
+ preg_match('#/wp-admin/user/?(.*?)$#i', $PHP_SELF, $self_matches);
+ else
+ preg_match('#/wp-admin/?(.*?)$#i', $PHP_SELF, $self_matches);
$pagenow = $self_matches[1];
$pagenow = trim($pagenow, '/');
$pagenow = preg_replace('#\?.*?$#', '', $pagenow);
else
$pagenow = 'index.php';
}
+unset($self_matches);
// Simple browser detection
$is_lynx = $is_gecko = $is_winIE = $is_macIE = $is_opera = $is_NS4 = $is_safari = $is_chrome = $is_iphone = false;
* Whether the server software is IIS or something else
* @global bool $is_IIS
*/
-$is_IIS = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer') !== false);
+$is_IIS = !$is_apache && (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer') !== false);
/**
* Whether the server software is IIS 7.X
* @global bool $is_iis7
*/
-$is_iis7 = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/7.') !== false);
-
+$is_iis7 = $is_IIS && (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/7.') !== false);
?>
\ No newline at end of file
*
* @global string $wp_version
*/
-$wp_version = '3.0.6';
+$wp_version = '3.1';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
*
* @global int $wp_db_version
*/
-$wp_db_version = 15477;
+$wp_db_version = 17056;
/**
* Holds the TinyMCE version
*
* @global string $tinymce_version
*/
-$tinymce_version = '327-1235';
+$tinymce_version = '3393';
/**
* Holds the cache manifest version
*
* @global string $manifest_version
*/
-$manifest_version = '20100530';
+$manifest_version = '20111113';
/**
* Holds the required PHP version
* @param int|string $id Widget ID.
* @param string $name Widget display title.
* @param callback $output_callback Run when widget is called.
- * @param array|string Optional. $options Widget Options.
+ * @param array|string $options Optional. Widget Options.
* @param mixed $params,... Widget parameters to add to widget.
* @return null Will return if $output_callback is empty after removing widget.
*/
*
* @since 2.2.0
*
- * @param callback Optional, Widget callback to check.
+ * @param string $callback Optional, Widget callback to check.
* @param int $widget_id Optional, but needed for checking. Widget ID.
* @param string $id_base Optional, the base ID of a widget created by extending WP_Widget.
* @param bool $skip_inactive Optional, whether to check in 'wp_inactive_widgets'.
*
* @since 2.8
*
- * @param mixed $index, sidebar name, id or number to check.
+ * @param mixed $index Sidebar name, id or number to check.
* @return bool true if the sidebar is in use, false otherwise.
*/
function is_active_sidebar( $index ) {
* @since 2.2.0
* @access private
*
- * @param bool $deprecated. Not used.
+ * @param bool $deprecated Not used (deprecated).
* @return array Upgraded list of widgets to version 3 array format when called from the admin.
*/
function wp_get_sidebars_widgets($deprecated = true) {
* @package WordPress
* @subpackage Database
* @since 0.71
- * @final
*/
class wpdb {
* Whether to suppress errors during the DB bootstrapping.
*
* @access private
- * @since 2.5
+ * @since 2.5.0
* @var bool
*/
var $suppress_errors = false;
* The last error during query.
*
* @see get_last_error()
- * @since 2.5
+ * @since 2.5.0
* @access private
* @var string
*/
/**
* Count of rows returned by previous query
*
- * @since 1.2
+ * @since 1.2.0
* @access private
* @var int
*/
/**
* A textual description of the last query/get_row/get_var call
*
- * @since unknown
+ * @since 3.0.0
* @access public
* @var string
*/
* @param string $dbhost MySQL database host
*/
function wpdb( $dbuser, $dbpassword, $dbname, $dbhost ) {
- if( defined( 'WP_USE_MULTIPLE_DB' ) && WP_USE_MULTIPLE_DB )
- $this->db_connect();
return $this->__construct( $dbuser, $dbpassword, $dbname, $dbhost );
}
if ( WP_DEBUG )
$this->show_errors();
- if ( is_multisite() ) {
+ $this->init_charset();
+
+ $this->dbuser = $dbuser;
+ $this->dbpassword = $dbpassword;
+ $this->dbname = $dbname;
+ $this->dbhost = $dbhost;
+
+ $this->db_connect();
+ }
+
+ /**
+ * PHP5 style destructor and will run when database object is destroyed.
+ *
+ * @see wpdb::__construct()
+ * @since 2.0.8
+ * @return bool true
+ */
+ function __destruct() {
+ return true;
+ }
+
+ /**
+ * Set $this->charset and $this->collate
+ *
+ * @since 3.1.0
+ */
+ function init_charset() {
+ if ( function_exists('is_multisite') && is_multisite() ) {
$this->charset = 'utf8';
if ( defined( 'DB_COLLATE' ) && DB_COLLATE )
$this->collate = DB_COLLATE;
if ( defined( 'DB_CHARSET' ) )
$this->charset = DB_CHARSET;
-
- $this->dbuser = $dbuser;
-
- $this->dbh = @mysql_connect( $dbhost, $dbuser, $dbpassword, true );
- if ( !$this->dbh ) {
- $this->bail( sprintf( /*WP_I18N_DB_CONN_ERROR*/"
-<h1>Error establishing a database connection</h1>
-<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>%s</code>. This could mean your host's database server is down.</p>
-<ul>
- <li>Are you sure you have the correct username and password?</li>
- <li>Are you sure that you have typed the correct hostname?</li>
- <li>Are you sure that the database server is running?</li>
-</ul>
-<p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>
-"/*/WP_I18N_DB_CONN_ERROR*/, $dbhost ), 'db_connect_fail' );
- return;
- }
-
- $this->ready = true;
-
- if ( $this->has_cap( 'collation' ) && !empty( $this->charset ) ) {
- if ( function_exists( 'mysql_set_charset' ) ) {
- mysql_set_charset( $this->charset, $this->dbh );
- $this->real_escape = true;
- } else {
- $query = $this->prepare( 'SET NAMES %s', $this->charset );
- if ( ! empty( $this->collate ) )
- $query .= $this->prepare( ' COLLATE %s', $this->collate );
- $this->query( $query );
- }
- }
-
- $this->select( $dbname, $this->dbh );
}
/**
- * PHP5 style destructor and will run when database object is destroyed.
+ * Sets the connection's character set.
*
- * @see wpdb::__construct()
- * @since 2.0.8
- * @return bool true
+ * @since 3.1.0
+ *
+ * @param resource $dbh The resource given by mysql_connect
+ * @param string $charset The character set (optional)
+ * @param string $collate The collation (optional)
*/
- function __destruct() {
- return true;
+ function set_charset($dbh, $charset = null, $collate = null) {
+ if ( !isset($charset) )
+ $charset = $this->charset;
+ if ( !isset($collate) )
+ $collate = $this->collate;
+ if ( $this->has_cap( 'collation', $dbh ) && !empty( $charset ) ) {
+ if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset', $dbh ) ) {
+ mysql_set_charset( $charset, $dbh );
+ $this->real_escape = true;
+ } else {
+ $query = $this->prepare( 'SET NAMES %s', $charset );
+ if ( ! empty( $collate ) )
+ $query .= $this->prepare( ' COLLATE %s', $collate );
+ mysql_query( $query, $dbh );
+ }
+ }
}
/**
* @return null Always null.
*/
function select( $db, $dbh = null) {
- if ( is_null($dbh) )
+ if ( is_null($dbh) )
$dbh = $this->dbh;
if ( !@mysql_select_db( $db, $dbh ) ) {
$this->ready = false;
- $this->bail( sprintf( /*WP_I18N_DB_SELECT_DB*/'
-<h1>Can’t select database</h1>
+ $this->bail( sprintf( /*WP_I18N_DB_SELECT_DB*/'<h1>Can’t select database</h1>
<p>We were able to connect to the database server (which means your username and password is okay) but not able to select the <code>%1$s</code> database.</p>
<ul>
<li>Are you sure it exists?</li>
*
* @see mysql_real_escape_string()
* @see addslashes()
- * @since 2.8
+ * @since 2.8.0
* @access private
*
* @param string $string to escape
/**
* Escape data. Works on arrays.
*
- * @uses wpdb::_escape()
- * @uses wpdb::_real_escape()
- * @since 2.8
+ * @uses wpdb::_escape()
+ * @uses wpdb::_real_escape()
+ * @since 2.8.0
* @access private
*
* @param string|array $data
* By default database errors are suppressed, with a simple
* call to this function they can be enabled.
*
- * @since 2.5
+ * @since 2.5.0
* @see wpdb::hide_errors()
* @param bool $suppress Optional. New value. Defaults to true.
* @return bool Old value
$this->last_query = null;
}
- function db_connect( $query = "SELECT" ) {
+ /**
+ * Connect to and select database
+ *
+ * @since 3.0.0
+ */
+ function db_connect() {
global $db_list, $global_db_list;
- if ( ! is_array( $db_list ) )
- return true;
-
- if ( $this->blogs != '' && preg_match("/(" . $this->blogs . "|" . $this->users . "|" . $this->usermeta . "|" . $this->site . "|" . $this->sitemeta . "|" . $this->sitecategories . ")/i",$query) ) {
- $action = 'global';
- $details = $global_db_list[ mt_rand( 0, count( $global_db_list ) -1 ) ];
- $this->db_global = $details;
- } elseif ( preg_match("/^\\s*(alter table|create|insert|delete|update|replace) /i",$query) ) {
- $action = 'write';
- $details = $db_list[ 'write' ][ mt_rand( 0, count( $db_list[ 'write' ] ) -1 ) ];
- $this->db_write = $details;
+
+ if ( WP_DEBUG ) {
+ $this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
} else {
- $action = '';
- $details = $db_list[ 'read' ][ mt_rand( 0, count( $db_list[ 'read' ] ) -1 ) ];
- $this->db_read = $details;
+ $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
}
- $dbhname = "dbh" . $action;
- $this->$dbhname = @mysql_connect( $details[ 'db_host' ], $details[ 'db_user' ], $details[ 'db_password' ] );
- if (!$this->$dbhname ) {
+ if ( !$this->dbh ) {
$this->bail( sprintf( /*WP_I18N_DB_CONN_ERROR*/"
<h1>Error establishing a database connection</h1>
<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>%s</code>. This could mean your host's database server is down.</p>
<li>Are you sure that the database server is running?</li>
</ul>
<p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>
-"/*/WP_I18N_DB_CONN_ERROR*/, $details['db_host'] ), 'db_connect_fail' );
+"/*/WP_I18N_DB_CONN_ERROR*/, $this->dbhost ), 'db_connect_fail' );
+
+ // If show errors is disabled then we need to die anyway as we don't have a working DB connection
+ // unless we're trying to test the initial connection, in which case setup-config.php will handle.
+ if ( defined( 'WP_SETUP_CONFIG' ) )
+ return;
+
+ die();
}
- $this->select( $details[ 'db_name' ], $this->$dbhname );
+
+ $this->set_charset( $this->dbh );
+
+ $this->ready = true;
+
+ $this->select( $this->dbname, $this->dbh );
}
/**
if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES )
$this->timer_start();
- // use $this->dbh for read ops, and $this->dbhwrite for write ops
- // use $this->dbhglobal for gloal table ops
- unset( $dbh );
- if( defined( 'WP_USE_MULTIPLE_DB' ) && WP_USE_MULTIPLE_DB ) {
- if( $this->blogs != '' && preg_match("/(" . $this->blogs . "|" . $this->users . "|" . $this->usermeta . "|" . $this->site . "|" . $this->sitemeta . "|" . $this->sitecategories . ")/i",$query) ) {
- if( false == isset( $this->dbhglobal ) ) {
- $this->db_connect( $query );
- }
- $dbh =& $this->dbhglobal;
- $this->last_db_used = "global";
- } elseif ( preg_match("/^\\s*(alter table|create|insert|delete|update|replace) /i",$query) ) {
- if( false == isset( $this->dbhwrite ) ) {
- $this->db_connect( $query );
- }
- $dbh =& $this->dbhwrite;
- $this->last_db_used = "write";
- } else {
- $dbh =& $this->dbh;
- $this->last_db_used = "read";
- }
- } else {
- $dbh =& $this->dbh;
- $this->last_db_used = "other/read";
- }
-
- $this->result = @mysql_query( $query, $dbh );
+ $this->result = @mysql_query( $query, $this->dbh );
$this->num_queries++;
if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES )
$this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() );
// If there is an error then take note of it..
- if ( $this->last_error = mysql_error( $dbh ) ) {
+ if ( $this->last_error = mysql_error( $this->dbh ) ) {
$this->print_error();
return false;
}
if ( preg_match( "/^\\s*(insert|delete|update|replace|alter) /i", $query ) ) {
- $this->rows_affected = mysql_affected_rows( $dbh );
+ $this->rows_affected = mysql_affected_rows( $this->dbh );
// Take note of the insert_id
if ( preg_match( "/^\\s*(insert|replace) /i", $query ) ) {
- $this->insert_id = mysql_insert_id($dbh);
+ $this->insert_id = mysql_insert_id($this->dbh);
}
// Return number of rows affected
$return_val = $this->rows_affected;
/**
* Determine if a database supports a particular feature
*
- * @since 2.7
+ * @since 2.7.0
* @see wpdb::db_version()
*
* @param string $db_cap the feature
case 'group_concat' : // @since 2.7
case 'subqueries' : // @since 2.7
return version_compare( $version, '4.1', '>=' );
+ case 'set_charset' :
+ return version_compare($version, '5.0.7', '>=');
};
return false;
/**
* The database version number.
*
+ * @since 2.7.0
+ *
* @return false|string false on failure, version number on success
*/
function db_version() {
}
}
-if ( ! isset( $wpdb ) ) {
- /**
- * WordPress Database Object, if it isn't set already in wp-content/db.php
- * @global object $wpdb Creates a new wpdb object based on wp-config.php Constants for the database
- * @since 0.71
- */
- $wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );
-}
?>
*
* This will set class properties based on the key value pairs in the array.
*
- * @since unknown
+ * @since 2.6.0
*
* @param array $params
*/
* @package WordPress
*/
-if ( empty($wp) ) {
- require_once('./wp-load.php');
- wp();
-}
+require_once('./wp-load.php');
header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
$link_cat = '';
<body>
<?php
if ( empty($link_cat) )
- $cats = get_categories(array('type' => 'link', 'hierarchical' => 0));
+ $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0));
else
- $cats = get_categories(array('type' => 'link', 'hierarchical' => 0, 'include' => $link_cat));
+ $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0, 'include' => $link_cat));
foreach ( (array)$cats as $cat ) :
$catname = apply_filters('link_category', $cat->name);
endforeach; // $cats
?>
</body>
-</opml>
+</opml>
\ No newline at end of file
// A config file doesn't exist
// Set a path for the link to the installer
- if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = '';
- else $path = 'wp-admin/';
+ if ( strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false )
+ $path = '';
+ else
+ $path = 'wp-admin/';
// Die with an error message
- require_once( ABSPATH . '/wp-includes/classes.php' );
+ require_once( ABSPATH . '/wp-includes/class-wp-error.php' );
require_once( ABSPATH . '/wp-includes/functions.php' );
require_once( ABSPATH . '/wp-includes/plugin.php' );
$text_direction = /*WP_I18N_TEXT_DIRECTION*/"ltr"/*/WP_I18N_TEXT_DIRECTION*/;
}
-?>
+?>
\ No newline at end of file
<?php
}
- do_action('login_head'); ?>
+ do_action( 'login_enqueue_scripts' );
+ do_action( 'login_head' ); ?>
</head>
<body class="login">
<?php if ( !is_multisite() ) { ?>
-<div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', 'http://wordpress.org/'); ?>" title="<?php echo apply_filters('login_headertitle', __('Powered by WordPress')); ?>"><?php bloginfo('name'); ?></a></h1>
+<div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', 'http://wordpress.org/'); ?>" title="<?php echo apply_filters('login_headertitle', esc_attr__('Powered by WordPress')); ?>"><?php bloginfo('name'); ?></a></h1>
<?php } else { ?>
-<div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', network_home_url() ); ?>" title="<?php echo apply_filters('login_headertitle', $current_site->site_name ); ?>"><span class="hide"><?php bloginfo('name'); ?></span></a></h1>
+<div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', network_home_url() ); ?>" title="<?php echo apply_filters('login_headertitle', esc_attr($current_site->site_name) ); ?>"><span class="hide"><?php bloginfo('name'); ?></span></a></h1>
<?php }
$message = apply_filters('login_message', $message);
echo '<p class="message">' . apply_filters('login_messages', $messages) . "</p>\n";
}
} // End of login_header()
+
+/**
+ * Outputs the footer for the login page.
+ *
+ * @param string $input_id Which input to auto-focus
+ */
+function login_footer($input_id = '') {
+ echo "</div>\n";
+
+ if ( !empty($input_id) ) {
+?>
+<script type="text/javascript">
+try{document.getElementById('<?php echo $input_id; ?>').focus();}catch(e){}
+if(typeof wpOnload=='function')wpOnload();
+</script>
+<?php
+ }
+?>
+<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php esc_attr_e('Are you lost?') ?>"><?php printf(__('← Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
+<?php do_action('login_footer'); ?>
+</body>
+</html>
+<?php
+}
+
function wp_shake_js() {
global $is_iphone;
if ( $is_iphone )
// Now insert the new md5 key into the db
$wpdb->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 = __('Someone requested that the password be reset for the following account:') . "\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 .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n";
+ $message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n";
+ $message .= __('To reset your password, visit the following address:') . "\r\n\r\n";
+ $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n";
if ( is_multisite() )
$blogname = $GLOBALS['current_site']->site_name;
}
/**
- * Handles resetting the user's password.
+ * Retrieves a user row based on password reset key and login
*
* @uses $wpdb WordPress Database object
*
* @param string $key Hash to validate sending user's password
- * @return bool|WP_Error
+ * @param string $login The user login
+ *
+ * @return object|WP_Error
*/
-function reset_password($key, $login) {
+function check_password_reset_key($key, $login) {
global $wpdb;
$key = preg_replace('/[^a-z0-9]/i', '', $key);
return new WP_Error('invalid_key', __('Invalid key'));
$user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE user_activation_key = %s AND user_login = %s", $key, $login));
+
if ( empty( $user ) )
return new WP_Error('invalid_key', __('Invalid key'));
- // Generate something random for a password...
- $new_pass = wp_generate_password();
+ return $user;
+}
+/**
+ * Handles resetting the user's password.
+ *
+ * @uses $wpdb WordPress Database object
+ *
+ * @param string $key Hash to validate sending user's password
+ */
+function reset_password($user, $new_pass) {
do_action('password_reset', $user, $new_pass);
wp_set_password($new_pass, $user->ID);
- 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";
-
- 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 = apply_filters('password_reset_title', $title);
- $message = apply_filters('password_reset_message', $message, $new_pass);
-
- if ( $message && !wp_mail($user->user_email, $title, $message) )
- wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') );
wp_password_change_notification($user);
-
- return true;
}
/**
if ( $errors->get_error_code() )
return $errors;
- $user_pass = wp_generate_password();
+ $user_pass = wp_generate_password( 12, false);
$user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
if ( ! $user_id ) {
$errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn’t register you... please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
case 'lostpassword' :
case 'retrievepassword' :
+
if ( $http_post ) {
$errors = retrieve_password();
if ( !is_wp_error($errors) ) {
$redirect_to = apply_filters( 'lostpassword_redirect', !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '' );
do_action('lost_password');
- login_header(__('Lost Password'), '<p class="message">' . __('Please enter your username or e-mail address. You will receive a new password via e-mail.') . '</p>', $errors);
+ login_header(__('Lost Password'), '<p class="message">' . __('Please enter your username or email address. You will receive a link to create a new password via email.') . '</p>', $errors);
$user_login = isset($_POST['user_login']) ? stripslashes($_POST['user_login']) : '';
</form>
<p id="nav">
-<?php if (get_option('users_can_register')) : ?>
-<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a> |
-<a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a>
-<?php else : ?>
<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a>
+<?php if (get_option('users_can_register')) : ?>
+ | <a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a>
<?php endif; ?>
</p>
-</div>
-
-<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('← Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
-
-<script type="text/javascript">
-try{document.getElementById('user_login').focus();}catch(e){}
-if(typeof wpOnload=='function')wpOnload();
-</script>
-</body>
-</html>
<?php
+login_footer('user_login');
break;
case 'resetpass' :
case 'rp' :
- $errors = reset_password($_GET['key'], $_GET['login']);
+ $user = check_password_reset_key($_GET['key'], $_GET['login']);
- if ( ! is_wp_error($errors) ) {
- wp_redirect('wp-login.php?checkemail=newpass');
- exit();
+ if ( is_wp_error($user) ) {
+ wp_redirect( site_url('wp-login.php?action=lostpassword&error=invalidkey') );
+ exit;
}
- wp_redirect('wp-login.php?action=lostpassword&error=invalidkey');
- exit();
+ $errors = '';
+
+ if ( isset($_POST['pass1']) && $_POST['pass1'] != $_POST['pass2'] ) {
+ $errors = new WP_Error('password_reset_mismatch', __('The passwords do not match.'));
+ } elseif ( isset($_POST['pass1']) && !empty($_POST['pass1']) ) {
+ reset_password($user, $_POST['pass1']);
+ login_header(__('Password Reset'), '<p class="message reset-pass">' . __('Your password has been reset.') . ' <a href="' . site_url('wp-login.php', 'login') . '">' . __('Log in') . '</a></p>');
+ login_footer();
+ exit;
+ }
+ wp_enqueue_script('utils');
+ wp_enqueue_script('user-profile');
+
+ login_header(__('Reset Password'), '<p class="message reset-pass">' . __('Enter your new password below.') . '</p>', $errors );
+
+?>
+<form name="resetpassform" id="resetpassform" action="<?php echo site_url('wp-login.php?action=resetpass&key=' . urlencode($_GET['key']) . '&login=' . urlencode($_GET['login']), 'login_post') ?>" method="post">
+ <input type="hidden" id="user_login" value="<?php echo esc_attr( $_GET['login'] ); ?>" autocomplete="off" />
+
+ <p>
+ <label><?php _e('New password') ?><br />
+ <input type="password" name="pass1" id="pass1" class="input" size="20" value="" autocomplete="off" /></label>
+ </p>
+ <p>
+ <label><?php _e('Confirm new password') ?><br />
+ <input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off" /></label>
+ </p>
+
+ <div id="pass-strength-result" class="hide-if-no-js"><?php _e('Strength indicator'); ?></div>
+ <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).'); ?></p>
+
+ <br class="clear" />
+ <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Reset Password'); ?>" tabindex="100" /></p>
+</form>
+
+<p id="nav">
+<a href="<?php echo site_url('wp-login.php', 'login') ?>"><?php _e('Log in') ?></a>
+<?php if (get_option('users_can_register')) : ?>
+ | <a href="<?php echo site_url('wp-login.php?action=register', 'login') ?>"><?php _e('Register') ?></a>
+<?php endif; ?>
+</p>
+
+<?php
+login_footer('user_pass');
break;
case 'register' :
if ( is_multisite() ) {
// Multisite uses wp-signup.php
- wp_redirect( apply_filters( 'wp_signup_location', get_bloginfo('wpurl') . '/wp-signup.php' ) );
+ wp_redirect( apply_filters( 'wp_signup_location', site_url('wp-signup.php') ) );
exit;
}
if ( !get_option('users_can_register') ) {
- wp_redirect('wp-login.php?registration=disabled');
+ wp_redirect( site_url('wp-login.php?registration=disabled') );
exit();
}
$user_login = '';
$user_email = '';
if ( $http_post ) {
- require_once( ABSPATH . WPINC . '/registration.php');
-
$user_login = $_POST['user_login'];
$user_email = $_POST['user_email'];
$errors = register_new_user($user_login, $user_email);
<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
</p>
-</div>
-
-<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('← Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
-
-<script type="text/javascript">
-try{document.getElementById('user_login').focus();}catch(e){}
-if(typeof wpOnload=='function')wpOnload();
-</script>
-</body>
-</html>
<?php
+login_footer('user_login');
break;
case 'login' :
</div></body></html>
<?php exit;
}
- // If the user can't edit posts, send them to their profile.
- if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) )
- $redirect_to = admin_url('profile.php');
+
+ if ( ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) {
+ // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
+ if ( is_multisite() && !get_active_blog_for_user($user->id) )
+ $redirect_to = user_admin_url();
+ elseif ( is_multisite() && !$user->has_cap('read') )
+ $redirect_to = get_dashboard_url( $user->id );
+ elseif ( !$user->has_cap('edit_posts') )
+ $redirect_to = admin_url('profile.php');
+ }
wp_safe_redirect($redirect_to);
exit();
}
<?php endif; ?>
</p>
</div>
-<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('← Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
+<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php esc_attr_e('Are you lost?') ?>"><?php printf(__('← Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
<?php } else { ?>
</div>
<?php } ?>
setTimeout( function(){ try{
<?php if ( $user_login || $interim_login ) { ?>
d = document.getElementById('user_pass');
+d.value = '';
<?php } else { ?>
d = document.getElementById('user_login');
-<?php } ?>
+<?php if ( 'invalid_username' == $errors->get_error_code() ) { ?>
+if( d.value != '' )
d.value = '';
+<?php
+}
+}?>
d.focus();
+d.select();
} catch(e){}
}, 200);
}
<?php } ?>
if(typeof wpOnload=='function')wpOnload();
</script>
+<?php do_action( 'login_footer' ); ?>
</body>
</html>
<?php
setcookie('wp-postpass_' . COOKIEHASH, $_POST['post_password'], time() + 864000, COOKIEPATH);
wp_safe_redirect(wp_get_referer());
-?>
\ No newline at end of file
+exit;
+?>
require( './wp-load.php' );
wp_redirect( get_bloginfo( 'rdf_url' ), 301 );
-
-?>
\ No newline at end of file
+exit;
+?>
*/
require('./wp-load.php');
-wp_redirect('wp-login.php?action=register');
-
-?>
\ No newline at end of file
+wp_redirect( site_url('wp-login.php?action=register') );
+exit;
+?>
require( './wp-load.php' );
wp_redirect( get_bloginfo( 'rss_url' ), 301 );
-
-?>
\ No newline at end of file
+exit;
+?>
require( './wp-load.php' );
wp_redirect( get_bloginfo( 'rss2_url' ), 301 );
-
-?>
\ No newline at end of file
+exit;
+?>
wp_unregister_GLOBALS();
// Ensure these global variables do not exist so they do not interfere with WordPress.
-unset( $wp_filter, $cache_lastcommentmodified, $cache_lastpostdate );
+unset( $wp_filter, $cache_lastcommentmodified );
// Standardize $_SERVER variables across setups.
wp_fix_server_vars();
// Load early WordPress files.
require( ABSPATH . WPINC . '/compat.php' );
require( ABSPATH . WPINC . '/functions.php' );
-require( ABSPATH . WPINC . '/classes.php' );
+require( ABSPATH . WPINC . '/class-wp.php' );
+require( ABSPATH . WPINC . '/class-wp-error.php' );
+require( ABSPATH . WPINC . '/plugin.php' );
-// Include the wpdb class, or a db.php database drop-in if present.
+// Include the wpdb class and, if present, a db.php database drop-in.
require_wp_db();
// Set the database table prefix and the format specifiers for database table columns.
wp_start_object_cache();
// Load early WordPress files.
-require( ABSPATH . WPINC . '/plugin.php' );
require( ABSPATH . WPINC . '/default-filters.php' );
require( ABSPATH . WPINC . '/pomo/mo.php' );
wp_not_installed();
// Load most of WordPress.
+require( ABSPATH . WPINC . '/class-wp-walker.php' );
+require( ABSPATH . WPINC . '/class-wp-ajax-response.php' );
require( ABSPATH . WPINC . '/formatting.php' );
require( ABSPATH . WPINC . '/capabilities.php' );
require( ABSPATH . WPINC . '/query.php' );
require( ABSPATH . WPINC . '/widgets.php' );
require( ABSPATH . WPINC . '/nav-menu.php' );
require( ABSPATH . WPINC . '/nav-menu-template.php' );
+require( ABSPATH . WPINC . '/admin-bar.php' );
// Load multisite-specific files.
if ( is_multisite() ) {
}
unset( $mu_plugin );
+// Load network activated plugins.
+if ( is_multisite() ) {
+ foreach( wp_get_active_network_plugins() as $network_plugin ) {
+ include_once( $network_plugin );
+ }
+ unset( $network_plugin );
+}
+
do_action( 'muplugins_loaded' );
if ( is_multisite() )
create_initial_taxonomies();
create_initial_post_types();
+// Register the default theme directory root
+register_theme_directory( get_theme_root() );
+
// Load active plugins.
foreach ( wp_get_active_and_valid_plugins() as $plugin )
include_once( $plugin );
add_action( 'wp_head', 'signuppageheaders' ) ;
require( './wp-blog-header.php' );
-require_once( ABSPATH . WPINC . '/registration.php' );
if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) {
wp_redirect( network_home_url() );
}
if ( !is_multisite() ) {
- wp_redirect( get_option( 'siteurl' ) . "/wp-login.php?action=register" );
+ wp_redirect( site_url('wp-login.php?action=register') );
die();
}
echo '<input name="blogname" type="text" id="blogname" value="'.esc_attr($blogname).'" maxlength="60" /><span class="suffix_address">.' . ( $site_domain = preg_replace( '|^www\.|', '', $current_site->domain ) ) . '</span><br />';
if ( !is_user_logged_in() ) {
- print '(<strong>' . __( 'Your address will be ' );
if ( !is_subdomain_install() )
- print $current_site->domain . $current_site->path . __( 'sitename' );
+ $site = $current_site->domain . $current_site->path . __( 'sitename' );
else
- print __( 'domain.' ) . $site_domain . $current_site->path;
- echo '.</strong>) ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) . '</p>';
+ $site = __( 'domain' ) . '.' . $site_domain . $current_site->path;
+ echo '<p>(<strong>' . sprintf( __('Your address will be %s.'), $site ) . '</strong>) ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) . '</p>';
}
// Blog Title
$i18n_signup['user'] = _x('user', 'Multisite active signup type');
if ( is_super_admin() )
- echo '<div class="mu_alert">' . sprintf( __( 'Greetings Site Administrator! You are currently allowing “%s” registrations. To change or disable registration go to your <a href="%s">Options page</a>.' ), $i18n_signup[$active_signup], esc_url( network_admin_url( 'ms-options.php' ) ) ) . '</div>';
+ echo '<div class="mu_alert">' . sprintf( __( 'Greetings Site Administrator! You are currently allowing “%s” registrations. To change or disable registration go to your <a href="%s">Options page</a>.' ), $i18n_signup[$active_signup], esc_url( network_admin_url( 'settings.php' ) ) ) . '</div>';
$newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null;
/**
* XML-RPC protocol support for WordPress
*
- * @license GPL v2 <./license.txt>
* @package WordPress
*/
include_once(ABSPATH . 'wp-admin/includes/admin.php');
include_once(ABSPATH . WPINC . '/class-IXR.php');
+include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
// Turn off all warnings and errors.
// error_reporting(0);
if ( isset($HTTP_RAW_POST_DATA) )
logIO("I", $HTTP_RAW_POST_DATA);
-/**
- * WordPress XMLRPC server implementation.
- *
- * Implements compatability for Blogger API, MetaWeblog API, MovableType, and
- * pingback. Additional WordPress API for managing comments, pages, posts,
- * options, etc.
- *
- * Since WordPress 2.6.0, WordPress XMLRPC server can be disabled in the
- * administration panels.
- *
- * @package WordPress
- * @subpackage Publishing
- * @since 1.5.0
- */
-class wp_xmlrpc_server extends IXR_Server {
-
- /**
- * Register all of the XMLRPC methods that XMLRPC server understands.
- *
- * PHP4 constructor and sets up server and method property. Passes XMLRPC
- * methods through the 'xmlrpc_methods' filter to allow plugins to extend
- * or replace XMLRPC methods.
- *
- * @since 1.5.0
- *
- * @return wp_xmlrpc_server
- */
- function wp_xmlrpc_server() {
- $this->methods = array(
- // WordPress API
- 'wp.getUsersBlogs' => 'this:wp_getUsersBlogs',
- 'wp.getPage' => 'this:wp_getPage',
- 'wp.getPages' => 'this:wp_getPages',
- 'wp.newPage' => 'this:wp_newPage',
- 'wp.deletePage' => 'this:wp_deletePage',
- 'wp.editPage' => 'this:wp_editPage',
- 'wp.getPageList' => 'this:wp_getPageList',
- 'wp.getAuthors' => 'this:wp_getAuthors',
- 'wp.getCategories' => 'this:mw_getCategories', // Alias
- 'wp.getTags' => 'this:wp_getTags',
- 'wp.newCategory' => 'this:wp_newCategory',
- 'wp.deleteCategory' => 'this:wp_deleteCategory',
- 'wp.suggestCategories' => 'this:wp_suggestCategories',
- 'wp.uploadFile' => 'this:mw_newMediaObject', // Alias
- 'wp.getCommentCount' => 'this:wp_getCommentCount',
- 'wp.getPostStatusList' => 'this:wp_getPostStatusList',
- 'wp.getPageStatusList' => 'this:wp_getPageStatusList',
- 'wp.getPageTemplates' => 'this:wp_getPageTemplates',
- 'wp.getOptions' => 'this:wp_getOptions',
- 'wp.setOptions' => 'this:wp_setOptions',
- 'wp.getComment' => 'this:wp_getComment',
- 'wp.getComments' => 'this:wp_getComments',
- 'wp.deleteComment' => 'this:wp_deleteComment',
- 'wp.editComment' => 'this:wp_editComment',
- 'wp.newComment' => 'this:wp_newComment',
- 'wp.getCommentStatusList' => 'this:wp_getCommentStatusList',
-
- // Blogger API
- 'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs',
- 'blogger.getUserInfo' => 'this:blogger_getUserInfo',
- 'blogger.getPost' => 'this:blogger_getPost',
- 'blogger.getRecentPosts' => 'this:blogger_getRecentPosts',
- 'blogger.getTemplate' => 'this:blogger_getTemplate',
- 'blogger.setTemplate' => 'this:blogger_setTemplate',
- 'blogger.newPost' => 'this:blogger_newPost',
- 'blogger.editPost' => 'this:blogger_editPost',
- 'blogger.deletePost' => 'this:blogger_deletePost',
-
- // MetaWeblog API (with MT extensions to structs)
- 'metaWeblog.newPost' => 'this:mw_newPost',
- 'metaWeblog.editPost' => 'this:mw_editPost',
- 'metaWeblog.getPost' => 'this:mw_getPost',
- 'metaWeblog.getRecentPosts' => 'this:mw_getRecentPosts',
- 'metaWeblog.getCategories' => 'this:mw_getCategories',
- 'metaWeblog.newMediaObject' => 'this:mw_newMediaObject',
-
- // MetaWeblog API aliases for Blogger API
- // see http://www.xmlrpc.com/stories/storyReader$2460
- 'metaWeblog.deletePost' => 'this:blogger_deletePost',
- 'metaWeblog.getTemplate' => 'this:blogger_getTemplate',
- 'metaWeblog.setTemplate' => 'this:blogger_setTemplate',
- 'metaWeblog.getUsersBlogs' => 'this:blogger_getUsersBlogs',
-
- // MovableType API
- 'mt.getCategoryList' => 'this:mt_getCategoryList',
- 'mt.getRecentPostTitles' => 'this:mt_getRecentPostTitles',
- 'mt.getPostCategories' => 'this:mt_getPostCategories',
- 'mt.setPostCategories' => 'this:mt_setPostCategories',
- 'mt.supportedMethods' => 'this:mt_supportedMethods',
- 'mt.supportedTextFilters' => 'this:mt_supportedTextFilters',
- 'mt.getTrackbackPings' => 'this:mt_getTrackbackPings',
- 'mt.publishPost' => 'this:mt_publishPost',
-
- // PingBack
- 'pingback.ping' => 'this:pingback_ping',
- 'pingback.extensions.getPingbacks' => 'this:pingback_extensions_getPingbacks',
-
- 'demo.sayHello' => 'this:sayHello',
- 'demo.addTwoNumbers' => 'this:addTwoNumbers'
- );
-
- $this->initialise_blog_option_info( );
- $this->methods = apply_filters('xmlrpc_methods', $this->methods);
- }
-
- function serve_request() {
- $this->IXR_Server($this->methods);
- }
-
- /**
- * Test XMLRPC API by saying, "Hello!" to client.
- *
- * @since 1.5.0
- *
- * @param array $args Method Parameters.
- * @return string
- */
- function sayHello($args) {
- return 'Hello!';
- }
-
- /**
- * Test XMLRPC API by adding two numbers for client.
- *
- * @since 1.5.0
- *
- * @param array $args Method Parameters.
- * @return int
- */
- function addTwoNumbers($args) {
- $number1 = $args[0];
- $number2 = $args[1];
- return $number1 + $number2;
- }
-
- /**
- * Check user's credentials.
- *
- * @since 1.5.0
- *
- * @param string $user_login User's username.
- * @param string $user_pass User's password.
- * @return bool Whether authentication passed.
- * @deprecated use wp_xmlrpc_server::login
- * @see wp_xmlrpc_server::login
- */
- 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 site. An admin user can enable them at %s'), admin_url('options-writing.php') ) );
- return false;
- }
-
- if (!user_pass_ok($user_login, $user_pass)) {
- $this->error = new IXR_Error(403, __('Bad login/pass combination.'));
- return false;
- }
- return true;
- }
-
- /**
- * Log user in.
- *
- * @since 2.8
- *
- * @param string $username User's username.
- * @param string $password User's password.
- * @return mixed WP_User object if authentication passed, false otherwise
- */
- function login($username, $password) {
- if ( !get_option( 'enable_xmlrpc' ) ) {
- $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;
- }
-
- $user = wp_authenticate($username, $password);
-
- if (is_wp_error($user)) {
- $this->error = new IXR_Error(403, __('Bad login/pass combination.'));
- return false;
- }
-
- wp_set_current_user( $user->ID );
- return $user;
- }
-
- /**
- * Sanitize string or array of strings for database.
- *
- * @since 1.5.2
- *
- * @param string|array $array Sanitize single string or array of strings.
- * @return string|array Type matches $array and sanitized for the database.
- */
- function escape(&$array) {
- global $wpdb;
-
- if (!is_array($array)) {
- return($wpdb->escape($array));
- } else {
- foreach ( (array) $array as $k => $v ) {
- if ( is_array($v) ) {
- $this->escape($array[$k]);
- } else if ( is_object($v) ) {
- //skip
- } else {
- $array[$k] = $wpdb->escape($v);
- }
- }
- }
- }
-
- /**
- * Retrieve custom fields for post.
- *
- * @since 2.5.0
- *
- * @param int $post_id Post ID.
- * @return array Custom fields, if exist.
- */
- function get_custom_fields($post_id) {
- $post_id = (int) $post_id;
-
- $custom_fields = array();
-
- foreach ( (array) has_meta($post_id) as $meta ) {
- // Don't expose protected fields.
- if ( strpos($meta['meta_key'], '_wp_') === 0 ) {
- continue;
- }
-
- $custom_fields[] = array(
- "id" => $meta['meta_id'],
- "key" => $meta['meta_key'],
- "value" => $meta['meta_value']
- );
- }
-
- return $custom_fields;
- }
-
- /**
- * Set custom fields for post.
- *
- * @since 2.5.0
- *
- * @param int $post_id Post ID.
- * @param array $fields Custom fields.
- */
- function set_custom_fields($post_id, $fields) {
- $post_id = (int) $post_id;
-
- foreach ( (array) $fields as $meta ) {
- if ( isset($meta['id']) ) {
- $meta['id'] = (int) $meta['id'];
-
- if ( isset($meta['key']) ) {
- update_meta($meta['id'], $meta['key'], $meta['value']);
- }
- else {
- delete_meta($meta['id']);
- }
- }
- else {
- $_POST['metakeyinput'] = $meta['key'];
- $_POST['metavalue'] = $meta['value'];
- add_meta($post_id);
- }
- }
- }
-
- /**
- * Set up blog options property.
- *
- * Passes property through 'xmlrpc_blog_options' filter.
- *
- * @since 2.6.0
- */
- function initialise_blog_option_info( ) {
- global $wp_version;
-
- $this->blog_options = array(
- // Read only options
- 'software_name' => array(
- 'desc' => __( 'Software Name' ),
- 'readonly' => true,
- 'value' => 'WordPress'
- ),
- 'software_version' => array(
- 'desc' => __( 'Software Version' ),
- 'readonly' => true,
- 'value' => $wp_version
- ),
- 'blog_url' => array(
- 'desc' => __( 'Site URL' ),
- 'readonly' => true,
- 'option' => 'siteurl'
- ),
-
- // Updatable options
- 'time_zone' => array(
- 'desc' => __( 'Time Zone' ),
- 'readonly' => false,
- 'option' => 'gmt_offset'
- ),
- 'blog_title' => array(
- 'desc' => __( 'Site Title' ),
- 'readonly' => false,
- 'option' => 'blogname'
- ),
- 'blog_tagline' => array(
- 'desc' => __( 'Site Tagline' ),
- 'readonly' => false,
- 'option' => 'blogdescription'
- ),
- 'date_format' => array(
- 'desc' => __( 'Date Format' ),
- 'readonly' => false,
- 'option' => 'date_format'
- ),
- 'time_format' => array(
- 'desc' => __( 'Time Format' ),
- 'readonly' => false,
- 'option' => 'time_format'
- ),
- 'users_can_register' => array(
- 'desc' => __( 'Allow new users to sign up' ),
- 'readonly' => false,
- 'option' => 'users_can_register'
- )
- );
-
- $this->blog_options = apply_filters( 'xmlrpc_blog_options', $this->blog_options );
- }
-
- /**
- * Retrieve the blogs of the user.
- *
- * @since 2.6.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_getUsersBlogs( $args ) {
- global $current_site;
- // If this isn't on WPMU then just use blogger_getUsersBlogs
- if ( !is_multisite() ) {
- array_unshift( $args, 1 );
- return $this->blogger_getUsersBlogs( $args );
- }
-
- $this->escape( $args );
-
- $username = $args[0];
- $password = $args[1];
-
- 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 ) {
- // Don't include blogs that aren't hosted at this site
- if ( $blog->site_id != $current_site->id )
- continue;
-
- $blog_id = $blog->userblog_id;
- switch_to_blog($blog_id);
- $is_admin = current_user_can('manage_options');
-
- $struct[] = array(
- 'isAdmin' => $is_admin,
- 'url' => get_option( 'home' ) . '/',
- 'blogid' => $blog_id,
- 'blogName' => get_option( 'blogname' ),
- 'xmlrpc' => site_url( 'xmlrpc.php' )
- );
-
- restore_current_blog( );
- }
-
- return $struct;
- }
-
- /**
- * Retrieve page.
- *
- * @since 2.2.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_getPage($args) {
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $page_id = (int) $args[1];
- $username = $args[2];
- $password = $args[3];
-
- if ( !$user = $this->login($username, $password) ) {
- return $this->error;
- }
-
- 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');
-
- // Lookup page info.
- $page = get_page($page_id);
-
- // If we found the page then format the data.
- 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) ) {
- $parent = get_page($page->post_parent);
- $parent_title = $parent->post_title;
- }
-
- // Determine comment and ping settings.
- $allow_comments = comments_open($page->ID) ? 1 : 0;
- $allow_pings = pings_open($page->ID) ? 1 : 0;
-
- // Format page date.
- $page_date = mysql2date("Ymd\TH:i:s", $page->post_date, false);
- $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' )
- $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 ) {
- $categories[] = get_cat_name($cat_id);
- }
-
- // Get the author info.
- $author = get_userdata($page->post_author);
-
- $page_template = get_post_meta( $page->ID, '_wp_page_template', true );
- if ( empty( $page_template ) )
- $page_template = 'default';
-
- $page_struct = array(
- "dateCreated" => new IXR_Date($page_date),
- "userid" => $page->post_author,
- "page_id" => $page->ID,
- "page_status" => $page->post_status,
- "description" => $full_page["main"],
- "title" => $page->post_title,
- "link" => $link,
- "permaLink" => $link,
- "categories" => $categories,
- "excerpt" => $page->post_excerpt,
- "text_more" => $full_page["extended"],
- "mt_allow_comments" => $allow_comments,
- "mt_allow_pings" => $allow_pings,
- "wp_slug" => $page->post_name,
- "wp_password" => $page->post_password,
- "wp_author" => $author->display_name,
- "wp_page_parent_id" => $page->post_parent,
- "wp_page_parent_title" => $parent_title,
- "wp_page_order" => $page->menu_order,
- "wp_author_id" => $author->ID,
- "wp_author_display_name" => $author->display_name,
- "date_created_gmt" => new IXR_Date($page_date_gmt),
- "custom_fields" => $this->get_custom_fields($page_id),
- "wp_page_template" => $page_template
- );
-
- return($page_struct);
- }
- // If the page doesn't exist indicate that.
- else {
- return(new IXR_Error(404, __("Sorry, no such page.")));
- }
- }
-
- /**
- * Retrieve Pages.
- *
- * @since 2.2.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_getPages($args) {
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $num_pages = isset($args[3]) ? (int) $args[3] : 10;
-
- if ( !$user = $this->login($username, $password) )
- return $this->error;
-
- if ( !current_user_can( 'edit_pages' ) )
- return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) );
-
- do_action('xmlrpc_call', 'wp.getPages');
-
- $pages = get_posts( array('post_type' => 'page', 'post_status' => 'any', 'numberposts' => $num_pages) );
- $num_pages = count($pages);
-
- // If we have pages, put together their info.
- if ( $num_pages >= 1 ) {
- $pages_struct = array();
-
- for ( $i = 0; $i < $num_pages; $i++ ) {
- $page = wp_xmlrpc_server::wp_getPage(array(
- $blog_id, $pages[$i]->ID, $username, $password
- ));
- $pages_struct[] = $page;
- }
-
- return($pages_struct);
- }
- // If no pages were found return an error.
- else {
- return(array());
- }
- }
-
- /**
- * Create new page.
- *
- * @since 2.2.0
- *
- * @param array $args Method parameters.
- * @return unknown
- */
- function wp_newPage($args) {
- // Items not escaped here will be escaped in newPost.
- $username = $this->escape($args[1]);
- $password = $this->escape($args[2]);
- $page = $args[3];
- $publish = $args[4];
-
- 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") )
- return(new IXR_Error(401, __("Sorry, you cannot add new pages.")));
-
- // Mark this as content for a page.
- $args[3]["post_type"] = "page";
-
- // Let mw_newPost do all of the heavy lifting.
- return($this->mw_newPost($args));
- }
-
- /**
- * Delete page.
- *
- * @since 2.2.0
- *
- * @param array $args Method parameters.
- * @return bool True, if success.
- */
- function wp_deletePage($args) {
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $page_id = (int) $args[3];
-
- 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") )
- return(new IXR_Error(404, __("Sorry, no such page.")));
-
- // Make sure the user can delete pages.
- 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 )
- return(new IXR_Error(500, __("Failed to delete the page.")));
-
- return(true);
- }
-
- /**
- * Edit page.
- *
- * @since 2.2.0
- *
- * @param array $args Method parameters.
- * @return unknown
- */
- function wp_editPage($args) {
- // Items not escaped here will be escaped in editPost.
- $blog_id = (int) $args[0];
- $page_id = (int) $this->escape($args[1]);
- $username = $this->escape($args[2]);
- $password = $this->escape($args[3]);
- $content = $args[4];
- $publish = $args[5];
-
- 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") )
- 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) )
- 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";
-
- // Arrange args in the way mw_editPost understands.
- $args = array(
- $page_id,
- $username,
- $password,
- $content,
- $publish
- );
-
- // Let mw_editPost do all of the heavy lifting.
- return($this->mw_editPost($args));
- }
-
- /**
- * Retrieve page list.
- *
- * @since 2.2.0
- *
- * @param array $args Method parameters.
- * @return unknown
- */
- function wp_getPageList($args) {
- global $wpdb;
-
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
-
- if ( !$user = $this->login($username, $password) )
- return $this->error;
-
- if ( !current_user_can( 'edit_pages' ) )
- return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) );
-
- do_action('xmlrpc_call', 'wp.getPageList');
-
- // Get list of pages ids and titles
- $page_list = $wpdb->get_results("
- SELECT ID page_id,
- post_title page_title,
- post_parent page_parent_id,
- post_date_gmt,
- post_date,
- post_status
- FROM {$wpdb->posts}
- WHERE post_type = 'page'
- ORDER BY ID
- ");
-
- // The date needs to be formated properly.
- $num_pages = count($page_list);
- 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);
-
- $page_list[$i]->dateCreated = new IXR_Date($post_date);
- $page_list[$i]->date_created_gmt = new IXR_Date($post_date_gmt);
-
- // For drafts use the GMT version of the date
- if ( $page_list[$i]->post_status == 'draft' ) {
- $page_list[$i]->date_created_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $page_list[$i]->post_date ), 'Ymd\TH:i:s' );
- $page_list[$i]->date_created_gmt = new IXR_Date( $page_list[$i]->date_created_gmt );
- }
-
- unset($page_list[$i]->post_date_gmt);
- unset($page_list[$i]->post_date);
- unset($page_list[$i]->post_status);
- }
-
- return($page_list);
- }
-
- /**
- * Retrieve authors list.
- *
- * @since 2.2.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_getAuthors($args) {
-
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
-
- 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 site.")));
-
- do_action('xmlrpc_call', 'wp.getAuthors');
-
- $authors = array();
- foreach ( (array) get_users_of_blog() as $row ) {
- $authors[] = array(
- "user_id" => $row->user_id,
- "user_login" => $row->user_login,
- "display_name" => $row->display_name
- );
- }
-
- return($authors);
- }
-
- /**
- * Get list of all tags
- *
- * @since 2.7
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_getTags( $args ) {
- $this->escape( $args );
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
-
- 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 site in order to view tags.' ) );
-
- do_action( 'xmlrpc_call', 'wp.getKeywords' );
-
- $tags = array( );
-
- if ( $all_tags = get_tags() ) {
- foreach( (array) $all_tags as $tag ) {
- $struct['tag_id'] = $tag->term_id;
- $struct['name'] = $tag->name;
- $struct['count'] = $tag->count;
- $struct['slug'] = $tag->slug;
- $struct['html_url'] = esc_html( get_tag_link( $tag->term_id ) );
- $struct['rss_url'] = esc_html( get_tag_feed_link( $tag->term_id ) );
-
- $tags[] = $struct;
- }
- }
-
- return $tags;
- }
-
- /**
- * Create new category.
- *
- * @since 2.2.0
- *
- * @param array $args Method parameters.
- * @return int Category ID.
- */
- function wp_newCategory($args) {
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $category = $args[3];
-
- 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") )
- 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"]) )
- $category["slug"] = "";
-
- // If no parent_id was provided make it empty
- // so that it will be a top level page (no parent).
- if ( !isset($category["parent_id"]) )
- $category["parent_id"] = "";
-
- // If no description was provided make it empty.
- if ( empty($category["description"]) )
- $category["description"] = "";
-
- $new_category = array(
- "cat_name" => $category["name"],
- "category_nicename" => $category["slug"],
- "category_parent" => $category["parent_id"],
- "category_description" => $category["description"]
- );
-
- $cat_id = wp_insert_category($new_category, true);
- if ( is_wp_error( $cat_id ) ) {
- if ( 'term_exists' == $cat_id->get_error_code() )
- return (int) $cat_id->get_error_data();
- else
- return(new IXR_Error(500, __("Sorry, the new category failed.")));
- } elseif ( ! $cat_id ) {
- return(new IXR_Error(500, __("Sorry, the new category failed.")));
- }
-
- return($cat_id);
- }
-
- /**
- * Remove category.
- *
- * @since 2.5.0
- *
- * @param array $args Method parameters.
- * @return mixed See {@link wp_delete_category()} for return info.
- */
- function wp_deleteCategory($args) {
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $category_id = (int) $args[3];
-
- if ( !$user = $this->login($username, $password) )
- return $this->error;
-
- do_action('xmlrpc_call', 'wp.deleteCategory');
-
- 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 );
- }
-
- /**
- * Retrieve category list.
- *
- * @since 2.2.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_suggestCategories($args) {
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $category = $args[3];
- $max_results = (int) $args[4];
-
- 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 site in order to view categories.' ) );
-
- do_action('xmlrpc_call', 'wp.suggestCategories');
-
- $category_suggestions = array();
- $args = array('get' => 'all', 'number' => $max_results, 'name__like' => $category);
- foreach ( (array) get_categories($args) as $cat ) {
- $category_suggestions[] = array(
- "category_id" => $cat->cat_ID,
- "category_name" => $cat->cat_name
- );
- }
-
- return($category_suggestions);
- }
-
- /**
- * Retrieve comment.
- *
- * @since 2.7.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_getComment($args) {
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $comment_id = (int) $args[3];
-
- 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 site.' ) );
-
- do_action('xmlrpc_call', 'wp.getComment');
-
- if ( ! $comment = get_comment($comment_id) )
- return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
-
- // Format page date.
- $comment_date = mysql2date("Ymd\TH:i:s", $comment->comment_date, false);
- $comment_date_gmt = mysql2date("Ymd\TH:i:s", $comment->comment_date_gmt, false);
-
- if ( '0' == $comment->comment_approved )
- $comment_status = 'hold';
- else if ( 'spam' == $comment->comment_approved )
- $comment_status = 'spam';
- else if ( '1' == $comment->comment_approved )
- $comment_status = 'approve';
- else
- $comment_status = $comment->comment_approved;
-
- $link = get_comment_link($comment);
-
- $comment_struct = array(
- "date_created_gmt" => new IXR_Date($comment_date_gmt),
- "user_id" => $comment->user_id,
- "comment_id" => $comment->comment_ID,
- "parent" => $comment->comment_parent,
- "status" => $comment_status,
- "content" => $comment->comment_content,
- "link" => $link,
- "post_id" => $comment->comment_post_ID,
- "post_title" => get_the_title($comment->comment_post_ID),
- "author" => $comment->comment_author,
- "author_url" => $comment->comment_author_url,
- "author_email" => $comment->comment_author_email,
- "author_ip" => $comment->comment_author_IP,
- "type" => $comment->comment_type,
- );
-
- return $comment_struct;
- }
-
- /**
- * Retrieve comments.
- *
- * @since 2.7.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_getComments($args) {
- $raw_args = $args;
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $struct = $args[3];
-
- 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.' ) );
-
- do_action('xmlrpc_call', 'wp.getComments');
-
- if ( isset($struct['status']) )
- $status = $struct['status'];
- else
- $status = '';
-
- $post_id = '';
- if ( isset($struct['post_id']) )
- $post_id = absint($struct['post_id']);
-
- $offset = 0;
- if ( isset($struct['offset']) )
- $offset = absint($struct['offset']);
-
- $number = 10;
- if ( isset($struct['number']) )
- $number = absint($struct['number']);
-
- $comments = get_comments( array('status' => $status, 'post_id' => $post_id, 'offset' => $offset, 'number' => $number ) );
- $num_comments = count($comments);
-
- if ( ! $num_comments )
- return array();
-
- $comments_struct = array();
-
- for ( $i = 0; $i < $num_comments; $i++ ) {
- $comment = wp_xmlrpc_server::wp_getComment(array(
- $raw_args[0], $raw_args[1], $raw_args[2], $comments[$i]->comment_ID,
- ));
- $comments_struct[] = $comment;
- }
-
- return $comments_struct;
- }
-
- /**
- * Remove comment.
- *
- * @since 2.7.0
- *
- * @param array $args Method parameters.
- * @return mixed {@link wp_delete_comment()}
- */
- function wp_deleteComment($args) {
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $comment_ID = (int) $args[3];
-
- 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 site.' ) );
-
- do_action('xmlrpc_call', 'wp.deleteComment');
-
- if ( !$comment = get_comment( $comment_ID ) )
- return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
-
- if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
- return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
-
- return wp_delete_comment($comment_ID);
- }
-
- /**
- * Edit comment.
- *
- * @since 2.7.0
- *
- * @param array $args Method parameters.
- * @return bool True, on success.
- */
- function wp_editComment($args) {
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $comment_ID = (int) $args[3];
- $content_struct = $args[4];
-
- 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 site.' ) );
-
- if ( !$comment = get_comment( $comment_ID ) )
- return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
-
- if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
- return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
-
- do_action('xmlrpc_call', 'wp.editComment');
-
- if ( isset($content_struct['status']) ) {
- $statuses = get_comment_statuses();
- $statuses = array_keys($statuses);
-
- if ( ! in_array($content_struct['status'], $statuses) )
- return new IXR_Error( 401, __( 'Invalid comment status.' ) );
- $comment_approved = $content_struct['status'];
- }
-
- // Do some timestamp voodoo
- if ( !empty( $content_struct['date_created_gmt'] ) ) {
- $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force
- $comment_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
- $comment_date_gmt = iso8601_to_datetime($dateCreated, GMT);
- }
-
- if ( isset($content_struct['content']) )
- $comment_content = $content_struct['content'];
-
- if ( isset($content_struct['author']) )
- $comment_author = $content_struct['author'];
-
- if ( isset($content_struct['author_url']) )
- $comment_author_url = $content_struct['author_url'];
-
- if ( isset($content_struct['author_email']) )
- $comment_author_email = $content_struct['author_email'];
-
- // We've got all the data -- post it:
- $comment = compact('comment_ID', 'comment_content', 'comment_approved', 'comment_date', 'comment_date_gmt', 'comment_author', 'comment_author_email', 'comment_author_url');
-
- $result = wp_update_comment($comment);
- if ( is_wp_error( $result ) )
- return new IXR_Error(500, $result->get_error_message());
-
- if ( !$result )
- return new IXR_Error(500, __('Sorry, the comment could not be edited. Something wrong happened.'));
-
- return true;
- }
-
- /**
- * Create new comment.
- *
- * @since 2.7.0
- *
- * @param array $args Method parameters.
- * @return mixed {@link wp_new_comment()}
- */
- function wp_newComment($args) {
- global $wpdb;
-
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $post = $args[3];
- $content_struct = $args[4];
-
- $allow_anon = apply_filters('xmlrpc_allow_anonymous_comments', false);
-
- $user = $this->login($username, $password);
-
- if ( !$user ) {
- $logged_in = false;
- if ( $allow_anon && get_option('comment_registration') )
- return new IXR_Error( 403, __( 'You must be registered to comment' ) );
- else if ( !$allow_anon )
- return $this->error;
- } else {
- $logged_in = true;
- }
-
- if ( is_numeric($post) )
- $post_id = absint($post);
- else
- $post_id = url_to_postid($post);
-
- if ( ! $post_id )
- return new IXR_Error( 404, __( 'Invalid post ID.' ) );
-
- if ( ! get_post($post_id) )
- return new IXR_Error( 404, __( 'Invalid post ID.' ) );
-
- $comment['comment_post_ID'] = $post_id;
-
- if ( $logged_in ) {
- $comment['comment_author'] = $wpdb->escape( $user->display_name );
- $comment['comment_author_email'] = $wpdb->escape( $user->user_email );
- $comment['comment_author_url'] = $wpdb->escape( $user->user_url );
- $comment['user_ID'] = $user->ID;
- } else {
- $comment['comment_author'] = '';
- if ( isset($content_struct['author']) )
- $comment['comment_author'] = $content_struct['author'];
-
- $comment['comment_author_email'] = '';
- if ( isset($content_struct['author_email']) )
- $comment['comment_author_email'] = $content_struct['author_email'];
-
- $comment['comment_author_url'] = '';
- if ( isset($content_struct['author_url']) )
- $comment['comment_author_url'] = $content_struct['author_url'];
-
- $comment['user_ID'] = 0;
-
- if ( get_option('require_name_email') ) {
- if ( 6 > strlen($comment['comment_author_email']) || '' == $comment['comment_author'] )
- return new IXR_Error( 403, __( 'Comment author name and email are required' ) );
- elseif ( !is_email($comment['comment_author_email']) )
- return new IXR_Error( 403, __( 'A valid email address is required' ) );
- }
- }
-
- $comment['comment_parent'] = isset($content_struct['comment_parent']) ? absint($content_struct['comment_parent']) : 0;
-
- $comment['comment_content'] = $content_struct['content'];
-
- do_action('xmlrpc_call', 'wp.newComment');
-
- return wp_new_comment($comment);
- }
-
- /**
- * Retrieve all of the comment status.
- *
- * @since 2.7.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_getCommentStatusList($args) {
- $this->escape( $args );
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
-
- 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 site.' ) );
-
- do_action('xmlrpc_call', 'wp.getCommentStatusList');
-
- return get_comment_statuses( );
- }
-
- /**
- * Retrieve comment count.
- *
- * @since 2.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_getCommentCount( $args ) {
- $this->escape($args);
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $post_id = (int) $args[3];
-
- 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 comments.' ) );
-
- do_action('xmlrpc_call', 'wp.getCommentCount');
-
- $count = wp_count_comments( $post_id );
- return array(
- "approved" => $count->approved,
- "awaiting_moderation" => $count->moderated,
- "spam" => $count->spam,
- "total_comments" => $count->total_comments
- );
- }
-
- /**
- * Retrieve post statuses.
- *
- * @since 2.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_getPostStatusList( $args ) {
- $this->escape( $args );
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
-
- 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 site.' ) );
-
- do_action('xmlrpc_call', 'wp.getPostStatusList');
-
- return get_post_statuses( );
- }
-
- /**
- * Retrieve page statuses.
- *
- * @since 2.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_getPageStatusList( $args ) {
- $this->escape( $args );
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
-
- 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 site.' ) );
-
- do_action('xmlrpc_call', 'wp.getPageStatusList');
-
- return get_page_statuses( );
- }
-
- /**
- * Retrieve page templates.
- *
- * @since 2.6.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_getPageTemplates( $args ) {
- $this->escape( $args );
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
-
- 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 site.' ) );
-
- $templates = get_page_templates( );
- $templates['Default'] = 'default';
-
- return $templates;
- }
-
- /**
- * Retrieve blog options.
- *
- * @since 2.6.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function wp_getOptions( $args ) {
- $this->escape( $args );
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $options = (array) $args[3];
-
- if ( !$user = $this->login($username, $password) )
- return $this->error;
-
- // If no specific options where asked for, return all of them
- if ( count( $options ) == 0 )
- $options = array_keys($this->blog_options);
-
- return $this->_getOptions($options);
- }
-
- /**
- * Retrieve blog options value from list.
- *
- * @since 2.6.0
- *
- * @param array $options Options to retrieve.
- * @return array
- */
- function _getOptions($options) {
- $data = array( );
- 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'] ) ) {
- $data[$option]['value'] = get_option( $data[$option]['option'] );
- unset($data[$option]['option']);
- }
- }
- }
-
- return $data;
- }
-
- /**
- * Update blog options.
- *
- * @since 2.6.0
- *
- * @param array $args Method parameters.
- * @return unknown
- */
- function wp_setOptions( $args ) {
- $this->escape( $args );
-
- $blog_id = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $options = (array) $args[3];
-
- if ( !$user = $this->login($username, $password) )
- return $this->error;
-
- 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 ) {
- $option_names[] = $o_name;
- if ( !array_key_exists( $o_name, $this->blog_options ) )
- continue;
-
- if ( $this->blog_options[$o_name]['readonly'] == true )
- continue;
-
- update_option( $this->blog_options[$o_name]['option'], $o_value );
- }
-
- //Now return the updated values
- return $this->_getOptions($option_names);
- }
-
- /* Blogger API functions.
- * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/
- */
-
- /**
- * Retrieve blogs that user owns.
- *
- * Will make more sense once we support multiple blogs.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @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) )
- return $this->error;
-
- do_action('xmlrpc_call', 'blogger.getUsersBlogs');
-
- $is_admin = current_user_can('manage_options');
-
- $struct = array(
- 'isAdmin' => $is_admin,
- 'url' => get_option('home') . '/',
- 'blogid' => '1',
- 'blogName' => get_option('blogname'),
- 'xmlrpc' => site_url( 'xmlrpc.php' )
- );
-
- 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.
- *
- * Gives your client some info about you, so you don't have to.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function blogger_getUserInfo($args) {
-
- $this->escape($args);
-
- $username = $args[1];
- $password = $args[2];
-
- 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 site.' ) );
-
- do_action('xmlrpc_call', 'blogger.getUserInfo');
-
- $struct = array(
- 'nickname' => $user->nickname,
- 'userid' => $user->ID,
- 'url' => $user->user_url,
- 'lastname' => $user->last_name,
- 'firstname' => $user->first_name
- );
-
- return $struct;
- }
-
- /**
- * Retrieve post.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function blogger_getPost($args) {
-
- $this->escape($args);
-
- $post_ID = (int) $args[1];
- $username = $args[2];
- $password = $args[3];
-
- if ( !$user = $this->login($username, $password) )
- return $this->error;
-
- 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');
-
- $post_data = wp_get_single_post($post_ID, ARRAY_A);
-
- $categories = implode(',', wp_get_post_categories($post_ID));
-
- $content = '<title>'.stripslashes($post_data['post_title']).'</title>';
- $content .= '<category>'.$categories.'</category>';
- $content .= stripslashes($post_data['post_content']);
-
- $struct = array(
- 'userid' => $post_data['post_author'],
- 'dateCreated' => new IXR_Date(mysql2date('Ymd\TH:i:s', $post_data['post_date'], false)),
- 'content' => $content,
- 'postid' => $post_data['ID']
- );
-
- return $struct;
- }
-
- /**
- * Retrieve list of recent posts.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function blogger_getRecentPosts($args) {
-
- $this->escape($args);
-
- $blog_ID = (int) $args[1]; /* though we don't use it yet */
- $username = $args[2];
- $password = $args[3];
- $num_posts = $args[4];
-
- 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 ) {
- $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'] ) )
- continue;
-
- $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date'], false);
- $categories = implode(',', wp_get_post_categories($entry['ID']));
-
- $content = '<title>'.stripslashes($entry['post_title']).'</title>';
- $content .= '<category>'.$categories.'</category>';
- $content .= stripslashes($entry['post_content']);
-
- $struct[] = array(
- 'userid' => $entry['post_author'],
- 'dateCreated' => new IXR_Date($post_date),
- 'content' => $content,
- 'postid' => $entry['ID'],
- );
-
- }
-
- $recent_posts = array();
- for ( $j=0; $j<count($struct); $j++ ) {
- array_push($recent_posts, $struct[$j]);
- }
-
- return $recent_posts;
- }
-
- /**
- * Retrieve blog_filename content.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return string
- */
- function blogger_getTemplate($args) {
-
- $this->escape($args);
-
- $blog_ID = (int) $args[1];
- $username = $args[2];
- $password = $args[3];
- $template = $args[4]; /* could be 'main' or 'archiveIndex', but we don't use it */
-
- if ( !$user = $this->login($username, $password) )
- return $this->error;
-
- do_action('xmlrpc_call', 'blogger.getTemplate');
-
- 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') . '/';
- $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename);
-
- $f = fopen($filename, 'r');
- $content = fread($f, filesize($filename));
- fclose($f);
-
- /* so it is actually editable with a windows/mac client */
- // FIXME: (or delete me) do we really want to cater to bad clients at the expense of good ones by BEEPing up their line breaks? commented. $content = str_replace("\n", "\r\n", $content);
-
- return $content;
- }
-
- /**
- * Updates the content of blog_filename.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return bool True when done.
- */
- function blogger_setTemplate($args) {
-
- $this->escape($args);
-
- $blog_ID = (int) $args[1];
- $username = $args[2];
- $password = $args[3];
- $content = $args[4];
- $template = $args[5]; /* could be 'main' or 'archiveIndex', but we don't use it */
-
- if ( !$user = $this->login($username, $password) )
- return $this->error;
-
- do_action('xmlrpc_call', 'blogger.setTemplate');
-
- 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') . '/';
- $filename = preg_replace('#https?://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename);
-
- if ($f = fopen($filename, 'w+')) {
- fwrite($f, $content);
- fclose($f);
- } else {
- return new IXR_Error(500, __('Either the file is not writable, or something wrong happened. The file has not been updated.'));
- }
-
- return true;
- }
-
- /**
- * Create new post.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return int
- */
- function blogger_newPost($args) {
-
- $this->escape($args);
-
- $blog_ID = (int) $args[1]; /* though we don't use it yet */
- $username = $args[2];
- $password = $args[3];
- $content = $args[4];
- $publish = $args[5];
-
- 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 site.'));
-
- $post_status = ($publish) ? 'publish' : 'draft';
-
- $post_author = $user->ID;
-
- $post_title = xmlrpc_getposttitle($content);
- $post_category = xmlrpc_getpostcategory($content);
- $post_content = xmlrpc_removepostdata($content);
-
- $post_date = current_time('mysql');
- $post_date_gmt = current_time('mysql', 1);
-
- $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status');
-
- $post_ID = wp_insert_post($post_data);
- if ( is_wp_error( $post_ID ) )
- return new IXR_Error(500, $post_ID->get_error_message());
-
- 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 );
-
- logIO('O', "Posted ! ID: $post_ID");
-
- return $post_ID;
- }
-
- /**
- * Edit a post.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return bool true when done.
- */
- function blogger_editPost($args) {
-
- $this->escape($args);
-
- $post_ID = (int) $args[1];
- $username = $args[2];
- $password = $args[3];
- $content = $args[4];
- $publish = $args[5];
-
- 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' )
- return new IXR_Error(404, __('Sorry, no such post.'));
-
- $this->escape($actual_post);
-
- if ( !current_user_can('edit_post', $post_ID) )
- return new IXR_Error(401, __('Sorry, you do not have the right to edit this post.'));
-
- extract($actual_post, EXTR_SKIP);
-
- if ( ('publish' == $post_status) && !current_user_can('publish_posts') )
- return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.'));
-
- $post_title = xmlrpc_getposttitle($content);
- $post_category = xmlrpc_getpostcategory($content);
- $post_content = xmlrpc_removepostdata($content);
-
- $postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt');
-
- $result = wp_update_post($postdata);
-
- 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;
- }
-
- /**
- * Remove a post.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return bool True when post is deleted.
- */
- function blogger_deletePost($args) {
- $this->escape($args);
-
- $post_ID = (int) $args[1];
- $username = $args[2];
- $password = $args[3];
- $publish = $args[4];
-
- 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' )
- return new IXR_Error(404, __('Sorry, no such post.'));
-
- if ( !current_user_can('delete_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 )
- return new IXR_Error(500, __('For some strange yet very annoying reason, this post could not be deleted.'));
-
- return true;
- }
-
- /* MetaWeblog API functions
- * specs on wherever Dave Winer wants them to be
- */
-
- /**
- * Create a new post.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return int
- */
- function mw_newPost($args) {
- $this->escape($args);
-
- $blog_ID = (int) $args[0]; // we will support this in the near future
- $username = $args[1];
- $password = $args[2];
- $content_struct = $args[3];
- $publish = isset( $args[4] ) ? $args[4] : 0;
-
- if ( !$user = $this->login($username, $password) )
- return $this->error;
-
- do_action('xmlrpc_call', 'metaWeblog.newPost');
-
- $page_template = '';
- if ( !empty( $content_struct['post_type'] ) ) {
- if ( $content_struct['post_type'] == 'page' ) {
- if ( $publish || 'publish' == $content_struct['page_status'])
- $cap = 'publish_pages';
- else
- $cap = 'edit_pages';
- $error_message = __( 'Sorry, you are not allowed to publish pages on this site.' );
- $post_type = 'page';
- if ( !empty( $content_struct['wp_page_template'] ) )
- $page_template = $content_struct['wp_page_template'];
- } elseif ( $content_struct['post_type'] == 'post' ) {
- if ( $publish || 'publish' == $content_struct['post_status'])
- $cap = 'publish_posts';
- else
- $cap = 'edit_posts';
- $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
- $post_type = 'post';
- } else {
- // No other post_type values are allowed here
- return new IXR_Error( 401, __( 'Invalid post type.' ) );
- }
- } else {
- if ( $publish || 'publish' == $content_struct['post_status'])
- $cap = 'publish_posts';
- else
- $cap = 'edit_posts';
- $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
- $post_type = 'post';
- }
-
- 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"]) )
- $post_name = $content_struct["wp_slug"];
-
- // Only use a password if one was given.
- 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"]) )
- $post_parent = $content_struct["wp_page_parent_id"];
-
- // Only set the menu_order if it was provided.
- 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 ) {
- case "post":
- 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") )
- 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.")));
- break;
- }
- $post_author = $content_struct["wp_author_id"];
- }
-
- $post_title = $content_struct['title'];
- $post_content = $content_struct['description'];
-
- $post_status = $publish ? 'publish' : 'draft';
-
- if ( isset( $content_struct["{$post_type}_status"] ) ) {
- switch ( $content_struct["{$post_type}_status"] ) {
- case 'draft':
- case 'private':
- case 'publish':
- $post_status = $content_struct["{$post_type}_status"];
- break;
- case 'pending':
- // Pending is only valid for posts, not pages.
- if ( $post_type === 'post' )
- $post_status = $content_struct["{$post_type}_status"];
- break;
- default:
- $post_status = $publish ? 'publish' : 'draft';
- break;
- }
- }
-
- $post_excerpt = $content_struct['mt_excerpt'];
- $post_more = $content_struct['mt_text_more'];
-
- $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"] ) {
- case "closed":
- $comment_status = "closed";
- break;
- case "open":
- $comment_status = "open";
- break;
- default:
- $comment_status = get_option("default_comment_status");
- break;
- }
- } else {
- switch ( (int) $content_struct["mt_allow_comments"] ) {
- case 0:
- case 2:
- $comment_status = "closed";
- break;
- case 1:
- $comment_status = "open";
- break;
- default:
- $comment_status = get_option("default_comment_status");
- break;
- }
- }
- } 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'] ) {
- case "closed":
- $ping_status = "closed";
- break;
- case "open":
- $ping_status = "open";
- break;
- default:
- $ping_status = get_option("default_ping_status");
- break;
- }
- } else {
- switch ( (int) $content_struct["mt_allow_pings"] ) {
- case 0:
- $ping_status = "closed";
- break;
- case 1:
- $ping_status = "open";
- break;
- default:
- $ping_status = get_option("default_ping_status");
- break;
- }
- }
- } else {
- $ping_status = get_option("default_ping_status");
- }
-
- if ( $post_more )
- $post_content = $post_content . "<!--more-->" . $post_more;
-
- $to_ping = $content_struct['mt_tb_ping_urls'];
- if ( is_array($to_ping) )
- $to_ping = implode(' ', $to_ping);
-
- // Do some timestamp voodoo
- if ( !empty( $content_struct['date_created_gmt'] ) )
- $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force
- elseif ( !empty( $content_struct['dateCreated']) )
- $dateCreated = $content_struct['dateCreated']->getIso();
-
- if ( !empty( $dateCreated ) ) {
- $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
- $post_date_gmt = iso8601_to_datetime($dateCreated, GMT);
- } else {
- $post_date = current_time('mysql');
- $post_date_gmt = current_time('mysql', 1);
- }
-
- $catnames = $content_struct['categories'];
- logIO('O', 'Post cats: ' . var_export($catnames,true));
- $post_category = array();
-
- if ( is_array($catnames) ) {
- foreach ($catnames as $cat) {
- $post_category[] = get_cat_ID($cat);
- }
- }
-
- // We've got all the data -- post it:
- $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order', 'tags_input', 'page_template');
-
- $post_ID = wp_insert_post($postdata, true);
- if ( is_wp_error( $post_ID ) )
- return new IXR_Error(500, $post_ID->get_error_message());
-
- 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 ( $content_struct['sticky'] == true )
- stick_post( $post_ID );
- elseif ( $content_struct['sticky'] == false )
- unstick_post( $post_ID );
- }
-
- 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']);
-
- $this->attach_uploads( $post_ID, $post_content );
-
- logIO('O', "Posted ! ID: $post_ID");
-
- return strval($post_ID);
- }
-
- function add_enclosure_if_new($post_ID, $enclosure) {
- if ( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) {
-
- $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'];
- $found = false;
- foreach ( (array) get_post_custom($post_ID) as $key => $val) {
- if ($key == 'enclosure') {
- foreach ( (array) $val as $enc ) {
- if ($enc == $encstring) {
- $found = true;
- break 2;
- }
- }
- }
- }
- if (!$found)
- add_post_meta( $post_ID, 'enclosure', $encstring );
- }
- }
-
- /**
- * Attach upload to a post.
- *
- * @since 2.1.0
- *
- * @param int $post_ID Post ID.
- * @param string $post_content Post Content for attachment.
- */
- function attach_uploads( $post_ID, $post_content ) {
- global $wpdb;
-
- // 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 )
- $wpdb->update($wpdb->posts, array('post_parent' => $post_ID), array('ID' => $file->ID) );
- }
- }
- }
-
- /**
- * Edit a post.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return bool True on success.
- */
- function mw_editPost($args) {
-
- $this->escape($args);
-
- $post_ID = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $content_struct = $args[3];
- $publish = $args[4];
-
- 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 site.' );
- $post_type = 'post';
- $page_template = '';
- if ( !empty( $content_struct['post_type'] ) ) {
- if ( $content_struct['post_type'] == 'page' ) {
- if ( $publish || 'publish' == $content_struct['page_status'] )
- $cap = 'publish_pages';
- else
- $cap = 'edit_pages';
- $error_message = __( 'Sorry, you are not allowed to publish pages on this site.' );
- $post_type = 'page';
- if ( !empty( $content_struct['wp_page_template'] ) )
- $page_template = $content_struct['wp_page_template'];
- } elseif ( $content_struct['post_type'] == 'post' ) {
- if ( $publish || 'publish' == $content_struct['post_status'] )
- $cap = 'publish_posts';
- else
- $cap = 'edit_posts';
- $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
- $post_type = 'post';
- } else {
- // No other post_type values are allowed here
- return new IXR_Error( 401, __( 'Invalid post type.' ) );
- }
- } else {
- if ( $publish || 'publish' == $content_struct['post_status'] )
- $cap = 'publish_posts';
- else
- $cap = 'edit_posts';
- $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
- $post_type = 'post';
- }
-
- 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"]) )
- 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"]) )
- $post_name = $content_struct["wp_slug"];
-
- // Only use a password if one was given.
- 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"]) )
- $post_parent = $content_struct["wp_page_parent_id"];
-
- // Only set the menu_order if it was given.
- 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 ) {
- case "post":
- 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") )
- 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.")));
- break;
- }
- $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"] ) {
- case "closed":
- $comment_status = "closed";
- break;
- case "open":
- $comment_status = "open";
- break;
- default:
- $comment_status = get_option("default_comment_status");
- break;
- }
- } else {
- switch ( (int) $content_struct["mt_allow_comments"] ) {
- case 0:
- case 2:
- $comment_status = "closed";
- break;
- case 1:
- $comment_status = "open";
- break;
- default:
- $comment_status = get_option("default_comment_status");
- break;
- }
- }
- }
-
- 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;
- case "open":
- $ping_status = "open";
- break;
- default:
- $ping_status = get_option("default_ping_status");
- break;
- }
- } else {
- switch ( (int) $content_struct["mt_allow_pings"] ) {
- case 0:
- $ping_status = "closed";
- break;
- case 1:
- $ping_status = "open";
- break;
- default:
- $ping_status = get_option("default_ping_status");
- break;
- }
- }
- }
-
- $post_title = $content_struct['title'];
- $post_content = $content_struct['description'];
- $catnames = $content_struct['categories'];
-
- $post_category = array();
-
- if ( is_array($catnames) ) {
- foreach ($catnames as $cat) {
- $post_category[] = get_cat_ID($cat);
- }
- }
-
- $post_excerpt = $content_struct['mt_excerpt'];
- $post_more = $content_struct['mt_text_more'];
-
- $post_status = $publish ? 'publish' : 'draft';
- if ( isset( $content_struct["{$post_type}_status"] ) ) {
- switch( $content_struct["{$post_type}_status"] ) {
- case 'draft':
- case 'private':
- case 'publish':
- $post_status = $content_struct["{$post_type}_status"];
- break;
- case 'pending':
- // Pending is only valid for posts, not pages.
- if ( $post_type === 'post' )
- $post_status = $content_struct["{$post_type}_status"];
- break;
- default:
- $post_status = $publish ? 'publish' : 'draft';
- break;
- }
- }
-
- $tags_input = $content_struct['mt_keywords'];
-
- if ( ('publish' == $post_status) ) {
- if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') )
- return new IXR_Error(401, __('Sorry, you do not have the right to publish this page.'));
- else if ( !current_user_can('publish_posts') )
- return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.'));
- }
-
- if ( $post_more )
- $post_content = $post_content . "<!--more-->" . $post_more;
-
- $to_ping = $content_struct['mt_tb_ping_urls'];
- if ( is_array($to_ping) )
- $to_ping = implode(' ', $to_ping);
-
- // Do some timestamp voodoo
- if ( !empty( $content_struct['date_created_gmt'] ) )
- $dateCreated = str_replace( 'Z', '', $content_struct['date_created_gmt']->getIso() ) . 'Z'; // We know this is supposed to be GMT, so we're going to slap that Z on there by force
- elseif ( !empty( $content_struct['dateCreated']) )
- $dateCreated = $content_struct['dateCreated']->getIso();
-
- if ( !empty( $dateCreated ) ) {
- $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated));
- $post_date_gmt = iso8601_to_datetime($dateCreated, GMT);
- } else {
- $post_date = $postdata['post_date'];
- $post_date_gmt = $postdata['post_date_gmt'];
- }
-
- // We've got all the data -- post it:
- $newpost = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'post_date', 'post_date_gmt', 'to_ping', 'post_name', 'post_password', 'post_parent', 'menu_order', 'post_author', 'tags_input', 'page_template');
-
- $result = wp_update_post($newpost, true);
- if ( is_wp_error( $result ) )
- return new IXR_Error(500, $result->get_error_message());
-
- 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 ( $content_struct['sticky'] == true )
- stick_post( $post_ID );
- elseif ( $content_struct['sticky'] == false )
- unstick_post( $post_ID );
- }
-
- 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']);
-
- $this->attach_uploads( $ID, $post_content );
-
- logIO('O',"(MW) Edited ! ID: $post_ID");
-
- return true;
- }
-
- /**
- * Retrieve post.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function mw_getPost($args) {
-
- $this->escape($args);
-
- $post_ID = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
-
- if ( !$user = $this->login($username, $password) )
- return $this->error;
-
- 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');
-
- $postdata = wp_get_single_post($post_ID, ARRAY_A);
-
- if ($postdata['post_date'] != '') {
- $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date'], false);
- $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' )
- $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);
- foreach($catids as $catid)
- $categories[] = get_cat_name($catid);
-
- $tagnames = array();
- $tags = wp_get_post_tags( $post_ID );
- if ( !empty( $tags ) ) {
- foreach ( $tags as $tag )
- $tagnames[] = $tag->name;
- $tagnames = implode( ', ', $tagnames );
- } else {
- $tagnames = '';
- }
-
- $post = get_extended($postdata['post_content']);
- $link = post_permalink($postdata['ID']);
-
- // Get the author info.
- $author = get_userdata($postdata['post_author']);
-
- $allow_comments = ('open' == $postdata['comment_status']) ? 1 : 0;
- $allow_pings = ('open' == $postdata['ping_status']) ? 1 : 0;
-
- // Consider future posts as published
- if ( $postdata['post_status'] === 'future' )
- $postdata['post_status'] = 'publish';
-
- $sticky = false;
- if ( is_sticky( $post_ID ) )
- $sticky = true;
-
- $enclosure = array();
- foreach ( (array) get_post_custom($post_ID) as $key => $val) {
- if ($key == 'enclosure') {
- foreach ( (array) $val as $enc ) {
- $encdata = split("\n", $enc);
- $enclosure['url'] = trim(htmlspecialchars($encdata[0]));
- $enclosure['length'] = (int) trim($encdata[1]);
- $enclosure['type'] = trim($encdata[2]);
- break 2;
- }
- }
- }
-
- $resp = array(
- 'dateCreated' => new IXR_Date($post_date),
- 'userid' => $postdata['post_author'],
- 'postid' => $postdata['ID'],
- 'description' => $post['main'],
- 'title' => $postdata['post_title'],
- 'link' => $link,
- 'permaLink' => $link,
- // commented out because no other tool seems to use this
- // 'content' => $entry['post_content'],
- 'categories' => $categories,
- 'mt_excerpt' => $postdata['post_excerpt'],
- 'mt_text_more' => $post['extended'],
- 'mt_allow_comments' => $allow_comments,
- 'mt_allow_pings' => $allow_pings,
- 'mt_keywords' => $tagnames,
- 'wp_slug' => $postdata['post_name'],
- 'wp_password' => $postdata['post_password'],
- 'wp_author_id' => $author->ID,
- 'wp_author_display_name' => $author->display_name,
- 'date_created_gmt' => new IXR_Date($post_date_gmt),
- 'post_status' => $postdata['post_status'],
- 'custom_fields' => $this->get_custom_fields($post_ID),
- 'sticky' => $sticky
- );
-
- if ( !empty($enclosure) ) $resp['enclosure'] = $enclosure;
-
- return $resp;
- } else {
- return new IXR_Error(404, __('Sorry, no such post.'));
- }
- }
-
- /**
- * Retrieve list of recent posts.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function mw_getRecentPosts($args) {
-
- $this->escape($args);
-
- $blog_ID = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $num_posts = (int) $args[3];
-
- 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 )
- return array( );
-
- foreach ($posts_list as $entry) {
- 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' )
- $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 )
- $categories[] = get_cat_name($catid);
-
- $tagnames = array();
- $tags = wp_get_post_tags( $entry['ID'] );
- if ( !empty( $tags ) ) {
- foreach ( $tags as $tag ) {
- $tagnames[] = $tag->name;
- }
- $tagnames = implode( ', ', $tagnames );
- } else {
- $tagnames = '';
- }
-
- $post = get_extended($entry['post_content']);
- $link = post_permalink($entry['ID']);
-
- // Get the post author info.
- $author = get_userdata($entry['post_author']);
-
- $allow_comments = ('open' == $entry['comment_status']) ? 1 : 0;
- $allow_pings = ('open' == $entry['ping_status']) ? 1 : 0;
-
- // Consider future posts as published
- if ( $entry['post_status'] === 'future' )
- $entry['post_status'] = 'publish';
-
- $struct[] = array(
- 'dateCreated' => new IXR_Date($post_date),
- 'userid' => $entry['post_author'],
- 'postid' => $entry['ID'],
- 'description' => $post['main'],
- 'title' => $entry['post_title'],
- 'link' => $link,
- 'permaLink' => $link,
- // commented out because no other tool seems to use this
- // 'content' => $entry['post_content'],
- 'categories' => $categories,
- 'mt_excerpt' => $entry['post_excerpt'],
- 'mt_text_more' => $post['extended'],
- 'mt_allow_comments' => $allow_comments,
- 'mt_allow_pings' => $allow_pings,
- 'mt_keywords' => $tagnames,
- 'wp_slug' => $entry['post_name'],
- 'wp_password' => $entry['post_password'],
- 'wp_author_id' => $author->ID,
- 'wp_author_display_name' => $author->display_name,
- 'date_created_gmt' => new IXR_Date($post_date_gmt),
- 'post_status' => $entry['post_status'],
- 'custom_fields' => $this->get_custom_fields($entry['ID'])
- );
-
- }
-
- $recent_posts = array();
- for ( $j=0; $j<count($struct); $j++ ) {
- array_push($recent_posts, $struct[$j]);
- }
-
- return $recent_posts;
- }
-
- /**
- * Retrieve the list of categories on a given blog.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function mw_getCategories($args) {
-
- $this->escape($args);
-
- $blog_ID = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
-
- 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 site in order to view categories.' ) );
-
- do_action('xmlrpc_call', 'metaWeblog.getCategories');
-
- $categories_struct = array();
-
- if ( $cats = get_categories(array('get' => 'all')) ) {
- foreach ( $cats as $cat ) {
- $struct['categoryId'] = $cat->term_id;
- $struct['parentId'] = $cat->parent;
- $struct['description'] = $cat->name;
- $struct['categoryDescription'] = $cat->description;
- $struct['categoryName'] = $cat->name;
- $struct['htmlUrl'] = esc_html(get_category_link($cat->term_id));
- $struct['rssUrl'] = esc_html(get_category_feed_link($cat->term_id, 'rss2'));
-
- $categories_struct[] = $struct;
- }
- }
-
- return $categories_struct;
- }
-
- /**
- * Uploads a file, following your settings.
- *
- * Adapted from a patch by Johann Richard.
- *
- * @link http://mycvs.org/archives/2004/06/30/file-upload-to-wordpress-in-ecto/
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function mw_newMediaObject($args) {
- global $wpdb;
-
- $blog_ID = (int) $args[0];
- $username = $wpdb->escape($args[1]);
- $password = $wpdb->escape($args[2]);
- $data = $args[3];
-
- $name = sanitize_file_name( $data['name'] );
- $type = $data['type'];
- $bits = $data['bits'];
-
- logIO('O', '(MW) Received '.strlen($bits).' bytes');
-
- if ( !$user = $this->login($username, $password) )
- return $this->error;
-
- do_action('xmlrpc_call', 'metaWeblog.newMediaObject');
-
- if ( !current_user_can('upload_files') ) {
- logIO('O', '(MW) User does not have upload_files capability');
- $this->error = new IXR_Error(401, __('You are not allowed to upload files to this site.'));
- return $this->error;
- }
-
- if ( $upload_err = apply_filters( "pre_upload_error", false ) )
- return new IXR_Error(500, $upload_err);
-
- if ( !empty($data["overwrite"]) && ($data["overwrite"] == true) ) {
- // Get postmeta info on the object.
- $old_file = $wpdb->get_row("
- SELECT ID
- FROM {$wpdb->posts}
- WHERE post_title = '{$name}'
- AND post_type = 'attachment'
- ");
-
- // Delete previous file.
- wp_delete_attachment($old_file->ID);
-
- // Make sure the new name is different by pre-pending the
- // previous post id.
- $filename = preg_replace("/^wpid\d+-/", "", $name);
- $name = "wpid{$old_file->ID}-{$filename}";
- }
-
- $upload = wp_upload_bits($name, $type, $bits);
- if ( ! empty($upload['error']) ) {
- $errorString = sprintf(__('Could not write file %1$s (%2$s)'), $name, $upload['error']);
- logIO('O', '(MW) ' . $errorString);
- return new IXR_Error(500, $errorString);
- }
- // Construct the attachment array
- // attach to post_id 0
- $post_id = 0;
- $attachment = array(
- 'post_title' => $name,
- 'post_content' => '',
- 'post_type' => 'attachment',
- 'post_parent' => $post_id,
- 'post_mime_type' => $type,
- 'guid' => $upload[ 'url' ]
- );
-
- // Save the data
- $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 ), 'upload' );
- }
-
- /* MovableType API functions
- * specs on http://www.movabletype.org/docs/mtmanual_programmatic.html
- */
-
- /**
- * Retrieve the post titles of recent posts.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function mt_getRecentPostTitles($args) {
-
- $this->escape($args);
-
- $blog_ID = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $num_posts = (int) $args[3];
-
- 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 ) {
- $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'] ) )
- 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' )
- $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),
- 'userid' => $entry['post_author'],
- 'postid' => $entry['ID'],
- 'title' => $entry['post_title'],
- 'date_created_gmt' => new IXR_Date($post_date_gmt)
- );
-
- }
-
- $recent_posts = array();
- for ( $j=0; $j<count($struct); $j++ ) {
- array_push($recent_posts, $struct[$j]);
- }
-
- return $recent_posts;
- }
-
- /**
- * Retrieve list of all categories on blog.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function mt_getCategoryList($args) {
-
- $this->escape($args);
-
- $blog_ID = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
-
- 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 site in order to view categories.' ) );
-
- do_action('xmlrpc_call', 'mt.getCategoryList');
-
- $categories_struct = array();
-
- if ( $cats = get_categories(array('hide_empty' => 0, 'hierarchical' => 0)) ) {
- foreach ( $cats as $cat ) {
- $struct['categoryId'] = $cat->term_id;
- $struct['categoryName'] = $cat->name;
-
- $categories_struct[] = $struct;
- }
- }
-
- return $categories_struct;
- }
-
- /**
- * Retrieve post categories.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function mt_getPostCategories($args) {
-
- $this->escape($args);
-
- $post_ID = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
-
- if ( !$user = $this->login($username, $password) )
- return $this->error;
-
- 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');
-
- $categories = array();
- $catids = wp_get_post_categories(intval($post_ID));
- // first listed category will be the primary category
- $isPrimary = true;
- foreach ( $catids as $catid ) {
- $categories[] = array(
- 'categoryName' => get_cat_name($catid),
- 'categoryId' => (string) $catid,
- 'isPrimary' => $isPrimary
- );
- $isPrimary = false;
- }
-
- return $categories;
- }
-
- /**
- * Sets categories for a post.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return bool True on success.
- */
- function mt_setPostCategories($args) {
-
- $this->escape($args);
-
- $post_ID = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
- $categories = $args[3];
-
- 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 ) {
- $catids[] = $cat['categoryId'];
- }
-
- wp_set_post_categories($post_ID, $catids);
-
- return true;
- }
-
- /**
- * Retrieve an array of methods supported by this server.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function mt_supportedMethods($args) {
-
- do_action('xmlrpc_call', 'mt.supportedMethods');
-
- $supported_methods = array();
- foreach ( $this->methods as $key => $value ) {
- $supported_methods[] = $key;
- }
-
- return $supported_methods;
- }
-
- /**
- * Retrieve an empty array because we don't support per-post text filters.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- */
- function mt_supportedTextFilters($args) {
- do_action('xmlrpc_call', 'mt.supportedTextFilters');
- return apply_filters('xmlrpc_text_filters', array());
- }
-
- /**
- * Retrieve trackbacks sent to a given post.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return mixed
- */
- function mt_getTrackbackPings($args) {
-
- global $wpdb;
-
- $post_ID = intval($args);
-
- do_action('xmlrpc_call', 'mt.getTrackbackPings');
-
- $actual_post = wp_get_single_post($post_ID, ARRAY_A);
-
- 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 )
- return array();
-
- $trackback_pings = array();
- foreach ( $comments as $comment ) {
- if ( 'trackback' == $comment->comment_type ) {
- $content = $comment->comment_content;
- $title = substr($content, 8, (strpos($content, '</strong>') - 8));
- $trackback_pings[] = array(
- 'pingTitle' => $title,
- 'pingURL' => $comment->comment_author_url,
- 'pingIP' => $comment->comment_author_IP
- );
- }
- }
-
- return $trackback_pings;
- }
-
- /**
- * Sets a post's publish status to 'publish'.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return int
- */
- function mt_publishPost($args) {
-
- $this->escape($args);
-
- $post_ID = (int) $args[0];
- $username = $args[1];
- $password = $args[2];
-
- if ( !$user = $this->login($username, $password) )
- return $this->error;
-
- do_action('xmlrpc_call', 'mt.publishPost');
-
- if ( !current_user_can('publish_posts') || !current_user_can('edit_post', $post_ID) )
- return new IXR_Error(401, __('Sorry, you cannot edit this post.'));
-
- $postdata = wp_get_single_post($post_ID,ARRAY_A);
-
- $postdata['post_status'] = 'publish';
-
- // retain old cats
- $cats = wp_get_post_categories($post_ID);
- $postdata['post_category'] = $cats;
- $this->escape($postdata);
-
- $result = wp_update_post($postdata);
-
- return $result;
- }
-
- /* PingBack functions
- * specs on www.hixie.ch/specs/pingback/pingback
- */
-
- /**
- * Retrieves a pingback and registers it.
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function pingback_ping($args) {
- global $wpdb;
-
- do_action('xmlrpc_call', 'pingback.ping');
-
- $this->escape($args);
-
- $pagelinkedfrom = $args[0];
- $pagelinkedto = $args[1];
-
- $title = '';
-
- $pagelinkedfrom = str_replace('&', '&', $pagelinkedfrom);
- $pagelinkedto = str_replace('&', '&', $pagelinkedto);
- $pagelinkedto = str_replace('&', '&', $pagelinkedto);
-
- // 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 )
- 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) ) {
- $way = 'url_to_postid()';
- } 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) ) {
- // 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']) ) {
- // an #anchor is there, it's either...
- 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']) ) {
- // ...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']) ) {
- // ...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);
- if (! ($post_ID = $wpdb->get_var($sql)) ) {
- // returning unknown error '0' is better than die()ing
- return new IXR_Error(0, '');
- }
- $way = 'from the fragment (title)';
- }
- } else {
- // TODO: Attempt to extract a post ID from the given URL
- 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.'));
- }
- $post_ID = (int) $post_ID;
-
-
- logIO("O","(PB) URL='$pagelinkedto' ID='$post_ID' Found='$way'");
-
- $post = get_post($post_ID);
-
- if ( !$post ) // Post_ID not found
- 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.'));
-
- if ( $post_ID == url_to_postid($pagelinkedfrom) )
- return new IXR_Error(0, __('The source URL and the target URL cannot both point to the same resource.'));
-
- // Check if pings are on
- if ( !pings_open($post) )
- 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
- 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);
-
- // Let's check the remote site
- $linea = wp_remote_fopen( $pagelinkedfrom );
- if ( !$linea )
- return new IXR_Error(16, __('The source URL does not exist.'));
-
- $linea = apply_filters('pre_remote_source', $linea, $pagelinkedto);
-
- // Work around bug in strip_tags():
- $linea = str_replace('<!DOC', '<DOC', $linea);
- $linea = preg_replace( '/[\s\r\n\t]+/', ' ', $linea ); // normalize spaces
- $linea = preg_replace( "/ <(h1|h2|h3|h4|h5|h6|p|th|td|li|dt|dd|pre|caption|input|textarea|button|body)[^>]*>/", "\n\n", $linea );
-
- preg_match('|<title>([^<]*?)</title>|is', $linea, $matchtitle);
- $title = $matchtitle[1];
- if ( empty( $title ) )
- return new IXR_Error(32, __('We cannot find a title on that page.'));
-
- $linea = strip_tags( $linea, '<a>' ); // just keep the tag we need
-
- $p = explode( "\n\n", $linea );
-
- $preg_target = preg_quote($pagelinkedto, '|');
-
- foreach ( $p as $para ) {
- if ( strpos($para, $pagelinkedto) !== false ) { // it exists, but is it a link?
- preg_match("|<a[^>]+?".$preg_target."[^>]*>([^>]+?)</a>|", $para, $context);
-
- // If the URL isn't in a link context, keep looking
- if ( empty($context) )
- continue;
-
- // We're going to use this fake tag to mark the context in a bit
- // the marker is needed in case the link text appears more than once in the paragraph
- $excerpt = preg_replace('|\</?wpcontext\>|', '', $para);
-
- // prevent really long link text
- if ( strlen($context[1]) > 100 )
- $context[1] = substr($context[1], 0, 100) . '...';
-
- $marker = '<wpcontext>'.$context[1].'</wpcontext>'; // set up our marker
- $excerpt= str_replace($context[0], $marker, $excerpt); // swap out the link for our marker
- $excerpt = strip_tags($excerpt, '<wpcontext>'); // strip all tags but our context marker
- $excerpt = trim($excerpt);
- $preg_marker = preg_quote($marker, '|');
- $excerpt = preg_replace("|.*?\s(.{0,100}$preg_marker.{0,100})\s.*|s", '$1', $excerpt);
- $excerpt = strip_tags($excerpt); // YES, again, to remove the marker wrapper
- break;
- }
- }
-
- if ( empty($context) ) // Link to target not found
- return new IXR_Error(17, __('The source URL does not contain a link to the target URL, and so cannot be used as a source.'));
-
- $pagelinkedfrom = str_replace('&', '&', $pagelinkedfrom);
-
- $context = '[...] ' . esc_html( $excerpt ) . ' [...]';
- $pagelinkedfrom = $wpdb->escape( $pagelinkedfrom );
-
- $comment_post_ID = (int) $post_ID;
- $comment_author = $title;
- $this->escape($comment_author);
- $comment_author_url = $pagelinkedfrom;
- $comment_content = $context;
- $this->escape($comment_content);
- $comment_type = 'pingback';
-
- $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_content', 'comment_type');
-
- $comment_ID = wp_new_comment($commentdata);
- do_action('pingback_post', $comment_ID);
-
- return sprintf(__('Pingback from %1$s to %2$s registered. Keep the web talking! :-)'), $pagelinkedfrom, $pagelinkedto);
- }
-
- /**
- * Retrieve array of URLs that pingbacked the given URL.
- *
- * Specs on http://www.aquarionics.com/misc/archives/blogite/0198.html
- *
- * @since 1.5.0
- *
- * @param array $args Method parameters.
- * @return array
- */
- function pingback_extensions_getPingbacks($args) {
-
- global $wpdb;
-
- do_action('xmlrpc_call', 'pingback.extensions.getPingbacks');
-
- $this->escape($args);
-
- $url = $args;
-
- $post_ID = url_to_postid($url);
- 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 ) {
- // 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 )
- return array();
-
- $pingbacks = array();
- foreach ( $comments as $comment ) {
- if ( 'pingback' == $comment->comment_type )
- $pingbacks[] = $comment->comment_author_url;
- }
-
- return $pingbacks;
- }
-}
+// Allow for a plugin to insert a different class to handle requests.
+$wp_xmlrpc_server_class = apply_filters('wp_xmlrpc_server_class', 'wp_xmlrpc_server');
+$wp_xmlrpc_server = new $wp_xmlrpc_server_class;
-$wp_xmlrpc_server = new wp_xmlrpc_server();
+// Fire off the request
$wp_xmlrpc_server->serve_request();
?>
\ No newline at end of file