Make WordPress Core


Ignore:
Timestamp:
03/16/2013 04:47:19 AM (12 years ago)
Author:
markjaquith
Message:

Accessibility revamp for nav menus.

props lessbloat. fixes #14045

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/nav-menus.php

    r23707 r23727  
    354354$page_count = wp_count_posts( 'page' );
    355355$one_theme_location_no_menus = ( 1 == count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) ? true : false;
     356
     357$l10n = array(
     358    "oneThemeLocationNoMenus" => ( $one_theme_location_no_menus ) ? 'true' : 'false',
     359    "move" => __( 'Move' ),
     360    "menuFocus" => __( 'Menu item %d of %d' ),
     361    "subMenuFocus" => __( 'Sub item number %d under' ),
     362    "under" => __( 'Under' ),
     363    "outFrom" => __( 'Out from under' )
     364);
     365wp_localize_script( 'nav-menu', 'menus', $l10n );
    356366
    357367// Redirect to add screen if there are no menus and this users has either zero, or more than 1 theme locations
     
    544554                        <div id="post-body-content">
    545555                            <?php if ( ! $add_new_screen ) : ?>
     556                            <h3><?php _e( 'Menu Structure' ); ?></h3>
    546557                            <?php $starter_copy = ( $one_theme_location_no_menus ) ? __( 'Edit your default menu by adding or removing items. Drag each item into the order you prefer. Click Create Menu to save your changes.' ) : __( 'Drag each item into the order you prefer. Click an item to reveal additional configuration options.' ); ?>
    547558                            <div class="drag-instructions post-body-plain" <?php if ( isset( $menu_items ) && 0 == count( $menu_items ) ) { ?>style="display: none;"<?php } ?>>
     
    560571                            <?php endif; ?>
    561572                            <div class="menu-settings" <?php if ( $one_theme_location_no_menus ) { ?>style="display: none;"<?php } ?>>
     573                                <h3><?php _e( 'Menu Settings' ); ?></h3>
    562574                                <?php
    563575                                if ( ! isset( $auto_add ) ) {
     
    613625    </div><!-- /#nav-menus-frame -->
    614626</div><!-- /.wrap-->
    615 <script type="text/javascript">var oneThemeLocationNoMenus = <?php if ( $one_theme_location_no_menus ) echo 'true'; else echo 'false'; ?>;</script>
    616627<?php include( './admin-footer.php' ); ?>
Note: See TracChangeset for help on using the changeset viewer.