2003-10-13 01:17:36 -04:00
|
|
|
|
2003-05-22 08:12:53 -04:00
|
|
|
<ul id="adminmenu">
|
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-21 03:20:13 -04:00
|
|
|
$menu[5] = array(__('Write'), 1, 'post.php');
|
|
|
|
$menu[10] = array(__('Edit'), 1, 'edit.php');
|
|
|
|
$menu[15] = array(__('Categories'), 3, 'categories.php');
|
|
|
|
$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');
|
|
|
|
$menu[40] = array(__('Templates'), 4, 'templates.php');
|
|
|
|
$menu[45] = array(__('Upload'), get_settings('fileupload_minlevel'), 'upload.php');
|
|
|
|
ksort($menu); // So other files can plugin
|
2004-04-25 02:42:45 -04:00
|
|
|
|
2004-04-28 15:49:27 -04:00
|
|
|
$self = preg_replace('|.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
|
2004-05-07 17:05:02 -04:00
|
|
|
if (!isset($parent_file)) $parent_file = '';
|
2003-05-28 03:54:49 -04:00
|
|
|
foreach ($menu as $item) {
|
|
|
|
$class = '';
|
2004-04-25 02:42:45 -04:00
|
|
|
|
|
|
|
// 0 = name, 1 = user_level, 2 = file
|
2004-04-28 15:49:27 -04:00
|
|
|
if ((substr($self, -10) == substr($item[2], -10) && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
|
2004-04-25 02:42:45 -04:00
|
|
|
|
|
|
|
if ($user_level >= $item[1]) {
|
2004-04-30 03:26:17 -04:00
|
|
|
if (
|
|
|
|
('upload.php' == $item[2] &&
|
|
|
|
get_settings('use_fileupload') &&
|
|
|
|
($user_level >= get_settings('fileupload_minlevel'))
|
|
|
|
) || 'upload.php' != $item[2])
|
2004-04-25 02:42:45 -04:00
|
|
|
echo "\n\t<li><a href='{$item[2]}'$class>{$item[0]}</a></li>";
|
|
|
|
}
|
2003-05-22 08:12:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
2004-04-28 03:27:03 -04: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 11:15:48 -05:00
|
|
|
<li class="last"><a href="<?php echo get_settings('siteurl')
|
2004-06-17 20:22:09 -04: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 08:12:53 -04:00
|
|
|
</ul>
|