2003-10-13 07:17:36 +02:00
|
|
|
|
2003-05-22 14:12:53 +02:00
|
|
|
<ul id="adminmenu">
|
2003-05-28 09:54:49 +02:00
|
|
|
<?php
|
2004-04-25 08:42:45 +02: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 09:18:59 +02:00
|
|
|
$menu[0] = array(__('Dashboard'), 0, 'index.php');
|
2004-07-21 09:20:13 +02:00
|
|
|
$menu[5] = array(__('Write'), 1, 'post.php');
|
2004-07-28 09:18:59 +02:00
|
|
|
$menu[10] = array(__('Manage'), 1, 'edit.php');
|
2004-07-21 09:20:13 +02:00
|
|
|
$menu[20] = array(__('Links'), 5, 'link-manager.php');
|
|
|
|
$menu[25] = array(__('Users'), 3, 'users.php');
|
|
|
|
$menu[30] = array(__('Options'), 6, 'options-general.php');
|
|
|
|
$menu[35] = array(__('Plugins'), 8, 'plugins.php');
|
2004-09-11 18:12:40 +02:00
|
|
|
$menu[40] = array(__('Presentation'), 8, 'themes.php');
|
|
|
|
$menu[45] = array(__('Templates'), 4, 'templates.php');
|
|
|
|
$menu[50] = array(__('Upload'), get_settings('fileupload_minlevel'), 'upload.php');
|
2004-07-21 09:20:13 +02:00
|
|
|
ksort($menu); // So other files can plugin
|
2004-04-25 08:42:45 +02:00
|
|
|
|
2004-08-23 01:24:50 +02: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 11:11:46 +02: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-08-23 01:24:50 +02: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');
|
|
|
|
|
|
|
|
$submenu['users.php'][5] = array(__('Authors & Users'), 5, 'users.php');
|
|
|
|
$submenu['users.php'][10] = array(__('Your Profile'), 5, 'profile.php');
|
|
|
|
|
|
|
|
$submenu['options-general.php'][5] = array(__('General'), 5, 'options-general.php');
|
|
|
|
$submenu['options-general.php'][10] = array(__('Writing'), 5, 'options-writing.php');
|
|
|
|
$submenu['options-general.php'][15] = array(__('Reading'), 5, 'options-reading.php');
|
|
|
|
$submenu['options-general.php'][20] = array(__('Discussion'), 5, 'options-discussion.php');
|
2004-09-05 02:24:28 +02:00
|
|
|
$submenu['options-general.php'][25] = array(__('Permalinks'), 5, 'options-permalink.php');
|
|
|
|
$submenu['options-general.php'][30] = array(__('Miscellaneous'), 5, 'options-misc.php');
|
2004-08-23 01:24:50 +02:00
|
|
|
|
2004-09-11 18:12:40 +02:00
|
|
|
$submenu['themes.php'][5] = array(__('Themes'), 5, 'themes.php');
|
|
|
|
$submenu['themes.php'][10] = array(__('Theme Editor'), 5, 'theme-editor.php');
|
|
|
|
|
2004-04-28 21:49:27 +02:00
|
|
|
$self = preg_replace('|.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
|
2004-05-07 23:05:02 +02:00
|
|
|
if (!isset($parent_file)) $parent_file = '';
|
2003-05-28 09:54:49 +02:00
|
|
|
foreach ($menu as $item) {
|
|
|
|
$class = '';
|
2004-04-25 08:42:45 +02:00
|
|
|
|
|
|
|
// 0 = name, 1 = user_level, 2 = file
|
2004-04-28 21:49:27 +02:00
|
|
|
if ((substr($self, -10) == substr($item[2], -10) && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
|
2004-04-25 08:42:45 +02:00
|
|
|
|
|
|
|
if ($user_level >= $item[1]) {
|
2004-04-30 09:26:17 +02:00
|
|
|
if (
|
|
|
|
('upload.php' == $item[2] &&
|
|
|
|
get_settings('use_fileupload') &&
|
|
|
|
($user_level >= get_settings('fileupload_minlevel'))
|
|
|
|
) || 'upload.php' != $item[2])
|
2004-04-25 08:42:45 +02:00
|
|
|
echo "\n\t<li><a href='{$item[2]}'$class>{$item[0]}</a></li>";
|
|
|
|
}
|
2003-05-22 14:12:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
2004-04-28 09:27:03 +02:00
|
|
|
<li><a href="<?php echo get_settings('home') . '/' . get_settings('blogfilename'); ?>" title="<?php _e('View your site') ?>"><?php _e('View site') ?> »</a></li>
|
2004-02-26 17:15:48 +01:00
|
|
|
<li class="last"><a href="<?php echo get_settings('siteurl')
|
2004-06-18 02:22:09 +02:00
|
|
|
?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php printf(__('Logout (%s)'), $user_nickname) ?></a></li>
|
2003-05-22 14:12:53 +02:00
|
|
|
</ul>
|
2004-08-23 01:24:50 +02:00
|
|
|
|
|
|
|
<?php
|
|
|
|
// Sub-menu
|
|
|
|
if ( isset($submenu["$parent_file"]) ) :
|
|
|
|
?>
|
|
|
|
<ul id="adminmenu2">
|
|
|
|
<?php
|
|
|
|
foreach ($submenu["$parent_file"] as $item) :
|
|
|
|
if ( substr($self, -10) == substr($item[2], -10) ) $class = ' class="current"';
|
|
|
|
else $class = '';
|
|
|
|
echo "\n\t<li><a href='{$item[2]}'$class>{$item[0]}</a></li>";
|
|
|
|
endforeach;
|
|
|
|
?>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
<?php endif; ?>
|