Hold off on menu cleanup until next release. There be dragons.

git-svn-id: http://svn.automattic.com/wordpress/trunk@4480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2006-11-18 07:31:29 +00:00
parent 2ef26430ec
commit eda9021317
33 changed files with 115 additions and 30 deletions

View File

@@ -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.') );
}
?>
?>