diff -uNr a/mp-wp/favicon.svg b/mp-wp/favicon.svg --- a/mp-wp/favicon.svg f8b9c170225c60751012c022ecf52406e2edacfa5d8654ad9c8c3ad00cc4ec6f3748ecc54e90f8fd38bf826342d250cfb9ce2d5f94d14e725578da20068088d9 +++ b/mp-wp/favicon.svg false @@ -1 +0,0 @@ - diff -uNr a/mp-wp/manifest b/mp-wp/manifest --- a/mp-wp/manifest 00b581121b09f282560a29d90fbb53a6ad22a7799428554bb1d17584200fb45310a8022757daf326c1709b2032434fb9eb4c507743af87e517adda50e2974365 +++ b/mp-wp/manifest dda35ab508d16ff98e3e1dfcc4db121dadb4ed81a432c0f5d9ab6f4bb1208b3fae5f3928e1090d7e7f3ba6643d5e83c2542c9ca7232c05e56b8e2047853ee6d8 @@ -8,3 +8,4 @@ 629903 mp-wp_remove-textselectionjs-pop3-etc-r2 jfw Remove the unreliable JS-based selection (reground: including wrapper spans), posting by POP3 login, and a stray .php.orig file. Neutralize and comment the example pingback updater. 629903 mp-wp_svg-screenshots-and-errorreporting-r2 jfw Allow .svg extensions in theme screenshot search. Don't clobber the user's errorreporting level without WP_DEBUG. (Reground following antecedent.) 631542 mp-wp_add-embeddable-codeblocks-and-server-side-selection billymg Add embeddable codeblocks and the server-side select mechanism to the "footnotes" plugin (now "mp-wp content processing") +634877 mp-wp_remove-all-javascript billymg Remove all JS and a decent chunk of unnecessary PHP code (including importers/exporters, theme/plugin editors, and unused filesystem libraries). Introduce a minor facelift to the admin UI while removing the contents of wp-admin/images/ diff -uNr a/mp-wp/wp-admin/admin-ajax.php b/mp-wp/wp-admin/admin-ajax.php --- a/mp-wp/wp-admin/admin-ajax.php 15dbf0bc5478ce0bd9c2a705c7ab4a7701e13cc6590a8b47211f39e8a6bc6a8dab0ac895b8ad360aaf9ca6727fe2cdef554b21be787b9a746a1feb5eb28c531f +++ b/mp-wp/wp-admin/admin-ajax.php false @@ -1,1044 +0,0 @@ -ALERT: You are logged out! Could not save draft. Please log in again.'), wp_login_url() ); - $x = new WP_Ajax_Response( array( - 'what' => 'autosave', - 'id' => $id, - 'data' => $message - ) ); - $x->send(); - } - - die('-1'); -} - -if ( isset( $_GET['action'] ) ) : -switch ( $action = $_GET['action'] ) : -case 'ajax-tag-search' : - if ( !current_user_can( 'manage_categories' ) ) - die('-1'); - - $s = $_GET['q']; // is this slashed already? - - if ( false !== strpos( $s, ',' ) ) { - $s = explode( ',', $s ); - $s = $s[count( $s ) - 1]; - } - $s = trim( $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 = 'post_tag' AND t.name LIKE ('%". $s . "%')" ); - echo join( $results, "\n" ); - die; - break; -default : - do_action( 'wp_ajax_' . $_GET['action'] ); - die('0'); - break; -endswitch; -endif; - -$id = isset($_POST['id'])? (int) $_POST['id'] : 0; -switch ( $action = $_POST['action'] ) : -case 'delete-comment' : - check_ajax_referer( "delete-comment_$id" ); - if ( !$comment = get_comment( $id ) ) - die('1'); - if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) - die('-1'); - - if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) { - if ( 'spam' == wp_get_comment_status( $comment->comment_ID ) ) - die('1'); - $r = wp_set_comment_status( $comment->comment_ID, 'spam' ); - } else { - $r = wp_delete_comment( $comment->comment_ID ); - } - - die( $r ? '1' : '0' ); - break; -case 'delete-cat' : - check_ajax_referer( "delete-category_$id" ); - if ( !current_user_can( 'manage_categories' ) ) - die('-1'); - - $cat = get_category( $id ); - if ( !$cat || is_wp_error( $cat ) ) - die('1'); - - if ( wp_delete_category( $id ) ) - die('1'); - else - die('0'); - break; -case 'delete-tag' : - check_ajax_referer( "delete-tag_$id" ); - if ( !current_user_can( 'manage_categories' ) ) - die('-1'); - - $tag = get_term( $id, 'post_tag' ); - if ( !$tag || is_wp_error( $tag ) ) - die('1'); - - if ( wp_delete_term($id, 'post_tag')) - die('1'); - 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'); - - // Don't delete the default cats. - if ( $id == get_option('default_link_category') ) { - $x = new WP_AJAX_Response( array( - 'what' => 'link-cat', - 'id' => $id, - 'data' => new WP_Error( 'default-link-cat', sprintf(__("Can’t delete the %s category: this is the default one"), $cat_name) ) - ) ); - $x->send(); - } - - $r = wp_delete_term($id, 'link_category'); - 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' ) ) - die('-1'); - - $link = get_bookmark( $id ); - if ( !$link || is_wp_error( $link ) ) - die('1'); - - if ( wp_delete_link( $id ) ) - die('1'); - else - die('0'); - break; -case 'delete-meta' : - check_ajax_referer( "delete-meta_$id" ); - if ( !$meta = get_post_meta_by_id( $id ) ) - die('1'); - - if ( !current_user_can( 'edit_post', $meta->post_id ) ) - die('-1'); - if ( delete_meta( $meta->meta_id ) ) - die('1'); - die('0'); - break; -case 'delete-post' : - check_ajax_referer( "{$action}_$id" ); - if ( !current_user_can( 'delete_post', $id ) ) - die('-1'); - - if ( !get_post( $id ) ) - die('1'); - - if ( wp_delete_post( $id ) ) - die('1'); - else - die('0'); - break; -case 'delete-page' : - check_ajax_referer( "{$action}_$id" ); - if ( !current_user_can( 'delete_page', $id ) ) - die('-1'); - - if ( !get_page( $id ) ) - die('1'); - - if ( wp_delete_post( $id ) ) - die('1'); - else - die('0'); - break; -case 'dim-comment' : - if ( !$comment = get_comment( $id ) ) - die('0'); - - if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) - die('-1'); - if ( !current_user_can( 'moderate_comments' ) ) - die('-1'); - - $current = wp_get_comment_status( $comment->comment_ID ); - if ( $_POST['new'] == $current ) - die('1'); - - if ( in_array( $current, array( 'unapproved', 'spam' ) ) ) { - check_ajax_referer( "approve-comment_$id" ); - if ( wp_set_comment_status( $comment->comment_ID, 'approve' ) ) - die('1'); - } else { - check_ajax_referer( "unapprove-comment_$id" ); - if ( wp_set_comment_status( $comment->comment_ID, 'hold' ) ) - die('1'); - } - die('0'); - break; -case 'add-category' : // On the Fly - check_ajax_referer( $action ); - if ( !current_user_can( 'manage_categories' ) ) - die('-1'); - $names = explode(',', $_POST['newcat']); - if ( 0 > $parent = (int) $_POST['newcat_parent'] ) - $parent = 0; - $post_category = isset($_POST['post_category'])? (array) $_POST['post_category'] : array(); - $checked_categories = array_map( 'absint', (array) $post_category ); - $popular_ids = isset( $_POST['popular_ids'] ) ? - array_map( 'absint', explode( ',', $_POST['popular_ids'] ) ) : - false; - - $x = new WP_Ajax_Response(); - foreach ( $names as $cat_name ) { - $cat_name = trim($cat_name); - $category_nicename = sanitize_title($cat_name); - if ( '' === $category_nicename ) - continue; - $cat_id = wp_create_category( $cat_name, $parent ); - $checked_categories[] = $cat_id; - if ( $parent ) // Do these all at once in a second - continue; - $category = get_category( $cat_id ); - ob_start(); - wp_category_checklist( 0, $cat_id, $checked_categories, $popular_ids ); - $data = ob_get_contents(); - ob_end_clean(); - $x->add( array( - 'what' => 'category', - 'id' => $cat_id, - 'data' => $data, - 'position' => -1 - ) ); - } - if ( $parent ) { // Foncy - replace the parent and all its children - $parent = get_category( $parent ); - ob_start(); - dropdown_categories( 0, $parent ); - $data = ob_get_contents(); - ob_end_clean(); - $x->add( array( - 'what' => 'category', - 'id' => $parent->term_id, - 'old_id' => $parent->term_id, - 'data' => $data, - 'position' => -1 - ) ); - - } - $x->send(); - break; -case 'add-link-category' : // On the Fly - check_ajax_referer( $action ); - if ( !current_user_can( 'manage_categories' ) ) - die('-1'); - $names = explode(',', $_POST['newcat']); - $x = new WP_Ajax_Response(); - foreach ( $names as $cat_name ) { - $cat_name = trim($cat_name); - $slug = sanitize_title($cat_name); - if ( '' === $slug ) - continue; - if ( !$cat_id = is_term( $cat_name, 'link_category' ) ) { - $cat_id = wp_insert_term( $cat_name, 'link_category' ); - } - $cat_id = $cat_id['term_id']; - $cat_name = wp_specialchars(stripslashes($cat_name)); - $x->add( array( - 'what' => 'link-category', - 'id' => $cat_id, - 'data' => "", - 'position' => -1 - ) ); - } - $x->send(); - break; -case 'add-cat' : // From Manage->Categories - check_ajax_referer( 'add-category' ); - if ( !current_user_can( 'manage_categories' ) ) - die('-1'); - - if ( '' === trim($_POST['cat_name']) ) { - $x = new WP_Ajax_Response( array( - 'what' => 'cat', - 'id' => new WP_Error( 'cat_name', __('You did not enter a category name.') ) - ) ); - $x->send(); - } - - if ( category_exists( trim( $_POST['cat_name'] ) ) ) { - $x = new WP_Ajax_Response( array( - 'what' => 'cat', - 'id' => new WP_Error( 'cat_exists', __('The category you are trying to create already exists.'), array( 'form-field' => 'cat_name' ) ), - ) ); - $x->send(); - } - - $cat = wp_insert_category( $_POST, true ); - - if ( is_wp_error($cat) ) { - $x = new WP_Ajax_Response( array( - 'what' => 'cat', - 'id' => $cat - ) ); - $x->send(); - } - - if ( !$cat || (!$cat = get_category( $cat )) ) - die('0'); - - $level = 0; - $cat_full_name = $cat->name; - $_cat = $cat; - while ( $_cat->parent ) { - $_cat = get_category( $_cat->parent ); - $cat_full_name = $_cat->name . ' — ' . $cat_full_name; - $level++; - } - $cat_full_name = attribute_escape($cat_full_name); - - $x = new WP_Ajax_Response( array( - 'what' => 'cat', - 'id' => $cat->term_id, - 'position' => -1, - 'data' => _cat_row( $cat, $level, $cat_full_name ), - 'supplemental' => array('name' => $cat_full_name, 'show-link' => sprintf(__( 'Category %s added' ), "cat-$cat->term_id", $cat_full_name)) - ) ); - $x->send(); - break; -case 'add-link-cat' : // From Blogroll -> Categories - check_ajax_referer( 'add-link-category' ); - if ( !current_user_can( 'manage_categories' ) ) - 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 - check_ajax_referer( 'add-tag' ); - if ( !current_user_can( 'manage_categories' ) ) - die('-1'); - - if ( '' === trim($_POST['name']) ) { - $x = new WP_Ajax_Response( array( - 'what' => 'tag', - 'id' => new WP_Error( 'name', __('You did not enter a tag name.') ) - ) ); - $x->send(); - } - - $tag = wp_insert_term($_POST['name'], 'post_tag', $_POST ); - - if ( is_wp_error($tag) ) { - $x = new WP_Ajax_Response( array( - 'what' => 'tag', - 'id' => $tag - ) ); - $x->send(); - } - - if ( !$tag || (!$tag = get_term( $tag['term_id'], 'post_tag' )) ) - die('0'); - - $tag_full_name = $tag->name; - $tag_full_name = attribute_escape($tag_full_name); - - $x = new WP_Ajax_Response( array( - 'what' => 'tag', - 'id' => $tag->term_id, - 'position' => '-1', - 'data' => _tag_row( $tag ), - 'supplemental' => array('name' => $tag_full_name, 'show-link' => sprintf(__( 'Tag %s added' ), "tag-$tag->term_id", $tag_full_name)) - ) ); - $x->send(); - break; -case 'get-tagcloud' : - if ( !current_user_can( 'manage_categories' ) ) - die('-1'); - - $tags = get_tags( array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) ); - - if ( empty( $tags ) ) - die( __('No tags found!') ); - - foreach ( $tags as $key => $tag ) { - $tags[ $key ]->link = '#'; - $tags[ $key ]->id = $tag->term_id; - } - - $return = wp_generate_tag_cloud( $tags ); - - if ( empty($return) ) - die('0'); - - echo $return; - - exit; - break; -case 'add-comment' : - check_ajax_referer( $action ); - if ( !current_user_can( 'edit_post', $id ) ) - die('-1'); - $search = isset($_POST['s']) ? $_POST['s'] : false; - $start = isset($_POST['page']) ? intval($_POST['page']) * 25 - 1: 24; - $status = isset($_POST['comment_status']) ? $_POST['comment_status'] : false; - $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'); - - $start = isset($_POST['start']) ? intval($_POST['start']) : 0; - $num = isset($_POST['num']) ? intval($_POST['num']) : 10; - - list($comments, $total) = _wp_get_comment_list( false, false, $start, $num, $post_ID ); - - if ( !$comments ) - die('1'); - - $comment_list_item = ''; - $x = new WP_Ajax_Response(); - foreach ( (array) $comments as $comment ) { - get_comment( $comment ); - ob_start(); - _wp_comment_row( $comment->comment_ID, 'single', false, false ); - $comment_list_item .= ob_get_contents(); - ob_end_clean(); - } - $x->add( array( - 'what' => 'comments', - 'data' => $comment_list_item - ) ); - $x->send(); - break; -case 'replyto-comment' : - check_ajax_referer( $action ); - - $comment_post_ID = (int) $_POST['comment_post_ID']; - if ( !current_user_can( 'edit_post', $comment_post_ID ) ) - die('-1'); - - $status = $wpdb->get_var( $wpdb->prepare("SELECT post_status FROM $wpdb->posts WHERE ID = %d", $comment_post_ID) ); - - if ( empty($status) ) - die('1'); - elseif ( in_array($status, array('draft', 'pending') ) ) - die( __('Error: you are replying to a comment on a draft post.') ); - - $user = wp_get_current_user(); - if ( $user->ID ) { - $comment_author = $wpdb->escape($user->display_name); - $comment_author_email = $wpdb->escape($user->user_email); - $comment_author_url = $wpdb->escape($user->user_url); - $comment_content = trim($_POST['content']); - if ( current_user_can('unfiltered_html') ) { - if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) { - kses_remove_filters(); // start with a clean slate - kses_init_filters(); // set up the filters - } - } - } else { - die( __('Sorry, you must be logged in to reply to a comment.') ); - } - - if ( '' == $comment_content ) - die( __('Error: please type a comment.') ); - - $comment_parent = absint($_POST['comment_ID']); - $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID'); - - $comment_id = wp_new_comment( $commentdata ); - $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 ) { - require_once( ABSPATH . 'wp-admin/includes/dashboard.php' ); - _wp_dashboard_recent_comments_row( $comment, false ); - } else { - _wp_comment_row( $comment->comment_ID, $mode, false, $checkbox ); - } - $comment_list_item = ob_get_contents(); - ob_end_clean(); - - $x->add( array( - 'what' => 'comment', - 'id' => $comment->comment_ID, - 'data' => $comment_list_item, - 'position' => $position - )); - - $x->send(); - break; -case 'edit-comment' : - check_ajax_referer( 'replyto-comment' ); - - $comment_post_ID = (int) $_POST['comment_post_ID']; - if ( ! current_user_can( 'edit_post', $comment_post_ID ) ) - die('-1'); - - if ( '' == $_POST['content'] ) - die( __('Error: please type a comment.') ); - - $comment_id = (int) $_POST['comment_ID']; - $_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; - - if ( get_option('show_avatars') && 'single' != $mode ) - add_filter( 'comment_author', 'floated_admin_avatar' ); - - $x = new WP_Ajax_Response(); - - ob_start(); - _wp_comment_row( $comment_id, $mode, true, $checkbox ); - $comment_list_item = ob_get_contents(); - ob_end_clean(); - - $x->add( array( - 'what' => 'edit_comment', - 'id' => $comment->comment_ID, - 'data' => $comment_list_item, - 'position' => $position - )); - - $x->send(); - break; -case 'add-meta' : - check_ajax_referer( 'add-meta' ); - $c = 0; - $pid = (int) $_POST['post_id']; - if ( isset($_POST['metakeyselect']) || isset($_POST['metakeyinput']) ) { - if ( !current_user_can( 'edit_post', $pid ) ) - die('-1'); - if ( '#NONE#' == $_POST['metakeyselect'] && empty($_POST['metakeyinput']) ) - die('1'); - if ( $pid < 0 ) { - $now = current_time('timestamp', 1); - if ( $pid = wp_insert_post( array( - 'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now)) - ) ) ) { - if ( is_wp_error( $pid ) ) { - $x = new WP_Ajax_Response( array( - 'what' => 'meta', - 'data' => $pid - ) ); - $x->send(); - } - $mid = add_meta( $pid ); - } else { - die('0'); - } - } else if ( !$mid = add_meta( $pid ) ) { - die('0'); - } - - $meta = get_post_meta_by_id( $mid ); - $pid = (int) $meta->post_id; - $meta = get_object_vars( $meta ); - $x = new WP_Ajax_Response( array( - 'what' => 'meta', - 'id' => $mid, - 'data' => _list_meta_row( $meta, $c ), - 'position' => 1, - 'supplemental' => array('postid' => $pid) - ) ); - } else { - $mid = (int) array_pop(array_keys($_POST['meta'])); - $key = $_POST['meta'][$mid]['key']; - $value = $_POST['meta'][$mid]['value']; - if ( !$meta = get_post_meta_by_id( $mid ) ) - die('0'); // if meta doesn't exist - if ( !current_user_can( 'edit_post', $meta->post_id ) ) - die('-1'); - if ( !$u = update_meta( $mid, $key, $value ) ) - die('1'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems). - $key = stripslashes($key); - $value = stripslashes($value); - $x = new WP_Ajax_Response( array( - 'what' => 'meta', - 'id' => $mid, 'old_id' => $mid, - 'data' => _list_meta_row( array( - 'meta_key' => $key, - 'meta_value' => $value, - 'meta_id' => $mid - ), $c ), - 'position' => 0, - 'supplemental' => array('postid' => $meta->post_id) - ) ); - } - $x->send(); - break; -case 'add-user' : - 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 ) ) { - $x = new WP_Ajax_Response( array( - 'what' => 'user', - 'id' => $user_id - ) ); - $x->send(); - } - $user_object = new WP_User( $user_id ); - - $x = new WP_Ajax_Response( array( - 'what' => 'user', - 'id' => $user_id, - 'data' => user_row( $user_object, '', $user_object->roles[0] ), - 'supplemental' => array( - 'show-link' => sprintf(__( 'User %s added' ), "user-$user_id", $user_object->user_login), - 'role' => $user_object->roles[0] - ) - ) ); - $x->send(); - break; -case 'autosave' : // The name of this action is hardcoded in edit_post() - define( 'DOING_AUTOSAVE', true ); - - $nonce_age = check_ajax_referer( 'autosave', 'autosavenonce' ); - global $current_user; - - $_POST['post_category'] = explode(",", $_POST['catslist']); - $_POST['tags_input'] = explode(",", $_POST['tags_input']); - if($_POST['post_type'] == 'page' || empty($_POST['post_category'])) - unset($_POST['post_category']); - - $do_autosave = (bool) $_POST['autosave']; - $do_lock = true; - - $data = ''; - $message = sprintf( __('Draft Saved at %s.'), date( __('g:i:s a'), current_time( 'timestamp', true ) ) ); - - $supplemental = array(); - - $id = $revision_id = 0; - if($_POST['post_ID'] < 0) { - $_POST['post_status'] = 'draft'; - $_POST['temp_ID'] = $_POST['post_ID']; - if ( $do_autosave ) { - $id = wp_write_post(); - $data = $message; - } - } else { - $post_ID = (int) $_POST['post_ID']; - $_POST['ID'] = $post_ID; - $post = get_post($post_ID); - - if ( $last = wp_check_post_lock( $post->ID ) ) { - $do_autosave = $do_lock = false; - - $last_user = get_userdata( $last ); - $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' ); - $data = new WP_Error( 'locked', sprintf( - $_POST['post_type'] == 'page' ? __( 'Autosave disabled: %s is currently editing this page.' ) : __( 'Autosave disabled: %s is currently editing this post.' ), - wp_specialchars( $last_user_name ) - ) ); - - $supplemental['disable_autosave'] = 'disable'; - } - - if ( 'page' == $post->post_type ) { - if ( !current_user_can('edit_page', $post_ID) ) - die(__('You are not allowed to edit this page.')); - } else { - if ( !current_user_can('edit_post', $post_ID) ) - die(__('You are not allowed to edit this post.')); - } - - if ( $do_autosave ) { - // Drafts are just overwritten by autosave - if ( 'draft' == $post->post_status ) { - $id = edit_post(); - } else { // Non drafts are not overwritten. The autosave is stored in a special post revision. - $revision_id = wp_create_post_autosave( $post->ID ); - if ( is_wp_error($revision_id) ) - $id = $revision_id; - else - $id = $post->ID; - } - $data = $message; - } else { - $id = $post->ID; - } - } - - if ( $do_lock && $id && is_numeric($id) ) - wp_set_post_lock( $id ); - - if ( $nonce_age == 2 ) { - $supplemental['replace-autosavenonce'] = wp_create_nonce('autosave'); - $supplemental['replace-getpermalinknonce'] = wp_create_nonce('getpermalink'); - $supplemental['replace-samplepermalinknonce'] = wp_create_nonce('samplepermalink'); - $supplemental['replace-closedpostboxesnonce'] = wp_create_nonce('closedpostboxes'); - if ( $id ) { - if ( $_POST['post_type'] == 'post' ) - $supplemental['replace-_wpnonce'] = wp_create_nonce('update-post_' . $id); - elseif ( $_POST['post_type'] == 'page' ) - $supplemental['replace-_wpnonce'] = wp_create_nonce('update-page_' . $id); - } - } - - $x = new WP_Ajax_Response( array( - 'what' => 'autosave', - 'id' => $id, - 'data' => $id ? $data : '', - 'supplemental' => $supplemental - ) ); - $x->send(); - break; -case 'autosave-generate-nonces' : - check_ajax_referer( 'autosave', 'autosavenonce' ); - $ID = (int) $_POST['post_ID']; - if($_POST['post_type'] == 'post') { - if(current_user_can('edit_post', $ID)) - die(wp_create_nonce('update-post_' . $ID)); - } - if($_POST['post_type'] == 'page') { - if(current_user_can('edit_page', $ID)) { - die(wp_create_nonce('update-page_' . $ID)); - } - } - die('0'); -break; -case 'closed-postboxes' : - check_ajax_referer( 'closedpostboxes', 'closedpostboxesnonce' ); - $closed = isset( $_POST['closed'] )? $_POST['closed'] : ''; - $closed = explode( ',', $_POST['closed'] ); - $hidden = isset( $_POST['hidden'] )? $_POST['hidden'] : ''; - $hidden = explode( ',', $_POST['hidden'] ); - $page = isset( $_POST['page'] )? $_POST['page'] : ''; - if ( !preg_match( '/^[a-z-_]+$/', $page ) ) { - die(-1); - } - $current_user = wp_get_current_user(); - if ( is_array($closed) ) - update_usermeta($current_user->ID, 'closedpostboxes_'.$page, $closed); - if ( is_array($hidden) ) - update_usermeta($current_user->ID, 'meta-box-hidden_'.$page, $hidden); -break; -case 'hidden-columns' : - check_ajax_referer( 'hiddencolumns', 'hiddencolumnsnonce' ); - $hidden = isset( $_POST['hidden'] )? $_POST['hidden'] : ''; - $hidden = explode( ',', $_POST['hidden'] ); - $page = isset( $_POST['page'] )? $_POST['page'] : ''; - if ( !preg_match( '/^[a-z-_]+$/', $page ) ) { - die(-1); - } - $current_user = wp_get_current_user(); - if ( is_array($hidden) ) - update_usermeta($current_user->ID, "manage-$page-columns-hidden", $hidden); -break; -case 'get-permalink': - check_ajax_referer( 'getpermalink', 'getpermalinknonce' ); - $post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0; - die(add_query_arg(array('preview' => 'true'), get_permalink($post_id))); -break; -case 'sample-permalink': - check_ajax_referer( 'samplepermalink', 'samplepermalinknonce' ); - $post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0; - $title = isset($_POST['new_title'])? $_POST['new_title'] : ''; - $slug = isset($_POST['new_slug'])? $_POST['new_slug'] : ''; - die(get_sample_permalink_html($post_id, $title, $slug)); -break; -case 'inline-save': - check_ajax_referer( 'inlineeditnonce', '_inline_edit' ); - - if ( ! isset($_POST['post_ID']) || ! ( $post_ID = (int) $_POST['post_ID'] ) ) - exit; - - if ( 'page' == $_POST['post_type'] ) { - if ( ! current_user_can( 'edit_page', $post_ID ) ) - die( __('You are not allowed to edit this page.') ); - } else { - if ( ! current_user_can( 'edit_post', $post_ID ) ) - die( __('You are not allowed to edit this post.') ); - } - - if ( $last = wp_check_post_lock( $post_ID ) ) { - $last_user = get_userdata( $last ); - $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' ); - printf( $_POST['post_type'] == 'page' ? __( 'Saving is disabled: %s is currently editing this page.' ) : __( 'Saving is disabled: %s is currently editing this post.' ), wp_specialchars( $last_user_name ) ); - exit; - } - - $data = &$_POST; - $post = get_post( $post_ID, ARRAY_A ); - $data['content'] = $post['post_content']; - $data['excerpt'] = $post['post_excerpt']; - - // rename - $data['user_ID'] = $GLOBALS['user_ID']; - - if ( isset($data['post_parent']) ) - $data['parent_id'] = $data['post_parent']; - - // status - if ( isset($data['keep_private']) && 'private' == $data['keep_private'] ) - $data['post_status'] = 'private'; - else - $data['post_status'] = $data['_status']; - - if ( empty($data['comment_status']) ) - $data['comment_status'] = 'closed'; - if ( empty($data['ping_status']) ) - $data['ping_status'] = 'closed'; - - // update the post - $_POST = $data; - edit_post(); - - $post = array(); - if ( 'page' == $_POST['post_type'] ) { - $post[] = get_post($_POST['post_ID']); - page_rows($post); - } elseif ( 'post' == $_POST['post_type'] ) { - $mode = $_POST['post_view']; - $post[] = get_post($_POST['post_ID']); - post_rows($post); - } - - exit; - break; -case 'inline-save-tax': - check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' ); - - if ( ! current_user_can('manage_categories') ) - die( __('Cheatin’ uh?') ); - - if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) ) - die(-1); - - switch ($_POST['tax_type']) { - case 'cat' : - $data = array(); - $data['cat_ID'] = $id; - $data['cat_name'] = $_POST['name']; - $data['category_nicename'] = $_POST['slug']; - if ( isset($_POST['parent']) && (int) $_POST['parent'] > 0 ) - $data['category_parent'] = $_POST['parent']; - - $cat = get_category($id, ARRAY_A); - $data['category_description'] = $cat['category_description']; - - $updated = wp_update_category($data); - - if ( $updated && !is_wp_error($updated) ) - echo _cat_row( $updated, 0 ); - else - die( __('Category not updated.') ); - - break; - case 'link-cat' : - $updated = wp_update_term($id, 'link_category', $_POST); - - if ( $updated && !is_wp_error($updated) ) - echo link_cat_row($updated['term_id']); - else - die( __('Category not updated.') ); - - break; - case 'tag' : - $updated = wp_update_term($id, 'post_tag', $_POST); - if ( $updated && !is_wp_error($updated) ) { - $tag = get_term( $updated['term_id'], 'post_tag' ); - if ( !$tag || is_wp_error( $tag ) ) - die( __('Tag not updated.') ); - - echo _tag_row($tag); - } else { - die( __('Tag not updated.') ); - } - - break; - } - - exit; - break; -case 'meta-box-order': - check_ajax_referer( 'meta-box-order' ); - update_user_option( $GLOBALS['current_user']->ID, "meta-box-order_$_POST[page]", $_POST['order'] ); - die('1'); - break; -case 'find_posts': - check_ajax_referer( 'find-posts' ); - - if ( empty($_POST['ps']) ) - exit; - - $what = isset($_POST['pages']) ? 'page' : 'post'; - $s = stripslashes($_POST['ps']); - preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches); - $search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]); - - $searchand = $search = ''; - foreach( (array) $search_terms as $term) { - $term = addslashes_gpc($term); - $search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))"; - $searchand = ' AND '; - } - $term = $wpdb->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}%')"; - - $posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND $search ORDER BY post_date_gmt DESC LIMIT 50" ); - - if ( ! $posts ) - exit( __('No posts found.') ); - - $html = ''; - foreach ( $posts as $post ) { - - switch ( $post->post_status ) { - case 'publish' : - case 'private' : - $stat = __('Published'); - break; - case 'future' : - $stat = __('Scheduled'); - break; - case 'pending' : - $stat = __('Pending Review'); - break; - case 'draft' : - $stat = __('Unpublished'); - break; - } - - if ( '0000-00-00 00:00:00' == $post->post_date ) { - $time = ''; - } else { - $time = mysql2date(__('Y/m/d'), $post->post_date); - } - - $html .= ''; - $html .= ''."\n\n"; - } - $html .= '

'.__('Title').''.__('Time').''.__('Status').'
'.wp_specialchars($time, true).''.wp_specialchars($stat, true).'
'; - - $x = new WP_Ajax_Response(); - $x->add( array( - 'what' => $what, - 'data' => $html - )); - $x->send(); - - break; -default : - do_action( 'wp_ajax_' . $_POST['action'] ); - die('0'); - break; -endswitch; -?> diff -uNr a/mp-wp/wp-admin/admin-footer.php b/mp-wp/wp-admin/admin-footer.php --- a/mp-wp/wp-admin/admin-footer.php 6a85d8646f911c892da3e7753a5a49f408c854070abcfd418440ebf76548a350d3f87122a335c8640dc2c22ab37e80ca9af907279d87b57b3142fd74f10bd201 +++ b/mp-wp/wp-admin/admin-footer.php 2079aa7b07deebc0b731f79b5035974be595af08deabff16b0526337252257c55c6bd71c894e0031a8bc6c6f2c27251ad86cfc9139c33f0884d17a1ad4e50320 @@ -12,17 +12,6 @@
- - - \ No newline at end of file + diff -uNr a/mp-wp/wp-admin/admin-header.php b/mp-wp/wp-admin/admin-header.php --- a/mp-wp/wp-admin/admin-header.php 34f1ef463ad4d0ffbb338851cab80259f68f8a133728d15279c40b181f47635009c33776fb83203ed9d86357e5d857464ad465622a3c64ef7db587fe0862fd2e +++ b/mp-wp/wp-admin/admin-header.php 223b71699a0aea566577db897ceb9c0fcdfc65b0ec036e20023f3a067a4767355235276f08a0b16503d1cb8e4a49c3fd9f7d6eeda927899111181942ee065860 @@ -25,33 +25,6 @@ wp_admin_css( 'css/colors' ); wp_admin_css( 'css/ie' ); -?> - -%2$s'), 'profile.php', $user_identity) ?> |

- - - - - -
- - - - - - - -
-$page_links
"; -?> - -
- - - -
- -
-
-

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

-

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

@@ -248,7 +218,6 @@

-
@@ -289,24 +258,7 @@
- - '.__('Go back').'!', 'javascript:history.go(-1)') ); + comment_footer_die( __('Oops, no comment with this ID.') ); if ( !current_user_can('edit_post', $comment->comment_post_ID) ) comment_footer_die( __('You are not allowed to edit comments on this post.') ); @@ -90,7 +89,7 @@ - +
' onclick="self.location='" />
@@ -237,4 +236,4 @@ include('admin-footer.php'); -?> \ No newline at end of file +?> diff -uNr a/mp-wp/wp-admin/css/colors-classic-rtl.css b/mp-wp/wp-admin/css/colors-classic-rtl.css --- a/mp-wp/wp-admin/css/colors-classic-rtl.css 98c41d5b6114f6a84f3b26b20df0dc247db3515b4319c140ee9e82935f9b824f41f6a2e1981c9f93e2c8955a8de88bc10dda4cf2450178ef036b2c360f9a08e6 +++ b/mp-wp/wp-admin/css/colors-classic-rtl.css false @@ -1,80 +0,0 @@ -.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.svg); -} -.tablenav .tablenav-pages a { - background: #eee url('../images/menu-bits-rtl.svg') 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.svg) no-repeat scroll right -289px; -} - -#adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.svg) no-repeat scroll right -34px; -} - -.folded #adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.svg) 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.svg) repeat-x scroll right -207px; -} - -#adminmenu .wp-has-current-submenu ul li a.current { - background: url(../images/menu-dark-rtl.svg) 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.svg) top right repeat-x; -} - -#adminmenu li.wp-has-current-submenu ul li a { - background: url(../images/menu-dark-rtl.svg) 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.svg) 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.svg) repeat-x scroll right -109px; -} - -#adminmenu a.wp-has-submenu { - background: #f1f1f1 url(../images/menu-bits-rtl.svg) repeat-x scroll right -379px; -} - -#adminmenu .wp-submenu a { - background: #FFFFFF url(../images/menu-bits-rtl.svg) no-repeat scroll right -310px; -} - -#adminmenu li.current a, -#adminmenu .wp-submenu a:hover { - background: transparent url(../images/menu-bits-rtl.svg) no-repeat scroll right -289px; -} - -#adminmenu li.wp-has-current-submenu a.wp-has-submenu { - background: #b5b5b5 url(../images/menu-bits-rtl.svg) repeat-x scroll right top; -} - -.meta-box-sortables .postbox:hover .handlediv { - background: transparent url(../images/menu-bits-rtl.svg) no-repeat scroll right -111px; -} diff -uNr a/mp-wp/wp-admin/css/colors-classic.css b/mp-wp/wp-admin/css/colors-classic.css --- a/mp-wp/wp-admin/css/colors-classic.css 39b755fafd1e9c60473f1355dfd9eb98d15d65c8c0e9a41b68792c390d585e40339b51152c4b93b40b3fda9a43c3dad38feed579325f786175521b1ab55b2d7c +++ b/mp-wp/wp-admin/css/colors-classic.css false @@ -1,1358 +0,0 @@ -html { - background-color: #F5FCFD; -} - -.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; -} - -kbd, code { - background: #eaeaea; -} - -div#current-widgets, -#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 { - 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: #BBD8E7; - background-color: #fff; -} - -div.dashboard-widget-error { - background-color: #c43; -} - -div.dashboard-widget-notice { - background-color: #cfe1ef; -} - -div.dashboard-widget-submit, -ul.widget-control-list div.widget-control-actions { - border-top-color: #ccc; -} - -div.ui-tabs-panel { - border-color: #f1f1f1; -} - -ul#category-tabs li.ui-tabs-selected { - background-color: #f1f1f1; -} - -input.disabled, -textarea.disabled { - background-color: #ccc; -} -/* #upload-menu li a.upload-tab-link, */ -li.widget-list-control-item h4.widget-title a:hover, -li.widget-list-control-item h4.widget-title a, -#dragHelper li.widget-list-control-item h4.widget-title a, -#draghelper li.widget-list-control-item h4.widget-title a:visited, -.login #backtoblog a:hover, -#plugin-information .action-button a, -#plugin-information .action-button a:hover, -#plugin-information .action-button a:visited { - color: #fff; -} - -li.widget-list-control-item div.widget-control { - background-color: #fff; - border-color: #dfdfdf; -} - -.metabox-holder .postbox h3, -#poststuff .postbox h3, -#poststuff .stuffbox h3 { - background: #dfdfdf url("../images/blue-grad.svg") repeat-x left top; - text-shadow: #fff 0 1px 0; -} - -.form-table th, -.form-wrap label { - color: #222; - text-shadow: #fff 0 1px 0; -} - -.setting-description, .form-wrap p { - color: #666; -} - -select { - background-color: #fff; - border-color: #8CBDD5; -} - -strong .post-com-count span { - background-color: #21759b; -} - -ul#widget-list li.widget-list-item h4.widget-title { - background-color: #f0f0f0; - color: #000; -} - -.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; -} - -.alternate, .alt { - background-color: #EDFBFC; -} - -.available-theme a.screenshot { - background-color: #f1f1f1; - border-color: #ddd; -} - -.bar { - background-color: #e8e8e8; - border-right-color: #99d; -} - -#media-upload { - 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 { - border-color: #c00 !important; -} - -.form-table input, -.form-table textarea, -.search-input, -.form-field input, -.form-field textarea, -.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; -} - -.describe input[type="text"], -.describe textarea { - border-color: #dfdfdf; -} - -.media-upload-form label.form-help, -td.help { - color: #9a9a9a; -} - -.post-com-count { - background-image: url(../images/bubble_bg.svg); - 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, .bordertitle { - border-bottom-color: #dadada; -} - -.side-info ul, .widget-description { - color: #666; -} - -.button, -.button-secondary, -.submit input, -input[type=button], -input[type=submit] { - border-color: #8CBDD5; - color: #093E56; -} - -.button:hover, -.button-secondary:hover, -.submit input:hover, -input[type=button]:hover, -input[type=submit]:hover { - color: #000; - border-color: #21759B; -} - -.button, -.submit input, -.button-secondary { - background: #f2f2f2 url(../images/white-grad.svg) repeat-x scroll left top; -} - -.button:active, -.submit input:active, -.button-secondary:active { - background: #eee url(../images/white-grad-active.svg) repeat-x scroll left top; -} - -.button-primary, -.submit .button-primary, -#login form .submit input { - border-color: #298cba !important; - font-weight: bold; - color: #FFF !important; - background: #21759B url(../images/button-grad.svg) repeat-x scroll left top; -} - -.button-primary:active, -#login form .submit input:active { - background: #21759b url(../images/button-grad-active.svg) repeat-x scroll left top !important; -} - -.button[disabled], -.button:disabled, -.button-secondary[disabled], -.button-secondary:disabled, -a.button.disabled { - color: #ccc !important; - border-color: #ccc; -} - -.button-primary[disabled], -.button-primary:disabled { - color: #2fa0d5 !important; -} - -a:active, -a:focus { - color: #d54e21; -} - -a:hover, -#wphead #viewsite a:hover, -#adminmenu a:hover, -#adminmenu ul.wp-submenu a:hover, -#the-comment-list .comment a:hover, -#rightnow a:hover, -.subsubsub a:hover, -.subsubsub a.current:hover, -#login form .submit input:hover, -div.dashboard-widget-submit input:hover, -#media-upload a.del-link:hover, -.ui-tabs-nav a:hover { - color: #d54e21; -} - -#the-comment-list .comment-item, -#dashboard-widgets #dashboard_quick_press form p.submit { - border-color: #dfdfdf; -} - -.button-primary:hover, -#login form .submit input:hover { - border-color: #13455b !important; - color: #EAF2FA !important; -} - -#side-info-column #category-tabs .ui-tabs-selected a { - color: #333; -} - -#rightnow .rbutton { - background-color: #ebebeb; - color: #264761; -} - -.submitbox .submit { - background-color: #464646; - color: #ccc; -} - -.submitbox .submitdelete, a.delete { - color: #f00; - border-bottom-color: #f00; -} - -.submitbox .submitdelete:hover, -#media-upload 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 #login_error, -.login .message { - background-color: #ffffe0; - border-color: #e6db55; -} - -a.page-numbers { - border-bottom-color: #B8D3E2; -} - -div#available-widgets-filter, -ul#widget-list li.widget-list-item, -.commentlist li { - border-bottom-color: #ccc; -} - -.widefat td, -.widefat th { - border-bottom-color: #BBD8E7; -} - -.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/blue-grad.svg) repeat-x scroll left top; -} - -h3.dashboard-widget-title small a { - color: #d7d7d7; -} - -h3.dashboard-widget-title small a:hover { - color: #fff; -} - -#adminmenu a, -#poststuff #edButtonPreview, -#poststuff #edButtonHTML, -#the-comment-list p.comment-author strong a, -#media-upload a.del-link, -#media-upload a.delete, -.ui-tabs-nav a, a { - color: #1C6280; -} - -#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) 0px -1px 0px; - -khtml-box-shadow: rgba(0,0,0,0.2) 0px -1px 0px; - -webkit-box-shadow: rgba(0,0,0,0.2) 0px -1px 0px; - box-shadow: rgba(0,0,0,0.2) 0px -1px 0px; -} - -#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 { - background-color: #f9f9f9; - border-bottom-color: #dfdfdf; -} - -div#plugin-information-header { - background-color: #e4f2fd; - border-bottom-color: #c6d9e9; -} - -#currenttheme img { - border-color: #666; -} - -#current-widgets .drop-widget-here { - background-color: #ffc; -} - -#dashboard_secondary div.dashboard-widget-content ul li a { - background-color: #f9f9f9; -} - -input.readonly, textarea.readonly { - background-color: #ddd; -} - -#dragHelper h4.widget-title, -li.widget-list-control-item h4, -#dragHelper li.widget-list-control-item h4 { - background-color: #2683ae; - color: #fff; -} - -#ed_toolbar input, -#ed_reply_toolbar input { - background: #fff url("../images/fade-butt.svg") 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: #073447; - color: #999; -} - -#media-items { - border-color: #dfdfdf; -} - -#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; -} - -.checkbox, -.side-info { - background-color: #fff; -} - -.plugins .active { - background-color: #e7f7d3; -} - -.plugins .togl { - border-right-color: #ccc; -} - -#the-comment-list .unapproved { - background-color: #ffffe0; -} - -#the-comment-list .approve a { - color: #006505; -} - -#the-comment-list .unapprove a { - color: #d98500; -} - -#the-comment-list .delete a { - color: #bc0b0b; -} - -.plugins tr { - background-color: #fff; -} - -.metabox-holder .postbox, -#poststuff .postbox, -#titlediv, -#poststuff .postarea, -#poststuff .stuffbox, -.postbox input[type="text"], -.postbox textarea, -.stuffbox input[type="text"], -.stuffbox textarea { - border-color: #BBD8E7; -} - -.metabox-holder .postbox, -#poststuff .postbox { - background-color: #FFF; -} - -.ui-sortable .postbox h3 { - color: #093E56; -} - -.ui-sortable .postbox h3:hover { - color: #000; -} - -.curtime #timestamp { - background-image: url(../images/date-button.svg); -} - -#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.svg) no-repeat; -} - -#tagchecklist span a:hover, -#bulk-titles div a:hover { - background: url(../images/xit.svg) no-repeat -10px 0; -} - -#update-nag, .plugin-update { - background-color: #fffeeb; - border-bottom-color: #ccc; - border-top-color: #ccc; - color: #555; -} - -.login #backtoblog a { - color: #ccc; -} - -#wphead { - background-color: #073447; -} - -body.login { - border-top-color: #093E56; -} - -#wphead h1 a { - color: #fff; -} - -#login form input { - color: #555; -} - -#wphead h1 a:hover { - text-decoration: underline; -} - -#user_info { - color: #999; -} - -#user_info a:link, #user_info a:visited, #footer a:link, #footer a:visited { - color: #ccc; - text-decoration: none; -} - -#user_info a:hover, #footer a:hover { - color: #fff; - text-decoration: underline !important; -} - -#user_info a:active, #footer a:active { - color: #ccc !important; -} - -div#media-upload-error, -.file-error, -abbr.required, -.widget-control-remove:hover, -.delete a:hover { - color: #f00; -} - -#media-upload a.delete { - color: #888; -} - -/* editors */ -#quicktags { - border-color: #dfdfdf; - background-color: #dfdfdf; -} - -#ed_toolbar input { - border-color: #C3C3C3; -} - -#ed_toolbar input:hover { - border-color: #aaa; - background: #ddd; -} - -#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; -} - -#editorcontainer, -#post-status-info, -#titlediv #title { - border-color: #dfdfdf; -} - -#titlediv #title { - background-color: #fff; -} - -#tTips p#tTips_inside { - background-color: #ddd; - color: #333; -} - -#timestampdiv input, -#namediv input, -#tagsdiv #the-tagcloud { - border-color: #ddd; -} - -/* menu */ -#adminmenu * { - border-color: #BBD8E7; -} - -#adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.svg) no-repeat scroll left 5px; -} - -.folded #adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.svg) 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.svg) 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.svg) no-repeat scroll left -109px; -} - -#adminmenu a.menu-top { - background: #EAF3FA url(../images/menu-bits.svg) repeat-x scroll left -379px; -} - -#adminmenu .wp-submenu a { - background: #FFFFFF url(../images/menu-bits.svg) 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.svg) top left no-repeat !important; -} - -#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, -#adminmenu .menu-top .current { - background: #6d6d6d url(../images/menu-bits.svg) top left repeat-x; - border-color: #6d6d6d; - color: #fff; - text-shadow: rgba(0,0,0,0.4) 0px -1px 0px; -} - -#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.svg) bottom left no-repeat !important; -} - -#adminmenu li.wp-has-current-submenu ul { - border-bottom-color: #aaa; -} - -#adminmenu li.menu-top .current:hover { - border-color: #B5B5B5; -} - -#adminmenu .wp-submenu .current a.current { - background: transparent url(../images/menu-bits.svg) 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) 0px 1px 0px; -} - -#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; -} - -/* menu icons */ -#adminmenu #menu-dashboard div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -61px -33px; -} - -#adminmenu #menu-dashboard:hover div.wp-menu-image, -#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image, -#adminmenu #menu-dashboard.current div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -61px -1px; -} - -#adminmenu #menu-posts div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -272px -33px; -} - -#adminmenu #menu-posts:hover div.wp-menu-image, -#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -272px -1px; -} - -#adminmenu #menu-media div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -121px -33px; -} - -#adminmenu #menu-media:hover div.wp-menu-image, -#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -121px -1px; -} - -#adminmenu #menu-links div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -91px -33px; -} - -#adminmenu #menu-links:hover div.wp-menu-image, -#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -91px -1px; -} - -#adminmenu #menu-pages div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -151px -33px; -} - -#adminmenu #menu-pages:hover div.wp-menu-image, -#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -151px -1px; -} - -#adminmenu #menu-comments div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -31px -33px; -} - -#adminmenu #menu-comments:hover div.wp-menu-image, -#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image, -#adminmenu #menu-comments.current div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -31px -1px; -} - -#adminmenu #menu-appearance div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -1px -33px; -} - -#adminmenu #menu-appearance:hover div.wp-menu-image, -#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -1px -1px; -} - -#adminmenu #menu-plugins div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -181px -33px; -} - -#adminmenu #menu-plugins:hover div.wp-menu-image, -#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -181px -1px; -} - -#adminmenu #menu-users div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -301px -33px; -} - -#adminmenu #menu-users:hover div.wp-menu-image, -#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -301px -1px; -} - -#adminmenu #menu-tools div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -211px -33px; -} - -#adminmenu #menu-tools:hover div.wp-menu-image, -#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -211px -1px; -} - -#adminmenu #menu-settings div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -241px -33px; -} - -#adminmenu #menu-settings:hover div.wp-menu-image, -#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu-vs.svg") no-repeat scroll -241px -1px; -} -/* end menu */ - - -/* Diff */ -table.diff .diff-deletedline { - background-color: #ffdddd; -} -table.diff .diff-deletedline del { - background-color: #ff9999; -} -table.diff .diff-addedline { - background-color: #ddffdd; -} -table.diff .diff-addedline ins { - background-color: #99ff99; -} - -#att-info { - background-color: #E4F2FD; -} - -/* edit image */ -#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; -} - -/* table vim shortcuts */ -.vim-current { - background-color: #E4F2FD !important; -} - -/* Install Plugins */ -.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 editor */ -.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: #FFFFFF; - border-color: #ddd; -} - -.inline-edit-row p.submit { - background-color: #f1f1f1; -} - -.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.svg) 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.svg') 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.ui-tabs-selected a { - color: #333; -} - -#wp_editimgbtn, -#wp_delimgbtn, -#wp_editgallery, -#wp_delgallery { - border-color: #999; - background-color: #eee; -} - -#wp_editimgbtn:hover, -#wp_delimgbtn:hover, -#wp_editgallery:hover, -#wp_delgallery:hover { - border-color: #555; - background-color: #ccc; -} - -#favorite-first { - background: #797979 url(../images/fav.svg) repeat-x 0 center; - border-color: #777 !important; - border-bottom-color: #666 !important; -} - -#favorite-inside { - border-color: #797979; - background-color: #797979; -} - -#favorite-toggle { - background: transparent url(../images/fav-arrow.svg) 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; -} - -.submit input, -.button, -.button-primary, -.button-secondary, -.button-highlighted, -#postcustomstuff .submit input { - text-shadow: rgba(255,255,255,1) 0 1px 0; -} - -.button-primary, -.submit .button-primary { - text-shadow: rgba(0,0,0,0.3) 0 -1px 0; -} - -#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.svg) no-repeat -552px -5px; -} - -#icon-index { - background: transparent url(../images/icons32-vs.svg) no-repeat -137px -5px; -} - -#icon-upload { - background: transparent url(../images/icons32-vs.svg) no-repeat -251px -5px; -} - -#icon-link-manager, -#icon-link, -#icon-link-category { - background: transparent url(../images/icons32-vs.svg) no-repeat -190px -5px; -} - -#icon-edit-pages, -#icon-page { - background: transparent url(../images/icons32-vs.svg) no-repeat -312px -5px; -} - -#icon-edit-comments { - background: transparent url(../images/icons32-vs.svg) no-repeat -72px -5px; -} - -#icon-themes { - background: transparent url(../images/icons32-vs.svg) no-repeat -11px -5px; -} - -#icon-plugins { - background: transparent url(../images/icons32-vs.svg) no-repeat -370px -5px; -} - -#icon-users, -#icon-user-edit { - background: transparent url(../images/icons32-vs.svg) no-repeat -600px -5px; -} - -#icon-tools, -#icon-admin { - background: transparent url(../images/icons32-vs.svg) no-repeat -432px -5px; -} - -#icon-options-general { - background: transparent url(../images/icons32-vs.svg) no-repeat -492px -5px; -} - -.view-switch #view-switch-list { - background: transparent url(../images/list-vs.svg) no-repeat 0 0; -} - -.view-switch #view-switch-list.current { - background: transparent url(../images/list-vs.svg) no-repeat -40px 0; -} - -.view-switch #view-switch-excerpt { - background: transparent url(../images/list-vs.svg) no-repeat -20px 0; -} - -.view-switch #view-switch-excerpt.current { - background: transparent url(../images/list-vs.svg) no-repeat -60px 0; -} - -#header-logo { - background: transparent url(../images/wp-logo.svg) no-repeat scroll center center; -} diff -uNr a/mp-wp/wp-admin/css/colors-fresh-rtl.css b/mp-wp/wp-admin/css/colors-fresh-rtl.css --- a/mp-wp/wp-admin/css/colors-fresh-rtl.css 53d4d0f84efb041ba861a55895694ca0b2cce96a70f3c47c7efbd81c263f7dade7669969faf054c551198a662ebd5489d853be17ce0dbd2337228ed7c90da7ec +++ b/mp-wp/wp-admin/css/colors-fresh-rtl.css false @@ -1,83 +0,0 @@ -.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.svg); -} -.tablenav .tablenav-pages a { - background: #eee url('../images/menu-bits-rtl.svg') 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.svg) no-repeat scroll right -289px; -} - -#adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.svg) no-repeat scroll right -34px; -} - -.folded #adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.svg) 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.svg) repeat-x scroll right -207px; -} - -#adminmenu .wp-has-current-submenu ul li a.current { - background: url(../images/menu-dark-rtl.svg) 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.svg) top right repeat-x; -} - -#adminmenu li.wp-has-current-submenu ul li a { - background: url(../images/menu-dark-rtl.svg) 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.svg) 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.svg) repeat-x scroll right -109px; -} - -#adminmenu a.wp-has-submenu { - background: #f1f1f1 url(../images/menu-bits-rtl.svg) repeat-x scroll right -379px; -} - -#adminmenu .wp-submenu a { - background: #FFFFFF url(../images/menu-bits-rtl.svg) no-repeat scroll right -310px; -} - -#adminmenu li.current a, -#adminmenu .wp-submenu a:hover { - background: transparent url(../images/menu-bits-rtl.svg) no-repeat scroll right -289px; -} - -#adminmenu li.wp-has-current-submenu a.wp-has-submenu { - background: #b5b5b5 url(../images/menu-bits-rtl.svg) repeat-x scroll right top; -} - -.meta-box-sortables .postbox:hover .handlediv { - background: transparent url(../images/menu-bits-rtl.svg) no-repeat scroll right -111px; -} -#favorite-toggle { - background: transparent url(../images/fav-arrow-rtl.svg) no-repeat right -4px; -} diff -uNr a/mp-wp/wp-admin/css/colors-fresh.css b/mp-wp/wp-admin/css/colors-fresh.css --- a/mp-wp/wp-admin/css/colors-fresh.css f42d54825380efb049d4161bc4390cc607bcce5b672bbab2d0d81c06b43b19eda5cb492bf807cab5aac877ebc9b7da016a9cf31a5a709caba1c7317f43252c90 +++ b/mp-wp/wp-admin/css/colors-fresh.css false @@ -1,1358 +0,0 @@ -html { - background-color: #f9f9f9; -} - -.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; -} - -kbd, code { - background: #eaeaea; -} - -div#current-widgets, -#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 { - 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, -ul.widget-control-list div.widget-control-actions { - border-top-color: #ccc; -} - -div.ui-tabs-panel { - border-color: #f1f1f1; -} - -ul#category-tabs li.ui-tabs-selected { - background-color: #f1f1f1; -} - -input.disabled, -textarea.disabled { - background-color: #ccc; -} -/* #upload-menu li a.upload-tab-link, */ -li.widget-list-control-item h4.widget-title a:hover, -li.widget-list-control-item h4.widget-title a, -#dragHelper li.widget-list-control-item h4.widget-title a, -#draghelper li.widget-list-control-item h4.widget-title a:visited, -.login #backtoblog a:hover, -#plugin-information .action-button a, -#plugin-information .action-button a:hover, -#plugin-information .action-button a:visited { - color: #fff; -} - -li.widget-list-control-item div.widget-control { - background-color: #fff; - border-color: #dfdfdf; -} - -.metabox-holder .postbox h3, -#poststuff .postbox h3, -#poststuff .stuffbox h3 { - background: #dfdfdf url("../images/gray-grad.svg") repeat-x left top; - text-shadow: #fff 0 1px 0; -} - -.form-table th, -.form-wrap label { - color: #222; - text-shadow: #fff 0 1px 0; -} - -.setting-description, .form-wrap p { - color: #666; -} - -select { - background-color: #fff; - border-color: #ddd; -} - -strong .post-com-count span { - background-color: #21759b; -} - -ul#widget-list li.widget-list-item h4.widget-title { - background-color: #f0f0f0; - color: #000; -} - -.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 { - 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 { - border-color: #c00 !important; -} - -.form-table input, -.form-table textarea, -.search-input, -.form-field input, -.form-field textarea, -.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; -} - -.describe input[type="text"], -.describe textarea { - border-color: #dfdfdf; -} - -.media-upload-form label.form-help, -td.help { - color: #9a9a9a; -} - -.post-com-count { - background-image: url(../images/bubble_bg.svg); - 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, .bordertitle { - border-bottom-color: #dadada; -} - -.side-info ul, .widget-description { - 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.svg) repeat-x scroll left top; -} - -.button:active, -.submit input:active, -.button-secondary:active { - background: #eee url(../images/white-grad-active.svg) repeat-x scroll left top; -} - -.button-primary, -.submit .button-primary, -#login form .submit input { - border-color: #298cba !important; - font-weight: bold; - color: #FFF !important; - background: #21759B url(../images/button-grad.svg) repeat-x scroll left top; -} - -.button-primary:active, -#login form .submit input:active { - background: #21759b url(../images/button-grad-active.svg) repeat-x scroll left top !important; -} - -.button[disabled], -.button:disabled, -.button-secondary[disabled], -.button-secondary:disabled, -a.button.disabled { - color: #ccc !important; - border-color: #ccc; -} - -.button-primary[disabled], -.button-primary:disabled { - color: #2fa0d5 !important; -} - -a:active, -a:focus { - color: #d54e21; -} - -a:hover, -#wphead #viewsite a:hover, -#adminmenu a:hover, -#adminmenu ul.wp-submenu a:hover, -#the-comment-list .comment a:hover, -#rightnow a:hover, -.subsubsub a:hover, -.subsubsub a.current:hover, -#login form .submit input:hover, -div.dashboard-widget-submit input:hover, -#media-upload a.del-link:hover, -.ui-tabs-nav a:hover { - color: #d54e21; -} - -#the-comment-list .comment-item, -#dashboard-widgets #dashboard_quick_press form p.submit { - border-color: #dfdfdf; -} - -.button-primary:hover, -#login form .submit input:hover { - border-color: #13455b !important; - color: #EAF2FA !important; -} - -#side-info-column #category-tabs .ui-tabs-selected a { - color: #333; -} - -#rightnow .rbutton { - background-color: #ebebeb; - color: #264761; -} - -.submitbox .submit { - background-color: #464646; - color: #ccc; -} - -.submitbox .submitdelete, a.delete { - color: #f00; - border-bottom-color: #f00; -} - -.submitbox .submitdelete:hover, -#media-upload 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 #login_error, -.login .message { - background-color: #ffffe0; - border-color: #e6db55; -} - -a.page-numbers { - border-bottom-color: #B8D3E2; -} - -div#available-widgets-filter, -ul#widget-list li.widget-list-item, -.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.svg) repeat-x scroll left top; -} - -h3.dashboard-widget-title small a { - color: #d7d7d7; -} - -h3.dashboard-widget-title small a:hover { - color: #fff; -} - -#adminmenu a, -#poststuff #edButtonPreview, -#poststuff #edButtonHTML, -#the-comment-list p.comment-author strong a, -#media-upload a.del-link, -#media-upload a.delete, -.ui-tabs-nav a, a { - color: #21759b; -} - -#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) 0px -1px 0px; - -khtml-box-shadow: rgba(0,0,0,0.2) 0px -1px 0px; - -webkit-box-shadow: rgba(0,0,0,0.2) 0px -1px 0px; - box-shadow: rgba(0,0,0,0.2) 0px -1px 0px; -} - -#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 { - background-color: #f9f9f9; - border-bottom-color: #dfdfdf; -} - -div#plugin-information-header { - background-color: #e4f2fd; - border-bottom-color: #c6d9e9; -} - -#currenttheme img { - border-color: #666; -} - -#current-widgets .drop-widget-here { - background-color: #ffc; -} - -#dashboard_secondary div.dashboard-widget-content ul li a { - background-color: #f9f9f9; -} - -input.readonly, textarea.readonly { - background-color: #ddd; -} - -#dragHelper h4.widget-title, -li.widget-list-control-item h4, -#dragHelper li.widget-list-control-item h4 { - background-color: #2683ae; - color: #fff; -} - -#ed_toolbar input, -#ed_reply_toolbar input { - background: #fff url("../images/fade-butt.svg") repeat-x 0 -2px; -} - -#editable-post-name { - background-color: #fffbcc; -} - -#edit-slug-box strong, -.tablenav .displaying-num, -#submitted-on { - color: #777; -} - -.login #nav a { - color: #21759b !important; -} - -.login #nav a:hover { - color: #d54e21 !important; -} - -#footer, -#footer-upgrade { - background: #464646; - color: #999; -} - -#media-items { - border-color: #dfdfdf; -} - -#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; -} - -.checkbox, -.side-info { - background-color: #fff; -} - -.plugins .active { - background-color: #e7f7d3; -} - -.plugins .togl { - border-right-color: #ccc; -} - -#the-comment-list .unapproved { - background-color: #ffffe0; -} - -#the-comment-list .approve a { - color: #006505; -} - -#the-comment-list .unapprove a { - color: #d98500; -} - -#the-comment-list .delete a { - color: #bc0b0b; -} - -.plugins tr { - background-color: #fff; -} - -.metabox-holder .postbox, -#poststuff .postbox, -#titlediv, -#poststuff .postarea, -#poststuff .stuffbox, -.postbox input[type="text"], -.postbox textarea, -.stuffbox input[type="text"], -.stuffbox textarea { - border-color: #dfdfdf; -} - -.metabox-holder .postbox, -#poststuff .postbox { - background-color: #FFF; -} - -.ui-sortable .postbox h3 { - color: #464646; -} - -.ui-sortable .postbox h3:hover { - color: #000; -} - -.curtime #timestamp { - background-image: url(../images/date-button.svg); -} - -#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.svg) no-repeat; -} - -#tagchecklist span a:hover, -#bulk-titles div a:hover { - background: url(../images/xit.svg) no-repeat -10px 0; -} - -#update-nag, .plugin-update { - background-color: #fffeeb; - border-bottom-color: #ccc; - border-top-color: #ccc; - color: #555; -} - -.login #backtoblog a { - color: #ccc; -} - -#wphead { - background-color: #464646; -} - -body.login { - border-top-color: #464646; -} - -#wphead h1 a { - color: #fff; -} - -#login form input { - color: #555; -} - -#wphead h1 a:hover { - text-decoration: underline; -} - -#user_info { - color: #999; -} - -#user_info a:link, #user_info a:visited, #footer a:link, #footer a:visited { - color: #ccc; - text-decoration: none; -} - -#user_info a:hover, #footer a:hover { - color: #fff; - text-decoration: underline !important; -} - -#user_info a:active, #footer a:active { - color: #ccc !important; -} - -div#media-upload-error, -.file-error, -abbr.required, -.widget-control-remove:hover, -.delete a:hover { - color: #f00; -} - -#media-upload a.delete { - color: #888; -} - -/* editors */ -#quicktags { - border-color: #dfdfdf; - background-color: #dfdfdf; -} - -#ed_toolbar input { - border-color: #C3C3C3; -} - -#ed_toolbar input:hover { - border-color: #aaa; - background: #ddd; -} - -#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; -} - -#editorcontainer, -#post-status-info, -#titlediv #title { - border-color: #dfdfdf; -} - -#titlediv #title { - background-color: #fff; -} - -#tTips p#tTips_inside { - background-color: #ddd; - color: #333; -} - -#timestampdiv input, -#namediv input, -#tagsdiv #the-tagcloud { - border-color: #ddd; -} - -/* menu */ -#adminmenu * { - border-color: #e3e3e3; -} - -#adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.svg) no-repeat scroll left 5px; -} - -.folded #adminmenu li.wp-menu-separator { - background: transparent url(../images/menu-arrows.svg) 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.svg) 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.svg) no-repeat scroll left -109px; -} - -#adminmenu a.menu-top { - background: #f1f1f1 url(../images/menu-bits.svg) repeat-x scroll left -379px; -} - -#adminmenu .wp-submenu a { - background: #FFFFFF url(../images/menu-bits.svg) 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.svg) top left no-repeat !important; -} - -#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, -#adminmenu .menu-top .current { - background: #6d6d6d url(../images/menu-bits.svg) top left repeat-x; - border-color: #6d6d6d; - color: #fff; - text-shadow: rgba(0,0,0,0.4) 0px -1px 0px; -} - -#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.svg) bottom left no-repeat !important; -} - -#adminmenu li.wp-has-current-submenu ul { - border-bottom-color: #aaa; -} - -#adminmenu li.menu-top .current:hover { - border-color: #B5B5B5; -} - -#adminmenu .wp-submenu .current a.current { - background: transparent url(../images/menu-bits.svg) 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) 0px 1px 0px; -} - -#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; -} - -/* menu icons */ -#adminmenu #menu-dashboard div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -61px -33px; -} - -#adminmenu #menu-dashboard:hover div.wp-menu-image, -#adminmenu #menu-dashboard.wp-has-current-submenu div.wp-menu-image, -#adminmenu #menu-dashboard.current div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -61px -1px; -} - -#adminmenu #menu-posts div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -272px -33px; -} - -#adminmenu #menu-posts:hover div.wp-menu-image, -#adminmenu #menu-posts.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -272px -1px; -} - -#adminmenu #menu-media div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -121px -33px; -} - -#adminmenu #menu-media:hover div.wp-menu-image, -#adminmenu #menu-media.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -121px -1px; -} - -#adminmenu #menu-links div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -91px -33px; -} - -#adminmenu #menu-links:hover div.wp-menu-image, -#adminmenu #menu-links.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -91px -1px; -} - -#adminmenu #menu-pages div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -151px -33px; -} - -#adminmenu #menu-pages:hover div.wp-menu-image, -#adminmenu #menu-pages.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -151px -1px; -} - -#adminmenu #menu-comments div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -31px -33px; -} - -#adminmenu #menu-comments:hover div.wp-menu-image, -#adminmenu #menu-comments.wp-has-current-submenu div.wp-menu-image, -#adminmenu #menu-comments.current div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -31px -1px; -} - -#adminmenu #menu-appearance div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -1px -33px; -} - -#adminmenu #menu-appearance:hover div.wp-menu-image, -#adminmenu #menu-appearance.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -1px -1px; -} - -#adminmenu #menu-plugins div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -181px -33px; -} - -#adminmenu #menu-plugins:hover div.wp-menu-image, -#adminmenu #menu-plugins.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -181px -1px; -} - -#adminmenu #menu-users div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -301px -33px; -} - -#adminmenu #menu-users:hover div.wp-menu-image, -#adminmenu #menu-users.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -301px -1px; -} - -#adminmenu #menu-tools div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -211px -33px; -} - -#adminmenu #menu-tools:hover div.wp-menu-image, -#adminmenu #menu-tools.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -211px -1px; -} - -#adminmenu #menu-settings div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -241px -33px; -} - -#adminmenu #menu-settings:hover div.wp-menu-image, -#adminmenu #menu-settings.wp-has-current-submenu div.wp-menu-image { - background: transparent url("../images/menu.svg") no-repeat scroll -241px -1px; -} -/* end menu */ - - -/* Diff */ -table.diff .diff-deletedline { - background-color: #ffdddd; -} -table.diff .diff-deletedline del { - background-color: #ff9999; -} -table.diff .diff-addedline { - background-color: #ddffdd; -} -table.diff .diff-addedline ins { - background-color: #99ff99; -} - -#att-info { - background-color: #E4F2FD; -} - -/* edit image */ -#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; -} - -/* table vim shortcuts */ -.vim-current { - background-color: #E4F2FD !important; -} - -/* Install Plugins */ -.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 editor */ -.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: #FFFFFF; - border-color: #ddd; -} - -.inline-edit-row p.submit { - background-color: #f1f1f1; -} - -.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.svg) 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.svg') 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.ui-tabs-selected a { - color: #333; -} - -#wp_editimgbtn, -#wp_delimgbtn, -#wp_editgallery, -#wp_delgallery { - border-color: #999; - background-color: #eee; -} - -#wp_editimgbtn:hover, -#wp_delimgbtn:hover, -#wp_editgallery:hover, -#wp_delgallery:hover { - border-color: #555; - background-color: #ccc; -} - -#favorite-first { - background: #797979 url(../images/fav.svg) repeat-x left center; - border-color: #777 !important; - border-bottom-color: #666 !important; -} - -#favorite-inside { - border-color: #797979; - background-color: #797979; -} - -#favorite-toggle { - background: transparent url(../images/fav-arrow.svg) 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; -} - -.submit input, -.button, -.button-primary, -.button-secondary, -.button-highlighted, -#postcustomstuff .submit input { - text-shadow: rgba(255,255,255,1) 0 1px 0; -} - -.button-primary, -.submit .button-primary { - text-shadow: rgba(0,0,0,0.3) 0 -1px 0; -} - -#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.svg) no-repeat -552px -5px; -} - -#icon-index { - background: transparent url(../images/icons32.svg) no-repeat -137px -5px; -} - -#icon-upload { - background: transparent url(../images/icons32.svg) no-repeat -251px -5px; -} - -#icon-link-manager, -#icon-link, -#icon-link-category { - background: transparent url(../images/icons32.svg) no-repeat -190px -5px; -} - -#icon-edit-pages, -#icon-page { - background: transparent url(../images/icons32.svg) no-repeat -312px -5px; -} - -#icon-edit-comments { - background: transparent url(../images/icons32.svg) no-repeat -72px -5px; -} - -#icon-themes { - background: transparent url(../images/icons32.svg) no-repeat -11px -5px; -} - -#icon-plugins { - background: transparent url(../images/icons32.svg) no-repeat -370px -5px; -} - -#icon-users, -#icon-user-edit { - background: transparent url(../images/icons32.svg) no-repeat -600px -5px; -} - -#icon-tools, -#icon-admin { - background: transparent url(../images/icons32.svg) no-repeat -432px -5px; -} - -#icon-options-general { - background: transparent url(../images/icons32.svg) no-repeat -492px -5px; -} - -.view-switch #view-switch-list { - background: transparent url(../images/list.svg) no-repeat 0 0; -} - -.view-switch #view-switch-list.current { - background: transparent url(../images/list.svg) no-repeat -40px 0; -} - -.view-switch #view-switch-excerpt { - background: transparent url(../images/list.svg) no-repeat -20px 0; -} - -.view-switch #view-switch-excerpt.current { - background: transparent url(../images/list.svg) no-repeat -60px 0; -} - -#header-logo { - background: transparent url(../images/wp-logo.svg) no-repeat scroll center center; -} diff -uNr a/mp-wp/wp-admin/css/dashboard-rtl.css b/mp-wp/wp-admin/css/dashboard-rtl.css --- a/mp-wp/wp-admin/css/dashboard-rtl.css 5d11294fdb3f269debb35877e198d8eb016ad0feea31b34eb7e5ceeff03e0f063fccb8ac8a2f05bbe2f3679cbfae694f3e6e96131144908f0e38c953a86a3b95 +++ b/mp-wp/wp-admin/css/dashboard-rtl.css false @@ -1,93 +0,0 @@ -#dashboard-widgets-wrap .has-sidebar { - margin-right: 0; - margin-left: -51%; -} -#dashboard-widgets-wrap .has-sidebar .has-sidebar-content { - margin-right: 0; - margin-left: 51%; -} -.view-all { - right: auto; - left: 0; -} -#dashboard_right_now p.sub, #dashboard-widgets h4, #dashboard_quick_press h4, a.rsswidget, #dashboard_plugins h4, #dashboard_plugins h5, #dashboard_recent_comments .comment-meta .approve { - font-family: Tahoma, Arial; -} -#dashboard_right_now td.b { - padding-right: 0; - padding-left: 6px; - text-align: left; - font-family: Tahoma, Arial; -} -#dashboard_right_now .t { - padding-right: 0; - padding-left: 12px; -} -#dashboard_right_now .versions a { - font-family: Tahoma, Arial; -} -#dashboard_right_now a.button { - float: left; - clear: left; -} -#dashboard-widgets h3 .postbox-title-action { - right: auto; - left: 30px; -} -#the-comment-list .pingback { - padding-left: 0 !important; - padding-right: 9px !important; -} -/* Recent Comments */ -#the-comment-list .comment-item { - padding: 1em 70px 1em 10px; -} -#the-comment-list .comment-item .avatar { - float: right; - margin-left: 0; - margin-right: -60px; -} -/* Feeds */ -.rss-widget cite { - text-align: left; -} -.rss-widget span.rss-date { - font-family: Tahoma, Arial; - margin-left: 0; - margin-right: 3px; -} -/* QuickPress */ -#dashboard_quick_press h4 { - float: right; - text-align: left; -} -#dashboard_quick_press h4 label { - margin-right: 0; - margin-left: 10px; -} -#dashboard_quick_press .input-text-wrap, #dashboard_quick_press .textarea-wrap { - margin: 0 5em 1em 0; -} -#dashboard_quick_press #media-buttons { - margin: 0 5em .5em 0; - padding: 0 10px 0 0; -} -#dashboard-widgets #dashboard_quick_press form p.submit { - margin-left: 0; - margin-right: 4.6em; -} -#dashboard-widgets #dashboard_quick_press form p.submit input { - float: right; -} -#dashboard-widgets #dashboard_quick_press form p.submit #save-post { - margin: 0 10px 0 1em; -} -#dashboard-widgets #dashboard_quick_press form p.submit #publish { - float: left; -} -/* Recent Drafts */ -#dashboard_recent_drafts h4 abbr { - font-family: Tahoma, Arial; - margin-left:0; - margin-right: 3px; -} diff -uNr a/mp-wp/wp-admin/css/dashboard.css b/mp-wp/wp-admin/css/dashboard.css --- a/mp-wp/wp-admin/css/dashboard.css 7eddde7772d1e7c38d7421a20a7dbba10df2bddd98fe521be4cfe3c15af6db0b273c11a1a8426ca04c9f1a4fe3da8e3382aa6a347382b34215ed7e6d5f98d280 +++ b/mp-wp/wp-admin/css/dashboard.css 8da6bc5d353248ef901e8893e0b6f638a8919644747dfc170788e6325e29217b8d5421dd4c45be195a6f31e6f28dfda9207a38429abdc9a61c1f1d88035b5bc4 @@ -1,4 +1,4 @@ -.postbox p, .postbox ul, .postbox ol, .postbox blockquote, #wp-version-message { font-size: 11px; } +.postbox p, .postbox ul, .postbox ol, .postbox blockquote { font-size: 11px; } .edit-box { display: none; @@ -21,7 +21,7 @@ margin: 0; padding: 0; width: 99%; - color: #333; + color: #303434; } form .textarea-wrap { @@ -69,7 +69,7 @@ } div.postbox div.inside { - margin: 10px; + margin: 0 10px 10px 10px; position: relative; } @@ -88,8 +88,8 @@ } #dashboard-widgets h4 { - font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - font-size: 13px; + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; + font-size: 11px; margin: 0 0 .2em; padding: 0; } @@ -105,14 +105,6 @@ font-size: 12px; } -#dashboard_right_now p.sub { - font-style: italic; - font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - padding: 5px 10px 15px; - color: #777; - font-size: 13px; -} - #dashboard_right_now .table { background: #f9f9f9; border-top: #ececec 1px solid; @@ -138,12 +130,13 @@ #dashboard_right_now td.b { padding-right: 6px; text-align: right; - font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; font-size: 14px; } #dashboard_right_now td.b a { - font-size: 18px; + font-size: 16px; + font-weight: bold; } #dashboard_right_now td.b a:hover { @@ -151,7 +144,7 @@ } #dashboard_right_now .t { - font-size: 12px; + font-size: 11px; padding-right: 12px; padding-top: 6px; color: #777; @@ -211,7 +204,7 @@ #the-comment-list .comment-item { padding: 1em 10px 1em 70px; - border-top: 1px solid; + border-top: 1px solid #eee; } #the-comment-list .pingback { @@ -262,54 +255,6 @@ font-size: 10px; } -/* QuickPress */ - -#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; -} - /* Recent Drafts */ #dashboard_recent_drafts ul { margin: 0; diff -uNr a/mp-wp/wp-admin/css/farbtastic-rtl.css b/mp-wp/wp-admin/css/farbtastic-rtl.css --- a/mp-wp/wp-admin/css/farbtastic-rtl.css 2bf6f8e23fe295014dbbf797cc021102ecd3dc888f7d4f675c7297c9fe4606b2f226a1599e6282ae0ab5d2b6b03ba5ef26bec3a245e24ca518e20b9933020a31 +++ b/mp-wp/wp-admin/css/farbtastic-rtl.css false @@ -1,7 +0,0 @@ -.farbtastic .color, .farbtastic .overlay { - left: 0; - right: 47px; -} -.farbtastic .marker { - margin: -8px -8px 0 0; -} diff -uNr a/mp-wp/wp-admin/css/farbtastic.css b/mp-wp/wp-admin/css/farbtastic.css --- a/mp-wp/wp-admin/css/farbtastic.css 3885d052a170b8f305fe47dba1a246eb0b9aabef48e30a83891c66512435fdf6bb284f6f1f181cc4d2fb0552d7661fa23db68ef8193b54a9b9ee69dcb4b7b189 +++ b/mp-wp/wp-admin/css/farbtastic.css false @@ -1,32 +0,0 @@ -.farbtastic { - position: relative; -} -.farbtastic * { - position: absolute; - cursor: crosshair; -} -.farbtastic, .farbtastic .wheel { - width: 195px; - height: 195px; -} -.farbtastic .color, .farbtastic .overlay { - top: 47px; - left: 47px; - width: 101px; - height: 101px; -} -.farbtastic .wheel { - background: url(../images/wheel.svg) no-repeat; - width: 195px; - height: 195px; -} -.farbtastic .overlay { - background: url(../images/mask.svg) no-repeat; -} -.farbtastic .marker { - width: 17px; - height: 17px; - margin: -8px 0 0 -8px; - overflow: hidden; - background: url(../images/marker.svg) no-repeat; -} diff -uNr a/mp-wp/wp-admin/css/global-rtl.css b/mp-wp/wp-admin/css/global-rtl.css --- a/mp-wp/wp-admin/css/global-rtl.css 09d014c1b926f87f579ff15fb1610c2d1cc2ebed87c76a42d99f8c4a7078b3a680f079173bee90c68f76a5c66c12ee2af8f588c56e7f608f8046848e9d3fe460 +++ b/mp-wp/wp-admin/css/global-rtl.css false @@ -1,74 +0,0 @@ -/* 2 column liquid layout */ -#adminmenu { - float: right; - clear: right; - margin-right:-160px; - margin-left: 5px; -} -div.folded #adminmenu { - margin-left: 0; - margin-right: -45px; -} -/* inner 2 column liquid layout */ -.inner-sidebar { - float: left; - clear: left; -} -.has-sidebar { - float: right; - clear: right; - margin-right: 0; - margin-left: -340px; -} -.has-sidebar .has-sidebar-content { - margin-right: 0; - margin-left: 305px; -} -#wpbody { - margin-left:0; - margin-right: 175px; -} -.folded #wpbody { - margin-left: 0; - margin-right: 60px; -} -#wpbody-content { - float: right; -} -/* 2 columns main area */ -#col-right { - float: left; - clear: left; -} -.wrap { - margin: 0 5px 0 15px; -} -/* styles for use by people extending the WordPress interface */ -body, td, textarea, input, select { - font-family: Tahoma, arial; -} -.alignleft { - float: right; -} -.alignright { - float: left; -} -.subsubsub { - float: right; -} -.widefat th { - text-align: right; -} -.widefat th input { - margin: 0 8px 0 0; -} -.wrap h2 { - font-family: arial; - padding: 14px 0 3px 15px; -} -.wrap h2.long-header { - padding-left: 0; -} -.updated, .error { - clear: both; -} diff -uNr a/mp-wp/wp-admin/css/global.css b/mp-wp/wp-admin/css/global.css --- a/mp-wp/wp-admin/css/global.css ab8bc61ed9622a262135a0d980cf00dd63d174976649d82e55557d5c1aeb39e72f13104e97170eddfebdca1f0ae7f661f614a207f629ee51365838cc4abaec6b +++ b/mp-wp/wp-admin/css/global.css ad11969a6ce4d1b04a5d746ef26b2d4d79726f46f19c50ab69cc79ddeb6689a4046982053c18033c4bde7daa0c2f26b62ce3e338f8db93d8a3c2842d9968af93 @@ -1,25 +1,10 @@ -/* http://meyerweb.com/eric/tools/css/reset/ */ -/* v1.0 | 20080212 */ - -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; -/* font-size: 100%; - vertical-align: baseline; */ - background: transparent; } body { line-height: 1; + box-sizing: border-box; } ol, ul { list-style: none; @@ -33,12 +18,6 @@ content: none; } -/* remember to define focus styles! */ -/* -:focus { - outline: 0; -} -*/ /* remember to highlight inserts somehow! */ ins { text-decoration: none; @@ -47,16 +26,6 @@ text-decoration: line-through; } -/* tables still need 'cellspacing="0"' in the markup */ -/* -table { - border-collapse: collapse; - border-spacing: 0; -} -*/ -/* end reset css */ - - /* 2 column liquid layout */ #wpwrap { height: auto; @@ -66,16 +35,13 @@ #wpcontent { height: 100%; - padding-bottom: 50px; } #wpbody { clear: both; - margin-left: 175px; -} - -.folded #wpbody { - margin-left: 60px; + margin-left: 155px; + background: #f5f6f7; + box-shadow: inset 2px 0 10px 0 rgba(0,0,0,0.05); } #wpbody-content { @@ -90,27 +56,12 @@ margin-top: 15px; margin-right: 5px; margin-bottom: 15px; - margin-left: -160px; + margin-left: -150px; 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 2 column liquid layout */ .inner-sidebar { @@ -177,8 +128,7 @@ } .hidden, -.closed .inside, -.hide-if-no-js { +.closed .inside { display: none; } @@ -281,6 +231,83 @@ margin: 2.33em 0; } +/* BUTTONS */ +.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: #999; +} + +.button, +.submit input, +.button-secondary { + background: #f2f2f2 linear-gradient(#fff, #e8e8e8); + box-shadow: 0 1px 0 0 #fff; +} + +.button:active, +.submit input:active, +.button-secondary:active { + background: #eee; +} + +.button-primary, +.submit .button-primary, +#login form .submit input, +input[type=button].button-primary, +input[type=submit].button-primary { + border-color: #004980; + font-weight: bold; + color: #fff; + background: linear-gradient(#1199c9, #0676c9); + box-shadow: 0 1px 0 0 #fff; +} + +.button-primary:hover, +.submit .button-primary:hover, +#login form .submit input:hover, +input[type=button].button-primary:hover, +input[type=submit].button-primary:hover { + border-color: #00355b; + box-shadow: 0 3px 15px 0 rgba(0,0,0,0.1); +} + +.button-primary:active, +#login form .submit input:active, +input[type=button].button-primary:active, +input[type=submit].button-primary:active { + background: #006cbc; +} + +.button[disabled], +.button:disabled, +.button-secondary[disabled], +.button-secondary:disabled, +a.button.disabled { + color: #ccc; + border-color: #ccc; +} + +.button-primary[disabled], +.button-primary:disabled { + color: #2fa0d5; +} + +/* END BUTTONS */ + + .subsubsub { list-style: none; margin: 8px 0 5px; @@ -314,17 +341,16 @@ } .widefat { - border-width: 1px; - border-style: solid; + border: none; border-collapse: separate; border-spacing: 0; width: 100%; clear: both; - margin: 0; + margin: 10px 0 0 0; -moz-border-radius: 4px; - -khtml-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; + background: #fff; } .widefat * { @@ -337,12 +363,18 @@ .widefat td, .widefat th { - border-bottom-width: 1px; - border-bottom-style: solid; + border-bottom: 1px solid #ebebeb; font-size: 11px; vertical-align: text-top; } +.widefat th { + background: #d7dbdb; + padding: 7px 7px 5px; + text-align: left; + border-bottom: 1px solid #babdbe; +} + .widefat td { padding: 7px 7px 5px; vertical-align: top; @@ -351,43 +383,22 @@ .widefat thead tr th:first { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; - -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; } .widefat thead tr th:last { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; - -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.widefat tfoot tr th:first { - -moz-border-radius-bottomleft: 4px; - -webkit-border-bottom-left-radius: 4px; - -khtml-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; -} - -.widefat tfoot tr th:last { - -moz-border-radius-bottomright: 4px; - -webkit-border-bottom-right-radius: 4px; - -khtml-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; -} - .widefat td p { font-size: 11px; } -.widefat th { - padding: 7px 7px 8px; - text-align: left; - line-height: 1.3em; -} - -.widefat th input { - margin: 0 0 0 8px; +.widefat th input, +.widefat .check-column input { + margin: 3px 0 0 8px; padding: 0; vertical-align: text-top; } @@ -398,7 +409,7 @@ } -.widefat tbody th.check-column { +.widefat tbody .check-column { padding: 7px 0 22px; } @@ -415,19 +426,18 @@ } .wrap { - margin: 0 15px 0 5px; + margin: 0 15px; } .updated, .error { - border-width: 1px; - border-style: solid; + border: 1px solid #e6db55; + background: rgb(255, 251, 204); padding: 0 0.6em; margin: 5px 15px 2px; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; } .updated p, @@ -443,11 +453,12 @@ } .wrap h2 { - font: italic normal normal 24px/29px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; + font-size: 24px; + font-weight: bold; margin: 0; - padding: 14px 15px 3px 0; + padding: 8px 15px 3px 0; line-height: 35px; - text-shadow: rgba(255,255,255,1) 0px 1px 0px; } .wrap h2.long-header { diff -uNr a/mp-wp/wp-admin/css/ie-rtl.css b/mp-wp/wp-admin/css/ie-rtl.css --- a/mp-wp/wp-admin/css/ie-rtl.css da639339b917854c07f8af9db49d428ac9efb9407ceba879719450b0d41be7849dfce75fed7a9b984c246c10a07adca1be34083dc91c1645f7fc2db74d14a1c5 +++ b/mp-wp/wp-admin/css/ie-rtl.css false @@ -1,91 +0,0 @@ -* html #wpcontent #adminmenu .wp-has-submenu .wp-menu-toggle { - background: url(../images/menu-bits-rtl.svg) no-repeat scroll right -109px; -} - -* html #wpcontent #adminmenu li.wp-has-current-submenu .wp-menu-toggle { - background: url(../images/menu-bits-rtl.svg) no-repeat scroll right -206px; -} -* html #adminmenu { - margin-left:0; - margin-right: -80px; -} -* html div.folded #adminmenu { - margin-left: 0; - margin-right: -22px; -} -#wpcontent #adminmenu .wp-submenu li.wp-submenu-head { - padding: 3px 10px 4px 4px; -} -.inline-edit-row fieldset label span.title { - float: right; -} -.inline-edit-row fieldset label span.input-text-wrap { - margin-right: 0; -} -p.search-box { - float: left; -} -* html #poststuff h2 { - margin-right: 0; -} -#bh { - margin: 7px 10px 0 0; - float: left; -} -#user_info + div#favorite-actions { - right: auto; - left: 15px; -} -#wphead-info { - float: left; -} -/* without this dashboard widgets appear in one column for some screen widths */ -div#dashboard-widgets { - padding-right: 0; - padding-left: 1px; -} -#tagchecklist span a { - margin: 4px -9px 0 0; -} -.widefat th input { - margin: 0 5px 0 0; -} -/* ---------- add by navid */ -#TB_window { - width: 670px; - position: absolute; - top: 50%; - left: 50%; - margin-right: 335px !important; -} -#dashboard_plugins { - direction: ltr; -} -#dashboard_plugins h3.hndle { - direction: rtl; -} -#dashboard_incoming_links ul li, -#dashboard_secondary ul li, -#dashboard_primary ul li, -p.row-actions { - width: 100%; -} -#favorite-inside { - position: absolute; - right:0; -} -#post-status-info { - height: 25px; -} -#screen-meta { - position: static; -} -p.submit { /* quick edit and reply in edit-comments.php */ - height:22px; -} -.inner-sidebar { /* fix edit single comment */ - position: static; -} -form#widgets-filter { /* fix widget page */ - position: static; -} diff -uNr a/mp-wp/wp-admin/css/ie.css b/mp-wp/wp-admin/css/ie.css --- a/mp-wp/wp-admin/css/ie.css 3ece7e10f20be0bc3dc6c9dae1dc4fc625b52326d2ffe0bd7c0d0eafd27c674f4098d4f295a52f3102db8c6b2c7c63d3b67c1c0ba8fffb063c8c3bb848d8365b +++ b/mp-wp/wp-admin/css/ie.css false @@ -1,343 +0,0 @@ -/* Fixes for IE bugs */ - -input.button, -input.button-secondary, -input.button-highlighted { - padding: 0; -} - -#minor-publishing-actions input, -#major-publishing-actions input, -#minor-publishing-actions .preview { - min-width: auto; - padding-left: 0; - padding-right: 0; -} - -#wpbody-content .postbox { - border: 1px solid #dfdfdf; -} - -#wpbody-content .postbox h3 { - margin-bottom: -1px; -} - -* html #side-info-column { - height: auto; -} - -* 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 body.minwidth { - _width: expression(document.documentElement.clientWidth < 810 ? "808px" : "99.9%"); -} - -* html #wpbody { - _width: expression(document.documentElement.clientWidth > 982 ? "980px" : "99.9%"); -} -*/ - -* html #adminmenu { - margin-left: -80px; -} - -* html div.folded #adminmenu { - margin-left: -22px; -} - -* html #wpcontent #adminmenu li.menu-top { - display: inline; - padding: 0; - margin: 0; -} - -#wpcontent.folded #adminmenu li.menu-top { - display: block; -} - -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.svg) no-repeat scroll left -109px; -} - -* html #wpcontent #adminmenu li.wp-has-current-submenu .wp-menu-toggle { - background: url(../images/menu-bits.svg) no-repeat scroll left -206px; -} - -* html #adminmenu div.wp-menu-image { - height: 29px; -} - -#wpcontent #adminmenu .wp-submenu li { - padding: 0; -} - -#adminmenu, -.wp-submenu, -.wp-submenu li, -.wp-menu-toggle { - zoom: 100%; -} - -#wpcontent.folded #adminmenu li.wp-menu-separator { - width: 28px; -} - -#wpcontent #adminmenu .wp-submenu li.wp-submenu-head { - padding: 3px 4px 4px 10px; - zoom: 100%; -} - -#wpcontent.folded #adminmenu .menu-top { - height: 30px; -} - -.folded #adminmenu .wp-submenu { - margin: -1px 0 0 0; -} - -#template, -#template div, -#editcat, -#addcat { - zoom: 100%; -} - -.submitbox { - margin-top: 10px; -} - -/* Inline Editor */ -#wpbody-content .quick-edit-row-post .inline-edit-col-left { - width: 39%; -} - -#wpbody-content .inline-edit-row-post .inline-edit-col-center { - width: 19%; -} - -#wpbody-content .quick-edit-row-page .inline-edit-col-left { - width: 49%; -} - -#wpbody-content .bulk-edit-row .inline-edit-col-left { - width: 29%; -} - -.inline-edit-row p.submit { - zoom: 100%; -} - -.inline-edit-row fieldset label span.title { - display: block; - float: left; - width: 5em; -} - -.inline-edit-row fieldset label span.input-text-wrap { - margin-left: 0; - zoom: 100%; -} - -#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input { - line-height: 130%; -} - -#wpbody-content .inline-edit-row .input-text-wrap input { - width: 95%; -} - -#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input { - width: 8em; -} -/* end Inline Editor */ - -* html .row-actions { - visibility: visible; -} - -#dashboard-widgets h3 a { - height: 20px; - line-height: 20px; -} - -#the-comment-list .comment-item, -ul#widget-list li.widget-list-item { - zoom: 100%; -} - -#wphead-info { - float: right; -} - -#titlediv #title { - width: 98%; -} - -a.button { - line-height: 1.4em; - margin: 1px; -} - -* html div.widget-liquid-left-holder, -* 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%; -} - -#post-status-info, -#wpwrap, -#wpcontent, -#post, -#wrap, -#postdiv, -#poststuff, -.metabox-holder, -#titlediv, -#post-body, -#editorcontainer, -.tablenav, -.widget-control-list, -li.widget-list-control-item, -#dragHelper, -li.widget-list-control-item h4, -.widget-sortable, -.widget-control-actions, -#tagchecklist, -#col-container, -#col-left, -#col-right { - 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 { - overflow: visible; - padding: 0 4px; -} - -#poststuff h2 { - font-size: 1.6em; -} - -* html #poststuff h2 { - margin-left: 0; -} - -#bh { - margin: 7px 10px 0 0; - float: right; -} - -/* without this dashboard widgets appear in one column for some screen widths */ -div#dashboard-widgets { - padding-right: 1px; -} - -#tagchecklist span, #tagchecklist span a { - display: inline-block; - display: block; -} - -#tagchecklist span a { - margin: 4px 0 0 -9px; -} - -.tablenav .button-secondary, .nav .button-secondary { - padding: 0 1px; - vertical-align: middle; -} - -.tablenav select { - font-size: 13px; - display: inline-block; - vertical-align: top; - margin-top: 2px; -} - -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; -} - -.tablenav a.button-secondary { - display: inline-block; - padding: 2px 5px; -} diff -uNr a/mp-wp/wp-admin/css/install-rtl.css b/mp-wp/wp-admin/css/install-rtl.css --- a/mp-wp/wp-admin/css/install-rtl.css 5c585c14f0c2ea87ed1ecefabbfafdcd94d30af1d2f4c60c0d1028da88439b9c743c66f93b1ae0581b4f78163e680d5cecf1f54074787b7ce4ae7c191e871f18 +++ b/mp-wp/wp-admin/css/install-rtl.css false @@ -1,16 +0,0 @@ -body { - font-family: Tahoma, arial; -} -h1 { - font-family: arial; - margin: 5px -4px 0 0; -} -ul, ol { padding: 5px 22px 5px 5px; } -.step, th { text-align: right; } -.submit input, .button, .button-secondary { - font-family: Tahoma, arial; - margin-right:0; -} -.form-table th { - text-align: right; -} diff -uNr a/mp-wp/wp-admin/css/install.css b/mp-wp/wp-admin/css/install.css --- a/mp-wp/wp-admin/css/install.css 3a2ff837f6a13ee750a33de77e1aee9fec09035c160ddbac6bbf81a2a56dba4dae07917a32e9a9ae3a06f384b3d9eaf7d1cb2253ea764b73bedfe0808219eef1 +++ b/mp-wp/wp-admin/css/install.css c884356307fe7085683e3b096d54af451799023294a9b72d29baec052c3dc0877283e52b2d7c29153189a496e4ac33ab7311cb45b200d506aa7f952f61a674fd @@ -2,13 +2,12 @@ body { background: #fff; - color: #333; + color: #303434; font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; margin: 2em auto 0 auto; width: 700px; padding: 1em 2em; -moz-border-radius: 11px; - -khtml-border-radius: 11px; -webkit-border-radius: 11px; border-radius: 11px; border: 1px solid #dfdfdf; @@ -58,12 +57,10 @@ 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; } @@ -73,11 +70,11 @@ } .button, .submit input, .button-secondary { - background: #f2f2f2 url(../images/white-grad.svg) repeat-x scroll left top; + background: #f2f2f2; } .button:active, .submit input:active, .button-secondary:active { - background: #eee url(../images/white-grad-active.svg) repeat-x scroll left top; + background: #eee; } .form-table { diff -uNr a/mp-wp/wp-admin/css/login-rtl.css b/mp-wp/wp-admin/css/login-rtl.css --- a/mp-wp/wp-admin/css/login-rtl.css fe30aa78b15cca883b16f976d0ac0082d27b4476faaa9e2a564a846b5e74ee4a2c6845f34d0d6fc356a9a5b8572cb41d0d41df4646adbbdfd70dc6b8c21c7ae1 +++ b/mp-wp/wp-admin/css/login-rtl.css false @@ -1,30 +0,0 @@ -body { - font-family: Tahoma, arial; -} -form { - margin-right: 8px; - margin-left: 0; -} -form .forgetmenot { - float: right; -} -#login form .submit input { - font-family: Tahoma, arial; -} -form .submit { float: left; } -#backtoblog a { - left: auto; - right: 15px; -} -#login_error, .message { - margin: 0 8px 16px 0; -} -#nav { margin: 0 8px 0 0; } -#user_pass, #user_login, #user_email { - margin-left: 6px; - margin-right: 0; - direction:ltr; -} -h1 a { - text-decoration: none; -} diff -uNr a/mp-wp/wp-admin/css/login.css b/mp-wp/wp-admin/css/login.css --- a/mp-wp/wp-admin/css/login.css 587df820eb42311f2042de9e7218327dfe4cfc7b655bfebf5cb88db6d1840906c944455ff114a88f7ea69769b7f60df9a289d47197516b9128f5acf5b6f43400 +++ b/mp-wp/wp-admin/css/login.css 8fa4fe366ba593b79e09bcb375647106703d0483efe12c1bc600130b70633ff1a31db6d563429d61dda24d5a8fd9d0df999726f3175e0bfb8b0b43314d4cdc23 @@ -11,14 +11,12 @@ padding: 16px 16px 40px 16px; font-weight: normal; -moz-border-radius: 11px; - -khtml-border-radius: 11px; -webkit-border-radius: 11px; - border-radius: 5px; + border-radius: 4px; 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; } @@ -26,19 +24,33 @@ #login form .submit input { font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - padding: 3px 10px; - border: none; - font-size: 12px; + text-decoration: none; + font-size: 11px; + 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; - cursor: pointer; - text-decoration: none; - margin-top: -3px; - text-shadow: rgba(0,0,0,0.3) 0 -1px 0; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; +} + +.button-primary { + border-color: #004980; + font-weight: bold; + color: #fff; + background: linear-gradient(#1199c9, #0676c9); + box-shadow: 0 1px 0 0 #fff; +} + +.button-primary:hover { + border-color: #00355b; + box-shadow: 0 3px 15px 0 rgba(0,0,0,0.1); +} + +.button-primary:active { + background: #006cbc; } #login form p { @@ -59,18 +71,10 @@ form p { margin-bottom: 24px; } -h1 a { - background: url(../images/logo-login.svg) no-repeat top center; +h1 { 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; + text-align: center; } #backtoblog a { @@ -78,19 +82,19 @@ top: 7px; left: 15px; text-decoration: none; + color: #fff; } #login { width: 320px; margin: 7em auto; } #login_error, .message { margin: 0 0 16px 8px; - border-width: 1px; - border-style: solid; + border: 1px solid #e6db55; + background: rgb(255, 251, 204); padding: 12px; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; } #nav { margin: 0 0 0 8px; padding: 16px; } diff -uNr a/mp-wp/wp-admin/css/media-rtl.css b/mp-wp/wp-admin/css/media-rtl.css --- a/mp-wp/wp-admin/css/media-rtl.css 706c8cfd052de05246f11d5a5b55da423f15e6270c5f6b1c5008b01bb8672e32bad1068faafe1d2146e68f70a40c29d581f35d2059d4be0a3943397f998b26ae +++ b/mp-wp/wp-admin/css/media-rtl.css false @@ -1,93 +0,0 @@ -body#media-upload ul#sidemenu { - left: auto; - right: 0; -} -#search-filter { - text-align: left; -} -/* specific to the image upload form */ -.align .field label { - padding: 0 28px 0 0; - margin: 0 0 0 1em; -} -.image-align-none-label, .image-align-left-label, .image-align-center-label, .image-align-right-label { - background-position: center right; -} -tr.image-size div.image-size-item { - float: right; -} -tr.image-size label { - margin: 0 1em 0 0; -} -.filename.original { - float: right; -} -.crunching { - text-align: left; - margin-right: 0; - margin-left: 5px; -} -button.dismiss { - right: auto; - left: 5px; -} -.file-error { - margin: 0 50px 5px 0; -} -.progress { - left: auto; - right: 0; -} -.describe td { - padding: 0 0 0 5px; -} -.bar { - border-right-width: 0; - border-left-width: 3px; - border-right-style: none; - border-left-style: solid; -} -.media-item .pinkynail { - float: right; -} -.describe-toggle-on, -.describe-toggle-off { - float: left; - margin-right: 0; - margin-left: 20px; -} -/* Specific to Uploader */ -#media-upload .media-upload-form p { - margin: 0 0 1em 1em; -} -.filename { - float: right; - margin-left: 0; - margin-right: 10px; -} -#media-upload .describe th.label { - text-align: right; -} -.menu_order { - float: left; -} -.media-upload-form label.form-help, td.help, #media-upload p.help, #media-upload label.help { - font-family: Tahoma, Arial; -} -#gallery-settings #basic th.label { - padding: 5px 0 5px 5px; -} -#gallery-settings .title, h3.media-title { - font-family: Tahoma, Arial; -} -#gallery-settings .describe th.label { - text-align: right; -} -#gallery-settings label, -#gallery-settings legend { - margin-right: 0; - margin-left: 15px; -} -#gallery-settings .align .field label { - margin: 0 0 0 1.5em; -} diff -uNr a/mp-wp/wp-admin/css/media.css b/mp-wp/wp-admin/css/media.css --- a/mp-wp/wp-admin/css/media.css a6d228df4415a1ddee08a386825b0ff1a6875344c256010653f38665bc6375eaa98269880cff0d285126695c89459ffcafb89b092ed8580674c5e61a3d5c648d +++ b/mp-wp/wp-admin/css/media.css 38b490fd39db8d4a11500dfd796cd7c10e391d9b9676977c64b523656d9babf40cd17fe123edf4c238915af48f3cf1c7ac509f0b05c0c969918bd12a23762f62 @@ -68,22 +68,6 @@ margin: 0 1em 0 0; } -.image-align-none-label { - background: url(../images/align-none.svg) no-repeat center left; -} - -.image-align-left-label { - background: url(../images/align-left.svg) no-repeat center left; -} - -.image-align-center-label { - background: url(../images/align-center.svg) no-repeat center left; -} - -.image-align-right-label { - background: url(../images/align-right.svg) no-repeat center left; -} - tr.image-size td { width: 460px; } diff -uNr a/mp-wp/wp-admin/css/plugin-install-rtl.css b/mp-wp/wp-admin/css/plugin-install-rtl.css --- a/mp-wp/wp-admin/css/plugin-install-rtl.css e41b4dec130277f1105cacf9669cd3208b49d45809aa990737388768a85a4fe83482512fc78cec16f3cc222f29c7a3f367469c25cfc2bfd5098597070bd91391 +++ b/mp-wp/wp-admin/css/plugin-install-rtl.css false @@ -1,43 +0,0 @@ -div.star { - left: auto; - right: 0; - letter-spacing: 0; -} -.star img, div.star a, div.star a:hover, div.star a:visited { - right: auto; - left: 0; -} -#plugin-information ul#sidemenu { - left: auto; - right: 0; -} -#plugin-information h2 { - margin-right: 0; - margin-left: 200px; -} -#plugin-information .fyi { - margin-left: 5px; - margin-right: 20px; -} -#plugin-information .fyi h2 { - margin-left: 0; -} -#plugin-information .fyi ul { - padding: 10px 7px 10px 5px; -} -#plugin-information #section-screenshots li p { - padding-left: 0; - padding-right: 20px; -} -#plugin-information .updated, -#plugin-information pre { - margin-right: 0; - margin-left: 215px; -} -#plugin-information .updated, #plugin-information .error { - clear: none; - direction: rtl; -} -#section-description { - direction: ltr; -} diff -uNr a/mp-wp/wp-admin/css/plugin-install.css b/mp-wp/wp-admin/css/plugin-install.css --- a/mp-wp/wp-admin/css/plugin-install.css 71b90176bf4774f8f41e8c6a3e771d4aaa2b2250665e8eb702e33792f1ec90843696ae39b33eddc0233a52368d38dcf3943b68555fbcef151f97c1b980a3ca7c +++ b/mp-wp/wp-admin/css/plugin-install.css false @@ -1,149 +0,0 @@ -/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */ -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; -} - -/* Start custom CSS */ -/* Header on thickbox */ -#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; -} - -/* Install sidemenu */ -#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-top-bottom-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-left: 10px; - margin-bottom: 50px; - width: 210px; -} - -#plugin-information .fyi h2 { - font-size: 0.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-top-bottom-radius: 3px; -} - -#plugin-information .fyi li { - margin-right: 0; -} - -#plugin-information #section-holder { - padding: 10px; -} - -#plugin-information .section ul, -#plugin-information .section ol { - margin-left: 16px; - list-style-type: square; - list-style-image: none; -} - -#plugin-information #section-screenshots li img { - vertical-align: text-top; -} - -#plugin-information #section-screenshots li p { - font-style: italic; - padding-left: 20px; - padding-bottom: 2em; -} - -#plugin-information .updated, -#plugin-information pre { - margin-right: 215px; -} - -#plugin-information pre { - padding: 7px; -} \ No newline at end of file diff -uNr a/mp-wp/wp-admin/css/theme-editor-rtl.css b/mp-wp/wp-admin/css/theme-editor-rtl.css --- a/mp-wp/wp-admin/css/theme-editor-rtl.css 713c562e77f6cec28cadcabfd626cb6972f66274bbc4ef99ec1252e1aa949026da1c893c51dc4c2b3eec99847bb8d488243a90008b6eb4325f868a721127c06a +++ b/mp-wp/wp-admin/css/theme-editor-rtl.css false @@ -1,12 +0,0 @@ -#templateside { - float: left; -} -#themeselector { - padding-right: 0; - padding-left: 5px; - float: left; -} -div.tablenav { - margin-right: 0; - margin-left: 210px; -} diff -uNr a/mp-wp/wp-admin/css/theme-editor.css b/mp-wp/wp-admin/css/theme-editor.css --- a/mp-wp/wp-admin/css/theme-editor.css 706a65caed9197a30da7516cb77768a99b76dd9a1a194941cc95a9918454836b5cedd8181d0e281738118eb2f7342d568589437b653a560ac290aa1c29191ec9 +++ b/mp-wp/wp-admin/css/theme-editor.css false @@ -1,66 +0,0 @@ -#template textarea { - font-family: Consolas, Monaco, Courier, monospace; - font-size: 12px; - width: 97%; -} - -#template p { - width: 97%; -} - -#templateside { - float: right; - width: 190px; -} - -#templateside h3, #postcustomstuff p.submit { - margin: 0; -} - -h3#bordertitle { - margin-bottom: 10px; -} - -#templateside h4 { - margin-bottom: 0; -} - -#templateside ol, #templateside ul { - list-style: none; - margin: .5em; - padding: 0; -} - -#templateside ol li, #templateside ul li { - margin: 1px 0; -} - -#themeselector { - padding-right: 5px; - float: right; - position: relative; - bottom: 25px; - top:20px; -} - -#themeselector select { - margin: 0; - padding: 0; -} - -.nonessential { - font-size: small; -} - -.highlight { - padding: 1px; -} - -div.bordertitle h2 { - border: none; - padding-bottom: 0; -} - -div.tablenav { - margin-right: 210px; -} diff -uNr a/mp-wp/wp-admin/css/widgets-rtl.css b/mp-wp/wp-admin/css/widgets-rtl.css --- a/mp-wp/wp-admin/css/widgets-rtl.css bc3af16194eebd59242e3e9f90e8b4d8792e051a36faf273095f861a132c3586040fb3b383cfe0a8aa5796c4bad49dee942c77929dd58391f232598ed8d6c315 +++ b/mp-wp/wp-admin/css/widgets-rtl.css false @@ -1,27 +0,0 @@ -h4.widget-title span { - float: right; -} -h4.widget-title a { - float: left; - margin-left: 0; - margin-right: 1em; -} -ul#widget-list li.widget-list-item h4.widget-title { - 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; -} -li.widget-list-control-item h4.widget-title a, -#dragHelper li.widget-list-control-item h4.widget-title a, -#draghelper li.widget-list-control-item h4.widget-title a:visited { - right: auto; - left: 1em; -} diff -uNr a/mp-wp/wp-admin/css/widgets.css b/mp-wp/wp-admin/css/widgets.css --- a/mp-wp/wp-admin/css/widgets.css be6966c8cca6095f5544d2b04b153bb0b5764b6dbba2764ec3d941d6884c5a183ae59535815c9fe14d39859bed3d4e55b3082ffbeb5b39bf3337244e2b595bff +++ b/mp-wp/wp-admin/css/widgets.css 0e2494b546e842f858a44d0175d04fccdb967b3ff4c2b1f6d2ad54da1b107eb46627a491afb0aa13829b25f218948fe06580672b53e7f6da779e9d31671f500d @@ -60,7 +60,6 @@ float: left; font-size: 13px; -moz-border-radius: 3px; - -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } @@ -100,7 +99,6 @@ li.widget-list-control-item { margin: 1em 0; -moz-border-radius: 3px; - -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } @@ -114,7 +112,6 @@ padding: 0.4em 0.8em; position: relative; -moz-border-radius: 3px; - -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } diff -uNr a/mp-wp/wp-admin/css/wp-admin.css b/mp-wp/wp-admin/css/wp-admin.css --- a/mp-wp/wp-admin/css/wp-admin.css false +++ b/mp-wp/wp-admin/css/wp-admin.css a01fb7c35645965388bcbcae02eda7baa152ff84680a3770d5169e3754a15f712ee366b367b5e74fe959ddb1af79bd614696d4d52b21df6e7ce6c99c3a9e52fb @@ -0,0 +1,2213 @@ + +p, ul, ol, blockquote { font-size: 12px; } + +a { + color: #006cbc; +} + +a:hover { + color: #d54e21; +} + +input[type=text], textarea { + border: 1px solid #d7dbdb; +} + +input[type=text]:focus, +textarea:focus { + border: 1px solid #2898dd; +} + +.plugins .name, +#pass-strength-result.strong, +#pass-strength-result.short, +.button-highlighted, +#ed_reply_toolbar #ed_reply_strong { + font-weight: bold; +} + +.plugins p { + margin: 0 4px; + padding: 0; +} + +.plugins .togl { + width: 150px; +} + +.import-system { + font-size: 16px; +} + +.anchors { + margin: 10px 20px 10px 20px; +} + +table#availablethemes { + border-spacing: 0; + border: 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: 1px solid #ddd; +} + +table#availablethemes td.right, +table#availablethemes td.left { + border-right: 0 none; + border-left: 0 none; +} + +table#availablethemes td.bottom { + border-bottom: 0 none; +} + +#wphead { + background: #303434; +} + +#wphead h1 a { + color: #ccc; +} + +#wphead h1 a:hover { + color: #fff; +} + +#user_info { + color: #999; +} + +#user_info a:link, #user_info a:visited { + color: #ccc; + text-decoration: none; +} + +#user_info a:hover { + color: #fff; + text-decoration: underline; +} + +#user_info a:active { + color: #ccc; +} + +.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 .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; +} + +.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; +} + +.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; + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; +} + +form p.submit a.cancel:hover { + text-decoration: none; +} + +#submitdiv h3, +#pagesubmitdiv h3 { + margin-bottom: 0 !important; +} + +#misc-publishing-actions { + padding: 6px 0 16px 0; +} + +.misc-pub-section { + padding: 6px; + border-bottom: 1px solid #d7dbdb; +} + +.misc-pub-section-last { + border-bottom: 0 none; +} + +#minor-publishing-actions { + padding: 6px; + text-align: right; +} + +#minor-publishing { + border-bottom: 1px solid #d7dbdb; +} + +#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; +} + +#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; +} + +.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, +.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; + line-height: 16px; + padding: 2px 8px; + cursor: pointer; + border-width: 1px; + border-style: solid; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; +} + +a.button, +a.button-primary, +a.button-secondary { + line-height: 1.2em; + -webkit-border-radius: 2px; + padding: 4px 10px; +} + +#doaction { + margin-right: 8px; +} + +.tablenav select[name="action"] { + width: 120px; +} + +.tablenav select[name="m"] { + width: 120px; +} + +.tablenav select#cat { + width: 150px; +} + +#wpcontent select { + font: 11px/20px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; + padding: 0; + box-shadow: 0 1px 0 0 #fff; + height: 2em; +} + +#wpcontent option { + padding: 2px; +} + +.approve { + display: none; +} + +.unapproved .approve, .spam .approve { + display: inline; +} + +.unapproved .unapprove { + display: none; +} + +.narrow { + width: 70%; + margin-bottom: 40px; +} + +.narrow p { + line-height: 150%; +} + +table .vers { + text-align: center; +} + +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%; + outline: none; + -moz-border-radius: 6px 6px 0 0; + -webkit-border-radius: 6px 6px 0 0; + border-radius: 6px 6px 0 0; +} + +#editorcontainer { + border-collapse: separate; + -moz-border-radius: 6px 6px 0 0; + -webkit-border-radius: 6px 6px 0 0; + border-radius: 6px 6px 0 0; +} + +#ed_toolbar input { + margin: 3px 1px 4px; + line-height: 18px; + display: inline-block; + border-width: 1px; + border-style: solid; + min-width: 26px; + padding: 2px 4px; + font-size: 12px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +#ed_reply_toolbar #ed_reply_link { + text-decoration: underline; +} + +#ed_reply_toolbar #ed_reply_del { + text-decoration: line-through; +} + +#ed_reply_toolbar #ed_reply_em { + font-style: italic; +} + +#excerpt, .attachmentlinks { + margin: 0; + height: 4em; + width: 98%; +} + +/* post meta postbox */ +#postcustomstuff table, +#postcustomstuff input, +#postcustomstuff textarea { + border-width: 1px; + border-style: solid; + -moz-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, +#pagecustomdiv #postcustomstuff .submit { + border: 0 none; + float: none; + padding: 5px 8px; +} + +#side-sortables #postcustom #postcustomstuff .submit, +#side-sortables #pagecustomdiv #postcustomstuff .submit { + padding: 0 5px; +} + +#side-sortables #postcustom #postcustomstuff td.left input, +#side-sortables #pagecustomdiv #postcustomstuff td.left input { + margin: 3px 3px 0; +} + +#side-sortables #postcustom #postcustomstuff #the-list textarea, +#side-sortables #pagecustomdiv #postcustomstuff #the-list textarea { + height: 85px; + margin: 3px; +} + +#postcustomstuff table { + margin: 0; + width: 100%; + border: none; + border-spacing: 0; + text-align: left; +} + +#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; +} + +/* 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; +} + +* html #themeselect { + padding: 0 3px; + height: 22px; +} + +#your-profile legend { + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + font-size: 22px; +} + +#howto { + font-size: 11px; + margin: 0 5px; + display: block; +} + +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; +} + +.column-comment p { + margin: 0.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; + font-weight: normal; + padding: 3px 6px; + border: 1px solid #ccc; + background: #ebebed; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; +} + +.tablenav .tablenav-pages a { + border-color: #006cbc; + background: none; + font-weight: bold; +} + +.tablenav .displaying-num { + margin-right: 10px; + font-size: 11px; + font-family: monospace; +} + +.tablenav .actions { + padding: 2px 8px 0 0; +} + +td.media-icon { + vertical-align: middle; + text-align: center; + width: 80px; +} + +td.media-icon img { + max-width: 80px; + max-height: 60px; +} + +#update-nag, .plugin-update { + line-height: 29px; + font-size: 12px; + text-align: center; + border-bottom-width: 1px; + border-bottom-style: solid; + border-top-width: 1px; + border-top-style: solid; +} + +#update-nag a, .plugin-update a { + font-size: 1.1em; +} + +#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; +} + +/* Admin Header */ +#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 { + display: none; + float: left; + margin: 7px 0 0 15px; +} + +#wphead h1 { + padding: 10px 8px 5px; + margin: 0; + float: left; + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + font-weight: normal; + font-size: 21px; +} + +#wphead h1.long-title { + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + font-size: 18px; + padding: 12px 10px 5px; +} + +#wphead h1 span { + font-size: 50%; +} + +/* ADMIN MENU */ +#adminmenu li { + line-height: 12px; +} +#adminmenu li.wp-menu-separator { + border-bottom: 1px solid #ddd; + margin: 10px 0; +} + +#adminmenu li.menu-top { + margin-top: 8px; +} +#adminmenu li.menu-top-first { + margin-top: 0; +} +#adminmenu a.menu-top { + font-weight: bold; +} + +#adminmenu .wp-submenu a { + padding-left: 3px; +} + +#adminmenu li { + margin: 0; +} + +#adminmenu a { + display: block; + color: #303434; + padding: 3px; + margin-left: -2px; + border-left: 3px solid transparent; +} + +#adminmenu a.current { + border-left: 3px solid #303434; +} + +#adminmenu a:hover { + background: #eee; +} + +#adminmenu .pending-count { + -moz-border-radius: 12px; + -webkit-border-radius: 12px; + border-radius: 12px; + padding: 2px 6px; + background: orange; + color: #fff; +} + +#adminmenu .count-0 { + display: none; +} + +/* END ADMIN MENU */ + +/* Tables used on comment.php and option/setting pages */ + +.form-table { + border-collapse: collapse; + margin-top: 0.5em; + width: 100%; + margin-bottom: -8px; + clear: both; +} + +.form-table td, +#wpbody-content .describe td { + margin-bottom: 9px; + padding: 4px 10px 12px; + line-height: 20px; + font-size: 11px; +} + +.form-table th, +.form-wrap label { + font-weight: normal; +} + +.form-table th, +#wpbody-content .describe th { + vertical-align: top; + text-align: left; + padding: 10px; + width: 200px; +} + +.form-table th.th-full { + width: auto; +} + +.form-table input, +.form-table textarea, +#wpbody-content .describe input, +#wpbody-content .describe textarea { + border-width: 1px; + border-style: solid; +} + +.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: -8px 3px 8px; +} + +.form-table .color-palette td { + border-width: 1px 1px 0; + border-stile: solid solid none; + height: 10px; + line-height: 20px; + width: 10px; +} + +textarea.large-text { + width: 99%; +} + +.form-table input.regular-text { + width: 325px; +} + +.form-table input.small-text { + width: 50px; +} + +#profile-page .form-table textarea { + width: 500px; + margin-bottom: 6px; +} + +#profile-page .form-table input[type=text] { + width: 300px; +} + +.form-table .pre { + padding: 8px; + margin: 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+ */ +} + +table.form-table td .updated { + font-size: 13px; +} + +/* divs for cats and tags pages */ + +.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%; +} + +.form-wrap p { + margin: 2px 0 5px; +} + +.setting-description, .form-wrap p { + 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; +} + +.tagcloud h3 { + margin: 2px 0 12px; +} + +/* Post Screen */ +#normal-sortables { + min-height: 50px; +} + +.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 { + min-height: 300px; +} + +#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, +#side-sortables #show-comments { + display: none; +} + +#post-body #tagsdiv #newtag { + margin-right: 5px; + width: 16em; +} + +#side-info-column input#post_password { + width: 94% +} + +#side-info-column #tagsdiv #newtag { + width: 68%; +} + +#post-status-info { + font-size: 12px; + line-height: 2; + padding: 0 15px 0 7px; + border: 1px solid #ddd; + border-top: none; + -moz-border-radius: 0 0 6px 6px; + -webkit-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; +} + +#editorcontent #post-status-info { + border: none; +} + +#pagesubmitdiv div.inside, +#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: 10px; + 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; +} + +.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; +} + +.ui-sortable .postbox h3 { + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +.ui-sortable .postbox .hndle span { + padding: 6px 0; +} + +.ui-sortable .postbox .hndle { + background: #eee; +} + +.hndle a { + font-size: 11px; + font-weight: normal; +} + +.sortable-placeholder { + border-width: 1px; + border-style: dashed; + z-index: -1; +} + +#poststuff h3, +.metabox-holder h3 { + font-size: 10px; + font-weight: normal; + padding: 7px 9px; + margin: 0; + line-height: 1; + text-transform: uppercase; + color: #555; + font-family: monospace; +} + +.metabox-holder .postbox, +#poststuff .postbox, +#poststuff .stuffbox { + background: #fff; + margin-bottom: 20px; + border: 1px solid #d7dbdb; + line-height: 1; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + box-shadow: inset 0 1px 3px 0 rgba(0,0,0,0.05), 0 1px 0 0 #fff; +} + +.metabox-holder .postbox h3, +#poststuff .postbox h3, +#poststuff .stuffbox h3 { + -moz-border-radius: 4px 4px 0 0; + -webkit-border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-top-left-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; +} + +.postbox input.tags-input { + width: 100%; +} + +#poststuff .inside, +#poststuff .inside p { + font-size: 11px; + margin: 6px; +} + +#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 { + margin-bottom: 20px; +} +#titlediv label { cursor: text; } + +#titlediv div.inside { + margin: 0; +} + +#poststuff #titlewrap { + border: 0; + padding: 0; + +} + +#titlediv #title { + padding: 6px 8px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + font-size: 18px; + width: 100%; + outline: none; +} + +#poststuff .inside-submitbox, +#side-info-column .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 { + display: flex; + margin-top: 5px; + padding: 0 7px; +} + +#edit-slug-box strong, +#edit-slug-box span#sample-permalink { + margin-top: 9px; +} + +#edit-slug-box input { + flex-grow: 1; +} + +.postarea h3 label { + float: left; +} + +.postarea #add-media-button { + float: right; + margin: 7px 0pt 0pt; + position: relative; + right: 10px; +} + +#poststuff #editor-toolbar { + height: 30px; +} + +#poststuff #edButtonPreview, +#poststuff #edButtonHTML { + display: block; + 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; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} + +#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 { + 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; +} + +/* Categories */ + +#category-adder { + margin-left: 120px; + padding: 4px 0; +} + +#category-adder h4 { + margin: 0 0 8px; +} + +#side-info-column #category-adder { + margin: 0; +} + +#post-body #category-add input, #category-add select { + width: 30%; +} + +#side-info-column #category-add input { + width: 94%; +} + +#side-info-column #category-add select { + width: 100%; +} + +#category-add input#category-add-sumbit { + width: auto; +} + +#post-body ul#category-tabs { + float: left; + width: 120px; + text-align: right; + /* Negative margin for the sake of those without JS: all tabs display */ + margin: 0 -120px 0 0; + padding: 0; +} + +#post-body ul#category-tabs li { + padding: 8px; +} + +#post-body ul#category-tabs li.ui-tabs-selected { + -moz-border-radius: 3px 0 0 3px; + -webkit-border-top-left-radius: 3px; + -webkit-border-bottom-left-radius: 3px; + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; +} + +#post-body ul#category-tabs li.ui-tabs-selected a { + font-weight: bold; + text-decoration: none; +} + +#side-info-column #category-tabs li { + display: inline; + padding-right: 8px; +} + +#side-info-column #category-tabs a { + text-decoration: none; +} + +#side-info-column #category-tabs { + margin-bottom: 3px; +} + +#categorydiv ul, +#linkcategorydiv ul { + list-style: none; + padding: 0; + margin: 0; +} + +#categorydiv ul.categorychecklist ul, +#linkcategorydiv ul.categorychecklist ul { + margin-left: 18px; +} + +ul.categorychecklist li { + margin: 0; + padding: 0; + line-height: 19px; +} + +/* positioning etc. */ + +form#tags-filter { + position: relative; +} + +p.search-box { + float: right; + margin: -5px 0 0; +} + +.search-input { + border: 1px solid #ccc; + box-shadow: 0 1px 0 0 #fff, inset 0 1px 2px 0 rgba(0,0,0,0.05); + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + padding: 2px; +} + +#posts-filter fieldset { + float: left; + margin: 0 1.5ex 1em 0; + padding: 0; +} + +#posts-filter fieldset legend { + padding: 0 0 .2em 1px; +} + +.bordertitle { + padding-bottom: 5px; + border-bottom-width: 1px; + border-bottom-style: solid; +} + +/* Edit posts */ + +td.post-title strong { + display: block; + margin-bottom: .2em; +} + +td.post-title p { + margin: 6px 0; +} + +/* Global classes */ + +.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; + background: #fff; +} + +.view-switch { + float: right; + margin: 9px 10px 0 0; + color: #999; +} + +.view-switch.view-switch-with-border { + border-right: 1px solid #ccc; +} + +.view-switch a { + text-decoration: none; + font-size: 11px; + margin-right: 10px; +} + +.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; +} + +.tablenav .delete { + margin-right: 20px; +} + +td.action-links, th.action-links { + text-align: right; +} + +/* Diff */ + +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; +} + +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; + -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: 20px; + padding: 0; +} + +#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; +} + +/* media popup 0819 */ +#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; + 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; +} + +/* reply to comments */ +#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 span.waiting, +#commentstatusdiv span.waiting { + padding: 0 10px; + vertical-align: top; +} + +#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; +} + +#replyrow #ed_reply_toolbar input { + margin: 1px 2px 1px 1px; + min-width: 24px; + padding: 3px 4px; + font-size: 11px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +ul.cat-checklist { + height: 12em; + border-style: solid; + border-width: 1px; + overflow-y: scroll; + padding: 0 5px; + margin: 0 0 5px; +} + +#bulk-titles { + display: block; + height: 12em; + border-style: solid; + border-width: 1px; + overflow-y: scroll; + padding: 0 5px; + margin: 0 0 5px; +} + +#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; +} + +/* Media library */ +#wpbody-content #media-items .describe { + border-collapse: collapse; + width: 100%; + border-top-style: solid; + border-top-width: 1px; + clear: both; + cursor: default; + padding: 5px; + width: 100%; +} + +#wpbody-content .describe .media-item-info tr { + background-color: transparent; +} + +#wpbody-content .filename { + margin-left: 10px; +} + +#wpbody-content .media-item .thumbnail { + max-height: 128px; + max-width: 128px; +} + +#wpbody-content .media-upload-form label { + display: block; + font-size: 13px; + margin: 0.5em; +} + +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; +} + +.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-items { + border-style: solid solid none; + border-width: 1px; + width: 670px; +} + +#wpbody-content #media-items .filename { + float: left; + line-height: 36px; + margin-left: 10px; + max-width: 430px; + overflow: hidden; +} + +.media-item .pinkynail { + float: left; + height: 32px; + margin: 2px; + max-width: 40px; + max-height: 40px; +} + +.media-item .startopen, +.media-item .startclosed { + display: none; +} + +/* find posts */ +.find-box { + width: 400px; + height: 250px; + overflow: hidden; + padding: 33px 5px 50px; + 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: 8px 0 0 8px; + width: 15px; +} + +.find-box-buttons { + bottom: 12px; + left: 12px; + position: absolute; +} + +.find-box-search label { + padding-right: 6px; +} + +#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; +} + +#tagsdiv #the-tagcloud { + margin: 5px 5px 10px; + padding: 8px; + border-width: 1px; + border-style: solid; + line-height: 1.8em; + word-spacing: 3px; + -moz-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 column width */ +table.fixed { + table-layout: fixed; +} + +.fixed .column-date, +.fixed .column-parent, +.fixed .column-visible, +.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: 60px; +} + +.fixed .column-slug { + width: 25%; +} + +.fixed .column-posts { + width: 10%; +} + +.fixed .column-icon { + width: 80px; +} + +#commentstatusdiv .fixed .column-author, +#comments-form .fixed .column-author, +#commentstatusdiv .fixed .column-date { + width: 20%; +} + +.widefat th, +.widefat td { + overflow: hidden; +} + +.key-labels label { + line-height: 24px; +} + +.subtitle { + font-size: 0.75em; + line-height: 1; + padding-left: 25px; +} diff -uNr a/mp-wp/wp-admin/custom-header.php b/mp-wp/wp-admin/custom-header.php --- a/mp-wp/wp-admin/custom-header.php 3e4322c7d8f1757f883a9f11abec332b8c952d7b050c801e4ba60e72853509f0603e0ea63b093dacf4ca158fe309043984900efa5ea0348c2d1cd9d0eb46388f +++ b/mp-wp/wp-admin/custom-header.php false @@ -1,470 +0,0 @@ -admin_header_callback = $admin_header_callback; - } - - /** - * Setup the hooks for the Custom Header admin page. - * - * @since unknown - */ - function init() { - $page = add_theme_page(__('Custom Image Header'), __('Custom Image Header'), 'edit_themes', 'custom-header', array(&$this, 'admin_page')); - - add_action("admin_print_scripts-$page", array(&$this, 'js_includes')); - add_action("admin_print_styles-$page", array(&$this, 'css_includes')); - add_action("admin_head-$page", array(&$this, 'take_action'), 50); - add_action("admin_head-$page", array(&$this, 'js'), 50); - add_action("admin_head-$page", $this->admin_header_callback, 51); - } - - /** - * Get the current step. - * - * @since unknown - * - * @return int Current step - */ - function step() { - if ( ! isset( $_GET['step'] ) ) - return 1; - - $step = (int) $_GET['step']; - if ( $step < 1 || 3 < $step ) - $step = 1; - - return $step; - } - - /** - * Setup the enqueue for the JavaScript files. - * - * @since unknown - */ - function js_includes() { - $step = $this->step(); - - if ( 1 == $step ) - wp_enqueue_script('farbtastic'); - elseif ( 2 == $step ) - wp_enqueue_script('cropper'); - } - - /** - * Setup the enqueue for the CSS files - * - * @since 2.7 - */ - function css_includes() { - $step = $this->step(); - - if ( 1 == $step ) { - wp_enqueue_style('farbtastic'); - } - } - - /** - * Execute custom header modification. - * - * @since unknown - */ - function take_action() { - if ( isset( $_POST['textcolor'] ) ) { - check_admin_referer('custom-header'); - if ( 'blank' == $_POST['textcolor'] ) { - set_theme_mod('header_textcolor', 'blank'); - } else { - $color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['textcolor']); - if ( strlen($color) == 6 || strlen($color) == 3 ) - set_theme_mod('header_textcolor', $color); - } - } - if ( isset($_POST['resetheader']) ) { - check_admin_referer('custom-header'); - remove_theme_mods(); - } - } - - /** - * Execute Javascript depending on step. - * - * @since unknown - */ - function js() { - $step = $this->step(); - if ( 1 == $step ) - $this->js_1(); - elseif ( 2 == $step ) - $this->js_2(); - } - - /** - * Display Javascript based on Step 1. - * - * @since unknown - */ - function js_1() { ?> - - - - -
-

-
- - -
- -

-

- -
-

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

-

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

- -
-
- - -

- -

-
- -
- - -
-

-

-
- - -
-
- false); - $file = wp_handle_upload($_FILES['import'], $overrides); - - if ( isset($file['error']) ) - die( $file['error'] ); - - $url = $file['url']; - $type = $file['type']; - $file = $file['file']; - $filename = basename($file); - - // Construct the object array - $object = array( - 'post_title' => $filename, - 'post_content' => $url, - 'post_mime_type' => $type, - 'guid' => $url); - - // Save the data - $id = wp_insert_attachment($object, $file); - - list($width, $height, $type, $attr) = getimagesize( $file ); - - if ( $width == HEADER_IMAGE_WIDTH && $height == HEADER_IMAGE_HEIGHT ) { - // Add the meta-data - wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); - - set_theme_mod('header_image', clean_url($url)); - do_action('wp_create_file_in_uploads', $file, $id); // For replication - return $this->finished(); - } elseif ( $width > HEADER_IMAGE_WIDTH ) { - $oitar = $width / HEADER_IMAGE_WIDTH; - $image = wp_crop_image($file, 0, 0, $width, $height, HEADER_IMAGE_WIDTH, $height / $oitar, false, str_replace(basename($file), 'midsize-'.basename($file), $file)); - $image = apply_filters('wp_create_file_in_uploads', $image, $id); // For replication - - $url = str_replace(basename($url), basename($image), $url); - $width = $width / $oitar; - $height = $height / $oitar; - } else { - $oitar = 1; - } - ?> - -
- -
- -

-
- -
- -

- - - - - - - - - - -

- -
-
- 1 ) { - $_POST['x1'] = $_POST['x1'] * $_POST['oitar']; - $_POST['y1'] = $_POST['y1'] * $_POST['oitar']; - $_POST['width'] = $_POST['width'] * $_POST['oitar']; - $_POST['height'] = $_POST['height'] * $_POST['oitar']; - } - - $original = get_attached_file( $_POST['attachment_id'] ); - - $cropped = wp_crop_image($_POST['attachment_id'], $_POST['x1'], $_POST['y1'], $_POST['width'], $_POST['height'], HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT); - $cropped = apply_filters('wp_create_file_in_uploads', $cropped, $_POST['attachment_id']); // For replication - - $parent = get_post($_POST['attachment_id']); - $parent_url = $parent->guid; - $url = str_replace(basename($parent_url), basename($cropped), $parent_url); - - // Construct the object array - $object = array( - 'ID' => $_POST['attachment_id'], - 'post_title' => basename($cropped), - 'post_content' => $url, - 'post_mime_type' => 'image/jpeg', - 'guid' => $url - ); - - // Update the attachment - wp_insert_attachment($object, $cropped); - wp_update_attachment_metadata( $_POST['attachment_id'], wp_generate_attachment_metadata( $_POST['attachment_id'], $cropped ) ); - - set_theme_mod('header_image', $url); - - // cleanup - $medium = str_replace(basename($original), 'midsize-'.basename($original), $original); - @unlink( apply_filters( 'wp_delete_file', $medium ) ); - @unlink( apply_filters( 'wp_delete_file', $original ) ); - - return $this->finished(); - } - - /** - * Display last step of custom header image page. - * - * @since unknown - */ - function finished() { - ?> -
-

- -

- -
- step(); - if ( 1 == $step ) - $this->step_1(); - elseif ( 2 == $step ) - $this->step_2(); - elseif ( 3 == $step ) - $this->step_3(); - } - -} -?> diff -uNr a/mp-wp/wp-admin/edit-attachment-rows.php b/mp-wp/wp-admin/edit-attachment-rows.php --- a/mp-wp/wp-admin/edit-attachment-rows.php 388b69c816ad5366dc8a395562ccaea40281812ee57cf4fd66c01e747242ae4e19207c98f8f5141dbea902847d2a812ce219eb015f35a3f13717cbbb06afefcb +++ b/mp-wp/wp-admin/edit-attachment-rows.php a8f51f88df658815171d139721c03a2077c2d340e895e87eef70b0818d12de252304e1c3a43a2e5d02ba0977ef68ab835dee58e633a11442a7084a661403d02d @@ -15,13 +15,6 @@ - - - - - - - - + ID) ) $actions['edit'] = '' . __('Edit') . ''; if ( current_user_can('delete_post', $post->ID) ) - $actions['delete'] = "ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . ""; + $actions['delete'] = "ID) . "'>" . __('Delete') . ""; $actions['view'] = '' . __('View') . ''; $action_count = count($actions); $i = 0; diff -uNr a/mp-wp/wp-admin/edit-category-form.php b/mp-wp/wp-admin/edit-category-form.php --- a/mp-wp/wp-admin/edit-category-form.php 771c5df8d4d6ba39bfa5ff42e982a6a62b392c7fa82f745f4569942bd1e719a1032e534e15a2270d5a451011e8af630cd46d3329550c1d31e0103c2c21d28629 +++ b/mp-wp/wp-admin/edit-category-form.php 7190b40a93732a00772b807699bc2e9cd53a1cd1e69048a52e7b82e0e74f1f88917e5d7b6474c7df9e9e9bfaa5333cee0c88e0f8e34815fdc458d03ad1df76a6 @@ -41,7 +41,6 @@

-
diff -uNr a/mp-wp/wp-admin/edit-comments.php b/mp-wp/wp-admin/edit-comments.php --- a/mp-wp/wp-admin/edit-comments.php 5bcb68d3a075d461b9b1eae9921df9d6e4baec9822c47c88b39845da08b5e15f2a674851fbd2efc744f6381bff89dc9d619fff0b13773a60396f904600d9db04 +++ b/mp-wp/wp-admin/edit-comments.php 93d3197cf44dbc6057f7d85045439aa100e23ad988a332ee62935da854d9e50241b8e811394eeef665c59152f2c02f0ae934ff383963a7718c1991976a161996 @@ -9,9 +9,6 @@ /** WordPress Administration Bootstrap */ require_once('admin.php'); -wp_enqueue_script('admin-comments'); -enqueue_comment_hotkeys_js(); - $post_id = isset($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0; if ( ( isset( $_REQUEST['delete_all_spam'] ) || isset( $_REQUEST['delete_all_spam2'] ) ) && !empty( $_REQUEST['pagegen_timestamp'] ) ) { @@ -24,9 +21,9 @@ if ( $post_id ) $redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to ); wp_redirect( $redirect_to ); -} elseif ( isset($_REQUEST['delete_comments']) && isset($_REQUEST['action']) && ( -1 != $_REQUEST['action'] || -1 != $_REQUEST['action2'] ) ) { +} elseif ( isset($_REQUEST['delete_comments']) && isset($_REQUEST['action']) && -1 != $_REQUEST['action'] ) { check_admin_referer('bulk-comments'); - $doaction = ( -1 != $_REQUEST['action'] ) ? $_REQUEST['action'] : $_REQUEST['action2']; + $doaction = $_REQUEST['action']; $deleted = $approved = $unapproved = $spammed = 0; foreach ( (array) $_REQUEST['delete_comments'] as $comment_id) : // Check the permissions on each @@ -223,14 +220,14 @@
- +
' . __( 'Displaying %s–%s of %s' ) . '%s', number_format_i18n( $start + 1 ), number_format_i18n( min( $page * $comments_per_page, $total ) ), number_format_i18n( $total ), $page_links ); echo $page_links_text; ?>
- +
- - - - - - - - - - - - - - - - - - -
- -
+
' . __( 'Displaying %s–%s of %s' ) . '%s', + number_format_i18n( $start + 1 ), + number_format_i18n( min( $page * $comments_per_page, $total ) ), + number_format_i18n( $total ), + $page_links +); echo $page_links_text; ?>
+
@@ -352,37 +322,20 @@ - -
-

+
- - diff -uNr a/mp-wp/wp-admin/edit-form-advanced.php b/mp-wp/wp-admin/edit-form-advanced.php --- a/mp-wp/wp-admin/edit-form-advanced.php 08558b087cf3e86ef88e3c07596f32dd005d467318e34350e5338c5ea72a30fa069632805b4e1d1f3094483b030f9852803b3285c1d8ffc6afdfffb5c1b650c8 +++ b/mp-wp/wp-admin/edit-form-advanced.php 653814251c9614dff0669b2fb4ee6c90ed3c6c7ffb0239615c1286a6b41e4f13a6e1c86c4b947dd135ec4f425b958f98e79fd17940a4fd69d7a6dcedced0e73c @@ -122,9 +122,7 @@ ?> post_status || 'private' == $post->post_status || $can_publish ) { ?> -post_status ) { ?>style="display:none;" class="edit-post-status hide-if-no-js" tabindex='4'> - -
+
- -
@@ -162,9 +158,8 @@ $visibility_trans = __('Public'); } -?> - -
+?> +
ID), true); ?> /> @@ -175,11 +170,6 @@ />

/>
- -

- - -

@@ -210,8 +200,7 @@
- -
+
@@ -224,7 +213,7 @@ @@ -267,7 +256,6 @@ ?>

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

-

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

-
-
ID); list_meta($metadata); @@ -416,49 +378,9 @@

get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID)); - - if ( !$post_ID || $post_ID < 0 || 1 > $total ) - return; - -wp_nonce_field( 'get-comments', 'add_comment_nonce', false ); -?> - - - - - - - - - - - -

- - - - -post_status && !current_user_can( 'publish_posts' ) ) ) - add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'normal', 'core'); - $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM if ( $post->post_author && !in_array($post->post_author, $authors) ) $authors[] = $post->post_author; @@ -617,9 +539,3 @@
- -post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message'])) : ?> - - diff -uNr a/mp-wp/wp-admin/edit-form-comment.php b/mp-wp/wp-admin/edit-form-comment.php --- a/mp-wp/wp-admin/edit-form-comment.php 385a932df06790b1c0f63315966076f74d2d2fed040814106b254c5e0d165101992d0c5e9b0becad5be6e6adf9a5c7615ebb74082e9591b2bbfa9853a8438406 +++ b/mp-wp/wp-admin/edit-form-comment.php e0d91053940c7bbcd2698e7398b83026003b4a4252bd0cf35181776c01833828655e0cf99e1a18aacf22cf570a76c3c1952f6935c6e68df5471a6923b56d259c @@ -59,8 +59,8 @@ $stamp = __('Submitted on: %1$s'); $date = date_i18n( $datef, strtotime( $comment->comment_date ) ); ?> -  -
+ +
@@ -68,7 +68,15 @@
@@ -140,6 +148,3 @@
- diff -uNr a/mp-wp/wp-admin/edit-link-categories.php b/mp-wp/wp-admin/edit-link-categories.php --- a/mp-wp/wp-admin/edit-link-categories.php eeb0f56f6aeb162762816414e04ebddad0a32dd8eba218e894eb229e69312ea1e2318782a44dcbd359676d58f2b3a189d6e23bddf52779a97505395faa91f6dd +++ b/mp-wp/wp-admin/edit-link-categories.php 448b8a27b097ca9eebdb6ed55cc37638825a239ca846c9aac418339678e5dc860d2de514c44be18d66e071cec0b70f89f750357be013daebb60aa89318ef4661 @@ -12,7 +12,7 @@ // Handle bulk actions if ( isset($_GET['action']) && isset($_GET['delete']) ) { check_admin_referer('bulk-link-categories'); - $doaction = $_GET['action'] ? $_GET['action'] : $_GET['action2']; + $doaction = $_GET['action']; if ( !current_user_can('manage_categories') ) wp_die(__('Cheatin’ uh?')); @@ -46,10 +46,6 @@ $title = __('Link Categories'); -wp_enqueue_script('admin-categories'); -if ( current_user_can('manage_categories') ) - wp_enqueue_script('inline-edit-tax'); - require_once ('admin-header.php'); $messages[1] = __('Category added.'); @@ -127,13 +123,6 @@ - - - - - - - -
-$page_links
"; -?> - -
- - -
- -
-

@@ -190,7 +163,6 @@

-
@@ -223,21 +195,4 @@
- - - - diff -uNr a/mp-wp/wp-admin/edit-link-category-form.php b/mp-wp/wp-admin/edit-link-category-form.php --- a/mp-wp/wp-admin/edit-link-category-form.php 1bd18b31925ff819da41679ff77f2842ce3fb97f4b05050ea494ce59372b9aa6ccbcde9bad3f4a4f299965afd45cd6b2aabb1229b6ac6ead9e291fd8ddcf08af +++ b/mp-wp/wp-admin/edit-link-category-form.php 8cd5f88f136b48239d41de653f8b5005eb34a7bab2b3ac881e436aa61a8e48a659ce0b73fbb94601e0f6cd746c3105203fc9df0faf196dc6d05adddfac088de2 @@ -55,7 +55,6 @@
-
diff -uNr a/mp-wp/wp-admin/edit-link-form.php b/mp-wp/wp-admin/edit-link-form.php --- a/mp-wp/wp-admin/edit-link-form.php c6ca0857a2b4ef3e34586ab128bd6afd3e0ed1176406e6823249f498365d5ba8efe10f48f1495635ae6d14a2d5b4fef6957a5d7038d21813b1ee1209ac8a1c38 +++ b/mp-wp/wp-admin/edit-link-form.php fb582e251778615e026de4123f4b1086e3814c2c774169651e797e7af955cfb90bff47f8f8e96e4a71d760cd36c02085d0b771265c0d9da42d60dda8777f411a @@ -85,7 +85,7 @@
- link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('link_name )); ?>') ) {return true;}return false;"> + link_id", 'delete-bookmark_' . $link->link_id); ?>">
@@ -113,23 +113,7 @@ * @param object $link */ function link_categories_meta_box($link) { ?> -
-

- -
- - - -
+
    link_id) ) @@ -139,12 +123,6 @@ ?>
- - post_status || 'private' == $post->post_status || $can_publish ) { ?> -post_status ) { ?>style="display:none;" class="edit-post-status hide-if-no-js" tabindex='4'> - -
+
- - -
@@ -152,9 +147,8 @@ $visibility_trans = __('Public'); } -?> - -
+?> +
@@ -163,11 +157,6 @@ />

/>
- -

- - -

@@ -195,10 +184,8 @@ ?>
- - - -
+ +
@@ -211,7 +198,7 @@ @@ -306,7 +293,6 @@ list_meta($metadata); meta_form(); ?> -

use in your theme.'); ?>

- -id, true, 'page' ); // TODO: ROLE SYSTEM if ( $post->post_author && !in_array($post->post_author, $authors) ) $authors[] = $post->post_author; @@ -490,7 +462,3 @@
- - diff -uNr a/mp-wp/wp-admin/edit-pages.php b/mp-wp/wp-admin/edit-pages.php --- a/mp-wp/wp-admin/edit-pages.php 3043631715d6345b415aa169554043aeeff92a92b95d9445aaa69c6af0636c1ff00cd3535b1bb04086f9d92d682b3fca847e89b466b5fb9f24cd2e6dbe606e5f +++ b/mp-wp/wp-admin/edit-pages.php 68788dd60a72a71d72917ff53ef5a63f7ad1299bdc51f69ea3401682fe52e0d90d0abab0da899191af007f92d049f5006424c54eeafbafd57bd0634b4be7b94a @@ -10,12 +10,12 @@ require_once('admin.php'); // Handle bulk actions -if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) { - $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2']; +if ( isset($_GET['action']) && -1 != $_GET['action'] ) { + $doaction = $_GET['action']; switch ( $doaction ) { case 'delete': - if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) { + if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && isset($_GET['doaction']) ) { check_admin_referer('bulk-pages'); $deleted = 0; foreach( (array) $_GET['post'] as $post_id_del ) { @@ -72,7 +72,6 @@ if ( empty($title) ) $title = __('Edit Pages'); $parent_file = 'edit-pages.php'; -wp_enqueue_script('inline-edit-post'); $post_stati = array( // array( adj, noun ) 'publish' => array(__('Published|page'), __('Published pages'), _n_noop('Published (%s)|page', 'Published (%s)')), @@ -95,11 +94,6 @@ $query = apply_filters('manage_pages_query', $query); wp($query); -if ( is_singular() ) { - wp_enqueue_script( 'admin-comments' ); - enqueue_comment_hotkeys_js(); -} - require_once('admin-header.php'); ?>
@@ -199,19 +193,18 @@ 'current' => $pagenum )); -if ( $page_links ) : ?> +if ( $page_links ) { ?>
' . __( 'Displaying %s–%s of %s' ) . '%s', number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ), number_format_i18n( min( $pagenum * $per_page, $wp_query->post_count ) ), number_format_i18n( $wp_query->post_count ), $page_links ); echo $page_links_text; ?>
- +
@@ -229,36 +222,11 @@ - - - - - - - -
-$page_links_text
"; -?> - -
- - -
- -
-
-

@@ -266,12 +234,18 @@ } // end if ($posts) ?> - - - - -
+ +
+
' . __( 'Displaying %s–%s of %s' ) . '%s', + number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ), + number_format_i18n( min( $pagenum * $per_page, $wp_query->post_count ) ), + number_format_i18n( $wp_query->post_count ), + $page_links +); echo $page_links_text; ?>
+
+ + - - diff -uNr a/mp-wp/wp-admin/edit-post-rows.php b/mp-wp/wp-admin/edit-post-rows.php --- a/mp-wp/wp-admin/edit-post-rows.php 751d64a408e07584db1439e7c7876ce1ad75f08b72ecfaecda510f4be8f6e22e834e106a7206eda4843c3bf653739adc97d677e6d9bb59a39bb82f7307144764 +++ b/mp-wp/wp-admin/edit-post-rows.php 2f93f90b13898e0f3c37130cbbcdfc3de4edad595decb80cc54127b946bf5b98ea6a121ea9f39f4fb544d856dfafdb2a1b1d70863e0bb9f003459170fda14969 @@ -14,14 +14,7 @@ - - - - - - - - \ No newline at end of file + diff -uNr a/mp-wp/wp-admin/edit-tag-form.php b/mp-wp/wp-admin/edit-tag-form.php --- a/mp-wp/wp-admin/edit-tag-form.php ae5a3011fb4edb8b03ae447c66caa63e1229699779a90b6d3b443856b398e06ff32da29df8291f4ed0b4481b7f2e2e46f129f52ae8be1839fe1d8f59dd3352c8 +++ b/mp-wp/wp-admin/edit-tag-form.php 924f0681455125bc73e66c9cd34dc623468e4334c3b605ce1a0bd1a92d43b7e7ea65e12a1c26220e59ef3e16681696ed8d400bf4fa372077491da99dc2cf291d @@ -17,7 +17,6 @@

-
diff -uNr a/mp-wp/wp-admin/edit-tags.php b/mp-wp/wp-admin/edit-tags.php --- a/mp-wp/wp-admin/edit-tags.php 833b9f3f31940bd4a8c6b81df47b3e75faec7310aa7a956e2c0f2c77f94b10c87da4a8ed357f50b33eb06275b1849fb664fc4acf0d0538c55efb91f9c1de70af +++ b/mp-wp/wp-admin/edit-tags.php bde0a3ffd58d17ae49185b0cd5184ed63f0256293ae6cf9bba4b34a8b5c4be3f27e5f84042fcbea919ac57729e06208feeeb5184caec59c908e9698fa9593969 @@ -13,7 +13,7 @@ wp_reset_vars( array('action', 'tag') ); -if ( isset( $_GET['action'] ) && isset($_GET['delete_tags']) && ( 'delete' == $_GET['action'] || 'delete' == $_GET['action2'] ) ) +if ( isset( $_GET['action'] ) && isset($_GET['delete_tags']) && 'delete' == $_GET['action'] ) $action = 'bulk-delete'; switch($action) { @@ -115,10 +115,6 @@ $can_manage = current_user_can('manage_categories'); -wp_enqueue_script('admin-tags'); -if ( $can_manage ) - wp_enqueue_script('inline-edit-tax'); - require_once ('admin-header.php'); $messages[1] = __('Tag added.'); @@ -195,13 +191,6 @@ - - - - - - - -
-$page_links
"; -?> - -
- - -
- -
-
-
@@ -252,7 +224,6 @@

-
@@ -280,23 +251,6 @@
- - - - @@ -250,9 +248,12 @@ ); echo $page_links_text; ?>
-
- id="view-switch-list" src="../wp-includes/images/blank.svg" width="20" height="20" title="" alt="" /> - id="view-switch-excerpt" src="../wp-includes/images/blank.svg" width="20" height="20" title="" alt="" /> +
+ + show excerpts + + hide excerpts +
@@ -262,54 +263,26 @@ -
- -$page_links_text
"; -?> - -
- - -
-
-
-
-

- - - + +
+
' . __( 'Displaying %s–%s of %s' ) . '%s', + number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ), + number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ), + number_format_i18n( $wp_query->found_posts ), + $page_links +); echo $page_links_text; ?>
+
+ -
+
- - diff -uNr a/mp-wp/wp-admin/export.php b/mp-wp/wp-admin/export.php --- a/mp-wp/wp-admin/export.php a5d4cac66409c5945ca8c3bf8a893ee1d18935f4cbffcb85dd30a305b5bd6a404b75b6372fd33242c7bfd752fbd6f8b6552eb522ec76fd9437bd43cfc0aefaed +++ b/mp-wp/wp-admin/export.php false @@ -1,62 +0,0 @@ - - -
- -

- -

-

-

-
-

- - - - - - -
- -
-

- -

-
-
- - diff -uNr a/mp-wp/wp-admin/images/align-center.svg b/mp-wp/wp-admin/images/align-center.svg --- a/mp-wp/wp-admin/images/align-center.svg 5eb028786be92b0ab628c42a5b35420a0cbf5e807717ed7bc1f17c0b1891ef666619a834a5d19d7bd6f7a86a2c5d68b89778848552a27b8c811d8168582ce298 +++ b/mp-wp/wp-admin/images/align-center.svg false @@ -1,16 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/align-left.svg b/mp-wp/wp-admin/images/align-left.svg --- a/mp-wp/wp-admin/images/align-left.svg 15308380bd59d3dc8f0aa7667787e34f47bd8ed8da2d3494785cf9fd295f5b413903d20cf077eb59d43c03b02e90982c3ea908e54174021931c5e10cd195667b +++ b/mp-wp/wp-admin/images/align-left.svg false @@ -1,16 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/align-none.svg b/mp-wp/wp-admin/images/align-none.svg --- a/mp-wp/wp-admin/images/align-none.svg 735972b4215caa53459687b05891967c779a79ccd773e7728ed0e29263110efd5e19f08d057f5383cb488bc8ae8b0a6971012bda40acdc5b72e7e7fddbdea9ab +++ b/mp-wp/wp-admin/images/align-none.svg false @@ -1,13 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/align-right.svg b/mp-wp/wp-admin/images/align-right.svg --- a/mp-wp/wp-admin/images/align-right.svg c8022e9a080cec5be106e51cd5cd452ea9183161944ff5db2e5788de55b2b852c55097286bebd07ffe7c62d2302a8ac3fddd56674f251fe1f31c96c0859c905f +++ b/mp-wp/wp-admin/images/align-right.svg false @@ -1,15 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/blue-grad.svg b/mp-wp/wp-admin/images/blue-grad.svg --- a/mp-wp/wp-admin/images/blue-grad.svg 1e690237f7c4bb8e9a3ce79dff2d0581f30a08e0c6d50052421a67c548fa09b9cefcd40f03520bb6466f6cd69ad3c7fa65b0b14363c909170f71d0cc0a59d4e5 +++ b/mp-wp/wp-admin/images/blue-grad.svg false @@ -1,10 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/browse-happy.svg b/mp-wp/wp-admin/images/browse-happy.svg --- a/mp-wp/wp-admin/images/browse-happy.svg 95bf28d321cb06447c476df3c68393222c78f8d4d8de2b2fd5e55df7d046f02750a0b57b16351f596f3f83cc311338767e3c49db55f47c4b418d0d91dc314bc3 +++ b/mp-wp/wp-admin/images/browse-happy.svg false @@ -1,53 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/bubble_bg-rtl.svg b/mp-wp/wp-admin/images/bubble_bg-rtl.svg --- a/mp-wp/wp-admin/images/bubble_bg-rtl.svg 1458b828946e161e4e7292138672215763414b173ff6137e3201ebf3cabe3ba4ad961b11493c266383ab124b9e9c535b1912e99f90d7829539746b985557712f +++ b/mp-wp/wp-admin/images/bubble_bg-rtl.svg false @@ -1,13 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/bubble_bg.svg b/mp-wp/wp-admin/images/bubble_bg.svg --- a/mp-wp/wp-admin/images/bubble_bg.svg 2c0ebd8b382a31d83969f12bc22a5682f66cdab01351159cc78a9de5cac269d09a90757253fa15228900c94683c3ae82c89b823fe6778f1914ad775b2f508252 +++ b/mp-wp/wp-admin/images/bubble_bg.svg false @@ -1,12 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/button-grad-active.svg b/mp-wp/wp-admin/images/button-grad-active.svg --- a/mp-wp/wp-admin/images/button-grad-active.svg 7329a55ffc02e2ba75e7c94f5c35908caf8c2703ec8e7f2f1a310df6c8dc332e2f31e16d1418f84842836dbb151d4335f4e07a4d42b54a4bd312cce538e2a3da +++ b/mp-wp/wp-admin/images/button-grad-active.svg false @@ -1,10 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/button-grad.svg b/mp-wp/wp-admin/images/button-grad.svg --- a/mp-wp/wp-admin/images/button-grad.svg 6ded172baa6201f5368db65eab26c2b0edfd11cd5d2137fbd06e10af6b6219cc1c89d1ecef384abe9e3a81478bc9b096fde12e841b589afa0da610c74eea8c3c +++ b/mp-wp/wp-admin/images/button-grad.svg false @@ -1,10 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/comment-grey-bubble.svg b/mp-wp/wp-admin/images/comment-grey-bubble.svg --- a/mp-wp/wp-admin/images/comment-grey-bubble.svg f01d4e9427128b2f04d180a95f5d46417270bb9976c7ee89037f1498d3f4e8c2ce965e88ce855c1e60dc19e5b8f7ffa5cd897abb3eb25418cf67cc39d245d500 +++ b/mp-wp/wp-admin/images/comment-grey-bubble.svg false @@ -1,8 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/date-button.svg b/mp-wp/wp-admin/images/date-button.svg --- a/mp-wp/wp-admin/images/date-button.svg b415bf0541005728b3db692740ae81218ba4af011e68602c4fae3477d8c2b892a1ccc2404340d1f588dff713ffab86c5dff5195b03d51b5d110ce74a06ebf6fc +++ b/mp-wp/wp-admin/images/date-button.svg false @@ -1,7 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/ed-bg.svg b/mp-wp/wp-admin/images/ed-bg.svg --- a/mp-wp/wp-admin/images/ed-bg.svg 43e8bd8b02cba89a8a7312981120fb123a744c147fcb388931b42b414245a29d1be8926140b498169cbc6693ccc8e3d6e90f6aa95972e5e83b8e47ba68d2e717 +++ b/mp-wp/wp-admin/images/ed-bg.svg false @@ -1,9 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/fade-butt.svg b/mp-wp/wp-admin/images/fade-butt.svg --- a/mp-wp/wp-admin/images/fade-butt.svg 47480c18c0d6f5e496943c4ad0d64daff7caea30eb49fcf203d5710c80212e498a046dafd51f1d342cb18e15b38c56b60122c1a9a8b45f67501959f6afeff926 +++ b/mp-wp/wp-admin/images/fade-butt.svg false @@ -1,19 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/fav-arrow-rtl.svg b/mp-wp/wp-admin/images/fav-arrow-rtl.svg --- a/mp-wp/wp-admin/images/fav-arrow-rtl.svg 3263e01dcc3f5a9c859de6328923d61aaf120658b5e6a5770dd68ffedac7651d82d94038678c91e359574944c1752fdf42333492775d9f6675e270511430cfb3 +++ b/mp-wp/wp-admin/images/fav-arrow-rtl.svg false @@ -1,13 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/fav-arrow.svg b/mp-wp/wp-admin/images/fav-arrow.svg --- a/mp-wp/wp-admin/images/fav-arrow.svg c73ace37b7042e790d1ec676adc9f17ba6628bedac5e85172af2b3981cf5ce97b45242f8d23822f4ddfff2516fce4ffebd1c089fa22f125d64f20c0fee83eb69 +++ b/mp-wp/wp-admin/images/fav-arrow.svg false @@ -1,11 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/fav-top.svg b/mp-wp/wp-admin/images/fav-top.svg --- a/mp-wp/wp-admin/images/fav-top.svg ca31c35f470bcd4b2df76e90001c4c10b7d05023cb1729bd557556d0847818d881057ed651b98c8092bd7e18355cfb51baa4eb2467b9396f309b7c55d5da4143 +++ b/mp-wp/wp-admin/images/fav-top.svg false @@ -1,8 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/fav.svg b/mp-wp/wp-admin/images/fav.svg --- a/mp-wp/wp-admin/images/fav.svg 2e185191867593b63d5648f8785d2b976a34ba11a717066f37ac94855a9d0f776f3be2f75e4a1d4019681f497bbcc874b4b8ec61a47d0e97614376f75073ceda +++ b/mp-wp/wp-admin/images/fav.svg false @@ -1,9 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/generic.svg b/mp-wp/wp-admin/images/generic.svg --- a/mp-wp/wp-admin/images/generic.svg 65fe3d8d2ce01377b9d668e14327b3c121550726621874bbae9bd17ce015c6849b03d707555433ad32294c8f8f23fcb3634412759b6021d8188cfdbba27ead40 +++ b/mp-wp/wp-admin/images/generic.svg false @@ -1,68 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/gray-grad.svg b/mp-wp/wp-admin/images/gray-grad.svg --- a/mp-wp/wp-admin/images/gray-grad.svg e5d1d40bc194ddaa9ee72b61beb8f6f8acabe5023ec2364aa7301c5d275329681a41519f79d73af3785a60cc6ac08fcbeb3e04a604eb9c87273a32638d86da82 +++ b/mp-wp/wp-admin/images/gray-grad.svg false @@ -1,9 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/icons32-vs.svg b/mp-wp/wp-admin/images/icons32-vs.svg --- a/mp-wp/wp-admin/images/icons32-vs.svg 7316c08035b11d5d6993bfdf508a2ac62aab555b9bb43b4ee31ed4df17546383681210bb6f7034db2c6be1a071db21fe4014ef54d345db42527810f311d1027f +++ b/mp-wp/wp-admin/images/icons32-vs.svg false @@ -1,308 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/icons32.svg b/mp-wp/wp-admin/images/icons32.svg --- a/mp-wp/wp-admin/images/icons32.svg b4938f0262a04c309e1e1f2cf0aa78c8e1fa89049655f44e6a7779a681d711f52d70630005aae782ae5ff1ff7b2838d19b121fbed03d47ba095647d1b476cf1a +++ b/mp-wp/wp-admin/images/icons32.svg false @@ -1,220 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/list-vs.svg b/mp-wp/wp-admin/images/list-vs.svg --- a/mp-wp/wp-admin/images/list-vs.svg b1f26a2a5f3fdd5ef0eee8b5af330ccd6ab739f19169dd4842ac15cf5ccd768ab1d10593a5ee0e1597f371468a19c1b2cf99715d33605a71bb3dcec096995bec +++ b/mp-wp/wp-admin/images/list-vs.svg false @@ -1,26 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/list.svg b/mp-wp/wp-admin/images/list.svg --- a/mp-wp/wp-admin/images/list.svg 2cb983a88480b3bdb398ba77bc8e003b5a583e3c81718758698fe942d289b47cc230b119de9c549a45abaa6eb2f6105aacf869116d39718db0cdbf690fc97829 +++ b/mp-wp/wp-admin/images/list.svg false @@ -1,25 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/loading.svg b/mp-wp/wp-admin/images/loading.svg --- a/mp-wp/wp-admin/images/loading.svg 6e85a48bc2baac5bb31c02fa767a5fca1ae25fe3d581db5f057863e1a95f2b7bd827fb00826a4b19f02a53e6b3b9576718323725b457a9657328516bad2c5e7a +++ b/mp-wp/wp-admin/images/loading.svg false @@ -1,116 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/logo-login.svg b/mp-wp/wp-admin/images/logo-login.svg --- a/mp-wp/wp-admin/images/logo-login.svg 4a023d9d343df7069c009460131be98f172f6cbe881bbf2e5aefea8a6fd8b148d2c51e62b20221b8b8951952fe489517250ae2c903690c8f21f3210ab3eb3b7a +++ b/mp-wp/wp-admin/images/logo-login.svg false @@ -1,90 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/logo.svg b/mp-wp/wp-admin/images/logo.svg --- a/mp-wp/wp-admin/images/logo.svg b661940f08e5cfa0485ed358aaded13297045594e732fdda71c7bc0d91e7722e3a9c63925d292e53a5b489b8c1e39abd14082a610ee82949385f23b040ed30b3 +++ b/mp-wp/wp-admin/images/logo.svg false @@ -1,28 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/marker.svg b/mp-wp/wp-admin/images/marker.svg --- a/mp-wp/wp-admin/images/marker.svg d1adb508c46e0d01aee16f57c371fa8711845d657c715675321745966c455441cc8ac8709cd3e4954d1843e26d202b4f3fb6e3350bd67da25c5df811ee6d5bcc +++ b/mp-wp/wp-admin/images/marker.svg false @@ -1,17 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/mask.svg b/mp-wp/wp-admin/images/mask.svg --- a/mp-wp/wp-admin/images/mask.svg fdfac238ffdb778d9c799de6672d984dfd8d2373eb4da3cbb091eb3a67b4c499fa99fa39e56ab8f24f33104bff757e937430a8e5a6ef5a91f65e8ed74ae45a85 +++ b/mp-wp/wp-admin/images/mask.svg false @@ -1,41 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/media-button-image.svg b/mp-wp/wp-admin/images/media-button-image.svg --- a/mp-wp/wp-admin/images/media-button-image.svg 3f97e34e7bb4c4e1f569009366f19a313e09fb65663030e43c7482b884dfac2a27a17fea35f5bb0896dc5abb62887f88c9973631ab903c8e27e553f7ec88424c +++ b/mp-wp/wp-admin/images/media-button-image.svg false @@ -1,7 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/media-button-music.svg b/mp-wp/wp-admin/images/media-button-music.svg --- a/mp-wp/wp-admin/images/media-button-music.svg 3c812c2543a44e952612e87aa64bf506397f1e1104145a7b09a8c5d58ec9290af8a0eba6f121e054661bae73b72427f4a2f31a1daaa729094575a24242e782fb +++ b/mp-wp/wp-admin/images/media-button-music.svg false @@ -1,9 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/media-button-other.svg b/mp-wp/wp-admin/images/media-button-other.svg --- a/mp-wp/wp-admin/images/media-button-other.svg a798206802cbecfbe7bc07a5a0dddbf329a38a05230d8eecddde20dfced85f0e07c70bc0e584b8539e3d39d8c2a690dd7021f4c3c9a56a6ec75c328cbe131e76 +++ b/mp-wp/wp-admin/images/media-button-other.svg false @@ -1,8 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/media-button-video.svg b/mp-wp/wp-admin/images/media-button-video.svg --- a/mp-wp/wp-admin/images/media-button-video.svg 2c9fa86b0c60099d0c114b7e436ca4a48f56835396af70bf5a7255d958e2c2f30bcff04bd02b210bdf2bea058b157c505949518cfe47a7ad4180d3fc4a7d6112 +++ b/mp-wp/wp-admin/images/media-button-video.svg false @@ -1,7 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/menu-arrows.svg b/mp-wp/wp-admin/images/menu-arrows.svg --- a/mp-wp/wp-admin/images/menu-arrows.svg 47ba465fab1555b7acfe7c73426b53fb85ed639d314ed6dfb5754d9f9c215d0aa7469604f0060b60a267ae0a3e39b1df441b4954592921d21a49234c91ef3198 +++ b/mp-wp/wp-admin/images/menu-arrows.svg false @@ -1,11 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/menu-bits-rtl.svg b/mp-wp/wp-admin/images/menu-bits-rtl.svg --- a/mp-wp/wp-admin/images/menu-bits-rtl.svg 732326351195a762ff6b8f7d0fb8678ef6ccbefa5b32281182bcf9593f00948a02eba81325dc3ccfcb3ba03506541df6de57e85552c59d2517f0bc3929e17fff +++ b/mp-wp/wp-admin/images/menu-bits-rtl.svg false @@ -1,28 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/menu-bits.svg b/mp-wp/wp-admin/images/menu-bits.svg --- a/mp-wp/wp-admin/images/menu-bits.svg ebd1b41ab7899e8dc67da7cd442db5dea572403a68f3d27a1ec872db842cf2968009d4e40d5a07915281d40ffdb211882de94367cdb331802e6f9891039a1aae +++ b/mp-wp/wp-admin/images/menu-bits.svg false @@ -1,26 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/menu-dark-rtl.svg b/mp-wp/wp-admin/images/menu-dark-rtl.svg --- a/mp-wp/wp-admin/images/menu-dark-rtl.svg a65d3d6eafe62904a2370315b3e8e55b40452c5aaf61d21a05b379228f662e1c1bedee6c885f328292ec31e5aefee253f6c91594f33d1c8ecd0028eaa2696661 +++ b/mp-wp/wp-admin/images/menu-dark-rtl.svg false @@ -1,22 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/menu-dark.svg b/mp-wp/wp-admin/images/menu-dark.svg --- a/mp-wp/wp-admin/images/menu-dark.svg cb973ce13105f5c481863367eacdc5c5dd896b3b456733b0da462b7f2038992190d4bfc56fc4e79aff3f794ffaedeb09954671e742a7ebebbd0f2990f497df01 +++ b/mp-wp/wp-admin/images/menu-dark.svg false @@ -1,10 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/menu-vs.svg b/mp-wp/wp-admin/images/menu-vs.svg --- a/mp-wp/wp-admin/images/menu-vs.svg 8e1bda905ddff051ec9ad763085f5b6dd264072f9d139f095c50a2ed9e6afdc015d490c754c502938c27e21410c8135faa15a5be25fe14f4575f9ab05b0fc6d7 +++ b/mp-wp/wp-admin/images/menu-vs.svg false @@ -1,252 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/menu.svg b/mp-wp/wp-admin/images/menu.svg --- a/mp-wp/wp-admin/images/menu.svg a2a3e8015a9dd35529149429fa86c78ad043d8e0803f4c40e8a96d3ec75d06cfcb58992f2f527572c635b139a7732d50550bcdacabef0b8229cbc101aaf392f7 +++ b/mp-wp/wp-admin/images/menu.svg false @@ -1,209 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/no.svg b/mp-wp/wp-admin/images/no.svg --- a/mp-wp/wp-admin/images/no.svg 08a4d1623ce5d7d96c41fbfb3d74a9589bb08c55b3bd3bf986f1339b12ef4337e7fd940bee6e19050f7e3a4fb9075a9905f722311565458bd687cbcd83205d3c +++ b/mp-wp/wp-admin/images/no.svg false @@ -1,19 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/required.svg b/mp-wp/wp-admin/images/required.svg --- a/mp-wp/wp-admin/images/required.svg ee66eeb74965a182755e4a7d7123598f17dd1dfc1669f3c2d8151361c13f77d8a2a18cec3cd8d265b72e2cdaf0cb65c16f3e4fd406c4438287ed10b0112d462b +++ b/mp-wp/wp-admin/images/required.svg false @@ -1,7 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/screen-options-left.svg b/mp-wp/wp-admin/images/screen-options-left.svg --- a/mp-wp/wp-admin/images/screen-options-left.svg 6ab564a84c795a2263abf5b962d0f16a315d44bf390808db960e915f445f532d66af8876015408f4791a9334f9b2aa52dc5dbc1751907a0bd227fdff661c52d3 +++ b/mp-wp/wp-admin/images/screen-options-left.svg false @@ -1,17 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/screen-options-right-up.svg b/mp-wp/wp-admin/images/screen-options-right-up.svg --- a/mp-wp/wp-admin/images/screen-options-right-up.svg 2c13cdee744499b78f71ab4a4e9838cbf6555945b60a04656a2c88d845f6ab737dbe6f025217b7897ebf7132fea2186fe42b7845baadebf555c363271ca26120 +++ b/mp-wp/wp-admin/images/screen-options-right-up.svg false @@ -1,10 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/screen-options-right.svg b/mp-wp/wp-admin/images/screen-options-right.svg --- a/mp-wp/wp-admin/images/screen-options-right.svg 3ce1986903c276e5d419bfb8d4fb1ca854223f72f403845620b5310dea2e47f4758816d88c2d973992e0f86451fedbf393b933768bd8dbfa2123bd78133b0bbb +++ b/mp-wp/wp-admin/images/screen-options-right.svg false @@ -1,10 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/se.svg b/mp-wp/wp-admin/images/se.svg --- a/mp-wp/wp-admin/images/se.svg 4ada0d9ca918ce279ba1902a9deb2ca487b7bd28adb17b6aa5dc9c7fd20b733be45d1d53e9ad0fee74523a4c0c6288fc7f38894f0d9e7dba0b674df9aef3051e +++ b/mp-wp/wp-admin/images/se.svg false @@ -1,8 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/star.svg b/mp-wp/wp-admin/images/star.svg --- a/mp-wp/wp-admin/images/star.svg c6722104c5034247692454f4f000f0d5e63f3929346269dc3d1b5d2936de450ab93f1dcad0b0ca0260c0291cbb86a9e19866b875ba8e286a08c174a55bf903ef +++ b/mp-wp/wp-admin/images/star.svg false @@ -1,7 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/wheel.svg b/mp-wp/wp-admin/images/wheel.svg --- a/mp-wp/wp-admin/images/wheel.svg a621dd6fb483f711896eb30f0debe642942c2dd5e257b295ffc797698464692de03c51e736a5377c79b428209f779296d663a1dd2dc61bbffc31e35112057b61 +++ b/mp-wp/wp-admin/images/wheel.svg false @@ -1,211 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/white-grad-active.svg b/mp-wp/wp-admin/images/white-grad-active.svg --- a/mp-wp/wp-admin/images/white-grad-active.svg 0b7ec8154ecaa06915932364cb84370a2c0fb71a421e6a4f8fbf415cd56ea15cd8b75e890ef44b5946ccf41c97c0633f2de1d4e61f9aa8c300bcca40cfb7a4f1 +++ b/mp-wp/wp-admin/images/white-grad-active.svg false @@ -1,9 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/white-grad.svg b/mp-wp/wp-admin/images/white-grad.svg --- a/mp-wp/wp-admin/images/white-grad.svg 2f92c9844b3f390e433c6df3b8f5304fcef6c0e85b80dde8f4972b349f4457e4f36b3c41c54a74715965fbbf944786f220b21bf02fc1aa1109b125d1e4a26a61 +++ b/mp-wp/wp-admin/images/white-grad.svg false @@ -1,9 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/wordpress-logo.svg b/mp-wp/wp-admin/images/wordpress-logo.svg --- a/mp-wp/wp-admin/images/wordpress-logo.svg dab33b25841c706fd49dddbb34cba56408eeebee53190302a15a9dfef12241ab05c9816bdecb080379c3b89a47ff76f30a86cecf87053df783c69fd775367643 +++ b/mp-wp/wp-admin/images/wordpress-logo.svg false @@ -1,46 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/wp-logo.svg b/mp-wp/wp-admin/images/wp-logo.svg --- a/mp-wp/wp-admin/images/wp-logo.svg eafc8b8af0024ae548f17132fb1b0ccf1962cfc7a55b254f00e8707c01a0c0676532ff0781aba8b8031e88d656b7c4edbefda845541641ab0dace6fadb329c86 +++ b/mp-wp/wp-admin/images/wp-logo.svg false @@ -1,25 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/xit.svg b/mp-wp/wp-admin/images/xit.svg --- a/mp-wp/wp-admin/images/xit.svg 2070e95c9e218f70e6d31b243c91159a7584ca293795eea88f9157ec048ada230a07d3db84b1053691d34dc1ff109ff6e444e92490b16856716bf73b5f779791 +++ b/mp-wp/wp-admin/images/xit.svg false @@ -1,9 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/images/yes.svg b/mp-wp/wp-admin/images/yes.svg --- a/mp-wp/wp-admin/images/yes.svg 389f7e705af0e96883c3b0cdbe428b9324e439c32288992bbb98fd70c7f4c101173ac77794a8e6a29bf2a7b96d6ceb0a355b25fccff5c7a583127cbdea34dead +++ b/mp-wp/wp-admin/images/yes.svg false @@ -1,16 +0,0 @@ - - - diff -uNr a/mp-wp/wp-admin/import/wordpress.php b/mp-wp/wp-admin/import/wordpress.php --- a/mp-wp/wp-admin/import/wordpress.php efae5b996de32533fa30deca52c2bd9912e8c34ec533abcebf2ae77fdca06740df26baf51dc54ec2b9f44a787936262047ac7750643fa60f30233f13bc774633 +++ b/mp-wp/wp-admin/import/wordpress.php false @@ -1,806 +0,0 @@ -'; - screen_icon(); - echo '

'.__('Import WordPress').'

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

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

'; - echo '

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

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

-

admins entries.'); ?>

-allow_create_users() ) { - echo '

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

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

-

- - -

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

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

'.__('Invalid file').'

'; - echo '

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

'; - } - } - - // fetch the user ID for a given author name, respecting the mapping preferences - function checkauthor($author) { - global $current_user; - - if ( !empty($this->author_ids[$author]) ) - return $this->author_ids[$author]; - - // failsafe: map to the current user - return $current_user->ID; - } - - - - function process_categories() { - global $wpdb; - - $cat_names = (array) get_terms('category', 'fields=names'); - - while ( $c = array_shift($this->categories) ) { - $cat_name = trim($this->get_tag( $c, 'wp:cat_name' )); - - // If the category exists we leave it alone - if ( in_array($cat_name, $cat_names) ) - continue; - - $category_nicename = $this->get_tag( $c, 'wp:category_nicename' ); - $posts_private = (int) $this->get_tag( $c, 'wp:posts_private' ); - $links_private = (int) $this->get_tag( $c, 'wp:links_private' ); - - $parent = $this->get_tag( $c, 'wp:category_parent' ); - - if ( empty($parent) ) - $category_parent = '0'; - else - $category_parent = category_exists($parent); - - $catarr = compact('category_nicename', 'category_parent', 'posts_private', 'links_private', 'posts_private', 'cat_name'); - - $cat_ID = wp_insert_category($catarr); - } - } - - function process_tags() { - global $wpdb; - - $tag_names = (array) get_terms('post_tag', 'fields=names'); - - while ( $c = array_shift($this->tags) ) { - $tag_name = trim($this->get_tag( $c, 'wp:tag_name' )); - - // If the category exists we leave it alone - if ( in_array($tag_name, $tag_names) ) - continue; - - $slug = $this->get_tag( $c, 'wp:tag_slug' ); - $description = $this->get_tag( $c, 'wp:tag_description' ); - - $tagarr = compact('slug', 'description'); - - $tag_ID = wp_insert_term($tag_name, 'post_tag', $tagarr); - } - } - - function process_author($post) { - $author = $this->get_tag( $post, 'dc:creator' ); - if ($author) - $this->allauthornames[] = $author; - } - - function process_posts() { - echo '
    '; - - $this->get_entries(array(&$this, 'process_post')); - - echo '
'; - - wp_import_cleanup($this->id); - do_action('import_done', 'wordpress'); - - echo '

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

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

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

    '; - echo '

    ' . $file['error'] . '

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

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

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

    -

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

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

    '; - echo '
    '; - echo '

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

    '; - echo '

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

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

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

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

    -

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

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

    '; ?> - -

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

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

    '; - echo '
    '; - echo '

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

    '; - echo '

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

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

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

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

    -

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

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

    '; ?> - -

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

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

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

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

    '; - echo '

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

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

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

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

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

    '; - echo '

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

    '; - } - - function init() { - - $step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1; - - $this->header(); - - if ( current_user_can('manage_categories') ) { - - switch ($step) { - case 1 : - $this->categories_tab(); - break; - - case 2 : - check_admin_referer('import-cat2tag'); - $this->convert_categories(); - break; - - case 3 : - $this->tags_tab(); - break; - - case 4 : - check_admin_referer('import-cat2tag'); - $this->convert_tags(); - break; - } - } - - $this->footer(); - } - - function WP_Categories_to_Tags() { - // Do nothing. - } -} - -$wp_cat2tag_importer = new WP_Categories_to_Tags(); - -register_importer('wp-cat2tag', __('Categories and Tags Converter'), __('Convert existing categories to tags or tags to categories, selectively.'), array(&$wp_cat2tag_importer, 'init')); - -?> diff -uNr a/mp-wp/wp-admin/import.php b/mp-wp/wp-admin/import.php --- a/mp-wp/wp-admin/import.php 897774b9d3f8540845fb15ecee11b90e2afe56017750628c7b28a28f10cd15bfacc4d640da4407d1064d28bf868f01df283cfbf144468affd79f08588b7d09e1 +++ b/mp-wp/wp-admin/import.php false @@ -1,73 +0,0 @@ - - -
    - -

    -

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

    '; // TODO: make more helpful -} else { -?> - - - $data) { - $style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate'; - $action = "{$data[0]}"; - - if ($style != '') - $style = 'class="'.$style.'"'; - echo " - - - - "; - } -?> - -
    $action{$data[1]}
    - - -
    - - - diff -uNr a/mp-wp/wp-admin/includes/class-pclzip.php b/mp-wp/wp-admin/includes/class-pclzip.php --- a/mp-wp/wp-admin/includes/class-pclzip.php 00f67e82c1c9704c47e73c6ef538b2a3859b0e79a9c39e74b0bfa5ff2e2aa11db6ac811f8a0702f08ed373846f650ecec2c2224c72ada4bd67a7cb6a818ca3df +++ b/mp-wp/wp-admin/includes/class-pclzip.php false @@ -1,5759 +0,0 @@ -define( 'PCLZIP_SEPARATOR', ' ' ); - * Recommanded values for smart separation of filenames. - */ -define( 'PCLZIP_SEPARATOR', ',' ); - -/** - * Error configuration - * - * 0 : PclZip Class integrated error handling - * 1 : PclError external library error handling. By enabling this you must - * ensure that you have included PclError library. - * [2,...] : reserved for future use - */ -define( 'PCLZIP_ERROR_EXTERNAL', 0 ); - - // ----- Optional static temporary directory - // By default temporary files are generated in the script current - // path. - // If defined : - // - MUST BE terminated by a '/'. - // - MUST be a valid, already created directory - // Samples : - // define( 'PCLZIP_TEMPORARY_DIR', '/temp/' ); - // define( 'PCLZIP_TEMPORARY_DIR', 'C:/Temp/' ); - define( 'PCLZIP_TEMPORARY_DIR', '' ); - -// -------------------------------------------------------------------------------- -// ***** UNDER THIS LINE NOTHING NEEDS TO BE MODIFIED ***** -// -------------------------------------------------------------------------------- - - // ----- Global variables - $g_pclzip_version = "2.5"; - - // ----- Error codes - // -1 : Unable to open file in binary write mode - // -2 : Unable to open file in binary read mode - // -3 : Invalid parameters - // -4 : File does not exist - // -5 : Filename is too long (max. 255) - // -6 : Not a valid zip file - // -7 : Invalid extracted file size - // -8 : Unable to create directory - // -9 : Invalid archive extension - // -10 : Invalid archive format - // -11 : Unable to delete file (unlink) - // -12 : Unable to rename file (rename) - // -13 : Invalid header checksum - // -14 : Invalid archive size - define( 'PCLZIP_ERR_USER_ABORTED', 2 ); - define( 'PCLZIP_ERR_NO_ERROR', 0 ); - define( 'PCLZIP_ERR_WRITE_OPEN_FAIL', -1 ); - define( 'PCLZIP_ERR_READ_OPEN_FAIL', -2 ); - define( 'PCLZIP_ERR_INVALID_PARAMETER', -3 ); - define( 'PCLZIP_ERR_MISSING_FILE', -4 ); - define( 'PCLZIP_ERR_FILENAME_TOO_LONG', -5 ); - define( 'PCLZIP_ERR_INVALID_ZIP', -6 ); - define( 'PCLZIP_ERR_BAD_EXTRACTED_FILE', -7 ); - define( 'PCLZIP_ERR_DIR_CREATE_FAIL', -8 ); - define( 'PCLZIP_ERR_BAD_EXTENSION', -9 ); - define( 'PCLZIP_ERR_BAD_FORMAT', -10 ); - define( 'PCLZIP_ERR_DELETE_FILE_FAIL', -11 ); - define( 'PCLZIP_ERR_RENAME_FILE_FAIL', -12 ); - define( 'PCLZIP_ERR_BAD_CHECKSUM', -13 ); - define( 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', -14 ); - define( 'PCLZIP_ERR_MISSING_OPTION_VALUE', -15 ); - define( 'PCLZIP_ERR_INVALID_OPTION_VALUE', -16 ); - define( 'PCLZIP_ERR_ALREADY_A_DIRECTORY', -17 ); - define( 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', -18 ); - define( 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION', -19 ); - define( 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE', -20 ); - define( 'PCLZIP_ERR_DIRECTORY_RESTRICTION', -21 ); - - // ----- Options values - define( 'PCLZIP_OPT_PATH', 77001 ); - define( 'PCLZIP_OPT_ADD_PATH', 77002 ); - define( 'PCLZIP_OPT_REMOVE_PATH', 77003 ); - define( 'PCLZIP_OPT_REMOVE_ALL_PATH', 77004 ); - define( 'PCLZIP_OPT_SET_CHMOD', 77005 ); - define( 'PCLZIP_OPT_EXTRACT_AS_STRING', 77006 ); - define( 'PCLZIP_OPT_NO_COMPRESSION', 77007 ); - define( 'PCLZIP_OPT_BY_NAME', 77008 ); - define( 'PCLZIP_OPT_BY_INDEX', 77009 ); - define( 'PCLZIP_OPT_BY_EREG', 77010 ); - define( 'PCLZIP_OPT_BY_PREG', 77011 ); - define( 'PCLZIP_OPT_COMMENT', 77012 ); - define( 'PCLZIP_OPT_ADD_COMMENT', 77013 ); - define( 'PCLZIP_OPT_PREPEND_COMMENT', 77014 ); - define( 'PCLZIP_OPT_EXTRACT_IN_OUTPUT', 77015 ); - define( 'PCLZIP_OPT_REPLACE_NEWER', 77016 ); - define( 'PCLZIP_OPT_STOP_ON_ERROR', 77017 ); - // Having big trouble with crypt. Need to multiply 2 long int - // which is not correctly supported by PHP ... - //define( 'PCLZIP_OPT_CRYPT', 77018 ); - define( 'PCLZIP_OPT_EXTRACT_DIR_RESTRICTION', 77019 ); - - // ----- File description attributes - define( 'PCLZIP_ATT_FILE_NAME', 79001 ); - define( 'PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002 ); - define( 'PCLZIP_ATT_FILE_NEW_FULL_NAME', 79003 ); - - // ----- Call backs values - define( 'PCLZIP_CB_PRE_EXTRACT', 78001 ); - define( 'PCLZIP_CB_POST_EXTRACT', 78002 ); - define( 'PCLZIP_CB_PRE_ADD', 78003 ); - define( 'PCLZIP_CB_POST_ADD', 78004 ); - /* For future use - define( 'PCLZIP_CB_PRE_LIST', 78005 ); - define( 'PCLZIP_CB_POST_LIST', 78006 ); - define( 'PCLZIP_CB_PRE_DELETE', 78007 ); - define( 'PCLZIP_CB_POST_DELETE', 78008 ); - */ - - // -------------------------------------------------------------------------------- - // Class : PclZip - // Description : - // PclZip is the class that represent a Zip archive. - // The public methods allow the manipulation of the archive. - // Attributes : - // Attributes must not be accessed directly. - // Methods : - // PclZip() : Object creator - // create() : Creates the Zip archive - // listContent() : List the content of the Zip archive - // extract() : Extract the content of the archive - // properties() : List the properties of the archive - // -------------------------------------------------------------------------------- - class PclZip - { - // ----- Filename of the zip file - var $zipname = ''; - - // ----- File descriptor of the zip file - var $zip_fd = 0; - - // ----- Internal error handling - var $error_code = 1; - var $error_string = ''; - - // ----- Current status of the magic_quotes_runtime - // This value store the php configuration for magic_quotes - // The class can then disable the magic_quotes and reset it after - var $magic_quotes_status; - - // -------------------------------------------------------------------------------- - // Function : PclZip() - // Description : - // Creates a PclZip object and set the name of the associated Zip archive - // filename. - // Note that no real action is taken, if the archive does not exist it is not - // created. Use create() for that. - // -------------------------------------------------------------------------------- - function PclZip($p_zipname) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::PclZip', "zipname=$p_zipname"); - - // ----- Tests the zlib - if (!function_exists('gzopen')) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 1, "zlib extension seems to be missing"); - die('Abort '.basename(__FILE__).' : Missing zlib extensions'); - } - - // ----- Set the attributes - $this->zipname = $p_zipname; - $this->zip_fd = 0; - $this->magic_quotes_status = -1; - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 1); - return; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // create($p_filelist, $p_add_dir="", $p_remove_dir="") - // create($p_filelist, $p_option, $p_option_value, ...) - // Description : - // This method supports two different synopsis. The first one is historical. - // This method creates a Zip Archive. The Zip file is created in the - // filesystem. The files and directories indicated in $p_filelist - // are added in the archive. See the parameters description for the - // supported format of $p_filelist. - // When a directory is in the list, the directory and its content is added - // in the archive. - // In this synopsis, the function takes an optional variable list of - // options. See bellow the supported options. - // Parameters : - // $p_filelist : An array containing file or directory names, or - // a string containing one filename or one directory name, or - // a string containing a list of filenames and/or directory - // names separated by spaces. - // $p_add_dir : A path to add before the real path of the archived file, - // in order to have it memorized in the archive. - // $p_remove_dir : A path to remove from the real path of the file to archive, - // in order to have a shorter path memorized in the archive. - // When $p_add_dir and $p_remove_dir are set, $p_remove_dir - // is removed first, before $p_add_dir is added. - // Options : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_COMMENT : - // PCLZIP_CB_PRE_ADD : - // PCLZIP_CB_POST_ADD : - // Return Values : - // 0 on failure, - // The list of the added files, with a status of the add action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function create($p_filelist) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::create', "filelist='$p_filelist', ..."); - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Set default values - $v_options = array(); - $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove from the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected"); - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_ADD => 'optional', - PCLZIP_CB_POST_ADD => 'optional', - PCLZIP_OPT_NO_COMPRESSION => 'optional', - PCLZIP_OPT_COMMENT => 'optional' - //, PCLZIP_OPT_CRYPT => 'optional' - )); - if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); - - // ----- Get the first argument - $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; - } - else if ($v_size > 2) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Invalid number / type of arguments"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return 0; - } - } - } - - // ----- Init - $v_string_list = array(); - $v_att_list = array(); - $v_filedescr_list = array(); - $p_result_list = array(); - - // ----- Look if the $p_filelist is really an array - if (is_array($p_filelist)) { - - // ----- Look if the first element is also an array - // This will mean that this is a file description entry - if (isset($p_filelist[0]) && is_array($p_filelist[0])) { - $v_att_list = $p_filelist; - } - - // ----- The list is a list of string names - else { - $v_string_list = $p_filelist; - } - } - - // ----- Look if the $p_filelist is a string - else if (is_string($p_filelist)) { - // ----- Create a list from the string - $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); - } - - // ----- Invalid variable type for $p_filelist - else { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - - // ----- Reformat the string list - if (sizeof($v_string_list) != 0) { - foreach ($v_string_list as $v_string) { - if ($v_string != '') { - $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Ignore an empty filename"); - } - } - } - - // ----- For each file in the list check the attributes - $v_supported_attributes - = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' - ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' - ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' - ); - foreach ($v_att_list as $v_entry) { - $v_result = $this->privFileDescrParseAtt($v_entry, - $v_filedescr_list[], - $v_options, - $v_supported_attributes); - if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - } - - // ----- Expand the filelist (expand directories) - $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); - if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - - // ----- Call the create fct - $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options); - if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list); - return $p_result_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // add($p_filelist, $p_add_dir="", $p_remove_dir="") - // add($p_filelist, $p_option, $p_option_value, ...) - // Description : - // This method supports two synopsis. The first one is historical. - // This methods add the list of files in an existing archive. - // If a file with the same name already exists, it is added at the end of the - // archive, the first one is still present. - // If the archive does not exist, it is created. - // Parameters : - // $p_filelist : An array containing file or directory names, or - // a string containing one filename or one directory name, or - // a string containing a list of filenames and/or directory - // names separated by spaces. - // $p_add_dir : A path to add before the real path of the archived file, - // in order to have it memorized in the archive. - // $p_remove_dir : A path to remove from the real path of the file to archive, - // in order to have a shorter path memorized in the archive. - // When $p_add_dir and $p_remove_dir are set, $p_remove_dir - // is removed first, before $p_add_dir is added. - // Options : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_COMMENT : - // PCLZIP_OPT_ADD_COMMENT : - // PCLZIP_OPT_PREPEND_COMMENT : - // PCLZIP_CB_PRE_ADD : - // PCLZIP_CB_POST_ADD : - // Return Values : - // 0 on failure, - // The list of the added files, with a status of the add action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function add($p_filelist) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::add', "filelist='$p_filelist', ..."); - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Set default values - $v_options = array(); - $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove form the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected"); - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_ADD => 'optional', - PCLZIP_CB_POST_ADD => 'optional', - PCLZIP_OPT_NO_COMPRESSION => 'optional', - PCLZIP_OPT_COMMENT => 'optional', - PCLZIP_OPT_ADD_COMMENT => 'optional', - PCLZIP_OPT_PREPEND_COMMENT => 'optional' - //, PCLZIP_OPT_CRYPT => 'optional' - )); - if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); - - // ----- Get the first argument - $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return 0; - } - } - } - - // ----- Init - $v_string_list = array(); - $v_att_list = array(); - $v_filedescr_list = array(); - $p_result_list = array(); - - // ----- Look if the $p_filelist is really an array - if (is_array($p_filelist)) { - - // ----- Look if the first element is also an array - // This will mean that this is a file description entry - if (isset($p_filelist[0]) && is_array($p_filelist[0])) { - $v_att_list = $p_filelist; - } - - // ----- The list is a list of string names - else { - $v_string_list = $p_filelist; - } - } - - // ----- Look if the $p_filelist is a string - else if (is_string($p_filelist)) { - // ----- Create a list from the string - $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); - } - - // ----- Invalid variable type for $p_filelist - else { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - - // ----- Reformat the string list - if (sizeof($v_string_list) != 0) { - foreach ($v_string_list as $v_string) { - $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; - } - } - - // ----- For each file in the list check the attributes - $v_supported_attributes - = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' - ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' - ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' - ); - foreach ($v_att_list as $v_entry) { - $v_result = $this->privFileDescrParseAtt($v_entry, - $v_filedescr_list[], - $v_options, - $v_supported_attributes); - if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - } - - // ----- Expand the filelist (expand directories) - $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); - if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - - // ----- Call the create fct - $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options); - if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list); - return $p_result_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : listContent() - // Description : - // This public method, gives the list of the files and directories, with their - // properties. - // The properties of each entries in the list are (used also in other functions) : - // filename : Name of the file. For a create or add action it is the filename - // given by the user. For an extract function it is the filename - // of the extracted file. - // stored_filename : Name of the file / directory stored in the archive. - // size : Size of the stored file. - // compressed_size : Size of the file's data compressed in the archive - // (without the headers overhead) - // mtime : Last known modification date of the file (UNIX timestamp) - // comment : Comment associated with the file - // folder : true | false - // index : index of the file in the archive - // status : status of the action (depending of the action) : - // Values are : - // ok : OK ! - // filtered : the file / dir is not extracted (filtered by user) - // already_a_directory : the file can not be extracted because a - // directory with the same name already exists - // write_protected : the file can not be extracted because a file - // with the same name already exists and is - // write protected - // newer_exist : the file was not extracted because a newer file exists - // path_creation_fail : the file is not extracted because the folder - // does not exists and can not be created - // write_error : the file was not extracted because there was a - // error while writing the file - // read_error : the file was not extracted because there was a error - // while reading the file - // invalid_header : the file was not extracted because of an archive - // format error (bad file header) - // Note that each time a method can continue operating when there - // is an action error on a file, the error is only logged in the file status. - // Return Values : - // 0 on an unrecoverable failure, - // The list of the files in the archive. - // -------------------------------------------------------------------------------- - function listContent() - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::listContent', ""); - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return(0); - } - - // ----- Call the extracting fct - $p_list = array(); - if (($v_result = $this->privList($p_list)) != 1) - { - unset($p_list); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); - return(0); - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // extract($p_path="./", $p_remove_path="") - // extract([$p_option, $p_option_value, ...]) - // Description : - // This method supports two synopsis. The first one is historical. - // This method extract all the files / directories from the archive to the - // folder indicated in $p_path. - // If you want to ignore the 'root' part of path of the memorized files - // you can indicate this in the optional $p_remove_path parameter. - // By default, if a newer file with the same name already exists, the - // file is not extracted. - // - // If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions - // are used, the path indicated in PCLZIP_OPT_ADD_PATH is append - // at the end of the path value of PCLZIP_OPT_PATH. - // Parameters : - // $p_path : Path where the files and directories are to be extracted - // $p_remove_path : First part ('root' part) of the memorized path - // (if any similar) to remove while extracting. - // Options : - // PCLZIP_OPT_PATH : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_CB_PRE_EXTRACT : - // PCLZIP_CB_POST_EXTRACT : - // Return Values : - // 0 or a negative value on failure, - // The list of the extracted files, with a status of the action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function extract() - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extract", ""); - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return(0); - } - - // ----- Set default values - $v_options = array(); -// $v_path = "./"; - $v_path = ''; - $v_remove_path = ""; - $v_remove_all_path = false; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); - - // ----- Default values for option - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - - // ----- Look for arguments - if ($v_size > 0) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options"); - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_PATH => 'optional', - PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_EXTRACT => 'optional', - PCLZIP_CB_POST_EXTRACT => 'optional', - PCLZIP_OPT_SET_CHMOD => 'optional', - PCLZIP_OPT_BY_NAME => 'optional', - PCLZIP_OPT_BY_EREG => 'optional', - PCLZIP_OPT_BY_PREG => 'optional', - PCLZIP_OPT_BY_INDEX => 'optional', - PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', - PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional', - PCLZIP_OPT_REPLACE_NEWER => 'optional' - ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' - ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional' - )); - if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - - // ----- Set the arguments - if (isset($v_options[PCLZIP_OPT_PATH])) { - $v_path = $v_options[PCLZIP_OPT_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { - $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { - // ----- Check for '/' in last path char - if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { - $v_path .= '/'; - } - $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); - - // ----- Get the first argument - $v_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_remove_path = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); - return 0; - } - } - } - - // ----- Trace - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'"); - - // ----- Call the extracting fct - $p_list = array(); - $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, - $v_remove_all_path, $v_options); - if ($v_result < 1) { - unset($p_list); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); - return(0); - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); - return $p_list; - } - // -------------------------------------------------------------------------------- - - - // -------------------------------------------------------------------------------- - // Function : - // extractByIndex($p_index, $p_path="./", $p_remove_path="") - // extractByIndex($p_index, [$p_option, $p_option_value, ...]) - // Description : - // This method supports two synopsis. The first one is historical. - // This method is doing a partial extract of the archive. - // The extracted files or folders are identified by their index in the - // archive (from 0 to n). - // Note that if the index identify a folder, only the folder entry is - // extracted, not all the files included in the archive. - // Parameters : - // $p_index : A single index (integer) or a string of indexes of files to - // extract. The form of the string is "0,4-6,8-12" with only numbers - // and '-' for range or ',' to separate ranges. No spaces or ';' - // are allowed. - // $p_path : Path where the files and directories are to be extracted - // $p_remove_path : First part ('root' part) of the memorized path - // (if any similar) to remove while extracting. - // Options : - // PCLZIP_OPT_PATH : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and - // not as files. - // The resulting content is in a new field 'content' in the file - // structure. - // This option must be used alone (any other options are ignored). - // PCLZIP_CB_PRE_EXTRACT : - // PCLZIP_CB_POST_EXTRACT : - // Return Values : - // 0 on failure, - // The list of the extracted files, with a status of the action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - //function extractByIndex($p_index, options...) - function extractByIndex($p_index) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extractByIndex", "index='$p_index', ..."); - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return(0); - } - - // ----- Set default values - $v_options = array(); -// $v_path = "./"; - $v_path = ''; - $v_remove_path = ""; - $v_remove_all_path = false; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); - - // ----- Default values for option - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove form the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options"); - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_PATH => 'optional', - PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_EXTRACT => 'optional', - PCLZIP_CB_POST_EXTRACT => 'optional', - PCLZIP_OPT_SET_CHMOD => 'optional', - PCLZIP_OPT_REPLACE_NEWER => 'optional' - ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' - ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional' - )); - if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - - // ----- Set the arguments - if (isset($v_options[PCLZIP_OPT_PATH])) { - $v_path = $v_options[PCLZIP_OPT_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { - $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { - // ----- Check for '/' in last path char - if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { - $v_path .= '/'; - } - $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; - } - if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) { - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING not set."); - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING set."); - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis"); - - // ----- Get the first argument - $v_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_remove_path = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return 0; - } - } - } - - // ----- Trace - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "index='$p_index', path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'"); - - // ----- Trick - // Here I want to reuse extractByRule(), so I need to parse the $p_index - // with privParseOptions() - $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index); - $v_options_trick = array(); - $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick, - array (PCLZIP_OPT_BY_INDEX => 'optional' )); - if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX]; - - // ----- Call the extracting fct - if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); - return(0); - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // delete([$p_option, $p_option_value, ...]) - // Description : - // This method removes files from the archive. - // If no parameters are given, then all the archive is emptied. - // Parameters : - // None or optional arguments. - // Options : - // PCLZIP_OPT_BY_INDEX : - // PCLZIP_OPT_BY_NAME : - // PCLZIP_OPT_BY_EREG : - // PCLZIP_OPT_BY_PREG : - // Return Values : - // 0 on failure, - // The list of the files which are still present in the archive. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function delete() - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::delete", ""); - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return(0); - } - - // ----- Set default values - $v_options = array(); - - // ----- Look for variable options arguments - $v_size = func_num_args(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method"); - - // ----- Look for arguments - if ($v_size > 0) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_BY_NAME => 'optional', - PCLZIP_OPT_BY_EREG => 'optional', - PCLZIP_OPT_BY_PREG => 'optional', - PCLZIP_OPT_BY_INDEX => 'optional' )); - if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - } - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Call the delete fct - $v_list = array(); - if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) { - $this->privSwapBackMagicQuotes(); - unset($v_list); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo()); - return(0); - } - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_list); - return $v_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : deleteByIndex() - // Description : - // ***** Deprecated ***** - // delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered. - // -------------------------------------------------------------------------------- - function deleteByIndex($p_index) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::deleteByIndex", "index='$p_index'"); - - $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list); - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : properties() - // Description : - // This method gives the properties of the archive. - // The properties are : - // nb : Number of files in the archive - // comment : Comment associated with the archive file - // status : not_exist, ok - // Parameters : - // None - // Return Values : - // 0 on failure, - // An array with the archive properties. - // -------------------------------------------------------------------------------- - function properties() - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::properties", ""); - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return(0); - } - - // ----- Default properties - $v_prop = array(); - $v_prop['comment'] = ''; - $v_prop['nb'] = 0; - $v_prop['status'] = 'not_exist'; - - // ----- Look if file exists - if (@is_file($this->zipname)) - { - // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); - if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) - { - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), 0); - return 0; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return 0; - } - - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Set the user attributes - $v_prop['comment'] = $v_central_dir['comment']; - $v_prop['nb'] = $v_central_dir['entries']; - $v_prop['status'] = 'ok'; - } - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_prop); - return $v_prop; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : duplicate() - // Description : - // This method creates an archive by copying the content of an other one. If - // the archive already exist, it is replaced by the new one without any warning. - // Parameters : - // $p_archive : The filename of a valid archive, or - // a valid PclZip object. - // Return Values : - // 1 on success. - // 0 or a negative value on error (error code). - // -------------------------------------------------------------------------------- - function duplicate($p_archive) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::duplicate", ""); - $v_result = 1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Look if the $p_archive is a PclZip object - if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is valid PclZip object '".$p_archive->zipname."'"); - - // ----- Duplicate the archive - $v_result = $this->privDuplicate($p_archive->zipname); - } - - // ----- Look if the $p_archive is a string (so a filename) - else if (is_string($p_archive)) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is a filename '$p_archive'"); - - // ----- Check that $p_archive is a valid zip file - // TBC : Should also check the archive format - if (!is_file($p_archive)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'"); - $v_result = PCLZIP_ERR_MISSING_FILE; - } - else { - // ----- Duplicate the archive - $v_result = $this->privDuplicate($p_archive); - } - } - - // ----- Invalid variable - else - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); - $v_result = PCLZIP_ERR_INVALID_PARAMETER; - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : merge() - // Description : - // This method merge the $p_archive_to_add archive at the end of the current - // one ($this). - // If the archive ($this) does not exist, the merge becomes a duplicate. - // If the $p_archive_to_add archive does not exist, the merge is a success. - // Parameters : - // $p_archive_to_add : It can be directly the filename of a valid zip archive, - // or a PclZip object archive. - // Return Values : - // 1 on success, - // 0 or negative values on error (see below). - // -------------------------------------------------------------------------------- - function merge($p_archive_to_add) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::merge", ""); - $v_result = 1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0); - return(0); - } - - // ----- Look if the $p_archive_to_add is a PclZip object - if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is valid PclZip object"); - - // ----- Merge the archive - $v_result = $this->privMerge($p_archive_to_add); - } - - // ----- Look if the $p_archive_to_add is a string (so a filename) - else if (is_string($p_archive_to_add)) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is a filename"); - - // ----- Create a temporary archive - $v_object_archive = new PclZip($p_archive_to_add); - - // ----- Merge the archive - $v_result = $this->privMerge($v_object_archive); - } - - // ----- Invalid variable - else - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); - $v_result = PCLZIP_ERR_INVALID_PARAMETER; - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - - - // -------------------------------------------------------------------------------- - // Function : errorCode() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorCode() - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - return(PclErrorCode()); - } - else { - return($this->error_code); - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : errorName() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorName($p_with_code=false) - { - $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR', - PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL', - PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL', - PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER', - PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE', - PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG', - PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP', - PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE', - PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL', - PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION', - PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT', - PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL', - PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL', - PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM', - PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', - PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE', - PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE', - PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', - PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION' - ,PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE' - ,PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION' - ); - - if (isset($v_name[$this->error_code])) { - $v_value = $v_name[$this->error_code]; - } - else { - $v_value = 'NoName'; - } - - if ($p_with_code) { - return($v_value.' ('.$this->error_code.')'); - } - else { - return($v_value); - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : errorInfo() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorInfo($p_full=false) - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - return(PclErrorString()); - } - else { - if ($p_full) { - return($this->errorName(true)." : ".$this->error_string); - } - else { - return($this->error_string." [code ".$this->error_code."]"); - } - } - } - // -------------------------------------------------------------------------------- - - -// -------------------------------------------------------------------------------- -// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS ***** -// ***** ***** -// ***** THESES FUNCTIONS MUST NOT BE USED DIRECTLY ***** -// -------------------------------------------------------------------------------- - - - - // -------------------------------------------------------------------------------- - // Function : privCheckFormat() - // Description : - // This method check that the archive exists and is a valid zip archive. - // Several level of check exists. (futur) - // Parameters : - // $p_level : Level of check. Default 0. - // 0 : Check the first bytes (magic codes) (default value)) - // 1 : 0 + Check the central directory (futur) - // 2 : 1 + Check each file header (futur) - // Return Values : - // true on success, - // false on error, the error code is set. - // -------------------------------------------------------------------------------- - function privCheckFormat($p_level=0) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFormat", ""); - $v_result = true; - - // ----- Reset the file system cache - clearstatcache(); - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Look if the file exits - if (!is_file($this->zipname)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo()); - return(false); - } - - // ----- Check that the file is readeable - if (!is_readable($this->zipname)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo()); - return(false); - } - - // ----- Check the magic code - // TBC - - // ----- Check the central header - // TBC - - // ----- Check each file header - // TBC - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privParseOptions() - // Description : - // This internal methods reads the variable list of arguments ($p_options_list, - // $p_size) and generate an array with the options and values ($v_result_list). - // $v_requested_options contains the options that can be present and those that - // must be present. - // $v_requested_options is an array, with the option value as key, and 'optional', - // or 'mandatory' as value. - // Parameters : - // See above. - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privParseOptions", ""); - $v_result=1; - - // ----- Read the options - $i=0; - while ($i<$p_size) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Looking for table index $i, option = '".PclZipUtilOptionText($p_options_list[$i])."(".$p_options_list[$i].")'"); - - // ----- Check if the option is supported - if (!isset($v_requested_options[$p_options_list[$i]])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Look for next option - switch ($p_options_list[$i]) { - // ----- Look for options that request a path value - case PCLZIP_OPT_PATH : - case PCLZIP_OPT_REMOVE_PATH : - case PCLZIP_OPT_ADD_PATH : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Get the value - $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); - $i++; - break; - - case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Get the value - if ( is_string($p_options_list[$i+1]) - && ($p_options_list[$i+1] != '')) { - $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); - $i++; - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." set with an empty value is ignored."); - } - break; - - // ----- Look for options that request an array of string for value - case PCLZIP_OPT_BY_NAME : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1]; - } - else if (is_array($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); - $i++; - break; - - // ----- Look for options that request an EREG or PREG expression - case PCLZIP_OPT_BY_EREG : - case PCLZIP_OPT_BY_PREG : - //case PCLZIP_OPT_CRYPT : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); - $i++; - break; - - // ----- Look for options that takes a string - case PCLZIP_OPT_COMMENT : - case PCLZIP_OPT_ADD_COMMENT : - case PCLZIP_OPT_PREPEND_COMMENT : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, - "Missing parameter value for option '" - .PclZipUtilOptionText($p_options_list[$i]) - ."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, - "Wrong parameter value for option '" - .PclZipUtilOptionText($p_options_list[$i]) - ."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); - $i++; - break; - - // ----- Look for options that request an array of index - case PCLZIP_OPT_BY_INDEX : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Get the value - $v_work_list = array(); - if (is_string($p_options_list[$i+1])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is a string '".$p_options_list[$i+1]."'"); - - // ----- Remove spaces - $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', ''); - - // ----- Parse items - $v_work_list = explode(",", $p_options_list[$i+1]); - } - else if (is_integer($p_options_list[$i+1])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an integer '".$p_options_list[$i+1]."'"); - $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1]; - } - else if (is_array($p_options_list[$i+1])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an array"); - $v_work_list = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Reduce the index list - // each index item in the list must be a couple with a start and - // an end value : [0,3], [5-5], [8-10], ... - // ----- Check the format of each item - $v_sort_flag=false; - $v_sort_value=0; - for ($j=0; $j= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Get the value - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'"); - $i++; - break; - - // ----- Look for options that request a call-back - case PCLZIP_CB_PRE_EXTRACT : - case PCLZIP_CB_POST_EXTRACT : - case PCLZIP_CB_PRE_ADD : - case PCLZIP_CB_POST_ADD : - /* for futur use - case PCLZIP_CB_PRE_DELETE : - case PCLZIP_CB_POST_DELETE : - case PCLZIP_CB_PRE_LIST : - case PCLZIP_CB_POST_LIST : - */ - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Get the value - $v_function_name = $p_options_list[$i+1]; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "call-back ".PclZipUtilOptionText($p_options_list[$i])." = '".$v_function_name."'"); - - // ----- Check that the value is a valid existing function - if (!function_exists($v_function_name)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Set the attribute - $v_result_list[$p_options_list[$i]] = $v_function_name; - $i++; - break; - - default : - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Unknown parameter '" - .$p_options_list[$i]."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Next options - $i++; - } - - // ----- Look for mandatory options - if ($v_requested_options !== false) { - for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { - // ----- Look for mandatory option - if ($v_requested_options[$key] == 'mandatory') { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Detect a mandatory option : ".PclZipUtilOptionText($key)."(".$key.")"); - // ----- Look if present - if (!isset($v_result_list[$key])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - } - } - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privFileDescrParseAtt() - // Description : - // Parameters : - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrParseAtt", ""); - $v_result=1; - - // ----- For each file in the list check the attributes - foreach ($p_file_list as $v_key => $v_value) { - - // ----- Check if the option is supported - if (!isset($v_requested_options[$v_key])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Look for attribute - switch ($v_key) { - case PCLZIP_ATT_FILE_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - $p_filedescr['filename'] = PclZipUtilPathReduction($v_value); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'"); - - if ($p_filedescr['filename'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - break; - - case PCLZIP_ATT_FILE_NEW_SHORT_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'"); - - if ($p_filedescr['new_short_name'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - break; - - case PCLZIP_ATT_FILE_NEW_FULL_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'"); - - if ($p_filedescr['new_full_name'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - break; - - default : - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Unknown parameter '".$v_key."'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Look for mandatory options - if ($v_requested_options !== false) { - for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { - // ----- Look for mandatory option - if ($v_requested_options[$key] == 'mandatory') { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Detect a mandatory option : ".PclZipUtilOptionText($key)."(".$key.")"); - // ----- Look if present - if (!isset($p_file_list[$key])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - } - } - } - - // end foreach - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privFileDescrExpand() - // Description : - // Parameters : - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privFileDescrExpand(&$p_filedescr_list, &$p_options) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrExpand", ""); - $v_result=1; - - // ----- Create a result list - $v_result_list = array(); - - // ----- Look each entry - for ($i=0; $iprivCalculateStoredFilename($v_descr, $p_options); - - // ----- Add the descriptor in result list - $v_result_list[sizeof($v_result_list)] = $v_descr; - - // ----- Look for folder - if ($v_descr['type'] == 'folder') { - // ----- List of items in folder - $v_dirlist_descr = array(); - $v_dirlist_nb = 0; - if ($v_folder_handler = @opendir($v_descr['filename'])) { - while (($v_item_handler = @readdir($v_folder_handler)) !== false) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for '".$v_item_handler."' in the directory"); - - // ----- Skip '.' and '..' - if (($v_item_handler == '.') || ($v_item_handler == '..')) { - continue; - } - - // ----- Compose the full filename - $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler; - - // ----- Look for different stored filename - // Because the name of the folder was changed, the name of the - // files/sub-folders also change - if ($v_descr['stored_filename'] != $v_descr['filename']) { - $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler; - } - - $v_dirlist_nb++; - } - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to open dir '".$v_descr['filename']."' in read mode. Skipped."); - // TBC : unable to open folder in read mode - } - - // ----- Expand each element of the list - if ($v_dirlist_nb != 0) { - // ----- Expand - if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Concat the resulting list - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Merging result list (size '".sizeof($v_result_list)."') with dirlist (size '".sizeof($v_dirlist_descr)."')"); - $v_result_list = array_merge($v_result_list, $v_dirlist_descr); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "merged result list is size '".sizeof($v_result_list)."'"); - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Nothing in this folder to expand."); - } - - // ----- Free local array - unset($v_dirlist_descr); - } - } - - // ----- Get the result list - $p_filedescr_list = $v_result_list; - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCreate() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privCreate($p_filedescr_list, &$p_result_list, &$p_options) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCreate", "list"); - $v_result=1; - $v_list_detail = array(); - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the file in write mode - if (($v_result = $this->privOpenFd('wb')) != 1) - { - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Add the list of files - $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options); - - // ----- Close - $this->privCloseFd(); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAdd() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAdd($p_filedescr_list, &$p_result_list, &$p_options) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAdd", "list"); - $v_result=1; - $v_list_detail = array(); - - // ----- Look if the archive exists or is empty - if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0)) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, or is empty, create it."); - - // ----- Do a create - $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Go to beginning of File - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); - @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Open the temporary file in write mode - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); - if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) - { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = $v_central_dir['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); - $v_buffer = fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Swap the file descriptor - // Here is a trick : I swap the temporary fd with the zip fd, in order to use - // the following methods on the temporary fil and not the real archive - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Add the files - $v_header_list = array(); - if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) - { - fclose($v_zip_temp_fd); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - $this->privSwapBackMagicQuotes(); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset"); - - // ----- Copy the block of file headers from the old archive - $v_size = $v_central_dir['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); - $v_buffer = @fread($v_zip_temp_fd, $v_read_size); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Create the Central Dir files header - for ($i=0, $v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { - fclose($v_zip_temp_fd); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - $this->privSwapBackMagicQuotes(); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - $v_count++; - } - - // ----- Transform the header to a 'usable' info - $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - // ----- Zip file comment - $v_comment = $v_central_dir['comment']; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) { - $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT]; - } - if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($this->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1) - { - // ----- Reset the file list - unset($v_header_list); - $this->privSwapBackMagicQuotes(); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Swap back the file descriptor - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Close - $this->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privOpenFd() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privOpenFd($p_mode) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privOpenFd", 'mode='.$p_mode); - $v_result=1; - - // ----- Look if already open - if ($this->zip_fd != 0) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Open file in '.$p_mode.' mode'); - if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCloseFd() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privCloseFd() - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCloseFd", ""); - $v_result=1; - - if ($this->zip_fd != 0) - @fclose($this->zip_fd); - $this->zip_fd = 0; - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddList() - // Description : - // $p_add_dir and $p_remove_dir will give the ability to memorize a path which is - // different from the real path of the file. This is usefull if you want to have PclTar - // running in any directory, and memorize relative path from an other directory. - // Parameters : - // $p_list : An array containing the file or directory names to add in the tar - // $p_result_list : list of added files with their properties (specially the status field) - // $p_add_dir : Path to add in the filename path archived - // $p_remove_dir : Path to remove in the filename path archived - // Return Values : - // -------------------------------------------------------------------------------- -// function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) - function privAddList($p_filedescr_list, &$p_result_list, &$p_options) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddList", "list"); - $v_result=1; - - // ----- Add the files - $v_header_list = array(); - if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) - { - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($this->zip_fd); - - // ----- Create the Central Dir files header - for ($i=0,$v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - $v_count++; - } - - // ----- Transform the header to a 'usable' info - $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - // ----- Zip file comment - $v_comment = ''; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($this->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1) - { - // ----- Reset the file list - unset($v_header_list); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFileList() - // Description : - // Parameters : - // $p_filedescr_list : An array containing the file description - // or directory names to add in the zip - // $p_result_list : list of added files with their properties (specially the status field) - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFileList", "filedescr_list"); - $v_result=1; - $v_header = array(); - - // ----- Recuperate the current number of elt in list - $v_nb = sizeof($p_result_list); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Before add, list have ".$v_nb." elements"); - - // ----- Loop on the files - for ($j=0; ($jprivAddFile($p_filedescr_list[$j], $v_header, - $p_options); - if ($v_result != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Store the file infos - $p_result_list[$v_nb++] = $v_header; - } - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "After add, list have ".$v_nb." elements"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFile() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFile($p_filedescr, &$p_header, &$p_options) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFile", "filename='".$p_filedescr['filename']."'"); - $v_result=1; - - // ----- Working variable - $p_filename = $p_filedescr['filename']; - - // TBC : Already done in the fileAtt check ... ? - if ($p_filename == "") { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Look for a stored different filename - if (isset($p_filedescr['stored_filename'])) { - $v_stored_filename = $p_filedescr['stored_filename']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'Stored filename is NOT the same "'.$v_stored_filename.'"'); - } - else { - $v_stored_filename = $p_filedescr['stored_filename']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'Stored filename is the same'); - } - - // ----- Set the file properties - clearstatcache(); - $p_header['version'] = 20; - $p_header['version_extracted'] = 10; - $p_header['flag'] = 0; - $p_header['compression'] = 0; - $p_header['mtime'] = filemtime($p_filename); - $p_header['crc'] = 0; - $p_header['compressed_size'] = 0; - $p_header['size'] = filesize($p_filename); - $p_header['filename_len'] = strlen($p_filename); - $p_header['extra_len'] = 0; - $p_header['comment_len'] = 0; - $p_header['disk'] = 0; - $p_header['internal'] = 0; -// $p_header['external'] = (is_file($p_filename)?0xFE49FFE0:0x41FF0010); - $p_header['external'] = (is_file($p_filename)?0x00000000:0x00000010); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header external extension '".sprintf("0x%X",$p_header['external'])."'"); - $p_header['offset'] = 0; - $p_header['filename'] = $p_filename; - $p_header['stored_filename'] = $v_stored_filename; - $p_header['extra'] = ''; - $p_header['comment'] = ''; - $p_header['status'] = 'ok'; - $p_header['index'] = -1; - - // ----- Look for pre-add callback - if (isset($p_options[PCLZIP_CB_PRE_ADD])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_ADD]."()') is defined for the extraction"); - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_header, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. - eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);'); - if ($v_result == 0) { - // ----- Change the file status - $p_header['status'] = "skipped"; - $v_result = 1; - } - - // ----- Update the informations - // Only some fields can be modified - if ($p_header['stored_filename'] != $v_local_header['stored_filename']) { - $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New stored filename is '".$p_header['stored_filename']."'"); - } - } - - // ----- Look for empty stored filename - if ($p_header['stored_filename'] == "") { - $p_header['status'] = "filtered"; - } - - // ----- Check the path length - if (strlen($p_header['stored_filename']) > 0xFF) { - $p_header['status'] = 'filename_too_long'; - } - - // ----- Look if no error, or file not skipped - if ($p_header['status'] == 'ok') { - - // ----- Look for a file - if (is_file($p_filename)) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a file"); - // ----- Open the source file - if (($v_file = @fopen($p_filename, "rb")) == 0) { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be compressed"); - // ----- Read the file content - $v_content_compressed = @fread($v_file, $p_header['size']); - - // ----- Calculate the CRC - $p_header['crc'] = @crc32($v_content_compressed); - - // ----- Set header parameters - $p_header['compressed_size'] = $p_header['size']; - $p_header['compression'] = 0; - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will be compressed"); - // ----- Read the file content - $v_content = @fread($v_file, $p_header['size']); - - // ----- Calculate the CRC - $p_header['crc'] = @crc32($v_content); - - // ----- Compress the file - $v_content_compressed = @gzdeflate($v_content); - - // ----- Set header parameters - $p_header['compressed_size'] = strlen($v_content_compressed); - $p_header['compression'] = 8; - } - - // ----- Look for encryption - /* - if ((isset($p_options[PCLZIP_OPT_CRYPT])) - && ($p_options[PCLZIP_OPT_CRYPT] != "")) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File need to be crypted ...."); - - // Should be a random header - $v_header = 'xxxxxxxxxxxx'; - $v_content_compressed = PclZipUtilZipEncrypt($v_content_compressed, - $p_header['compressed_size'], - $v_header, - $p_header['crc'], - "test"); - - $p_header['compressed_size'] += 12; - $p_header['flag'] = 1; - - // ----- Add the header to the data - $v_content_compressed = $v_header.$v_content_compressed; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size after header : ".strlen($v_content_compressed).""); - } - */ - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - @fclose($v_file); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Write the compressed (or not) content - @fwrite($this->zip_fd, - $v_content_compressed, $p_header['compressed_size']); - - // ----- Close the file - @fclose($v_file); - } - - // ----- Look for a directory - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a folder"); - // ----- Look for directory last '/' - if (@substr($p_header['stored_filename'], -1) != '/') { - $p_header['stored_filename'] .= '/'; - } - - // ----- Set the file properties - $p_header['size'] = 0; - //$p_header['external'] = 0x41FF0010; // Value for a folder : to be checked - $p_header['external'] = 0x00000010; // Value for a folder : to be checked - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) - { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - } - } - - // ----- Look for post-add callback - if (isset($p_options[PCLZIP_CB_POST_ADD])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_ADD]."()') is defined for the extraction"); - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_header, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. - eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);'); - if ($v_result == 0) { - // ----- Ignored - $v_result = 1; - } - - // ----- Update the informations - // Nothing can be modified - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCalculateStoredFilename() - // Description : - // Based on file descriptor properties and global options, this method - // calculate the filename that will be stored in the archive. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privCalculateStoredFilename(&$p_filedescr, &$p_options) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCalculateStoredFilename", "filename='".$p_filedescr['filename']."'"); - $v_result=1; - - // ----- Working variables - $p_filename = $p_filedescr['filename']; - if (isset($p_options[PCLZIP_OPT_ADD_PATH])) { - $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH]; - } - else { - $p_add_dir = ''; - } - if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) { - $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH]; - } - else { - $p_remove_dir = ''; - } - if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - else { - $p_remove_all_dir = 0; - } - - // ----- Look for full name change - if (isset($p_filedescr['new_full_name'])) { - $v_stored_filename = $p_filedescr['new_full_name']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing full name of '".$p_filename."' for '".$v_stored_filename."'"); - } - - // ----- Look for path and/or short name change - else { - - // ----- Look for short name change - if (isset($p_filedescr['new_short_name'])) { - $v_path_info = pathinfo($p_filename); - $v_dir = ''; - if ($v_path_info['dirname'] != '') { - $v_dir = $v_path_info['dirname'].'/'; - } - $v_stored_filename = $v_dir.$p_filedescr['new_short_name']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing short name of '".$p_filename."' for '".$v_stored_filename."'"); - } - else { - // ----- Calculate the stored filename - $v_stored_filename = $p_filename; - } - - // ----- Look for all path to remove - if ($p_remove_all_dir) { - $v_stored_filename = basename($p_filename); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Remove all path selected change '".$p_filename."' for '".$v_stored_filename."'"); - } - // ----- Look for partial path remove - else if ($p_remove_dir != "") { - if (substr($p_remove_dir, -1) != '/') - $p_remove_dir .= "/"; - - if ( (substr($p_filename, 0, 2) == "./") - || (substr($p_remove_dir, 0, 2) == "./")) { - - if ( (substr($p_filename, 0, 2) == "./") - && (substr($p_remove_dir, 0, 2) != "./")) { - $p_remove_dir = "./".$p_remove_dir; - } - if ( (substr($p_filename, 0, 2) != "./") - && (substr($p_remove_dir, 0, 2) == "./")) { - $p_remove_dir = substr($p_remove_dir, 2); - } - } - - $v_compare = PclZipUtilPathInclusion($p_remove_dir, - $v_stored_filename); - if ($v_compare > 0) { - if ($v_compare == 2) { - $v_stored_filename = ""; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Path to remove is the current folder"); - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Remove path '$p_remove_dir' in file '$v_stored_filename'"); - $v_stored_filename = substr($v_stored_filename, - strlen($p_remove_dir)); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Result is '$v_stored_filename'"); - } - } - } - // ----- Look for path to add - if ($p_add_dir != "") { - if (substr($p_add_dir, -1) == "/") - $v_stored_filename = $p_add_dir.$v_stored_filename; - else - $v_stored_filename = $p_add_dir."/".$v_stored_filename; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_filename' = '$v_stored_filename'"); - } - } - - // ----- Filename (reduce the path of stored name) - $v_stored_filename = PclZipUtilPathReduction($v_stored_filename); - $p_filedescr['stored_filename'] = $v_stored_filename; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Stored filename will be '".$p_filedescr['stored_filename']."', strlen ".strlen($p_filedescr['stored_filename'])); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteFileHeader(&$p_header) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"'); - $v_result=1; - - // ----- Store the offset position of the file - $p_header['offset'] = ftell($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'File offset of the header :'.$p_header['offset']); - - // ----- Transform UNIX mtime to DOS format mdate/mtime - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); - $v_date = getdate($p_header['mtime']); - $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; - $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; - - // ----- Packed data - $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50, - $p_header['version_extracted'], $p_header['flag'], - $p_header['compression'], $v_mtime, $v_mdate, - $p_header['crc'], $p_header['compressed_size'], - $p_header['size'], - strlen($p_header['stored_filename']), - $p_header['extra_len']); - - // ----- Write the first 148 bytes of the header in the archive - fputs($this->zip_fd, $v_binary_data, 30); - - // ----- Write the variable fields - if (strlen($p_header['stored_filename']) != 0) - { - fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); - } - if ($p_header['extra_len'] != 0) - { - fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteCentralFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteCentralFileHeader(&$p_header) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"'); - $v_result=1; - - // TBC - //for(reset($p_header); $key = key($p_header); next($p_header)) { - // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "header[$key] = ".$p_header[$key]); - //} - - // ----- Transform UNIX mtime to DOS format mdate/mtime - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); - $v_date = getdate($p_header['mtime']); - $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; - $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; - - // ----- Packed data - $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50, - $p_header['version'], $p_header['version_extracted'], - $p_header['flag'], $p_header['compression'], - $v_mtime, $v_mdate, $p_header['crc'], - $p_header['compressed_size'], $p_header['size'], - strlen($p_header['stored_filename']), - $p_header['extra_len'], $p_header['comment_len'], - $p_header['disk'], $p_header['internal'], - $p_header['external'], $p_header['offset']); - - // ----- Write the 42 bytes of the header in the zip file - fputs($this->zip_fd, $v_binary_data, 46); - - // ----- Write the variable fields - if (strlen($p_header['stored_filename']) != 0) - { - fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); - } - if ($p_header['extra_len'] != 0) - { - fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); - } - if ($p_header['comment_len'] != 0) - { - fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']); - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteCentralHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralHeader", 'nb_entries='.$p_nb_entries.', size='.$p_size.', offset='.$p_offset.', comment="'.$p_comment.'"'); - $v_result=1; - - // ----- Packed data - $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries, - $p_nb_entries, $p_size, - $p_offset, strlen($p_comment)); - - // ----- Write the 22 bytes of the header in the zip file - fputs($this->zip_fd, $v_binary_data, 22); - - // ----- Write the variable fields - if (strlen($p_comment) != 0) - { - fputs($this->zip_fd, $p_comment, strlen($p_comment)); - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privList() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privList(&$p_list) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privList", "list"); - $v_result=1; - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); - if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) - { - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Go to beginning of Central Dir - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Offset : ".$v_central_dir['offset']."'"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'"); - @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'"); - if (@fseek($this->zip_fd, $v_central_dir['offset'])) - { - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'"); - - // ----- Read each entry - for ($i=0; $i<$v_central_dir['entries']; $i++) - { - // ----- Read the file header - if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) - { - $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - $v_header['index'] = $i; - - // ----- Get the only interesting attributes - $this->privConvertHeader2FileInfo($v_header, $p_list[$i]); - unset($v_header); - } - - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privConvertHeader2FileInfo() - // Description : - // This function takes the file informations from the central directory - // entries and extract the interesting parameters that will be given back. - // The resulting file infos are set in the array $p_info - // $p_info['filename'] : Filename with full path. Given by user (add), - // extracted in the filesystem (extract). - // $p_info['stored_filename'] : Stored filename in the archive. - // $p_info['size'] = Size of the file. - // $p_info['compressed_size'] = Compressed size of the file. - // $p_info['mtime'] = Last modification date of the file. - // $p_info['comment'] = Comment associated with the file. - // $p_info['folder'] = true/false : indicates if the entry is a folder or not. - // $p_info['status'] = status of the action on the file. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privConvertHeader2FileInfo($p_header, &$p_info) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privConvertHeader2FileInfo", "Filename='".$p_header['filename']."'"); - $v_result=1; - - // ----- Get the interesting attributes - $p_info['filename'] = $p_header['filename']; - $p_info['stored_filename'] = $p_header['stored_filename']; - $p_info['size'] = $p_header['size']; - $p_info['compressed_size'] = $p_header['compressed_size']; - $p_info['mtime'] = $p_header['mtime']; - $p_info['comment'] = $p_header['comment']; - $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010); - $p_info['index'] = $p_header['index']; - $p_info['status'] = $p_header['status']; - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractByRule() - // Description : - // Extract a file or directory depending of rules (by index, by name, ...) - // Parameters : - // $p_file_list : An array where will be placed the properties of each - // extracted file - // $p_path : Path to add while writing the extracted files - // $p_remove_path : Path to remove (from the file memorized path) while writing the - // extracted files. If the path does not match the file path, - // the file is extracted with its memorized path. - // $p_remove_path does not apply to 'list' mode. - // $p_path and $p_remove_path are commulative. - // Return Values : - // 1 on success,0 or less on error (see error code list) - // -------------------------------------------------------------------------------- - function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privExtractByRule", "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'"); - $v_result=1; - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Check the path - if ( ($p_path == "") - || ( (substr($p_path, 0, 1) != "/") - && (substr($p_path, 0, 3) != "../") - && (substr($p_path,1,2)!=":/"))) - $p_path = "./".$p_path; - - // ----- Reduce the path last (and duplicated) '/' - if (($p_path != "./") && ($p_path != "/")) - { - // ----- Look for the path end '/' - while (substr($p_path, -1) == "/") - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Destination path [$p_path] ends by '/'"); - $p_path = substr($p_path, 0, strlen($p_path)-1); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Modified to [$p_path]"); - } - } - - // ----- Look for path to remove format (should end by /) - if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/')) - { - $p_remove_path .= '/'; - } - $p_remove_path_size = strlen($p_remove_path); - - // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); - if (($v_result = $this->privOpenFd('rb')) != 1) - { - $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Start at beginning of Central Dir - $v_pos_entry = $v_central_dir['offset']; - - // ----- Read each entry - $j_start = 0; - for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry : '$i'"); - - // ----- Read next Central dir entry - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position before rewind : ".ftell($this->zip_fd)."'"); - @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position after rewind : ".ftell($this->zip_fd)."'"); - if (@fseek($this->zip_fd, $v_pos_entry)) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position after fseek : ".ftell($this->zip_fd)."'"); - - // ----- Read the file header - $v_header = array(); - if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Store the index - $v_header['index'] = $i; - - // ----- Store the file position - $v_pos_entry = ftell($this->zip_fd); - - // ----- Look for the specific extract rules - $v_extract = false; - - // ----- Look for extract by name rule - if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) - && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'"); - - // ----- Look if the filename is in the list - for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) - && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path"); - $v_extract = true; - } - } - // ----- Look for a filename - elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one."); - $v_extract = true; - } - } - } - - // ----- Look for extract by ereg rule - else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) - && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'"); - - if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); - $v_extract = true; - } - } - - // ----- Look for extract by preg rule - else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) - && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'"); - - if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); - $v_extract = true; - } - } - - // ----- Look for extract by index rule - else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) - && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'"); - - // ----- Look if the index is in the list - for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range"); - $v_extract = true; - } - if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop"); - $j_start = $j+1; - } - - if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop"); - break; - } - } - } - - // ----- Look for no rule, which means extract all the archive - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with no rule (extract all)"); - $v_extract = true; - } - - // ----- Check compression method - if ( ($v_extract) - && ( ($v_header['compression'] != 8) - && ($v_header['compression'] != 0))) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported compression method (".$v_header['compression'].")"); - $v_header['status'] = 'unsupported_compression'; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); - - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION, - "Filename '".$v_header['stored_filename']."' is " - ."compressed by an unsupported compression " - ."method (".$v_header['compression'].") "); - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - } - - // ----- Check encrypted files - if (($v_extract) && (($v_header['flag'] & 1) == 1)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported file encryption"); - $v_header['status'] = 'unsupported_encryption'; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); - - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, - "Unsupported encryption for " - ." filename '".$v_header['stored_filename'] - ."'"); - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - } - - // ----- Look for real extraction - if (($v_extract) && ($v_header['status'] != 'ok')) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "No need for extract"); - $v_result = $this->privConvertHeader2FileInfo($v_header, - $p_file_list[$v_nb_extracted++]); - if ($v_result != 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - $v_extract = false; - } - - // ----- Look for real extraction - if ($v_extract) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file '".$v_header['filename']."', index '$i'"); - - // ----- Go to the file position - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'"); - @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'"); - if (@fseek($this->zip_fd, $v_header['offset'])) - { - // ----- Close the zip file - $this->privCloseFd(); - - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'"); - - // ----- Look for extraction as string - if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) { - - // ----- Extracting the file - $v_result1 = $this->privExtractFileAsString($v_header, $v_string); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Set the file content - $p_file_list[$v_nb_extracted]['content'] = $v_string; - - // ----- Next extracted file - $v_nb_extracted++; - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - // ----- Look for extraction in standard output - elseif ( (isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) - && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) { - // ----- Extracting the file in standard output - $v_result1 = $this->privExtractFileInOutput($v_header, $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - // ----- Look for normal extraction - else { - // ----- Extracting the file - $v_result1 = $this->privExtractFile($v_header, - $p_path, $p_remove_path, - $p_remove_all_path, - $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - } - } - - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFile() - // Description : - // Parameters : - // Return Values : - // - // 1 : ... ? - // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback - // -------------------------------------------------------------------------------- - function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFile', "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'"); - $v_result=1; - - // ----- Read the file header - if (($v_result = $this->privReadFileHeader($v_header)) != 1) - { - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for all path to remove - if ($p_remove_all_path == true) { - // ----- Look for folder entry that not need to be extracted - if (($p_entry['external']&0x00000010)==0x00000010) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The entry is a folder : need to be filtered"); - - $p_entry['status'] = "filtered"; - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "All path is removed"); - // ----- Get the basename of the path - $p_entry['filename'] = basename($p_entry['filename']); - } - - // ----- Look for path to remove - else if ($p_remove_path != "") - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look for some path to remove"); - if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The folder is the same as the removed path '".$p_entry['filename']."'"); - - // ----- Change the file status - $p_entry['status'] = "filtered"; - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - $p_remove_path_size = strlen($p_remove_path); - if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file '".$p_entry['filename']."'"); - - // ----- Remove the path - $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size); - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Resulting file is '".$p_entry['filename']."'"); - } - } - - // ----- Add the path - if ($p_path != '') { - $p_entry['filename'] = $p_path."/".$p_entry['filename']; - } - - // ----- Check a base_dir_restriction - if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Check the extract directory restriction"); - $v_inclusion - = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION], - $p_entry['filename']); - if ($v_inclusion == 0) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_EXTRACT_DIR_RESTRICTION is selected, file is outside restriction"); - - PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION, - "Filename '".$p_entry['filename']."' is " - ."outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION"); - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction"); - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. - eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'"); - } - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'"); - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Look for specific actions while the file exist - if (file_exists($p_entry['filename'])) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$p_entry['filename']."' already exists"); - - // ----- Look if file is a directory - if (is_dir($p_entry['filename'])) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is a directory"); - - // ----- Change the file status - $p_entry['status'] = "already_a_directory"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); - - PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY, - "Filename '".$p_entry['filename']."' is " - ."already used by an existing directory"); - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - } - // ----- Look if file is write protected - else if (!is_writeable($p_entry['filename'])) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is write protected"); - - // ----- Change the file status - $p_entry['status'] = "write_protected"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); - - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, - "Filename '".$p_entry['filename']."' exists " - ."and is write protected"); - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - } - - // ----- Look if the extracted file is older - else if (filemtime($p_entry['filename']) > $p_entry['mtime']) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is newer (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")"); - // ----- Change the file status - if ( (isset($p_options[PCLZIP_OPT_REPLACE_NEWER])) - && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_REPLACE_NEWER is selected, file will be replaced"); - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be replaced"); - $p_entry['status'] = "newer_exist"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped"); - - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, - "Newer version of '".$p_entry['filename']."' exists " - ."and option PCLZIP_OPT_REPLACE_NEWER is not selected"); - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - } - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is older than the extrated one - will be replaced by the extracted one (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")"); - } - } - - // ----- Check the directory availability and create it if necessary - else { - if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) - $v_dir_to_check = $p_entry['filename']; - else if (!strstr($p_entry['filename'], "/")) - $v_dir_to_check = ""; - else - $v_dir_to_check = dirname($p_entry['filename']); - - if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '".$p_entry['filename']."'"); - - // ----- Change the file status - $p_entry['status'] = "path_creation_fail"; - - // ----- Return - ////--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - //return $v_result; - $v_result = 1; - } - } - } - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) - { - // ----- Look for not compressed file - if ($p_entry['compression'] == 0) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file"); - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode"); - - // ----- Change the file status - $p_entry['status'] = "write_error"; - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read '".$p_entry['size']."' bytes"); - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = $p_entry['compressed_size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read $v_read_size bytes"); - $v_buffer = @fread($this->zip_fd, $v_read_size); - /* Try to speed up the code - $v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($v_dest_file, $v_binary_data, $v_read_size); - */ - @fwrite($v_dest_file, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Closing the destination file - fclose($v_dest_file); - - // ----- Change the file mtime - touch($p_entry['filename'], $p_entry['mtime']); - - - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (Compression method ".$p_entry['compression'].")"); - // ----- TBC - // Need to be finished - if (($p_entry['flag'] & 1) == 1) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File is encrypted"); - /* - // ----- Read the encryption header - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read 12 encryption header bytes"); - $v_encryption_header = @fread($this->zip_fd, 12); - - // ----- Read the encrypted & compressed file in a buffer - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".($p_entry['compressed_size']-12)."' compressed & encrypted bytes"); - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']-12); - - // ----- Decrypt the buffer - $this->privDecrypt($v_encryption_header, $v_buffer, - $p_entry['compressed_size']-12, $p_entry['crc']); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Buffer is '".$v_buffer."'"); - */ - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".$p_entry['compressed_size']."' compressed bytes"); - // ----- Read the compressed file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - } - - // ----- Decompress the file - $v_file_content = @gzinflate($v_buffer); - unset($v_buffer); - if ($v_file_content === FALSE) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to inflate compressed file"); - - // ----- Change the file status - // TBC - $p_entry['status'] = "error"; - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode"); - - // ----- Change the file status - $p_entry['status'] = "write_error"; - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Write the uncompressed data - @fwrite($v_dest_file, $v_file_content, $p_entry['size']); - unset($v_file_content); - - // ----- Closing the destination file - @fclose($v_dest_file); - - // ----- Change the file mtime - @touch($p_entry['filename'], $p_entry['mtime']); - } - - // ----- Look for chmod option - if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "chmod option activated '".$p_options[PCLZIP_OPT_SET_CHMOD]."'"); - - // ----- Change the mode of the file - @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]); - } - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done"); - } - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction"); - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. - eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - - // ----- Look for abort result - if ($v_result == 2) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileInOutput() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileInOutput(&$p_entry, &$p_options) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileInOutput', ""); - $v_result=1; - - // ----- Read the file header - if (($v_result = $this->privReadFileHeader($v_header)) != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction"); - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. - eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'"); - } - - // ----- Trace - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'"); - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) { - // ----- Look for not compressed file - if ($p_entry['compressed_size'] == $p_entry['size']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes"); - - // ----- Read the file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Send the file to the output - echo $v_buffer; - unset($v_buffer); - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Reading '".$p_entry['size']."' bytes"); - - // ----- Read the compressed file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - $v_file_content = gzinflate($v_buffer); - unset($v_buffer); - - // ----- Send the file to the output - echo $v_file_content; - unset($v_file_content); - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done"); - } - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction"); - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. - eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - - // ----- Look for abort result - if ($v_result == 2) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction"); - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileAsString() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileAsString(&$p_entry, &$p_string) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileAsString', "p_entry['filename']='".$p_entry['filename']."'"); - $v_result=1; - - // ----- Read the file header - $v_header = array(); - if (($v_result = $this->privReadFileHeader($v_header)) != 1) - { - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'"); - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file in string (with path) '".$p_entry['filename']."', size '$v_header[size]'"); - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) - { - // ----- Look for not compressed file -// if ($p_entry['compressed_size'] == $p_entry['size']) - if ($p_entry['compression'] == 0) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes"); - - // ----- Reading the file - $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (compression method '".$p_entry['compression']."')"); - - // ----- Reading the file - $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - if (($p_string = @gzinflate($v_data)) === FALSE) { - // TBC - } - } - - // ----- Trace - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done"); - } - else { - // TBC : error : can not extract a folder in a string - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadFileHeader(&$p_header) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadFileHeader", ""); - $v_result=1; - - // ----- Read the 4 bytes signature - $v_binary_data = @fread($this->zip_fd, 4); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'"); - $v_data = unpack('Vid', $v_binary_data); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'"); - - // ----- Check signature - if ($v_data['id'] != 0x04034b50) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid File header"); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Read the first 42 bytes of the header - $v_binary_data = fread($this->zip_fd, 26); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 26) - { - $p_header['filename'] = ""; - $p_header['status'] = "invalid_header"; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data)); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Extract the values - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header : '".$v_binary_data."'"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header (Hex) : '".bin2hex($v_binary_data)."'"); - $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data); - - // ----- Get filename - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "File name length : ".$v_data['filename_len']); - $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Filename : \''.$p_header['filename'].'\''); - - // ----- Get extra_fields - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extra field length : ".$v_data['extra_len']); - if ($v_data['extra_len'] != 0) { - $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']); - } - else { - $p_header['extra'] = ''; - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Extra field : \''.bin2hex($p_header['extra']).'\''); - - // ----- Extract properties - $p_header['version_extracted'] = $v_data['version']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : ('.$p_header['version_extracted'].') \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\''); - $p_header['compression'] = $v_data['compression']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compression method : \''.$p_header['compression'].'\''); - $p_header['size'] = $v_data['size']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_header['size'].'\''); - $p_header['compressed_size'] = $v_data['compressed_size']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_header['compressed_size'].'\''); - $p_header['crc'] = $v_data['crc']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\''); - $p_header['flag'] = $v_data['flag']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Flag : \''.$p_header['flag'].'\''); - $p_header['filename_len'] = $v_data['filename_len']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Filename_len : \''.$p_header['filename_len'].'\''); - - // ----- Recuperate date in UNIX format - $p_header['mdate'] = $v_data['mdate']; - $p_header['mtime'] = $v_data['mtime']; - if ($p_header['mdate'] && $p_header['mtime']) - { - // ----- Extract time - $v_hour = ($p_header['mtime'] & 0xF800) >> 11; - $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; - $v_seconde = ($p_header['mtime'] & 0x001F)*2; - - // ----- Extract date - $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; - $v_month = ($p_header['mdate'] & 0x01E0) >> 5; - $v_day = $p_header['mdate'] & 0x001F; - - // ----- Get UNIX date format - $p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); - } - else - { - $p_header['mtime'] = time(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); - } - - // TBC - //for(reset($v_data); $key = key($v_data); next($v_data)) { - // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Attribut[$key] = ".$v_data[$key]); - //} - - // ----- Set the stored filename - $p_header['stored_filename'] = $p_header['filename']; - - // ----- Set the status field - $p_header['status'] = "ok"; - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadCentralFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadCentralFileHeader(&$p_header) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadCentralFileHeader", ""); - $v_result=1; - - // ----- Read the 4 bytes signature - $v_binary_data = @fread($this->zip_fd, 4); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'"); - $v_data = unpack('Vid', $v_binary_data); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'"); - - // ----- Check signature - if ($v_data['id'] != 0x02014b50) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid Central Dir File signature"); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Read the first 42 bytes of the header - $v_binary_data = fread($this->zip_fd, 42); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 42) - { - $p_header['filename'] = ""; - $p_header['status'] = "invalid_header"; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data)); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Extract the values - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header : '".$v_binary_data."'"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header (Hex) : '".bin2hex($v_binary_data)."'"); - $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data); - - // ----- Get filename - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File name length : ".$p_header['filename_len']); - if ($p_header['filename_len'] != 0) - $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']); - else - $p_header['filename'] = ''; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Filename : \''.$p_header['filename'].'\''); - - // ----- Get extra - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Extra length : ".$p_header['extra_len']); - if ($p_header['extra_len'] != 0) - $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']); - else - $p_header['extra'] = ''; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Extra : \''.$p_header['extra'].'\''); - - // ----- Get comment - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Comment length : ".$p_header['comment_len']); - if ($p_header['comment_len'] != 0) - $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']); - else - $p_header['comment'] = ''; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Comment : \''.$p_header['comment'].'\''); - - // ----- Extract properties - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version : \''.($p_header['version']/10).'.'.($p_header['version']%10).'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Size : \''.$p_header['size'].'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Compressed Size : \''.$p_header['compressed_size'].'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Flag : \''.$p_header['flag'].'\''); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Offset : \''.$p_header['offset'].'\''); - - // ----- Recuperate date in UNIX format - if ($p_header['mdate'] && $p_header['mtime']) - { - // ----- Extract time - $v_hour = ($p_header['mtime'] & 0xF800) >> 11; - $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; - $v_seconde = ($p_header['mtime'] & 0x001F)*2; - - // ----- Extract date - $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; - $v_month = ($p_header['mdate'] & 0x01E0) >> 5; - $v_day = $p_header['mdate'] & 0x001F; - - // ----- Get UNIX date format - $p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); - } - else - { - $p_header['mtime'] = time(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\''); - } - - // ----- Set the stored filename - $p_header['stored_filename'] = $p_header['filename']; - - // ----- Set default status to ok - $p_header['status'] = 'ok'; - - // ----- Look if it is a directory - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Internal (Hex) : '".sprintf("Ox%04X", $p_header['internal'])."'"); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "External (Hex) : '".sprintf("Ox%04X", $p_header['external'])."' (".(($p_header['external']&0x00000010)==0x00000010?'is a folder':'is a file').')'); - if (substr($p_header['filename'], -1) == '/') { - //$p_header['external'] = 0x41FF0010; - $p_header['external'] = 0x00000010; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Force folder external : \''.sprintf("Ox%04X", $p_header['external']).'\''); - } - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Header of filename : \''.$p_header['filename'].'\''); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCheckFileHeaders() - // Description : - // Parameters : - // Return Values : - // 1 on success, - // 0 on error; - // -------------------------------------------------------------------------------- - function privCheckFileHeaders(&$p_local_header, &$p_central_header) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFileHeaders", ""); - $v_result=1; - - // ----- Check the static values - // TBC - if ($p_local_header['filename'] != $p_central_header['filename']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename" : TBC To Be Completed'); - } - if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "version_extracted" : TBC To Be Completed'); - } - if ($p_local_header['flag'] != $p_central_header['flag']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "flag" : TBC To Be Completed'); - } - if ($p_local_header['compression'] != $p_central_header['compression']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "compression" : TBC To Be Completed'); - } - if ($p_local_header['mtime'] != $p_central_header['mtime']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "mtime" : TBC To Be Completed'); - } - if ($p_local_header['filename_len'] != $p_central_header['filename_len']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename_len" : TBC To Be Completed'); - } - - // ----- Look for flag bit 3 - if (($p_local_header['flag'] & 8) == 8) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Purpose bit flag bit 3 set !'); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'File size, compression size and crc found in central header'); - $p_local_header['size'] = $p_central_header['size']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_local_header['size'].'\''); - $p_local_header['compressed_size'] = $p_central_header['compressed_size']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_local_header['compressed_size'].'\''); - $p_local_header['crc'] = $p_central_header['crc']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_local_header['crc']).'\''); - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadEndCentralDir() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadEndCentralDir(&$p_central_dir) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadEndCentralDir", ""); - $v_result=1; - - // ----- Go to the end of the zip file - $v_size = filesize($this->zipname); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size of the file :$v_size"); - @fseek($this->zip_fd, $v_size); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position at end of zip file : \''.ftell($this->zip_fd).'\''); - if (@ftell($this->zip_fd) != $v_size) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\''); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- First try : look if this is an archive with no commentaries (most of the time) - // in this case the end of central dir is at 22 bytes of the file end - $v_found = 0; - if ($v_size > 26) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Look for central dir with no comment'); - @fseek($this->zip_fd, $v_size-22); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after min central position : \''.ftell($this->zip_fd).'\''); - if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Read for bytes - $v_binary_data = @fread($this->zip_fd, 4); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Binary data is : '".sprintf("%08x", $v_binary_data)."'"); - $v_data = @unpack('Vid', $v_binary_data); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'"); - - // ----- Check signature - if ($v_data['id'] == 0x06054b50) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found central dir at the default position."); - $v_found = 1; - } - - $v_pos = ftell($this->zip_fd); - } - - // ----- Go back to the maximum possible size of the Central Dir End Record - if (!$v_found) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Start extended search of end central dir'); - $v_maximum_size = 65557; // 0xFFFF + 22; - if ($v_maximum_size > $v_size) - $v_maximum_size = $v_size; - @fseek($this->zip_fd, $v_size-$v_maximum_size); - if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after max central position : \''.ftell($this->zip_fd).'\''); - - // ----- Read byte per byte in order to find the signature - $v_pos = ftell($this->zip_fd); - $v_bytes = 0x00000000; - while ($v_pos < $v_size) - { - // ----- Read a byte - $v_byte = @fread($this->zip_fd, 1); - - // ----- Add the byte - // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number - // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. - $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte); - - // ----- Compare the bytes - if ($v_bytes == 0x504b0506) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Found End Central Dir signature at position : \''.ftell($this->zip_fd).'\''); - $v_pos++; - break; - } - - $v_pos++; - } - - // ----- Look if not found end of central dir - if ($v_pos == $v_size) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to find End of Central Dir Record signature"); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - } - - // ----- Read the first 18 bytes of the header - $v_binary_data = fread($this->zip_fd, 18); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 18) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Extract the values - ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record : '".$v_binary_data."'"); - ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record (Hex) : '".bin2hex($v_binary_data)."'"); - $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data); - - // ----- Check the global size - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Comment length : ".$v_data['comment_size']); - if (($v_pos + $v_data['comment_size'] + 18) != $v_size) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The central dir is not at the end of the archive. Some trailing bytes exists after the archive."); - - // ----- Removed in release 2.2 see readme file - // The check of the file size is a little too strict. - // Some bugs where found when a zip is encrypted/decrypted with 'crypt'. - // While decrypted, zip has training 0 bytes - if (0) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, - 'The central dir is not at the end of the archive.' - .' Some trailing bytes exists after the archive.'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - } - - // ----- Get comment - if ($v_data['comment_size'] != 0) - $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']); - else - $p_central_dir['comment'] = ''; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Comment : \''.$p_central_dir['comment'].'\''); - - $p_central_dir['entries'] = $v_data['entries']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries : \''.$p_central_dir['entries'].'\''); - $p_central_dir['disk_entries'] = $v_data['disk_entries']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries for this disk : \''.$p_central_dir['disk_entries'].'\''); - $p_central_dir['offset'] = $v_data['offset']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Offset of Central Dir : \''.$p_central_dir['offset'].'\''); - $p_central_dir['size'] = $v_data['size']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size of Central Dir : \''.$p_central_dir['size'].'\''); - $p_central_dir['disk'] = $v_data['disk']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Disk number : \''.$p_central_dir['disk'].'\''); - $p_central_dir['disk_start'] = $v_data['disk_start']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Start disk number : \''.$p_central_dir['disk_start'].'\''); - - // TBC - //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) { - // //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "central_dir[$key] = ".$p_central_dir[$key]); - //} - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDeleteByRule() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDeleteByRule(&$p_result_list, &$p_options) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDeleteByRule", ""); - $v_result=1; - $v_list_detail = array(); - - // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Go to beginning of File - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); - @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'"); - - // ----- Scan all the files - // ----- Start at beginning of Central Dir - $v_pos_entry = $v_central_dir['offset']; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'"); - @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'"); - if (@fseek($this->zip_fd, $v_pos_entry)) - { - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'"); - - // ----- Read each entry - $v_header_list = array(); - $j_start = 0; - for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry (index '$i')"); - - // ----- Read the file header - $v_header_list[$v_nb_extracted] = array(); - if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename (index '$i') : '".$v_header_list[$v_nb_extracted]['stored_filename']."'"); - - // ----- Store the index - $v_header_list[$v_nb_extracted]['index'] = $i; - - // ----- Look for the specific extract rules - $v_found = false; - - // ----- Look for extract by name rule - if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) - && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'"); - - // ----- Look if the filename is in the list - for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) - && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path"); - $v_found = true; - } - elseif ( (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */ - && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The entry is the searched directory"); - $v_found = true; - } - } - // ----- Look for a filename - elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one."); - $v_found = true; - } - } - } - - // ----- Look for extract by ereg rule - else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) - && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'"); - - if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); - $v_found = true; - } - } - - // ----- Look for extract by preg rule - else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) - && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'"); - - if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression"); - $v_found = true; - } - } - - // ----- Look for extract by index rule - else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) - && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'"); - - // ----- Look if the index is in the list - for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range"); - $v_found = true; - } - if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop"); - $j_start = $j+1; - } - - if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop"); - break; - } - } - } - else { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "No argument mean remove all file"); - $v_found = true; - } - - // ----- Look for deletion - if ($v_found) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' need to be deleted"); - unset($v_header_list[$v_nb_extracted]); - } - else - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' will not be deleted"); - $v_nb_extracted++; - } - } - - // ----- Look if something need to be deleted - if ($v_nb_extracted > 0) { - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Creates a temporary zip archive - $v_temp_zip = new PclZip($v_zip_temp_name); - - // ----- Open the temporary zip file in write mode - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary write mode"); - if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) { - $this->privCloseFd(); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Look which file need to be kept - for ($i=0; $izip_fd)."'"); - @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'"); - if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'"); - - // ----- Read the file header - $v_local_header = array(); - if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Check that local file header is same as central file header - if ($this->privCheckFileHeaders($v_local_header, - $v_header_list[$i]) != 1) { - // TBC - } - unset($v_local_header); - - // ----- Write the file header - if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Offset for this file is '".$v_header_list[$i]['offset']."'"); - - // ----- Read/write the data block - if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($v_temp_zip->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "New offset of central dir : $v_offset"); - - // ----- Re-Create the Central Dir files header - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the new central directory"); - for ($i=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Transform the header to a 'usable' info - $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the central directory footer"); - - // ----- Zip file comment - $v_comment = ''; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) { - // ----- Reset the file list - unset($v_header_list); - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Close - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Destroy the temporary archive - unset($v_temp_zip); - } - - // ----- Remove every files : reset the file - else if ($v_central_dir['entries'] != 0) { - $this->privCloseFd(); - - if (($v_result = $this->privOpenFd('wb')) != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - $this->privCloseFd(); - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDirCheck() - // Description : - // Check if a directory exists, if not it creates it and all the parents directory - // which may be useful. - // Parameters : - // $p_dir : Directory path to check. - // Return Values : - // 1 : OK - // -1 : Unable to create directory - // -------------------------------------------------------------------------------- - function privDirCheck($p_dir, $p_is_dir=false) - { - $v_result = 1; - - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDirCheck", "entry='$p_dir', is_dir='".($p_is_dir?"true":"false")."'"); - - // ----- Remove the final '/' - if (($p_is_dir) && (substr($p_dir, -1)=='/')) - { - $p_dir = substr($p_dir, 0, strlen($p_dir)-1); - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Looking for entry '$p_dir'"); - - // ----- Check the directory availability - if ((is_dir($p_dir)) || ($p_dir == "")) - { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, "'$p_dir' is a directory"); - return 1; - } - - // ----- Extract parent directory - $p_parent_dir = dirname($p_dir); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Parent directory is '$p_parent_dir'"); - - // ----- Just a check - if ($p_parent_dir != $p_dir) - { - // ----- Look for parent directory - if ($p_parent_dir != "") - { - if (($v_result = $this->privDirCheck($p_parent_dir)) != 1) - { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - } - } - - // ----- Create the directory - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Create directory '$p_dir'"); - if (!@mkdir($p_dir, 0777)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'"); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result, "Directory '$p_dir' created"); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privMerge() - // Description : - // If $p_archive_to_add does not exist, the function exit with a success result. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privMerge(&$p_archive_to_add) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privMerge", "archive='".$p_archive_to_add->zipname."'"); - $v_result=1; - - // ----- Look if the archive_to_add exists - if (!is_file($p_archive_to_add->zipname)) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to add does not exist. End of merge."); - - // ----- Nothing to merge, so merge is a success - $v_result = 1; - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Look if the archive exists - if (!is_file($this->zipname)) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, duplicate the archive_to_add."); - - // ----- Do a duplicate - $v_result = $this->privDuplicate($p_archive_to_add->zipname); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Go to beginning of File - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'"); - @rewind($this->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'"); - - // ----- Open the archive_to_add file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open archive_to_add in binary read mode"); - if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1) - { - $this->privCloseFd(); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir_to_add = array(); - if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Go to beginning of File - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'"); - @rewind($p_archive_to_add->zip_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'"); - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Open the temporary file in write mode - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); - if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = $v_central_dir['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); - $v_buffer = fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Copy the files from the archive_to_add into the temporary file - $v_size = $v_central_dir_to_add['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); - $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($v_zip_temp_fd); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset"); - - // ----- Copy the block of file headers from the old archive - $v_size = $v_central_dir['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); - $v_buffer = @fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Copy the block of file headers from the archive_to_add - $v_size = $v_central_dir_to_add['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); - $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Merge the file comments - $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment']; - - // ----- Calculate the size of the (new) central header - $v_size = @ftell($v_zip_temp_fd)-$v_offset; - - // ----- Swap the file descriptor - // Here is a trick : I swap the temporary fd with the zip fd, in order to use - // the following methods on the temporary fil and not the real archive fd - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - @fclose($v_zip_temp_fd); - $this->zip_fd = null; - - // ----- Reset the file list - unset($v_header_list); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Swap back the file descriptor - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Close - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDuplicate() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDuplicate($p_archive_filename) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDuplicate", "archive_filename='$p_archive_filename'"); - $v_result=1; - - // ----- Look if the $p_archive_filename exists - if (!is_file($p_archive_filename)) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to duplicate does not exist. End of duplicate."); - - // ----- Nothing to duplicate, so duplicate is a success. - $v_result = 1; - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Open the zip file - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); - if (($v_result=$this->privOpenFd('wb')) != 1) - { - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Open the temporary file in write mode - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode"); - if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0) - { - $this->privCloseFd(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode'); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo()); - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = filesize($p_archive_filename); - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read $v_read_size bytes"); - $v_buffer = fread($v_zip_temp_fd, $v_read_size); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Close - $this->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privErrorLog() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privErrorLog($p_error_code=0, $p_error_string='') - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - PclError($p_error_code, $p_error_string); - } - else { - $this->error_code = $p_error_code; - $this->error_string = $p_error_string; - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privErrorReset() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privErrorReset() - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - PclErrorReset(); - } - else { - $this->error_code = 0; - $this->error_string = ''; - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDecrypt() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDecrypt($p_encryption_header, &$p_buffer, $p_size, $p_crc) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privDecrypt', "size=".$p_size.""); - $v_result=1; - - // ----- To Be Modified ;-) - $v_pwd = "test"; - - $p_buffer = PclZipUtilZipDecrypt($p_buffer, $p_size, $p_encryption_header, - $p_crc, $v_pwd); - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDisableMagicQuotes() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDisableMagicQuotes() - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privDisableMagicQuotes', ""); - $v_result=1; - - // ----- Look if function exists - if ( (!function_exists("get_magic_quotes_runtime")) - || (!function_exists("set_magic_quotes_runtime"))) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Functions *et_magic_quotes_runtime are not supported"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Look if already done - if ($this->magic_quotes_status != -1) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "magic_quote already disabled"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Get and memorize the magic_quote value - $this->magic_quotes_status = @get_magic_quotes_runtime(); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Current magic_quotes_runtime status is '".($this->magic_quotes_status==0?'disable':'enable')."'"); - - // ----- Disable magic_quotes - if ($this->magic_quotes_status == 1) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Disable magic_quotes"); - @set_magic_quotes_runtime(0); - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privSwapBackMagicQuotes() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privSwapBackMagicQuotes() - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privSwapBackMagicQuotes', ""); - $v_result=1; - - // ----- Look if function exists - if ( (!function_exists("get_magic_quotes_runtime")) - || (!function_exists("set_magic_quotes_runtime"))) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Functions *et_magic_quotes_runtime are not supported"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Look if something to do - if ($this->magic_quotes_status != -1) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "magic_quote not modified"); - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - - // ----- Swap back magic_quotes - if ($this->magic_quotes_status == 1) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Enable back magic_quotes"); - @set_magic_quotes_runtime($this->magic_quotes_status); - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - } - // End of class - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilPathReduction() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function PclZipUtilPathReduction($p_dir) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathReduction", "dir='$p_dir'"); - $v_result = ""; - - // ----- Look for not empty path - if ($p_dir != "") { - // ----- Explode path by directory names - $v_list = explode("/", $p_dir); - - // ----- Study directories from last to first - $v_skip = 0; - for ($i=sizeof($v_list)-1; $i>=0; $i--) { - // ----- Look for current path - if ($v_list[$i] == ".") { - // ----- Ignore this directory - // Should be the first $i=0, but no check is done - } - else if ($v_list[$i] == "..") { - $v_skip++; - } - else if ($v_list[$i] == "") { - // ----- First '/' i.e. root slash - if ($i == 0) { - $v_result = "/".$v_result; - if ($v_skip > 0) { - // ----- It is an invalid path, so the path is not modified - // TBC - $v_result = $p_dir; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid path is unchanged"); - $v_skip = 0; - } - } - // ----- Last '/' i.e. indicates a directory - else if ($i == (sizeof($v_list)-1)) { - $v_result = $v_list[$i]; - } - // ----- Double '/' inside the path - else { - // ----- Ignore only the double '//' in path, - // but not the first and last '/' - } - } - else { - // ----- Look for item to skip - if ($v_skip > 0) { - $v_skip--; - } - else { - $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:""); - } - } - } - - // ----- Look for skip - if ($v_skip > 0) { - while ($v_skip > 0) { - $v_result = '../'.$v_result; - $v_skip--; - } - } - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilPathInclusion() - // Description : - // This function indicates if the path $p_path is under the $p_dir tree. Or, - // said in an other way, if the file or sub-dir $p_path is inside the dir - // $p_dir. - // The function indicates also if the path is exactly the same as the dir. - // This function supports path with duplicated '/' like '//', but does not - // support '.' or '..' statements. - // Parameters : - // Return Values : - // 0 if $p_path is not inside directory $p_dir - // 1 if $p_path is inside directory $p_dir - // 2 if $p_path is exactly the same as $p_dir - // -------------------------------------------------------------------------------- - function PclZipUtilPathInclusion($p_dir, $p_path) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathInclusion", "dir='$p_dir', path='$p_path'"); - $v_result = 1; - - // ----- Look for path beginning by ./ - if ( ($p_dir == '.') - || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) { - $p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Replacing ./ by full path in p_dir '".$p_dir."'"); - } - if ( ($p_path == '.') - || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) { - $p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Replacing ./ by full path in p_path '".$p_path."'"); - } - - // ----- Explode dir and path by directory separator - $v_list_dir = explode("/", $p_dir); - $v_list_dir_size = sizeof($v_list_dir); - $v_list_path = explode("/", $p_path); - $v_list_path_size = sizeof($v_list_path); - - // ----- Study directories paths - $i = 0; - $j = 0; - while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Working on dir($i)='".$v_list_dir[$i]."' and path($j)='".$v_list_path[$j]."'"); - - // ----- Look for empty dir (path reduction) - if ($v_list_dir[$i] == '') { - $i++; - continue; - } - if ($v_list_path[$j] == '') { - $j++; - continue; - } - - // ----- Compare the items - if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != '')) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Items ($i,$j) are different"); - $v_result = 0; - } - - // ----- Next items - $i++; - $j++; - } - - // ----- Look if everything seems to be the same - if ($v_result) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Look for tie break"); - // ----- Skip all the empty items - while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++; - while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++; - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Looking on dir($i)='".($i < $v_list_dir_size?$v_list_dir[$i]:'')."' and path($j)='".($j < $v_list_path_size?$v_list_path[$j]:'')."'"); - - if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) { - // ----- There are exactly the same - $v_result = 2; - } - else if ($i < $v_list_dir_size) { - // ----- The path is shorter than the dir - $v_result = 0; - } - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilCopyBlock() - // Description : - // Parameters : - // $p_mode : read/write compression mode - // 0 : src & dest normal - // 1 : src gzip, dest normal - // 2 : src normal, dest gzip - // 3 : src & dest gzip - // Return Values : - // -------------------------------------------------------------------------------- - function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilCopyBlock", "size=$p_size, mode=$p_mode"); - $v_result = 1; - - if ($p_mode==0) - { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset before read :".(@ftell($p_src))); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset before write :".(@ftell($p_dest))); - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); - $v_buffer = @fread($p_src, $v_read_size); - @fwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset after read :".(@ftell($p_src))); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset after write :".(@ftell($p_dest))); - } - else if ($p_mode==1) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); - $v_buffer = @gzread($p_src, $v_read_size); - @fwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==2) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); - $v_buffer = @fread($p_src, $v_read_size); - @gzwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==3) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes"); - $v_buffer = @gzread($p_src, $v_read_size); - @gzwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilRename() - // Description : - // This function tries to do a simple rename() function. If it fails, it - // tries to copy the $p_src file in a new $p_dest file and then unlink the - // first one. - // Parameters : - // $p_src : Old filename - // $p_dest : New filename - // Return Values : - // 1 on success, 0 on failure. - // -------------------------------------------------------------------------------- - function PclZipUtilRename($p_src, $p_dest) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilRename", "source=$p_src, destination=$p_dest"); - $v_result = 1; - - // ----- Try to rename the files - if (!@rename($p_src, $p_dest)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to rename file, try copy+unlink"); - - // ----- Try to copy & unlink the src - if (!@copy($p_src, $p_dest)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to copy file"); - $v_result = 0; - } - else if (!@unlink($p_src)) { - //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to unlink old filename"); - $v_result = 0; - } - } - - // ----- Return - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilOptionText() - // Description : - // Translate option value in text. Mainly for debug purpose. - // Parameters : - // $p_option : the option value. - // Return Values : - // The option text value. - // -------------------------------------------------------------------------------- - function PclZipUtilOptionText($p_option) - { - //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilOptionText", "option='".$p_option."'"); - - $v_list = get_defined_constants(); - for (reset($v_list); $v_key = key($v_list); next($v_list)) { - $v_prefix = substr($v_key, 0, 10); - if (( ($v_prefix == 'PCLZIP_OPT') - || ($v_prefix == 'PCLZIP_CB_') - || ($v_prefix == 'PCLZIP_ATT')) - && ($v_list[$v_key] == $p_option)) { - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_key); - return $v_key; - } - } - - $v_result = 'Unknown'; - - //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result); - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilTranslateWinPath() - // Description : - // Translate windows path by replacing '\' by '/' and optionally removing - // drive letter. - // Parameters : - // $p_path : path to translate. - // $p_remove_disk_letter : true | false - // Return Values : - // The path translated. - // -------------------------------------------------------------------------------- - function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true) - { - if (stristr(php_uname(), 'windows')) { - // ----- Look for potential disk letter - if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) { - $p_path = substr($p_path, $v_position+1); - } - // ----- Change potential windows directory separator - if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) { - $p_path = strtr($p_path, '\\', '/'); - } - } - return $p_path; - } - // -------------------------------------------------------------------------------- - - -?> diff -uNr a/mp-wp/wp-admin/includes/class-wp-filesystem-base.php b/mp-wp/wp-admin/includes/class-wp-filesystem-base.php --- a/mp-wp/wp-admin/includes/class-wp-filesystem-base.php 0a6e0e0180bd0bc43eb8949bc05729b34291a52aeed1f168e9af5970cec13405c224a020be59a0930cbf439c08b5f1f6f32e9eeb1ba8c54dec5af1119290d736 +++ b/mp-wp/wp-admin/includes/class-wp-filesystem-base.php false @@ -1,316 +0,0 @@ -method, 'ftp') !== false ) - return FTP_BASE; - $folder = $this->find_folder(ABSPATH); - //Perhaps the FTP folder is rooted at the WordPress install, Check for wp-includes folder in root, Could have some false positives, but rare. - if ( ! $folder && $this->is_dir('/wp-includes') ) - $folder = '/'; - return $folder; - } - /** - * Returns the path on the remote filesystem of WP_CONTENT_DIR - * - * @since 2.7 - * @access public - * @return string The location of the remote path. - */ - function wp_content_dir() { - if ( defined('FTP_CONTENT_DIR') && strpos($this->method, 'ftp') !== false ) - return FTP_CONTENT_DIR; - return $this->find_folder(WP_CONTENT_DIR); - } - /** - * Returns the path on the remote filesystem of WP_PLUGIN_DIR - * - * @since 2.7 - * @access public - * - * @return string The location of the remote path. - */ - function wp_plugins_dir() { - if ( defined('FTP_PLUGIN_DIR') && strpos($this->method, 'ftp') !== false ) - return FTP_PLUGIN_DIR; - return $this->find_folder(WP_PLUGIN_DIR); - } - /** - * Returns the path on the remote filesystem of the Themes Directory - * - * @since 2.7 - * @access public - * - * @return string The location of the remote path. - */ - function wp_themes_dir() { - return $this->wp_content_dir() . '/themes'; - } - - /** - * Locates a folder on the remote filesystem. - * - * Deprecated; use WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir() methods instead. - * - * @since 2.5 - * @deprecated 2.7 - * @access public - * - * @param string $base The folder to start searching from - * @param bool $echo True to display debug information - * @return string The location of the remote path. - */ - function find_base_dir($base = '.', $echo = false) { - _deprecated_function(__FUNCTION__, '2.7', 'WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir()' ); - $this->verbose = $echo; - return $this->abspath(); - } - /** - * Locates a folder on the remote filesystem. - * - * Deprecated; use WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir() methods instead. - * - * @since 2.5 - * @deprecated 2.7 - * @access public - * - * @param string $base The folder to start searching from - * @param bool $echo True to display debug information - * @return string The location of the remote path. - */ - function get_base_dir($base = '.', $echo = false) { - _deprecated_function(__FUNCTION__, '2.7', 'WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir()' ); - $this->verbose = $echo; - return $this->abspath(); - } - - /** - * Locates a folder on the remote filesystem. - * - * Assumes that on Windows systems, Stripping off the Drive letter is OK - * Sanitizes \\ to / in windows filepaths. - * - * @since 2.7 - * @access public - * - * @param string $folder the folder to locate - * @return string The location of the remote path. - */ - function find_folder($folder) { - - $folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows driveletter if its there. - $folder = str_replace('\\', '/', $folder); //Windows path sanitiation - - if ( isset($this->cache[ $folder ] ) ) - return $this->cache[ $folder ]; - - if ( $this->exists($folder) ) { //Folder exists at that absolute path. - $this->cache[ $folder ] = $folder; - return $folder; - } - if( $return = $this->search_for_folder($folder) ) - $this->cache[ $folder ] = $return; - return $return; - } - - /** - * Locates a folder on the remote filesystem. - * - * Expects Windows sanitized path - * - * @since 2.7 - * @access private - * - * @param string $folder the folder to locate - * @param string $base the folder to start searching from - * @param bool $loop if the function has recursed, Internal use only - * @return string The location of the remote path. - */ - function search_for_folder($folder, $base = '.', $loop = false ) { - if ( empty( $base ) || '.' == $base ) - $base = trailingslashit($this->cwd()); - - $folder = untrailingslashit($folder); - - $folder_parts = explode('/', $folder); - $last_path = $folder_parts[ count($folder_parts) - 1 ]; - - $files = $this->dirlist( $base ); - - foreach ( $folder_parts as $key ) { - if ( $key == $last_path ) - continue; //We want this to be caught by the next code block. - - //Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder, - // If its found, change into it and follow through looking for it. - // If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on. - // If it reaches the end, and still cant find it, it'll return false for the entire function. - if( isset($files[ $key ]) ){ - //Lets try that folder: - $newdir = trailingslashit(path_join($base, $key)); - if( $this->verbose ) - printf( __('Changing to %s') . '
    ', $newdir ); - if( $ret = $this->search_for_folder( $folder, $newdir, $loop) ) - return $ret; - } - } - - //Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take. - if(isset( $files[ $last_path ] ) ) { - if( $this->verbose ) - printf( __('Found %s') . '
    ', $base . $last_path ); - return $base . $last_path; - } - if( $loop ) - return false;//Prevent tihs function looping again. - //As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups. - return $this->search_for_folder($folder, '/', true); - - } - - /** - * Returns the *nix style file permissions for a file - * - * From the PHP documentation page for fileperms() - * - * @link http://docs.php.net/fileperms - * @since 2.5 - * @access public - * - * @param string $file string filename - * @return int octal representation of permissions - */ - function gethchmod($file){ - $perms = $this->getchmod($file); - if (($perms & 0xC000) == 0xC000) // Socket - $info = 's'; - elseif (($perms & 0xA000) == 0xA000) // Symbolic Link - $info = 'l'; - elseif (($perms & 0x8000) == 0x8000) // Regular - $info = '-'; - elseif (($perms & 0x6000) == 0x6000) // Block special - $info = 'b'; - elseif (($perms & 0x4000) == 0x4000) // Directory - $info = 'd'; - elseif (($perms & 0x2000) == 0x2000) // Character special - $info = 'c'; - elseif (($perms & 0x1000) == 0x1000)// FIFO pipe - $info = 'p'; - else // Unknown - $info = 'u'; - - // Owner - $info .= (($perms & 0x0100) ? 'r' : '-'); - $info .= (($perms & 0x0080) ? 'w' : '-'); - $info .= (($perms & 0x0040) ? - (($perms & 0x0800) ? 's' : 'x' ) : - (($perms & 0x0800) ? 'S' : '-')); - - // Group - $info .= (($perms & 0x0020) ? 'r' : '-'); - $info .= (($perms & 0x0010) ? 'w' : '-'); - $info .= (($perms & 0x0008) ? - (($perms & 0x0400) ? 's' : 'x' ) : - (($perms & 0x0400) ? 'S' : '-')); - - // World - $info .= (($perms & 0x0004) ? 'r' : '-'); - $info .= (($perms & 0x0002) ? 'w' : '-'); - $info .= (($perms & 0x0001) ? - (($perms & 0x0200) ? 't' : 'x' ) : - (($perms & 0x0200) ? 'T' : '-')); - return $info; - } - - /** - * Converts *nix style file permissions to a octal number. - * - * Converts '-rw-r--r--' to 0644 - * From "info at rvgate dot nl"'s comment on the PHP documentation for chmod() - * - * @link http://docs.php.net/manual/en/function.chmod.php#49614 - * @since 2.5 - * @access public - * - * @param string $mode string *nix style file permission - * @return int octal representation - */ - function getnumchmodfromh($mode) { - $realmode = ''; - $legal = array('', 'w', 'r', 'x', '-'); - $attarray = preg_split('//', $mode); - - for($i=0; $i < count($attarray); $i++) - if($key = array_search($attarray[$i], $legal)) - $realmode .= $legal[$key]; - - $mode = str_pad($realmode, 9, '-'); - $trans = array('-'=>'0', 'r'=>'4', 'w'=>'2', 'x'=>'1'); - $mode = strtr($mode,$trans); - - $newmode = ''; - $newmode .= $mode[0] + $mode[1] + $mode[2]; - $newmode .= $mode[3] + $mode[4] + $mode[5]; - $newmode .= $mode[6] + $mode[7] + $mode[8]; - return $newmode; - } - - /** - * Determines if the string provided contains binary characters. - * - * @since 2.7 - * @access private - * - * @param string $text String to test against - * @return bool true if string is binary, false otherwise - */ - function is_binary( $text ) { - return (bool) preg_match('|[^\x20-\x7E]|', $text); //chr(32)..chr(127) - } -} - -?> diff -uNr a/mp-wp/wp-admin/includes/class-wp-filesystem-direct.php b/mp-wp/wp-admin/includes/class-wp-filesystem-direct.php --- a/mp-wp/wp-admin/includes/class-wp-filesystem-direct.php 8166333e0573868651a1e9da3a9163177173f0a1115bddd25fd004ac88d856075b3573b9b8945661be9066014d4337be1b95416ee0662fe85c7a2b64a7fd4f5d +++ b/mp-wp/wp-admin/includes/class-wp-filesystem-direct.php false @@ -1,274 +0,0 @@ -method = 'direct'; - $this->errors = new WP_Error(); - $this->permission = umask(); - } - function connect() { - return true; - } - function setDefaultPermissions($perm) { - $this->permission = $perm; - } - function get_contents($file) { - return @file_get_contents($file); - } - function get_contents_array($file) { - return @file($file); - } - function put_contents($file, $contents, $mode = false, $type = '') { - if ( ! ($fp = @fopen($file, 'w' . $type)) ) - return false; - @fwrite($fp, $contents); - @fclose($fp); - $this->chmod($file,$mode); - return true; - } - function cwd() { - return @getcwd(); - } - function chdir($dir) { - return @chdir($dir); - } - function chgrp($file, $group, $recursive = false) { - if( ! $this->exists($file) ) - return false; - if( ! $recursive ) - return @chgrp($file, $group); - if( ! $this->is_dir($file) ) - return @chgrp($file, $group); - //Is a directory, and we want recursive - $file = trailingslashit($file); - $filelist = $this->dirlist($file); - foreach($filelist as $filename) - $this->chgrp($file . $filename, $group, $recursive); - - return true; - } - function chmod($file, $mode = false, $recursive = false) { - if( ! $mode ) - $mode = $this->permission; - if( ! $this->exists($file) ) - return false; - if( ! $recursive ) - return @chmod($file,$mode); - if( ! $this->is_dir($file) ) - return @chmod($file, $mode); - //Is a directory, and we want recursive - $file = trailingslashit($file); - $filelist = $this->dirlist($file); - foreach($filelist as $filename) - $this->chmod($file . $filename, $mode, $recursive); - - return true; - } - function chown($file, $owner, $recursive = false) { - if( ! $this->exists($file) ) - return false; - if( ! $recursive ) - return @chown($file, $owner); - if( ! $this->is_dir($file) ) - return @chown($file, $owner); - //Is a directory, and we want recursive - $filelist = $this->dirlist($file); - foreach($filelist as $filename){ - $this->chown($file . '/' . $filename, $owner, $recursive); - } - return true; - } - function owner($file) { - $owneruid = @fileowner($file); - if( ! $owneruid ) - return false; - if( ! function_exists('posix_getpwuid') ) - return $owneruid; - $ownerarray = posix_getpwuid($owneruid); - return $ownerarray['name']; - } - function getchmod($file) { - return @fileperms($file); - } - function group($file) { - $gid = @filegroup($file); - if( ! $gid ) - return false; - if( ! function_exists('posix_getgrgid') ) - return $gid; - $grouparray = posix_getgrgid($gid); - return $grouparray['name']; - } - - function copy($source, $destination, $overwrite = false) { - if( ! $overwrite && $this->exists($destination) ) - return false; - return copy($source, $destination); - } - - function move($source, $destination, $overwrite = false) { - //Possible to use rename()? - if( $this->copy($source, $destination, $overwrite) && $this->exists($destination) ){ - $this->delete($source); - return true; - } else { - return false; - } - } - - function delete($file, $recursive = false) { - $file = str_replace('\\', '/', $file); //for win32, occasional problems deleteing files otherwise - - if( $this->is_file($file) ) - return @unlink($file); - if( ! $recursive && $this->is_dir($file) ) - return @rmdir($file); - - //At this point its a folder, and we're in recursive mode - $file = trailingslashit($file); - $filelist = $this->dirlist($file, true); - - $retval = true; - if( is_array($filelist) ) //false if no files, So check first. - foreach($filelist as $filename => $fileinfo) - if( ! $this->delete($file . $filename, $recursive) ) - $retval = false; - - if( ! @rmdir($file) ) - return false; - return $retval; - } - - function exists($file) { - return @file_exists($file); - } - - function is_file($file) { - return @is_file($file); - } - - function is_dir($path) { - return @is_dir($path); - } - - function is_readable($file) { - return @is_readable($file); - } - - function is_writable($file) { - return @is_writable($file); - } - - function atime($file) { - return @fileatime($file); - } - - function mtime($file) { - return @filemtime($file); - } - function size($file) { - return @filesize($file); - } - - function touch($file, $time = 0, $atime = 0){ - if($time == 0) - $time = time(); - if($atime == 0) - $atime = time(); - return @touch($file, $time, $atime); - } - - function mkdir($path, $chmod = false, $chown = false, $chgrp = false){ - if( ! $chmod) - $chmod = $this->permission; - - if( ! @mkdir($path, $chmod) ) - return false; - if( $chown ) - $this->chown($path, $chown); - if( $chgrp ) - $this->chgrp($path, $chgrp); - return true; - } - - function rmdir($path, $recursive = false) { - //Currently unused and untested, Use delete() instead. - if( ! $recursive ) - return @rmdir($path); - //recursive: - $filelist = $this->dirlist($path); - foreach($filelist as $filename => $det) { - if ( '/' == substr($filename, -1, 1) ) - $this->rmdir($path . '/' . $filename, $recursive); - @rmdir($filename); - } - return @rmdir($path); - } - - function dirlist($path, $incdot = false, $recursive = false) { - if( $this->is_file($path) ) { - $limitFile = basename($path); - $path = dirname($path); - } else { - $limitFile = false; - } - if( ! $this->is_dir($path) ) - return false; - - $ret = array(); - $dir = @dir($path); - if ( ! $dir ) - return false; - while (false !== ($entry = $dir->read()) ) { - $struc = array(); - $struc['name'] = $entry; - - if( '.' == $struc['name'] || '..' == $struc['name'] ) - continue; //Do not care about these folders. - if( '.' == $struc['name'][0] && !$incdot) - continue; - if( $limitFile && $struc['name'] != $limitFile) - continue; - - $struc['perms'] = $this->gethchmod($path.'/'.$entry); - $struc['permsn'] = $this->getnumchmodfromh($struc['perms']); - $struc['number'] = false; - $struc['owner'] = $this->owner($path.'/'.$entry); - $struc['group'] = $this->group($path.'/'.$entry); - $struc['size'] = $this->size($path.'/'.$entry); - $struc['lastmodunix']= $this->mtime($path.'/'.$entry); - $struc['lastmod'] = date('M j',$struc['lastmodunix']); - $struc['time'] = date('h:i:s',$struc['lastmodunix']); - $struc['type'] = $this->is_dir($path.'/'.$entry) ? 'd' : 'f'; - - if ( 'd' == $struc['type'] ) { - if( $recursive ) - $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); - else - $struc['files'] = array(); - } - - $ret[ $struc['name'] ] = $struc; - } - $dir->close(); - unset($dir); - return $ret; - } -} -?> diff -uNr a/mp-wp/wp-admin/includes/class-wp-filesystem-ftpext.php b/mp-wp/wp-admin/includes/class-wp-filesystem-ftpext.php --- a/mp-wp/wp-admin/includes/class-wp-filesystem-ftpext.php 3129ade306ce07e1ff8f7cc0ea5755d709bc1fd927dd6c795f3de0d2fafdd5ceccd7462b075a74b289c93ce8fa43637007312d5b177b9755066f1979da80c92a +++ b/mp-wp/wp-admin/includes/class-wp-filesystem-ftpext.php false @@ -1,382 +0,0 @@ -method = 'ftpext'; - $this->errors = new WP_Error(); - - //Check if possible to use ftp functions. - if ( ! extension_loaded('ftp') ) { - $this->errors->add('no_ftp_ext', __('The ftp PHP extension is not available')); - return false; - } - - // Set defaults: - if ( empty($opt['port']) ) - $this->options['port'] = 21; - else - $this->options['port'] = $opt['port']; - - if ( empty($opt['hostname']) ) - $this->errors->add('empty_hostname', __('FTP hostname is required')); - else - $this->options['hostname'] = $opt['hostname']; - - if ( isset($opt['base']) && ! empty($opt['base']) ) - $this->wp_base = $opt['base']; - - // Check if the options provided are OK. - if ( empty ($opt['username']) ) - $this->errors->add('empty_username', __('FTP username is required')); - else - $this->options['username'] = $opt['username']; - - if ( empty ($opt['password']) ) - $this->errors->add('empty_password', __('FTP password is required')); - else - $this->options['password'] = $opt['password']; - - $this->options['ssl'] = false; - if ( isset($opt['ssl']) ) - $this->options['ssl'] = ( !empty($opt['ssl']) ); - elseif ( isset( $opt['connection_type']) ) - $this->options['ssl'] = ( 'ftps' == $opt['connection_type'] ); - } - - function connect() { - if ( $this->options['ssl'] && function_exists('ftp_ssl_connect') ) - $this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'],$this->timeout); - else - $this->link = @ftp_connect($this->options['hostname'], $this->options['port'],$this->timeout); - - if ( ! $this->link ) { - $this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port'])); - return false; - } - - if ( ! @ftp_login($this->link,$this->options['username'], $this->options['password']) ) { - $this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username'])); - return false; - } - - //Set the Connection to use Passive FTP - @ftp_pasv( $this->link, true ); - - return true; - } - - function setDefaultPermissions($perm) { - $this->permission = $perm; - } - - function get_contents($file, $type = '', $resumepos = 0 ){ - if( empty($type) ) - $type = FTP_BINARY; - - $temp = tmpfile(); - if ( ! $temp ) - return false; - - if( ! @ftp_fget($this->link, $temp, $file, $type, $resumepos) ) - return false; - - fseek($temp, 0); //Skip back to the start of the file being written to - $contents = ''; - - while ( ! feof($temp) ) - $contents .= fread($temp, 8192); - - fclose($temp); - return $contents; - } - function get_contents_array($file) { - return explode("\n", $this->get_contents($file)); - } - function put_contents($file, $contents, $type = '' ) { - if( empty($type) ) - $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII; - - $temp = tmpfile(); - if ( ! $temp ) - return false; - - fwrite($temp, $contents); - fseek($temp, 0); //Skip back to the start of the file being written to - - $ret = @ftp_fput($this->link, $file, $temp, $type); - - fclose($temp); - return $ret; - } - function cwd() { - $cwd = @ftp_pwd($this->link); - if( $cwd ) - $cwd = trailingslashit($cwd); - return $cwd; - } - function chdir($dir) { - return @ftp_chdir($dir); - } - function chgrp($file, $group, $recursive = false ) { - return false; - } - function chmod($file, $mode = false, $recursive = false) { - if( ! $mode ) - $mode = $this->permission; - if( ! $mode ) - return false; - if ( ! $this->exists($file) ) - return false; - if ( ! $recursive || ! $this->is_dir($file) ) { - if ( ! function_exists('ftp_chmod') ) - return @ftp_site($this->link, sprintf('CHMOD %o %s', $mode, $file)); - return @ftp_chmod($this->link, $mode, $file); - } - //Is a directory, and we want recursive - $filelist = $this->dirlist($file); - foreach($filelist as $filename){ - $this->chmod($file . '/' . $filename, $mode, $recursive); - } - return true; - } - function chown($file, $owner, $recursive = false ) { - return false; - } - function owner($file) { - $dir = $this->dirlist($file); - return $dir[$file]['owner']; - } - function getchmod($file) { - $dir = $this->dirlist($file); - return $dir[$file]['permsn']; - } - function group($file) { - $dir = $this->dirlist($file); - return $dir[$file]['group']; - } - function copy($source, $destination, $overwrite = false ) { - if( ! $overwrite && $this->exists($destination) ) - return false; - $content = $this->get_contents($source); - if( false === $content) - return false; - return $this->put_contents($destination, $content); - } - function move($source, $destination, $overwrite = false) { - return ftp_rename($this->link, $source, $destination); - } - - function delete($file,$recursive=false) { - if ( $this->is_file($file) ) - return @ftp_delete($this->link, $file); - if ( !$recursive ) - return @ftp_rmdir($this->link, $file); - $filelist = $this->dirlist($file); - foreach ((array) $filelist as $filename => $fileinfo) { - $this->delete($file . '/' . $filename, $recursive); - } - return @ftp_rmdir($this->link, $file); - } - - function exists($file) { - $list = ftp_rawlist($this->link, $file, false); - if( ! $list ) - return false; - return count($list) == 1 ? true : false; - } - function is_file($file) { - return $this->is_dir($file) ? false : true; - } - function is_dir($path) { - $cwd = $this->cwd(); - $result = @ftp_chdir($this->link, $path); - if( $result && $path == $this->cwd() || $this->cwd() != $cwd ) { - @ftp_chdir($this->link, $cwd); - return true; - } - return false; - } - function is_readable($file) { - //Get dir list, Check if the file is writable by the current user?? - return true; - } - function is_writable($file) { - //Get dir list, Check if the file is writable by the current user?? - return true; - } - function atime($file) { - return false; - } - function mtime($file) { - return ftp_mdtm($this->link, $file); - } - function size($file) { - return ftp_size($this->link, $file); - } - function touch($file, $time = 0, $atime = 0) { - return false; - } - function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { - if( !@ftp_mkdir($this->link, $path) ) - return false; - if( $chmod ) - $this->chmod($path, $chmod); - if( $chown ) - $this->chown($path, $chown); - if( $chgrp ) - $this->chgrp($path, $chgrp); - return true; - } - function rmdir($path, $recursive = false) { - if( ! $recursive ) - return @ftp_rmdir($this->link, $path); - - //TODO: Recursive Directory delete, Have to delete files from the folder first. - //$dir = $this->dirlist($path); - //foreach($dir as $file) - - } - - function parselisting($line) { - $is_windows = ($this->OS_remote == FTP_OS_Windows); - if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|) +(.+)/", $line, $lucifer)) { - $b = array(); - if ($lucifer[3]<70) { $lucifer[3] +=2000; } else { $lucifer[3]+=1900; } // 4digit year fix - $b['isdir'] = ($lucifer[7]==""); - if ( $b['isdir'] ) - $b['type'] = 'd'; - else - $b['type'] = 'f'; - $b['size'] = $lucifer[7]; - $b['month'] = $lucifer[1]; - $b['day'] = $lucifer[2]; - $b['year'] = $lucifer[3]; - $b['hour'] = $lucifer[4]; - $b['minute'] = $lucifer[5]; - $b['time'] = @mktime($lucifer[4]+(strcasecmp($lucifer[6],"PM")==0?12:0),$lucifer[5],0,$lucifer[1],$lucifer[2],$lucifer[3]); - $b['am/pm'] = $lucifer[6]; - $b['name'] = $lucifer[8]; - } else if (!$is_windows && $lucifer=preg_split("/[ ]/",$line,9,PREG_SPLIT_NO_EMPTY)) { - //echo $line."\n"; - $lcount=count($lucifer); - if ($lcount<8) return ''; - $b = array(); - $b['isdir'] = $lucifer[0]{0} === "d"; - $b['islink'] = $lucifer[0]{0} === "l"; - if ( $b['isdir'] ) - $b['type'] = 'd'; - elseif ( $b['islink'] ) - $b['type'] = 'l'; - else - $b['type'] = 'f'; - $b['perms'] = $lucifer[0]; - $b['number'] = $lucifer[1]; - $b['owner'] = $lucifer[2]; - $b['group'] = $lucifer[3]; - $b['size'] = $lucifer[4]; - if ($lcount==8) { - sscanf($lucifer[5],"%d-%d-%d",$b['year'],$b['month'],$b['day']); - sscanf($lucifer[6],"%d:%d",$b['hour'],$b['minute']); - $b['time'] = @mktime($b['hour'],$b['minute'],0,$b['month'],$b['day'],$b['year']); - $b['name'] = $lucifer[7]; - } else { - $b['month'] = $lucifer[5]; - $b['day'] = $lucifer[6]; - if (preg_match("/([0-9]{2}):([0-9]{2})/",$lucifer[7],$l2)) { - $b['year'] = date("Y"); - $b['hour'] = $l2[1]; - $b['minute'] = $l2[2]; - } else { - $b['year'] = $lucifer[7]; - $b['hour'] = 0; - $b['minute'] = 0; - } - $b['time'] = strtotime(sprintf("%d %s %d %02d:%02d",$b['day'],$b['month'],$b['year'],$b['hour'],$b['minute'])); - $b['name'] = $lucifer[8]; - } - } - - return $b; - } - - function dirlist($path = '.', $incdot = false, $recursive = false) { - if( $this->is_file($path) ) { - $limitFile = basename($path); - $path = dirname($path) . '/'; - } else { - $limitFile = false; - } - - $list = @ftp_rawlist($this->link, '-a ' . $path, false); - - if ( $list === false ) - return false; - - $dirlist = array(); - foreach ( $list as $k => $v ) { - $entry = $this->parselisting($v); - if ( empty($entry) ) - continue; - - if ( '.' == $entry["name"] || '..' == $entry["name"] ) - continue; - - $dirlist[ $entry['name'] ] = $entry; - } - - if ( ! $dirlist ) - return false; - if ( empty($dirlist) ) - return array(); - - $ret = array(); - foreach ( $dirlist as $struc ) { - - if ( 'd' == $struc['type'] ) { - $struc['files'] = array(); - - if ( $incdot ){ - //We're including the doted starts - if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder - if ($recursive) - $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); - } - } else { //No dots - if ($recursive) - $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); - } - } - //File - $ret[$struc['name']] = $struc; - } - return $ret; - } - - function __destruct(){ - if( $this->link ) - ftp_close($this->link); - } -} - -?> diff -uNr a/mp-wp/wp-admin/includes/class-wp-filesystem-ftpsockets.php b/mp-wp/wp-admin/includes/class-wp-filesystem-ftpsockets.php --- a/mp-wp/wp-admin/includes/class-wp-filesystem-ftpsockets.php 4b7fab2cadf7c6b81efce687e49d6eeeca0d07a582d58c121ae6aaa03b3cb9f3970a6708bcf676c921da2a0c264a34d5e22b94ce2727665ab1a0c1989336f618 +++ b/mp-wp/wp-admin/includes/class-wp-filesystem-ftpsockets.php false @@ -1,325 +0,0 @@ -method = 'ftpsockets'; - $this->errors = new WP_Error(); - - //Check if possible to use ftp functions. - if( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' ) - return false; - $this->ftp = new ftp(); - - //Set defaults: - if ( empty($opt['port']) ) - $this->options['port'] = 21; - else - $this->options['port'] = $opt['port']; - - if ( empty($opt['hostname']) ) - $this->errors->add('empty_hostname', __('FTP hostname is required')); - else - $this->options['hostname'] = $opt['hostname']; - - if ( isset($opt['base']) && ! empty($opt['base']) ) - $this->wp_base = $opt['base']; - - // Check if the options provided are OK. - if ( empty ($opt['username']) ) - $this->errors->add('empty_username', __('FTP username is required')); - else - $this->options['username'] = $opt['username']; - - if ( empty ($opt['password']) ) - $this->errors->add('empty_password', __('FTP password is required')); - else - $this->options['password'] = $opt['password']; - } - - function connect() { - if ( ! $this->ftp ) - return false; - - //$this->ftp->Verbose = true; - - if ( ! $this->ftp->SetServer($this->options['hostname'], $this->options['port']) ) { - $this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port'])); - return false; - } - if ( ! $this->ftp->connect() ) { - $this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port'])); - return false; - } - - if ( ! $this->ftp->login($this->options['username'], $this->options['password']) ) { - $this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username'])); - return false; - } - - $this->ftp->SetType(FTP_AUTOASCII); - $this->ftp->Passive(true); - return true; - } - - function setDefaultPermissions($perm) { - $this->permission = $perm; - } - - function get_contents($file, $type = '', $resumepos = 0) { - if( ! $this->exists($file) ) - return false; - - if( empty($type) ) - $type = FTP_AUTOASCII; - $this->ftp->SetType($type); - - $temp = wp_tempnam( $file ); - - if ( ! $temphandle = fopen($temp, 'w+') ) - return false; - - if ( ! $this->ftp->fget($temphandle, $file) ) { - fclose($temphandle); - unlink($temp); - return ''; //Blank document, File does exist, Its just blank. - } - - fseek($temphandle, 0); //Skip back to the start of the file being written to - $contents = ''; - - while ( ! feof($temphandle) ) - $contents .= fread($temphandle, 8192); - - fclose($temphandle); - unlink($temp); - return $contents; - } - - function get_contents_array($file) { - return explode("\n", $this->get_contents($file) ); - } - - function put_contents($file, $contents, $type = '' ) { - if( empty($type) ) - $type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII; - - $this->ftp->SetType($type); - - $temp = wp_tempnam( $file ); - if ( ! $temphandle = fopen($temp, 'w+') ){ - unlink($temp); - return false; - } - - fwrite($temphandle, $contents); - fseek($temphandle, 0); //Skip back to the start of the file being written to - - $ret = $this->ftp->fput($file, $temphandle); - - fclose($temphandle); - unlink($temp); - return $ret; - } - - function cwd() { - $cwd = $this->ftp->pwd(); - if( $cwd ) - $cwd = trailingslashit($cwd); - return $cwd; - } - - function chdir($file) { - return $this->ftp->chdir($file); - } - - function chgrp($file, $group, $recursive = false ) { - return false; - } - - function chmod($file, $mode = false, $recursive = false ) { - if( ! $mode ) - $mode = $this->permission; - if( ! $mode ) - return false; - //if( ! $this->exists($file) ) - // return false; - if( ! $recursive || ! $this->is_dir($file) ) { - return $this->ftp->chmod($file,$mode); - } - //Is a directory, and we want recursive - $filelist = $this->dirlist($file); - foreach($filelist as $filename){ - $this->chmod($file . '/' . $filename, $mode, $recursive); - } - return true; - } - - function chown($file, $owner, $recursive = false ) { - return false; - } - - function owner($file) { - $dir = $this->dirlist($file); - return $dir[$file]['owner']; - } - - function getchmod($file) { - $dir = $this->dirlist($file); - return $dir[$file]['permsn']; - } - - function group($file) { - $dir = $this->dirlist($file); - return $dir[$file]['group']; - } - - function copy($source, $destination, $overwrite = false ) { - if( ! $overwrite && $this->exists($destination) ) - return false; - - $content = $this->get_contents($source); - if ( false === $content ) - return false; - - return $this->put_contents($destination, $content); - } - - function move($source, $destination, $overwrite = false ) { - return $this->ftp->rename($source, $destination); - } - - function delete($file, $recursive = false ) { - if ( $this->is_file($file) ) - return $this->ftp->delete($file); - if ( !$recursive ) - return $this->ftp->rmdir($file); - - return $this->ftp->mdel($file); - } - - function exists($file) { - return $this->ftp->is_exists($file); - } - - function is_file($file) { - return $this->is_dir($file) ? false : true; - } - - function is_dir($path) { - $cwd = $this->cwd(); - if ( $this->chdir($path) ) { - $this->chdir($cwd); - return true; - } - return false; - } - - function is_readable($file) { - //Get dir list, Check if the file is writable by the current user?? - return true; - } - - function is_writable($file) { - //Get dir list, Check if the file is writable by the current user?? - return true; - } - - function atime($file) { - return false; - } - - function mtime($file) { - return $this->ftp->mdtm($file); - } - - function size($file) { - return $this->ftp->filesize($file); - } - - function touch($file, $time = 0, $atime = 0 ) { - return false; - } - - function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) { - if( ! $this->ftp->mkdir($path) ) - return false; - if( $chmod ) - $this->chmod($path, $chmod); - if( $chown ) - $this->chown($path, $chown); - if( $chgrp ) - $this->chgrp($path, $chgrp); - return true; - } - - function rmdir($path, $recursive = false ) { - if( ! $recursive ) - return $this->ftp->rmdir($path); - - return $this->ftp->mdel($path); - } - - function dirlist($path = '.', $incdot = false, $recursive = false ) { - if( $this->is_file($path) ) { - $limitFile = basename($path); - $path = dirname($path) . '/'; - } else { - $limitFile = false; - } - - $list = $this->ftp->dirlist($path); - if( ! $list ) - return false; - if( empty($list) ) - return array(); - - $ret = array(); - foreach ( $list as $struc ) { - - if ( 'd' == $struc['type'] ) { - $struc['files'] = array(); - - if ( $incdot ){ - //We're including the doted starts - if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder - if ($recursive) - $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); - } - } else { //No dots - if ($recursive) - $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); - } - } - //File - $ret[$struc['name']] = $struc; - } - return $ret; - } - - function __destruct() { - $this->ftp->quit(); - } -} - -?> diff -uNr a/mp-wp/wp-admin/includes/class-wp-filesystem-ssh2.php b/mp-wp/wp-admin/includes/class-wp-filesystem-ssh2.php --- a/mp-wp/wp-admin/includes/class-wp-filesystem-ssh2.php 793e8a50c47ebca2824dd8b2ca9e681f8670286b499ee169b2ddd10ced61322bd86279a8376725483bad2d4d42d499fbfe860eafe505fcd25c32f930f44d9d01 +++ b/mp-wp/wp-admin/includes/class-wp-filesystem-ssh2.php false @@ -1,507 +0,0 @@ -method = 'ssh2'; - $this->errors = new WP_Error(); - - //Check if possible to use ssh2 functions. - if ( ! extension_loaded('ssh2') ) { - $this->errors->add('no_ssh2_ext', __('The ssh2 PHP extension is not available')); - return false; - } - - // Set defaults: - if ( empty($opt['port']) ) - $this->options['port'] = 22; - else - $this->options['port'] = $opt['port']; - - if ( empty($opt['hostname']) ) - $this->errors->add('empty_hostname', __('SSH2 hostname is required')); - else - $this->options['hostname'] = $opt['hostname']; - - if ( isset($opt['base']) && ! empty($opt['base']) ) - $this->wp_base = $opt['base']; - - // Check if the options provided are OK. - if ( empty ($opt['username']) ) - $this->errors->add('empty_username', __('SSH2 username is required')); - else - $this->options['username'] = $opt['username']; - - if ( ( !empty ($opt['public_key']) ) && ( !empty ($opt['private_key']) ) ) { - $this->options['public_key'] = $opt['public_key']; - $this->options['private_key'] = $opt['private_key']; - - $this->options['hostkey'] = array("hostkey" => "ssh-rsa"); - - $this->keys = true; - } - - - if ( empty ($opt['password']) ) { - if ( !$this->keys ) // password can be blank if we are using keys - $this->errors->add('empty_password', __('SSH2 password is required')); - } else { - $this->options['password'] = $opt['password']; - } - - } - - function connect() { - $this->debug("connect();"); - - if ( ! $this->keys ) { - $this->link = @ssh2_connect($this->options['hostname'], $this->options['port']); - } else { - $this->link = @ssh2_connect($this->options['hostname'], $this->options['port'], $this->options['hostkey']); - } - - if ( ! $this->link ) { - $this->errors->add('connect', sprintf(__('Failed to connect to SSH2 Server %1$s:%2$s'), $this->options['hostname'], $this->options['port'])); - return false; - } - - if ( !$this->keys ) { - if ( ! @ssh2_auth_password($this->link, $this->options['username'], $this->options['password']) ) { - $this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username'])); - return false; - } - } else { - if ( ! @ssh2_auth_pubkey_file($this->link, $this->options['username'], $this->options['public_key'], $this->options['private_key'], $this->options['password'] ) ) { - $this->errors->add('auth', sprintf(__('Public and Private keys incorrent for %s'), $this->options['username'])); - return false; - } - } - - $this->sftp_link = ssh2_sftp($this->link); - - return true; - } - - function run_command($link, $command, $returnbool = false) { - $this->debug("run_command();"); - if(!($stream = @ssh2_exec( $link, $command . "; echo \"__COMMAND_FINISHED__\";"))) { - $this->errors->add('command', sprintf(__('Unable to perform command: %s'), $command)); - } else { - stream_set_blocking( $stream, true ); - $time_start = time(); - $data = null; - while( true ) { - if (strpos($data,"__COMMAND_FINISHED__") !== false){ - break; // the command has finshed! - } - if( (time()-$time_start) > $this->timeout ){ - $this->errors->add('command', sprintf(__('Connection to the server has timeout after %s seconds.'), $this->timeout)); - unset($this->link); - unset($this->sftp_link); // close connections - return false; - } - while( $buf = fread( $stream, strlen($stream) ) ) - $data .= $buf; - } - fclose($stream); - $data = trim(str_replace("__COMMAND_FINISHED__", "", $data)); - if (($returnbool) && ( (int) $data )) { - return true; - } elseif (($returnbool) && (! (int) $data )) { - return false; - } else { - return $data; - } - } - return false; - } - - function debug($text) - { - if ($this->debugtest) - { - echo "
    " . $text . "
    "; - } - } - - function setDefaultPermissions($perm) { - $this->debug("setDefaultPermissions();"); - if ( $perm ) - $this->permission = $perm; - } - - function get_contents($file, $type = '', $resumepos = 0 ) { - $this->debug("get_contents();"); - $tempfile = wp_tempnam( $file ); - if ( ! $tempfile ) - return false; - if( ! ssh2_scp_recv($this->link, $file, $tempfile) ) - return false; - $contents = file_get_contents($tempfile); - unlink($tempfile); - return $contents; - } - - function get_contents_array($file) { - $this->debug("get_contents_array();"); - return explode("\n", $this->get_contents($file)); - } - - function put_contents($file, $contents, $type = '' ) { - $this->debug("put_contents($file);"); - $tempfile = wp_tempnam( $file ); - $temp = fopen($tempfile, 'w'); - if ( ! $temp ) - return false; - fwrite($temp, $contents); - fclose($temp); - $ret = ssh2_scp_send($this->link, $tempfile, $file, $this->permission); - unlink($tempfile); - return $ret; - } - - function cwd() { - $this->debug("cwd();"); - $cwd = $this->run_command($this->link, 'pwd'); - if( $cwd ) - $cwd = trailingslashit($cwd); - return $cwd; - } - - function chdir($dir) { - $this->debug("chdir();"); - return $this->run_command($this->link, 'cd ' . $dir, true); - } - - function chgrp($file, $group, $recursive = false ) { - $this->debug("chgrp();"); - if ( ! $this->exists($file) ) - return false; - if ( ! $recursive || ! $this->is_dir($file) ) - return $this->run_command($this->link, sprintf('chgrp %o %s', $mode, $file), true); - return $this->run_command($this->link, sprintf('chgrp -R %o %s', $mode, $file), true); - } - - function chmod($file, $mode = false, $recursive = false) { - $this->debug("chmod();"); - if( ! $mode ) - $mode = $this->permission; - if( ! $mode ) - return false; - if ( ! $this->exists($file) ) - return false; - if ( ! $recursive || ! $this->is_dir($file) ) - return $this->run_command($this->link, sprintf('chmod %o %s', $mode, $file), true); - return $this->run_command($this->link, sprintf('chmod -R %o %s', $mode, $file), true); - } - - function chown($file, $owner, $recursive = false ) { - $this->debug("chown();"); - if ( ! $this->exists($file) ) - return false; - if ( ! $recursive || ! $this->is_dir($file) ) - return $this->run_command($this->link, sprintf('chown %o %s', $mode, $file), true); - return $this->run_command($this->link, sprintf('chown -R %o %s', $mode, $file), true); - } - - function owner($file) { - $this->debug("owner();"); - $dir = $this->dirlist($file); - return $dir[$file]['owner']; - } - - function getchmod($file) { - $this->debug("getchmod();"); - $dir = $this->dirlist($file); - return $dir[$file]['permsn']; - } - - function group($file) { - $this->debug("group();"); - $dir = $this->dirlist($file); - return $dir[$file]['group']; - } - - function copy($source, $destination, $overwrite = false ) { - $this->debug("copy();"); - if( ! $overwrite && $this->exists($destination) ) - return false; - $content = $this->get_contents($source); - if( false === $content) - return false; - return $this->put_contents($destination, $content); - } - - function move($source, $destination, $overwrite = false) { - $this->debug("move();"); - return @ssh2_sftp_rename($this->link, $source, $destination); - } - - function delete($file, $recursive = false) { - $this->debug("delete();"); - if ( $this->is_file($file) ) - return ssh2_sftp_unlink($this->sftp_link, $file); - if ( ! $recursive ) - return ssh2_sftp_rmdir($this->sftp_link, $file); - $filelist = $this->dirlist($file); - if ( is_array($filelist) ) { - foreach ( $filelist as $filename => $fileinfo) { - $this->delete($file . '/' . $filename, $recursive); - } - } - return ssh2_sftp_rmdir($this->sftp_link, $file); - } - - function exists($file) { - $this->debug("exists();"); - return $this->run_command($this->link, sprintf('ls -lad %s', $file), true); - } - - function is_file($file) { - $this->debug("is_file();"); - //DO NOT RELY ON dirlist()! - $list = $this->run_command($this->link, sprintf('ls -lad %s', $file)); - $list = $this->parselisting($list); - if ( ! $list ) - return false; - else - return ( !$list['isdir'] && !$list['islink'] ); //ie. not a file or link, yet exists, must be file. - } - - function is_dir($path) { - $this->debug("is_dir();"); - //DO NOT RELY ON dirlist()! - $list = $this->parselisting($this->run_command($this->link, sprintf('ls -lad %s', untrailingslashit($path)))); - if ( ! $list ) - return false; - else - return $list['isdir']; - } - - function is_readable($file) { - //Not implmented. - } - - function is_writable($file) { - //Not implmented. - } - - function atime($file) { - //Not implmented. - } - - function mtime($file) { - //Not implmented. - } - - function size($file) { - //Not implmented. - } - - function touch($file, $time = 0, $atime = 0) { - //Not implmented. - } - - function mkdir($path, $chmod = null, $chown = false, $chgrp = false) { - $this->debug("mkdir();"); - $path = untrailingslashit($path); - if( ! ssh2_sftp_mkdir($this->sftp_link, $path, $chmod, true) ) - return false; - if( $chown ) - $this->chown($path, $chown); - if( $chgrp ) - $this->chgrp($path, $chgrp); - return true; - } - - function rmdir($path, $recursive = false) { - $this->debug("rmdir();"); - return $this->delete($path, $recursive); - } - - function parselisting($line) { - $this->debug("parselisting();"); - $is_windows = ($this->OS_remote == FTP_OS_Windows); - if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|) +(.+)/", $line, $lucifer)) { - $b = array(); - if ($lucifer[3]<70) { $lucifer[3] +=2000; } else { $lucifer[3]+=1900; } // 4digit year fix - $b['isdir'] = ($lucifer[7]==""); - if ( $b['isdir'] ) - $b['type'] = 'd'; - else - $b['type'] = 'f'; - $b['size'] = $lucifer[7]; - $b['month'] = $lucifer[1]; - $b['day'] = $lucifer[2]; - $b['year'] = $lucifer[3]; - $b['hour'] = $lucifer[4]; - $b['minute'] = $lucifer[5]; - $b['time'] = @mktime($lucifer[4]+(strcasecmp($lucifer[6],"PM")==0?12:0),$lucifer[5],0,$lucifer[1],$lucifer[2],$lucifer[3]); - $b['am/pm'] = $lucifer[6]; - $b['name'] = $lucifer[8]; - } else if (!$is_windows && $lucifer=preg_split("/[ ]/",$line,9,PREG_SPLIT_NO_EMPTY)) { - //echo $line."\n"; - $lcount=count($lucifer); - if ($lcount<8) return ''; - $b = array(); - $b['isdir'] = $lucifer[0]{0} === "d"; - $b['islink'] = $lucifer[0]{0} === "l"; - if ( $b['isdir'] ) - $b['type'] = 'd'; - elseif ( $b['islink'] ) - $b['type'] = 'l'; - else - $b['type'] = 'f'; - $b['perms'] = $lucifer[0]; - $b['number'] = $lucifer[1]; - $b['owner'] = $lucifer[2]; - $b['group'] = $lucifer[3]; - $b['size'] = $lucifer[4]; - if ($lcount==8) { - sscanf($lucifer[5],"%d-%d-%d",$b['year'],$b['month'],$b['day']); - sscanf($lucifer[6],"%d:%d",$b['hour'],$b['minute']); - $b['time'] = @mktime($b['hour'],$b['minute'],0,$b['month'],$b['day'],$b['year']); - $b['name'] = $lucifer[7]; - } else { - $b['month'] = $lucifer[5]; - $b['day'] = $lucifer[6]; - if (preg_match("/([0-9]{2}):([0-9]{2})/",$lucifer[7],$l2)) { - $b['year'] = date("Y"); - $b['hour'] = $l2[1]; - $b['minute'] = $l2[2]; - } else { - $b['year'] = $lucifer[7]; - $b['hour'] = 0; - $b['minute'] = 0; - } - $b['time'] = strtotime(sprintf("%d %s %d %02d:%02d",$b['day'],$b['month'],$b['year'],$b['hour'],$b['minute'])); - $b['name'] = $lucifer[8]; - } - } - - return $b; - } - - function dirlist($path = '.', $incdot = false, $recursive = false) { - $this->debug("dirlist();"); - if( $this->is_file($path) ) { - $limitFile = basename($path); - $path = trailingslashit(dirname($path)); - } else { - $limitFile = false; - } - - $list = $this->run_command($this->link, sprintf('ls -la %s', $path)); - - if ( $list === false ) - return false; - - $list = explode("\n", $list); - - $dirlist = array(); - foreach ( (array)$list as $k => $v ) { - $entry = $this->parselisting($v); - if ( empty($entry) ) - continue; - - if ( '.' == $entry['name'] || '..' == $entry['name'] ) - continue; - - $dirlist[ $entry['name'] ] = $entry; - } - - if ( ! $dirlist ) - return false; - - if ( empty($dirlist) ) - return array(); - - $ret = array(); - foreach ( $dirlist as $struc ) { - - if ( 'd' == $struc['type'] ) { - $struc['files'] = array(); - - if ( $incdot ){ - //We're including the doted starts - if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder - if ($recursive) - $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); - } - } else { //No dots - if ( $recursive ) - $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); - } - } - //File - $ret[$struc['name']] = $struc; - } - return $ret; - } - function __destruct() { - $this->debug("__destruct();"); - if ( $this->link ) - unset($this->link); - if ( $this->sftp_link ) - unset($this->sftp_link); - } -} - -?> diff -uNr a/mp-wp/wp-admin/includes/comment.php b/mp-wp/wp-admin/includes/comment.php --- a/mp-wp/wp-admin/includes/comment.php 925fc35aefe98838cec79236f68eb0b305662566c2944b261a4ffa150619116b6f6e1add761f1acf461656742447b64e72bd255ae7d505cbfde2972d4debfbbc +++ b/mp-wp/wp-admin/includes/comment.php 0ba39a3444470d82a52e70f2f321d3f86874891a76b1678f37d8000d3f22ae948528ad8c6a047e8dfb27538e888c251926ed2c7b294ba0a345c3304126abc9a1 @@ -151,11 +151,6 @@ return "$avatar $name"; } -function enqueue_comment_hotkeys_js() { - if ( 'true' == get_user_option( 'comment_shortcuts' ) ) - wp_enqueue_script( 'jquery-table-hotkeys' ); -} - if ( is_admin() && ('edit-comments.php' == $pagenow || 'edit.php' == $pagenow) ) { if ( get_option('show_avatars') ) add_filter( 'comment_author', 'floated_admin_avatar' ); diff -uNr a/mp-wp/wp-admin/includes/dashboard.php b/mp-wp/wp-admin/includes/dashboard.php --- a/mp-wp/wp-admin/includes/dashboard.php 237b6b3c050348cbbd984c97b5030637a17a3c98c6252e4be8d68fbb82ae327b2dc90de81f4bd99c081361e65359f9adf00c1d6f2fa330d94bef05e3959e9f91 +++ b/mp-wp/wp-admin/includes/dashboard.php 2c6f9fd702518c4606dae01232495e2abe75c6c3147c7a9af2eab3193ac23fbfd8ab862d72f91cf36871bae341b6263ffb720d9c91a3e543911e3b709b9133fb @@ -31,58 +31,10 @@ $recent_comments_title = __( 'Recent Comments' ); wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments' ); - // 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; - $widget_options['dashboard_incoming_links'] = array( - 'home' => get_option('home'), - 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), - 'url' => apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ), - 'items' => isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10, - '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 Plugins Widget - if ( current_user_can( 'activate_plugins' ) ) - wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' ); - - // QuickPress Widget - if ( 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') ) wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' ); - // Primary feed (Dev Blog) Widget - if ( !isset( $widget_options['dashboard_primary'] ) ) { - $update = true; - $widget_options['dashboard_primary'] = array( - 'link' => apply_filters( 'dashboard_primary_link', __( 'http://wordpress.org/development/' ) ), - 'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/development/feed/' ) ), - 'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Development Blog' ) ), - 'items' => 2, - 'show_summary' => 1, - 'show_author' => 0, - 'show_date' => 1 - ); - } - wp_add_dashboard_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_primary', 'wp_dashboard_primary_control' ); - - // Secondary Feed (Planet) Widget - if ( !isset( $widget_options['dashboard_secondary'] ) ) { - $update = true; - $widget_options['dashboard_secondary'] = array( - 'link' => apply_filters( 'dashboard_secondary_link', __( 'http://planet.wordpress.org/' ) ), - 'url' => apply_filters( 'dashboard_secondary_feed', __( 'http://planet.wordpress.org/feed/' ) ), - 'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ), - 'items' => 5 - ); - } - 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' ); @@ -175,7 +127,6 @@ $num_comm = wp_count_comments( ); - echo "\n\t".'

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

    '; echo "\n\t".'
    '."\n\t".''; echo "\n\t".''; @@ -278,91 +229,11 @@ } echo '

    '; - - echo sprintf('You are using WordPress %s', $GLOBALS['wp_version']); - echo "\n\t".''; do_action( 'rightnow_end' ); do_action( 'activity_box_end' ); } -function wp_dashboard_quick_press() { - $drafts = false; - if ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) && isset( $_POST['action'] ) && 0 === strpos( $_POST['action'], 'post-quickpress' ) && (int) $_POST['post_ID'] ) { - $view = get_permalink( $_POST['post_ID'] ); - $edit = clean_url( get_edit_post_link( $_POST['post_ID'] ) ); - if ( 'post-quickpress-publish' == $_POST['action'] ) { - if ( current_user_can('publish_posts') ) - printf( '

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

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

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

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

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

    ', clean_url( add_query_arg( 'preview', 1, $view ) ), $edit ); - $drafts_query = new WP_Query( array( - 'post_type' => 'post', - 'what_to_show' => 'posts', - 'post_status' => 'draft', - 'author' => $GLOBALS['current_user']->ID, - 'posts_per_page' => 1, - 'orderby' => 'modified', - 'order' => 'DESC' - ) ); - - if ( $drafts_query->posts ) - $drafts =& $drafts_query->posts; - } - printf('

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

    ', '' . __('Press This') . '' ); - $_REQUEST = array(); // hack for get_default_post_to_edit() - } - - $post = get_default_post_to_edit(); -?> - - -

    -
    - -
    - - -
    - -
    - - -

    -
    - -
    - - - -

    -
    - -
    - -

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

    - - - -comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . ''; $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; $actions['edit'] = "". __('Edit') . ''; - //$actions['quickedit'] = '' . __('Quick Edit') . ''; - $actions['reply'] = '' . __('Reply') . ''; $actions['spam'] = "" . _c( 'Spam|verb' ) . ''; $actions['delete'] = "" . __('Delete') . ''; @@ -486,10 +355,6 @@ ++$i; ( ( ('approve' == $action || 'unapprove' == $action) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | '; - // Reply and quickedit need a hide-if-no-js span - if ( 'reply' == $action || 'quickedit' == $action ) - $action .= ' hide-if-no-js'; - $actions_string .= "$sep$link"; } } @@ -668,66 +533,6 @@ echo ""; } -function wp_dashboard_plugins() { - wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array( - 'http://wordpress.org/extend/plugins/rss/browse/popular/', - 'http://wordpress.org/extend/plugins/rss/browse/new/', - 'http://wordpress.org/extend/plugins/rss/browse/updated/' - ) ); -} - -/** - * Display plugins most popular, newest plugins, and recently updated widget text. - * - * @since unknown - */ -function wp_dashboard_plugins_output() { - $popular = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/popular/' ); - $new = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/new/' ); - $updated = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/updated/' ); - - foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins'), 'updated' => __('Recently Updated') ) as $feed => $label ) { - if ( !isset($$feed->items) || 0 == count($$feed->items) ) - continue; - - $$feed->items = array_slice($$feed->items, 0, 5); - $item_key = array_rand($$feed->items); - - // Eliminate some common badly formed plugin descriptions - while ( ( null !== $item_key = array_rand($$feed->items) ) && false !== strpos( $$feed->items[$item_key]['description'], 'Plugin Name:' ) ) - unset($$feed->items[$item_key]); - - if ( !isset($$feed->items[$item_key]) ) - continue; - - $item = $$feed->items[$item_key]; - - // current bbPress feed item titles are: user on "topic title" - if ( preg_match( '/"(.*)"/s', $item['title'], $matches ) ) - $title = $matches[1]; - else // but let's make it forward compatible if things change - $title = $item['title']; - $title = wp_specialchars( $title ); - - $description = wp_specialchars( strip_tags(html_entity_decode($item['description'], ENT_QUOTES)) ); - - list($link, $frag) = explode( '#', $item['link'] ); - - $link = clean_url($link); - if( preg_match('|/([^/]+?)/?$|', $link, $matches) ) - $slug = $matches[1]; - else - $slug = ''; - - $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . - '&TB_iframe=true&width=600&height=800'; - - echo "

    $label

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

    $description

    \n"; - } -} - /** * Checks to see if all of the feed url in $check_urls are cached. * diff -uNr a/mp-wp/wp-admin/includes/file.php b/mp-wp/wp-admin/includes/file.php --- a/mp-wp/wp-admin/includes/file.php d15748396bc55befc5382493a14277183743bdfbdac539adf53761ff46f57f90e2edd86ed3231afb0d0f6981e51a1ba1f04756c59ccd4cd100ebebb737d412b8 +++ b/mp-wp/wp-admin/includes/file.php 21d106bb4cd0fc4fa5adbb52a7d10ce57bc8c2c1bd9cb7b47797f337774acbbe735fd8aa63946ed841d9a05961976a90fe6afc2ade47392fe9b2e02730448575 @@ -40,29 +40,6 @@ * * @since unknown * - * @param unknown_type $file - * @return unknown - */ -function get_file_description( $file ) { - global $wp_file_descriptions; - - if ( isset( $wp_file_descriptions[basename( $file )] ) ) { - return $wp_file_descriptions[basename( $file )]; - } - elseif ( file_exists( WP_CONTENT_DIR . $file ) && is_file( WP_CONTENT_DIR . $file ) ) { - $template_data = implode( '', file( WP_CONTENT_DIR . $file ) ); - if ( preg_match( '|Template Name:(.*)$|mi', $template_data, $name )) - return $name[1] . ' Page Template'; - } - - return basename( $file ); -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * * @return unknown */ function get_home_path() { @@ -84,60 +61,6 @@ * * @since unknown * - * @param unknown_type $file - * @return unknown - */ -function get_real_file_to_edit( $file ) { - if ('index.php' == $file || '.htaccess' == $file ) { - $real_file = get_home_path() . $file; - } else { - $real_file = WP_CONTENT_DIR . $file; - } - - return $real_file; -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param string $folder Optional. Full path to folder - * @param int $levels Optional. Levels of folders to follow, Default: 100 (PHP Loop limit). - * @return bool|array - */ -function list_files( $folder = '', $levels = 100 ) { - if( empty($folder) ) - return false; - - if( ! $levels ) - return false; - - $files = array(); - if ( $dir = @opendir( $folder ) ) { - while (($file = readdir( $dir ) ) !== false ) { - if ( in_array($file, array('.', '..') ) ) - continue; - if ( is_dir( $folder . '/' . $file ) ) { - $files2 = list_files( $folder . '/' . $file, $levels - 1); - if( $files2 ) - $files = array_merge($files, $files2 ); - else - $files[] = $folder . '/' . $file . '/'; - } else { - $files[] = $folder . '/' . $file; - } - } - } - @closedir( $dir ); - return $files; -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * * @return unknown */ function get_temp_dir() { @@ -180,35 +103,6 @@ * * @since unknown * - * @param unknown_type $file - * @param unknown_type $allowed_files - * @return unknown - */ -function validate_file_to_edit( $file, $allowed_files = '' ) { - $file = stripslashes( $file ); - - $code = validate_file( $file, $allowed_files ); - - if (!$code ) - return $file; - - switch ( $code ) { - case 1 : - wp_die( __('Sorry, can’t edit files with ".." in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.' )); - - case 2 : - wp_die( __('Sorry, can’t call files with their real path.' )); - - case 3 : - wp_die( __('Sorry, that file cannot be edited.' )); - } -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * * @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 ). @@ -309,461 +203,4 @@ return $return; } -/** - * {@internal Missing Short Description}} - * - * Pass this function an array similar to that of a $_FILES POST array. - * - * @since unknown - * - * @param unknown_type $file - * @param unknown_type $overrides - * @return unknown - */ -function wp_handle_sideload( &$file, $overrides = false ) { - // The default error handler. - if (! function_exists( 'wp_handle_upload_error' ) ) { - function wp_handle_upload_error( &$file, $message ) { - return array( 'error'=>$message ); - } - } - - // You may define your own function and pass the name in $overrides['upload_error_handler'] - $upload_error_handler = 'wp_handle_upload_error'; - - // You may define your own function and pass the name in $overrides['unique_filename_callback'] - $unique_filename_callback = null; - - // $_POST['action'] must be set and its value must equal $overrides['action'] or this: - $action = 'wp_handle_sideload'; - - // Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error']. - $upload_error_strings = array( false, - __( "The file exceeds the upload_max_filesize directive in php.ini." ), - __( "The file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form." ), - __( "The file was only partially uploaded." ), - __( "No file was sent." ), - __( "Missing a temporary folder." ), - __( "Failed to write file to disk." )); - - // All tests are on by default. Most can be turned off by $override[{test_name}] = false; - $test_form = true; - $test_size = true; - - // If you override this, you must provide $ext and $type!!!! - $test_type = true; - $mimes = false; - - // Install user overrides. Did we mention that this voids your warranty? - if ( is_array( $overrides ) ) - extract( $overrides, EXTR_OVERWRITE ); - - // A correct form post will pass this test. - if ( $test_form && (!isset( $_POST['action'] ) || ($_POST['action'] != $action ) ) ) - return $upload_error_handler( $file, __( 'Invalid form submission.' )); - - // A successful upload will pass this test. It makes no sense to override this one. - if ( $file['error'] > 0 ) - return $upload_error_handler( $file, $upload_error_strings[$file['error']] ); - - // A non-empty file will pass this test. - if ( $test_size && !(filesize($file['tmp_name']) > 0 ) ) - return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.' )); - - // A properly uploaded file will pass this test. There should be no reason to override this one. - if (! @ is_file( $file['tmp_name'] ) ) - return $upload_error_handler( $file, __( 'Specified file does not exist.' )); - - // A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter. - if ( $test_type ) { - $wp_filetype = wp_check_filetype( $file['name'], $mimes ); - - extract( $wp_filetype ); - - if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) - return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' )); - - if ( !$ext ) - $ext = ltrim(strrchr($file['name'], '.'), '.'); - - if ( !$type ) - $type = $file['type']; - } - - // A writable uploads dir will pass this test. Again, there's no point overriding this one. - if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) ) - return $upload_error_handler( $file, $uploads['error'] ); - - $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); - - // Strip the query strings. - $filename = str_replace('?','-', $filename); - $filename = str_replace('&','-', $filename); - - // Move the file to the uploads dir - $new_file = $uploads['path'] . "/$filename"; - if ( false === @ rename( $file['tmp_name'], $new_file ) ) { - return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) ); - } - - // Set correct file permissions - $stat = stat( dirname( $new_file )); - $perms = $stat['mode'] & 0000666; - @ chmod( $new_file, $perms ); - - // Compute the URL - $url = $uploads['url'] . "/$filename"; - - $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) ); - - return $return; -} - -/** - * Downloads a url to a local file using the Snoopy HTTP Class. - * - * @since unknown - * @todo Transition over to using the new HTTP Request API (jacob). - * - * @param string $url the URL of the file to download - * @return mixed WP_Error on failure, string Filename on success. - */ -function download_url( $url ) { - //WARNING: The file is not automatically deleted, The script must unlink() the file. - if ( ! $url ) - return new WP_Error('http_no_url', __('Invalid URL Provided')); - - $tmpfname = wp_tempnam($url); - if ( ! $tmpfname ) - return new WP_Error('http_no_file', __('Could not create Temporary file')); - - $handle = @fopen($tmpfname, 'wb'); - if ( ! $handle ) - return new WP_Error('http_no_file', __('Could not create Temporary file')); - - $response = wp_remote_get($url, array('timeout' => 30)); - - if ( is_wp_error($response) ) { - fclose($handle); - unlink($tmpfname); - return $response; - } - - if ( $response['response']['code'] != '200' ){ - fclose($handle); - unlink($tmpfname); - return new WP_Error('http_404', trim($response['response']['message'])); - } - - fwrite($handle, $response['body']); - fclose($handle); - - return $tmpfname; -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $file - * @param unknown_type $to - * @return unknown - */ -function unzip_file($file, $to) { - global $wp_filesystem; - - if ( ! $wp_filesystem || !is_object($wp_filesystem) ) - return new WP_Error('fs_unavailable', __('Could not access filesystem.')); - - // Unzip uses a lot of memory - @ini_set('memory_limit', '256M'); - - $fs =& $wp_filesystem; - - require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php'); - - $archive = new PclZip($file); - - // Is the archive valid? - if ( false == ($archive_files = $archive->extract(PCLZIP_OPT_EXTRACT_AS_STRING)) ) - return new WP_Error('incompatible_archive', __('Incompatible archive'), $archive->errorInfo(true)); - - if ( 0 == count($archive_files) ) - return new WP_Error('empty_archive', __('Empty archive')); - - $path = explode('/', untrailingslashit($to)); - for ( $i = count($path); $i > 0; $i-- ) { //>0 = first element is empty allways for paths starting with '/' - $tmppath = implode('/', array_slice($path, 0, $i) ); - if ( $fs->is_dir($tmppath) ) { //Found the highest folder that exists, Create from here(ie +1) - for ( $i = $i + 1; $i <= count($path); $i++ ) { - $tmppath = implode('/', array_slice($path, 0, $i) ); - if ( ! $fs->mkdir($tmppath, FS_CHMOD_DIR) ) - return new WP_Error('mkdir_failed', __('Could not create directory'), $tmppath); - } - break; //Exit main for loop - } - } - - $to = trailingslashit($to); - foreach ($archive_files as $file) { - $path = $file['folder'] ? $file['filename'] : dirname($file['filename']); - $path = explode('/', $path); - for ( $i = count($path); $i >= 0; $i-- ) { //>=0 as the first element contains data - if ( empty($path[$i]) ) - continue; - $tmppath = $to . implode('/', array_slice($path, 0, $i) ); - if ( $fs->is_dir($tmppath) ) {//Found the highest folder that exists, Create from here - for ( $i = $i + 1; $i <= count($path); $i++ ) { //< count() no file component please. - $tmppath = $to . implode('/', array_slice($path, 0, $i) ); - if ( ! $fs->is_dir($tmppath) && ! $fs->mkdir($tmppath, FS_CHMOD_DIR) ) - return new WP_Error('mkdir_failed', __('Could not create directory'), $tmppath); - } - break; //Exit main for loop - } - } - - // We've made sure the folders are there, so let's extract the file now: - if ( ! $file['folder'] ) { - if ( !$fs->put_contents( $to . $file['filename'], $file['content']) ) - return new WP_Error('copy_failed', __('Could not copy file'), $to . $file['filename']); - $fs->chmod($to . $file['filename'], FS_CHMOD_FILE); - } - } - return true; -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $from - * @param unknown_type $to - * @return unknown - */ -function copy_dir($from, $to) { - global $wp_filesystem; - - $dirlist = $wp_filesystem->dirlist($from); - - $from = trailingslashit($from); - $to = trailingslashit($to); - - foreach ( (array) $dirlist as $filename => $fileinfo ) { - if ( 'f' == $fileinfo['type'] ) { - if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true) ) { - // If copy failed, chmod file to 0644 and try again. - $wp_filesystem->chmod($to . $filename, 0644); - if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true) ) - return new WP_Error('copy_failed', __('Could not copy file'), $to . $filename); - } - $wp_filesystem->chmod($to . $filename, FS_CHMOD_FILE); - } elseif ( 'd' == $fileinfo['type'] ) { - if ( !$wp_filesystem->is_dir($to . $filename) ) { - if ( !$wp_filesystem->mkdir($to . $filename, FS_CHMOD_DIR) ) - return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $filename); - } - $result = copy_dir($from . $filename, $to . $filename); - if ( is_wp_error($result) ) - return $result; - } - } -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $args - * @return unknown - */ -function WP_Filesystem( $args = false ) { - global $wp_filesystem; - - require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'); - - $method = get_filesystem_method($args); - - if ( ! $method ) - return false; - - $abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method); - if( ! file_exists($abstraction_file) ) - return; - - require_once($abstraction_file); - $method = "WP_Filesystem_$method"; - - $wp_filesystem = new $method($args); - - if ( $wp_filesystem->errors->get_error_code() ) - return false; - - if ( !$wp_filesystem->connect() ) - return false; //There was an erorr connecting to the server. - - // Set the permission constants if not already set. - if ( ! defined('FS_CHMOD_DIR') ) - define('FS_CHMOD_DIR', 0755 ); - if ( ! defined('FS_CHMOD_FILE') ) - define('FS_CHMOD_FILE', 0644 ); - - return true; -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $args - * @return unknown - */ -function get_filesystem_method($args = array()) { - $method = false; - if( function_exists('getmyuid') && function_exists('fileowner') ){ - $temp_file = wp_tempnam(); - if ( getmyuid() == fileowner($temp_file) ) - $method = 'direct'; - unlink($temp_file); - } - - if ( ! $method && isset($args['connection_type']) && 'ssh' == $args['connection_type'] && extension_loaded('ssh2') ) $method = 'ssh2'; - if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext'; - if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread - return apply_filters('filesystem_method', $method); -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $form_post - * @param unknown_type $type - * @param unknown_type $error - * @return unknown - */ -function request_filesystem_credentials($form_post, $type = '', $error = false) { - $req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error); - if ( '' !== $req_cred ) - return $req_cred; - - if ( empty($type) ) - $type = get_filesystem_method(); - - if ( 'direct' == $type ) - return true; - - $credentials = get_option('ftp_credentials', array()); - // If defined, set it to that, Else, If POST'd, set it to that, If not, Set it to whatever it previously was(saved details in option) - $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? $_POST['hostname'] : $credentials['hostname']); - $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username'] : $credentials['username']); - $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password'] : $credentials['password']); - - // Check to see if we are setting the public/private keys for ssh - $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? $_POST['public_key'] : $credentials['public_key']); - $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? $_POST['private_key'] : $credentials['private_key']); - - if ( strpos($credentials['hostname'], ':') ) - list( $credentials['hostname'], $credentials['port'] ) = explode(':', $credentials['hostname'], 2); - - if ( defined('FTP_SSH') || (isset($_POST['connection_type']) && 'ssh' == $_POST['connection_type']) ) - $credentials['connection_type'] = 'ssh'; - else if ( defined('FTP_SSL') || (isset($_POST['connection_type']) && 'ftps' == $_POST['connection_type']) ) - $credentials['connection_type'] = 'ftps'; - else if ( !isset($credentials['connection_type']) || (isset($_POST['connection_type']) && 'ftp' == $_POST['connection_type']) ) - $credentials['connection_type'] = 'ftp'; - - if ( ! $error && !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) { - $stored_credentials = $credentials; - unset($stored_credentials['password'], $stored_credentials['private_key'], $stored_credentials['public_key']); - update_option('ftp_credentials', $stored_credentials); - return $credentials; - } - $hostname = ''; - $username = ''; - $password = ''; - $connection_type = ''; - if ( !empty($credentials) ) - extract($credentials, EXTR_OVERWRITE); - if ( $error ) { - $error_string = __('Error: 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 '

    ' . $error_string . '

    '; - } -?> - - -
    -

    -

    - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    " size="40" />
    size="40" />
    size="40" />'.__('(Password not shown)').''; ?>
    -
    -
    - -

    size="40" />
    size="40" /> -
    -
    -
    -
    - -
    -
    - - - - - - - -

    - -

    -
    - - diff -uNr a/mp-wp/wp-admin/includes/media.php b/mp-wp/wp-admin/includes/media.php --- a/mp-wp/wp-admin/includes/media.php aa48e94b3b4b8efc548628161409c2bb1abde5025797ad4645f5b43cbfe9f979be3879427302f2f2593b050264413363af383826b5d1cfe40d287205766fce57 +++ b/mp-wp/wp-admin/includes/media.php 424aa85cb23d44ece062add5c6f19aeb86fb59aa27b042db49fdbbdeddc366673b57eb3cf22800873b587d719bcadeca19634ed65bff1d58b2809cf6f0f10fae @@ -9,169 +9,6 @@ /** * {@internal Missing Short Description}} * - * @since unknown - * - * @return unknown - */ -function media_upload_tabs() { - $_default_tabs = array( - 'type' => __('From Computer'), // handler action suffix => tab text - 'type_url' => __('From URL'), - 'gallery' => __('Gallery'), - 'library' => __('Media Library') - ); - - return apply_filters('media_upload_tabs', $_default_tabs); -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $tabs - * @return unknown - */ -function update_gallery_tab($tabs) { - global $wpdb; - - if ( !isset($_REQUEST['post_id']) ) { - unset($tabs['gallery']); - return $tabs; - } - - if ( intval($_REQUEST['post_id']) ) - $attachments = intval($wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = %d", $_REQUEST['post_id']))); - - if ( empty($attachments) ) { - unset($tabs['gallery']); - return $tabs; - } - - $tabs['gallery'] = sprintf(__('Gallery (%s)'), "$attachments"); - - return $tabs; -} -add_filter('media_upload_tabs', 'update_gallery_tab'); - -/** - * {@internal Missing Short Description}} - * - * @since unknown - */ -function the_media_upload_tabs() { - global $redir_tab; - $tabs = media_upload_tabs(); - - if ( !empty($tabs) ) { - echo "
      \n"; - if ( isset($redir_tab) && array_key_exists($redir_tab, $tabs) ) - $current = $redir_tab; - elseif ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) ) - $current = $_GET['tab']; - else { - $keys = array_keys($tabs); - $current = array_shift($keys); - } - foreach ( $tabs as $callback => $text ) { - $class = ''; - if ( $current == $callback ) - $class = " class='current'"; - $href = add_query_arg(array('tab'=>$callback, 's'=>false, 'paged'=>false, 'post_mime_type'=>false, 'm'=>false)); - $link = "$text"; - echo "\t
    • $link
    • \n"; - } - echo "
    \n"; - } -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $id - * @param unknown_type $alt - * @param unknown_type $title - * @param unknown_type $align - * @param unknown_type $url - * @param unknown_type $rel - * @param unknown_type $size - * @return unknown - */ -function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = false, $size='medium') { - - $htmlalt = ( empty($alt) ) ? $title : $alt; - - $html = get_image_tag($id, $htmlalt, $title, $align, $size); - - $rel = $rel ? ' rel="attachment wp-att-'.attribute_escape($id).'"' : ''; - - if ( $url ) - $html = '$html"; - - $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size ); - - return $html; -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $html - * @param unknown_type $id - * @param unknown_type $alt - * @param unknown_type $title - * @param unknown_type $align - * @param unknown_type $url - * @param unknown_type $size - * @return unknown - */ -function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { - - if ( empty($alt) || apply_filters( 'disable_captions', '' ) ) return $html; - $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; - - preg_match( '/width="([0-9]+)/', $html, $matches ); - if ( ! isset($matches[1]) ) return $html; - $width = $matches[1]; - - $html = preg_replace( '/align[^\s\'"]+\s?/', '', $html ); - if ( empty($align) ) $align = 'none'; - - $alt = ! empty($alt) ? addslashes($alt) : ''; - - $shcode = '[caption id="' . $id . '" align="align' . $align - . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/caption]'; - - return apply_filters( 'image_add_caption_shortcode', $shcode, $html ); -} -add_filter( 'image_send_to_editor', 'image_add_caption', 20, 7 ); - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $html - */ -function media_send_to_editor($html) { -?> - - false); - $file = wp_handle_sideload($file_array, $overrides); - - if ( isset($file['error']) ) - return new WP_Error( 'upload_error', $file['error'] ); - - $url = $file['url']; - $type = $file['type']; - $file = $file['file']; - $title = preg_replace('/\.[^.]+$/', '', basename($file)); - $content = ''; - - // use image exif/iptc data for title and caption defaults if possible - if ( $image_meta = @wp_read_image_metadata($file) ) { - if ( trim($image_meta['title']) ) - $title = $image_meta['title']; - if ( trim($image_meta['caption']) ) - $content = $image_meta['caption']; - } - - $title = @$desc; - - // Construct the attachment array - $attachment = array_merge( array( - 'post_mime_type' => $type, - 'guid' => $url, - 'post_parent' => $post_id, - 'post_title' => $title, - 'post_content' => $content, - ), $post_data ); - - // Save the data - $id = wp_insert_attachment($attachment, $file, $post_id); - if ( !is_wp_error($id) ) { - wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); - return $url; - } - return $id; -} - -/** - * {@internal Missing Short Description}} - * - * 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 - * - * @param unknown_type $content_func - */ -function wp_iframe($content_func /* ... */) { -?> - - > - - -<?php bloginfo('name') ?> › <?php _e('Uploads'); ?> — <?php _e('WordPress'); ?> - - - - -> - - - -$image_title - $video_title - $audio_title - $media_title - -EOF; - printf($context, $out); -} -add_action( 'media_buttons', 'media_buttons' ); -add_action('media_upload_media', 'media_upload_handler'); - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * * @return unknown */ function media_upload_form_handler() { @@ -397,31 +103,6 @@ wp_set_object_terms($attachment_id, array_map('trim', preg_split('/,+/', $attachment[$t])), $t, false); } - if ( isset($_POST['insert-gallery']) || isset($_POST['update-gallery']) ) { ?> - - $html"; - } - $html = apply_filters('media_send_to_editor', $html, $send_id, $attachment); - return media_send_to_editor($html); - } - return $errors; } @@ -430,431 +111,6 @@ * * @since unknown * - * @return unknown - */ -function media_upload_image() { - $errors = array(); - $id = 0; - - if ( isset($_POST['html-upload']) && !empty($_FILES) ) { - // Upload File button was clicked - $id = media_handle_upload('async-upload', $_REQUEST['post_id']); - unset($_FILES); - if ( is_wp_error($id) ) { - $errors['upload_error'] = $id; - $id = false; - } - } - - if ( !empty($_POST['insertonlybutton']) ) { - $src = $_POST['insertonly']['src']; - if ( !empty($src) && !strpos($src, '://') ) - $src = "http://$src"; - $alt = attribute_escape($_POST['insertonly']['alt']); - if ( isset($_POST['insertonly']['align']) ) { - $align = attribute_escape($_POST['insertonly']['align']); - $class = " class='align$align'"; - } - if ( !empty($src) ) - $html = "$alt"; - return media_send_to_editor($html); - } - - if ( !empty($_POST) ) { - $return = media_upload_form_handler(); - - if ( is_string($return) ) - return $return; - if ( is_array($return) ) - $errors = $return; - } - - if ( isset($_POST['save']) ) { - $errors['upload_notice'] = __('Saved.'); - return media_upload_gallery(); - } - - if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' ) - return wp_iframe( 'media_upload_type_url_form', 'image', $errors, $id ); - - return wp_iframe( 'media_upload_type_form', 'image', $errors, $id ); -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $file - * @param unknown_type $post_id - * @param unknown_type $desc - * @return unknown - */ -function media_sideload_image($file, $post_id, $desc = null) { - if (!empty($file) ) { - $file_array['name'] = basename($file); - $tmp = download_url($file); - $file_array['tmp_name'] = $tmp; - $desc = @$desc; - - if ( is_wp_error($tmp) ) { - @unlink($file_array['tmp_name']); - $file_array['tmp_name'] = ''; - } - - $id = media_handle_sideload($file_array, $post_id, $desc); - $src = $id; - - if ( is_wp_error($id) ) { - @unlink($file_array['tmp_name']); - return $id; - } - } - - if ( !empty($src) ) { - $alt = @$desc; - $html = "$alt"; - return $html; - } -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @return unknown - */ -function media_upload_audio() { - $errors = array(); - $id = 0; - - if ( isset($_POST['html-upload']) && !empty($_FILES) ) { - // Upload File button was clicked - $id = media_handle_upload('async-upload', $_REQUEST['post_id']); - unset($_FILES); - if ( is_wp_error($id) ) { - $errors['upload_error'] = $id; - $id = false; - } - } - - if ( !empty($_POST['insertonlybutton']) ) { - $href = $_POST['insertonly']['href']; - if ( !empty($href) && !strpos($href, '://') ) - $href = "http://$href"; - $title = attribute_escape($_POST['insertonly']['title']); - if ( empty($title) ) - $title = basename($href); - if ( !empty($title) && !empty($href) ) - $html = "$title"; - return media_send_to_editor($html); - } - - if ( !empty($_POST) ) { - $return = media_upload_form_handler(); - - if ( is_string($return) ) - return $return; - if ( is_array($return) ) - $errors = $return; - } - - if ( isset($_POST['save']) ) { - $errors['upload_notice'] = __('Saved.'); - return media_upload_gallery(); - } - - if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' ) - return wp_iframe( 'media_upload_type_url_form', 'audio', $errors, $id ); - - return wp_iframe( 'media_upload_type_form', 'audio', $errors, $id ); -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @return unknown - */ -function media_upload_video() { - $errors = array(); - $id = 0; - - if ( isset($_POST['html-upload']) && !empty($_FILES) ) { - // Upload File button was clicked - $id = media_handle_upload('async-upload', $_REQUEST['post_id']); - unset($_FILES); - if ( is_wp_error($id) ) { - $errors['upload_error'] = $id; - $id = false; - } - } - - if ( !empty($_POST['insertonlybutton']) ) { - $href = $_POST['insertonly']['href']; - if ( !empty($href) && !strpos($href, '://') ) - $href = "http://$href"; - $title = attribute_escape($_POST['insertonly']['title']); - if ( empty($title) ) - $title = basename($href); - if ( !empty($title) && !empty($href) ) - $html = "$title"; - return media_send_to_editor($html); - } - - if ( !empty($_POST) ) { - $return = media_upload_form_handler(); - - if ( is_string($return) ) - return $return; - if ( is_array($return) ) - $errors = $return; - } - - if ( isset($_POST['save']) ) { - $errors['upload_notice'] = __('Saved.'); - return media_upload_gallery(); - } - - if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' ) - return wp_iframe( 'media_upload_type_url_form', 'video', $errors, $id ); - - return wp_iframe( 'media_upload_type_form', 'video', $errors, $id ); -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @return unknown - */ -function media_upload_file() { - $errors = array(); - $id = 0; - - if ( isset($_POST['html-upload']) && !empty($_FILES) ) { - // Upload File button was clicked - $id = media_handle_upload('async-upload', $_REQUEST['post_id']); - unset($_FILES); - if ( is_wp_error($id) ) { - $errors['upload_error'] = $id; - $id = false; - } - } - - if ( !empty($_POST['insertonlybutton']) ) { - $href = $_POST['insertonly']['href']; - if ( !empty($href) && !strpos($href, '://') ) - $href = "http://$href"; - $title = attribute_escape($_POST['insertonly']['title']); - if ( empty($title) ) - $title = basename($href); - if ( !empty($title) && !empty($href) ) - $html = "$title"; - return media_send_to_editor($html); - } - - if ( !empty($_POST) ) { - $return = media_upload_form_handler(); - - if ( is_string($return) ) - return $return; - if ( is_array($return) ) - $errors = $return; - } - - if ( isset($_POST['save']) ) { - $errors['upload_notice'] = __('Saved.'); - return media_upload_gallery(); - } - - if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' ) - return wp_iframe( 'media_upload_type_url_form', 'file', $errors, $id ); - - return wp_iframe( 'media_upload_type_form', 'file', $errors, $id ); -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @return unknown - */ -function media_upload_gallery() { - $errors = array(); - - if ( !empty($_POST) ) { - $return = media_upload_form_handler(); - - if ( is_string($return) ) - return $return; - if ( is_array($return) ) - $errors = $return; - } - - wp_enqueue_script('admin-gallery'); - return wp_iframe( 'media_upload_gallery_form', $errors ); -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @return unknown - */ -function media_upload_library() { - $errors = array(); - if ( !empty($_POST) ) { - $return = media_upload_form_handler(); - - if ( is_string($return) ) - return $return; - if ( is_array($return) ) - $errors = $return; - } - - return wp_iframe( 'media_upload_library_form', $errors ); -} - -/** - * Retrieve HTML for the image alignment radio buttons with the specified one checked. - * - * @since unknown - * - * @param unknown_type $post - * @param unknown_type $checked - * @return unknown - */ -function image_align_input_fields($post, $checked='') { - - $alignments = array('none' => 'None', 'left' => 'Left', 'center' => 'Center', 'right' => 'Right'); - if ( !array_key_exists($checked, $alignments) ) - $checked = 'none'; - - $out = array(); - foreach ($alignments as $name => $label) { - - $out[] = ""; - } - return join("\n", $out); -} - -/** - * Retrieve HTML for the size radio buttons with the specified one checked. - * - * @since unknown - * - * @param unknown_type $post - * @param unknown_type $checked - * @return unknown - */ -function image_size_input_fields($post, $checked='') { - - // get a list of the actual pixel dimensions of each possible intermediate version of this image - $size_names = array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full size')); - - foreach ( $size_names as $size => $name) { - $downsize = image_downsize($post->ID, $size); - - // is this size selectable? - $enabled = ( $downsize[3] || 'full' == $size ); - $css_id = "image-size-{$size}-{$post->ID}"; - // if this size is the default but that's not available, don't select it - if ( $checked && !$enabled ) - $checked = ''; - // if $checked was not specified, default to the first available size that's bigger than a thumbnail - if ( !$checked && $enabled && 'thumbnail' != $size ) - $checked = $size; - - $html = "
    "; - - $html .= ""; - // only show the dimensions if that choice is available - if ( $enabled ) - $html .= " "; - - $html .= '
    '; - - $out[] = $html; - } - - return array( - 'label' => __('Size'), - 'input' => 'html', - 'html' => join("\n", $out), - ); -} - -/** - * Retrieve HTML for the Link URL buttons with the default link type as specified. - * - * @since unknown - * - * @param unknown_type $post - * @param unknown_type $url_type - * @return unknown - */ -function image_link_input_fields($post, $url_type='') { - - $file = wp_get_attachment_url($post->ID); - $link = get_attachment_link($post->ID); - - $url = ''; - if ( $url_type == 'file' ) - $url = $file; - elseif ( $url_type == 'post' ) - $url = $link; - - return "
    - - - -"; -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $form_fields - * @param unknown_type $post - * @return unknown - */ -function image_attachment_fields_to_edit($form_fields, $post) { - if ( substr($post->post_mime_type, 0, 5) == 'image' ) { - $form_fields['post_title']['required'] = true; - - $form_fields['post_excerpt']['label'] = __('Caption'); - $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); - - $form_fields['post_content']['label'] = __('Description'); - - $form_fields['align'] = array( - 'label' => __('Alignment'), - 'input' => 'html', - 'html' => image_align_input_fields($post, get_option('image_default_align')), - ); - - $form_fields['image-size'] = image_size_input_fields($post, get_option('image_default_size')); - } - return $form_fields; -} - -add_filter('attachment_fields_to_edit', 'image_attachment_fields_to_edit', 10, 2); - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * * @param unknown_type $form_fields * @param unknown_type $post * @return unknown @@ -891,41 +147,6 @@ * * @since unknown * - * @param unknown_type $html - * @param unknown_type $attachment_id - * @param unknown_type $attachment - * @return unknown - */ -function image_media_send_to_editor($html, $attachment_id, $attachment) { - $post =& get_post($attachment_id); - if ( substr($post->post_mime_type, 0, 5) == 'image' ) { - $url = $attachment['url']; - - if ( isset($attachment['align']) ) - $align = $attachment['align']; - else - $align = 'none'; - - if ( !empty($attachment['image-size']) ) - $size = $attachment['image-size']; - else - $size = 'medium'; - - $rel = ( $url == get_attachment_link($attachment_id) ); - - return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size); - } - - return $html; -} - -add_filter('media_send_to_editor', 'image_media_send_to_editor', 10, 3); - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * * @param unknown_type $post * @param unknown_type $errors * @return unknown @@ -952,12 +173,6 @@ 'value' => $edit_post->post_content, 'input' => 'textarea', ), - 'url' => array( - 'label' => __('Link URL'), - 'input' => 'html', - 'html' => image_link_input_fields($post, get_option('image_default_link_type')), - 'helps' => __('Enter a link URL or click above for presets.'), - ), 'menu_order' => array( 'label' => __('Order'), 'value' => $edit_post->menu_order @@ -993,39 +208,6 @@ return $form_fields; } -/** - * Retrieve HTML for media items of post gallery. - * - * The HTML markup retrieved will be created for the progress of SWF Upload - * component. Will also create link for showing and hiding the form to modify - * the image attachment. - * - * @since unknown - * - * @param int $post_id Optional. Post ID. - * @param array $errors Errors for attachment, if any. - * @return string - */ -function get_media_items( $post_id, $errors ) { - if ( $post_id ) { - $post = get_post($post_id); - if ( $post && $post->post_type == 'attachment' ) - $attachments = array($post->ID => $post); - else - $attachments = get_children( array( 'post_parent' => $post_id, 'post_type' => 'attachment', 'orderby' => 'menu_order ASC, ID', 'order' => 'DESC') ); - } else { - if ( is_array($GLOBALS['wp_the_query']->posts) ) - foreach ( $GLOBALS['wp_the_query']->posts as $attachment ) - $attachments[$attachment->ID] = $attachment; - } - - $output = ''; - foreach ( (array) $attachments as $id => $attachment ) - if ( $item = get_media_item( $id, array( 'errors' => isset($errors[$id]) ? $errors[$id] : null) ) ) - $output .= "\n
    $item\n
    "; - - return $output; -} /** * Retrieve HTML form for modifying the image attachment. @@ -1039,7 +221,7 @@ function get_media_item( $attachment_id, $args = null ) { global $redir_tab; - $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true ); + $default_args = array( 'errors' => null, 'delete' => true, 'toggle' => true, 'show_title' => true ); $args = wp_parse_args( $args, $default_args ); extract( $args, EXTR_SKIP ); @@ -1124,16 +306,6 @@ 'extra_rows' => array(), ); - $delete_href = wp_nonce_url("post.php?action=delete-post&post=$attachment_id", 'delete-post_' . $attachment_id); - if ( $send ) - $send = ""; - if ( $delete ) - $delete = "" . __('Delete') . ""; - if ( ( $send || $delete ) && !isset($form_fields['buttons']) ) - $form_fields['buttons'] = array('tr' => "\t\t$send $delete -
    " . sprintf(__("You are about to delete %s."), $filename) . " " . __('Continue') . " - " . __('Cancel') . "
    \n"); - $hidden_fields = array(); foreach ( $form_fields as $id => $field ) { @@ -1211,7 +383,6 @@ */ function media_upload_header() { ?> -
    @@ -1252,65 +423,10 @@ - - - -
    - - -
    - -

    -
    - - -

    - +


    @@ -1323,725 +439,4 @@ - -
    - - - -

    - - - - -
    -'.wp_specialchars($id->get_error_message()).'
    '; - exit; - } -} -?> -
    - - - - - - - - - -

    - - - -
    -
    - -
    -
    - - - - - - - - -
    - - - - - - - - - -
    - - add_query_arg( 'paged', '%#%' ), - 'format' => '', - 'prev_text' => __('«'), - 'next_text' => __('»'), - 'total' => ceil($wp_query->found_posts / 10), - 'current' => $_GET['paged'] -)); - -if ( $page_links ) - echo "
    $page_links
    "; -?> - -
    -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 ) ) { ?> - - - - - -
    - -
    -
    -
    - -
    - - - - - - -
    - -
    -

    - - -

    -
    - - - - - required - - - - - - - - * - -

    - - - - - - - -

    ' . $alt_help . '

    - - - -

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

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

    - - - - - - - - - -'; - -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @return unknown - */ -function type_url_form_audio() { - return ' - - - - - - - - - - - - - - -
    - - * -
    - - * -
    ' . __('Link text, e.g. "Still Alive by Jonathan Coulton"') . '
    - -
    -'; -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @return unknown - */ -function type_url_form_video() { - return ' - - - - - - - - - - - - - - -
    - - * -
    - - * -
    ' . __('Link text, e.g. "Lucy on YouTube"') . '
    - -
    -'; -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @return unknown - */ -function type_url_form_file() { - return ' - - - - - - - - - - - - - - -
    - - * -
    - - * -
    ' . __('Link text, e.g. "Ransom Demands (PDF)"') . '
    - -
    -'; -} - -/** - * {@internal Missing Short Description}} - * - * Support a GET parameter for disabling the flash uploader. - * - * @since unknown - * - * @param unknown_type $flash - * @return unknown - */ -function media_upload_use_flash($flash) { - if ( array_key_exists('flash', $_REQUEST) ) - $flash = !empty($_REQUEST['flash']); - return $flash; -} - -add_filter('flash_uploader', 'media_upload_use_flash'); - -/** - * {@internal Missing Short Description}} - * - * @since unknown - */ -function media_upload_flash_bypass() { - echo '

    '; - printf( __('You are using the Flash uploader. Problems? Try the Browser uploader instead.'), clean_url(add_query_arg('flash', 0)) ); - echo '

    '; -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown - */ -function media_upload_html_bypass() { - echo '

    '; - if ( array_key_exists('flash', $_REQUEST) ) - // the user manually selected the browser uploader, so let them switch back to Flash - printf( __('You are using the Browser uploader. Try the Flash uploader instead.'), clean_url(add_query_arg('flash', 1)) ); - else - // the user probably doesn't have Flash - printf( __('You are using the Browser uploader.') ); - - echo '

    '; -} - -add_action('post-flash-upload-ui', 'media_upload_flash_bypass'); -add_action('post-html-upload-ui', 'media_upload_html_bypass'); - -/** - * {@internal Missing Short Description}} - * - * Make sure the GET parameter sticks when we submit a form. - * - * @since unknown - * - * @param unknown_type $url - * @return unknown - */ -function media_upload_bypass_url($url) { - if ( array_key_exists('flash', $_REQUEST) ) - $url = add_query_arg('flash', intval($_REQUEST['flash'])); - return $url; -} - -add_filter('media_upload_form_url', 'media_upload_bypass_url'); - - - -add_filter('async_upload_image', 'get_media_item', 10, 2); -add_filter('async_upload_audio', 'get_media_item', 10, 2); -add_filter('async_upload_video', 'get_media_item', 10, 2); -add_filter('async_upload_file', 'get_media_item', 10, 2); - -add_action('media_upload_image', 'media_upload_image'); -add_action('media_upload_audio', 'media_upload_audio'); -add_action('media_upload_video', 'media_upload_video'); -add_action('media_upload_file', 'media_upload_file'); - -add_filter('media_upload_gallery', 'media_upload_gallery'); - -add_filter('media_upload_library', 'media_upload_library'); - ?> diff -uNr a/mp-wp/wp-admin/includes/plugin-install.php b/mp-wp/wp-admin/includes/plugin-install.php --- a/mp-wp/wp-admin/includes/plugin-install.php b7bb881a25fd047b984ebf4df073b5b1662f8287f33a756484f0afae46bbd3f03008996c7ec4c93a4ce90f5db2e79d9a6d3d9b7dc955c6927df9951043e05b57 +++ b/mp-wp/wp-admin/includes/plugin-install.php false @@ -1,889 +0,0 @@ -per_page) ) - $args->per_page = 24; - - $args = apply_filters('plugins_api_args', $args, $action); //NOTE: Ensure that an object is returned via this filter. - $res = apply_filters('plugins_api', false, $action, $args); //NOTE: Allows a plugin to completely override the builtin WordPress.org API. - - if ( ! $res ) { - $request = wp_remote_post('http://api.wordpress.org/plugins/info/1.0/', array( 'body' => array('action' => $action, 'request' => serialize($args))) ); - if ( is_wp_error($request) ) { - $res = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occured during the API request.

    Try again'), $request->get_error_message() ); - } else { - $res = unserialize($request['body']); - if ( ! $res ) - $res = new WP_Error('plugins_api_failed', __('An unknown error occured'), $request['body']); - } - } - - return apply_filters('plugins_api_result', $res, $action, $args); -} - -/** - * Retrieve popular WordPress plugin tags. - * - * @since 2.7.0 - * - * @param array $args - * @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; - - $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'); - - 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() { - ?> -

    WordPress Plugin Directory or upload a plugin in .zip format via this page.') ?>

    - -

    - ' . __('[need help?]') . '') ?> -
    -


    - Term: Searches plugins names and descriptions for the specified term') ?>
    - Tag: Searches for plugins tagged as such') ?>
    - Author: Searches for plugins created by the Author, or which the Author contributed to.') ?>

    -
    - -

    -

    -
    - - - -
    - -

    -

    - clean_url( admin_url('plugin-install.php?tab=search&type=tag&s=' . urlencode($tag['name'])) ), - 'name' => $tag['name'], - 'id' => sanitize_title_with_dashes($tag['name']), - 'count' => $tag['count'] ); - echo wp_generate_tag_cloud($tags, array( 'single_text' => __('%d plugin'), 'multiple_text' => __('%d plugins') ) ); -} - -/** - * Display search form for searching plugins. - * - * @since 2.7.0 - */ -function install_search_form(){ - $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : ''; - $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : ''; - - ?>
    - - - -
    'featured', 'page' => $page); - $api = plugins_api('query_plugins', $args); - if ( is_wp_error($api) ) - wp_die($api); - 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); - display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']); -} - -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); - 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); - display_plugins_table($api->plugins, $api->info['page'], $api->info['pages']); -} - -/** - * 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'] ) : ''; - - $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()); - -?> -
    -
    - -
    - add_query_arg('paged', '%#%', $url), - 'format' => '', - 'prev_text' => __('«'), - 'next_text' => __('»'), - 'total' => $totalpages, - 'current' => $page - )); - - if ( $page_links ) - echo "\t\t
    $page_links
    "; -?> -
    -
    - - - - - - - - - - - - - - - - - - - - - - - '; - - foreach( (array) $plugins as $plugin ){ - if ( is_object($plugin) ) - $plugin = (array) $plugin; - - $title = wp_kses($plugin['name'], $plugins_allowedtags); - $description = wp_kses($plugin['description'], $plugins_allowedtags); - $version = wp_kses($plugin['version'], $plugins_allowedtags); - - $name = strip_tags($title . ' ' . $version); - - $author = $plugin['author']; - if( ! empty($plugin['author']) ) - $author = ' ' . sprintf( __('By %s'), $author ) . '.'; - - $author = wp_kses($author, $plugins_allowedtags); - - if( isset($plugin['homepage']) ) - $title = '' . $title . ''; - - $action_links = array(); - $action_links[] = '' . __('Install') . ''; - - $action_links = apply_filters('plugin_install_action_links', $action_links, $plugin); - ?> - - - - - - - - - -
    ', __('No plugins match your request.'), '
    -
    -
    -
    <?php _e('5 stars') ?>
    -
    <?php _e('4 stars') ?>
    -
    <?php _e('3 stars') ?>
    -
    <?php _e('2 stars') ?>
    -
    <?php _e('1 star') ?>
    -
    -

    - -
    - $page_links
    "; ?> -
    - - - stripslashes( $_REQUEST['plugin'] ) )); - - if ( is_wp_error($api) ) - wp_die($api); - - $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(), - 'div' => array(), 'p' => array(), 'ul' => array(), 'ol' => array(), 'li' => array(), - 'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(), - 'img' => array('src' => array(), 'class' => array(), 'alt' => array())); - //Sanitize HTML - foreach ( (array)$api->sections as $section_name => $content ) - $api->sections[$section_name] = wp_kses($content, $plugins_allowedtags); - foreach ( array('version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug') as $key ) - $api->$key = wp_kses($api->$key, $plugins_allowedtags); - - $section = isset($_REQUEST['section']) ? stripslashes( $_REQUEST['section'] ) : 'description'; //Default to the Description tab, Do not translate, API returns English. - if( empty($section) || ! isset($api->sections[ $section ]) ) - $section = array_shift( $section_titles = array_keys((array)$api->sections) ); - - iframe_header( __('Plugin Install') ); - echo "
    \n"; - echo "
      \n"; - foreach ( (array)$api->sections as $section_name => $content ) { - - $title = $section_name; - $title = ucwords(str_replace('_', ' ', $title)); - - $class = ( $section_name == $section ) ? ' class="current"' : ''; - $href = add_query_arg( array('tab' => $tab, 'section' => $section_name) ); - $href = clean_url($href); - $san_title = attribute_escape(sanitize_title_with_dashes($title)); - echo "\t
    • $title
    • \n"; - } - echo "
    \n"; - echo "
    \n"; - ?> -
    - download_link) ) : ?> -

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

    - -

    -
      -version) ) : ?> -
    • version ?>
    • -author) ) : ?> -
    • author, '_blank') ?>
    • -last_updated) ) : ?> -
    • last_updated)) ) ?>
    • -requires) ) : ?> -
    • requires) ?>
    • -tested) ) : ?> -
    • tested ?>
    • -downloaded) ) : ?> -
    • downloaded), number_format_i18n($api->downloaded)) ?>
    • -slug) ) : ?> -
    • -homepage) ) : ?> -
    • - -
    -

    -
    -
    -
    <?php _e('5 stars') ?>
    -
    <?php _e('4 stars') ?>
    -
    <?php _e('3 stars') ?>
    -
    <?php _e('2 stars') ?>
    -
    <?php _e('1 star') ?>
    -
    - num_ratings), number_format_i18n($api->num_ratings)); ?> -
    -
    - tested, '>') ) - echo '

    ' . __('Warning: This plugin has not been tested with your current version of WordPress.') . '

    '; - else if ( version_compare($GLOBALS['wp_version'], $api->requires, '<') ) - echo '

    ' . __('Warning: This plugin has not been marked as compatible with your version of WordPress.') . '

    '; - foreach ( (array)$api->sections as $section_name => $content ) { - $title = $section_name; - $title[0] = strtoupper($title[0]); - $title = str_replace('_', ' ', $title); - - $content = links_add_base_url($content, 'http://wordpress.org/extend/plugins/' . $api->slug . '/'); - $content = links_add_target($content, '_blank'); - - $san_title = attribute_escape(sanitize_title_with_dashes($title)); - - $display = ( $section_name == $section ) ? 'block' : 'none'; - - echo "\t
    \n"; - echo "\t\t

    $title

    "; - echo $content; - echo "\t
    \n"; - } - echo "
    \n"; - - iframe_footer(); - exit; -} - - -add_action('install_plugins_upload', 'upload_plugin'); -function upload_plugin() { - - if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) ) - wp_die($uploads['error']); - - if ( !empty($_FILES) ) - $filename = $_FILES['pluginzip']['name']; - else if ( isset($_GET['package']) ) - $filename = $_GET['package']; - - check_admin_referer('plugin-upload'); - - echo '
    '; - echo '

    ', sprintf( __('Installing Plugin from file: %s'), basename($filename) ), '

    '; - - //Handle a newly uploaded file, Else assume it was - if ( !empty($_FILES) ) { - $filename = wp_unique_filename( $uploads['basedir'], $filename ); - $local_file = $uploads['basedir'] . '/' . $filename; - - // Move the file to the uploads dir - if ( false === @ move_uploaded_file( $_FILES['pluginzip']['tmp_name'], $local_file) ) - wp_die( sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'])); - } else { - $local_file = $uploads['basedir'] . '/' . $filename; - } - - do_plugin_install_local_package($local_file, $filename); - echo '
    '; -} - -add_action('install_plugins_install', 'install_plugin'); - -/** - * Display plugin link and execute install. - * - * @since 2.7.0 - */ -function install_plugin() { - - $plugin = isset($_REQUEST['plugin']) ? stripslashes( $_REQUEST['plugin'] ) : ''; - - check_admin_referer('install-plugin_' . $plugin); - $api = plugins_api('plugin_information', array('slug' => $plugin, 'fields' => array('sections' => false) ) ); //Save on a bit of bandwidth. - - if ( is_wp_error($api) ) - wp_die($api); - - echo '
    '; - echo '

    ', sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version ), '

    '; - - do_plugin_install($api->download_link, $api); - echo '
    '; - -} - -/** - * Retrieve plugin and install. - * - * @since 2.7.0 - * - * @param string $download_url Download URL. - * @param object $plugin_information Optional. Plugin information - */ -function do_plugin_install($download_url, $plugin_information = null) { - global $wp_filesystem; - - if ( empty($download_url) ) { - show_message( __('No plugin Specified') ); - return; - } - - $plugin = isset($_REQUEST['plugin']) ? stripslashes( $_REQUEST['plugin'] ) : ''; - - $url = 'plugin-install.php?tab=install'; - $url = add_query_arg(array('plugin' => $plugin, 'plugin_name' => stripslashes( $_REQUEST['plugin_name'] ), 'download_url' => stripslashes( $_REQUEST['download_url'] ) ), $url); - - $url = wp_nonce_url($url, 'install-plugin_' . $plugin); - if ( false === ($credentials = request_filesystem_credentials($url)) ) - return; - - if ( ! WP_Filesystem($credentials) ) { - request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again - return; - } - - if ( $wp_filesystem->errors->get_error_code() ) { - foreach ( $wp_filesystem->errors->get_error_messages() as $message ) - show_message($message); - return; - } - - $result = wp_install_plugin( $download_url, 'show_message' ); - - if ( is_wp_error($result) ) { - show_message($result); - show_message( __('Installation Failed') ); - } else { - show_message( sprintf(__('Successfully installed the plugin %s %s.'), $plugin_information->name, $plugin_information->version) ); - $plugin_file = $result; - - $install_actions = apply_filters('install_plugin_complete_actions', array( - 'activate_plugin' => '' . __('Activate Plugin') . '', - 'plugins_page' => '' . __('Return to Plugins page') . '' - ), $plugin_information, $plugin_file); - if ( ! empty($install_actions) ) - show_message('' . __('Actions:') . ' ' . implode(' | ', (array)$install_actions)); - } -} - -/** - * Install a plugin from a local file. - * - * @since 2.7.0 - * - * @param string $package Local Plugin zip - * @param string $filename Optional. Original filename - * @param object $plugin_information Optional. Plugin information - */ -function do_plugin_install_local_package($package, $filename = '') { - global $wp_filesystem; - - if ( empty($package) ) { - show_message( __('No plugin Specified') ); - return; - } - - if ( empty($filename) ) - $filename = basename($package); - - $url = 'plugin-install.php?tab=upload'; - $url = add_query_arg(array('package' => $filename), $url); - - $url = wp_nonce_url($url, 'plugin-upload'); - if ( false === ($credentials = request_filesystem_credentials($url)) ) - return; - - if ( ! WP_Filesystem($credentials) ) { - request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again - return; - } - - if ( $wp_filesystem->errors->get_error_code() ) { - foreach ( $wp_filesystem->errors->get_error_messages() as $message ) - show_message($message); - return; - } - - $result = wp_install_plugin_local_package( $package, 'show_message' ); - - if ( is_wp_error($result) ) { - show_message($result); - show_message( __('Installation Failed') ); - } else { - show_message( __('Successfully installed the plugin.') ); - $plugin_file = $result; - - $install_actions = apply_filters('install_plugin_complete_actions', array( - 'activate_plugin' => '' . __('Activate Plugin') . '', - 'plugins_page' => '' . __('Return to Plugins page') . '' - ), array(), $plugin_file); - if ( ! empty($install_actions) ) - show_message('' . __('Actions:') . ' ' . implode(' | ', (array)$install_actions)); - } -} - -/** - * Install plugin. - * - * @since 2.7.0 - * - * @param string $package - * @param string $feedback Optional. - * @return mixed. - */ -function wp_install_plugin($package, $feedback = '') { - global $wp_filesystem; - - if ( !empty($feedback) ) - add_filter('install_feedback', $feedback); - - // Is a filesystem accessor setup? - if ( ! $wp_filesystem || ! is_object($wp_filesystem) ) - WP_Filesystem(); - - if ( ! is_object($wp_filesystem) ) - return new WP_Error('fs_unavailable', __('Could not access filesystem.')); - - if ( $wp_filesystem->errors->get_error_code() ) - return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors); - - //Get the base plugin folder - $plugins_dir = $wp_filesystem->wp_plugins_dir(); - if ( empty($plugins_dir) ) - return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.')); - - //And the same for the Content directory. - $content_dir = $wp_filesystem->wp_content_dir(); - if( empty($content_dir) ) - return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).')); - - $plugins_dir = trailingslashit( $plugins_dir ); - $content_dir = trailingslashit( $content_dir ); - - if ( empty($package) ) - return new WP_Error('no_package', __('Install package not available.')); - - // Download the package - apply_filters('install_feedback', sprintf(__('Downloading plugin package from %s'), $package)); - $download_file = download_url($package); - - if ( is_wp_error($download_file) ) - return new WP_Error('download_failed', __('Download failed.'), $download_file->get_error_message()); - - $working_dir = $content_dir . 'upgrade/' . basename($package, '.zip'); - - // Clean up working directory - if ( $wp_filesystem->is_dir($working_dir) ) - $wp_filesystem->delete($working_dir, true); - - apply_filters('install_feedback', __('Unpacking the plugin package')); - // Unzip package to working directory - $result = unzip_file($download_file, $working_dir); - - // Once extracted, delete the package - @unlink($download_file); - - if ( is_wp_error($result) ) { - $wp_filesystem->delete($working_dir, true); - return $result; - } - - //Get a list of the directories in the working directory before we delete it, We need to know the new folder for the plugin - $filelist = array_keys( $wp_filesystem->dirlist($working_dir) ); - - if( $wp_filesystem->exists( $plugins_dir . $filelist[0] ) ) { - $wp_filesystem->delete($working_dir, true); - return new WP_Error('install_folder_exists', __('Folder already exists.'), $filelist[0] ); - } - - apply_filters('install_feedback', __('Installing the plugin')); - // Copy new version of plugin into place. - $result = copy_dir($working_dir, $plugins_dir); - if ( is_wp_error($result) ) { - $wp_filesystem->delete($working_dir, true); - return $result; - } - - //Get a list of the directories in the working directory before we delete it, We need to know the new folder for the plugin - $filelist = array_keys( $wp_filesystem->dirlist($working_dir) ); - - // Remove working directory - $wp_filesystem->delete($working_dir, true); - - if( empty($filelist) ) - return false; //We couldnt find any files in the working dir, therefor no plugin installed? Failsafe backup. - - $folder = $filelist[0]; - $plugin = get_plugins('/' . $folder); //Ensure to pass with leading slash - $pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list - - //Return the plugin files name. - return $folder . '/' . $pluginfiles[0]; -} - -/** - * Install plugin from local package - * - * @since 2.7.0 - * - * @param string $package - * @param string $feedback Optional. - * @return mixed. - */ -function wp_install_plugin_local_package($package, $feedback = '') { - global $wp_filesystem; - - if ( !empty($feedback) ) - add_filter('install_feedback', $feedback); - - // Is a filesystem accessor setup? - if ( ! $wp_filesystem || ! is_object($wp_filesystem) ) - WP_Filesystem(); - - if ( ! is_object($wp_filesystem) ) - return new WP_Error('fs_unavailable', __('Could not access filesystem.')); - - if ( $wp_filesystem->errors->get_error_code() ) - return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors); - - //Get the base plugin folder - $plugins_dir = $wp_filesystem->wp_plugins_dir(); - if ( empty($plugins_dir) ) - return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.')); - - //And the same for the Content directory. - $content_dir = $wp_filesystem->wp_content_dir(); - if( empty($content_dir) ) - return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).')); - - $plugins_dir = trailingslashit( $plugins_dir ); - $content_dir = trailingslashit( $content_dir ); - - if ( empty($package) ) - return new WP_Error('no_package', __('Install package not available.')); - - $working_dir = $content_dir . 'upgrade/' . basename($package, '.zip'); - - // Clean up working directory - if ( $wp_filesystem->is_dir($working_dir) ) - $wp_filesystem->delete($working_dir, true); - - apply_filters('install_feedback', __('Unpacking the plugin package')); - // Unzip package to working directory - $result = unzip_file($package, $working_dir); - - // Once extracted, delete the package - unlink($package); - - if ( is_wp_error($result) ) { - $wp_filesystem->delete($working_dir, true); - return $result; - } - - //Get a list of the directories in the working directory before we delete it, We need to know the new folder for the plugin - $filelist = array_keys( $wp_filesystem->dirlist($working_dir) ); - - if( $wp_filesystem->exists( $plugins_dir . $filelist[0] ) ) { - $wp_filesystem->delete($working_dir, true); - return new WP_Error('install_folder_exists', __('Folder already exists.'), $filelist[0] ); - } - - apply_filters('install_feedback', __('Installing the plugin')); - // Copy new version of plugin into place. - $result = copy_dir($working_dir, $plugins_dir); - if ( is_wp_error($result) ) { - $wp_filesystem->delete($working_dir, true); - return $result; - } - - //Get a list of the directories in the working directory before we delete it, We need to know the new folder for the plugin - $filelist = array_keys( $wp_filesystem->dirlist($working_dir) ); - - // Remove working directory - $wp_filesystem->delete($working_dir, true); - - if( empty($filelist) ) - return false; //We couldnt find any files in the working dir, therefor no plugin installed? Failsafe backup. - - $folder = $filelist[0]; - $plugin = get_plugins('/' . $folder); //Ensure to pass with leading slash - $pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list - - //Return the plugin files name. - return $folder . '/' . $pluginfiles[0]; -} - -?> diff -uNr a/mp-wp/wp-admin/includes/plugin.php b/mp-wp/wp-admin/includes/plugin.php --- a/mp-wp/wp-admin/includes/plugin.php f324c3e723ae8d5248a4bc68b41bf2867524cf50d19d64f09d965a7c7e7f5e521bee9570bff3ece96ad44f0e2086d69ceb97e0101bc6b1aecd2d574a540aed79 +++ b/mp-wp/wp-admin/includes/plugin.php f42c4e6e3fb6a8f32281a6a8bd0049b1bdf120fcc3a0b917f8f5bd2ad5299da654a3236d37d47f679288bfdf2cbc48968dc2b574e2c8dca54fe1e6df7c24a01c @@ -124,7 +124,7 @@ if ( ! empty($plugin_data['AuthorURI']) ) $plugin_data['Author'] = '' . $plugin_data['Author'] . ''; - $plugin_data['Description'] = wptexturize( $plugin_data['Description'] ); + $plugin_data['Description'] = $plugin_data['Description']; if( ! empty($plugin_data['Author']) ) $plugin_data['Description'] .= ' ' . sprintf( __('By %s'), $plugin_data['Author'] ) . '.'; } @@ -342,99 +342,6 @@ return true; } -/** - * Remove directory and files of a plugin for a single or list of plugin(s). - * - * If the plugins parameter list is empty, false will be returned. True when - * completed. - * - * @since unknown - * - * @param array $plugins List of plugin - * @param string $redirect Redirect to page when complete. - * @return mixed - */ -function delete_plugins($plugins, $redirect = '' ) { - global $wp_filesystem; - - if( empty($plugins) ) - return false; - - $checked = array(); - foreach( $plugins as $plugin ) - $checked[] = 'checked[]=' . $plugin; - - ob_start(); - $url = wp_nonce_url('plugins.php?action=delete-selected&verify-delete=1&' . implode('&', $checked), 'bulk-manage-plugins'); - if ( false === ($credentials = request_filesystem_credentials($url)) ) { - $data = ob_get_contents(); - ob_end_clean(); - if( ! empty($data) ){ - include_once( ABSPATH . 'wp-admin/admin-header.php'); - echo $data; - include( ABSPATH . 'wp-admin/admin-footer.php'); - exit; - } - return; - } - - if ( ! WP_Filesystem($credentials) ) { - request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again - $data = ob_get_contents(); - ob_end_clean(); - if( ! empty($data) ){ - include_once( ABSPATH . 'wp-admin/admin-header.php'); - echo $data; - include( ABSPATH . 'wp-admin/admin-footer.php'); - exit; - } - return; - } - - if ( $wp_filesystem->errors->get_error_code() ) { - return $wp_filesystem->errors; - } - - if ( ! is_object($wp_filesystem) ) - return new WP_Error('fs_unavailable', __('Could not access filesystem.')); - - if ( $wp_filesystem->errors->get_error_code() ) - return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors); - - //Get the base plugin folder - $plugins_dir = $wp_filesystem->wp_plugins_dir(); - if ( empty($plugins_dir) ) - return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.')); - - $plugins_dir = trailingslashit( $plugins_dir ); - - $errors = array(); - - foreach( $plugins as $plugin_file ) { - // Run Uninstall hook - if ( is_uninstallable_plugin( $plugin_file ) ) - uninstall_plugin($plugin_file); - - $this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin_file) ); - // If plugin is in its own directory, recursively delete the directory. - if ( strpos($plugin_file, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder - $deleted = $wp_filesystem->delete($this_plugin_dir, true); - else - $deleted = $wp_filesystem->delete($plugins_dir . $plugin_file); - - if ( ! $deleted ) - $errors[] = $plugin_file; - } - - if ( ! empty($errors) ) - return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s'), implode(', ', $errors)) ); - - // Force refresh of plugin update information - delete_option('update_plugins'); - - return true; -} - function validate_active_plugins() { $check_plugins = get_option('active_plugins'); @@ -479,63 +386,6 @@ return 0; } -/** - * Whether the plugin can be uninstalled. - * - * @since 2.7.0 - * - * @param string $plugin Plugin path to check. - * @return bool Whether plugin can be uninstalled. - */ -function is_uninstallable_plugin($plugin) { - $file = plugin_basename($plugin); - - $uninstallable_plugins = (array) get_option('uninstall_plugins'); - if ( isset( $uninstallable_plugins[$file] ) || file_exists( WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php' ) ) - return true; - - return false; -} - -/** - * Uninstall a single plugin. - * - * Calls the uninstall hook, if it is available. - * - * @since 2.7.0 - * - * @param string $plugin Relative plugin path from Plugin Directory. - */ -function uninstall_plugin($plugin) { - $file = plugin_basename($plugin); - - $uninstallable_plugins = (array) get_option('uninstall_plugins'); - if ( file_exists( WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php' ) ) { - if ( isset( $uninstallable_plugins[$file] ) ) { - unset($uninstallable_plugins[$file]); - update_option('uninstall_plugins', $uninstallable_plugins); - } - unset($uninstallable_plugins); - - define('WP_UNINSTALL_PLUGIN', $file); - include WP_PLUGIN_DIR . '/' . dirname($file) . '/uninstall.php'; - - return true; - } - - if ( isset( $uninstallable_plugins[$file] ) ) { - $callable = $uninstallable_plugins[$file]; - unset($uninstallable_plugins[$file]); - update_option('uninstall_plugins', $uninstallable_plugins); - unset($uninstallable_plugins); - - include WP_PLUGIN_DIR . '/' . $file; - - add_action( 'uninstall_' . $file, $callable ); - do_action( 'uninstall_' . $file ); - } -} - // // Menu // @@ -711,14 +561,6 @@ $parent = $_wp_real_parent_file[$parent]; return $parent; } -/* - if ( !empty ( $parent_file ) ) { - if ( isset( $_wp_real_parent_file[$parent_file] ) ) - $parent_file = $_wp_real_parent_file[$parent_file]; - - return $parent_file; - } -*/ if ( $pagenow == 'admin.php' && isset( $plugin_page ) ) { foreach ( $menu as $parent_menu ) { diff -uNr a/mp-wp/wp-admin/includes/post.php b/mp-wp/wp-admin/includes/post.php --- a/mp-wp/wp-admin/includes/post.php 0259b97c471cea621cc846a3c22ab4e8e160f88d44cfb8720a518fe7813ea79831ecfa85c08a8bcb91915ded8d462c90296940787da889d2ee8bc8d603a839d5 +++ b/mp-wp/wp-admin/includes/post.php 0f56a6d784e662b0fffce0fe0ec9277715912422e89a577d4c614c07b044c49672357ba556355d0308f7b09caf3ac7f6d62e45c4427a813221525323c8d8ea58 @@ -926,6 +926,7 @@ $post->post_status = $original_status; $post->post_date = $original_date; $post->post_name = $original_name; + return $permalink; } @@ -945,24 +946,8 @@ if (false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%')) { return ''; } - $title = __('Click to edit this part of the permalink'); - if (function_exists('mb_strlen')) { - if (mb_strlen($post_name) > 30) { - $post_name_abridged = mb_substr($post_name, 0, 14). '…' . mb_substr($post_name, -14); - } else { - $post_name_abridged = $post_name; - } - } else { - if (strlen($post_name) > 30) { - $post_name_abridged = substr($post_name, 0, 14). '…' . substr($post_name, -14); - } else { - $post_name_abridged = $post_name; - } - } - $post_name_html = ''.$post_name_abridged.''.$post_name.''; - $display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink); - $return = '' . __('Permalink:') . "\n" . '' . $display_link . "\n"; - $return .= '' . __('Edit') . "\n"; + $display_link = str_replace(array('%pagename%/','%postname%/'), '', $permalink); + $return = '' . __('Permalink:') . "\n" . '' . $display_link . "".''; return $return; } diff -uNr a/mp-wp/wp-admin/includes/schema.php b/mp-wp/wp-admin/includes/schema.php --- a/mp-wp/wp-admin/includes/schema.php c890a951b231c4c93f6b5c87cd66f0a3312c83fd26fa04718ee43a55d67b18c7e4cc2e3b44e54276e093bb952b191430260f6de08ad6fca55dc96e7987997c4a +++ b/mp-wp/wp-admin/includes/schema.php e083b5b6b430483751fd25b8c8e411daa0e5478557c02a48c349e784ed38e2c24a08c21e82107b6b7f2155f5c2193dd5e8f58418282b7f2ec60f4076e35a358c @@ -299,7 +299,7 @@ add_option('dismissed_update_core', array()); // 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'); + $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', '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'); foreach ($unusedoptions as $option) : delete_option($option); endforeach; diff -uNr a/mp-wp/wp-admin/includes/template.php b/mp-wp/wp-admin/includes/template.php --- a/mp-wp/wp-admin/includes/template.php 16c0fc9c5d8a4cc9ff746e06c54c55c30fc703f1d81d3f441454e3cc94655a0abbcf606e3df1126dad1e5ffdc049f04328f33461f1ef137a46e06a5aca0eabe9 +++ b/mp-wp/wp-admin/includes/template.php 67007ae96743e9c971f9d54432741753eda72b8c98134960a3ed97bc8368ba32ea6c57830219f47e34804ffe607dfa4b400e41846323595eaf134f43e20bfcc9 @@ -121,9 +121,8 @@ $edit = "name)) . "'>" . attribute_escape( $name ) . '
    '; $actions = array(); $actions['edit'] = '' . __('Edit') . ''; - $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; if ( $default_cat_id != $category->term_id ) - $actions['delete'] = "term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . ""; + $actions['delete'] = "term_id) . "'>" . __('Delete') . ""; $action_count = count($actions); $i = 0; $edit .= '
    '; @@ -157,13 +156,13 @@ switch ($column_name) { case 'cb': - $output .= ""; + $output .= ""; if ( $default_cat_id != $category->term_id ) { $output .= ""; } else { $output .= " "; } - $output .= ''; + $output .= ''; break; case 'name': $output .= "$edit"; @@ -191,80 +190,6 @@ /** * {@internal Missing Short Description}} * - * @since 2.7 - * - * Outputs the HTML for the hidden table rows used in Categories, Link Caregories and Tags quick edit. - * - * @param string $type "tag", "category" or "link-category" - * @return - */ -function inline_edit_term_row($type) { - - if ( ! current_user_can( 'manage_categories' ) ) - return; - - $is_tag = $type == 'edit-tags'; - $columns = get_column_headers($type); - $hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($type) ) ); - $col_count = count($columns) - count($hidden); - ?> - -
    - -
    -name)) . "'>$name
    "; $actions = array(); $actions['edit'] = '' . __('Edit') . ''; - $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; if ( $default_cat_id != $category->term_id ) - $actions['delete'] = "term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this category '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . ""; + $actions['delete'] = "term_id) . "'>" . __('Delete') . ""; $action_count = count($actions); $i = 0; $edit .= '
    '; @@ -321,13 +245,13 @@ switch ($column_name) { case 'cb': - $output .= ""; + $output .= ""; if ( absint( get_option( 'default_link_category' ) ) != $category->term_id ) { $output .= ""; } else { $output .= " "; } - $output .= ""; + $output .= ""; break; case 'name': $output .= "$edit"; @@ -603,14 +527,13 @@ switch ($column_name) { case 'cb': - $out .= ' '; + $out .= ' '; break; case 'name': $out .= '' . $name . '
    '; $actions = array(); $actions['edit'] = '' . __('Edit') . ''; - $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; - $actions['delete'] = "term_id) . "' onclick=\"if ( confirm('" . js_escape(sprintf(__("You are about to delete this tag '%s'\n 'Cancel' to stop, 'OK' to delete."), $name )) . "') ) { return true;}return false;\">" . __('Delete') . ""; + $actions['delete'] = "term_id) . "'>" . __('Delete') . ""; $action_count = count($actions); $i = 0; $out .= '
    '; @@ -686,13 +609,13 @@ */ function wp_manage_posts_columns() { $posts_columns = array(); - $posts_columns['cb'] = ''; + $posts_columns['cb'] = ' '; $posts_columns['title'] = _c('Post|noun'); $posts_columns['author'] = __('Author'); $posts_columns['categories'] = __('Categories'); $posts_columns['tags'] = __('Tags'); if ( !isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) - $posts_columns['comments'] = '
    Comments
    '; + $posts_columns['comments'] = '
    Comments
    '; $posts_columns['date'] = __('Date'); $posts_columns = apply_filters('manage_posts_columns', $posts_columns); @@ -709,14 +632,11 @@ */ function wp_manage_media_columns() { $posts_columns = array(); - $posts_columns['cb'] = ''; + $posts_columns['cb'] = ' '; $posts_columns['icon'] = ''; $posts_columns['media'] = _c('File|media column header'); $posts_columns['author'] = __('Author'); - //$posts_columns['tags'] = _c('Tags|media column header'); - $posts_columns['parent'] = _c('Attached to|media column header'); - $posts_columns['comments'] = '
    Comments
    '; - //$posts_columns['comments'] = __('Comments'); + $posts_columns['comments'] = '
    Comments
    '; $posts_columns['date'] = _c('Date|media column header'); $posts_columns = apply_filters('manage_media_columns', $posts_columns); @@ -732,14 +652,14 @@ */ function wp_manage_pages_columns() { $posts_columns = array(); - $posts_columns['cb'] = ''; + $posts_columns['cb'] = ' '; $posts_columns['title'] = __('Title'); $posts_columns['author'] = __('Author'); $post_status = 'all'; if ( !empty($_GET['post_status']) ) $post_status = $_GET['post_status']; if ( !in_array($post_status, array('pending', 'draft', 'future')) ) - $posts_columns['comments'] = '
    '; + $posts_columns['comments'] = '
    Comments
    '; $posts_columns['date'] = __('Date'); $posts_columns = apply_filters('manage_pages_columns', $posts_columns); @@ -773,7 +693,7 @@ break; case 'edit-comments': $_wp_column_headers[$page] = array( - 'cb' => '', + 'cb' => ' ', 'author' => __('Author'), 'comment' => _c('Comment|noun'), //'date' => __('Submitted'), @@ -783,7 +703,7 @@ break; case 'link-manager': $_wp_column_headers[$page] = array( - 'cb' => '', + 'cb' => ' ', 'name' => __('Name'), 'url' => __('URL'), 'categories' => __('Categories'), @@ -797,7 +717,7 @@ break; case 'categories': $_wp_column_headers[$page] = array( - 'cb' => '', + 'cb' => ' ', 'name' => __('Name'), 'description' => __('Description'), 'slug' => __('Slug'), @@ -807,7 +727,7 @@ break; case 'edit-link-categories': $_wp_column_headers[$page] = array( - 'cb' => '', + 'cb' => ' ', 'name' => __('Name'), 'description' => __('Description'), 'slug' => __('Slug'), @@ -817,7 +737,7 @@ break; case 'edit-tags': $_wp_column_headers[$page] = array( - 'cb' => '', + 'cb' => ' ', 'name' => __('Name'), 'slug' => __('Slug'), 'posts' => __('Posts') @@ -826,7 +746,7 @@ break; case 'users': $_wp_column_headers[$page] = array( - 'cb' => '', + 'cb' => ' ', 'username' => __('Username'), 'name' => __('Name'), 'email' => __('E-mail'), @@ -914,295 +834,6 @@ return (array) get_user_option( 'manage-' . $page . '-columns-hidden', 0, false ); } -/** - * {@internal Missing Short Description}} - * - * Outputs the quick edit and bulk edit table rows for posts and pages - * - * @since 2.7 - * - * @param string $type 'post' or 'page' - */ -function inline_edit_row( $type ) { - global $current_user, $mode; - - $is_page = 'page' == $type; - if ( $is_page ) { - $screen = 'edit-pages'; - $post = get_default_page_to_edit(); - } else { - $screen = 'edit'; - $post = get_default_post_to_edit(); - } - - $columns = $is_page ? wp_manage_pages_columns() : wp_manage_posts_columns(); - $hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($screen) ) ); - $col_count = count($columns) - count($hidden); - $m = ( isset($mode) && 'excerpt' == $mode ) ? 'excerpt' : 'list'; - $can_publish = current_user_can("publish_{$type}s"); - $core_columns = array( 'cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true ); - -?> - -
    - - - " style="display: none"> - -
    - -
    -

    - - - -
    -
    -
    - - - - - - - - - - - - - -
    - -
    -
    - -id, true, $type ); // TODO: ROLE SYSTEM - if ( $authors && count( $authors ) > 1 ) : - $users_opt = array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'multi' => 1); - if ( $bulk ) - $users_opt['show_option_none'] = __('- No Change -'); -?> - - - - - - -
    - - - - - -
    - - - -
    - - - -
    - - - - -
      - -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - -
    - - - -
    - - - - -
    - - - - - - - - - - - - - - - - -
    - -
    - - $column_display_name ) { - if ( isset( $core_columns[$column_name] ) ) - continue; - do_action( $bulk ? 'bulk_edit_custom_box' : 'quick_edit_custom_box', $column_name, $type); - } -?> -

    - - - - - - - - -
    -

    -
    - - ID ) ) { ?> + ID ) ) { ?> ID) ) { $actions['edit'] = '' . __('Edit') . ''; - $actions['inline hide-if-no-js'] = '' . __('Quick Edit') . ''; - $actions['delete'] = "ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . ""; } if ( in_array($post->post_status, array('pending', 'draft')) ) { if ( current_user_can('edit_post', $post->ID) ) @@ -1535,7 +1164,7 @@ case 'cb': ?> - + ID) ) { $actions['edit'] = '' . __('Edit') . ''; - $actions['inline'] = '' . __('Quick Edit') . ''; - $actions['delete'] = "ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . ""; + $actions['delete'] = "ID) . "'>" . __('Delete') . ""; } if ( in_array($post->post_status, array('pending', 'draft')) ) { if ( current_user_can('edit_page', $page->ID) ) @@ -1842,7 +1470,7 @@ switch ($column_name) { case 'cb': - $r .= ""; + $r .= ""; break; case 'username': $r .= "$avatar $edit"; @@ -1995,9 +1623,9 @@ switch ($column_name) { case 'cb': if ( !$checkbox ) break; - echo ''; + echo ''; if ( current_user_can('edit_post', $post->ID) ) echo ""; - echo ''; + echo ''; break; case 'comment': echo ""; @@ -2031,9 +1659,6 @@ $actions['spam'] = "" . _c( 'Spam|verb' ) . ''; $actions['delete'] = "" . __('Delete') . ''; $actions['edit'] = "". __('Edit') . ''; - $actions['quickedit'] = '' . __('Quick Edit') . ''; - if ( 'spam' != $the_comment_status ) - $actions['reply'] = '' . __('Reply') . ''; $actions = apply_filters( 'comment_row_actions', $actions, $comment ); @@ -2043,10 +1668,6 @@ ++$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'; - echo "$sep$link"; } echo '
    '; @@ -2168,7 +1789,7 @@ - +

    @@ -2362,8 +1983,7 @@ } ?> - - + @@ -2448,11 +2068,6 @@ ?> - -

    - - -

    Browse Happy
    -'; -} - -/** - * {@internal Missing Short Description}} - * - * @since unknown * * @param unknown_type $id * @return unknown @@ -2789,7 +2392,6 @@ if ( in_array($box['id'], $hidden) ) $style = 'style="display:none;"'; echo '
    ' . "\n"; - echo '

    '; echo "

    {$box['title']}

    \n"; echo '
    ' . "\n"; call_user_func($box['callback'], $object, $box); @@ -3003,142 +2605,6 @@ } /** - * {@internal Missing Short Description}} - * - * @since unknown - * - * @param unknown_type $found_action - */ -function find_posts_div($found_action = '') { -?> - - -post_password ) ) echo attribute_escape( $post->post_password ); } -/** - * {@internal Missing Short Description}} - * - * @since unknown - */ -function favorite_actions() { - $actions = array( - 'post-new.php' => array(__('New Post'), 'edit_posts'), - 'edit.php?post_status=draft' => array(__('Drafts'), 'edit_posts'), - 'page-new.php' => array(__('New Page'), 'edit_pages'), - 'media-new.php' => array(__('Upload'), 'upload_files'), - 'edit-comments.php' => array(__('Comments'), 'moderate_comments') - ); - - $actions = apply_filters('favorite_actions', $actions); - - $allowed_actions = array(); - foreach ( $actions as $action => $data ) { - if ( current_user_can($data[1]) ) - $allowed_actions[$action] = $data[0]; - } - - if ( empty($allowed_actions) ) - return; - - $first = array_keys($allowed_actions); - $first = $first[0]; - echo '
    '; - echo '

    '; - echo '
    '; - - array_shift($allowed_actions); - - foreach ( $allowed_actions as $action => $label) { - echo "\n"; - } - echo "
    \n"; -} /** * Get the post title. @@ -3225,53 +2651,6 @@ echo isset($_GET['s']) ? attribute_escape( stripslashes( $_GET['s'] ) ) : ''; } -/** - * Generic Iframe header for use with Thickbox - * - * @since 2.7.0 - * @param string $title Title of the Iframe page. - * @param bool $limit_styles Limit styles to colour-related styles only (unless others are enqueued). - * - */ -function iframe_header( $title = '', $limit_styles = false) { -?> - > - - -<?php bloginfo('name') ?> › <?php echo $title ?> — <?php _e('WordPress'); ?> - - - - -> - -'; -} - function _post_states($post) { $post_states = array(); if ( isset($_GET['post_status']) ) @@ -3300,137 +2679,6 @@ } } -function screen_meta($screen) { - global $wp_meta_boxes, $_wp_contextual_help; - - $screen = str_replace('.php', '', $screen); - $screen = str_replace('-new', '', $screen); - $screen = str_replace('-add', '', $screen); - $screen = apply_filters('screen_meta_screen', $screen); - - $column_screens = get_column_headers($screen); - $meta_screens = array('index' => 'dashboard'); - - if ( isset($meta_screens[$screen]) ) - $screen = $meta_screens[$screen]; - $show_screen = false; - if ( !empty($wp_meta_boxes[$screen]) || !empty($column_screens) ) - $show_screen = true; -?> -
    - - - -' . __('Writing Posts') . '

    '; - $_wp_contextual_help['post'] = $help; - } - - if ( !isset($_wp_contextual_help['page']) ) { - $help = drag_drop_help(); - $_wp_contextual_help['page'] = $help; - } - - if ( !isset($_wp_contextual_help['dashboard']) ) { - $help = drag_drop_help(); - $_wp_contextual_help['dashboard'] = $help; - } - - if ( !isset($_wp_contextual_help['link']) ) { - $help = drag_drop_help(); - $_wp_contextual_help['link'] = $help; - } - - if ( !isset($_wp_contextual_help['options-general']) ) - $_wp_contextual_help['options-general'] = __('General Settings'); - - $_wp_contextual_help = apply_filters('contextual_help_list', $_wp_contextual_help, $screen); - ?> - - - -
    -' . __('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.') . '

    -

    ' . __('The same modules can be expanded and collapsed by clicking once on their title bar and also completely hidden from the Screen Options tab.') . '

    -'; -} - function screen_icon($name = '') { global $parent_file, $hook_suffix; @@ -3441,9 +2689,6 @@ $name = str_replace(array('.php', '-new', '-add'), '', $hook_suffix); } unset($hook_suffix); -?> -

    - diff -uNr a/mp-wp/wp-admin/includes/widgets.php b/mp-wp/wp-admin/includes/widgets.php --- a/mp-wp/wp-admin/includes/widgets.php 254517b0604be63728fe88b3965f8da94140ae82cf34e1b22324506e4883f6937b9c07d9c9ce18a5bac7db55f4d72c787dff30d486a7ce08e1d478b1011e4b05 +++ b/mp-wp/wp-admin/includes/widgets.php 0bbc732f61e4f55f812b8cf492c409d36c42b842dd660f947f68251888a7d8b5008c2c3b086f583b95922d829fdd2d0d2c15fcf2310e2a1c0cdc2afba996c5ef @@ -302,13 +302,6 @@
    - - - - - - - ">
    @@ -337,4 +330,4 @@ return trim( wp_specialchars( strip_tags( $string ) ) ); } -?> \ No newline at end of file +?> diff -uNr a/mp-wp/wp-admin/index-extra.php b/mp-wp/wp-admin/index-extra.php --- a/mp-wp/wp-admin/index-extra.php 251a67164a1d3c2a768817863f03fdcad5670a9963ff30b7fe9d854c1f756750fe0a06d680e23b4be7d49f132a47f920eda3d89827277ff1054cd3785b194d06 +++ b/mp-wp/wp-admin/index-extra.php 154677028eaa9e17a85d9c731eb736f456193f39f3879ed63cbe4a30fd0870fc1b98a49754cef5099d6becb3bbae45eee65dbcec355bb09f6ff2052a5233c57e @@ -30,11 +30,6 @@ case 'dashboard_secondary' : wp_dashboard_secondary_output(); break; - -case 'dashboard_plugins' : - wp_dashboard_plugins_output(); - break; - } -?> \ No newline at end of file +?> diff -uNr a/mp-wp/wp-admin/index.php b/mp-wp/wp-admin/index.php --- a/mp-wp/wp-admin/index.php f069b7b1994121d8227ac9ba20dcbaf8a9980cf48c606090afb8e580b9e003d219f08cb75d9af86de64791b6e5d324e0175427ef5fd43c7fd26d3b46b7de1a91 +++ b/mp-wp/wp-admin/index.php bf7be02a73c676986e7b4e4b978e6d374b1bdcb5e27cffaab7902d4750c8c95e87f0f1af47165d15c9aa5fd7661a09fd98e6e69a093ed13badcc4c9aeb52d768 @@ -14,12 +14,8 @@ wp_dashboard_setup(); -wp_enqueue_script( 'dashboard' ); -wp_enqueue_script( 'plugin-install' ); -wp_enqueue_script( 'media-upload' ); wp_admin_css( 'dashboard' ); wp_admin_css( 'plugin-install' ); -add_thickbox(); $title = __('Dashboard'); $parent_file = 'index.php'; diff -uNr a/mp-wp/wp-admin/install.php b/mp-wp/wp-admin/install.php --- a/mp-wp/wp-admin/install.php f5749ce9778014c4db045b1fa8ccd66d10fdc98442e94c424b5145111c9bd93bcb83df44535b251a9cec68490897cee768aee9b651334b59cf3a69051ee39572 +++ b/mp-wp/wp-admin/install.php a9a90cb00f87e99ad8b3639c2c102c75440c14d5c2f3405176ff033be77382e6ff8ed54ff15a863cf71f0725edcfe072e002584b43eb263de30a1ea0b87aeb37 @@ -43,7 +43,7 @@ -

    WordPress

    +

    MP-WP

    - diff -uNr a/mp-wp/wp-admin/js/cat.js b/mp-wp/wp-admin/js/cat.js --- a/mp-wp/wp-admin/js/cat.js 7e1e51e966391bf49519b06fb023a0f141d07ce95cfa1a04382504bea418f3170014276ba975ac7f5aa627b6253a1015ced433bdaf5c091a71bd46109ae71db9 +++ b/mp-wp/wp-admin/js/cat.js false @@ -1,5 +0,0 @@ -jQuery( function($) { - var myConfirm = function() { return '' !== $('#newcat').val(); }; - $('#jaxcat').prepend('' + catL10n.how + '') - $('#categorychecklist').wpList( { alt: '', response: 'cat-ajax-response', confirm: myConfirm } ); -} ); diff -uNr a/mp-wp/wp-admin/js/categories.js b/mp-wp/wp-admin/js/categories.js --- a/mp-wp/wp-admin/js/categories.js fbe46531eac11f184d4019581b116e1c6f30b3ab43efb1408e58331c3cc775ff0a49126885b5153bfc56bdb331f8c307ef926f7f547673cfba115e6818fe6388 +++ b/mp-wp/wp-admin/js/categories.js false @@ -1,37 +0,0 @@ -jQuery(function($) { - var options = false - if ( document.forms['addcat'].category_parent ) - options = document.forms['addcat'].category_parent.options; - - var addAfter = function( r, settings ) { - var name = $("" + $('name', r).text() + "").html(); - var id = $('cat', r).attr('id'); - options[options.length] = new Option(name, id); - - addAfter2( r, settings ); - } - - var addAfter2 = function( x, r ) { - var t = $(r.parsed.responses[0].data); - if ( t.length == 1 ) - inlineEditTax.addEvents($(t.id)); - } - - var delAfter = function( r, settings ) { - var id = $('cat', r).attr('id'); - for ( var o = 0; o < options.length; o++ ) - if ( id == options[o].value ) - options[o] = null; - } - - if ( options ) - $('#the-list').wpList( { addAfter: addAfter, delAfter: delAfter } ); - else - $('#the-list').wpList({ addAfter: addAfter2 }); - - if ( jQuery('#link-category-search-input').size() ) { - columns.init('edit-link-categories'); - } else { - columns.init('categories'); - } -}); diff -uNr a/mp-wp/wp-admin/js/comment.js b/mp-wp/wp-admin/js/comment.js --- a/mp-wp/wp-admin/js/comment.js 8addf23a31f89cb15336bcf457d1f0e494ac355c12139d4987406eef2f443eeef47313cb496218d222d204b5eaddb28fbb390166e5b084c3262cff81d6b926e5 +++ b/mp-wp/wp-admin/js/comment.js false @@ -1,39 +0,0 @@ -jQuery(document).ready( function($) { - jQuery('.hide-if-no-js').show(); - jQuery('.hide-if-js').hide(); - - var stamp = $('#timestamp').html(); - $('.edit-timestamp').click(function () { - if ($('#timestampdiv').is(":hidden")) { - $('#timestampdiv').slideDown("normal"); - $('.edit-timestamp').hide(); - } - return false; - }); - - $('.cancel-timestamp').click(function() { - $('#timestampdiv').slideUp("normal"); - $('#mm').val($('#hidden_mm').val()); - $('#jj').val($('#hidden_jj').val()); - $('#aa').val($('#hidden_aa').val()); - $('#hh').val($('#hidden_hh').val()); - $('#mn').val($('#hidden_mn').val()); - $('#timestamp').html(stamp); - $('.edit-timestamp').show(); - return false; - }); - - $('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels - $('#timestampdiv').slideUp("normal"); - $('.edit-timestamp').show(); - $('#timestamp').html( - commentL10n.submittedOn + ' ' + - $( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' + - $('#jj').val() + ', ' + - $('#aa').val() + ' @ ' + - $('#hh').val() + ':' + - $('#mn').val() + ' ' - ); - return false; - }); -}); \ No newline at end of file diff -uNr a/mp-wp/wp-admin/js/common.js b/mp-wp/wp-admin/js/common.js --- a/mp-wp/wp-admin/js/common.js e47932af030e1a7055a8e3a8d649999819fbfb685a92349e5ee9a83f6225741cb39f92102fc23241c892d679d7f2e8b2af87d28b12fc9474d773a8f81cae007d +++ b/mp-wp/wp-admin/js/common.js false @@ -1,366 +0,0 @@ - -wpCookies = { -// The following functions are from Cookie.js class in TinyMCE, Moxiecode, used under LGPL. - - each : function(o, cb, s) { - var n, l; - - if (!o) - return 0; - - s = s || o; - - if (typeof(o.length) != 'undefined') { - for (n=0, l = o.length; n
    diff -uNr a/mp-wp/wp-admin/media.php b/mp-wp/wp-admin/media.php --- a/mp-wp/wp-admin/media.php bcdec73f5ee71615523f0eb88243cb2484822e6600b9d7da01882a75d16c25e287fea3d11e4cb194ab2ec40fc681588f26163b7cc93324277a8831027c39447d +++ b/mp-wp/wp-admin/media.php 3bed941f9637e5c6482ce69d1a1104a36706684dce722ace26a22959b06a1628f35a8c571cc720c80769023606a9b4071f0ecc2066d98e4b3d9ae39835f982aa @@ -60,9 +60,6 @@ add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2); - wp_enqueue_script( 'wp-ajax-response' ); -// wp_admin_css( 'media' ); - require( 'admin-header.php' ); $parent_file = 'upload.php'; diff -uNr a/mp-wp/wp-admin/menu-header.php b/mp-wp/wp-admin/menu-header.php --- a/mp-wp/wp-admin/menu-header.php 438670b5c1c70f8178d4731a311ed8c0e12f4075ea7eac3d0a8fca957bbef6b897c59b6601574a14fbb52ea5908eee69f5958f33d9ef8f1b6ca56e93b07efad3 +++ b/mp-wp/wp-admin/menu-header.php 8e21636aa1532db2b812e83466fe036609ce47fdc0fa5f07cb993cfd6ac193309ff30f847f24e661d81b18c566b1db9a9978a8445eb08030f539a3e1905ffbfc @@ -43,7 +43,7 @@ $first = false; } if ( !empty($submenu[$item[2]]) ) - $class[] = 'wp-has-submenu'; + $class[] = 'wp-has-submenu wp-menu-open'; if ( ( $parent_file && $item[2] == $parent_file ) || strcmp($self, $item[2]) == 0 ) { if ( !empty($submenu[$item[2]]) ) @@ -59,39 +59,32 @@ $tabindex = ' tabindex="1"'; $id = isset($item[5]) && ! empty($item[5]) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : ''; $img = ''; - if ( isset($item[6]) && ! empty($item[6]) ) { - if ( 'div' === $item[6] ) - $img = ''; - else - $img = ''; - } - $toggle = ''; echo "\n\t"; if ( false !== strpos($class, 'wp-menu-separator') ) { - echo '
    '; + echo ''; } elseif ( $submenu_as_parent && !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(WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook)) { $admin_is_parent = true; - echo "$img$toggle{$item[0]}"; + echo "$img{$item[0]}"; } else { - echo "\n\t$img$toggle{$item[0]}"; + echo "\n\t$img{$item[0]}"; } } else if ( current_user_can($item[1]) ) { $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); if ( file_exists(WP_PLUGIN_DIR . "/{$item[2]}") || !empty($menu_hook) ) { $admin_is_parent = true; - echo "\n\t$img$toggle{$item[0]}"; + echo "\n\t$img{$item[0]}"; } else { - echo "\n\t$img$toggle{$item[0]}"; + echo "\n\t$img{$item[0]}"; } } if ( !empty($submenu[$item[2]]) ) { - echo "\n\t
    {$item[0]}
      "; + echo "\n\t
        "; $first = true; foreach ( $submenu[$item[2]] as $sub_key => $sub_item ) { if ( !current_user_can($sub_item[1]) ) @@ -144,4 +137,4 @@ do_action( 'adminmenu' ); ?> -
      \ No newline at end of file +
    diff -uNr a/mp-wp/wp-admin/menu.php b/mp-wp/wp-admin/menu.php --- a/mp-wp/wp-admin/menu.php 38e5575a69fdf003a721791a120bd47e1568e85409f9450f9cad69bb6cc18f96b99eabcbb4342c25c051d5268903442449b4dfc232ee9f2139dc77be9788f6a1 +++ b/mp-wp/wp-admin/menu.php 9104f9e5c07c883b1e28cf7f0d635278a7926a3ca5a13c0cfe6a9687ae28a2b445274c980960b7d2f2bf38750af71b9e6cacbdd2ef7798426887cdd16d116a18 @@ -56,17 +56,14 @@ $menu[40] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top', 'menu-appearance', 'div' ); $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php'); - $submenu['themes.php'][10] = array(__('Editor'), 'edit_themes', 'theme-editor.php'); $update_plugins = get_option( 'update_plugins' ); $update_count = 0; if ( !empty($update_plugins->response) ) $update_count = count( $update_plugins->response ); -$menu[45] = array( sprintf( __('Plugins %s'), "" . number_format_i18n($update_count) . "" ), 'activate_plugins', 'plugins.php', '', 'menu-top', 'menu-plugins', 'div' ); +$menu[45] = array( __('Plugins'), 'activate_plugins', 'plugins.php', '', 'menu-top', 'menu-plugins', 'div' ); $submenu['plugins.php'][5] = array( __('Installed'), 'activate_plugins', 'plugins.php' ); - $submenu['plugins.php'][10] = array(_c('Add New|plugin'), 'install_plugins', 'plugin-install.php'); - $submenu['plugins.php'][15] = array( __('Editor'), 'edit_plugins', 'plugin-editor.php' ); if ( current_user_can('edit_users') ) $menu[50] = array( __('Users'), 'edit_users', 'users.php', '', 'menu-top', 'menu-users', 'div' ); @@ -83,10 +80,6 @@ $submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php'); } -$menu[55] = array( __('Tools'), 'manage_options', 'tools.php', '', 'menu-top', 'menu-tools', 'div' ); - $submenu['tools.php'][10] = array( __('Import'), 'import', 'import.php' ); - $submenu['tools.php'][15] = array( __('Export'), 'import', 'export.php' ); - $menu[60] = array( __('Settings'), 'manage_options', 'options-general.php', '', 'menu-top', 'menu-settings', 'div' ); $submenu['options-general.php'][10] = array(__('General'), 'manage_options', 'options-general.php'); $submenu['options-general.php'][15] = array(__('Writing'), 'manage_options', 'options-writing.php'); diff -uNr a/mp-wp/wp-admin/options-general.php b/mp-wp/wp-admin/options-general.php --- a/mp-wp/wp-admin/options-general.php 1f02d5cbebd151b0228f06b080b918301db8a696ef65a202a429b3d78cd3f3482b932b68b0315faaa18151a5f5397c2b7f206b8e8a9b5a4b3c07d870060640b0 +++ b/mp-wp/wp-admin/options-general.php 42d6cff8f839c42bf2b28ad254bfeaeee62b03aaa893f4eb60c9aba6b4bd1d2f2fedb03043649f08eb55dfce09866a944374e499d5b871aaf142e73ffa011842 @@ -12,39 +12,6 @@ $title = __('General Settings'); $parent_file = 'options-general.php'; -/** - * Display JavaScript on the page. - * - * @package WordPress - * @subpackage General_Settings_Panel - */ -function add_js() { -?> - - diff -uNr a/mp-wp/wp-admin/options-permalink.php b/mp-wp/wp-admin/options-permalink.php --- a/mp-wp/wp-admin/options-permalink.php c3f84e51f460c5ef75a9c8fb834a0a8e6867d2fa549945a18f355ce10982f8f56b0fa6b44731dec04b9ecdcfc5cf27586c3cc796dfa546c980b368288360d7b0 +++ b/mp-wp/wp-admin/options-permalink.php 36a7019592d247b27dbbb32481ee5011cebb2b9b7e9553bead784fbee1341274186fbe4ef45a2cdd7ce8610de568fa6d1d6322fa8f312830a4ab1be6315fc48a @@ -12,61 +12,6 @@ $title = __('Permalink Settings'); $parent_file = 'options-general.php'; -/** - * Display JavaScript on the page. - * - * @package WordPress - * @subpackage Permalink_Settings_Panel - */ -function add_js() { -?> - -ID ) ) { $last_user = get_userdata( $last ); @@ -119,7 +114,6 @@ add_action('admin_notices', create_function( '', "echo '$message';" ) ); } else { wp_set_post_lock( $post->ID ); - wp_enqueue_script('autosave'); } } diff -uNr a/mp-wp/wp-admin/plugin-editor.php b/mp-wp/wp-admin/plugin-editor.php --- a/mp-wp/wp-admin/plugin-editor.php 4ac392674019cf0defe9fa224484a992da428d36929c3b838016b560717a8db6c28644e2f069769ff6633ced67657b054af9fe4f0ca78beadb53023999ca739a +++ b/mp-wp/wp-admin/plugin-editor.php false @@ -1,164 +0,0 @@ -'.__('You do not have sufficient permissions to edit templates for this blog.').'

    '); - - $newcontent = stripslashes($_POST['newcontent']); - if ( is_writeable($real_file) ) { - $f = fopen($real_file, 'w+'); - fwrite($f, $newcontent); - fclose($f); - - // Deactivate so we can test it. - if ( is_plugin_active($file) || isset($_POST['phperror']) ) { - if ( is_plugin_active($file) ) - deactivate_plugins($file, true); - wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1")); - exit; - } - wp_redirect("plugin-editor.php?file=$file&a=te"); - } else { - wp_redirect("plugin-editor.php?file=$file"); - } - exit; - -break; - -default: - - if ( !current_user_can('edit_plugins') ) - wp_die('

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

    '); - - if ( isset($_GET['liveupdate']) ) { - check_admin_referer('edit-plugin-test_' . $file); - - $error = validate_plugin($file); - if( is_wp_error($error) ) - wp_die( $error ); - - if ( ! is_plugin_active($file) ) - activate_plugin($file, "plugin-editor.php?file=$file&phperror=1");// we'll override this later if the plugin can be included without fatal error - - wp_redirect("plugin-editor.php?file=$file&a=te"); - exit; - } - - require_once('admin-header.php'); - - update_recently_edited(WP_PLUGIN_DIR . '/' . $file); - - if ( ! is_file($real_file) ) - $error = 1; - - if ( ! $error ) - $content = htmlspecialchars(file_get_contents($real_file)); - - ?> - -

    - -

    fatal error.') ?>

    - - - -
    - -
    - -

    - -
    -
    -%s (active)'), $file); - else - echo sprintf(__('Browsing %s (active)'), $file); - } else { - if ( is_writeable($real_file) ) - echo sprintf(__('Editing %s (inactive)'), $file); - else - echo sprintf(__('Browsing %s (inactive)'), $file); - } - ?> -
    -
    -
    -
    -
    -

    - -

    -
      - -
    • - -
    -
    - -
    - -
    - - -
    - - -

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

    - -

    - "; - else - echo ""; - ?> -

    - -

    the Codex for more information.'); ?>

    - -
    -

    ' . __('Oops, no such file exists! Double check the name and try again, merci.') . '

    '; - } -?> -
     
    -
    - \ No newline at end of file diff -uNr a/mp-wp/wp-admin/plugin-install.php b/mp-wp/wp-admin/plugin-install.php --- a/mp-wp/wp-admin/plugin-install.php dfe64b42c54cc4f4c1028000f4367b6044cec2abdae986bf037f4d8462d1f6827afa4e88a5856e2a128e7d9cd8812b530c9a8ee00b1ddc25c83124edf67fa749 +++ b/mp-wp/wp-admin/plugin-install.php false @@ -1,74 +0,0 @@ - -
    - -

    - -
      - $text ) { - $sep = ( end($tabs) != $text ) ? ' | ' : ''; - $class = ( $action == $tab ) ? ' class="current"' : ''; - $href = admin_url('plugin-install.php?tab='. $action); - echo "\t\t
    • $text$sep
    • \n"; -} -?> -
    -
    - -
    - diff -uNr a/mp-wp/wp-admin/plugins.php b/mp-wp/wp-admin/plugins.php --- a/mp-wp/wp-admin/plugins.php 954ab7dc135abba9b25af8dabaeadaaf7408ddce076578572097832e83aee55ff27350822d39a773141b2f1487555cb54ae6a28ed16f0b74a03e78c772205bcb +++ b/mp-wp/wp-admin/plugins.php 8e27bd6e9c5553d9dbb52d0b1e7ff7b30ed8fd004f2650a0f2659c817b8b2fa341b18661bd3b1688aca72c9413cc7ab7634e079247dd7821fce0e5506214312f @@ -10,7 +10,7 @@ require_once('admin.php'); $action = ''; -foreach( array('activate-selected', 'deactivate-selected', 'delete-selected', 'clear-recent-list') as $action_key ) { +foreach( array('activate-selected', 'deactivate-selected', 'clear-recent-list') as $action_key ) { if( isset($_POST[$action_key]) ) { $action = $action_key; break; @@ -80,91 +80,12 @@ wp_redirect('plugins.php?deactivate-multi=true'); exit; break; - case 'delete-selected': - if ( ! current_user_can('delete_plugins') ) - wp_die(__('You do not have sufficient permissions to delete plugins for this blog.')); - - check_admin_referer('bulk-manage-plugins'); - - $plugins = $_REQUEST['checked']; //$_POST = from the plugin form; $_GET = from the FTP details screen. - - $title = __('Delete Plugin'); - $parent_file = 'plugins.php'; - - if ( ! isset($_REQUEST['verify-delete']) ) { - wp_enqueue_script('jquery'); - require_once('admin-header.php'); - ?> -
    -

    - -

    -
      - ', sprintf(__('%s by %s'), $plugin['Name'], $plugin['Author']), ''; - ?> -
    -

    -
    - - - '; - ?> - - -
    -
    - -
    - -

    - -
    -
    - -

    get_error_message() ); ?>

    - -

    deleted.'); ?>

    -

    activated.') ?>

    @@ -249,24 +164,13 @@ - + - - - - - - - - - - - ' . __('Activate') . ''; - if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) - $action_links[] = '' . __('Edit') . ''; - $action_links = apply_filters( 'plugin_action_links', $action_links, $plugin_file, $plugin_data, $context ); $action_links = apply_filters( "plugin_action_links_$plugin_file", $action_links, $plugin_file, $plugin_data, $context ); echo " - + @@ -325,9 +226,6 @@ - - - @@ -384,11 +282,6 @@

    -

    -

    Plugin Browser/Installer functionality, Or by browsing the WordPress Plugin Directory directly and installing manually.'); ?>

    -

    manually install a plugin you generally just need to upload the plugin file into your %s directory.'), WP_PLUGIN_DIR); ?>

    -

    - diff -uNr a/mp-wp/wp-admin/post.php b/mp-wp/wp-admin/post.php --- a/mp-wp/wp-admin/post.php 70ceffb697d263832d4007de3de8d8aed4eaddf8092e2a6ddbe53ba0685f54051d50f8a1ac97281dc7d42317483731c86f2f9093aff529f14e2eba3ffa8ea25c +++ b/mp-wp/wp-admin/post.php 9581534c5e27c73b37ff7d1c3469cf87afb937fafc799c1b6bc7eb4f1f4d9c01fd1e7a30b38400657933b5fbf030a20d8b9736b324aa107a5a6c5ddbdde541e3 @@ -138,13 +138,6 @@ exit(); } - wp_enqueue_script('post'); - add_thickbox(); - wp_enqueue_script('media-upload'); - wp_enqueue_script('word-count'); - wp_enqueue_script( 'admin-comments' ); - enqueue_comment_hotkeys_js(); - if ( current_user_can('edit_post', $post_ID) ) { if ( $last = wp_check_post_lock( $post->ID ) ) { $last_user = get_userdata( $last ); @@ -154,7 +147,6 @@ add_action('admin_notices', create_function( '', "echo '$message';" ) ); } else { wp_set_post_lock( $post->ID ); - wp_enqueue_script('autosave'); } } diff -uNr a/mp-wp/wp-admin/rtl.css b/mp-wp/wp-admin/rtl.css --- a/mp-wp/wp-admin/rtl.css 52a0de9489cbfd0a34141cd595c031436cd52828943bdccfd02bdf6be0506a2ba2473667a73bea012a0801a872d66a7ff4924c7f5290575f03e7a968410c9179 +++ b/mp-wp/wp-admin/rtl.css false @@ -1,529 +0,0 @@ -/* 0 - 200 -=================================== */ -td.available-theme { - text-align: right; -} -#current-theme img { - float: right; - margin-right: 0; - margin-left: 1em; -} -.quicktags, .search { - font-family: Tahoma, "Times New Roman"; -} -/* 200 - 500 -=================================== */ -#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: 1; - 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, "Times New Roman"; -} -#wpcontent select { - font-family: Tahoma, "Times New Roman"; -} -#quicktags { - background-position: right top; -} -/* 500 - 700 -=================================== */ -#template div { - margin-right: 0; - margin-left: 190px; -} -* html #template div { - margin-left: 0; -} -#your-profile legend { - font-family: "Times New Roman", Tahoma; -} -#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, "Times New Roman"; -} -#postcustomstuff table input, -#postcustomstuff table select, -#postcustomstuff table textarea { - margin: 8px 8px 8px 0; -} -/* 700 - 1000 -=================================== */ -#pass-strength-result { - float: right; - margin: 12px 1px 5px 5px; -} -/* Admin Header */ -#user_info { - float: left; -} -#header-logo { - float: right; - margin: 7px 15px 0 0; -} -#wphead h1 { - font-family: "Times New Roman", Tahoma; - float: right; -} -#wphead h1.long-title { - font-family: "Times New Roman", Tahoma; -} -#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, "Times New Roman"; -} -#adminmenu a.menu-top, -#adminmenu .wp-submenu-head { - font-family: Tahoma, "Times New Roman"; -} -#adminmenu img.wp-menu-image { - float: right; -} -.folded #adminmenu img.wp-menu-image { - padding: 7px 6px 0 0; -} -#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; -} -/* end side admin menu */ -/* 1000 - 1300 -=================================== */ -#adminmenu #awaiting-mod, -#adminmenu span.update-plugins, -#sidemenu li a span.update-plugins { - font-family: tahoma; - margin-left: 0; - margin-right: 2px; -} -#adminmenu li #awaiting-mod span, -#adminmenu li span.update-plugins span, -#sidemenu li a span.update-plugins span { - float: right; -} -.post-com-count-wrapper { - font-family: tahoma; -} -.column-response .post-com-count { - float: right; - margin-right: 0; - margin-left: 5px; -} -/* Tables used on comment.php and option/setting pages */ -.form-table th, -#wpbody-content .describe th { - text-align: right; -} -.form-table input.tog { - margin-right: 0; - margin-left: 2px; - float: right; -} -.form-table table.color-palette { - float: right; -} -/* Post Screen */ -/* 1300 - 1500 -=================================== */ -#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; -} -.setting-description, .form-wrap p { - font-family: Tahoma, Arial; -} -/* 1500 - 1800 -=================================== */ -.meta-box-sortables .postbox .handlediv { - float: left; -} -.howto { - font-family: Tahoma, Arial; -} -.postarea h3 label { - float: right; -} -.postarea #add-media-button { - float: left; - right: auto; - left: 10px; -} -#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; -} -/* Categories */ -#category-adder { - margin-left: 0; - margin-right: 120px; -} -#post-body ul#category-tabs li.ui-tabs-selected { - -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 { - float: right; - text-align: left; - margin: 0 0 0 -120px; -} -#post-body #categorydiv div.ui-tabs-panel, -#post-body #linkcategorydiv div.ui-tabs-panel { - margin: 0 120px 0 5px; -} -/* 1800 - 2000 -=================================== */ -#side-info-column #category-tabs li { - padding-right: 0; - padding-left: 8px; -} -#categorydiv ul.categorychecklist ul, -#linkcategorydiv ul.categorychecklist ul { - margin-left: 0; - margin-right: 18px; -} -/* positioning etc. */ -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; -} -/* 2000 - 2300 -=================================== */ -.filter .subsubsub { - margin-left: 0; - margin-right: -10px; -} -#wp-word-count { - margin-right: 10px; -} -.tool-box .title { - font-family: "Times New Roman", Tahoma; -} -.settings-toggle { - text-align: left; - margin: 5px 0 15px 7px; -} -.curtime #timestamp { - background-position: right top; - padding-left: 0; - padding-right: 18px; -} -/* media popup 0819 */ -#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; -} -/* 2300 - 2500 -=================================== */ -#edithead .inside { - float: right; - margin: 3px 5px 2px 0; -} -#replyrow #ed_reply_toolbar input { - margin: 1px 1px 1px 2px; -} -/* show/hide settings */ -#screen-meta-links { - margin: 0 0 0 9px; -} -#screen-options-link-wrap, -#contextual-help-link-wrap { - float: left; - font-family: Tahoma, "Times New Roman"; - margin: 0 0 0 6px; -} -.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; -} -/* 2500 - 2700 -=================================== */ -#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: 0.5em; -} -#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child { - margin-right: 0; - margin-left: 0.5em; -} -/* 2700 - 3000 -=================================== */ -.inline-edit-row fieldset span.title, -.inline-edit-row fieldset span.checkbox-title { - font-family: Tahoma, "Times New Roman"; -} -.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, "Times New Roman"; -} -.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 */ -#favorite-actions { - float: left; -} -#favorite-first { - padding: 3px 12px 4px 30px; -} -#favorite-inside { -} -#favorite-inside a { - padding: 3px 10px 3px 5px; -} -#favorite-toggle { - right: auto; - left: 0; - background:transparent url(images/fav-arrow-rtl.svg) 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; -} -/* ltr -=================================== */ -#author-email, #author-url, #rss-url-1, #edit-slug-box, #post_name, #trackback_url, #metakeyinput, #post_password, #slug, #category_nicename, #link_url, #link_image, #rss_uri, #menu_order, #email, #newcomment_author_url, #pages-exclude, #template textarea, #user_login, #url, #pass1, #pass2, #aim, #yim, #jabber, #siteurl, #home, #admin_email, #gmt_offset, #default_post_edit_rows, #mailserver_url, #mailserver_login, #mailserver_pass, #mailserver_port, #ping_sites, #posts_per_page, #posts_per_rss, #blog_charset, #close_comments_days_old, #comments_per_page, #comment_max_links, #moderation_keys, #blacklist_keys, #thumbnail_size_w, #thumbnail_size_h, #medium_size_w, #medium_size_h, #large_size_w, #large_size_h, #permalink_structure, #category_base, #tag_base, #upload_path, #upload_url_path, #rules { - direction: ltr; -} diff -uNr a/mp-wp/wp-admin/setup-config.php b/mp-wp/wp-admin/setup-config.php --- a/mp-wp/wp-admin/setup-config.php c5b8c57cc414d7ca6062b21b76b6a7cf4fb9b93456fd96a937a0429687c01dc239daea0813a73831ba0b6b5e7d892b06f454a95cd31bad1074f25611b0e0b91a +++ b/mp-wp/wp-admin/setup-config.php f54f7ba38a4d89ab295145336b06f548a3461d6709ea53776bfc2a46b15129f9255e42b66a9a36487b867080678a41a8ea4b56e73835401b2231e1f53132a4b2 @@ -71,7 +71,7 @@ -

    WordPress

    +

    MP-WP

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

    '); - - $newcontent = stripslashes($_POST['newcontent']); - $theme = urlencode($theme); - if (is_writeable($real_file)) { - //is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable - $f = fopen($real_file, 'w+'); - if ($f !== FALSE) { - fwrite($f, $newcontent); - fclose($f); - $location = "theme-editor.php?file=$file&theme=$theme&a=te"; - } else { - $location = "theme-editor.php?file=$file&theme=$theme"; - } - } else { - $location = "theme-editor.php?file=$file&theme=$theme"; - } - - $location = wp_kses_no_null($location); - $strip = array('%0d', '%0a'); - $location = str_replace($strip, '', $location); - header("Location: $location"); - exit(); - -break; - -default: - - if ( !current_user_can('edit_themes') ) - wp_die('

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

    '); - - require_once('admin-header.php'); - - update_recently_edited($file); - - if (!is_file($real_file)) - $error = 1; - - if (!$error && filesize($real_file) > 0) { - $f = fopen($real_file, 'r'); - $content = fread($f, filesize($real_file)); - $content = htmlspecialchars($content); - } - - ?> - -

    - (%s)" : "%s"; -?> -
    - -

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

    - - -

    -
      -($template_show)" : "$description"; - $filedesc = ( $template_file == $file ) ? "$description ($template_show)" : $filedesc; - - // If we have two files of the same name prefer the one in the Template Directory - // This means that we display the correct files for child themes which overload Templates as well as Styles - if( array_key_exists($description, $template_mapping ) ) { - if ( false !== strpos( $template_file, $template_dir ) ) { - $template_mapping[ $description ] = array( $template_file, $filedesc ); - } - } else { - $template_mapping[ $description ] = array( $template_file, $filedesc ); - } - } - ksort( $template_mapping ); - while ( list( $template_sorted_key, list( $template_file, $filedesc ) ) = each( $template_mapping ) ) : - ?> -
    • &theme=">
    • - -
    -

    -
      -($style_show)" : "$description"; - $filedesc = ( $style_file == $file ) ? "$description ($style_show)" : $filedesc; - $template_mapping[ $description ] = array( $style_file, $filedesc ); - } - ksort( $template_mapping ); - while ( list( $template_sorted_key, list( $style_file, $filedesc ) ) = each( $template_mapping ) ) : - ?> -
    • &theme=">
    • - -
    - -
    - -
    - -
    - - - -
    - -
    - -

    -"; -?> -

    - -

    the Codex for more information.'); ?>

    - -
    - -

    ' . __('Oops, no such file exists! Double check the name and try again, merci.') . '

    '; - } - ?> -
     
    - - diff -uNr a/mp-wp/wp-admin/themes.php b/mp-wp/wp-admin/themes.php --- a/mp-wp/wp-admin/themes.php 70e37396b6d1248880f83859c3639df7ea4e8c863bb1760466d73f86c8230c079edfce08c8a4d2de557af801965a5e0e1afca46b2ee28992d201201f84c94925 +++ b/mp-wp/wp-admin/themes.php 80b10f66b9830ed00f992cc3a0c18f082463fbcbd7cde1ed50b6508282d041af97515c6a42190c54a13d9cca54692b7d0c5cc478436a0cc241175693c01d094f @@ -22,9 +22,6 @@ $title = __('Manage Themes'); $parent_file = 'themes.php'; -add_thickbox(); -wp_enqueue_script( 'theme-preview' ); - require_once('admin-header.php'); ?> @@ -137,16 +134,15 @@ $preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true', 'width' => 600, 'height' => 400 ), $preview_link ) ); $preview_text = attribute_escape( sprintf( __('Preview of "%s"'), $title ) ); $tags = $themes[$theme_name]['Tags']; - $thickbox_class = 'thickbox'; $activate_link = wp_nonce_url("themes.php?action=activate&template=".urlencode($template)."&stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template); $activate_text = attribute_escape( sprintf( __('Activate "%s"'), $title ) ); ?> - + -

    +

    @@ -209,9 +205,6 @@ } ?> -

    -

    WordPress theme directory. To install a theme you generally just need to upload the theme folder into your wp-content/themes directory. Once a theme is uploaded, you should see it on this page.'); ?>

    - diff -uNr a/mp-wp/wp-admin/upload.php b/mp-wp/wp-admin/upload.php --- a/mp-wp/wp-admin/upload.php 5403c9ff616259f4927cc55a812b565e3d66a3d2940e069e470a0d773a0662f102d3edce7328bfcb76eb4f87eba1b4b9be7c05887a8b896ae4d6f9839b7fbe36 +++ b/mp-wp/wp-admin/upload.php 4d859251298afa201efb8030ad57c8358e9d93f50cc19c0cc7460387cc79f090a13a565a06e06f483766d6749942b4336806a3510e3f3d7b58cb50bf67cfe0ab @@ -8,9 +8,6 @@ /** WordPress Administration Bootstrap */ require_once('admin.php'); -wp_enqueue_script( 'wp-ajax-response' ); -wp_enqueue_script( 'jquery-ui-draggable' ); -wp_enqueue_script( 'jquery-ui-resizable' ); if (!current_user_can('upload_files')) wp_die(__('You do not have permission to upload files.')); @@ -68,9 +65,9 @@ exit; } -} elseif ( isset($_GET['action']) && isset($_GET['media']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) { +} elseif ( isset($_GET['action']) && isset($_GET['media']) && -1 != $_GET['action'] ) { check_admin_referer('bulk-media'); - $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2']; + $doaction = $_GET['action']; if ( 'delete' == $doaction ) { foreach( (array) $_GET['media'] as $post_id_del ) { @@ -200,7 +197,6 @@ $type_links[] = "
  • " . sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . ''; } $class = isset($_GET['detached']) ? ' class="current"' : ''; -$type_links[] = '
  • ' . __('Unattached') . ''; echo implode( " |
  • \n", $type_links) . ''; unset($type_links); @@ -230,22 +226,19 @@ 'current' => $_GET['paged'] )); -if ( $page_links ) : ?> +if ( $page_links ) { ?>
    ' . __( 'Displaying %s–%s of %s' ) . '%s', number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ), number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ), number_format_i18n( $wp_query->found_posts ), $page_links ); echo $page_links_text; ?>
    - +
    @@ -299,22 +292,12 @@
     
    {$plugin_data['Title']} {$plugin_data['Version']}

    {$plugin_data['Description']}

    - + - - - - - - - - - - ID) ); ?> - +
     
    ID, array(80, 60), true ) ) { ?> @@ -339,10 +322,8 @@ if ( current_user_can('edit_post', $post->ID) ) $actions['edit'] = '' . __('Edit') . ''; if ( current_user_can('delete_post', $post->ID) ) - $actions['delete'] = "ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . ""; + $actions['delete'] = "ID) . "'>" . __('Delete') . ""; $actions['view'] = '' . __('View') . ''; - if ( current_user_can('edit_post', $post->ID) ) - $actions['attach'] = ''.__('Attach').''; $action_count = count($actions); $i = 0; foreach ( $actions as $action => $link ) { @@ -377,58 +358,27 @@
    - -
    - + +
    +
    ' . __( 'Displaying %s–%s of %s' ) . '%s', + number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ), + number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ), + number_format_i18n( $wp_query->found_posts ), + $page_links +); echo $page_links_text; ?>
    - -$page_links_text
    "; -?> - -
    - - -
    -
    -

    - - - - - 1 ) : ?> - - - -
    - $color_info ): ?> -
    /> - - - colors as $html_color ): ?> - - - -
     
    - - -
    - -
    diff -uNr a/mp-wp/wp-admin/user-new.php b/mp-wp/wp-admin/user-new.php --- a/mp-wp/wp-admin/user-new.php cc6c5caef32096d22f7344d3542cdcfbeddbeffe5c09ffde7b7111572983a275e24a42361d15ba7c9c7b67fa23fb868d1b64fd4628c276e7410336dff3a61e93 +++ b/mp-wp/wp-admin/user-new.php bfbf97a3f8b6300c86d25ffe14ebf86a0a697472342e2176d41b19dbd95546d83495157c483f1e8108d363bdf6412c995791c579b0f7e055a03598a0a71842d4 @@ -36,8 +36,6 @@ $title = __('Add New User'); $parent_file = 'users.php'; -wp_enqueue_script('admin-users'); - require_once ('admin-header.php'); ?> @@ -69,7 +67,6 @@ ?> -
    \ No newline at end of file +?> diff -uNr a/mp-wp/wp-admin/users.php b/mp-wp/wp-admin/users.php --- a/mp-wp/wp-admin/users.php 127d96ac709e20becdc00726237152d9b09655d090a2b6c08003351bb518c58a52568a62a673dcda043916d72f59b1fcc378830a0674dc4b6ed695e3f6b93822 +++ b/mp-wp/wp-admin/users.php 4c1d067525f6c72f0bec36d0ec519f4223a7edde319209e40ed3238b72cb73d70f7830de100e0d22e7e825f2c9aeeb2170cad9d929879e0050e6234b747a5f45 @@ -20,7 +20,7 @@ $update = $doaction = ''; if ( isset($_REQUEST['action']) ) - $doaction = $_REQUEST['action'] ? $_REQUEST['action'] : $_REQUEST['action2']; + $doaction = $_REQUEST['action']; if ( empty($doaction) ) { if ( isset($_GET['changeit']) && !empty($_GET['new_role']) ) @@ -185,8 +185,6 @@ exit; } - wp_enqueue_script('admin-users'); - include('admin-header.php'); $usersearch = isset($_GET['usersearch']) ? $_GET['usersearch'] : null; @@ -340,13 +338,6 @@ - - - - - - - -
    - -results_are_paged() ) : ?> -
    page_links(); ?>
    - - -
    - - -
    - -
    -
    - diff -uNr a/mp-wp/wp-admin/widgets.php b/mp-wp/wp-admin/widgets.php --- a/mp-wp/wp-admin/widgets.php d41f6da17520e87f2974d32425467f9d417fa00230a2369b974ec198b4e1e5587e81c4a53238e9999996c303045e6df423fca0f29677e0ba385487edf787182b +++ b/mp-wp/wp-admin/widgets.php f7793e26f6609e7ebf9a4dd46054410fd648ea0f171a66dcdefb7ff3873c604f5602d8d237dd2448f56e94a140866e9b733c4e5c8cee612a6996630afd050acd @@ -15,7 +15,6 @@ if ( ! current_user_can('switch_themes') ) wp_die( __( 'Cheatin’ uh?' )); -wp_enqueue_script( array( 'wp-lists', 'admin-widgets' ) ); wp_admin_css( 'widgets' ); do_action( 'sidebar_admin_setup' ); diff -uNr a/mp-wp/wp-admin/wp-admin.css b/mp-wp/wp-admin/wp-admin.css --- a/mp-wp/wp-admin/wp-admin.css 310db6ed07d6f444552841e3bcaca5c4b8841e1488d1cb17074d3fc09e98af2a369013d7ed258ad787a7f9a519b15caea536271f06c126dad14019a170b80240 +++ b/mp-wp/wp-admin/wp-admin.css false @@ -1,2893 +0,0 @@ - -p, ul, ol, blockquote { font-size: 12px; } - -.plugins .name, -#pass-strength-result.strong, -#pass-strength-result.short, -.button-highlighted, -#quicktags #ed_strong, -#ed_reply_toolbar #ed_reply_strong { - font-weight: bold; -} - -.plugins p { - margin: 0 4px; - padding: 0; -} - -.plugins .togl { - width: 150px; -} - -.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 .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; -} - -.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, -#pagesubmitdiv 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; -} - -#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; -} - -.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, -.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; - -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: 1.2em; - -webkit-border-radius: 10px; - padding: 4px 10px; -} - -#doaction, -#doaction2 { - margin-right: 8px; -} - -.tablenav select[name="action"], -.tablenav select[name="action2"] { - width: 120px; -} - -.tablenav select[name="m"] { - width: 120px; -} - -.tablenav select#cat { - width: 150px; -} - -#wpcontent select { - font: 11px/20px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - padding: 2px; - border-width: 1px; - border-style: solid; - height: 2em; - vertical-align: top; -} - -#wpcontent option { - padding: 2px; -} - -.approve { - display: none; -} - -.unapproved .approve, .spam .approve { - display: inline; -} - -.unapproved .unapprove { - display: none; -} - -.narrow { - width: 70%; - margin-bottom: 40px; -} - -.narrow p { - line-height: 150%; -} - -table .vers { - text-align: center; -} - -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; - -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.svg"); - background-position: left top; - background-repeat: repeat-x; -} - -#quicktags #ed_toolbar { - padding: 2px 4px 0; -} - -#ed_toolbar input { - margin: 3px 1px 4px; - line-height: 18px; - display: inline-block; - border-width: 1px; - border-style: solid; - min-width: 26px; - padding: 2px 4px; - font-size: 12px; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -#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%; -} - -/* post meta postbox */ -#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, -#pagecustomdiv #postcustomstuff .submit { - border: 0 none; - float: none; - padding: 5px 8px; -} - -#side-sortables #postcustom #postcustomstuff .submit, -#side-sortables #pagecustomdiv #postcustomstuff .submit { - padding: 0 5px; -} - -#side-sortables #postcustom #postcustomstuff td.left input, -#side-sortables #pagecustomdiv #postcustomstuff td.left input { - margin: 3px 3px 0; -} - -#side-sortables #postcustom #postcustomstuff #the-list textarea, -#side-sortables #pagecustomdiv #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; -} - -/* 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; -} - -* html #themeselect { - padding: 0 3px; - height: 22px; -} - -#your-profile legend { - font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - font-size: 22px; -} - -#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; -} - -.column-comment p { - margin: 0.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 { - vertical-align: middle; - text-align: center; - width: 80px; -} - -td.media-icon img { - max-width: 80px; - max-height: 60px; -} - -#update-nag, .plugin-update { - line-height: 29px; - font-size: 12px; - text-align: center; - border-bottom-width: 1px; - border-bottom-style: solid; - border-top-width: 1px; - border-top-style: solid; -} - -#update-nag a, .plugin-update a { - font-size: 1.1em; -} - -#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; -} - -/* Admin Header */ -#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 h1 span { - font-size: 50%; -} - -/* side admin menu */ -#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 { - 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 img.wp-menu-image { - float: left; - padding: 8px 6px 0; - opacity: 0.6; - filter: alpha(opacity=60); -} - -#adminmenu li.menu-top:hover img.wp-menu-image, -#adminmenu li.wp-has-current-submenu img.wp-menu-image { - opacity: 1; - filter: alpha(opacity=100); -} - -.folded #adminmenu img.wp-menu-image { - padding: 7px 0 0 6px; -} - -#adminmenu li.wp-menu-separator { - height: 21px; - padding: 0; - margin: 0; - cursor: w-resize; -} - -.folded #adminmenu li.wp-menu-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; -} -/* end side admin menu */ - -/* comments/plugins bubble in menu */ -#adminmenu #awaiting-mod, -#adminmenu span.update-plugins, -#sidemenu li a span.update-plugins { - position: absolute; - font-family: Helvetica, Arial, sans-serif; - font-size: 7pt; - font-weight: bold; - margin-top: 2px; - margin-left: 2px; - -moz-border-radius: 7px; - -khtml-border-radius: 7px; - -webkit-border-radius: 7px; - border-radius: 7px; -} - -#adminmenu li #awaiting-mod span, -#adminmenu li span.update-plugins span, -#sidemenu li a span.update-plugins span { - float: left; - display: block; - height: 1.6em; - line-height: 1.6em; - padding: 0 6px; -} - -#adminmenu li span.count-0, -#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; -} - -.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: bild; - height: 1.7em; - line-height: 1.70em; - min-width: 0.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 { - margin: 4px 0; -} - -/* Admin Footer */ -#footer { - margin-top: -45px; -} - -#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; -} - -/* Tables used on comment.php and option/setting pages */ - -.form-table { - border-collapse: collapse; - margin-top: 0.5em; - width: 100%; - margin-bottom: -8px; - clear: both; -} - -.form-table td, -#wpbody-content .describe td { - margin-bottom: 9px; - padding: 4px 10px 12px; - 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, -#wpbody-content .describe th { - vertical-align: top; - text-align: left; - padding: 10px; - width: 200px; -} - -.form-table th.th-full { - width: auto; -} - -.form-table input, -.form-table textarea, -#wpbody-content .describe input, -#wpbody-content .describe textarea { - border-width: 1px; - border-style: solid; -} - -.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: -8px 3px 8px; -} - -.form-table .color-palette td { - border-width: 1px 1px 0; - border-stile: solid solid none; - height: 10px; - line-height: 20px; - width: 10px; -} - -textarea.large-text { - width: 99%; -} - -.form-table input.regular-text { - width: 325px; -} - -.form-table input.small-text { - width: 50px; -} - -#profile-page .form-table textarea { - width: 500px; - margin-bottom: 6px; -} - -#profile-page .form-table input[type=text] { - width: 300px; -} - -.form-table .pre { - padding: 8px; - margin: 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+ */ -} - -table.form-table td .updated { - font-size: 13px; -} - -/* divs for cats and tags pages */ - -.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%; -} - -.form-wrap p { - margin: 2px 0 5px; -} - -.setting-description, .form-wrap p { - 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; -} - -.tagcloud h3 { - margin: 2px 0 12px; -} - -/* Post Screen */ -#normal-sortables { - min-height: 50px; -} - -.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 { - min-height: 300px; -} - -#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, -#side-sortables #show-comments { - display: none; -} - -#post-body #tagsdiv #newtag { - margin-right: 5px; - width: 16em; -} - -#side-info-column input#post_password { - width: 94% -} - -#side-info-column #tagsdiv #newtag { - width: 68%; -} - -#post-status-info { - font-size: 12px; - line-height: 2; - padding: 0 15px 0 7px; - border-width: 0 1px 1px; - border-style: none solid solid; - -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; -} - -#editorcontent #post-status-info { - border: none; -} - -#pagesubmitdiv div.inside, -#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: 10px; - 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; -} - -.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; -} - -.ui-sortable .postbox h3 { - cursor: pointer; - -webkit-user-select: none; - -moz-user-select: none; - -khtml-user-select: none; - user-select: none; -} - -.ui-sortable .postbox .hndle span { - padding: 6px 0; -} - -.ui-sortable .postbox .hndle { - cursor: move; -} - -.hndle a { - font-size: 11px; - font-weight: normal; -} - -.meta-box-sortables .postbox .handlediv { - float: right; - width: 23px; - height: 26px; -} - -.sortable-placeholder { - border-width: 1px; - border-style: dashed; - z-index: -1; -} - -#poststuff h3, -.metabox-holder h3 { - font-size: 12px; - font-weight: bold; - padding: 7px 9px; - margin: 0; - line-height: 1; -} - -.metabox-holder .postbox, -#poststuff .postbox, -#poststuff .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; -} - -.metabox-holder .postbox h3, -#poststuff .postbox h3, -#poststuff .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 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; -} - -#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 { - 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; - width: 100%; - outline: none; -} - -#poststuff .inside-submitbox, -#side-info-column .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 { - 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 0pt 0pt; - position: relative; - right: 10px; -} - -#poststuff #editor-toolbar { - height: 30px; -} - -#poststuff #edButtonPreview, -#poststuff #edButtonHTML { - display: block; - 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; -} - -#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 { - 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; -} - -/* Categories */ - -#category-adder { - margin-left: 120px; - padding: 4px 0; -} - -#category-adder h4 { - margin: 0 0 8px; -} - -#side-info-column #category-adder { - margin: 0; -} - -#post-body #category-add input, #category-add select { - width: 30%; -} - -#side-info-column #category-add input { - width: 94%; -} - -#side-info-column #category-add select { - width: 100%; -} - -#category-add input#category-add-sumbit { - width: auto; -} - -#post-body ul#category-tabs { - float: left; - width: 120px; - text-align: right; - /* Negative margin for the sake of those without JS: all tabs display */ - margin: 0 -120px 0 0; - padding: 0; -} - -#post-body ul#category-tabs li { - padding: 8px; -} - -#post-body ul#category-tabs li.ui-tabs-selected { - -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.ui-tabs-selected a { - font-weight: bold; - text-decoration: none; -} - -#categorydiv div.ui-tabs-panel, -#linkcategorydiv div.ui-tabs-panel { - height: 150px; - overflow: auto; - padding: 0.5em 0.9em; -} - -#post-body #categorydiv div.ui-tabs-panel, -#post-body #linkcategorydiv div.ui-tabs-panel { - margin: 0 5px 0 120px; - height: 10em; - overflow: auto; - border-width: 4px; - border-style: solid; -} - -#side-info-column #category-tabs li { - display: inline; - padding-right: 8px; -} - -#side-info-column #category-tabs a { - text-decoration: none; -} - -#side-info-column #category-tabs { - margin-bottom: 3px; -} - -#categorydiv ul, -#linkcategorydiv ul { - list-style: none; - padding: 0; - margin: 0; -} - -#categorydiv ul.categorychecklist ul, -#linkcategorydiv ul.categorychecklist ul { - margin-left: 18px; -} - -ul.categorychecklist li { - margin: 0; - padding: 0; - line-height: 19px; -} - -/* positioning etc. */ - -form#tags-filter { - position: relative; -} - -p.search-box { - float: right; - margin: -5px 0 0; -} - -.search-input { - border-width: 1px; - border-style: solid; - padding: 2px; -} - -#posts-filter fieldset { - float: left; - margin: 0 1.5ex 1em 0; - padding: 0; -} - -#posts-filter fieldset legend { - padding: 0 0 .2em 1px; -} - -.bordertitle { - padding-bottom: 5px; - border-bottom-width: 1px; - border-bottom-style: solid; -} - -/* Edit posts */ - -td.post-title strong { - display: block; - margin-bottom: .2em; -} - -td.post-title p { - margin: 6px 0; -} - -/* Global classes */ - -.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; -} - -.tablenav .delete { - margin-right: 20px; -} - -td.action-links, th.action-links { - text-align: right; -} - -/* Diff */ - -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; -} - -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: 20px; - padding: 0; -} - -#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; -} - -/* media popup 0819 */ -#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; -} - -/* reply to comments */ -#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, -#commentstatusdiv img.waiting { - padding: 0 10px; - vertical-align: top; -} - -#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; -} - -#replyrow #ed_reply_toolbar input { - margin: 1px 2px 1px 1px; - min-width: 24px; - padding: 3px 4px; - font-size: 11px; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -/* show/hide settings */ - -#screen-meta { - position: relative; - clear: both; -} - -#screen-meta-links { - margin: 0 9px 0 0; -} - -#screen-meta .invisible { - visibility: hidden; -} - -#screen-options-link-wrap, -#contextual-help-link-wrap { - float: right; - background: transparent url( images/screen-options-left.svg ) no-repeat 0 0; - font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif; - height: 22px; - padding: 0; - margin: 0 6px 0 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: right bottom; -} - -#screen-meta a.show-settings { - background-image: url( images/screen-options-right.svg ); -} - -#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; -} - -/* 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; -} - -#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 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: 0.5em; - margin: 0.5em 0 0; -} - -/* 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; -} - -.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; -} - -ul.cat-checklist { - height: 12em; - border-style: solid; - border-width: 1px; - overflow-y: scroll; - padding: 0 5px; - margin: 0 0 5px; -} - -#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; -} - -/* Media library */ -#wpbody-content #media-items .describe { - border-collapse: collapse; - width: 100%; - border-top-style: solid; - border-top-width: 1px; - clear: both; - cursor: default; - padding: 5px; - width: 100%; -} - -#wpbody-content .describe .media-item-info tr { - background-color: transparent; -} - -#wpbody-content .filename { - margin-left: 10px; -} - -#wpbody-content .media-item .thumbnail { - max-height: 128px; - max-width: 128px; -} - -#wpbody-content .media-upload-form label { - display: block; - font-size: 13px; - margin: 0.5em; -} - -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; -} - -.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-items { - border-style: solid solid none; - border-width: 1px; - width: 670px; -} - -#wpbody-content #media-items .filename { - float: left; - line-height: 36px; - margin-left: 10px; - max-width: 430px; - overflow: hidden; -} - -.media-item .pinkynail { - float: left; - height: 32px; - margin: 2px; - max-width: 40px; - max-height: 40px; -} - -.media-item .startopen, -.media-item .startclosed { - display: none; -} - -/* find posts */ -.find-box { - width: 400px; - height: 250px; - overflow: hidden; - padding: 33px 5px 50px; - 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: 8px 0 0 8px; - width: 15px; -} - -.find-box-buttons { - bottom: 12px; - left: 12px; - position: absolute; -} - -.find-box-search label { - padding-right: 6px; -} - -/* favorite-actions */ -#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 0 0 0px; - padding: 0 1px 6px 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 { - background-image: url(images/fav-top.svg); - background-repeat: repeat-x; - background-position: 0 top; - -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-width: 1px; - border-bottom-style: solid; -} - -#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; -} - -#tagsdiv #the-tagcloud { - margin: 5px 5px 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 column width */ -table.fixed { - table-layout: fixed; -} - -.fixed .column-date, -.fixed .column-parent, -.fixed .column-visible, -.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; -} - -.fixed .column-slug { - width: 25%; -} - -.fixed .column-posts { - width: 10%; -} - -.fixed .column-icon { - width: 80px; -} - -#commentstatusdiv .fixed .column-author, -#comments-form .fixed .column-author, -#commentstatusdiv .fixed .column-date { - width: 20%; -} - -.widefat th, -.widefat td { - overflow: hidden; -} - -.widefat th { - text-shadow: rgba(255,255,255,0.8) 0 1px 0; -} - -.icon32 { - float: left; - height: 36px; - margin: 14px 6px 0 0; - width: 36px; -} - -.key-labels label { - line-height: 24px; -} - -.subtitle { - font-size: 0.75em; - line-height: 1; - padding-left: 25px; -} diff -uNr a/mp-wp/wp-content/plugins/footnotes.php b/mp-wp/wp-content/plugins/footnotes.php --- a/mp-wp/wp-content/plugins/footnotes.php 5f8bedbdaf66b24223d250d56acc0050ad7df6b7abade9d7834e835142ec46a5baff035c48fece400e10db78116d2af885d2ebfb8522f4ffcee876d58a0969a3 +++ b/mp-wp/wp-content/plugins/footnotes.php 08b3ee019a622247dc87083980dc20fea7083b985094d6b5952ffa5a96f96f653e67e40edb841fde11691cf842403c1db58d3d89dab65866a6a8b947740e9d07 @@ -299,7 +299,7 @@ word-break: break-all; } span.line-added { color: green; } - span.line-removed { color:red; } + span.line-removed { color: red; } options['list_style_type'] != 'symbol'): ?> ol.footnotes li { list-style-type: options['list_style_type']; ?>; } diff -uNr a/mp-wp/wp-content/themes/classic/comments-popup.php b/mp-wp/wp-content/themes/classic/comments-popup.php --- a/mp-wp/wp-content/themes/classic/comments-popup.php 720cdb5387afd7d31abdeb5c04ee8aa5081cdd972b1349f3783a9e0a570e38057b31a9c288ddcc73b2c072061f35460e7eb159bb09df51aa2db356e408fe752b +++ b/mp-wp/wp-content/themes/classic/comments-popup.php false @@ -1,126 +0,0 @@ - - - - <?php echo get_option('blogname'); ?> - <?php echo sprintf(__("Comments on %s"), the_title('','',false)); ?> - - - - - - - -

    - - - -

    - -

    RSS feed for comments on this post."); ?>

    - -ping_status) { ?> -

    URL to TrackBack this entry is:"); ?>

    - - - - - -
      - -
    1. - -

      @

      -
    2. - - -
    - -

    - - -comment_status) { ?> -

    -

    HTML allowed:"); ?>

    - -
    - -

    '.$user_identity.''); ?>

    - -

    - - -

    - -

    - - -

    - -

    - - -

    - - -

    - -
    - -

    - -

    - - " /> - " /> -

    - ID); ?> -
    - -

    - - -
    - - -

    Sorry, no posts matched your criteria.

    - - - - -

    Powered by WordPress"),__("Powered by WordPress, state-of-the-art semantic personal publishing platform.")); ?>

    - - - - diff -uNr a/mp-wp/wp-content/themes/classic/rtl.css b/mp-wp/wp-content/themes/classic/rtl.css --- a/mp-wp/wp-content/themes/classic/rtl.css ddfdb660f9951906b3013cd103a3b0f5492587724181f20e2862eb8ff0d3671d2fb2a4c2b155b244d93bc0900fba0a953ebd1a796a4a40d96e30fe4232f03e6b +++ b/mp-wp/wp-content/themes/classic/rtl.css false @@ -1,92 +0,0 @@ -/* Based on Arabic (RTL) version of WordPress Classic theme, converted by Serdal (Serdal.com) */ - -#menu ul ul, #wp-calendar caption, #wp-calendar #prev a { text-align: right; } -#wp-calendar #next a, .feedback { text-align: left; } - -blockquote { - border-left: 0; - border-right: 5px solid #ccc; - margin-left: auto; - margin-right: 1.5em; - padding-left: 0; - padding-right: 5px; -} - -body { font-family: 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; } - -h2 { font: 95% 'Al Bayan', 'Traditional Arabic', "Times New Roman", Times, serif; } - -p, li, .feedback { - font: 90%/175% 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - text-align: justify; -} - -acronym, abbr, span.caps, h2, p, li, #header, #menu ul li, #menu ul ul li, #wp-calendar td, .feedback, .meta, .meta a { letter-spacing: normal; } - -#commentlist li ul { - border-left: 0; - border-right: 1px solid #ddd; -} - -#commentlist li .avatar { - margin-right: 0; - margin-left: 12px; -} - -#commentlist li .avatar { - margin-right: 0; - margin-left: 12px; -} - -#content { - margin: 30px 3em 0 13em; - padding-right: 0; - padding-left: 60px; -} - -#header { - border-left: solid 1px #9a9; - border-right: solid 1px #565; - font: normal normal 230% 'Al Bayan', 'Traditional Arabic', 'Times New Roman', Times, serif; - padding: 15px 60px 15px 10px; -} - -#menu { - border-left: 0; - border-right: 1px dotted #ccc; - padding: 20px 30px 10px 0; - right: auto; - left: 2px; -} - -#menu form { margin: 0 13px 0 0; } - -#menu ul { - padding-left: 0; - padding-right: 3px; -} - -#menu ul li { font: normal normal 110% 'Geeza Pro', Tahoma, 'Times New Roman', Times, serif; } - -#menu ul ul li { - font: normal normal 12px/115% 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; - padding-left: 0; - padding-right: 12px; -} - -#menu ul ul ul.children { - padding-left: 0; - padding-right: 4px; -} - -#wp-calendar #next a { - padding-right: 0; - padding-left: 10px; -} - -#wp-calendar #prev a { - padding-left: 0; - padding-right: 10px; -} - -#wp-calendar td { font: normal normal 12px 'Geeza Pro', Tahoma, 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif; } diff -uNr a/mp-wp/wp-content/themes/classic/style.css b/mp-wp/wp-content/themes/classic/style.css --- a/mp-wp/wp-content/themes/classic/style.css d5961fa49353447e5065c12d322083faab1bfb4744d8e6eeee4fb12bf1b883debfc83cd303c8dd9c1551b7cd7d45e75087349dd6d14e3426be8dc8b692fdcddd +++ b/mp-wp/wp-content/themes/classic/style.css 52aa1fd09b41d5618edaac4b1d38243a7eb6265324246745dc7c88155cfa2d31bd64284b2a2f8129aab9a85c0878a238023d98c79b05037d1001b8a49d3e0a83 @@ -29,7 +29,7 @@ } acronym, abbr { - border-bottom: 1px dashed #333; + border-bottom: 1px dashed #303434; } acronym, abbr, span.caps { @@ -146,7 +146,7 @@ #commentform #author, #commentform #email, #commentform #url, #commentform textarea { background: #fff; - border: 1px solid #333; + border: 1px solid #303434; padding: .2em; } @@ -289,7 +289,7 @@ #wp-calendar a:hover { background: #e0e6e0; - color: #333; + color: #303434; } #wp-calendar caption { @@ -343,7 +343,6 @@ padding-top: 4px; margin: 10px; -moz-border-radius: 3px; - -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } diff -uNr a/mp-wp/wp-content/themes/default/comments-popup.php b/mp-wp/wp-content/themes/default/comments-popup.php --- a/mp-wp/wp-content/themes/default/comments-popup.php 10367854b5e3954b6e037469e5fece559a76ed62d0f13ae8f1662264b257dff416a111ecd9cefdea99209f655b5cce3f318c679ce143993b2ed271776823e300 +++ b/mp-wp/wp-content/themes/default/comments-popup.php false @@ -1,126 +0,0 @@ - - - - <?php echo get_option('blogname'); ?> - Comments on <?php the_title(); ?> - - - - - - - -

    - - -

    Comments

    - -

    RSS feed for comments on this post.

    - -ping_status) { ?> -

    The URL to TrackBack this entry is:

    - - - - - -
      - -
    1. - -

      by @

      -
    2. - - -
    - -

    No comments yet.

    - - -comment_status) { ?> -

    Leave a comment

    -

    Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:

    - -
    - -

    Logged in as . Log out »

    - - -

    - - -

    - -

    - - -

    - -

    - - -

    - - -

    - -
    - -

    - -

    - - " /> - " /> - -

    - ID); ?> -
    - -

    Sorry, the comment form is closed at this time.

    - - - - - -

    Sorry, no posts matched your criteria.

    - - - -

    Powered by WordPress

    - - - - diff -uNr a/mp-wp/wp-content/themes/default/functions.php b/mp-wp/wp-content/themes/default/functions.php --- a/mp-wp/wp-content/themes/default/functions.php 6399a2b7affebc933cdbbe699a806131411ed87dd6509b6ad68a679130b78f32aa628bc8045d95c7edcf7a3ca9217aa048f703fbed526c13f29070fc5dc5e0bb +++ b/mp-wp/wp-content/themes/default/functions.php d998fa47a199b7d39163b5a076de094d21e4074bb82830150103882127ad4a347040e6855d4f501763fa2db7086aff7d4616ce6871e411eaf8444ef79aedf145 @@ -11,412 +11,4 @@ 'before_title' => '

    ', 'after_title' => '

    ', )); - -/** @ignore */ -function kubrick_head() { - $head = "\n"; - if ( '' != $output ) - echo $head . $output . $foot; -} - -add_action('wp_head', 'kubrick_head'); - -function kubrick_header_image() { - return apply_filters('kubrick_header_image', get_option('kubrick_header_image')); -} - -function kubrick_upper_color() { - if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { - parse_str(substr($url, strpos($url, '?') + 1), $q); - return $q['upper']; - } else - return '69aee7'; -} - -function kubrick_lower_color() { - if (strpos($url = kubrick_header_image_url(), 'header-img.php?') !== false) { - parse_str(substr($url, strpos($url, '?') + 1), $q); - return $q['lower']; - } else - return '4180b6'; -} - -function kubrick_header_image_url() { - if ( $image = kubrick_header_image() ) - $url = get_template_directory_uri() . '/images/' . $image; - else - $url = get_template_directory_uri() . '/images/kubrickheader.svg'; - - return $url; -} - -function kubrick_header_color() { - return apply_filters('kubrick_header_color', get_option('kubrick_header_color')); -} - -function kubrick_header_color_string() { - $color = kubrick_header_color(); - if ( false === $color ) - return 'white'; - - return $color; -} - -function kubrick_header_display() { - return apply_filters('kubrick_header_display', get_option('kubrick_header_display')); -} - -function kubrick_header_display_string() { - $display = kubrick_header_display(); - return $display ? $display : 'inline'; -} - -add_action('admin_menu', 'kubrick_add_theme_page'); - -function kubrick_add_theme_page() { - if ( isset( $_GET['page'] ) && $_GET['page'] == basename(__FILE__) ) { - if ( isset( $_REQUEST['action'] ) && 'save' == $_REQUEST['action'] ) { - check_admin_referer('kubrick-header'); - if ( isset($_REQUEST['njform']) ) { - if ( isset($_REQUEST['defaults']) ) { - delete_option('kubrick_header_image'); - delete_option('kubrick_header_color'); - delete_option('kubrick_header_display'); - } else { - if ( '' == $_REQUEST['njfontcolor'] ) - delete_option('kubrick_header_color'); - else { - $fontcolor = preg_replace('/^.*(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['njfontcolor']); - update_option('kubrick_header_color', $fontcolor); - } - if ( preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njuppercolor'], $uc) && preg_match('/[0-9A-F]{6}|[0-9A-F]{3}/i', $_REQUEST['njlowercolor'], $lc) ) { - $uc = ( strlen($uc[0]) == 3 ) ? $uc[0]{0}.$uc[0]{0}.$uc[0]{1}.$uc[0]{1}.$uc[0]{2}.$uc[0]{2} : $uc[0]; - $lc = ( strlen($lc[0]) == 3 ) ? $lc[0]{0}.$lc[0]{0}.$lc[0]{1}.$lc[0]{1}.$lc[0]{2}.$lc[0]{2} : $lc[0]; - update_option('kubrick_header_image', "header-img.php?upper=$uc&lower=$lc"); - } - - if ( isset($_REQUEST['toggledisplay']) ) { - if ( false === get_option('kubrick_header_display') ) - update_option('kubrick_header_display', 'none'); - else - delete_option('kubrick_header_display'); - } - } - } else { - - if ( isset($_REQUEST['headerimage']) ) { - check_admin_referer('kubrick-header'); - if ( '' == $_REQUEST['headerimage'] ) - delete_option('kubrick_header_image'); - else { - $headerimage = preg_replace('/^.*?(header-img.php\?upper=[0-9a-fA-F]{6}&lower=[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['headerimage']); - update_option('kubrick_header_image', $headerimage); - } - } - - if ( isset($_REQUEST['fontcolor']) ) { - check_admin_referer('kubrick-header'); - if ( '' == $_REQUEST['fontcolor'] ) - delete_option('kubrick_header_color'); - else { - $fontcolor = preg_replace('/^.*?(#[0-9a-fA-F]{6})?.*$/', '$1', $_REQUEST['fontcolor']); - update_option('kubrick_header_color', $fontcolor); - } - } - - if ( isset($_REQUEST['fontdisplay']) ) { - check_admin_referer('kubrick-header'); - if ( '' == $_REQUEST['fontdisplay'] || 'inline' == $_REQUEST['fontdisplay'] ) - delete_option('kubrick_header_display'); - else - update_option('kubrick_header_display', 'none'); - } - } - //print_r($_REQUEST); - wp_redirect("themes.php?page=functions.php&saved=true"); - die; - } - add_action('admin_head', 'kubrick_theme_page_head'); - } - add_theme_page(__('Customize Header'), __('Header Image and Color'), 'edit_themes', basename(__FILE__), 'kubrick_theme_page'); -} - -function kubrick_theme_page_head() { ?> - - - -

    '.__('Options saved.').'

    '; -?> -
    -

    -
    -
    - -
    -
    -
    -
    - -
    - red', '#FF0000', 'rgb(255, 0, 0)'); ?>
    - #FF0000', '#F00'); ?>
    - #FF0000', '#F00'); ?>
    - - - - - - -
    -
    -
    -
    - - - - - - - - - - - - -

    -
    - -
    - -
    -
    -
    -
    - diff -uNr a/mp-wp/wp-content/themes/default/header.php b/mp-wp/wp-content/themes/default/header.php --- a/mp-wp/wp-content/themes/default/header.php d8c5832d830dc1068bacc857351d3de47daede54ee76b0ba9851a980fb0d2d3ff36c6fbf1b52d2296325554aba8c1261440174e99567dcf2058cb57d4e00cdc6 +++ b/mp-wp/wp-content/themes/default/header.php 7efda3833c4bb2987be5ae7bb9a616215f59fdda921920a8628c97bfb739a9ea04870562d2e8f2ec62a1c9fc4974d5004e83af0c1774a0d437946ff93c249b5f @@ -30,8 +30,6 @@ - - diff -uNr a/mp-wp/wp-content/themes/default/images/kubrickbg-rtl.svg b/mp-wp/wp-content/themes/default/images/kubrickbg-rtl.svg --- a/mp-wp/wp-content/themes/default/images/kubrickbg-rtl.svg 10533980dad27b77d98221b59719423ce5a89ee5c6d85548de582284e4363b0a3ed1c59bca93471bee5daee76ddb3ad01805fe86713a2e8edde342b67e411d25 +++ b/mp-wp/wp-content/themes/default/images/kubrickbg-rtl.svg false @@ -1,35 +0,0 @@ - - - diff -uNr a/mp-wp/wp-content/themes/default/rtl.css b/mp-wp/wp-content/themes/default/rtl.css --- a/mp-wp/wp-content/themes/default/rtl.css cdc85a8b49d2d936a612b38975c9aec8794f5f64783abe1e85ef8583aaa77ebc11cf08ed2f634fe7d134d87e9b51eda5e940a18c8b3a98a37f688a20ce38468a +++ b/mp-wp/wp-content/themes/default/rtl.css false @@ -1,106 +0,0 @@ -/* -Theme name: WordPress Default - kubrick - -Editors: Navid Kashani -Persian Wordpress Project : wp-persian.com -*/ -body, .commentlist li, #commentform input, #commentform textarea, #commentform p, #sidebar, #wp-calendar caption { - font-family:tahoma, arial; -} -#page { - text-align:right; - direction:rtl; -} -h1, h2, h3, #sidebar h2 { - font-family:arial, tahoma; -} -.commentlist li .avatar { - float:left; -} -#header { - margin:0 1px 0 0; -} -.narrowcolumn { - float:right; - padding: 0 45px 20px 0; -} -.widecolumn { - margin: 5px 150px 0 0; -} -.widecolumn .smallattachment { - margin: 5px 0 5px 5px; -} -.postmetadata { - clear:right; -} -#sidebar { - margin-left: 0; - margin-right: 545px; -} -img.alignright { - margin: 0 7px 2px 0; -} - -img.alignleft { - margin: 0 0 2px 7px; -} - -.alignright { - float: left; -} - -.alignleft { - float: right; -} -code { - display:block; - direction:ltr; - text-align:left; -} -acronym, abbr, span.caps { - letter-spacing:0; /* fix opera bug */ -} -html>body .entry ul { - padding:0 10px 0 0; - text-indent:10px; -} -html>body .entry li { - margin: 7px 10px 8px 0; -} -.entry ol { - padding: 0 35px 0 0; -} -#sidebar ul ul, #sidebar ul ol { - margin: 5px 10px 0 0; -} -#sidebar ul ul ul, #sidebar ul ol { - margin: 0 10px 0 0; -} -#commentform input { - margin: 5px 0 1px 5px; -} -#commentform #submit { - float:left; -} -.commentlist p { - margin: 10px 0 10px 5px; -} -#wp-calendar #next a { - padding-right:0; - padding-left:10px; - text-align:left; -} -#wp-calendar #prev a { - padding-left:0; - padding-right:10px; - text-align:right; -} -blockquote { - margin: 15px 10px 0 30px; - padding-left: 0; - padding-right: 20px; - border-left: 0 none; - border-right: 5px solid #ddd; -} -#email, #url { - direction:ltr; -} \ No newline at end of file diff -uNr a/mp-wp/wp-content/themes/default/style.css b/mp-wp/wp-content/themes/default/style.css --- a/mp-wp/wp-content/themes/default/style.css 06218a0bbac6ad5ed2f6cc2ea3855f98eae264bbceddcbd02ce0ec6f2322ce2ff296ec351ffa7795eef87bf994c60452bfe6446533bdad10a85e5ad8e82a1aee +++ b/mp-wp/wp-content/themes/default/style.css cfd881d2767493dbd09171bf2992e7dc3a3a739f3d45d437d48603dcecf776a9f8d70e8011f6ce86dc022b0f8149380f7eee76e998d32319df57c4af0fd2f5c3 @@ -25,7 +25,7 @@ font-size: 62.5%; /* Resets 1em to 10px */ font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; background: #d5d6d7 url('images/kubrickbgcolor.svg'); - color: #333; + color: #303434; text-align: center; } @@ -129,7 +129,7 @@ } h2, h2 a, h2 a:visited, h3, h3 a, h3 a:visited { - color: #333; + color: #303434; } h2, h2 a, h2 a:hover, h2 a:visited, h3, h3 a, h3 a:hover, h3 a:visited, #sidebar h2, #wp-calendar caption, cite { @@ -680,7 +680,6 @@ padding-top: 4px; margin: 10px; -moz-border-radius: 3px; - -khtml-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; } diff -uNr a/mp-wp/wp-includes/class.wp-scripts.php b/mp-wp/wp-includes/class.wp-scripts.php --- a/mp-wp/wp-includes/class.wp-scripts.php d95199605a8ed528631af9f91d17bb3a20dcdb9c9b8bae0b0df224db9d8f4f400971e4f1e0e90d9e35d2b5673ab47122d3487463b31003c4ad826125873eb33f +++ b/mp-wp/wp-includes/class.wp-scripts.php false @@ -1,110 +0,0 @@ -do_items( $handles ); - } - - function print_scripts_l10n( $handle ) { - if ( empty($this->registered[$handle]->extra['l10n']) || empty($this->registered[$handle]->extra['l10n'][0]) || !is_array($this->registered[$handle]->extra['l10n'][1]) ) - return false; - - $object_name = $this->registered[$handle]->extra['l10n'][0]; - - echo "\n"; - - return true; - } - - function do_item( $handle ) { - if ( !parent::do_item($handle) ) - return false; - - $ver = $this->registered[$handle]->ver ? $this->registered[$handle]->ver : $this->default_version; - if ( isset($this->args[$handle]) ) - $ver .= '&' . $this->args[$handle]; - - $src = $this->registered[$handle]->src; - if ( !preg_match('|^https?://|', $src) && !preg_match('|^' . preg_quote(WP_CONTENT_URL) . '|', $src) ) { - $src = $this->base_url . $src; - } - - $src = add_query_arg('ver', $ver, $src); - $src = clean_url(apply_filters( 'script_loader_src', $src, $handle )); - - $this->print_scripts_l10n( $handle ); - - echo "\n"; - - return true; - } - - /** - * Localizes a script - * - * 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 - * @return bool Successful localization - */ - function localize( $handle, $object_name, $l10n ) { - if ( !$object_name || !$l10n ) - return false; - return $this->add_data( $handle, 'l10n', array( $object_name, $l10n ) ); - } - - function all_deps( $handles, $recursion = false ) { - $r = parent::all_deps( $handles, $recursion ); - if ( !$recursion ) - $this->to_do = apply_filters( 'print_scripts_array', $this->to_do ); - return $r; - } -} diff -uNr a/mp-wp/wp-includes/class.wp-styles.php b/mp-wp/wp-includes/class.wp-styles.php --- a/mp-wp/wp-includes/class.wp-styles.php 231dfac3cb1f3e6310de2886569510da3ad4c66d07975bb49e0e98747e8719e409bec7a52240b8bb5aee0c50c24e0003da7da77938772e658f3ee70f93a03bf2 +++ b/mp-wp/wp-includes/class.wp-styles.php 697d491af70103f46e6d4fae81eeea4c9ce84c076dc7ed993825484157956e52b484d07fb153da5713775bc6f03334c48b3c5f482d1ed36a8d5986c62481fa94 @@ -58,12 +58,6 @@ echo $end_cond; - // Could do something with $this->registered[$handle]->extra here to print out extra CSS rules -// echo "\n"; - return true; } diff -uNr a/mp-wp/wp-includes/classes.php b/mp-wp/wp-includes/classes.php --- a/mp-wp/wp-includes/classes.php 42a3d6baf466d997f62b27bd07f1dce43b164e39091cb05cfc9ecf20e5da094ebf46f4f297da4040e2b3df352ca36d45537eb7f5baa96758cb3773a7e9d40bd7 +++ b/mp-wp/wp-includes/classes.php 400e9fa6918eb20554548892fe6ada0940a73b906cff113644fe48c40c349430d258b06fd3d232405558874c67b09de631d9d56740c931a7e5c0a37463e7687a @@ -1444,140 +1444,4 @@ } } -/** - * 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 .= "get_error_message($code) . "]]>"; - 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 .= ""; - - if ( is_scalar($error_data) ) { - $response .= ""; - } elseif ( is_array($error_data) ) { - foreach ( $error_data as $k => $v ) - $response .= "<$k>"; - } - - $response .= ""; - } - } else { - $response = ""; - } - - $s = ''; - if ( is_array($supplemental) ) { - foreach ( $supplemental as $k => $v ) - $s .= "<$k>"; - $s = "$s"; - } - - if ( false === $action ) - $action = $_POST['action']; - - $x = ''; - $x .= ""; // 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 .= ""; - $x .= ""; - - $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 ""; - foreach ( (array) $this->responses as $response ) - echo $response; - echo ''; - die(); - } -} - ?> diff -uNr a/mp-wp/wp-includes/comment-template.php b/mp-wp/wp-includes/comment-template.php --- a/mp-wp/wp-includes/comment-template.php 024eb09a7a1a5ca5f6b74d2b79c670a866817a4d3433c6d6fc3c439d91f4df5bc1b0de26c63b6dca5d7fc91fc6f2868db42451af38778ffdd0943974a025ead2 +++ b/mp-wp/wp-includes/comment-template.php 00ecf9abe29f093f2e0f902bbd56b4a039e4b1ee79f81bc9014a0bcd5e1ead803fdbff57ef81c0634a2d37396dcbeffc157665cf9ac6fcd0e8c03959060d6016 @@ -717,7 +717,7 @@ echo ' dc:identifier="'; the_permalink(); echo '"'."\n"; - echo ' dc:title="'.str_replace('--', '--', wptexturize(strip_tags(get_the_title()))).'"'."\n"; + echo ' dc:title="'.str_replace('--', '--', strip_tags(get_the_title())).'"'."\n"; echo ' trackback:ping="'.get_trackback_url().'"'." />\n"; echo ''; } @@ -861,37 +861,6 @@ } /** - * Displays the JS popup script to show a comment. - * - * If the $file parameter is empty, then the home page is assumed. The defaults - * for the window are 400px by 400px. - * - * For the comment link popup to work, this function has to be called or the - * normal comment link will be assumed. - * - * @since 0.71 - * @global string $wpcommentspopupfile The URL to use for the popup window - * @global int $wpcommentsjavascript Whether to use JavaScript or not. Set when function is called - * - * @param int $width Optional. The width of the popup window - * @param int $height Optional. The height of the popup window - * @param string $file Optional. Sets the location of the popup window - */ -function comments_popup_script($width=400, $height=400, $file='') { - global $wpcommentspopupfile, $wpcommentsjavascript; - - if (empty ($file)) { - $wpcommentspopupfile = ''; // Use the index. - } else { - $wpcommentspopupfile = $file; - } - - $wpcommentsjavascript = 1; - $javascript = "\n"; - echo $javascript; -} - -/** * Displays the link to the comments popup window for the current post ID. * * Is not meant to be displayed on single posts and pages. Should be used on the @@ -899,8 +868,6 @@ * * @since 0.71 * @uses $id - * @uses $wpcommentspopupfile - * @uses $wpcommentsjavascript * @uses $post * * @param string $zero The string to display when no comments @@ -911,7 +878,7 @@ * @return null Returns null on single posts and pages. */ function comments_popup_link( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $css_class = '', $none = 'Comments Off' ) { - global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post; + global $id, $post; if ( is_single() || is_page() ) return; @@ -929,20 +896,11 @@ } echo '' . $login_text . ''; else // Removed rel="nofollow" from here - $link = "comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text"; + $link = "comment_ID ) ) . "#" . $respond_id . "'>$reply_text"; return apply_filters('comment_reply_link', $before . $link . $after, $args, $comment, $post); } @@ -1052,7 +1010,7 @@ $link = '' . $login_text . ''; } else { // Removed rel="nofollow" from here - $link = "$reply_text"; + $link = "$reply_text"; } return apply_filters('post_comments_link', $before . $link . $after, $post); } diff -uNr a/mp-wp/wp-includes/default-filters.php b/mp-wp/wp-includes/default-filters.php --- a/mp-wp/wp-includes/default-filters.php 5daadbb5362bff123f3858e455008789291800b0066f27ee232320298278f4acab93b2b03ccf39704c5b953e8e7dd8e5d382dc7866c6007825af3bdd5db5c6af +++ b/mp-wp/wp-includes/default-filters.php 4116301a0a0e3f25d1ac59e4612bc2f4566ce7b46d5d2541633e7344b8070bd74d3552104a141ab53e547b23b4bef1385bb9181701d2d9a333dc11facd1907ab @@ -78,7 +78,6 @@ $filters = array('comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title'); foreach ( $filters as $filter ) { - add_filter($filter, 'wptexturize'); add_filter($filter, 'convert_chars'); add_filter($filter, 'wp_specialchars'); } @@ -86,7 +85,6 @@ // Format text area for display. $filters = array('term_description'); foreach ( $filters as $filter ) { - add_filter($filter, 'wptexturize'); add_filter($filter, 'convert_chars'); add_filter($filter, 'wpautop'); } @@ -98,23 +96,19 @@ } // Display filters -add_filter('the_title', 'wptexturize'); add_filter('the_title', 'convert_chars'); add_filter('the_title', 'trim'); -add_filter('the_content', 'wptexturize'); add_filter('the_content', 'convert_smilies'); add_filter('the_content', 'convert_chars'); add_filter('the_content', 'wpautop'); add_filter('the_content', 'prepend_attachment'); -add_filter('the_excerpt', 'wptexturize'); add_filter('the_excerpt', 'convert_smilies'); add_filter('the_excerpt', 'convert_chars'); add_filter('the_excerpt', 'wpautop'); add_filter('get_the_excerpt', 'wp_trim_excerpt'); -add_filter('comment_text', 'wptexturize'); add_filter('comment_text', 'convert_chars'); add_filter('comment_text', 'make_clickable', 9); add_filter('comment_text', 'force_balance_tags', 25); @@ -123,9 +117,6 @@ 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); // RSS filters @@ -169,7 +160,6 @@ add_action('publish_future_post', 'check_and_publish_future_post', 10, 1); add_action('wp_head', 'noindex', 1); add_action('wp_head', 'wp_print_styles', 9); -add_action('wp_head', 'wp_print_scripts'); add_action('wp_head', 'wp_generator'); if(!defined('DOING_CRON')) add_action('init', 'wp_cron'); @@ -180,7 +170,6 @@ add_action('do_pings', 'do_all_pings', 10, 1); add_action('do_robots', 'do_robots'); add_action('sanitize_comment_cookies', 'sanitize_comment_cookies'); -add_action('admin_print_scripts', 'wp_print_scripts', 20); add_action('admin_print_styles', 'wp_print_styles', 20); add_action('init', 'smilies_init', 5); add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); diff -uNr a/mp-wp/wp-includes/deprecated.php b/mp-wp/wp-includes/deprecated.php --- a/mp-wp/wp-includes/deprecated.php 70f855dacd4c0cb42bf3987c348d079b8959698f44d25235d47610d5eefc8e46959451715e67e608982be91c9452002a349a3c7c235e8491e8da04997d51452c +++ b/mp-wp/wp-includes/deprecated.php 8ead6036ead04f82727e836bde5d5a26fff8dc44e78e2e18d1ef47d02b36fe7ea4de29917d11334b4ce0c3ab220842ca967e69cef5bfe5a6f3641a7e4c68bb0a @@ -79,572 +79,6 @@ */ /** - * Entire Post data. - * - * @since 0.71 - * @deprecated Use get_post() - * @see get_post() - * - * @param int $postid - * @return array - */ -function get_postdata($postid) { - _deprecated_function(__FUNCTION__, '0.0', 'get_post()'); - - $post = &get_post($postid); - - $postdata = array ( - 'ID' => $post->ID, - 'Author_ID' => $post->post_author, - 'Date' => $post->post_date, - 'Content' => $post->post_content, - 'Excerpt' => $post->post_excerpt, - 'Title' => $post->post_title, - 'Category' => $post->post_category, - 'post_status' => $post->post_status, - 'comment_status' => $post->comment_status, - 'ping_status' => $post->ping_status, - 'post_password' => $post->post_password, - 'to_ping' => $post->to_ping, - 'pinged' => $post->pinged, - 'post_type' => $post->post_type, - 'post_name' => $post->post_name - ); - - return $postdata; -} - -/** - * Sets up the WordPress Loop. - * - * @since 1.0.1 - * @deprecated Since 1.5 - {@link http://codex.wordpress.org/The_Loop Use new WordPress Loop} - */ -function start_wp() { - global $wp_query, $post; - - _deprecated_function(__FUNCTION__, '1.5', __('new WordPress Loop') ); - - // Since the old style loop is being used, advance the query iterator here. - $wp_query->next_post(); - - setup_postdata($post); -} - -/** - * Return or Print Category ID. - * - * @since 0.71 - * @deprecated use get_the_category() - * @see get_the_category() - * - * @param bool $echo - * @return null|int - */ -function the_category_ID($echo = true) { - _deprecated_function(__FUNCTION__, '0.0', 'get_the_category()'); - - // Grab the first cat in the list. - $categories = get_the_category(); - $cat = $categories[0]->term_id; - - if ( $echo ) - echo $cat; - - return $cat; -} - -/** - * Print category with optional text before and after. - * - * @since 0.71 - * @deprecated use get_the_category_by_ID() - * @see get_the_category_by_ID() - * - * @param string $before - * @param string $after - */ -function the_category_head($before='', $after='') { - global $currentcat, $previouscat; - - _deprecated_function(__FUNCTION__, '0.0', 'get_the_category_by_ID()'); - - // Grab the first cat in the list. - $categories = get_the_category(); - $currentcat = $categories[0]->category_id; - if ( $currentcat != $previouscat ) { - echo $before; - echo get_the_category_by_ID($currentcat); - echo $after; - $previouscat = $currentcat; - } -} - -/** - * Prints link to the previous post. - * - * @since 1.5 - * @deprecated Use previous_post_link() - * @see previous_post_link() - * - * @param string $format - * @param string $previous - * @param string $title - * @param string $in_same_cat - * @param int $limitprev - * @param string $excluded_categories - */ -function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { - - _deprecated_function(__FUNCTION__, '0.0', 'previous_post_link()'); - - if ( empty($in_same_cat) || 'no' == $in_same_cat ) - $in_same_cat = false; - else - $in_same_cat = true; - - $post = get_previous_post($in_same_cat, $excluded_categories); - - if ( !$post ) - return; - - $string = ''.$previous; - if ( 'yes' == $title ) - $string .= apply_filters('the_title', $post->post_title, $post); - $string .= ''; - $format = str_replace('%', $string, $format); - echo $format; -} - -/** - * Prints link to the next post. - * - * @since 0.71 - * @deprecated Use next_post_link() - * @see next_post_link() - * - * @param string $format - * @param string $previous - * @param string $title - * @param string $in_same_cat - * @param int $limitprev - * @param string $excluded_categories - */ -function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { - _deprecated_function(__FUNCTION__, '0.0', 'next_post_link()'); - - if ( empty($in_same_cat) || 'no' == $in_same_cat ) - $in_same_cat = false; - else - $in_same_cat = true; - - $post = get_next_post($in_same_cat, $excluded_categories); - - if ( !$post ) - return; - - $string = ''.$next; - if ( 'yes' == $title ) - $string .= apply_filters('the_title', $post->post_title, $nextpost); - $string .= ''; - $format = str_replace('%', $string, $format); - echo $format; -} - -/** - * Whether user can create a post. - * - * @since 1.5 - * @deprecated Use current_user_can() - * @see current_user_can() - * - * @param int $user_id - * @param int $blog_id Not Used - * @param int $category_id Not Used - * @return bool - */ -function user_can_create_post($user_id, $blog_id = 1, $category_id = 'None') { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); - - $author_data = get_userdata($user_id); - return ($author_data->user_level > 1); -} - -/** - * Whether user can create a post. - * - * @since 1.5 - * @deprecated Use current_user_can() - * @see current_user_can() - * - * @param int $user_id - * @param int $blog_id Not Used - * @param int $category_id Not Used - * @return bool - */ -function user_can_create_draft($user_id, $blog_id = 1, $category_id = 'None') { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); - - $author_data = get_userdata($user_id); - return ($author_data->user_level >= 1); -} - -/** - * Whether user can edit a post. - * - * @since 1.5 - * @deprecated Use current_user_can() - * @see current_user_can() - * - * @param int $user_id - * @param int $post_id - * @param int $blog_id Not Used - * @return bool - */ -function user_can_edit_post($user_id, $post_id, $blog_id = 1) { - _deprecated_function(__FUNCTION__, '0', 'current_user_can()'); - - $author_data = get_userdata($user_id); - $post = get_post($post_id); - $post_author_data = get_userdata($post->post_author); - - if ( (($user_id == $post_author_data->ID) && !($post->post_status == 'publish' && $author_data->user_level < 2)) - || ($author_data->user_level > $post_author_data->user_level) - || ($author_data->user_level >= 10) ) { - return true; - } else { - return false; - } -} - -/** - * Whether user can delete a post. - * - * @since 1.5 - * @deprecated Use current_user_can() - * @see current_user_can() - * - * @param int $user_id - * @param int $post_id - * @param int $blog_id Not Used - * @return bool - */ -function user_can_delete_post($user_id, $post_id, $blog_id = 1) { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); - - // right now if one can edit, one can delete - return user_can_edit_post($user_id, $post_id, $blog_id); -} - -/** - * Whether user can set new posts' dates. - * - * @since 1.5 - * @deprecated Use current_user_can() - * @see current_user_can() - * - * @param int $user_id - * @param int $blog_id Not Used - * @param int $category_id Not Used - * @return bool - */ -function user_can_set_post_date($user_id, $blog_id = 1, $category_id = 'None') { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); - - $author_data = get_userdata($user_id); - return (($author_data->user_level > 4) && user_can_create_post($user_id, $blog_id, $category_id)); -} - -/** - * Whether user can delete a post. - * - * @since 1.5 - * @deprecated Use current_user_can() - * @see current_user_can() - * - * @param int $user_id - * @param int $post_id - * @param int $blog_id Not Used - * @return bool returns true if $user_id can edit $post_id's date - */ -function user_can_edit_post_date($user_id, $post_id, $blog_id = 1) { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); - - $author_data = get_userdata($user_id); - return (($author_data->user_level > 4) && user_can_edit_post($user_id, $post_id, $blog_id)); -} - -/** - * Whether user can delete a post. - * - * @since 1.5 - * @deprecated Use current_user_can() - * @see current_user_can() - * - * @param int $user_id - * @param int $post_id - * @param int $blog_id Not Used - * @return bool returns true if $user_id can edit $post_id's comments - */ -function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1) { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); - - // right now if one can edit a post, one can edit comments made on it - return user_can_edit_post($user_id, $post_id, $blog_id); -} - -/** - * Whether user can delete a post. - * - * @since 1.5 - * @deprecated Use current_user_can() - * @see current_user_can() - * - * @param int $user_id - * @param int $post_id - * @param int $blog_id Not Used - * @return bool returns true if $user_id can delete $post_id's comments - */ -function user_can_delete_post_comments($user_id, $post_id, $blog_id = 1) { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); - - // right now if one can edit comments, one can delete comments - return user_can_edit_post_comments($user_id, $post_id, $blog_id); -} - -/** - * Can user can edit other user. - * - * @since 1.5 - * @deprecated Use current_user_can() - * @see current_user_can() - * - * @param int $user_id - * @param int $other_user - * @return bool - */ -function user_can_edit_user($user_id, $other_user) { - _deprecated_function(__FUNCTION__, '0.0', 'current_user_can()'); - - $user = get_userdata($user_id); - $other = get_userdata($other_user); - if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID ) - return true; - else - return false; -} - -/** - * Gets the links associated with category $cat_name. - * - * @since 0.71 - * @deprecated Use get_links() - * @see get_links() - * - * @param string $cat_name Optional. The category name to use. If no match is found uses all. - * @param string $before Optional. The html to output before the link. - * @param string $after Optional. The html to output after the link. - * @param string $between Optional. The html to output between the link/image and it's description. Not used if no image or $show_images is true. - * @param bool $show_images Optional. Whether to show images (if defined). - * @param string $orderby Optional. The order to output the links. E.g. 'id', 'name', 'url', 'description' or 'rating'. Or maybe owner. - * If you start the name with an underscore the order will be reversed. You can also specify 'rand' as the order which will return links in a - * random order. - * @param bool $show_description Optional. Whether to show the description if show_images=false/not defined. - * @param bool $show_rating Optional. Show rating stars/chars. - * @param int $limit Optional. Limit to X entries. If not specified, all entries are shown. - * @param int $show_updated Optional. Whether to show last updated timestamp - */ -function get_linksbyname($cat_name = "noname", $before = '', $after = '
    ', $between = " ", $show_images = true, $orderby = 'id', - $show_description = true, $show_rating = false, - $limit = -1, $show_updated = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'get_links()'); - - $cat_id = -1; - $cat = get_term_by('name', $cat_name, 'link_category'); - if ( $cat ) - $cat_id = $cat->term_id; - - get_links($cat_id, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated); -} - -/** - * Gets the links associated with the named category. - * - * @since 1.0.1 - * @deprecated Use wp_get_links() - * @see wp_get_links() - * - * @param string $category The category to use. - * @param string $args - * @return bool|null - */ -function wp_get_linksbyname($category, $args = '') { - _deprecated_function(__FUNCTION__, '0.0', 'wp_get_links()'); - - $cat = get_term_by('name', $category, 'link_category'); - if ( !$cat ) - return false; - $cat_id = $cat->term_id; - - $args = add_query_arg('category', $cat_id, $args); - wp_get_links($args); -} - -/** - * Gets an array of link objects associated with category $cat_name. - * - * - * $links = get_linkobjectsbyname('fred'); - * foreach ($links as $link) { - * echo '
  • '.$link->link_name.'
  • '; - * } - *
    - * - * @since 1.0.1 - * @deprecated Use get_linkobjects() - * @see get_linkobjects() - * - * @param string $cat_name The category name to use. If no match is found uses all. - * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', 'description', or 'rating'. - * Or maybe owner. If you start the name with an underscore the order will be reversed. You can also - * specify 'rand' as the order which will return links in a random order. - * @param int $limit Limit to X entries. If not specified, all entries are shown. - * @return unknown - */ -function get_linkobjectsbyname($cat_name = "noname" , $orderby = 'name', $limit = -1) { - _deprecated_function(__FUNCTION__, '0.0', 'get_linkobjects()'); - - $cat_id = -1; - $cat = get_term_by('name', $cat_name, 'link_category'); - if ( $cat ) - $cat_id = $cat->term_id; - - return get_linkobjects($cat_id, $orderby, $limit); -} - -/** - * Gets an array of link objects associated with category n. - * - * Usage: - * - * $links = get_linkobjects(1); - * if ($links) { - * foreach ($links as $link) { - * echo '
  • '.$link->link_name.'
    '.$link->link_description.'
  • '; - * } - * } - *
    - * - * Fields are: - *
      - *
    1. link_id
    2. - *
    3. link_url
    4. - *
    5. link_name
    6. - *
    7. link_image
    8. - *
    9. link_target
    10. - *
    11. link_category
    12. - *
    13. link_description
    14. - *
    15. link_visible
    16. - *
    17. link_owner
    18. - *
    19. link_rating
    20. - *
    21. link_updated
    22. - *
    23. link_rel
    24. - *
    25. link_notes
    26. - *
    - * - * @since 1.0.1 - * @deprecated Use get_bookmarks() - * @see get_bookmarks() - * - * @param int $category The category to use. If no category supplied uses all - * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url', - * 'description', or 'rating'. Or maybe owner. If you start the name with an - * underscore the order will be reversed. You can also specify 'rand' as the - * order which will return links in a random order. - * @param int $limit Limit to X entries. If not specified, all entries are shown. - * @return unknown - */ -function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); - - $links = get_bookmarks("category=$category&orderby=$orderby&limit=$limit"); - - $links_array = array(); - foreach ($links as $link) - $links_array[] = $link; - - return $links_array; -} - -/** - * Gets the links associated with category 'cat_name' and display rating stars/chars. - * - * @since 0.71 - * @deprecated Use get_bookmarks() - * @see get_bookmarks() - * - * @param string $cat_name The category name to use. If no match is found uses all - * @param string $before The html to output before the link - * @param string $after The html to output after the link - * @param string $between The html to output between the link/image and it's description. Not used if no image or show_images is true - * @param bool $show_images Whether to show images (if defined). - * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url', - * 'description', or 'rating'. Or maybe owner. If you start the name with an - * underscore the order will be reversed. You can also specify 'rand' as the - * order which will return links in a random order. - * @param bool $show_description Whether to show the description if show_images=false/not defined - * @param int $limit Limit to X entries. If not specified, all entries are shown. - * @param int $show_updated Whether to show last updated timestamp - */ -function get_linksbyname_withrating($cat_name = "noname", $before = '', $after = '
    ', $between = " ", - $show_images = true, $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); - - get_linksbyname($cat_name, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); -} - -/** - * Gets the links associated with category n and display rating stars/chars. - * - * @since 0.71 - * @deprecated Use get_bookmarks() - * @see get_bookmarks() - * - * @param int $category The category to use. If no category supplied uses all - * @param string $before The html to output before the link - * @param string $after The html to output after the link - * @param string $between The html to output between the link/image and it's description. Not used if no image or show_images == true - * @param bool $show_images Whether to show images (if defined). - * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url', - * 'description', or 'rating'. Or maybe owner. If you start the name with an - * underscore the order will be reversed. You can also specify 'rand' as the - * order which will return links in a random order. - * @param bool $show_description Whether to show the description if show_images=false/not defined. - * @param string $limit Limit to X entries. If not specified, all entries are shown. - * @param int $show_updated Whether to show last updated timestamp - */ -function get_links_withrating($category = -1, $before = '', $after = '
    ', $between = " ", $show_images = true, - $orderby = 'id', $show_description = true, $limit = -1, $show_updated = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); - - get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, true, $limit, $show_updated); -} - -/** - * Gets the auto_toggle setting. - * - * @since 0.71 - * @deprecated No alternative function available - * - * @param int $id The category to get. If no category supplied uses 0 - * @return int Only returns 0. - */ -function get_autotoggle($id = 0) { - _deprecated_function(__FUNCTION__, '0.0' ); - return 0; -} - -/** * @since 0.71 * @deprecated Use wp_list_categories() * @see wp_list_categories() @@ -710,586 +144,4 @@ return wp_list_categories($r); } -/** - * @since 0.71 - * @deprecated Use wp_dropdown_categories() - * @see wp_dropdown_categories() - * - * @param int $optionall - * @param string $all - * @param string $orderby - * @param string $order - * @param int $show_last_update - * @param int $show_count - * @param int $hide_empty - * @param bool $optionnone - * @param int $selected - * @param int $exclude - * @return unknown - */ -function dropdown_cats($optionall = 1, $all = 'All', $orderby = 'ID', $order = 'asc', - $show_last_update = 0, $show_count = 0, $hide_empty = 1, $optionnone = false, - $selected = 0, $exclude = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'wp_dropdown_categories()'); - - $show_option_all = ''; - if ( $optionall ) - $show_option_all = $all; - - $show_option_none = ''; - if ( $optionnone ) - $show_option_none = __('None'); - - $vars = compact('show_option_all', 'show_option_none', 'orderby', 'order', - 'show_last_update', 'show_count', 'hide_empty', 'selected', 'exclude'); - $query = add_query_arg($vars, ''); - return wp_dropdown_categories($query); -} - -/** - * @since 1.2 - * @deprecated Use wp_list_authors() - * @see wp_list_authors() - * - * @param bool $optioncount - * @param bool $exclude_admin - * @param bool $show_fullname - * @param bool $hide_empty - * @param string $feed - * @param string $feed_image - * @return unknown - */ -function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { - _deprecated_function(__FUNCTION__, '0.0', 'wp_list_authors()'); - - $args = compact('optioncount', 'exclude_admin', 'show_fullname', 'hide_empty', 'feed', 'feed_image'); - return wp_list_authors($args); -} - -/** - * @since 1.0.1 - * @deprecated Use wp_get_post_categories() - * @see wp_get_post_categories() - * - * @param int $blogid Not Used - * @param int $post_ID - * @return unknown - */ -function wp_get_post_cats($blogid = '1', $post_ID = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'wp_get_post_categories()'); - return wp_get_post_categories($post_ID); -} - -/** - * Sets the categories that the post id belongs to. - * - * @since 1.0.1 - * @deprecated Use wp_set_post_categories() - * @see wp_set_post_categories() - * - * @param int $blogid Not used - * @param int $post_ID - * @param array $post_categories - * @return unknown - */ -function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) { - _deprecated_function(__FUNCTION__, '0.0', 'wp_set_post_categories()'); - return wp_set_post_categories($post_ID, $post_categories); -} - -/** - * @since 0.71 - * @deprecated Use wp_get_archives() - * @see wp_get_archives() - * - * @param string $type - * @param string $limit - * @param string $format - * @param string $before - * @param string $after - * @param bool $show_post_count - * @return unknown - */ -function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) { - _deprecated_function(__FUNCTION__, '0.0', 'wp_get_archives()'); - $args = compact('type', 'limit', 'format', 'before', 'after', 'show_post_count'); - return wp_get_archives($args); -} - -/** - * Returns or Prints link to the author's posts. - * - * @since 1.2 - * @deprecated Use get_author_posts_url() - * @see get_author_posts_url() - * - * @param bool $echo Optional. - * @param int $author_id Required. - * @param string $author_nicename Optional. - * @return string|null - */ -function get_author_link($echo = false, $author_id, $author_nicename = '') { - _deprecated_function(__FUNCTION__, '0.0', 'get_author_posts_url()'); - - $link = get_author_posts_url($author_id, $author_nicename); - - if ( $echo ) - echo $link; - return $link; -} - -/** - * Print list of pages based on arguments. - * - * @since 0.71 - * @deprecated Use wp_link_pages() - * @see wp_link_pages() - * - * @param string $before - * @param string $after - * @param string $next_or_number - * @param string $nextpagelink - * @param string $previouspagelink - * @param string $pagelink - * @param string $more_file - * @return string - */ -function link_pages($before='
    ', $after='
    ', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', - $pagelink='%', $more_file='') { - _deprecated_function(__FUNCTION__, '0.0', 'wp_link_pages()'); - - $args = compact('before', 'after', 'next_or_number', 'nextpagelink', 'previouspagelink', 'pagelink', 'more_file'); - return wp_link_pages($args); -} - -/** - * Get value based on option. - * - * @since 0.71 - * @deprecated Use get_option() - * @see get_option() - * - * @param string $option - * @return string - */ -function get_settings($option) { - _deprecated_function(__FUNCTION__, '0.0', 'get_option()'); - - return get_option($option); -} - -/** - * Print the permalink of the current post in the loop. - * - * @since 0.71 - * @deprecated Use the_permalink() - * @see the_permalink() - */ -function permalink_link() { - _deprecated_function(__FUNCTION__, '0.0', 'the_permalink()'); - the_permalink(); -} - -/** - * Print the permalink to the RSS feed. - * - * @since 0.71 - * @deprecated Use the_permalink_rss() - * @see the_permalink_rss() - * - * @param string $file - */ -function permalink_single_rss($deprecated = '') { - _deprecated_function(__FUNCTION__, '0.0', 'the_permalink_rss()'); - the_permalink_rss(); -} - -/** - * Gets the links associated with category. - * - * @see get_links() for argument information that can be used in $args - * @since 1.0.1 - * @deprecated Use get_bookmarks() - * @see get_bookmarks() - * - * @param string $args a query string - * @return null|string - */ -function wp_get_links($args = '') { - _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); - - if ( strpos( $args, '=' ) === false ) { - $cat_id = $args; - $args = add_query_arg( 'category', $cat_id, $args ); - } - - $defaults = array( - 'category' => -1, 'before' => '', - 'after' => '
    ', 'between' => ' ', - 'show_images' => true, 'orderby' => 'name', - 'show_description' => true, 'show_rating' => false, - 'limit' => -1, 'show_updated' => true, - 'echo' => true - ); - - $r = wp_parse_args( $args, $defaults ); - extract( $r, EXTR_SKIP ); - - return get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, $echo); -} - -/** - * Gets the links associated with category by id. - * - * @since 0.71 - * @deprecated Use get_bookmarks() - * @see get_bookmarks() - * - * @param int $category The category to use. If no category supplied uses all - * @param string $before the html to output before the link - * @param string $after the html to output after the link - * @param string $between the html to output between the link/image and its description. - * Not used if no image or show_images == true - * @param bool $show_images whether to show images (if defined). - * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url', - * 'description', or 'rating'. Or maybe owner. If you start the name with an - * underscore the order will be reversed. You can also specify 'rand' as the order - * which will return links in a random order. - * @param bool $show_description whether to show the description if show_images=false/not defined. - * @param bool $show_rating show rating stars/chars - * @param int $limit Limit to X entries. If not specified, all entries are shown. - * @param int $show_updated whether to show last updated timestamp - * @param bool $echo whether to echo the results, or return them instead - * @return null|string - */ -function get_links($category = -1, $before = '', $after = '
    ', $between = ' ', $show_images = true, $orderby = 'name', - $show_description = true, $show_rating = false, $limit = -1, $show_updated = 1, $echo = true) { - _deprecated_function(__FUNCTION__, '0.0', 'get_bookmarks()'); - - $order = 'ASC'; - if ( substr($orderby, 0, 1) == '_' ) { - $order = 'DESC'; - $orderby = substr($orderby, 1); - } - - if ( $category == -1 ) //get_bookmarks uses '' to signify all categories - $category = ''; - - $results = get_bookmarks("category=$category&orderby=$orderby&order=$order&show_updated=$show_updated&limit=$limit"); - - if ( !$results ) - return; - - $output = ''; - - foreach ( (array) $results as $row ) { - if ( !isset($row->recently_updated) ) - $row->recently_updated = false; - $output .= $before; - if ( $show_updated && $row->recently_updated ) - $output .= get_option('links_recently_updated_prepend'); - $the_link = '#'; - if ( !empty($row->link_url) ) - $the_link = clean_url($row->link_url); - $rel = $row->link_rel; - if ( '' != $rel ) - $rel = ' rel="' . $rel . '"'; - - $desc = attribute_escape(sanitize_bookmark_field('link_description', $row->link_description, $row->link_id, 'display')); - $name = attribute_escape(sanitize_bookmark_field('link_name', $row->link_name, $row->link_id, 'display')); - $title = $desc; - - if ( $show_updated ) - if (substr($row->link_updated_f, 0, 2) != '00') - $title .= ' ('.__('Last updated') . ' ' . date(get_option('links_updated_date_format'), $row->link_updated_f + (get_option('gmt_offset') * 3600)) . ')'; - - if ( '' != $title ) - $title = ' title="' . $title . '"'; - - $alt = ' alt="' . $name . '"'; - - $target = $row->link_target; - if ( '' != $target ) - $target = ' target="' . $target . '"'; - - $output .= ''; - - if ( $row->link_image != null && $show_images ) { - if ( strpos($row->link_image, 'http') !== false ) - $output .= "link_image\" $alt $title />"; - else // If it's a relative path - $output .= "link_image\" $alt $title />"; - } else { - $output .= $name; - } - - $output .= ''; - - if ( $show_updated && $row->recently_updated ) - $output .= get_option('links_recently_updated_append'); - - if ( $show_description && '' != $desc ) - $output .= $between . $desc; - - if ($show_rating) { - $output .= $between . get_linkrating($row); - } - - $output .= "$after\n"; - } // end while - - if ( !$echo ) - return $output; - echo $output; -} - -/** - * Output entire list of links by category. - * - * Output a list of all links, listed by category, using the settings in - * $wpdb->linkcategories and output it as a nested HTML unordered list. - * - * @author Dougal - * @since 1.0.1 - * @deprecated Use wp_list_bookmarks() - * @see wp_list_bookmarks() - * - * @param string $order Sort link categories by 'name' or 'id' - * @param string $$deprecated Not Used - */ -function get_links_list($order = 'name', $deprecated = '') { - _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()'); - - $order = strtolower($order); - - // Handle link category sorting - $direction = 'ASC'; - if ( '_' == substr($order,0,1) ) { - $direction = 'DESC'; - $order = substr($order,1); - } - - if ( !isset($direction) ) - $direction = ''; - - $cats = get_categories("type=link&orderby=$order&order=$direction&hierarchical=0"); - - // Display each category - if ( $cats ) { - foreach ( (array) $cats as $cat ) { - // Handle each category. - - // Display the category name - echo '
  • ' . apply_filters('link_category', $cat->name ) . "

    \n\t
      \n"; - // Call get_links() with all the appropriate params - get_links($cat->term_id, '
    • ', "
    • ", "\n", true, 'name', false); - - // Close the last category - echo "\n\t
    \n
  • \n"; - } - } -} - -/** - * Show the link to the links popup and the number of links. - * - * @author Fullo - * @link http://sprite.csr.unibo.it/fullo/ - * - * @since 0.71 - * @deprecated {@internal Use function instead is unknown}} - * - * @param string $text the text of the link - * @param int $width the width of the popup window - * @param int $height the height of the popup window - * @param string $file the page to open in the popup window - * @param bool $count the number of links in the db - */ -function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) { - _deprecated_function(__FUNCTION__, '0.0' ); - - if ( $count ) - $counts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links"); - - $javascript = ""; - $javascript .= $text; - - if ( $count ) - $javascript .= " ($counts)"; - - $javascript .= "\n\n"; - echo $javascript; -} - -/** - * @since 1.0.1 - * @deprecated Use sanitize_bookmark_field() - * @see sanitize_bookmark_field() - * - * @param object $link - * @return unknown - */ -function get_linkrating($link) { - _deprecated_function(__FUNCTION__, '0.0', 'sanitize_bookmark_field()'); - return sanitize_bookmark_field('link_rating', $link->link_rating, $link->link_id, 'display'); -} - -/** - * Gets the name of category by id. - * - * @since 0.71 - * @deprecated Use get_category() - * @see get_category() - * - * @param int $id The category to get. If no category supplied uses 0 - * @return string - */ -function get_linkcatname($id = 0) { - _deprecated_function(__FUNCTION__, '0.0', 'get_category()'); - - $id = (int) $id; - - if ( empty($id) ) - return ''; - - $cats = wp_get_link_cats($id); - - if ( empty($cats) || ! is_array($cats) ) - return ''; - - $cat_id = (int) $cats[0]; // Take the first cat. - - $cat = get_category($cat_id); - return $cat->name; -} - -/** - * Print RSS comment feed link. - * - * @since 1.0.1 - * @deprecated Use post_comments_feed_link() - * @see post_comments_feed_link() - * - * @param string $link_text - * @param string $deprecated Not used - */ -function comments_rss_link($link_text = 'Comments RSS', $deprecated = '') { - _deprecated_function(__FUNCTION__, '0.0', 'post_comments_feed_link()'); - post_comments_feed_link($link_text); -} - -/** - * Print/Return link to category RSS2 feed. - * - * @since 1.2 - * @deprecated Use get_category_feed_link() - * @see get_category_feed_link() - * - * @param bool $echo - * @param int $cat_ID - * @param string $deprecated Not used - * @return string|null - */ -function get_category_rss_link($echo = false, $cat_ID = 1, $deprecated = '') { - _deprecated_function(__FUNCTION__, '0.0', 'get_category_feed_link()'); - - $link = get_category_feed_link($cat_ID, 'rss2'); - - if ( $echo ) - echo $link; - return $link; -} - -/** - * Print/Return link to author RSS feed. - * - * @since 1.2 - * @deprecated Use get_author_feed_link() - * @see get_author_feed_link() - * - * @param bool $echo - * @param int $author_id - * @param string $deprecated Not used - * @return string|null - */ -function get_author_rss_link($echo = false, $author_id = 1, $deprecated = '') { - _deprecated_function(__FUNCTION__, '0.0', 'get_author_feed_link()'); - - $link = get_author_feed_link($author_id); - if ( $echo ) - echo $link; - return $link; -} - -/** - * Return link to the post RSS feed. - * - * @since 1.5 - * @deprecated Use get_post_comments_feed_link() - * @see get_post_comments_feed_link() - * - * @param string $deprecated Not used - * @return string - */ -function comments_rss($deprecated = '') { - _deprecated_function(__FUNCTION__, '2.2', 'get_post_comments_feed_link()'); - return get_post_comments_feed_link(); -} - -/** - * An alias of wp_create_user(). - * - * @param string $username The user's username. - * @param string $password The user's password. - * @param string $email The user's email (optional). - * @return int The new user's ID. - * @deprecated Use wp_create_user() - * @see wp_create_user() - */ -function create_user($username, $password, $email) { - _deprecated_function( __FUNCTION__, '2.0', 'wp_create_user()' ); - return wp_create_user($username, $password, $email); -} - -/** - * Unused Admin function. - * - * @since 2.0 - * @param string $deprecated Unknown - * @deprecated 2.5 - */ -function documentation_link( $deprecated = '' ) { - _deprecated_function( __FUNCTION__, '2.5', '' ); - return; -} - -/** - * Unused function. - * - * @deprecated 2.5 -*/ -function gzip_compression() { - return false; -} - -/** - * Retrieve an array of comment data about comment $comment_ID. - * - * @deprecated Use get_comment() - * @see get_comment() - * @since 0.71 - * - * @uses $id - * @uses $wpdb Database Object - * - * @param int $comment_ID The ID of the comment - * @param int $no_cache Whether to use the cache or not (casted to bool) - * @param bool $include_unapproved Whether to include unapproved comments or not - * @return array The comment data - */ -function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) { - _deprecated_function( __FUNCTION__, '2.7', 'get_comment()' ); - return get_comment($comment_ID, ARRAY_A); -} - -?> \ No newline at end of file +?> diff -uNr a/mp-wp/wp-includes/formatting.php b/mp-wp/wp-includes/formatting.php --- a/mp-wp/wp-includes/formatting.php 8f357ed8c80c0ca11d8f4c97243f23ae535672fd5d9c83e43ddfe14b6d1ba191b920801ed8c9ac0168e61f6e626634d0041985de3afc69ffe6af6ae2fbded7c7 +++ b/mp-wp/wp-includes/formatting.php 8a1954e0681a8c454faa3583568b572ba75b27fd048649ad65bf1ff8cb1cd92452980eb0f26b818c635c1f8398197ea4570c461a8358866672004448e6de4bc4 @@ -8,76 +8,6 @@ **/ /** - * Replaces common plain text characters into formatted entities - * - * As an example, - * - * 'cause today's effort makes it worth tomorrow's "holiday"... - * - * Becomes: - * - * ’cause today’s effort makes it worth tomorrow’s “holiday”… - * - * Code within certain html blocks are skipped. - * - * @since 0.71 - * @uses $wp_cockneyreplace Array of formatted entities for certain common phrases - * - * @param string $text The text to be formatted - * @return string The string replaced with html entities - */ -function wptexturize($text) { -/* global $wp_cockneyreplace; - $next = true; - $has_pre_parent = false; - $output = ''; - $curl = ''; - $textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); - $stop = count($textarr); - - // if a plugin has provided an autocorrect array, use it - if ( isset($wp_cockneyreplace) ) { - $cockney = array_keys($wp_cockneyreplace); - $cockneyreplace = array_values($wp_cockneyreplace); - } else { - $cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause"); - $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause"); - } - - $static_characters = array_merge(array('---', ' -- ', '--', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney); - $static_replacements = array_merge(array('—', ' — ', '–', 'xn--', '…', '“', '’s', '”', ' ™'), $cockneyreplace); - - $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/'); - $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1“$2', '”$1', '’$1', '$1×$2'); - - for ( $i = 0; $i < $stop; $i++ ) { - $curl = $textarr[$i]; - - if ( !empty($curl) && '<' != $curl{0} && '[' != $curl{0} && $next && !$has_pre_parent) { // If it's not a tag - // static strings - $curl = str_replace($static_characters, $static_replacements, $curl); - // regular expressions - $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); - } elseif (strpos($curl, '') !== false) { - $has_pre_parent = false; - } else { - $next = true; - } - - $curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&$1', $curl); - $output .= $curl; - } - - return $output; -*/ -return $text; -} - -/** * Accepts matches array from preg_replace_callback in wpautop() or a string. * * Ensures that the contents of a <
    >...<
    > HTML block are not diff -uNr a/mp-wp/wp-includes/functions.wp-scripts.php b/mp-wp/wp-includes/functions.wp-scripts.php --- a/mp-wp/wp-includes/functions.wp-scripts.php d8000256cc4303e265e02409547860113408e20ef6e19bb6b484a22104d4356519365b2bb827566b6d2310e3549e7b1075c7419324a9eb5721401ab322fa4313 +++ b/mp-wp/wp-includes/functions.wp-scripts.php false @@ -1,99 +0,0 @@ -do_items( $handles ); -} - -/** - * Register new JavaScript file. - * - * @since r16 - * @see WP_Scripts::add() For parameter information. - */ -function wp_register_script( $handle, $src, $deps = array(), $ver = false ) { - global $wp_scripts; - if ( !is_a($wp_scripts, 'WP_Scripts') ) - $wp_scripts = new WP_Scripts(); - - $wp_scripts->add( $handle, $src, $deps, $ver ); -} - -/** - * Localizes a script. - * - * Localizes only if script has already been added. - * - * @since r16 - * @see WP_Script::localize() - */ -function wp_localize_script( $handle, $object_name, $l10n ) { - global $wp_scripts; - if ( !is_a($wp_scripts, 'WP_Scripts') ) - return false; - - return $wp_scripts->localize( $handle, $object_name, $l10n ); -} - -/** - * Remove a registered script. - * - * @since r16 - * @see WP_Scripts::remove() For parameter information. - */ -function wp_deregister_script( $handle ) { - global $wp_scripts; - if ( !is_a($wp_scripts, 'WP_Scripts') ) - $wp_scripts = new WP_Scripts(); - - $wp_scripts->remove( $handle ); -} - -/** - * Enqueues script. - * - * Registers the script if src provided (does NOT overwrite) and enqueues. - * - * @since r16 - * @see WP_Script::add(), WP_Script::enqueue() -*/ -function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false ) { - global $wp_scripts; - if ( !is_a($wp_scripts, 'WP_Scripts') ) - $wp_scripts = new WP_Scripts(); - - if ( $src ) { - $_handle = explode('?', $handle); - $wp_scripts->add( $_handle[0], $src, $deps, $ver ); - } - $wp_scripts->enqueue( $handle ); -} diff -uNr a/mp-wp/wp-includes/general-template.php b/mp-wp/wp-includes/general-template.php --- a/mp-wp/wp-includes/general-template.php b61758ce3944dcc4e0d26b170cac7d65e024b14414aee50de039c9bc0eaa7b909dad56cec1ae40faee7f0cd478cf13b3d92ecd128606e0143f921b717217f88d +++ b/mp-wp/wp-includes/general-template.php ab9d675f6e203732f5816a06fd517f96ac66fc7c41de37bc9c5769f62e96874e898500ca595a2b3931b21f4b2bf5788202ba024f8c72a38e526d4aa93d3644eb @@ -659,7 +659,6 @@ * @return string HTML link content for archive. */ function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') { - $text = wptexturize($text); $title_text = attribute_escape($text); $url = clean_url($url); @@ -1040,7 +1039,7 @@ foreach ( (array) $ak_post_titles as $ak_post_title ) { $post_title = apply_filters( "the_title", $ak_post_title->post_title ); - $post_title = str_replace('"', '"', wptexturize( $post_title )); + $post_title = str_replace('"', '"', $post_title ); if ( empty($ak_titles_for_day['day_'.$ak_post_title->dom]) ) $ak_titles_for_day['day_'.$ak_post_title->dom] = ''; @@ -1410,46 +1409,19 @@ * @param string $content Textarea content. * @param string $id HTML ID attribute value. * @param string $prev_id HTML ID name for switching back and forth between visual editors. - * @param bool $media_buttons Optional, default is true. Whether to display media buttons. * @param int $tab_index Optional, default is 2. Tabindex for textarea element. */ -function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2) { +function the_editor($content, $id = 'content', $prev_id = 'title', $tab_index = 2) { $rows = get_option('default_post_edit_rows'); if (($rows < 3) || ($rows > 100)) $rows = 12; - if ( !current_user_can( 'upload_files' ) ) - $media_buttons = false; - $rows = "rows='$rows'"; - if ( $media_buttons ) { ?> -
    - -
    - -
    - -
    - - -
    - - -
    - - \n"); + $the_editor = apply_filters('the_editor', "
    \n"); $the_editor_content = apply_filters('the_editor_content', $content); printf($the_editor, $the_editor_content); - - ?> - - - * wp_admin_css_color('classic', __('Classic'), admin_url("css/colors-classic.css"), - * array('#07273E', '#14568A', '#D54E21', '#2683AE')); - * - * - * @since 2.5.0 - * - * @param string $key The unique key for this theme. - * @param string $name The name of the theme. - * @param string $url The url of the css file containing the colour scheme. - * @param array @colors An array of CSS color definitions which are used to give the user a feel for the theme. - */ -function wp_admin_css_color($key, $name, $url, $colors = array()) { - global $_wp_admin_css_colors; - - if ( !isset($_wp_admin_css_colors) ) - $_wp_admin_css_colors = array(); - - $_wp_admin_css_colors[$key] = (object) array('name' => $name, 'url' => $url, 'colors' => $colors); -} - -/** * Display the URL of a WordPress admin CSS file. * * @see WP_Styles::_css_href and its style_loader_src filter. @@ -1724,20 +1671,6 @@ } /** - * Enqueues the default ThickBox js and css. - * - * If any of the settings need to be changed, this can be done with another js - * file similar to media-upload.js and theme-preview.js. That file should - * require array('thickbox') to ensure it is loaded after. - * - * @since 2.5.0 - */ -function add_thickbox() { - wp_enqueue_script( 'thickbox' ); - wp_enqueue_style( 'thickbox' ); -} - -/** * Display the XHTML generator that is generated on the wp_head hook. * * @since 2.5.0 diff -uNr a/mp-wp/wp-includes/js/.htaccess b/mp-wp/wp-includes/js/.htaccess --- a/mp-wp/wp-includes/js/.htaccess 8d7843bf5142262b9b76e30639d4eb8137d53af16a639d75726f6b88d624a9bff8a1163fd5a7a18ee580cfd7118ec58d4e72760540b2321dcaae3440e2266712 +++ b/mp-wp/wp-includes/js/.htaccess false @@ -1,3 +0,0 @@ -Order deny,allow -Deny from all -Allow from fill your own diff -uNr a/mp-wp/wp-includes/js/autosave.js b/mp-wp/wp-includes/js/autosave.js --- a/mp-wp/wp-includes/js/autosave.js 30e1d670b6a0578792d5d6c78a27740f66faf7ff175f188277e6b6b7b9e9e599630739eebdbf35f562cc204ab23bada8a0c4a8079a3cbb8c2a7d9c5b70f7bed8 +++ b/mp-wp/wp-includes/js/autosave.js false @@ -1,195 +0,0 @@ -var autosaveLast = ''; -var autosavePeriodical; -var autosaveOldMessage = ''; -var autosaveDelayPreview = false; -var autosaveFirst = true; - -jQuery(function($) { - autosaveLast = $('#post #title').val()+$('#post #content').val(); - autosavePeriodical = $.schedule({time: autosaveL10n.autosaveInterval * 1000, func: function() { autosave(); }, repeat: true, protect: true}); - - //Disable autosave after the form has been submitted - $("#post").submit(function() { $.cancel(autosavePeriodical); }); -}); - -function autosave_parse_response(response) { - var res = wpAjax.parseAjaxResponse(response, 'autosave'); // parse the ajax response - var message = ''; - - if ( res && res.responses && res.responses.length ) { - message = res.responses[0].data; // The saved message or error. - // someone else is editing: disable autosave, set errors - if ( res.responses[0].supplemental ) { - if ( 'disable' == res.responses[0].supplemental['disable_autosave'] ) { - autosave = function() {}; - res = { errors: true }; - } - jQuery.each(res.responses[0].supplemental, function(selector, value) { - if ( selector.match(/^replace-/) ) { - jQuery('#'+selector.replace('replace-', '')).val(value); - } - }); - } - - // if no errors: add slug UI - if ( !res.errors ) { - var postID = parseInt( res.responses[0].id ); - if ( !isNaN(postID) && postID > 0 ) { - autosave_update_slug(postID); - } - } - } - if ( message ) { jQuery('#autosave').html(message); } // update autosave message - else if ( autosaveOldMessage && res ) { jQuery('#autosave').html( autosaveOldMessage ); } - return res; -} - -// called when autosaving pre-existing post -function autosave_saved(response) { - autosave_parse_response(response); // parse the ajax response - autosave_enable_buttons(); // re-enable disabled form buttons -} - -// called when autosaving new post -function autosave_saved_new(response) { - var res = autosave_parse_response(response); // parse the ajax response - // if no errors: update post_ID from the temporary value, grab new save-nonce for that new ID - if ( res && res.responses.length && !res.errors ) { - var tempID = jQuery('#post_ID').val(); - var postID = parseInt( res.responses[0].id ); - autosave_update_post_ID( postID ); // disabled form buttons are re-enabled here - if ( tempID < 0 && postID > 0 ) // update media buttons - jQuery('#media-buttons a').each(function(){ - this.href = this.href.replace(tempID, postID); - }); - // activate preview - autosaveFirst = false; - if ( autosaveDelayPreview ) - jQuery('#post-preview').click(); - } else { - autosave_enable_buttons(); // re-enable disabled form buttons - } -} - -function autosave_update_post_ID( postID ) { - if ( !isNaN(postID) && postID > 0 ) { - if ( postID == parseInt(jQuery('#post_ID').val()) ) { return; } // no need to do this more than once - jQuery('#post_ID').attr({name: "post_ID"}); - jQuery('#post_ID').val(postID); - // We need new nonces - jQuery.post(autosaveL10n.requestFile, { - action: "autosave-generate-nonces", - post_ID: postID, - autosavenonce: jQuery('#autosavenonce').val(), - post_type: jQuery('#post_type').val() - }, function(html) { - jQuery('#_wpnonce').val(html); - autosave_enable_buttons(); // re-enable disabled form buttons - }); - jQuery('#hiddenaction').val('editpost'); - } -} - -function autosave_update_slug(post_id) { - // create slug area only if not already there - if ( jQuery.isFunction(make_slugedit_clickable) && !jQuery('#edit-slug-box > *').size() ) { - jQuery.post( - slugL10n.requestFile, - { - action: 'sample-permalink', - post_id: post_id, - new_title: jQuery('#title').val(), - samplepermalinknonce: jQuery('#samplepermalinknonce').val() - }, - function(data) { - jQuery('#edit-slug-box').html(data); - make_slugedit_clickable(); - } - ); - } -} - -function autosave_loading() { - jQuery('#autosave').html(autosaveL10n.savingText); -} - -function autosave_enable_buttons() { - jQuery("#submitpost :button:disabled, #submitpost :submit:disabled").attr('disabled', ''); -} - -function autosave_disable_buttons() { - jQuery("#submitpost :button:enabled, #submitpost :submit:enabled").attr('disabled', 'disabled'); - setTimeout(autosave_enable_buttons, 5000); // Re-enable 5 sec later. Just gives autosave a head start to avoid collisions. -} - -var autosave = function() { - var post_data = { - action: "autosave", - post_ID: jQuery("#post_ID").val() || 0, - post_title: jQuery("#title").val() || "", - autosavenonce: jQuery('#autosavenonce').val(), - tags_input: jQuery("#tags-input").val() || "", - post_type: jQuery('#post_type').val() || "", - autosave: 1 - }; - - // We always send the ajax request in order to keep the post lock fresh. - // This (bool) tells whether or not to write the post to the DB during the ajax request. - var doAutoSave = true; - - // No autosave while thickbox is open (media buttons) - if ( jQuery("#TB_window").css('display') == 'block' ) - doAutoSave = false; - - post_data["content"] = jQuery("#content").val(); - if ( jQuery('#post_name').val() ) - post_data["post_name"] = jQuery('#post_name').val(); - - // Nothing to save or no change. - if( (post_data["post_title"].length==0 && post_data["content"].length==0) || post_data["post_title"] + post_data["content"] == autosaveLast) { - doAutoSave = false - } - - autosave_disable_buttons(); - - var origStatus = jQuery('#original_post_status').val(); - - autosaveLast = jQuery("#title").val()+jQuery("#content").val(); - goodcats = ([]); - jQuery("[@name='post_category[]']:checked").each( function(i) { - goodcats.push(this.value); - } ); - post_data["catslist"] = goodcats.join(","); - - if ( jQuery("#comment_status").attr("checked") ) - post_data["comment_status"] = 'open'; - if ( jQuery("#ping_status").attr("checked") ) - post_data["ping_status"] = 'open'; - if ( jQuery("#excerpt").size() ) - post_data["excerpt"] = jQuery("#excerpt").val(); - if ( jQuery("#post_author").size() ) - post_data["post_author"] = jQuery("#post_author").val(); - - post_data["user_ID"] = jQuery("#user-id").val(); - - if(parseInt(post_data["post_ID"]) < 1) { - post_data["temp_ID"] = post_data["post_ID"]; - var successCallback = autosave_saved_new; // new post - } else { - var successCallback = autosave_saved; // pre-existing post - } - - if ( !doAutoSave ) { - post_data['autosave'] = 0; - } - - autosaveOldMessage = jQuery('#autosave').html(); - - jQuery.ajax({ - data: post_data, - beforeSend: doAutoSave ? autosave_loading : null, - type: "POST", - url: autosaveL10n.requestFile, - success: successCallback - }); -} diff -uNr a/mp-wp/wp-includes/js/colorpicker.js b/mp-wp/wp-includes/js/colorpicker.js --- a/mp-wp/wp-includes/js/colorpicker.js 5dda52724e8ee7889baf0a35ad0665f2db6af09cb7daede70d7320ac1f24fd1ab6eeb4563d39da229c6f43fd46695be69d6067c211a8b886390caa87d156b8f6 +++ b/mp-wp/wp-includes/js/colorpicker.js false @@ -1,707 +0,0 @@ -// =================================================================== -// Author: Matt Kruse -// WWW: http://www.mattkruse.com/ -// -// NOTICE: You may use this code for any purpose, commercial or -// private, without any further permission from the author. You may -// remove this notice from your final code if you wish, however it is -// appreciated by the author if at least my web site address is kept. -// -// You may *NOT* re-distribute this code in any way except through its -// use. That means, you can include it in your product, or your web -// site, or any other form where the code is actually being used. You -// may not put the plain javascript up on your site for download or -// include it in your javascript libraries for download. -// If you wish to share this code with others, please just point them -// to the URL instead. -// Please DO NOT link directly to my .js files from your site. Copy -// the files to your server and use them there. Thank you. -// =================================================================== - - -/* SOURCE FILE: AnchorPosition.js */ - -/* -AnchorPosition.js -Author: Matt Kruse -Last modified: 10/11/02 - -DESCRIPTION: These functions find the position of an tag in a document, -so other elements can be positioned relative to it. - -COMPATABILITY: Netscape 4.x,6.x,Mozilla, IE 5.x,6.x on Windows. Some small -positioning errors - usually with Window positioning - occur on the -Macintosh platform. - -FUNCTIONS: -getAnchorPosition(anchorname) - Returns an Object() having .x and .y properties of the pixel coordinates - of the upper-left corner of the anchor. Position is relative to the PAGE. - -getAnchorWindowPosition(anchorname) - Returns an Object() having .x and .y properties of the pixel coordinates - of the upper-left corner of the anchor, relative to the WHOLE SCREEN. - -NOTES: - -1) For popping up separate browser windows, use getAnchorWindowPosition. - Otherwise, use getAnchorPosition - -2) Your anchor tag MUST contain both NAME and ID attributes which are the - same. For example: - - -3) There must be at least a space between for IE5.5 to see the - anchor tag correctly. Do not do with no space. -*/ - -// getAnchorPosition(anchorname) -// This function returns an object having .x and .y properties which are the coordinates -// of the named anchor, relative to the page. -function getAnchorPosition(anchorname) { - // This function will return an Object with x and y properties - var useWindow=false; - var coordinates=new Object(); - var x=0,y=0; - // Browser capability sniffing - var use_gebi=false, use_css=false, use_layers=false; - if (document.getElementById) { use_gebi=true; } - else if (document.all) { use_css=true; } - else if (document.layers) { use_layers=true; } - // Logic to find position - if (use_gebi && document.all) { - x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]); - y=AnchorPosition_getPageOffsetTop(document.all[anchorname]); - } - else if (use_gebi) { - var o=document.getElementById(anchorname); - x=AnchorPosition_getPageOffsetLeft(o); - y=AnchorPosition_getPageOffsetTop(o); - } - else if (use_css) { - x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]); - y=AnchorPosition_getPageOffsetTop(document.all[anchorname]); - } - else if (use_layers) { - var found=0; - for (var i=0; i tags may cause errors. - -USAGE: -// Create an object for a WINDOW popup -var win = new PopupWindow(); - -// Create an object for a DIV window using the DIV named 'mydiv' -var win = new PopupWindow('mydiv'); - -// Set the window to automatically hide itself when the user clicks -// anywhere else on the page except the popup -win.autoHide(); - -// Show the window relative to the anchor name passed in -win.showPopup(anchorname); - -// Hide the popup -win.hidePopup(); - -// Set the size of the popup window (only applies to WINDOW popups -win.setSize(width,height); - -// Populate the contents of the popup window that will be shown. If you -// change the contents while it is displayed, you will need to refresh() -win.populate(string); - -// set the URL of the window, rather than populating its contents -// manually -win.setUrl("http://www.site.com/"); - -// Refresh the contents of the popup -win.refresh(); - -// Specify how many pixels to the right of the anchor the popup will appear -win.offsetX = 50; - -// Specify how many pixels below the anchor the popup will appear -win.offsetY = 100; - -NOTES: -1) Requires the functions in AnchorPosition.js - -2) Your anchor tag MUST contain both NAME and ID attributes which are the - same. For example: - - -3) There must be at least a space between for IE5.5 to see the - anchor tag correctly. Do not do with no space. - -4) When a PopupWindow object is created, a handler for 'onmouseup' is - attached to any event handler you may have already defined. Do NOT define - an event handler for 'onmouseup' after you define a PopupWindow object or - the autoHide() will not work correctly. -*/ - -// Set the position of the popup window based on the anchor -function PopupWindow_getXYPosition(anchorname) { - var coordinates; - if (this.type == "WINDOW") { - coordinates = getAnchorWindowPosition(anchorname); - } - else { - coordinates = getAnchorPosition(anchorname); - } - this.x = coordinates.x; - this.y = coordinates.y; - } -// Set width/height of DIV/popup window -function PopupWindow_setSize(width,height) { - this.width = width; - this.height = height; - } -// Fill the window with contents -function PopupWindow_populate(contents) { - this.contents = contents; - this.populated = false; - } -// Set the URL to go to -function PopupWindow_setUrl(url) { - this.url = url; - } -// Set the window popup properties -function PopupWindow_setWindowProperties(props) { - this.windowProperties = props; - } -// Refresh the displayed contents of the popup -function PopupWindow_refresh() { - if (this.divName != null) { - // refresh the DIV object - if (this.use_gebi) { - document.getElementById(this.divName).innerHTML = this.contents; - } - else if (this.use_css) { - document.all[this.divName].innerHTML = this.contents; - } - else if (this.use_layers) { - var d = document.layers[this.divName]; - d.document.open(); - d.document.writeln(this.contents); - d.document.close(); - } - } - else { - if (this.popupWindow != null && !this.popupWindow.closed) { - if (this.url!="") { - this.popupWindow.location.href=this.url; - } - else { - this.popupWindow.document.open(); - this.popupWindow.document.writeln(this.contents); - this.popupWindow.document.close(); - } - this.popupWindow.focus(); - } - } - } -// Position and show the popup, relative to an anchor object -function PopupWindow_showPopup(anchorname) { - this.getXYPosition(anchorname); - this.x += this.offsetX; - this.y += this.offsetY; - if (!this.populated && (this.contents != "")) { - this.populated = true; - this.refresh(); - } - if (this.divName != null) { - // Show the DIV object - if (this.use_gebi) { - document.getElementById(this.divName).style.left = this.x + "px"; - document.getElementById(this.divName).style.top = this.y; - document.getElementById(this.divName).style.visibility = "visible"; - } - else if (this.use_css) { - document.all[this.divName].style.left = this.x; - document.all[this.divName].style.top = this.y; - document.all[this.divName].style.visibility = "visible"; - } - else if (this.use_layers) { - document.layers[this.divName].left = this.x; - document.layers[this.divName].top = this.y; - document.layers[this.divName].visibility = "visible"; - } - } - else { - if (this.popupWindow == null || this.popupWindow.closed) { - // If the popup window will go off-screen, move it so it doesn't - if (this.x<0) { this.x=0; } - if (this.y<0) { this.y=0; } - if (screen && screen.availHeight) { - if ((this.y + this.height) > screen.availHeight) { - this.y = screen.availHeight - this.height; - } - } - if (screen && screen.availWidth) { - if ((this.x + this.width) > screen.availWidth) { - this.x = screen.availWidth - this.width; - } - } - var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled ); - this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+""); - } - this.refresh(); - } - } -// Hide the popup -function PopupWindow_hidePopup() { - if (this.divName != null) { - if (this.use_gebi) { - document.getElementById(this.divName).style.visibility = "hidden"; - } - else if (this.use_css) { - document.all[this.divName].style.visibility = "hidden"; - } - else if (this.use_layers) { - document.layers[this.divName].visibility = "hidden"; - } - } - else { - if (this.popupWindow && !this.popupWindow.closed) { - this.popupWindow.close(); - this.popupWindow = null; - } - } - } -// Pass an event and return whether or not it was the popup DIV that was clicked -function PopupWindow_isClicked(e) { - if (this.divName != null) { - if (this.use_layers) { - var clickX = e.pageX; - var clickY = e.pageY; - var t = document.layers[this.divName]; - if ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) { - return true; - } - else { return false; } - } - else if (document.all) { // Need to hard-code this to trap IE for error-handling - var t = window.event.srcElement; - while (t.parentElement != null) { - if (t.id==this.divName) { - return true; - } - t = t.parentElement; - } - return false; - } - else if (this.use_gebi && e) { - var t = e.originalTarget; - while (t.parentNode != null) { - if (t.id==this.divName) { - return true; - } - t = t.parentNode; - } - return false; - } - return false; - } - return false; - } - -// Check an onMouseDown event to see if we should hide -function PopupWindow_hideIfNotClicked(e) { - if (this.autoHideEnabled && !this.isClicked(e)) { - this.hidePopup(); - } - } -// Call this to make the DIV disable automatically when mouse is clicked outside it -function PopupWindow_autoHide() { - this.autoHideEnabled = true; - } -// This global function checks all PopupWindow objects onmouseup to see if they should be hidden -function PopupWindow_hidePopupWindows(e) { - for (var i=0; i0) { - this.type="DIV"; - this.divName = arguments[0]; - } - else { - this.type="WINDOW"; - } - this.use_gebi = false; - this.use_css = false; - this.use_layers = false; - if (document.getElementById) { this.use_gebi = true; } - else if (document.all) { this.use_css = true; } - else if (document.layers) { this.use_layers = true; } - else { this.type = "WINDOW"; } - this.offsetX = 0; - this.offsetY = 0; - // Method mappings - this.getXYPosition = PopupWindow_getXYPosition; - this.populate = PopupWindow_populate; - this.setUrl = PopupWindow_setUrl; - this.setWindowProperties = PopupWindow_setWindowProperties; - this.refresh = PopupWindow_refresh; - this.showPopup = PopupWindow_showPopup; - this.hidePopup = PopupWindow_hidePopup; - this.setSize = PopupWindow_setSize; - this.isClicked = PopupWindow_isClicked; - this.autoHide = PopupWindow_autoHide; - this.hideIfNotClicked = PopupWindow_hideIfNotClicked; - } - -/* SOURCE FILE: ColorPicker2.js */ - -/* -Last modified: 02/24/2003 - -DESCRIPTION: This widget is used to select a color, in hexadecimal #RRGGBB -form. It uses a color "swatch" to display the standard 216-color web-safe -palette. The user can then click on a color to select it. - -COMPATABILITY: See notes in AnchorPosition.js and PopupWindow.js. -Only the latest DHTML-capable browsers will show the color and hex values -at the bottom as your mouse goes over them. - -USAGE: -// Create a new ColorPicker object using DHTML popup -var cp = new ColorPicker(); - -// Create a new ColorPicker object using Window Popup -var cp = new ColorPicker('window'); - -// Add a link in your page to trigger the popup. For example: -Pick - -// Or use the built-in "select" function to do the dirty work for you: -Pick - -// If using DHTML popup, write out the required DIV tag near the bottom -// of your page. - - -// Write the 'pickColor' function that will be called when the user clicks -// a color and do something with the value. This is only required if you -// want to do something other than simply populate a form field, which is -// what the 'select' function will give you. -function pickColor(color) { - field.value = color; - } - -NOTES: -1) Requires the functions in AnchorPosition.js and PopupWindow.js - -2) Your anchor tag MUST contain both NAME and ID attributes which are the - same. For example: - - -3) There must be at least a space between for IE5.5 to see the - anchor tag correctly. Do not do with no space. - -4) When a ColorPicker object is created, a handler for 'onmouseup' is - attached to any event handler you may have already defined. Do NOT define - an event handler for 'onmouseup' after you define a ColorPicker object or - the color picker will not hide itself correctly. -*/ -ColorPicker_targetInput = null; -function ColorPicker_writeDiv() { - document.writeln(""); - } - -function ColorPicker_show(anchorname) { - this.showPopup(anchorname); - } - -function ColorPicker_pickColor(color,obj) { - obj.hidePopup(); - pickColor(color); - } - -// A Default "pickColor" function to accept the color passed back from popup. -// User can over-ride this with their own function. -function pickColor(color) { - if (ColorPicker_targetInput==null) { - alert("Target Input is null, which means you either didn't use the 'select' function or you have no defined your own 'pickColor' function to handle the picked color!"); - return; - } - ColorPicker_targetInput.value = color; - } - -// This function is the easiest way to popup the window, select a color, and -// have the value populate a form field, which is what most people want to do. -function ColorPicker_select(inputobj,linkname) { - if (inputobj.type!="text" && inputobj.type!="hidden" && inputobj.type!="textarea") { - alert("colorpicker.select: Input object passed is not a valid form input object"); - window.ColorPicker_targetInput=null; - return; - } - window.ColorPicker_targetInput = inputobj; - this.show(linkname); - } - -// This function runs when you move your mouse over a color block, if you have a newer browser -function ColorPicker_highlightColor(c) { - var thedoc = (arguments.length>1)?arguments[1]:window.document; - var d = thedoc.getElementById("colorPickerSelectedColor"); - d.style.backgroundColor = c; - d = thedoc.getElementById("colorPickerSelectedColorValue"); - d.innerHTML = c; - } - -function ColorPicker() { - var windowMode = false; - // Create a new PopupWindow object - if (arguments.length==0) { - var divname = "colorPickerDiv"; - } - else if (arguments[0] == "window") { - var divname = ''; - windowMode = true; - } - else { - var divname = arguments[0]; - } - - if (divname != "") { - var cp = new PopupWindow(divname); - } - else { - var cp = new PopupWindow(); - cp.setSize(225,250); - } - - // Object variables - cp.currentValue = "#FFFFFF"; - - // Method Mappings - cp.writeDiv = ColorPicker_writeDiv; - cp.highlightColor = ColorPicker_highlightColor; - cp.show = ColorPicker_show; - cp.select = ColorPicker_select; - - // Code to populate color picker window - var colors = new Array( "#4180B6","#69AEE7","#000000","#000033","#000066","#000099","#0000CC","#0000FF","#330000","#330033","#330066","#330099", - "#3300CC","#3300FF","#660000","#660033","#660066","#660099","#6600CC","#6600FF","#990000","#990033","#990066","#990099", - "#9900CC","#9900FF","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#FF0000","#FF0033","#FF0066","#FF0099", - "#FF00CC","#FF00FF","#7FFFFF","#7FFFFF","#7FF7F7","#7FEFEF","#7FE7E7","#7FDFDF","#7FD7D7","#7FCFCF","#7FC7C7","#7FBFBF", - "#7FB7B7","#7FAFAF","#7FA7A7","#7F9F9F","#7F9797","#7F8F8F","#7F8787","#7F7F7F","#7F7777","#7F6F6F","#7F6767","#7F5F5F", - "#7F5757","#7F4F4F","#7F4747","#7F3F3F","#7F3737","#7F2F2F","#7F2727","#7F1F1F","#7F1717","#7F0F0F","#7F0707","#7F0000", - - "#4180B6","#69AEE7","#003300","#003333","#003366","#003399","#0033CC","#0033FF","#333300","#333333","#333366","#333399", - "#3333CC","#3333FF","#663300","#663333","#663366","#663399","#6633CC","#6633FF","#993300","#993333","#993366","#993399", - "#9933CC","#9933FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#FF3300","#FF3333","#FF3366","#FF3399", - "#FF33CC","#FF33FF","#FF7FFF","#FF7FFF","#F77FF7","#EF7FEF","#E77FE7","#DF7FDF","#D77FD7","#CF7FCF","#C77FC7","#BF7FBF", - "#B77FB7","#AF7FAF","#A77FA7","#9F7F9F","#977F97","#8F7F8F","#877F87","#7F7F7F","#777F77","#6F7F6F","#677F67","#5F7F5F", - "#577F57","#4F7F4F","#477F47","#3F7F3F","#377F37","#2F7F2F","#277F27","#1F7F1F","#177F17","#0F7F0F","#077F07","#007F00", - - "#4180B6","#69AEE7","#006600","#006633","#006666","#006699","#0066CC","#0066FF","#336600","#336633","#336666","#336699", - "#3366CC","#3366FF","#666600","#666633","#666666","#666699","#6666CC","#6666FF","#996600","#996633","#996666","#996699", - "#9966CC","#9966FF","#CC6600","#CC6633","#CC6666","#CC6699","#CC66CC","#CC66FF","#FF6600","#FF6633","#FF6666","#FF6699", - "#FF66CC","#FF66FF","#FFFF7F","#FFFF7F","#F7F77F","#EFEF7F","#E7E77F","#DFDF7F","#D7D77F","#CFCF7F","#C7C77F","#BFBF7F", - "#B7B77F","#AFAF7F","#A7A77F","#9F9F7F","#97977F","#8F8F7F","#87877F","#7F7F7F","#77777F","#6F6F7F","#67677F","#5F5F7F", - "#57577F","#4F4F7F","#47477F","#3F3F7F","#37377F","#2F2F7F","#27277F","#1F1F7F","#17177F","#0F0F7F","#07077F","#00007F", - - "#4180B6","#69AEE7","#009900","#009933","#009966","#009999","#0099CC","#0099FF","#339900","#339933","#339966","#339999", - "#3399CC","#3399FF","#669900","#669933","#669966","#669999","#6699CC","#6699FF","#999900","#999933","#999966","#999999", - "#9999CC","#9999FF","#CC9900","#CC9933","#CC9966","#CC9999","#CC99CC","#CC99FF","#FF9900","#FF9933","#FF9966","#FF9999", - "#FF99CC","#FF99FF","#3FFFFF","#3FFFFF","#3FF7F7","#3FEFEF","#3FE7E7","#3FDFDF","#3FD7D7","#3FCFCF","#3FC7C7","#3FBFBF", - "#3FB7B7","#3FAFAF","#3FA7A7","#3F9F9F","#3F9797","#3F8F8F","#3F8787","#3F7F7F","#3F7777","#3F6F6F","#3F6767","#3F5F5F", - "#3F5757","#3F4F4F","#3F4747","#3F3F3F","#3F3737","#3F2F2F","#3F2727","#3F1F1F","#3F1717","#3F0F0F","#3F0707","#3F0000", - - "#4180B6","#69AEE7","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#33CC00","#33CC33","#33CC66","#33CC99", - "#33CCCC","#33CCFF","#66CC00","#66CC33","#66CC66","#66CC99","#66CCCC","#66CCFF","#99CC00","#99CC33","#99CC66","#99CC99", - "#99CCCC","#99CCFF","#CCCC00","#CCCC33","#CCCC66","#CCCC99","#CCCCCC","#CCCCFF","#FFCC00","#FFCC33","#FFCC66","#FFCC99", - "#FFCCCC","#FFCCFF","#FF3FFF","#FF3FFF","#F73FF7","#EF3FEF","#E73FE7","#DF3FDF","#D73FD7","#CF3FCF","#C73FC7","#BF3FBF", - "#B73FB7","#AF3FAF","#A73FA7","#9F3F9F","#973F97","#8F3F8F","#873F87","#7F3F7F","#773F77","#6F3F6F","#673F67","#5F3F5F", - "#573F57","#4F3F4F","#473F47","#3F3F3F","#373F37","#2F3F2F","#273F27","#1F3F1F","#173F17","#0F3F0F","#073F07","#003F00", - - "#4180B6","#69AEE7","#00FF00","#00FF33","#00FF66","#00FF99","#00FFCC","#00FFFF","#33FF00","#33FF33","#33FF66","#33FF99", - "#33FFCC","#33FFFF","#66FF00","#66FF33","#66FF66","#66FF99","#66FFCC","#66FFFF","#99FF00","#99FF33","#99FF66","#99FF99", - "#99FFCC","#99FFFF","#CCFF00","#CCFF33","#CCFF66","#CCFF99","#CCFFCC","#CCFFFF","#FFFF00","#FFFF33","#FFFF66","#FFFF99", - "#FFFFCC","#FFFFFF","#FFFF3F","#FFFF3F","#F7F73F","#EFEF3F","#E7E73F","#DFDF3F","#D7D73F","#CFCF3F","#C7C73F","#BFBF3F", - "#B7B73F","#AFAF3F","#A7A73F","#9F9F3F","#97973F","#8F8F3F","#87873F","#7F7F3F","#77773F","#6F6F3F","#67673F","#5F5F3F", - "#57573F","#4F4F3F","#47473F","#3F3F3F","#37373F","#2F2F3F","#27273F","#1F1F3F","#17173F","#0F0F3F","#07073F","#00003F", - - "#4180B6","#69AEE7","#FFFFFF","#FFEEEE","#FFDDDD","#FFCCCC","#FFBBBB","#FFAAAA","#FF9999","#FF8888","#FF7777","#FF6666", - "#FF5555","#FF4444","#FF3333","#FF2222","#FF1111","#FF0000","#FF0000","#FF0000","#FF0000","#EE0000","#DD0000","#CC0000", - "#BB0000","#AA0000","#990000","#880000","#770000","#660000","#550000","#440000","#330000","#220000","#110000","#000000", - "#000000","#000000","#000000","#001111","#002222","#003333","#004444","#005555","#006666","#007777","#008888","#009999", - "#00AAAA","#00BBBB","#00CCCC","#00DDDD","#00EEEE","#00FFFF","#00FFFF","#00FFFF","#00FFFF","#11FFFF","#22FFFF","#33FFFF", - "#44FFFF","#55FFFF","#66FFFF","#77FFFF","#88FFFF","#99FFFF","#AAFFFF","#BBFFFF","#CCFFFF","#DDFFFF","#EEFFFF","#FFFFFF", - - "#4180B6","#69AEE7","#FFFFFF","#EEFFEE","#DDFFDD","#CCFFCC","#BBFFBB","#AAFFAA","#99FF99","#88FF88","#77FF77","#66FF66", - "#55FF55","#44FF44","#33FF33","#22FF22","#11FF11","#00FF00","#00FF00","#00FF00","#00FF00","#00EE00","#00DD00","#00CC00", - "#00BB00","#00AA00","#009900","#008800","#007700","#006600","#005500","#004400","#003300","#002200","#001100","#000000", - "#000000","#000000","#000000","#110011","#220022","#330033","#440044","#550055","#660066","#770077","#880088","#990099", - "#AA00AA","#BB00BB","#CC00CC","#DD00DD","#EE00EE","#FF00FF","#FF00FF","#FF00FF","#FF00FF","#FF11FF","#FF22FF","#FF33FF", - "#FF44FF","#FF55FF","#FF66FF","#FF77FF","#FF88FF","#FF99FF","#FFAAFF","#FFBBFF","#FFCCFF","#FFDDFF","#FFEEFF","#FFFFFF", - - "#4180B6","#69AEE7","#FFFFFF","#EEEEFF","#DDDDFF","#CCCCFF","#BBBBFF","#AAAAFF","#9999FF","#8888FF","#7777FF","#6666FF", - "#5555FF","#4444FF","#3333FF","#2222FF","#1111FF","#0000FF","#0000FF","#0000FF","#0000FF","#0000EE","#0000DD","#0000CC", - "#0000BB","#0000AA","#000099","#000088","#000077","#000066","#000055","#000044","#000033","#000022","#000011","#000000", - "#000000","#000000","#000000","#111100","#222200","#333300","#444400","#555500","#666600","#777700","#888800","#999900", - "#AAAA00","#BBBB00","#CCCC00","#DDDD00","#EEEE00","#FFFF00","#FFFF00","#FFFF00","#FFFF00","#FFFF11","#FFFF22","#FFFF33", - "#FFFF44","#FFFF55","#FFFF66","#FFFF77","#FFFF88","#FFFF99","#FFFFAA","#FFFFBB","#FFFFCC","#FFFFDD","#FFFFEE","#FFFFFF", - - "#4180B6","#69AEE7","#FFFFFF","#FFFFFF","#FBFBFB","#F7F7F7","#F3F3F3","#EFEFEF","#EBEBEB","#E7E7E7","#E3E3E3","#DFDFDF", - "#DBDBDB","#D7D7D7","#D3D3D3","#CFCFCF","#CBCBCB","#C7C7C7","#C3C3C3","#BFBFBF","#BBBBBB","#B7B7B7","#B3B3B3","#AFAFAF", - "#ABABAB","#A7A7A7","#A3A3A3","#9F9F9F","#9B9B9B","#979797","#939393","#8F8F8F","#8B8B8B","#878787","#838383","#7F7F7F", - "#7B7B7B","#777777","#737373","#6F6F6F","#6B6B6B","#676767","#636363","#5F5F5F","#5B5B5B","#575757","#535353","#4F4F4F", - "#4B4B4B","#474747","#434343","#3F3F3F","#3B3B3B","#373737","#333333","#2F2F2F","#2B2B2B","#272727","#232323","#1F1F1F", - "#1B1B1B","#171717","#131313","#0F0F0F","#0B0B0B","#070707","#030303","#000000","#000000","#000000","#000000","#000000"); - var total = colors.length; - var width = 72; - var cp_contents = ""; - var windowRef = (windowMode)?"window.opener.":""; - if (windowMode) { - cp_contents += "Select Color"; - cp_contents += ""; - } - cp_contents += ""; - var use_highlight = (document.getElementById || document.all)?true:false; - for (var i=0; i '; - if ( ((i+1)>=total) || (((i+1) % width) == 0)) { - cp_contents += ""; - } - } - // If the browser supports dynamically changing TD cells, add the fancy stuff - if (document.getElementById) { - var width1 = Math.floor(width/2); - var width2 = width = width1; - cp_contents += ""; - } - cp_contents += "
     #FFFFFF
    "; - if (windowMode) { - cp_contents += "
    "; - } - // end populate code - - // Write the contents to the popup object - cp.populate(cp_contents+"\n"); - // Move the table down a bit so you can see it - cp.offsetY = 25; - cp.autoHide(); - return cp; - } diff -uNr a/mp-wp/wp-includes/js/comment-reply.js b/mp-wp/wp-includes/js/comment-reply.js --- a/mp-wp/wp-includes/js/comment-reply.js e1a4268ed180ac629186d81a8332654ee1fd8c00607bed755e0fed3efd23c512329add23e16c6a12d5b23b1d66f6370d7dfbbfe5b482a872c0fe9dfcdc203c20 +++ b/mp-wp/wp-includes/js/comment-reply.js false @@ -1,48 +0,0 @@ - -addComment = { - moveForm : function(commId, parentId, respondId, postId) { - var t = this, div, comm = t.I(commId), respond = t.I(respondId), cancel = t.I('cancel-comment-reply-link'), parent = t.I('comment_parent'), post = t.I('comment_post_ID'); - - if ( ! comm || ! respond || ! cancel || ! parent ) - return; - - t.respondId = respondId; - postId = postId || false; - - if ( ! t.I('wp-temp-form-div') ) { - div = document.createElement('div'); - div.id = 'wp-temp-form-div'; - div.style.display = 'none'; - respond.parentNode.insertBefore(div, respond); - } - - comm.parentNode.insertBefore(respond, comm.nextSibling); - if ( post && postId ) - post.value = postId; - parent.value = parentId; - cancel.style.display = ''; - - cancel.onclick = function() { - var t = addComment, temp = t.I('wp-temp-form-div'), respond = t.I(t.respondId); - - if ( ! temp || ! respond ) - return; - - t.I('comment_parent').value = '0'; - temp.parentNode.insertBefore(respond, temp); - temp.parentNode.removeChild(temp); - this.style.display = 'none'; - this.onclick = null; - return false; - } - - try { t.I('comment').focus(); } - catch(e) {} - - return false; - }, - - I : function(e) { - return document.getElementById(e); - } -} diff -uNr a/mp-wp/wp-includes/js/crop/cropper.css b/mp-wp/wp-includes/js/crop/cropper.css --- a/mp-wp/wp-includes/js/crop/cropper.css 8899dfa41ea6c163540020b02c27a6b9fd5db2719b9d122771b3e1e433faa1df5b9698dad13062a8df4b6b41e24c5fe254035a2ae0d86d0891e4af4d7fdd183e +++ b/mp-wp/wp-includes/js/crop/cropper.css false @@ -1,165 +0,0 @@ -.imgCrop_wrap { - /* width: 500px; @done_in_js */ - /* height: 375px; @done_in_js */ - position: relative; - cursor: crosshair; -} - -/* an extra classname is applied for Opera < 9.0 to fix it's lack of opacity support */ -.imgCrop_wrap.opera8 .imgCrop_overlay, -.imgCrop_wrap.opera8 .imgCrop_clickArea { - background-color: transparent; -} - -/* fix for IE displaying all boxes at line-height by default, although they are still 1 pixel high until we combine them with the pointless span */ -.imgCrop_wrap, -.imgCrop_wrap * { - font-size: 0; -} - -.imgCrop_overlay { - background-color: #000; - opacity: 0.5; - filter:alpha(opacity=50); - position: absolute; - width: 100%; - height: 100%; -} - -.imgCrop_selArea { - position: absolute; - /* @done_in_js - top: 20px; - left: 20px; - width: 200px; - height: 200px; - background: transparent url(castle.jpg) no-repeat -210px -110px; - */ - cursor: move; - z-index: 2; -} - -/* clickArea is all a fix for IE 5.5 & 6 to allow the user to click on the given area */ -.imgCrop_clickArea { - width: 100%; - height: 100%; - background-color: #FFF; - opacity: 0.01; - filter:alpha(opacity=01); -} - -.imgCrop_marqueeHoriz { - position: absolute; - width: 100%; - height: 1px; - background: transparent url(marqueeHoriz.svg) repeat-x 0 0; - z-index: 3; -} - -.imgCrop_marqueeVert { - position: absolute; - height: 100%; - width: 1px; - background: transparent url(marqueeVert.svg) repeat-y 0 0; - z-index: 3; -} - -.imgCrop_marqueeNorth { top: 0; left: 0; } -.imgCrop_marqueeEast { top: 0; right: 0; } -.imgCrop_marqueeSouth { bottom: 0px; left: 0; } -.imgCrop_marqueeWest { top: 0; left: 0; } - - -.imgCrop_handle { - position: absolute; - border: 1px solid #333; - width: 6px; - height: 6px; - background: #FFF; - opacity: 0.5; - filter:alpha(opacity=50); - z-index: 4; -} - -/* fix IE 5 box model */ -* html .imgCrop_handle { - width: 8px; - height: 8px; - wid\th: 6px; - hei\ght: 6px; -} - -.imgCrop_handleN { - top: -3px; - left: 0; - /* margin-left: 49%; @done_in_js */ - cursor: n-resize; -} - -.imgCrop_handleNE { - top: -3px; - right: -3px; - cursor: ne-resize; -} - -.imgCrop_handleE { - top: 0; - right: -3px; - /* margin-top: 49%; @done_in_js */ - cursor: e-resize; -} - -.imgCrop_handleSE { - right: -3px; - bottom: -3px; - cursor: se-resize; -} - -.imgCrop_handleS { - right: 0; - bottom: -3px; - /* margin-right: 49%; @done_in_js */ - cursor: s-resize; -} - -.imgCrop_handleSW { - left: -3px; - bottom: -3px; - cursor: sw-resize; -} - -.imgCrop_handleW { - top: 0; - left: -3px; - /* margin-top: 49%; @done_in_js */ - cursor: e-resize; -} - -.imgCrop_handleNW { - top: -3px; - left: -3px; - cursor: nw-resize; -} - -/** - * Create an area to click & drag around on as the default browser behaviour is to let you drag the image - */ -.imgCrop_dragArea { - width: 100%; - height: 100%; - z-index: 200; - position: absolute; - top: 0; - left: 0; -} - -.imgCrop_previewWrap { - /* width: 200px; @done_in_js */ - /* height: 200px; @done_in_js */ - overflow: hidden; - position: relative; -} - -.imgCrop_previewWrap img { - position: absolute; -} \ No newline at end of file diff -uNr a/mp-wp/wp-includes/js/crop/cropper.js b/mp-wp/wp-includes/js/crop/cropper.js --- a/mp-wp/wp-includes/js/crop/cropper.js 2bf793302337c1fd67aea0247024ac417b08296bd55f6d3f1d2b1850fbaa4648adda2c4b2b299469e909e3c44b146bed46d0f5ec18041b36055915896288b82b +++ b/mp-wp/wp-includes/js/crop/cropper.js false @@ -1,516 +0,0 @@ -/** - * Copyright (c) 2006, David Spurr (http://www.defusion.org.uk/) - * 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 the David Spurr 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 OWNER 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. - * - * http://www.opensource.org/licenses/bsd-license.php - * - * See scriptaculous.js for full scriptaculous licence - */ - -var CropDraggable=Class.create(); -Object.extend(Object.extend(CropDraggable.prototype,Draggable.prototype),{initialize:function(_1){ -this.options=Object.extend({drawMethod:function(){ -}},arguments[1]||{}); -this.element=$(_1); -this.handle=this.element; -this.delta=this.currentDelta(); -this.dragging=false; -this.eventMouseDown=this.initDrag.bindAsEventListener(this); -Event.observe(this.handle,"mousedown",this.eventMouseDown); -Draggables.register(this); -},draw:function(_2){ -var _3=Position.cumulativeOffset(this.element); -var d=this.currentDelta(); -_3[0]-=d[0]; -_3[1]-=d[1]; -var p=[0,1].map(function(i){ -return (_2[i]-_3[i]-this.offset[i]); -}.bind(this)); -this.options.drawMethod(p); -}}); -var Cropper={}; -Cropper.Img=Class.create(); -Cropper.Img.prototype={initialize:function(_7,_8){ -this.options=Object.extend({ratioDim:{x:0,y:0},minWidth:0,minHeight:0,displayOnInit:false,onEndCrop:Prototype.emptyFunction,captureKeys:true},_8||{}); -if(this.options.minWidth>0&&this.options.minHeight>0){ -this.options.ratioDim.x=this.options.minWidth; -this.options.ratioDim.y=this.options.minHeight; -} -this.img=$(_7); -this.clickCoords={x:0,y:0}; -this.dragging=false; -this.resizing=false; -this.isWebKit=/Konqueror|Safari|KHTML/.test(navigator.userAgent); -this.isIE=/MSIE/.test(navigator.userAgent); -this.isOpera8=/Opera\s[1-8]/.test(navigator.userAgent); -this.ratioX=0; -this.ratioY=0; -this.attached=false; -$A(document.getElementsByTagName("script")).each(function(s){ -if(s.src.match(/cropper\.js/)){ -var _a=s.src.replace(/cropper\.js(.*)?/,""); -var _b=document.createElement("link"); -_b.rel="stylesheet"; -_b.type="text/css"; -_b.href=_a+"cropper.css"; -_b.media="screen"; -document.getElementsByTagName("head")[0].appendChild(_b); -} -}); -if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0){ -var _c=this.getGCD(this.options.ratioDim.x,this.options.ratioDim.y); -this.ratioX=this.options.ratioDim.x/_c; -this.ratioY=this.options.ratioDim.y/_c; -} -this.subInitialize(); -if(this.img.complete||this.isWebKit){ -this.onLoad(); -}else{ -Event.observe(this.img,"load",this.onLoad.bindAsEventListener(this)); -} -},getGCD:function(a,b){return 1; -if(b==0){ -return a; -} -return this.getGCD(b,a%b); -},onLoad:function(){ -var _f="imgCrop_"; -var _10=this.img.parentNode; -var _11=""; -if(this.isOpera8){ -_11=" opera8"; -} -this.imgWrap=Builder.node("div",{"class":_f+"wrap"+_11}); -if(this.isIE){ -this.north=Builder.node("div",{"class":_f+"overlay "+_f+"north"},[Builder.node("span")]); -this.east=Builder.node("div",{"class":_f+"overlay "+_f+"east"},[Builder.node("span")]); -this.south=Builder.node("div",{"class":_f+"overlay "+_f+"south"},[Builder.node("span")]); -this.west=Builder.node("div",{"class":_f+"overlay "+_f+"west"},[Builder.node("span")]); -var _12=[this.north,this.east,this.south,this.west]; -}else{ -this.overlay=Builder.node("div",{"class":_f+"overlay"}); -var _12=[this.overlay]; -} -this.dragArea=Builder.node("div",{"class":_f+"dragArea"},_12); -this.handleN=Builder.node("div",{"class":_f+"handle "+_f+"handleN"}); -this.handleNE=Builder.node("div",{"class":_f+"handle "+_f+"handleNE"}); -this.handleE=Builder.node("div",{"class":_f+"handle "+_f+"handleE"}); -this.handleSE=Builder.node("div",{"class":_f+"handle "+_f+"handleSE"}); -this.handleS=Builder.node("div",{"class":_f+"handle "+_f+"handleS"}); -this.handleSW=Builder.node("div",{"class":_f+"handle "+_f+"handleSW"}); -this.handleW=Builder.node("div",{"class":_f+"handle "+_f+"handleW"}); -this.handleNW=Builder.node("div",{"class":_f+"handle "+_f+"handleNW"}); -this.selArea=Builder.node("div",{"class":_f+"selArea"},[Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeNorth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeEast"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeSouth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeWest"},[Builder.node("span")]),this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW,Builder.node("div",{"class":_f+"clickArea"})]); -Element.setStyle($(this.selArea),{backgroundColor:"transparent",backgroundRepeat:"no-repeat",backgroundPosition:"0 0"}); -this.imgWrap.appendChild(this.img); -this.imgWrap.appendChild(this.dragArea); -this.dragArea.appendChild(this.selArea); -this.dragArea.appendChild(Builder.node("div",{"class":_f+"clickArea"})); -_10.appendChild(this.imgWrap); -Event.observe(this.dragArea,"mousedown",this.startDrag.bindAsEventListener(this)); -Event.observe(document,"mousemove",this.onDrag.bindAsEventListener(this)); -Event.observe(document,"mouseup",this.endCrop.bindAsEventListener(this)); -var _13=[this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW]; -for(var i=0;i<_13.length;i++){ -Event.observe(_13[i],"mousedown",this.startResize.bindAsEventListener(this)); -} -if(this.options.captureKeys){ -Event.observe(document,"keydown",this.handleKeys.bindAsEventListener(this)); -} -new CropDraggable(this.selArea,{drawMethod:this.moveArea.bindAsEventListener(this)}); -this.setParams(); -},setParams:function(){ -this.imgW=this.img.width; -this.imgH=this.img.height; -if(!this.isIE){ -Element.setStyle($(this.overlay),{width:this.imgW+"px",height:this.imgH+"px"}); -Element.hide($(this.overlay)); -Element.setStyle($(this.selArea),{backgroundImage:"url("+this.img.src+")"}); -}else{ -Element.setStyle($(this.north),{height:0}); -Element.setStyle($(this.east),{width:0,height:0}); -Element.setStyle($(this.south),{height:0}); -Element.setStyle($(this.west),{width:0,height:0}); -} -Element.setStyle($(this.imgWrap),{"width":this.imgW+"px","height":this.imgH+"px"}); -Element.hide($(this.selArea)); -var _15=Position.positionedOffset(this.imgWrap); -this.wrapOffsets={"top":_15[1],"left":_15[0]}; -var _16={x1:0,y1:0,x2:0,y2:0}; -this.setAreaCoords(_16); -if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0&&this.options.displayOnInit){ -_16.x1=Math.ceil((this.imgW-this.options.ratioDim.x)/2); -_16.y1=Math.ceil((this.imgH-this.options.ratioDim.y)/2); -_16.x2=_16.x1+this.options.ratioDim.x; -_16.y2=_16.y1+this.options.ratioDim.y; -Element.show(this.selArea); -this.drawArea(); -this.endCrop(); -} -this.attached=true; -},remove:function(){ -this.attached=false; -this.imgWrap.parentNode.insertBefore(this.img,this.imgWrap); -this.imgWrap.parentNode.removeChild(this.imgWrap); -Event.stopObserving(this.dragArea,"mousedown",this.startDrag.bindAsEventListener(this)); -Event.stopObserving(document,"mousemove",this.onDrag.bindAsEventListener(this)); -Event.stopObserving(document,"mouseup",this.endCrop.bindAsEventListener(this)); -var _17=[this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW]; -for(var i=0;i<_17.length;i++){ -Event.stopObserving(_17[i],"mousedown",this.startResize.bindAsEventListener(this)); -} -if(this.options.captureKeys){ -Event.stopObserving(document,"keydown",this.handleKeys.bindAsEventListener(this)); -} -},reset:function(){ -if(!this.attached){ -this.onLoad(); -}else{ -this.setParams(); -} -this.endCrop(); -},handleKeys:function(e){ -var dir={x:0,y:0}; -if(!this.dragging){ -switch(e.keyCode){ -case (37): -dir.x=-1; -break; -case (38): -dir.y=-1; -break; -case (39): -dir.x=1; -break; -case (40): -dir.y=1; -break; -} -if(dir.x!=0||dir.y!=0){ -if(e.shiftKey){ -dir.x*=10; -dir.y*=10; -} -this.moveArea([this.areaCoords.x1+dir.x,this.areaCoords.y1+dir.y]); -Event.stop(e); -} -} -},calcW:function(){ -return (this.areaCoords.x2-this.areaCoords.x1); -},calcH:function(){ -return (this.areaCoords.y2-this.areaCoords.y1); -},moveArea:function(_1b){ -this.setAreaCoords({x1:_1b[0],y1:_1b[1],x2:_1b[0]+this.calcW(),y2:_1b[1]+this.calcH()},true); -this.drawArea(); -},cloneCoords:function(_1c){ -return {x1:_1c.x1,y1:_1c.y1,x2:_1c.x2,y2:_1c.y2}; -},setAreaCoords:function(_1d,_1e,_1f,_20,_21){ -var _22=typeof _1e!="undefined"?_1e:false; -var _23=typeof _1f!="undefined"?_1f:false; -if(_1e){ -var _24=_1d.x2-_1d.x1; -var _25=_1d.y2-_1d.y1; -if(_1d.x1<0){ -_1d.x1=0; -_1d.x2=_24; -} -if(_1d.y1<0){ -_1d.y1=0; -_1d.y2=_25; -} -if(_1d.x2>this.imgW){ -_1d.x2=this.imgW; -_1d.x1=this.imgW-_24; -} -if(_1d.y2>this.imgH){ -_1d.y2=this.imgH; -_1d.y1=this.imgH-_25; -} -}else{ -if(_1d.x1<0){ -_1d.x1=0; -} -if(_1d.y1<0){ -_1d.y1=0; -} -if(_1d.x2>this.imgW){ -_1d.x2=this.imgW; -} -if(_1d.y2>this.imgH){ -_1d.y2=this.imgH; -} -if(typeof (_20)!="undefined"){ -if(this.ratioX>0){ -this.applyRatio(_1d,{x:this.ratioX,y:this.ratioY},_20,_21); -}else{ -if(_23){ -this.applyRatio(_1d,{x:1,y:1},_20,_21); -} -} -var _26={a1:_1d.x1,a2:_1d.x2}; -var _27={a1:_1d.y1,a2:_1d.y2}; -var _28=this.options.minWidth; -var _29=this.options.minHeight; -if((_28==0||_29==0)&&_23){ -if(_28>0){ -_29=_28; -}else{ -if(_29>0){ -_28=_29; -} -} -} -this.applyMinDimension(_26,_28,_20.x,{min:0,max:this.imgW}); -this.applyMinDimension(_27,_29,_20.y,{min:0,max:this.imgH}); -_1d={x1:_26.a1,y1:_27.a1,x2:_26.a2,y2:_27.a2}; -} -} -this.areaCoords=_1d; -},applyMinDimension:function(_2a,_2b,_2c,_2d){ -if((_2a.a2-_2a.a1)<_2b){ -if(_2c==1){ -_2a.a2=_2a.a1+_2b; -}else{ -_2a.a1=_2a.a2-_2b; -} -if(_2a.a1<_2d.min){ -_2a.a1=_2d.min; -_2a.a2=_2b; -}else{ -if(_2a.a2>_2d.max){ -_2a.a1=_2d.max-_2b; -_2a.a2=_2d.max; -} -} -} -},applyRatio:function(_2e,_2f,_30,_31){ -var _32; -if(_31=="N"||_31=="S"){ -_32=this.applyRatioToAxis({a1:_2e.y1,b1:_2e.x1,a2:_2e.y2,b2:_2e.x2},{a:_2f.y,b:_2f.x},{a:_30.y,b:_30.x},{min:0,max:this.imgW}); -_2e.x1=_32.b1; -_2e.y1=_32.a1; -_2e.x2=_32.b2; -_2e.y2=_32.a2; -}else{ -_32=this.applyRatioToAxis({a1:_2e.x1,b1:_2e.y1,a2:_2e.x2,b2:_2e.y2},{a:_2f.x,b:_2f.y},{a:_30.x,b:_30.y},{min:0,max:this.imgH}); -_2e.x1=_32.a1; -_2e.y1=_32.b1; -_2e.x2=_32.a2; -_2e.y2=_32.b2; -} -},applyRatioToAxis:function(_33,_34,_35,_36){ -var _37=Object.extend(_33,{}); -var _38=_37.a2-_37.a1; -var _3a=Math.floor(_38*_34.b/_34.a); -var _3b; -var _3c; -var _3d=null; -if(_35.b==1){ -_3b=_37.b1+_3a; -if(_3b>_36.max){ -_3b=_36.max; -_3d=_3b-_37.b1; -} -_37.b2=_3b; -}else{ -_3b=_37.b2-_3a; -if(_3b<_36.min){ -_3b=_36.min; -_3d=_3b+_37.b2; -} -_37.b1=_3b; -} -if(_3d!=null){ -_3c=Math.floor(_3d*_34.a/_34.b); -if(_35.a==1){ -_37.a2=_37.a1+_3c; -}else{ -_37.a1=_37.a1=_37.a2-_3c; -} -} -return _37; -},drawArea:function(){ -if(!this.isIE){ -Element.show($(this.overlay)); -} -var _3e=this.calcW(); -var _3f=this.calcH(); -var _40=this.areaCoords.x2; -var _41=this.areaCoords.y2; -var _42=this.selArea.style; -_42.left=this.areaCoords.x1+"px"; -_42.top=this.areaCoords.y1+"px"; -_42.width=_3e+"px"; -_42.height=_3f+"px"; -var _43=Math.ceil((_3e-6)/2)+"px"; -var _44=Math.ceil((_3f-6)/2)+"px"; -this.handleN.style.left=_43; -this.handleE.style.top=_44; -this.handleS.style.left=_43; -this.handleW.style.top=_44; -if(this.isIE){ -this.north.style.height=this.areaCoords.y1+"px"; -var _45=this.east.style; -_45.top=this.areaCoords.y1+"px"; -_45.height=_3f+"px"; -_45.left=_40+"px"; -_45.width=(this.img.width-_40)+"px"; -var _46=this.south.style; -_46.top=_41+"px"; -_46.height=(this.img.height-_41)+"px"; -var _47=this.west.style; -_47.top=this.areaCoords.y1+"px"; -_47.height=_3f+"px"; -_47.width=this.areaCoords.x1+"px"; -}else{ -_42.backgroundPosition="-"+this.areaCoords.x1+"px "+"-"+this.areaCoords.y1+"px"; -} -this.subDrawArea(); -this.forceReRender(); -},forceReRender:function(){ -if(this.isIE||this.isWebKit){ -var n=document.createTextNode(" "); -var d,el,fixEL,i; -if(this.isIE){ -fixEl=this.selArea; -}else{ -if(this.isWebKit){ -fixEl=document.getElementsByClassName("imgCrop_marqueeSouth",this.imgWrap)[0]; -d=Builder.node("div",""); -d.style.visibility="hidden"; -var _4a=["SE","S","SW"]; -for(i=0;i<_4a.length;i++){ -el=document.getElementsByClassName("imgCrop_handle"+_4a[i],this.selArea)[0]; -if(el.childNodes.length){ -el.removeChild(el.childNodes[0]); -} -el.appendChild(d); -} -} -} -fixEl.appendChild(n); -fixEl.removeChild(n); -} -},startResize:function(e){ -this.startCoords=this.cloneCoords(this.areaCoords); -this.resizing=true; -this.resizeHandle=Element.classNames(Event.element(e)).toString().replace(/([^N|NE|E|SE|S|SW|W|NW])+/,""); -Event.stop(e); -},startDrag:function(e){ -Element.show(this.selArea); -this.clickCoords=this.getCurPos(e); -this.setAreaCoords({x1:this.clickCoords.x,y1:this.clickCoords.y,x2:this.clickCoords.x,y2:this.clickCoords.y}); -this.dragging=true; -this.onDrag(e); -Event.stop(e); -},getCurPos:function(e){ -return curPos={x:Event.pointerX(e)-this.wrapOffsets.left,y:Event.pointerY(e)-this.wrapOffsets.top}; -},onDrag:function(e){ -var _4f=null; -if(this.dragging||this.resizing){ -var _50=this.getCurPos(e); -var _51=this.cloneCoords(this.areaCoords); -var _52={x:1,y:1}; -} -if(this.dragging){ -if(_50.x0&&this.options.minHeight>0){ -this.previewWrap=$(this.options.previewWrap); -this.previewImg=this.img.cloneNode(false); -this.options.displayOnInit=true; -this.hasPreviewImg=true; -Element.addClassName(this.previewWrap,"imgCrop_previewWrap"); -Element.setStyle(this.previewWrap,{width:this.options.minWidth+"px",height:this.options.minHeight+"px"}); -this.previewWrap.appendChild(this.previewImg); -} -},subDrawArea:function(){ -if(this.hasPreviewImg){ -var _58=this.calcW(); -var _59=this.calcH(); -var _5a={x:this.imgW/_58,y:this.imgH/_59}; -var _5b={x:_58/this.options.minWidth,y:_59/this.options.minHeight}; -var _5c={w:Math.ceil(this.options.minWidth*_5a.x)+"px",h:Math.ceil(this.options.minHeight*_5a.y)+"px",x:"-"+Math.ceil(this.areaCoords.x1/_5b.x)+"px",y:"-"+Math.ceil(this.areaCoords.y1/_5b.y)+"px"}; -var _5d=this.previewImg.style; -_5d.width=_5c.w; -_5d.height=_5c.h; -_5d.left=_5c.x; -_5d.top=_5c.y; -} -}}); diff -uNr a/mp-wp/wp-includes/js/crop/marqueeHoriz.svg b/mp-wp/wp-includes/js/crop/marqueeHoriz.svg --- a/mp-wp/wp-includes/js/crop/marqueeHoriz.svg 230235ba4c5f9f80f286c3b2426a0b478b0f5e4959786921b46db2a9800d3abe640895348cd6913310c08e94fee1bed235cb17f7502dfceab09fc99ddb6fa037 +++ b/mp-wp/wp-includes/js/crop/marqueeHoriz.svg false @@ -1,9 +0,0 @@ - - - - diff -uNr a/mp-wp/wp-includes/js/crop/marqueeVert.svg b/mp-wp/wp-includes/js/crop/marqueeVert.svg --- a/mp-wp/wp-includes/js/crop/marqueeVert.svg c21d5f910be7f149a6e40c83574fee7f70b66bfc63c02f804e0f0cde42b7d254a600c170d657195c796e3ca27b7e65f27f6c14e81b67e66f0ac01590aed53643 +++ b/mp-wp/wp-includes/js/crop/marqueeVert.svg false @@ -1,10 +0,0 @@ - - - - - diff -uNr a/mp-wp/wp-includes/js/hoverIntent.js b/mp-wp/wp-includes/js/hoverIntent.js --- a/mp-wp/wp-includes/js/hoverIntent.js eb320c34c6b4c630a27566249d5a81f6ee91e9d5a59f350a60e638bd41209ad2d931b57dd3902664ffb12074e771e60b99c10e53ad953ea541158b1fa51a9b08 +++ b/mp-wp/wp-includes/js/hoverIntent.js false @@ -1,128 +0,0 @@ -/** -* hoverIntent is similar to jQuery's built-in "hover" function except that -* instead of firing the onMouseOver event immediately, hoverIntent checks -* to see if the user's mouse has slowed down (beneath the sensitivity -* threshold) before firing the onMouseOver event. -* -* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+ -* -* -* hoverIntent is currently available for use in all personal or commercial -* projects under both MIT and GPL licenses. This means that you can choose -* the license that best suits your project, and use it accordingly. -* -* // basic usage (just like .hover) receives onMouseOver and onMouseOut functions -* $("ul li").hoverIntent( showNav , hideNav ); -* -* // advanced usage receives configuration object only -* $("ul li").hoverIntent({ -* sensitivity: 7, // number = sensitivity threshold (must be 1 or higher) -* interval: 100, // number = milliseconds of polling interval -* over: showNav, // function = onMouseOver callback (required) -* timeout: 0, // number = milliseconds delay before onMouseOut function call -* out: hideNav // function = onMouseOut callback (required) -* }); -* -* @param f onMouseOver function || An object with configuration options -* @param g onMouseOut function || Nothing (use configuration options object) -* @author Brian Cherne -*/ -(function($) { - $.fn.hoverIntent = function(f,g) { - // default configuration options - var cfg = { - sensitivity: 7, - interval: 100, - timeout: 0 - }; - // override configuration options with user supplied object - cfg = $.extend(cfg, g ? { over: f, out: g } : f ); - - // instantiate variables - // cX, cY = current X and Y position of mouse, updated by mousemove event - // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval - var cX, cY, pX, pY; - - // A private function for getting mouse position - var track = function(ev) { - cX = ev.pageX; - cY = ev.pageY; - }; - - // A private function for comparing current and previous mouse position - var compare = function(ev,ob) { - ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); - // compare mouse positions to see if they've crossed the threshold - if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) { - $(ob).unbind("mousemove",track); - // set hoverIntent state to true (so mouseOut can be called) - ob.hoverIntent_s = 1; - return cfg.over.apply(ob,[ev]); - } else { - // set previous coordinates for next time - pX = cX; pY = cY; - // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) - ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval ); - } - }; - - // A private function for delaying the mouseOut function - var delay = function(ev,ob) { - ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); - ob.hoverIntent_s = 0; - return cfg.out.apply(ob,[ev]); - }; - - // workaround for Mozilla bug: not firing mouseout/mouseleave on absolute positioned elements over textareas and input type="text" - var handleHover = function(e) { - var t = this; - - // next two lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut - var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; - while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } } - if ( p == this ) { - if ( $.browser.mozilla ) { - if ( e.type == "mouseout" ) { - t.mtout = setTimeout( function(){doHover(e,t);}, 30 ); - } else { - if (t.mtout) { t.mtout = clearTimeout(t.mtout); } - } - } - return; - } else { - if (t.mtout) { t.mtout = clearTimeout(t.mtout); } - doHover(e,t); - } - }; - - // A private function for handling mouse 'hovering' - var doHover = function(e,ob) { - - // copy objects to be passed into t (required for event object to be passed in IE) - var ev = jQuery.extend({},e); - - // cancel hoverIntent timer if it exists - if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } - - // else e.type == "onmouseover" - if (e.type == "mouseover") { - // set "previous" X and Y position based on initial entry point - pX = ev.pageX; pY = ev.pageY; - // update "current" X and Y position based on mousemove - $(ob).bind("mousemove",track); - // start polling interval (self-calling timeout) to compare mouse coordinates over time - if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} - - // else e.type == "onmouseout" - } else { - // unbind expensive mousemove event - $(ob).unbind("mousemove",track); - // if hoverIntent state is true, then call the mouseOut function after the specified delay - if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );} - } - }; - - // bind the function to the two event listeners - return this.mouseover(handleHover).mouseout(handleHover); - }; -})(jQuery); \ No newline at end of file diff -uNr a/mp-wp/wp-includes/js/jquery/interface.js b/mp-wp/wp-includes/js/jquery/interface.js --- a/mp-wp/wp-includes/js/jquery/interface.js a050beebc2a530ac45925c1c3b2283fc5b09b88791716400f10c1710baa9f0a3c6798e1876d604ad6729ee7a709325f01a80aa0698e68177f01b63cc6a8300c7 +++ b/mp-wp/wp-includes/js/jquery/interface.js false @@ -1,12 +0,0 @@ -/** - * Interface Elements for jQuery - * - * http://interface.eyecon.ro - * - * Copyright (c) 2006 Stefan Petre - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * - */ -eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('A.cP={2l:C(c){G B.1y(C(){if(!c.8Y||!c.8P)G;F b=B;b.2a={9M:c.9M||bz,8Y:c.8Y,8P:c.8P,7R:c.7R||\'du\',9c:c.9c||\'du\',2K:c.2K&&28 c.2K==\'C\'?c.2K:H,2V:c.2K&&28 c.2V==\'C\'?c.2V:H,6D:c.6D&&28 c.6D==\'C\'?c.6D:H,8A:A(c.8Y,B),8a:A(c.8P,B),1l:c.1l||7n,5w:c.5w||0};b.2a.8a.2x().E(\'S\',\'9e\').eq(0).E({S:b.2a.9M+\'Q\',11:\'2v\'}).3m();b.2a.8A.1y(C(a){B.6L=a}).ht(C(){A(B).2H(b.2a.9c)},C(){A(B).3S(b.2a.9c)}).1C(\'4U\',C(e){if(b.2a.5w==B.6L)G;b.2a.8A.eq(b.2a.5w).3S(b.2a.7R).3m().eq(B.6L).2H(b.2a.7R).3m();b.2a.8a.eq(b.2a.5w).4S({S:0},b.2a.1l,C(){B.Y.11=\'1k\';if(b.2a.2V){b.2a.2V.1x(b,[B])}}).3m().eq(B.6L).1S().4S({S:b.2a.9M},b.2a.1l,C(){B.Y.11=\'2v\';if(b.2a.2K){b.2a.2K.1x(b,[B])}}).3m();if(b.2a.6D){b.2a.6D.1x(b,[B,b.2a.8a.I(B.6L),b.2a.8A.I(b.2a.5w),b.2a.8a.I(b.2a.5w)])}b.2a.5w=B.6L}).eq(0).2H(b.2a.7R).3m();A(B).E(\'S\',A(B).E(\'S\')).E(\'2N\',\'2B\')})}};A.fn.fe=A.cP.2l;A.8p={2l:C(h){G B.1y(C(){F c=B;F d=2*Z.2F/eD;F f=2*Z.2F;if(A(c).E(\'T\')!=\'2i\'&&A(c).E(\'T\')!=\'1J\'){A(c).E(\'T\',\'2i\')}c.1i={1M:A(h.1M,B),2y:h.2y,61:h.61,9l:h.9l,iu:f,1N:A.12.2f(B),T:A.12.3a(B),2b:Z.2F/2,b4:h.b4,7K:h.5U,5U:[],93:H,7G:2*Z.2F/eD};c.1i.d8=(c.1i.1N.w-c.1i.2y)/2;c.1i.6Y=(c.1i.1N.h-c.1i.61-c.1i.61*c.1i.7K)/2;c.1i.3f=2*Z.2F/c.1i.1M.1N();c.1i.aS=c.1i.1N.w/2;c.1i.aR=c.1i.1N.h/2-c.1i.61*c.1i.7K;F g=1c.3x(\'1W\');A(g).E({T:\'1J\',3j:1,O:0,M:0});A(c).1L(g);c.1i.1M.1y(C(a){8G=A(\'3O\',B).I(0);S=R(c.1i.61*c.1i.7K);if(A.2R.46){3u=1c.3x(\'3O\');A(3u).E(\'T\',\'1J\');3u.2E=8G.2E;3u.Y.4X=\'fu 9x:9C.9E.a6(1E=60, Y=1, fc=0, f9=0, f5=0, f3=0)\'}L{3u=1c.3x(\'3u\');if(3u.bZ){4j=3u.bZ("2d");3u.Y.T=\'1J\';3u.Y.S=S+\'Q\';3u.Y.V=c.1i.2y+\'Q\';3u.S=S;3u.V=c.1i.2y;4j.eR();4j.eM(0,S);4j.eJ(1,-1);4j.jm(8G,0,0,c.1i.2y,S);4j.bL();4j.jl="jh-3U";F b=4j.jf(0,0,0,S);b.es(1,"eg(1O, 1O, 1O, 1)");b.es(0,"eg(1O, 1O, 1O, 0.6)");4j.j9=b;if(j7.j5.3o(\'iX\')!=-1){4j.iV()}L{4j.iS(0,0,c.1i.2y,S)}}}c.1i.5U[a]=3u;A(g).1L(3u)}).1C(\'9r\',C(e){c.1i.93=14;c.1i.1l=c.1i.7G*0.1*c.1i.1l/Z.3B(c.1i.1l);G H}).1C(\'86\',C(e){c.1i.93=H;G H});A.8p.6z(c);c.1i.1l=c.1i.7G*0.2;c.1i.it=1P.5Y(C(){c.1i.2b+=c.1i.1l;if(c.1i.2b>f)c.1i.2b=0;A.8p.6z(c)},20);A(c).1C(\'86\',C(){c.1i.1l=c.1i.7G*0.2*c.1i.1l/Z.3B(c.1i.1l)}).1C(\'3t\',C(e){if(c.1i.93==H){1A=A.12.3W(e);dr=c.1i.1N.w-1A.x+c.1i.T.x;c.1i.1l=c.1i.b4*c.1i.7G*(c.1i.1N.w/2-dr)/(c.1i.1N.w/2)}})})},6z:C(b){b.1i.1M.1y(C(a){b8=b.1i.2b+a*b.1i.3f;x=b.1i.d8*Z.51(b8);y=b.1i.6Y*Z.7L(b8);do=R(1Y*(b.1i.6Y+y)/(2*b.1i.6Y));dm=(b.1i.6Y+y)/(2*b.1i.6Y);V=R((b.1i.2y-b.1i.9l)*dm+b.1i.9l);S=R(V*b.1i.61/b.1i.2y);B.Y.O=b.1i.aR+y-S/2+"Q";B.Y.M=b.1i.aS+x-V/2+"Q";B.Y.V=V+"Q";B.Y.S=S+"Q";B.Y.3j=do;b.1i.5U[a].Y.O=R(b.1i.aR+y+S-1-S/2)+"Q";b.1i.5U[a].Y.M=R(b.1i.aS+x-V/2)+"Q";b.1i.5U[a].Y.V=V+"Q";b.1i.5U[a].Y.S=R(S*b.1i.7K)+"Q"})}};A.fn.hL=A.8p.2l;A.1U({1e:{b1:C(p,n,a,b,c){G((-Z.51(p*Z.2F)/2)+0.5)*b+a},ho:C(p,n,a,b,c){G b*(n/=c)*n*n+a},d2:C(p,n,a,b,c){G-b*((n=n/c-1)*n*n*n-1)+a},hh:C(p,n,a,b,c){if((n/=c/2)<1)G b/2*n*n*n*n+a;G-b/2*((n-=2)*n*n*n-2)+a},7D:C(p,n,a,b,c){if((n/=c)<(1/2.75)){G b*(7.8W*n*n)+a}L if(n<(2/2.75)){G b*(7.8W*(n-=(1.5/2.75))*n+.75)+a}L if(n<(2.5/2.75)){G b*(7.8W*(n-=(2.25/2.75))*n+.gV)+a}L{G b*(7.8W*(n-=(2.gR/2.75))*n+.gN)+a}},aQ:C(p,n,a,b,c){if(A.1e.7D)G b-A.1e.7D(p,c-n,0,b,c)+a;G a+b},gE:C(p,n,a,b,c){if(A.1e.aQ&&A.1e.7D)if(ng.1z.6q?g.1z.6q:3J;3J=g.1z.6q-3J;bc=g.1z.5R*3J/g.1z.6q;B.Y.V=g.1z.2y+bc+\'Q\';B.Y.M=g.1z.2y*a+c+\'Q\';c+=bc});A.5K.8F(g,c)})})},8F:C(a,b){if(a.1z.4I)if(a.1z.4I==\'az\')a.1z.2q.I(0).Y.M=(a.3P-a.1z.2y*a.1z.1M.1N())/2-b/2+\'Q\';L if(a.1z.4I==\'M\')a.1z.2q.I(0).Y.M=-b/a.1z.1M.1N()+\'Q\';L if(a.1z.4I==\'2D\')a.1z.2q.I(0).Y.M=(a.3P-a.1z.2y*a.1z.1M.1N())-b/2+\'Q\';a.1z.2q.I(0).Y.V=a.1z.2y*a.1z.1M.1N()+b+\'Q\'},6z:C(b){b.1z.1M.1y(C(a){B.Y.V=b.1z.2y+\'Q\';B.Y.M=b.1z.2y*a+\'Q\'})}};A.fn.fz=A.5K.2l;A.K={18:P,7W:P,3q:P,2A:P,4b:P,af:P,2r:P,2h:P,1M:P,58:C(){A.K.7W.58();if(A.K.3q){A.K.3q.2x()}},4i:C(){A.K.1M=P;A.K.2h=P;A.K.4b=A.K.2r.2m;if(A.K.18.E(\'11\')==\'2v\'){if(A.K.2r.1a.fx){2X(A.K.2r.1a.fx.1K){19\'a4\':A.K.18.6d(A.K.2r.1a.fx.1H,A.K.58);1n;19\'1u\':A.K.18.c6(A.K.2r.1a.fx.1H,A.K.58);1n;19\'8o\':A.K.18.c3(A.K.2r.1a.fx.1H,A.K.58);1n}}L{A.K.18.2x()}if(A.K.2r.1a.2V)A.K.2r.1a.2V.1x(A.K.2r,[A.K.18,A.K.3q])}L{A.K.58()}1P.a2(A.K.2A)},c1:C(){F e=A.K.2r;F f=A.K.8C(e);if(e&&f.3w!=A.K.4b&&f.3w.1b>=e.1a.8N){A.K.4b=f.3w;A.K.af=f.3w;9V={bR:A(e).1m(\'eS\')||\'bR\',2m:f.3w};A.eQ({1K:\'eN\',9V:A.eL(9V),eK:C(b){e.1a.3X=A(\'3w\',b);1N=e.1a.3X.1N();if(1N>0){F c=\'\';e.1a.3X.1y(C(a){c+=\'<7b 4o="\'+A(\'2m\',B).3D()+\'" 8h="\'+a+\'" Y="7z: 8T;">\'+A(\'3D\',B).3D()+\'\'});if(e.1a.9K){F d=A(\'2m\',e.1a.3X.I(0)).3D();e.2m=f.30+d+e.1a.3y+f.5m;A.K.64(e,f.3w.1b!=d.1b?(f.30.1b+f.3w.1b):d.1b,f.3w.1b!=d.1b?(f.30.1b+d.1b):d.1b)}if(1N>0){A.K.aU(e,c)}L{A.K.4i()}}L{A.K.4i()}},5v:e.1a.96})}},aU:C(a,b){A.K.7W.3i(b);A.K.1M=A(\'7b\',A.K.7W.I(0));A.K.1M.9r(A.K.en).1C(\'4U\',A.K.ed);F c=A.12.3a(a);F d=A.12.2f(a);A.K.18.E(\'O\',c.y+d.hb+\'Q\').E(\'M\',c.x+\'Q\').2H(a.1a.9D);if(A.K.3q){A.K.3q.E(\'11\',\'2v\').E(\'O\',c.y+d.hb+\'Q\').E(\'M\',c.x+\'Q\').E(\'V\',A.K.18.E(\'V\')).E(\'S\',A.K.18.E(\'S\'))}A.K.2h=0;A.K.1M.I(0).2Z=a.1a.72;A.K.7I(a,a.1a.3X.I(0),\'6H\');if(A.K.18.E(\'11\')==\'1k\'){if(a.1a.bv){F e=A.12.9y(a,14);F f=A.12.6b(a,14);A.K.18.E(\'V\',a.3P-(A.e0?(e.l+e.r+f.l+f.r):0)+\'Q\')}if(a.1a.fx){2X(a.1a.fx.1K){19\'a4\':A.K.18.6U(a.1a.fx.1H);1n;19\'1u\':A.K.18.dR(a.1a.fx.1H);1n;19\'8o\':A.K.18.dP(a.1a.fx.1H);1n}}L{A.K.18.1S()}if(A.K.2r.1a.2K)A.K.2r.1a.2K.1x(A.K.2r,[A.K.18,A.K.3q])}},dM:C(){F b=B;if(b.1a.3X){A.K.4b=b.2m;A.K.af=b.2m;F c=\'\';b.1a.3X.1y(C(a){2m=A(\'2m\',B).3D().5u();dH=b.2m.5u();if(2m.3o(dH)==0){c+=\'<7b 4o="\'+A(\'2m\',B).3D()+\'" 8h="\'+a+\'" Y="7z: 8T;">\'+A(\'3D\',B).3D()+\'\'}});if(c!=\'\'){A.K.aU(b,c);B.1a.9s=14;G}}b.1a.3X=P;B.1a.9s=H},64:C(a,b,c){if(a.9q){F d=a.9q();d.iJ(14);d.dC("bh",b);d.iE("bh",-c+b);d.7Q()}L if(a.9m){a.9m(b,c)}L{if(a.88){a.88=b;a.dA=c}}a.6a()},dw:C(a){if(a.88)G a.88;L if(a.9q){F b=1c.64.dv();F c=b.il();G 0-c.dC(\'bh\',-ij)}},8C:C(a){F b={2m:a.2m,30:\'\',5m:\'\',3w:\'\'};if(a.1a.9k){F c=H;F d=A.K.dw(a)||0;F e=b.2m.6W(a.1a.3y);1V(F i=0;i=d||d==0)&&!c){if(b.30.1b<=d)b.3w=e[i];L b.5m+=e[i]+(e[i]!=\'\'?a.1a.3y:\'\');c=14}L if(c){b.5m+=e[i]+(e[i]!=\'\'?a.1a.3y:\'\')}if(!c){b.30+=e[i]+(e.1b>1?a.1a.3y:\'\')}}}L{b.3w=b.2m}G b},b9:C(e){1P.a2(A.K.2A);F a=A.K.8C(B);F b=e.6S||e.6R||-1;if(/13|27|35|36|38|40|9/.3M(b)&&A.K.1M){if(1P.3N){1P.3N.b6=14;1P.3N.b5=H}L{e.9b();e.99()}if(A.K.2h!=P)A.K.1M.I(A.K.2h||0).2Z=\'\';L A.K.2h=-1;2X(b){19 9:19 13:if(A.K.2h==-1)A.K.2h=0;F c=A.K.1M.I(A.K.2h||0);F d=c.4Z(\'4o\');B.2m=a.30+d+B.1a.3y+a.5m;A.K.4b=a.3w;A.K.64(B,a.30.1b+d.1b+B.1a.3y.1b,a.30.1b+d.1b+B.1a.3y.1b);A.K.4i();if(B.1a.5p){4E=R(c.4Z(\'8h\'))||0;A.K.7I(B,B.1a.3X.I(4E),\'5p\')}if(B.6O)B.6O(H);G b!=13;1n;19 27:B.2m=a.30+A.K.4b+B.1a.3y+a.5m;B.1a.3X=P;A.K.4i();if(B.6O)B.6O(H);G H;1n;19 35:A.K.2h=A.K.1M.1N()-1;1n;19 36:A.K.2h=0;1n;19 38:A.K.2h--;if(A.K.2h<0)A.K.2h=A.K.1M.1N()-1;1n;19 40:A.K.2h++;if(A.K.2h==A.K.1M.1N())A.K.2h=0;1n}A.K.7I(B,B.1a.3X.I(A.K.2h||0),\'6H\');A.K.1M.I(A.K.2h||0).2Z=B.1a.72;if(A.K.1M.I(A.K.2h||0).6O)A.K.1M.I(A.K.2h||0).6O(H);if(B.1a.9K){F f=A.K.1M.I(A.K.2h||0).4Z(\'4o\');B.2m=a.30+f+B.1a.3y+a.5m;if(A.K.4b.1b!=f.1b)A.K.64(B,a.30.1b+A.K.4b.1b,a.30.1b+f.1b)}G H}A.K.dM.1x(B);if(B.1a.9s==H){if(a.3w!=A.K.4b&&a.3w.1b>=B.1a.8N)A.K.2A=1P.97(A.K.c1,B.1a.4w);if(A.K.1M){A.K.4i()}}G 14},7I:C(a,b,c){if(a.1a[c]){F d={};94=b.dj(\'*\');1V(i=0;i<94.1b;i++){d[94[i].4D]=94[i].6M.hG}a.1a[c].1x(a,[d])}},en:C(e){if(A.K.1M){if(A.K.2h!=P)A.K.1M.I(A.K.2h||0).2Z=\'\';A.K.1M.I(A.K.2h||0).2Z=\'\';A.K.2h=R(B.4Z(\'8h\'))||0;A.K.1M.I(A.K.2h||0).2Z=A.K.2r.1a.72}},ed:C(a){1P.a2(A.K.2A);a=a||A.3N.hD(1P.3N);a.9b();a.99();F b=A.K.8C(A.K.2r);F c=B.4Z(\'4o\');A.K.2r.2m=b.30+c+A.K.2r.1a.3y+b.5m;A.K.4b=B.4Z(\'4o\');A.K.64(A.K.2r,b.30.1b+c.1b+A.K.2r.1a.3y.1b,b.30.1b+c.1b+A.K.2r.1a.3y.1b);A.K.4i();if(A.K.2r.1a.5p){4E=R(B.4Z(\'8h\'))||0;A.K.7I(A.K.2r,A.K.2r.1a.3X.I(4E),\'5p\')}G H},dh:C(e){6K=e.6S||e.6R||-1;if(/13|27|35|36|38|40/.3M(6K)&&A.K.1M){if(1P.3N){1P.3N.b6=14;1P.3N.b5=H}L{e.9b();e.99()}G H}},2l:C(a){if(!a.96||!A.12){G}if(!A.K.18){if(A.2R.46){A(\'23\',1c).1L(\'<3q Y="11:1k;T:1J;4X:9x:9C.9E.a6(1E=0);" id="df" 2E="dc:H;" da="0" d7="b0">\');A.K.3q=A(\'#df\')}A(\'23\',1c).1L(\'<1W id="d4" Y="T: 1J; O: 0; M: 0; z-aY: hj; 11: 1k;"><90 Y="5X: 0;7E: 0; h9-Y: 1k; z-aY: h8;">&6G;\');A.K.18=A(\'#d4\');A.K.7W=A(\'90\',A.K.18)}G B.1y(C(){if(B.4D!=\'aV\'&&B.4Z(\'1K\')!=\'3D\')G;B.1a={};B.1a.96=a.96;B.1a.8N=Z.3B(R(a.8N)||1);B.1a.9D=a.9D?a.9D:\'\';B.1a.72=a.72?a.72:\'\';B.1a.5p=a.5p&&a.5p.1F==2w?a.5p:P;B.1a.2K=a.2K&&a.2K.1F==2w?a.2K:P;B.1a.2V=a.2V&&a.2V.1F==2w?a.2V:P;B.1a.6H=a.6H&&a.6H.1F==2w?a.6H:P;B.1a.bv=a.bv||H;B.1a.9k=a.9k||H;B.1a.3y=B.1a.9k?(a.3y||\', \'):\'\';B.1a.9K=a.9K?14:H;B.1a.4w=Z.3B(R(a.4w)||8V);if(a.fx&&a.fx.1F==6E){if(!a.fx.1K||!/a4|1u|8o/.3M(a.fx.1K)){a.fx.1K=\'1u\'}if(a.fx.1K==\'1u\'&&!A.fx.1u)G;if(a.fx.1K==\'8o\'&&!A.fx.5l)G;a.fx.1H=Z.3B(R(a.fx.1H)||7n);if(a.fx.1H>B.1a.4w){a.fx.1H=B.1a.4w-1Y}B.1a.fx=a.fx}B.1a.3X=P;B.1a.9s=H;A(B).1m(\'b9\',\'cW\').6a(C(){A.K.2r=B;A.K.4b=B.2m}).cV(A.K.dh).5Q(A.K.b9).4W(C(){A.K.2A=1P.97(A.K.4i,gM)})})}};A.fn.gJ=A.K.2l;A.1t={2A:P,4k:P,1X:P,3f:10,2b:C(a,b,c,d){A.1t.4k=a;A.1t.1X=b;A.1t.3f=R(c)||10;A.1t.2A=1P.5Y(A.1t.cR,R(d)||40)},cR:C(){1V(i=0;i0&&A.1t.1X[i].2J.y+A.1t.1X[i].2J.t>5a.y){A.1t.1X[i].2T-=A.1t.3f}L if(A.1t.1X[i].2J.t<=A.1t.1X[i].2J.h&&A.1t.1X[i].2J.t+A.1t.1X[i].2J.hb<5a.y+5a.hb){A.1t.1X[i].2T+=A.1t.3f}if(A.1t.1X[i].2J.l>0&&A.1t.1X[i].2J.x+A.1t.1X[i].2J.l>5a.x){A.1t.1X[i].2P-=A.1t.3f}L if(A.1t.1X[i].2J.l<=A.1t.1X[i].2J.gf&&A.1t.1X[i].2J.l+A.1t.1X[i].2J.1D<5a.x+5a.1D){A.1t.1X[i].2P+=A.1t.3f}}},7w:C(){1P.5h(A.1t.2A);A.1t.4k=P;A.1t.1X=P;1V(i in A.1t.1X){A.1t.1X[i].2J=P}}};A.X={18:P,1g:P,4v:C(){G B.1y(C(){if(B.8L){B.D.cM.3h(\'4R\',A.X.aM);B.D=P;B.8L=H;if(A.2R.46){B.aI="cW"}L{B.Y.g0=\'\';B.Y.cJ=\'\';B.Y.cH=\'\'}}})},aM:C(e){if(A.X.1g!=P){A.X.8I(e);G H}F a=B.3H;A(1c).1C(\'3t\',A.X.aE).1C(\'5n\',A.X.8I);a.D.1A=A.12.3W(e);a.D.4d=a.D.1A;a.D.6g=H;a.D.fY=B!=B.3H;A.X.1g=a;if(a.D.4P&&B!=B.3H){aC=A.12.3a(a.2S);aZ=A.12.2f(a);ay={x:R(A.E(a,\'M\'))||0,y:R(A.E(a,\'O\'))||0};dx=a.D.4d.x-aC.x-aZ.1D/2-ay.x;dy=a.D.4d.y-aC.y-aZ.hb/2-ay.y;A.2Q.4s(a,[dx,dy])}G A.6J||H},cD:C(e){F a=A.X.1g;a.D.6g=14;F b=a.Y;a.D.6o=A.E(a,\'11\');a.D.49=A.E(a,\'T\');if(!a.D.av)a.D.av=a.D.49;a.D.22={x:R(A.E(a,\'M\'))||0,y:R(A.E(a,\'O\'))||0};a.D.8z=0;a.D.8y=0;if(A.2R.46){F c=A.12.6b(a,14);a.D.8z=c.l||0;a.D.8y=c.t||0}a.D.1w=A.1U(A.12.3a(a),A.12.2f(a));if(a.D.49!=\'2i\'&&a.D.49!=\'1J\'){b.T=\'2i\'}A.X.18.58();F d=A(a).cA(14).I(0);A(d).E({11:\'2v\',M:\'2G\',O:\'2G\'});d.Y.4M=\'0\';d.Y.53=\'0\';d.Y.4L=\'0\';d.Y.4K=\'0\';A.X.18.1L(d);F f=A.X.18.I(0).Y;if(a.D.ar){f.V=\'8x\';f.S=\'8x\'}L{f.S=a.D.1w.hb+\'Q\';f.V=a.D.1w.1D+\'Q\'}f.11=\'2v\';f.4M=\'2G\';f.53=\'2G\';f.4L=\'2G\';f.4K=\'2G\';A.1U(a.D.1w,A.12.2f(d));if(a.D.2M){if(a.D.2M.M){a.D.22.x+=a.D.1A.x-a.D.1w.x-a.D.2M.M;a.D.1w.x=a.D.1A.x-a.D.2M.M}if(a.D.2M.O){a.D.22.y+=a.D.1A.y-a.D.1w.y-a.D.2M.O;a.D.1w.y=a.D.1A.y-a.D.2M.O}if(a.D.2M.2D){a.D.22.x+=a.D.1A.x-a.D.1w.x-a.D.1w.hb+a.D.2M.2D;a.D.1w.x=a.D.1A.x-a.D.1w.1D+a.D.2M.2D}if(a.D.2M.4e){a.D.22.y+=a.D.1A.y-a.D.1w.y-a.D.1w.hb+a.D.2M.4e;a.D.1w.y=a.D.1A.y-a.D.1w.hb+a.D.2M.4e}}a.D.2n=a.D.22.x;a.D.2j=a.D.22.y;if(a.D.7V||a.D.2e==\'7X\'){7Z=A.12.6b(a.2S,14);a.D.1w.x=a.7Y+(A.2R.46?0:A.2R.6l?-7Z.l:7Z.l);a.D.1w.y=a.7t+(A.2R.46?0:A.2R.6l?-7Z.t:7Z.t);A(a.2S).1L(A.X.18.I(0))}if(a.D.2e){A.X.ah(a);a.D.4V.2e=A.X.ae}if(a.D.4P){A.2Q.ad(a)}f.M=a.D.1w.x-a.D.8z+\'Q\';f.O=a.D.1w.y-a.D.8y+\'Q\';f.V=a.D.1w.1D+\'Q\';f.S=a.D.1w.hb+\'Q\';A.X.1g.D.8w=H;if(a.D.gx){a.D.4V.5y=A.X.a9}if(a.D.3j!=H){A.X.18.E(\'3j\',a.D.3j)}if(a.D.1E){A.X.18.E(\'1E\',a.D.1E);if(1P.6j){A.X.18.E(\'4X\',\'7s(1E=\'+a.D.1E*1Y+\')\')}}if(a.D.6i){A.X.18.2H(a.D.6i);A.X.18.I(0).6M.Y.11=\'1k\'}if(a.D.4c)a.D.4c.1x(a,[d,a.D.22.x,a.D.22.y]);if(A.1s&&A.1s.7p>0){A.1s.ck(a)}if(a.D.3L==H){b.11=\'1k\'}G H},ah:C(a){if(a.D.2e.1F==8t){if(a.D.2e==\'7X\'){a.D.1Z=A.1U({x:0,y:0},A.12.2f(a.2S));F b=A.12.6b(a.2S,14);a.D.1Z.w=a.D.1Z.1D-b.l-b.r;a.D.1Z.h=a.D.1Z.hb-b.t-b.b}L if(a.D.2e==\'1c\'){F c=A.12.a5();a.D.1Z={x:0,y:0,w:c.w,h:c.h}}}L if(a.D.2e.1F==6h){a.D.1Z={x:R(a.D.2e[0])||0,y:R(a.D.2e[1])||0,w:R(a.D.2e[2])||0,h:R(a.D.2e[3])||0}}a.D.1Z.dx=a.D.1Z.x-a.D.1w.x;a.D.1Z.dy=a.D.1Z.y-a.D.1w.y},8r:C(a){if(a.D.7V||a.D.2e==\'7X\'){A(\'23\',1c).1L(A.X.18.I(0))}A.X.18.58().2x().E(\'1E\',1);if(1P.6j){A.X.18.E(\'4X\',\'7s(1E=1Y)\')}},8I:C(e){A(1c).3h(\'3t\',A.X.aE).3h(\'5n\',A.X.8I);if(A.X.1g==P){G}F a=A.X.1g;A.X.1g=P;if(a.D.6g==H){G H}if(a.D.3I==14){A(a).E(\'T\',a.D.49)}F b=a.Y;if(a.4P){A.X.18.E(\'7z\',\'7g\')}if(a.D.6i){A.X.18.3S(a.D.6i)}if(a.D.5B==H){if(a.D.fx>0){if(!a.D.2g||a.D.2g==\'3Z\'){F x=W A.fx(a,{1H:a.D.fx},\'M\');x.1G(a.D.22.x,a.D.7i)}if(!a.D.2g||a.D.2g==\'3K\'){F y=W A.fx(a,{1H:a.D.fx},\'O\');y.1G(a.D.22.y,a.D.7k)}}L{if(!a.D.2g||a.D.2g==\'3Z\')a.Y.M=a.D.7i+\'Q\';if(!a.D.2g||a.D.2g==\'3K\')a.Y.O=a.D.7k+\'Q\'}A.X.8r(a);if(a.D.3L==H){A(a).E(\'11\',a.D.6o)}}L if(a.D.fx>0){a.D.8w=14;F c=H;if(A.1s&&A.1p&&a.D.3I){c=A.12.3a(A.1p.18.I(0))}A.X.18.4S({M:c?c.x:a.D.1w.x,O:c?c.y:a.D.1w.y},a.D.fx,C(){a.D.8w=H;if(a.D.3L==H){a.Y.11=a.D.6o}A.X.8r(a)})}L{A.X.8r(a);if(a.D.3L==H){A(a).E(\'11\',a.D.6o)}}if(A.1s&&A.1s.7p>0){A.1s.c8(a)}if(A.1p&&a.D.3I){A.1p.c7(a)}if(a.D.2I&&(a.D.7i!=a.D.22.x||a.D.7k!=a.D.22.y)){a.D.2I.1x(a,a.D.aa||[0,0,a.D.7i,a.D.7k])}if(a.D.3C)a.D.3C.1x(a);G H},a9:C(x,y,a,b){if(a!=0)a=R((a+(B.D.gx*a/Z.3B(a))/2)/B.D.gx)*B.D.gx;if(b!=0)b=R((b+(B.D.gy*b/Z.3B(b))/2)/B.D.gy)*B.D.gy;G{dx:a,dy:b,x:0,y:0}},ae:C(x,y,a,b){a=Z.3k(Z.3g(a,B.D.1Z.dx),B.D.1Z.w+B.D.1Z.dx-B.D.1w.1D);b=Z.3k(Z.3g(b,B.D.1Z.dy),B.D.1Z.h+B.D.1Z.dy-B.D.1w.hb);G{dx:a,dy:b,x:0,y:0}},aE:C(e){if(A.X.1g==P||A.X.1g.D.8w==14){G}F a=A.X.1g;a.D.4d=A.12.3W(e);if(a.D.6g==H){3J=Z.cB(Z.5j(a.D.1A.x-a.D.4d.x,2)+Z.5j(a.D.1A.y-a.D.4d.y,2));if(3J0){A.1s.8n(a)}G H},2l:C(o){if(!A.X.18){A(\'23\',1c).1L(\'<1W id="bX">\');A.X.18=A(\'#bX\');F c=A.X.18.I(0);F d=c.Y;d.T=\'1J\';d.11=\'1k\';d.7z=\'7g\';d.bV=\'1k\';d.2N=\'2B\';if(1P.6j){c.aI="bU"}L{d.eZ=\'1k\';d.cH=\'1k\';d.cJ=\'1k\'}}if(!o){o={}}G B.1y(C(){if(B.8L||!A.12)G;if(1P.6j){B.eX=C(){G H};B.eW=C(){G H}}F a=B;F b=o.3c?A(B).eV(o.3c):A(B);if(A.2R.46){b.1y(C(){B.aI="bU"})}L{b.E(\'-eU-6f-7Q\',\'1k\');b.E(\'6f-7Q\',\'1k\');b.E(\'-eT-6f-7Q\',\'1k\')}B.D={cM:b,5B:o.5B?14:H,3L:o.3L?14:H,3I:o.3I?o.3I:H,4P:o.4P?o.4P:H,7V:o.7V?o.7V:H,3j:o.3j?R(o.3j)||0:H,1E:o.1E?2c(o.1E):H,fx:R(o.fx)||P,5z:o.5z?o.5z:H,4V:{},1A:{},4c:o.4c&&o.4c.1F==2w?o.4c:H,3C:o.3C&&o.3C.1F==2w?o.3C:H,2I:o.2I&&o.2I.1F==2w?o.2I:H,2g:/3K|3Z/.3M(o.2g)?o.2g:H,5D:o.5D?R(o.5D)||0:0,2M:o.2M?o.2M:H,ar:o.ar?14:H,6i:o.6i||H};if(o.4V&&o.4V.1F==2w)B.D.4V.6f=o.4V;if(o.4h&&o.4h.1F==2w)B.D.4h=o.4h;if(o.2e&&((o.2e.1F==8t&&(o.2e==\'7X\'||o.2e==\'1c\'))||(o.2e.1F==6h&&o.2e.1b==4))){B.D.2e=o.2e}if(o.2C){B.D.2C=o.2C}if(o.5y){if(28 o.5y==\'eO\'){B.D.gx=R(o.5y)||1;B.D.gy=R(o.5y)||1}L if(o.5y.1b==2){B.D.gx=R(o.5y[0])||1;B.D.gy=R(o.5y[1])||1}}if(o.3n&&o.3n.1F==2w){B.D.3n=o.3n}B.8L=14;b.1y(C(){B.3H=a});b.1C(\'4R\',A.X.aM)})}};A.fn.1U({8j:A.X.4v,6r:A.X.2l});A.1s={bP:C(a,b,c,d){G a<=A.X.1g.D.2n&&(a+c)>=(A.X.1g.D.2n+A.X.1g.D.1w.w)&&b<=A.X.1g.D.2j&&(b+d)>=(A.X.1g.D.2j+A.X.1g.D.1w.h)?14:H},9S:C(a,b,c,d){G!(a>(A.X.1g.D.2n+A.X.1g.D.1w.w)||(a+c)(A.X.1g.D.2j+A.X.1g.D.1w.h)||(b+d)A.X.1g.D.4d.x&&bA.X.1g.D.4d.y?14:H},4T:H,3z:{},7p:0,3p:{},ck:C(a){if(A.X.1g==P){G}F i;A.1s.3z={};F b=H;1V(i in A.1s.3p){if(A.1s.3p[i]!=P){F c=A.1s.3p[i].I(0);if(A(A.X.1g).is(\'.\'+c.1f.a)){if(c.1f.m==H){c.1f.p=A.1U(A.12.6x(c),A.12.6w(c));c.1f.m=14}if(c.1f.ac){A.1s.3p[i].2H(c.1f.ac)}A.1s.3z[i]=A.1s.3p[i];if(A.1p&&c.1f.s&&A.X.1g.D.3I){c.1f.el=A(\'.\'+c.1f.a,c);a.Y.11=\'1k\';A.1p.bM(c);c.1f.9P=A.1p.8g(A.1m(c,\'id\')).6A;a.Y.11=a.D.6o;b=14}if(c.1f.9O){c.1f.9O.1x(A.1s.3p[i].I(0),[A.X.1g])}}}}if(b){A.1p.2b()}},eF:C(){A.1s.3z={};1V(i in A.1s.3p){if(A.1s.3p[i]!=P){F a=A.1s.3p[i].I(0);if(A(A.X.1g).is(\'.\'+a.1f.a)){a.1f.p=A.1U(A.12.6x(a),A.12.6w(a));if(a.1f.ac){A.1s.3p[i].2H(a.1f.ac)}A.1s.3z[i]=A.1s.3p[i];if(A.1p&&a.1f.s&&A.X.1g.D.3I){a.1f.el=A(\'.\'+a.1f.a,a);bJ.Y.11=\'1k\';A.1p.bM(a);bJ.Y.11=bJ.D.6o}}}}},8n:C(e){if(A.X.1g==P){G}A.1s.4T=H;F i;F a=H;F b=0;1V(i in A.1s.3z){F c=A.1s.3z[i].I(0);if(A.1s.4T==H&&A.1s[c.1f.t](c.1f.p.x,c.1f.p.y,c.1f.p.1D,c.1f.p.hb)){if(c.1f.hc&&c.1f.h==H){A.1s.3z[i].2H(c.1f.hc)}if(c.1f.h==H&&c.1f.76){a=14}c.1f.h=14;A.1s.4T=c;if(A.1p&&c.1f.s&&A.X.1g.D.3I){A.1p.18.I(0).2Z=c.1f.eC;A.1p.8n(c)}b++}L if(c.1f.h==14){if(c.1f.6C){c.1f.6C.1x(c,[e,A.X.18.I(0).6M,c.1f.fx])}if(c.1f.hc){A.1s.3z[i].3S(c.1f.hc)}c.1f.h=H}}if(A.1p&&!A.1s.4T&&A.X.1g.3I){A.1p.18.I(0).Y.11=\'1k\'}if(a){A.1s.4T.1f.76.1x(A.1s.4T,[e,A.X.18.I(0).6M])}},c8:C(e){F i;1V(i in A.1s.3z){F a=A.1s.3z[i].I(0);if(a.1f.ac){A.1s.3z[i].3S(a.1f.ac)}if(a.1f.hc){A.1s.3z[i].3S(a.1f.hc)}if(a.1f.s){A.1p.73[A.1p.73.1b]=i}if(a.1f.9I&&a.1f.h==14){a.1f.h=H;a.1f.9I.1x(a,[e,a.1f.fx])}a.1f.m=H;a.1f.h=H}A.1s.3z={}},4v:C(){G B.1y(C(){if(B.8S){if(B.1f.s){id=A.1m(B,\'id\');A.1p.54[id]=P;A(\'.\'+B.1f.a,B).8j()}A.1s.3p[\'d\'+B.bG]=P;B.8S=H;B.f=P}})},2l:C(o){G B.1y(C(){if(B.8S==14||!o.3r||!A.12||!A.X){G}B.1f={a:o.3r,ac:o.9F||H,hc:o.8X||H,eC:o.4G||H,9I:o.je||o.9I||H,76:o.76||o.ev||H,6C:o.6C||o.er||H,9O:o.9O||H,t:o.5T&&(o.5T==\'bP\'||o.5T==\'9S\')?o.5T:\'1A\',fx:o.fx?o.fx:H,m:H,h:H};if(o.bC==14&&A.1p){id=A.1m(B,\'id\');A.1p.54[id]=B.1f.a;B.1f.s=14;if(o.2I){B.1f.2I=o.2I;B.1f.9P=A.1p.8g(id).6A}}B.8S=14;B.bG=R(Z.63()*aW);A.1s.3p[\'d\'+B.bG]=A(B);A.1s.7p++})}};A.fn.1U({ei:A.1s.4v,ee:A.1s.2l});A.jd=A.1s.eF;A.3l={18:P,89:C(){3D=B.2m;if(!3D)G;Y={eb:A(B).E(\'eb\')||\'\',4a:A(B).E(\'4a\')||\'\',87:A(B).E(\'87\')||\'\',e9:A(B).E(\'e9\')||\'\',e8:A(B).E(\'e8\')||\'\',e7:A(B).E(\'e7\')||\'\',bx:A(B).E(\'bx\')||\'\',e6:A(B).E(\'e6\')||\'\'};A.3l.18.E(Y);3i=A.3l.e5(3D);3i=3i.48(W bw("\\\\n","g"),"
    ");A.3l.18.3i(\'j6\');b3=A.3l.18.I(0).3P;A.3l.18.3i(3i);V=A.3l.18.I(0).3P+b3;if(B.66.65&&V>B.66.65[0]){V=B.66.65[0]}B.Y.V=V+\'Q\';if(B.4D==\'bs\'){S=A.3l.18.I(0).5r+b3;if(B.66.65&&S>B.66.65[1]){S=B.66.65[1]}B.Y.S=S+\'Q\'}},e5:C(a){bq={\'&\':\'&j1;\',\'<\':\'&j0;\',\'>\':\'>\',\'"\':\'&iZ;\'};1V(i in bq){a=a.48(W bw(i,\'g\'),bq[i])}G a},2l:C(a){if(A.3l.18==P){A(\'23\',1c).1L(\'<1W id="dX" Y="T: 1J; O: 0; M: 0; 2W: 2B;">\');A.3l.18=A(\'#dX\')}G B.1y(C(){if(/bs|aV/.3M(B.4D)){if(B.4D==\'aV\'){dT=B.4Z(\'1K\');if(!/3D|iW/.3M(dT)){G}}if(a&&(a.1F==bm||(a.1F==6h&&a.1b==2))){if(a.1F==bm)a=[a,a];L{a[0]=R(a[0])||7n;a[1]=R(a[1])||7n}B.66={65:a}}A(B).4W(A.3l.89).5Q(A.3l.89).cV(A.3l.89);A.3l.89.1x(B)}})}};A.fn.iU=A.3l.2l;A.fn.1U({c3:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'4l\',c)})},dP:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'41\',c)})},iQ:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'dG\',c)})},iM:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'M\',c)})},iL:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'2D\',c)})},iK:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.5l(B,a,b,\'dF\',c)})}});A.fx.5l=C(e,a,b,c,d){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;z.el=A(e);z.1N=A.12.2f(e);z.1e=28 b==\'4B\'?b:d||P;if(!e.4f)e.4f=z.el.E(\'11\');if(c==\'dG\'){c=z.el.E(\'11\')==\'1k\'?\'41\':\'4l\'}L if(c==\'dF\'){c=z.el.E(\'11\')==\'1k\'?\'2D\':\'M\'}z.el.1S();z.1l=a;z.29=28 b==\'C\'?b:P;z.fx=A.fx.9u(e);z.6T=c;z.1T=C(){if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}if(z.6T==\'41\'||z.6T==\'2D\'){z.el.E(\'11\',z.el.I(0).4f==\'1k\'?\'2v\':z.el.I(0).4f)}L{z.el.2x()}A.fx.9n(z.fx.2Y.I(0),z.fx.U);A.2z(z.el.I(0),\'1j\')};2X(z.6T){19\'4l\':5q=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'S\');5q.1G(z.fx.U.1o.hb,0);1n;19\'41\':z.fx.2Y.E(\'S\',\'9e\');z.el.1S();5q=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'S\');5q.1G(0,z.fx.U.1o.hb);1n;19\'M\':5q=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'V\');5q.1G(z.fx.U.1o.1D,0);1n;19\'2D\':z.fx.2Y.E(\'V\',\'9e\');z.el.1S();5q=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'V\');5q.1G(0,z.fx.U.1o.1D);1n}};A.fn.iA=C(a,b){G B.1r(\'1j\',C(){if(!A.4n(B)){A.2z(B,\'1j\');G H}F e=W A.fx.eu(B,a,b);e.bE()})};A.fx.eu=C(e,a,b){F z=B;z.el=A(e);z.el.1S();z.29=b;z.8e=R(a)||40;z.U={};z.U.T=z.el.E(\'T\');z.U.O=R(z.el.E(\'O\'))||0;z.U.M=R(z.el.E(\'M\'))||0;if(z.U.T!=\'2i\'&&z.U.T!=\'1J\'){z.el.E(\'T\',\'2i\')}z.74=5;z.52=1;z.bE=C(){z.52++;z.e=W A.fx(z.el.I(0),{1H:io,1T:C(){z.e=W A.fx(z.el.I(0),{1H:80,1T:C(){z.8e=R(z.8e/2);if(z.52<=z.74)z.bE();L{z.el.E(\'T\',z.U.T).E(\'O\',z.U.O+\'Q\').E(\'M\',z.U.M+\'Q\');A.2z(z.el.I(0),\'1j\');if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}}}},\'O\');z.e.1G(z.U.O-z.8e,z.U.O)}},\'O\');z.e.1G(z.U.O,z.U.O-z.8e)}};A.fn.1U({im:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'41\',\'3U\',c)})},ik:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'41\',\'in\',c)})},ii:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'41\',\'3E\',c)})},ig:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'4l\',\'3U\',c)})},ie:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'4l\',\'in\',c)})},ic:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'4l\',\'3E\',c)})},ib:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'M\',\'3U\',c)})},ia:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'M\',\'in\',c)})},i9:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'M\',\'3E\',c)})},i8:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'2D\',\'3U\',c)})},i7:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'2D\',\'in\',c)})},i6:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.3Y(B,a,b,\'2D\',\'3E\',c)})}});A.fx.3Y=C(e,a,b,c,d,f){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;z.el=A(e);z.1e=28 b==\'4B\'?b:f||P;z.U={};z.U.T=z.el.E(\'T\');z.U.O=z.el.E(\'O\');z.U.M=z.el.E(\'M\');if(!e.4f)e.4f=z.el.E(\'11\');if(d==\'3E\'){d=z.el.E(\'11\')==\'1k\'?\'in\':\'3U\'}z.el.1S();if(z.U.T!=\'2i\'&&z.U.T!=\'1J\'){z.el.E(\'T\',\'2i\')}z.1K=d;b=28 b==\'C\'?b:P;7N=1;2X(c){19\'4l\':z.e=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'O\');z.5x=2c(z.U.O)||0;z.9i=z.dt;7N=-1;1n;19\'41\':z.e=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'O\');z.5x=2c(z.U.O)||0;z.9i=z.dt;1n;19\'2D\':z.e=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'M\');z.5x=2c(z.U.M)||0;z.9i=z.ds;1n;19\'M\':z.e=W A.fx(z.el.I(0),A.1l(a-15,z.1e,b),\'M\');z.5x=2c(z.U.M)||0;z.9i=z.ds;7N=-1;1n}z.e2=W A.fx(z.el.I(0),A.1l(a,z.1e,C(){z.el.E(z.U);if(z.1K==\'3U\'){z.el.E(\'11\',\'1k\')}L z.el.E(\'11\',z.el.I(0).4f==\'1k\'?\'2v\':z.el.I(0).4f);A.2z(z.el.I(0),\'1j\')}),\'1E\');if(d==\'in\'){z.e.1G(z.5x+1Y*7N,z.5x);z.e2.1G(0,1)}L{z.e.1G(z.5x,z.5x+1Y*7N);z.e2.1G(1,0)}};A.fn.1U({i5:C(a,b,c,d){G B.1r(\'1j\',C(){W A.fx.9h(B,a,b,c,\'dq\',d)})},i4:C(a,b,c,d){G B.1r(\'1j\',C(){W A.fx.9h(B,a,b,c,\'9g\',d)})},i3:C(a,b,c,d){G B.1r(\'1j\',C(){W A.fx.9h(B,a,b,c,\'3E\',d)})}});A.fx.9h=C(e,a,b,c,d,f){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;z.el=A(e);z.1e=28 c==\'4B\'?c:f||P;z.29=28 c==\'C\'?c:P;if(d==\'3E\'){d=z.el.E(\'11\')==\'1k\'?\'9g\':\'dq\'}z.1l=a;z.S=b&&b.1F==bm?b:20;z.fx=A.fx.9u(e);z.1K=d;z.1T=C(){if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}if(z.1K==\'9g\'){z.el.1S()}L{z.el.2x()}A.fx.9n(z.fx.2Y.I(0),z.fx.U);A.2z(z.el.I(0),\'1j\')};if(z.1K==\'9g\'){z.el.1S();z.fx.2Y.E(\'S\',z.S+\'Q\').E(\'V\',\'9e\');z.ef=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,C(){z.ef=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'S\');z.ef.1G(z.S,z.fx.U.1o.hb)}),\'V\');z.ef.1G(0,z.fx.U.1o.1D)}L{z.ef=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,C(){z.ef=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e,z.1T),\'V\');z.ef.1G(z.fx.U.1o.1D,0)}),\'S\');z.ef.1G(z.fx.U.1o.hb,z.S)}};A.fn.i2=C(c,d,e,f){G B.1r(\'dp\',C(){B.6Q=A(B).1m("Y")||\'\';f=28 e==\'4B\'?e:f||P;e=28 e==\'C\'?e:P;F a=A(B).E(\'6P\');F b=B.2S;6k(a==\'b7\'&&b){a=A(b).E(\'6P\');b=b.2S}A(B).E(\'6P\',d);if(28 B.6Q==\'7M\')B.6Q=B.6Q["9d"];A(B).4S({\'6P\':a},c,f,C(){A.2z(B,\'dp\');if(28 A(B).1m("Y")==\'7M\'){A(B).1m("Y")["9d"]="";A(B).1m("Y")["9d"]=B.6Q}L{A(B).1m("Y",B.6Q)}if(e)e.1x(B)})})};A.4n=C(e){if(/^i1$|^i0$|^hZ$|^5W$|^hY$|^hX$|^hW$|^hV$|^hU$|^23$|^hT$|^hS$|^hR$|^hQ$|^hP$|^hO$|^hN$/i.3M(e.98))G H;L G 14};A.fx.9n=C(e,a){F c=e.6M;F b=c.Y;b.T=a.T;b.4M=a.3s.t;b.4K=a.3s.l;b.4L=a.3s.b;b.53=a.3s.r;b.O=a.O+\'Q\';b.M=a.M+\'Q\';e.2S.dn(c,e);e.2S.hM(e)};A.fx.9u=C(e){if(!A.4n(e))G H;F t=A(e);F a=e.Y;F b=H;if(t.E(\'11\')==\'1k\'){95=t.E(\'2W\');t.E(\'2W\',\'2B\').1S();b=14}F c={};c.T=t.E(\'T\');c.1o=A.12.2f(e);c.3s=A.12.b2(e);F d=e.4u?e.4u.dk:t.E(\'hK\');c.O=R(t.E(\'O\'))||0;c.M=R(t.E(\'M\'))||0;F f=\'hJ\'+R(Z.63()*aW);F g=1c.3x(/^3O$|^br$|^hI$|^hr$|^7Q$|^hH$|^7M$|^3q$|^hF$|^hE$|^hC$|^90$|^dl$|^hB$/i.3M(e.98)?\'1W\':e.98);A.1m(g,\'id\',f);F h=A(g).2H(\'hA\');F i=g.Y;F j=0;F k=0;if(c.T==\'2i\'||c.T==\'1J\'){j=c.O;k=c.M}i.O=j+\'Q\';i.M=k+\'Q\';i.T=c.T!=\'2i\'&&c.T!=\'1J\'?\'2i\':c.T;i.S=c.1o.hb+\'Q\';i.V=c.1o.1D+\'Q\';i.4M=c.3s.t;i.53=c.3s.r;i.4L=c.3s.b;i.4K=c.3s.l;i.2N=\'2B\';if(A.2R.46){i.dk=d}L{i.hz=d}if(A.2R=="46"){a.4X="7s(1E="+0.dg*1Y+")"}a.1E=0.dg;e.2S.dn(g,e);g.hy(e);a.4M=\'2G\';a.53=\'2G\';a.4L=\'2G\';a.4K=\'2G\';a.T=\'1J\';a.bV=\'1k\';a.O=\'2G\';a.M=\'2G\';if(b){t.2x();a.2W=95}G{U:c,2Y:A(g)}};A.fx.7H={hx:[0,1O,1O],hw:[dd,1O,1O],hv:[db,db,hu],hs:[0,0,0],hq:[0,0,1O],hp:[d6,42,42],hn:[0,1O,1O],hm:[0,0,6N],hl:[0,6N,6N],hk:[aX,aX,aX],hi:[0,1Y,0],hg:[hf,he,cZ],hd:[6N,0,6N],ha:[85,cZ,47],h7:[1O,cY,0],h6:[h5,50,h4],h3:[6N,0,0],h2:[h1,cX,h0],gZ:[gY,0,8U],gX:[1O,0,1O],gW:[1O,gU,0],gT:[0,67,0],gS:[75,0,gQ],gP:[dd,cU,cY],gO:[gL,gK,cU],gI:[cT,1O,1O],gH:[cS,gG,cS],gF:[8U,8U,8U],gD:[1O,gC,gB],gA:[1O,1O,cT],gw:[0,1O,0],gv:[1O,0,1O],gu:[67,0,0],gs:[0,0,67],gr:[67,67,0],gq:[1O,d6,0],gp:[1O,8R,gn],gm:[67,0,67],gl:[1O,0,0],gk:[8R,8R,8R],gj:[1O,1O,1O],gi:[1O,1O,0]};A.fx.5L=C(a,b){if(A.fx.7H[a])G{r:A.fx.7H[a][0],g:A.fx.7H[a][1],b:A.fx.7H[a][2]};L if(2L=/^6v\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)$/.8Q(a))G{r:R(2L[1]),g:R(2L[2]),b:R(2L[3])};L if(2L=/6v\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)$/.8Q(a))G{r:2c(2L[1])*2.55,g:2c(2L[2])*2.55,b:2c(2L[3])*2.55};L if(2L=/^#([a-fA-6t-9])([a-fA-6t-9])([a-fA-6t-9])$/.8Q(a))G{r:R("6s"+2L[1]+2L[1]),g:R("6s"+2L[2]+2L[2]),b:R("6s"+2L[3]+2L[3])};L if(2L=/^#([a-fA-6t-9]{2})([a-fA-6t-9]{2})([a-fA-6t-9]{2})$/.8Q(a))G{r:R("6s"+2L[1]),g:R("6s"+2L[2]),b:R("6s"+2L[3])};L G b==14?H:{r:1O,g:1O,b:1O}};A.fx.cQ={5d:1,4y:1,5i:1,4x:1,4e:1,4a:1,S:1,M:1,bx:1,gh:1,4L:1,4K:1,53:1,4M:1,7y:1,5R:1,7x:1,8O:1,1E:1,ge:1,gc:1,4Q:1,4F:1,5g:1,5b:1,2D:1,gb:1,O:1,V:1,3j:1};A.fx.cN={6P:1,ga:1,g9:1,g8:1,g7:1,g6:1,g5:1};A.fx.7v=[\'g4\',\'g3\',\'g2\',\'g1\'];A.fx.aL={\'aK\':[\'2u\',\'cK\'],\'8E\':[\'2u\',\'aH\'],\'5X\':[\'5X\',\'\'],\'7E\':[\'7E\',\'\']};A.fn.1U({4S:C(b,c,d,f){G B.1r(C(){F a=A.1l(c,d,f);F e=W A.cI(B,a,b)})},aG:C(b,c){G B.1r(C(){F a=A.1l(b,c);F e=W A.aG(B,a)})},7w:C(a){G B.1y(C(){if(B.5e)A.aF(B,a)})},fZ:C(a){G B.1y(C(){if(B.5e)A.aF(B,a);if(B.1r&&B.1r[\'fx\'])B.1r.fx=[]})}});A.1U({aG:C(a,b){F z=B,5f;z.3f=C(){if(A.cF(b.1T))b.1T.1x(a)};z.2A=5Y(C(){z.3f()},b.1H);a.5e=z},1e:{b1:C(p,n,a,b,c){G((-Z.51(p*Z.2F)/2)+0.5)*b+a}},cI:C(f,g,h){F z=B,5f;F y=f.Y;F k=A.E(f,"2N");F l=A.E(f,"11");F o={};z.9a=(W 6p()).6y();g.1e=g.1e&&A.1e[g.1e]?g.1e:\'b1\';z.8H=C(a,b){if(A.fx.cQ[a]){if(b==\'1S\'||b==\'2x\'||b==\'3E\'){if(!f.5I)f.5I={};F r=2c(A.5S(f,a));f.5I[a]=r&&r>-aW?r:(2c(A.E(f,a))||0);b=b==\'3E\'?(l==\'1k\'?\'1S\':\'2x\'):b;g[b]=14;o[a]=b==\'1S\'?[0,f.5I[a]]:[f.5I[a],0];if(a!=\'1E\')y[a]=o[a][0]+(a!=\'3j\'&&a!=\'87\'?\'Q\':\'\');L A.1m(y,"1E",o[a][0])}L{o[a]=[2c(A.5S(f,a)),2c(b)||0]}}L if(A.fx.cN[a])o[a]=[A.fx.5L(A.5S(f,a)),A.fx.5L(b)];L if(/^5X$|7E$|2u$|8E$|aK$/i.3M(a)){F m=b.48(/\\s+/g,\' \').48(/6v\\s*\\(\\s*/g,\'6v(\').48(/\\s*,\\s*/g,\',\').48(/\\s*\\)/g,\')\').aD(/([^\\s]+)/g);2X(a){19\'5X\':19\'7E\':19\'aK\':19\'8E\':m[3]=m[3]||m[1]||m[0];m[2]=m[2]||m[0];m[1]=m[1]||m[0];1V(F i=0;ig.1H+z.9a){5h(z.2A);z.2A=P;1V(p in o){if(p=="1E")A.1m(y,"1E",o[p][1]);L if(28 o[p][1]==\'7M\')y[p]=\'6v(\'+o[p][1].r+\',\'+o[p][1].g+\',\'+o[p][1].b+\')\';L y[p]=o[p][1]+(p!=\'3j\'&&p!=\'87\'?\'Q\':\'\')}if(g.2x||g.1S)1V(F p in f.5I)if(p=="1E")A.1m(y,p,f.5I[p]);L y[p]="";y.11=g.2x?\'1k\':(l!=\'1k\'?l:\'2v\');y.2N=k;f.5e=P;if(A.cF(g.1T))g.1T.1x(f)}L{F n=t-B.9a;F a=n/g.1H;1V(p in o){if(28 o[p][1]==\'7M\'){y[p]=\'6v(\'+R(A.1e[g.1e](a,n,o[p][0].r,(o[p][1].r-o[p][0].r),g.1H))+\',\'+R(A.1e[g.1e](a,n,o[p][0].g,(o[p][1].g-o[p][0].g),g.1H))+\',\'+R(A.1e[g.1e](a,n,o[p][0].b,(o[p][1].b-o[p][0].b),g.1H))+\')\'}L{F b=A.1e[g.1e](a,n,o[p][0],(o[p][1]-o[p][0]),g.1H);if(p=="1E")A.1m(y,"1E",b);L y[p]=b+(p!=\'3j\'&&p!=\'87\'?\'Q\':\'\')}}}};z.2A=5Y(C(){z.3f()},13);f.5e=z},aF:C(a,b){if(b)a.5e.9a-=fJ;L{1P.5h(a.5e.2A);a.5e=P;A.2z(a,"fx")}}});A.ax=C(a){F b={};if(28 a==\'4B\'){a=a.5u().6W(\';\');1V(F i=0;i0){z.cy=1o[i];z.4a=2c(z.U.4a)}if(z.U.4x.3o(1o[i])>0){z.cx=1o[i];z.aq=2c(z.U.4x)||0}if(z.U.5i.3o(1o[i])>0){z.cw=1o[i];z.ap=2c(z.U.5i)||0}if(z.U.5d.3o(1o[i])>0){z.cv=1o[i];z.ao=2c(z.U.5d)||0}if(z.U.4y.3o(1o[i])>0){z.cu=1o[i];z.an=2c(z.U.4y)||0}if(z.U.5b.3o(1o[i])>0){z.ct=1o[i];z.am=2c(z.U.5b)||0}if(z.U.5g.3o(1o[i])>0){z.cr=1o[i];z.al=2c(z.U.5g)||0}if(z.U.4Q.3o(1o[i])>0){z.cq=1o[i];z.ak=2c(z.U.4Q)||0}if(z.U.4F.3o(1o[i])>0){z.cp=1o[i];z.aj=2c(z.U.4F)||0}}if(z.U.T!=\'2i\'&&z.U.T!=\'1J\'){z.el.E(\'T\',\'2i\')}z.el.E(\'2N\',\'2B\');z.1K=m;2X(z.1K){19\'cz\':z.3V=z.O+z.26.h/2;z.4H=z.O;z.3Q=z.M+z.26.w/2;z.4r=z.M;1n;19\'as\':z.4H=z.O+z.26.h/2;z.3V=z.O;z.4r=z.M+z.26.w/2;z.3Q=z.M;1n;19\'5c\':z.4H=z.O-z.26.h/4;z.3V=z.O;z.4r=z.M-z.26.w/4;z.3Q=z.M;1n}z.ai=H;z.t=(W 6p).6y();z.4i=C(){5h(z.2A);z.2A=P};z.3f=C(){if(z.ai==H){z.el.1S();z.ai=14}F t=(W 6p).6y();F n=t-z.t;F p=n/z.1H;if(t>=z.1H+z.t){97(C(){o=1;if(z.1K){t=z.4H;l=z.4r;if(z.1K==\'5c\')o=0}z.ag(z.3v,l,t,14,o)},13);z.4i()}L{o=1;if(!A.1e||!A.1e[z.1e]){s=((-Z.51(p*Z.2F)/2)+0.5)*(z.3v-z.6m)+z.6m}L{s=A.1e[z.1e](p,n,z.6m,(z.3v-z.6m),z.1H)}if(z.1K){if(!A.1e||!A.1e[z.1e]){t=((-Z.51(p*Z.2F)/2)+0.5)*(z.4H-z.3V)+z.3V;l=((-Z.51(p*Z.2F)/2)+0.5)*(z.4r-z.3Q)+z.3Q;if(z.1K==\'5c\')o=((-Z.51(p*Z.2F)/2)+0.5)*(-0.9B)+0.9B}L{t=A.1e[z.1e](p,n,z.3V,(z.4H-z.3V),z.1H);l=A.1e[z.1e](p,n,z.3Q,(z.4r-z.3Q),z.1H);if(z.1K==\'5c\')o=A.1e[z.1e](p,n,0.9B,-0.9B,z.1H)}}z.ag(s,l,t,H,o)}};z.2A=5Y(C(){z.3f()},13);z.ag=C(a,b,c,d,e){z.el.E(\'S\',z.S*a/1Y+\'Q\').E(\'V\',z.V*a/1Y+\'Q\').E(\'M\',b+\'Q\').E(\'O\',c+\'Q\').E(\'4a\',z.4a*a/1Y+z.cy);if(z.aq)z.el.E(\'4x\',z.aq*a/1Y+z.cx);if(z.ap)z.el.E(\'5i\',z.ap*a/1Y+z.cw);if(z.ao)z.el.E(\'5d\',z.ao*a/1Y+z.cv);if(z.an)z.el.E(\'4y\',z.an*a/1Y+z.cu);if(z.am)z.el.E(\'5b\',z.am*a/1Y+z.ct);if(z.al)z.el.E(\'5g\',z.al*a/1Y+z.cr);if(z.ak)z.el.E(\'4Q\',z.ak*a/1Y+z.cq);if(z.aj)z.el.E(\'4F\',z.aj*a/1Y+z.cp);if(z.1K==\'5c\'){if(1P.6j)z.el.I(0).Y.4X="7s(1E="+e*1Y+")";z.el.I(0).Y.1E=e}if(d){if(z.bL){z.el.E(z.U)}if(z.1K==\'as\'||z.1K==\'5c\'){z.el.E(\'11\',\'1k\');if(z.1K==\'5c\'){if(1P.6j)z.el.I(0).Y.4X="7s(1E="+1Y+")";z.el.I(0).Y.1E=1}}L z.el.E(\'11\',\'2v\');if(z.29)z.29.1x(z.el.I(0));A.2z(z.el.I(0),\'1j\')}}};A.fn.1U({9A:C(a,b,c){o=A.1l(a);G B.1r(\'1j\',C(){W A.fx.9A(B,o,b,c)})},ft:C(a,b,c){G B.1y(C(){A(\'a[@2U*="#"]\',B).4U(C(e){co=B.2U.6W(\'#\');A(\'#\'+co[1]).9A(a,b,c);G H})})}});A.fx.9A=C(e,o,a,b){F z=B;z.o=o;z.e=e;z.2g=/cn|cm/.3M(a)?a:H;z.1e=b;p=A.12.3a(e);s=A.12.5O();z.4i=C(){5h(z.2A);z.2A=P;A.2z(z.e,\'1j\')};z.t=(W 6p).6y();s.h=s.h>s.ih?(s.h-s.ih):s.h;s.w=s.w>s.iw?(s.w-s.iw):s.w;z.4H=p.y>s.h?s.h:p.y;z.4r=p.x>s.w?s.w:p.x;z.3V=s.t;z.3Q=s.l;z.3f=C(){F t=(W 6p).6y();F n=t-z.t;F p=n/z.o.1H;if(t>=z.o.1H+z.t){z.4i();97(C(){z.ab(z.4H,z.4r)},13)}L{if(!z.2g||z.2g==\'cn\'){if(!A.1e||!A.1e[z.1e]){8v=((-Z.51(p*Z.2F)/2)+0.5)*(z.4H-z.3V)+z.3V}L{8v=A.1e[z.1e](p,n,z.3V,(z.4H-z.3V),z.o.1H)}}L{8v=z.3V}if(!z.2g||z.2g==\'cm\'){if(!A.1e||!A.1e[z.1e]){8u=((-Z.51(p*Z.2F)/2)+0.5)*(z.4r-z.3Q)+z.3Q}L{8u=A.1e[z.1e](p,n,z.3Q,(z.4r-z.3Q),z.o.1H)}}L{8u=z.3Q}z.ab(8v,8u)}};z.ab=C(t,l){1P.fs(l,t)};z.2A=5Y(C(){z.3f()},13)};A.fn.a8=C(a,b){G B.1r(\'1j\',C(){if(!A.4n(B)){A.2z(B,\'1j\');G H}F e=W A.fx.a8(B,a,b);e.a7()})};A.fx.a8=C(e,a,b){F z=B;z.el=A(e);z.el.1S();z.74=R(a)||3;z.29=b;z.52=1;z.U={};z.U.T=z.el.E(\'T\');z.U.O=R(z.el.E(\'O\'))||0;z.U.M=R(z.el.E(\'M\'))||0;if(z.U.T!=\'2i\'&&z.U.T!=\'1J\'){z.el.E(\'T\',\'2i\')}z.a7=C(){z.52++;z.e=W A.fx(z.el.I(0),{1H:60,1T:C(){z.e=W A.fx(z.el.I(0),{1H:60,1T:C(){z.e=W A.fx(e,{1H:60,1T:C(){if(z.52<=z.74)z.a7();L{z.el.E(\'T\',z.U.T).E(\'O\',z.U.O+\'Q\').E(\'M\',z.U.M+\'Q\');A.2z(z.el.I(0),\'1j\');if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}}}},\'M\');z.e.1G(z.U.M-20,z.U.M)}},\'M\');z.e.1G(z.U.M+20,z.U.M-20)}},\'M\');z.e.1G(z.U.M,z.U.M+20)}};A.fn.1U({dR:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'4l\',\'in\',c)})},c6:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'4l\',\'3U\',c)})},fr:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'4l\',\'3E\',c)})},fq:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'41\',\'in\',c)})},fp:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'41\',\'3U\',c)})},fo:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'41\',\'3E\',c)})},fm:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'M\',\'in\',c)})},fl:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'M\',\'3U\',c)})},fk:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'M\',\'3E\',c)})},fj:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'2D\',\'in\',c)})},fi:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'2D\',\'3U\',c)})},fh:C(a,b,c){G B.1r(\'1j\',C(){W A.fx.1u(B,a,b,\'2D\',\'3E\',c)})}});A.fx.1u=C(e,a,b,c,d,f){if(!A.4n(e)){A.2z(e,\'1j\');G H}F z=B;z.el=A(e);z.1e=28 b==\'4B\'?b:f||P;z.29=28 b==\'C\'?b:P;if(d==\'3E\'){d=z.el.E(\'11\')==\'1k\'?\'in\':\'3U\'}if(!e.4f)e.4f=z.el.E(\'11\');z.el.1S();z.1l=a;z.fx=A.fx.9u(e);z.1K=d;z.6T=c;z.1T=C(){if(z.1K==\'3U\')z.el.E(\'2W\',\'2B\');A.fx.9n(z.fx.2Y.I(0),z.fx.U);if(z.1K==\'in\'){z.el.E(\'11\',z.el.I(0).4f==\'1k\'?\'2v\':z.el.I(0).4f)}L{z.el.E(\'11\',\'1k\');z.el.E(\'2W\',\'cl\')}if(z.29&&z.29.1F==2w){z.29.1x(z.el.I(0))}A.2z(z.el.I(0),\'1j\')};2X(z.6T){19\'4l\':z.ef=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'O\');z.79=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e),\'S\');if(z.1K==\'in\'){z.ef.1G(-z.fx.U.1o.hb,0);z.79.1G(0,z.fx.U.1o.hb)}L{z.ef.1G(0,-z.fx.U.1o.hb);z.79.1G(z.fx.U.1o.hb,0)}1n;19\'41\':z.ef=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'O\');if(z.1K==\'in\'){z.ef.1G(z.fx.U.1o.hb,0)}L{z.ef.1G(0,z.fx.U.1o.hb)}1n;19\'M\':z.ef=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'M\');z.79=W A.fx(z.fx.2Y.I(0),A.1l(z.1l,z.1e),\'V\');if(z.1K==\'in\'){z.ef.1G(-z.fx.U.1o.1D,0);z.79.1G(0,z.fx.U.1o.1D)}L{z.ef.1G(0,-z.fx.U.1o.1D);z.79.1G(z.fx.U.1o.1D,0)}1n;19\'2D\':z.ef=W A.fx(z.el.I(0),A.1l(z.1l,z.1e,z.1T),\'M\');if(z.1K==\'in\'){z.ef.1G(z.fx.U.1o.1D,0)}L{z.ef.1G(0,z.fx.U.1o.1D)}1n}};A.2O=P;A.fn.fg=C(o){G B.1r(\'1j\',C(){W A.fx.cj(B,o)})};A.fx.cj=C(e,o){if(A.2O==P){A(\'23\',1c).1L(\'<1W id="2O">\');A.2O=A(\'#2O\')}A.2O.E(\'11\',\'2v\').E(\'T\',\'1J\');F z=B;z.el=A(e);if(!o||!o.3v){G}if(o.3v.1F==8t&&1c.7o(o.3v)){o.3v=1c.7o(o.3v)}L if(!o.3v.ci){G}if(!o.1H){o.1H=ch}z.1H=o.1H;z.3v=o.3v;z.7e=o.2Z;z.1T=o.1T;if(z.7e){A.2O.2H(z.7e)}z.8s=0;z.8i=0;if(A.e0){z.8s=(R(A.2O.E(\'4y\'))||0)+(R(A.2O.E(\'5i\'))||0)+(R(A.2O.E(\'4F\'))||0)+(R(A.2O.E(\'5g\'))||0);z.8i=(R(A.2O.E(\'4x\'))||0)+(R(A.2O.E(\'5d\'))||0)+(R(A.2O.E(\'5b\'))||0)+(R(A.2O.E(\'4Q\'))||0)}z.2b=A.1U(A.12.3a(z.el.I(0)),A.12.2f(z.el.I(0)));z.3m=A.1U(A.12.3a(z.3v),A.12.2f(z.3v));z.2b.1D-=z.8s;z.2b.hb-=z.8i;z.3m.1D-=z.8s;z.3m.hb-=z.8i;z.29=o.1T;A.2O.E(\'V\',z.2b.1D+\'Q\').E(\'S\',z.2b.hb+\'Q\').E(\'O\',z.2b.y+\'Q\').E(\'M\',z.2b.x+\'Q\').4S({O:z.3m.y,M:z.3m.x,V:z.3m.1D,S:z.3m.hb},z.1H,C(){if(z.7e)A.2O.3S(z.7e);A.2O.E(\'11\',\'1k\');if(z.1T&&z.1T.1F==2w){z.1T.1x(z.el.I(0),[z.3v])}A.2z(z.el.I(0),\'1j\')})};A.1q={24:{2u:10,cf:\'1R/ff.ce\',cd:\'<3O 2E="1R/5o.cc" />\',cb:0.8,ca:\'fb 8G\',c9:\'6m\',3F:7n},fa:H,f8:H,5A:P,7m:H,7l:H,a3:C(a){if(!A.1q.7l||A.1q.7m)G;F b=a.6S||a.6R||-1;2X(b){19 35:if(A.1q.5A)A.1q.2b(P,A(\'a[@4o=\'+A.1q.5A+\']:f7\').I(0));1n;19 36:if(A.1q.5A)A.1q.2b(P,A(\'a[@4o=\'+A.1q.5A+\']:f6\').I(0));1n;19 37:19 8:19 33:19 80:19 f4:F c=A(\'#7j\');if(c.I(0).4q!=P){c.I(0).4q.1x(c.I(0))}1n;19 38:1n;19 39:19 34:19 32:19 fd:19 78:F d=A(\'#7h\');if(d.I(0).4q!=P){d.I(0).4q.1x(d.I(0))}1n;19 40:1n;19 27:A.1q.8q();1n}},6g:C(a){if(a)A.1U(A.1q.24,a);if(1P.3N){A(\'23\',1c).1C(\'5Q\',A.1q.a3)}L{A(1c).1C(\'5Q\',A.1q.a3)}A(\'a\').1y(C(){el=A(B);c5=el.1m(\'4o\')||\'\';c4=el.1m(\'2U\')||\'\';cg=/\\.cc|\\.f2|\\.7q|\\.ce|\\.f1/g;if(c4.5u().aD(cg)!=P&&c5.5u().3o(\'c2\')==0){el.1C(\'4U\',A.1q.2b)}});if(A.2R.46){3q=1c.3x(\'3q\');A(3q).1m({id:\'a1\',2E:\'dc:H;\',da:\'b0\',d7:\'b0\'}).E({11:\'1k\',T:\'1J\',O:\'0\',M:\'0\',4X:\'9x:9C.9E.a6(1E=0)\'});A(\'23\').1L(3q)}7r=1c.3x(\'1W\');A(7r).1m(\'id\',\'a0\').E({T:\'1J\',11:\'1k\',O:\'0\',M:\'0\',1E:0}).1L(1c.8b(\' \')).1C(\'4U\',A.1q.8q);5C=1c.3x(\'1W\');A(5C).1m(\'id\',\'c0\').E({4F:A.1q.24.2u+\'Q\'}).1L(1c.8b(\' \'));9Z=1c.3x(\'1W\');A(9Z).1m(\'id\',\'bY\').E({4F:A.1q.24.2u+\'Q\',4Q:A.1q.24.2u+\'Q\'}).1L(1c.8b(\' \'));9Y=1c.3x(\'a\');A(9Y).1m({id:\'f0\',2U:\'#\'}).E({T:\'1J\',2D:A.1q.24.2u+\'Q\',O:\'0\'}).1L(A.1q.24.cd).1C(\'4U\',A.1q.8q);6Z=1c.3x(\'1W\');A(6Z).1m(\'id\',\'9X\').E({T:\'2i\',9W:\'M\',5X:\'0 8x\',3j:1}).1L(5C).1L(9Z).1L(9Y);21=1c.3x(\'3O\');21.2E=A.1q.24.cf;A(21).1m(\'id\',\'bW\').E({T:\'1J\'});5G=1c.3x(\'a\');A(5G).1m({id:\'7j\',2U:\'#\'}).E({T:\'1J\',11:\'1k\',2N:\'2B\',cC:\'1k\'}).1L(1c.8b(\' \'));5F=1c.3x(\'a\');A(5F).1m({id:\'7h\',2U:\'#\'}).E({T:\'1J\',2N:\'2B\',cC:\'1k\'}).1L(1c.8b(\' \'));2q=1c.3x(\'1W\');A(2q).1m(\'id\',\'bT\').E({11:\'1k\',T:\'2i\',2N:\'2B\',9W:\'M\',5X:\'0 8x\',O:\'0\',M:\'0\',3j:2}).1L([21,5G,5F]);5Z=1c.3x(\'1W\');A(5Z).1m(\'id\',\'8m\').E({11:\'1k\',T:\'1J\',2N:\'2B\',O:\'0\',M:\'0\',9W:\'az\',6P:\'b7\',eY:\'0\'}).1L([2q,6Z]);A(\'23\').1L(7r).1L(5Z)},2b:C(e,a){el=a?A(a):A(B);8J=el.1m(\'4o\');F b,4E,5G,5F;if(8J!=\'c2\'){A.1q.5A=8J;7F=A(\'a[@4o=\'+8J+\']\');b=7F.1N();4E=7F.aY(a?a:B);5G=7F.I(4E-1);5F=7F.I(4E+1)}aw=el.1m(\'2U\');5C=el.1m(\'3T\');3R=A.12.5O();7r=A(\'#a0\');if(!A.1q.7l){A.1q.7l=14;if(A.2R.46){A(\'#a1\').E(\'S\',Z.3g(3R.ih,3R.h)+\'Q\').E(\'V\',Z.3g(3R.iw,3R.w)+\'Q\').1S()}7r.E(\'S\',Z.3g(3R.ih,3R.h)+\'Q\').E(\'V\',Z.3g(3R.iw,3R.w)+\'Q\').1S().bS(bz,A.1q.24.cb,C(){A.1q.aB(aw,5C,3R,b,4E,5G,5F)});A(\'#8m\').E(\'V\',Z.3g(3R.iw,3R.w)+\'Q\')}L{A(\'#7j\').I(0).4q=P;A(\'#7h\').I(0).4q=P;A.1q.aB(aw,5C,3R,b,4E,5G,5F)}G H},aB:C(a,b,c,d,e,f,g){A(\'#aA\').9U();8l=A(\'#7j\');8l.2x();8k=A(\'#7h\');8k.2x();21=A(\'#bW\');2q=A(\'#bT\');5Z=A(\'#8m\');6Z=A(\'#9X\').E(\'2W\',\'2B\');A(\'#c0\').3i(5C);A.1q.7m=14;if(d)A(\'#bY\').3i(A.1q.24.ca+\' \'+(e+1)+\' \'+A.1q.24.c9+\' \'+d);if(f){8l.I(0).4q=C(){B.4W();A.1q.2b(P,f);G H}}if(g){8k.I(0).4q=C(){B.4W();A.1q.2b(P,g);G H}}21.1S();7u=A.12.2f(2q.I(0));4C=Z.3g(7u.1D,21.I(0).V+A.1q.24.2u*2);59=Z.3g(7u.hb,21.I(0).S+A.1q.24.2u*2);21.E({M:(4C-21.I(0).V)/2+\'Q\',O:(59-21.I(0).S)/2+\'Q\'});2q.E({V:4C+\'Q\',S:59+\'Q\'}).1S();bQ=A.12.a5();5Z.E(\'O\',c.t+(bQ.h/15)+\'Q\');if(5Z.E(\'11\')==\'1k\'){5Z.1S().6U(A.1q.24.3F)}5H=W 8M;A(5H).1m(\'id\',\'aA\').1C(\'eP\',C(){4C=5H.V+A.1q.24.2u*2;59=5H.S+A.1q.24.2u*2;21.2x();2q.4S({S:59},7u.hb!=59?A.1q.24.3F:1,C(){2q.4S({V:4C},7u.1D!=4C?A.1q.24.3F:1,C(){2q.aJ(5H);A(5H).E({T:\'1J\',M:A.1q.24.2u+\'Q\',O:A.1q.24.2u+\'Q\'}).6U(A.1q.24.3F,C(){cL=A.12.2f(6Z.I(0));if(f){8l.E({M:A.1q.24.2u+\'Q\',O:A.1q.24.2u+\'Q\',V:4C/2-A.1q.24.2u*3+\'Q\',S:59-A.1q.24.2u*2+\'Q\'}).1S()}if(g){8k.E({M:4C/2+A.1q.24.2u*2+\'Q\',O:A.1q.24.2u+\'Q\',V:4C/2-A.1q.24.2u*3+\'Q\',S:59-A.1q.24.2u*2+\'Q\'}).1S()}6Z.E({V:4C+\'Q\',O:-cL.hb+\'Q\',2W:\'cl\'}).4S({O:-1},A.1q.24.3F,C(){A.1q.7m=H})})})})});5H.2E=a},8q:C(){A(\'#aA\').9U();A(\'#8m\').2x();A(\'#9X\').E(\'2W\',\'2B\');A(\'#a0\').bS(bz,0,C(){A(B).2x();if(A.2R.46){A(\'#a1\').2x()}});A(\'#7j\').I(0).4q=P;A(\'#7h\').I(0).4q=P;A.1q.5A=P;A.1q.7l=H;A.1q.7m=H;G H}};A.N={1v:P,3A:P,1g:P,1A:P,1o:P,T:P,7f:C(e){A.N.1g=(B.9T)?B.9T:B;A.N.1A=A.12.3W(e);A.N.1o={V:R(A(A.N.1g).E(\'V\'))||0,S:R(A(A.N.1g).E(\'S\'))||0};A.N.T={O:R(A(A.N.1g).E(\'O\'))||0,M:R(A(A.N.1g).E(\'M\'))||0};A(1c).1C(\'3t\',A.N.aO).1C(\'5n\',A.N.aN);if(28 A.N.1g.1h.bO===\'C\'){A.N.1g.1h.bO.1x(A.N.1g)}G H},aN:C(e){A(1c).3h(\'3t\',A.N.aO).3h(\'5n\',A.N.aN);if(28 A.N.1g.1h.cO===\'C\'){A.N.1g.1h.cO.1x(A.N.1g)}A.N.1g=P},aO:C(e){if(!A.N.1g){G}1A=A.12.3W(e);6c=A.N.T.O-A.N.1A.y+1A.y;77=A.N.T.M-A.N.1A.x+1A.x;6c=Z.3g(Z.3k(6c,A.N.1g.1h.7d-A.N.1o.S),A.N.1g.1h.6F);77=Z.3g(Z.3k(77,A.N.1g.1h.7c-A.N.1o.V),A.N.1g.1h.6u);if(28 A.N.1g.1h.4h===\'C\'){F a=A.N.1g.1h.4h.1x(A.N.1g,[77,6c]);if(28 a==\'eI\'&&a.1b==2){77=a[0];6c=a[1]}}A.N.1g.Y.O=6c+\'Q\';A.N.1g.Y.M=77+\'Q\';G H},2b:C(e){A(1c).1C(\'3t\',A.N.7g).1C(\'5n\',A.N.7w);A.N.1v=B.1v;A.N.3A=B.3A;A.N.1A=A.12.3W(e);A.N.1o={V:R(A(B.1v).E(\'V\'))||0,S:R(A(B.1v).E(\'S\'))||0};A.N.T={O:R(A(B.1v).E(\'O\'))||0,M:R(A(B.1v).E(\'M\'))||0};if(A.N.1v.1h.4c){A.N.1v.1h.4c.1x(A.N.1v,[B])}G H},7w:C(){A(1c).3h(\'3t\',A.N.7g).3h(\'5n\',A.N.7w);if(A.N.1v.1h.3C){A.N.1v.1h.3C.1x(A.N.1v,[A.N.3A])}A.N.1v=P;A.N.3A=P},5N:C(a,b){G Z.3k(Z.3g(A.N.1o.V+a*b,A.N.1v.1h.8O),A.N.1v.1h.5R)},5M:C(a,b){G Z.3k(Z.3g(A.N.1o.S+a*b,A.N.1v.1h.7x),A.N.1v.1h.7y)},bN:C(a){G Z.3k(Z.3g(a,A.N.1v.1h.7x),A.N.1v.1h.7y)},7g:C(e){if(A.N.1v==P){G}1A=A.12.3W(e);dx=1A.x-A.N.1A.x;dy=1A.y-A.N.1A.y;1B={V:A.N.1o.V,S:A.N.1o.S};2s={O:A.N.T.O,M:A.N.T.M};2X(A.N.3A){19\'e\':1B.V=A.N.5N(dx,1);1n;19\'eH\':1B.V=A.N.5N(dx,1);1B.S=A.N.5M(dy,1);1n;19\'w\':1B.V=A.N.5N(dx,-1);2s.M=A.N.T.M-1B.V+A.N.1o.V;1n;19\'9R\':1B.V=A.N.5N(dx,-1);2s.M=A.N.T.M-1B.V+A.N.1o.V;1B.S=A.N.5M(dy,1);1n;19\'7a\':1B.S=A.N.5M(dy,-1);2s.O=A.N.T.O-1B.S+A.N.1o.S;1B.V=A.N.5N(dx,-1);2s.M=A.N.T.M-1B.V+A.N.1o.V;1n;19\'n\':1B.S=A.N.5M(dy,-1);2s.O=A.N.T.O-1B.S+A.N.1o.S;1n;19\'9Q\':1B.S=A.N.5M(dy,-1);2s.O=A.N.T.O-1B.S+A.N.1o.S;1B.V=A.N.5N(dx,1);1n;19\'s\':1B.S=A.N.5M(dy,1);1n}if(A.N.1v.1h.44){if(A.N.3A==\'n\'||A.N.3A==\'s\')43=1B.S*A.N.1v.1h.44;L 43=1B.V;4z=A.N.bN(43*A.N.1v.1h.44);43=4z/A.N.1v.1h.44;2X(A.N.3A){19\'n\':19\'7a\':19\'9Q\':2s.O+=1B.S-4z;1n}2X(A.N.3A){19\'7a\':19\'w\':19\'9R\':2s.M+=1B.V-43;1n}1B.S=4z;1B.V=43}if(2s.OA.N.1v.1h.7d){1B.S=A.N.1v.1h.7d-2s.O;if(A.N.1v.1h.44){1B.V=1B.S/A.N.1v.1h.44}}if(2s.M+1B.V>A.N.1v.1h.7c){1B.V=A.N.1v.1h.7c-2s.M;if(A.N.1v.1h.44){1B.S=1B.V*A.N.1v.1h.44}}F a=H;if(A.N.1v.1h.eG){a=A.N.1v.1h.eG.1x(A.N.1v,[1B,2s]);if(a){if(a.1o){A.1U(1B,a.1o)}if(a.T){A.1U(2s,a.T)}}}8f=A.N.1v.Y;8f.M=2s.M+\'Q\';8f.O=2s.O+\'Q\';8f.V=1B.V+\'Q\';8f.S=1B.S+\'Q\';G H},2l:C(b){if(!b||!b.3G||b.3G.1F!=6E){G}G B.1y(C(){F a=B;a.1h=b;a.1h.8O=b.8O||10;a.1h.7x=b.7x||10;a.1h.5R=b.5R||5P;a.1h.7y=b.7y||5P;a.1h.6F=b.6F||-8V;a.1h.6u=b.6u||-8V;a.1h.7c=b.7c||5P;a.1h.7d=b.7d||5P;bK=A(a).E(\'T\');if(!(bK==\'2i\'||bK==\'1J\')){a.Y.T=\'2i\'}eE=/n|9Q|e|eH|s|9R|w|7a/g;1V(i in a.1h.3G){if(i.5u().aD(eE)!=P){if(a.1h.3G[i].1F==8t){3c=A(a.1h.3G[i]);if(3c.1N()>0){a.1h.3G[i]=3c.I(0)}}if(a.1h.3G[i].4D){a.1h.3G[i].1v=a;a.1h.3G[i].3A=i;A(a.1h.3G[i]).1C(\'4R\',A.N.2b)}}}if(a.1h.5k){if(28 a.1h.5k===\'4B\'){9N=A(a.1h.5k);if(9N.1N()>0){9N.1y(C(){B.9T=a});9N.1C(\'4R\',A.N.7f)}}L if(a.1h.5k==14){A(B).1C(\'4R\',A.N.7f)}}})},4v:C(){G B.1y(C(){F a=B;1V(i in a.1h.3G){a.1h.3G[i].1v=P;a.1h.3G[i].3A=P;A(a.1h.3G[i]).3h(\'4R\',A.N.2b)}if(a.1h.5k){if(28 a.1h.5k===\'4B\'){3c=A(a.1h.5k);if(3c.1N()>0){3c.3h(\'4R\',A.N.7f)}}L if(a.1h.5k==14){A(B).3h(\'4R\',A.N.7f)}}a.1h=P})}};A.fn.1U({jk:A.N.2l,jj:A.N.4v});A.2t=P;A.6J=H;A.31=P;A.6B=[];A.9L=C(e){F a=e.6S||e.6R||-1;if(a==17||a==16){A.6J=14}};A.9J=C(e){A.6J=H};A.eB=C(e){B.f.1A=A.12.3W(e);B.f.1I=A.1U(A.12.3a(B),A.12.2f(B));B.f.4p=A.12.5O(B);B.f.1A.x-=B.f.1I.x;B.f.1A.y-=B.f.1I.y;A(B).1L(A.2t.I(0));if(B.f.hc)A.2t.2H(B.f.hc).E(\'11\',\'2v\');A.2t.E({11:\'2v\',V:\'2G\',S:\'2G\'});if(B.f.o){A.2t.E(\'1E\',B.f.o)}A.31=B;A.7A=H;A.6B=[];B.f.el.1y(C(){B.1I={x:B.7Y+(B.4u&&!A.2R.6l?R(B.4u.4y)||0:0)+(A.31.2P||0),y:B.7t+(B.4u&&!A.2R.6l?R(B.4u.4x)||0:0)+(A.31.2T||0),1D:B.3P,hb:B.5r};if(B.s==14){if(A.6J==H){B.s=H;A(B).3S(A.31.f.71)}L{A.7A=14;A.6B[A.6B.1b]=A.1m(B,\'id\')}}});A.9H.1x(B,[e]);A(1c).1C(\'3t\',A.9H).1C(\'5n\',A.bI);G H};A.9H=C(e){if(!A.31)G;A.eA.1x(A.31,[e])};A.eA=C(e){if(!A.31)G;F a=A.12.3W(e);F b=A.12.5O(A.31);a.x+=b.l-B.f.4p.l-B.f.1I.x;a.y+=b.t-B.f.4p.t-B.f.1I.y;F c=Z.3k(a.x,B.f.1A.x);F d=Z.3k(Z.3B(a.x-B.f.1A.x),Z.3B(B.f.4p.w-c));F f=Z.3k(a.y,B.f.1A.y);F g=Z.3k(Z.3B(a.y-B.f.1A.y),Z.3B(B.f.4p.h-f));if(B.2T>0&&a.y-20B.2T+B.f.1I.h){F h=Z.3k(B.f.4p.h-B.2T,10);B.2T+=h;if(B.2T!=b.t)g+=h}if(B.2P>0&&a.x-20B.2P+B.f.1I.w){F h=Z.3k(B.f.4p.w-B.2P,10);B.2P+=h;if(B.2P!=b.l)d+=h}A.2t.E({M:c+\'Q\',O:f+\'Q\',V:d+\'Q\',S:g+\'Q\'});A.2t.l=c+B.f.4p.l;A.2t.t=f+B.f.4p.t;A.2t.r=A.2t.l+d;A.2t.b=A.2t.t+g;A.7A=H;B.f.el.1y(C(){9G=A.6B.3o(A.1m(B,\'id\'));if(!(B.1I.x>A.2t.r||(B.1I.x+B.1I.1D)A.2t.b||(B.1I.y+B.1I.hb)0){h+=\'&\'}h+=s+\'[]=\'+A.1m(B,\'id\');o[o.1b]=A.1m(B,\'id\')}})}G{6A:h,o:o}};A.fn.jg=C(o){if(!A.2t){A(\'23\',1c).1L(\'<1W id="2t">\').1C(\'70\',A.9L).1C(\'5Q\',A.9J);A.2t=A(\'#2t\');A.2t.E({T:\'1J\',11:\'1k\'});if(1P.3N){A(\'23\',1c).1C(\'70\',A.9L).1C(\'5Q\',A.9J)}L{A(1c).1C(\'70\',A.9L).1C(\'5Q\',A.9J)}}if(!o){o={}}G B.1y(C(){if(B.ey)G;B.ey=14;B.f={a:o.3r,o:o.1E?2c(o.1E):H,71:o.ex?o.ex:H,hc:o.4G?o.4G:H,8d:o.8d?o.8d:H,8c:o.8c?o.8c:H};B.f.el=A(\'.\'+o.3r);A(B).1C(\'4R\',A.eB).E(\'T\',\'2i\')})};A.2Q={aT:1,ew:C(b){F b=b;G B.1y(C(){B.4g.69.1y(C(a){A.2Q.4s(B,b[a])})})},I:C(){F e=[];B.1y(C(b){if(B.bD){e[b]=[];F c=B;F d=A.12.2f(B);B.4g.69.1y(C(a){F x=B.7Y;F y=B.7t;7B=R(x*1Y/(d.w-B.3P));7C=R(y*1Y/(d.h-B.5r));e[b][a]=[7B||0,7C||0,x||0,y||0]})}});G e},ad:C(a){a.D.ep=a.D.1Z.w-a.D.1w.1D;a.D.eo=a.D.1Z.h-a.D.1w.hb;if(a.92.4g.bB){8Z=a.92.4g.69.I(a.bA+1);if(8Z){a.D.1Z.w=(R(A(8Z).E(\'M\'))||0)+a.D.1w.1D;a.D.1Z.h=(R(A(8Z).E(\'O\'))||0)+a.D.1w.hb}9f=a.92.4g.69.I(a.bA-1);if(9f){F b=R(A(9f).E(\'M\'))||0;F c=R(A(9f).E(\'M\'))||0;a.D.1Z.x+=b;a.D.1Z.y+=c;a.D.1Z.w-=b;a.D.1Z.h-=c}}a.D.ek=a.D.1Z.w-a.D.1w.1D;a.D.ej=a.D.1Z.h-a.D.1w.hb;if(a.D.2C){a.D.gx=((a.D.1Z.w-a.D.1w.1D)/a.D.2C)||1;a.D.gy=((a.D.1Z.h-a.D.1w.hb)/a.D.2C)||1;a.D.d1=a.D.ek/a.D.2C;a.D.d0=a.D.ej/a.D.2C}a.D.1Z.dx=a.D.1Z.x-a.D.22.x;a.D.1Z.dy=a.D.1Z.y-a.D.22.y;A.X.18.E(\'7z\',\'8T\')},3n:C(a,x,y){if(a.D.2C){d9=R(x/a.D.d1);7B=d9*1Y/a.D.2C;d5=R(y/a.D.d0);7C=d5*1Y/a.D.2C}L{7B=R(x*1Y/a.D.ep);7C=R(y*1Y/a.D.eo)}a.D.aa=[7B||0,7C||0,x||0,y||0];if(a.D.3n)a.D.3n.1x(a,a.D.aa)},d3:C(a){6K=a.6S||a.6R||-1;2X(6K){19 35:A.2Q.4s(B.3H,[91,91]);1n;19 36:A.2Q.4s(B.3H,[-91,-91]);1n;19 37:A.2Q.4s(B.3H,[-B.3H.D.gx||-1,0]);1n;19 38:A.2Q.4s(B.3H,[0,-B.3H.D.gy||-1]);1n;19 39:A.2Q.4s(B.3H,[B.3H.D.gx||1,0]);1n;19 40:A.X.4s(B.3H,[0,B.3H.D.gy||1]);1n}},4s:C(a,b){if(!a.D){G}a.D.1w=A.1U(A.12.3a(a),A.12.2f(a));a.D.22={x:R(A.E(a,\'M\'))||0,y:R(A.E(a,\'O\'))||0};a.D.49=A.E(a,\'T\');if(a.D.49!=\'2i\'&&a.D.49!=\'1J\'){a.Y.T=\'2i\'}A.X.ah(a);A.2Q.ad(a);dx=R(b[0])||0;dy=R(b[1])||0;2n=a.D.22.x+dx;2j=a.D.22.y+dy;if(a.D.2C){57=A.X.a9.1x(a,[2n,2j,dx,dy]);if(57.1F==6E){dx=57.dx;dy=57.dy}2n=a.D.22.x+dx;2j=a.D.22.y+dy}57=A.X.ae.1x(a,[2n,2j,dx,dy]);if(57&&57.1F==6E){dx=57.dx;dy=57.dy}2n=a.D.22.x+dx;2j=a.D.22.y+dy;if(a.D.4P&&(a.D.3n||a.D.2I)){A.2Q.3n(a,2n,2j)}2n=!a.D.2g||a.D.2g==\'3Z\'?2n:a.D.22.x||0;2j=!a.D.2g||a.D.2g==\'3K\'?2j:a.D.22.y||0;a.Y.M=2n+\'Q\';a.Y.O=2j+\'Q\'},2l:C(o){G B.1y(C(){if(B.bD==14||!o.3r||!A.12||!A.X||!A.1s){G}4Y=A(o.3r,B);if(4Y.1N()==0){G}F b={2e:\'7X\',4P:14,3n:o.3n&&o.3n.1F==2w?o.3n:P,2I:o.2I&&o.2I.1F==2w?o.2I:P,3c:B,1E:o.1E||H};if(o.2C&&R(o.2C)){b.2C=R(o.2C)||1;b.2C=b.2C>0?b.2C:1}if(4Y.1N()==1)4Y.6r(b);L{A(4Y.I(0)).6r(b);b.3c=P;4Y.6r(b)}4Y.70(A.2Q.d3);4Y.1m(\'aT\',A.2Q.aT++);B.bD=14;B.4g={};B.4g.ec=b.ec;B.4g.2C=b.2C;B.4g.69=4Y;B.4g.bB=o.bB?14:H;by=B;by.4g.69.1y(C(a){B.bA=a;B.92=by});if(o.5f&&o.5f.1F==6h){1V(i=o.5f.1b-1;i>=0;i--){if(o.5f[i].1F==6h&&o.5f[i].1b==2){el=B.4g.69.I(i);if(el.4D){A.2Q.4s(el,o.5f[i])}}}}})}};A.fn.1U({jc:A.2Q.2l,jb:A.2Q.ew,ja:A.2Q.I});A.2p={56:[],ea:C(){B.4W();1d=B.2S;id=A.1m(1d,\'id\');if(A.2p.56[id]!=P){1P.5h(A.2p.56[id])}1u=1d.J.3d+1;if(1d.J.1R.1b<1u){1u=1}1R=A(\'3O\',1d.J.4O);1d.J.3d=1u;if(1R.1N()>0){1R.6d(1d.J.3F,A.2p.7J)}},di:C(){B.4W();1d=B.2S;id=A.1m(1d,\'id\');if(A.2p.56[id]!=P){1P.5h(A.2p.56[id])}1u=1d.J.3d-1;1R=A(\'3O\',1d.J.4O);if(1u<1){1u=1d.J.1R.1b}1d.J.3d=1u;if(1R.1N()>0){1R.6d(1d.J.3F,A.2p.7J)}},2A:C(c){1d=1c.7o(c);if(1d.J.63){1u=1d.J.3d;6k(1u==1d.J.3d){1u=1+R(Z.63()*1d.J.1R.1b)}}L{1u=1d.J.3d+1;if(1d.J.1R.1b<1u){1u=1}}1R=A(\'3O\',1d.J.4O);1d.J.3d=1u;if(1R.1N()>0){1R.6d(1d.J.3F,A.2p.7J)}},go:C(o){F a;if(o&&o.1F==6E){if(o.21){a=1c.7o(o.21.1d);5v=1P.j8.2U.6W("#");o.21.5J=P;if(5v.1b==2){1u=R(5v[1]);1S=5v[1].48(1u,\'\');if(A.1m(a,\'id\')!=1S){1u=1}}L{1u=1}}if(o.84){o.84.4W();a=o.84.2S.2S;id=A.1m(a,\'id\');if(A.2p.56[id]!=P){1P.5h(A.2p.56[id])}5v=o.84.2U.6W("#");1u=R(5v[1]);1S=5v[1].48(1u,\'\');if(A.1m(a,\'id\')!=1S){1u=1}}if(a.J.1R.1b<1u||1u<1){1u=1}a.J.3d=1u;4t=A.12.2f(a);e4=A.12.9y(a);e3=A.12.6b(a);if(a.J.3e){a.J.3e.o.E(\'11\',\'1k\')}if(a.J.3b){a.J.3b.o.E(\'11\',\'1k\')}if(a.J.21){y=R(e4.t)+R(e3.t);if(a.J.1Q){if(a.J.1Q.4J==\'O\'){y+=a.J.1Q.45.hb}L{4t.h-=a.J.1Q.45.hb}}if(a.J.2o){if(a.J.2o&&a.J.2o.5V==\'O\'){y+=a.J.2o.45.hb}L{4t.h-=a.J.2o.45.hb}}if(!a.J.bu){a.J.e1=o.21?o.21.S:(R(a.J.21.E(\'S\'))||0);a.J.bu=o.21?o.21.V:(R(a.J.21.E(\'V\'))||0)}a.J.21.E(\'O\',y+(4t.h-a.J.e1)/2+\'Q\');a.J.21.E(\'M\',(4t.1D-a.J.bu)/2+\'Q\');a.J.21.E(\'11\',\'2v\')}1R=A(\'3O\',a.J.4O);if(1R.1N()>0){1R.6d(a.J.3F,A.2p.7J)}L{9w=A(\'a\',a.J.1Q.o).I(1u-1);A(9w).2H(a.J.1Q.5s);F b=W 8M();b.1d=A.1m(a,\'id\');b.1u=1u-1;b.2E=a.J.1R[a.J.3d-1].2E;if(b.1T){b.5J=P;A.2p.11.1x(b)}L{b.5J=A.2p.11}if(a.J.2o){a.J.2o.o.3i(a.J.1R[1u-1].5W)}}}},7J:C(){1d=B.2S.2S;1d.J.4O.E(\'11\',\'1k\');if(1d.J.1Q.5s){9w=A(\'a\',1d.J.1Q.o).3S(1d.J.1Q.5s).I(1d.J.3d-1);A(9w).2H(1d.J.1Q.5s)}F a=W 8M();a.1d=A.1m(1d,\'id\');a.1u=1d.J.3d-1;a.2E=1d.J.1R[1d.J.3d-1].2E;if(a.1T){a.5J=P;A.2p.11.1x(a)}L{a.5J=A.2p.11}if(1d.J.2o){1d.J.2o.o.3i(1d.J.1R[1d.J.3d-1].5W)}},11:C(){1d=1c.7o(B.1d);if(1d.J.3e){1d.J.3e.o.E(\'11\',\'1k\')}if(1d.J.3b){1d.J.3b.o.E(\'11\',\'1k\')}4t=A.12.2f(1d);y=0;if(1d.J.1Q){if(1d.J.1Q.4J==\'O\'){y+=1d.J.1Q.45.hb}L{4t.h-=1d.J.1Q.45.hb}}if(1d.J.2o){if(1d.J.2o&&1d.J.2o.5V==\'O\'){y+=1d.J.2o.45.hb}L{4t.h-=1d.J.2o.45.hb}}j4=A(\'.bt\',1d);y=y+(4t.h-B.S)/2;x=(4t.1D-B.V)/2;1d.J.4O.E(\'O\',y+\'Q\').E(\'M\',x+\'Q\').3i(\'<3O 2E="\'+B.2E+\'" />\');1d.J.4O.6U(1d.J.3F);3b=1d.J.3d+1;if(3b>1d.J.1R.1b){3b=1}3e=1d.J.3d-1;if(3e<1){3e=1d.J.1R.1b}1d.J.3b.o.E(\'11\',\'2v\').E(\'O\',y+\'Q\').E(\'M\',x+2*B.V/3+\'Q\').E(\'V\',B.V/3+\'Q\').E(\'S\',B.S+\'Q\').1m(\'3T\',1d.J.1R[3b-1].5W);1d.J.3b.o.I(0).2U=\'#\'+3b+A.1m(1d,\'id\');1d.J.3e.o.E(\'11\',\'2v\').E(\'O\',y+\'Q\').E(\'M\',x+\'Q\').E(\'V\',B.V/3+\'Q\').E(\'S\',B.S+\'Q\').1m(\'3T\',1d.J.1R[3e-1].5W);1d.J.3e.o.I(0).2U=\'#\'+3e+A.1m(1d,\'id\')},2l:C(o){if(!o||!o.2q||A.2p.56[o.2q])G;F a=A(\'#\'+o.2q);F c=a.I(0);if(c.Y.T!=\'1J\'&&c.Y.T!=\'2i\'){c.Y.T=\'2i\'}c.Y.2N=\'2B\';if(a.1N()==0)G;c.J={};c.J.1R=o.1R?o.1R:[];c.J.63=o.63&&o.63==14||H;7T=c.dj(\'j3\');1V(i=0;i<7T.1b;i++){6e=c.J.1R.1b;c.J.1R[6e]={2E:7T[i].2E,5W:7T[i].3T||7T[i].j2||\'\'}}if(c.J.1R.1b==0){G}c.J.49=A.1U(A.12.3a(c),A.12.2f(c));c.J.bp=A.12.9y(c);c.J.bo=A.12.6b(c);t=R(c.J.bp.t)+R(c.J.bo.t);b=R(c.J.bp.b)+R(c.J.bo.b);A(\'3O\',c).9U();c.J.3F=o.3F?o.3F:ch;if(o.4J||o.82||o.5s){c.J.1Q={};a.1L(\'<1W 68="dZ">\');c.J.1Q.o=A(\'.dZ\',c);if(o.82){c.J.1Q.82=o.82;c.J.1Q.o.2H(o.82)}if(o.5s){c.J.1Q.5s=o.5s}c.J.1Q.o.E(\'T\',\'1J\').E(\'V\',c.J.49.w+\'Q\');if(o.4J&&o.4J==\'O\'){c.J.1Q.4J=\'O\';c.J.1Q.o.E(\'O\',t+\'Q\')}L{c.J.1Q.4J=\'4e\';c.J.1Q.o.E(\'4e\',b+\'Q\')}c.J.1Q.9v=o.9v?o.9v:\' \';1V(F i=0;i\'+6e+\'\'+(6e!=c.J.1R.1b?c.J.1Q.9v:\'\'))}A(\'a\',c.J.1Q.o).1C(\'4U\',C(){A.2p.go({84:B})});c.J.1Q.45=A.12.2f(c.J.1Q.o.I(0))}if(o.5V||o.81){c.J.2o={};a.1L(\'<1W 68="dW">&6G;\');c.J.2o.o=A(\'.dW\',c);if(o.81){c.J.2o.81=o.81;c.J.2o.o.2H(o.81)}c.J.2o.o.E(\'T\',\'1J\').E(\'V\',c.J.49.w+\'Q\');if(o.5V&&o.5V==\'O\'){c.J.2o.5V=\'O\';c.J.2o.o.E(\'O\',(c.J.1Q&&c.J.1Q.4J==\'O\'?c.J.1Q.45.hb+t:t)+\'Q\')}L{c.J.2o.5V=\'4e\';c.J.2o.o.E(\'4e\',(c.J.1Q&&c.J.1Q.4J==\'4e\'?c.J.1Q.45.hb+b:b)+\'Q\')}c.J.2o.45=A.12.2f(c.J.2o.o.I(0))}if(o.9j){c.J.3b={9j:o.9j};a.1L(\'&6G;\');c.J.3b.o=A(\'.dV\',c);c.J.3b.o.E(\'T\',\'1J\').E(\'11\',\'1k\').E(\'2N\',\'2B\').E(\'4a\',\'dU\').2H(c.J.3b.9j);c.J.3b.o.1C(\'4U\',A.2p.ea)}if(o.9t){c.J.3e={9t:o.9t};a.1L(\'&6G;\');c.J.3e.o=A(\'.dS\',c);c.J.3e.o.E(\'T\',\'1J\').E(\'11\',\'1k\').E(\'2N\',\'2B\').E(\'4a\',\'dU\').2H(c.J.3e.9t);c.J.3e.o.1C(\'4U\',A.2p.di)}a.aJ(\'<1W 68="bt">\');c.J.4O=A(\'.bt\',c);c.J.4O.E(\'T\',\'1J\').E(\'O\',\'2G\').E(\'M\',\'2G\').E(\'11\',\'1k\');if(o.21){a.aJ(\'<1W 68="dz" Y="11: 1k;"><3O 2E="\'+o.21+\'" />\');c.J.21=A(\'.dz\',c);c.J.21.E(\'T\',\'1J\');F d=W 8M();d.1d=o.2q;d.2E=o.21;if(d.1T){d.5J=P;A.2p.go({21:d})}L{d.5J=C(){A.2p.go({21:B})}}}L{A.2p.go({2q:c})}if(o.ba){dQ=R(o.ba)*8V}A.2p.56[o.2q]=o.ba?1P.5Y(\'A.2p.2A(\\\'\'+o.2q+\'\\\')\',dQ):P}};A.1d=A.2p.2l;A.1p={73:[],54:{},18:H,6X:P,2b:C(){if(A.X.1g==P){G}F a,3s,c,cs;A.1p.18.I(0).2Z=A.X.1g.D.5z;a=A.1p.18.I(0).Y;a.11=\'2v\';A.1p.18.1w=A.1U(A.12.3a(A.1p.18.I(0)),A.12.2f(A.1p.18.I(0)));a.V=A.X.1g.D.1w.1D+\'Q\';a.S=A.X.1g.D.1w.hb+\'Q\';3s=A.12.b2(A.X.1g);a.4M=3s.t;a.53=3s.r;a.4L=3s.b;a.4K=3s.l;if(A.X.1g.D.3L==14){c=A(A.X.1g).cA(14).I(0);cs=c.Y;cs.4M=\'2G\';cs.53=\'2G\';cs.4L=\'2G\';cs.4K=\'2G\';cs.11=\'2v\';A.1p.18.58().1L(c)}A(A.X.1g).dO(A.1p.18.I(0));A.X.1g.Y.11=\'1k\'},c7:C(e){if(!e.D.3I&&A.1s.4T.bC){if(e.D.3C)e.D.3C.1x(1g);A(e).E(\'T\',e.D.av||e.D.49);A(e).8j();A(A.1s.4T).dN(e)}A.1p.18.3S(e.D.5z).3i(\'&6G;\');A.1p.6X=P;F a=A.1p.18.I(0).Y;a.11=\'1k\';A.1p.18.dO(e);if(e.D.fx>0){A(e).6U(e.D.fx)}A(\'23\').1L(A.1p.18.I(0));F b=[];F c=H;1V(F i=0;i0){c(b)}},8n:C(e,o){if(!A.X.1g)G;F a=H;F i=0;if(e.1f.el.1N()>0){1V(i=e.1f.el.1N();i>0;i--){if(e.1f.el.I(i-1)!=A.X.1g){if(!e.5t.bb){if((e.1f.el.I(i-1).1I.y+e.1f.el.I(i-1).1I.hb/2)>A.X.1g.D.2j){a=e.1f.el.I(i-1)}L{1n}}L{if((e.1f.el.I(i-1).1I.x+e.1f.el.I(i-1).1I.1D/2)>A.X.1g.D.2n&&(e.1f.el.I(i-1).1I.y+e.1f.el.I(i-1).1I.hb/2)>A.X.1g.D.2j){a=e.1f.el.I(i-1)}}}}}if(a&&A.1p.6X!=a){A.1p.6X=a;A(a).iT(A.1p.18.I(0))}L if(!a&&(A.1p.6X!=P||A.1p.18.I(0).2S!=e)){A.1p.6X=P;A(e).1L(A.1p.18.I(0))}A.1p.18.I(0).Y.11=\'2v\'},bM:C(e){if(A.X.1g==P){G}e.1f.el.1y(C(){B.1I=A.1U(A.12.6w(B),A.12.6x(B))})},8g:C(s){F i;F h=\'\';F o={};if(s){if(A.1p.54[s]){o[s]=[];A(\'#\'+s+\' .\'+A.1p.54[s]).1y(C(){if(h.1b>0){h+=\'&\'}h+=s+\'[]=\'+A.1m(B,\'id\');o[s][o[s].1b]=A.1m(B,\'id\')})}L{1V(a in s){if(A.1p.54[s[a]]){o[s[a]]=[];A(\'#\'+s[a]+\' .\'+A.1p.54[s[a]]).1y(C(){if(h.1b>0){h+=\'&\'}h+=s[a]+\'[]=\'+A.1m(B,\'id\');o[s[a]][o[s[a]].1b]=A.1m(B,\'id\')})}}}}L{1V(i in A.1p.54){o[i]=[];A(\'#\'+i+\' .\'+A.1p.54[i]).1y(C(){if(h.1b>0){h+=\'&\'}h+=i+\'[]=\'+A.1m(B,\'id\');o[i][o[i].1b]=A.1m(B,\'id\')})}}G{6A:h,o:o}},dL:C(e){if(!e.ci){G}G B.1y(C(){if(!B.5t||!A(e).is(\'.\'+B.5t.3r))A(e).2H(B.5t.3r);A(e).6r(B.5t.D)})},4v:C(){G B.1y(C(){A(\'.\'+B.5t.3r).8j();A(B).ei();B.5t=P;B.dK=P})},2l:C(o){if(o.3r&&A.12&&A.X&&A.1s){if(!A.1p.18){A(\'23\',1c).1L(\'<1W id="dJ">&6G;\');A.1p.18=A(\'#dJ\');A.1p.18.I(0).Y.11=\'1k\'}B.ee({3r:o.3r,9F:o.9F?o.9F:H,8X:o.8X?o.8X:H,4G:o.4G?o.4G:H,76:o.76||o.ev,6C:o.6C||o.er,bC:14,2I:o.2I||o.iR,fx:o.fx?o.fx:H,3L:o.3L?14:H,5T:o.5T?o.5T:\'9S\'});G B.1y(C(){F a={5B:o.5B?14:H,dI:5P,1E:o.1E?2c(o.1E):H,5z:o.4G?o.4G:H,fx:o.fx?o.fx:H,3I:14,3L:o.3L?14:H,3c:o.3c?o.3c:P,2e:o.2e?o.2e:P,4c:o.4c&&o.4c.1F==2w?o.4c:H,4h:o.4h&&o.4h.1F==2w?o.4h:H,3C:o.3C&&o.3C.1F==2w?o.3C:H,2g:/3K|3Z/.3M(o.2g)?o.2g:H,5D:o.5D?R(o.5D)||0:H,2M:o.2M?o.2M:H};A(\'.\'+o.3r,B).6r(a);B.dK=14;B.5t={3r:o.3r,5B:o.5B?14:H,dI:5P,1E:o.1E?2c(o.1E):H,5z:o.4G?o.4G:H,fx:o.fx?o.fx:H,3I:14,3L:o.3L?14:H,3c:o.3c?o.3c:P,2e:o.2e?o.2e:P,bb:o.bb?14:H,D:a}})}}};A.fn.1U({iP:A.1p.2l,dN:A.1p.dL,iO:A.1p.4v});A.iN=A.1p.8g;A.2k={62:P,9o:H,9p:P,6a:C(e){A.2k.9o=14;A.2k.1S(e,B,14)},bk:C(e){if(A.2k.62!=B)G;A.2k.9o=H;A.2k.2x(e,B)},1S:C(e,a,b){if(A.2k.62!=P)G;if(!a){a=B}A.2k.62=a;1I=A.1U(A.12.3a(a),A.12.2f(a));7U=A(a);3T=7U.1m(\'3T\');2U=7U.1m(\'2U\');if(3T){A.2k.9p=3T;7U.1m(\'3T\',\'\');A(\'#dE\').3i(3T);if(2U)A(\'#bj\').3i(2U.48(\'iI://\',\'\'));L A(\'#bj\').3i(\'\');18=A(\'#7S\');if(a.4m.2Z){18.I(0).2Z=a.4m.2Z}L{18.I(0).2Z=\'\'}bi=A.12.2f(18.I(0));dD=b&&a.4m.T==\'bn\'?\'4e\':a.4m.T;2X(dD){19\'O\':2j=1I.y-bi.hb;2n=1I.x;1n;19\'M\':2j=1I.y;2n=1I.x-bi.1D;1n;19\'2D\':2j=1I.y;2n=1I.x+1I.1D;1n;19\'bn\':A(\'23\').1C(\'3t\',A.2k.3t);1A=A.12.3W(e);2j=1A.y+15;2n=1A.x+15;1n;8T:2j=1I.y+1I.hb;2n=1I.x;1n}18.E({O:2j+\'Q\',M:2n+\'Q\'});if(a.4m.4w==H){18.1S()}L{18.6U(a.4m.4w)}if(a.4m.2K)a.4m.2K.1x(a);7U.1C(\'86\',A.2k.2x).1C(\'4W\',A.2k.bk)}},3t:C(e){if(A.2k.62==P){A(\'23\').3h(\'3t\',A.2k.3t);G}1A=A.12.3W(e);A(\'#7S\').E({O:1A.y+15+\'Q\',M:1A.x+15+\'Q\'})},2x:C(e,a){if(!a){a=B}if(A.2k.9o!=14&&A.2k.62==a){A.2k.62=P;A(\'#7S\').6d(1);A(a).1m(\'3T\',A.2k.9p).3h(\'86\',A.2k.2x).3h(\'4W\',A.2k.bk);if(a.4m.2V)a.4m.2V.1x(a);A.2k.9p=P}},2l:C(b){if(!A.2k.18){A(\'23\').1L(\'<1W id="7S"><1W id="dE"><1W id="bj">\');A(\'#7S\').E({T:\'1J\',3j:5P,11:\'1k\'});A.2k.18=14}G B.1y(C(){if(A.1m(B,\'3T\')){B.4m={T:/O|4e|M|2D|bn/.3M(b.T)?b.T:\'4e\',2Z:b.2Z?b.2Z:H,4w:b.4w?b.4w:H,2K:b.2K&&b.2K.1F==2w?b.2K:H,2V:b.2V&&b.2V.1F==2w?b.2V:H};F a=A(B);a.1C(\'9r\',A.2k.1S);a.1C(\'6a\',A.2k.6a)}})}};A.fn.iH=A.2k.2l;A.7O={bl:C(e){6K=e.6S||e.6R||-1;if(6K==9){if(1P.3N){1P.3N.b6=14;1P.3N.b5=H}L{e.9b();e.99()}if(B.9q){1c.64.dv().3D="\\t";B.dB=C(){B.6a();B.dB=P}}L if(B.9m){2b=B.88;3m=B.dA;B.2m=B.2m.iG(0,2b)+"\\t"+B.2m.iF(3m);B.9m(2b+1,2b+1);B.6a()}G H}},4v:C(){G B.1y(C(){if(B.6V&&B.6V==14){A(B).3h(\'70\',A.7O.bl);B.6V=H}})},2l:C(){G B.1y(C(){if(B.4D==\'bs\'&&(!B.6V||B.6V==H)){A(B).1C(\'70\',A.7O.bl);B.6V=14}})}};A.fn.1U({iD:A.7O.2l,iC:A.7O.4v});A.12={3a:C(e){F x=0;F y=0;F a=e.Y;F b=H;if(A(e).E(\'11\')==\'1k\'){F c=a.2W;F d=a.T;b=14;a.2W=\'2B\';a.11=\'2v\';a.T=\'1J\'}F f=e;6k(f){x+=f.7Y+(f.4u&&!A.2R.6l?R(f.4u.4y)||0:0);y+=f.7t+(f.4u&&!A.2R.6l?R(f.4u.4x)||0:0);f=f.dY}f=e;6k(f&&f.4D&&f.4D.5u()!=\'23\'){x-=f.2P||0;y-=f.2T||0;f=f.2S}if(b==14){a.11=\'1k\';a.T=d;a.2W=c}G{x:x,y:y}},6x:C(a){F x=0,y=0;6k(a){x+=a.7Y||0;y+=a.7t||0;a=a.dY}G{x:x,y:y}},2f:C(e){F w=A.E(e,\'V\');F h=A.E(e,\'S\');F a=0;F b=0;F c=e.Y;if(A(e).E(\'11\')!=\'1k\'){a=e.3P;b=e.5r}L{F d=c.2W;F f=c.T;c.2W=\'2B\';c.11=\'2v\';c.T=\'1J\';a=e.3P;b=e.5r;c.11=\'1k\';c.T=f;c.2W=d}G{w:w,h:h,1D:a,hb:b}},6w:C(a){G{1D:a.3P||0,hb:a.5r||0}},a5:C(e){F h,w,de;if(e){w=e.83;h=e.7P}L{de=1c.4A;w=1P.bg||9z.bg||(de&&de.83)||1c.23.83;h=1P.bf||9z.bf||(de&&de.7P)||1c.23.7P}G{w:w,h:h}},5O:C(e){F t=0,l=0,w=0,h=0,iw=0,ih=0;if(e&&e.98.5u()!=\'23\'){t=e.2T;l=e.2P;w=e.be;h=e.bd;iw=0;ih=0}L{if(1c.4A){t=1c.4A.2T;l=1c.4A.2P;w=1c.4A.be;h=1c.4A.bd}L if(1c.23){t=1c.23.2T;l=1c.23.2P;w=1c.23.be;h=1c.23.bd}iw=9z.bg||1c.4A.83||1c.23.83||0;ih=9z.bf||1c.4A.7P||1c.23.7P||0}G{t:t,l:l,w:w,h:h,iw:iw,ih:ih}},b2:C(e,a){F c=A(e);F t=c.E(\'4M\')||\'\';F r=c.E(\'53\')||\'\';F b=c.E(\'4L\')||\'\';F l=c.E(\'4K\')||\'\';if(a)G{t:R(t)||0,r:R(r)||0,b:R(b)||0,l:R(l)};L G{t:t,r:r,b:b,l:l}},9y:C(e,a){F c=A(e);F t=c.E(\'5b\')||\'\';F r=c.E(\'5g\')||\'\';F b=c.E(\'4Q\')||\'\';F l=c.E(\'4F\')||\'\';if(a)G{t:R(t)||0,r:R(r)||0,b:R(b)||0,l:R(l)};L G{t:t,r:r,b:b,l:l}},6b:C(e,a){F c=A(e);F t=c.E(\'4x\')||\'\';F r=c.E(\'5i\')||\'\';F b=c.E(\'5d\')||\'\';F l=c.E(\'4y\')||\'\';if(a)G{t:R(t)||0,r:R(r)||0,b:R(b)||0,l:R(l)||0};L G{t:t,r:r,b:b,l:l}},3W:C(a){F x=a.iB||(a.iz+(1c.4A.2P||1c.23.2P))||0;F y=a.iy||(a.ix+(1c.4A.2T||1c.23.2T))||0;G{x:x,y:y}},bH:C(a,b){b(a);a=a.6M;6k(a){A.12.bH(a,b);a=a.iv}},ji:C(c){A.12.bH(c,C(a){1V(F b in a){if(28 a[b]===\'C\'){a[b]=P}}})},ir:C(a,b){F c=A.12.5O();F d=A.12.2f(a);if(!b||b==\'3K\')A(a).E({O:c.t+((Z.3g(c.h,c.ih)-c.t-d.hb)/2)+\'Q\'});if(!b||b==\'3Z\')A(a).E({M:c.l+((Z.3g(c.w,c.iw)-c.l-d.1D)/2)+\'Q\'})},iq:C(a,b){F c=A(\'3O[@2E*="7q"]\',a||1c),7q;c.1y(C(){7q=B.2E;B.2E=b;B.Y.4X="9x:9C.9E.ip(2E=\'"+7q+"\')"})}};[].3o||(6h.jn.3o=C(v,n){n=(n==P)?0:n;F m=B.1b;1V(F i=n;i= 0 ? '&' : '?') + q; - options.data = null; // data is null for 'get' - } - else - options.data = q; // data is the query string for 'post' - - var $form = this, callbacks = []; - if (options.resetForm) callbacks.push(function() { $form.resetForm(); }); - if (options.clearForm) callbacks.push(function() { $form.clearForm(); }); - - // perform a load on the target only if dataType is not provided - if (!options.dataType && options.target) { - var oldSuccess = options.success || function(){}; - callbacks.push(function(data) { - if (this.evalScripts) - $(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, arguments); - else // jQuery v1.1.4 - $(options.target).html(data).each(oldSuccess, arguments); - }); - } - else if (options.success) - callbacks.push(options.success); - - options.success = function(data, status) { - for (var i=0, max=callbacks.length; i < max; i++) - callbacks[i](data, status, $form); - }; - - // are there files to upload? - var files = $('input:file', this).fieldValue(); - var found = false; - for (var j=0; j < files.length; j++) - if (files[j]) - found = true; - - // options.iframe allows user to force iframe mode - if (options.iframe || found) { - // hack to fix Safari hang (thanks to Tim Molendijk for this) - // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d - if ($.browser.safari && options.closeKeepAlive) - $.get(options.closeKeepAlive, fileUpload); - else - fileUpload(); - } - else - $.ajax(options); - - // fire 'notify' event - $.event.trigger('form.submit.notify', [this, options]); - return this; - - - // private function for handling file uploads (hat tip to YAHOO!) - function fileUpload() { - var form = $form[0]; - var opts = $.extend({}, $.ajaxSettings, options); - - var id = 'jqFormIO' + $.fn.ajaxSubmit.counter++; - var $io = $(''); - this.iefix = $(this.update.id+'_iefix'); - } - if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); - }, - - fixIEOverlapping: function() { - Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); - this.iefix.style.zIndex = 1; - this.update.style.zIndex = 2; - Element.show(this.iefix); - }, - - hide: function() { - this.stopIndicator(); - if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); - if(this.iefix) Element.hide(this.iefix); - }, - - startIndicator: function() { - if(this.options.indicator) Element.show(this.options.indicator); - }, - - stopIndicator: function() { - if(this.options.indicator) Element.hide(this.options.indicator); - }, - - onKeyPress: function(event) { - if(this.active) - switch(event.keyCode) { - case Event.KEY_TAB: - case Event.KEY_RETURN: - this.selectEntry(); - Event.stop(event); - case Event.KEY_ESC: - this.hide(); - this.active = false; - Event.stop(event); - return; - case Event.KEY_LEFT: - case Event.KEY_RIGHT: - return; - case Event.KEY_UP: - this.markPrevious(); - this.render(); - if(Prototype.Browser.WebKit) Event.stop(event); - return; - case Event.KEY_DOWN: - this.markNext(); - this.render(); - if(Prototype.Browser.WebKit) Event.stop(event); - return; - } - else - if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || - (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return; - - this.changed = true; - this.hasFocus = true; - - if(this.observer) clearTimeout(this.observer); - this.observer = - setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000); - }, - - activate: function() { - this.changed = false; - this.hasFocus = true; - this.getUpdatedChoices(); - }, - - onHover: function(event) { - var element = Event.findElement(event, 'LI'); - if(this.index != element.autocompleteIndex) - { - this.index = element.autocompleteIndex; - this.render(); - } - Event.stop(event); - }, - - onClick: function(event) { - var element = Event.findElement(event, 'LI'); - this.index = element.autocompleteIndex; - this.selectEntry(); - this.hide(); - }, - - onBlur: function(event) { - // needed to make click events working - setTimeout(this.hide.bind(this), 250); - this.hasFocus = false; - this.active = false; - }, - - render: function() { - if(this.entryCount > 0) { - for (var i = 0; i < this.entryCount; i++) - this.index==i ? - Element.addClassName(this.getEntry(i),"selected") : - Element.removeClassName(this.getEntry(i),"selected"); - if(this.hasFocus) { - this.show(); - this.active = true; - } - } else { - this.active = false; - this.hide(); - } - }, - - markPrevious: function() { - if(this.index > 0) this.index-- - else this.index = this.entryCount-1; - this.getEntry(this.index).scrollIntoView(true); - }, - - markNext: function() { - if(this.index < this.entryCount-1) this.index++ - else this.index = 0; - this.getEntry(this.index).scrollIntoView(false); - }, - - getEntry: function(index) { - return this.update.firstChild.childNodes[index]; - }, - - getCurrentEntry: function() { - return this.getEntry(this.index); - }, - - selectEntry: function() { - this.active = false; - this.updateElement(this.getCurrentEntry()); - }, - - updateElement: function(selectedElement) { - if (this.options.updateElement) { - this.options.updateElement(selectedElement); - return; - } - var value = ''; - if (this.options.select) { - var nodes = $(selectedElement).select('.' + this.options.select) || []; - if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); - } else - value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); - - var bounds = this.getTokenBounds(); - if (bounds[0] != -1) { - var newValue = this.element.value.substr(0, bounds[0]); - var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/); - if (whitespace) - newValue += whitespace[0]; - this.element.value = newValue + value + this.element.value.substr(bounds[1]); - } else { - this.element.value = value; - } - this.oldElementValue = this.element.value; - this.element.focus(); - - if (this.options.afterUpdateElement) - this.options.afterUpdateElement(this.element, selectedElement); - }, - - updateChoices: function(choices) { - if(!this.changed && this.hasFocus) { - this.update.innerHTML = choices; - Element.cleanWhitespace(this.update); - Element.cleanWhitespace(this.update.down()); - - if(this.update.firstChild && this.update.down().childNodes) { - this.entryCount = - this.update.down().childNodes.length; - for (var i = 0; i < this.entryCount; i++) { - var entry = this.getEntry(i); - entry.autocompleteIndex = i; - this.addObservers(entry); - } - } else { - this.entryCount = 0; - } - - this.stopIndicator(); - this.index = 0; - - if(this.entryCount==1 && this.options.autoSelect) { - this.selectEntry(); - this.hide(); - } else { - this.render(); - } - } - }, - - addObservers: function(element) { - Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); - Event.observe(element, "click", this.onClick.bindAsEventListener(this)); - }, - - onObserverEvent: function() { - this.changed = false; - this.tokenBounds = null; - if(this.getToken().length>=this.options.minChars) { - this.getUpdatedChoices(); - } else { - this.active = false; - this.hide(); - } - this.oldElementValue = this.element.value; - }, - - getToken: function() { - var bounds = this.getTokenBounds(); - return this.element.value.substring(bounds[0], bounds[1]).strip(); - }, - - getTokenBounds: function() { - if (null != this.tokenBounds) return this.tokenBounds; - var value = this.element.value; - if (value.strip().empty()) return [-1, 0]; - var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue); - var offset = (diff == this.oldElementValue.length ? 1 : 0); - var prevTokenPos = -1, nextTokenPos = value.length; - var tp; - for (var index = 0, l = this.options.tokens.length; index < l; ++index) { - tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1); - if (tp > prevTokenPos) prevTokenPos = tp; - tp = value.indexOf(this.options.tokens[index], diff + offset); - if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp; - } - return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]); - } -}); - -Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) { - var boundary = Math.min(newS.length, oldS.length); - for (var index = 0; index < boundary; ++index) - if (newS[index] != oldS[index]) - return index; - return boundary; -}; - -Ajax.Autocompleter = Class.create(Autocompleter.Base, { - initialize: function(element, update, url, options) { - this.baseInitialize(element, update, options); - this.options.asynchronous = true; - this.options.onComplete = this.onComplete.bind(this); - this.options.defaultParams = this.options.parameters || null; - this.url = url; - }, - - getUpdatedChoices: function() { - this.startIndicator(); - - var entry = encodeURIComponent(this.options.paramName) + '=' + - encodeURIComponent(this.getToken()); - - this.options.parameters = this.options.callback ? - this.options.callback(this.element, entry) : entry; - - if(this.options.defaultParams) - this.options.parameters += '&' + this.options.defaultParams; - - new Ajax.Request(this.url, this.options); - }, - - onComplete: function(request) { - this.updateChoices(request.responseText); - } -}); - -// The local array autocompleter. Used when you'd prefer to -// inject an array of autocompletion options into the page, rather -// than sending out Ajax queries, which can be quite slow sometimes. -// -// The constructor takes four parameters. The first two are, as usual, -// the id of the monitored textbox, and id of the autocompletion menu. -// The third is the array you want to autocomplete from, and the fourth -// is the options block. -// -// Extra local autocompletion options: -// - choices - How many autocompletion choices to offer -// -// - partialSearch - If false, the autocompleter will match entered -// text only at the beginning of strings in the -// autocomplete array. Defaults to true, which will -// match text at the beginning of any *word* in the -// strings in the autocomplete array. If you want to -// search anywhere in the string, additionally set -// the option fullSearch to true (default: off). -// -// - fullSsearch - Search anywhere in autocomplete array strings. -// -// - partialChars - How many characters to enter before triggering -// a partial match (unlike minChars, which defines -// how many characters are required to do any match -// at all). Defaults to 2. -// -// - ignoreCase - Whether to ignore case when autocompleting. -// Defaults to true. -// -// It's possible to pass in a custom function as the 'selector' -// option, if you prefer to write your own autocompletion logic. -// In that case, the other options above will not apply unless -// you support them. - -Autocompleter.Local = Class.create(Autocompleter.Base, { - initialize: function(element, update, array, options) { - this.baseInitialize(element, update, options); - this.options.array = array; - }, - - getUpdatedChoices: function() { - this.updateChoices(this.options.selector(this)); - }, - - setOptions: function(options) { - this.options = Object.extend({ - choices: 10, - partialSearch: true, - partialChars: 2, - ignoreCase: true, - fullSearch: false, - selector: function(instance) { - var ret = []; // Beginning matches - var partial = []; // Inside matches - var entry = instance.getToken(); - var count = 0; - - for (var i = 0; i < instance.options.array.length && - ret.length < instance.options.choices ; i++) { - - var elem = instance.options.array[i]; - var foundPos = instance.options.ignoreCase ? - elem.toLowerCase().indexOf(entry.toLowerCase()) : - elem.indexOf(entry); - - while (foundPos != -1) { - if (foundPos == 0 && elem.length != entry.length) { - ret.push("
  • " + elem.substr(0, entry.length) + "" + - elem.substr(entry.length) + "
  • "); - break; - } else if (entry.length >= instance.options.partialChars && - instance.options.partialSearch && foundPos != -1) { - if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { - partial.push("
  • " + elem.substr(0, foundPos) + "" + - elem.substr(foundPos, entry.length) + "" + elem.substr( - foundPos + entry.length) + "
  • "); - break; - } - } - - foundPos = instance.options.ignoreCase ? - elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : - elem.indexOf(entry, foundPos + 1); - - } - } - if (partial.length) - ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) - return "
      " + ret.join('') + "
    "; - } - }, options || { }); - } -}); - -// AJAX in-place editor and collection editor -// Full rewrite by Christophe Porteneuve (April 2007). - -// Use this if you notice weird scrolling problems on some browsers, -// the DOM might be a bit confused when this gets called so do this -// waits 1 ms (with setTimeout) until it does the activation -Field.scrollFreeActivate = function(field) { - setTimeout(function() { - Field.activate(field); - }, 1); -} - -Ajax.InPlaceEditor = Class.create({ - initialize: function(element, url, options) { - this.url = url; - this.element = element = $(element); - this.prepareOptions(); - this._controls = { }; - arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!! - Object.extend(this.options, options || { }); - if (!this.options.formId && this.element.id) { - this.options.formId = this.element.id + '-inplaceeditor'; - if ($(this.options.formId)) - this.options.formId = ''; - } - if (this.options.externalControl) - this.options.externalControl = $(this.options.externalControl); - if (!this.options.externalControl) - this.options.externalControlOnly = false; - this._originalBackground = this.element.getStyle('background-color') || 'transparent'; - this.element.title = this.options.clickToEditText; - this._boundCancelHandler = this.handleFormCancellation.bind(this); - this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this); - this._boundFailureHandler = this.handleAJAXFailure.bind(this); - this._boundSubmitHandler = this.handleFormSubmission.bind(this); - this._boundWrapperHandler = this.wrapUp.bind(this); - this.registerListeners(); - }, - checkForEscapeOrReturn: function(e) { - if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return; - if (Event.KEY_ESC == e.keyCode) - this.handleFormCancellation(e); - else if (Event.KEY_RETURN == e.keyCode) - this.handleFormSubmission(e); - }, - createControl: function(mode, handler, extraClasses) { - var control = this.options[mode + 'Control']; - var text = this.options[mode + 'Text']; - if ('button' == control) { - var btn = document.createElement('input'); - btn.type = 'submit'; - btn.value = text; - btn.className = 'editor_' + mode + '_button'; - if ('cancel' == mode) - btn.onclick = this._boundCancelHandler; - this._form.appendChild(btn); - this._controls[mode] = btn; - } else if ('link' == control) { - var link = document.createElement('a'); - link.href = '#'; - link.appendChild(document.createTextNode(text)); - link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler; - link.className = 'editor_' + mode + '_link'; - if (extraClasses) - link.className += ' ' + extraClasses; - this._form.appendChild(link); - this._controls[mode] = link; - } - }, - createEditField: function() { - var text = (this.options.loadTextURL ? this.options.loadingText : this.getText()); - var fld; - if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) { - fld = document.createElement('input'); - fld.type = 'text'; - var size = this.options.size || this.options.cols || 0; - if (0 < size) fld.size = size; - } else { - fld = document.createElement('textarea'); - fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows); - fld.cols = this.options.cols || 40; - } - fld.name = this.options.paramName; - fld.value = text; // No HTML breaks conversion anymore - fld.className = 'editor_field'; - if (this.options.submitOnBlur) - fld.onblur = this._boundSubmitHandler; - this._controls.editor = fld; - if (this.options.loadTextURL) - this.loadExternalText(); - this._form.appendChild(this._controls.editor); - }, - createForm: function() { - var ipe = this; - function addText(mode, condition) { - var text = ipe.options['text' + mode + 'Controls']; - if (!text || condition === false) return; - ipe._form.appendChild(document.createTextNode(text)); - }; - this._form = $(document.createElement('form')); - this._form.id = this.options.formId; - this._form.addClassName(this.options.formClassName); - this._form.onsubmit = this._boundSubmitHandler; - this.createEditField(); - if ('textarea' == this._controls.editor.tagName.toLowerCase()) - this._form.appendChild(document.createElement('br')); - if (this.options.onFormCustomization) - this.options.onFormCustomization(this, this._form); - addText('Before', this.options.okControl || this.options.cancelControl); - this.createControl('ok', this._boundSubmitHandler); - addText('Between', this.options.okControl && this.options.cancelControl); - this.createControl('cancel', this._boundCancelHandler, 'editor_cancel'); - addText('After', this.options.okControl || this.options.cancelControl); - }, - destroy: function() { - if (this._oldInnerHTML) - this.element.innerHTML = this._oldInnerHTML; - this.leaveEditMode(); - this.unregisterListeners(); - }, - enterEditMode: function(e) { - if (this._saving || this._editing) return; - this._editing = true; - this.triggerCallback('onEnterEditMode'); - if (this.options.externalControl) - this.options.externalControl.hide(); - this.element.hide(); - this.createForm(); - this.element.parentNode.insertBefore(this._form, this.element); - if (!this.options.loadTextURL) - this.postProcessEditField(); - if (e) Event.stop(e); - }, - enterHover: function(e) { - if (this.options.hoverClassName) - this.element.addClassName(this.options.hoverClassName); - if (this._saving) return; - this.triggerCallback('onEnterHover'); - }, - getText: function() { - return this.element.innerHTML; - }, - handleAJAXFailure: function(transport) { - this.triggerCallback('onFailure', transport); - if (this._oldInnerHTML) { - this.element.innerHTML = this._oldInnerHTML; - this._oldInnerHTML = null; - } - }, - handleFormCancellation: function(e) { - this.wrapUp(); - if (e) Event.stop(e); - }, - handleFormSubmission: function(e) { - var form = this._form; - var value = $F(this._controls.editor); - this.prepareSubmission(); - var params = this.options.callback(form, value) || ''; - if (Object.isString(params)) - params = params.toQueryParams(); - params.editorId = this.element.id; - if (this.options.htmlResponse) { - var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); - Object.extend(options, { - parameters: params, - onComplete: this._boundWrapperHandler, - onFailure: this._boundFailureHandler - }); - new Ajax.Updater({ success: this.element }, this.url, options); - } else { - var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); - Object.extend(options, { - parameters: params, - onComplete: this._boundWrapperHandler, - onFailure: this._boundFailureHandler - }); - new Ajax.Request(this.url, options); - } - if (e) Event.stop(e); - }, - leaveEditMode: function() { - this.element.removeClassName(this.options.savingClassName); - this.removeForm(); - this.leaveHover(); - this.element.style.backgroundColor = this._originalBackground; - this.element.show(); - if (this.options.externalControl) - this.options.externalControl.show(); - this._saving = false; - this._editing = false; - this._oldInnerHTML = null; - this.triggerCallback('onLeaveEditMode'); - }, - leaveHover: function(e) { - if (this.options.hoverClassName) - this.element.removeClassName(this.options.hoverClassName); - if (this._saving) return; - this.triggerCallback('onLeaveHover'); - }, - loadExternalText: function() { - this._form.addClassName(this.options.loadingClassName); - this._controls.editor.disabled = true; - var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); - Object.extend(options, { - parameters: 'editorId=' + encodeURIComponent(this.element.id), - onComplete: Prototype.emptyFunction, - onSuccess: function(transport) { - this._form.removeClassName(this.options.loadingClassName); - var text = transport.responseText; - if (this.options.stripLoadedTextTags) - text = text.stripTags(); - this._controls.editor.value = text; - this._controls.editor.disabled = false; - this.postProcessEditField(); - }.bind(this), - onFailure: this._boundFailureHandler - }); - new Ajax.Request(this.options.loadTextURL, options); - }, - postProcessEditField: function() { - var fpc = this.options.fieldPostCreation; - if (fpc) - $(this._controls.editor)['focus' == fpc ? 'focus' : 'activate'](); - }, - prepareOptions: function() { - this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions); - Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks); - [this._extraDefaultOptions].flatten().compact().each(function(defs) { - Object.extend(this.options, defs); - }.bind(this)); - }, - prepareSubmission: function() { - this._saving = true; - this.removeForm(); - this.leaveHover(); - this.showSaving(); - }, - registerListeners: function() { - this._listeners = { }; - var listener; - $H(Ajax.InPlaceEditor.Listeners).each(function(pair) { - listener = this[pair.value].bind(this); - this._listeners[pair.key] = listener; - if (!this.options.externalControlOnly) - this.element.observe(pair.key, listener); - if (this.options.externalControl) - this.options.externalControl.observe(pair.key, listener); - }.bind(this)); - }, - removeForm: function() { - if (!this._form) return; - this._form.remove(); - this._form = null; - this._controls = { }; - }, - showSaving: function() { - this._oldInnerHTML = this.element.innerHTML; - this.element.innerHTML = this.options.savingText; - this.element.addClassName(this.options.savingClassName); - this.element.style.backgroundColor = this._originalBackground; - this.element.show(); - }, - triggerCallback: function(cbName, arg) { - if ('function' == typeof this.options[cbName]) { - this.options[cbName](this, arg); - } - }, - unregisterListeners: function() { - $H(this._listeners).each(function(pair) { - if (!this.options.externalControlOnly) - this.element.stopObserving(pair.key, pair.value); - if (this.options.externalControl) - this.options.externalControl.stopObserving(pair.key, pair.value); - }.bind(this)); - }, - wrapUp: function(transport) { - this.leaveEditMode(); - // Can't use triggerCallback due to backward compatibility: requires - // binding + direct element - this._boundComplete(transport, this.element); - } -}); - -Object.extend(Ajax.InPlaceEditor.prototype, { - dispose: Ajax.InPlaceEditor.prototype.destroy -}); - -Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, { - initialize: function($super, element, url, options) { - this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions; - $super(element, url, options); - }, - - createEditField: function() { - var list = document.createElement('select'); - list.name = this.options.paramName; - list.size = 1; - this._controls.editor = list; - this._collection = this.options.collection || []; - if (this.options.loadCollectionURL) - this.loadCollection(); - else - this.checkForExternalText(); - this._form.appendChild(this._controls.editor); - }, - - loadCollection: function() { - this._form.addClassName(this.options.loadingClassName); - this.showLoadingText(this.options.loadingCollectionText); - var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); - Object.extend(options, { - parameters: 'editorId=' + encodeURIComponent(this.element.id), - onComplete: Prototype.emptyFunction, - onSuccess: function(transport) { - var js = transport.responseText.strip(); - if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check - throw 'Server returned an invalid collection representation.'; - this._collection = eval(js); - this.checkForExternalText(); - }.bind(this), - onFailure: this.onFailure - }); - new Ajax.Request(this.options.loadCollectionURL, options); - }, - - showLoadingText: function(text) { - this._controls.editor.disabled = true; - var tempOption = this._controls.editor.firstChild; - if (!tempOption) { - tempOption = document.createElement('option'); - tempOption.value = ''; - this._controls.editor.appendChild(tempOption); - tempOption.selected = true; - } - tempOption.update((text || '').stripScripts().stripTags()); - }, - - checkForExternalText: function() { - this._text = this.getText(); - if (this.options.loadTextURL) - this.loadExternalText(); - else - this.buildOptionList(); - }, - - loadExternalText: function() { - this.showLoadingText(this.options.loadingText); - var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); - Object.extend(options, { - parameters: 'editorId=' + encodeURIComponent(this.element.id), - onComplete: Prototype.emptyFunction, - onSuccess: function(transport) { - this._text = transport.responseText.strip(); - this.buildOptionList(); - }.bind(this), - onFailure: this.onFailure - }); - new Ajax.Request(this.options.loadTextURL, options); - }, - - buildOptionList: function() { - this._form.removeClassName(this.options.loadingClassName); - this._collection = this._collection.map(function(entry) { - return 2 === entry.length ? entry : [entry, entry].flatten(); - }); - var marker = ('value' in this.options) ? this.options.value : this._text; - var textFound = this._collection.any(function(entry) { - return entry[0] == marker; - }.bind(this)); - this._controls.editor.update(''); - var option; - this._collection.each(function(entry, index) { - option = document.createElement('option'); - option.value = entry[0]; - option.selected = textFound ? entry[0] == marker : 0 == index; - option.appendChild(document.createTextNode(entry[1])); - this._controls.editor.appendChild(option); - }.bind(this)); - this._controls.editor.disabled = false; - Field.scrollFreeActivate(this._controls.editor); - } -}); - -//**** DEPRECATION LAYER FOR InPlace[Collection]Editor! **** -//**** This only exists for a while, in order to let **** -//**** users adapt to the new API. Read up on the new **** -//**** API and convert your code to it ASAP! **** - -Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) { - if (!options) return; - function fallback(name, expr) { - if (name in options || expr === undefined) return; - options[name] = expr; - }; - fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' : - options.cancelLink == options.cancelButton == false ? false : undefined))); - fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' : - options.okLink == options.okButton == false ? false : undefined))); - fallback('highlightColor', options.highlightcolor); - fallback('highlightEndColor', options.highlightendcolor); -}; - -Object.extend(Ajax.InPlaceEditor, { - DefaultOptions: { - ajaxOptions: { }, - autoRows: 3, // Use when multi-line w/ rows == 1 - cancelControl: 'link', // 'link'|'button'|false - cancelText: 'cancel', - clickToEditText: 'Click to edit', - externalControl: null, // id|elt - externalControlOnly: false, - fieldPostCreation: 'activate', // 'activate'|'focus'|false - formClassName: 'inplaceeditor-form', - formId: null, // id|elt - highlightColor: '#ffff99', - highlightEndColor: '#ffffff', - hoverClassName: '', - htmlResponse: true, - loadingClassName: 'inplaceeditor-loading', - loadingText: 'Loading...', - okControl: 'button', // 'link'|'button'|false - okText: 'ok', - paramName: 'value', - rows: 1, // If 1 and multi-line, uses autoRows - savingClassName: 'inplaceeditor-saving', - savingText: 'Saving...', - size: 0, - stripLoadedTextTags: false, - submitOnBlur: false, - textAfterControls: '', - textBeforeControls: '', - textBetweenControls: '' - }, - DefaultCallbacks: { - callback: function(form) { - return Form.serialize(form); - }, - onComplete: function(transport, element) { - // For backward compatibility, this one is bound to the IPE, and passes - // the element directly. It was too often customized, so we don't break it. - new Effect.Highlight(element, { - startcolor: this.options.highlightColor, keepBackgroundImage: true }); - }, - onEnterEditMode: null, - onEnterHover: function(ipe) { - ipe.element.style.backgroundColor = ipe.options.highlightColor; - if (ipe._effect) - ipe._effect.cancel(); - }, - onFailure: function(transport, ipe) { - alert('Error communication with the server: ' + transport.responseText.stripTags()); - }, - onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls. - onLeaveEditMode: null, - onLeaveHover: function(ipe) { - ipe._effect = new Effect.Highlight(ipe.element, { - startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor, - restorecolor: ipe._originalBackground, keepBackgroundImage: true - }); - } - }, - Listeners: { - click: 'enterEditMode', - keydown: 'checkForEscapeOrReturn', - mouseover: 'enterHover', - mouseout: 'leaveHover' - } -}); - -Ajax.InPlaceCollectionEditor.DefaultOptions = { - loadingCollectionText: 'Loading options...' -}; - -// Delayed observer, like Form.Element.Observer, -// but waits for delay after last key input -// Ideal for live-search fields - -Form.Element.DelayedObserver = Class.create({ - initialize: function(element, delay, callback) { - this.delay = delay || 0.5; - this.element = $(element); - this.callback = callback; - this.timer = null; - this.lastValue = $F(this.element); - Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this)); - }, - delayedListener: function(event) { - if(this.lastValue == $F(this.element)) return; - if(this.timer) clearTimeout(this.timer); - this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); - this.lastValue = $F(this.element); - }, - onTimerEvent: function() { - this.timer = null; - this.callback(this.element, $F(this.element)); - } -}); diff -uNr a/mp-wp/wp-includes/js/scriptaculous/dragdrop.js b/mp-wp/wp-includes/js/scriptaculous/dragdrop.js --- a/mp-wp/wp-includes/js/scriptaculous/dragdrop.js f728e059183adf05bc868d9fd6adb3c5c5329586bea8a6d0c39ac2749edd6d9cd6668fa70ab90c895911858a965a032accc8e777efb3a810bc366aede09dcad4 +++ b/mp-wp/wp-includes/js/scriptaculous/dragdrop.js false @@ -1,974 +0,0 @@ -// script.aculo.us dragdrop.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 - -// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -if(Object.isUndefined(Effect)) - throw("dragdrop.js requires including script.aculo.us' effects.js library"); - -var Droppables = { - drops: [], - - remove: function(element) { - this.drops = this.drops.reject(function(d) { return d.element==$(element) }); - }, - - add: function(element) { - element = $(element); - var options = Object.extend({ - greedy: true, - hoverclass: null, - tree: false - }, arguments[1] || { }); - - // cache containers - if(options.containment) { - options._containers = []; - var containment = options.containment; - if(Object.isArray(containment)) { - containment.each( function(c) { options._containers.push($(c)) }); - } else { - options._containers.push($(containment)); - } - } - - if(options.accept) options.accept = [options.accept].flatten(); - - Element.makePositioned(element); // fix IE - options.element = element; - - this.drops.push(options); - }, - - findDeepestChild: function(drops) { - deepest = drops[0]; - - for (i = 1; i < drops.length; ++i) - if (Element.isParent(drops[i].element, deepest.element)) - deepest = drops[i]; - - return deepest; - }, - - isContained: function(element, drop) { - var containmentNode; - if(drop.tree) { - containmentNode = element.treeNode; - } else { - containmentNode = element.parentNode; - } - return drop._containers.detect(function(c) { return containmentNode == c }); - }, - - isAffected: function(point, element, drop) { - return ( - (drop.element!=element) && - ((!drop._containers) || - this.isContained(element, drop)) && - ((!drop.accept) || - (Element.classNames(element).detect( - function(v) { return drop.accept.include(v) } ) )) && - Position.within(drop.element, point[0], point[1]) ); - }, - - deactivate: function(drop) { - if(drop.hoverclass) - Element.removeClassName(drop.element, drop.hoverclass); - this.last_active = null; - }, - - activate: function(drop) { - if(drop.hoverclass) - Element.addClassName(drop.element, drop.hoverclass); - this.last_active = drop; - }, - - show: function(point, element) { - if(!this.drops.length) return; - var drop, affected = []; - - this.drops.each( function(drop) { - if(Droppables.isAffected(point, element, drop)) - affected.push(drop); - }); - - if(affected.length>0) - drop = Droppables.findDeepestChild(affected); - - if(this.last_active && this.last_active != drop) this.deactivate(this.last_active); - if (drop) { - Position.within(drop.element, point[0], point[1]); - if(drop.onHover) - drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); - - if (drop != this.last_active) Droppables.activate(drop); - } - }, - - fire: function(event, element) { - if(!this.last_active) return; - Position.prepare(); - - if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) - if (this.last_active.onDrop) { - this.last_active.onDrop(element, this.last_active.element, event); - return true; - } - }, - - reset: function() { - if(this.last_active) - this.deactivate(this.last_active); - } -} - -var Draggables = { - drags: [], - observers: [], - - register: function(draggable) { - if(this.drags.length == 0) { - this.eventMouseUp = this.endDrag.bindAsEventListener(this); - this.eventMouseMove = this.updateDrag.bindAsEventListener(this); - this.eventKeypress = this.keyPress.bindAsEventListener(this); - - Event.observe(document, "mouseup", this.eventMouseUp); - Event.observe(document, "mousemove", this.eventMouseMove); - Event.observe(document, "keypress", this.eventKeypress); - } - this.drags.push(draggable); - }, - - unregister: function(draggable) { - this.drags = this.drags.reject(function(d) { return d==draggable }); - if(this.drags.length == 0) { - Event.stopObserving(document, "mouseup", this.eventMouseUp); - Event.stopObserving(document, "mousemove", this.eventMouseMove); - Event.stopObserving(document, "keypress", this.eventKeypress); - } - }, - - activate: function(draggable) { - if(draggable.options.delay) { - this._timeout = setTimeout(function() { - Draggables._timeout = null; - window.focus(); - Draggables.activeDraggable = draggable; - }.bind(this), draggable.options.delay); - } else { - window.focus(); // allows keypress events if window isn't currently focused, fails for Safari - this.activeDraggable = draggable; - } - }, - - deactivate: function() { - this.activeDraggable = null; - }, - - updateDrag: function(event) { - if(!this.activeDraggable) return; - var pointer = [Event.pointerX(event), Event.pointerY(event)]; - // Mozilla-based browsers fire successive mousemove events with - // the same coordinates, prevent needless redrawing (moz bug?) - if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; - this._lastPointer = pointer; - - this.activeDraggable.updateDrag(event, pointer); - }, - - endDrag: function(event) { - if(this._timeout) { - clearTimeout(this._timeout); - this._timeout = null; - } - if(!this.activeDraggable) return; - this._lastPointer = null; - this.activeDraggable.endDrag(event); - this.activeDraggable = null; - }, - - keyPress: function(event) { - if(this.activeDraggable) - this.activeDraggable.keyPress(event); - }, - - addObserver: function(observer) { - this.observers.push(observer); - this._cacheObserverCallbacks(); - }, - - removeObserver: function(element) { // element instead of observer fixes mem leaks - this.observers = this.observers.reject( function(o) { return o.element==element }); - this._cacheObserverCallbacks(); - }, - - notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag' - if(this[eventName+'Count'] > 0) - this.observers.each( function(o) { - if(o[eventName]) o[eventName](eventName, draggable, event); - }); - if(draggable.options[eventName]) draggable.options[eventName](draggable, event); - }, - - _cacheObserverCallbacks: function() { - ['onStart','onEnd','onDrag'].each( function(eventName) { - Draggables[eventName+'Count'] = Draggables.observers.select( - function(o) { return o[eventName]; } - ).length; - }); - } -} - -/*--------------------------------------------------------------------------*/ - -var Draggable = Class.create({ - initialize: function(element) { - var defaults = { - handle: false, - reverteffect: function(element, top_offset, left_offset) { - var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02; - new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur, - queue: {scope:'_draggable', position:'end'} - }); - }, - endeffect: function(element) { - var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0; - new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, - queue: {scope:'_draggable', position:'end'}, - afterFinish: function(){ - Draggable._dragging[element] = false - } - }); - }, - zindex: 1000, - revert: false, - quiet: false, - scroll: false, - scrollSensitivity: 20, - scrollSpeed: 15, - snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] } - delay: 0 - }; - - if(!arguments[1] || Object.isUndefined(arguments[1].endeffect)) - Object.extend(defaults, { - starteffect: function(element) { - element._opacity = Element.getOpacity(element); - Draggable._dragging[element] = true; - new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); - } - }); - - var options = Object.extend(defaults, arguments[1] || { }); - - this.element = $(element); - - if(options.handle && Object.isString(options.handle)) - this.handle = this.element.down('.'+options.handle, 0); - - if(!this.handle) this.handle = $(options.handle); - if(!this.handle) this.handle = this.element; - - if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) { - options.scroll = $(options.scroll); - this._isScrollChild = Element.childOf(this.element, options.scroll); - } - - Element.makePositioned(this.element); // fix IE - - this.options = options; - this.dragging = false; - - this.eventMouseDown = this.initDrag.bindAsEventListener(this); - Event.observe(this.handle, "mousedown", this.eventMouseDown); - - Draggables.register(this); - }, - - destroy: function() { - Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); - Draggables.unregister(this); - }, - - currentDelta: function() { - return([ - parseInt(Element.getStyle(this.element,'left') || '0'), - parseInt(Element.getStyle(this.element,'top') || '0')]); - }, - - initDrag: function(event) { - if(!Object.isUndefined(Draggable._dragging[this.element]) && - Draggable._dragging[this.element]) return; - if(Event.isLeftClick(event)) { - // abort on form elements, fixes a Firefox issue - var src = Event.element(event); - if((tag_name = src.tagName.toUpperCase()) && ( - tag_name=='INPUT' || - tag_name=='SELECT' || - tag_name=='OPTION' || - tag_name=='BUTTON' || - tag_name=='TEXTAREA')) return; - - var pointer = [Event.pointerX(event), Event.pointerY(event)]; - var pos = Position.cumulativeOffset(this.element); - this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); - - Draggables.activate(this); - Event.stop(event); - } - }, - - startDrag: function(event) { - this.dragging = true; - if(!this.delta) - this.delta = this.currentDelta(); - - if(this.options.zindex) { - this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); - this.element.style.zIndex = this.options.zindex; - } - - if(this.options.ghosting) { - this._clone = this.element.cloneNode(true); - this.element._originallyAbsolute = (this.element.getStyle('position') == 'absolute'); - if (!this.element._originallyAbsolute) - Position.absolutize(this.element); - this.element.parentNode.insertBefore(this._clone, this.element); - } - - if(this.options.scroll) { - if (this.options.scroll == window) { - var where = this._getWindowScroll(this.options.scroll); - this.originalScrollLeft = where.left; - this.originalScrollTop = where.top; - } else { - this.originalScrollLeft = this.options.scroll.scrollLeft; - this.originalScrollTop = this.options.scroll.scrollTop; - } - } - - Draggables.notify('onStart', this, event); - - if(this.options.starteffect) this.options.starteffect(this.element); - }, - - updateDrag: function(event, pointer) { - if(!this.dragging) this.startDrag(event); - - if(!this.options.quiet){ - Position.prepare(); - Droppables.show(pointer, this.element); - } - - Draggables.notify('onDrag', this, event); - - this.draw(pointer); - if(this.options.change) this.options.change(this); - - if(this.options.scroll) { - this.stopScrolling(); - - var p; - if (this.options.scroll == window) { - with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } - } else { - p = Position.page(this.options.scroll); - p[0] += this.options.scroll.scrollLeft + Position.deltaX; - p[1] += this.options.scroll.scrollTop + Position.deltaY; - p.push(p[0]+this.options.scroll.offsetWidth); - p.push(p[1]+this.options.scroll.offsetHeight); - } - var speed = [0,0]; - if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity); - if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity); - if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity); - if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity); - this.startScrolling(speed); - } - - // fix AppleWebKit rendering - if(Prototype.Browser.WebKit) window.scrollBy(0,0); - - Event.stop(event); - }, - - finishDrag: function(event, success) { - this.dragging = false; - - if(this.options.quiet){ - Position.prepare(); - var pointer = [Event.pointerX(event), Event.pointerY(event)]; - Droppables.show(pointer, this.element); - } - - if(this.options.ghosting) { - if (!this.element._originallyAbsolute) - Position.relativize(this.element); - delete this.element._originallyAbsolute; - Element.remove(this._clone); - this._clone = null; - } - - var dropped = false; - if(success) { - dropped = Droppables.fire(event, this.element); - if (!dropped) dropped = false; - } - if(dropped && this.options.onDropped) this.options.onDropped(this.element); - Draggables.notify('onEnd', this, event); - - var revert = this.options.revert; - if(revert && Object.isFunction(revert)) revert = revert(this.element); - - var d = this.currentDelta(); - if(revert && this.options.reverteffect) { - if (dropped == 0 || revert != 'failure') - this.options.reverteffect(this.element, - d[1]-this.delta[1], d[0]-this.delta[0]); - } else { - this.delta = d; - } - - if(this.options.zindex) - this.element.style.zIndex = this.originalZ; - - if(this.options.endeffect) - this.options.endeffect(this.element); - - Draggables.deactivate(this); - Droppables.reset(); - }, - - keyPress: function(event) { - if(event.keyCode!=Event.KEY_ESC) return; - this.finishDrag(event, false); - Event.stop(event); - }, - - endDrag: function(event) { - if(!this.dragging) return; - this.stopScrolling(); - this.finishDrag(event, true); - Event.stop(event); - }, - - draw: function(point) { - var pos = Position.cumulativeOffset(this.element); - if(this.options.ghosting) { - var r = Position.realOffset(this.element); - pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY; - } - - var d = this.currentDelta(); - pos[0] -= d[0]; pos[1] -= d[1]; - - if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) { - pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft; - pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop; - } - - var p = [0,1].map(function(i){ - return (point[i]-pos[i]-this.offset[i]) - }.bind(this)); - - if(this.options.snap) { - if(Object.isFunction(this.options.snap)) { - p = this.options.snap(p[0],p[1],this); - } else { - if(Object.isArray(this.options.snap)) { - p = p.map( function(v, i) { - return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this)) - } else { - p = p.map( function(v) { - return (v/this.options.snap).round()*this.options.snap }.bind(this)) - } - }} - - var style = this.element.style; - if((!this.options.constraint) || (this.options.constraint=='horizontal')) - style.left = p[0] + "px"; - if((!this.options.constraint) || (this.options.constraint=='vertical')) - style.top = p[1] + "px"; - - if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering - }, - - stopScrolling: function() { - if(this.scrollInterval) { - clearInterval(this.scrollInterval); - this.scrollInterval = null; - Draggables._lastScrollPointer = null; - } - }, - - startScrolling: function(speed) { - if(!(speed[0] || speed[1])) return; - this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed]; - this.lastScrolled = new Date(); - this.scrollInterval = setInterval(this.scroll.bind(this), 10); - }, - - scroll: function() { - var current = new Date(); - var delta = current - this.lastScrolled; - this.lastScrolled = current; - if(this.options.scroll == window) { - with (this._getWindowScroll(this.options.scroll)) { - if (this.scrollSpeed[0] || this.scrollSpeed[1]) { - var d = delta / 1000; - this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); - } - } - } else { - this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; - this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; - } - - Position.prepare(); - Droppables.show(Draggables._lastPointer, this.element); - Draggables.notify('onDrag', this); - if (this._isScrollChild) { - Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); - Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; - Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; - if (Draggables._lastScrollPointer[0] < 0) - Draggables._lastScrollPointer[0] = 0; - if (Draggables._lastScrollPointer[1] < 0) - Draggables._lastScrollPointer[1] = 0; - this.draw(Draggables._lastScrollPointer); - } - - if(this.options.change) this.options.change(this); - }, - - _getWindowScroll: function(w) { - var T, L, W, H; - with (w.document) { - if (w.document.documentElement && documentElement.scrollTop) { - T = documentElement.scrollTop; - L = documentElement.scrollLeft; - } else if (w.document.body) { - T = body.scrollTop; - L = body.scrollLeft; - } - if (w.innerWidth) { - W = w.innerWidth; - H = w.innerHeight; - } else if (w.document.documentElement && documentElement.clientWidth) { - W = documentElement.clientWidth; - H = documentElement.clientHeight; - } else { - W = body.offsetWidth; - H = body.offsetHeight - } - } - return { top: T, left: L, width: W, height: H }; - } -}); - -Draggable._dragging = { }; - -/*--------------------------------------------------------------------------*/ - -var SortableObserver = Class.create({ - initialize: function(element, observer) { - this.element = $(element); - this.observer = observer; - this.lastValue = Sortable.serialize(this.element); - }, - - onStart: function() { - this.lastValue = Sortable.serialize(this.element); - }, - - onEnd: function() { - Sortable.unmark(); - if(this.lastValue != Sortable.serialize(this.element)) - this.observer(this.element) - } -}); - -var Sortable = { - SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, - - sortables: { }, - - _findRootElement: function(element) { - while (element.tagName.toUpperCase() != "BODY") { - if(element.id && Sortable.sortables[element.id]) return element; - element = element.parentNode; - } - }, - - options: function(element) { - element = Sortable._findRootElement($(element)); - if(!element) return; - return Sortable.sortables[element.id]; - }, - - destroy: function(element){ - var s = Sortable.options(element); - - if(s) { - Draggables.removeObserver(s.element); - s.droppables.each(function(d){ Droppables.remove(d) }); - s.draggables.invoke('destroy'); - - delete Sortable.sortables[s.element.id]; - } - }, - - create: function(element) { - element = $(element); - var options = Object.extend({ - element: element, - tag: 'li', // assumes li children, override with tag: 'tagname' - dropOnEmpty: false, - tree: false, - treeTag: 'ul', - overlap: 'vertical', // one of 'vertical', 'horizontal' - constraint: 'vertical', // one of 'vertical', 'horizontal', false - containment: element, // also takes array of elements (or id's); or false - handle: false, // or a CSS class - only: false, - delay: 0, - hoverclass: null, - ghosting: false, - quiet: false, - scroll: false, - scrollSensitivity: 20, - scrollSpeed: 15, - format: this.SERIALIZE_RULE, - - // these take arrays of elements or ids and can be - // used for better initialization performance - elements: false, - handles: false, - - onChange: Prototype.emptyFunction, - onUpdate: Prototype.emptyFunction - }, arguments[1] || { }); - - // clear any old sortable with same element - this.destroy(element); - - // build options for the draggables - var options_for_draggable = { - revert: true, - quiet: options.quiet, - scroll: options.scroll, - scrollSpeed: options.scrollSpeed, - scrollSensitivity: options.scrollSensitivity, - delay: options.delay, - ghosting: options.ghosting, - constraint: options.constraint, - handle: options.handle }; - - if(options.starteffect) - options_for_draggable.starteffect = options.starteffect; - - if(options.reverteffect) - options_for_draggable.reverteffect = options.reverteffect; - else - if(options.ghosting) options_for_draggable.reverteffect = function(element) { - element.style.top = 0; - element.style.left = 0; - }; - - if(options.endeffect) - options_for_draggable.endeffect = options.endeffect; - - if(options.zindex) - options_for_draggable.zindex = options.zindex; - - // build options for the droppables - var options_for_droppable = { - overlap: options.overlap, - containment: options.containment, - tree: options.tree, - hoverclass: options.hoverclass, - onHover: Sortable.onHover - } - - var options_for_tree = { - onHover: Sortable.onEmptyHover, - overlap: options.overlap, - containment: options.containment, - hoverclass: options.hoverclass - } - - // fix for gecko engine - Element.cleanWhitespace(element); - - options.draggables = []; - options.droppables = []; - - // drop on empty handling - if(options.dropOnEmpty || options.tree) { - Droppables.add(element, options_for_tree); - options.droppables.push(element); - } - - (options.elements || this.findElements(element, options) || []).each( function(e,i) { - var handle = options.handles ? $(options.handles[i]) : - (options.handle ? $(e).select('.' + options.handle)[0] : e); - options.draggables.push( - new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); - Droppables.add(e, options_for_droppable); - if(options.tree) e.treeNode = element; - options.droppables.push(e); - }); - - if(options.tree) { - (Sortable.findTreeElements(element, options) || []).each( function(e) { - Droppables.add(e, options_for_tree); - e.treeNode = element; - options.droppables.push(e); - }); - } - - // keep reference - this.sortables[element.id] = options; - - // for onupdate - Draggables.addObserver(new SortableObserver(element, options.onUpdate)); - - }, - - // return all suitable-for-sortable elements in a guaranteed order - findElements: function(element, options) { - return Element.findChildren( - element, options.only, options.tree ? true : false, options.tag); - }, - - findTreeElements: function(element, options) { - return Element.findChildren( - element, options.only, options.tree ? true : false, options.treeTag); - }, - - onHover: function(element, dropon, overlap) { - if(Element.isParent(dropon, element)) return; - - if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) { - return; - } else if(overlap>0.5) { - Sortable.mark(dropon, 'before'); - if(dropon.previousSibling != element) { - var oldParentNode = element.parentNode; - element.style.visibility = "hidden"; // fix gecko rendering - dropon.parentNode.insertBefore(element, dropon); - if(dropon.parentNode!=oldParentNode) - Sortable.options(oldParentNode).onChange(element); - Sortable.options(dropon.parentNode).onChange(element); - } - } else { - Sortable.mark(dropon, 'after'); - var nextElement = dropon.nextSibling || null; - if(nextElement != element) { - var oldParentNode = element.parentNode; - element.style.visibility = "hidden"; // fix gecko rendering - dropon.parentNode.insertBefore(element, nextElement); - if(dropon.parentNode!=oldParentNode) - Sortable.options(oldParentNode).onChange(element); - Sortable.options(dropon.parentNode).onChange(element); - } - } - }, - - onEmptyHover: function(element, dropon, overlap) { - var oldParentNode = element.parentNode; - var droponOptions = Sortable.options(dropon); - - if(!Element.isParent(dropon, element)) { - var index; - - var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only}); - var child = null; - - if(children) { - var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap); - - for (index = 0; index < children.length; index += 1) { - if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) { - offset -= Element.offsetSize (children[index], droponOptions.overlap); - } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) { - child = index + 1 < children.length ? children[index + 1] : null; - break; - } else { - child = children[index]; - break; - } - } - } - - dropon.insertBefore(element, child); - - Sortable.options(oldParentNode).onChange(element); - droponOptions.onChange(element); - } - }, - - unmark: function() { - if(Sortable._marker) Sortable._marker.hide(); - }, - - mark: function(dropon, position) { - // mark on ghosting only - var sortable = Sortable.options(dropon.parentNode); - if(sortable && !sortable.ghosting) return; - - if(!Sortable._marker) { - Sortable._marker = - ($('dropmarker') || Element.extend(document.createElement('DIV'))). - hide().addClassName('dropmarker').setStyle({position:'absolute'}); - document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); - } - var offsets = Position.cumulativeOffset(dropon); - Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'}); - - if(position=='after') - if(sortable.overlap == 'horizontal') - Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'}); - else - Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'}); - - Sortable._marker.show(); - }, - - _tree: function(element, options, parent) { - var children = Sortable.findElements(element, options) || []; - - for (var i = 0; i < children.length; ++i) { - var match = children[i].id.match(options.format); - - if (!match) continue; - - var child = { - id: encodeURIComponent(match ? match[1] : null), - element: element, - parent: parent, - children: [], - position: parent.children.length, - container: $(children[i]).down(options.treeTag) - } - - /* Get the element containing the children and recurse over it */ - if (child.container) - this._tree(child.container, options, child) - - parent.children.push (child); - } - - return parent; - }, - - tree: function(element) { - element = $(element); - var sortableOptions = this.options(element); - var options = Object.extend({ - tag: sortableOptions.tag, - treeTag: sortableOptions.treeTag, - only: sortableOptions.only, - name: element.id, - format: sortableOptions.format - }, arguments[1] || { }); - - var root = { - id: null, - parent: null, - children: [], - container: element, - position: 0 - } - - return Sortable._tree(element, options, root); - }, - - /* Construct a [i] index for a particular node */ - _constructIndex: function(node) { - var index = ''; - do { - if (node.id) index = '[' + node.position + ']' + index; - } while ((node = node.parent) != null); - return index; - }, - - sequence: function(element) { - element = $(element); - var options = Object.extend(this.options(element), arguments[1] || { }); - - return $(this.findElements(element, options) || []).map( function(item) { - return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; - }); - }, - - setSequence: function(element, new_sequence) { - element = $(element); - var options = Object.extend(this.options(element), arguments[2] || { }); - - var nodeMap = { }; - this.findElements(element, options).each( function(n) { - if (n.id.match(options.format)) - nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; - n.parentNode.removeChild(n); - }); - - new_sequence.each(function(ident) { - var n = nodeMap[ident]; - if (n) { - n[1].appendChild(n[0]); - delete nodeMap[ident]; - } - }); - }, - - serialize: function(element) { - element = $(element); - var options = Object.extend(Sortable.options(element), arguments[1] || { }); - var name = encodeURIComponent( - (arguments[1] && arguments[1].name) ? arguments[1].name : element.id); - - if (options.tree) { - return Sortable.tree(element, arguments[1]).children.map( function (item) { - return [name + Sortable._constructIndex(item) + "[id]=" + - encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); - }).flatten().join('&'); - } else { - return Sortable.sequence(element, arguments[1]).map( function(item) { - return name + "[]=" + encodeURIComponent(item); - }).join('&'); - } - } -} - -// Returns true if child is contained within element -Element.isParent = function(child, element) { - if (!child.parentNode || child == element) return false; - if (child.parentNode == element) return true; - return Element.isParent(child.parentNode, element); -} - -Element.findChildren = function(element, only, recursive, tagName) { - if(!element.hasChildNodes()) return null; - tagName = tagName.toUpperCase(); - if(only) only = [only].flatten(); - var elements = []; - $A(element.childNodes).each( function(e) { - if(e.tagName && e.tagName.toUpperCase()==tagName && - (!only || (Element.classNames(e).detect(function(v) { return only.include(v) })))) - elements.push(e); - if(recursive) { - var grandchildren = Element.findChildren(e, only, recursive, tagName); - if(grandchildren) elements.push(grandchildren); - } - }); - - return (elements.length>0 ? elements.flatten() : []); -} - -Element.offsetSize = function (element, type) { - return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')]; -} diff -uNr a/mp-wp/wp-includes/js/scriptaculous/effects.js b/mp-wp/wp-includes/js/scriptaculous/effects.js --- a/mp-wp/wp-includes/js/scriptaculous/effects.js 8d811c88ceeea3f18f44c44f87aaae52f5e5d5c242edcaee6e7adfd440ade0bc037117fc3f2ced34df3b3646d8002f0cd11ebe2c0f6e18487fd1526882fbae5e +++ b/mp-wp/wp-includes/js/scriptaculous/effects.js false @@ -1,1122 +0,0 @@ -// script.aculo.us effects.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007 - -// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) -// Contributors: -// Justin Palmer (http://encytemedia.com/) -// Mark Pilgrim (http://diveintomark.org/) -// Martin Bialasinki -// -// script.aculo.us is freely distributable under the terms of an MIT-style license. -// For details, see the script.aculo.us web site: http://script.aculo.us/ - -// converts rgb() and #xxx to #xxxxxx format, -// returns self (or first argument) if not convertable -String.prototype.parseColor = function() { - var color = '#'; - if (this.slice(0,4) == 'rgb(') { - var cols = this.slice(4,this.length-1).split(','); - var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); - } else { - if (this.slice(0,1) == '#') { - if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); - if (this.length==7) color = this.toLowerCase(); - } - } - return (color.length==7 ? color : (arguments[0] || this)); -}; - -/*--------------------------------------------------------------------------*/ - -Element.collectTextNodes = function(element) { - return $A($(element).childNodes).collect( function(node) { - return (node.nodeType==3 ? node.nodeValue : - (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); - }).flatten().join(''); -}; - -Element.collectTextNodesIgnoreClass = function(element, className) { - return $A($(element).childNodes).collect( function(node) { - return (node.nodeType==3 ? node.nodeValue : - ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? - Element.collectTextNodesIgnoreClass(node, className) : '')); - }).flatten().join(''); -}; - -Element.setContentZoom = function(element, percent) { - element = $(element); - element.setStyle({fontSize: (percent/100) + 'em'}); - if (Prototype.Browser.WebKit) window.scrollBy(0,0); - return element; -}; - -Element.getInlineOpacity = function(element){ - return $(element).style.opacity || ''; -}; - -Element.forceRerendering = function(element) { - try { - element = $(element); - var n = document.createTextNode(' '); - element.appendChild(n); - element.removeChild(n); - } catch(e) { } -}; - -/*--------------------------------------------------------------------------*/ - -var Effect = { - _elementDoesNotExistError: { - name: 'ElementDoesNotExistError', - message: 'The specified DOM element does not exist, but is required for this effect to operate' - }, - Transitions: { - linear: Prototype.K, - sinoidal: function(pos) { - return (-Math.cos(pos*Math.PI)/2) + 0.5; - }, - reverse: function(pos) { - return 1-pos; - }, - flicker: function(pos) { - var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4; - return pos > 1 ? 1 : pos; - }, - wobble: function(pos) { - return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5; - }, - pulse: function(pos, pulses) { - pulses = pulses || 5; - return ( - ((pos % (1/pulses)) * pulses).round() == 0 ? - ((pos * pulses * 2) - (pos * pulses * 2).floor()) : - 1 - ((pos * pulses * 2) - (pos * pulses * 2).floor()) - ); - }, - spring: function(pos) { - return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); - }, - none: function(pos) { - return 0; - }, - full: function(pos) { - return 1; - } - }, - DefaultOptions: { - duration: 1.0, // seconds - fps: 100, // 100= assume 66fps max. - sync: false, // true for combining - from: 0.0, - to: 1.0, - delay: 0.0, - queue: 'parallel' - }, - tagifyText: function(element) { - var tagifyStyle = 'position:relative'; - if (Prototype.Browser.IE) tagifyStyle += ';zoom:1'; - - element = $(element); - $A(element.childNodes).each( function(child) { - if (child.nodeType==3) { - child.nodeValue.toArray().each( function(character) { - element.insertBefore( - new Element('span', {style: tagifyStyle}).update( - character == ' ' ? String.fromCharCode(160) : character), - child); - }); - Element.remove(child); - } - }); - }, - multiple: function(element, effect) { - var elements; - if (((typeof element == 'object') || - Object.isFunction(element)) && - (element.length)) - elements = element; - else - elements = $(element).childNodes; - - var options = Object.extend({ - speed: 0.1, - delay: 0.0 - }, arguments[2] || { }); - var masterDelay = options.delay; - - $A(elements).each( function(element, index) { - new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); - }); - }, - PAIRS: { - 'slide': ['SlideDown','SlideUp'], - 'blind': ['BlindDown','BlindUp'], - 'appear': ['Appear','Fade'] - }, - toggle: function(element, effect) { - element = $(element); - effect = (effect || 'appear').toLowerCase(); - var options = Object.extend({ - queue: { position:'end', scope:(element.id || 'global'), limit: 1 } - }, arguments[2] || { }); - Effect[element.visible() ? - Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); - } -}; - -Effect.DefaultOptions.transition = Effect.Transitions.sinoidal; - -/* ------------- core effects ------------- */ - -Effect.ScopedQueue = Class.create(Enumerable, { - initialize: function() { - this.effects = []; - this.interval = null; - }, - _each: function(iterator) { - this.effects._each(iterator); - }, - add: function(effect) { - var timestamp = new Date().getTime(); - - var position = Object.isString(effect.options.queue) ? - effect.options.queue : effect.options.queue.position; - - switch(position) { - case 'front': - // move unstarted effects after this effect - this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { - e.startOn += effect.finishOn; - e.finishOn += effect.finishOn; - }); - break; - case 'with-last': - timestamp = this.effects.pluck('startOn').max() || timestamp; - break; - case 'end': - // start effect after last queued effect has finished - timestamp = this.effects.pluck('finishOn').max() || timestamp; - break; - } - - effect.startOn += timestamp; - effect.finishOn += timestamp; - - if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) - this.effects.push(effect); - - if (!this.interval) - this.interval = setInterval(this.loop.bind(this), 15); - }, - remove: function(effect) { - this.effects = this.effects.reject(function(e) { return e==effect }); - if (this.effects.length == 0) { - clearInterval(this.interval); - this.interval = null; - } - }, - loop: function() { - var timePos = new Date().getTime(); - for(var i=0, len=this.effects.length;i= this.startOn) { - if (timePos >= this.finishOn) { - this.render(1.0); - this.cancel(); - this.event('beforeFinish'); - if (this.finish) this.finish(); - this.event('afterFinish'); - return; - } - var pos = (timePos - this.startOn) / this.totalTime, - frame = (pos * this.totalFrames).round(); - if (frame > this.currentFrame) { - this.render(pos); - this.currentFrame = frame; - } - } - }, - cancel: function() { - if (!this.options.sync) - Effect.Queues.get(Object.isString(this.options.queue) ? - 'global' : this.options.queue.scope).remove(this); - this.state = 'finished'; - }, - event: function(eventName) { - if (this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); - if (this.options[eventName]) this.options[eventName](this); - }, - inspect: function() { - var data = $H(); - for(property in this) - if (!Object.isFunction(this[property])) data.set(property, this[property]); - return '#'; - } -}); - -Effect.Parallel = Class.create(Effect.Base, { - initialize: function(effects) { - this.effects = effects || []; - this.start(arguments[1]); - }, - update: function(position) { - this.effects.invoke('render', position); - }, - finish: function(position) { - this.effects.each( function(effect) { - effect.render(1.0); - effect.cancel(); - effect.event('beforeFinish'); - if (effect.finish) effect.finish(position); - effect.event('afterFinish'); - }); - } -}); - -Effect.Tween = Class.create(Effect.Base, { - initialize: function(object, from, to) { - object = Object.isString(object) ? $(object) : object; - var args = $A(arguments), method = args.last(), - options = args.length == 5 ? args[3] : null; - this.method = Object.isFunction(method) ? method.bind(object) : - Object.isFunction(object[method]) ? object[method].bind(object) : - function(value) { object[method] = value }; - this.start(Object.extend({ from: from, to: to }, options || { })); - }, - update: function(position) { - this.method(position); - } -}); - -Effect.Event = Class.create(Effect.Base, { - initialize: function() { - this.start(Object.extend({ duration: 0 }, arguments[0] || { })); - }, - update: Prototype.emptyFunction -}); - -Effect.Opacity = Class.create(Effect.Base, { - initialize: function(element) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - // make this work on IE on elements without 'layout' - if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) - this.element.setStyle({zoom: 1}); - var options = Object.extend({ - from: this.element.getOpacity() || 0.0, - to: 1.0 - }, arguments[1] || { }); - this.start(options); - }, - update: function(position) { - this.element.setOpacity(position); - } -}); - -Effect.Move = Class.create(Effect.Base, { - initialize: function(element) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - x: 0, - y: 0, - mode: 'relative' - }, arguments[1] || { }); - this.start(options); - }, - setup: function() { - this.element.makePositioned(); - this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); - this.originalTop = parseFloat(this.element.getStyle('top') || '0'); - if (this.options.mode == 'absolute') { - this.options.x = this.options.x - this.originalLeft; - this.options.y = this.options.y - this.originalTop; - } - }, - update: function(position) { - this.element.setStyle({ - left: (this.options.x * position + this.originalLeft).round() + 'px', - top: (this.options.y * position + this.originalTop).round() + 'px' - }); - } -}); - -// for backwards compatibility -Effect.MoveBy = function(element, toTop, toLeft) { - return new Effect.Move(element, - Object.extend({ x: toLeft, y: toTop }, arguments[3] || { })); -}; - -Effect.Scale = Class.create(Effect.Base, { - initialize: function(element, percent) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - scaleX: true, - scaleY: true, - scaleContent: true, - scaleFromCenter: false, - scaleMode: 'box', // 'box' or 'contents' or { } with provided values - scaleFrom: 100.0, - scaleTo: percent - }, arguments[2] || { }); - this.start(options); - }, - setup: function() { - this.restoreAfterFinish = this.options.restoreAfterFinish || false; - this.elementPositioning = this.element.getStyle('position'); - - this.originalStyle = { }; - ['top','left','width','height','fontSize'].each( function(k) { - this.originalStyle[k] = this.element.style[k]; - }.bind(this)); - - this.originalTop = this.element.offsetTop; - this.originalLeft = this.element.offsetLeft; - - var fontSize = this.element.getStyle('font-size') || '100%'; - ['em','px','%','pt'].each( function(fontSizeType) { - if (fontSize.indexOf(fontSizeType)>0) { - this.fontSize = parseFloat(fontSize); - this.fontSizeType = fontSizeType; - } - }.bind(this)); - - this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; - - this.dims = null; - if (this.options.scaleMode=='box') - this.dims = [this.element.offsetHeight, this.element.offsetWidth]; - if (/^content/.test(this.options.scaleMode)) - this.dims = [this.element.scrollHeight, this.element.scrollWidth]; - if (!this.dims) - this.dims = [this.options.scaleMode.originalHeight, - this.options.scaleMode.originalWidth]; - }, - update: function(position) { - var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); - if (this.options.scaleContent && this.fontSize) - this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); - this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); - }, - finish: function(position) { - if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle); - }, - setDimensions: function(height, width) { - var d = { }; - if (this.options.scaleX) d.width = width.round() + 'px'; - if (this.options.scaleY) d.height = height.round() + 'px'; - if (this.options.scaleFromCenter) { - var topd = (height - this.dims[0])/2; - var leftd = (width - this.dims[1])/2; - if (this.elementPositioning == 'absolute') { - if (this.options.scaleY) d.top = this.originalTop-topd + 'px'; - if (this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; - } else { - if (this.options.scaleY) d.top = -topd + 'px'; - if (this.options.scaleX) d.left = -leftd + 'px'; - } - } - this.element.setStyle(d); - } -}); - -Effect.Highlight = Class.create(Effect.Base, { - initialize: function(element) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || { }); - this.start(options); - }, - setup: function() { - // Prevent executing on elements not in the layout flow - if (this.element.getStyle('display')=='none') { this.cancel(); return; } - // Disable background image during the effect - this.oldStyle = { }; - if (!this.options.keepBackgroundImage) { - this.oldStyle.backgroundImage = this.element.getStyle('background-image'); - this.element.setStyle({backgroundImage: 'none'}); - } - if (!this.options.endcolor) - this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); - if (!this.options.restorecolor) - this.options.restorecolor = this.element.getStyle('background-color'); - // init color calculations - this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); - this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); - }, - update: function(position) { - this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ - return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart()); }.bind(this)) }); - }, - finish: function() { - this.element.setStyle(Object.extend(this.oldStyle, { - backgroundColor: this.options.restorecolor - })); - } -}); - -Effect.ScrollTo = function(element) { - var options = arguments[1] || { }, - scrollOffsets = document.viewport.getScrollOffsets(), - elementOffsets = $(element).cumulativeOffset(), - max = (window.height || document.body.scrollHeight) - document.viewport.getHeight(); - - if (options.offset) elementOffsets[1] += options.offset; - - return new Effect.Tween(null, - scrollOffsets.top, - elementOffsets[1] > max ? max : elementOffsets[1], - options, - function(p){ scrollTo(scrollOffsets.left, p.round()) } - ); -}; - -/* ------------- combination effects ------------- */ - -Effect.Fade = function(element) { - element = $(element); - var oldOpacity = element.getInlineOpacity(); - var options = Object.extend({ - from: element.getOpacity() || 1.0, - to: 0.0, - afterFinishInternal: function(effect) { - if (effect.options.to!=0) return; - effect.element.hide().setStyle({opacity: oldOpacity}); - } - }, arguments[1] || { }); - return new Effect.Opacity(element,options); -}; - -Effect.Appear = function(element) { - element = $(element); - var options = Object.extend({ - from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), - to: 1.0, - // force Safari to render floated elements properly - afterFinishInternal: function(effect) { - effect.element.forceRerendering(); - }, - beforeSetup: function(effect) { - effect.element.setOpacity(effect.options.from).show(); - }}, arguments[1] || { }); - return new Effect.Opacity(element,options); -}; - -Effect.Puff = function(element) { - element = $(element); - var oldStyle = { - opacity: element.getInlineOpacity(), - position: element.getStyle('position'), - top: element.style.top, - left: element.style.left, - width: element.style.width, - height: element.style.height - }; - return new Effect.Parallel( - [ new Effect.Scale(element, 200, - { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), - new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], - Object.extend({ duration: 1.0, - beforeSetupInternal: function(effect) { - Position.absolutize(effect.effects[0].element) - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().setStyle(oldStyle); } - }, arguments[1] || { }) - ); -}; - -Effect.BlindUp = function(element) { - element = $(element); - element.makeClipping(); - return new Effect.Scale(element, 0, - Object.extend({ scaleContent: false, - scaleX: false, - restoreAfterFinish: true, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping(); - } - }, arguments[1] || { }) - ); -}; - -Effect.BlindDown = function(element) { - element = $(element); - var elementDimensions = element.getDimensions(); - return new Effect.Scale(element, 100, Object.extend({ - scaleContent: false, - scaleX: false, - scaleFrom: 0, - scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, - restoreAfterFinish: true, - afterSetup: function(effect) { - effect.element.makeClipping().setStyle({height: '0px'}).show(); - }, - afterFinishInternal: function(effect) { - effect.element.undoClipping(); - } - }, arguments[1] || { })); -}; - -Effect.SwitchOff = function(element) { - element = $(element); - var oldOpacity = element.getInlineOpacity(); - return new Effect.Appear(element, Object.extend({ - duration: 0.4, - from: 0, - transition: Effect.Transitions.flicker, - afterFinishInternal: function(effect) { - new Effect.Scale(effect.element, 1, { - duration: 0.3, scaleFromCenter: true, - scaleX: false, scaleContent: false, restoreAfterFinish: true, - beforeSetup: function(effect) { - effect.element.makePositioned().makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); - } - }) - } - }, arguments[1] || { })); -}; - -Effect.DropOut = function(element) { - element = $(element); - var oldStyle = { - top: element.getStyle('top'), - left: element.getStyle('left'), - opacity: element.getInlineOpacity() }; - return new Effect.Parallel( - [ new Effect.Move(element, {x: 0, y: 100, sync: true }), - new Effect.Opacity(element, { sync: true, to: 0.0 }) ], - Object.extend( - { duration: 0.5, - beforeSetup: function(effect) { - effect.effects[0].element.makePositioned(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); - } - }, arguments[1] || { })); -}; - -Effect.Shake = function(element) { - element = $(element); - var options = Object.extend({ - distance: 20, - duration: 0.5 - }, arguments[1] || {}); - var distance = parseFloat(options.distance); - var split = parseFloat(options.duration) / 10.0; - var oldStyle = { - top: element.getStyle('top'), - left: element.getStyle('left') }; - return new Effect.Move(element, - { x: distance, y: 0, duration: split, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { - new Effect.Move(effect.element, - { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) { - effect.element.undoPositioned().setStyle(oldStyle); - }}) }}) }}) }}) }}) }}); -}; - -Effect.SlideDown = function(element) { - element = $(element).cleanWhitespace(); - // SlideDown need to have the content of the element wrapped in a container element with fixed height! - var oldInnerBottom = element.down().getStyle('bottom'); - var elementDimensions = element.getDimensions(); - return new Effect.Scale(element, 100, Object.extend({ - scaleContent: false, - scaleX: false, - scaleFrom: window.opera ? 0 : 1, - scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, - restoreAfterFinish: true, - afterSetup: function(effect) { - effect.element.makePositioned(); - effect.element.down().makePositioned(); - if (window.opera) effect.element.setStyle({top: ''}); - effect.element.makeClipping().setStyle({height: '0px'}).show(); - }, - afterUpdateInternal: function(effect) { - effect.element.down().setStyle({bottom: - (effect.dims[0] - effect.element.clientHeight) + 'px' }); - }, - afterFinishInternal: function(effect) { - effect.element.undoClipping().undoPositioned(); - effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } - }, arguments[1] || { }) - ); -}; - -Effect.SlideUp = function(element) { - element = $(element).cleanWhitespace(); - var oldInnerBottom = element.down().getStyle('bottom'); - var elementDimensions = element.getDimensions(); - return new Effect.Scale(element, window.opera ? 0 : 1, - Object.extend({ scaleContent: false, - scaleX: false, - scaleMode: 'box', - scaleFrom: 100, - scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, - restoreAfterFinish: true, - afterSetup: function(effect) { - effect.element.makePositioned(); - effect.element.down().makePositioned(); - if (window.opera) effect.element.setStyle({top: ''}); - effect.element.makeClipping().show(); - }, - afterUpdateInternal: function(effect) { - effect.element.down().setStyle({bottom: - (effect.dims[0] - effect.element.clientHeight) + 'px' }); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().undoPositioned(); - effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); - } - }, arguments[1] || { }) - ); -}; - -// Bug in opera makes the TD containing this element expand for a instance after finish -Effect.Squish = function(element) { - return new Effect.Scale(element, window.opera ? 1 : 0, { - restoreAfterFinish: true, - beforeSetup: function(effect) { - effect.element.makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping(); - } - }); -}; - -Effect.Grow = function(element) { - element = $(element); - var options = Object.extend({ - direction: 'center', - moveTransition: Effect.Transitions.sinoidal, - scaleTransition: Effect.Transitions.sinoidal, - opacityTransition: Effect.Transitions.full - }, arguments[1] || { }); - var oldStyle = { - top: element.style.top, - left: element.style.left, - height: element.style.height, - width: element.style.width, - opacity: element.getInlineOpacity() }; - - var dims = element.getDimensions(); - var initialMoveX, initialMoveY; - var moveX, moveY; - - switch (options.direction) { - case 'top-left': - initialMoveX = initialMoveY = moveX = moveY = 0; - break; - case 'top-right': - initialMoveX = dims.width; - initialMoveY = moveY = 0; - moveX = -dims.width; - break; - case 'bottom-left': - initialMoveX = moveX = 0; - initialMoveY = dims.height; - moveY = -dims.height; - break; - case 'bottom-right': - initialMoveX = dims.width; - initialMoveY = dims.height; - moveX = -dims.width; - moveY = -dims.height; - break; - case 'center': - initialMoveX = dims.width / 2; - initialMoveY = dims.height / 2; - moveX = -dims.width / 2; - moveY = -dims.height / 2; - break; - } - - return new Effect.Move(element, { - x: initialMoveX, - y: initialMoveY, - duration: 0.01, - beforeSetup: function(effect) { - effect.element.hide().makeClipping().makePositioned(); - }, - afterFinishInternal: function(effect) { - new Effect.Parallel( - [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), - new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), - new Effect.Scale(effect.element, 100, { - scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, - sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) - ], Object.extend({ - beforeSetup: function(effect) { - effect.effects[0].element.setStyle({height: '0px'}).show(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); - } - }, options) - ) - } - }); -}; - -Effect.Shrink = function(element) { - element = $(element); - var options = Object.extend({ - direction: 'center', - moveTransition: Effect.Transitions.sinoidal, - scaleTransition: Effect.Transitions.sinoidal, - opacityTransition: Effect.Transitions.none - }, arguments[1] || { }); - var oldStyle = { - top: element.style.top, - left: element.style.left, - height: element.style.height, - width: element.style.width, - opacity: element.getInlineOpacity() }; - - var dims = element.getDimensions(); - var moveX, moveY; - - switch (options.direction) { - case 'top-left': - moveX = moveY = 0; - break; - case 'top-right': - moveX = dims.width; - moveY = 0; - break; - case 'bottom-left': - moveX = 0; - moveY = dims.height; - break; - case 'bottom-right': - moveX = dims.width; - moveY = dims.height; - break; - case 'center': - moveX = dims.width / 2; - moveY = dims.height / 2; - break; - } - - return new Effect.Parallel( - [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), - new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), - new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) - ], Object.extend({ - beforeStartInternal: function(effect) { - effect.effects[0].element.makePositioned().makeClipping(); - }, - afterFinishInternal: function(effect) { - effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } - }, options) - ); -}; - -Effect.Pulsate = function(element) { - element = $(element); - var options = arguments[1] || { }; - var oldOpacity = element.getInlineOpacity(); - var transition = options.transition || Effect.Transitions.sinoidal; - var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) }; - reverser.bind(transition); - return new Effect.Opacity(element, - Object.extend(Object.extend({ duration: 2.0, from: 0, - afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } - }, options), {transition: reverser})); -}; - -Effect.Fold = function(element) { - element = $(element); - var oldStyle = { - top: element.style.top, - left: element.style.left, - width: element.style.width, - height: element.style.height }; - element.makeClipping(); - return new Effect.Scale(element, 5, Object.extend({ - scaleContent: false, - scaleX: false, - afterFinishInternal: function(effect) { - new Effect.Scale(element, 1, { - scaleContent: false, - scaleY: false, - afterFinishInternal: function(effect) { - effect.element.hide().undoClipping().setStyle(oldStyle); - } }); - }}, arguments[1] || { })); -}; - -Effect.Morph = Class.create(Effect.Base, { - initialize: function(element) { - this.element = $(element); - if (!this.element) throw(Effect._elementDoesNotExistError); - var options = Object.extend({ - style: { } - }, arguments[1] || { }); - - if (!Object.isString(options.style)) this.style = $H(options.style); - else { - if (options.style.include(':')) - this.style = options.style.parseStyle(); - else { - this.element.addClassName(options.style); - this.style = $H(this.element.getStyles()); - this.element.removeClassName(options.style); - var css = this.element.getStyles(); - this.style = this.style.reject(function(style) { - return style.value == css[style.key]; - }); - options.afterFinishInternal = function(effect) { - effect.element.addClassName(effect.options.style); - effect.transforms.each(function(transform) { - effect.element.style[transform.style] = ''; - }); - } - } - } - this.start(options); - }, - - setup: function(){ - function parseColor(color){ - if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; - color = color.parseColor(); - return $R(0,2).map(function(i){ - return parseInt( color.slice(i*2+1,i*2+3), 16 ) - }); - } - this.transforms = this.style.map(function(pair){ - var property = pair[0], value = pair[1], unit = null; - - if (value.parseColor('#zzzzzz') != '#zzzzzz') { - value = value.parseColor(); - unit = 'color'; - } else if (property == 'opacity') { - value = parseFloat(value); - if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) - this.element.setStyle({zoom: 1}); - } else if (Element.CSS_LENGTH.test(value)) { - var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/); - value = parseFloat(components[1]); - unit = (components.length == 3) ? components[2] : null; - } - - var originalValue = this.element.getStyle(property); - return { - style: property.camelize(), - originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), - targetValue: unit=='color' ? parseColor(value) : value, - unit: unit - }; - }.bind(this)).reject(function(transform){ - return ( - (transform.originalValue == transform.targetValue) || - ( - transform.unit != 'color' && - (isNaN(transform.originalValue) || isNaN(transform.targetValue)) - ) - ) - }); - }, - update: function(position) { - var style = { }, transform, i = this.transforms.length; - while(i--) - style[(transform = this.transforms[i]).style] = - transform.unit=='color' ? '#'+ - (Math.round(transform.originalValue[0]+ - (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() + - (Math.round(transform.originalValue[1]+ - (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() + - (Math.round(transform.originalValue[2]+ - (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() : - (transform.originalValue + - (transform.targetValue - transform.originalValue) * position).toFixed(3) + - (transform.unit === null ? '' : transform.unit); - this.element.setStyle(style, true); - } -}); - -Effect.Transform = Class.create({ - initialize: function(tracks){ - this.tracks = []; - this.options = arguments[1] || { }; - this.addTracks(tracks); - }, - addTracks: function(tracks){ - tracks.each(function(track){ - track = $H(track); - var data = track.values().first(); - this.tracks.push($H({ - ids: track.keys().first(), - effect: Effect.Morph, - options: { style: data } - })); - }.bind(this)); - return this; - }, - play: function(){ - return new Effect.Parallel( - this.tracks.map(function(track){ - var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options'); - var elements = [$(ids) || $$(ids)].flatten(); - return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) }); - }).flatten(), - this.options - ); - } -}); - -Element.CSS_PROPERTIES = $w( - 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + - 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + - 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + - 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' + - 'fontSize fontWeight height left letterSpacing lineHeight ' + - 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+ - 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' + - 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + - 'right textIndent top width wordSpacing zIndex'); - -Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; - -String.__parseStyleElement = document.createElement('div'); -String.prototype.parseStyle = function(){ - var style, styleRules = $H(); - if (Prototype.Browser.WebKit) - style = new Element('div',{style:this}).style; - else { - String.__parseStyleElement.innerHTML = '
    '; - style = String.__parseStyleElement.childNodes[0].style; - } - - Element.CSS_PROPERTIES.each(function(property){ - if (style[property]) styleRules.set(property, style[property]); - }); - - if (Prototype.Browser.IE && this.include('opacity')) - styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]); - - return styleRules; -}; - -if (document.defaultView && document.defaultView.getComputedStyle) { - Element.getStyles = function(element) { - var css = document.defaultView.getComputedStyle($(element), null); - return Element.CSS_PROPERTIES.inject({ }, function(styles, property) { - styles[property] = css[property]; - return styles; - }); - }; -} else { - Element.getStyles = function(element) { - element = $(element); - var css = element.currentStyle, styles; - styles = Element.CSS_PROPERTIES.inject({ }, function(hash, property) { - hash.set(property, css[property]); - return hash; - }); - if (!styles.opacity) styles.set('opacity', element.getOpacity()); - return styles; - }; -}; - -Effect.Methods = { - morph: function(element, style) { - element = $(element); - new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { })); - return element; - }, - visualEffect: function(element, effect, options) { - element = $(element) - var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1); - new Effect[klass](element, options); - return element; - }, - highlight: function(element, options) { - element = $(element); - new Effect.Highlight(element, options); - return element; - } -}; - -$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+ - 'pulsate shake puff squish switchOff dropOut').each( - function(effect) { - Effect.Methods[effect] = function(element, options){ - element = $(element); - Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options); - return element; - } - } -); - -$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( - function(f) { Effect.Methods[f] = Element[f]; } -); - -Element.addMethods(Effect.Methods); diff -uNr a/mp-wp/wp-includes/js/scriptaculous/prototype.js b/mp-wp/wp-includes/js/scriptaculous/prototype.js --- a/mp-wp/wp-includes/js/scriptaculous/prototype.js 066cb61e50765a665d7a67d70150fdd04668dab0d87c5b98eb13fdccbab0c79e1dd904c870c73c8871ddd2a2ea20f0975f10cc0d7643fb00d12b9d414a4d6e29 +++ b/mp-wp/wp-includes/js/scriptaculous/prototype.js false @@ -1,4184 +0,0 @@ -/* Prototype JavaScript framework, version 1.6.0 - * (c) 2005-2007 Sam Stephenson - * - * Prototype is freely distributable under the terms of an MIT-style license. - * For details, see the Prototype web site: http://www.prototypejs.org/ - * - *--------------------------------------------------------------------------*/ - -var Prototype = { - Version: '1.6.0', - - Browser: { - IE: !!(window.attachEvent && !window.opera), - Opera: !!window.opera, - WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, - Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1, - MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) - }, - - BrowserFeatures: { - XPath: !!document.evaluate, - ElementExtensions: !!window.HTMLElement, - SpecificElementExtensions: - document.createElement('div').__proto__ && - document.createElement('div').__proto__ !== - document.createElement('form').__proto__ - }, - - ScriptFragment: ']*>([\\S\\s]*?)<\/script>', - JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, - - emptyFunction: function() { }, - K: function(x) { return x } -}; - -if (Prototype.Browser.MobileSafari) - Prototype.BrowserFeatures.SpecificElementExtensions = false; - -if (Prototype.Browser.WebKit) - Prototype.BrowserFeatures.XPath = false; - -/* Based on Alex Arnell's inheritance implementation. */ -var Class = { - create: function() { - var parent = null, properties = $A(arguments); - if (Object.isFunction(properties[0])) - parent = properties.shift(); - - function klass() { - this.initialize.apply(this, arguments); - } - - Object.extend(klass, Class.Methods); - klass.superclass = parent; - klass.subclasses = []; - - if (parent) { - var subclass = function() { }; - subclass.prototype = parent.prototype; - klass.prototype = new subclass; - parent.subclasses.push(klass); - } - - for (var i = 0; i < properties.length; i++) - klass.addMethods(properties[i]); - - if (!klass.prototype.initialize) - klass.prototype.initialize = Prototype.emptyFunction; - - klass.prototype.constructor = klass; - - return klass; - } -}; - -Class.Methods = { - addMethods: function(source) { - var ancestor = this.superclass && this.superclass.prototype; - var properties = Object.keys(source); - - if (!Object.keys({ toString: true }).length) - properties.push("toString", "valueOf"); - - for (var i = 0, length = properties.length; i < length; i++) { - var property = properties[i], value = source[property]; - if (ancestor && Object.isFunction(value) && - value.argumentNames().first() == "$super") { - var method = value, value = Object.extend((function(m) { - return function() { return ancestor[m].apply(this, arguments) }; - })(property).wrap(method), { - valueOf: function() { return method }, - toString: function() { return method.toString() } - }); - } - this.prototype[property] = value; - } - - return this; - } -}; - -var Abstract = { }; - -Object.extend = function(destination, source) { - for (var property in source) - destination[property] = source[property]; - return destination; -}; - -Object.extend(Object, { - inspect: function(object) { - try { - if (object === undefined) return 'undefined'; - if (object === null) return 'null'; - return object.inspect ? object.inspect() : object.toString(); - } catch (e) { - if (e instanceof RangeError) return '...'; - throw e; - } - }, - - toJSON: function(object) { - var type = typeof object; - switch (type) { - case 'undefined': - case 'function': - case 'unknown': return; - case 'boolean': return object.toString(); - } - - if (object === null) return 'null'; - if (object.toJSON) return object.toJSON(); - if (Object.isElement(object)) return; - - var results = []; - for (var property in object) { - var value = Object.toJSON(object[property]); - if (value !== undefined) - results.push(property.toJSON() + ': ' + value); - } - - return '{' + results.join(', ') + '}'; - }, - - toQueryString: function(object) { - return $H(object).toQueryString(); - }, - - toHTML: function(object) { - return object && object.toHTML ? object.toHTML() : String.interpret(object); - }, - - keys: function(object) { - var keys = []; - for (var property in object) - keys.push(property); - return keys; - }, - - values: function(object) { - var values = []; - for (var property in object) - values.push(object[property]); - return values; - }, - - clone: function(object) { - return Object.extend({ }, object); - }, - - isElement: function(object) { - return object && object.nodeType == 1; - }, - - isArray: function(object) { - return object && object.constructor === Array; - }, - - isHash: function(object) { - return object instanceof Hash; - }, - - isFunction: function(object) { - return typeof object == "function"; - }, - - isString: function(object) { - return typeof object == "string"; - }, - - isNumber: function(object) { - return typeof object == "number"; - }, - - isUndefined: function(object) { - return typeof object == "undefined"; - } -}); - -Object.extend(Function.prototype, { - argumentNames: function() { - var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip"); - return names.length == 1 && !names[0] ? [] : names; - }, - - bind: function() { - if (arguments.length < 2 && arguments[0] === undefined) return this; - var __method = this, args = $A(arguments), object = args.shift(); - return function() { - return __method.apply(object, args.concat($A(arguments))); - } - }, - - bindAsEventListener: function() { - var __method = this, args = $A(arguments), object = args.shift(); - return function(event) { - return __method.apply(object, [event || window.event].concat(args)); - } - }, - - curry: function() { - if (!arguments.length) return this; - var __method = this, args = $A(arguments); - return function() { - return __method.apply(this, args.concat($A(arguments))); - } - }, - - delay: function() { - var __method = this, args = $A(arguments), timeout = args.shift() * 1000; - return window.setTimeout(function() { - return __method.apply(__method, args); - }, timeout); - }, - - wrap: function(wrapper) { - var __method = this; - return function() { - return wrapper.apply(this, [__method.bind(this)].concat($A(arguments))); - } - }, - - methodize: function() { - if (this._methodized) return this._methodized; - var __method = this; - return this._methodized = function() { - return __method.apply(null, [this].concat($A(arguments))); - }; - } -}); - -Function.prototype.defer = Function.prototype.delay.curry(0.01); - -Date.prototype.toJSON = function() { - return '"' + this.getUTCFullYear() + '-' + - (this.getUTCMonth() + 1).toPaddedString(2) + '-' + - this.getUTCDate().toPaddedString(2) + 'T' + - this.getUTCHours().toPaddedString(2) + ':' + - this.getUTCMinutes().toPaddedString(2) + ':' + - this.getUTCSeconds().toPaddedString(2) + 'Z"'; -}; - -var Try = { - these: function() { - var returnValue; - - for (var i = 0, length = arguments.length; i < length; i++) { - var lambda = arguments[i]; - try { - returnValue = lambda(); - break; - } catch (e) { } - } - - return returnValue; - } -}; - -RegExp.prototype.match = RegExp.prototype.test; - -RegExp.escape = function(str) { - return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); -}; - -/*--------------------------------------------------------------------------*/ - -var PeriodicalExecuter = Class.create({ - initialize: function(callback, frequency) { - this.callback = callback; - this.frequency = frequency; - this.currentlyExecuting = false; - - this.registerCallback(); - }, - - registerCallback: function() { - this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); - }, - - execute: function() { - this.callback(this); - }, - - stop: function() { - if (!this.timer) return; - clearInterval(this.timer); - this.timer = null; - }, - - onTimerEvent: function() { - if (!this.currentlyExecuting) { - try { - this.currentlyExecuting = true; - this.execute(); - } finally { - this.currentlyExecuting = false; - } - } - } -}); -Object.extend(String, { - interpret: function(value) { - return value == null ? '' : String(value); - }, - specialChar: { - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '\\': '\\\\' - } -}); - -Object.extend(String.prototype, { - gsub: function(pattern, replacement) { - var result = '', source = this, match; - replacement = arguments.callee.prepareReplacement(replacement); - - while (source.length > 0) { - if (match = source.match(pattern)) { - result += source.slice(0, match.index); - result += String.interpret(replacement(match)); - source = source.slice(match.index + match[0].length); - } else { - result += source, source = ''; - } - } - return result; - }, - - sub: function(pattern, replacement, count) { - replacement = this.gsub.prepareReplacement(replacement); - count = count === undefined ? 1 : count; - - return this.gsub(pattern, function(match) { - if (--count < 0) return match[0]; - return replacement(match); - }); - }, - - scan: function(pattern, iterator) { - this.gsub(pattern, iterator); - return String(this); - }, - - truncate: function(length, truncation) { - length = length || 30; - truncation = truncation === undefined ? '...' : truncation; - return this.length > length ? - this.slice(0, length - truncation.length) + truncation : String(this); - }, - - strip: function() { - return this.replace(/^\s+/, '').replace(/\s+$/, ''); - }, - - stripTags: function() { - return this.replace(/<\/?[^>]+>/gi, ''); - }, - - stripScripts: function() { - return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); - }, - - extractScripts: function() { - var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); - var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); - return (this.match(matchAll) || []).map(function(scriptTag) { - return (scriptTag.match(matchOne) || ['', ''])[1]; - }); - }, - - evalScripts: function() { - return this.extractScripts().map(function(script) { return eval(script) }); - }, - - escapeHTML: function() { - var self = arguments.callee; - self.text.data = this; - return self.div.innerHTML; - }, - - unescapeHTML: function() { - var div = new Element('div'); - div.innerHTML = this.stripTags(); - return div.childNodes[0] ? (div.childNodes.length > 1 ? - $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) : - div.childNodes[0].nodeValue) : ''; - }, - - toQueryParams: function(separator) { - var match = this.strip().match(/([^?#]*)(#.*)?$/); - if (!match) return { }; - - return match[1].split(separator || '&').inject({ }, function(hash, pair) { - if ((pair = pair.split('='))[0]) { - var key = decodeURIComponent(pair.shift()); - var value = pair.length > 1 ? pair.join('=') : pair[0]; - if (value != undefined) value = decodeURIComponent(value); - - if (key in hash) { - if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; - hash[key].push(value); - } - else hash[key] = value; - } - return hash; - }); - }, - - toArray: function() { - return this.split(''); - }, - - succ: function() { - return this.slice(0, this.length - 1) + - String.fromCharCode(this.charCodeAt(this.length - 1) + 1); - }, - - times: function(count) { - return count < 1 ? '' : new Array(count + 1).join(this); - }, - - camelize: function() { - var parts = this.split('-'), len = parts.length; - if (len == 1) return parts[0]; - - var camelized = this.charAt(0) == '-' - ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) - : parts[0]; - - for (var i = 1; i < len; i++) - camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); - - return camelized; - }, - - capitalize: function() { - return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); - }, - - underscore: function() { - return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); - }, - - dasherize: function() { - return this.gsub(/_/,'-'); - }, - - inspect: function(useDoubleQuotes) { - var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) { - var character = String.specialChar[match[0]]; - return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16); - }); - if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; - return "'" + escapedString.replace(/'/g, '\\\'') + "'"; - }, - - toJSON: function() { - return this.inspect(true); - }, - - unfilterJSON: function(filter) { - return this.sub(filter || Prototype.JSONFilter, '#{1}'); - }, - - isJSON: function() { - var str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, ''); - return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str); - }, - - evalJSON: function(sanitize) { - var json = this.unfilterJSON(); - try { - if (!sanitize || json.isJSON()) return eval('(' + json + ')'); - } catch (e) { } - throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); - }, - - include: function(pattern) { - return this.indexOf(pattern) > -1; - }, - - startsWith: function(pattern) { - return this.indexOf(pattern) === 0; - }, - - endsWith: function(pattern) { - var d = this.length - pattern.length; - return d >= 0 && this.lastIndexOf(pattern) === d; - }, - - empty: function() { - return this == ''; - }, - - blank: function() { - return /^\s*$/.test(this); - }, - - interpolate: function(object, pattern) { - return new Template(this, pattern).evaluate(object); - } -}); - -if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, { - escapeHTML: function() { - return this.replace(/&/g,'&').replace(//g,'>'); - }, - unescapeHTML: function() { - return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); - } -}); - -String.prototype.gsub.prepareReplacement = function(replacement) { - if (Object.isFunction(replacement)) return replacement; - var template = new Template(replacement); - return function(match) { return template.evaluate(match) }; -}; - -String.prototype.parseQuery = String.prototype.toQueryParams; - -Object.extend(String.prototype.escapeHTML, { - div: document.createElement('div'), - text: document.createTextNode('') -}); - -with (String.prototype.escapeHTML) div.appendChild(text); - -var Template = Class.create({ - initialize: function(template, pattern) { - this.template = template.toString(); - this.pattern = pattern || Template.Pattern; - }, - - evaluate: function(object) { - if (Object.isFunction(object.toTemplateReplacements)) - object = object.toTemplateReplacements(); - - return this.template.gsub(this.pattern, function(match) { - if (object == null) return ''; - - var before = match[1] || ''; - if (before == '\\') return match[2]; - - var ctx = object, expr = match[3]; - var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/, match = pattern.exec(expr); - if (match == null) return before; - - while (match != null) { - var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1]; - ctx = ctx[comp]; - if (null == ctx || '' == match[3]) break; - expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); - match = pattern.exec(expr); - } - - return before + String.interpret(ctx); - }.bind(this)); - } -}); -Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; - -var $break = { }; - -var Enumerable = { - each: function(iterator, context) { - var index = 0; - iterator = iterator.bind(context); - try { - this._each(function(value) { - iterator(value, index++); - }); - } catch (e) { - if (e != $break) throw e; - } - return this; - }, - - eachSlice: function(number, iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var index = -number, slices = [], array = this.toArray(); - while ((index += number) < array.length) - slices.push(array.slice(index, index+number)); - return slices.collect(iterator, context); - }, - - all: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var result = true; - this.each(function(value, index) { - result = result && !!iterator(value, index); - if (!result) throw $break; - }); - return result; - }, - - any: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var result = false; - this.each(function(value, index) { - if (result = !!iterator(value, index)) - throw $break; - }); - return result; - }, - - collect: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var results = []; - this.each(function(value, index) { - results.push(iterator(value, index)); - }); - return results; - }, - - detect: function(iterator, context) { - iterator = iterator.bind(context); - var result; - this.each(function(value, index) { - if (iterator(value, index)) { - result = value; - throw $break; - } - }); - return result; - }, - - findAll: function(iterator, context) { - iterator = iterator.bind(context); - var results = []; - this.each(function(value, index) { - if (iterator(value, index)) - results.push(value); - }); - return results; - }, - - grep: function(filter, iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var results = []; - - if (Object.isString(filter)) - filter = new RegExp(filter); - - this.each(function(value, index) { - if (filter.match(value)) - results.push(iterator(value, index)); - }); - return results; - }, - - include: function(object) { - if (Object.isFunction(this.indexOf)) - if (this.indexOf(object) != -1) return true; - - var found = false; - this.each(function(value) { - if (value == object) { - found = true; - throw $break; - } - }); - return found; - }, - - inGroupsOf: function(number, fillWith) { - fillWith = fillWith === undefined ? null : fillWith; - return this.eachSlice(number, function(slice) { - while(slice.length < number) slice.push(fillWith); - return slice; - }); - }, - - inject: function(memo, iterator, context) { - iterator = iterator.bind(context); - this.each(function(value, index) { - memo = iterator(memo, value, index); - }); - return memo; - }, - - invoke: function(method) { - var args = $A(arguments).slice(1); - return this.map(function(value) { - return value[method].apply(value, args); - }); - }, - - max: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var result; - this.each(function(value, index) { - value = iterator(value, index); - if (result == undefined || value >= result) - result = value; - }); - return result; - }, - - min: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var result; - this.each(function(value, index) { - value = iterator(value, index); - if (result == undefined || value < result) - result = value; - }); - return result; - }, - - partition: function(iterator, context) { - iterator = iterator ? iterator.bind(context) : Prototype.K; - var trues = [], falses = []; - this.each(function(value, index) { - (iterator(value, index) ? - trues : falses).push(value); - }); - return [trues, falses]; - }, - - pluck: function(property) { - var results = []; - this.each(function(value) { - results.push(value[property]); - }); - return results; - }, - - reject: function(iterator, context) { - iterator = iterator.bind(context); - var results = []; - this.each(function(value, index) { - if (!iterator(value, index)) - results.push(value); - }); - return results; - }, - - sortBy: function(iterator, context) { - iterator = iterator.bind(context); - return this.map(function(value, index) { - return {value: value, criteria: iterator(value, index)}; - }).sort(function(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }).pluck('value'); - }, - - toArray: function() { - return this.map(); - }, - - zip: function() { - var iterator = Prototype.K, args = $A(arguments); - if (Object.isFunction(args.last())) - iterator = args.pop(); - - var collections = [this].concat(args).map($A); - return this.map(function(value, index) { - return iterator(collections.pluck(index)); - }); - }, - - size: function() { - return this.toArray().length; - }, - - inspect: function() { - return '#'; - } -}; - -Object.extend(Enumerable, { - map: Enumerable.collect, - find: Enumerable.detect, - select: Enumerable.findAll, - filter: Enumerable.findAll, - member: Enumerable.include, - entries: Enumerable.toArray, - every: Enumerable.all, - some: Enumerable.any -}); -function $A(iterable) { - if (!iterable) return []; - if (iterable.toArray) return iterable.toArray(); - var length = iterable.length, results = new Array(length); - while (length--) results[length] = iterable[length]; - return results; -} - -if (Prototype.Browser.WebKit) { - function $A(iterable) { - if (!iterable) return []; - if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') && - iterable.toArray) return iterable.toArray(); - var length = iterable.length, results = new Array(length); - while (length--) results[length] = iterable[length]; - return results; - } -} - -Array.from = $A; - -Object.extend(Array.prototype, Enumerable); - -if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse; - -Object.extend(Array.prototype, { - _each: function(iterator) { - for (var i = 0, length = this.length; i < length; i++) - iterator(this[i]); - }, - - clear: function() { - this.length = 0; - return this; - }, - - first: function() { - return this[0]; - }, - - last: function() { - return this[this.length - 1]; - }, - - compact: function() { - return this.select(function(value) { - return value != null; - }); - }, - - flatten: function() { - return this.inject([], function(array, value) { - return array.concat(Object.isArray(value) ? - value.flatten() : [value]); - }); - }, - - without: function() { - var values = $A(arguments); - return this.select(function(value) { - return !values.include(value); - }); - }, - - reverse: function(inline) { - return (inline !== false ? this : this.toArray())._reverse(); - }, - - reduce: function() { - return this.length > 1 ? this : this[0]; - }, - - uniq: function(sorted) { - return this.inject([], function(array, value, index) { - if (0 == index || (sorted ? array.last() != value : !array.include(value))) - array.push(value); - return array; - }); - }, - - intersect: function(array) { - return this.uniq().findAll(function(item) { - return array.detect(function(value) { return item === value }); - }); - }, - - clone: function() { - return [].concat(this); - }, - - size: function() { - return this.length; - }, - - inspect: function() { - return '[' + this.map(Object.inspect).join(', ') + ']'; - }, - - toJSON: function() { - var results = []; - this.each(function(object) { - var value = Object.toJSON(object); - if (value !== undefined) results.push(value); - }); - return '[' + results.join(', ') + ']'; - } -}); - -// use native browser JS 1.6 implementation if available -if (Object.isFunction(Array.prototype.forEach)) - Array.prototype._each = Array.prototype.forEach; - -if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) { - i || (i = 0); - var length = this.length; - if (i < 0) i = length + i; - for (; i < length; i++) - if (this[i] === item) return i; - return -1; -}; - -if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) { - i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; - var n = this.slice(0, i).reverse().indexOf(item); - return (n < 0) ? n : i - n - 1; -}; - -Array.prototype.toArray = Array.prototype.clone; - -function $w(string) { - if (!Object.isString(string)) return []; - string = string.strip(); - return string ? string.split(/\s+/) : []; -} - -if (Prototype.Browser.Opera){ - Array.prototype.concat = function() { - var array = []; - for (var i = 0, length = this.length; i < length; i++) array.push(this[i]); - for (var i = 0, length = arguments.length; i < length; i++) { - if (Object.isArray(arguments[i])) { - for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) - array.push(arguments[i][j]); - } else { - array.push(arguments[i]); - } - } - return array; - }; -} -Object.extend(Number.prototype, { - toColorPart: function() { - return this.toPaddedString(2, 16); - }, - - succ: function() { - return this + 1; - }, - - times: function(iterator) { - $R(0, this, true).each(iterator); - return this; - }, - - toPaddedString: function(length, radix) { - var string = this.toString(radix || 10); - return '0'.times(length - string.length) + string; - }, - - toJSON: function() { - return isFinite(this) ? this.toString() : 'null'; - } -}); - -$w('abs round ceil floor').each(function(method){ - Number.prototype[method] = Math[method].methodize(); -}); -function $H(object) { - return new Hash(object); -}; - -var Hash = Class.create(Enumerable, (function() { - if (function() { - var i = 0, Test = function(value) { this.key = value }; - Test.prototype.key = 'foo'; - for (var property in new Test('bar')) i++; - return i > 1; - }()) { - function each(iterator) { - var cache = []; - for (var key in this._object) { - var value = this._object[key]; - if (cache.include(key)) continue; - cache.push(key); - var pair = [key, value]; - pair.key = key; - pair.value = value; - iterator(pair); - } - } - } else { - function each(iterator) { - for (var key in this._object) { - var value = this._object[key], pair = [key, value]; - pair.key = key; - pair.value = value; - iterator(pair); - } - } - } - - function toQueryPair(key, value) { - if (Object.isUndefined(value)) return key; - return key + '=' + encodeURIComponent(String.interpret(value)); - } - - return { - initialize: function(object) { - this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); - }, - - _each: each, - - set: function(key, value) { - return this._object[key] = value; - }, - - get: function(key) { - return this._object[key]; - }, - - unset: function(key) { - var value = this._object[key]; - delete this._object[key]; - return value; - }, - - toObject: function() { - return Object.clone(this._object); - }, - - keys: function() { - return this.pluck('key'); - }, - - values: function() { - return this.pluck('value'); - }, - - index: function(value) { - var match = this.detect(function(pair) { - return pair.value === value; - }); - return match && match.key; - }, - - merge: function(object) { - return this.clone().update(object); - }, - - update: function(object) { - return new Hash(object).inject(this, function(result, pair) { - result.set(pair.key, pair.value); - return result; - }); - }, - - toQueryString: function() { - return this.map(function(pair) { - var key = encodeURIComponent(pair.key), values = pair.value; - - if (values && typeof values == 'object') { - if (Object.isArray(values)) - return values.map(toQueryPair.curry(key)).join('&'); - } - return toQueryPair(key, values); - }).join('&'); - }, - - inspect: function() { - return '#'; - }, - - toJSON: function() { - return Object.toJSON(this.toObject()); - }, - - clone: function() { - return new Hash(this); - } - } -})()); - -Hash.prototype.toTemplateReplacements = Hash.prototype.toObject; -Hash.from = $H; -var ObjectRange = Class.create(Enumerable, { - initialize: function(start, end, exclusive) { - this.start = start; - this.end = end; - this.exclusive = exclusive; - }, - - _each: function(iterator) { - var value = this.start; - while (this.include(value)) { - iterator(value); - value = value.succ(); - } - }, - - include: function(value) { - if (value < this.start) - return false; - if (this.exclusive) - return value < this.end; - return value <= this.end; - } -}); - -var $R = function(start, end, exclusive) { - return new ObjectRange(start, end, exclusive); -}; - -var Ajax = { - getTransport: function() { - return Try.these( - function() {return new XMLHttpRequest()}, - function() {return new ActiveXObject('Msxml2.XMLHTTP')}, - function() {return new ActiveXObject('Microsoft.XMLHTTP')} - ) || false; - }, - - activeRequestCount: 0 -}; - -Ajax.Responders = { - responders: [], - - _each: function(iterator) { - this.responders._each(iterator); - }, - - register: function(responder) { - if (!this.include(responder)) - this.responders.push(responder); - }, - - unregister: function(responder) { - this.responders = this.responders.without(responder); - }, - - dispatch: function(callback, request, transport, json) { - this.each(function(responder) { - if (Object.isFunction(responder[callback])) { - try { - responder[callback].apply(responder, [request, transport, json]); - } catch (e) { } - } - }); - } -}; - -Object.extend(Ajax.Responders, Enumerable); - -Ajax.Responders.register({ - onCreate: function() { Ajax.activeRequestCount++ }, - onComplete: function() { Ajax.activeRequestCount-- } -}); - -Ajax.Base = Class.create({ - initialize: function(options) { - this.options = { - method: 'post', - asynchronous: true, - contentType: 'application/x-www-form-urlencoded', - encoding: 'UTF-8', - parameters: '', - evalJSON: true, - evalJS: true - }; - Object.extend(this.options, options || { }); - - this.options.method = this.options.method.toLowerCase(); - if (Object.isString(this.options.parameters)) - this.options.parameters = this.options.parameters.toQueryParams(); - } -}); - -Ajax.Request = Class.create(Ajax.Base, { - _complete: false, - - initialize: function($super, url, options) { - $super(options); - this.transport = Ajax.getTransport(); - this.request(url); - }, - - request: function(url) { - this.url = url; - this.method = this.options.method; - var params = Object.clone(this.options.parameters); - - if (!['get', 'post'].include(this.method)) { - // simulate other verbs over post - params['_method'] = this.method; - this.method = 'post'; - } - - this.parameters = params; - - if (params = Object.toQueryString(params)) { - // when GET, append parameters to URL - if (this.method == 'get') - this.url += (this.url.include('?') ? '&' : '?') + params; - else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) - params += '&_='; - } - - try { - var response = new Ajax.Response(this); - if (this.options.onCreate) this.options.onCreate(response); - Ajax.Responders.dispatch('onCreate', this, response); - - this.transport.open(this.method.toUpperCase(), this.url, - this.options.asynchronous); - - if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); - - this.transport.onreadystatechange = this.onStateChange.bind(this); - this.setRequestHeaders(); - - this.body = this.method == 'post' ? (this.options.postBody || params) : null; - this.transport.send(this.body); - - /* Force Firefox to handle ready state 4 for synchronous requests */ - if (!this.options.asynchronous && this.transport.overrideMimeType) - this.onStateChange(); - - } - catch (e) { - this.dispatchException(e); - } - }, - - onStateChange: function() { - var readyState = this.transport.readyState; - if (readyState > 1 && !((readyState == 4) && this._complete)) - this.respondToReadyState(this.transport.readyState); - }, - - setRequestHeaders: function() { - var headers = { - 'X-Requested-With': 'XMLHttpRequest', - 'X-Prototype-Version': Prototype.Version, - 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' - }; - - if (this.method == 'post') { - headers['Content-type'] = this.options.contentType + - (this.options.encoding ? '; charset=' + this.options.encoding : ''); - - /* Force "Connection: close" for older Mozilla browsers to work - * around a bug where XMLHttpRequest sends an incorrect - * Content-length header. See Mozilla Bugzilla #246651. - */ - if (this.transport.overrideMimeType && - (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) - headers['Connection'] = 'close'; - } - - // user-defined headers - if (typeof this.options.requestHeaders == 'object') { - var extras = this.options.requestHeaders; - - if (Object.isFunction(extras.push)) - for (var i = 0, length = extras.length; i < length; i += 2) - headers[extras[i]] = extras[i+1]; - else - $H(extras).each(function(pair) { headers[pair.key] = pair.value }); - } - - for (var name in headers) - this.transport.setRequestHeader(name, headers[name]); - }, - - success: function() { - var status = this.getStatus(); - return !status || (status >= 200 && status < 300); - }, - - getStatus: function() { - try { - return this.transport.status || 0; - } catch (e) { return 0 } - }, - - respondToReadyState: function(readyState) { - var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); - - if (state == 'Complete') { - try { - this._complete = true; - (this.options['on' + response.status] - || this.options['on' + (this.success() ? 'Success' : 'Failure')] - || Prototype.emptyFunction)(response, response.headerJSON); - } catch (e) { - this.dispatchException(e); - } - - var contentType = response.getHeader('Content-type'); - if (this.options.evalJS == 'force' - || (this.options.evalJS && contentType - && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) - this.evalResponse(); - } - - try { - (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); - Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); - } catch (e) { - this.dispatchException(e); - } - - if (state == 'Complete') { - // avoid memory leak in MSIE: clean up - this.transport.onreadystatechange = Prototype.emptyFunction; - } - }, - - getHeader: function(name) { - try { - return this.transport.getResponseHeader(name); - } catch (e) { return null } - }, - - evalResponse: function() { - try { - return eval((this.transport.responseText || '').unfilterJSON()); - } catch (e) { - this.dispatchException(e); - } - }, - - dispatchException: function(exception) { - (this.options.onException || Prototype.emptyFunction)(this, exception); - Ajax.Responders.dispatch('onException', this, exception); - } -}); - -Ajax.Request.Events = - ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; - -Ajax.Response = Class.create({ - initialize: function(request){ - this.request = request; - var transport = this.transport = request.transport, - readyState = this.readyState = transport.readyState; - - if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { - this.status = this.getStatus(); - this.statusText = this.getStatusText(); - this.responseText = String.interpret(transport.responseText); - this.headerJSON = this._getHeaderJSON(); - } - - if(readyState == 4) { - var xml = transport.responseXML; - this.responseXML = xml === undefined ? null : xml; - this.responseJSON = this._getResponseJSON(); - } - }, - - status: 0, - statusText: '', - - getStatus: Ajax.Request.prototype.getStatus, - - getStatusText: function() { - try { - return this.transport.statusText || ''; - } catch (e) { return '' } - }, - - getHeader: Ajax.Request.prototype.getHeader, - - getAllHeaders: function() { - try { - return this.getAllResponseHeaders(); - } catch (e) { return null } - }, - - getResponseHeader: function(name) { - return this.transport.getResponseHeader(name); - }, - - getAllResponseHeaders: function() { - return this.transport.getAllResponseHeaders(); - }, - - _getHeaderJSON: function() { - var json = this.getHeader('X-JSON'); - if (!json) return null; - json = decodeURIComponent(escape(json)); - try { - return json.evalJSON(this.request.options.sanitizeJSON); - } catch (e) { - this.request.dispatchException(e); - } - }, - - _getResponseJSON: function() { - var options = this.request.options; - if (!options.evalJSON || (options.evalJSON != 'force' && - !(this.getHeader('Content-type') || '').include('application/json'))) - return null; - try { - return this.transport.responseText.evalJSON(options.sanitizeJSON); - } catch (e) { - this.request.dispatchException(e); - } - } -}); - -Ajax.Updater = Class.create(Ajax.Request, { - initialize: function($super, container, url, options) { - this.container = { - success: (container.success || container), - failure: (container.failure || (container.success ? null : container)) - }; - - options = options || { }; - var onComplete = options.onComplete; - options.onComplete = (function(response, param) { - this.updateContent(response.responseText); - if (Object.isFunction(onComplete)) onComplete(response, param); - }).bind(this); - - $super(url, options); - }, - - updateContent: function(responseText) { - var receiver = this.container[this.success() ? 'success' : 'failure'], - options = this.options; - - if (!options.evalScripts) responseText = responseText.stripScripts(); - - if (receiver = $(receiver)) { - if (options.insertion) { - if (Object.isString(options.insertion)) { - var insertion = { }; insertion[options.insertion] = responseText; - receiver.insert(insertion); - } - else options.insertion(receiver, responseText); - } - else receiver.update(responseText); - } - - if (this.success()) { - if (this.onComplete) this.onComplete.bind(this).defer(); - } - } -}); - -Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { - initialize: function($super, container, url, options) { - $super(options); - this.onComplete = this.options.onComplete; - - this.frequency = (this.options.frequency || 2); - this.decay = (this.options.decay || 1); - - this.updater = { }; - this.container = container; - this.url = url; - - this.start(); - }, - - start: function() { - this.options.onComplete = this.updateComplete.bind(this); - this.onTimerEvent(); - }, - - stop: function() { - this.updater.options.onComplete = undefined; - clearTimeout(this.timer); - (this.onComplete || Prototype.emptyFunction).apply(this, arguments); - }, - - updateComplete: function(response) { - if (this.options.decay) { - this.decay = (response.responseText == this.lastText ? - this.decay * this.options.decay : 1); - - this.lastText = response.responseText; - } - this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); - }, - - onTimerEvent: function() { - this.updater = new Ajax.Updater(this.container, this.url, this.options); - } -}); -function $(element) { - if (arguments.length > 1) { - for (var i = 0, elements = [], length = arguments.length; i < length; i++) - elements.push($(arguments[i])); - return elements; - } - if (Object.isString(element)) - element = document.getElementById(element); - return Element.extend(element); -} - -if (Prototype.BrowserFeatures.XPath) { - document._getElementsByXPath = function(expression, parentElement) { - var results = []; - var query = document.evaluate(expression, $(parentElement) || document, - null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); - for (var i = 0, length = query.snapshotLength; i < length; i++) - results.push(Element.extend(query.snapshotItem(i))); - return results; - }; -} - -/*--------------------------------------------------------------------------*/ - -if (!window.Node) var Node = { }; - -if (!Node.ELEMENT_NODE) { - // DOM level 2 ECMAScript Language Binding - Object.extend(Node, { - ELEMENT_NODE: 1, - ATTRIBUTE_NODE: 2, - TEXT_NODE: 3, - CDATA_SECTION_NODE: 4, - ENTITY_REFERENCE_NODE: 5, - ENTITY_NODE: 6, - PROCESSING_INSTRUCTION_NODE: 7, - COMMENT_NODE: 8, - DOCUMENT_NODE: 9, - DOCUMENT_TYPE_NODE: 10, - DOCUMENT_FRAGMENT_NODE: 11, - NOTATION_NODE: 12 - }); -} - -(function() { - var element = this.Element; - this.Element = function(tagName, attributes) { - attributes = attributes || { }; - tagName = tagName.toLowerCase(); - var cache = Element.cache; - if (Prototype.Browser.IE && attributes.name) { - tagName = '<' + tagName + ' name="' + attributes.name + '">'; - delete attributes.name; - return Element.writeAttribute(document.createElement(tagName), attributes); - } - if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); - return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); - }; - Object.extend(this.Element, element || { }); -}).call(window); - -Element.cache = { }; - -Element.Methods = { - visible: function(element) { - return $(element).style.display != 'none'; - }, - - toggle: function(element) { - element = $(element); - Element[Element.visible(element) ? 'hide' : 'show'](element); - return element; - }, - - hide: function(element) { - $(element).style.display = 'none'; - return element; - }, - - show: function(element) { - $(element).style.display = ''; - return element; - }, - - remove: function(element) { - element = $(element); - element.parentNode.removeChild(element); - return element; - }, - - update: function(element, content) { - element = $(element); - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) return element.update().insert(content); - content = Object.toHTML(content); - element.innerHTML = content.stripScripts(); - content.evalScripts.bind(content).defer(); - return element; - }, - - replace: function(element, content) { - element = $(element); - if (content && content.toElement) content = content.toElement(); - else if (!Object.isElement(content)) { - content = Object.toHTML(content); - var range = element.ownerDocument.createRange(); - range.selectNode(element); - content.evalScripts.bind(content).defer(); - content = range.createContextualFragment(content.stripScripts()); - } - element.parentNode.replaceChild(content, element); - return element; - }, - - insert: function(element, insertions) { - element = $(element); - - if (Object.isString(insertions) || Object.isNumber(insertions) || - Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) - insertions = {bottom:insertions}; - - var content, t, range; - - for (position in insertions) { - content = insertions[position]; - position = position.toLowerCase(); - t = Element._insertionTranslations[position]; - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) { - t.insert(element, content); - continue; - } - - content = Object.toHTML(content); - - range = element.ownerDocument.createRange(); - t.initializeRange(element, range); - t.insert(element, range.createContextualFragment(content.stripScripts())); - - content.evalScripts.bind(content).defer(); - } - - return element; - }, - - wrap: function(element, wrapper, attributes) { - element = $(element); - if (Object.isElement(wrapper)) - $(wrapper).writeAttribute(attributes || { }); - else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); - else wrapper = new Element('div', wrapper); - if (element.parentNode) - element.parentNode.replaceChild(wrapper, element); - wrapper.appendChild(element); - return wrapper; - }, - - inspect: function(element) { - element = $(element); - var result = '<' + element.tagName.toLowerCase(); - $H({'id': 'id', 'className': 'class'}).each(function(pair) { - var property = pair.first(), attribute = pair.last(); - var value = (element[property] || '').toString(); - if (value) result += ' ' + attribute + '=' + value.inspect(true); - }); - return result + '>'; - }, - - recursivelyCollect: function(element, property) { - element = $(element); - var elements = []; - while (element = element[property]) - if (element.nodeType == 1) - elements.push(Element.extend(element)); - return elements; - }, - - ancestors: function(element) { - return $(element).recursivelyCollect('parentNode'); - }, - - descendants: function(element) { - return $A($(element).getElementsByTagName('*')).each(Element.extend); - }, - - firstDescendant: function(element) { - element = $(element).firstChild; - while (element && element.nodeType != 1) element = element.nextSibling; - return $(element); - }, - - immediateDescendants: function(element) { - if (!(element = $(element).firstChild)) return []; - while (element && element.nodeType != 1) element = element.nextSibling; - if (element) return [element].concat($(element).nextSiblings()); - return []; - }, - - previousSiblings: function(element) { - return $(element).recursivelyCollect('previousSibling'); - }, - - nextSiblings: function(element) { - return $(element).recursivelyCollect('nextSibling'); - }, - - siblings: function(element) { - element = $(element); - return element.previousSiblings().reverse().concat(element.nextSiblings()); - }, - - match: function(element, selector) { - if (Object.isString(selector)) - selector = new Selector(selector); - return selector.match($(element)); - }, - - up: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(element.parentNode); - var ancestors = element.ancestors(); - return expression ? Selector.findElement(ancestors, expression, index) : - ancestors[index || 0]; - }, - - down: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return element.firstDescendant(); - var descendants = element.descendants(); - return expression ? Selector.findElement(descendants, expression, index) : - descendants[index || 0]; - }, - - previous: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element)); - var previousSiblings = element.previousSiblings(); - return expression ? Selector.findElement(previousSiblings, expression, index) : - previousSiblings[index || 0]; - }, - - next: function(element, expression, index) { - element = $(element); - if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element)); - var nextSiblings = element.nextSiblings(); - return expression ? Selector.findElement(nextSiblings, expression, index) : - nextSiblings[index || 0]; - }, - - select: function() { - var args = $A(arguments), element = $(args.shift()); - return Selector.findChildElements(element, args); - }, - - adjacent: function() { - var args = $A(arguments), element = $(args.shift()); - return Selector.findChildElements(element.parentNode, args).without(element); - }, - - identify: function(element) { - element = $(element); - var id = element.readAttribute('id'), self = arguments.callee; - if (id) return id; - do { id = 'anonymous_element_' + self.counter++ } while ($(id)); - element.writeAttribute('id', id); - return id; - }, - - readAttribute: function(element, name) { - element = $(element); - if (Prototype.Browser.IE) { - var t = Element._attributeTranslations.read; - if (t.values[name]) return t.values[name](element, name); - if (t.names[name]) name = t.names[name]; - if (name.include(':')) { - return (!element.attributes || !element.attributes[name]) ? null : - element.attributes[name].value; - } - } - return element.getAttribute(name); - }, - - writeAttribute: function(element, name, value) { - element = $(element); - var attributes = { }, t = Element._attributeTranslations.write; - - if (typeof name == 'object') attributes = name; - else attributes[name] = value === undefined ? true : value; - - for (var attr in attributes) { - var name = t.names[attr] || attr, value = attributes[attr]; - if (t.values[attr]) name = t.values[attr](element, value); - if (value === false || value === null) - element.removeAttribute(name); - else if (value === true) - element.setAttribute(name, name); - else element.setAttribute(name, value); - } - return element; - }, - - getHeight: function(element) { - return $(element).getDimensions().height; - }, - - getWidth: function(element) { - return $(element).getDimensions().width; - }, - - classNames: function(element) { - return new Element.ClassNames(element); - }, - - hasClassName: function(element, className) { - if (!(element = $(element))) return; - var elementClassName = element.className; - return (elementClassName.length > 0 && (elementClassName == className || - new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); - }, - - addClassName: function(element, className) { - if (!(element = $(element))) return; - if (!element.hasClassName(className)) - element.className += (element.className ? ' ' : '') + className; - return element; - }, - - removeClassName: function(element, className) { - if (!(element = $(element))) return; - element.className = element.className.replace( - new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); - return element; - }, - - toggleClassName: function(element, className) { - if (!(element = $(element))) return; - return element[element.hasClassName(className) ? - 'removeClassName' : 'addClassName'](className); - }, - - // removes whitespace-only text node children - cleanWhitespace: function(element) { - element = $(element); - var node = element.firstChild; - while (node) { - var nextNode = node.nextSibling; - if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) - element.removeChild(node); - node = nextNode; - } - return element; - }, - - empty: function(element) { - return $(element).innerHTML.blank(); - }, - - descendantOf: function(element, ancestor) { - element = $(element), ancestor = $(ancestor); - - if (element.compareDocumentPosition) - return (element.compareDocumentPosition(ancestor) & 8) === 8; - - if (element.sourceIndex && !Prototype.Browser.Opera) { - var e = element.sourceIndex, a = ancestor.sourceIndex, - nextAncestor = ancestor.nextSibling; - if (!nextAncestor) { - do { ancestor = ancestor.parentNode; } - while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode); - } - if (nextAncestor) return (e > a && e < nextAncestor.sourceIndex); - } - - while (element = element.parentNode) - if (element == ancestor) return true; - return false; - }, - - scrollTo: function(element) { - element = $(element); - var pos = element.cumulativeOffset(); - window.scrollTo(pos[0], pos[1]); - return element; - }, - - getStyle: function(element, style) { - element = $(element); - style = style == 'float' ? 'cssFloat' : style.camelize(); - var value = element.style[style]; - if (!value) { - var css = document.defaultView.getComputedStyle(element, null); - value = css ? css[style] : null; - } - if (style == 'opacity') return value ? parseFloat(value) : 1.0; - return value == 'auto' ? null : value; - }, - - getOpacity: function(element) { - return $(element).getStyle('opacity'); - }, - - setStyle: function(element, styles) { - element = $(element); - var elementStyle = element.style, match; - if (Object.isString(styles)) { - element.style.cssText += ';' + styles; - return styles.include('opacity') ? - element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; - } - for (var property in styles) - if (property == 'opacity') element.setOpacity(styles[property]); - else - elementStyle[(property == 'float' || property == 'cssFloat') ? - (elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') : - property] = styles[property]; - - return element; - }, - - setOpacity: function(element, value) { - element = $(element); - element.style.opacity = (value == 1 || value === '') ? '' : - (value < 0.00001) ? 0 : value; - return element; - }, - - getDimensions: function(element) { - element = $(element); - var display = $(element).getStyle('display'); - if (display != 'none' && display != null) // Safari bug - return {width: element.offsetWidth, height: element.offsetHeight}; - - // All *Width and *Height properties give 0 on elements with display none, - // so enable the element temporarily - var els = element.style; - var originalVisibility = els.visibility; - var originalPosition = els.position; - var originalDisplay = els.display; - els.visibility = 'hidden'; - els.position = 'absolute'; - els.display = 'block'; - var originalWidth = element.clientWidth; - var originalHeight = element.clientHeight; - els.display = originalDisplay; - els.position = originalPosition; - els.visibility = originalVisibility; - return {width: originalWidth, height: originalHeight}; - }, - - makePositioned: function(element) { - element = $(element); - var pos = Element.getStyle(element, 'position'); - if (pos == 'static' || !pos) { - element._madePositioned = true; - element.style.position = 'relative'; - // Opera returns the offset relative to the positioning context, when an - // element is position relative but top and left have not been defined - if (window.opera) { - element.style.top = 0; - element.style.left = 0; - } - } - return element; - }, - - undoPositioned: function(element) { - element = $(element); - if (element._madePositioned) { - element._madePositioned = undefined; - element.style.position = - element.style.top = - element.style.left = - element.style.bottom = - element.style.right = ''; - } - return element; - }, - - makeClipping: function(element) { - element = $(element); - if (element._overflow) return element; - element._overflow = Element.getStyle(element, 'overflow') || 'auto'; - if (element._overflow !== 'hidden') - element.style.overflow = 'hidden'; - return element; - }, - - undoClipping: function(element) { - element = $(element); - if (!element._overflow) return element; - element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; - element._overflow = null; - return element; - }, - - cumulativeOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - positionedOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - element = element.offsetParent; - if (element) { - if (element.tagName == 'BODY') break; - var p = Element.getStyle(element, 'position'); - if (p == 'relative' || p == 'absolute') break; - } - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - absolutize: function(element) { - element = $(element); - if (element.getStyle('position') == 'absolute') return; - // Position.prepare(); // To be done manually by Scripty when it needs it. - - var offsets = element.positionedOffset(); - var top = offsets[1]; - var left = offsets[0]; - var width = element.clientWidth; - var height = element.clientHeight; - - element._originalLeft = left - parseFloat(element.style.left || 0); - element._originalTop = top - parseFloat(element.style.top || 0); - element._originalWidth = element.style.width; - element._originalHeight = element.style.height; - - element.style.position = 'absolute'; - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.width = width + 'px'; - element.style.height = height + 'px'; - return element; - }, - - relativize: function(element) { - element = $(element); - if (element.getStyle('position') == 'relative') return; - // Position.prepare(); // To be done manually by Scripty when it needs it. - - element.style.position = 'relative'; - var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); - var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); - - element.style.top = top + 'px'; - element.style.left = left + 'px'; - element.style.height = element._originalHeight; - element.style.width = element._originalWidth; - return element; - }, - - cumulativeScrollOffset: function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.scrollTop || 0; - valueL += element.scrollLeft || 0; - element = element.parentNode; - } while (element); - return Element._returnOffset(valueL, valueT); - }, - - getOffsetParent: function(element) { - if (element.offsetParent) return $(element.offsetParent); - if (element == document.body) return $(element); - - while ((element = element.parentNode) && element != document.body) - if (Element.getStyle(element, 'position') != 'static') - return $(element); - - return $(document.body); - }, - - viewportOffset: function(forElement) { - var valueT = 0, valueL = 0; - - var element = forElement; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - - // Safari fix - if (element.offsetParent == document.body && - Element.getStyle(element, 'position') == 'absolute') break; - - } while (element = element.offsetParent); - - element = forElement; - do { - if (!Prototype.Browser.Opera || element.tagName == 'BODY') { - valueT -= element.scrollTop || 0; - valueL -= element.scrollLeft || 0; - } - } while (element = element.parentNode); - - return Element._returnOffset(valueL, valueT); - }, - - clonePosition: function(element, source) { - var options = Object.extend({ - setLeft: true, - setTop: true, - setWidth: true, - setHeight: true, - offsetTop: 0, - offsetLeft: 0 - }, arguments[2] || { }); - - // find page position of source - source = $(source); - var p = source.viewportOffset(); - - // find coordinate system to use - element = $(element); - var delta = [0, 0]; - var parent = null; - // delta [0,0] will do fine with position: fixed elements, - // position:absolute needs offsetParent deltas - if (Element.getStyle(element, 'position') == 'absolute') { - parent = element.getOffsetParent(); - delta = parent.viewportOffset(); - } - - // correct by body offsets (fixes Safari) - if (parent == document.body) { - delta[0] -= document.body.offsetLeft; - delta[1] -= document.body.offsetTop; - } - - // set position - if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; - if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; - if (options.setWidth) element.style.width = source.offsetWidth + 'px'; - if (options.setHeight) element.style.height = source.offsetHeight + 'px'; - return element; - } -}; - -Element.Methods.identify.counter = 1; - -Object.extend(Element.Methods, { - getElementsBySelector: Element.Methods.select, - childElements: Element.Methods.immediateDescendants -}); - -Element._attributeTranslations = { - write: { - names: { - className: 'class', - htmlFor: 'for' - }, - values: { } - } -}; - - -if (!document.createRange || Prototype.Browser.Opera) { - Element.Methods.insert = function(element, insertions) { - element = $(element); - - if (Object.isString(insertions) || Object.isNumber(insertions) || - Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) - insertions = { bottom: insertions }; - - var t = Element._insertionTranslations, content, position, pos, tagName; - - for (position in insertions) { - content = insertions[position]; - position = position.toLowerCase(); - pos = t[position]; - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) { - pos.insert(element, content); - continue; - } - - content = Object.toHTML(content); - tagName = ((position == 'before' || position == 'after') - ? element.parentNode : element).tagName.toUpperCase(); - - if (t.tags[tagName]) { - var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); - if (position == 'top' || position == 'after') fragments.reverse(); - fragments.each(pos.insert.curry(element)); - } - else element.insertAdjacentHTML(pos.adjacency, content.stripScripts()); - - content.evalScripts.bind(content).defer(); - } - - return element; - }; -} - -if (Prototype.Browser.Opera) { - Element.Methods._getStyle = Element.Methods.getStyle; - Element.Methods.getStyle = function(element, style) { - switch(style) { - case 'left': - case 'top': - case 'right': - case 'bottom': - if (Element._getStyle(element, 'position') == 'static') return null; - default: return Element._getStyle(element, style); - } - }; - Element.Methods._readAttribute = Element.Methods.readAttribute; - Element.Methods.readAttribute = function(element, attribute) { - if (attribute == 'title') return element.title; - return Element._readAttribute(element, attribute); - }; -} - -else if (Prototype.Browser.IE) { - $w('positionedOffset getOffsetParent viewportOffset').each(function(method) { - Element.Methods[method] = Element.Methods[method].wrap( - function(proceed, element) { - element = $(element); - var position = element.getStyle('position'); - if (position != 'static') return proceed(element); - element.setStyle({ position: 'relative' }); - var value = proceed(element); - element.setStyle({ position: position }); - return value; - } - ); - }); - - Element.Methods.getStyle = function(element, style) { - element = $(element); - style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); - var value = element.style[style]; - if (!value && element.currentStyle) value = element.currentStyle[style]; - - if (style == 'opacity') { - if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) - if (value[1]) return parseFloat(value[1]) / 100; - return 1.0; - } - - if (value == 'auto') { - if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) - return element['offset' + style.capitalize()] + 'px'; - return null; - } - return value; - }; - - Element.Methods.setOpacity = function(element, value) { - function stripAlpha(filter){ - return filter.replace(/alpha\([^\)]*\)/gi,''); - } - element = $(element); - var currentStyle = element.currentStyle; - if ((currentStyle && !currentStyle.hasLayout) || - (!currentStyle && element.style.zoom == 'normal')) - element.style.zoom = 1; - - var filter = element.getStyle('filter'), style = element.style; - if (value == 1 || value === '') { - (filter = stripAlpha(filter)) ? - style.filter = filter : style.removeAttribute('filter'); - return element; - } else if (value < 0.00001) value = 0; - style.filter = stripAlpha(filter) + - 'alpha(opacity=' + (value * 100) + ')'; - return element; - }; - - Element._attributeTranslations = { - read: { - names: { - 'class': 'className', - 'for': 'htmlFor' - }, - values: { - _getAttr: function(element, attribute) { - return element.getAttribute(attribute, 2); - }, - _getAttrNode: function(element, attribute) { - var node = element.getAttributeNode(attribute); - return node ? node.value : ""; - }, - _getEv: function(element, attribute) { - var attribute = element.getAttribute(attribute); - return attribute ? attribute.toString().slice(23, -2) : null; - }, - _flag: function(element, attribute) { - return $(element).hasAttribute(attribute) ? attribute : null; - }, - style: function(element) { - return element.style.cssText.toLowerCase(); - }, - title: function(element) { - return element.title; - } - } - } - }; - - Element._attributeTranslations.write = { - names: Object.clone(Element._attributeTranslations.read.names), - values: { - checked: function(element, value) { - element.checked = !!value; - }, - - style: function(element, value) { - element.style.cssText = value ? value : ''; - } - } - }; - - Element._attributeTranslations.has = {}; - - $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + - 'encType maxLength readOnly longDesc').each(function(attr) { - Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; - Element._attributeTranslations.has[attr.toLowerCase()] = attr; - }); - - (function(v) { - Object.extend(v, { - href: v._getAttr, - src: v._getAttr, - type: v._getAttr, - action: v._getAttrNode, - disabled: v._flag, - checked: v._flag, - readonly: v._flag, - multiple: v._flag, - onload: v._getEv, - onunload: v._getEv, - onclick: v._getEv, - ondblclick: v._getEv, - onmousedown: v._getEv, - onmouseup: v._getEv, - onmouseover: v._getEv, - onmousemove: v._getEv, - onmouseout: v._getEv, - onfocus: v._getEv, - onblur: v._getEv, - onkeypress: v._getEv, - onkeydown: v._getEv, - onkeyup: v._getEv, - onsubmit: v._getEv, - onreset: v._getEv, - onselect: v._getEv, - onchange: v._getEv - }); - })(Element._attributeTranslations.read.values); -} - -else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { - Element.Methods.setOpacity = function(element, value) { - element = $(element); - element.style.opacity = (value == 1) ? 0.999999 : - (value === '') ? '' : (value < 0.00001) ? 0 : value; - return element; - }; -} - -else if (Prototype.Browser.WebKit) { - Element.Methods.setOpacity = function(element, value) { - element = $(element); - element.style.opacity = (value == 1 || value === '') ? '' : - (value < 0.00001) ? 0 : value; - - if (value == 1) - if(element.tagName == 'IMG' && element.width) { - element.width++; element.width--; - } else try { - var n = document.createTextNode(' '); - element.appendChild(n); - element.removeChild(n); - } catch (e) { } - - return element; - }; - - // Safari returns margins on body which is incorrect if the child is absolutely - // positioned. For performance reasons, redefine Position.cumulativeOffset for - // KHTML/WebKit only. - Element.Methods.cumulativeOffset = function(element) { - var valueT = 0, valueL = 0; - do { - valueT += element.offsetTop || 0; - valueL += element.offsetLeft || 0; - if (element.offsetParent == document.body) - if (Element.getStyle(element, 'position') == 'absolute') break; - - element = element.offsetParent; - } while (element); - - return Element._returnOffset(valueL, valueT); - }; -} - -if (Prototype.Browser.IE || Prototype.Browser.Opera) { - // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements - Element.Methods.update = function(element, content) { - element = $(element); - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) return element.update().insert(content); - - content = Object.toHTML(content); - var tagName = element.tagName.toUpperCase(); - - if (tagName in Element._insertionTranslations.tags) { - $A(element.childNodes).each(function(node) { element.removeChild(node) }); - Element._getContentFromAnonymousElement(tagName, content.stripScripts()) - .each(function(node) { element.appendChild(node) }); - } - else element.innerHTML = content.stripScripts(); - - content.evalScripts.bind(content).defer(); - return element; - }; -} - -if (document.createElement('div').outerHTML) { - Element.Methods.replace = function(element, content) { - element = $(element); - - if (content && content.toElement) content = content.toElement(); - if (Object.isElement(content)) { - element.parentNode.replaceChild(content, element); - return element; - } - - content = Object.toHTML(content); - var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); - - if (Element._insertionTranslations.tags[tagName]) { - var nextSibling = element.next(); - var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); - parent.removeChild(element); - if (nextSibling) - fragments.each(function(node) { parent.insertBefore(node, nextSibling) }); - else - fragments.each(function(node) { parent.appendChild(node) }); - } - else element.outerHTML = content.stripScripts(); - - content.evalScripts.bind(content).defer(); - return element; - }; -} - -Element._returnOffset = function(l, t) { - var result = [l, t]; - result.left = l; - result.top = t; - return result; -}; - -Element._getContentFromAnonymousElement = function(tagName, html) { - var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; - div.innerHTML = t[0] + html + t[1]; - t[2].times(function() { div = div.firstChild }); - return $A(div.childNodes); -}; - -Element._insertionTranslations = { - before: { - adjacency: 'beforeBegin', - insert: function(element, node) { - element.parentNode.insertBefore(node, element); - }, - initializeRange: function(element, range) { - range.setStartBefore(element); - } - }, - top: { - adjacency: 'afterBegin', - insert: function(element, node) { - element.insertBefore(node, element.firstChild); - }, - initializeRange: function(element, range) { - range.selectNodeContents(element); - range.collapse(true); - } - }, - bottom: { - adjacency: 'beforeEnd', - insert: function(element, node) { - element.appendChild(node); - } - }, - after: { - adjacency: 'afterEnd', - insert: function(element, node) { - element.parentNode.insertBefore(node, element.nextSibling); - }, - initializeRange: function(element, range) { - range.setStartAfter(element); - } - }, - tags: { - TABLE: ['', '
    ', 1], - TBODY: ['', '
    ', 2], - TR: ['', '
    ', 3], - TD: ['
    ', '
    ', 4], - SELECT: ['', 1] - } -}; - -(function() { - this.bottom.initializeRange = this.top.initializeRange; - Object.extend(this.tags, { - THEAD: this.tags.TBODY, - TFOOT: this.tags.TBODY, - TH: this.tags.TD - }); -}).call(Element._insertionTranslations); - -Element.Methods.Simulated = { - hasAttribute: function(element, attribute) { - attribute = Element._attributeTranslations.has[attribute] || attribute; - var node = $(element).getAttributeNode(attribute); - return node && node.specified; - } -}; - -Element.Methods.ByTag = { }; - -Object.extend(Element, Element.Methods); - -if (!Prototype.BrowserFeatures.ElementExtensions && - document.createElement('div').__proto__) { - window.HTMLElement = { }; - window.HTMLElement.prototype = document.createElement('div').__proto__; - Prototype.BrowserFeatures.ElementExtensions = true; -} - -Element.extend = (function() { - if (Prototype.BrowserFeatures.SpecificElementExtensions) - return Prototype.K; - - var Methods = { }, ByTag = Element.Methods.ByTag; - - var extend = Object.extend(function(element) { - if (!element || element._extendedByPrototype || - element.nodeType != 1 || element == window) return element; - - var methods = Object.clone(Methods), - tagName = element.tagName, property, value; - - // extend methods for specific tags - if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); - - for (property in methods) { - value = methods[property]; - if (Object.isFunction(value) && !(property in element)) - element[property] = value.methodize(); - } - - element._extendedByPrototype = Prototype.emptyFunction; - return element; - - }, { - refresh: function() { - // extend methods for all tags (Safari doesn't need this) - if (!Prototype.BrowserFeatures.ElementExtensions) { - Object.extend(Methods, Element.Methods); - Object.extend(Methods, Element.Methods.Simulated); - } - } - }); - - extend.refresh(); - return extend; -})(); - -Element.hasAttribute = function(element, attribute) { - if (element.hasAttribute) return element.hasAttribute(attribute); - return Element.Methods.Simulated.hasAttribute(element, attribute); -}; - -Element.addMethods = function(methods) { - var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; - - if (!methods) { - Object.extend(Form, Form.Methods); - Object.extend(Form.Element, Form.Element.Methods); - Object.extend(Element.Methods.ByTag, { - "FORM": Object.clone(Form.Methods), - "INPUT": Object.clone(Form.Element.Methods), - "SELECT": Object.clone(Form.Element.Methods), - "TEXTAREA": Object.clone(Form.Element.Methods) - }); - } - - if (arguments.length == 2) { - var tagName = methods; - methods = arguments[1]; - } - - if (!tagName) Object.extend(Element.Methods, methods || { }); - else { - if (Object.isArray(tagName)) tagName.each(extend); - else extend(tagName); - } - - function extend(tagName) { - tagName = tagName.toUpperCase(); - if (!Element.Methods.ByTag[tagName]) - Element.Methods.ByTag[tagName] = { }; - Object.extend(Element.Methods.ByTag[tagName], methods); - } - - function copy(methods, destination, onlyIfAbsent) { - onlyIfAbsent = onlyIfAbsent || false; - for (var property in methods) { - var value = methods[property]; - if (!Object.isFunction(value)) continue; - if (!onlyIfAbsent || !(property in destination)) - destination[property] = value.methodize(); - } - } - - function findDOMClass(tagName) { - var klass; - var trans = { - "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", - "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", - "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", - "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", - "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": - "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": - "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": - "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": - "FrameSet", "IFRAME": "IFrame" - }; - if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; - if (window[klass]) return window[klass]; - klass = 'HTML' + tagName + 'Element'; - if (window[klass]) return window[klass]; - klass = 'HTML' + tagName.capitalize() + 'Element'; - if (window[klass]) return window[klass]; - - window[klass] = { }; - window[klass].prototype = document.createElement(tagName).__proto__; - return window[klass]; - } - - if (F.ElementExtensions) { - copy(Element.Methods, HTMLElement.prototype); - copy(Element.Methods.Simulated, HTMLElement.prototype, true); - } - - if (F.SpecificElementExtensions) { - for (var tag in Element.Methods.ByTag) { - var klass = findDOMClass(tag); - if (Object.isUndefined(klass)) continue; - copy(T[tag], klass.prototype); - } - } - - Object.extend(Element, Element.Methods); - delete Element.ByTag; - - if (Element.extend.refresh) Element.extend.refresh(); - Element.cache = { }; -}; - -document.viewport = { - getDimensions: function() { - var dimensions = { }; - $w('width height').each(function(d) { - var D = d.capitalize(); - dimensions[d] = self['inner' + D] || - (document.documentElement['client' + D] || document.body['client' + D]); - }); - return dimensions; - }, - - getWidth: function() { - return this.getDimensions().width; - }, - - getHeight: function() { - return this.getDimensions().height; - }, - - getScrollOffsets: function() { - return Element._returnOffset( - window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, - window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); - } -}; -/* Portions of the Selector class are derived from Jack Slocum`s DomQuery, - * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style - * license. Please see http://www.yui-ext.com/ for more information. */ - -var Selector = Class.create({ - initialize: function(expression) { - this.expression = expression.strip(); - this.compileMatcher(); - }, - - compileMatcher: function() { - // Selectors with namespaced attributes can't use the XPath version - if (Prototype.BrowserFeatures.XPath && !(/(\[[\w-]*?:|:checked)/).test(this.expression)) - return this.compileXPathMatcher(); - - var e = this.expression, ps = Selector.patterns, h = Selector.handlers, - c = Selector.criteria, le, p, m; - - if (Selector._cache[e]) { - this.matcher = Selector._cache[e]; - return; - } - - this.matcher = ["this.matcher = function(root) {", - "var r = root, h = Selector.handlers, c = false, n;"]; - - while (e && le != e && (/\S/).test(e)) { - le = e; - for (var i in ps) { - p = ps[i]; - if (m = e.match(p)) { - this.matcher.push(Object.isFunction(c[i]) ? c[i](m) : - new Template(c[i]).evaluate(m)); - e = e.replace(m[0], ''); - break; - } - } - } - - this.matcher.push("return h.unique(n);\n}"); - eval(this.matcher.join('\n')); - Selector._cache[this.expression] = this.matcher; - }, - - compileXPathMatcher: function() { - var e = this.expression, ps = Selector.patterns, - x = Selector.xpath, le, m; - - if (Selector._cache[e]) { - this.xpath = Selector._cache[e]; return; - } - - this.matcher = ['.//*']; - while (e && le != e && (/\S/).test(e)) { - le = e; - for (var i in ps) { - if (m = e.match(ps[i])) { - this.matcher.push(Object.isFunction(x[i]) ? x[i](m) : - new Template(x[i]).evaluate(m)); - e = e.replace(m[0], ''); - break; - } - } - } - - this.xpath = this.matcher.join(''); - Selector._cache[this.expression] = this.xpath; - }, - - findElements: function(root) { - root = root || document; - if (this.xpath) return document._getElementsByXPath(this.xpath, root); - return this.matcher(root); - }, - - match: function(element) { - this.tokens = []; - - var e = this.expression, ps = Selector.patterns, as = Selector.assertions; - var le, p, m; - - while (e && le !== e && (/\S/).test(e)) { - le = e; - for (var i in ps) { - p = ps[i]; - if (m = e.match(p)) { - // use the Selector.assertions methods unless the selector - // is too complex. - if (as[i]) { - this.tokens.push([i, Object.clone(m)]); - e = e.replace(m[0], ''); - } else { - // reluctantly do a document-wide search - // and look for a match in the array - return this.findElements(document).include(element); - } - } - } - } - - var match = true, name, matches; - for (var i = 0, token; token = this.tokens[i]; i++) { - name = token[0], matches = token[1]; - if (!Selector.assertions[name](element, matches)) { - match = false; break; - } - } - - return match; - }, - - toString: function() { - return this.expression; - }, - - inspect: function() { - return "#"; - } -}); - -Object.extend(Selector, { - _cache: { }, - - xpath: { - descendant: "//*", - child: "/*", - adjacent: "/following-sibling::*[1]", - laterSibling: '/following-sibling::*', - tagName: function(m) { - if (m[1] == '*') return ''; - return "[local-name()='" + m[1].toLowerCase() + - "' or local-name()='" + m[1].toUpperCase() + "']"; - }, - className: "[contains(concat(' ', @class, ' '), ' #{1} ')]", - id: "[@id='#{1}']", - attrPresence: "[@#{1}]", - attr: function(m) { - m[3] = m[5] || m[6]; - return new Template(Selector.xpath.operators[m[2]]).evaluate(m); - }, - pseudo: function(m) { - var h = Selector.xpath.pseudos[m[1]]; - if (!h) return ''; - if (Object.isFunction(h)) return h(m); - return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m); - }, - operators: { - '=': "[@#{1}='#{3}']", - '!=': "[@#{1}!='#{3}']", - '^=': "[starts-with(@#{1}, '#{3}')]", - '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']", - '*=': "[contains(@#{1}, '#{3}')]", - '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]", - '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]" - }, - pseudos: { - 'first-child': '[not(preceding-sibling::*)]', - 'last-child': '[not(following-sibling::*)]', - 'only-child': '[not(preceding-sibling::* or following-sibling::*)]', - 'empty': "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]", - 'checked': "[@checked]", - 'disabled': "[@disabled]", - 'enabled': "[not(@disabled)]", - 'not': function(m) { - var e = m[6], p = Selector.patterns, - x = Selector.xpath, le, m, v; - - var exclusion = []; - while (e && le != e && (/\S/).test(e)) { - le = e; - for (var i in p) { - if (m = e.match(p[i])) { - v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m); - exclusion.push("(" + v.substring(1, v.length - 1) + ")"); - e = e.replace(m[0], ''); - break; - } - } - } - return "[not(" + exclusion.join(" and ") + ")]"; - }, - 'nth-child': function(m) { - return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m); - }, - 'nth-last-child': function(m) { - return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m); - }, - 'nth-of-type': function(m) { - return Selector.xpath.pseudos.nth("position() ", m); - }, - 'nth-last-of-type': function(m) { - return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m); - }, - 'first-of-type': function(m) { - m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m); - }, - 'last-of-type': function(m) { - m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m); - }, - 'only-of-type': function(m) { - var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m); - }, - nth: function(fragment, m) { - var mm, formula = m[6], predicate; - if (formula == 'even') formula = '2n+0'; - if (formula == 'odd') formula = '2n+1'; - if (mm = formula.match(/^(\d+)$/)) // digit only - return '[' + fragment + "= " + mm[1] + ']'; - if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b - if (mm[1] == "-") mm[1] = -1; - var a = mm[1] ? Number(mm[1]) : 1; - var b = mm[2] ? Number(mm[2]) : 0; - predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " + - "((#{fragment} - #{b}) div #{a} >= 0)]"; - return new Template(predicate).evaluate({ - fragment: fragment, a: a, b: b }); - } - } - } - }, - - criteria: { - tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', - className: 'n = h.className(n, r, "#{1}", c); c = false;', - id: 'n = h.id(n, r, "#{1}", c); c = false;', - attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;', - attr: function(m) { - m[3] = (m[5] || m[6]); - return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m); - }, - pseudo: function(m) { - if (m[6]) m[6] = m[6].replace(/"/g, '\\"'); - return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m); - }, - descendant: 'c = "descendant";', - child: 'c = "child";', - adjacent: 'c = "adjacent";', - laterSibling: 'c = "laterSibling";' - }, - - patterns: { - // combinators must be listed first - // (and descendant needs to be last combinator) - laterSibling: /^\s*~\s*/, - child: /^\s*>\s*/, - adjacent: /^\s*\+\s*/, - descendant: /^\s/, - - // selectors follow - tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, - id: /^#([\w\-\*]+)(\b|$)/, - className: /^\.([\w\-\*]+)(\b|$)/, - pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s)|(?=:))/, - attrPresence: /^\[([\w]+)\]/, - attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/ - }, - - // for Selector.match and Element#match - assertions: { - tagName: function(element, matches) { - return matches[1].toUpperCase() == element.tagName.toUpperCase(); - }, - - className: function(element, matches) { - return Element.hasClassName(element, matches[1]); - }, - - id: function(element, matches) { - return element.id === matches[1]; - }, - - attrPresence: function(element, matches) { - return Element.hasAttribute(element, matches[1]); - }, - - attr: function(element, matches) { - var nodeValue = Element.readAttribute(element, matches[1]); - return Selector.operators[matches[2]](nodeValue, matches[3]); - } - }, - - handlers: { - // UTILITY FUNCTIONS - // joins two collections - concat: function(a, b) { - for (var i = 0, node; node = b[i]; i++) - a.push(node); - return a; - }, - - // marks an array of nodes for counting - mark: function(nodes) { - for (var i = 0, node; node = nodes[i]; i++) - node._counted = true; - return nodes; - }, - - unmark: function(nodes) { - for (var i = 0, node; node = nodes[i]; i++) - node._counted = undefined; - return nodes; - }, - - // mark each child node with its position (for nth calls) - // "ofType" flag indicates whether we're indexing for nth-of-type - // rather than nth-child - index: function(parentNode, reverse, ofType) { - parentNode._counted = true; - if (reverse) { - for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) { - var node = nodes[i]; - if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; - } - } else { - for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++) - if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++; - } - }, - - // filters out duplicates and extends all nodes - unique: function(nodes) { - if (nodes.length == 0) return nodes; - var results = [], n; - for (var i = 0, l = nodes.length; i < l; i++) - if (!(n = nodes[i])._counted) { - n._counted = true; - results.push(Element.extend(n)); - } - return Selector.handlers.unmark(results); - }, - - // COMBINATOR FUNCTIONS - descendant: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - h.concat(results, node.getElementsByTagName('*')); - return results; - }, - - child: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) { - for (var j = 0, children = [], child; child = node.childNodes[j]; j++) - if (child.nodeType == 1 && child.tagName != '!') results.push(child); - } - return results; - }, - - adjacent: function(nodes) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - var next = this.nextElementSibling(node); - if (next) results.push(next); - } - return results; - }, - - laterSibling: function(nodes) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - h.concat(results, Element.nextSiblings(node)); - return results; - }, - - nextElementSibling: function(node) { - while (node = node.nextSibling) - if (node.nodeType == 1) return node; - return null; - }, - - previousElementSibling: function(node) { - while (node = node.previousSibling) - if (node.nodeType == 1) return node; - return null; - }, - - // TOKEN FUNCTIONS - tagName: function(nodes, root, tagName, combinator) { - tagName = tagName.toUpperCase(); - var results = [], h = Selector.handlers; - if (nodes) { - if (combinator) { - // fastlane for ordinary descendant combinators - if (combinator == "descendant") { - for (var i = 0, node; node = nodes[i]; i++) - h.concat(results, node.getElementsByTagName(tagName)); - return results; - } else nodes = this[combinator](nodes); - if (tagName == "*") return nodes; - } - for (var i = 0, node; node = nodes[i]; i++) - if (node.tagName.toUpperCase() == tagName) results.push(node); - return results; - } else return root.getElementsByTagName(tagName); - }, - - id: function(nodes, root, id, combinator) { - var targetNode = $(id), h = Selector.handlers; - if (!targetNode) return []; - if (!nodes && root == document) return [targetNode]; - if (nodes) { - if (combinator) { - if (combinator == 'child') { - for (var i = 0, node; node = nodes[i]; i++) - if (targetNode.parentNode == node) return [targetNode]; - } else if (combinator == 'descendant') { - for (var i = 0, node; node = nodes[i]; i++) - if (Element.descendantOf(targetNode, node)) return [targetNode]; - } else if (combinator == 'adjacent') { - for (var i = 0, node; node = nodes[i]; i++) - if (Selector.handlers.previousElementSibling(targetNode) == node) - return [targetNode]; - } else nodes = h[combinator](nodes); - } - for (var i = 0, node; node = nodes[i]; i++) - if (node == targetNode) return [targetNode]; - return []; - } - return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : []; - }, - - className: function(nodes, root, className, combinator) { - if (nodes && combinator) nodes = this[combinator](nodes); - return Selector.handlers.byClassName(nodes, root, className); - }, - - byClassName: function(nodes, root, className) { - if (!nodes) nodes = Selector.handlers.descendant([root]); - var needle = ' ' + className + ' '; - for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) { - nodeClassName = node.className; - if (nodeClassName.length == 0) continue; - if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle)) - results.push(node); - } - return results; - }, - - attrPresence: function(nodes, root, attr) { - if (!nodes) nodes = root.getElementsByTagName("*"); - var results = []; - for (var i = 0, node; node = nodes[i]; i++) - if (Element.hasAttribute(node, attr)) results.push(node); - return results; - }, - - attr: function(nodes, root, attr, value, operator) { - if (!nodes) nodes = root.getElementsByTagName("*"); - var handler = Selector.operators[operator], results = []; - for (var i = 0, node; node = nodes[i]; i++) { - var nodeValue = Element.readAttribute(node, attr); - if (nodeValue === null) continue; - if (handler(nodeValue, value)) results.push(node); - } - return results; - }, - - pseudo: function(nodes, name, value, root, combinator) { - if (nodes && combinator) nodes = this[combinator](nodes); - if (!nodes) nodes = root.getElementsByTagName("*"); - return Selector.pseudos[name](nodes, value, root); - } - }, - - pseudos: { - 'first-child': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - if (Selector.handlers.previousElementSibling(node)) continue; - results.push(node); - } - return results; - }, - 'last-child': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - if (Selector.handlers.nextElementSibling(node)) continue; - results.push(node); - } - return results; - }, - 'only-child': function(nodes, value, root) { - var h = Selector.handlers; - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!h.previousElementSibling(node) && !h.nextElementSibling(node)) - results.push(node); - return results; - }, - 'nth-child': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root); - }, - 'nth-last-child': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, true); - }, - 'nth-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, false, true); - }, - 'nth-last-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, formula, root, true, true); - }, - 'first-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, "1", root, false, true); - }, - 'last-of-type': function(nodes, formula, root) { - return Selector.pseudos.nth(nodes, "1", root, true, true); - }, - 'only-of-type': function(nodes, formula, root) { - var p = Selector.pseudos; - return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root); - }, - - // handles the an+b logic - getIndices: function(a, b, total) { - if (a == 0) return b > 0 ? [b] : []; - return $R(1, total).inject([], function(memo, i) { - if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i); - return memo; - }); - }, - - // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type - nth: function(nodes, formula, root, reverse, ofType) { - if (nodes.length == 0) return []; - if (formula == 'even') formula = '2n+0'; - if (formula == 'odd') formula = '2n+1'; - var h = Selector.handlers, results = [], indexed = [], m; - h.mark(nodes); - for (var i = 0, node; node = nodes[i]; i++) { - if (!node.parentNode._counted) { - h.index(node.parentNode, reverse, ofType); - indexed.push(node.parentNode); - } - } - if (formula.match(/^\d+$/)) { // just a number - formula = Number(formula); - for (var i = 0, node; node = nodes[i]; i++) - if (node.nodeIndex == formula) results.push(node); - } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b - if (m[1] == "-") m[1] = -1; - var a = m[1] ? Number(m[1]) : 1; - var b = m[2] ? Number(m[2]) : 0; - var indices = Selector.pseudos.getIndices(a, b, nodes.length); - for (var i = 0, node, l = indices.length; node = nodes[i]; i++) { - for (var j = 0; j < l; j++) - if (node.nodeIndex == indices[j]) results.push(node); - } - } - h.unmark(nodes); - h.unmark(indexed); - return results; - }, - - 'empty': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) { - // IE treats comments as element nodes - if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue; - results.push(node); - } - return results; - }, - - 'not': function(nodes, selector, root) { - var h = Selector.handlers, selectorType, m; - var exclusions = new Selector(selector).findElements(root); - h.mark(exclusions); - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!node._counted) results.push(node); - h.unmark(exclusions); - return results; - }, - - 'enabled': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (!node.disabled) results.push(node); - return results; - }, - - 'disabled': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (node.disabled) results.push(node); - return results; - }, - - 'checked': function(nodes, value, root) { - for (var i = 0, results = [], node; node = nodes[i]; i++) - if (node.checked) results.push(node); - return results; - } - }, - - operators: { - '=': function(nv, v) { return nv == v; }, - '!=': function(nv, v) { return nv != v; }, - '^=': function(nv, v) { return nv.startsWith(v); }, - '$=': function(nv, v) { return nv.endsWith(v); }, - '*=': function(nv, v) { return nv.include(v); }, - '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); }, - '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); } - }, - - matchElements: function(elements, expression) { - var matches = new Selector(expression).findElements(), h = Selector.handlers; - h.mark(matches); - for (var i = 0, results = [], element; element = elements[i]; i++) - if (element._counted) results.push(element); - h.unmark(matches); - return results; - }, - - findElement: function(elements, expression, index) { - if (Object.isNumber(expression)) { - index = expression; expression = false; - } - return Selector.matchElements(elements, expression || '*')[index || 0]; - }, - - findChildElements: function(element, expressions) { - var exprs = expressions.join(','), expressions = []; - exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) { - expressions.push(m[1].strip()); - }); - var results = [], h = Selector.handlers; - for (var i = 0, l = expressions.length, selector; i < l; i++) { - selector = new Selector(expressions[i].strip()); - h.concat(results, selector.findElements(element)); - } - return (l > 1) ? h.unique(results) : results; - } -}); - -function $$() { - return Selector.findChildElements(document, $A(arguments)); -} -var Form = { - reset: function(form) { - $(form).reset(); - return form; - }, - - serializeElements: function(elements, options) { - if (typeof options != 'object') options = { hash: !!options }; - else if (options.hash === undefined) options.hash = true; - var key, value, submitted = false, submit = options.submit; - - var data = elements.inject({ }, function(result, element) { - if (!element.disabled && element.name) { - key = element.name; value = $(element).getValue(); - if (value != null && (element.type != 'submit' || (!submitted && - submit !== false && (!submit || key == submit) && (submitted = true)))) { - if (key in result) { - // a key is already present; construct an array of values - if (!Object.isArray(result[key])) result[key] = [result[key]]; - result[key].push(value); - } - else result[key] = value; - } - } - return result; - }); - - return options.hash ? data : Object.toQueryString(data); - } -}; - -Form.Methods = { - serialize: function(form, options) { - return Form.serializeElements(Form.getElements(form), options); - }, - - getElements: function(form) { - return $A($(form).getElementsByTagName('*')).inject([], - function(elements, child) { - if (Form.Element.Serializers[child.tagName.toLowerCase()]) - elements.push(Element.extend(child)); - return elements; - } - ); - }, - - getInputs: function(form, typeName, name) { - form = $(form); - var inputs = form.getElementsByTagName('input'); - - if (!typeName && !name) return $A(inputs).map(Element.extend); - - for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { - var input = inputs[i]; - if ((typeName && input.type != typeName) || (name && input.name != name)) - continue; - matchingInputs.push(Element.extend(input)); - } - - return matchingInputs; - }, - - disable: function(form) { - form = $(form); - Form.getElements(form).invoke('disable'); - return form; - }, - - enable: function(form) { - form = $(form); - Form.getElements(form).invoke('enable'); - return form; - }, - - findFirstElement: function(form) { - var elements = $(form).getElements().findAll(function(element) { - return 'hidden' != element.type && !element.disabled; - }); - var firstByIndex = elements.findAll(function(element) { - return element.hasAttribute('tabIndex') && element.tabIndex >= 0; - }).sortBy(function(element) { return element.tabIndex }).first(); - - return firstByIndex ? firstByIndex : elements.find(function(element) { - return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); - }); - }, - - focusFirstElement: function(form) { - form = $(form); - form.findFirstElement().activate(); - return form; - }, - - request: function(form, options) { - form = $(form), options = Object.clone(options || { }); - - var params = options.parameters, action = form.readAttribute('action') || ''; - if (action.blank()) action = window.location.href; - options.parameters = form.serialize(true); - - if (params) { - if (Object.isString(params)) params = params.toQueryParams(); - Object.extend(options.parameters, params); - } - - if (form.hasAttribute('method') && !options.method) - options.method = form.method; - - return new Ajax.Request(action, options); - } -}; - -/*--------------------------------------------------------------------------*/ - -Form.Element = { - focus: function(element) { - $(element).focus(); - return element; - }, - - select: function(element) { - $(element).select(); - return element; - } -}; - -Form.Element.Methods = { - serialize: function(element) { - element = $(element); - if (!element.disabled && element.name) { - var value = element.getValue(); - if (value != undefined) { - var pair = { }; - pair[element.name] = value; - return Object.toQueryString(pair); - } - } - return ''; - }, - - getValue: function(element) { - element = $(element); - var method = element.tagName.toLowerCase(); - return Form.Element.Serializers[method](element); - }, - - setValue: function(element, value) { - element = $(element); - var method = element.tagName.toLowerCase(); - Form.Element.Serializers[method](element, value); - return element; - }, - - clear: function(element) { - $(element).value = ''; - return element; - }, - - present: function(element) { - return $(element).value != ''; - }, - - activate: function(element) { - element = $(element); - try { - element.focus(); - if (element.select && (element.tagName.toLowerCase() != 'input' || - !['button', 'reset', 'submit'].include(element.type))) - element.select(); - } catch (e) { } - return element; - }, - - disable: function(element) { - element = $(element); - element.blur(); - element.disabled = true; - return element; - }, - - enable: function(element) { - element = $(element); - element.disabled = false; - return element; - } -}; - -/*--------------------------------------------------------------------------*/ - -var Field = Form.Element; -var $F = Form.Element.Methods.getValue; - -/*--------------------------------------------------------------------------*/ - -Form.Element.Serializers = { - input: function(element, value) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - return Form.Element.Serializers.inputSelector(element, value); - default: - return Form.Element.Serializers.textarea(element, value); - } - }, - - inputSelector: function(element, value) { - if (value === undefined) return element.checked ? element.value : null; - else element.checked = !!value; - }, - - textarea: function(element, value) { - if (value === undefined) return element.value; - else element.value = value; - }, - - select: function(element, index) { - if (index === undefined) - return this[element.type == 'select-one' ? - 'selectOne' : 'selectMany'](element); - else { - var opt, value, single = !Object.isArray(index); - for (var i = 0, length = element.length; i < length; i++) { - opt = element.options[i]; - value = this.optionValue(opt); - if (single) { - if (value == index) { - opt.selected = true; - return; - } - } - else opt.selected = index.include(value); - } - } - }, - - selectOne: function(element) { - var index = element.selectedIndex; - return index >= 0 ? this.optionValue(element.options[index]) : null; - }, - - selectMany: function(element) { - var values, length = element.length; - if (!length) return null; - - for (var i = 0, values = []; i < length; i++) { - var opt = element.options[i]; - if (opt.selected) values.push(this.optionValue(opt)); - } - return values; - }, - - optionValue: function(opt) { - // extend element because hasAttribute may not be native - return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; - } -}; - -/*--------------------------------------------------------------------------*/ - -Abstract.TimedObserver = Class.create(PeriodicalExecuter, { - initialize: function($super, element, frequency, callback) { - $super(callback, frequency); - this.element = $(element); - this.lastValue = this.getValue(); - }, - - execute: function() { - var value = this.getValue(); - if (Object.isString(this.lastValue) && Object.isString(value) ? - this.lastValue != value : String(this.lastValue) != String(value)) { - this.callback(this.element, value); - this.lastValue = value; - } - } -}); - -Form.Element.Observer = Class.create(Abstract.TimedObserver, { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.Observer = Class.create(Abstract.TimedObserver, { - getValue: function() { - return Form.serialize(this.element); - } -}); - -/*--------------------------------------------------------------------------*/ - -Abstract.EventObserver = Class.create({ - initialize: function(element, callback) { - this.element = $(element); - this.callback = callback; - - this.lastValue = this.getValue(); - if (this.element.tagName.toLowerCase() == 'form') - this.registerFormCallbacks(); - else - this.registerCallback(this.element); - }, - - onElementEvent: function() { - var value = this.getValue(); - if (this.lastValue != value) { - this.callback(this.element, value); - this.lastValue = value; - } - }, - - registerFormCallbacks: function() { - Form.getElements(this.element).each(this.registerCallback, this); - }, - - registerCallback: function(element) { - if (element.type) { - switch (element.type.toLowerCase()) { - case 'checkbox': - case 'radio': - Event.observe(element, 'click', this.onElementEvent.bind(this)); - break; - default: - Event.observe(element, 'change', this.onElementEvent.bind(this)); - break; - } - } - } -}); - -Form.Element.EventObserver = Class.create(Abstract.EventObserver, { - getValue: function() { - return Form.Element.getValue(this.element); - } -}); - -Form.EventObserver = Class.create(Abstract.EventObserver, { - getValue: function() { - return Form.serialize(this.element); - } -}); -if (!window.Event) var Event = { }; - -Object.extend(Event, { - KEY_BACKSPACE: 8, - KEY_TAB: 9, - KEY_RETURN: 13, - KEY_ESC: 27, - KEY_LEFT: 37, - KEY_UP: 38, - KEY_RIGHT: 39, - KEY_DOWN: 40, - KEY_DELETE: 46, - KEY_HOME: 36, - KEY_END: 35, - KEY_PAGEUP: 33, - KEY_PAGEDOWN: 34, - KEY_INSERT: 45, - - cache: { }, - - relatedTarget: function(event) { - var element; - switch(event.type) { - case 'mouseover': element = event.fromElement; break; - case 'mouseout': element = event.toElement; break; - default: return null; - } - return Element.extend(element); - } -}); - -Event.Methods = (function() { - var isButton; - - if (Prototype.Browser.IE) { - var buttonMap = { 0: 1, 1: 4, 2: 2 }; - isButton = function(event, code) { - return event.button == buttonMap[code]; - }; - - } else if (Prototype.Browser.WebKit) { - isButton = function(event, code) { - switch (code) { - case 0: return event.which == 1 && !event.metaKey; - case 1: return event.which == 1 && event.metaKey; - default: return false; - } - }; - - } else { - isButton = function(event, code) { - return event.which ? (event.which === code + 1) : (event.button === code); - }; - } - - return { - isLeftClick: function(event) { return isButton(event, 0) }, - isMiddleClick: function(event) { return isButton(event, 1) }, - isRightClick: function(event) { return isButton(event, 2) }, - - element: function(event) { - var node = Event.extend(event).target; - return Element.extend(node.nodeType == Node.TEXT_NODE ? node.parentNode : node); - }, - - findElement: function(event, expression) { - var element = Event.element(event); - return element.match(expression) ? element : element.up(expression); - }, - - pointer: function(event) { - return { - x: event.pageX || (event.clientX + - (document.documentElement.scrollLeft || document.body.scrollLeft)), - y: event.pageY || (event.clientY + - (document.documentElement.scrollTop || document.body.scrollTop)) - }; - }, - - pointerX: function(event) { return Event.pointer(event).x }, - pointerY: function(event) { return Event.pointer(event).y }, - - stop: function(event) { - Event.extend(event); - event.preventDefault(); - event.stopPropagation(); - event.stopped = true; - } - }; -})(); - -Event.extend = (function() { - var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { - m[name] = Event.Methods[name].methodize(); - return m; - }); - - if (Prototype.Browser.IE) { - Object.extend(methods, { - stopPropagation: function() { this.cancelBubble = true }, - preventDefault: function() { this.returnValue = false }, - inspect: function() { return "[object Event]" } - }); - - return function(event) { - if (!event) return false; - if (event._extendedByPrototype) return event; - - event._extendedByPrototype = Prototype.emptyFunction; - var pointer = Event.pointer(event); - Object.extend(event, { - target: event.srcElement, - relatedTarget: Event.relatedTarget(event), - pageX: pointer.x, - pageY: pointer.y - }); - return Object.extend(event, methods); - }; - - } else { - Event.prototype = Event.prototype || document.createEvent("HTMLEvents").__proto__; - Object.extend(Event.prototype, methods); - return Prototype.K; - } -})(); - -Object.extend(Event, (function() { - var cache = Event.cache; - - function getEventID(element) { - if (element._eventID) return element._eventID; - arguments.callee.id = arguments.callee.id || 1; - return element._eventID = ++arguments.callee.id; - } - - function getDOMEventName(eventName) { - if (eventName && eventName.include(':')) return "dataavailable"; - return eventName; - } - - function getCacheForID(id) { - return cache[id] = cache[id] || { }; - } - - function getWrappersForEventName(id, eventName) { - var c = getCacheForID(id); - return c[eventName] = c[eventName] || []; - } - - function createWrapper(element, eventName, handler) { - var id = getEventID(element); - var c = getWrappersForEventName(id, eventName); - if (c.pluck("handler").include(handler)) return false; - - var wrapper = function(event) { - if (!Event || !Event.extend || - (event.eventName && event.eventName != eventName)) - return false; - - Event.extend(event); - handler.call(element, event) - }; - - wrapper.handler = handler; - c.push(wrapper); - return wrapper; - } - - function findWrapper(id, eventName, handler) { - var c = getWrappersForEventName(id, eventName); - return c.find(function(wrapper) { return wrapper.handler == handler }); - } - - function destroyWrapper(id, eventName, handler) { - var c = getCacheForID(id); - if (!c[eventName]) return false; - c[eventName] = c[eventName].without(findWrapper(id, eventName, handler)); - } - - function destroyCache() { - for (var id in cache) - for (var eventName in cache[id]) - cache[id][eventName] = null; - } - - if (window.attachEvent) { - window.attachEvent("onunload", destroyCache); - } - - return { - observe: function(element, eventName, handler) { - element = $(element); - var name = getDOMEventName(eventName); - - var wrapper = createWrapper(element, eventName, handler); - if (!wrapper) return element; - - if (element.addEventListener) { - element.addEventListener(name, wrapper, false); - } else { - element.attachEvent("on" + name, wrapper); - } - - return element; - }, - - stopObserving: function(element, eventName, handler) { - element = $(element); - var id = getEventID(element), name = getDOMEventName(eventName); - - if (!handler && eventName) { - getWrappersForEventName(id, eventName).each(function(wrapper) { - element.stopObserving(eventName, wrapper.handler); - }); - return element; - - } else if (!eventName) { - Object.keys(getCacheForID(id)).each(function(eventName) { - element.stopObserving(eventName); - }); - return element; - } - - var wrapper = findWrapper(id, eventName, handler); - if (!wrapper) return element; - - if (element.removeEventListener) { - element.removeEventListener(name, wrapper, false); - } else { - element.detachEvent("on" + name, wrapper); - } - - destroyWrapper(id, eventName, handler); - - return element; - }, - - fire: function(element, eventName, memo) { - element = $(element); - if (element == document && document.createEvent && !element.dispatchEvent) - element = document.documentElement; - - if (document.createEvent) { - var event = document.createEvent("HTMLEvents"); - event.initEvent("dataavailable", true, true); - } else { - var event = document.createEventObject(); - event.eventType = "ondataavailable"; - } - - event.eventName = eventName; - event.memo = memo || { }; - - if (document.createEvent) { - element.dispatchEvent(event); - } else { - element.fireEvent(event.eventType, event); - } - - return event; - } - }; -})()); - -Object.extend(Event, Event.Methods); - -Element.addMethods({ - fire: Event.fire, - observe: Event.observe, - stopObserving: Event.stopObserving -}); - -Object.extend(document, { - fire: Element.Methods.fire.methodize(), - observe: Element.Methods.observe.methodize(), - stopObserving: Element.Methods.stopObserving.methodize() -}); - -(function() { - /* Support for the DOMContentLoaded event is based on work by Dan Webb, - Matthias Miller, Dean Edwards and John Resig. */ - - var timer, fired = false; - - function fireContentLoadedEvent() { - if (fired) return; - if (timer) window.clearInterval(timer); - document.fire("dom:loaded"); - fired = true; - } - - if (document.addEventListener) { - if (Prototype.Browser.WebKit) { - timer = window.setInterval(function() { - if (/loaded|complete/.test(document.readyState)) - fireContentLoadedEvent(); - }, 0); - - Event.observe(window, "load", fireContentLoadedEvent); - - } else { - document.addEventListener("DOMContentLoaded", - fireContentLoadedEvent, false); - } - - } else { - document.write("'); - }, - REQUIRED_PROTOTYPE: '1.6', - load: function() { - function convertVersionString(versionString){ - var r = versionString.split('.'); - return parseInt(r[0])*100000 + parseInt(r[1])*1000 + parseInt(r[2]); - } - - if((typeof Prototype=='undefined') || - (typeof Element == 'undefined') || - (typeof Element.Methods=='undefined') || - (convertVersionString(Prototype.Version) < - convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE))) - throw("script.aculo.us requires the Prototype JavaScript framework >= " + - Scriptaculous.REQUIRED_PROTOTYPE); - - $A(document.getElementsByTagName("script")).findAll( function(s) { - return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/)) - }).each( function(s) { - var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,''); - var includes = s.src.match(/\?.*load=([a-z,]*)/); - if ( includes ) - includes[1].split(',').each( - function(include) { Scriptaculous.require(path+include+'.js') }); - }); - } -} - -Scriptaculous.load(); diff -uNr a/mp-wp/wp-includes/js/swfupload/handlers.js b/mp-wp/wp-includes/js/swfupload/handlers.js --- a/mp-wp/wp-includes/js/swfupload/handlers.js fc72ca2e9f5c2e47c6633759bd86ecc5bf71a9dd8b3fde34e54eb0d5075f36294b929f1b9749c0e32aaada6aa78e57ff19b85a87604c49e46874bc04f50b007c +++ b/mp-wp/wp-includes/js/swfupload/handlers.js false @@ -1,287 +0,0 @@ -function fileDialogStart() { - jQuery("#media-upload-error").empty(); -} - -// progress and success handlers for media multi uploads -function fileQueued(fileObj) { - // Get rid of unused form - jQuery('.media-blank').remove(); - // Collapse a single item - if ( jQuery('.type-form #media-items>*').length == 1 && jQuery('#media-items .hidden').length > 0 ) { - jQuery('.toggle').toggle(); - jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden'); - } - // Create a progress bar containing the filename - jQuery('#media-items').append('
    ' + fileObj.name + '
    '); - // Display the progress div - jQuery('#media-item-' + fileObj.id + ' .progress').show(); - - // Disable the submit button - jQuery('#insert-gallery').attr('disabled', 'disabled'); -} - -function uploadStart(fileObj) { return true; } - -function uploadProgress(fileObj, bytesDone, bytesTotal) { - // Lengthen the progress bar - jQuery('#media-item-' + fileObj.id + ' .bar').width(620*bytesDone/bytesTotal); - - if ( bytesDone == bytesTotal ) - jQuery('#media-item-' + fileObj.id + ' .bar').html('' + swfuploadL10n.crunching + ''); -} - -function prepareMediaItem(fileObj, serverData) { - // Move the progress bar to 100% - jQuery('#media-item-' + fileObj.id + ' .bar').remove(); - jQuery('#media-item-' + fileObj.id + ' .progress').hide(); - - var f = ( typeof shortform == 'undefined' ) ? 1 : 2; - // Old style: Append the HTML returned by the server -- thumbnail and form inputs - if ( isNaN(serverData) || !serverData ) { - jQuery('#media-item-' + fileObj.id).append(serverData); - prepareMediaItemInit(fileObj); - } - // New style: server data is just the attachment ID, fetch the thumbnail and form html from the server - else { - jQuery('#media-item-' + fileObj.id).load('async-upload.php', {attachment_id:serverData, fetch:f}, function(){prepareMediaItemInit(fileObj);updateMediaForm()}); - } -} - -function prepareMediaItemInit(fileObj) { - - // Clone the thumbnail as a "pinkynail" -- a tiny image to the left of the filename - jQuery('#media-item-' + fileObj.id + ' .thumbnail').clone().attr('className', 'pinkynail toggle').prependTo('#media-item-' + fileObj.id); - - // Replace the original filename with the new (unique) one assigned during upload - jQuery('#media-item-' + fileObj.id + ' .filename.original').replaceWith(jQuery('#media-item-' + fileObj.id + ' .filename.new')); - - // Also bind toggle to the links - jQuery('#media-item-' + fileObj.id + ' a.toggle').bind('click', function(){jQuery(this).siblings('.slidetoggle').slideToggle(150, function(){var o=jQuery(this).offset();window.scrollTo(0,o.top-36);});jQuery(this).parent().eq(0).children('.toggle').toggle();jQuery(this).siblings('a.toggle').focus();return false;}); - - // Bind AJAX to the new Delete button - jQuery('#media-item-' + fileObj.id + ' a.delete').bind('click',function(){ - // Tell the server to delete it. TODO: handle exceptions - jQuery.ajax({url:'admin-ajax.php',type:'post',success:deleteSuccess,error:deleteError,id:fileObj.id,data:{ - id : this.id.replace(/[^0-9]/g,''), - action : 'delete-post', - _ajax_nonce : this.href.replace(/^.*wpnonce=/,'')} - }); - return false; - }); - - // Open this item if it says to start open (e.g. to display an error) - jQuery('#media-item-' + fileObj.id + '.startopen') - .removeClass('startopen') - .slideToggle(500) - .parent().eq(0).children('.toggle').toggle(); -} - -function itemAjaxError(id, html) { - var error = jQuery('#media-item-error' + id); - - error.html('
    '+html+'
    '); - jQuery('#dismiss-'+id).click(function(){jQuery(this).parents('.file-error').slideUp(200, function(){jQuery(this).empty();})}); -} - -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 item = jQuery('#media-item-' + this.id); - - // Decrement the counters. - if ( type = jQuery('#type-of-' + this.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('.type-form #media-items>*').length == 1 && jQuery('#media-items .hidden').length > 0 ) { - jQuery('.toggle').toggle(); - jQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden'); - } - - // Vanish it. - jQuery('#media-item-' + this.id + ' .filename:empty').remove(); - jQuery('#media-item-' + this.id + ' .filename').append(' '+swfuploadL10n.deleted+'').siblings('a.toggle').remove(); - jQuery('#media-item-' + this.id).children('.describe').css({backgroundColor:'#fff'}).end() - .animate({backgroundColor:'#ffc0c0'}, {queue:false,duration:50}) - .animate({minHeight:0,height:36}, 400, null, function(){jQuery(this).children('.describe').remove()}) - .animate({backgroundColor:'#fff'}, 400) - .animate({height:0}, 800, null, function(){jQuery(this).remove();updateMediaForm();}); - - return; -} - -function deleteError(X, textStatus, errorThrown) { - // TODO -} - -function updateMediaForm() { - storeState(); - // Just one file, no need for collapsible part - if ( jQuery('.type-form #media-items>*').length == 1 ) { - jQuery('#media-items .slidetoggle').slideDown(500).parent().eq(0).children('.toggle').toggle(); - jQuery('.type-form .slidetoggle').siblings().addClass('hidden'); - } - - // Only show Save buttons when there is at least one file. - if ( jQuery('#media-items>*').not('.media-blank').length > 0 ) - jQuery('.savebutton').show(); - else - jQuery('.savebutton').hide(); - - // Only show Gallery button when there are at least two files. - if ( jQuery('#media-items>*').length > 1 ) - jQuery('.insert-gallery').show(); - else - jQuery('.insert-gallery').hide(); -} - -function uploadSuccess(fileObj, serverData) { - // if async-upload returned an error message, place it in the media item div and return - if ( serverData.match('media-upload-error') ) { - jQuery('#media-item-' + fileObj.id).html(serverData); - return; - } - - prepareMediaItem(fileObj, serverData); - updateMediaForm(); - - // Increment the counter. - 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 no more uploads queued, enable the submit button - if ( swfu.getStats().files_queued == 0 ) - jQuery('#insert-gallery').attr('disabled', ''); -} - - -// wp-specific error handlers - -// generic message -function wpQueueError(message) { - jQuery('#media-upload-error').show().text(message); -} - -// file-specific message -function wpFileError(fileObj, message) { - jQuery('#media-item-' + fileObj.id + ' .filename').after('
    '+message+'
    ').siblings('.toggle').remove(); - jQuery('#dismiss-' + fileObj.id).click(function(){jQuery(this).parents('.media-item').slideUp(200, function(){jQuery(this).remove();})}); -} - -function fileQueueError(fileObj, error_code, message) { - // Handle this error separately because we don't want to create a FileProgress element for it. - 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 swfuploadPreLoad() { - var swfupload_element = jQuery('#'+swfu.customSettings.swfupload_element_id).get(0); - jQuery('#' + swfu.customSettings.degraded_element_id).hide(); - // Doing this directly because jQuery().show() seems to have timing problems - if ( swfupload_element && ! swfupload_element.style.display ) - swfupload_element.style.display = 'block'; -} - -function swfuploadLoadFailed() { - jQuery('#' + swfu.customSettings.swfupload_element_id).hide(); - jQuery('#' + swfu.customSettings.degraded_element_id).show(); -} - -function uploadError(fileObj, error_code, message) { - // first the file specific error - if ( error_code == SWFUpload.UPLOAD_ERROR.MISSING_UPLOAD_URL ) { - wpFileError(fileObj, swfuploadL10n.missing_upload_url); - } - else if ( error_code == SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED ) { - wpFileError(fileObj, swfuploadL10n.upload_limit_exceeded); - } - else { - wpFileError(fileObj, swfuploadL10n.default_error); - } - - // now the general upload status - if ( error_code == SWFUpload.UPLOAD_ERROR.HTTP_ERROR ) { - wpQueueError(swfuploadL10n.http_error); - } - else if ( error_code == SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED ) { - wpQueueError(swfuploadL10n.upload_failed); - } - else if ( error_code == SWFUpload.UPLOAD_ERROR.IO_ERROR ) { - wpQueueError(swfuploadL10n.io_error); - } - else if ( error_code == SWFUpload.UPLOAD_ERROR.SECURITY_ERROR ) { - wpQueueError(swfuploadL10n.security_error); - } - else if ( error_code == SWFUpload.UPLOAD_ERROR.FILE_CANCELLED ) { - wpQueueError(swfuploadL10n.security_error); - } -} - -// remember the last used image size, alignment and url -var storeState; -(function($){ - -storeState = function(){ - var align = getUserSetting('align') || '', imgsize = getUserSetting('imgsize') || ''; - - $('tr.align input[type="radio"]').click(function(){ - setUserSetting('align', $(this).val()); - }).filter(function(){ - if ( $(this).val() == align ) - return true; - return false; - }).attr('checked','checked'); - - $('tr.image-size input[type="radio"]').click(function(){ - setUserSetting('imgsize', $(this).val()); - }).filter(function(){ - if ( $(this).attr('disabled') || $(this).val() != imgsize ) - return false; - return true; - }).attr('checked','checked'); - - $('tr.url button').click(function(){ - var c = this.className || ''; - c = c.replace(/.*?(url[^ '"]+).*/, '$1'); - if (c) setUserSetting('urlbutton', c); - $(this).siblings('.urlfield').val( $(this).attr('title') ); - }); - - $('tr.url .urlfield').each(function(){ - var b = getUserSetting('urlbutton'); - $(this).val( $(this).siblings('button.'+b).attr('title') ); - }); -} -})(jQuery); diff -uNr a/mp-wp/wp-includes/js/swfupload/plugins/swfupload.cookies.js b/mp-wp/wp-includes/js/swfupload/plugins/swfupload.cookies.js --- a/mp-wp/wp-includes/js/swfupload/plugins/swfupload.cookies.js 659e33480372c2127d72abb078045fc9d398fd7ffe89e9fa4a7fa5b972d47674e055403d278a5cf9d116c1e66cefdb4b17fb68ab62d2024a7b2ff7497ef39b03 +++ b/mp-wp/wp-includes/js/swfupload/plugins/swfupload.cookies.js false @@ -1,53 +0,0 @@ -/* - Cookie Plug-in - - This plug in automatically gets all the cookies for this site and adds them to the post_params. - Cookies are loaded only on initialization. The refreshCookies function can be called to update the post_params. - The cookies will override any other post params with the same name. -*/ - -var SWFUpload; -if (typeof(SWFUpload) === "function") { - SWFUpload.prototype.initSettings = function (oldInitSettings) { - return function () { - if (typeof(oldInitSettings) === "function") { - oldInitSettings.call(this); - } - - this.refreshCookies(false); // The false parameter must be sent since SWFUpload has not initialzed at this point - }; - }(SWFUpload.prototype.initSettings); - - // refreshes the post_params and updates SWFUpload. The sendToFlash parameters is optional and defaults to True - SWFUpload.prototype.refreshCookies = function (sendToFlash) { - if (sendToFlash === undefined) { - sendToFlash = true; - } - sendToFlash = !!sendToFlash; - - // Get the post_params object - var postParams = this.settings.post_params; - - // Get the cookies - var i, cookieArray = document.cookie.split(';'), caLength = cookieArray.length, c, eqIndex, name, value; - for (i = 0; i < caLength; i++) { - c = cookieArray[i]; - - // Left Trim spaces - while (c.charAt(0) === " ") { - c = c.substring(1, c.length); - } - eqIndex = c.indexOf("="); - if (eqIndex > 0) { - name = c.substring(0, eqIndex); - value = c.substring(eqIndex + 1); - postParams[name] = value; - } - } - - if (sendToFlash) { - this.setPostParams(postParams); - } - }; - -} diff -uNr a/mp-wp/wp-includes/js/swfupload/plugins/swfupload.documentready.js b/mp-wp/wp-includes/js/swfupload/plugins/swfupload.documentready.js --- a/mp-wp/wp-includes/js/swfupload/plugins/swfupload.documentready.js b1d705f33297ec5be97856650570926f221976bcb892d53f15dcd769c1281a45d6fca1cddf6bc249facbe63b0ac5d4aa8a6f82d8165cb0ef9033dbfb1f0a7e15 +++ b/mp-wp/wp-includes/js/swfupload/plugins/swfupload.documentready.js false @@ -1,102 +0,0 @@ -/* - DocumentReady Plug-in - - This plugin loads SWFUpload as soon as the document is ready. You should not load SWFUpload inside window.onload using this plugin. - You can also chain other functions by calling SWFUpload.DocumentReady(your function). - - Warning: Embedded Ads or other scripts that overwrite window.onload or use their own document ready functions may interfer with this plugin. You - should not set window.onload when using this plugin. - - Usage Example: - - var swfu = new SWFUpload(your settings object); - SWFUpload.DocumentReady(function () { alert('Document Ready!'; }); - -*/ - -var SWFUpload; -if (typeof(SWFUpload) === "function") { - // Override iniSWFUpload so SWFUpload gets inited when the document is ready rather than immediately - SWFUpload.prototype.initSWFUpload = function (old_initSWFUpload) { - return function (init_settings) { - var self = this; - if (typeof(old_initSWFUpload) === "function") { - SWFUpload.DocumentReady(function () { - old_initSWFUpload.call(self, init_settings); - }); - } - } - - }(SWFUpload.prototype.initSWFUpload); - - - // The DocumentReady function adds the passed in function to - // the functions that will be executed when the document is ready/loaded - SWFUpload.DocumentReady = function (fn) { - // Add the function to the chain - SWFUpload.DocumentReady.InternalOnloadChain = function (previous_link_fn) { - return function () { - if (typeof(previous_link_fn) === "function") { - previous_link_fn(); - } - fn(); - }; - }(SWFUpload.DocumentReady.InternalOnloadChain); - }; - SWFUpload.DocumentReady.InternalOnloadChain = null; - SWFUpload.DocumentReady.Onload = function () { - // Execute the onload function chain - if (typeof(SWFUpload.DocumentReady.InternalOnloadChain) === "function") { - SWFUpload.DocumentReady.InternalOnloadChain(); - } - }; - SWFUpload.DocumentReady.SetupComplete = false; - - - /* ******************************************** - This portion of the code gets executed as soon it is loaded. - It binds the proper event for executing JavaScript is - early as possible. This is a per browser function and so - some browser sniffing is used. - - This solution still has the "exposed" issue (See the Global Delegation section at http://peter.michaux.ca/article/553 ) - - Base solution from http://dean.edwards.name/weblog/2006/06/again/ and http://dean.edwards.name/weblog/2005/09/busted/ - ******************************************** */ - if (!SWFUpload.DocumentReady.SetupComplete) { - // for Internet Explorer (using conditional comments) - /*@cc_on @*/ - /*@if (@_win32) - document.write(" - - Notes: - You must provide set minimum_flash_version setting to "8" if you are using SWFUpload for Flash Player 8. - The swfuploadLoadFailed event is only fired if the minimum version of Flash Player is not met. Other issues such as missing SWF files, browser bugs - or corrupt Flash Player installations will not trigger this event. - The swfuploadPreLoad event is fired as soon as the minimum version of Flash Player is found. It does not wait for SWFUpload to load and can - be used to prepare the SWFUploadUI and hide alternate content. - swfobject's onDomReady event is cross-browser safe but will default to the window.onload event when DOMReady is not supported by the browser. - Early DOM Loading is supported in major modern browsers but cannot be guaranteed for every browser ever made. -*/ - - -/* SWFObject v2.0 rc4 - Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis - This software is released under the MIT License -*/ -var swfobject=function(){var X="undefined",P="object",a="visibility:visible",e="visibility:hidden",B="Shockwave Flash",h="ShockwaveFlash.ShockwaveFlash",V="application/x-shockwave-flash",K="SWFObjectExprInst",G=window,g=document,N=navigator,f=[],H=[],Q=null,L=null,S=false,C=false;var Y=function(){var l=typeof g.getElementById!=X&&typeof g.getElementsByTagName!=X&&typeof g.createElement!=X&&typeof g.appendChild!=X&&typeof g.replaceChild!=X&&typeof g.removeChild!=X&&typeof g.cloneNode!=X,t=[0,0,0],n=null;if(typeof N.plugins!=X&&typeof N.plugins[B]==P){n=N.plugins[B].description;if(n){n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");t[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);t[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10);t[2]=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof G.ActiveXObject!=X){var o=null,s=false;try{o=new ActiveXObject(h+".7")}catch(k){try{o=new ActiveXObject(h+".6");t=[6,0,21];o.AllowScriptAccess="always"}catch(k){if(t[0]==6){s=true}}if(!s){try{o=new ActiveXObject(h)}catch(k){}}}if(!s&&o){try{n=o.GetVariable("$version");if(n){n=n.split(" ")[1].split(",");t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}catch(k){}}}}var v=N.userAgent.toLowerCase(),j=N.platform.toLowerCase(),r=/webkit/.test(v)?parseFloat(v.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=false,q=j?/win/.test(j):/win/.test(v),m=j?/mac/.test(j):/mac/.test(v);/*@cc_on i=true;@if(@_win32)q=true;@elif(@_mac)m=true;@end@*/return{w3cdom:l,pv:t,webkit:r,ie:i,win:q,mac:m}}();var d=function(){if(!Y.w3cdom){return }J(I);if(Y.ie&&Y.win){try{g.write(" - -
      diff -uNr a/mp-wp/wp-login.php b/mp-wp/wp-login.php --- a/mp-wp/wp-login.php 5e5c1e016d3a7b1bfd2cf6ab94eba8e84b1c9947496a2bc8fa6a6f7bcdeeff58a10d1dce6706028c6f0a796bfe468007fcce74a14d4d524d8e858538a075f6d4 +++ b/mp-wp/wp-login.php bb410ee4f18dad69714fa6e7980e6f4f8c66315cf8f85851b7f6f441cbc97422e2b90a08d0b33313161f1c2ba2dbfb5d36a3f5a3efd4377c939f14d898948f1d @@ -56,7 +56,7 @@ -

      +

      MP-WP

      " size="20" tabindex="10" />

      -

      +

      -

      -

      +

      -

      - +

      @@ -496,18 +490,6 @@

      -