Make WordPress Core


Ignore:
Timestamp:
09/16/2011 05:01:54 AM (14 years ago)
Author:
koopersmith
Message:

Admin bar UX improvements. First pass, see #18197

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r18675 r18683  
    6363    decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
    6464    isRtl = <?php echo (int) is_rtl(); ?>;
    65    
     65
    6666    function wp_set_width_class() {
    6767        var w = document.body.clientWidth, bc = document.body.className;
     
    119119<?php require(ABSPATH . 'wp-admin/menu-header.php'); ?>
    120120<div id="wpcontent">
    121 <div id="wphead">
    122 <?php
    123 
    124 if ( is_network_admin() )
    125     $blog_name = sprintf( __('Network Admin: %s'), esc_html($current_site->site_name) );
    126 elseif ( is_user_admin() )
    127     $blog_name = sprintf( __('Global Dashboard: %s'), esc_html($current_site->site_name) );
    128 else
    129     $blog_name = get_bloginfo('name', 'display');
    130 if ( '' == $blog_name ) {
    131     $blog_name = __( 'Visit Site' );
    132 } else {
    133     $blog_name_excerpt = wp_html_excerpt($blog_name, 40);
    134     if ( $blog_name != $blog_name_excerpt )
    135         $blog_name_excerpt = trim($blog_name_excerpt) . '&hellip;';
    136     $blog_name = $blog_name_excerpt;
    137     unset($blog_name_excerpt);
    138 }
    139 $title_class = '';
    140 if ( function_exists('mb_strlen') ) {
    141     if ( mb_strlen($blog_name, 'UTF-8') > 30 )
    142         $title_class = 'class="long-title"';
    143 } else {
    144     if ( strlen($blog_name) > 30 )
    145         $title_class = 'class="long-title"';
    146 }
    147 ?>
    148 
    149 <img id="header-logo" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" alt="" width="16" height="16" />
    150 <h1 id="site-heading" <?php echo $title_class ?>>
    151     <a href="<?php echo trailingslashit( get_bloginfo( 'url' ) ); ?>" title="<?php esc_attr_e('Visit Site') ?>">
    152         <span id="site-title"><?php echo $blog_name ?></span>
    153     </a>
    154 </h1>
    155121
    156122<?php
    157 
    158123do_action('in_admin_header');
    159 
    160 $links = array();
    161 
    162 // Generate user profile and info links.
    163 $links[5] = sprintf( __('Howdy, %1$s'), $user_identity );
    164 
    165 $links[8] = '<a href="profile.php" title="' . esc_attr__('Edit your profile') . '">' . __('Your Profile') . '</a>';
    166 
    167 if ( is_multisite() && is_super_admin() ) {
    168     if ( !is_network_admin() )
    169         $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>';
    170     else
    171         $links[10] = '<a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>';
    172 }
    173 
    174 $links[15] = '<a href="' . wp_logout_url() . '" title="' . esc_attr__('Log Out') . '">' . __('Log Out') . '</a>';
    175 
    176 $links = apply_filters( 'admin_user_info_links', $links, $current_user );
    177 ksort( $links );
    178 
    179 // Trim whitespace and pipes from links, then convert to list items.
    180 $links = array_map( 'trim', $links, array_fill( 0, count( $links ), " |\n\t" ) );
    181 
    182 $howdy = array_shift( $links );
    183 
    184 $links_no_js = implode( ' | ', $links );
    185 $links_js = '<li>' . implode( '</li><li>', $links ) . '</li>';
    186 
    187124?>
    188 
    189 <div id="wphead-info">
    190 <div id="user_info">
    191     <p class="hide-if-js"><?php echo "$howdy | $links_no_js"; ?></p>
    192 
    193     <div class="hide-if-no-js">
    194         <p><?php echo $howdy; ?></p>
    195         <div id="user_info_arrow"></div>
    196         <div id="user_info_links_wrap"><div id="user_info_links">
    197             <ul><?php echo $links_js; ?></ul>
    198         </div></div>
    199     </div>
    200 </div>
    201 </div>
    202 
    203 </div>
    204125
    205126<div id="wpbody">
Note: See TracChangeset for help on using the changeset viewer.