Make WordPress Core

Changeset 6549


Ignore:
Timestamp:
01/04/2008 11:47:06 AM (17 years ago)
Author:
matt
Message:

There's a lockup in the tri-menu area. Traffic ahead. Eliminating generic file editor.

Location:
trunk/wp-admin
Files:
1 deleted
3 edited

Legend:

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

    r4495 r6549  
    1 <ul id="adminmenu">
    21<?php
    32$self = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
     
    65get_admin_page_parent();
    76
    8 foreach ($menu as $item) {
     7// We're going to do this loop three times
     8?>
     9
     10<ul id="dashmenu">
     11<?php
     12foreach ( $menu as $key => $item ) {
     13    if ( 3 < $key ) // get each menu item before 3
     14        continue;
     15    $class = '';
     16    // 0 = name, 1 = capability, 2 = file
     17    if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
     18
     19    if ( !empty($submenu[$item[2]]) ) {
     20        $submenu[$item[2]] = array_values($submenu[$item[2]]);  // Re-index.
     21        $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]);
     22        if ( file_exists(ABSPATH . PLUGINDIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook))
     23            echo "\n\t<li><a href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a></li>";
     24        else
     25            echo "\n\t<li><a href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a></li>";
     26    } else if ( current_user_can($item[1]) ) {
     27        if ( file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") )
     28            echo "\n\t<li><a href='admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
     29        else
     30            echo "\n\t<li><a href='{$item[2]}'$class>{$item[0]}</a></li>";
     31    }
     32}
     33do_action( 'dashmenu' );
     34?>
     35</ul>
     36
     37<ul id="adminmenu">
     38<?php
     39foreach ( $menu as $key => $item ) {
     40    if ( 5 > $key || $key > 25 ) // get each menu item before 3
     41        continue;
     42
    943    $class = '';
    1044
     
    2660    }
    2761}
    28 
     62do_action( 'adminmenu' );
    2963?>
    3064</ul>
     65
     66<ul id="sidemenu">
     67<?php
     68foreach ( $menu as $key => $item ) {
     69    if ( 26 > $key ) // get each menu item before 3
     70        continue;
     71
     72    $class = '';
     73
     74    // 0 = name, 1 = capability, 2 = file
     75    if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
     76
     77    if ( !empty($submenu[$item[2]]) ) {
     78        $submenu[$item[2]] = array_values($submenu[$item[2]]);  // Re-index.
     79        $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]);
     80        if ( file_exists(ABSPATH . PLUGINDIR . "/{$submenu[$item[2]][0][2]}") || !empty($menu_hook))
     81            echo "\n\t<li><a href='admin.php?page={$submenu[$item[2]][0][2]}'$class>{$item[0]}</a> |</li>";
     82        else
     83            echo "\n\t<li><a href='{$submenu[$item[2]][0][2]}'$class>{$item[0]}</a> |</li>";
     84    } else if ( current_user_can($item[1]) ) {
     85        if ( file_exists(ABSPATH . PLUGINDIR . "/{$item[2]}") )
     86            echo "\n\t<li><a href='admin.php?page={$item[2]}'$class>{$item[0]}</a> |</li>";
     87        else
     88            echo "\n\t<li><a href='{$item[2]}'$class>{$item[0]}</a> |</li>";
     89    }
     90}
     91do_action( 'sidemenu' );
     92?>
     93</ul>
     94
    3195
    3296<?php
  • trunk/wp-admin/menu.php

    r6545 r6549  
    2020    $awaiting_mod = '99+'; // to not blow out layout
    2121$menu[15] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='comment-count'>$awaiting_mod</span>" ), 'edit_posts', 'edit-comments.php');
    22 $menu[20] = array(__('Blogroll'), 'manage_links', 'link-manager.php');
    2322$menu[25] = array(__('Design'), 'switch_themes', 'themes.php');
    2423$menu[30] = array(__('Plugins'), 'activate_plugins', 'plugins.php');
     
    3130
    3231$_wp_real_parent_file['post.php'] = 'post-new.php'; // Back-compat
    33 $submenu['post-new.php'][5] = array(__('Write Post'), 'edit_posts', 'post-new.php');
    34 $submenu['post-new.php'][10] = array(__('Write Page'), 'edit_pages', 'page-new.php');
     32$submenu['post-new.php'][5] = array(__('Post'), 'edit_posts', 'post-new.php');
     33$submenu['post-new.php'][10] = array(__('Page'), 'edit_pages', 'page-new.php');
    3534
    3635$submenu['edit-comments.php'][5] = array(__('Comments'), 'edit_posts', 'edit-comments.php');
     
    4140$submenu['edit.php'][5] = array(__('Posts'), 'edit_posts', 'edit.php');
    4241$submenu['edit.php'][10] = array(__('Pages'), 'edit_pages', 'edit-pages.php');
    43 $submenu['edit.php'][12] = array(__('Uploads'), 'upload_files', 'upload.php');
    44 $submenu['edit.php'][15] = array(__('Categories'), 'manage_categories', 'categories.php');
    45 $submenu['edit.php'][30] = array(__('Files'), 'edit_files', 'templates.php');
    46 $submenu['edit.php'][35] = array(__('Import'), 'import', 'import.php');
    47 $submenu['edit.php'][40] = array(__('Export'), 'import', 'export.php');
     42$submenu['edit.php'][15] = array(__('Links'), 'manage_links', 'link-manager.php');
     43$submenu['edit.php'][20] = array(__('Categories'), 'manage_categories', 'categories.php');
     44$submenu['edit.php'][25] = array(__('Media Library'), 'upload_files', 'upload.php');
     45$submenu['edit.php'][30] = array(__('Import'), 'import', 'import.php');
     46$submenu['edit.php'][35] = array(__('Export'), 'import', 'export.php');
    4847
    49 $submenu['link-manager.php'][5] = array(__('Manage Blogroll'), 'manage_links', 'link-manager.php');
    50 $submenu['link-manager.php'][10] = array(__('Add Link'), 'manage_links', 'link-add.php');
    51 $submenu['link-manager.php'][20] = array(__('Import Links'), 'manage_links', 'link-import.php');
    52 $submenu['link-manager.php'][30] = array(__('Categories'), 'manage_links', 'edit-link-categories.php');
     48
     49$submenu['edit.php'][50] = array(__('Add Link'), 'manage_links', 'link-add.php'); // todo: axe
     50$submenu['edit.php'][55] = array(__('Import Links'), 'manage_links', 'link-import.php'); // todo: axe
     51$submenu['edit.php'][60] = array(__('Categories'), 'manage_links', 'edit-link-categories.php'); // todo: axe
    5352
    5453if ( current_user_can('edit_users') ) {
  • trunk/wp-admin/wp-admin.css

    r6544 r6549  
    900900}
    901901
     902/* menu stuff */
     903
     904#dashmenu {
     905    margin: 0;
     906    list-style: none;
     907    position: absolute;
     908    top: 7px;
     909    left: 0;
     910    padding-left: 12px;
     911}
     912
     913#dashmenu a {
     914    color: #999;
     915    padding: 6px;
     916    line-height: 220%;
     917    margin-right: 8px;
     918}
     919
     920#dashmenu a:hover, #dashmenu a.current, #dashmenu a.current:hover {
     921    background: #e4f2fd;
     922    -moz-border-radius-topleft: 3px;
     923    -moz-border-radius-topright: 3px;       
     924    color: #555;
     925}
     926
    902927#adminmenu {
    903928    margin: 0;
     
    911936    font-size: 16px;
    912937    color: #2583ad;
    913     padding: 6px 6px;
     938    padding: 6px;
    914939    line-height: 200%;
    915940    border: 1px solid #e4f2fd;
     
    932957}
    933958
    934 #adminmenu li, #submenu li {
     959#sidemenu {
     960    margin: 0;
     961    color: #999;
     962    list-style: none;
     963    position: absolute;
     964    right: 25%;
     965    top: 55px;
     966    padding-left: 10px;
     967}
     968
     969#sidemenu a {
     970    color: #2583ad;
     971    padding: 3px;
     972    line-height: 200%;
     973}
     974
     975#sidemenu a:hover, #sidemenu a.current, #sidemenu a.current:hover {
     976    color: #d54e21;
     977}
     978
     979#dashmenu li, #adminmenu li, #submenu li, #sidemenu li {
    935980    display: inline;
    936981    line-height: 200%;
     
    938983    text-align: center;
    939984    white-space: nowrap;
     985    margin: 0;
     986    padding: 0;
    940987}
    941988
     
    9721019}
    9731020
     1021/* end menu stuff */
     1022
    9741023/* Admin Footer */
    9751024
Note: See TracChangeset for help on using the changeset viewer.