<!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>[13369] trunk/wp-admin: Remove Resetting, remove Enabling, enable deletion,
  etc.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13369">13369</a></dd>
<dt>Author</dt> <dd>markjaquith</dd>
<dt>Date</dt> <dd>2010-02-24 09:43:09 +0000 (Wed, 24 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove Resetting, remove Enabling, enable deletion, etc. see <a href="http://trac.wordpress.org/ticket/11817">#11817</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 (13368 => 13369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/nav-menu.php        2010-02-24 08:45:26 UTC (rev 13368)
+++ trunk/wp-admin/includes/nav-menu.php        2010-02-24 09:43:09 UTC (rev 13369)
</span><span class="lines">@@ -216,7 +216,7 @@
</span><span class="cx"> 
</span><span class="cx">         return $counter;
</span><span class="cx"> }
</span><del>-
</del><ins>+/*
</ins><span class="cx"> function wp_nav_menu_setup($override = false) {
</span><span class="cx">         // Custom Navigation Menu Setup
</span><span class="cx"> 
</span><span class="lines">@@ -232,5 +232,5 @@
</span><span class="cx"> 
</span><span class="cx">         wp_create_nav_menu( __('Main') );
</span><span class="cx"> }
</span><del>-
</del><ins>+/**/
</ins><span class="cx"> ?&gt;
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminnavmenusphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/nav-menus.php (13368 => 13369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/nav-menus.php        2010-02-24 08:45:26 UTC (rev 13368)
+++ trunk/wp-admin/nav-menus.php        2010-02-24 09:43:09 UTC (rev 13369)
</span><span class="lines">@@ -70,13 +70,6 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if ( isset( $_POST['set_wp_menu'] ) ) {
-        // @todo validate set_wp_menu
-        update_option( 'wp_custom_nav_menu', $_POST['enable_wp_menu'] );
-        $updated = true;
-        $messagesdiv = '&lt;div id=&quot;message&quot; class=&quot;updated fade below-h2&quot;&gt;&lt;p&gt;' . __('Menu has been updated!') . '&lt;/p&gt;&lt;/div&gt;';
-}
-
</del><span class="cx"> if ( isset( $_POST['licount'] ) )
</span><span class="cx">         $postCounter = $_POST['licount'];
</span><span class="cx"> else
</span><span class="lines">@@ -84,6 +77,7 @@
</span><span class="cx"> 
</span><span class="cx"> // Create a new menu. Menus are stored as terms in the 'menu' taxonomy.
</span><span class="cx"> if ( isset( $_POST['add_menu'] ) &amp;&amp; ! $updated ) {
</span><ins>+        update_option( 'wp_custom_nav_menu', $_POST['enable_wp_menu'] ); // Do we need this?
</ins><span class="cx">         $insert_menu_name = $_POST['add_menu_name'];
</span><span class="cx"> 
</span><span class="cx">         if ( $insert_menu_name != '' ) {
</span><span class="lines">@@ -94,6 +88,7 @@
</span><span class="cx">                         $custom_menus[$menu-&gt;term_id] = $menu;
</span><span class="cx">                         $menu_selected_id = $menu-&gt;term_id;
</span><span class="cx">                         $menu_id_in_edit = $menu_selected_id;
</span><ins>+                        $menu_title = $menu-&gt;name;
</ins><span class="cx">                         $messagesdiv = '&lt;div id=&quot;message&quot; class=&quot;updated fade below-h2&quot;&gt;&lt;p&gt;' . esc_html( sprintf( __('&quot;%s&quot; menu has been created!'), $menu-&gt;name ) ) . '&lt;/p&gt;&lt;/div&gt;';
</span><span class="cx">                         $postCounter = 0;
</span><span class="cx">                 }
</span><span class="lines">@@ -103,19 +98,7 @@
</span><span class="cx">         $updated = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if ( isset($_POST['reset_wp_menu']) &amp;&amp; ! $updated ) {
-        $success = wp_reset_nav_menu();
-        if ( $success ) {
-                // DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly
-                $messagesdiv = '&lt;div id=&quot;message&quot; class=&quot;updated fade below-h2&quot;&gt;&lt;p&gt;' . __('The menu has been reset.') . '&lt;/p&gt;&lt;/div&gt;';
-                // GET reset menu id
-                $custom_menus = array();
-                $menu_selected_id = 0;
-        } else {
-                // DISPLAY SUCCESS MESSAGE IF Menu Reset Correctly
-                $messagesdiv = '&lt;div id=&quot;message&quot; class=&quot;error fade below-h2&quot;&gt;&lt;p&gt;' . __('The menu could not be reset. Please try again.') . '&lt;/p&gt;&lt;/div&gt;';
-        }
-} elseif ( $postCounter &gt; 0 &amp;&amp; $menu_selected_id &gt; 0 &amp;&amp; ! $updated ) {
</del><ins>+if ( $postCounter &gt; 0 &amp;&amp; $menu_selected_id &gt; 0 &amp;&amp; ! $updated ) {
</ins><span class="cx">         $menu_items = wp_get_nav_menu_items( $menu_selected_id, array('orderby' =&gt; 'ID', 'output' =&gt; ARRAY_A, 'output_key' =&gt; 'ID') );
</span><span class="cx">         $parent_menu_ids = array();
</span><span class="cx"> 
</span><span class="lines">@@ -174,8 +157,9 @@
</span><span class="cx">         &lt;div class=&quot;hide-if-js error&quot;&gt;&lt;p&gt;&lt;?php _e('You do not have JavaScript enabled in your browser. Please enable it to access the Menus functionality.'); ?&gt;&lt;/p&gt;&lt;/div&gt;
</span><span class="cx">         &lt;div class=&quot;hide-if-no-js&quot;&gt;
</span><span class="cx">         &lt;div id=&quot;pages-left&quot;&gt;
</span><ins>+        &lt;?php if ( ! empty( $custom_menus ) &amp;&amp; count( $custom_menus ) &gt; 1 ) { ?&gt;
</ins><span class="cx">                 &lt;ul class=&quot;subsubsub&quot;&gt;
</span><del>-&lt;?php                if ( ! empty( $custom_menus ) ) {
</del><ins>+&lt;?php
</ins><span class="cx">                                 foreach ( $custom_menus as $menu ) {
</span><span class="cx">                                         $sep = end($custom_menus) == $menu ? '' : ' | ';
</span><span class="cx">                                         // $menu_term = get_term( $menu, 'nav_menu' );
</span><span class="lines">@@ -185,28 +169,19 @@
</span><span class="cx">                         &lt;li&gt;&lt;a href='nav-menus.php?edit_menu=&lt;?php echo esc_attr($menu-&gt;term_id); ?&gt;'&gt;&lt;?php echo esc_html( $menu-&gt;name ); ?&gt;&lt;/a&gt;&lt;?php echo $sep; ?&gt;&lt;/li&gt;
</span><span class="cx"> &lt;?php                                }
</span><span class="cx">                                 }
</span><del>-                        } else { ?&gt;
-                        &lt;li&gt;&lt;?php _e( 'Default' ); ?&gt;&lt;/li&gt;
-&lt;?php                } ?&gt;
</del><ins>+?&gt;
</ins><span class="cx">                 &lt;/ul&gt;
</span><span class="cx">                 &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
</span><ins>+&lt;?php } ?&gt;
+                &lt;form onsubmit=&quot;updatepostdata()&quot; action=&quot;nav-menus.php&quot; method=&quot;post&quot;  enctype=&quot;multipart/form-data&quot;&gt;
</ins><span class="cx">                 &lt;div class=&quot;inside&quot;&gt;
</span><del>-                &lt;?php
-                        // CHECK if custom menu has been enabled
-                        $enabled_menu = get_option('wp_custom_nav_menu');
-                        $checked = strtolower($enabled_menu);
-
-                        if ( $checked != 'true' )
-                                echo '&lt;div id=&quot;message-enabled&quot; class=&quot;error fade below-h2&quot;&gt;&lt;p&gt;&lt;strong&gt;' . __('Menu editing has not been Enabled yet. Please enable it in order to use it --------&gt;') . '&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;';
-                ?&gt;
</del><ins>+                &lt;?php if ( ! empty( $custom_menus ) ) : ?&gt;
</ins><span class="cx">                 &lt;?php echo $messagesdiv; ?&gt;
</span><del>-                &lt;form onsubmit=&quot;updatepostdata()&quot; action=&quot;nav-menus.php&quot; method=&quot;post&quot;  enctype=&quot;multipart/form-data&quot;&gt;
</del><span class="cx"> 
</span><span class="cx">                 &lt;input type=&quot;hidden&quot; name=&quot;licount&quot; id=&quot;licount&quot; value=&quot;0&quot; /&gt;
</span><span class="cx">                 &lt;input type=&quot;hidden&quot; name=&quot;menu_id_in_edit&quot; id=&quot;menu_id_in_edit&quot; value=&quot;&lt;?php echo esc_attr($menu_selected_id); ?&gt;&quot; /&gt;
</span><span class="cx"> 
</span><span class="cx">                 &lt;div class=&quot;sidebar-name&quot;&gt;
</span><del>-
</del><span class="cx">                         &lt;div class=&quot;sidebar-name-arrow&quot;&gt;
</span><span class="cx">                                 &lt;br/&gt;
</span><span class="cx">                         &lt;/div&gt;
</span><span class="lines">@@ -235,8 +210,13 @@
</span><span class="cx">                 &lt;script type=&quot;text/javascript&quot;&gt;
</span><span class="cx">                         updatepostdata();
</span><span class="cx">                 &lt;/script&gt;
</span><del>-                &lt;!-- &lt;input id=&quot;delete_menu&quot; name=&quot;delete_menu&quot; type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Delete This Menu'); ?&gt;&quot; /&gt; --&gt;
-                &lt;input id=&quot;save_bottom&quot; name=&quot;save_bottom&quot; type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Save All Changes'); ?&gt;&quot; /&gt;&lt;/p&gt;
</del><ins>+                &lt;input id=&quot;save_bottom&quot; name=&quot;save_bottom&quot; type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Save All Changes'); ?&gt;&quot; /&gt;
+                &lt;input id=&quot;delete_menu&quot; name=&quot;delete_menu&quot; type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Delete This Menu'); ?&gt;&quot; /&gt;
+                &lt;/p&gt;
+
+        &lt;?php else : ?&gt;
+                &lt;div class=&quot;updated below-h2&quot;&gt;&lt;p&gt;&lt;?php _e( 'Add a menu to start editing!' ); ?&gt;&lt;/p&gt;&lt;/div&gt;
+        &lt;?php endif; ?&gt;
</ins><span class="cx">                 &lt;/div&gt;&lt;!-- /.inside --&gt;
</span><span class="cx">         &lt;/div&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -244,34 +224,17 @@
</span><span class="cx">                 &lt;div class=&quot;widgets-holder-wrap&quot;&gt;
</span><span class="cx">                         &lt;div class=&quot;sidebar-name&quot;&gt;
</span><span class="cx">                                 &lt;div class=&quot;sidebar-name-arrow&quot;&gt;&lt;/div&gt;
</span><del>-                                &lt;h3&gt;&lt;?php esc_html_e('Setup Menus'); ?&gt;&lt;/h3&gt;
</del><ins>+                                &lt;h3&gt;&lt;?php esc_html_e('Add Menu'); ?&gt;&lt;/h3&gt;
</ins><span class="cx">                         &lt;/div&gt;
</span><span class="cx">                         &lt;div class=&quot;widget-holder&quot;&gt;
</span><span class="cx"> 
</span><del>-                                &lt;?php
-                                // Setup custom menu
-                                $enabled_menu = get_option('wp_custom_nav_menu');
-                                $checked = strtolower($enabled_menu);
-                                ?&gt;
-
-                                &lt;span &gt;
-                                        &lt;label&gt;&lt;?php _e('Enable'); ?&gt;&lt;/label&gt;&lt;input type=&quot;radio&quot; name=&quot;enable_wp_menu&quot; value=&quot;true&quot; &lt;?php if ($checked=='true') { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
-                                        &lt;label&gt;&lt;?php _e('Disable'); ?&gt;&lt;/label&gt;&lt;input type=&quot;radio&quot; name=&quot;enable_wp_menu&quot; value=&quot;false&quot; &lt;?php if ($checked=='true') { } else { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
-                                &lt;/span&gt;&lt;!-- /.checkboxes --&gt;
-
-                                &lt;input id=&quot;set_wp_menu&quot; type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Set Menu'); ?&gt;&quot; name=&quot;set_wp_menu&quot; class=&quot;button&quot; /&gt;&lt;br /&gt;
-
</del><span class="cx">                                 &lt;span&gt;
</span><del>-                                        &lt;label&gt;&lt;?php _e('Reset Menu to Default'); ?&gt;&lt;/label&gt;
-                                        &lt;input id=&quot;reset_wp_menu&quot; type=&quot;submit&quot; value=&quot;Reset&quot; name=&quot;reset_wp_menu&quot; class=&quot;button&quot; onclick=&quot;return confirm('&lt;?php _e('Are you sure you want to reset the menu to its default settings?'); ?&gt;');&quot; /&gt;
-                                &lt;/span&gt;
-                                &lt;br /&gt;&lt;br /&gt;
-                                &lt;span&gt;
</del><span class="cx">                                 &lt;input id=&quot;add_menu_name&quot; name=&quot;add_menu_name&quot; type=&quot;text&quot; value=&quot;&quot;  /&gt;
</span><span class="cx">                                 &lt;input id=&quot;add_menu&quot; type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Add Menu'); ?&gt;&quot; name=&quot;add_menu&quot; class=&quot;button&quot; /&gt;
</span><span class="cx">                                 &lt;/span&gt;
</span><span class="cx">                         &lt;/div&gt;
</span><span class="cx">                 &lt;/div&gt;&lt;!-- /.widgets-holder-wrap --&gt;
</span><ins>+&lt;?php /* ?&gt;
</ins><span class="cx">                 &lt;?php $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options'); ?&gt;
</span><span class="cx">                 &lt;div class=&quot;widgets-holder-wrap&quot; style=&quot;display:none;&quot;&gt;
</span><span class="cx">                         &lt;div class=&quot;sidebar-name&quot;&gt;
</span><span class="lines">@@ -309,7 +272,7 @@
</span><span class="cx">                                 &lt;div class=&quot;fix&quot;&gt;&lt;/div&gt;
</span><span class="cx">                         &lt;/div&gt;
</span><span class="cx">                 &lt;/div&gt;&lt;!-- /.widgets-holder-wrap --&gt;
</span><del>-
</del><ins>+&lt;?php */ ?&gt;
</ins><span class="cx">                 &lt;div class=&quot;widgets-holder-wrap&quot;&gt;
</span><span class="cx">                         &lt;div class=&quot;sidebar-name&quot;&gt;
</span><span class="cx">                                 &lt;div class=&quot;sidebar-name-arrow&quot;&gt;&lt;/div&gt;
</span></span></pre>
</div>
</div>

</body>
</html>