For WordPress 2.5+ Version: 2.0.3 Author: Ozh Author URI: http://planetOzh.com/ */ /* Release History : * 1.0: Initial release * 1.1: Tiger Admin compatibility ! * 1.2: Multiple Page Plugin (ex: Akismet) compatibility and minor CSS improvements * 1.3: Fix for plugins with subfolders on Windows WP installs * 1.3.1: Minor CSS tweaks * 2.0: Complete rewrite for WordPress 2.5 * 2.0.1: Fixed: bug with uploader * 2.0.2: Improved: compatibility with admin custom CSS (some colors are now dynamically picked) Fixed: bug with submenu under plugin toplevel menus Fixed: WP's internal behavior or rewriting the "Manage" link according to the current "Write" page and vice-versa (makes sense?:) Added: Option to display original submenu, per popular demand * 2.0.3: Fixed: CSS bug with uploader, again. Grrrr. */ /***********************************/ /***** Options: Edit if wished *****/ /***********************************/ global $wp_ozh_adminmenu; $wp_ozh_adminmenu['display_submenu'] = false; // boolean: do you want to still display the sublevel menus? Some find it more convenient. /***********************************/ /*** Do not modify anything below **/ /***********************************/ function wp_ozh_adminmenu() { $menu = wp_ozh_adminmenu_build(); $ozh_menu = '
";
	echo '__MENU ';print_r($menu);
	echo 'SUBMENU ';print_r($submenu);
	echo 'ALTMENU ';print_r($altmenu);
	die();
	/**/
	
	// Clean debugging: prints after footer
	/**
	global $wpdb;
	$wpdb->wp_ozh_adminmenu_neat_array = "
Our Oh-So-Beautiful-4-Levels-".htmlentities(print_r($altmenu,true))."
"; add_action('admin_footer', create_function('', 'global $wpdb; echo $wpdb->wp_ozh_adminmenu_neat_array;')); /**/ return ($altmenu); } function wp_ozh_adminmenu_js($menu = '') { global $wp_ozh_adminmenu; $submenu = $wp_ozh_adminmenu['display_submenu'] ? '': "jQuery('#wpwrap #submenu').html('')"; echo << JS; } function wp_ozh_adminmenu_css() { global $wp_ozh_adminmenu, $pagenow; $submenu = ($wp_ozh_adminmenu['display_submenu'] or ($pagenow == "media-upload.php") ) ? '' : '#wpwrap #submenu li'; echo << /* Restyle or hide original items */ #sidemenu, #adminmenu, #dashmenu, $submenu { display:none; } #media-upload-header #sidemenu li { display:auto; } #wphead h1 { font-size:25px; } #wphead #viewsite { margin-top: 6px; } #wphead #viewsite a { font-size:10px; } /* Styles for our new menu */ #ozhmenu { /* our new ul */ font-size:12px; left:0px; list-style-image:none; list-style-position:outside; list-style-type:none; margin:0pt; padding-left:8px; position:absolute; top:4px; width:95%; /* width required for -wtf?- dropping li elements to be 100% wide in their containing ul */ z-index:80; } #ozhmenu li { /* all list items */ display:inline; line-height:200%; list-style-image:none; list-style-position:outside; list-style-type:none; margin:0 3px; padding:0; white-space:nowrap; float: left; width: 1*; /* maybe needed for some Opera ? */ } #ozhmenu a { /* all links */ text-decoration:none; color:#bbb; line-height:220%; padding:0px 10px; display:block; width:1*; /* maybe needed for some Opera ? */ } #ozhmenu li:hover, #ozhmenu li.ozhmenu_over, #ozhmenu li .current { background: #14568A; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; color: #ddd; } #ozhmenu .ozhmenu_sublevel a:hover, #ozhmenu .ozhmenu_sublevel a.current, #ozhmenu .ozhmenu_sublevel a.current:hover { background: #e4f2fd; -moz-border-radius-topleft: 0px; -moz-border-radius-topright: 0px; color: #555; } #ozhmenu li ul { /* drop down lists */ padding: 0; margin: 0; padding-bottom:5px; list-style: none; position: absolute; background: white; opacity:0.95; filter:alpha(opacity=95); border-left:1px solid #c6d9e9 ; border-right:1px solid #c6d9e9 ; border-bottom:1px solid #c6d9e9 ; -moz-border-radius-bottomleft:5px; -moz-border-radius-bottomright:5px; width: 1*; /* maybe needed for some Opera ? */ min-width:6em; left: -999em; /* using left instead of display to hide menus because display: none isn't read by screen readers */ list-style-position:auto; list-style-type:auto; } #ozhmenu li ul li { /* dropped down lists item */ float:none; text-align:left; } #ozhmenu li ul li a { /* links in dropped down list items*/ margin:0px; color:#666; } #ozhmenu li:hover ul, #ozhmenu li.ozhmenu_over ul { /* lists dropped down under hovered list items */ left: auto; z-index:999999; } #ozhmenu li a #awaiting-mod { position: absolute; margin-left: 0.1em; font-size: 0.8em; background-image: url(images/comment-stalk-fresh.gif); background-repeat: no-repeat; background-position: -160px bottom; height: 1.7em; width: 1em; } #ozhmenu li.ozhmenu_over a #awaiting-mod, #ozhmenu li a:hover #awaiting-mod { background-position: -2px bottom; } #ozhmenu li a #awaiting-mod span { color: #fff; top: -0.3em; right: -0.5em; position: absolute; display: block; height: 1.3em; line-height: 1.3em; padding: 0 0.8em; background-color: #2583AD; -moz-border-radius: 4px; -khtml-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } #ozhmenu li.ozhmenu_over a #awaiting-mod span, #ozhmenu li a:hover #awaiting-mod span { background-color:#D54E21; } #ozhmenu .current { border:0px; /* MSIE insists on having this */ } #ozhmenu li ul li a.current:before { content: "\\00BB \\0020"; color:#d54e21; } CSS; } /***** Hook things in ****/ if (is_admin()) { add_action('init', create_function('', 'wp_enqueue_script("jquery");')); } add_action('dashmenu', 'wp_ozh_adminmenu'); add_action('admin_head', 'wp_ozh_adminmenu_head'); function wp_ozh_adminmenu_head() { wp_ozh_adminmenu_css(); wp_ozh_adminmenu_js(); } ?>