Hide URL editing UI for page and category menu items. TODO: eliminate all usage of guid. Use custom field instead. see #11817

git-svn-id: http://svn.automattic.com/wordpress/trunk@13390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2010-02-24 22:52:29 +00:00
parent e2bec6bd60
commit 6141567b74
2 changed files with 22 additions and 14 deletions

View File

@ -33,21 +33,26 @@ function removeitem(o)
function edititem(o) function edititem(o)
{ {
itemTitle = jQuery('#title' + o).attr('value'); itemTitle = jQuery('#title' + o).val();
itemURL = jQuery('#linkurl' + o).attr('value'); itemURL = jQuery('#linkurl' + o).val();
itemAnchorTitle = jQuery('#anchortitle' + o).attr('value'); itemAnchorTitle = jQuery('#anchortitle' + o).val();
itemNewWindow = jQuery('#newwindow' + o).attr('value'); itemNewWindow = jQuery('#newwindow' + o).val();
itemDesc = jQuery('#description' + o).attr('value'); itemDesc = jQuery('#description' + o).val();
jQuery('#dialog-confirm').dialog( 'option' , 'itemID' , o ) jQuery('#dialog-confirm').dialog( 'option' , 'itemID' , o )
jQuery('#dialog-confirm').dialog('open'); jQuery('#dialog-confirm').dialog('open');
jQuery('#edittitle').attr('value', itemTitle); jQuery('#edittitle').val( itemTitle );
jQuery('#editlink').attr('value', itemURL); if ( 'custom' == jQuery( '#linktype' + o ).val() ) {
jQuery('#editanchortitle').attr('value', itemAnchorTitle); jQuery( '#editlink-wrap' ).css( 'display', 'inline' );
} else {
jQuery( '#editlink-wrap' ).css( 'display', 'none' );
}
jQuery('#editlink').val( itemURL );
jQuery('#editanchortitle').val( itemAnchorTitle );
jQuery("#editnewwindow option[value='" + itemNewWindow + "']").attr('selected', 'selected'); jQuery("#editnewwindow option[value='" + itemNewWindow + "']").attr('selected', 'selected');
jQuery('#editdescription').attr('value', itemDesc); jQuery('#editdescription').val( itemDesc );
}; };

View File

@ -106,7 +106,7 @@ if ( $post_counter > 0 && $menu_selected_id > 0 && ! $updated ) {
$object_id = isset( $_POST['postmenu'.$k] )? $_POST['postmenu'.$k] : 0; $object_id = isset( $_POST['postmenu'.$k] )? $_POST['postmenu'.$k] : 0;
$parent_id = isset( $_POST['parent'.$k] )? $_POST['parent'.$k] : 0; $parent_id = isset( $_POST['parent'.$k] )? $_POST['parent'.$k] : 0;
$custom_title = isset( $_POST['title'.$k] )? $_POST['title'.$k] : ''; $custom_title = isset( $_POST['title'.$k] )? $_POST['title'.$k] : '';
$custom_linkurl = isset( $_POST['linkurl'.$k] )? $_POST['linkurl'.$k] : ''; $custom_linkurl = ( isset( $_POST['linkurl'.$k] ) && 'custom' == $_POST['linktype'.$k] ) ? $_POST['linkurl'.$k] : '';
$custom_description = isset( $_POST['description'.$k] )? $_POST['description'.$k] : ''; $custom_description = isset( $_POST['description'.$k] )? $_POST['description'.$k] : '';
// doesn't seem to be used by UI // doesn't seem to be used by UI
$icon = isset( $_POST['icon'.$k] )? $_POST['icon'.$k] : 0; $icon = isset( $_POST['icon'.$k] )? $_POST['icon'.$k] : 0;
@ -376,14 +376,17 @@ if ( $post_counter > 0 && $menu_selected_id > 0 && ! $updated ) {
</div> </div>
<div id="dialog-confirm" style="display:none;" title="<?php esc_attr_e('Edit Menu Item'); ?>"> <div id="dialog-confirm" style="display:none;" title="<?php esc_attr_e('Edit Menu Item'); ?>">
<input id="edittitle" type="text" name="edittitle" value="" /><label class="editlabel" for="edittitle"><?php _e('Menu Title'); ?></label><br /> <span id="edittitle-wrap"><input id="edittitle" type="text" name="edittitle" value="" /><label class="editlabel" for="edittitle"><?php _e('Menu Title'); ?></label><br /></span>
<input id="editlink" type="text" name="editlink" value="" /><label class="editlabel" for="editlink"><?php _e('URL'); ?></label><br /> <span id="editlink-wrap"><input id="editlink" type="text" name="editlink" value="" /><label class="editlabel" for="editlink"><?php _e('URL'); ?></label><br /></span>
<input id="editanchortitle" type="text" name="editanchortitle" value="" /><label class="editlabel" for="editanchortitle"><?php _e('Link Title'); ?></label><br /> <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">
<select id="editnewwindow" name="editnewwindow"> <select id="editnewwindow" name="editnewwindow">
<option value="1"><?php _e('Yes'); ?></option> <option value="1"><?php _e('Yes'); ?></option>
<option value="0"><?php _e('No'); ?></option> <option value="0"><?php _e('No'); ?></option>
</select><label class="editlabel" for="editnewwindow"><?php _e('Open Link in a new window'); ?></label> </select><label class="editlabel" for="editnewwindow"><?php _e('Open Link in a new window'); ?></label>
<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>
<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>
</div> </div>
<?php <?php