Make WordPress Core


Ignore:
Timestamp:
10/19/2004 03:03:06 AM (20 years ago)
Author:
rboren
Message:

Split admin-header.php into admin.php and admin-header.php. Split menu.php into menu-header.php and menu.php. Add plugin admin page support.

File:
1 edited

Legend:

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

    r1810 r1818  
    1 
    2 <ul id="adminmenu">
    31<?php
    42// This array constructs the admin menu bar.
     
    5048}
    5149
    52 $self = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
    53 $self = preg_replace('|^.*/plugins/|i', '', $self);
    54 
    55 if (!isset($parent_file)) $parent_file = '';
    56 foreach ($menu as $item) {
    57     $class = '';
    58 
    59     // 0 = name, 1 = user_level, 2 = file
    60     if ((substr($self, -10) == substr($item[2], -10) && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
    61    
    62     if ($user_level >= $item[1]) {
    63         if (
    64 ('upload.php' == $item[2] &&
    65 get_settings('use_fileupload') &&
    66 ($user_level >= get_settings('fileupload_minlevel'))
    67              ) || 'upload.php' != $item[2])
    68                     echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
    69     }
    70 }
    71 
    7250?>
    73     <li class="last"><a href="<?php echo get_settings('siteurl')
    74      ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php printf(__('Logout (%s)'), $user_nickname) ?></a></li>
    75 </ul>
    76 
    77 <?php
    78 // Sub-menu
    79 if ( isset($submenu["$parent_file"]) ) :
    80 ?>
    81 <ul id="adminmenu2">
    82 <?php
    83 foreach ($submenu["$parent_file"] as $item) :
    84      if ($user_level < $item[1]) {
    85          continue;
    86      }
    87 
    88     if ( substr($self, -10) == substr($item[2], -10) ) $class = ' class="current"';
    89     else $class = '';
    90     echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
    91 endforeach;
    92 ?>
    93 
    94 </ul>
    95 <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.