2004-10-18 23:03:06 -04:00
|
|
|
<ul id="adminmenu">
|
|
|
|
<?php
|
|
|
|
$self = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
|
|
|
|
$self = preg_replace('|^.*/plugins/|i', '', $self);
|
|
|
|
|
|
|
|
get_admin_page_parent();
|
|
|
|
|
|
|
|
foreach ($menu as $item) {
|
|
|
|
$class = '';
|
|
|
|
|
2004-11-25 20:50:37 -05:00
|
|
|
// 0 = name, 1 = user_level, 2 = file
|
2005-02-11 21:00:56 -05:00
|
|
|
if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
|
2004-10-18 23:03:06 -04:00
|
|
|
|
2004-11-25 20:50:37 -05:00
|
|
|
if ($user_level >= $item[1]) {
|
2004-12-14 04:53:16 -05:00
|
|
|
if ( file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") )
|
|
|
|
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
|
|
|
|
else
|
|
|
|
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
|
2004-11-25 20:50:37 -05:00
|
|
|
}
|
2004-10-18 23:03:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
<li class="last"><a href="<?php echo get_settings('siteurl')
|
2005-06-12 20:05:41 -04:00
|
|
|
?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php printf(__('Logout (%s)'), $user_identity) ?></a></li>
|
2004-10-18 23:03:06 -04:00
|
|
|
</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;
|
|
|
|
}
|
|
|
|
|
2005-03-02 11:30:00 -05:00
|
|
|
if ( isset($submenu_file) ) {
|
2005-03-20 23:18:16 -05:00
|
|
|
if ( $submenu_file == $item[2] ) $class = ' class="current"';
|
2005-03-02 11:30:00 -05:00
|
|
|
else $class = '';
|
2005-03-20 23:18:16 -05:00
|
|
|
} else if ( (isset($plugin_page) && $plugin_page == $item[2]) || (!isset($plugin_page) && $self == $item[2]) ) $class = ' class="current"';
|
2004-12-24 15:55:36 -05:00
|
|
|
else $class = '';
|
2004-10-18 23:03:06 -04:00
|
|
|
|
2005-02-25 11:11:27 -05:00
|
|
|
$menu_hook = get_plugin_page_hook($item[2], $parent_file);
|
|
|
|
|
|
|
|
if (file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") || ! empty($menu_hook)) {
|
|
|
|
if ( 'admin.php' == $pagenow )
|
2005-02-06 20:15:06 -05:00
|
|
|
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
|
2005-02-25 11:11:27 -05:00
|
|
|
else
|
|
|
|
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$parent_file}?page={$item[2]}'$class>{$item[0]}</a></li>";
|
2005-02-06 20:15:06 -05:00
|
|
|
} else {
|
2004-10-18 23:03:06 -04:00
|
|
|
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
|
2005-02-06 20:15:06 -05:00
|
|
|
}
|
2004-10-18 23:03:06 -04:00
|
|
|
endforeach;
|
|
|
|
?>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
<?php endif; ?>
|