Changes in trunk/wp-admin/admin-header.php [19522:18349]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r19522 r18349 11 11 require_once( './admin.php' ); 12 12 13 // In case admin-header.php is included in a function.14 global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version, $is_iphone,15 $current_site, $update_title, $total_update_count, $parent_file;16 17 // Catch plugins that include admin-header.php before admin.php completes.18 if ( empty( $current_screen ) )19 set_current_screen();20 21 13 get_admin_page_title(); 22 14 $title = esc_html( strip_tags( $title ) ); … … 38 30 wp_user_settings(); 39 31 40 _wp_admin_html_begin(); 41 ?> 32 ?> 33 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 34 <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>> 35 <head> 36 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" /> 42 37 <title><?php echo $admin_title; ?></title> 43 38 <?php 44 39 45 wp_enqueue_style( 'colors' ); 46 wp_enqueue_style( 'ie' ); 40 wp_admin_css( 'global' ); 41 wp_admin_css(); 42 wp_admin_css( 'colors' ); 43 wp_admin_css( 'ie' ); 44 if ( is_multisite() ) 45 wp_admin_css( 'ms' ); 47 46 wp_enqueue_script('utils'); 48 47 … … 50 49 ?> 51 50 <script type="text/javascript"> 51 //<![CDATA[ 52 52 addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; 53 53 var userSettings = { … … 58 58 ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', 59 59 pagenow = '<?php echo $current_screen->id; ?>', 60 typenow = '<?php echo $current_screen->post_type; ?>',60 typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>', 61 61 adminpage = '<?php echo $admin_body_class; ?>', 62 62 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>', 63 63 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>', 64 64 isRtl = <?php echo (int) is_rtl(); ?>; 65 //]]> 65 66 </script> 66 67 <?php 68 69 if ( in_array( $pagenow, array('post.php', 'post-new.php') ) ) { 70 wp_enqueue_script('quicktags'); 71 } 67 72 68 73 do_action('admin_enqueue_scripts', $hook_suffix); … … 83 88 $admin_body_class .= ' rtl'; 84 89 85 $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) );90 $admin_body_class .= ' branch-' . str_replace( '.', '-', floatval( $wp_version ) ); 86 91 $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) ); 87 92 $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); … … 92 97 </head> 93 98 <body class="wp-admin no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>"> 94 <script type="text/javascript">document.body.className = document.body.className.replace('no-js','js');</script> 99 <script type="text/javascript"> 100 //<![CDATA[ 101 (function(){ 102 var c = document.body.className; 103 c = c.replace(/no-js/, 'js'); 104 document.body.className = c; 105 })(); 106 //]]> 107 </script> 95 108 96 109 <div id="wpwrap"> 97 110 <?php require(ABSPATH . 'wp-admin/menu-header.php'); ?> 98 111 <div id="wpcontent"> 99 100 <?php 112 <div id="wphead"> 113 <?php 114 115 if ( is_network_admin() ) 116 $blog_name = sprintf( __('%s Network Admin'), esc_html($current_site->site_name) ); 117 elseif ( is_user_admin() ) 118 $blog_name = sprintf( __('%s Global Dashboard'), esc_html($current_site->site_name) ); 119 else 120 $blog_name = get_bloginfo('name', 'display'); 121 if ( '' == $blog_name ) { 122 $blog_name = __( 'Visit Site' ); 123 } else { 124 $blog_name_excerpt = wp_html_excerpt($blog_name, 40); 125 if ( $blog_name != $blog_name_excerpt ) 126 $blog_name_excerpt = trim($blog_name_excerpt) . '…'; 127 $blog_name = $blog_name_excerpt; 128 unset($blog_name_excerpt); 129 } 130 $title_class = ''; 131 if ( function_exists('mb_strlen') ) { 132 if ( mb_strlen($blog_name, 'UTF-8') > 30 ) 133 $title_class = 'class="long-title"'; 134 } else { 135 if ( strlen($blog_name) > 30 ) 136 $title_class = 'class="long-title"'; 137 } 138 ?> 139 140 <img id="header-logo" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" alt="" width="16" height="16" /> 141 <h1 id="site-heading" <?php echo $title_class ?>> 142 <a href="<?php echo trailingslashit( get_bloginfo( 'url' ) ); ?>" title="<?php esc_attr_e('Visit Site') ?>"> 143 <span id="site-title"><?php echo $blog_name ?></span> 144 </a> 145 </h1> 146 147 <?php 148 101 149 do_action('in_admin_header'); 102 ?> 150 151 $links = array(); 152 153 // Generate user profile and info links. 154 $links[5] = sprintf( __('Howdy, %1$s'), $user_identity ); 155 156 $links[8] = '<a href="profile.php" title="' . esc_attr__('Edit your profile') . '">' . __('Your Profile') . '</a>'; 157 158 if ( is_multisite() && is_super_admin() ) { 159 if ( !is_network_admin() ) 160 $links[10] = '<a href="' . network_admin_url() . '" title="' . ( ! empty( $update_title ) ? $update_title : esc_attr__('Network Admin') ) . '">' . __('Network Admin') . ( ! empty( $total_update_count ) ? ' (' . number_format_i18n( $total_update_count ) . ')' : '' ) . '</a>'; 161 else 162 $links[10] = '<a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>'; 163 } 164 165 $links[15] = '<a href="' . wp_logout_url() . '" title="' . esc_attr__('Log Out') . '">' . __('Log Out') . '</a>'; 166 167 $links = apply_filters( 'admin_user_info_links', $links, $current_user ); 168 ksort( $links ); 169 170 // Trim whitespace and pipes from links, then convert to list items. 171 $links = array_map( 'trim', $links, array_fill( 0, count( $links ), " |\n\t" ) ); 172 173 $howdy = array_shift( $links ); 174 175 $links_no_js = implode( ' | ', $links ); 176 $links_js = '<li>' . implode( '</li><li>', $links ) . '</li>'; 177 178 ?> 179 180 <div id="wphead-info"> 181 <div id="user_info"> 182 <p class="hide-if-js"><?php echo "$howdy | $links_no_js"; ?></p> 183 184 <div class="hide-if-no-js"> 185 <p><?php echo $howdy; ?></p> 186 <div id="user_info_arrow"></div> 187 <div id="user_info_links_wrap"><div id="user_info_links"> 188 <ul><?php echo $links_js; ?></ul> 189 </div></div> 190 </div> 191 </div> 192 </div> 193 194 </div> 103 195 104 196 <div id="wpbody"> … … 106 198 unset($title_class, $blog_name, $total_update_count, $update_title); 107 199 108 $current_screen->set_parentage( $parent_file ); 109 200 $current_screen->parent_file = $parent_file; 201 $current_screen->parent_base = preg_replace('/\?.*$/', '', $parent_file); 202 $current_screen->parent_base = str_replace('.php', '', $current_screen->parent_base); 110 203 ?> 111 204 112 205 <div id="wpbody-content"> 113 206 <?php 114 115 $current_screen->render_screen_meta(); 207 screen_meta($current_screen); 116 208 117 209 if ( is_network_admin() )
Note: See TracChangeset
for help on using the changeset viewer.