<!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>[13390] trunk/wp-admin:
  Hide URL editing UI for page and category menu items.</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Hide URL editing UI for page and category menu items. TODO: eliminate all usage of guid. Use custom field instead. see <a href="http://trac.wordpress.org/ticket/11817">#11817</a></pre>

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

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminjscustomnavigationdynamicfunctionsdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js (13389 => 13390)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js        2010-02-24 22:13:23 UTC (rev 13389)
+++ trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js        2010-02-24 22:52:29 UTC (rev 13390)
</span><span class="lines">@@ -33,21 +33,26 @@
</span><span class="cx"> function edititem(o)
</span><span class="cx"> {
</span><span class="cx"> 
</span><del>-                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');
</del><ins>+                itemTitle = jQuery('#title' + o).val();
+                itemURL = jQuery('#linkurl' + o).val();
+                itemAnchorTitle = jQuery('#anchortitle' + o).val();
+                itemNewWindow = jQuery('#newwindow' + o).val();
+                itemDesc = jQuery('#description' + o).val();
</ins><span class="cx"> 
</span><span class="cx">                 jQuery('#dialog-confirm').dialog( 'option' , 'itemID' , o )
</span><span class="cx"> 
</span><span class="cx">                 jQuery('#dialog-confirm').dialog('open');
</span><span class="cx"> 
</span><del>-                jQuery('#edittitle').attr('value', itemTitle);
-                jQuery('#editlink').attr('value', itemURL);
-                jQuery('#editanchortitle').attr('value', itemAnchorTitle);
</del><ins>+                jQuery('#edittitle').val( itemTitle );
+                if ( 'custom' == jQuery( '#linktype' + o ).val() ) {
+                        jQuery( '#editlink-wrap' ).css( 'display', 'inline' );
+                } else {
+                        jQuery( '#editlink-wrap' ).css( 'display', 'none' );
+                }
+                jQuery('#editlink').val( itemURL );
+                jQuery('#editanchortitle').val( itemAnchorTitle );
</ins><span class="cx">                 jQuery(&quot;#editnewwindow option[value='&quot; + itemNewWindow  + &quot;']&quot;).attr('selected', 'selected');
</span><del>-                jQuery('#editdescription').attr('value', itemDesc);
</del><ins>+                jQuery('#editdescription').val( itemDesc );
</ins><span class="cx"> 
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminnavmenusphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/nav-menus.php (13389 => 13390)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/nav-menus.php        2010-02-24 22:13:23 UTC (rev 13389)
+++ trunk/wp-admin/nav-menus.php        2010-02-24 22:52:29 UTC (rev 13390)
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">                 $object_id = isset( $_POST['postmenu'.$k] )? $_POST['postmenu'.$k] : 0;
</span><span class="cx">                 $parent_id = isset( $_POST['parent'.$k] )? $_POST['parent'.$k] : 0;
</span><span class="cx">                 $custom_title = isset( $_POST['title'.$k] )?  $_POST['title'.$k] : '';
</span><del>-                $custom_linkurl = isset( $_POST['linkurl'.$k] )? $_POST['linkurl'.$k] : '';
</del><ins>+                $custom_linkurl = ( isset( $_POST['linkurl'.$k] ) &amp;&amp; 'custom' == $_POST['linktype'.$k] ) ? $_POST['linkurl'.$k] : '';
</ins><span class="cx">                 $custom_description = isset( $_POST['description'.$k] )? $_POST['description'.$k] : '';
</span><span class="cx">                 // doesn't seem to be used by UI
</span><span class="cx">                 $icon = isset( $_POST['icon'.$k] )? $_POST['icon'.$k] : 0;
</span><span class="lines">@@ -376,14 +376,17 @@
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;dialog-confirm&quot; style=&quot;display:none;&quot; title=&quot;&lt;?php esc_attr_e('Edit Menu Item'); ?&gt;&quot;&gt;
</span><del>-        &lt;input id=&quot;edittitle&quot; type=&quot;text&quot; name=&quot;edittitle&quot; value=&quot;&quot; /&gt;&lt;label class=&quot;editlabel&quot; for=&quot;edittitle&quot;&gt;&lt;?php _e('Menu Title'); ?&gt;&lt;/label&gt;&lt;br /&gt;
-        &lt;input id=&quot;editlink&quot; type=&quot;text&quot; name=&quot;editlink&quot; value=&quot;&quot; /&gt;&lt;label class=&quot;editlabel&quot; for=&quot;editlink&quot;&gt;&lt;?php _e('URL'); ?&gt;&lt;/label&gt;&lt;br /&gt;
-        &lt;input id=&quot;editanchortitle&quot; type=&quot;text&quot; name=&quot;editanchortitle&quot; value=&quot;&quot; /&gt;&lt;label class=&quot;editlabel&quot; for=&quot;editanchortitle&quot;&gt;&lt;?php _e('Link Title'); ?&gt;&lt;/label&gt;&lt;br /&gt;
</del><ins>+        &lt;span id=&quot;edittitle-wrap&quot;&gt;&lt;input id=&quot;edittitle&quot; type=&quot;text&quot; name=&quot;edittitle&quot; value=&quot;&quot; /&gt;&lt;label class=&quot;editlabel&quot; for=&quot;edittitle&quot;&gt;&lt;?php _e('Menu Title'); ?&gt;&lt;/label&gt;&lt;br /&gt;&lt;/span&gt;
+        &lt;span id=&quot;editlink-wrap&quot;&gt;&lt;input id=&quot;editlink&quot; type=&quot;text&quot; name=&quot;editlink&quot; value=&quot;&quot; /&gt;&lt;label class=&quot;editlabel&quot; for=&quot;editlink&quot;&gt;&lt;?php _e('URL'); ?&gt;&lt;/label&gt;&lt;br /&gt;&lt;/span&gt;
+        &lt;span id=&quot;editanchortitle-wrap&quot;&gt;&lt;input id=&quot;editanchortitle&quot; type=&quot;text&quot; name=&quot;editanchortitle&quot; value=&quot;&quot; /&gt;&lt;label class=&quot;editlabel&quot; for=&quot;editanchortitle&quot;&gt;&lt;?php _e('Link Title'); ?&gt;&lt;/label&gt;&lt;br /&gt;&lt;/span&gt;
+        &lt;span id=&quot;editnewwindow-wrap&quot;&gt;
</ins><span class="cx">         &lt;select id=&quot;editnewwindow&quot; name=&quot;editnewwindow&quot;&gt;
</span><span class="cx">                 &lt;option value=&quot;1&quot;&gt;&lt;?php _e('Yes'); ?&gt;&lt;/option&gt;
</span><span class="cx">                 &lt;option value=&quot;0&quot;&gt;&lt;?php _e('No'); ?&gt;&lt;/option&gt;
</span><span class="cx">         &lt;/select&gt;&lt;label class=&quot;editlabel&quot; for=&quot;editnewwindow&quot;&gt;&lt;?php _e('Open Link in a new window'); ?&gt;&lt;/label&gt;
</span><del>-        &lt;input id=&quot;editdescription&quot; type=&quot;text&quot; name=&quot;editdescription&quot; value=&quot;&quot; &lt;?php if ($advanced_option_descriptions == 'no') { ?&gt;style=&quot;display:none;&quot;&lt;?php } ?&gt; /&gt;&lt;label class=&quot;editlabel&quot; for=&quot;editdescription&quot; &lt;?php if ($advanced_option_descriptions == 'no') { ?&gt;style=&quot;display:none;&quot;&lt;?php } ?&gt; &gt;&lt;?php _e('Description'); ?&gt;&lt;/label&gt;&lt;br /&gt;
</del><ins>+        &lt;/span&gt;
+        &lt;span id=&quot;editdescription-wrap&quot;&gt;
+        &lt;input id=&quot;editdescription&quot; type=&quot;text&quot; name=&quot;editdescription&quot; value=&quot;&quot; &lt;?php if ($advanced_option_descriptions == 'no') { ?&gt;style=&quot;display:none;&quot;&lt;?php } ?&gt; /&gt;&lt;label class=&quot;editlabel&quot; for=&quot;editdescription&quot; &lt;?php if ($advanced_option_descriptions == 'no') { ?&gt;style=&quot;display:none;&quot;&lt;?php } ?&gt; &gt;&lt;?php _e('Description'); ?&gt;&lt;/label&gt;&lt;br /&gt;&lt;/span&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php
</span></span></pre>
</div>
</div>

</body>
</html>