2003-05-28 03:54:49 -04:00
|
|
|
<?php
|
2004-04-25 02:42:45 -04:00
|
|
|
// This array constructs the admin menu bar.
|
|
|
|
//
|
|
|
|
// Menu item name
|
|
|
|
// The minimum level the user needs to access the item: between 0 and 10
|
|
|
|
// The URL of the item's file
|
2004-07-28 03:18:59 -04:00
|
|
|
$menu[0] = array(__('Dashboard'), 0, 'index.php');
|
2004-07-21 03:20:13 -04:00
|
|
|
$menu[5] = array(__('Write'), 1, 'post.php');
|
2004-07-28 03:18:59 -04:00
|
|
|
$menu[10] = array(__('Manage'), 1, 'edit.php');
|
2004-07-21 03:20:13 -04:00
|
|
|
$menu[20] = array(__('Links'), 5, 'link-manager.php');
|
2005-02-04 23:53:19 -05:00
|
|
|
$menu[25] = array(__('Presentation'), 8, 'themes.php');
|
|
|
|
$menu[30] = array(__('Plugins'), 8, 'plugins.php');
|
|
|
|
$menu[35] = array(__('Users'), 0, 'profile.php');
|
|
|
|
$menu[40] = array(__('Options'), 6, 'options-general.php');
|
|
|
|
|
2004-12-14 04:53:16 -05:00
|
|
|
if ( get_option('use_fileupload') )
|
|
|
|
$menu[45] = array(__('Upload'), get_settings('fileupload_minlevel'), 'upload.php');
|
2004-04-25 02:42:45 -04:00
|
|
|
|
2004-11-24 23:11:57 -05:00
|
|
|
$submenu['post.php'][5] = array(__('Write Post'), 1, 'post.php');
|
|
|
|
$submenu['post.php'][10] = array(__('Write Page'), 5, 'page-new.php');
|
2004-11-16 14:29:51 -05:00
|
|
|
|
2004-08-22 19:24:50 -04:00
|
|
|
$submenu['edit.php'][5] = array(__('Posts'), 1, 'edit.php');
|
|
|
|
$submenu['edit.php'][10] = array(__('Pages'), 5, 'edit-pages.php');
|
|
|
|
$submenu['edit.php'][15] = array(__('Categories'), 1, 'categories.php');
|
|
|
|
$submenu['edit.php'][20] = array(__('Comments'), 1, 'edit-comments.php');
|
2004-08-28 05:11:46 -04:00
|
|
|
$awaiting_mod = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'");
|
|
|
|
$submenu['edit.php'][25] = array(sprintf(__("Awaiting Moderation (%s)"), $awaiting_mod), 1, 'moderation.php');
|
2004-12-08 17:32:49 -05:00
|
|
|
$submenu['edit.php'][30] = array(__('Files'), 8, 'templates.php');
|
2004-08-22 19:24:50 -04:00
|
|
|
|
|
|
|
$submenu['link-manager.php'][5] = array(__('Manage Links'), 5, 'link-manager.php');
|
|
|
|
$submenu['link-manager.php'][10] = array(__('Add Link'), 5, 'link-add.php');
|
|
|
|
$submenu['link-manager.php'][15] = array(__('Link Categories'), 5, 'link-categories.php');
|
|
|
|
$submenu['link-manager.php'][20] = array(__('Import Links'), 5, 'link-import.php');
|
|
|
|
|
2004-12-24 15:55:36 -05:00
|
|
|
$submenu['profile.php'][5] = array(__('Your Profile'), 0, 'profile.php');
|
|
|
|
$submenu['profile.php'][10] = array(__('Authors & Users'), 5, 'users.php');
|
2004-08-22 19:24:50 -04:00
|
|
|
|
2004-12-08 17:32:49 -05:00
|
|
|
$submenu['options-general.php'][5] = array(__('General'), 6, 'options-general.php');
|
|
|
|
$submenu['options-general.php'][10] = array(__('Writing'), 6, 'options-writing.php');
|
|
|
|
$submenu['options-general.php'][15] = array(__('Reading'), 6, 'options-reading.php');
|
|
|
|
$submenu['options-general.php'][20] = array(__('Discussion'), 6, 'options-discussion.php');
|
|
|
|
$submenu['options-general.php'][25] = array(__('Permalinks'), 6, 'options-permalink.php');
|
|
|
|
$submenu['options-general.php'][30] = array(__('Miscellaneous'), 6, 'options-misc.php');
|
2004-08-22 19:24:50 -04:00
|
|
|
|
2004-12-08 17:32:49 -05:00
|
|
|
$submenu['plugins.php'][5] = array(__('Plugins'), 8, 'plugins.php');
|
|
|
|
$submenu['plugins.php'][10] = array(__('Plugin Editor'), 8, 'plugin-editor.php');
|
2004-11-16 22:15:44 -05:00
|
|
|
|
2004-12-08 17:32:49 -05:00
|
|
|
$submenu['themes.php'][5] = array(__('Themes'), 8, 'themes.php');
|
|
|
|
$submenu['themes.php'][10] = array(__('Theme Editor'), 8, 'theme-editor.php');
|
2004-09-11 12:12:40 -04:00
|
|
|
|
2005-02-06 20:15:06 -05:00
|
|
|
// Create list of page plugin hook names.
|
|
|
|
foreach ($menu as $menu_page) {
|
|
|
|
$admin_page_hooks[$menu_page[2]] = sanitize_title($menu_page[0]);
|
|
|
|
}
|
|
|
|
|
2004-10-18 00:50:08 -04:00
|
|
|
do_action('admin_menu', '');
|
2004-11-25 10:45:16 -05:00
|
|
|
ksort($menu); // make it all pretty
|
2004-10-18 00:50:08 -04:00
|
|
|
|
|
|
|
if (! user_can_access_admin_page()) {
|
2005-01-09 23:03:51 -05:00
|
|
|
die( __('You do not have sufficient permissions to access this page.') );
|
2004-10-18 00:50:08 -04:00
|
|
|
}
|
|
|
|
|
2004-11-24 23:11:57 -05:00
|
|
|
?>
|