Ensure valid HTML in the nav menu UI. props ocean90, see #13220.

git-svn-id: https://develop.svn.wordpress.org/trunk@14482 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-05-06 19:19:53 +00:00
parent 86801ae5fe
commit 368521cd69
2 changed files with 21 additions and 21 deletions

View File

@ -154,12 +154,12 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
<p class="field-description description description-wide"> <p class="field-description description description-wide">
<label for="edit-menu-item-description-<?php echo $item_id; ?>"> <label for="edit-menu-item-description-<?php echo $item_id; ?>">
<?php _e( 'Description' ); ?><br /> <?php _e( 'Description' ); ?><br />
<textarea id="edit-menu-item-description-<?php echo $item_id; ?>" class="widefat edit-menu-item-description" rows="3" name="menu-item-description[<?php echo $item_id; ?>]"><?php echo esc_html( $item->description ); ?></textarea> <textarea id="edit-menu-item-description-<?php echo $item_id; ?>" class="widefat edit-menu-item-description" rows="3" cols="20" name="menu-item-description[<?php echo $item_id; ?>]"><?php echo esc_html( $item->description ); ?></textarea>
<span class="description"><?php _e('The description will be displayed in the menu if the current theme supports it.'); ?></span> <span class="description"><?php _e('The description will be displayed in the menu if the current theme supports it.'); ?></span>
</label> </label>
</p> </p>
<span class="menu-item-actions description-wide submitbox"> <div class="menu-item-actions description-wide submitbox">
<?php if( 'custom' != $item->type ) : ?> <?php if( 'custom' != $item->type ) : ?>
<p class="link-to-original"><?php <p class="link-to-original"><?php
_e('Original '); _e('Original ');
@ -182,14 +182,14 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
'delete-menu_item_' . $item_id 'delete-menu_item_' . $item_id
); ?>"><?php _e('Remove'); ?></a> | <a class="item-close submitclose" id="close-<?php echo $item_id; ?>" href="<?php echo admin_url( 'nav-menus.php' ); ?>"><?php _e('Close'); ?></a> ); ?>"><?php _e('Remove'); ?></a> | <a class="item-close submitclose" id="close-<?php echo $item_id; ?>" href="<?php echo admin_url( 'nav-menus.php' ); ?>"><?php _e('Close'); ?></a>
<input class="button-primary save-menu-item" name="save_menu_item" type="submit" value="<?php esc_attr_e('Save Menu Item'); ?>" /> <input class="button-primary save-menu-item" name="save_menu_item" type="submit" value="<?php esc_attr_e('Save Menu Item'); ?>" />
</span> </div>
<input class="menu-item-data-append" type="hidden" name="menu-item-append[<?php echo $item_id; ?>]" value="<?php echo $item->append; ?>" /> <input class="menu-item-data-append" type="hidden" name="menu-item-append[<?php echo $item_id; ?>]" value="<?php echo $item->append; ?>" />
<input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" /> <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" />
<input class="menu-item-data-object-id" type="hidden" name="menu-item-object-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object_id ); ?>" /> <input class="menu-item-data-object-id" type="hidden" name="menu-item-object-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object_id ); ?>" />
<input class="menu-item-data-object" type="hidden" name="menu-item-object[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object ); ?>" /> <input class="menu-item-data-object" type="hidden" name="menu-item-object[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object ); ?>" />
<input class="menu-item-data-parent-id" type="hidden" name="menu-item-parent-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_item_parent ); ?>" /> <input class="menu-item-data-parent-id" type="hidden" name="menu-item-parent-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_item_parent ); ?>" />
<input class="menu-item-data-position" type="hidden" class="menu-item-position" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" /> <input class="menu-item-data-position" type="hidden" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" />
<input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" /> <input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" />
</div><!-- .menu-item-settings--> </div><!-- .menu-item-settings-->
<ul class="menu-item-transport"></ul> <ul class="menu-item-transport"></ul>
@ -566,8 +566,8 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
?> ?>
<div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv"> <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv">
<ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs"> <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs">
<li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args)); ?>#<?php echo $post_type_name; ?>-all"><?php _e('View All'); ?></a></li> <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo esc_url(add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#<?php echo $post_type_name; ?>-all"><?php _e('View All'); ?></a></li>
<li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args)); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search"><?php _e('Search'); ?></a></li> <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo esc_url(add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search"><?php _e('Search'); ?></a></li>
</ul> </ul>
<div class="tabs-panel <?php <div class="tabs-panel <?php
@ -629,13 +629,13 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
<p class="button-controls"> <p class="button-controls">
<span class="list-controls"> <span class="list-controls">
<a href="<?php <a href="<?php
echo add_query_arg( echo esc_url(add_query_arg(
array( array(
$post_type_name . '-tab' => 'all', $post_type_name . '-tab' => 'all',
'selectall' => 1, 'selectall' => 1,
), ),
remove_query_arg($removed_args) remove_query_arg($removed_args)
); ));
?>#posttype-<?php echo $post_type_name; ?>" class="select-all"><?php _e('Select All'); ?></a> ?>#posttype-<?php echo $post_type_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
</span> </span>
@ -727,9 +727,9 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
?> ?>
<div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv"> <div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv">
<ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs"> <ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
<li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args)); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop"><?php _e('Most Used'); ?></a></li> <li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo esc_url(add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop"><?php _e('Most Used'); ?></a></li>
<li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args)); ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>"><?php _e('Search'); ?></a></li> <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo esc_url(add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>"><?php _e('Search'); ?></a></li>
<li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args)); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all"><?php _e('View All'); ?></a></li> <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo esc_url(add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all"><?php _e('View All'); ?></a></li>
</ul> </ul>
<div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php <div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php
@ -797,13 +797,13 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
<p class="button-controls"> <p class="button-controls">
<span class="list-controls"> <span class="list-controls">
<a href="<?php <a href="<?php
echo add_query_arg( echo esc_url(add_query_arg(
array( array(
$taxonomy_name . '-tab' => 'all', $taxonomy_name . '-tab' => 'all',
'selectall' => 1, 'selectall' => 1,
), ),
remove_query_arg($removed_args) remove_query_arg($removed_args)
); ));
?>#taxonomy-<?php echo $taxonomy_name; ?>" class="select-all"><?php _e('Select All'); ?></a> ?>#taxonomy-<?php echo $taxonomy_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
</span> </span>

View File

@ -421,9 +421,9 @@ require_once( 'admin-header.php' );
<div id="menu-management-liquid"> <div id="menu-management-liquid">
<div id="menu-management"> <div id="menu-management">
<div id="select-nav-menu-container" class="hide-if-js"> <div id="select-nav-menu-container" class="hide-if-js">
<form id="select-nav-menu"> <form id="select-nav-menu" action="">
<strong><label for="select-nav-menu"><?php esc_html_e( 'Select Menu: ' ); ?></label></strong> <strong><label for="select-nav-menu"><?php esc_html_e( 'Select Menu: ' ); ?></label></strong>
<select id="select-nav-menu" name="menu"> <select class="select-nav-menu" name="menu">
<?php foreach( (array) $nav_menus as $_nav_menu ) : ?> <?php foreach( (array) $nav_menus as $_nav_menu ) : ?>
<option value="<?php echo esc_attr($_nav_menu->term_id) ?>" <?php selected($nav_menu_selected_id, $_nav_menu->term_id); ?>> <option value="<?php echo esc_attr($_nav_menu->term_id) ?>" <?php selected($nav_menu_selected_id, $_nav_menu->term_id); ?>>
<?php echo esc_html( $_nav_menu->truncated_name ); ?> <?php echo esc_html( $_nav_menu->truncated_name ); ?>
@ -441,13 +441,13 @@ require_once( 'admin-header.php' );
foreach( (array) $nav_menus as $_nav_menu ) : foreach( (array) $nav_menus as $_nav_menu ) :
?><a href="<?php ?><a href="<?php
echo add_query_arg( echo esc_url(add_query_arg(
array( array(
'action' => 'edit', 'action' => 'edit',
'menu' => $_nav_menu->term_id, 'menu' => $_nav_menu->term_id,
), ),
admin_url( 'nav-menus.php' ) admin_url( 'nav-menus.php' )
); ));
?>" class="nav-tab<?php ?>" class="nav-tab<?php
if ( $nav_menu_selected_id == $_nav_menu->term_id ) if ( $nav_menu_selected_id == $_nav_menu->term_id )
echo ' nav-tab-active'; echo ' nav-tab-active';
@ -456,13 +456,13 @@ require_once( 'admin-header.php' );
?>"><?php echo esc_html( $_nav_menu->truncated_name ); ?></a><?php ?>"><?php echo esc_html( $_nav_menu->truncated_name ); ?></a><?php
endforeach; endforeach;
?><a href="<?php ?><a href="<?php
echo add_query_arg( echo esc_url(add_query_arg(
array( array(
'action' => 'edit', 'action' => 'edit',
'menu' => 0, 'menu' => 0,
), ),
admin_url( 'nav-menus.php' ) admin_url( 'nav-menus.php' )
); ));
?>" class="nav-tab menu-add-new<?php ?>" class="nav-tab menu-add-new<?php
if ( 0 == $nav_menu_selected_id ) if ( 0 == $nav_menu_selected_id )
echo ' nav-tab-active'; echo ' nav-tab-active';
@ -476,7 +476,7 @@ require_once( 'admin-header.php' );
<div class="major-publishing-actions"> <div class="major-publishing-actions">
<label class="menu-name-label howto open-label" for="menu-name"> <label class="menu-name-label howto open-label" for="menu-name">
<span><?php _e('Menu Name'); ?></span> <span><?php _e('Menu Name'); ?></span>
<input name="menu-name" type="text" class="menu-name regular-text menu-item-textbox input-with-default-title" title="Enter menu name here." value="<?php echo esc_attr( $nav_menu_selected_title ); ?>" /> <input name="menu-name" id="menu-name" type="text" class="menu-name regular-text menu-item-textbox input-with-default-title" title="Enter menu name here." value="<?php echo esc_attr( $nav_menu_selected_title ); ?>" />
<br class="clear" /> <br class="clear" />
</label> </label>
@ -486,7 +486,7 @@ require_once( 'admin-header.php' );
<?php if ( ! empty( $nav_menu_selected_id ) ) : ?> <?php if ( ! empty( $nav_menu_selected_id ) ) : ?>
<div class="delete-action"> <div class="delete-action">
<a class="submitdelete deletion menu-delete" href="<?php echo wp_nonce_url( admin_url('nav-menus.php?action=delete&amp;menu=' . $nav_menu_selected_id), 'delete-nav_menu-' . $nav_menu_selected_id ); ?>"><?php _e('Delete Menu'); ?></a> <a class="submitdelete deletion menu-delete" href="<?php echo esc_url( wp_nonce_url( admin_url('nav-menus.php?action=delete&amp;menu=' . $nav_menu_selected_id), 'delete-nav_menu-' . $nav_menu_selected_id ) ); ?>"><?php _e('Delete Menu'); ?></a>
</div><!--END .delete-action--> </div><!--END .delete-action-->
<?php endif; ?> <?php endif; ?>
<br class="clear" /> <br class="clear" />