From 77706cc0250040d9a87fb9dc22a6c155989858c3 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Sun, 22 Aug 2004 23:24:50 +0000 Subject: [PATCH] New submenu system. git-svn-id: http://svn.automattic.com/wordpress/trunk@1551 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/categories.php | 17 ++----- wp-admin/edit-comments.php | 9 +--- wp-admin/edit-pages.php | 10 +--- wp-admin/edit.php | 10 +--- wp-admin/link-add.php | 10 +--- wp-admin/link-categories.php | 16 +------ wp-admin/link-import.php | 7 --- wp-admin/link-manager.php | 19 ++------ wp-admin/menu.php | 38 +++++++++++++++ wp-admin/moderation.php | 14 +----- wp-admin/options-general.php | 1 + wp-admin/options-head.php | 26 ----------- wp-admin/profile.php | 90 ++---------------------------------- wp-admin/users.php | 11 ++--- 14 files changed, 60 insertions(+), 218 deletions(-) diff --git a/wp-admin/categories.php b/wp-admin/categories.php index 9ceb77574..f9c026f33 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -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; ?> - +

@@ -152,13 +147,7 @@ $messages[1] = __('Category added.'); $messages[2] = __('Category deleted.'); $messages[3] = __('Category updated.'); ?> -
    -
  • -
  • -
  • -
  • -
  • -
+

diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index 11a44dc3b..fb70ef4b3 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -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']; ?> -
    -
  • -
  • -
  • -
  • -
  • -
+ -
    -
  • -
  • -
  • -
  • -
+
diff --git a/wp-admin/menu.php b/wp-admin/menu.php index 3d991bdb4..9a2ec3dfc 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -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 & 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') &&
  • + + + + \ No newline at end of file diff --git a/wp-admin/moderation.php b/wp-admin/moderation.php index 1137849bd..9f78b0087 100644 --- a/wp-admin/moderation.php +++ b/wp-admin/moderation.php @@ -3,7 +3,6 @@ require_once('../wp-includes/wp-l10n.php'); $title = __('Moderate comments'); $parent_file = 'edit.php'; -/* */ function add_magic_quotes($array) { foreach ($array as $k => $v) { @@ -96,15 +95,6 @@ default: if ($user_level <= 3) { die(__('

    Your level is not high enough to moderate comments.

    ')); } -?> -
      -
    • -
    • -
    • -
    • -
    • -
    -\n

    "; @@ -183,5 +173,5 @@ echo " | comment_post_ break; } -/* */ -include("admin-footer.php") ?> + +include('admin-footer.php') ?> \ No newline at end of file diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php index f76662bec..406525051 100644 --- a/wp-admin/options-general.php +++ b/wp-admin/options-general.php @@ -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) { diff --git a/wp-admin/options-head.php b/wp-admin/options-head.php index 8afec7f52..9c85a626f 100644 --- a/wp-admin/options-head.php +++ b/wp-admin/options-head.php @@ -16,33 +16,7 @@ foreach ($option_groups as $option_group) { $groups .= "

  • {$option_group->group_name}
  • \n"; } } - -$submenu = ' -
      -
    • ' . __('General') . '
    • -
    • ' . __('Writing') . '
    • -
    • ' . __('Reading') . '
    • -
    • ' . __('Discussion') . '
    • -
    • ' . __('Miscellaneous') . '
    • -
    • ' . __('Permalinks') . '
    • '; - -$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 . - '
    '; ?> -
    diff --git a/wp-admin/profile.php b/wp-admin/profile.php index 8f90078ea..146ec00af 100644 --- a/wp-admin/profile.php +++ b/wp-admin/profile.php @@ -2,7 +2,7 @@ require_once('../wp-includes/wp-l10n.php'); $title = "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'); - ?> - -

    “ - 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; - ?> - ”

    - -
    -

    - user_login ?> - | ID ?> | - user_level ?> | - -

    - -

    user_firstname ?>

    - -

    user_lastname ?>

    - -

    user_nickname ?>

    - -

    user_email) ?> -

    - -

    user_url ?>

    - -

    - user_icq > 0) { echo make_clickable("icq:".$profiledata->user_icq); } ?> -

    - -

    user_aim) ."&message=Howdy'>$profiledata->user_aim"; ?> -

    - -

    user_msn ?>

    - -

    user_yim ?>

    - -
    - - -
      -
    • -
    • -
    - +if (isset($updated)) { ?>

    @@ -244,13 +163,10 @@ default:

    -
    - + diff --git a/wp-admin/users.php b/wp-admin/users.php index 0c143eee8..c36bb4b9e 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -2,7 +2,7 @@ require_once('../wp-includes/wp-l10n.php'); $title = __('Users'); -/* */ +$parent_file = 'users.php'; $wpvarstoreset = array('action','standalone','redirect','profile'); for ($i=0; $i -
      -
    • -
    • -

    @@ -340,7 +336,6 @@ echo "\n
    break; } - -/* */ + include('admin-footer.php'); -?> +?> \ No newline at end of file
    user_login; ?>user_login; ?>