Ticket #6167: admin_color.diff
File admin_color.diff, 5.5 KB (added by , 17 years ago) |
---|
-
wp-includes/registration.php
154 154 if ( empty($rich_editing) ) 155 155 $rich_editing = 'true'; 156 156 157 if ( empty($admin_color) ) 158 $admin_color = 'classic'; 159 $admin_color = preg_replace('|[^a-z0-9 _.\-@]|i', '', $admin_color); 160 157 161 if ( empty($user_registered) ) 158 162 $user_registered = gmdate('Y-m-d H:i:s'); 159 163 … … 176 180 update_usermeta( $user_id, 'aim', $aim ); 177 181 update_usermeta( $user_id, 'yim', $yim ); 178 182 update_usermeta( $user_id, 'rich_editing', $rich_editing); 183 update_usermeta( $user_id, 'admin_color', $admin_color); 179 184 180 185 if ( $update && isset($role) ) { 181 186 $user = new WP_User($user_id); -
wp-includes/general-template.php
1100 1100 return $r; 1101 1101 } 1102 1102 1103 function wp_admin_css_color($key, $name, $url, $rtl_url = '') { 1104 global $_wp_admin_css_colors; 1105 1106 if ( !isset($_wp_admin_css_colors) ) 1107 $_wp_admin_css_colors = array(); 1108 1109 $_wp_admin_css_colors[$key] = (object) array('name' => $name, 'url' => $url, 'rtl_url' => $rtl_url); 1110 } 1111 1103 1112 function wp_admin_css_uri( $file = 'wp-admin' ) { 1104 if ( defined('WP_INSTALLING') ) 1105 { 1106 $_file = add_query_arg( 'version', get_bloginfo( 'version' ), "./$file.css" ); 1113 if ( defined('WP_INSTALLING') ) { 1114 $_file = "./$file.css"; 1107 1115 } else { 1108 $_file = add_query_arg( 'version', get_bloginfo( 'version' ), get_option( 'siteurl' ) . "/wp-admin/$file.css" ); 1116 if ( 'css/colors' == $file || 'css/colors-rtl' == $file ) { 1117 $color = get_user_option('admin_color'); 1118 if ( empty($color) ) 1119 $color = 'classic'; 1120 global $_wp_admin_css_colors; 1121 $color = $_wp_admin_css_colors[$color]; 1122 if ( 'css/colors-rtl' == $file ) 1123 $_file = $color->rtl_url; 1124 else 1125 $_file = $color->url; 1126 } else { 1127 $_file = get_option( 'siteurl' ) . "/wp-admin/$file.css"; 1128 } 1109 1129 } 1130 $_file = add_query_arg( 'version', get_bloginfo( 'version' ), $_file ); 1131 1110 1132 return apply_filters( 'wp_admin_css_uri', $_file, $file ); 1111 1133 } 1112 1134 1113 1135 function wp_admin_css( $file = 'wp-admin' ) { 1136 1114 1137 echo apply_filters( 'wp_admin_css', "<link rel='stylesheet' href='" . wp_admin_css_uri( $file ) . "' type='text/css' />\n", $file ); 1115 1138 if ( 'rtl' == get_bloginfo( 'text_direction' ) ) { 1116 1139 $rtl = ( 'wp-admin' == $file ) ? 'rtl' : "$file-rtl"; -
wp-admin/includes/user.php
73 73 else 74 74 $user->rich_editing = 'false'; 75 75 76 if ( !$update ) 77 $user->admin_color = 'classic'; // Default to classic for new users. 78 else if ( isset( $_POST['admin_color'] ) ) 79 $user->admin_color = $_POST['admin_color']; 80 else 81 $user->admin_color = 'classic'; 82 76 83 $errors = new WP_Error(); 77 84 78 85 /* checking that username has been typed */ -
wp-admin/admin-header.php
28 28 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" /> 29 29 <title><?php bloginfo('name') ?> › <?php echo wp_specialchars( strip_tags( $title ) ); ?> — WordPress</title> 30 30 <?php 31 wp_admin_css_color('classic', __('Classic'), get_option( 'siteurl' ) . "/wp-admin/css/colors-classic.css"); 32 wp_admin_css_color('fresh', __('Fresh'), get_option( 'siteurl' ) . "/wp-admin/css/colors-fresh.css"); 31 33 wp_admin_css( 'css/global' ); 32 34 wp_admin_css(); 33 wp_admin_css( 'css/colors -classic' );35 wp_admin_css( 'css/colors' ); 34 36 ?> 35 37 <!--[if gte IE 6]> 36 38 <?php wp_admin_css( 'css/ie' ); -
wp-admin/user-edit.php
146 146 147 147 <h3><?php _e('Personal Options'); ?></h3> 148 148 149 <table class="form-table"> 149 150 <?php if ( rich_edit_exists() ) : // don't bother showing the option if the editor has been removed ?> 150 <table class="form-table">151 151 <tr> 152 <td colspan="2"><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="true" <?php checked('true', $profileuser->rich_editing); ?> /> <?php _e('Use the visual editor when writing'); ?></label></td> 152 <th scope="row"><?php _e('Visual Editor')?></th> 153 <td><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="true" <?php checked('true', $profileuser->rich_editing); ?> /> <?php _e('Use the visual editor when writing'); ?></label></td> 153 154 </tr> 155 <?php endif; ?> 156 <tr> 157 <th scope="row"><?php _e('Admin Color Scheme')?></th> 158 <td> 159 <?php 160 foreach ( $_wp_admin_css_colors as $color => $color_info ): ?> 161 <p><label> 162 <input name="admin_color" type="radio" value="<?php echo $color ?>" class="tog" <?php checked($color, get_user_option('admin_color')); ?> /> 163 <?php echo $color_info->name ?> 164 </label> 165 </p> 166 <?php endforeach; ?> 167 </td> 154 168 </table> 155 <?php endif; ?>156 169 170 157 171 <?php 158 172 if ( $is_profile_page ) { 159 173 do_action('profile_personal_options'); 160 174 } 161 175 ?> 162 176 163 <h3> Name</h3>177 <h3><?php _e('Name') ?></h3> 164 178 165 179 <table class="form-table"> 166 180 <tr> … … 232 246 </tr> 233 247 </table> 234 248 235 <h3> Contact Info</h3>249 <h3><?php _e('Contact Info') ?></h3> 236 250 237 251 <table class="form-table"> 238 252 <tr>