<!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>[13355] trunk/wp-admin/custom-navigation.php:
move menu selection to a top nav links, See #11817</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13355">13355</a></dd>
<dt>Author</dt> <dd>wpmuguru</dd>
<dt>Date</dt> <dd>2010-02-24 01:44:16 +0000 (Wed, 24 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>move menu selection to a top nav links, See <a href="http://trac.wordpress.org/ticket/11817">#11817</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincustomnavigationphp">trunk/wp-admin/custom-navigation.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincustomnavigationphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/custom-navigation.php (13354 => 13355)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/custom-navigation.php        2010-02-24 00:37:15 UTC (rev 13354)
+++ trunk/wp-admin/custom-navigation.php        2010-02-24 01:44:16 UTC (rev 13355)
</span><span class="lines">@@ -40,11 +40,11 @@
</span><span class="cx"> $updated = false;
</span><span class="cx">
</span><span class="cx"> // Check which menu is selected and if menu is in edit already
</span><del>-if ( isset( $_POST['switch_menu'] ) ) {
-        $menu_selected_id = (int) $_POST['menu_select'];
</del><ins>+if ( isset( $_GET['edit_menu'] ) ) {
+        $menu_selected_id = (int) $_GET['edit_menu'];
</ins><span class="cx">         $updated = true;
</span><del>-} elseif ( isset( $_POST['menu_id_in_edit'] ) ) {
-        $menu_selected_id = (int) $_POST['menu_id_in_edit'];
</del><ins>+} elseif ( isset( $_POST[ 'menu_id_in_edit' ] ) ) {
+        $menu_selected_id = (int) $_POST[ 'menu_id_in_edit' ];
</ins><span class="cx"> } else {
</span><span class="cx">         $menu_selected_id = 0;
</span><span class="cx"> }
</span><span class="lines">@@ -173,6 +173,21 @@
</span><span class="cx">
</span><span class="cx">         <div id="no-js"><h3><?php _e('You do not have JavaScript enabled in your browser. Please enable it to access the Menus functionality.'); ?></h3></div>
</span><span class="cx">         <div id="pages-left">
</span><ins>+                <ul class="subsubsub">
+<?php                        if ( ! empty( $custom_menus ) ) {
+                                foreach ( $custom_menus as $menu ) {
+                                        $menu_term = get_term( $menu, 'nav_menu' );
+                                        if ( ( $menu_id_in_edit == $menu->term_id ) || ( $menu_selected_id == $menu->term_id ) ) { ?>
+                        <li><?php echo esc_html( $menu_term->name ); ?> |</li>
+<?php                                        } else { ?>
+                        <li><a href='custom-navigation.php?edit_menu=<?php echo esc_attr($menu_term->term_id); ?>'><?php echo esc_html( $menu_term->name ); ?></a> |</li>
+<?php                                        }
+                                }
+                        } else { ?>
+                        <li><?php _e( 'Default' ); ?></li>
+<?php                        } ?>
+                </ul>
+                <div class="clear"></div>
</ins><span class="cx">                 <div class="inside">
</span><span class="cx">                 <?php
</span><span class="cx">                         // CHECK if custom menu has been enabled
</span><span class="lines">@@ -249,38 +264,11 @@
</span><span class="cx">                                         <label><?php _e('Reset Menu to Default'); ?></label>
</span><span class="cx">                                         <input id="reset_wp_menu" type="submit" value="Reset" name="reset_wp_menu" class="button" onclick="return confirm('<?php _e('Are you sure you want to reset the menu to its default settings?'); ?>');" />
</span><span class="cx">                                 </span>
</span><del>-
-                                <div class="fix"></div>
-                        </div>
-                </div><!-- /.widgets-holder-wrap -->
-
-                <div class="widgets-holder-wrap">
-                        <div class="sidebar-name">
-                                <div class="sidebar-name-arrow"></div>
-                                <h3><?php esc_html_e('Menu Selector'); ?></h3>
-                        </div>
-                        <div class="widget-holder">
-                                <select id="menu_select" name="menu_select">
-                                        <?php
-                                        // Display select options
-                                        foreach ( $custom_menus as $menu ) {
-                                                $menu_term = get_term( $menu, 'nav_menu' );
-                                                if ( ( $menu_id_in_edit == $menu->term_id ) || ( $menu_selected_id == $menu->term_id ) )
-                                                        $selected_option = 'selected="selected"';
-                                                else
-                                                        $selected_option = '';
-                                                ?>
-                                                <option value="<?php echo esc_attr($menu_term->term_id); ?>" <?php echo $selected_option; ?>><?php echo $menu_term->name; ?></option>
-                                                <?php
-                                        }
-                                        ?>
-                                </select>
-
-                                <input id="switch_menu" type="submit" value="<?php esc_attr_e('Switch'); ?>" name="switch_menu" class="button" />
</del><ins>+                                <br /><br />
+                                <span>
</ins><span class="cx">                                 <input id="add_menu_name" name="add_menu_name" type="text" value="" />
</span><span class="cx">                                 <input id="add_menu" type="submit" value="<?php esc_attr_e('Add Menu'); ?>" name="add_menu" class="button" />
</span><del>-
-                                <div class="fix"></div>
</del><ins>+                                </span>
</ins><span class="cx">                         </div>
</span><span class="cx">                 </div><!-- /.widgets-holder-wrap -->
</span><span class="cx">                 <?php $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options'); ?>
</span></span></pre>
</div>
</div>
</body>
</html>