New submenu system.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-08-22 23:24:50 +00:00
parent 78cdf55da5
commit 77706cc025
14 changed files with 60 additions and 218 deletions

View File

@ -2,6 +2,7 @@
require_once('../wp-includes/wp-l10n.php');
$title = __('Categories');
$parent_file = 'edit.php';
function add_magic_quotes($array) {
foreach ($array as $k => $v) {
@ -91,13 +92,7 @@ case 'edit':
$category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$cat_ID'");
$cat_name = $category->cat_name;
?>
<ul id="adminmenu2">
<li><a href="edit.php"><?php _e('Posts') ?></a></li>
<li><a href="edit-pages.php"><?php _e('Pages') ?></a></li>
<li><a href="categories.php" class="current"><?php _e('Categories') ?></a></li>
<li><a href="edit-comments.php"><?php _e('Comments') ?></a></li>
<li class="last"><a href="moderation.php"><?php _e('Awaiting Moderation') ?></a></li>
</ul>
<div class="wrap">
<h2><?php _e('Edit Category') ?></h2>
<form name="editcat" action="categories.php" method="post">
@ -152,13 +147,7 @@ $messages[1] = __('Category added.');
$messages[2] = __('Category deleted.');
$messages[3] = __('Category updated.');
?>
<ul id="adminmenu2">
<li><a href="edit.php"><?php _e('Posts') ?></a></li>
<li><a href="edit-pages.php"><?php _e('Pages') ?></a></li>
<li><a class="current"><?php _e('Categories') ?></a></li>
<li><a href="edit-comments.php"><?php _e('Comments') ?></a></li>
<li><a href="moderation.php"><?php _e('Awaiting Moderation') ?></a></li>
</ul>
<?php if (isset($_GET['message'])) : ?>
<div class="updated"><p><?php echo $messages[$_GET['message']]; ?></p></div>
<?php endif; ?>

View File

@ -3,17 +3,12 @@ require_once('../wp-includes/wp-l10n.php');
$title = __('Edit Comments');
$parent_file = 'edit.php';
require_once('admin-header.php');
if (empty($_GET['mode'])) $mode = 'view';
else $mode = $_GET['mode'];
?>
<ul id="adminmenu2">
<li><a href="edit.php"><?php _e('Posts') ?></a></li>
<li><a href="edit-pages.php"><?php _e('Pages') ?></a></li>
<li><a href="categories.php"><?php _e('Categories') ?></a></li>
<li><a href="edit-comments.php" class="current"><?php _e('Comments') ?></a></li>
<li><a href="moderation.php"><?php _e('Awaiting Moderation') ?></a></li>
</ul>
<script type="text/javascript">
<!--
function checkAll(form)

View File

@ -2,17 +2,9 @@
require_once('../wp-includes/wp-l10n.php');
$title = __('Pages');
$parent_file = 'edit.php';
require_once('admin-header.php');
?>
<ul id="adminmenu2">
<li><a href="edit.php"><?php _e('Posts') ?></a></li>
<li><a href="edit-pages.php" class="current"><?php _e('Pages') ?></a></li>
<li><a href="categories.php"><?php _e('Categories') ?></a></li>
<li><a href="edit-comments.php"><?php _e('Comments') ?></a></li>
<li><a href="moderation.php"><?php _e('Awaiting Moderation') ?></a></li>
</ul>
<?php
get_currentuserinfo();
?>

View File

@ -2,17 +2,9 @@
require_once('../wp-includes/wp-l10n.php');
$title = __('Posts');
$parent_file = 'edit.php';
require_once('admin-header.php');
?>
<ul id="adminmenu2">
<li><a href="edit.php" class="current"><?php _e('Posts') ?></a></li>
<li><a href="edit-pages.php"><?php _e('Pages') ?></a></li>
<li><a href="categories.php"><?php _e('Categories') ?></a></li>
<li><a href="edit-comments.php"><?php _e('Comments') ?></a></li>
<li><a href="moderation.php"><?php _e('Awaiting Moderation') ?></a></li>
</ul>
<?php
get_currentuserinfo();
$drafts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'draft' AND post_author = $user_ID");
if ($drafts) {

View File

@ -63,15 +63,7 @@ $link_name = htmlentities(stripslashes(urldecode($_GET['name'])));
$xfn = true;
require('admin-header.php');
?>
<ul id="adminmenu2">
<li><a href="link-manager.php"><?php _e('Manage Links') ?></a></li>
<li><a href="link-add.php" class="current"><?php _e('Add Link') ?></a></li>
<li><a href="link-categories.php"><?php _e('Link Categories') ?></a></li>
<li class="last"><a href="link-import.php"><?php _e('Import Blogroll') ?></a></li>
</ul>
<style type="text/css" media="screen">
th { text-align: right; }
</style>
<?php if ($_GET['added']) : ?>
<div class="updated"><p>Link added.</p></div>
<?php endif; ?>

View File

@ -113,13 +113,6 @@ switch ($action) {
}
?>
<ul id="adminmenu2">
<li><a href="link-manager.php" ><?php _e('Manage Links') ?></a></li>
<li><a href="link-add.php"><?php _e('Add Link') ?></a></li>
<li><a href="link-categories.php" class="current"><?php _e('Link Categories') ?></a></li>
<li class="last"><a href="link-import.php"><?php _e('Import Blogroll') ?></a></li>
</ul>
<div class="wrap">
<h2>Edit &#8220;<?php echo htmlspecialchars($row->cat_name)?>&#8221; Category </h2>
@ -291,12 +284,7 @@ switch ($action) {
die(__("You have do not have sufficient permissions to edit the link categories for this blog. :)"));
}
?>
<ul id="adminmenu2">
<li><a href="link-manager.php" ><?php _e('Manage Links') ?></a></li>
<li><a href="link-add.php"><?php _e('Add Link') ?></a></li>
<li><a href="link-categories.php" class="current"><?php _e('Link Categories') ?></a></li>
<li class="last"><a href="link-import.php"><?php _e('Import Blogroll') ?></a></li>
</ul>
<div class="wrap">
<h2><?php _e('Link Categories:') ?></h2>
<table width="100%" cellpadding="5" cellspacing="0" border="0">

View File

@ -23,13 +23,6 @@ switch ($step) {
$opmltype = 'blogrolling'; // default.
?>
<ul id="adminmenu2">
<li><a href="link-manager.php" ><?php _e('Manage Links') ?></a></li>
<li><a href="link-add.php"><?php _e('Add Link') ?></a></li>
<li><a href="link-categories.php"><?php _e('Link Categories') ?></a></li>
<li class="last"><a href="link-import.php" class="current"><?php _e('Import Blogroll') ?></a></li>
</ul>
<div class="wrap">
<h2><?php _e('Import your blogroll from another system') ?> </h2>

View File

@ -5,7 +5,7 @@
require_once('../wp-config.php');
$title = __('Manage Links');
$this_file = 'link-manager.php';
$this_file = $parent_file = 'link-manager.php';
function xfn_check($class, $value = '', $type = 'check') {
global $link_rel;
@ -329,15 +329,7 @@ switch ($action) {
}
?>
<ul id="adminmenu2">
<li><a href="link-manager.php" class="current"><?php _e('Manage Links') ?></a></li>
<li><a href="link-add.php"><?php _e('Add Link') ?></a></li>
<li><a href="link-categories.php"><?php _e('Link Categories') ?></a></li>
<li class="last"><a href="link-import.php"><?php _e('Import Blogroll') ?></a></li>
</ul>
<style media="screen" type="text/css">
th { text-align: right; }
</style>
<div class="wrap">
<form action="" method="post" name="editlink" id="editlink">
<h2><?php _e('Edit a link:') ?></h2>
@ -611,12 +603,7 @@ function checkAll(form)
}
//-->
</script>
<ul id="adminmenu2">
<li><a href="link-manager.php" class="current"><?php _e('Manage Links') ?></a></li>
<li><a href="link-add.php"><?php _e('Add Link') ?></a></li>
<li><a href="link-categories.php"><?php _e('Link Categories') ?></a></li>
<li class="last"><a href="link-import.php"><?php _e('Import Blogroll') ?></a></li>
</ul>
<div class="wrap">
<form name="cats" method="post" action="">
<table width="75%" cellpadding="3" cellspacing="3">

View File

@ -17,6 +17,28 @@ $menu[40] = array(__('Templates'), 4, 'templates.php');
$menu[45] = array(__('Upload'), get_settings('fileupload_minlevel'), 'upload.php');
ksort($menu); // So other files can plugin
$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');
$submenu['edit.php'][25] = array(__('Awaiting Moderation'), 1, 'moderation.php');
$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 &amp; 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');
$submenu['options-general.php'][25] = array(__('Miscellaneous'), 5, 'options-misc.php');
$submenu['options-general.php'][30] = array(__('Permalinks'), 5, 'options-permalink.php');
$submenu['options-general.php'][35] = array(__('Link Manager'), 5, 'options-links.php');
$self = preg_replace('|.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
if (!isset($parent_file)) $parent_file = '';
foreach ($menu as $item) {
@ -40,3 +62,19 @@ get_settings('use_fileupload') &&
<li class="last"><a href="<?php echo get_settings('siteurl')
?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php printf(__('Logout (%s)'), $user_nickname) ?></a></li>
</ul>
<?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; ?>

View File

@ -3,7 +3,6 @@ require_once('../wp-includes/wp-l10n.php');
$title = __('Moderate comments');
$parent_file = 'edit.php';
/* <Moderation> */
function add_magic_quotes($array) {
foreach ($array as $k => $v) {
@ -96,15 +95,6 @@ default:
if ($user_level <= 3) {
die(__('<p>Your level is not high enough to moderate comments.</p>'));
}
?>
<ul id="adminmenu2">
<li><a href="edit.php"> <?php _e('Posts') ?></a></li>
<li><a href="edit-pages.php"><?php _e('Pages') ?></a></li>
<li><a href="categories.php"><?php _e('Categories') ?></a></li>
<li><a href="edit-comments.php"> <?php _e('Comments') ?></a></li>
<li><a href="moderation.php" class="current"><?php _e('Awaiting Moderation') ?></a></li>
</ul>
<?php
if (isset($deleted) || isset($approved) || isset($ignored)) {
echo "<div class='updated'>\n<p>";
@ -183,5 +173,5 @@ echo " | <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_
break;
}
/* </Template> */
include("admin-footer.php") ?>
include('admin-footer.php') ?>

View File

@ -2,6 +2,7 @@
require_once('../wp-includes/wp-l10n.php');
$title = __('General Options');
$parent_file = 'options-general.php';
function add_magic_quotes($array) {
foreach ($array as $k => $v) {

View File

@ -16,34 +16,8 @@ foreach ($option_groups as $option_group) {
$groups .= "<li><a href='options.php?option_group_id={$option_group->group_id}' title='{$option_group->group_desc}'>{$option_group->group_name}</a></li>\n";
}
}
$submenu = '
<ul id="adminmenu2">
<li><a href="options-general.php">' . __('General') . '</a></li>
<li><a href="options-writing.php">' . __('Writing') . '</a></li>
<li><a href="options-reading.php">' . __('Reading') . '</a></li>
<li><a href="options-discussion.php">' . __('Discussion') . '</a></li>
<li><a href="options-misc.php">' . __('Miscellaneous') . '</a></li>
<li><a href="options-permalink.php">' . __('Permalinks') . '</a></li>';
$sublines = split("\n", $submenu);
$_SERVER['REQUEST_URI'] = str_replace(array('?updated=true','&', 'updated=true'), '', $_SERVER['REQUEST_URI']);
foreach ($sublines as $subline) {
if (preg_match('/href="([^"]+)"/', $subline, $url)) {
if (substr($_SERVER['REQUEST_URI'], -8) == substr($url[1], -8)) {
$subline = str_replace('a hr', 'a class="current" hr', $subline);
if (str_replace('/wp-admin/', '', $_SERVER["REQUEST_URI"]) == $url[1]) {
$subline = preg_replace('|href=".*?"|', '', $subline);
}
}
}
echo $subline."\n";
}
echo $groups .
'</ul>';
?>
<br clear="all" />
<?php if (isset($updated)) : ?>

View File

@ -2,7 +2,7 @@
require_once('../wp-includes/wp-l10n.php');
$title = "Profile";
/* <Profile | My Profile> */
$parent_file = 'profile.php';
function add_magic_quotes($array) {
foreach ($array as $k => $v) {
@ -105,82 +105,6 @@ case 'update':
header('Location: profile.php?updated=true');
break;
case 'viewprofile':
$profiledata = get_userdata($user);
if ($_COOKIE['wordpressuser_'.$cookiehash] == $profiledata->user_login)
header ('Location: profile.php');
include_once('admin-header.php');
?>
<h2><?php _e('View Profile') ?> &#8220;
<?php
switch($profiledata->user_idmode) {
case 'nickname':
$r = $profiledata->user_nickname;
break;
case 'login':
$r = $profiledata->user_login;
break;
case 'firstname':
$r = $profiledata->user_firstname;
break;
case 'lastname':
$r = $profiledata->user_lastname;
break;
case 'namefl':
$r = $profiledata->user_firstname.' '.$profiledata->user_lastname;
break;
case 'namelf':
$r = $profiledata->user_lastname.' '.$profiledata->user_firstname;
break;
}
echo $r;
?>
&#8221;</h2>
<div id="profile">
<p>
<strong><?php _e('Login') ?></strong> <?php echo $profiledata->user_login ?>
| <strong><?php _e('User #') ?></strong> <?php echo $profiledata->ID ?> | <strong><?php _e('Level') ?></strong>
<?php echo $profiledata->user_level ?> | <strong><?php _e('Posts') ?></strong>
<?php
$posts = get_usernumposts($user);
echo $posts;
?>
</p>
<p> <strong><?php _e('First name:') ?></strong> <?php echo $profiledata->user_firstname ?> </p>
<p> <strong><?php _e('Last name:') ?></strong> <?php echo $profiledata->user_lastname ?> </p>
<p> <strong><?php _e('Nickname:') ?></strong> <?php echo $profiledata->user_nickname ?> </p>
<p> <strong><?php _e('E-mail:') ?></strong> <?php echo make_clickable($profiledata->user_email) ?>
</p>
<p> <strong><?php _e('Website:') ?></strong> <?php echo $profiledata->user_url ?> </p>
<p> <strong><?php _e('ICQ:') ?></strong>
<?php if ($profiledata->user_icq > 0) { echo make_clickable("icq:".$profiledata->user_icq); } ?>
</p>
<p> <strong><?php _e('AIM:') ?></strong> <?php echo "<a href='aim:goim?screenname=". str_replace(' ', '+', $profiledata->user_aim) ."&message=Howdy'>$profiledata->user_aim</a>"; ?>
</p>
<p> <strong><?php _e('MSN IM:') ?></strong> <?php echo $profiledata->user_msn ?> </p>
<p> <strong><?php _e('Yahoo IM:') ?></strong> <?php echo $profiledata->user_yim ?> </p>
</div>
<?php
break;
case 'IErightclick':
@ -226,12 +150,7 @@ default:
$bookmarklet_tbpb .= (get_settings('use_pingback')) ? '&pingback=1' : '';
$bookmarklet_height= (get_settings('use_trackback')) ? 480 : 440;
?>
<ul id="adminmenu2">
<li><a href="users.php"><?php _e('Authors &amp; Users') ?></a></li>
<li><a class="current"><?php _e('Your Profile') ?></a></li>
</ul>
<?php if (isset($updated)) { ?>
if (isset($updated)) { ?>
<div class="updated">
<p><strong><?php _e('Profile updated.') ?></strong></p>
</div>
@ -244,13 +163,10 @@ default:
<input type="hidden" name="checkuser_id" value="<?php echo $user_ID ?>" />
</p>
<style type="text/css" media="screen">
th { text-align: right; }
</style>
<table width="99%" border="0" cellspacing="2" cellpadding="3">
<tr>
<th width="33%" scope="row"><?php _e('Login:') ?></th>
<td width="73%"><?php echo $profiledata->user_login; ?></td>
<td width="67%"><?php echo $profiledata->user_login; ?></td>
</tr>
<tr>
<th scope="row"><?php _e('Level:') ?></th>

View File

@ -2,7 +2,7 @@
require_once('../wp-includes/wp-l10n.php');
$title = __('Users');
/* <Team> */
$parent_file = 'users.php';
$wpvarstoreset = array('action','standalone','redirect','profile');
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
@ -179,10 +179,6 @@ default:
$standalone = 0;
include ('admin-header.php');
?>
<ul id="adminmenu2">
<li><a class="current"><?php _e('Authors &amp; Users') ?></a></li>
<li><a href="profile.php"><?php _e('Your Profile') ?></a></li>
</ul>
<?php if (isset($_GET['deleted'])) : ?>
<div class="updated"><p><?php _e('User deleted.') ?></p></div>
@ -341,6 +337,5 @@ echo "\n<tr $style>
break;
}
/* </Team> */
include('admin-footer.php');
?>