Make WordPress Core

Changeset 9178


Ignore:
Timestamp:
10/14/2008 10:44:56 PM (16 years ago)
Author:
ryan
Message:

Menu fixes

Location:
trunk/wp-admin
Files:
3 edited

Legend:

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

    r9050 r9178  
    498498    $file = plugin_basename( $file );
    499499
    500     $menu[] = array ( $menu_title, $access_level, $file, $page_title );
    501 
    502500    $admin_page_hooks[$file] = sanitize_title( $menu_title );
    503501
     
    505503    if (!empty ( $function ) && !empty ( $hookname ))
    506504        add_action( $hookname, $function );
     505
     506    $menu[] = array ( $menu_title, $access_level, $file, $page_title, $hookname, $hookname );
    507507
    508508    return $hookname;
     
    661661
    662662    $parent = $parent1 = get_admin_page_parent();
     663
    663664    if ( empty ( $parent) ) {
    664665        foreach ( $menu as $menu_array ) {
     
    719720
    720721    $page_type = 'admin';
    721     if ( empty ( $parent_page ) || 'admin.php' == $parent_page ) {
    722         if ( isset( $admin_page_hooks[$plugin_page] ))
     722    if ( empty ( $parent_page ) || 'admin.php' == $parent_page || isset( $admin_page_hooks[$plugin_page] ) ) {
     723        if ( isset( $admin_page_hooks[$plugin_page] ) )
    723724            $page_type = 'toplevel';
    724725        else
  • trunk/wp-admin/menu-header.php

    r9154 r9178  
    5252        }
    5353
    54         if ( isset($item[3]) && ! empty($item[3]) )
    55             $class[] = $item[3];
     54        if ( isset($item[4]) && ! empty($item[4]) )
     55            $class[] = $item[4];
    5656
    5757        $class = $class ? ' class="' . join( ' ', $class ) . '"' : '';
    58         $id = isset($item[4]) && ! empty($item[4]) ? ' id="' . $item[4] . '"' : '';
    59         $img = isset($item[5]) && ! empty($item[5]) ? '<img class="wp-menu-image" src="' . $item[5] . '" alt="" />' : '';
     58        $id = isset($item[5]) && ! empty($item[5]) ? ' id="' . $item[5] . '"' : '';
     59        $img = isset($item[6]) && ! empty($item[6]) ? '<img class="wp-menu-image" src="' . $item[6] . '" alt="" />' : '';
    6060
    6161        echo "\n\t<li$class$id>";
  • trunk/wp-admin/menu.php

    r9176 r9178  
    2525$awaiting_mod = $awaiting_mod->moderated;
    2626
    27 $menu[0] = array( __('Dashboard'), 'read', 'index.php', 'wp-menu-open', 'menu-dashboard', 'images/menu/home.png' );
     27$menu[0] = array( __('Dashboard'), 'read', 'index.php', '', 'wp-menu-open', 'menu-dashboard', 'images/menu/home.png' );
    2828    $submenu['index.php'][5]  = array( __('Dashboard'), 'read' , 'index.php' );
    2929
    30 $menu[4] = array( '', 'read', '', 'wp-menu-separator' );
     30$menu[4] = array( '', 'read', '', '', 'wp-menu-separator' );
    3131
    32 $menu[5] = array( __('Posts'), 'edit_posts', 'post-new.php', 'wp-menu-open', 'menu-posts', 'images/menu/posts.png' );
     32$menu[5] = array( __('Posts'), 'edit_posts', 'post-new.php', '', 'wp-menu-open', 'menu-posts', 'images/menu/posts.png' );
    3333    $submenu['post-new.php'][5]  = array( __('Add New'), 'edit_posts', 'post-new.php' );
    3434    //$submenu['post-new.php'][10]  = array( __('Drafts'), 'edit_posts', 'edit-post-drafts.php' );
     
    3737    $submenu['post-new.php'][25] = array( __('Categories'), 'manage_categories', 'categories.php' );
    3838
    39 $menu[10] = array( __('Media'), 'upload_files', 'media-new.php', '', 'menu-media', 'images/menu/media.png' );
     39$menu[10] = array( __('Media'), 'upload_files', 'media-new.php', '', '', 'menu-media', 'images/menu/media.png' );
    4040    $submenu['media-new.php'][5] = array( __('Add New'), 'upload_files', 'media-new.php');
    4141    $submenu['media-new.php'][10] = array( __('Edit'), 'upload_files', 'upload.php');
    4242
    43 $menu[15] = array( __('Links'), 'manage_links', 'link-add.php', '', 'menu-links', 'images/menu/links.png' );
     43$menu[15] = array( __('Links'), 'manage_links', 'link-add.php', '', '', 'menu-links', 'images/menu/links.png' );
    4444    $submenu['link-add.php'][5] = array( __('Add New'), 'manage_links', 'link-add.php' );
    4545    $submenu['link-add.php'][10] = array( __('Edit'), 'manage_links', 'link-manager.php' );
    4646    $submenu['link-add.php'][15] = array( __('Link Categories'), 'manage_categories', 'edit-link-categories.php' );
    4747
    48 $menu[20] = array( __('Pages'), 'edit_pages', 'page-new.php', '', 'menu-pages', 'images/menu/pages.png' );
     48$menu[20] = array( __('Pages'), 'edit_pages', 'page-new.php', '', '', 'menu-pages', 'images/menu/pages.png' );
    4949    $submenu['page-new.php'][5] = array( __('Add New'), 'edit_pages', 'page-new.php' );
    5050    //$submenu['page-new.php'][10] = array( __('Drafts'), 'edit_pages', 'edit-page-drafts.php' );
    5151    $submenu['page-new.php'][15] = array( __('Edit'), 'edit_pages', 'edit-pages.php' );
    5252
    53 $menu[25] = array( __('Comments'), 'edit_posts', 'edit-comments.php', '', 'menu-comments', 'images/menu/comments.png' );
     53$menu[25] = array( __('Comments'), 'edit_posts', 'edit-comments.php', '', '', 'menu-comments', 'images/menu/comments.png' );
    5454    $submenu['edit-comments.php'][15] = array( __('Comments'), 'edit_posts', 'edit-comments.php' );
    5555
    56 $menu[29] = array( '', 'read', '', 'wp-menu-separator' );
     56$menu[29] = array( '', 'read', '', '', 'wp-menu-separator' );
    5757
    58 $menu[30] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-appearance', 'images/menu/appearance.png' );
     58$menu[30] = array( __('Appearance'), 'switch_themes', 'themes.php', '', '', 'menu-appearance', 'images/menu/appearance.png' );
    5959    $submenu['themes.php'][5]  = array(__('Themes'), 'switch_themes', 'themes.php');
    6060    $submenu['themes.php'][10] = array(__('Editor'), 'edit_themes', 'theme-editor.php');
    6161
    62 $menu[35] = array( __('Plugins'), 'activate_plugins', 'plugins.php', '', 'menu-plugins', 'images/menu/plugins.png' );
     62$menu[35] = array( __('Plugins'), 'activate_plugins', 'plugins.php', '', '', 'menu-plugins', 'images/menu/plugins.png' );
    6363    $submenu['plugins.php'][15] = array(__('Add New'), 'install_plugins', 'plugin-install.php');   
    6464    $submenu['plugins.php'][5]  = array( __('Installed'), 'activate_plugins', 'plugins.php' );
     
    6666
    6767if ( current_user_can('edit_users') )
    68     $menu[40] = array( __('Users'), 'edit_users', 'users.php', '', 'menu-users', 'images/menu/users.png' );
     68    $menu[40] = array( __('Users'), 'edit_users', 'users.php', '', '', 'menu-users', 'images/menu/users.png' );
    6969else
    70     $menu[40] = array( __('Profile'), 'read', 'profile.php', '', 'menu-users', 'images/menu/users.png' );
     70    $menu[40] = array( __('Profile'), 'read', 'profile.php', '', '', 'menu-users', 'images/menu/users.png' );
    7171
    7272if ( current_user_can('edit_users') ) {
     
    7979}
    8080
    81 $menu[45] = array( __('Tools'), 'manage_options', 'import.php', '', 'menu-tools', 'images/menu/tools.png' );
     81$menu[45] = array( __('Tools'), 'manage_options', 'import.php', '', '', 'menu-tools', 'images/menu/tools.png' );
    8282    $submenu['import.php'][5] = array( __('Import'), 'import', 'import.php' );
    8383    $submenu['import.php'][10] = array( __('Export'), 'import', 'export.php' );
     
    8686        $submenu['import.php'][20] = array( __('Turbo'), 'read', 'turbo.php' );
    8787
    88 $menu[50] = array( __('Settings'), 'manage_options', 'options-general.php', '', 'menu-settings', 'images/menu/settings.png' );
     88$menu[50] = array( __('Settings'), 'manage_options', 'options-general.php', '', '', 'menu-settings', 'images/menu/settings.png' );
    8989    $submenu['options-general.php'][10] = array(__('General'), 'manage_options', 'options-general.php');
    9090    $submenu['options-general.php'][15] = array(__('Writing'), 'manage_options', 'options-writing.php');
     
    163163            $_wp_menu_nopriv[$data[2]] = true;
    164164            unset($menu[$id]);
     165        } elseif ( !empty($data[0]) ) {
     166            $submenu[$data[2]][0] = $data;
    165167        }
    166168    }
Note: See TracChangeset for help on using the changeset viewer.