Changeset 21003
- Timestamp:
- 06/05/2012 06:51:33 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 9 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r20857 r21003 39 39 $core_actions_get = array( 40 40 'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache', 41 'autocomplete-user', ' autocomplete-site', 'dashboard-widgets',41 'autocomplete-user', 'dashboard-widgets', 42 42 ); 43 43 -
trunk/wp-admin/includes/ajax-actions.php
r20913 r21003 211 211 } 212 212 wp_die(); 213 }214 215 function wp_ajax_autocomplete_site() {216 if ( ! is_multisite() || ! current_user_can( 'manage_sites' ) || wp_is_large_network( 'sites' ) )217 wp_die( -1 );218 219 $return = array();220 221 global $wpdb;222 $like_escaped_term = '%' . like_escape( stripslashes( $_REQUEST['term'] ) ) . '%';223 $sites = $wpdb->get_results( $wpdb->prepare( "SELECT blog_id, domain, path FROM $wpdb->blogs WHERE ( domain LIKE %s OR path LIKE %s ) AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $like_escaped_term, $like_escaped_term ), ARRAY_A );224 225 if ( empty( $sites ) )226 wp_die( -1 );227 228 foreach ( (array) $sites as $details ) {229 $blogname = get_blog_option( $details['blog_id'], 'blogname' );230 $return[] = array(231 'label' => sprintf( '%1$s (%2$s)', $blogname, $details['domain'] . $details['path'] ),232 'value' => $details['domain']233 );234 }235 236 wp_die( json_encode( $return ) );237 213 } 238 214 -
trunk/wp-admin/includes/dashboard.php
r20984 r21003 415 415 $actions['create-user'] = '<a href="' . network_admin_url('user-new.php') . '">' . __( 'Create a New User' ) . '</a>'; 416 416 417 if ( ! wp_is_large_network( 'users' ) )418 wp_enqueue_script( 'user-search' );419 420 if ( ! wp_is_large_network( 'sites' ) )421 wp_enqueue_script( 'site-search' );422 423 417 $c_users = get_user_count(); 424 418 $c_blogs = get_blog_count(); … … 443 437 <?php do_action( 'wpmuadminresult', '' ); ?> 444 438 445 <form name="searchform"action="<?php echo network_admin_url('users.php'); ?>" method="get">439 <form action="<?php echo network_admin_url('users.php'); ?>" method="get"> 446 440 <p> 447 <input type="search" name="s" value="" size="30" id="all-user-search-input" />441 <input type="search" name="s" value="" size="30" autocomplete="off" /> 448 442 <?php submit_button( __( 'Search Users' ), 'button', 'submit', false, array( 'id' => 'submit_users' ) ); ?> 449 443 </p> 450 444 </form> 451 445 452 <form name="searchform"action="<?php echo network_admin_url('sites.php'); ?>" method="get">446 <form action="<?php echo network_admin_url('sites.php'); ?>" method="get"> 453 447 <p> 454 <input type="search" name="s" value="" size="30" id="site-search-input" />448 <input type="search" name="s" value="" size="30" autocomplete="off" /> 455 449 <?php submit_button( __( 'Search Sites' ), 'button', 'submit', false, array( 'id' => 'submit_sites' ) ); ?> 456 450 </p> -
trunk/wp-admin/js/user-suggest.dev.js
r20992 r21003 1 jQuery( function($) { 2 var id = typeof( current_site_id ) != 'undefined' ? '&site_id=' + current_site_id : '', 3 isRTL = !! ( 'undefined' != typeof isRtl && isRtl ), 4 position = isRTL ? { my: 'right top', at: 'right bottom', offset: '0, -1' } : { offset: '0, -1' }, 5 open = function(e, ui) { 6 $(this).addClass('open'); 7 }, 8 close = function(e, ui) { 9 $(this).removeClass('open'); 10 }; 11 12 $( '#adduser-email, #newuser' ).autocomplete({ 13 source: ajaxurl + '?action=autocomplete-user&autocomplete_type=add' + id, 14 delay: 500, 15 minLength: 2, 16 position: position, 17 open: open, 18 close: close 1 (function($) { 2 var id = 'undefined' !== typeof current_site_id ? '&site_id=' + current_site_id : ''; 3 $(document).ready( function() { 4 $( '.wp-suggest-user' ).autocomplete({ 5 source: ajaxurl + '?action=autocomplete-user&autocomplete_type=add' + id, 6 delay: 500, 7 minLength: 2, 8 position: ( 'undefined' !== typeof isRtl && isRtl ) ? { my: 'right top', at: 'right bottom', offset: '0, -1' } : { offset: '0, -1' }, 9 open: function() { $(this).addClass('open'); }, 10 close: function() { $(this).removeClass('open'); } 11 }); 19 12 }); 20 21 $( '#user-search-input' ).autocomplete({ 22 source: ajaxurl + '?action=autocomplete-user&autocomplete_type=search' + id, 23 delay: 500, 24 minLength: 2, 25 position: position, 26 open: open, 27 close: close 28 }); 29 30 $( '#all-user-search-input' ).autocomplete({ 31 source: ajaxurl + '?action=autocomplete-user&autocomplete_type=search-all' + id, 32 delay: 500, 33 minLength: 2, 34 position: position, 35 open: open, 36 close: close 37 }); 38 }); 13 })(jQuery); -
trunk/wp-admin/network/site-users.php
r20713 r21003 173 173 174 174 if ( ! wp_is_large_network( 'users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) 175 wp_enqueue_script( 'user-s earch' );175 wp_enqueue_script( 'user-suggest' ); 176 176 177 177 require('../admin-header.php'); ?> … … 268 268 <tr> 269 269 <th scope="row"><?php _e( 'Username' ); ?></th> 270 <td><input type="text" class="regular-text " name="newuser" id="newuser" /></td>270 <td><input type="text" class="regular-text wp-suggest-user" name="newuser" id="newuser" /></td> 271 271 </tr> 272 272 <tr> -
trunk/wp-admin/network/sites.php
r20713 r21003 283 283 $wp_list_table->prepare_items(); 284 284 285 if ( ! wp_is_large_network( 'sites' ) )286 wp_enqueue_script( 'site-search' );287 288 285 require_once( '../admin-header.php' ); 289 286 ?> -
trunk/wp-admin/network/users.php
r20993 r21003 246 246 ); 247 247 248 if ( ! wp_is_large_network( 'users' ) )249 wp_enqueue_script( 'user-search' );250 251 248 require_once( '../admin-header.php' ); 252 249 -
trunk/wp-admin/user-new.php
r20631 r21003 181 181 && ( is_super_admin() || apply_filters( 'autocomplete_users_for_site_admins', false ) ) 182 182 ) { 183 wp_enqueue_script( 'user-s earch' );183 wp_enqueue_script( 'user-suggest' ); 184 184 } 185 185 … … 270 270 <tr class="form-field form-required"> 271 271 <th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th> 272 <td><input name="email" type="text" id="adduser-email" value="" /></td>272 <td><input name="email" type="text" id="adduser-email" class="wp-suggest-user" value="" /></td> 273 273 </tr> 274 274 <tr class="form-field"> -
trunk/wp-admin/users.php
r20631 r21003 340 340 } 341 341 342 if ( is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' )343 && ( is_super_admin() || apply_filters( 'autocomplete_users_for_site_admins', false ) )344 ) {345 wp_enqueue_script( 'user-search' );346 }347 348 342 include('./admin-header.php'); 349 343 -
trunk/wp-includes/script-loader.php
r20960 r21003 268 268 $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), false, 1 ); 269 269 270 $scripts->add( 'user-search', "/wp-admin/js/user-search$suffix.js", array( 'jquery-ui-autocomplete' ), false, 1 ); 271 272 $scripts->add( 'site-search', "/wp-admin/js/site-search$suffix.js", array( 'jquery-ui-autocomplete' ), false, 1 ); 270 $scripts->add( 'user-suggest', "/wp-admin/js/user-suggest$suffix.js", array( 'jquery-ui-autocomplete' ), false, 1 ); 273 271 274 272 $scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 );
Note: See TracChangeset
for help on using the changeset viewer.