X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f9001779751f83dc8a10e478bfecb4d8dd5f964c..refs/tags/wordpress-3.4.1:/wp-admin/nav-menus.php?ds=sidebyside diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php index 1e398051..6b4b0323 100644 --- a/wp-admin/nav-menus.php +++ b/wp-admin/nav-menus.php @@ -22,11 +22,7 @@ if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets' if ( ! current_user_can('edit_theme_options') ) wp_die( __( 'Cheatin’ uh?' ) ); -// Nav Menu CSS -wp_admin_css( 'nav-menu' ); - // jQuery -wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'jquery-ui-draggable' ); wp_enqueue_script( 'jquery-ui-droppable' ); wp_enqueue_script( 'jquery-ui-sortable' ); @@ -39,6 +35,9 @@ wp_enqueue_script( 'common' ); wp_enqueue_script( 'wp-lists' ); wp_enqueue_script( 'postbox' ); +if ( wp_is_mobile() ) + wp_enqueue_script( 'jquery-touch-punch' ); + // Container for any messages displayed to the user $messages = array(); @@ -121,7 +120,6 @@ switch ( $action ) { wp_update_post($next_item_data); } - // the item is last but still has a parent, so bubble up } elseif ( ! empty( $menu_item_data['menu_item_parent'] ) && @@ -156,7 +154,6 @@ switch ( $action ) { } } - // if this menu item is not first if ( ! empty( $dbids_to_orders[$menu_item_id] ) && ! empty( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) ) { @@ -232,7 +229,6 @@ switch ( $action ) { check_admin_referer( 'delete-menu_item_' . $menu_item_id ); - if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) ) $messages[] = '

' . __('The menu item has been successfully deleted.') . '

'; break; @@ -434,14 +430,14 @@ $_wp_nav_menu_max_depth = 0; // Calling wp_get_nav_menu_to_edit generates $_wp_nav_menu_max_depth if ( is_nav_menu( $nav_menu_selected_id ) ) - $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id ); + $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id ); -function wp_nav_menu_max_depth() { +function wp_nav_menu_max_depth($classes) { global $_wp_nav_menu_max_depth; - return "menu-max-depth-$_wp_nav_menu_max_depth"; + return "$classes menu-max-depth-$_wp_nav_menu_max_depth"; } -add_action('admin_body_class','wp_nav_menu_max_depth'); +add_filter('admin_body_class', 'wp_nav_menu_max_depth'); wp_nav_menu_setup(); wp_initial_nav_menu_meta_boxes(); @@ -449,14 +445,26 @@ wp_initial_nav_menu_meta_boxes(); if ( ! current_theme_supports( 'menus' ) && ! wp_get_nav_menus() ) $messages[] = '

' . __('The current theme does not natively support menus, but you can use the “Custom Menu” widget to add any menus you create here to the theme’s sidebar.') . '

'; -$help = '

' . __('This feature, introduced in version 3.0, allows you to use a custom menu in place of your theme’s default menus. If your theme does not support the custom menus feature yet (the default theme, Twenty Ten, does), you can learn about adding this support by following the Documentation link in this tab. You can still use the “Custom Menu” widget to add menus to a sidebar.') . '

'; -$help .= '

' . __('You can create custom menus for your site. These menus may contain links to pages, categories, custom links or other content types (use the Screen Options tab to decide which ones to show on the screen). You can specify a different navigation label for a menu item as well as other attributes. You can create multiple menus. If your theme includes more than one menu, you can choose which custom menu to associate with each. You can also use custom menus in conjunction with the Custom Menus widget.') . '

'; -$help .= '

' . __('To create a new custom menu, click on the + tab, give the menu a name, and click Create Menu. Next, add menu items from the appropriate boxes. You’ll be able to edit the information for each menu item, and can drag and drop to put them in order. You can also drag a menu item a little to the right to make it a submenu, to create menus with hierarchy. Drop the item into its new nested placement when the dotted rectangle target shifts over, also a little to the right. Don’t forget to click Save when you’re finished.') . '

'; -$help .= '

' . __('For more information:') . '

'; -$help .= '

' . __('Documentation on Menus') . '

'; -$help .= '

' . __('Support Forums') . '

'; - -add_contextual_help($current_screen, $help); +get_current_screen()->add_help_tab( array( +'id' => 'overview', +'title' => __('Overview'), +'content' => + '

' . __('This feature allows you to use a custom menu in place of your theme’s default menus.') . '

' . + '

' . __('Custom menus may contain links to pages, categories, custom links or other content types (use the Screen Options tab to decide which ones to show on the screen). You can specify a different navigation label for a menu item as well as other attributes. You can create multiple menus. If your theme includes more than one menu, you can choose which custom menu to associate with each. You can also use custom menus in conjunction with the Custom Menus widget.') . '

' . + '

' . __('If your theme does not support the custom menus feature yet (the default themes, Twenty Eleven and Twenty Ten, do), you can learn about adding this support by following the Documentation link to the side.') . '

' +) ); +get_current_screen()->add_help_tab( array( +'id' => 'create-menus', +'title' => __('Create Menus'), +'content' => + '

' . __('To create a new custom menu, click on the + tab, give the menu a name, and click Create Menu. Next, add menu items from the appropriate boxes. You’ll be able to edit the information for each menu item, and can drag and drop to put them in order. You can also drag a menu item a little to the right to make it a submenu, to create menus with hierarchy. Drop the item into its new nested placement when the dotted rectangle target shifts over, also a little to the right. Don’t forget to click Save when you’re finished.') . '

' +) ); + +get_current_screen()->set_help_sidebar( + '

' . __('For more information:') . '

' . + '

' . __('Documentation on Menus') . '

' . + '

' . __('Support Forums') . '

' +); // Get the admin header require_once( './admin-header.php' ); @@ -537,7 +545,7 @@ require_once( './admin-header.php' );

- + 'save_menu_header' ) ); ?>
@@ -593,7 +601,10 @@ require_once( './admin-header.php' ); @@ -604,5 +615,4 @@ require_once( './admin-header.php' );
-