<!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("#editnewwindow option[value='" + itemNewWindow + "']").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] ) && '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"> </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>-        <input id="edittitle" type="text" name="edittitle" value="" /><label class="editlabel" for="edittitle"><?php _e('Menu Title'); ?></label><br />
-        <input id="editlink" type="text" name="editlink" value="" /><label class="editlabel" for="editlink"><?php _e('URL'); ?></label><br />
-        <input id="editanchortitle" type="text" name="editanchortitle" value="" /><label class="editlabel" for="editanchortitle"><?php _e('Link Title'); ?></label><br />
</del><ins>+        <span id="edittitle-wrap"><input id="edittitle" type="text" name="edittitle" value="" /><label class="editlabel" for="edittitle"><?php _e('Menu Title'); ?></label><br /></span>
+        <span id="editlink-wrap"><input id="editlink" type="text" name="editlink" value="" /><label class="editlabel" for="editlink"><?php _e('URL'); ?></label><br /></span>
+        <span id="editanchortitle-wrap"><input id="editanchortitle" type="text" name="editanchortitle" value="" /><label class="editlabel" for="editanchortitle"><?php _e('Link Title'); ?></label><br /></span>
+        <span id="editnewwindow-wrap">
</ins><span class="cx">         <select id="editnewwindow" name="editnewwindow">
</span><span class="cx">                 <option value="1"><?php _e('Yes'); ?></option>
</span><span class="cx">                 <option value="0"><?php _e('No'); ?></option>
</span><span class="cx">         </select><label class="editlabel" for="editnewwindow"><?php _e('Open Link in a new window'); ?></label>
</span><del>-        <input id="editdescription" type="text" name="editdescription" value="" <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> /><label class="editlabel" for="editdescription" <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> ><?php _e('Description'); ?></label><br />
</del><ins>+        </span>
+        <span id="editdescription-wrap">
+        <input id="editdescription" type="text" name="editdescription" value="" <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> /><label class="editlabel" for="editdescription" <?php if ($advanced_option_descriptions == 'no') { ?>style="display:none;"<?php } ?> ><?php _e('Description'); ?></label><br /></span>
</ins><span class="cx"> </div>
</span><span class="cx">
</span><span class="cx"> <?php
</span></span></pre>
</div>
</div>
</body>
</html>