mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@1818 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
+1
-46
@@ -1,5 +1,3 @@
|
||||
|
||||
<ul id="adminmenu">
|
||||
<?php
|
||||
// This array constructs the admin menu bar.
|
||||
//
|
||||
@@ -49,47 +47,4 @@ if (! user_can_access_admin_page()) {
|
||||
die( __('You have do not have sufficient permissions to access this page.') );
|
||||
}
|
||||
|
||||
$self = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
|
||||
$self = preg_replace('|^.*/plugins/|i', '', $self);
|
||||
|
||||
if (!isset($parent_file)) $parent_file = '';
|
||||
foreach ($menu as $item) {
|
||||
$class = '';
|
||||
|
||||
// 0 = name, 1 = user_level, 2 = file
|
||||
if ((substr($self, -10) == substr($item[2], -10) && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
|
||||
|
||||
if ($user_level >= $item[1]) {
|
||||
if (
|
||||
('upload.php' == $item[2] &&
|
||||
get_settings('use_fileupload') &&
|
||||
($user_level >= get_settings('fileupload_minlevel'))
|
||||
) || 'upload.php' != $item[2])
|
||||
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<li class="last"><a href="<?php echo get_settings('siteurl')
|
||||
?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php printf(__('Logout (%s)'), $user_nickname) ?></a></li>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
// Sub-menu
|
||||
if ( isset($submenu["$parent_file"]) ) :
|
||||
?>
|
||||
<ul id="adminmenu2">
|
||||
<?php
|
||||
foreach ($submenu["$parent_file"] as $item) :
|
||||
if ($user_level < $item[1]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( substr($self, -10) == substr($item[2], -10) ) $class = ' class="current"';
|
||||
else $class = '';
|
||||
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
|
||||
endforeach;
|
||||
?>
|
||||
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
?>
|
||||
Reference in New Issue
Block a user