Changes in trunk/wp-admin/admin-header.php [18349:19522]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r18349 r19522 10 10 if ( ! defined( 'WP_ADMIN' ) ) 11 11 require_once( './admin.php' ); 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(); 12 20 13 21 get_admin_page_title(); … … 30 38 wp_user_settings(); 31 39 40 _wp_admin_html_begin(); 32 41 ?> 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'); ?>" />37 42 <title><?php echo $admin_title; ?></title> 38 43 <?php 39 44 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' ); 45 wp_enqueue_style( 'colors' ); 46 wp_enqueue_style( 'ie' ); 46 47 wp_enqueue_script('utils'); 47 48 … … 49 50 ?> 50 51 <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 if ( isset($current_screen->post_type) )echo $current_screen->post_type; ?>',60 typenow = '<?php 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 //]]>66 65 </script> 67 66 <?php 68 69 if ( in_array( $pagenow, array('post.php', 'post-new.php') ) ) {70 wp_enqueue_script('quicktags');71 }72 67 73 68 do_action('admin_enqueue_scripts', $hook_suffix); … … 88 83 $admin_body_class .= ' rtl'; 89 84 90 $admin_body_class .= ' branch-' . str_replace( '.', '-', floatval( $wp_version ) );85 $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', floatval( $wp_version ) ); 91 86 $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) ); 92 87 $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); … … 97 92 </head> 98 93 <body class="wp-admin no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>"> 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> 94 <script type="text/javascript">document.body.className = document.body.className.replace('no-js','js');</script> 108 95 109 96 <div id="wpwrap"> 110 97 <?php require(ABSPATH . 'wp-admin/menu-header.php'); ?> 111 98 <div id="wpcontent"> 112 <div id="wphead">113 <?php114 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 else120 $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 99 147 100 <?php 148 149 101 do_action('in_admin_header'); 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 else162 $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 102 ?> 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>195 103 196 104 <div id="wpbody"> … … 198 106 unset($title_class, $blog_name, $total_update_count, $update_title); 199 107 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); 108 $current_screen->set_parentage( $parent_file ); 109 203 110 ?> 204 111 205 112 <div id="wpbody-content"> 206 113 <?php 207 screen_meta($current_screen); 114 115 $current_screen->render_screen_meta(); 208 116 209 117 if ( is_network_admin() )
Note: See TracChangeset
for help on using the changeset viewer.