Loading admin_menu_source.module +27 −2 Changes for admin_menu_source.module: 27 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -73,10 +73,35 @@ function admin_menu_source_admin_menu_output_alter(&$content) { } if (!empty($source_menu)) { $content['menu'] = admin_menu_links_menu(admin_menu_tree($source_menu)); // Get the menu tree. $tree = admin_menu_tree($source_menu); // Fix for special_menu_items so multiple <nolink> are supported. // Replace <nolink> with <nolink-*>. $count = 0; foreach ($tree as &$data) { if ($data['link']['href'] == '<nolink>') { $data['link']['href'] = '<nolink-' . $count . '>'; $count++; } } // Build the menu as renderable menu links. $menu = admin_menu_links_menu($tree); // Replace <nolink-*> back with <nolink>. foreach ($menu as &$data) { preg_match("/^<nolink.*>/", $data['#href'], $matches); if (count($matches)) { $data['#href'] = '<nolink>'; } } // Replace with new $menu. $content['menu'] = $menu; $content['menu']['#theme'] = 'admin_menu_links'; $content['menu']['#weight'] = 0; $content['menu']['#sorted'] = TRUE; $content['menu']['#wrapper_attributes']['id'] = 'admin-menu-menu'; } } } Loading Loading
admin_menu_source.module +27 −2 Changes for admin_menu_source.module: 27 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -73,10 +73,35 @@ function admin_menu_source_admin_menu_output_alter(&$content) { } if (!empty($source_menu)) { $content['menu'] = admin_menu_links_menu(admin_menu_tree($source_menu)); // Get the menu tree. $tree = admin_menu_tree($source_menu); // Fix for special_menu_items so multiple <nolink> are supported. // Replace <nolink> with <nolink-*>. $count = 0; foreach ($tree as &$data) { if ($data['link']['href'] == '<nolink>') { $data['link']['href'] = '<nolink-' . $count . '>'; $count++; } } // Build the menu as renderable menu links. $menu = admin_menu_links_menu($tree); // Replace <nolink-*> back with <nolink>. foreach ($menu as &$data) { preg_match("/^<nolink.*>/", $data['#href'], $matches); if (count($matches)) { $data['#href'] = '<nolink>'; } } // Replace with new $menu. $content['menu'] = $menu; $content['menu']['#theme'] = 'admin_menu_links'; $content['menu']['#weight'] = 0; $content['menu']['#sorted'] = TRUE; $content['menu']['#wrapper_attributes']['id'] = 'admin-menu-menu'; } } } Loading