<!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>[13393] trunk/wp-admin: Use standard WP UI markup in menu admin,
  props ptahdunbar, See #11817</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13393">13393</a></dd>
<dt>Author</dt> <dd>wpmuguru</dd>
<dt>Date</dt> <dd>2010-02-25 00:03:42 +0000 (Thu, 25 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use standard WP UI markup in menu admin, props ptahdunbar, See <a href="http://trac.wordpress.org/ticket/11817">#11817</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincsscustomnavigationdevcss">trunk/wp-admin/css/custom-navigation.dev.css</a></li>
<li><a href="#trunkwpadminnavmenusphp">trunk/wp-admin/nav-menus.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincsscustomnavigationdevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/custom-navigation.dev.css (13392 => 13393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/custom-navigation.dev.css        2010-02-24 23:12:51 UTC (rev 13392)
+++ trunk/wp-admin/css/custom-navigation.dev.css        2010-02-25 00:03:42 UTC (rev 13393)
</span><span class="lines">@@ -8,91 +8,23 @@
</span><span class="cx">  * @subpackage Administration
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-.fix{clear: both;height: 1px;margin: -1px 0 0;overflow: hidden;}
-
</del><span class="cx"> .maintitle  { margin: 0 0 20px 0!important;}
</span><del>-
</del><span class="cx"> .logo  { vertical-align: middle; margin: 0 10px 0 0; }
</span><del>-
-#pages-left { min-width:650px;max-width:1100px;width: 100%; float:left; clear: left; margin-right: -315px; }
-#pages-left .inside  {margin-top: 20px; margin-right: 315px; }
-#nav-container  { margin-top: -3px; }
-
-.sidebar-name  { background-color:#AAAAAA;
-background-image:url(../images/ed-bg.gif);
-border-color:#DFDFDF;
-text-shadow:0 1px 0 #FFFFFF;-moz-border-radius-topleft:8px;
--moz-border-radius-topright:8px;
-background-position:0 0;
-background-repeat:repeat-x;
-border-style:solid;
-border-width:1px;
-cursor:pointer;
-font-size:13px; }
-
-
-.sidebar-name h3 {
-font-size:13px;
-height:19px;
-margin:0;
-overflow:hidden;
-padding:5px 12px;
-white-space:nowrap;
-}
-
-.sidebar-name-arrow {
-background:transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;
-float:right;
-height:29px;
-width:26px;
-}
-
-#menu-right { width: 285px; margin-top: 20px; margin-right: 10px; margin-left: 20px; float:left; clear: right;}
</del><span class="cx"> h2.heading  { margin: 32px 0 10px 0; }
</span><del>-
-.widgets-holder-wrap  { margin: 0 0 20px 0; }
-.widget-holder {
-padding:15px 10px;
--moz-border-radius-bottomleft:8px;
--moz-border-radius-bottomright:8px;
-border-style:none solid solid;
-border-width:0 1px 1px;
-background-color:#F1F1F1;
-border-color:#DDDDDD;
-}
-
</del><span class="cx"> .checkboxes  { float: right; margin: 10px 12px 0 0; }
</span><span class="cx"> 
</span><del>-.addtomenu  {
-display: block;
-float: right;
-margin: 10px 0 0 0;
-text-shadow:0 -1px 0 rgba(0, 0, 0, 0.3);
-background:#21759B url(../images/button-grad.png) repeat-x scroll left top;
-border-color:#298CBA !important;
-color:#FFFFFF !important;
-font-weight:bold;
--moz-border-radius-bottomleft:11px;
--moz-border-radius-bottomright:11px;
--moz-border-radius-topleft:11px;
--moz-border-radius-topright:11px;
-border-style:solid;
-border-width:1px;
-cursor:pointer;
-font-size:11px !important;
-line-height:16px;
-padding:2px 8px;
-text-decoration:none;
-}
-
</del><span class="cx"> .list { zoom: 1; }
</span><span class="cx"> .list li  { margin: 0; }
</span><span class="cx"> .list dt  { display:none; float: left; width: 260px; margin: 0; padding: 0 0 0 5px; line-height: 30px; border-bottom: 1px solid #e3e3e3;  }
</span><span class="cx"> .list dt span  { float: left; }
</span><span class="cx"> .list dt img  { cursor: pointer; float: right; margin: 7px 5px 0 0 }
</span><span class="cx"> 
</span><del>-#nav-container  { padding: 0 10px 10px 10px; background-color: #fff; border: 1px solid #DFDFDF; border-top: none; -moz-border-radius-bottomleft:8px; -moz-border-radius-bottomright:8px; }
</del><span class="cx"> 
</span><ins>+#menus-container { clear: both; }
+#nav-container .inside { padding: 0px 10px 10px; }
+#menus-container .submit { padding: 0px; }
+#menu-settings-column .inside { padding: 10px; overflow: auto; }
+
</ins><span class="cx"> #custom-nav ul  { width: 100%; }
</span><span class="cx"> #custom-nav li { margin: 0; }
</span><span class="cx"> .ui-draggable-dragging  { width: 500px; }
</span></span></pre></div>
<a id="trunkwpadminnavmenusphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/nav-menus.php (13392 => 13393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/nav-menus.php        2010-02-24 23:12:51 UTC (rev 13392)
+++ trunk/wp-admin/nav-menus.php        2010-02-25 00:03:42 UTC (rev 13393)
</span><span class="lines">@@ -25,11 +25,11 @@
</span><span class="cx"> wp_enqueue_script( 'jquery-autocomplete' );
</span><span class="cx"> wp_enqueue_script( 'custom-navigation-php-functions' );
</span><span class="cx"> 
</span><del>-require_once('admin-header.php');
-require_once(ABSPATH . 'wp-admin/includes/nav-menu.php');
</del><ins>+require_once( 'admin-header.php' );
+require_once( ABSPATH . 'wp-admin/includes/nav-menu.php' );
</ins><span class="cx"> 
</span><span class="cx"> function wp_reset_nav_menu() {
</span><del>-        wp_nav_menu_setup(true);
</del><ins>+        wp_nav_menu_setup( true );
</ins><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -149,231 +149,231 @@
</span><span class="cx"> 
</span><span class="cx"> ?&gt;
</span><span class="cx"> &lt;div class=&quot;wrap&quot;&gt;
</span><del>-&lt;?php screen_icon(); ?&gt;
-&lt;h2&gt;&lt;?php esc_html_e('Menus') ?&gt;&lt;/h2&gt;
</del><ins>+        &lt;?php screen_icon(); ?&gt;
+        &lt;h2&gt;&lt;?php esc_html_e('Menus') ?&gt;&lt;/h2&gt;
+        &lt;?php echo $messages_div; ?&gt;
+        &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;
+        
+        
</ins><span class="cx">         &lt;form onsubmit=&quot;updatepostdata()&quot; action=&quot;&lt;?php echo admin_url( 'nav-menus.php' ); ?&gt;&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
</span><del>-&lt;?php if ( ! empty( $custom_menus ) &amp;&amp; count( $custom_menus ) &gt; 1 ): ?&gt;
</del><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
</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">                                         if ( ( $menu_id_in_edit == $menu-&gt;term_id ) || ( $menu_selected_id == $menu-&gt;term_id ) ) { ?&gt;
</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;' class=&quot;current&quot;&gt;&lt;?php echo esc_html( $menu-&gt;name ); ?&gt;&lt;/a&gt;&lt;?php echo $sep; ?&gt;&lt;/li&gt;
</span><del>-&lt;?php                                } else { ?&gt;
</del><ins>+                        &lt;?php        } else { ?&gt;
</ins><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><del>-&lt;?php                                }
</del><ins>+                        &lt;?php        }
</ins><span class="cx">                                 }
</span><del>-?&gt;
</del><ins>+                        ?&gt;
</ins><span class="cx">                 &lt;/ul&gt;
</span><del>-                &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
-&lt;?php endif ?&gt;
</del><ins>+                &lt;?php endif; ?&gt;
+                
+                &lt;div id=&quot;menus-container&quot; class=&quot;metabox-holder has-right-sidebar&quot;&gt;
+                        &lt;div id=&quot;menu-settings-column&quot; class=&quot;inner-sidebar&quot;&gt;
+                                &lt;div id=&quot;side-sortables&quot; class=&quot;meta-box-sortables ui-sortable&quot;&gt;
+                                        
+                                        &lt;div id=&quot;add-menu&quot; class=&quot;postbox&quot;&gt;
+                                                &lt;div class=&quot;handlediv&quot; title=&quot;Click to toggle&quot;&gt;&lt;br /&gt;&lt;/div&gt;
+                                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;?php esc_html_e('Add Menu'); ?&gt;&lt;/h3&gt;
+                                                &lt;div class=&quot;inside&quot;&gt;
+                                                        &lt;span&gt;
+                                                                &lt;input id=&quot;add-menu-name&quot; name=&quot;add-menu-name&quot; type=&quot;text&quot; value=&quot;&quot;  /&gt;
+                                                                &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;
+                                                        &lt;/span&gt;
+                                                &lt;/div&gt;&lt;!-- /.inside--&gt;
+                                        &lt;/div&gt;&lt;!--END #add-menu--&gt;
+                                        
+                                        &lt;div id=&quot;add-pages&quot; class=&quot;postbox&quot;&gt;
+                                                &lt;div class=&quot;handlediv&quot; title=&quot;Click to toggle&quot;&gt;&lt;br /&gt;&lt;/div&gt;
+                                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;?php esc_html_e('Add an Existing Page'); ?&gt;&lt;/h3&gt;
+                                                &lt;div class=&quot;inside&quot;&gt;
+                                                        &lt;?php
+                                                                $pages_args = array(
+                                                                        'child_of' =&gt; 0,
+                                                                        'sort_order' =&gt; 'ASC',
+                                                                        'sort_column' =&gt; 'post_title',
+                                                                        'hierarchical' =&gt; 1,
+                                                                        'exclude' =&gt; '',
+                                                                        'include' =&gt; '',
+                                                                        'meta_key' =&gt; '',
+                                                                        'meta_value' =&gt; '',
+                                                                        'authors' =&gt; '',
+                                                                        'parent' =&gt; -1,
+                                                                        'exclude_tree' =&gt; '',
+                                                                        'number' =&gt; '',
+                                                                        'offset' =&gt; 0
+                                                                );
+                                                                $page_name = '';
+                                                                $pages_array = get_pages($pages_args);
+                                                                if ( $pages_array ) {
+                                                                        foreach ( $pages_array as $post ) {
+                                                                                $page_name .= $post-&gt;post_title . '|';
+                                                                        }
+                                                                } else {
+                                                                        $page_name = __('No pages available');
+                                                                }
+                                                        ?&gt;
+                                                        &lt;script type=&quot;text/javascript&quot; charset=&quot;&lt;?php bloginfo('charset'); ?&gt;&quot;&gt;
+                                                                jQuery(document).ready(function(){
+                                                                        var posts = &quot;&lt;?php echo esc_js( $page_name ); ?&gt;&quot;.split(&quot;|&quot;);
+                                                                        jQuery(&quot;#page-search&quot;).autocomplete(posts);
+                                                                        jQuery(&quot;#page-search&quot;).result(function(event, data, formatted) {
+                                                                                jQuery('#existing-pages').css('display','block');
+                                                                                jQuery(&quot;#existing-pages dt:contains('&quot; + data + &quot;')&quot;).css(&quot;display&quot;, &quot;block&quot;);
+                                                                                jQuery('#show-pages').hide();
+                                                                                jQuery('#hide-pages').show();
+                                                                        });
+                                                                        jQuery('#existing-pages').css('display','none');
+                                                                });
+                                                        &lt;/script&gt;
+                                                        &lt;input type=&quot;text&quot; onfocus=&quot;jQuery('#page-search').attr('value','');&quot; id=&quot;page-search&quot; value=&quot;&lt;?php esc_attr_e('Search Pages'); ?&gt;&quot; /&gt;
</ins><span class="cx"> 
</span><del>-        &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;
-        &lt;div class=&quot;hide-if-no-js&quot;&gt;
-        &lt;div id=&quot;pages-left&quot;&gt;
-                &lt;div class=&quot;inside&quot;&gt;
-                &lt;?php if ( ! empty( $custom_menus ) ) : ?&gt;
-                &lt;?php echo $messages_div; ?&gt;
</del><ins>+                                                        &lt;a id=&quot;show-pages&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-pages').css('display','block');jQuery('#page-search').attr('value','');jQuery('#existing-pages dt').css('display','block');jQuery('#show-pages').hide();jQuery('#hide-pages').show();&quot;&gt;&lt;?php _e('View All'); ?&gt;&lt;/a&gt;
+                                                        &lt;a id=&quot;hide-pages&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-pages').css('display','none');jQuery('#page-search').attr('value','Search Pages');jQuery('#existing-pages dt').css('display','none');jQuery('#show-pages').show();jQuery('#hide-pages').hide();&quot;&gt;&lt;?php _e('Hide All'); ?&gt;&lt;/a&gt;
</ins><span class="cx"> 
</span><del>-                &lt;input type=&quot;hidden&quot; name=&quot;li-count&quot; id=&quot;li-count&quot; value=&quot;0&quot; /&gt;
-                &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;
</del><ins>+                                                        &lt;script type=&quot;text/javascript&quot;&gt;
+                                                                jQuery('#hide-pages').hide();
+                                                        &lt;/script&gt;
</ins><span class="cx"> 
</span><del>-                &lt;div class=&quot;sidebar-name&quot;&gt;
-                        &lt;div class=&quot;sidebar-name-arrow&quot;&gt;
-                                &lt;br/&gt;
-                        &lt;/div&gt;
-                        &lt;h3&gt;&lt;?php echo esc_html( $menu_title ); ?&gt;&lt;/h3&gt;
</del><ins>+                                                        &lt;ul id=&quot;existing-pages&quot; class=&quot;list&quot;&gt;
+                                                        &lt;?php $items_counter = wp_nav_menu_get_pages( 0,'default' ); ?&gt;
+                                                        &lt;/ul&gt;
+                                                        &lt;div class=&quot;fix&quot;&gt;&lt;/div&gt;
+                                                &lt;/div&gt;&lt;!-- /.inside--&gt;
+                                        &lt;/div&gt;&lt;!--END #add-pages--&gt;
+                                        
+                                        &lt;div id=&quot;add-categories&quot; class=&quot;postbox&quot;&gt;
+                                                &lt;div class=&quot;handlediv&quot; title=&quot;Click to toggle&quot;&gt;&lt;br /&gt;&lt;/div&gt;
+                                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;?php esc_html_e('Add an Existing Category'); ?&gt;&lt;/h3&gt;
+                                                &lt;div class=&quot;inside&quot;&gt;
+                                                        &lt;?php
+                                                                // Custom GET categories query
+                                                                // @todo Use API
+                                                                $categories = $wpdb-&gt;get_results(&quot;SELECT term_id FROM $wpdb-&gt;term_taxonomy WHERE taxonomy = 'category' ORDER BY term_id ASC&quot;);
+                                                                $cat_name = '';
+                                                                if ( $categories ) {
+                                                                        foreach ( $categories as $category ) {
+                                                                                $cat_id = $category-&gt;term_id;
+                                                                                $cat_args = array(
+                                                                                        'orderby' =&gt; 'name',
+                                                                                        'include' =&gt; $cat_id,
+                                                                                        'hierarchical' =&gt; 1,
+                                                                                        'order' =&gt; 'ASC',
+                                                                                );
+                                                                                $category_names = get_categories( $cat_args );
+                                                                                if ( isset( $category_names[0]-&gt;name ) ) {
+                                                                                        $cat_name .= htmlentities( $category_names[0]-&gt;name ).'|';
+                                                                                }
+                                                                        }
+                                                                } else {
+                                                                        $cat_name = __('No categories available');
+                                                                }
+                                                        ?&gt;
+                                                        &lt;script type=&quot;text/javascript&quot; charset=&quot;&lt;?php bloginfo('charset'); ?&gt;&quot;&gt;
+                                                                jQuery(document).ready(function(){
+                                                                        var categories = &quot;&lt;?php echo esc_js($cat_name); ?&gt;&quot;.split(&quot;|&quot;);
+                                                                        jQuery(&quot;#cat-search&quot;).autocomplete(categories);
+                                                                        jQuery(&quot;#cat-search&quot;).result(function(event, data, formatted) {
+                                                                                jQuery('#existing-categories').css('display','block');
+                                                                                jQuery(&quot;#existing-categories dt:contains('&quot; + data + &quot;')&quot;).css(&quot;display&quot;, &quot;block&quot;);
+                                                                                jQuery('#show-cats').hide();
+                                                                                jQuery('#hide-cats').show();
+                                                                        });
+                                                                        jQuery('#existing-categories').css('display','none');
+                                                                });
+                                                        &lt;/script&gt;
</ins><span class="cx"> 
</span><del>-                &lt;/div&gt;
</del><ins>+                                                        &lt;input type=&quot;text&quot; onfocus=&quot;jQuery('#cat-search').attr('value','');&quot; id=&quot;cat-search&quot; value=&quot;&lt;?php esc_attr_e('Search Categories'); ?&gt;&quot; /&gt;
</ins><span class="cx"> 
</span><del>-                &lt;div id=&quot;nav-container&quot;&gt;
-                        &lt;ul id=&quot;custom-nav&quot;&gt;
</del><ins>+                                                        &lt;a id=&quot;show-cats&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-categories').css('display','block');jQuery('#cat-search').attr('value','');jQuery('#existing-categories dt').css('display','block');jQuery('#show-cats').hide();jQuery('#hide-cats').show();&quot;&gt;&lt;?php _e('View All'); ?&gt;&lt;/a&gt;
+                                                        &lt;a id=&quot;hide-cats&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-categories').css('display','none');jQuery('#cat-search').attr('value','Search Categories');jQuery('#existing-categories dt').css('display','none');jQuery('#show-cats').show();jQuery('#hide-cats').hide();&quot;&gt;&lt;?php _e('Hide All'); ?&gt;&lt;/a&gt;
</ins><span class="cx"> 
</span><del>-&lt;?php
-                if ( $menu_selected_id &gt; 0 ) {
-                        wp_print_nav_menu( array( 'type' =&gt; 'backend', 'name' =&gt; $menu_title, 'id' =&gt; $menu_selected_id ) );
-                }
-?&gt;
-                        &lt;/ul&gt;
-                &lt;/div&gt;&lt;!-- /#nav-container --&gt;
</del><ins>+                                                        &lt;script type=&quot;text/javascript&quot;&gt;
+                                                                jQuery('#hide-cats').hide();
+                                                        &lt;/script&gt;
</ins><span class="cx"> 
</span><del>-                &lt;p class=&quot;submit&quot;&gt;
</del><ins>+                                                        &lt;ul id=&quot;existing-categories&quot; class=&quot;list&quot;&gt;
+                                                                &lt;?php $items_counter = wp_nav_menu_get_categories( $items_counter, 'default' ); ?&gt;
+                                                        &lt;/ul&gt;
</ins><span class="cx"> 
</span><del>-                &lt;script type=&quot;text/javascript&quot;&gt;
-                        updatepostdata();
-                &lt;/script&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;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;
</del><ins>+                                                        &lt;div class=&quot;fix&quot;&gt;&lt;/div&gt;
+                                                &lt;/div&gt;&lt;!-- /.inside--&gt;
+                                        &lt;/div&gt;&lt;!--END #add-categories--&gt;
+                                        
+                                        &lt;div id=&quot;add-external-link&quot; class=&quot;postbox&quot;&gt;
+                                                &lt;div class=&quot;handlediv&quot; title=&quot;Click to toggle&quot;&gt;&lt;br /&gt;&lt;/div&gt;
+                                                &lt;h3 class=&quot;hndle&quot;&gt;&lt;?php esc_html_e('Add a Custom Link'); ?&gt;&lt;/h3&gt;
+                                                &lt;div class=&quot;inside&quot;&gt;
+                                                        
+                                                        &lt;label class=&quot;howto&quot; for=&quot;custom-menu-item-url&quot;&gt;
+                                                                &lt;input id=&quot;custom-menu-item-url&quot; type=&quot;text&quot; value=&quot;http://&quot; /&gt;
+                                                                &lt;?php _e('URL'); ?&gt;
+                                                        &lt;/label&gt;&lt;br /&gt;
+                                                        
+                                                        &lt;?php $template_dir = get_bloginfo('url'); ?&gt;
+                                                        &lt;input type=&quot;hidden&quot; id=&quot;template-dir&quot; value=&quot;&lt;?php echo esc_attr($template_dir); ?&gt;&quot; /&gt;
+                                                        &lt;label class=&quot;howto&quot; for=&quot;custom-menu-item-name&quot;&gt;
+                                                                &lt;input id=&quot;custom-menu-item-name&quot; type=&quot;text&quot; value=&quot;&lt;?php echo esc_attr( __('Menu Item') ); ?&gt;&quot; onfocus=&quot;jQuery('#custom-menu-item-name').attr('value','');&quot;  /&gt;
+                                                                &lt;?php _e('Menu Text'); ?&gt;
+                                                        &lt;/label&gt;&lt;br /&gt;
+                                                        
+                                                        &lt;label class=&quot;howto&quot; for=&quot;custom_menu_item_description&quot; &lt;?php if ($advanced_option_descriptions == 'no') { ?&gt;style=&quot;display:none;&quot;&lt;?php } ?&gt;&gt;
+                                                                &lt;input id=&quot;custom_menu_item_description&quot; type=&quot;text&quot; value=&quot;&lt;?php esc_attr_e('A description'); ?&gt;&quot; &lt;?php if ($advanced_option_descriptions == 'no') { ?&gt;style=&quot;display:none;&quot;&lt;?php } ?&gt; onfocus=&quot;jQuery('#custom_menu_item_description').attr('value','');&quot; /&gt;
+                                                                &lt;?php _e('Description'); ?&gt;
+                                                        &lt;/label&gt;
+                                                        
+                                                        &lt;?php if ( 'no' != $advanced_option_descriptions ) { echo '&lt;br /&gt;'; } ?&gt;
+                                                        
+                                                        &lt;a class=&quot;addtomenu button&quot; onclick=&quot;appendToList('&lt;?php echo $template_dir; ?&gt;','&lt;?php echo esc_js( _x('Custom', 'menu nav item type') ); ?&gt;','','','','0','');jQuery('#custom-menu-item-name').attr('value','&lt;?php echo esc_js( __('Menu Item') ); ?&gt;');jQuery('#custom_menu_item_description').attr('value','&lt;?php echo esc_js( __('A description') ); ?&gt;');&quot;&gt;&lt;?php _e('Add to menu'); ?&gt;&lt;/a&gt;
+                                                        &lt;div class=&quot;fix&quot;&gt;&lt;/div&gt;
+                                                &lt;/div&gt;&lt;!-- /.inside--&gt;
+                                        &lt;/div&gt;&lt;!-- /#add-external-link--&gt;
+                                        
+                                &lt;/div&gt;&lt;!-- /#side-sortables--&gt;
+                        &lt;/div&gt;&lt;!-- /#menu-settings-column --&gt;
</ins><span class="cx"> 
</span><del>-        &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;
-                &lt;/div&gt;&lt;!-- /.inside --&gt;
-        &lt;/div&gt;
</del><ins>+                        &lt;div id=&quot;post-body&quot;&gt;
+                                &lt;div id=&quot;post-body-content&quot;&gt;
+                                        &lt;div id=&quot;normal-sortables&quot; class=&quot;meta-box-sortables ui-sortable&quot;&gt;
+                                        
+                                        &lt;?php if ( ! empty( $custom_menus ) ) : ?&gt;
+                                                &lt;div id=&quot;nav-container&quot; class=&quot;postbox&quot;&gt;        
+                                                        &lt;h3 class=&quot;hndle&quot;&gt;&lt;?php echo esc_html( $menu_title ); ?&gt;&lt;/h3&gt;
+                                                        &lt;div class=&quot;inside&quot;&gt;
+                                                                &lt;input type=&quot;hidden&quot; name=&quot;li-count&quot; id=&quot;li-count&quot; value=&quot;0&quot; /&gt;
+                                                                &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;
</ins><span class="cx"> 
</span><del>-        &lt;div id=&quot;menu-right&quot;&gt;
-                &lt;div class=&quot;widgets-holder-wrap&quot;&gt;
-                        &lt;div class=&quot;sidebar-name&quot;&gt;
-                                &lt;div class=&quot;sidebar-name-arrow&quot;&gt;&lt;/div&gt;
-                                &lt;h3&gt;&lt;?php esc_html_e('Add Menu'); ?&gt;&lt;/h3&gt;
-                        &lt;/div&gt;
-                        &lt;div class=&quot;widget-holder&quot;&gt;
-
-                                &lt;span&gt;
-                                &lt;input id=&quot;add-menu-name&quot; name=&quot;add-menu-name&quot; type=&quot;text&quot; value=&quot;&quot;  /&gt;
-                                &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;
-                                &lt;/span&gt;
-                        &lt;/div&gt;
-                &lt;/div&gt;&lt;!-- /.widgets-holder-wrap --&gt;
-                &lt;div class=&quot;widgets-holder-wrap&quot;&gt;
-                        &lt;div class=&quot;sidebar-name&quot;&gt;
-                                &lt;div class=&quot;sidebar-name-arrow&quot;&gt;&lt;/div&gt;
-                                &lt;h3&gt;&lt;?php esc_html_e('Add an Existing Page'); ?&gt;&lt;/h3&gt;
-                        &lt;/div&gt;
-                        &lt;div class=&quot;widget-holder&quot;&gt;
-&lt;?php
-        $pages_args = array(
-                'child_of' =&gt; 0,
-                'sort_order' =&gt; 'ASC',
-                'sort_column' =&gt; 'post_title',
-                'hierarchical' =&gt; 1,
-                'exclude' =&gt; '',
-                'include' =&gt; '',
-                'meta_key' =&gt; '',
-                'meta_value' =&gt; '',
-                'authors' =&gt; '',
-                'parent' =&gt; -1,
-                'exclude_tree' =&gt; '',
-                'number' =&gt; '',
-                'offset' =&gt; 0
-        );
-        $page_name = '';
-        $pages_array = get_pages($pages_args);
-        if ( $pages_array ) {
-                foreach ( $pages_array as $post ) {
-                        $page_name .= $post-&gt;post_title . '|';
-                }
-        } else {
-                $page_name = __('No pages available');
-        }
-?&gt;
-                                &lt;script type=&quot;text/javascript&quot; charset=&quot;&lt;?php bloginfo('charset'); ?&gt;&quot;&gt;
-                                        jQuery(document).ready(function(){
-                                                var posts = &quot;&lt;?php echo esc_js( $page_name ); ?&gt;&quot;.split(&quot;|&quot;);
-                                                jQuery(&quot;#page-search&quot;).autocomplete(posts);
-                                                jQuery(&quot;#page-search&quot;).result(function(event, data, formatted) {
-                                                        jQuery('#existing-pages').css('display','block');
-                                                        jQuery(&quot;#existing-pages dt:contains('&quot; + data + &quot;')&quot;).css(&quot;display&quot;, &quot;block&quot;);
-                                                        jQuery('#show-pages').hide();
-                                                        jQuery('#hide-pages').show();
-                                                });
-                                                jQuery('#existing-pages').css('display','none');
-                                        });
-                                &lt;/script&gt;
-                                &lt;input type=&quot;text&quot; onfocus=&quot;jQuery('#page-search').attr('value','');&quot; id=&quot;page-search&quot; value=&quot;&lt;?php esc_attr_e('Search Pages'); ?&gt;&quot; /&gt;
-
-                                &lt;a id=&quot;show-pages&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-pages').css('display','block');jQuery('#page-search').attr('value','');jQuery('#existing-pages dt').css('display','block');jQuery('#show-pages').hide();jQuery('#hide-pages').show();&quot;&gt;&lt;?php _e('View All'); ?&gt;&lt;/a&gt;
-                                &lt;a id=&quot;hide-pages&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-pages').css('display','none');jQuery('#page-search').attr('value','Search Pages');jQuery('#existing-pages dt').css('display','none');jQuery('#show-pages').show();jQuery('#hide-pages').hide();&quot;&gt;&lt;?php _e('Hide All'); ?&gt;&lt;/a&gt;
-
-                                &lt;script type=&quot;text/javascript&quot;&gt;
-                                        jQuery('#hide-pages').hide();
-                                &lt;/script&gt;
-
-                                &lt;ul id=&quot;existing-pages&quot; class=&quot;list&quot;&gt;
-&lt;?php
-        $items_counter = wp_nav_menu_get_pages( 0,'default' );
-?&gt;
-                                &lt;/ul&gt;
-                                &lt;div class=&quot;fix&quot;&gt;&lt;/div&gt;
-                        &lt;/div&gt;
-                &lt;/div&gt;&lt;!-- /.widgets-holder-wrap --&gt;
-
-                &lt;div class=&quot;widgets-holder-wrap&quot;&gt;
-                        &lt;div class=&quot;sidebar-name&quot;&gt;
-                                &lt;div class=&quot;sidebar-name-arrow&quot;&gt;&lt;/div&gt;
-                                &lt;h3&gt;&lt;?php esc_html_e('Add an Existing Category'); ?&gt;&lt;/h3&gt;
-                        &lt;/div&gt;
-                        &lt;div class=&quot;widget-holder&quot;&gt;
-
-&lt;?php
-        // Custom GET categories query
-        // @todo Use API
-        $categories = $wpdb-&gt;get_results(&quot;SELECT term_id FROM $wpdb-&gt;term_taxonomy WHERE taxonomy = 'category' ORDER BY term_id ASC&quot;);
-        $cat_name = '';
-        if ( $categories ) {
-                foreach ( $categories as $category ) {
-                        $cat_id = $category-&gt;term_id;
-                        $cat_args = array(
-                                'orderby' =&gt; 'name',
-                                'include' =&gt; $cat_id,
-                                'hierarchical' =&gt; 1,
-                                'order' =&gt; 'ASC',
-                        );
-                        $category_names = get_categories( $cat_args );
-                        if ( isset( $category_names[0]-&gt;name ) ) {
-                                $cat_name .= htmlentities( $category_names[0]-&gt;name ).'|';
-                        }
-                }
-        } else {
-                $cat_name = __('No categories available');
-        }
-?&gt;
-                                &lt;script type=&quot;text/javascript&quot; charset=&quot;&lt;?php bloginfo('charset'); ?&gt;&quot;&gt;
-                                        jQuery(document).ready(function(){
-                                                var categories = &quot;&lt;?php echo esc_js($cat_name); ?&gt;&quot;.split(&quot;|&quot;);
-                                                jQuery(&quot;#cat-search&quot;).autocomplete(categories);
-                                                jQuery(&quot;#cat-search&quot;).result(function(event, data, formatted) {
-                                                        jQuery('#existing-categories').css('display','block');
-                                                        jQuery(&quot;#existing-categories dt:contains('&quot; + data + &quot;')&quot;).css(&quot;display&quot;, &quot;block&quot;);
-                                                        jQuery('#show-cats').hide();
-                                                        jQuery('#hide-cats').show();
-                                                });
-                                                jQuery('#existing-categories').css('display','none');
-                                        });
-                                &lt;/script&gt;
-
-                                &lt;input type=&quot;text&quot; onfocus=&quot;jQuery('#cat-search').attr('value','');&quot; id=&quot;cat-search&quot; value=&quot;&lt;?php esc_attr_e('Search Categories'); ?&gt;&quot; /&gt;
-
-                                &lt;a id=&quot;show-cats&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-categories').css('display','block');jQuery('#cat-search').attr('value','');jQuery('#existing-categories dt').css('display','block');jQuery('#show-cats').hide();jQuery('#hide-cats').show();&quot;&gt;&lt;?php _e('View All'); ?&gt;&lt;/a&gt;
-                                &lt;a id=&quot;hide-cats&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-categories').css('display','none');jQuery('#cat-search').attr('value','Search Categories');jQuery('#existing-categories dt').css('display','none');jQuery('#show-cats').show();jQuery('#hide-cats').hide();&quot;&gt;&lt;?php _e('Hide All'); ?&gt;&lt;/a&gt;
-
-                                &lt;script type=&quot;text/javascript&quot;&gt;
-                                        jQuery('#hide-cats').hide();
-                                &lt;/script&gt;
-
-                                &lt;ul id=&quot;existing-categories&quot; class=&quot;list&quot;&gt;
-&lt;?php
-        $items_counter = wp_nav_menu_get_categories( $items_counter, 'default' );
-?&gt;
-                                &lt;/ul&gt;
-
-                                &lt;div class=&quot;fix&quot;&gt;&lt;/div&gt;
-                        &lt;/div&gt;
-                &lt;/div&gt;&lt;!-- /.widgets-holder-wrap --&gt;
-
-                &lt;div class=&quot;widgets-holder-wrap&quot;&gt;
-                        &lt;div class=&quot;sidebar-name&quot;&gt;
-                                &lt;div class=&quot;sidebar-name-arrow&quot;&gt;&lt;/div&gt;
-                                &lt;h3&gt;&lt;?php esc_html_e('Add a Custom Url'); ?&gt;&lt;/h3&gt;
-                        &lt;/div&gt;
-                        &lt;div class=&quot;widget-holder&quot;&gt;
-                                &lt;input id=&quot;custom-menu-item-url&quot; type=&quot;text&quot; value=&quot;http://&quot;  /&gt;
-                                &lt;label for=&quot;custom-menu-item-url&quot;&gt;&lt;?php _e('URL'); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                &lt;?php $template_dir = get_bloginfo('url'); ?&gt;
-                                &lt;input type=&quot;hidden&quot; id=&quot;template-dir&quot; value=&quot;&lt;?php echo esc_attr($template_dir); ?&gt;&quot; /&gt;
-                                &lt;input id=&quot;custom-menu-item-name&quot; type=&quot;text&quot; value=&quot;&lt;?php echo esc_attr( __('Menu Item') ); ?&gt;&quot; onfocus=&quot;jQuery('#custom-menu-item-name').attr('value','');&quot;  /&gt;
-                                &lt;label for=&quot;custom-menu-item-name&quot;&gt;&lt;?php _e('Menu Text'); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                &lt;input id=&quot;custom_menu_item_description&quot; type=&quot;text&quot; value=&quot;&lt;?php esc_attr_e('A description'); ?&gt;&quot; &lt;?php if ($advanced_option_descriptions == 'no') { ?&gt;style=&quot;display:none;&quot;&lt;?php } ?&gt; onfocus=&quot;jQuery('#custom_menu_item_description').attr('value','');&quot; /&gt;
-                                &lt;label &lt;?php if ($advanced_option_descriptions == 'no') { ?&gt;style=&quot;display:none;&quot;&lt;?php } ?&gt; &gt;&lt;?php _e('Description'); ?&gt;&lt;/label&gt;
-                                &lt;a class=&quot;addtomenu&quot; onclick=&quot;appendToList('&lt;?php echo $template_dir; ?&gt;','&lt;?php echo esc_js( _x('Custom', 'menu nav item type') ); ?&gt;','','','','0','');jQuery('#custom-menu-item-name').attr('value','&lt;?php echo esc_js( __('Menu Item') ); ?&gt;');jQuery('#custom_menu_item_description').attr('value','&lt;?php echo esc_js( __('A description') ); ?&gt;');&quot;&gt;&lt;?php _e('Add to menu'); ?&gt;&lt;/a&gt;
-                                &lt;div class=&quot;fix&quot;&gt;&lt;/div&gt;
-                        &lt;/div&gt;
-                &lt;/div&gt;&lt;!-- /.widgets-holder-wrap --&gt;
-        &lt;/div&gt;&lt;!-- /.hide-if-no-js --&gt;
-        &lt;/div&gt;
</del><ins>+                                                                &lt;ul id=&quot;custom-nav&quot;&gt;
+                                                                &lt;?php
+                                                                if ( $menu_selected_id &gt; 0 ) {
+                                                                        wp_print_nav_menu( array( 'type' =&gt; 'backend', 'name' =&gt; $menu_title, 'id' =&gt; $menu_selected_id ) );
+                                                                }
+                                                                ?&gt;
+                                                                &lt;/ul&gt;&lt;!-- /#custom-nav--&gt;
+                                                        &lt;/div&gt;&lt;!-- /.inside --&gt;
+                                                &lt;!-- /#nav-menu-canvas .postbox--&gt;
+                                                &lt;/div&gt;
+                                                &lt;p class=&quot;submit&quot;&gt;
+                                                        &lt;script type=&quot;text/javascript&quot;&gt;
+                                                                updatepostdata();
+                                                        &lt;/script&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;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&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;
+                                        &lt;/div&gt;&lt;!-- /#normal-sortables--&gt;
+                                &lt;/div&gt;&lt;!-- /#post-body-content--&gt;
+                        &lt;/div&gt;&lt;!--- /#post-body --&gt;
+                        &lt;br class=&quot;clear&quot; /&gt;
+                &lt;/div&gt;&lt;!-- /.metabox-holder has-right-sidebar--&gt;
</ins><span class="cx">         &lt;/form&gt;
</span><del>-&lt;/div&gt;
</del><ins>+&lt;/div&gt;&lt;!-- /.wrap--&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;dialog-confirm&quot; style=&quot;display:none;&quot; title=&quot;&lt;?php esc_attr_e('Edit Menu Item'); ?&gt;&quot;&gt;
</span><span class="cx">         &lt;span id=&quot;edittitle-wrap&quot;&gt;&lt;input id=&quot;edittitle&quot; type=&quot;text&quot; name=&quot;edittitle&quot; value=&quot;&quot; /&gt;&lt;label class=&quot;editlabel&quot; for=&quot;edittitle&quot;&gt;&lt;?php _e('Menu Title'); ?&gt;&lt;/label&gt;&lt;br /&gt;&lt;/span&gt;
</span><span class="lines">@@ -391,4 +391,4 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;?php
</span><span class="cx"> 
</span><del>-include(&quot;admin-footer.php&quot;);
</del><span class="cx">\ No newline at end of file
</span><ins>+include( 'admin-footer.php' );
</ins><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>

</body>
</html>