From 7e226f1a94cd2757270f06e58ab2c49c5314411e Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sat, 18 Nov 2006 07:31:29 +0000 Subject: [PATCH] Hold off on menu cleanup until next release. There be dragons. git-svn-id: https://develop.svn.wordpress.org/trunk@4480 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin.php | 2 ++ wp-admin/categories.php | 3 +++ wp-admin/comment.php | 1 + wp-admin/edit-comments.php | 2 ++ wp-admin/edit-pages.php | 2 ++ wp-admin/edit.php | 2 ++ wp-admin/export.php | 2 ++ wp-admin/import.php | 2 ++ wp-admin/index.php | 2 ++ wp-admin/link-add.php | 3 +++ wp-admin/link-import.php | 2 ++ wp-admin/link-manager.php | 1 + wp-admin/menu-header.php | 10 ++------ wp-admin/menu.php | 41 +++++++++++++++------------------ wp-admin/moderation.php | 2 ++ wp-admin/options-discussion.php | 4 ++++ wp-admin/options-general.php | 4 ++++ wp-admin/options-misc.php | 4 ++++ wp-admin/options-permalink.php | 4 ++++ wp-admin/options-privacy.php | 4 ++++ wp-admin/options-reading.php | 4 ++++ wp-admin/options-writing.php | 4 ++++ wp-admin/options.php | 4 ++++ wp-admin/page-new.php | 2 ++ wp-admin/plugin-editor.php | 4 ++++ wp-admin/plugins.php | 1 + wp-admin/post-new.php | 2 ++ wp-admin/profile.php | 7 ++++++ wp-admin/templates.php | 3 +++ wp-admin/theme-editor.php | 4 ++++ wp-admin/themes.php | 2 ++ wp-admin/user-edit.php | 5 ++++ wp-admin/users.php | 6 +++++ 33 files changed, 115 insertions(+), 30 deletions(-) diff --git a/wp-admin/admin.php b/wp-admin/admin.php index d350ddbc1e..de7b6aee73 100644 --- a/wp-admin/admin.php +++ b/wp-admin/admin.php @@ -82,7 +82,9 @@ if (isset($plugin_page)) { include(ABSPATH . "wp-admin/import/$importer.php"); + $parent_file = 'edit.php'; $submenu_file = 'import.php'; + $title = __('Import'); if (! isset($_GET['noheader'])) require_once(ABSPATH . 'wp-admin/admin-header.php'); diff --git a/wp-admin/categories.php b/wp-admin/categories.php index c0026e754c..bd93bcb736 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -1,6 +1,9 @@ diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 1edb386a9a..2722aa2586 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -1,6 +1,8 @@ diff --git a/wp-admin/index.php b/wp-admin/index.php index b546747c7f..c6d2e9130b 100644 --- a/wp-admin/index.php +++ b/wp-admin/index.php @@ -1,5 +1,7 @@ $subpages ) { - foreach ( $subpages as $page ) { - // 0 menu title, 1 cap, 2 file or slug, 3 page title - if ( $self == $page[2] ) - $parent_file = $parent; - } -} +get_admin_page_parent(); foreach ($menu as $item) { $class = ''; @@ -68,4 +62,4 @@ endif; do_action('admin_notices'); -?> \ No newline at end of file +?> diff --git a/wp-admin/menu.php b/wp-admin/menu.php index ebe13c581a..2ead8eddb9 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -4,31 +4,26 @@ // Menu item name // The minimum level the user needs to access the item: between 0 and 10 // The URL of the item's file -// Slug -$menu[0] = array(__('Dashboard'), 'read', 'index.php', 'home'); +$menu[0] = array(__('Dashboard'), 'read', 'index.php'); -// So when people switch between write and manage they go to the appropiate page/post mode they were on if ( strstr($_SERVER['REQUEST_URI'], 'edit-pages.php') ) - $menu[5] = array(__('Write'), 'edit_pages', 'page-new.php', 'write'); + $menu[5] = array(__('Write'), 'edit_pages', 'page-new.php'); else - $menu[5] = array(__('Write'), 'edit_posts', 'post-new.php', 'write'); - + $menu[5] = array(__('Write'), 'edit_posts', 'post-new.php'); if ( strstr($_SERVER['REQUEST_URI'], 'page-new.php') ) - $menu[10] = array(__('Manage'), 'edit_pages', 'edit-pages.php', 'manage'); + $menu[10] = array(__('Manage'), 'edit_pages', 'edit-pages.php'); else - $menu[10] = array(__('Manage'), 'edit_posts', 'edit.php', 'manage'); + $menu[10] = array(__('Manage'), 'edit_posts', 'edit.php'); -$menu[15] = array(__('Comments'), 'edit_posts', 'edit-comments.php', 'comments'); -$menu[20] = array(__('Blogroll'), 'manage_links', 'link-manager.php', 'blogroll'); -$menu[25] = array(__('Presentation'), 'switch_themes', 'themes.php', 'themes'); -$menu[30] = array(__('Plugins'), 'activate_plugins', 'plugins.php', 'plugins'); - +$menu[15] = array(__('Comments'), 'edit_posts', 'edit-comments.php'); +$menu[20] = array(__('Blogroll'), 'manage_links', 'link-manager.php'); +$menu[25] = array(__('Presentation'), 'switch_themes', 'themes.php'); +$menu[30] = array(__('Plugins'), 'activate_plugins', 'plugins.php'); if ( current_user_can('edit_users') ) - $menu[35] = array(__('Users'), 'edit_users', 'users.php', 'users'); + $menu[35] = array(__('Users'), 'edit_users', 'users.php'); else - $menu[35] = array(__('Profile'), 'read', 'profile.php', 'profile'); - -$menu[40] = array(__('Options'), 'manage_options', 'options-general.php', 'options'); + $menu[35] = array(__('Profile'), 'read', 'profile.php'); +$menu[40] = array(__('Options'), 'manage_options', 'options-general.php'); $submenu['post-new.php'][5] = array(__('Write Post'), 'edit_posts', 'post-new.php'); @@ -74,8 +69,9 @@ $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php'); $submenu['themes.php'][10] = array(__('Theme Editor'), 'edit_themes', 'theme-editor.php'); // Create list of page plugin hook names. -foreach ( $menu as $menu_page ) +foreach ($menu as $menu_page) { $admin_page_hooks[$menu_page[2]] = sanitize_title($menu_page[0]); +} $_wp_submenu_nopriv = array(); $_wp_menu_nopriv = array(); @@ -132,11 +128,12 @@ foreach ( $menu as $id => $data ) { } } -unset( $id ); +unset($id); -uksort( $menu, 'strnatcasecmp' ); +uksort($menu, "strnatcasecmp"); // make it all pretty -if ( !user_can_access_admin_page() ) +if (! user_can_access_admin_page()) { wp_die( __('You do not have sufficient permissions to access this page.') ); +} -?> \ No newline at end of file +?> diff --git a/wp-admin/moderation.php b/wp-admin/moderation.php index a0eab57be0..8017073d48 100644 --- a/wp-admin/moderation.php +++ b/wp-admin/moderation.php @@ -1,6 +1,8 @@ diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php index 15bb99041d..61386c831c 100644 --- a/wp-admin/options-general.php +++ b/wp-admin/options-general.php @@ -1,5 +1,9 @@ diff --git a/wp-admin/options-misc.php b/wp-admin/options-misc.php index df62308969..f0c412cc07 100644 --- a/wp-admin/options-misc.php +++ b/wp-admin/options-misc.php @@ -1,5 +1,9 @@ diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index 71b8ae07a5..64bd18056f 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -1,5 +1,9 @@