Make WordPress Core

Changeset 4480


Ignore:
Timestamp:
11/18/2006 07:31:29 AM (18 years ago)
Author:
ryan
Message:

Hold off on menu cleanup until next release. There be dragons.

Location:
trunk/wp-admin
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin.php

    r4478 r4480  
    8383    include(ABSPATH . "wp-admin/import/$importer.php");
    8484
     85    $parent_file = 'edit.php';
    8586    $submenu_file = 'import.php';
     87    $title = __('Import');
    8688
    8789    if (! isset($_GET['noheader']))
  • trunk/wp-admin/categories.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3
     4$title = __('Categories');
     5$parent_file = 'edit.php';
    36
    47wp_reset_vars(array('action', 'cat'));
  • trunk/wp-admin/comment.php

    r4478 r4480  
    22require_once('admin.php');
    33
     4$parent_file = 'edit.php';
    45$submenu_file = 'edit-comments.php';
    56
  • trunk/wp-admin/edit-comments.php

    r4479 r4480  
    22require_once('admin.php');
    33
     4$title = __('Edit Comments');
     5$parent_file = 'edit-comments.php';
    46wp_enqueue_script( 'admin-comments' );
    57
  • trunk/wp-admin/edit-pages.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3$title = __('Pages');
     4$parent_file = 'edit.php';
    35wp_enqueue_script( 'listman' );
    46require_once('admin-header.php');
  • trunk/wp-admin/edit.php

    r4478 r4480  
    22require_once('admin.php');
    33
     4$title = __('Posts');
     5$parent_file = 'edit.php';
    46wp_enqueue_script( 1 == $_GET['c'] ? 'admin-comments' : 'listman' );
    57require_once('admin-header.php');
  • trunk/wp-admin/export.php

    r4478 r4480  
    11<?php
    22require_once ('admin.php');
     3$title = __('Export');
     4$parent_file = 'edit.php';
    35
    46if ( isset( $_GET['download'] ) )
  • trunk/wp-admin/import.php

    r4478 r4480  
    11<?php
    22require_once ('admin.php');
     3$title = __('Import');
     4$parent_file = 'edit.php';
    35require_once ('admin-header.php');
    46?>
  • trunk/wp-admin/index.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3$title = __('Dashboard');
     4$parent_file = 'index.php';
    35require_once('admin-header.php');
    46require_once (ABSPATH . WPINC . '/rss.php');
  • trunk/wp-admin/link-add.php

    r4478 r4480  
    22require_once('admin.php');
    33
     4$title = __('Add Bookmark');
    45$this_file = 'link-manager.php';
     6$parent_file = 'link-manager.php';
     7
    58
    69wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image',
  • trunk/wp-admin/link-import.php

    r4478 r4480  
    44
    55require_once('admin.php');
     6$parent_file = 'link-manager.php';
     7$title = __('Import Blogroll');
    68$this_file = 'link-import.php';
    79
  • trunk/wp-admin/link-manager.php

    r4478 r4480  
    77require_once ('admin.php');
    88
     9$title = __('Manage Bookmarks');
    910$this_file = $parent_file = 'link-manager.php';
    1011wp_enqueue_script( 'listman' );
  • trunk/wp-admin/menu-header.php

    r4478 r4480  
    44$self = preg_replace('|^.*/plugins/|i', '', $self);
    55
    6 foreach ( $submenu as $parent => $subpages ) {
    7     foreach ( $subpages as $page ) {
    8     // 0 menu title, 1 cap, 2 file or slug, 3 page title
    9         if ( $self == $page[2] )
    10             $parent_file = $parent;
    11     }
    12 }
     6get_admin_page_parent();
    137
    148foreach ($menu as $item) {
  • trunk/wp-admin/menu.php

    r4478 r4480  
    55// The minimum level the user needs to access the item: between 0 and 10
    66// The URL of the item's file
    7 // Slug
    8 $menu[0] = array(__('Dashboard'), 'read', 'index.php', 'home');
     7$menu[0] = array(__('Dashboard'), 'read', 'index.php');
    98
    10 // So when people switch between write and manage they go to the appropiate page/post mode they were on
    119if ( strstr($_SERVER['REQUEST_URI'], 'edit-pages.php') )
    12     $menu[5] = array(__('Write'), 'edit_pages', 'page-new.php', 'write');
     10    $menu[5] = array(__('Write'), 'edit_pages', 'page-new.php');
    1311else
    14     $menu[5] = array(__('Write'), 'edit_posts', 'post-new.php', 'write');
    15 
     12    $menu[5] = array(__('Write'), 'edit_posts', 'post-new.php');
    1613if ( strstr($_SERVER['REQUEST_URI'], 'page-new.php') )
    17     $menu[10] = array(__('Manage'), 'edit_pages', 'edit-pages.php', 'manage');
     14    $menu[10] = array(__('Manage'), 'edit_pages', 'edit-pages.php');
    1815else
    19     $menu[10] = array(__('Manage'), 'edit_posts', 'edit.php', 'manage');
     16    $menu[10] = array(__('Manage'), 'edit_posts', 'edit.php');
    2017   
    21 $menu[15] = array(__('Comments'), 'edit_posts', 'edit-comments.php', 'comments');
    22 $menu[20] = array(__('Blogroll'), 'manage_links', 'link-manager.php', 'blogroll');
    23 $menu[25] = array(__('Presentation'), 'switch_themes', 'themes.php', 'themes');
    24 $menu[30] = array(__('Plugins'), 'activate_plugins', 'plugins.php', 'plugins');
    25 
     18$menu[15] = array(__('Comments'), 'edit_posts', 'edit-comments.php');
     19$menu[20] = array(__('Blogroll'), 'manage_links', 'link-manager.php');
     20$menu[25] = array(__('Presentation'), 'switch_themes', 'themes.php');
     21$menu[30] = array(__('Plugins'), 'activate_plugins', 'plugins.php');
    2622if ( current_user_can('edit_users') )
    27     $menu[35] = array(__('Users'), 'edit_users', 'users.php', 'users');
     23    $menu[35] = array(__('Users'), 'edit_users', 'users.php');
    2824else
    29     $menu[35] = array(__('Profile'), 'read', 'profile.php', 'profile');
    30 
    31 $menu[40] = array(__('Options'), 'manage_options', 'options-general.php', 'options');
     25    $menu[35] = array(__('Profile'), 'read', 'profile.php');
     26$menu[40] = array(__('Options'), 'manage_options', 'options-general.php');
    3227
    3328
     
    7570
    7671// Create list of page plugin hook names.
    77 foreach ( $menu as $menu_page )
     72foreach ($menu as $menu_page) {
    7873    $admin_page_hooks[$menu_page[2]] = sanitize_title($menu_page[0]);
     74}
    7975
    8076$_wp_submenu_nopriv = array();
     
    133129}
    134130
    135 unset( $id );
     131unset($id);
    136132
    137 uksort( $menu, 'strnatcasecmp' );
     133uksort($menu, "strnatcasecmp"); // make it all pretty
    138134
    139 if ( !user_can_access_admin_page() )
     135if (! user_can_access_admin_page()) {
    140136    wp_die( __('You do not have sufficient permissions to access this page.') );
     137}
    141138
    142139?>
  • trunk/wp-admin/moderation.php

    r4478 r4480  
    22require_once('admin.php');
    33
     4$title = __('Moderate comments');
     5$parent_file = 'edit-comments.php';
    46wp_enqueue_script( 'admin-comments' );
    57
  • trunk/wp-admin/options-discussion.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3
     4$title = __('Discussion Options');
     5$parent_file = 'options-general.php';
     6
    37include('admin-header.php');
    48?>
  • trunk/wp-admin/options-general.php

    r4478 r4480  
    11<?php
    22require_once('./admin.php');
     3
     4$title = __('General Options');
     5$parent_file = 'options-general.php';
     6
    37include('./admin-header.php');
    48?>
  • trunk/wp-admin/options-misc.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3
     4$title = __('Miscellaneous Options');
     5$parent_file = 'options-general.php';
     6
    37include('admin-header.php');
    48
  • trunk/wp-admin/options-permalink.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3
     4$title = __('Permalink Options');
     5$parent_file = 'options-general.php';
     6
    37function add_js() {
    48?>
  • trunk/wp-admin/options-privacy.php

    r4478 r4480  
    11<?php
    22require_once('./admin.php');
     3
     4$title = __('Privacy Options');
     5$parent_file = 'options-general.php';
     6
    37include('./admin-header.php');
    48?>
  • trunk/wp-admin/options-reading.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3
     4$title = __('Reading Options');
     5$parent_file = 'options-general.php';
     6
    37include('admin-header.php');
    48?>
  • trunk/wp-admin/options-writing.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3
     4$title = __('Writing Options');
     5$parent_file = 'options-general.php';
     6
    37include('admin-header.php');
    48?>
  • trunk/wp-admin/options.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3
     4$title = __('Options');
     5$this_file = 'options.php';
     6$parent_file = 'options-general.php';
    37
    48wp_reset_vars(array('action'));
  • trunk/wp-admin/page-new.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3$title = __('New Page');
     4$parent_file = 'post-new.php';
    35$editing = true;
    46wp_enqueue_script('prototype');
  • trunk/wp-admin/plugin-editor.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3
     4$title = __("Edit Plugins");
     5$parent_file = 'plugins.php';
     6
    37wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file'));
    48
  • trunk/wp-admin/plugins.php

    r4478 r4480  
    3030}
    3131
     32$title = __('Manage Plugins');
    3233require_once('admin-header.php');
    3334
  • trunk/wp-admin/post-new.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3$title = __('Create New Post');
     4$parent_file = 'post-new.php';
    35$editing = true;
    46wp_enqueue_script('prototype');
  • trunk/wp-admin/profile.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3
     4$title = __('Profile');
     5
     6if ( current_user_can('edit_users') )
     7    $parent_file = 'users.php';
     8else
     9    $parent_file = 'profile.php';
    310include_once('admin-header.php');
    411$profileuser = get_user_to_edit($user_ID);
  • trunk/wp-admin/templates.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3$title = __('Template &amp; File Editing');
     4$parent_file =  'edit.php';
     5
    36wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file'));
    47
  • trunk/wp-admin/theme-editor.php

    r4478 r4480  
    11<?php
    22require_once('admin.php');
     3
     4$title = __("Edit Themes");
     5$parent_file = 'themes.php';
     6
    37wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme'));
    48
  • trunk/wp-admin/themes.php

    r4478 r4480  
    1919}
    2020
     21$title = __('Manage Themes');
     22$parent_file = 'themes.php';
    2123require_once('admin-header.php');
    2224?>
  • trunk/wp-admin/user-edit.php

    r4478 r4480  
    22require_once('admin.php');
    33
     4$title = __('Edit User');
     5if ( current_user_can('edit_users') )
     6    $parent_file = 'users.php';
     7else
     8    $parent_file = 'profile.php';
    49$submenu_file = 'users.php';
    510
  • trunk/wp-admin/users.php

    r4478 r4480  
    22require_once('admin.php');
    33require_once( ABSPATH . WPINC . '/registration.php');
     4
     5$title = __('Users');
     6if ( current_user_can('edit_users') )
     7    $parent_file = 'users.php';
     8else
     9    $parent_file = 'profile.php';
    410
    511$action = $_REQUEST['action'];
Note: See TracChangeset for help on using the changeset viewer.