<!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>[13375] trunk: Nav menu cleanups.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13375">13375</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-02-24 18:52:54 +0000 (Wed, 24 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Nav menu cleanups. Props nbachiyski. see <a href="http://trac.wordpress.org/ticket/11817">#11817</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincsscustomnavigationcss">trunk/wp-admin/css/custom-navigation.css</a></li>
<li><a href="#trunkwpadmincsscustomnavigationdevcss">trunk/wp-admin/css/custom-navigation.dev.css</a></li>
<li><a href="#trunkwpadminincludesnavmenuphp">trunk/wp-admin/includes/nav-menu.php</a></li>
<li><a href="#trunkwpadminjscustomnavigationdynamicfunctionsdevjs">trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js</a></li>
<li><a href="#trunkwpadminjscustomnavigationdynamicfunctionsjs">trunk/wp-admin/js/custom-navigation-dynamic-functions.js</a></li>
<li><a href="#trunkwpadminnavmenusphp">trunk/wp-admin/nav-menus.php</a></li>
<li><a href="#trunkwpincludesdefaultwidgetsphp">trunk/wp-includes/default-widgets.php</a></li>
<li><a href="#trunkwpincludesnavmenutemplatephp">trunk/wp-includes/nav-menu-template.php</a></li>
<li><a href="#trunkwpincludesnavmenuphp">trunk/wp-includes/nav-menu.php</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincsscustomnavigationcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/custom-navigation.css (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/custom-navigation.css        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-admin/css/custom-navigation.css        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -1 +1 @@
</span><del>-.fix{clear:both;height:1px;margin:-1px 0 0;overflow:hidden;}.maintitle{margin:0 0 20px 0!important;}.logo{vertical-align:middle;margin:0 10px 0 0;}#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:#AAA;background-image:url(../images/ed-bg.gif);border-color:#DFDFDF;text-shadow:0 1px 0 #FFF;-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;}h2.heading{margin:32px 0 10px 0;}.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:#DDD;}.checkboxes{float:right;margin:10px 12px 0 0;}.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:#FFF!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;}.list{zoom:1;}.list li{margin:0;}.list dt{display:none;float:left;width:260px;margin:0;padding:0 0 0 5px;line-height:30px;border-bottom:1px solid #e3e3e3;}.list dt span{float:left;}.list dt img{cursor:pointer;float:right;margin:7px 5px 0 0;}#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;}#custom-nav ul{width:100%;}#custom-nav li{margin:0;}.ui-draggable-dragging{width:500px;}#custom-nav li dl dt{-webkit-border-bottom-left-radius:6px;-webkit-border-bottom-right-radius:6px;-webkit-border-top-left-radius:6px;-webkit-border-top-right-radius:6px;border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-bottomright:6px;-moz-border-radius-topleft:6px;-moz-border-radius-topright:6px;border:1px solid #E6E6E6;position:relative;padding-left:10px;background-color:#f1f1f1;height:35px;line-height:35px;}#custom-nav li dl dt:hover{cursor:move;}#custom-nav li dl dt .controls{position:absolute;right:15px;top:-1px;}#custom-nav li dl dt img{vertical-align:middle;}#custom-nav li .title{background:url(../images/ico-arrow.png) no-repeat 4px 5px;padding-left:15px;}#custom-nav li ul li{margin-left:20px;opacity:.7;}#custom-nav li ul li ul li{opacity:.9;}#custom-nav li ul li ul li ul li{opacity:.9;}#custom-nav li ul li ul li ul li ul li{opacity:.95;}#existing-pages li .title{background:url(../images/ico-arrow.png) no-repeat 4px 13px;padding-left:15px;}#existing-pages li ul li .title{margin-left:10px;}#existing-pages li ul li ul li .title{margin-left:20px;}#existing-pages li ul li ul li ul li .title{margin-left:30px;}#existing-pages li ul li ul li ul li ul li .title{margin-left:40px;}#existing-pages li ul li ul li ul li ul li ul li .title{margin-left:50px;}#existing-pages li ul li ul li ul li ul li ul li ul li .title{margin-left:60px;}#existing-pages li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:70px;}#existing-pages li ul li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:80px;}#existing-categories li .title{background:url(../images/ico-arrow.png) no-repeat 4px 13px;padding-left:15px;}#existing-categories li ul li .title{margin-left:10px;}#existing-categories li ul li ul li .title{margin-left:20px;}#existing-categories li ul li ul li ul li .title{margin-left:30px;}#existing-categories li ul li ul li ul li ul li .title{margin-left:40px;}#existing-categories li ul li ul li ul li ul li ul li .title{margin-left:50px;}#existing-categories li ul li ul li ul li ul li ul li ul li .title{margin-left:60px;}#existing-categories li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:70px;}#existing-categories li ul li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:80px;}img.remove,img.edit{cursor:pointer;margin:0 5px 0 0;}.dropzone{height:7px;margin:3px 0 3px 0;}.hide{display:none;}.type{text-transform:uppercase;font-size:11px;color:#999;padding-right:10px;}#menu_select{width:170px;}#dialog-confirm label{padding-left:10px;}.ui-dialog{background:#fff;border:1px solid #555;-moz-box-shadow:0 4px 30px #000;}.ui-dialog-titlebar{color:#CFCFCF;font-family:"Lucida Grande",Verdana,Arial,sans-serif;padding:6px 10px 6px;background-color:#222!important;border:none!important;-moz-border-radius:none!important;}#dialog-confirm{height:168px!important;padding:20px 10px 10px;}#dialog-confirm input{margin:0 0 15px 0;width:280px;}#dialog-confirm select{margin:0 0 15px 0;}.ui-dialog-buttonpane{padding:10px;}.ui-dialog-buttonpane button{margin:0 10px 0 0;background:#F2F2F2;text-shadow:0 1px 0 #FFF;border-color:#BBB;color:#464646;-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:14px;padding:2px 8px;text-decoration:none;}.ui-dialog-buttonpane button:hover{color:#000;border-color:#666;}.ui-icon{display:none;}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%;}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.60;filter:Alpha(Opacity=60);}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.60;filter:Alpha(Opacity=60);-moz-border-radius:8px;-webkit-border-radius:8px;}#reset_wp_menu{background:#c77 none!important;color:white!important;text-shadow:0 1px 0 #555!important;}
</del><span class="cx">\ No newline at end of file
</span><ins>+.fix{clear:both;height:1px;margin:-1px 0 0;overflow:hidden;}.maintitle{margin:0 0 20px 0!important;}.logo{vertical-align:middle;margin:0 10px 0 0;}#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:#AAA;background-image:url(../images/ed-bg.gif);border-color:#DFDFDF;text-shadow:0 1px 0 #FFF;-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;}h2.heading{margin:32px 0 10px 0;}.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:#DDD;}.checkboxes{float:right;margin:10px 12px 0 0;}.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:#FFF!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;}.list{zoom:1;}.list li{margin:0;}.list dt{display:none;float:left;width:260px;margin:0;padding:0 0 0 5px;line-height:30px;border-bottom:1px solid #e3e3e3;}.list dt span{float:left;}.list dt img{cursor:pointer;float:right;margin:7px 5px 0 0;}#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;}#custom-nav ul{width:100%;}#custom-nav li{margin:0;}.ui-draggable-dragging{width:500px;}#custom-nav li dl dt{-webkit-border-bottom-left-radius:6px;-webkit-border-bottom-right-radius:6px;-webkit-border-top-left-radius:6px;-webkit-border-top-right-radius:6px;border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-bottomright:6px;-moz-border-radius-topleft:6px;-moz-border-radius-topright:6px;border:1px solid #E6E6E6;position:relative;padding-left:10px;background-color:#f1f1f1;height:35px;line-height:35px;}#custom-nav li dl dt:hover{cursor:move;}#custom-nav li dl dt .controls{position:absolute;right:15px;top:-1px;}#custom-nav li dl dt img{vertical-align:middle;}#custom-nav li .title{background:url(../images/ico-arrow.png) no-repeat 4px 5px;padding-left:15px;}#custom-nav li ul li{margin-left:20px;opacity:.7;}#custom-nav li ul li ul li{opacity:.9;}#custom-nav li ul li ul li ul li{opacity:.9;}#custom-nav li ul li ul li ul li ul li{opacity:.95;}#existing-pages li .title{background:url(../images/ico-arrow.png) no-repeat 4px 13px;padding-left:15px;}#existing-pages li ul li .title{margin-left:10px;}#existing-pages li ul li ul li .title{margin-left:20px;}#existing-pages li ul li ul li ul li .title{margin-left:30px;}#existing-pages li ul li ul li ul li ul li .title{margin-left:40px;}#existing-pages li ul li ul li ul li ul li ul li .title{margin-left:50px;}#existing-pages li ul li ul li ul li ul li ul li ul li .title{margin-left:60px;}#existing-pages li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:70px;}#existing-pages li ul li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:80px;}#existing-categories li .title{background:url(../images/ico-arrow.png) no-repeat 4px 13px;padding-left:15px;}#existing-categories li ul li .title{margin-left:10px;}#existing-categories li ul li ul li .title{margin-left:20px;}#existing-categories li ul li ul li ul li .title{margin-left:30px;}#existing-categories li ul li ul li ul li ul li .title{margin-left:40px;}#existing-categories li ul li ul li ul li ul li ul li .title{margin-left:50px;}#existing-categories li ul li ul li ul li ul li ul li ul li .title{margin-left:60px;}#existing-categories li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:70px;}#existing-categories li ul li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:80px;}img.remove,img.edit{cursor:pointer;margin:0 5px 0 0;}.dropzone{height:7px;margin:3px 0 3px 0;}.hide{display:none;}.type{text-transform:uppercase;font-size:11px;color:#999;padding-right:10px;}#menu_select{width:170px;}#dialog-confirm label{padding-left:10px;}.ui-dialog{background:#fff;border:1px solid #555;-moz-box-shadow:0 4px 30px #000;}.ui-dialog-titlebar{color:#CFCFCF;font-family:"Lucida Grande",Verdana,Arial,sans-serif;padding:6px 10px 6px;background-color:#222!important;border:none!important;-moz-border-radius:none!important;}#dialog-confirm{height:168px!important;padding:20px 10px 10px;}#dialog-confirm input{margin:0 0 15px 0;width:280px;}#dialog-confirm select{margin:0 0 15px 0;}.ui-dialog-buttonpane{padding:10px;}.ui-dialog-buttonpane button{margin:0 10px 0 0;background:#F2F2F2;text-shadow:0 1px 0 #FFF;border-color:#BBB;color:#464646;-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:14px;padding:2px 8px;text-decoration:none;}.ui-dialog-buttonpane button:hover{color:#000;border-color:#666;}.ui-icon{display:none;}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%;}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.60;filter:Alpha(Opacity=60);}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.60;filter:Alpha(Opacity=60);-moz-border-radius:8px;-webkit-border-radius:8px;}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadmincsscustomnavigationdevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/custom-navigation.dev.css (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/custom-navigation.dev.css        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-admin/css/custom-navigation.dev.css        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -161,6 +161,3 @@
</span><span class="cx"> .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
</span><span class="cx"> .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); }
</span><span class="cx"> .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); -moz-border-radius: 8px; -webkit-border-radius: 8px; }
</span><del>-
-
-#reset_wp_menu { background:#c77 none !important;color:white!important;text-shadow:0 1px 0 #555 !important;}
</del></span></pre></div>
<a id="trunkwpadminincludesnavmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/nav-menu.php (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/nav-menu.php        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-admin/includes/nav-menu.php        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -29,27 +29,27 @@
</span><span class="cx">         //GET all pages
</span><span class="cx">         $pages_array = get_pages($pages_args);
</span><span class="cx">
</span><del>-        $intCounter = $counter;
-        $parentli = $intCounter;
</del><ins>+        $items_counter = $counter;
+        $parentli = $items_counter;
</ins><span class="cx">
</span><span class="cx">         if ( !$pages_array ) {
</span><del>-                echo 'Not Found';
-                return $intCounter;
</del><ins>+                echo __('Not Found');
+                return $items_counter;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         // Display Loop
</span><span class="cx">         foreach ( $pages_array as $post ) {
</span><span class="cx">                 if ( $post->post_parent == 0 ) {
</span><del>-                        $post = wp_setup_nav_menu_item($post, 'page', $intCounter);
</del><ins>+                        $post = wp_setup_nav_menu_item($post, 'page', $items_counter);
</ins><span class="cx">                         if ( $type == 'menu' ) {
</span><span class="cx">                                 ?>
</span><span class="cx">
</span><del>-                                <li id="menu-<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>">
</del><ins>+                                <li id="menu-<?php echo $items_counter; ?>" value="<?php echo $items_counter; ?>">
</ins><span class="cx">                                         <?php
</span><del>-                                                wp_print_nav_menu_item($post, 'menu', $intCounter);
</del><ins>+                                                wp_print_nav_menu_item($post, 'menu', $items_counter);
</ins><span class="cx">                                                 $parentli = $post->ID;
</span><del>-                                                $intCounter++;
-                                                $intCounter = wp_custom_navigation_default_sub_items($post->ID, $intCounter, $parentli, 'pages', 'menu');
</del><ins>+                                                $items_counter++;
+                                                $items_counter = wp_custom_navigation_default_sub_items($post->ID, $items_counter, $parentli, 'pages', 'menu');
</ins><span class="cx">                                         ?>
</span><span class="cx">                                 </li>
</span><span class="cx">
</span><span class="lines">@@ -61,8 +61,8 @@
</span><span class="cx">                                         <?php
</span><span class="cx">                                                 wp_print_nav_menu_item($post, 'default');
</span><span class="cx">                                                 $parentli = $post->ID;
</span><del>-                                                $intCounter++;
-                                                $intCounter = wp_nav_menu_sub_items($post->ID, $intCounter, $parentli, 'pages', 'default');
</del><ins>+                                                $items_counter++;
+                                                $items_counter = wp_nav_menu_sub_items($post->ID, $items_counter, $parentli, 'pages', 'default');
</ins><span class="cx">                                          ?>
</span><span class="cx">                                 </li>
</span><span class="cx">
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        return $intCounter;
</del><ins>+        return $items_counter;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Outputs All Categories and Sub Items
</span><span class="lines">@@ -90,30 +90,30 @@
</span><span class="cx">                         'number' => '',
</span><span class="cx">                         'pad_counts' => false );
</span><span class="cx">
</span><del>-        $intCounter = $counter;
</del><ins>+        $items_counter = $counter;
</ins><span class="cx">
</span><span class="cx">         // Get all categories
</span><span class="cx">         $categories_array = get_categories($category_args);
</span><span class="cx">
</span><span class="cx">         if ( !$categories_array ) {
</span><span class="cx">                 _e('Not Found');
</span><del>-                return $intCounter;
</del><ins>+                return $items_counter;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         // Display Loop
</span><span class="cx">         foreach ( $categories_array as $cat_item ) {
</span><span class="cx">                 if ( $cat_item->parent == 0 ) {
</span><del>-                        $cat_item = wp_setup_nav_menu_item($cat_item, 'category', $intCounter);
</del><ins>+                        $cat_item = wp_setup_nav_menu_item($cat_item, 'category', $items_counter);
</ins><span class="cx">                         // Custom Menu
</span><span class="cx">                         if ( $type == 'menu' ) {
</span><span class="cx">                                 ?>
</span><span class="cx">
</span><del>-                                <li id="menu-<?php echo $intCounter; ?>" value="<?php echo $intCounter; ?>">
</del><ins>+                                <li id="menu-<?php echo $items_counter; ?>" value="<?php echo $items_counter; ?>">
</ins><span class="cx">                                         <?php
</span><span class="cx">                                                 wp_print_nav_menu_item($cat_item, 'menu');
</span><span class="cx">                                                 $parentli = $cat_item->cat_ID;
</span><del>-                                                $intCounter++;
-                                                $intCounter = wp_nav_menu_sub_items($cat_item->cat_ID, $intCounter, $parentli, 'categories', 'menu');
</del><ins>+                                                $items_counter++;
+                                                $items_counter = wp_nav_menu_sub_items($cat_item->cat_ID, $items_counter, $parentli, 'categories', 'menu');
</ins><span class="cx">                                         ?>
</span><span class="cx">
</span><span class="cx">                                 </li>
</span><span class="lines">@@ -126,8 +126,8 @@
</span><span class="cx">                                         <?php
</span><span class="cx">                                                 wp_print_nav_menu_item($cat_item, 'default');
</span><span class="cx">                                                 $parentli = $cat_item->cat_ID;
</span><del>-                                                $intCounter++;
-                                                $intCounter = wp_nav_menu_sub_items($cat_item->cat_ID, $intCounter, $parentli, 'categories', 'default');
</del><ins>+                                                $items_counter++;
+                                                $items_counter = wp_nav_menu_sub_items($cat_item->cat_ID, $items_counter, $parentli, 'categories', 'default');
</ins><span class="cx">                                         ?>
</span><span class="cx">
</span><span class="cx">                                 </li>
</span><span class="lines">@@ -137,13 +137,13 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        return $intCounter;
</del><ins>+        return $items_counter;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> //RECURSIVE Sub Menu Items of default categories and pages
</span><del>-function wp_nav_menu_sub_items($childof, $intCounter, $parentli, $type, $output_type) {
</del><ins>+function wp_nav_menu_sub_items($childof, $items_counter, $parentli, $type, $output_type) {
</ins><span class="cx">
</span><del>-        $counter = $intCounter;
</del><ins>+        $counter = $items_counter;
</ins><span class="cx">
</span><span class="cx">         // Custom Menu
</span><span class="cx">         if ( $output_type == 'menu' ) {
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationdynamicfunctionsdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -115,7 +115,7 @@
</span><span class="cx">         jQuery(this).find('dl > dt > span > #remove' + j).attr('onClick', 'removeitem(' + i + ')');
</span><span class="cx">         jQuery(this).find('dl > dt > span > #remove' + j).attr('id','remove' + i);
</span><span class="cx">
</span><del>-         jQuery('#licount').attr('value',i);
</del><ins>+         jQuery('#li-count').attr('value',i);
</ins><span class="cx">
</span><span class="cx"> });
</span><span class="cx">
</span><span class="lines">@@ -142,16 +142,16 @@
</span><span class="cx">         var inputdescription = '';
</span><span class="cx">         var inputicon = '';
</span><span class="cx">
</span><del>-        if (additemtype == 'Custom')
</del><ins>+        if (additemtype == navMenuL10n.custom)
</ins><span class="cx">         {
</span><del>-                inputvaluevarname = document.getElementById('custom_menu_item_name').value;
-                inputvaluevarurl = document.getElementById('custom_menu_item_url').value;
</del><ins>+                inputvaluevarname = document.getElementById('custom-menu-item-name').value;
+                inputvaluevarurl = document.getElementById('custom-menu-item-url').value;
</ins><span class="cx">                 inputitemid = '';
</span><span class="cx">                 inputparentid = '';
</span><span class="cx">                 inputlinktype = 'custom';
</span><del>-                inputdescription = document.getElementById('custom_menu_item_description').value;
</del><ins>+                inputdescription = '';
</ins><span class="cx">         }
</span><del>-        else if (additemtype == 'Page')
</del><ins>+        else if (additemtype == navMenuL10n.page)
</ins><span class="cx">         {
</span><span class="cx">                 inputvaluevarname = htmlentities(itemtext.toString());
</span><span class="cx">                 inputvaluevarurl = itemurl.toString();
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx">                 inputdescription = htmlentities(itemdescription.toString());
</span><span class="cx">
</span><span class="cx">         }
</span><del>-        else if (additemtype == 'Category')
</del><ins>+        else if (additemtype == navMenuL10n.category)
</ins><span class="cx">         {
</span><span class="cx">                 inputvaluevarname = htmlentities(itemtext.toString());
</span><span class="cx">                 inputvaluevarurl = itemurl.toString();
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationdynamicfunctionsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/custom-navigation-dynamic-functions.js (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-dynamic-functions.js        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-admin/js/custom-navigation-dynamic-functions.js        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -1 +1 @@
</span><del>-function removeitem(o){var todelete=document.getElementById("menu-"+o);if(todelete){var parenttodelete=document.getElementById("menu-"+o).parentNode;throwaway_node=parenttodelete.removeChild(todelete)}updatepostdata()}function edititem(o){itemTitle=jQuery("#title"+o).attr("value");itemURL=jQuery("#linkurl"+o).attr("value");itemAnchorTitle=jQuery("#anchortitle"+o).attr("value");itemNewWindow=jQuery("#newwindow"+o).attr("value");itemDesc=jQuery("#description"+o).attr("value");jQuery("#dialog-confirm").dialog("option","itemID",o);jQuery("#dialog-confirm").dialog("open");jQuery("#edittitle").attr("value",itemTitle);jQuery("#editlink").attr("value",itemURL);jQuery("#editanchortitle").attr("value",itemAnchorTitle);jQuery("#editnewwindow option[value='"+itemNewWindow+"']").attr("selected","selected");jQuery("#editdescription").attr("value",itemDesc)}function updatepostdata(){var i=0;jQuery("#custom-nav").find("li").each(function(i){i=i+1;var j=jQuery(this).attr("value");jQuery(this).find("#position"+j).attr("value",i);jQuery(this).attr("id","menu-"+i);jQuery(this).attr("value",i);jQuery(this).find("#dbid"+j).attr("name","dbid"+i);jQuery(this).find("#dbid"+j).attr("id","dbid"+i);jQuery(this).find("#postmenu"+j).attr("name","postmenu"+i);jQuery(this).find("#postmenu"+j).attr("id","postmenu"+i);var p=jQuery(this).find("#parent"+j).parent().parent().parent().attr("value");jQuery(this).find("#parent"+j).attr("name","parent"+i);jQuery(this).find("#parent"+j).attr("id","parent"+i);if(p){}else{p=0}jQuery(this).find("#parent"+j).attr("value",p);jQuery(this).find("#title"+j).attr("name","title"+i);jQuery(this).find("#title"+j).attr("id","title"+i);jQuery(this).find("#linkurl"+j).attr("name","linkurl"+i);jQuery(this).find("#linkurl"+j).attr("id","linkurl"+i);jQuery(this).find("#description"+j).attr("name","description"+i);jQuery(this).find("#description"+j).attr("id","description"+i);jQuery(this).find("#icon"+j).attr("name","icon"+i);jQuery(this).find("#icon"+j).attr("id","icon"+i);jQuery(this).find("#position"+j).attr("name","position"+i);jQuery(this).find("#position"+j).attr("id","position"+i);jQuery(this).find("#linktype"+j).attr("name","linktype"+i);jQuery(this).find("#linktype"+j).attr("id","linktype"+i);jQuery(this).find("#anchortitle"+j).attr("name","anchortitle"+i);jQuery(this).find("#anchortitle"+j).attr("id","anchortitle"+i);jQuery(this).find("#newwindow"+j).attr("name","newwindow"+i);jQuery(this).find("#newwindow"+j).attr("id","newwindow"+i);jQuery(this).find("dl > dt > span > #remove"+j).attr("value",i);jQuery(this).find("dl > dt > span > #remove"+j).attr("onClick","removeitem("+i+")");jQuery(this).find("dl > dt > span > #remove"+j).attr("id","remove"+i);jQuery("#licount").attr("value",i)})}function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparentid,itemdescription){var inputvaluevarname="";var inputvaluevarurl="";var inputitemid="";var inputparentid="";var inputdescription="";var inputicon="";if(additemtype=="Custom"){inputvaluevarname=document.getElementById("custom_menu_item_name").value;inputvaluevarurl=document.getElementById("custom_menu_item_url").value;inputitemid="";inputparentid="";inputlinktype="custom";inputdescription=document.getElementById("custom_menu_item_description").value}else{if(additemtype=="Page"){inputvaluevarname=htmlentities(itemtext.toString());inputvaluevarurl=itemurl.toString();inputitemid=itemid.toString();inputparentid="0";inputlinktype="page";inputdescription=htmlentities(itemdescription.toString())}else{if(additemtype=="Category"){inputvaluevarname=htmlentities(itemtext.toString());inputvaluevarurl=itemurl.toString();inputitemid=itemid.toString();inputparentid="0";inputlinktype="category";inputdescription=htmlentities(itemdescription.toString())}else{inputvaluevarname="";inputvaluevarname="";inputitemid="";inputparentid="";inputlinktype="custom";inputdescription=""}}}var count=document.getElementById("custom-nav").getElementsByTagName("li").length+1;var randomnumber=count;var validatetest=0;try{var test=document.getElementById("menu-"+randomnumber.toString()).value}catch(err){validatetest=1}while(validatetest==0){randomnumber=randomnumber+1;try{var test2=document.getElementById("menu-"+randomnumber.toString()).value}catch(err){validatetest=1}}jQuery(".maintitle").after('<div id="message" class="updated fade below-h2"><p>Menu Item added!</p></div>');jQuery("#message").animate({opacity:1},2000).fadeOut(300,function(){jQuery(this).remove()});jQuery("#custom-nav").append('<li id="menu-'+randomnumber+'" value="'+randomnumber+'"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="title">'+inputvaluevarname+'</span><span class="controls"><span class="type">'+additemtype+'</span><a id="edit'+randomnumber+'" onclick="edititem('+randomnumber+')" value="'+randomnumber+'"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="'+templatedir+'/wp-admin/images/ico-edit.png" /></a> <a id="remove'+randomnumber+'" onclick="removeitem('+randomnumber+')" value="'+randomnumber+'"><img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="'+templatedir+'/wp-admin/images/ico-close.png" /></a> <a href="'+inputvaluevarurl+'" target="_blank"><img alt="View Custom Link" title="View Custom Link" src="'+templatedir+'/wp-admin/images/ico-viewpage.png" /></a></span></dt></dl><a class="hide" href="'+inputvaluevarurl+'">'+inputvaluevarname+'</a><input type="hidden" name="postmenu'+randomnumber+'" id="postmenu'+randomnumber+'" value="'+inputitemid+'" /><input type="hidden" name="parent'+randomnumber+'" id="parent'+randomnumber+'" value="'+inputparentid+'" /><input type="hidden" name="title'+randomnumber+'" id="title'+randomnumber+'" value="'+inputvaluevarname+'" /><input type="hidden" name="linkurl'+randomnumber+'" id="linkurl'+randomnumber+'" value="'+inputvaluevarurl+'" /><input type="hidden" name="description'+randomnumber+'" id="description'+randomnumber+'" value="'+inputdescription+'" /><input type="hidden" name="icon'+randomnumber+'" id="icon'+randomnumber+'" value="'+inputicon+'" /><input type="hidden" name="position'+randomnumber+'" id="position'+randomnumber+'" value="'+randomnumber+'" /><input type="hidden" name="linktype'+randomnumber+'" id="linktype'+randomnumber+'" value="'+inputlinktype+'" /><input type="hidden" name="anchortitle'+randomnumber+'" id="anchortitle'+randomnumber+'" value="'+inputvaluevarname+'" /><input type="hidden" name="newwindow'+randomnumber+'" id="newwindow'+randomnumber+'" value="0" /></li>');jQuery("#menu-"+randomnumber+"").draggable({handle:" > dl",opacity:0.8,addClasses:false,helper:"clone",zIndex:100});jQuery("#menu-"+randomnumber+" dl, #menu-"+randomnumber+" .dropzone").droppable({accept:"#"+randomnumber+", #custom-nav li",tolerance:"pointer",drop:function(e,ui){var li=jQuery(this).parent();var child=!jQuery(this).hasClass("dropzone");if(child&&li.children("ul").length==0){li.append("<ul/>")}if(child){li.children("ul").append(ui.draggable)}else{li.before(ui.draggable)}li.find("dl,.dropzone").css({backgroundColor:"",borderColor:""});var draggablevalue=ui.draggable.attr("value");var droppablevalue=li.attr("value");li.find("#menu-"+draggablevalue).find("#parent"+draggablevalue).val(droppablevalue);jQuery(this).parent().find("dt").removeAttr("style");jQuery(this).parent().find("div:first").removeAttr("style")},over:function(){if(jQuery(this).attr("class")=="dropzone ui-droppable"){jQuery(this).parent().find("div:first").css("background","none").css("height","50px")}else{if(jQuery(this).attr("class")=="ui-droppable"){jQuery(this).parent().find("dt:first").css("background","#d8d8d8")}else{}}var parentid=jQuery(this).parent().attr("id")},out:function(){jQuery(this).parent().find("dt").removeAttr("style");jQuery(this).parent().find("div:first").removeAttr("style");jQuery(this).filter(".dropzone").css({borderColor:""})}});updatepostdata()};
</del><span class="cx">\ No newline at end of file
</span><ins>+function removeitem(c){var b=document.getElementById("menu-"+c);if(b){var a=document.getElementById("menu-"+c).parentNode;throwaway_node=a.removeChild(b)}updatepostdata()}function edititem(a){itemTitle=jQuery("#title"+a).attr("value");itemURL=jQuery("#linkurl"+a).attr("value");itemAnchorTitle=jQuery("#anchortitle"+a).attr("value");itemNewWindow=jQuery("#newwindow"+a).attr("value");itemDesc=jQuery("#description"+a).attr("value");jQuery("#dialog-confirm").dialog("option","itemID",a);jQuery("#dialog-confirm").dialog("open");jQuery("#edittitle").attr("value",itemTitle);jQuery("#editlink").attr("value",itemURL);jQuery("#editanchortitle").attr("value",itemAnchorTitle);jQuery("#editnewwindow option[value='"+itemNewWindow+"']").attr("selected","selected");jQuery("#editdescription").attr("value",itemDesc)}function updatepostdata(){var a=0;jQuery("#custom-nav").find("li").each(function(c){c=c+1;var b=jQuery(this).attr("value");jQuery(this).find("#position"+b).attr("value",c);jQuery(this).attr("id","menu-"+c);jQuery(this).attr("value",c);jQuery(this).find("#dbid"+b).attr("name","dbid"+c);jQuery(this).find("#dbid"+b).attr("id","dbid"+c);jQuery(this).find("#postmenu"+b).attr("name","postmenu"+c);jQuery(this).find("#postmenu"+b).attr("id","postmenu"+c);var d=jQuery(this).find("#parent"+b).parent().parent().parent().attr("value");jQuery(this).find("#parent"+b).attr("name","parent"+c);jQuery(this).find("#parent"+b).attr("id","parent"+c);if(d){}else{d=0}jQuery(this).find("#parent"+b).attr("value",d);jQuery(this).find("#title"+b).attr("name","title"+c);jQuery(this).find("#title"+b).attr("id","title"+c);jQuery(this).find("#linkurl"+b).attr("name","linkurl"+c);jQuery(this).find("#linkurl"+b).attr("id","linkurl"+c);jQuery(this).find("#description"+b).attr("name","description"+c);jQuery(this).find("#description"+b).attr("id","description"+c);jQuery(this).find("#icon"+b).attr("name","icon"+c);jQuery(this).find("#icon"+b).attr("id","icon"+c);jQuery(this).find("#position"+b).attr("name","position"+c);jQuery(this).find("#position"+b).attr("id","position"+c);jQuery(this).find("#linktype"+b).attr("name","linktype"+c);jQuery(this).find("#linktype"+b).attr("id","linktype"+c);jQuery(this).find("#anchortitle"+b).attr("name","anchortitle"+c);jQuery(this).find("#anchortitle"+b).attr("id","anchortitle"+c);jQuery(this).find("#newwindow"+b).attr("name","newwindow"+c);jQuery(this).find("#newwindow"+b).attr("id","newwindow"+c);jQuery(this).find("dl > dt > span > #remove"+b).attr("value",c);jQuery(this).find("dl > dt > span > #remove"+b).attr("onClick","removeitem("+c+")");jQuery(this).find("dl > dt > span > #remove"+b).attr("id","remove"+c);jQuery("#li-count").attr("value",c)})}function appendToList(b,s,d,n,h,l,e){var k="";var c="";var r="";var o="";var i="";var a="";if(s==navMenuL10n.custom){k=document.getElementById("custom-menu-item-name").value;c=document.getElementById("custom-menu-item-url").value;r="";o="";inputlinktype="custom";i=""}else{if(s==navMenuL10n.page){k=htmlentities(d.toString());c=n.toString();r=h.toString();o="0";inputlinktype="page";i=htmlentities(e.toString())}else{if(s==navMenuL10n.category){k=htmlentities(d.toString());c=n.toString();r=h.toString();o="0";inputlinktype="category";i=htmlentities(e.toString())}else{k="";k="";r="";o="";inputlinktype="custom";i=""}}}var g=document.getElementById("custom-nav").getElementsByTagName("li").length+1;var p=g;var m=0;try{var q=document.getElementById("menu-"+p.toString()).value}catch(f){m=1}while(m==0){p=p+1;try{var j=document.getElementById("menu-"+p.toString()).value}catch(f){m=1}}jQuery(".maintitle").after('<div id="message" class="updated fade below-h2"><p>Menu Item added!</p></div>');jQuery("#message").animate({opacity:1},2000).fadeOut(300,function(){jQuery(this).remove()});jQuery("#custom-nav").append('<li id="menu-'+p+'" value="'+p+'"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="title">'+k+'</span><span class="controls"><span class="type">'+s+'</span><a id="edit'+p+'" onclick="edititem('+p+')" value="'+p+'"><img class="edit" alt="Edit Menu Item" title="Edit Menu Item" src="'+b+'/wp-admin/images/ico-edit.png" /></a> <a id="remove'+p+'" onclick="removeitem('+p+')" value="'+p+'"><img class="remove" alt="Remove from Custom Menu" title="Remove from Custom Menu" src="'+b+'/wp-admin/images/ico-close.png" /></a> <a href="'+c+'" target="_blank"><img alt="View Custom Link" title="View Custom Link" src="'+b+'/wp-admin/images/ico-viewpage.png" /></a></span></dt></dl><a class="hide" href="'+c+'">'+k+'</a><input type="hidden" name="postmenu'+p+'" id="postmenu'+p+'" value="'+r+'" /><input type="hidden" name="parent'+p+'" id="parent'+p+'" value="'+o+'" /><input type="hidden" name="title'+p+'" id="title'+p+'" value="'+k+'" /><input type="hidden" name="linkurl'+p+'" id="linkurl'+p+'" value="'+c+'" /><input type="hidden" name="description'+p+'" id="description'+p+'" value="'+i+'" /><input type="hidden" name="icon'+p+'" id="icon'+p+'" value="'+a+'" /><input type="hidden" name="position'+p+'" id="position'+p+'" value="'+p+'" /><input type="hidden" name="linktype'+p+'" id="linktype'+p+'" value="'+inputlinktype+'" /><input type="hidden" name="anchortitle'+p+'" id="anchortitle'+p+'" value="'+k+'" /><input type="hidden" name="newwindow'+p+'" id="newwindow'+p+'" value="0" /></li>');jQuery("#menu-"+p+"").draggable({handle:" > dl",opacity:0.8,addClasses:false,helper:"clone",zIndex:100});jQuery("#menu-"+p+" dl, #menu-"+p+" .dropzone").droppable({accept:"#"+p+", #custom-nav li",tolerance:"pointer",drop:function(x,w){var t=jQuery(this).parent();var y=!jQuery(this).hasClass("dropzone");if(y&&t.children("ul").length==0){t.append("<ul/>")}if(y){t.children("ul").append(w.draggable)}else{t.before(w.draggable)}t.find("dl,.dropzone").css({backgroundColor:"",borderColor:""});var v=w.draggable.attr("value");var u=t.attr("value");t.find("#menu-"+v).find("#parent"+v).val(u);jQuery(this).parent().find("dt").removeAttr("style");jQuery(this).parent().find("div:first").removeAttr("style")},over:function(){if(jQuery(this).attr("class")=="dropzone ui-droppable"){jQuery(this).parent().find("div:first").css("background","none").css("height","50px")}else{if(jQuery(this).attr("class")=="ui-droppable"){jQuery(this).parent().find("dt:first").css("background","#d8d8d8")}else{}}var t=jQuery(this).parent().attr("id")},out:function(){jQuery(this).parent().find("dt").removeAttr("style");jQuery(this).parent().find("div:first").removeAttr("style");jQuery(this).filter(".dropzone").css({borderColor:""})}});updatepostdata()};
</ins><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 (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/nav-menus.php        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-admin/nav-menus.php        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -31,25 +31,25 @@
</span><span class="cx">
</span><span class="cx"> function wp_reset_nav_menu() {
</span><span class="cx">         wp_nav_menu_setup(true);
</span><del>-
</del><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-$messagesdiv = '';
</del><ins>+$messages_div = '';
</ins><span class="cx"> $menu_id_in_edit = 0;
</span><span class="cx"> $updated = false;
</span><ins>+$advanced_option_descriptions = 'no';
</ins><span class="cx">
</span><span class="cx"> // Check which menu is selected and if menu is in edit already
</span><del>-if ( isset( $_GET['edit_menu'] ) ) {
-        $menu_selected_id = (int) $_GET['edit_menu'];
</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="cx">
</span><del>-if ( isset( $_POST[ 'delete_menu' ] ) && $menu_selected_id > 0 ) {
</del><ins>+if ( isset( $_POST[ 'delete-menu' ] ) && $menu_selected_id > 0 ) {
</ins><span class="cx">         wp_delete_nav_menu( $menu_selected_id );
</span><span class="cx">         $menu_selected_id = 0;
</span><span class="cx">         $updated = true;
</span><span class="lines">@@ -70,52 +70,51 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-if ( isset( $_POST['licount'] ) )
-        $postCounter = $_POST['licount'];
</del><ins>+if ( isset( $_POST['li-count'] ) )
+        $post_counter = $_POST['li-count'];
</ins><span class="cx"> else
</span><del>-        $postCounter = 0;
</del><ins>+        $post_counter = 0;
</ins><span class="cx">
</span><span class="cx"> // Create a new menu. Menus are stored as terms in the 'menu' taxonomy.
</span><del>-if ( isset( $_POST['add_menu'] ) && ! $updated ) {
-        update_option( 'wp_custom_nav_menu', $_POST['enable_wp_menu'] ); // Do we need this?
-        $insert_menu_name = $_POST['add_menu_name'];
</del><ins>+if ( isset( $_POST['add-menu'] ) && ! $updated ) {
+        $insert_menu_name = $_POST['add-menu-name'];
</ins><span class="cx">
</span><del>-        if ( $insert_menu_name != '' ) {
-                $menu = wp_create_nav_menu($insert_menu_name);
-                if ( is_wp_error($menu) ) {
-                        $messagesdiv = '<div id="message" class="error fade below-h2"><p>' . esc_html( $menu->get_error_message() ) . '</p></div>';
</del><ins>+        if ( $insert_menu_name ) {
+                $menu = wp_create_nav_menu( $insert_menu_name );
+                if ( is_wp_error( $menu ) ) {
+                        $messages_div = '<div id="message" class="error fade below-h2"><p>' . $menu->get_error_message() . '</p></div>';
</ins><span class="cx">                 } else {
</span><span class="cx">                         $custom_menus[$menu->term_id] = $menu;
</span><span class="cx">                         $menu_selected_id = $menu->term_id;
</span><span class="cx">                         $menu_id_in_edit = $menu_selected_id;
</span><span class="cx">                         $menu_title = $menu->name;
</span><del>-                        $messagesdiv = '<div id="message" class="updated fade below-h2"><p>' . esc_html( sprintf( __('"%s" menu has been created!'), $menu->name ) ) . '</p></div>';
-                        $postCounter = 0;
</del><ins>+                        $messages_div = '<div id="message" class="updated fade below-h2"><p>' . sprintf( __('&#8220;%s&#8221; menu has been created.'), esc_html( $menu->name ) ) . '</p></div>';
+                        $post_counter = 0;
</ins><span class="cx">                 }
</span><span class="cx">         } else {
</span><del>-                $messagesdiv = '<div id="message" class="error fade below-h2"><p>' . __('Please enter a valid menu name.') . '</p></div>';
</del><ins>+                $messages_div = '<div id="message" class="error fade below-h2"><p>' . __('Please enter a valid menu name.') . '</p></div>';
</ins><span class="cx">         }
</span><span class="cx">         $updated = true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-if ( $postCounter > 0 && $menu_selected_id > 0 && ! $updated ) {
</del><ins>+if ( $post_counter > 0 && $menu_selected_id > 0 && ! $updated ) {
</ins><span class="cx">         $menu_items = wp_get_nav_menu_items( $menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID') );
</span><span class="cx">         $parent_menu_ids = array();
</span><span class="cx">
</span><span class="cx">         // Loop through all POST variables
</span><del>-        for ( $k = 1; $k <= $postCounter; $k++ ) {
-                if (isset($_POST['dbid'.$k])) { $db_id = $_POST['dbid'.$k]; } else { $db_id = 0; }
-                if (isset($_POST['postmenu'.$k])) { $object_id = $_POST['postmenu'.$k]; } else { $object_id = 0; }
-                if (isset($_POST['parent'.$k])) { $parent_id = $_POST['parent'.$k]; } else { $parent_id = 0; }
-                if (isset($_POST['title'.$k])) { $custom_title = $_POST['title'.$k]; } else { $custom_title = ''; }
-                if (isset($_POST['linkurl'.$k])) { $custom_linkurl = $_POST['linkurl'.$k]; } else { $custom_linkurl = ''; }
-                if (isset($_POST['description'.$k])) { $custom_description = $_POST['description'.$k]; } else { $custom_description = ''; }
</del><ins>+        for ( $k = 1; $k <= $post_counter; $k++ ) {
+                $db_id = isset( $_POST['dbid'.$k] )? $_POST['dbid'.$k] : 0;
+                $object_id = isset( $_POST['postmenu'.$k] )? $_POST['postmenu'.$k] : 0;
+                $parent_id = isset( $_POST['parent'.$k] )? $_POST['parent'.$k] : 0;
+                $custom_title = isset( $_POST['title'.$k] )? $_POST['title'.$k] : '';
+                $custom_linkurl = isset( $_POST['linkurl'.$k] )? $_POST['linkurl'.$k] : '';
+                $custom_description = isset( $_POST['description'.$k] )? $_POST['description'.$k] : '';
</ins><span class="cx">                 // doesn't seem to be used by UI
</span><del>-                if (isset($_POST['icon'.$k])) { $icon = $_POST['icon'.$k]; } else { $icon = 0; }
-                if (isset($_POST['position'.$k])) { $position = $_POST['position'.$k]; } else { $position = 0; }
-                if (isset($_POST['linktype'.$k])) { $linktype = $_POST['linktype'.$k]; } else { $linktype = 'custom'; }
-                if (isset($_POST['anchortitle'.$k])) { $custom_anchor_title = $_POST['anchortitle'.$k]; } else { $custom_anchor_title = $custom_title; }
-                if (isset($_POST['newwindow'.$k])) { $new_window = $_POST['newwindow'.$k]; } else { $new_window = 0; }
</del><ins>+                $icon = isset( $_POST['icon'.$k] )? $_POST['icon'.$k] : 0;
+                $position = isset( $_POST['position'.$k] )? $_POST['position'.$k] : 0;
+                $linktype = isset( $_POST['linktype'.$k] )? $_POST['linktype'.$k] : 'custom';
+                $custom_anchor_title = isset( $_POST['anchortitle'.$k] )? $_POST['anchortitle'.$k] : $custom_title;
+                $new_window = isset( $_POST['newwindow'.$k] )? $_POST['newwindow'.$k] : 0;
</ins><span class="cx">
</span><span class="cx">                 $post = array( 'post_status' => 'publish', 'post_type' => 'nav_menu_item', 'post_author' => $user_ID,
</span><span class="cx">                         'ping_status' => 0, 'post_parent' => 0, 'menu_order' => $position,
</span><span class="lines">@@ -125,8 +124,8 @@
</span><span class="cx">                         $post['post_content_filtered'] = '_blank';
</span><span class="cx">                 else
</span><span class="cx">                         $post['post_content_filtered'] = '';
</span><del>-                if ( $parent_id > 0 && isset( $parent_menu_ids[ $parent_id ] ) )
-                        $post[ 'post_parent' ] = $parent_menu_ids[ $parent_id ];
</del><ins>+                if ( $parent_id > 0 && isset( $parent_menu_ids[$parent_id] ) )
+                        $post['post_parent'] = $parent_menu_ids[$parent_id];
</ins><span class="cx">
</span><span class="cx">                 // New menu item
</span><span class="cx">                 if ( $db_id == 0 ) {
</span><span class="lines">@@ -138,16 +137,15 @@
</span><span class="cx">                 }
</span><span class="cx">                 $parent_menu_ids[ $k ] = $db_id;
</span><span class="cx">
</span><del>-                update_post_meta($db_id, 'menu_type', $linktype);
-                update_post_meta($db_id, 'object_id', $object_id);
</del><ins>+                update_post_meta( $db_id, 'menu_type', $linktype );
+                update_post_meta( $db_id, 'object_id', $object_id );
</ins><span class="cx">         }
</span><span class="cx">         if ( !empty( $menu_items ) ) {
</span><span class="cx">                 foreach ( array_keys( $menu_items ) as $menu_id ) {
</span><span class="cx">                         wp_delete_post( $menu_id );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        // DISPLAY SUCCESS MESSAGE IF POST CORRECT
-        $messagesdiv = '<div id="message" class="updated fade below-h2"><p>' . __('The menu has been updated.') . '</p></div>';
</del><ins>+        $messages_div = '<div id="message" class="updated fade below-h2"><p>' . __('The menu has been updated.') . '</p></div>';
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ?>
</span><span class="lines">@@ -155,51 +153,48 @@
</span><span class="cx"> <?php screen_icon(); ?>
</span><span class="cx"> <h2><?php esc_html_e('Menus') ?></h2>
</span><span class="cx">         <form onsubmit="updatepostdata()" action="<?php echo admin_url( 'nav-menus.php' ); ?>" method="post" enctype="multipart/form-data">
</span><del>-        <?php if ( ! empty( $custom_menus ) && count( $custom_menus ) > 1 ) { ?>
</del><ins>+<?php if ( ! empty( $custom_menus ) && count( $custom_menus ) > 1 ): ?>
</ins><span class="cx">                 <ul class="subsubsub">
</span><span class="cx"> <?php
</span><span class="cx">                                 foreach ( $custom_menus as $menu ) {
</span><del>-                                        $sep = end($custom_menus) == $menu ? '' : ' | ';
-                                        // $menu_term = get_term( $menu, 'nav_menu' );
</del><ins>+                                        $sep = end( $custom_menus ) == $menu ? '' : ' | ';
</ins><span class="cx">                                         if ( ( $menu_id_in_edit == $menu->term_id ) || ( $menu_selected_id == $menu->term_id ) ) { ?>
</span><del>-                                                <li><a href='nav-menus.php?edit_menu=<?php echo esc_attr($menu->term_id); ?>' class="current"><?php echo esc_html( $menu->name ); ?></a><?php echo $sep; ?></li>
</del><ins>+                                                <li><a href='nav-menus.php?edit-menu=<?php echo esc_attr($menu->term_id); ?>' class="current"><?php echo esc_html( $menu->name ); ?></a><?php echo $sep; ?></li>
</ins><span class="cx"> <?php                                } else { ?>
</span><del>-                                                <li><a href='nav-menus.php?edit_menu=<?php echo esc_attr($menu->term_id); ?>'><?php echo esc_html( $menu->name ); ?></a><?php echo $sep; ?></li>
</del><ins>+                                                <li><a href='nav-menus.php?edit-menu=<?php echo esc_attr($menu->term_id); ?>'><?php echo esc_html( $menu->name ); ?></a><?php echo $sep; ?></li>
</ins><span class="cx"> <?php                                }
</span><span class="cx">                                 }
</span><span class="cx"> ?>
</span><span class="cx">                 </ul>
</span><span class="cx">                 <div class="clear"></div>
</span><del>-<?php } ?>
</del><ins>+<?php endif ?>
</ins><span class="cx">
</span><span class="cx">         <div class="hide-if-js error"><p><?php _e('You do not have JavaScript enabled in your browser. Please enable it to access the Menus functionality.'); ?></p></div>
</span><span class="cx">         <div class="hide-if-no-js">
</span><span class="cx">         <div id="pages-left">
</span><span class="cx">                 <div class="inside">
</span><span class="cx">                 <?php if ( ! empty( $custom_menus ) ) : ?>
</span><del>-                <?php echo $messagesdiv; ?>
</del><ins>+                <?php echo $messages_div; ?>
</ins><span class="cx">
</span><del>-                <input type="hidden" name="licount" id="licount" value="0" />
-                <input type="hidden" name="menu_id_in_edit" id="menu_id_in_edit" value="<?php echo esc_attr($menu_selected_id); ?>" />
</del><ins>+                <input type="hidden" name="li-count" id="li-count" value="0" />
+                <input type="hidden" name="menu-id-in-edit" id="menu-id-in-edit" value="<?php echo esc_attr( $menu_selected_id ); ?>" />
</ins><span class="cx">
</span><span class="cx">                 <div class="sidebar-name">
</span><span class="cx">                         <div class="sidebar-name-arrow">
</span><span class="cx">                                 <br/>
</span><span class="cx">                         </div>
</span><del>-                        <h3><?php echo esc_html($menu_title); ?></h3>
</del><ins>+                        <h3><?php echo esc_html( $menu_title ); ?></h3>
</ins><span class="cx">
</span><span class="cx">                 </div>
</span><span class="cx">
</span><span class="cx">                 <div id="nav-container">
</span><span class="cx">                         <ul id="custom-nav">
</span><span class="cx">
</span><del>-                <?php
-                //DISPLAY existing menu
</del><ins>+<?php
</ins><span class="cx">                 if ( $menu_selected_id > 0 ) {
</span><del>-                        wp_print_nav_menu( 'type=backend&name='.$menu_title.'&id='.$menu_selected_id );
</del><ins>+                        wp_print_nav_menu( array( 'type' => 'backend', 'name' => $menu_title, 'id' => $menu_selected_id ) );
</ins><span class="cx">                 }
</span><del>-                ?>
-
</del><ins>+?>
</ins><span class="cx">                         </ul>
</span><span class="cx">                 </div><!-- /#nav-container -->
</span><span class="cx">
</span><span class="lines">@@ -209,7 +204,7 @@
</span><span class="cx">                         updatepostdata();
</span><span class="cx">                 </script>
</span><span class="cx">                 <input id="save_bottom" name="save_bottom" type="submit" value="<?php esc_attr_e('Save All Changes'); ?>" />
</span><del>-                <input id="delete_menu" name="delete_menu" type="submit" value="<?php esc_attr_e('Delete This Menu'); ?>" />
</del><ins>+                <input id="delete-menu" name="delete-menu" type="submit" value="<?php esc_attr_e('Delete This Menu'); ?>" />
</ins><span class="cx">                 </p>
</span><span class="cx">
</span><span class="cx">         <?php else : ?>
</span><span class="lines">@@ -227,128 +222,71 @@
</span><span class="cx">                         <div class="widget-holder">
</span><span class="cx">
</span><span class="cx">                                 <span>
</span><del>-                                <input id="add_menu_name" name="add_menu_name" type="text" value="" />
-                                <input id="add_menu" type="submit" value="<?php esc_attr_e('Add Menu'); ?>" name="add_menu" class="button" />
</del><ins>+                                <input id="add-menu-name" name="add-menu-name" type="text" value="" />
+                                <input id="add-menu" type="submit" value="<?php esc_attr_e('Add Menu'); ?>" name="add-menu" class="button" />
</ins><span class="cx">                                 </span>
</span><span class="cx">                         </div>
</span><span class="cx">                 </div><!-- /.widgets-holder-wrap -->
</span><del>-<?php /* ?>
-                <?php $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options'); ?>
-                <div class="widgets-holder-wrap" style="display:none;">
-                        <div class="sidebar-name">
-                                <div class="sidebar-name-arrow"></div>
-                                <h3><?php esc_html_e('Top Level Menu Descriptions'); ?></h3>
-                        </div>
-                        <div class="widget-holder">
-                                <span><?php _e('Display Descriptions in Top Level Menu?'); ?></span>
-
-                                <?php
-                                // UPDATE and DISPLAY Menu Description Option
-                                if ( isset($_POST['menu-descriptions']) ) {
-                                        if ( !isset($_POST['switch_menu']) ) {
-                                                $menu_options_to_edit = $_POST['menu_id_in_edit'];
-                                                update_option('wp_settings_custom_nav_'.$menu_options_to_edit.'_descriptions',$_POST['menu-descriptions']);
-                                        }
-                                }
-
-                                if ( $menu_id_in_edit > 0 )
-                                        $checkedraw = get_option('wp_settings_custom_nav_'.$menu_id_in_edit.'_descriptions');
-                                else
-                                        $checkedraw = get_option('wp_settings_custom_nav_'.$menu_selected_id.'_descriptions');
-
-                                $checked = strtolower($checkedraw);
-
-                                if ( $advanced_option_descriptions == 'no' )
-                                        $checked = 'no';
-                                ?>
-
-                                <span class="checkboxes">
-                                        <label><?php _e('Yes'); ?></label><input type="radio" name="menu-descriptions" value="yes" <?php if ($checked=='yes') { echo 'checked="checked"'; } ?> />
-                                        <label><?php _e('No'); ?></label><input type="radio" name="menu-descriptions" value="no" <?php if ($checked=='yes') { } else { echo 'checked="checked"'; } ?> />
-                                </span><!-- /.checkboxes -->
-                                </form>
-                                <div class="fix"></div>
-                        </div>
-                </div><!-- /.widgets-holder-wrap -->
-<?php */ ?>
</del><span class="cx">                 <div class="widgets-holder-wrap">
</span><span class="cx">                         <div class="sidebar-name">
</span><span class="cx">                                 <div class="sidebar-name-arrow"></div>
</span><span class="cx">                                 <h3><?php esc_html_e('Add an Existing Page'); ?></h3>
</span><span class="cx">                         </div>
</span><span class="cx">                         <div class="widget-holder">
</span><del>-
-                                <?php
-                                $pages_args = array(
-                                'child_of' => 0,
-                                'sort_order' => 'ASC',
-                                'sort_column' => 'post_title',
-                                'hierarchical' => 1,
-                                'exclude' => '',
-                                'include' => '',
-                                'meta_key' => '',
-                                'meta_value' => '',
-                                'authors' => '',
-                                'parent' => -1,
-                                'exclude_tree' => '',
-                                'number' => '',
-                                'offset' => 0 );
-
-                                //GET all pages
-                                $pages_array = get_pages($pages_args);
-                                $page_name = '';
-                                //CHECK if pages exist
-                                if ( $pages_array ) {
-                                        foreach ( $pages_array as $post ) {
-                                                //Add page name to
-                                                $page_name .= htmlentities($post->post_title).'|';
-                                        }
-                                } else {
-                                        $page_name = __('No pages available');
-                                }
-                                ?>
-
-                                <script>
</del><ins>+<?php
+        $pages_args = array(
+                'child_of' => 0,
+                'sort_order' => 'ASC',
+                'sort_column' => 'post_title',
+                'hierarchical' => 1,
+                'exclude' => '',
+                'include' => '',
+                'meta_key' => '',
+                'meta_value' => '',
+                'authors' => '',
+                'parent' => -1,
+                'exclude_tree' => '',
+                'number' => '',
+                'offset' => 0
+        );
+        $page_name = '';
+        $pages_array = get_pages($pages_args);
+        if ( $pages_array ) {
+                foreach ( $pages_array as $post ) {
+                        $page_name .= $post->post_title . '|';
+                }
+        } else {
+                $page_name = __('No pages available');
+        }
+?>
+                                <script type="text/javascript" charset="<?php bloginfo('charset'); ?>">
</ins><span class="cx">                                         jQuery(document).ready(function(){
</span><del>-
-                                                //GET PHP pages
-                                                var dataposts = "<?php echo esc_js($page_name); ?>".split("|");
-
-                                                //Set autocomplete
-                                                jQuery("#page-search").autocomplete(dataposts);
-
-                                                //Handle autocomplete result
</del><ins>+                                                var posts = "<?php echo esc_js( $page_name ); ?>".split("|");
+                                                jQuery("#page-search").autocomplete(posts);
</ins><span class="cx">                                                 jQuery("#page-search").result(function(event, data, formatted) {
</span><span class="cx">                                                         jQuery('#existing-pages').css('display','block');
</span><span class="cx">                                                         jQuery("#existing-pages dt:contains('" + data + "')").css("display", "block");
</span><del>-
</del><span class="cx">                                                         jQuery('#show-pages').hide();
</span><span class="cx">                                                         jQuery('#hide-pages').show();
</span><del>-
</del><span class="cx">                                                 });
</span><span class="cx">                                                 jQuery('#existing-pages').css('display','none');
</span><span class="cx">                                         });
</span><span class="cx">                                 </script>
</span><del>-
</del><span class="cx">                                 <input type="text" onfocus="jQuery('#page-search').attr('value','');" id="page-search" value="<?php esc_attr_e('Search Pages'); ?>" />
</span><span class="cx">
</span><del>-                                <a id="show-pages" style="cursor:pointer;" onclick="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();">View All</a>
-                                <a id="hide-pages" style="cursor:pointer;" onclick="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();">Hide All</a>
</del><ins>+                                <a id="show-pages" style="cursor:pointer;" onclick="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();"><?php _e('View All'); ?></a>
+                                <a id="hide-pages" style="cursor:pointer;" onclick="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();"><?php _e('Hide All'); ?></a>
</ins><span class="cx">
</span><span class="cx">                                 <script type="text/javascript">
</span><span class="cx">                                         jQuery('#hide-pages').hide();
</span><span class="cx">                                 </script>
</span><span class="cx">
</span><span class="cx">                                 <ul id="existing-pages" class="list">
</span><del>-                                        <?php
-                                                $intCounter = 0;
-                                                //Get default Pages
-                                                $intCounter = wp_nav_menu_get_pages($intCounter,'default');
-                                        ?>
</del><ins>+<?php
+        $items_counter = wp_nav_menu_get_pages( 0,'default' );
+?>
</ins><span class="cx">                                 </ul>
</span><del>-
</del><span class="cx">                                 <div class="fix"></div>
</span><del>-
</del><span class="cx">                         </div>
</span><span class="cx">                 </div><!-- /.widgets-holder-wrap -->
</span><span class="cx">
</span><span class="lines">@@ -359,76 +297,59 @@
</span><span class="cx">                         </div>
</span><span class="cx">                         <div class="widget-holder">
</span><span class="cx">
</span><del>-                                <?php
-                                // Custom GET categories query
-                                // @todo Use API
-                                $categories = $wpdb->get_results("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'category' ORDER BY term_id ASC");
-                                $cat_name = '';
-                                //CHECK for results
-                                if ( $categories ) {
-                                        foreach ( $categories as $category ) {
-                                                $cat_id = $category->term_id;
-
-                                                $cat_args = array(
-                                                        'orderby' => 'name',
-                                                        'include' => $cat_id,
-                                                        'hierarchical' => 1,
-                                                        'order' => 'ASC'
-                                                );
-
-                                                $category_names=get_categories($cat_args);
-
-                                                if ( isset($category_names[0]->name) ) {
-                                                        // Add category name to data string
-                                                        $cat_name .= htmlentities($category_names[0]->name).'|';
-                                                }
-                                        }
-                                } else {
-                                        $cat_name = __('No categories available');
-                                }
-                                ?>
-
-                                <script>
</del><ins>+<?php
+        // Custom GET categories query
+        // @todo Use API
+        $categories = $wpdb->get_results("SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = 'category' ORDER BY term_id ASC");
+        $cat_name = '';
+        if ( $categories ) {
+                foreach ( $categories as $category ) {
+                        $cat_id = $category->term_id;
+                        $cat_args = array(
+                                'orderby' => 'name',
+                                'include' => $cat_id,
+                                'hierarchical' => 1,
+                                'order' => 'ASC',
+                        );
+                        $category_names = get_categories( $cat_args );
+                        if ( isset( $category_names[0]->name ) ) {
+                                $cat_name .= htmlentities( $category_names[0]->name ).'|';
+                        }
+                }
+        } else {
+                $cat_name = __('No categories available');
+        }
+?>
+                                <script type="text/javascript" charset="<?php bloginfo('charset'); ?>">
</ins><span class="cx">                                         jQuery(document).ready(function(){
</span><del>-
-                                                //GET PHP categories
-                                                var datacats = "<?php echo esc_js($cat_name); ?>".split("|");
-
-                                                //Set autocomplete
-                                                jQuery("#cat-search").autocomplete(datacats);
-
-                                                //Handle autocomplete result
</del><ins>+                                                var categories = "<?php echo esc_js($cat_name); ?>".split("|");
+                                                jQuery("#cat-search").autocomplete(categories);
</ins><span class="cx">                                                 jQuery("#cat-search").result(function(event, data, formatted) {
</span><span class="cx">                                                         jQuery('#existing-categories').css('display','block');
</span><span class="cx">                                                         jQuery("#existing-categories dt:contains('" + data + "')").css("display", "block");
</span><del>-
</del><span class="cx">                                                         jQuery('#show-cats').hide();
</span><span class="cx">                                                         jQuery('#hide-cats').show();
</span><del>-
</del><span class="cx">                                                 });
</span><span class="cx">                                                 jQuery('#existing-categories').css('display','none');
</span><del>-
</del><span class="cx">                                         });
</span><span class="cx">                                 </script>
</span><span class="cx">
</span><span class="cx">                                 <input type="text" onfocus="jQuery('#cat-search').attr('value','');" id="cat-search" value="<?php esc_attr_e('Search Categories'); ?>" />
</span><span class="cx">
</span><del>-                                <a id="show-cats" style="cursor:pointer;" onclick="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();">View All</a>
-                                <a id="hide-cats" style="cursor:pointer;" onclick="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();">Hide All</a>
</del><ins>+                                <a id="show-cats" style="cursor:pointer;" onclick="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();"><?php _e('View All'); ?></a>
+                                <a id="hide-cats" style="cursor:pointer;" onclick="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();"><?php _e('Hide All'); ?></a>
</ins><span class="cx">
</span><span class="cx">                                 <script type="text/javascript">
</span><span class="cx">                                         jQuery('#hide-cats').hide();
</span><span class="cx">                                 </script>
</span><span class="cx">
</span><span class="cx">                                 <ul id="existing-categories" class="list">
</span><del>-                                        <?php
-                                                // Get default Categories
-                                                $intCounter = wp_nav_menu_get_categories($intCounter, 'default');
-                                        ?>
</del><ins>+<?php
+        $items_counter = wp_nav_menu_get_categories( $items_counter, 'default' );
+?>
</ins><span class="cx">                                 </ul>
</span><span class="cx">
</span><span class="cx">                                 <div class="fix"></div>
</span><del>-
</del><span class="cx">                         </div>
</span><span class="cx">                 </div><!-- /.widgets-holder-wrap -->
</span><span class="cx">
</span><span class="lines">@@ -438,15 +359,15 @@
</span><span class="cx">                                 <h3><?php esc_html_e('Add a Custom Url'); ?></h3>
</span><span class="cx">                         </div>
</span><span class="cx">                         <div class="widget-holder">
</span><del>-                                <input id="custom_menu_item_url" type="text" value="http://" />
-                                <label><?php _e('URL'); ?></label><br />
-                                <?php $templatedir = get_bloginfo('url'); ?>
-                                <input type="hidden" id="templatedir" value="<?php echo esc_attr($templatedir); ?>" />
-                                <input id="custom_menu_item_name" type="text" value="Menu Item" onfocus="jQuery('#custom_menu_item_name').attr('value','');" />
-                                <label><?php _e('Menu Text'); ?></label><br />
</del><ins>+                                <input id="custom-menu-item-url" type="text" value="http://" />
+                                <label for="custom-menu-item-url"><?php _e('URL'); ?></label><br />
+                                <?php $template_dir = get_bloginfo('url'); ?>
+                                <input type="hidden" id="template-dir" value="<?php echo esc_attr($template_dir); ?>" />
+                                <input id="custom-menu-item-name" type="text" value="<?php echo esc_attr( __('Menu Item') ); ?>" onfocus="jQuery('#custom-menu-item-name').attr('value','');" />
+                                <label for="custom-menu-item-name"><?php _e('Menu Text'); ?></label><br />
</ins><span class="cx">                                 <input id="custom_menu_item_description" type="text" value="<?php esc_attr_e('A description'); ?>" <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> onfocus="jQuery('#custom_menu_item_description').attr('value','');" />
</span><span class="cx">                                 <label <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> ><?php _e('Description'); ?></label>
</span><del>-                                <a class="addtomenu" onclick="appendToList('<?php echo $templatedir; ?>','Custom','','','','0','');jQuery('#custom_menu_item_name').attr('value','Menu Item');jQuery('#custom_menu_item_description').attr('value','A description');"><?php _e('Add to menu'); ?></a>
</del><ins>+                                <a class="addtomenu" onclick="appendToList('<?php echo $template_dir; ?>','<?php echo esc_js( _x('Custom', 'menu nav item type') ); ?>','','','','0','');jQuery('#custom-menu-item-name').attr('value','<?php echo esc_js( __('Menu Item') ); ?>');jQuery('#custom_menu_item_description').attr('value','<?php echo esc_js( __('A description') ); ?>');"><?php _e('Add to menu'); ?></a>
</ins><span class="cx">                                 <div class="fix"></div>
</span><span class="cx">                         </div>
</span><span class="cx">                 </div><!-- /.widgets-holder-wrap -->
</span><span class="lines">@@ -455,7 +376,7 @@
</span><span class="cx"> </div>
</span><span class="cx">
</span><span class="cx"> <div id="dialog-confirm" style="display:none;" title="<?php esc_attr_e('Edit Menu Item'); ?>">
</span><del>-        </label><input id="edittitle" type="text" name="edittitle" value="" /><label class="editlabel" for="edittitle"><?php _e('Menu Title'); ?></label><br />
</del><ins>+        <input id="edittitle" type="text" name="edittitle" value="" /><label class="editlabel" for="edittitle"><?php _e('Menu Title'); ?></label><br />
</ins><span class="cx">         <input id="editlink" type="text" name="editlink" value="" /><label class="editlabel" for="editlink"><?php _e('URL'); ?></label><br />
</span><span class="cx">         <input id="editanchortitle" type="text" name="editanchortitle" value="" /><label class="editlabel" for="editanchortitle"><?php _e('Link Title'); ?></label><br />
</span><span class="cx">         <select id="editnewwindow" name="editnewwindow">
</span><span class="lines">@@ -467,4 +388,4 @@
</span><span class="cx">
</span><span class="cx"> <?php
</span><span class="cx">
</span><del>-include("admin-footer.php");
</del><ins>+include("admin-footer.php");
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesdefaultwidgetsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/default-widgets.php (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/default-widgets.php        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-includes/default-widgets.php        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -1120,18 +1120,8 @@
</span><span class="cx">                                         <ul class="custom-nav">
</span><span class="cx">                                         <?php
</span><span class="cx">                                 }
</span><del>-
-                 ?>
-
-                                                <?php
-                                                        //DISPLAY custom navigation menu
-                                                        if ( get_option('wp_custom_nav_menu') == 'true' )
-                                                 wp_nav_menu( array('id' => $navmenu, 'name' => $wp_custom_nav_menu_name, 'desc' => $navwidgetdescription, 'format' => 'widget') );
-                                                ?>
-
-                                <?php
-
-                                        //DEVELOPER settings enabled
</del><ins>+                                wp_nav_menu( array('id' => $navmenu, 'name' => $wp_custom_nav_menu_name, 'desc' => $navwidgetdescription, 'format' => 'widget') );
+                                //DEVELOPER settings enabled
</ins><span class="cx">                                         if ( $navdeveloper == 'yes' ) {
</span><span class="cx">                                                 //DISPLAY Custom UL
</span><span class="cx">                                                 if ( $navul == 'yes' ) {
</span></span></pre></div>
<a id="trunkwpincludesnavmenutemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu-template.php (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu-template.php        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-includes/nav-menu-template.php        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx">                                                 <?php if ( 'backend' == $context ) { ?>
</span><span class="cx">                                                 <a><span class=""></span></a>
</span><span class="cx">                                                 <?php } else { ?>
</span><del>-                                                <a class="hide" href="<?php echo $menu_item->link; ?>"><?php echo $menu_item->title; ?></a>
</del><ins>+                                                <a class="hide" href="<?php echo $menu_item->link; ?>"><?php echo esc_html( $menu_item->title ); ?></a>
</ins><span class="cx">                                                 <?php } ?>
</span><span class="cx">                                                 <input type="hidden" name="dbid<?php echo $menu_item->menu_order; ?>" id="dbid<?php echo $menu_item->menu_order; ?>" value="<?php echo $menu_item->ID; ?>" />
</span><span class="cx">                                                 <input type="hidden" name="postmenu<?php echo $menu_item->menu_order; ?>" id="postmenu<?php echo $menu_item->menu_order; ?>" value="<?php echo esc_attr( get_post_meta( $menu_item->ID, 'object_id', true ) ); ?>" />
</span><span class="lines">@@ -148,11 +148,13 @@
</span><span class="cx">                 break;
</span><span class="cx">
</span><span class="cx">                 case 'default':
</span><del>-                        $templatedir = get_bloginfo('url');
</del><ins>+                        $template_dir = get_bloginfo('url');
</ins><span class="cx"> ?>
</span><span class="cx">                                         <dl>
</span><del>-                                        <dt>
-                                        <span class="title"><?php echo $menu_item->title; ?></span> <a onclick="appendToList('<?php echo esc_js( esc_url_raw( $templatedir ) ); ?>','<?php echo esc_js( $menu_item->append ); ?>','<?php echo esc_js( $menu_item->title ); ?>','<?php echo esc_js( $menu_item->link ); ?>','<?php echo esc_js( $menu_item->ID ); ?>','<?php echo esc_js( $menu_item->parent_item ); ?>','<?php echo esc_js( $menu_item->description ); ?>')" name="<?php echo esc_attr( $menu_item->title ); ?>" value="<?php echo esc_attr( $menu_item->link ); ?>"><img alt="<?php esc_attr_e('Add to Custom Menu'); ?>" title="<?php esc_attr_e('Add to Custom Menu'); ?>" src="<?php echo admin_url('images/ico-add.png'); ?>" /></a> </dt>
</del><ins>+                                                <dt>
+                                                        <span class="title"><?php echo $menu_item->title; ?></span>
+                                                        <a onclick="appendToList('<?php echo esc_js( esc_url_raw( $template_dir ) ); ?>','<?php echo esc_js( $menu_item->append ); ?>','<?php echo esc_js( $menu_item->title ); ?>','<?php echo esc_js( $menu_item->link ); ?>','<?php echo esc_js( $menu_item->ID ); ?>','<?php echo esc_js( $menu_item->parent_item ); ?>','<?php echo esc_js( $menu_item->description ); ?>')" name="<?php echo esc_attr( $menu_item->title ); ?>" value="<?php echo esc_attr( $menu_item->link ); ?>"><img alt="<?php esc_attr_e('Add to Custom Menu'); ?>" title="<?php esc_attr_e('Add to Custom Menu'); ?>" src="<?php echo admin_url('images/ico-add.png'); ?>" /></a>
+                                                </dt>
</ins><span class="cx">                                         </dl>
</span><span class="cx"> <?php
</span><span class="cx">                 break;
</span></span></pre></div>
<a id="trunkwpincludesnavmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu.php (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu.php        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-includes/nav-menu.php        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx">         $menu_exists = get_term_by( 'name', $menu_name, 'nav_menu' );
</span><span class="cx">
</span><span class="cx">         if ( $menu_exists )
</span><del>-                return WP_Error('menu_exists', sprintf( __('A menu named "%s" already exists; please try another name.'), $menu_exists->name ));
</del><ins>+                return new WP_Error('menu_exists', sprintf( __('A menu named &#8220;%s&#8221; already exists; please try another name.'), esc_html( $menu_exists->name ) ) );
</ins><span class="cx">
</span><span class="cx">         $menu = wp_insert_term( $menu_name, 'nav_menu' );
</span><span class="cx">         if ( is_wp_error($menu) )
</span><span class="lines">@@ -97,16 +97,16 @@
</span><span class="cx">                         $menu_item->link = get_page_link( $menu_item->object_id );
</span><span class="cx">
</span><span class="cx">                         if ( $menu_item->post_title == '' )
</span><del>-                                $menu_item->title = htmlentities( get_the_title( $menu_item->object_id ) );
</del><ins>+                                $menu_item->title = get_the_title( $menu_item->object_id );
</ins><span class="cx">                         else
</span><del>-                                $menu_item->title = htmlentities( $menu_item->post_title );
</del><ins>+                                $menu_item->title = $menu_item->post_title;
</ins><span class="cx">
</span><span class="cx">                         if ( $menu_item->post_content == '' )
</span><del>-                                $menu_item->description = htmlentities( get_post_meta( $menu_item->ID, 'page-description', true ) );
</del><ins>+                                $menu_item->description = get_post_meta( $menu_item->ID, 'page-description', true );
</ins><span class="cx">                         else
</span><del>-                                $menu_item->description = htmlentities( $menu_item->post_content );
</del><ins>+                                $menu_item->description = $menu_item->post_content;
</ins><span class="cx">                         $menu_item->target = '';
</span><del>-                        $menu_item->append = 'Page';
</del><ins>+                        $menu_item->append = _x('Page', 'menu nav item type');
</ins><span class="cx">                 break;
</span><span class="cx">                 // Category Menu Item
</span><span class="cx">                 case 'category':
</span><span class="lines">@@ -114,25 +114,25 @@
</span><span class="cx">
</span><span class="cx">                         if ( empty($menu_item->post_title) ) {
</span><span class="cx">                                 $title_raw = get_category( $menu_item->object_id );
</span><del>-                                $menu_item->title = htmlentities($title_raw->cat_name);
</del><ins>+                                $menu_item->title = $title_raw->cat_name;
</ins><span class="cx">                         } else {
</span><del>-                                $menu_item->title = htmlentities( $menu_item->post_title );
</del><ins>+                                $menu_item->title = $menu_item->post_title;
</ins><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         if ( empty($menu_item->post_content) )
</span><del>-                                $menu_item->description = htmlentities( strip_tags( category_description( $menu_item->object_id ) ) );
</del><ins>+                                $menu_item->description = strip_tags( category_description( $menu_item->object_id ) );
</ins><span class="cx">                         else
</span><del>-                                $menu_item->description = htmlentities( $menu_item->post_content );
</del><ins>+                                $menu_item->description = $menu_item->post_content;
</ins><span class="cx">                         $menu_item->target = '';
</span><del>-                        $menu_item->append = 'Category';
</del><ins>+                        $menu_item->append = _x('Category', 'menu nav item type');
</ins><span class="cx">                 break;
</span><span class="cx">                 default:
</span><span class="cx">                         // Custom Menu Item
</span><span class="cx">                         $menu_item->link = $menu_item->guid;
</span><del>-                        $menu_item->title = htmlentities( $menu_item->post_title );
-                        $menu_item->description = htmlentities( $menu_item->post_content );
</del><ins>+                        $menu_item->title = $menu_item->post_title;
+                        $menu_item->description = $menu_item->post_content;
</ins><span class="cx">                         $menu_item->target = 'target="_blank"';
</span><del>-                        $menu_item->append = 'Custom';
</del><ins>+                        $menu_item->append = _x('Custom', 'menu nav item type');
</ins><span class="cx">                 break;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx">
</span><span class="cx">                         //SET anchor title
</span><span class="cx">                         if (isset($wp_custom_nav_menu_items->custom_anchor_title)) {
</span><del>-                                $anchor_title = htmlentities($wp_custom_nav_menu_items->custom_anchor_title);
</del><ins>+                                $anchor_title = $wp_custom_nav_menu_items->custom_anchor_title;
</ins><span class="cx">                         }
</span><span class="cx">                         else {
</span><span class="cx">                                 $anchor_title = $title;
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-includes/script-loader.php        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -398,7 +398,13 @@
</span><span class="cx">
</span><span class="cx">                 // Custom Navigation
</span><span class="cx">                 $scripts->add( 'custom-navigation-default-items', "/wp-admin/js/custom-navigation-default-items$suffix.js", false, '20100223' );
</span><del>-                $scripts->add( 'custom-navigation-dynamic-functions', "/wp-admin/js/custom-navigation-dynamic-functions$suffix.js", false, '20100220' );
</del><ins>+                $scripts->add( 'custom-navigation-dynamic-functions', "/wp-admin/js/custom-navigation-dynamic-functions$suffix.js", false, '20100224' );
+                $scripts->localize( 'custom-navigation-dynamic-functions', 'navMenuL10n', array(
+                        'custom' => _x('Custom', 'menu nav item type'),
+                        'page' => _x('Page', 'menu nav item type'),
+                        'category' => _x('Category', 'menu nav item type')
+                ) );
+                
</ins><span class="cx">                 $scripts->add( 'custom-navigation-php-functions', "/wp-admin/js/custom-navigation-php-functions$suffix.js", false, '20100220' );
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -468,7 +474,7 @@
</span><span class="cx">         $styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' );
</span><span class="cx">         $styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
</span><span class="cx">         $styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
</span><del>-        $styles->add( 'custom-navigation', "/wp-admin/css/custom-navigation$suffix.css", array(), '20100223' );
</del><ins>+        $styles->add( 'custom-navigation', "/wp-admin/css/custom-navigation$suffix.css", array(), '20100224' );
</ins><span class="cx">
</span><span class="cx">         foreach ( $rtl_styles as $rtl_style ) {
</span><span class="cx">                 $styles->add_data( $rtl_style, 'rtl', true );
</span></span></pre>
</div>
</div>
</body>
</html>