Changeset 11359
- Timestamp:
- 05/16/2009 06:29:10 AM (15 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/user-edit.php
r11330 r11359 10 10 require_once('admin.php'); 11 11 12 if ( defined('IS_PROFILE_PAGE') && IS_PROFILE_PAGE ) 13 $is_profile_page = true; 14 else 15 $is_profile_page = false; 16 17 if ( $is_profile_page ) { 18 wp_enqueue_script('user-profile'); 19 wp_enqueue_script('password-strength-meter'); 20 } 21 22 $title = $is_profile_page? __('Profile') : __('Edit User'); 23 if ( current_user_can('edit_users') && !$is_profile_page ) 12 if ( !defined('IS_PROFILE_PAGE') ) 13 define('IS_PROFILE_PAGE', false); 14 15 wp_enqueue_script('user-profile'); 16 wp_enqueue_script('password-strength-meter'); 17 18 $title = IS_PROFILE_PAGE ? __('Profile') : __('Edit User'); 19 if ( current_user_can('edit_users') && !IS_PROFILE_PAGE ) 24 20 $submenu_file = 'users.php'; 25 21 else … … 34 30 35 31 if ( !$user_id ) { 36 if ( $is_profile_page) {32 if ( IS_PROFILE_PAGE ) { 37 33 $current_user = wp_get_current_user(); 38 34 $user_id = $current_user->ID; … … 76 72 wp_die(__('You do not have permission to edit this user.')); 77 73 78 if ( $is_profile_page)74 if ( IS_PROFILE_PAGE ) 79 75 do_action('personal_options_update', $user_id); 80 76 else … … 84 80 85 81 if ( !is_wp_error( $errors ) ) { 86 $redirect = ( $is_profile_page? "profile.php?" : "user-edit.php?user_id=$user_id&"). "updated=true";82 $redirect = (IS_PROFILE_PAGE ? "profile.php?" : "user-edit.php?user_id=$user_id&"). "updated=true"; 87 83 $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect); 88 84 wp_redirect($redirect); … … 102 98 <div id="message" class="updated fade"> 103 99 <p><strong><?php _e('User updated.') ?></strong></p> 104 <?php if ( $wp_http_referer && ! $is_profile_page) : ?>100 <?php if ( $wp_http_referer && !IS_PROFILE_PAGE ) : ?> 105 101 <p><a href="users.php"><?php _e('← Back to Authors and Users'); ?></a></p> 106 102 <?php endif; ?> … … 174 170 </table> 175 171 <?php 176 if ( $is_profile_page)172 if ( IS_PROFILE_PAGE ) 177 173 do_action('profile_personal_options', $profileuser); 178 174 ?> … … 186 182 </tr> 187 183 188 <?php if ( ! $is_profile_page): ?>184 <?php if ( !IS_PROFILE_PAGE ): ?> 189 185 <tr><th><label for="role"><?php _e('Role:') ?></label></th> 190 186 <td><select name="role" id="role"> … … 205 201 ?> 206 202 </select></td></tr> 207 <?php endif; //! $is_profile_page?>203 <?php endif; //!IS_PROFILE_PAGE ?> 208 204 209 205 <tr> … … 281 277 </table> 282 278 283 <h3><?php $is_profile_page? _e('About Yourself') : _e('About the user'); ?></h3>279 <h3><?php IS_PROFILE_PAGE ? _e('About Yourself') : _e('About the user'); ?></h3> 284 280 285 281 <table class="form-table"> … … 298 294 <td><input type="password" name="pass1" id="pass1" size="16" value="" autocomplete="off" /> <span class="description"><?php _e("If you would like to change the password type a new one. Otherwise leave this blank."); ?></span><br /> 299 295 <input type="password" name="pass2" id="pass2" size="16" value="" autocomplete="off" /> <span class="description"><?php _e("Type your new password again."); ?></span><br /> 300 <?php if ( $is_profile_page ): ?>301 296 <div id="pass-strength-result"><?php _e('Strength indicator'); ?></div> 302 <p class="description indicator-hint"><?php _e('Hint: Yourpassword should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).'); ?></p>303 < ?php endif; ?></td>297 <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).'); ?></p> 298 </td> 304 299 </tr> 305 300 <?php endif; ?> … … 307 302 308 303 <?php 309 if ( $is_profile_page) {304 if ( IS_PROFILE_PAGE ) { 310 305 do_action('show_user_profile', $profileuser); 311 306 } else { … … 336 331 <input type="hidden" name="action" value="update" /> 337 332 <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($user_id); ?>" /> 338 <input type="submit" class="button-primary" value="<?php $is_profile_page? esc_attr_e('Update Profile') : esc_attr_e('Update User') ?>" name="submit" />333 <input type="submit" class="button-primary" value="<?php IS_PROFILE_PAGE ? esc_attr_e('Update Profile') : esc_attr_e('Update User') ?>" name="submit" /> 339 334 </p> 340 335 </form> -
trunk/wp-admin/user-new.php
r11330 r11359 38 38 39 39 wp_enqueue_script('wp-ajax-response'); 40 wp_enqueue_script('user-profile'); 41 wp_enqueue_script('password-strength-meter'); 40 42 41 43 require_once ('admin-header.php'); … … 118 120 <td><input name="pass1" type="password" id="pass1" autocomplete="off" /> 119 121 <br /> 120 <input name="pass2" type="password" id="pass2" autocomplete="off"/></td> 122 <input name="pass2" type="password" id="pass2" autocomplete="off"/> 123 <div id="pass-strength-result"><?php _e('Strength indicator'); ?></div> 124 <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).'); ?></p> 125 </td> 121 126 </tr> 122 127 <tr> -
trunk/wp-admin/wp-admin.css
r11337 r11359 1305 1305 } 1306 1306 1307 .form-table input.regular-text { 1308 width: 325px; 1307 .form-table input.regular-text, 1308 #adduser .form-field input { 1309 width: 25em; 1309 1310 } 1310 1311 … … 1316 1317 width: 500px; 1317 1318 margin-bottom: 6px; 1318 }1319 1320 #profile-page .form-table input[type=text] {1321 width: 300px;1322 1319 } 1323 1320
Note: See TracChangeset
for help on using the changeset viewer.