Changes in trunk/wp-admin/menu-header.php [17950:15866]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/menu-header.php
r17950 r15866 37 37 global $self, $parent_file, $submenu_file, $plugin_page, $pagenow, $typenow; 38 38 39 $menu_setting_increment = -1;40 $user_settings = get_all_user_settings();41 42 39 $first = true; 43 40 // 0 = name, 1 = capability, 2 = file, 3 = class, 4 = id, 5 = icon src … … 49 46 $first = false; 50 47 } 51 if ( !empty($submenu[$item[2]]) ) {48 if ( !empty($submenu[$item[2]]) ) 52 49 $class[] = 'wp-has-submenu'; 53 $menu_setting_increment++;54 }55 50 56 51 if ( ( $parent_file && $item[2] == $parent_file ) || ( empty($typenow) && $self == $item[2] ) ) { … … 59 54 else 60 55 $class[] = 'current'; 61 } elseif ( ! empty( $submenu[ $item[2] ] ) && isset( $user_settings[ 'm' . $menu_setting_increment ] ) && 'o' == $user_settings[ 'm' . $menu_setting_increment ] ) {62 $class[] = 'wp-menu-open';63 56 } 64 57 … … 77 70 } 78 71 $toggle = '<div class="wp-menu-toggle"><br /></div>'; 79 $arrow = '<div class="wp-menu-arrow"><div></div></div>';80 72 81 73 $title = wptexturize($item[0]); … … 83 75 echo "\n\t<li$class$id>"; 84 76 85 if ( false !== strpos( $class, 'wp-menu-separator') ) {86 echo '< div class="separator"></div>';77 if ( false !== strpos($class, 'wp-menu-separator') ) { 78 echo '<a class="separator" href="?unfoldmenu=1"><br /></a>'; 87 79 } elseif ( $submenu_as_parent && !empty($submenu[$item[2]]) ) { 88 80 $submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index. … … 93 85 if ( ( ('index.php' != $submenu[$item[2]][0][2]) && file_exists(WP_PLUGIN_DIR . "/$menu_file") ) || !empty($menu_hook)) { 94 86 $admin_is_parent = true; 95 echo "<div class='wp-menu-image'><a href='admin.php?page={$submenu[$item[2]][0][2]}'>$img</a></div>$ arrow$toggle<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class$tabindex>$title</a>";87 echo "<div class='wp-menu-image'><a href='admin.php?page={$submenu[$item[2]][0][2]}'>$img</a></div>$toggle<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class$tabindex>$title</a>"; 96 88 } else { 97 echo "\n\t<div class='wp-menu-image'><a href='{$submenu[$item[2]][0][2]}'>$img</a></div>$ arrow$toggle<a href='{$submenu[$item[2]][0][2]}'$class$tabindex>$title</a>";89 echo "\n\t<div class='wp-menu-image'><a href='{$submenu[$item[2]][0][2]}'>$img</a></div>$toggle<a href='{$submenu[$item[2]][0][2]}'$class$tabindex>$title</a>"; 98 90 } 99 } else if ( !empty($item[2]) &¤t_user_can($item[1]) ) {91 } else if ( current_user_can($item[1]) ) { 100 92 $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); 101 93 $menu_file = $item[2]; … … 104 96 if ( ('index.php' != $item[2]) && file_exists(WP_PLUGIN_DIR . "/$menu_file") || !empty($menu_hook) ) { 105 97 $admin_is_parent = true; 106 echo "\n\t<div class='wp-menu-image'><a href='admin.php?page={$item[2]}'>$img</a></div>$ arrow$toggle<a href='admin.php?page={$item[2]}'$class$tabindex>{$item[0]}</a>";98 echo "\n\t<div class='wp-menu-image'><a href='admin.php?page={$item[2]}'>$img</a></div>$toggle<a href='admin.php?page={$item[2]}'$class$tabindex>{$item[0]}</a>"; 107 99 } else { 108 echo "\n\t<div class='wp-menu-image'><a href='{$item[2]}'>$img</a></div>$ arrow$toggle<a href='{$item[2]}'$class$tabindex>{$item[0]}</a>";100 echo "\n\t<div class='wp-menu-image'><a href='{$item[2]}'>$img</a></div>$toggle<a href='{$item[2]}'$class$tabindex>{$item[0]}</a>"; 109 101 } 110 102 } 111 103 112 104 if ( !empty($submenu[$item[2]]) ) { 113 echo "\n\t<div class='wp-submenu'><div class='wp-submenu-wrap'>"; 114 echo "<div class='wp-submenu-head'>{$item[0]}</div><ul>"; 105 echo "\n\t<div class='wp-submenu'><div class='wp-submenu-head'>{$item[0]}</div><ul>"; 115 106 $first = true; 116 107 foreach ( $submenu[$item[2]] as $sub_key => $sub_item ) { … … 165 156 } 166 157 } 167 echo "</ul></div> </div>";158 echo "</ul></div>"; 168 159 } 169 160 echo "</li>"; 170 161 } 171 172 echo '<li id="collapse-menu"><div id="collapse-button"><div></div></div>';173 echo '<span>' . esc_html__( 'Collapse menu' ) . '</span>';174 echo '</li>';175 162 } 176 163 177 164 ?> 178 165 179 <div id="adminmenuback"></div>180 <div id="adminmenuwrap">181 <div id="adminmenushadow"></div>182 166 <ul id="adminmenu"> 183 167 … … 189 173 ?> 190 174 </ul> 191 </div>
Note: See TracChangeset
for help on using the changeset viewer.