summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-admin/menu-header.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-12 11:27:54 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-12 11:27:54 +0000
commit4f3bce79bfb5851cef9e7bc655c91bb3093cc401 (patch)
tree10a0991fddeb0e075d7fa46e2b40e5dbc64d1e88 /wp-inst/wp-admin/menu-header.php
downloadwordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.tar.gz
wordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.tar.xz
wordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.zip
Initial Import
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-admin/menu-header.php')
-rw-r--r--wp-inst/wp-admin/menu-header.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/wp-inst/wp-admin/menu-header.php b/wp-inst/wp-admin/menu-header.php
new file mode 100644
index 0000000..b661146
--- /dev/null
+++ b/wp-inst/wp-admin/menu-header.php
@@ -0,0 +1,58 @@
+<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 = '';
+
+ // 0 = name, 1 = user_level, 2 = file
+ if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
+
+ if ($user_level >= $item[1]) {
+ 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>";
+ }
+}
+
+?>
+ <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_identity) ?></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 ( isset($submenu_file) ) {
+ if ( $submenu_file == $item[2] ) $class = ' class="current"';
+ else $class = '';
+} else if ( (isset($plugin_page) && $plugin_page == $item[2]) || (!isset($plugin_page) && $self == $item[2]) ) $class = ' class="current"';
+else $class = '';
+
+$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 )
+ 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/{$parent_file}?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>";
+ }
+endforeach;
+?>
+
+</ul>
+<?php endif; ?> \ No newline at end of file