<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[14482] trunk/wp-admin: Ensure valid HTML in the nav menu UI.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14482">14482</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-05-06 19:19:53 +0000 (Thu, 06 May 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Ensure valid HTML in the nav menu UI. props ocean90, see <a href="http://trac.wordpress.org/ticket/13220">#13220</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesnavmenuphp">trunk/wp-admin/includes/nav-menu.php</a></li>
<li><a href="#trunkwpadminnavmenusphp">trunk/wp-admin/nav-menus.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesnavmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/nav-menu.php (14481 => 14482)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/nav-menu.php        2010-05-06 18:33:27 UTC (rev 14481)
+++ trunk/wp-admin/includes/nav-menu.php        2010-05-06 19:19:53 UTC (rev 14482)
</span><span class="lines">@@ -154,12 +154,12 @@
</span><span class="cx">                                 <p class="field-description description description-wide">
</span><span class="cx">                                         <label for="edit-menu-item-description-<?php echo $item_id; ?>">
</span><span class="cx">                                                 <?php _e( 'Description' ); ?><br />
</span><del>-                                                <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>
</del><ins>+                                                <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>
</ins><span class="cx">                                                 <span class="description"><?php _e('The description will be displayed in the menu if the current theme supports it.'); ?></span>
</span><span class="cx">                                         </label>
</span><span class="cx">                                 </p>
</span><span class="cx">
</span><del>-                                <span class="menu-item-actions description-wide submitbox">
</del><ins>+                                <div class="menu-item-actions description-wide submitbox">
</ins><span class="cx">                                         <?php if( 'custom' != $item->type ) : ?>
</span><span class="cx">                                                 <p class="link-to-original"><?php
</span><span class="cx">                                                         _e('Original ');
</span><span class="lines">@@ -182,14 +182,14 @@
</span><span class="cx">                                                 'delete-menu_item_' . $item_id
</span><span class="cx">                                         ); ?>"><?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>
</span><span class="cx">                                         <input class="button-primary save-menu-item" name="save_menu_item" type="submit" value="<?php esc_attr_e('Save Menu Item'); ?>" />
</span><del>-                                </span>
</del><ins>+                                </div>
</ins><span class="cx">
</span><span class="cx">                                 <input class="menu-item-data-append" type="hidden" name="menu-item-append[<?php echo $item_id; ?>]" value="<?php echo $item->append; ?>" />
</span><span class="cx">                                 <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" />
</span><span class="cx">                                 <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 ); ?>" />
</span><span class="cx">                                 <input class="menu-item-data-object" type="hidden" name="menu-item-object[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object ); ?>" />
</span><span class="cx">                                 <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 ); ?>" />
</span><del>-                                <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 ); ?>" />
</del><ins>+                                <input class="menu-item-data-position" type="hidden" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" />
</ins><span class="cx">                                 <input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" />
</span><span class="cx">                         </div><!-- .menu-item-settings-->
</span><span class="cx">                         <ul class="menu-item-transport"></ul>
</span><span class="lines">@@ -566,8 +566,8 @@
</span><span class="cx">         ?>
</span><span class="cx">         <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv">
</span><span class="cx">                 <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs">
</span><del>-                        <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 ( '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>
</del><ins>+                        <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 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>
</ins><span class="cx">                 </ul>
</span><span class="cx">
</span><span class="cx">                 <div class="tabs-panel <?php
</span><span class="lines">@@ -629,13 +629,13 @@
</span><span class="cx">                 <p class="button-controls">
</span><span class="cx">                         <span class="list-controls">
</span><span class="cx">                                 <a href="<?php
</span><del>-                                        echo add_query_arg(
</del><ins>+                                        echo esc_url(add_query_arg(
</ins><span class="cx">                                                 array(
</span><span class="cx">                                                         $post_type_name . '-tab' => 'all',
</span><span class="cx">                                                         'selectall' => 1,
</span><span class="cx">                                                 ),
</span><span class="cx">                                                 remove_query_arg($removed_args)
</span><del>-                                        );
</del><ins>+                                        ));
</ins><span class="cx">                                 ?>#posttype-<?php echo $post_type_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
</span><span class="cx">                         </span>
</span><span class="cx">
</span><span class="lines">@@ -727,9 +727,9 @@
</span><span class="cx">         ?>
</span><span class="cx">         <div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv">
</span><span class="cx">                 <ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
</span><del>-                        <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 ( '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 ( '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>
</del><ins>+                        <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 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 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>
</ins><span class="cx">                 </ul>
</span><span class="cx">
</span><span class="cx">                 <div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php
</span><span class="lines">@@ -797,13 +797,13 @@
</span><span class="cx">                 <p class="button-controls">
</span><span class="cx">                         <span class="list-controls">
</span><span class="cx">                                 <a href="<?php
</span><del>-                                        echo add_query_arg(
</del><ins>+                                        echo esc_url(add_query_arg(
</ins><span class="cx">                                                 array(
</span><span class="cx">                                                         $taxonomy_name . '-tab' => 'all',
</span><span class="cx">                                                         'selectall' => 1,
</span><span class="cx">                                                 ),
</span><span class="cx">                                                 remove_query_arg($removed_args)
</span><del>-                                        );
</del><ins>+                                        ));
</ins><span class="cx">                                 ?>#taxonomy-<?php echo $taxonomy_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
</span><span class="cx">                         </span>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminnavmenusphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/nav-menus.php (14481 => 14482)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/nav-menus.php        2010-05-06 18:33:27 UTC (rev 14481)
+++ trunk/wp-admin/nav-menus.php        2010-05-06 19:19:53 UTC (rev 14482)
</span><span class="lines">@@ -421,9 +421,9 @@
</span><span class="cx">         <div id="menu-management-liquid">
</span><span class="cx">                 <div id="menu-management">
</span><span class="cx">                         <div id="select-nav-menu-container" class="hide-if-js">
</span><del>-                                <form id="select-nav-menu">
</del><ins>+                                <form id="select-nav-menu" action="">
</ins><span class="cx">                                         <strong><label for="select-nav-menu"><?php esc_html_e( 'Select Menu: ' ); ?></label></strong>
</span><del>-                                        <select id="select-nav-menu" name="menu">
</del><ins>+                                        <select class="select-nav-menu" name="menu">
</ins><span class="cx">                                                 <?php foreach( (array) $nav_menus as $_nav_menu ) : ?>
</span><span class="cx">                                                         <option value="<?php echo esc_attr($_nav_menu->term_id) ?>" <?php selected($nav_menu_selected_id, $_nav_menu->term_id); ?>>
</span><span class="cx">                                                                 <?php echo esc_html( $_nav_menu->truncated_name ); ?>
</span><span class="lines">@@ -441,13 +441,13 @@
</span><span class="cx">                                 foreach( (array) $nav_menus as $_nav_menu ) :
</span><span class="cx">
</span><span class="cx">                                         ?><a href="<?php
</span><del>-                                                echo add_query_arg(
</del><ins>+                                                echo esc_url(add_query_arg(
</ins><span class="cx">                                                         array(
</span><span class="cx">                                                                 'action' => 'edit',
</span><span class="cx">                                                                 'menu' => $_nav_menu->term_id,
</span><span class="cx">                                                         ),
</span><span class="cx">                                                         admin_url( 'nav-menus.php' )
</span><del>-                                                );
</del><ins>+                                                ));
</ins><span class="cx">                                         ?>" class="nav-tab<?php
</span><span class="cx">                                                 if ( $nav_menu_selected_id == $_nav_menu->term_id )
</span><span class="cx">                                                         echo ' nav-tab-active';
</span><span class="lines">@@ -456,13 +456,13 @@
</span><span class="cx">                                         ?>"><?php echo esc_html( $_nav_menu->truncated_name ); ?></a><?php
</span><span class="cx">                                 endforeach;
</span><span class="cx">                                 ?><a href="<?php
</span><del>-                                        echo add_query_arg(
</del><ins>+                                        echo esc_url(add_query_arg(
</ins><span class="cx">                                                 array(
</span><span class="cx">                                                         'action' => 'edit',
</span><span class="cx">                                                         'menu' => 0,
</span><span class="cx">                                                 ),
</span><span class="cx">                                                 admin_url( 'nav-menus.php' )
</span><del>-                                        );
</del><ins>+                                        ));
</ins><span class="cx">                                 ?>" class="nav-tab menu-add-new<?php
</span><span class="cx">                                         if ( 0 == $nav_menu_selected_id )
</span><span class="cx">                                                 echo ' nav-tab-active';
</span><span class="lines">@@ -476,7 +476,7 @@
</span><span class="cx">                                                         <div class="major-publishing-actions">
</span><span class="cx">                                                                 <label class="menu-name-label howto open-label" for="menu-name">
</span><span class="cx">                                                                         <span><?php _e('Menu Name'); ?></span>
</span><del>-                                                                        <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 ); ?>" />
</del><ins>+                                                                        <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 ); ?>" />
</ins><span class="cx">                                                                         <br class="clear" />
</span><span class="cx">                                                                 </label>
</span><span class="cx">
</span><span class="lines">@@ -486,7 +486,7 @@
</span><span class="cx">
</span><span class="cx">                                                                 <?php if ( ! empty( $nav_menu_selected_id ) ) : ?>
</span><span class="cx">                                                                 <div class="delete-action">
</span><del>-                                                                        <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>
</del><ins>+                                                                        <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>
</ins><span class="cx">                                                                 </div><!--END .delete-action-->
</span><span class="cx">                                                                 <?php endif; ?>
</span><span class="cx">                                                                 <br class="clear" />
</span></span></pre>
</div>
</div>
</body>
</html>