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
*
* @ author Jeffikus < pearce . jp @ gmail . com >
* @ version 1.1 . 0
*
* @ 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-23 21:48:50 +01:00
if ( ! current_user_can ( 'switch_themes' ) )
wp_die ( __ ( 'Cheatin’ uh?' ));
2010-02-20 22:57:43 +01:00
wp_admin_css ( 'custom-navigation' );
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-20 22:57:43 +01:00
wp_enqueue_script ( 'custom-navigation-dynamic-functions' );
wp_enqueue_script ( 'custom-navigation-default-items' );
2010-02-21 00:35:05 +01:00
wp_enqueue_script ( 'jquery-autocomplete' );
2010-02-20 22:57:43 +01:00
wp_enqueue_script ( 'custom-navigation-php-functions' );
2010-02-21 01:10:20 +01:00
2010-02-20 22:57:43 +01:00
require_once ( 'admin-header.php' );
2010-02-24 09:06:36 +01:00
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-24 09:45:26 +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-24 19:52:54 +01:00
if ( isset ( $_POST [ 'delete-menu' ] ) && $menu_selected_id > 0 ) {
2010-02-24 00:53:08 +01:00
wp_delete_nav_menu ( $menu_selected_id );
$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-24 07:41:35 +01:00
$custom_menus = wp_get_nav_menus ();
2010-02-24 00:53:08 +01:00
if ( ! $menu_selected_id && ! empty ( $custom_menus ) )
2010-02-23 21:48:50 +01:00
$menu_selected_id = $custom_menus [ 0 ] -> term_id ;
$menu_title = '' ;
if ( $menu_selected_id > 0 ) {
foreach ( $custom_menus as $menu ) {
if ( $menu -> term_id == $menu_selected_id ) {
$menu_title = $menu -> name ;
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-24 19:52:54 +01:00
if ( isset ( $_POST [ 'add-menu' ] ) && ! $updated ) {
$insert_menu_name = $_POST [ 'add-menu-name' ];
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-23 23:06:21 +01:00
$custom_menus [ $menu -> term_id ] = $menu ;
$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-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 ++ ) {
$db_id = isset ( $_POST [ 'dbid' . $k ] ) ? $_POST [ 'dbid' . $k ] : 0 ;
$object_id = isset ( $_POST [ 'postmenu' . $k ] ) ? $_POST [ 'postmenu' . $k ] : 0 ;
$parent_id = isset ( $_POST [ 'parent' . $k ] ) ? $_POST [ 'parent' . $k ] : 0 ;
$custom_title = isset ( $_POST [ 'title' . $k ] ) ? $_POST [ 'title' . $k ] : '' ;
$custom_linkurl = isset ( $_POST [ 'linkurl' . $k ] ) ? $_POST [ 'linkurl' . $k ] : '' ;
$custom_description = isset ( $_POST [ 'description' . $k ] ) ? $_POST [ 'description' . $k ] : '' ;
2010-02-23 21:48:50 +01:00
// doesn't seem to be used by UI
2010-02-24 19:52:54 +01:00
$icon = isset ( $_POST [ 'icon' . $k ] ) ? $_POST [ 'icon' . $k ] : 0 ;
$position = isset ( $_POST [ 'position' . $k ] ) ? $_POST [ 'position' . $k ] : 0 ;
$linktype = isset ( $_POST [ 'linktype' . $k ] ) ? $_POST [ 'linktype' . $k ] : 'custom' ;
$custom_anchor_title = isset ( $_POST [ 'anchortitle' . $k ] ) ? $_POST [ 'anchortitle' . $k ] : $custom_title ;
$new_window = isset ( $_POST [ 'newwindow' . $k ] ) ? $_POST [ 'newwindow' . $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 ,
'guid' => $custom_linkurl , 'post_excerpt' => $custom_anchor_title , 'tax_input' => array ( 'nav_menu' => $menu_title ),
'post_content' => $custom_description , 'post_title' => $custom_title );
if ( $new_window )
$post [ 'post_content_filtered' ] = '_blank' ;
else
$post [ 'post_content_filtered' ] = '' ;
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-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-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 " >
< ? php screen_icon (); ?>
2010-02-24 11:37:00 +01:00
< h2 >< ? php esc_html_e ( 'Menus' ) ?> </h2>
< form onsubmit = " updatepostdata() " action = " <?php echo admin_url( 'nav-menus.php' ); ?> " method = " post " enctype = " multipart/form-data " >
2010-02-24 19:52:54 +01:00
< ? php if ( ! empty ( $custom_menus ) && count ( $custom_menus ) > 1 ) : ?>
2010-02-24 02:44:16 +01:00
< ul class = " subsubsub " >
2010-02-24 10:43:09 +01:00
< ? php
2010-02-24 02:44:16 +01:00
foreach ( $custom_menus as $menu ) {
2010-02-24 19:52:54 +01:00
$sep = end ( $custom_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-24 07:41:35 +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-24 07:41:35 +01:00
< ? php }
2010-02-24 02:44:16 +01:00
}
2010-02-24 10:43:09 +01:00
?>
2010-02-24 02:44:16 +01:00
</ ul >
< div class = " clear " ></ div >
2010-02-24 19:52:54 +01:00
< ? php endif ?>
2010-02-24 11:37:00 +01:00
< 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>
< div class = " hide-if-no-js " >
< div id = " pages-left " >
2010-02-23 21:48:50 +01:00
< div class = " inside " >
2010-02-24 10:43:09 +01:00
< ? php if ( ! empty ( $custom_menus ) ) : ?>
2010-02-24 19:52:54 +01:00
< ? php echo $messages_div ; ?>
2010-02-23 21:48:50 +01:00
2010-02-24 19:52:54 +01:00
< 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 ); ?> " />
2010-02-23 21:48:50 +01:00
< div class = " sidebar-name " >
< div class = " sidebar-name-arrow " >
< br />
2010-02-20 22:57:43 +01:00
</ div >
2010-02-24 19:52:54 +01:00
< h3 >< ? php echo esc_html ( $menu_title ); ?> </h3>
2010-02-21 01:03:42 +01:00
2010-02-20 22:57:43 +01:00
</ div >
2010-02-21 01:03:42 +01:00
2010-02-23 21:48:50 +01:00
< div id = " nav-container " >
< ul id = " custom-nav " >
2010-02-21 01:03:42 +01:00
2010-02-24 19:52:54 +01:00
< ? php
2010-02-23 21:48:50 +01:00
if ( $menu_selected_id > 0 ) {
2010-02-24 19:52:54 +01:00
wp_print_nav_menu ( array ( 'type' => 'backend' , 'name' => $menu_title , 'id' => $menu_selected_id ) );
2010-02-23 21:48:50 +01:00
}
2010-02-24 19:52:54 +01:00
?>
2010-02-23 21:48:50 +01:00
</ ul >
</ div ><!-- / #nav-container -->
2010-02-21 01:03:42 +01:00
2010-02-23 21:48:50 +01:00
< p class = " submit " >
2010-02-21 01:03:42 +01:00
2010-02-23 21:48:50 +01:00
< script type = " text/javascript " >
updatepostdata ();
</ script >
2010-02-24 10:43:09 +01:00
< input id = " save_bottom " name = " save_bottom " type = " submit " value = " <?php esc_attr_e('Save All Changes'); ?> " />
2010-02-24 19:52:54 +01:00
< input id = " delete-menu " name = " delete-menu " type = " submit " value = " <?php esc_attr_e('Delete This Menu'); ?> " />
2010-02-24 10:43:09 +01:00
</ p >
< ? php else : ?>
< div class = " updated below-h2 " >< p >< ? php _e ( 'Add a menu to start editing!' ); ?> </p></div>
< ? php endif ; ?>
2010-02-23 21:48:50 +01:00
</ div ><!-- /. inside -->
</ div >
2010-02-21 01:03:42 +01:00
2010-02-23 21:48:50 +01:00
< div id = " menu-right " >
< div class = " widgets-holder-wrap " >
< div class = " sidebar-name " >
< div class = " sidebar-name-arrow " ></ div >
2010-02-24 10:43:09 +01:00
< h3 >< ? php esc_html_e ( 'Add Menu' ); ?> </h3>
2010-02-23 21:48:50 +01:00
</ div >
< div class = " widget-holder " >
2010-02-21 01:03:42 +01:00
2010-02-24 02:44:16 +01:00
< span >
2010-02-24 19:52:54 +01:00
< input id = " add-menu-name " name = " add-menu-name " type = " text " value = " " />
< input id = " add-menu " type = " submit " value = " <?php esc_attr_e('Add Menu'); ?> " name = " add-menu " class = " button " />
2010-02-24 02:44:16 +01:00
</ span >
2010-02-23 21:48:50 +01:00
</ div >
</ div ><!-- /. widgets - holder - wrap -->
< div class = " widgets-holder-wrap " >
< div class = " sidebar-name " >
< div class = " sidebar-name-arrow " ></ div >
< h3 >< ? php esc_html_e ( 'Add an Existing Page' ); ?> </h3>
</ div >
< div class = " widget-holder " >
2010-02-24 19:52:54 +01:00
< ? php
$pages_args = array (
'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
);
$page_name = '' ;
$pages_array = get_pages ( $pages_args );
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'); ?> " >
2010-02-23 21:48:50 +01:00
jQuery ( document ) . ready ( function (){
2010-02-24 19:52:54 +01:00
var posts = " <?php echo esc_js( $page_name ); ?> " . split ( " | " );
jQuery ( " #page-search " ) . autocomplete ( posts );
2010-02-23 21:48:50 +01:00
jQuery ( " #page-search " ) . result ( function ( event , data , formatted ) {
jQuery ( '#existing-pages' ) . css ( 'display' , 'block' );
jQuery ( " #existing-pages dt:contains(' " + data + " ') " ) . css ( " display " , " block " );
jQuery ( '#show-pages' ) . hide ();
jQuery ( '#hide-pages' ) . show ();
});
jQuery ( '#existing-pages' ) . css ( 'display' , 'none' );
});
</ script >
< input type = " text " onfocus = " jQuery('#page-search').attr('value',''); " id = " page-search " value = " <?php esc_attr_e('Search Pages'); ?> " />
2010-02-21 01:03:42 +01:00
2010-02-24 19:52:54 +01:00
< a id = " show-pages " style = " cursor:pointer; " onclick = " jQuery('#existing-pages').css('display','block');jQuery('#page-search').attr('value','');jQuery('#existing-pages dt').css('display','block');jQuery('#show-pages').hide();jQuery('#hide-pages').show(); " >< ? php _e ( 'View All' ); ?> </a>
< a id = " hide-pages " style = " cursor:pointer; " onclick = " jQuery('#existing-pages').css('display','none');jQuery('#page-search').attr('value','Search Pages');jQuery('#existing-pages dt').css('display','none');jQuery('#show-pages').show();jQuery('#hide-pages').hide(); " >< ? php _e ( 'Hide All' ); ?> </a>
2010-02-21 01:03:42 +01:00
2010-02-23 21:48:50 +01:00
< script type = " text/javascript " >
jQuery ( '#hide-pages' ) . hide ();
</ script >
2010-02-21 01:03:42 +01:00
2010-02-23 21:48:50 +01:00
< ul id = " existing-pages " class = " list " >
2010-02-24 19:52:54 +01:00
< ? php
$items_counter = wp_nav_menu_get_pages ( 0 , 'default' );
?>
2010-02-23 21:48:50 +01:00
</ ul >
< div class = " fix " ></ div >
</ div >
</ div ><!-- /. widgets - holder - wrap -->
< div class = " widgets-holder-wrap " >
< div class = " sidebar-name " >
< div class = " sidebar-name-arrow " ></ div >
< h3 >< ? php esc_html_e ( 'Add an Existing Category' ); ?> </h3>
</ div >
< div class = " widget-holder " >
2010-02-24 19:52:54 +01:00
< ? 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'); ?> " >
2010-02-23 21:48:50 +01:00
jQuery ( document ) . ready ( function (){
2010-02-24 19:52:54 +01:00
var categories = " <?php echo esc_js( $cat_name ); ?> " . split ( " | " );
jQuery ( " #cat-search " ) . autocomplete ( categories );
2010-02-23 21:48:50 +01:00
jQuery ( " #cat-search " ) . result ( function ( event , data , formatted ) {
jQuery ( '#existing-categories' ) . css ( 'display' , 'block' );
jQuery ( " #existing-categories dt:contains(' " + data + " ') " ) . css ( " display " , " block " );
jQuery ( '#show-cats' ) . hide ();
jQuery ( '#hide-cats' ) . show ();
});
jQuery ( '#existing-categories' ) . css ( 'display' , 'none' );
});
</ script >
2010-02-21 01:03:42 +01:00
2010-02-23 21:48:50 +01:00
< input type = " text " onfocus = " jQuery('#cat-search').attr('value',''); " id = " cat-search " value = " <?php esc_attr_e('Search Categories'); ?> " />
2010-02-20 22:57:43 +01:00
2010-02-24 19:52:54 +01:00
< a id = " show-cats " style = " cursor:pointer; " onclick = " jQuery('#existing-categories').css('display','block');jQuery('#cat-search').attr('value','');jQuery('#existing-categories dt').css('display','block');jQuery('#show-cats').hide();jQuery('#hide-cats').show(); " >< ? php _e ( 'View All' ); ?> </a>
< a id = " hide-cats " style = " cursor:pointer; " onclick = " jQuery('#existing-categories').css('display','none');jQuery('#cat-search').attr('value','Search Categories');jQuery('#existing-categories dt').css('display','none');jQuery('#show-cats').show();jQuery('#hide-cats').hide(); " >< ? php _e ( 'Hide All' ); ?> </a>
2010-02-21 01:03:42 +01:00
2010-02-23 21:48:50 +01:00
< script type = " text/javascript " >
jQuery ( '#hide-cats' ) . hide ();
</ script >
2010-02-21 01:03:42 +01:00
2010-02-23 21:48:50 +01:00
< ul id = " existing-categories " class = " list " >
2010-02-24 19:52:54 +01:00
< ? php
$items_counter = wp_nav_menu_get_categories ( $items_counter , 'default' );
?>
2010-02-23 21:48:50 +01:00
</ ul >
2010-02-21 01:03:42 +01:00
2010-02-23 21:48:50 +01:00
< div class = " fix " ></ div >
</ div >
</ div ><!-- /. widgets - holder - wrap -->
2010-02-21 01:03:42 +01:00
2010-02-23 21:48:50 +01:00
< div class = " widgets-holder-wrap " >
< div class = " sidebar-name " >
< div class = " sidebar-name-arrow " ></ div >
< h3 >< ? php esc_html_e ( 'Add a Custom Url' ); ?> </h3>
</ div >
< div class = " widget-holder " >
2010-02-24 19:52:54 +01:00
< input id = " custom-menu-item-url " type = " text " value = " http:// " />
< label for = " custom-menu-item-url " >< ? php _e ( 'URL' ); ?> </label><br />
< ? php $template_dir = get_bloginfo ( 'url' ); ?>
< input type = " hidden " id = " template-dir " value = " <?php echo esc_attr( $template_dir ); ?> " />
< input id = " custom-menu-item-name " type = " text " value = " <?php echo esc_attr( __('Menu Item') ); ?> " onfocus = " jQuery('#custom-menu-item-name').attr('value',''); " />
< label for = " custom-menu-item-name " >< ? php _e ( 'Menu Text' ); ?> </label><br />
2010-02-23 21:48:50 +01:00
< input id = " custom_menu_item_description " type = " text " value = " <?php esc_attr_e('A description'); ?> " < ? php if ( $advanced_option_descriptions == 'no' ) { ?> style="display:none;"<?php } ?> onfocus="jQuery('#custom_menu_item_description').attr('value','');" />
< label < ? php if ( $advanced_option_descriptions == 'no' ) { ?> style="display:none;"<?php } ?> ><?php _e('Description'); ?></label>
2010-02-24 19:52:54 +01:00
< a class = " addtomenu " onclick = " appendToList('<?php echo $template_dir ; ?>','<?php echo esc_js( _x('Custom', 'menu nav item type') ); ?>','','','','0','');jQuery('#custom-menu-item-name').attr('value','<?php echo esc_js( __('Menu Item') ); ?>');jQuery('#custom_menu_item_description').attr('value','<?php echo esc_js( __('A description') ); ?>'); " >< ? php _e ( 'Add to menu' ); ?> </a>
2010-02-23 21:48:50 +01:00
< div class = " fix " ></ div >
</ div >
</ div ><!-- /. widgets - holder - wrap -->
2010-02-24 09:10:27 +01:00
</ div ><!-- /. hide - if - no - js -->
</ div >
2010-02-23 21:48:50 +01:00
</ div >
2010-02-24 09:10:27 +01:00
< div id = " dialog-confirm " style = " display:none; " title = " <?php esc_attr_e('Edit Menu Item'); ?> " >
2010-02-24 19:52:54 +01:00
< input id = " edittitle " type = " text " name = " edittitle " value = " " />< label class = " editlabel " for = " edittitle " >< ? php _e ( 'Menu Title' ); ?> </label><br />
2010-02-23 21:48:50 +01:00
< 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 />
< select id = " editnewwindow " name = " editnewwindow " >
< option value = " 1 " >< ? php _e ( 'Yes' ); ?> </option>
< option value = " 0 " >< ? php _e ( 'No' ); ?> </option>
</ 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 />
</ div >
2010-02-20 22:57:43 +01:00
< ? php
2010-02-24 19:52:54 +01:00
include ( " admin-footer.php " );