Nav menu UI updates. props koopersmith, see #13134.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-04-29 03:43:39 +00:00
parent 8787503192
commit cd9ab80421
10 changed files with 445 additions and 201 deletions

File diff suppressed because one or more lines are too long

View File

@ -8,10 +8,16 @@
* @subpackage Administration
*/
#nav-menus-frame {
margin-left: 300px;
}
#menu-settings-column {
display:block;
float:left;
width:281px;
margin-left: -300px;
clear: both;
float: left;
}
#menu-settings-column .inside {
@ -22,23 +28,47 @@
background: url("../images/menu-bits.gif") no-repeat scroll 0 -110px;
}
#wpbody {
position: relative;
}
/* Menu Container */
#menu-management-liquid {
float:right;
margin-left:-300px;
width: 100%;
#menu-management-liquid {
float: left;
min-width: 100%;
}
#menu-management {
margin-left:300px;
max-width: 600px;
position: relative;
margin-right: 20px;
margin-top: -3px;
width: 100%;
}
#menu-management .menu-edit {
background-color:#fff;
border-color: #dfdfdf;
border-width: 1px;
border-style: solid;
margin-bottom: 20px;
padding:0 10px 10px;
}
#nav-menu-header, #post-body {
border-color: #ccc;
border-style: solid;
}
#nav-menu-header {
background: url("../images/gray-grad.png") repeat-x scroll left top #dfdfdf;
border-width: 1px 1px 0 1px;
-moz-border-radius-topleft: 6px;
-webkit-border-top-left-radius: 6px;
-khtml-border-top-left-radius: 6px;
border-top-left-radius: 6px;
-moz-border-radius-topright: 6px;
-webkit-border-top-right-radius: 6px;
-khtml-border-top-right-radius: 6px;
border-top-right-radius: 6px;
}
#post-body {
background: #fff;
padding:0 0 10px 10px;
border-width: 0 1px 1px 1px;
-moz-border-radius-bottomleft: 6px;
-webkit-border-bottom-left-radius: 6px;
-khtml-border-bottom-left-radius: 6px;
@ -47,33 +77,61 @@
-webkit-border-bottom-right-radius: 6px;
-khtml-border-bottom-right-radius: 6px;
border-bottom-right-radius: 6px;
-moz-border-radius-topright: 6px;
-webkit-border-top-right-radius: 6px;
-khtml-border-top-right-radius: 6px;
border-top-right-radius: 6px;
}
#menu-management .menu-add-new abbr {
font-weight:bold;
}
#menu-management .nav-tabs {
padding-left: 30px;
}
#menu-management .menu-tabs {
background-color:#fff;
border-color:#dfdfdf;
border-bottom-color:#fff;
#menu-management .nav-tab {
background: #f4f4f4;
font-weight: bold;
border-color: #dfdfdf;
}
#menu-management .menu-tab-inactive {
background-color:#fafafa;
border-bottom-color:#fafafa;
#menu-management .nav-tab-active {
background: #ececec;
border-color:#ccc;
border-bottom-color: #ececec;
}
#menu-management #major-publishing-actions #delete-action {
float: right;
margin-right: 10px;
}
#menu-name-label {
margin-top: -2px;
}
#wpbody .open-label {
display: inline-block;
}
#wpbody .open-label span {
padding-right: 10px;
}
.js .label-with-default-title {
color: #aaa;
font-style: italic;
}
#menu-management .inside { padding: 0 10px; }
/* Add Menu Item Boxes */
.tabs-panel .howto input {
width: 180px;
float: right;
}
/* Button Primary Actions */
#menu-container .submit { margin: 0px 0px 10px; padding: 0px; }
.submitdelete { font-size: 11px; }
.submitdelete, .submitclose { font-size: 11px; }
#cancel-save { color: #ff0000; text-decoration: underline; font-size: 11px; margin-left: 20px; margin-top: 5px; }
#cancel-save:hover { background-color: #FF0000; color: #fff; }
@ -83,7 +141,7 @@
float: right;
}
.processing .add-to-menu {
form.processing .add-to-menu {
background: url("../images/wpspin_light.gif") no-repeat top center;
display:block;
height:20px;
@ -105,7 +163,7 @@
#available-links dt { display: block; }
#add-custom-link .howto { font-size: 11px; }
#add-custom-link label span { display: block; float: left; margin-top: 5px; padding-right: 5px; }
.menu-item-textbox { float: right; width: 220px; }
.menu-item-textbox { width: 180px; }
.howto span { margin-top: 4px; display: block; float: left; }
/* Menu item types */
@ -120,14 +178,14 @@
.list li .menu-item-title { cursor: pointer; display: block; }
.list li .menu-item-title input { margin-right: 3px; margin-top: -3px; }
.list li ul li .menu-item-title { margin-left: 14px; }
.list li ul li ul li .menu-item-title { margin-left: 28px; }
.list li ul li ul li ul li .menu-item-title { margin-left: 42px; }
.list li ul li ul li ul li ul li .menu-item-title { margin-left: 56px; }
.list li ul li ul li ul li ul li ul li .menu-item-title { margin-left: 70px; }
.list li ul li ul li ul li ul li ul li ul li .menu-item-title { margin-left: 84px; }
.list li ul li ul li ul li ul li ul li ul li ul li .menu-item-title { margin-left: 98px; }
.list li ul li ul li ul li ul li ul li ul li ul li ul li .menu-item-title { margin-left: 112px; }
.list li li .menu-item-title { margin-left: 14px; }
.list li li li .menu-item-title { margin-left: 28px; }
.list li li li li .menu-item-title { margin-left: 42px; }
.list li li li li li .menu-item-title { margin-left: 56px; }
.list li li li li li li .menu-item-title { margin-left: 70px; }
.list li li li li li li li .menu-item-title { margin-left: 84px; }
.list li li li li li li li li .menu-item-title { margin-left: 98px; }
.list li li li li li li li li li .menu-item-title { margin-left: 112px; }
/* Nav Menu */
#menu-container .inside { padding-bottom: 10px; }
@ -148,16 +206,32 @@
position:relative;
}
.menu li dl dt {
-webkit-border-radius: 6px;
border-radius: 6px;
-moz-border-radius: 6px;
background: url("../images/gray-grad.png") repeat-x scroll left top #DFDFDF;
border: 1px solid #E6E6E6;
clear:both;
position: relative;
padding-left: 10px;
background-color: #f1f1f1;
height: 35px;
padding-left: 10px;
height: auto;
width: 400px;
line-height: 35px;
text-shadow: 0 1px 0 #FFFFFF;
font-weight:bold;
overflow: hidden;
}
.menu li dl.menu-item-edit-inactive dt {
border-radius: 6px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
-khtml-border-radius: 6px;
}
.menu li dl.menu-item-edit-active dt {
-moz-border-radius: 6px 6px 0 0;
-webkit-border-top-right-radius: 6px;
-webkit-border-top-left-radius: 6px;
-khtml-border-top-right-radius: 6px;
-khtml-border-top-left-radius: 6px;
border-top-right-radius: 6px;
border-top-left-radius: 6px;
}
.js .menu li dl dt {
cursor: move;
@ -172,15 +246,19 @@
}
.menu li .item-title {
padding: 7px 0;
line-height: 20px;
display:block;
height:1em;
margin-right:18em;
margin-right:13em;
}
.menu li .sortable-placeholder {
width: 430px;
}
.menu li div.sortable-placeholder {
background: #f5f5f5;
border: 1px dashed #bbb;
margin: 10px 0px;
margin: 10px 0;
padding-top:40px;
}
@ -189,20 +267,17 @@
padding-bottom:40px;
}
.menu li ul li { margin-left: 20px; opacity: .7; }
.menu li ul li ul li { opacity: .9; }
.menu li ul li ul li ul li { opacity: .9; }
.menu li ul li ul li ul li ul li { opacity: .95; }
.menu li li { margin-left: 20px; }
/* Drag and Drop */
.dropzone { height: 7px; margin: 3px 0 3px 0; }
.ui-draggable-dragging { width: 600px; }
/* Menu item controls */
.item-type { text-transform: uppercase; font-size: 11px; color: #999999; padding-right: 10px; }
.item-controls { font-size: 11px; position: absolute; right: 15px; top: -1px; }
.item-controls { font-size: 11px; position: absolute; right: 20px; top: -1px; }
.item-controls a { text-decoration: none; }
.item-controls a:hover { cursor: pointer; }
.item-controls .item-order { padding-right: 10px;}
.item-controls .item-order a {
font-weight:bold;
}
@ -213,12 +288,41 @@ body.js .item-order {
.item-controls .menu-item-delete:hover { color: #ff0000; }
.item-edit {
background: url("../images/menu-bits.gif") no-repeat scroll 0 -105px;
position: absolute;
right: -20px;
top: 0;
display: block;
width: 23px;
height: 36px;
overflow: hidden;
text-indent:-999em;
border-bottom: 1px solid #eee;
-moz-border-radius-bottomleft: 3px;
-webkit-border-bottom-left-radius: 3px;
-khtml-border-bottom-left-radius: 3px;
border-bottom-left-radius: 3px;
}
/* Menu editing */
.menu-item-edit-active {
.menu-item-settings {
background: #F9F9F9;
width: 400px;
padding: 10px 0 10px 10px;
border: solid #E6E6E6;
border-width: 0 1px 1px 1px;
-moz-border-radius: 0 0 6px 6px;
-webkit-border-bottom-right-radius: 6px;
-webkit-border-bottom-left-radius: 6px;
-khtml-border-bottom-right-radius: 6px;
-khtml-border-bottom-left-radius: 6px;
}
.menu-item-settings.menu-item-edit-active {
display:block;
}
.menu-item-edit-inactive {
.menu-item-settings.menu-item-edit-inactive {
display:none;
}
@ -227,6 +331,50 @@ body.js .item-order {
text-align:center;
}
.link-to-original {
display: block;
margin: 0 0 10px;
padding: 3px 5px 5px;
font-size: 11px;
color: #777;
font-style: italic;
border: 1px solid #dfdfdf;
border-radius: 6px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
-khtml-border-radius: 6px;
}
.link-to-original a {
padding-left: 4px;
font-style: normal;
}
.hidden-field {
display: none;
}
.menu-item-settings .description-thin,
.menu-item-settings .description-wide {
margin-right: 10px;
float: left;
}
.description-thin {
width: 190px;
height: 40px;
}
.description-wide {
width: 390px;
}
.menu-item-actions {
padding-top: 15px;
line-height: 25px;
}
.save-menu-item {
padding-left: 10px;
float: right;
}
#cancel-save { cursor: pointer; }
#cancel-save:hover { color: #fff !important; }
#update-menu-item { color: #fff !important; }
@ -234,6 +382,39 @@ body.js .item-order {
#update-menu-item:active,
#update-menu-item:focus { color: #eaf2fa !important; border-color: #13455b !important; }
/* Major/minor publishing actions (classes) */
.major-publishing-actions {
padding: 5px 10px;
border-bottom: 1px solid #eee;
}
.major-publishing-actions .publishing-action {
text-align: right;
float: right;
line-height: 23px;
}
.major-publishing-actions .delete-action {
line-height: 25px;
vertical-align: middle;
text-align: left;
float: right;
padding-right: 15px;
}
.menu-name-label span {
font-size: 11px;
font-style: normal;
}
.submitbox .submitclose {
color: #21759B;
border-bottom: 1px solid #21759B;
padding: 1px 2px;
text-decoration: none;
}
.submitbox .submitclose:hover {
background: #21759B;
color: #fff;
}
/* Clearfix */
.button-controls:after, #menu-item-url-wrap:after, #menu-item-name-wrap:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.button-controls, #menu-item-url-wrap, #menu-item-name-wrap { display: block; }
.menu-item-settings:after, .button-controls:after, #menu-item-url-wrap:after, #menu-item-name-wrap:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.menu-item-settings, .button-controls, #menu-item-url-wrap, #menu-item-name-wrap { display: block; }

File diff suppressed because one or more lines are too long

View File

@ -494,6 +494,10 @@ textarea.all-options, input.all-options {
padding-top: 10px;
}
.nav-menus-php #wpbody-content .metabox-holder {
padding-top: 24px;
}
#content {
margin: 0;
width: 100%;
@ -3720,15 +3724,19 @@ table#available-headers label img {
/* Tab Interface */
.menu-tabs {
border-width: 1px 1px 2px;
.nav-tab {
border-style: solid;
border-color: #ccc #ccc #f9f9f9;
color: #464646;
padding: 4px 20px 6px;
border-width: 1px 1px 0;
color: #c1c1c1;
text-shadow: rgba(255,255,255,1) 0 1px 0;
font-size: 12px;
line-height: 16px;
display: inline-block;
padding: 4px 14px 6px;
text-decoration: none;
background-color: #fafafa;
margin: 0 6px 0 0;
margin: 0 6px -1px 0;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
@ -3738,12 +3746,17 @@ table#available-headers label img {
border-top-right-radius: 5px;
}
.themes-php .wrap h2, .theme-install-php .wrap h2 {
border-bottom: 1px solid #ccc;
.nav-tab-active {
border-width: 1px;
color: #464646;
}
.menu-tab-inactive {
border-width: 1px 1px 0;
background-color: #fafafa;
color: #c1c1c1;
.themes-php .wrap h2, .theme-install-php .wrap h2 {
border-bottom: 1px solid #ccc;
padding-bottom: 0;
}
h2 .nav-tab {
padding: 4px 20px 6px;
font: italic normal normal 24px/35px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
}

View File

@ -32,9 +32,22 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
'page-tab',
'_wpnonce',
);
$original_title = '';
if ( 'taxonomy' == $item->type ) {
$original_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' );
} elseif ( 'post_type' == $item->type ) {
$original_object = get_post( $item->object_id );
$original_title = $original_object->post_title;
}
?>
<li id="menu-item-<?php echo $item_id; ?>">
<dl>
<li id="menu-item-<?php echo $item_id; ?>" class="menu-item-<?php echo strtolower(esc_attr( $item->append )); ?>">
<dl class="<?php
if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] )
echo 'menu-item-edit-active';
else
echo 'menu-item-edit-inactive';
?>">
<dt>
<span class="item-title"><?php echo esc_html( $item->title ); ?></span>
<span class="item-controls">
@ -65,52 +78,41 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
'move-item'
);
?>" class="item-move-down"><abbr title="<?php esc_attr_e('Move down'); ?>">&#8595;</abbr></a>
|
</span>
<a class="item-edit" id="edit-<?php echo $item_id; ?>" title="<?php _e('Edit Menu Item'); ?>" href="<?php
echo add_query_arg('edit-menu-item', $item_id, remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) );
?>#menu-item-settings-<?php echo $item_id; ?>"><?php _e('Edit'); ?></a> |
<a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?>" href="<?php
echo wp_nonce_url(
add_query_arg(
array(
'action' => 'delete-menu-item',
'menu-item' => $item_id,
),
remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
),
'delete-menu_item_' . $item_id
); ?>"><?php _e('Delete'); ?></a>
?>#menu-item-settings-<?php echo $item_id; ?>">Edit Menu Item</a>
</span>
</dt>
</dl>
<div class="menu-item-settings <?php
if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] ) :
echo ' menu-item-edit-active';
else :
echo ' menu-item-edit-inactive';
endif;
?>" id="menu-item-settings-<?php echo $item_id; ?>">
<p class="description">
if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] )
echo 'menu-item-edit-active';
else
echo 'menu-item-edit-inactive';
?>" id="menu-item-settings-<?php echo $item_id; ?>">
<?php if( 'custom' == $item->type ) : ?>
<p class="field-url description description-wide">
<label for="edit-menu-item-url-<?php echo $item_id; ?>">
<?php _e( 'URL' ); ?><br />
<input type="text" id="edit-menu-item-url-<?php echo $item_id; ?>" class="widefat code edit-menu-item-url" name="menu-item-url[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->url ); ?>" />
</label>
</p>
<?php endif; ?>
<p class="description description-thin">
<label for="edit-menu-item-title-<?php echo $item_id; ?>">
<?php _e( 'Menu Title' ); ?><br />
<?php _e( 'Navigation Label' ); ?><br />
<input type="text" id="edit-menu-item-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-title" name="menu-item-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->title ); ?>" />
</label>
</p>
<p class="description">
<label for="edit-menu-item-url-<?php echo $item_id; ?>">
<?php _e( 'URL' ); ?><br />
<input type="text" id="edit-menu-item-url-<?php echo $item_id; ?>" class="widefat code edit-menu-item-url" name="menu-item-url[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->url ); ?>" />
</label>
</p>
<p class="description">
<p class="description description-thin">
<label for="edit-menu-item-attr-title-<?php echo $item_id; ?>">
<?php _e( 'Title Attribute' ); ?><br />
<input type="text" id="edit-menu-item-attr-title-<?php echo $item_id; ?>" class="widefat edit-menu-item-attr-title" name="menu-item-attr-title[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->post_excerpt ); ?>" />
</label>
</p>
<p class="description">
<p class="field-link-target description description-thin">
<label for="edit-menu-item-target-<?php echo $item_id; ?>">
<?php _e( 'Link Target' ); ?><br />
<select id="edit-menu-item-target-<?php echo $item_id; ?>" class="widefat edit-menu-item-target" name="menu-item-target[<?php echo $item_id; ?>]">
@ -119,26 +121,51 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
</select>
</label>
</p>
<p class="description">
<p class="field-css-classes description description-thin">
<label for="edit-menu-item-classes-<?php echo $item_id; ?>">
<?php _e( 'CSS Classes (optional)' ); ?><br />
<input type="text" id="edit-menu-item-classes-<?php echo $item_id; ?>" class="widefat code edit-menu-item-classes" name="menu-item-classes[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->classes ); ?>" />
</label>
</p>
<p class="description">
<p class="field-xfn description description-thin">
<label for="edit-menu-item-xfn-<?php echo $item_id; ?>">
<?php _e( 'Link Relationship (XFN) (optional)' ); ?><br />
<?php _e( 'Link Relationship (XFN)' ); ?><br />
<input type="text" id="edit-menu-item-xfn-<?php echo $item_id; ?>" class="widefat code edit-menu-item-xfn" name="menu-item-xfn[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->xfn ); ?>" />
</label>
</p>
<p class="description">
<p class="field-description description description-wide">
<label for="edit-menu-item-description-<?php echo $item_id; ?>">
<?php _e( 'Description (optional)' ); ?><br />
<?php _e( 'Description' ); ?><br />
<textarea id="edit-menu-item-description-<?php echo $item_id; ?>" class="widefat edit-menu-item-description" rows="3" name="menu-item-description[<?php echo $item_id; ?>]"><?php echo esc_html( $item->description ); ?></textarea>
<span class="description"><?php _e('The description will be displayed in the menu if the current theme supports it.'); ?></span>
</label>
</p>
<span class="menu-item-actions description-wide submitbox">
<?php if( 'custom' != $item->type ) : ?>
<p class="link-to-original"><?php
_e('Original ');
echo esc_html( $item->append );
echo ":"; ?>
<a href="<?php echo esc_attr( $item->url ); ?>">
<?php echo esc_html($original_title); ?>
</a>
</p>
<?php endif; ?>
<a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?>" href="<?php
echo wp_nonce_url(
add_query_arg(
array(
'action' => 'delete-menu-item',
'menu-item' => $item_id,
),
remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
),
'delete-menu_item_' . $item_id
); ?>"><?php _e('Remove'); ?></a> | <a class="item-close submitclose" id="close-<?php echo $item_id; ?>" href=""><?php _e('Close'); ?></a>
<input class="button-primary save-menu-item" name="save_menu_item" type="submit" value="<?php esc_attr_e('Save Menu Item'); ?>" />
</span>
<input type="hidden" name="menu-item-append[<?php echo $item_id; ?>]" value="<?php echo $item->append; ?>" />
<input type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" />
<input type="hidden" name="menu-item-object-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object_id ); ?>" />
@ -259,14 +286,31 @@ function _wp_ajax_menu_quick_search( $request = array() ) {
}
/**
* Register nav menu metaboxes
* Register nav menu metaboxes and advanced menu items
*
* @since 3.0.0
**/
function wp_nav_menu_meta_boxes_setup() {
function wp_nav_menu_setup() {
// Register meta boxes
add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
wp_nav_menu_post_type_meta_boxes();
wp_nav_menu_taxonomy_meta_boxes();
// Register advanced menu items (columns)
add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns');
add_filter( 'columns_prefs_header', create_function( '', "return __('Show advanced menu properties');" ));
// If first time editing, disable advanced items by default.
if( false === get_user_option( 'managenav-menuscolumnshidden' ) ) {
$user = wp_get_current_user();
update_user_option($user->ID, "managenav-menuscolumnshidden",
array ( 0 => 'link-target', 1 => 'css-classes', 2 => 'xfn', 3 => 'description', ),
true);
}
}
/**
@ -373,7 +417,7 @@ function wp_nav_menu_item_link_meta_box() {
?>
<div class="customlinkdiv">
<ul id="customlink-tabs" class="customlink-tabs add-menu-item-tabs">
<li <?php echo ( 'create' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="menu-tab-link" href="<?php echo add_query_arg('customlink-tab', 'create', remove_query_arg($removed_args)); ?>#tabs-panel-create-custom"><?php _e('Create New'); ?></a></li>
<li <?php echo ( 'create' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo add_query_arg('customlink-tab', 'create', remove_query_arg($removed_args)); ?>#tabs-panel-create-custom"><?php _e('Create New'); ?></a></li>
</ul>
<div class="tabs-panel <?php
@ -390,7 +434,7 @@ function wp_nav_menu_item_link_meta_box() {
<p id="menu-item-name-wrap">
<label class="howto" for="custom-menu-item-name">
<span><?php _e('Text'); ?></span>
<input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]" type="text" class="regular-text menu-item-textbox" value="<?php echo esc_attr( __('Menu Item') ); ?>" />
<input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]" type="text" class="regular-text menu-item-textbox label-with-default-title" title="<?php esc_attr_e('Menu Item'); ?>" />
</label>
</p>
</div><!-- /.tabs-panel -->
@ -508,8 +552,8 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
?>
<div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv">
<ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs">
<li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="menu-tab-link" href="<?php echo add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args)); ?>#<?php echo $post_type_name; ?>-all"><?php _e('View All'); ?></a></li>
<li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="menu-tab-link" href="<?php echo add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args)); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search"><?php _e('Search'); ?></a></li>
<li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args)); ?>#<?php echo $post_type_name; ?>-all"><?php _e('View All'); ?></a></li>
<li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args)); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search"><?php _e('Search'); ?></a></li>
</ul>
<div class="tabs-panel <?php
@ -664,9 +708,9 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
?>
<div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv">
<ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
<li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="menu-tab-link" href="<?php echo add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args)); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop"><?php _e('Most Used'); ?></a></li>
<li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="menu-tab-link" href="<?php echo add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args)); ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>"><?php _e('Search'); ?></a></li>
<li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="menu-tab-link" href="<?php echo add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args)); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all"><?php _e('View All'); ?></a></li>
<li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args)); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop"><?php _e('Most Used'); ?></a></li>
<li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args)); ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>"><?php _e('Search'); ?></a></li>
<li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php echo add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args)); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all"><?php _e('View All'); ?></a></li>
</ul>
<div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php
@ -885,4 +929,22 @@ function wp_get_nav_menu_to_edit( $menu_item_id = 0 ) {
}
/**
* Returns the columns for the nav menus page.
*
* @since 3.0.0
*
* @param string $menu_item_id The ID of the menu item to format.
* @return string|WP_Error $output The menu formatted to edit or error object on failure.
*/
function wp_nav_menu_manage_columns() {
return array(
'cb' => '<input type="checkbox" />',
'link-target' => __('Link Target'),
'css-classes' => __('CSS Classes'),
'xfn' => __('Link Relationship (XFN)'),
'description' => __('Description'),
);
}
?>

View File

@ -3582,33 +3582,40 @@ function screen_meta($screen) {
if ( !isset($_wp_contextual_help) )
$_wp_contextual_help = array();
$settings = '';
$settings = apply_filters('screen_settings', '', $screen);
switch ( $screen->id ) {
case 'widgets':
$settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";
$show_screen = true;
break;
}
if( $settings )
$show_screen = true;
?>
<div id="screen-meta">
<?php
if ( $show_screen ) :
$default_text = __('Show on screen');
?>
<div id="screen-options-wrap" class="hidden">
<form id="adv-settings" action="" method="post">
<h5><?php _e('Show on screen') ?></h5>
<div class="metabox-prefs">
<?php
if ( !meta_box_prefs($screen) && isset($column_screens) ) {
manage_columns_prefs($screen);
}
?>
<br class="clear" />
</div>
<?php echo screen_layout($screen); ?>
<?php echo $screen_options; ?>
<?php echo $settings; ?>
<?php if ( isset($wp_meta_boxes[$screen->id]) ) : ?>
<h5><?php echo apply_filters('meta_box_prefs_header', $default_text); ?></h5>
<div class="metabox-prefs">
<?php meta_box_prefs($screen); ?>
<br class="clear" />
</div>
<?php endif;
if ( isset($column_screens) ) : ?>
<h5><?php echo apply_filters('columns_prefs_header', $default_text); ?></h5>
<div class="metabox-prefs">
<?php manage_columns_prefs($screen); ?>
<br class="clear" />
</div>
<?php endif;
echo screen_layout($screen);
echo $screen_options;
echo $settings; ?>
<div><?php wp_nonce_field( 'screen-options-nonce', 'screenoptionnonce', false ); ?></div>
</form>
</div>

View File

@ -233,31 +233,18 @@ switch ( $action ) {
if ( ! is_wp_error( $_menu_object ) ) {
$menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID') );
$post_fields = array( 'menu-item-db-id', 'menu-item-object-id', 'menu-item-object', 'menu-item-parent-id', 'menu-item-position', 'menu-item-type', 'menu-item-append', 'menu-item-title', 'menu-item-url', 'menu-item-description', 'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn' );
// Loop through all the menu items' POST variables
if ( ! empty( $_POST['menu-item-db-id'] ) ) {
foreach( (array) $_POST['menu-item-db-id'] as $_key => $k ) {
// Menu item title can't be blank
if ( '' == $_POST['menu-item-title'][$_key] )
if ( empty( $_POST['menu-item-title'][$_key] ) )
continue;
$args = array(
'menu-item-db-id' => $_POST['menu-item-db-id'][$_key],
'menu-item-object-id' => $_POST['menu-item-object-id'][$_key],
'menu-item-object' => $_POST['menu-item-object'][$_key],
'menu-item-parent-id' => $_POST['menu-item-parent-id'][$_key],
'menu-item-position' => $_POST['menu-item-position'][$_key],
'menu-item-type' => $_POST['menu-item-type'][$_key],
'menu-item-append' => $_POST['menu-item-append'][$_key],
'menu-item-title' => $_POST['menu-item-title'][$_key],
'menu-item-url' => $_POST['menu-item-url'][$_key],
'menu-item-description' => $_POST['menu-item-description'][$_key],
'menu-item-attr-title' => $_POST['menu-item-attr-title'][$_key],
'menu-item-target' => $_POST['menu-item-target'][$_key],
'menu-item-classes' => $_POST['menu-item-classes'][$_key],
'menu-item-xfn' => $_POST['menu-item-xfn'][$_key],
);
$args = array();
foreach ( $post_fields as $field )
$args[$field] = isset( $_POST[$field][$_key] ) ? $_POST[$field][$_key] : '';
$menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][$_key] != $_key ? 0 : $_key ), $args );
@ -316,13 +303,13 @@ if ( ! $nav_menu_selected_title && is_nav_menu( $nav_menu_selected_id ) ) {
// The theme supports menus
if ( current_theme_supports('nav-menus') ) {
// Register nav menu metaboxes
wp_nav_menu_meta_boxes_setup();
// Set up nav menu
wp_nav_menu_setup();
// The theme does not support menus but supports widgets
} elseif ( current_theme_supports('widgets') ) {
// Register nav menu metaboxes
wp_nav_menu_meta_boxes_setup();
// Set up nav menu
wp_nav_menu_setup();
$messages_div = '<div id="message" class="error"><p>' . __('The current theme does not natively support menus, but you can use the &#8220;Navigation Menu&#8221; widget to add any menus you create here to the theme&#8217;s sidebar.') . '</p></div>';
// The theme supports neither menus nor widgets.
@ -340,6 +327,7 @@ require_once( 'admin-header.php' );
<?php echo $messages_div; ?>
<?php if ( current_theme_supports('nav-menus') || current_theme_supports('widgets') ) : ?>
<div id="nav-menus-frame">
<div id="menu-settings-column" class="metabox-holder">
<form id="nav-menu-meta" action="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-menu-meta" method="post" enctype="multipart/form-data">
@ -350,15 +338,13 @@ require_once( 'admin-header.php' );
</form>
</div><!-- /#menu-settings-column -->
<div id="menu-management-liquid">
<div id="menu-management" class="">
<h2>
<div id="menu-management">
<div class="nav-tabs">
<?php
foreach( (array) $nav_menus as $_nav_menu ) :
?>
<a href="<?php
?><a href="<?php
echo add_query_arg(
array(
'action' => 'edit',
@ -366,15 +352,12 @@ require_once( 'admin-header.php' );
),
admin_url( 'nav-menus.php' )
);
?>" class="menu-tabs<?php
if ( $nav_menu_selected_id != $_nav_menu->term_id )
echo ' menu-tab-inactive';
?>"><?php echo esc_html( $_nav_menu->name ); ?></a>
<?php
?>" class="nav-tab<?php
if ( $nav_menu_selected_id == $_nav_menu->term_id )
echo ' nav-tab-active';
?>"><?php echo esc_html( $_nav_menu->name ); ?></a><?php
endforeach;
?>
<a href="<?php
?><a href="<?php
echo add_query_arg(
array(
'action' => 'edit',
@ -382,44 +365,41 @@ require_once( 'admin-header.php' );
),
admin_url( 'nav-menus.php' )
);
?>" class="menu-tabs menu-add-new<?php
if ( 0 != $nav_menu_selected_id )
echo ' menu-tab-inactive';
?>" class="nav-tab menu-add-new<?php
if ( 0 == $nav_menu_selected_id )
echo ' nav-tab-active';
?>"><?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add menu' ) ); ?></a>
</h2>
</div>
<div class="menu-edit">
<form id="update-nav-menu" action="<?php echo admin_url( 'nav-menus.php' ); ?>" method="post" enctype="multipart/form-data">
<div id="submitpost" class="submitbox">
<div id="minor-publishing">
<div class="misc-pub-section misc-pub-section-last">
<label class="howto" for="menu-name">
<span><?php _e('Name'); ?></span>
<input id="menu-name" name="menu-name" type="text" class="regular-text menu-item-textbox" value="<?php echo esc_attr( $nav_menu_selected_title ); ?>" />
<div id="nav-menu-header">
<div id="submitpost" class="submitbox">
<div class="major-publishing-actions">
<label class="menu-name-label howto open-label" for="menu-name">
<span><?php _e('Menu Name'); ?></span>
<input name="menu-name" type="text" class="menu-name regular-text menu-item-textbox label-with-default-title" title="Enter menu name here." value="<?php echo esc_attr( $nav_menu_selected_title ); ?>" />
<br class="clear" />
</label>
</div><!--END .misc-pub-section misc-pub-section-last-->
<br class="clear" />
</div><!--END #misc-publishing-actions-->
<div id="major-publishing-actions">
<?php if ( ! empty( $nav_menu_selected_id ) ) : ?>
<div id="delete-action">
<a class="submitdelete deletion menu-delete" href="<?php echo wp_nonce_url( admin_url('nav-menus.php?action=delete&amp;menu=' . $nav_menu_selected_id), 'delete-nav_menu-' . $nav_menu_selected_id ); ?>"><?php _e('Delete Menu'); ?></a>
</div><!--END #delete-action-->
<?php endif; ?>
<div id="publishing-action">
<input class="button-primary" name="save_menu" type="submit" value="<?php esc_attr_e('Save Menu'); ?>" />
</div><!--END #publishing-action-->
<br class="clear" />
</div><!--END #major-publishing-actions-->
</div><!--END #submitpost .submitbox-->
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
<?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
<?php wp_nonce_field( 'update-nav_menu', 'update-nav-menu-nonce' ); ?>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
<input type="hidden" id="hidden-metaboxes" value="<?php echo wp_initial_nav_menu_meta_boxes(); ?>" />
<div class="publishing-action">
<input class="button-primary" name="save_menu" type="submit" value="<?php esc_attr_e('Save Menu'); ?>" />
</div><!--END .publishing-action-->
<?php if ( ! empty( $nav_menu_selected_id ) ) : ?>
<div class="delete-action">
<a class="submitdelete deletion menu-delete" href="<?php echo wp_nonce_url( admin_url('nav-menus.php?action=delete&amp;menu=' . $nav_menu_selected_id), 'delete-nav_menu-' . $nav_menu_selected_id ); ?>"><?php _e('Delete Menu'); ?></a>
</div><!--END .delete-action-->
<?php endif; ?>
<br class="clear" />
</div><!--END .major-publishing-actions-->
</div><!--END #submitpost .submitbox-->
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
<?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
<?php wp_nonce_field( 'update-nav_menu', 'update-nav-menu-nonce' ); ?>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
<input type="hidden" id="hidden-metaboxes" value="<?php echo wp_initial_nav_menu_meta_boxes(); ?>" />
</div><!--END #nav-menu-header-->
<div id="post-body">
<div id="post-body-content">
<?php if ( is_nav_menu( $nav_menu_selected_id ) && ( current_theme_supports('nav-menus') || current_theme_supports('widgets') ) ) : ?>
@ -445,6 +425,7 @@ require_once( 'admin-header.php' );
</div><!-- /.menu-edit -->
</div><!-- /#menu-management -->
</div><!-- /#menu-management-liquid -->
</div><!-- /#nav-menus-frame-->
<?php endif; // if menus supported in current theme ?>
</div><!-- /.wrap-->

View File

@ -59,7 +59,7 @@ include('./admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><a href="themes.php" class="menu-tabs menu-tab-inactive"><?php echo esc_html_x('Manage Themes', 'theme'); ?></a><a href="theme-install.php" class="menu-tabs"><?php echo esc_html( $title ); ?></a></h2>
<h2><a href="themes.php" class="nav-tab"><?php echo esc_html_x('Manage Themes', 'theme'); ?></a><a href="theme-install.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a></h2>
<ul class="subsubsub">
<?php

View File

@ -134,7 +134,7 @@ function theme_update_available( $theme ) {
<div class="wrap">
<?php screen_icon(); ?>
<h2><a href="themes.php" class="menu-tabs"><?php echo esc_html( $title ); ?></a><?php if ( current_user_can('install_themes') ) { ?><a href="theme-install.php" class="menu-tabs menu-tab-inactive"><?php echo esc_html_x('Install Themes', 'theme'); ?></a><?php } ?></h2>
<h2><a href="themes.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a><?php if ( current_user_can('install_themes') ) { ?><a href="theme-install.php" class="nav-tab"><?php echo esc_html_x('Install Themes', 'theme'); ?></a><?php } ?></h2>
<h3><?php _e('Current Theme'); ?></h3>
<div id="current-theme">

View File

@ -60,7 +60,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' );
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20100326' );
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20100429' );
$scripts->add_data( 'common', 'group', 1 );
$scripts->localize( 'common', 'commonL10n', array(
'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete."),
@ -393,7 +393,7 @@ function wp_default_scripts( &$scripts ) {
) );
// Custom Navigation
$scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100428b' );
$scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100429' );
$scripts->localize( 'nav-menu', 'navMenuL10n', array(
'custom' => _x('Custom', 'menu nav item type'),
'thickbox' => _x('Edit Menu Item', 'Thickbox Title'),
@ -442,7 +442,7 @@ function wp_default_styles( &$styles ) {
// Any rtl stylesheets that don't have a .dev version for ltr
$no_suffix = array( 'farbtastic' );
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20100426' );
$styles->add( 'wp-admin', "/wp-admin/css/wp-admin$suffix.css", array(), '20100429' );
$styles->add( 'ie', "/wp-admin/css/ie$suffix.css", array(), '20100219' );
$styles->add_data( 'ie', 'conditional', 'lte IE 7' );
@ -474,7 +474,7 @@ function wp_default_styles( &$styles ) {
$styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' );
$styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
$styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
$styles->add( 'nav-menu', "/wp-admin/css/nav-menu$suffix.css", array(), '20100428' );
$styles->add( 'nav-menu', "/wp-admin/css/nav-menu$suffix.css", array(), '20100429' );
foreach ( $rtl_styles as $rtl_style ) {
$styles->add_data( $rtl_style, 'rtl', true );