2010-02-20 22:57:43 +01:00
< ? php
/**
2010-02-23 21:38:27 +01:00
* WordPress Administration for Navigation Menus
2010-02-20 22:57:43 +01:00
* Interface functions
*
2010-02-28 00:06:56 +01:00
* @ version 2.0 . 0
2010-02-20 22:57:43 +01:00
*
* @ package WordPress
* @ subpackage Administration
*/
2010-02-21 01:03:42 +01:00
2010-02-20 22:57:43 +01:00
require_once ( 'admin.php' );
2010-02-28 00:06:56 +01:00
/*
TODO
Add caps : edit_menus , delete_menus
*/
2010-02-23 21:48:50 +01:00
if ( ! current_user_can ( 'switch_themes' ) )
wp_die ( __ ( 'Cheatin’ uh?' ));
2010-02-25 18:10:00 +01:00
wp_admin_css ( 'nav-menu' );
2010-02-21 00:35:05 +01:00
wp_enqueue_script ( 'jquery' );
2010-02-21 01:10:20 +01:00
wp_enqueue_script ( 'jquery-ui-draggable' );
wp_enqueue_script ( 'jquery-ui-droppable' );
wp_enqueue_script ( 'jquery-ui-sortable' );
wp_enqueue_script ( 'jquery-ui-dialog' );
2010-02-25 18:10:00 +01:00
wp_enqueue_script ( 'nav-menu-dynamic-functions' );
wp_enqueue_script ( 'nav-menu-default-items' );
2010-02-21 00:35:05 +01:00
wp_enqueue_script ( 'jquery-autocomplete' );
2010-02-25 18:10:00 +01:00
wp_enqueue_script ( 'nav-menu-php-functions' );
2010-02-28 00:06:56 +01:00
add_thickbox ();
2010-02-21 01:10:20 +01:00
2010-02-25 01:03:42 +01:00
require_once ( 'admin-header.php' );
require_once ( ABSPATH . 'wp-admin/includes/nav-menu.php' );
2010-02-20 22:57:43 +01:00
2010-02-23 23:06:21 +01:00
function wp_reset_nav_menu () {
2010-02-25 01:03:42 +01:00
wp_nav_menu_setup ( true );
2010-02-20 22:57:43 +01:00
return true ;
}
2010-02-24 19:52:54 +01:00
$messages_div = '' ;
2010-02-23 21:48:50 +01:00
$menu_id_in_edit = 0 ;
2010-02-24 00:53:08 +01:00
$updated = false ;
2010-02-24 19:52:54 +01:00
$advanced_option_descriptions = 'no' ;
2010-02-23 21:48:50 +01:00
// Check which menu is selected and if menu is in edit already
2010-02-24 19:52:54 +01:00
if ( isset ( $_GET [ 'edit-menu' ] ) ) {
$menu_selected_id = ( int ) $_GET [ 'edit-menu' ];
2010-02-24 00:53:08 +01:00
$updated = true ;
2010-02-24 19:52:54 +01:00
} elseif ( isset ( $_POST [ 'menu-id-in-edit' ] ) ) {
$menu_selected_id = ( int ) $_POST [ 'menu-id-in-edit' ];
2010-02-24 00:53:08 +01:00
} else {
2010-02-23 21:48:50 +01:00
$menu_selected_id = 0 ;
2010-02-24 00:53:08 +01:00
}
2010-02-23 21:48:50 +01:00
2010-02-28 00:06:56 +01:00
// Delete a menu
if ( isset ( $_GET [ 'delete-menu' ]) && $_GET [ 'delete-menu' ] > 0 ) {
// if ( ! current_user_can('delete_menus') )
// wp_die( __( 'Cheatin’ uh?' ));
2010-03-02 04:59:28 +01:00
2010-02-28 00:06:56 +01:00
$menu_id = ( int ) $_GET [ 'delete-menu' ];
check_admin_referer ( 'delete_menu-' . $menu_id );
2010-03-02 04:59:28 +01:00
2010-02-28 00:06:56 +01:00
wp_delete_nav_menu ( $menu_id );
$messages_div = '<div id="message" class="updated fade below-h2"><p>' . __ ( 'Menu successfully deleted.' ) . '</p></div>' ;
2010-02-24 00:53:08 +01:00
$menu_selected_id = 0 ;
$updated = true ;
}
2010-02-24 07:41:35 +01:00
2010-02-23 21:48:50 +01:00
// Default Menu to show
2010-02-28 00:06:56 +01:00
$menus = wp_get_nav_menus ();
2010-02-25 22:06:44 +01:00
2010-02-28 00:06:56 +01:00
if ( empty ( $menus ) && empty ( $_POST ) ) {
2010-02-25 22:06:44 +01:00
wp_create_default_nav_menu ();
2010-02-28 00:06:56 +01:00
$menus = wp_get_nav_menus ();
2010-02-25 22:06:44 +01:00
}
2010-02-28 00:06:56 +01:00
if ( ! $menu_selected_id && ! empty ( $menus ) )
$menu_selected_id = $menus [ 0 ] -> term_id ;
2010-02-23 21:48:50 +01:00
2010-03-02 04:59:28 +01:00
// Get the name of the current Menu
2010-02-23 21:48:50 +01:00
$menu_title = '' ;
2010-02-28 00:06:56 +01:00
$valid_menu = false ;
2010-02-23 21:48:50 +01:00
if ( $menu_selected_id > 0 ) {
2010-02-28 00:06:56 +01:00
foreach ( $menus as $menu ) {
2010-02-23 21:48:50 +01:00
if ( $menu -> term_id == $menu_selected_id ) {
$menu_title = $menu -> name ;
2010-02-28 00:06:56 +01:00
$valid_menu = true ;
2010-02-23 21:48:50 +01:00
break ;
}
}
}
2010-02-21 01:03:42 +01:00
2010-02-24 19:52:54 +01:00
if ( isset ( $_POST [ 'li-count' ] ) )
$post_counter = $_POST [ 'li-count' ];
2010-02-23 21:48:50 +01:00
else
2010-02-24 19:52:54 +01:00
$post_counter = 0 ;
2010-02-23 21:48:50 +01:00
// Create a new menu. Menus are stored as terms in the 'menu' taxonomy.
2010-02-28 00:06:56 +01:00
if ( isset ( $_POST [ 'create-menu' ] ) && ! $updated ) {
$insert_menu_name = $_POST [ 'create-menu-name' ];
2010-02-24 19:52:54 +01:00
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>' ;
2010-02-23 21:48:50 +01:00
} else {
2010-02-28 00:06:56 +01:00
$menus [ $menu -> term_id ] = $menu ;
2010-02-23 23:06:21 +01:00
$menu_selected_id = $menu -> term_id ;
$menu_id_in_edit = $menu_selected_id ;
2010-02-24 10:43:09 +01:00
$menu_title = $menu -> name ;
2010-02-24 19:52:54 +01:00
$messages_div = '<div id="message" class="updated fade below-h2"><p>' . sprintf ( __ ( '“%s” menu has been created.' ), esc_html ( $menu -> name ) ) . '</p></div>' ;
$post_counter = 0 ;
2010-02-20 22:57:43 +01:00
}
2010-02-23 21:48:50 +01:00
} else {
2010-02-24 19:52:54 +01:00
$messages_div = '<div id="message" class="error fade below-h2"><p>' . __ ( 'Please enter a valid menu name.' ) . '</p></div>' ;
2010-02-20 22:57:43 +01:00
}
2010-02-24 00:53:08 +01:00
$updated = true ;
2010-02-23 21:48:50 +01:00
}
2010-02-21 01:03:42 +01:00
2010-02-24 19:52:54 +01:00
if ( $post_counter > 0 && $menu_selected_id > 0 && ! $updated ) {
2010-02-23 23:06:21 +01:00
$menu_items = wp_get_nav_menu_items ( $menu_selected_id , array ( 'orderby' => 'ID' , 'output' => ARRAY_A , 'output_key' => 'ID' ) );
2010-02-24 00:13:54 +01:00
$parent_menu_ids = array ();
2010-03-02 04:59:28 +01:00
2010-02-23 21:48:50 +01:00
// Loop through all POST variables
2010-02-24 19:52:54 +01:00
for ( $k = 1 ; $k <= $post_counter ; $k ++ ) {
2010-02-28 21:00:49 +01:00
$db_id = isset ( $_POST [ 'item-dbid' . $k ] ) ? $_POST [ 'item-dbid' . $k ] : 0 ;
$object_id = isset ( $_POST [ 'item-postmenu' . $k ] ) ? $_POST [ 'item-postmenu' . $k ] : 0 ;
$parent_id = isset ( $_POST [ 'item-parent' . $k ] ) ? $_POST [ 'item-parent' . $k ] : 0 ;
2010-02-28 00:06:56 +01:00
$custom_title = isset ( $_POST [ 'item-title' . $k ] ) ? $_POST [ 'item-title' . $k ] : '' ;
2010-03-12 22:57:52 +01:00
$custom_linkurl = ( isset ( $_POST [ 'item-url' . $k ] ) && 'custom' == $_POST [ 'item-type' . $k ] ) ? $_POST [ 'item-url' . $k ] : '' ;
2010-02-28 00:06:56 +01:00
$custom_description = isset ( $_POST [ 'item-description' . $k ] ) ? $_POST [ 'item-description' . $k ] : '' ;
2010-03-02 04:59:28 +01:00
2010-02-23 21:48:50 +01:00
// doesn't seem to be used by UI
2010-02-28 21:00:49 +01:00
$position = isset ( $_POST [ 'item-position' . $k ] ) ? $_POST [ 'item-position' . $k ] : 0 ;
$linktype = isset ( $_POST [ 'item-type' . $k ] ) ? $_POST [ 'item-type' . $k ] : 'custom' ;
2010-02-28 00:06:56 +01:00
$custom_anchor_title = isset ( $_POST [ 'item-attr-title' . $k ] ) ? $_POST [ 'item-attr-title' . $k ] : $custom_title ;
$new_window = isset ( $_POST [ 'item-target' . $k ] ) ? $_POST [ 'item-target' . $k ] : 0 ;
2010-02-23 21:48:50 +01:00
$post = array ( 'post_status' => 'publish' , 'post_type' => 'nav_menu_item' , 'post_author' => $user_ID ,
'ping_status' => 0 , 'post_parent' => 0 , 'menu_order' => $position ,
2010-02-25 09:48:17 +01:00
'post_excerpt' => $custom_anchor_title , 'tax_input' => array ( 'nav_menu' => $menu_title ),
2010-02-23 21:48:50 +01:00
'post_content' => $custom_description , 'post_title' => $custom_title );
2010-02-25 17:49:57 +01:00
2010-02-24 19:52:54 +01:00
if ( $parent_id > 0 && isset ( $parent_menu_ids [ $parent_id ] ) )
$post [ 'post_parent' ] = $parent_menu_ids [ $parent_id ];
2010-03-02 04:59:28 +01:00
2010-02-23 21:48:50 +01:00
// New menu item
if ( $db_id == 0 ) {
$db_id = wp_insert_post ( $post );
} elseif ( isset ( $menu_items [ $db_id ] ) ) {
$post [ 'ID' ] = $db_id ;
wp_update_post ( $post );
unset ( $menu_items [ $db_id ] );
2010-02-20 22:57:43 +01:00
}
2010-02-24 00:13:54 +01:00
$parent_menu_ids [ $k ] = $db_id ;
2010-02-24 19:52:54 +01:00
update_post_meta ( $db_id , 'menu_type' , $linktype );
update_post_meta ( $db_id , 'object_id' , $object_id );
2010-02-25 17:49:57 +01:00
if ( $new_window )
update_post_meta ( $db_id , 'menu_new_window' , 1 );
else
update_post_meta ( $db_id , 'menu_new_window' , 0 );
if ( $custom_linkurl )
update_post_meta ( $db_id , 'menu_link' , esc_url_raw ( $custom_linkurl ) );
2010-02-23 21:48:50 +01:00
}
if ( ! empty ( $menu_items ) ) {
foreach ( array_keys ( $menu_items ) as $menu_id ) {
wp_delete_post ( $menu_id );
2010-02-20 22:57:43 +01:00
}
}
2010-02-24 19:52:54 +01:00
$messages_div = '<div id="message" class="updated fade below-h2"><p>' . __ ( 'The menu has been updated.' ) . '</p></div>' ;
2010-02-23 21:48:50 +01:00
}
2010-02-21 01:03:42 +01:00
2010-02-23 21:48:50 +01:00
?>
< div class = " wrap " >
2010-02-25 01:03:42 +01:00
< ? php screen_icon (); ?>
2010-02-28 00:06:56 +01:00
< h2 >< ? php esc_html_e ( 'Menus' ); ?> </h2>
2010-02-25 01:03:42 +01:00
< ? php echo $messages_div ; ?>
< 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>
2010-03-02 04:59:28 +01:00
2010-02-28 00:06:56 +01:00
< form onsubmit = " wp_update_post_data(); " action = " <?php echo admin_url( 'nav-menus.php' ); ?> " method = " post " enctype = " multipart/form-data " >
< ? php if ( ! empty ( $menus ) && count ( $menus ) > 1 ) : ?>
2010-02-24 02:44:16 +01:00
< ul class = " subsubsub " >
2010-02-25 01:03:42 +01:00
< ? php
2010-02-28 00:06:56 +01:00
foreach ( $menus as $menu ) {
$sep = end ( $menus ) == $menu ? '' : ' | ' ;
2010-02-24 02:44:16 +01:00
if ( ( $menu_id_in_edit == $menu -> term_id ) || ( $menu_selected_id == $menu -> term_id ) ) { ?>
2010-02-24 19:52:54 +01:00
< 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>
2010-02-25 01:03:42 +01:00
< ? php } else { ?>
2010-02-24 19:52:54 +01:00
< 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>
2010-02-25 01:03:42 +01:00
< ? php }
2010-02-24 02:44:16 +01:00
}
2010-02-25 01:03:42 +01:00
?>
2010-02-24 02:44:16 +01:00
</ ul >
2010-02-25 01:03:42 +01:00
< ? php endif ; ?>
2010-03-02 04:59:28 +01:00
2010-02-28 00:06:56 +01:00
< div id = " menu-management " class = " metabox-holder has-right-sidebar " >
< div id = " post-body " >
< div id = " post-body-content " >
< div id = " normal-sortables " class = " meta-box-sortables ui-sortable " >
< ? php if ( $valid_menu and ! empty ( $menus ) ) : ?>
2010-03-02 04:59:28 +01:00
< div id = " menu-container " class = " postbox " >
2010-02-28 00:06:56 +01:00
< h3 class = " hndle " >< ? php echo esc_html ( $menu_title ); ?> </h3>
< div class = " inside " >
< 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 ); ?> " />
< ? php
2010-02-28 21:00:49 +01:00
if ( $menu_selected_id > 0 )
echo wp_get_nav_menu ( array ( 'type' => 'backend' , 'menu' => $menu_selected_id , 'ul_class' => 'menu' ) );
2010-02-28 00:06:56 +01:00
?>
2010-03-02 04:59:28 +01:00
2010-02-28 00:06:56 +01:00
< div id = " queue " class = " hide " >
</ div ><!--/ #queue-->
</ div ><!-- /. inside -->
<!-- / #nav-menu-canvas .postbox-->
</ div >
< p >
< script type = " text/javascript " >
wp_update_post_data ();
</ script >
< a class = " submitdelete deletion " href = " <?php echo wp_nonce_url( admin_url('nav-menus.php?delete-menu=' . $menu_selected_id ), 'delete_menu-' . $menu_selected_id ); ?> " >< ? php _e ( 'Delete Menu' ); ?> </a>
< input class = " button-primary save " name = " save_menu " type = " submit " value = " <?php esc_attr_e('Save All Changes'); ?> " />
< br class = " clear " />
</ p >
< ? php endif ; ?>
</ div ><!-- / #normal-sortables-->
</ div ><!-- / #post-body-content-->
</ div ><!--- / #post-body -->
2010-02-25 01:03:42 +01:00
< div id = " menu-settings-column " class = " inner-sidebar " >
< div id = " side-sortables " class = " meta-box-sortables ui-sortable " >
2010-03-02 04:59:28 +01:00
2010-02-28 00:06:56 +01:00
< div id = " create-menu " class = " postbox " >
< h3 class = " hndle " >< ? php esc_html_e ( 'Create Menu' ); ?> </h3>
2010-02-25 01:03:42 +01:00
< div class = " inside " >
2010-02-28 00:06:56 +01:00
< p >
< input type = " text " name = " create-menu-name " id = " create-menu-name " class = " regular-text " value = " " />
< input type = " submit " name = " create-menu " id = " create-menu " class = " button " value = " <?php esc_attr_e('Create Menu'); ?> " />
</ p >
2010-02-25 01:03:42 +01:00
</ div ><!-- /. inside -->
2010-02-28 00:06:56 +01:00
</ div ><!-- END #create-menu-->
2010-03-02 04:59:28 +01:00
2010-02-25 06:40:03 +01:00
< div id = " add-custom-link " class = " postbox " >
< h3 class = " hndle " >< ? php esc_html_e ( 'Add a Custom Link' ); ?> </h3>
2010-03-02 04:59:28 +01:00
< div class = " inside " >
2010-02-28 00:06:56 +01:00
< p id = " menu-item-url-wrap " >
< label class = " howto " for = " menu-item-url " >
< span >< ? php _e ( 'URL' ); ?> </span>
< input id = " menu-item-url " name = " menu-item-url " type = " text " class = " code " value = " http:// " />
</ label >
</ p >
< br class = " clear " />
< p id = " menu-item-name-wrap " >
< label class = " howto " for = " custom-menu-item-name " >
< span >< ? php _e ( 'Text' ); ?> </span>
< input id = " menu-item-name " type = " text " class = " regular-text " value = " <?php echo esc_attr( __('Menu Item') ); ?> " />
</ label >
</ p >
2010-03-02 04:59:28 +01:00
2010-02-28 00:06:56 +01:00
< p class = " button-controls " >
2010-03-02 04:28:11 +01:00
< a class = " show-all " >< ? php _e ( 'View All' ); ?> </a>
< a class = " hide-all " >< ? php _e ( 'Hide All' ); ?> </a>
2010-02-28 00:06:56 +01:00
</ p >
< div id = " available-links " class = " list-wrap " >
< div class = " list-container " >
< ul class = " list " >
2010-02-28 21:00:49 +01:00
< ? php $items_counter = wp_nav_menu_get_custom_links ( 0 , 'default' ); ?>
2010-02-28 00:06:56 +01:00
</ ul >
</ div ><!-- /. list - container -->
</ div ><!-- / #available-links-->
< p class = " add-to-menu " >
< a class = " button " >< ? php _e ( 'Add to Menu' ); ?> </a>
</ p >
2010-02-25 06:40:03 +01:00
< br class = " clear " />
</ div ><!-- /. inside -->
</ div ><!-- / #add-custom-link-->
2010-03-02 04:59:28 +01:00
2010-02-25 01:03:42 +01:00
< div id = " add-pages " class = " postbox " >
< h3 class = " hndle " >< ? php esc_html_e ( 'Add an Existing Page' ); ?> </h3>
< div class = " inside " >
< ? php
$pages_args = array (
2010-02-28 00:06:56 +01:00
'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
2010-02-25 01:03:42 +01:00
);
$page_name = '' ;
2010-02-28 00:06:56 +01:00
$pages_array = get_pages ( $pages_args );
2010-02-25 01:03:42 +01:00
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'); ?> " >
jQuery ( document ) . ready ( function (){
2010-02-28 00:06:56 +01:00
var posts = " <?php echo esc_js( $page_name ); ?> " . split ( '|' );
jQuery ( '#add-pages .quick-search' ) . autocomplete ( posts );
2010-03-02 04:59:28 +01:00
2010-02-28 00:06:56 +01:00
jQuery ( '#add-pages .quick-search' ) . result ( function ( event , data , formatted ) {
jQuery ( '#add-pages .list-wrap' ) . css ( 'display' , 'block' );
2010-02-28 21:00:49 +01:00
jQuery ( " #add-pages .list-wrap li:contains(' " + data + " ') " ) . css ( 'display' , 'block' );
2010-02-28 00:06:56 +01:00
jQuery ( '#add-pages .show-all' ) . hide ();
jQuery ( '#add-pages .hide-all' ) . show ();
2010-02-25 01:03:42 +01:00
});
});
</ script >
2010-02-28 00:06:56 +01:00
< p >
< input type = " text " class = " quick-search regular-text " value = " " />
< a class = " quick-search-submit button " >< ? php _e ( 'Search' ); ?> </a>
</ p >
2010-03-02 04:59:28 +01:00
2010-02-28 00:06:56 +01:00
< p class = " button-controls " >
2010-03-02 04:28:11 +01:00
< a class = " show-all " >< ? php _e ( 'View All' ); ?> </a>
< a class = " hide-all " >< ? php _e ( 'Hide All' ); ?> </a>
2010-02-28 00:06:56 +01:00
</ p >
2010-03-02 04:59:28 +01:00
2010-02-28 00:06:56 +01:00
< div id = " existing-pages " class = " list-wrap " >
< div class = " list-container " >
< ul class = " list " >
2010-02-28 21:00:49 +01:00
< ? php $items_counter = wp_nav_menu_get_pages ( $items_counter , 'default' ); ?>
2010-02-28 00:06:56 +01:00
</ ul >
</ div ><!-- /. list - container -->
</ div ><!-- / #existing-pages-->
< p class = " add-to-menu enqueue " >
< a class = " button " >< ? php _e ( 'Add to Menu' ); ?> </a>
</ p >
2010-02-25 06:40:03 +01:00
< br class = " clear " />
2010-02-25 01:03:42 +01:00
</ div ><!-- /. inside -->
</ div ><!-- END #add-pages-->
2010-03-02 04:59:28 +01:00
2010-02-25 01:03:42 +01:00
< div id = " add-categories " class = " postbox " >
< h3 class = " hndle " >< ? php esc_html_e ( 'Add an Existing Category' ); ?> </h3>
< div class = " inside " >
< ? 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'); ?> " >
jQuery ( document ) . ready ( function (){
2010-02-28 00:06:56 +01:00
var categories = " <?php echo esc_js( $cat_name ); ?> " . split ( '|' );
jQuery ( '#add-categories .quick-search' ) . autocomplete ( categories );
jQuery ( '#add-categories .quick-search' ) . result ( function ( event , data , formatted ) {
jQuery ( '#add-categories .list-wrap' ) . css ( 'display' , 'block' );
2010-02-28 21:00:49 +01:00
jQuery ( " #add-categories .list-wrap li:contains(' " + data + " ') " ) . css ( 'display' , 'block' );
2010-02-28 00:06:56 +01:00
jQuery ( '#add-categories .show-all' ) . hide ();
jQuery ( '#add-categories .hide-all' ) . show ();
2010-02-25 01:03:42 +01:00
});
});
</ script >
2010-02-28 00:06:56 +01:00
< p >
< input type = " text " class = " quick-search regular-text " value = " " />
< a class = " quick-search-submit button " >< ? php _e ( 'Search' ); ?> </a>
</ p >
2010-03-02 04:59:28 +01:00
2010-02-28 00:06:56 +01:00
< p class = " button-controls " >
2010-03-02 04:28:11 +01:00
< a class = " show-all " >< ? php _e ( 'View All' ); ?> </a>
< a class = " hide-all " >< ? php _e ( 'Hide All' ); ?> </a>
2010-02-28 00:06:56 +01:00
</ p >
2010-03-02 04:59:28 +01:00
2010-02-28 00:06:56 +01:00
< div id = " existing-categories " class = " list-wrap " >
< div class = " list-container " >
< ul class = " list " >
< ? php $items_counter = wp_nav_menu_get_categories ( $items_counter , 'default' ); ?>
</ ul >
</ div ><!-- /. list - container -->
</ div ><!-- / #existing-categories-->
< p class = " add-to-menu enqueue " >
< a class = " button " >< ? php _e ( 'Add to Menu' ); ?> </a>
</ p >
2010-02-25 06:40:03 +01:00
< br class = " clear " />
2010-02-25 01:03:42 +01:00
</ div ><!-- /. inside -->
</ div ><!-- END #add-categories-->
</ div ><!-- / #side-sortables-->
</ div ><!-- / #menu-settings-column -->
< br class = " clear " />
</ div ><!-- /. metabox - holder has - right - sidebar -->
2010-02-24 21:14:12 +01:00
</ form >
2010-02-25 01:03:42 +01:00
</ div ><!-- /. wrap -->
2010-02-23 21:48:50 +01:00
2010-02-28 00:06:56 +01:00
< div id = " menu-item-settings " >
< p class = " description " >
< label for = " edit-item-title " >
< ? php _e ( 'Menu Title' ); ?> <br />
< input type = " text " id = " edit-item-title " class = " widefat " name = " edit-item-title " value = " " tabindex = " 1 " />
</ label >
</ p >
< p class = " description " >
< label for = " edit-item-url " >
< ? php _e ( 'URL' ); ?> <br />
< input type = " text " id = " edit-item-url " class = " widefat code " name = " edit-item-url " value = " " tabindex = " 2 " />
</ label >
</ p >
< p class = " description " >
< label for = " edit-item-attr-title " >
< ? php _e ( 'Attribute Title' ); ?> <br />
< input type = " text " id = " edit-item-attr-title " class = " widefat " name = " edit-item-attr-title " value = " " tabindex = " 3 " />
</ label >
</ p >
< p class = " description " >
< label for = " edit-item-target " >
< ? php _e ( 'Open Link in a new window' ); ?> <br />
< select id = " edit-item-target " class = " widefat " name = " edit-item-target " >
< option value = " 1 " > Yes </ option >
< option value = " 0 " > No </ option >
</ select >
</ label >
</ p >
< p class = " description " >
< label for = " edit-item-description " >
< ? php _e ( 'Description' ); ?> <br />
< textarea id = " edit-item-description " class = " widefat " rows = " 3 " name = " edit-item-description " tabindex = " 4 " /></ textarea >
</ label >
</ p >
< p >
< a id = " cancel-save " class = " submitdelete deletion " >< ? php _e ( 'Cancel' ); ?> </a>
< a id = " update-menu-item " class = " save button-primary " tabindex = " 5 " >< ? php _e ( 'Save Changes' ); ?> </a>
</ p >
< input type = " hidden " id = " edit-item-id " name = " edit-item-id " value = " " />
</ div ><!-- / #menu-item-settings-->
< ? php include ( 'admin-footer.php' ); ?>