From f104d3cc12134fc574373d6a643d9c84a317de44 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Fri, 26 Sep 2003 10:04:09 +0000
Subject: [PATCH] - Committed the admin menu integration patch.  Thanks Adrian,
 Stefan and others.

---
 includes/menu.inc                    |  15 ++-
 misc/admin.css                       | 131 ---------------------------
 misc/drupal.css                      |  10 ++
 misc/menu-collapsed.gif              |   2 +-
 misc/menu-expanded.gif               |   6 +-
 misc/menu-leaf.gif                   |   5 +-
 modules/admin.module                 | 113 ++++++++---------------
 modules/aggregator.module            |  18 ++--
 modules/aggregator/aggregator.module |  18 ++--
 modules/block.module                 |   7 +-
 modules/block/block.module           |   7 +-
 modules/blog.module                  |  17 ++--
 modules/blog/blog.module             |  17 ++--
 modules/book.module                  |  23 ++---
 modules/book/book.module             |  23 ++---
 modules/cloud.module                 |  12 ++-
 modules/comment.module               |  36 ++++----
 modules/comment/comment.module       |  36 ++++----
 modules/help.module                  |   3 +-
 modules/help/help.module             |   3 +-
 modules/import.module                |  18 ++--
 modules/locale.module                |  26 +++---
 modules/locale/locale.module         |  26 +++---
 modules/node.module                  |  15 +--
 modules/node/node.module             |  15 +--
 modules/page.module                  |   6 +-
 modules/page/page.module             |   6 +-
 modules/poll.module                  |   6 +-
 modules/poll/poll.module             |   6 +-
 modules/queue.module                 |   6 +-
 modules/statistics.module            |  34 +++----
 modules/statistics/statistics.module |  34 +++----
 modules/story.module                 |   6 +-
 modules/story/story.module           |   6 +-
 modules/system.module                |  48 +++++-----
 modules/system/system.module         |  48 +++++-----
 modules/taxonomy.module              |  10 +-
 modules/taxonomy/taxonomy.module     |  10 +-
 modules/tracker.module               |   8 +-
 modules/tracker/tracker.module       |   8 +-
 modules/user.module                  |  60 +++++-------
 modules/user/user.module             |  60 +++++-------
 modules/watchdog.module              |  20 ++--
 modules/watchdog/watchdog.module     |  20 ++--
 44 files changed, 443 insertions(+), 561 deletions(-)
 delete mode 100644 misc/admin.css

diff --git a/includes/menu.inc b/includes/menu.inc
index 617e9ed2201e..18a6e5aca254 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -46,6 +46,17 @@ function menu_item($in_path) {
   return "<a href=\"". url($in_path) ."\"$css>". t($_gmenu[$in_path]["title"]) ."</a>";
 }
 
+function menu_title($in_path = null) {
+  global $_gmenu;
+
+  if ($in_path == null) {
+    $trail = menu_trail();
+    $in_path = array_pop($trail);
+  }
+
+  return ucfirst($_gmenu[$in_path]["title"]);
+}
+
 function menu_trail() {
   global $_gmenu;
   static $trail; // cache
@@ -72,13 +83,13 @@ function menu_path() {
 
   $trail = menu_trail();
 
-  $links = array();
+  $links[] = l(t("Home"), "");
 
   foreach ($trail as $item) {
     $links[] = menu_item($item);
   }
 
-  return implode(" &raquo; ", $links);
+  return $links;
 }
 
 function menu_help() {
diff --git a/misc/admin.css b/misc/admin.css
deleted file mode 100644
index 219c8e8c74af..000000000000
--- a/misc/admin.css
+++ /dev/null
@@ -1,131 +0,0 @@
-/* $Id */
-
-body {
-  font-size: 90%;
-  margin: 0;
-  background-color: #fff;
-}
-body, th, td, h1, h2, h3, h4, #menu, #main {
-  font-family: helvetica, arial;
-}
-a:link {
-  color: #059;
-}
-a:visited {
-  color: #049;
-}
-h1 {
-  font-size: 1.3em;
-  font-weight: bold;
-  color: #006;
-}
-h2 {
-  font-size: 1.2em;
-  font-weight: bold;
-  color: #006;
-  margin: 0;
-  padding: 0.5em 0 0 0;
-}
-h3 {
-  font-size: 1.2em;
-  font-weight: bold;
-  color: #006;
-  margin: 0;
-  padding: 1em 0 0 0;
-}
-table {
-  border-collapse: collapse;
-}
-th {
-  text-align: left;
-  padding-right: 1em;
-  color: #006;
-  border-bottom: 1px solid #ccc;
-}
-td {
-  padding: 5px;
-  font-size: 0.9em;
-}
-hr {
-  clear: both;
-  margin: .5em 0;
-  height: 1px;
-  color: #ccc;
-}
-dt {
-  font-weight: bold;
-}
-dd {
-  margin-bottom: 0.5em;
-}
-#menu {
-  position: absolute;
-  left: 0px;
-  top: 0px;
-  margin: 0 0 0 0;
-  padding: 0 0 .85em 0;
-  width: 14em;
-  z-index: 1;
-  overflow: hidden;
-  background-color: #69c;
-  border-right: 1px solid #999;
-  border-bottom: 1px solid #999;
-}
-#menu h1 {
-  background-color: #369;
-  display: block;
-  margin: 0 0 .85em 0;
-  padding: 1em 0 .2em .6em;
-  border-top: 1px solid #69c;
-  border-bottom: 1px solid #90bade;
-}
-#menu h1 a {
-  color: #fff;
-  text-decoration: none;
-}
-#menu ul {
-  list-style: none;
-  margin: 0;
-  padding: 0 0 0.25em 1.5em;
-  border: none;
-}
-#menu li {
-  margin: 0;
-  padding: 0.2em 0.5em 0 0;
-}
-#menu li a {
-  display: block;
-  width: 100%;
-  color: #fff;
-  text-decoration: none;
-}
-#menu li a.current {
-  color: #000;
-}
-#menu li a:hover {
-  color: #009;
-}
-#menu li.expanded {
-  list-style-image: url(menu-expanded.gif);
-}
-#menu li.collapsed {
-  list-style-image: url(menu-collapsed.gif);
-}
-#menu li.leaf {
-  list-style-image: url(menu-leaf.gif);
-}
-#main {
-  margin: 0 0 0 16em;
-  padding: 1em 1em 1em 0;
-  z-index: 2;
-}
-#logo {
-  padding: 1em 1em 0 1em;
-  float: right;
-}
-#logo img {
-  border: 0;
-}
-#update {
-  padding: 1em 1em 1em 1em;
-}
diff --git a/misc/drupal.css b/misc/drupal.css
index 894a762b6d99..936715445b6c 100644
--- a/misc/drupal.css
+++ b/misc/drupal.css
@@ -258,3 +258,13 @@ pre, code {
 .queue-user-numeral {
   color: red;
 }
+
+#menu                     {  padding: 0 0 0 0.5em; }
+#menu ul                  {  list-style: none;  margin: 0;  padding: 0 0 0.25em 1em;  border: none; text-align:left;}
+#menu li                  {  margin: 0;  padding: 0.2em 0.5em 0 0; }
+#menu li a                {  display: block;  width: 100%;  text-decoration: none; }
+#menu li a.current        {  color: #000; }
+#menu li a:hover          {  color: #009; }
+#menu li.expanded         {  list-style-image: url(menu-expanded.gif); }
+#menu li.collapsed        {  list-style-image: url(menu-collapsed.gif); }
+#menu li.leaf             {  list-style-image: url(menu-leaf.gif); }
diff --git a/misc/menu-collapsed.gif b/misc/menu-collapsed.gif
index 7018396922dc..5ae2274fbea4 100644
--- a/misc/menu-collapsed.gif
+++ b/misc/menu-collapsed.gif
@@ -1 +1 @@
-GIF89a��€��ÀÀÀ���!ù���,�������L`y¨àíØ’KU��;
\ No newline at end of file
+GIF89a��€�����ÿÿÿ!ù���,�������L`y¨àíØ’KU��;
\ No newline at end of file
diff --git a/misc/menu-expanded.gif b/misc/menu-expanded.gif
index 38e54e7b8057..dfe822804c36 100644
--- a/misc/menu-expanded.gif
+++ b/misc/menu-expanded.gif
@@ -1 +1,5 @@
-GIF89a��€��ÀÀÀ���!ù���,�������„j
œ´Î�;
\ No newline at end of file
+GIF89a������			
+
+
+


   !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~€€€‚‚‚ƒƒƒ„„„………†††‡‡‡ˆˆˆ‰‰‰ŠŠŠ‹‹‹ŒŒŒŽŽŽ‘‘‘’’’“““”””•••–––———˜˜˜™™™ššš›››œœœžžžŸŸŸ   ¡¡¡¢¢¢£££¤¤¤¥¥¥¦¦¦§§§¨¨¨©©©ªªª«««¬¬¬­­­®®®¯¯¯°°°±±±²²²³³³´´´µµµ¶¶¶···¸¸¸¹¹¹ººº»»»¼¼¼½½½¾¾¾¿¿¿ÀÀÀÁÁÁÂÂÂÃÃÃÄÄÄÅÅÅÆÆÆÇÇÇÈÈÈÉÉÉÊÊÊËËËÌÌÌÍÍÍÎÎÎÏÏÏÐÐÐÑÑÑÒÒÒÓÓÓÔÔÔÕÕÕÖÖÖ×××ØØØÙÙÙÚÚÚÛÛÛÜÜÜÝÝÝÞÞÞßßßàààáááâââãããäääåååæææçççèèèéééêêêëëëìììíííîîîïïïðððñññòòòóóóôôôõõõööö÷÷÷øøøùùùúúúûûûüüüýýýþþþÿÿÿ!ù��ÿ�,��������àÁ‚ÿ
+LÈ!Ç#>�;
\ No newline at end of file
diff --git a/misc/menu-leaf.gif b/misc/menu-leaf.gif
index e40cb368652e..3b120a244eff 100644
--- a/misc/menu-leaf.gif
+++ b/misc/menu-leaf.gif
@@ -1 +1,4 @@
-GIF89a��€��ÀÀÀ���!ù���,�������
Œo šý^3-ŠB�;
\ No newline at end of file
+GIF89a������			
+
+
+


   !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~€€€‚‚‚ƒƒƒ„„„………†††‡‡‡ˆˆˆ‰‰‰ŠŠŠ‹‹‹ŒŒŒŽŽŽ‘‘‘’’’“““”””•••–––———˜˜˜™™™ššš›››œœœžžžŸŸŸ   ¡¡¡¢¢¢£££¤¤¤¥¥¥¦¦¦§§§¨¨¨©©©ªªª«««¬¬¬­­­®®®¯¯¯°°°±±±²²²³³³´´´µµµ¶¶¶···¸¸¸¹¹¹ººº»»»¼¼¼½½½¾¾¾¿¿¿ÀÀÀÁÁÁÂÂÂÃÃÃÄÄÄÅÅÅÆÆÆÇÇÇÈÈÈÉÉÉÊÊÊËËËÌÌÌÍÍÍÎÎÎÏÏÏÐÐÐÑÑÑÒÒÒÓÓÓÔÔÔÕÕÕÖÖÖ×××ØØØÙÙÙÚÚÚÛÛÛÜÜÜÝÝÝÞÞÞßßßàààáááâââãããäääåååæææçççèèèéééêêêëëëìììíííîîîïïïðððñññòòòóóóôôôõõõööö÷÷÷øøøùùùúúúûûûüüüýýýþþþÿÿÿ!ù��ÿ�,��������ÿ	(€AƒH¸pá?‡„Hð_@�;
\ No newline at end of file
diff --git a/modules/admin.module b/modules/admin.module
index 5af8a76c8af3..1f2994d0f987 100644
--- a/modules/admin.module
+++ b/modules/admin.module
@@ -13,112 +13,73 @@ function admin_help($section) {
   $output = "";
 
   switch ($section) {
-    case 'admin/system/modules':
+    case "admin/system/modules":
       $output .= "Handles the administration pages.";
       break;
-    case 'admin':
+    case "admin":
       $output .= "Welcome to the administration section. Below are the most recent system events.  To get started please choose an item in the left column. If there is an arrow it will expand into a submenu. To jump up a level use the link,bread crumbs, above this block of text. To return to the home page click on the site name, and to go to Drupal's home page click on Druplicon, the drop on to the right.";
       break;
-    case 'admin':
+    case "admin":
       $output = "This is a complete overview of the site administration page.";
       break;
   }
-
   return t($output);
 }
+
 function admin_system($field){
   $output = "";
-
-  if ($field == "description") { $output = admin_help("admin/system/modules"); }
+  if ($field == "description") {
+    $output = admin_help("admin/system/modules");
+  }
 
   return $output;
 }
 
 function admin_link($type) {
-  if ($type == "admin") {
-    menu("admin", "Administration", NULL, admin_help("admin"));
+  if ($type == "system") {
+    menu("admin", t("administer %a", array("%a" => variable_get("site_name", "drupal"))) , NULL, NULL, 9);
     menu("admin/overview", "sitemap", "overview_callback", admin_help("admin/overview"), 8);
   }
 }
 
 function overview_callback() {
-  return menu_map("admin");
+  return menu_map();
 }
 
 function admin_admin() {
-  print menu_map();
+  return menu_map();
 }
 
-function admin_page() {
-  global $base_url;
 
+function admin_page() {
   if (user_access("access administration pages")) {
-   ?>
-    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-    <html>
-     <head>
-      <title><?php echo t("%sitename administration pages", array("%sitename" => variable_get("site_name", "drupal"))); ?></title>
-      <?php print theme_head(); ?>
-      <link rel="shortcut icon" type="image/ico" href="favicon.ico" />
-      <link rel="stylesheet" type="text/css" media="print" href="misc/print.css" />
-      <style type="text/css" title="layout" media="Screen">
-        @import url("misc/admin.css");
-      </style>
-     </head>
-     <body<?php print theme_onload_attribute(); ?>>
-      <?php
-        // NOTE: we include a dummy "print.css" to remove the "flash of unstyled content" (FUOC) problems in IE.
-
-        menu_build("admin");
-
-        /*
-        ** Body:
-        */
-
-        print "<div id=\"logo\"><a href=\"http://drupal.org/\"><img src=\"misc/druplicon-small.gif\" alt=\"Druplicon - Drupal logo\" title=\"Druplicon - Drupal logo\" /></a></div>";
-        print "<div id=\"main\">";
-
-        if ($path = menu_path()) {
-          print "<h2>$path</h2>";
-        }
-
-        if ($help = menu_help()) {
-          print "<small>$help</small>";
-        }
-
-        print "<hr />";
-
-        if (arg(1)) {
-          //print module_invoke(arg(1), "admin");
-          print menu_execute_action();
-        }
-        else {
-          print "<h2>". t("System messages") ."</h2>";
-          print watchdog_overview("actions");
-        }
-
-        print "</div>";
-
-        /*
-        ** Menu:
-        **   We rebuild the admin menu once more because one might have
-        **   enabled/disabled themes or modules, changed permissions, etc.
-        */
-
-        menu_build("admin");
-
-        print "<div id=\"menu\">";
-        echo "<h1><a href=\"$base_url/\">". variable_get("site_name", "drupal") ."</a></h1>";
-        print menu_tree("admin") ;
-        print "</div>";
-        print theme_footer();
-      ?>
-    </body>
-   </html>
-   <?php
+    if (!isset($GLOBALS["_gmenu"])) {
+      menu_build("system");
+    }
+    if ($help = menu_help()) {
+      $contents = "<small>$help</small><hr />";
+    }
+    if (arg(1)) {
+      $contents .= menu_execute_action();
+    }
+    else {
+      $contents.= watchdog_overview("actions");
+      $title = t("System messages");
+    }
+
+    $breadcrumb = menu_path();
+    array_pop($breadcrumb);
+    $title = menu_title();
+
+    theme("header");
+    theme("breadcrumb", $breadcrumb);
+    theme("box", $title, $contents);
+    theme("footer");
   }
   else {
-    print message_access();
+    theme("header");
+    theme("box", t("Access denied"), message_access());
+    theme("footer");
   }
 }
 
diff --git a/modules/aggregator.module b/modules/aggregator.module
index dab184fbd6a4..4bb4431ec0d3 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -105,14 +105,16 @@ function import_link($type) {
     $links[] = l(t("news feeds"), "import", array("title" => t("Read the latest news from syndicated web sites.")));
   }
 
-  if ($type == "admin" && user_access("administer news feeds")) {
-
-    menu("admin/syndication", "content syndication", NULL, NULL, 5);
-    menu("admin/syndication/news", "news aggregation", "import_admin", import_help("admin/syndication/news") );
-    menu("admin/syndication/news/add/feed", "add new feed", "import_admin", import_help("admin/syndication/news/add/feed"), 2);
-    menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", import_help("admin/syndication/news/add/bundle"), 3);
-    menu("admin/syndication/news/tag", "tag news items", "import_admin", import_help("admin/syndication/news/tag"), 4);
-    menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
+  if ($type == "system") {
+    if (user_access("administer news feeds")) {
+
+      menu("admin/syndication", "content syndication", NULL, NULL, 5);
+      menu("admin/syndication/news", "news aggregation", "import_admin", import_help("admin/syndication/news") );
+      menu("admin/syndication/news/add/feed", "add new feed", "import_admin", import_help("admin/syndication/news/add/feed"), 2);
+      menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", import_help("admin/syndication/news/add/bundle"), 3);
+      menu("admin/syndication/news/tag", "tag news items", "import_admin", import_help("admin/syndication/news/tag"), 4);
+      menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
+    }
   }
 
   return $links;
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index dab184fbd6a4..4bb4431ec0d3 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -105,14 +105,16 @@ function import_link($type) {
     $links[] = l(t("news feeds"), "import", array("title" => t("Read the latest news from syndicated web sites.")));
   }
 
-  if ($type == "admin" && user_access("administer news feeds")) {
-
-    menu("admin/syndication", "content syndication", NULL, NULL, 5);
-    menu("admin/syndication/news", "news aggregation", "import_admin", import_help("admin/syndication/news") );
-    menu("admin/syndication/news/add/feed", "add new feed", "import_admin", import_help("admin/syndication/news/add/feed"), 2);
-    menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", import_help("admin/syndication/news/add/bundle"), 3);
-    menu("admin/syndication/news/tag", "tag news items", "import_admin", import_help("admin/syndication/news/tag"), 4);
-    menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
+  if ($type == "system") {
+    if (user_access("administer news feeds")) {
+
+      menu("admin/syndication", "content syndication", NULL, NULL, 5);
+      menu("admin/syndication/news", "news aggregation", "import_admin", import_help("admin/syndication/news") );
+      menu("admin/syndication/news/add/feed", "add new feed", "import_admin", import_help("admin/syndication/news/add/feed"), 2);
+      menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", import_help("admin/syndication/news/add/bundle"), 3);
+      menu("admin/syndication/news/tag", "tag news items", "import_admin", import_help("admin/syndication/news/tag"), 4);
+      menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
+    }
   }
 
   return $links;
diff --git a/modules/block.module b/modules/block.module
index a1332619af89..ac89366f6ff5 100644
--- a/modules/block.module
+++ b/modules/block.module
@@ -66,7 +66,7 @@ function block_perm() {
 }
 
 function block_link($type) {
-  if ($type == "admin" && user_access("administer blocks")) {
+  if ($type == "system" && user_access("administer blocks")) {
 
     menu("admin/block", "block management", "block_admin", block_help("admin/block"), 3);
     menu("admin/block/add", "create new block", "block_admin", block_help("admin/block/add"), 2);
@@ -169,10 +169,7 @@ function block_admin_display() {
       $delete = "";
     }
 
-    $status = form_checkbox(NULL, $block["module"]."][".$block["delta"]."][status", 1, $block["status"]);
-    $custom = form_checkbox(NULL, $block["module"]."][".$block["delta"]."][custom", 1, $block["custom"]);
-
-    $rows[] = array($block["info"], array("data" => $status, "align" => "center"), array("data" => $custom, "align" => "center"), form_weight(NULL, $block["module"]."][".$block["delta"]."][weight", $block["weight"]), form_select(NULL, $block["module"]."][".$block["delta"]."][region", $block["region"], array(t("left"), t("right"))), form_textfield(NULL, $block["module"]."][".$block["delta"]."][path", $block["path"], 10, 255), $edit, $delete);
+    $rows[] = array($block["info"], array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][status", 1, $block["status"]), "align" => "center"), array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][custom", 1, $block["custom"]), "align" => "center"), form_weight(NULL, $block["module"]."][".$block["delta"]."][weight", $block["weight"]), form_select(NULL, $block["module"]."][".$block["delta"]."][region", $block["region"], array(t("left"), t("right"))), form_textfield(NULL, $block["module"]."][".$block["delta"]."][path", $block["path"], 10, 255), $edit, $delete);
   }
 
   $output = table($header, $rows);
diff --git a/modules/block/block.module b/modules/block/block.module
index a1332619af89..ac89366f6ff5 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -66,7 +66,7 @@ function block_perm() {
 }
 
 function block_link($type) {
-  if ($type == "admin" && user_access("administer blocks")) {
+  if ($type == "system" && user_access("administer blocks")) {
 
     menu("admin/block", "block management", "block_admin", block_help("admin/block"), 3);
     menu("admin/block/add", "create new block", "block_admin", block_help("admin/block/add"), 2);
@@ -169,10 +169,7 @@ function block_admin_display() {
       $delete = "";
     }
 
-    $status = form_checkbox(NULL, $block["module"]."][".$block["delta"]."][status", 1, $block["status"]);
-    $custom = form_checkbox(NULL, $block["module"]."][".$block["delta"]."][custom", 1, $block["custom"]);
-
-    $rows[] = array($block["info"], array("data" => $status, "align" => "center"), array("data" => $custom, "align" => "center"), form_weight(NULL, $block["module"]."][".$block["delta"]."][weight", $block["weight"]), form_select(NULL, $block["module"]."][".$block["delta"]."][region", $block["region"], array(t("left"), t("right"))), form_textfield(NULL, $block["module"]."][".$block["delta"]."][path", $block["path"], 10, 255), $edit, $delete);
+    $rows[] = array($block["info"], array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][status", 1, $block["status"]), "align" => "center"), array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][custom", 1, $block["custom"]), "align" => "center"), form_weight(NULL, $block["module"]."][".$block["delta"]."][weight", $block["weight"]), form_select(NULL, $block["module"]."][".$block["delta"]."][region", $block["region"], array(t("left"), t("right"))), form_textfield(NULL, $block["module"]."][".$block["delta"]."][path", $block["path"], 10, 255), $edit, $delete);
   }
 
   $output = table($header, $rows);
diff --git a/modules/blog.module b/modules/blog.module
index e66460334095..5f00f3d8a965 100644
--- a/modules/blog.module
+++ b/modules/blog.module
@@ -259,16 +259,17 @@ function blog_link($type, $node = 0, $main) {
 
   $links = array();
 
-  if ($type == "page" && user_access("access content")) {
-    $links[] = l(t("blogs"), "blog", array("title" => t("Read the latest blog entries.")));
-  }
-
-  if ($type == "menu.create" && user_access("maintain personal blog")) {
-    $links[] = l(t("create blog entry"), "node/add/blog", array("title" => t("Add a new personal blog entry.")));
+  if ($type == "system") {
+    if (user_access("maintain personal blog")) {
+      menu("node/add/blog", t("create blog entry"), NULL, NULL, 0);
+    }
+    if (user_access("maintain personal blog")) {
+      menu("blog/" . $user->uid,t("view personal blog"), NULL, NULL, 1);
+    }
   }
 
-  if ($type == "menu.view" && user_access("maintain personal blog")) {
-    $links[] = l(t("view personal blog"), "blog/$user->uid", array("title" => t("Read your latest blog entries.")));
+  if ($type == "page" && user_access("access content")) {
+    $links[] = l(t("blogs"), "blog", array("title" => t("Read the latest blog entries.")));
   }
 
   if ($type == "node" && $node->type == "blog") {
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index e66460334095..5f00f3d8a965 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -259,16 +259,17 @@ function blog_link($type, $node = 0, $main) {
 
   $links = array();
 
-  if ($type == "page" && user_access("access content")) {
-    $links[] = l(t("blogs"), "blog", array("title" => t("Read the latest blog entries.")));
-  }
-
-  if ($type == "menu.create" && user_access("maintain personal blog")) {
-    $links[] = l(t("create blog entry"), "node/add/blog", array("title" => t("Add a new personal blog entry.")));
+  if ($type == "system") {
+    if (user_access("maintain personal blog")) {
+      menu("node/add/blog", t("create blog entry"), NULL, NULL, 0);
+    }
+    if (user_access("maintain personal blog")) {
+      menu("blog/" . $user->uid,t("view personal blog"), NULL, NULL, 1);
+    }
   }
 
-  if ($type == "menu.view" && user_access("maintain personal blog")) {
-    $links[] = l(t("view personal blog"), "blog/$user->uid", array("title" => t("Read your latest blog entries.")));
+  if ($type == "page" && user_access("access content")) {
+    $links[] = l(t("blogs"), "blog", array("title" => t("Read the latest blog entries.")));
   }
 
   if ($type == "node" && $node->type == "blog") {
diff --git a/modules/book.module b/modules/book.module
index af0119679a3d..bebd9a24d23e 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -68,10 +68,6 @@ function book_link($type, $node = 0, $main = 0) {
     $links[] = l(t("books"), "book", array("title" => t("Read and contribute to the collaborative books.")));
   }
 
-  if ($type == "menu.create" && user_access("maintain books")) {
-    $links[] = l(t("create book page"), "node/add/book", array("title" => t("Add a new book page.")));
-  }
-
   if ($type == "node" && $node->type == "book") {
     if (book_access("update", $node)) {
       $links[] = l(t("edit this page"), "node/edit/$node->nid", array("title" => t("Suggest an update for this book page.")));
@@ -81,15 +77,20 @@ function book_link($type, $node = 0, $main = 0) {
     }
   }
 
-  if ($type == "admin" && user_access("maintain books")) {
-    menu("admin/node/book", "books", "book_admin", book_help("admin/node/book"), 4);
-    menu("admin/node/book/orphan", "orphan pages", "book_admin", book_help("admin/node/book/orphan"), 8);
-    menu("admin/node/book/help", "help", "book_help", NULL, 9);
+  if ($type == "system") {
+    if (user_access("maintain books")) {
+      menu("node/add/book",t("create book page"),NULL, NULL,0);
+
+      menu("admin/node/book", "books", NULL, NULL, 4);
+      menu("admin/node/book/orphan", "orphan pages", NULL, NULL, 8);
+      menu("admin/node/book/help", "help", NULL, NULL, 9);
 
-    $result = db_query("SELECT n.nid, n.title FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = 0 ORDER BY b.weight, n.title");
-    while ($book = db_fetch_object($result)) {
-      menu("admin/node/book/$book->nid", "'$book->title' book", "book_admin");
+      $result = db_query("SELECT n.nid, n.title FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = 0 ORDER BY b.weight, n.title");
+      while ($book = db_fetch_object($result)) {
+        menu("admin/node/book/$book->nid", "'$book->title' book", "book_admin");
+      }
     }
+
   }
 
   return $links;
diff --git a/modules/book/book.module b/modules/book/book.module
index af0119679a3d..bebd9a24d23e 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -68,10 +68,6 @@ function book_link($type, $node = 0, $main = 0) {
     $links[] = l(t("books"), "book", array("title" => t("Read and contribute to the collaborative books.")));
   }
 
-  if ($type == "menu.create" && user_access("maintain books")) {
-    $links[] = l(t("create book page"), "node/add/book", array("title" => t("Add a new book page.")));
-  }
-
   if ($type == "node" && $node->type == "book") {
     if (book_access("update", $node)) {
       $links[] = l(t("edit this page"), "node/edit/$node->nid", array("title" => t("Suggest an update for this book page.")));
@@ -81,15 +77,20 @@ function book_link($type, $node = 0, $main = 0) {
     }
   }
 
-  if ($type == "admin" && user_access("maintain books")) {
-    menu("admin/node/book", "books", "book_admin", book_help("admin/node/book"), 4);
-    menu("admin/node/book/orphan", "orphan pages", "book_admin", book_help("admin/node/book/orphan"), 8);
-    menu("admin/node/book/help", "help", "book_help", NULL, 9);
+  if ($type == "system") {
+    if (user_access("maintain books")) {
+      menu("node/add/book",t("create book page"),NULL, NULL,0);
+
+      menu("admin/node/book", "books", NULL, NULL, 4);
+      menu("admin/node/book/orphan", "orphan pages", NULL, NULL, 8);
+      menu("admin/node/book/help", "help", NULL, NULL, 9);
 
-    $result = db_query("SELECT n.nid, n.title FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = 0 ORDER BY b.weight, n.title");
-    while ($book = db_fetch_object($result)) {
-      menu("admin/node/book/$book->nid", "'$book->title' book", "book_admin");
+      $result = db_query("SELECT n.nid, n.title FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = 0 ORDER BY b.weight, n.title");
+      while ($book = db_fetch_object($result)) {
+        menu("admin/node/book/$book->nid", "'$book->title' book", "book_admin");
+      }
     }
+
   }
 
   return $links;
diff --git a/modules/cloud.module b/modules/cloud.module
index 8895ade66f4b..4e6ea5f2538e 100644
--- a/modules/cloud.module
+++ b/modules/cloud.module
@@ -58,11 +58,13 @@ function cloud_link($type) {
     $links[] = l(t("site cloud"), "cloud", array("title" => t("Monitor other sites in the cloud.")));
   }
 
-  if ($type == "admin" && user_access("administer site cloud")) {
-    menu("admin/syndication", "content syndication", NULL, NULL, 5);
-    menu("admin/syndication/cloud", "site cloud", "cloud_admin", cloud_help("admin/syndication/cloud"));
-    menu("admin/syndication/cloud/add", "add new site", "cloud_admin", cloud_help("admin/syndication/cloud/add"));
-    menu("admin/syndication/cloud/help", "help", "cloud_help", NULL, 9);
+  if ($type == "system") {
+    if (user_access("administer site cloud")) {
+      menu("admin/syndication", "content syndication", NULL, NULL, 5);
+      menu("admin/syndication/cloud", "site cloud", "cloud_admin", cloud_help("admin/syndication/cloud"));
+      menu("admin/syndication/cloud/add", "add new site", "cloud_admin", cloud_help("admin/syndication/cloud/add"));
+      menu("admin/syndication/cloud/help", "help", "cloud_help", NULL, 9);
+    }
   }
 
   return $links;
diff --git a/modules/comment.module b/modules/comment.module
index 43060e2a03ad..5e40378a7c19 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -813,23 +813,25 @@ function comment_link($type, $node = 0, $main = 0) {
     }
   }
 
-  if ($type == "admin" && user_access("administer comments")) {
-
-    menu("admin/comment", "comment management", "comment_admin", comment_help("admin/comment"), 2);
-    menu("admin/comment/comments", "comment overview",NULL, comment_help("admin/comment/comments"), 2);
-    menu("admin/comment/comments/0", "new or updated comments", "comment_admin", comment_help("admin/comment/comments/0"), 1);
-    menu("admin/comment/comments/1", "comment approval queue", "comment_admin", comment_help("admin/comment/comments/1"), 2);
-    menu("admin/comment/search", "search comments", "comment_admin", comment_help("admin/comment/search"), 8);
-    menu("admin/comment/help", "help", "comment_help", NULL, 9);
-    menu("admin/comment/edit", "edit comment", "comment_admin", NULL, 0, 1);
-
-    // comment settings:
-    if (user_access("administer moderation")) {
-      menu("admin/comment/moderation", "comment moderation", NULL, comment_help("admin/comment/moderation"), 3);
-      menu("admin/comment/moderation/votes", "votes", "comment_admin", comment_help("admin/comment/moderation/votes"));
-      menu("admin/comment/moderation/matrix", "matrix", "comment_admin", comment_help("admin/comment/moderation/matrix"));
-      menu("admin/comment/moderation/filters", "thresholds", "comment_admin", comment_help("admin/comment/moderation/filters"));
-      menu("admin/comment/moderation/roles", "initial comment scores", "comment_admin", comment_help("admin/comment/roles"), 6);
+  if ($type == "system") {
+    if (user_access("administer comments")) {
+
+      menu("admin/comment", "comment management", "comment_admin", comment_help("admin/comment"), 2);
+      menu("admin/comment/comments", "comment overview",NULL, comment_help("admin/comment/comments"), 2);
+      menu("admin/comment/comments/0", "new or updated comments", "comment_admin", comment_help("admin/comment/comments/0"), 1);
+      menu("admin/comment/comments/1", "comment approval queue", "comment_admin", comment_help("admin/comment/comments/1"), 2);
+      menu("admin/comment/search", "search comments", "comment_admin", comment_help("admin/comment/search"), 8);
+      menu("admin/comment/help", "help", "comment_help", NULL, 9);
+      menu("admin/comment/edit", "edit comment", "comment_admin", NULL, 0, 1);
+
+      // comment settings:
+      if (user_access("administer moderation")) {
+        menu("admin/comment/moderation", "comment moderation", NULL, comment_help("admin/comment/moderation"), 3);
+        menu("admin/comment/moderation/votes", "votes", "comment_admin", comment_help("admin/comment/moderation/votes"));
+        menu("admin/comment/moderation/matrix", "matrix", "comment_admin", comment_help("admin/comment/moderation/matrix"));
+        menu("admin/comment/moderation/filters", "thresholds", "comment_admin", comment_help("admin/comment/moderation/filters"));
+        menu("admin/comment/moderation/roles", "initial comment scores", "comment_admin", comment_help("admin/comment/roles"), 6);
+      }
     }
   }
 
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 43060e2a03ad..5e40378a7c19 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -813,23 +813,25 @@ function comment_link($type, $node = 0, $main = 0) {
     }
   }
 
-  if ($type == "admin" && user_access("administer comments")) {
-
-    menu("admin/comment", "comment management", "comment_admin", comment_help("admin/comment"), 2);
-    menu("admin/comment/comments", "comment overview",NULL, comment_help("admin/comment/comments"), 2);
-    menu("admin/comment/comments/0", "new or updated comments", "comment_admin", comment_help("admin/comment/comments/0"), 1);
-    menu("admin/comment/comments/1", "comment approval queue", "comment_admin", comment_help("admin/comment/comments/1"), 2);
-    menu("admin/comment/search", "search comments", "comment_admin", comment_help("admin/comment/search"), 8);
-    menu("admin/comment/help", "help", "comment_help", NULL, 9);
-    menu("admin/comment/edit", "edit comment", "comment_admin", NULL, 0, 1);
-
-    // comment settings:
-    if (user_access("administer moderation")) {
-      menu("admin/comment/moderation", "comment moderation", NULL, comment_help("admin/comment/moderation"), 3);
-      menu("admin/comment/moderation/votes", "votes", "comment_admin", comment_help("admin/comment/moderation/votes"));
-      menu("admin/comment/moderation/matrix", "matrix", "comment_admin", comment_help("admin/comment/moderation/matrix"));
-      menu("admin/comment/moderation/filters", "thresholds", "comment_admin", comment_help("admin/comment/moderation/filters"));
-      menu("admin/comment/moderation/roles", "initial comment scores", "comment_admin", comment_help("admin/comment/roles"), 6);
+  if ($type == "system") {
+    if (user_access("administer comments")) {
+
+      menu("admin/comment", "comment management", "comment_admin", comment_help("admin/comment"), 2);
+      menu("admin/comment/comments", "comment overview",NULL, comment_help("admin/comment/comments"), 2);
+      menu("admin/comment/comments/0", "new or updated comments", "comment_admin", comment_help("admin/comment/comments/0"), 1);
+      menu("admin/comment/comments/1", "comment approval queue", "comment_admin", comment_help("admin/comment/comments/1"), 2);
+      menu("admin/comment/search", "search comments", "comment_admin", comment_help("admin/comment/search"), 8);
+      menu("admin/comment/help", "help", "comment_help", NULL, 9);
+      menu("admin/comment/edit", "edit comment", "comment_admin", NULL, 0, 1);
+
+      // comment settings:
+      if (user_access("administer moderation")) {
+        menu("admin/comment/moderation", "comment moderation", NULL, comment_help("admin/comment/moderation"), 3);
+        menu("admin/comment/moderation/votes", "votes", "comment_admin", comment_help("admin/comment/moderation/votes"));
+        menu("admin/comment/moderation/matrix", "matrix", "comment_admin", comment_help("admin/comment/moderation/matrix"));
+        menu("admin/comment/moderation/filters", "thresholds", "comment_admin", comment_help("admin/comment/moderation/filters"));
+        menu("admin/comment/moderation/roles", "initial comment scores", "comment_admin", comment_help("admin/comment/roles"), 6);
+      }
     }
   }
 
diff --git a/modules/help.module b/modules/help.module
index 157b37e0d5c3..9719ba9e97b7 100644
--- a/modules/help.module
+++ b/modules/help.module
@@ -7,7 +7,7 @@ function help_system($field){
 }
 
 function help_link($type) {
-  if ($type == "admin") {
+  if ($type == "system") {
     menu("admin/help/glossary", "glossary", "help_glossary", NULL, 8);
     menu("admin/help", "help", "help_admin", NULL, 9);
   }
@@ -48,7 +48,6 @@ function help_admin() {
       }
     }
   }
-
   $output = "<small>". implode(" &middot; ", $links) ."</small><hr />". $output;
   return $output;
 }
diff --git a/modules/help/help.module b/modules/help/help.module
index 157b37e0d5c3..9719ba9e97b7 100644
--- a/modules/help/help.module
+++ b/modules/help/help.module
@@ -7,7 +7,7 @@ function help_system($field){
 }
 
 function help_link($type) {
-  if ($type == "admin") {
+  if ($type == "system") {
     menu("admin/help/glossary", "glossary", "help_glossary", NULL, 8);
     menu("admin/help", "help", "help_admin", NULL, 9);
   }
@@ -48,7 +48,6 @@ function help_admin() {
       }
     }
   }
-
   $output = "<small>". implode(" &middot; ", $links) ."</small><hr />". $output;
   return $output;
 }
diff --git a/modules/import.module b/modules/import.module
index dab184fbd6a4..4bb4431ec0d3 100644
--- a/modules/import.module
+++ b/modules/import.module
@@ -105,14 +105,16 @@ function import_link($type) {
     $links[] = l(t("news feeds"), "import", array("title" => t("Read the latest news from syndicated web sites.")));
   }
 
-  if ($type == "admin" && user_access("administer news feeds")) {
-
-    menu("admin/syndication", "content syndication", NULL, NULL, 5);
-    menu("admin/syndication/news", "news aggregation", "import_admin", import_help("admin/syndication/news") );
-    menu("admin/syndication/news/add/feed", "add new feed", "import_admin", import_help("admin/syndication/news/add/feed"), 2);
-    menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", import_help("admin/syndication/news/add/bundle"), 3);
-    menu("admin/syndication/news/tag", "tag news items", "import_admin", import_help("admin/syndication/news/tag"), 4);
-    menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
+  if ($type == "system") {
+    if (user_access("administer news feeds")) {
+
+      menu("admin/syndication", "content syndication", NULL, NULL, 5);
+      menu("admin/syndication/news", "news aggregation", "import_admin", import_help("admin/syndication/news") );
+      menu("admin/syndication/news/add/feed", "add new feed", "import_admin", import_help("admin/syndication/news/add/feed"), 2);
+      menu("admin/syndication/news/add/bundle", "add new bundle", "import_admin", import_help("admin/syndication/news/add/bundle"), 3);
+      menu("admin/syndication/news/tag", "tag news items", "import_admin", import_help("admin/syndication/news/tag"), 4);
+      menu("admin/syndication/news/help", "help", "import_help", NULL, 9);
+    }
   }
 
   return $links;
diff --git a/modules/locale.module b/modules/locale.module
index 873865bd05b2..fff214eecd35 100644
--- a/modules/locale.module
+++ b/modules/locale.module
@@ -69,18 +69,20 @@ function locale_perm() {
 function locale_link($type) {
   global $languages;
 
-  if ($type == "admin" && user_access("administer locales")) {
-
-    menu("admin/locale", "localization", NULL, locale_help("admin/locale"), 5);
-    menu("admin/locale/search", "search string", "locale_admin", locale_help("admin/locale/search"), 8);
-    menu("admin/locale/help", "help", "locale_help", NULL, 9);
-    menu("admin/locale/edit", "edit string", "locale_admin", NULL, 0, 1); // hidden menu
-    menu("admin/locale/delete", "delete string", "locale_admin", NULL, 0, 1); // hidden menu
-
-    foreach ($languages as $key => $value) {
-      menu("admin/locale/$key", "$value", NULL, locale_help("admin/locale"));
-      menu("admin/locale/$key/translated", "translated strings", "locale_admin", locale_help("admin/locale/translated"));
-      menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin", locale_help("admin/locale/untranslated"));
+  if ($type == "system") {
+    if (user_access("administer locales")) {
+
+      menu("admin/locale", "localization", NULL, locale_help("admin/locale"), 5);
+      menu("admin/locale/search", "search string", "locale_admin", locale_help("admin/locale/search"), 8);
+      menu("admin/locale/help", "help", "locale_help", NULL, 9);
+      menu("admin/locale/edit", "edit string", "locale_admin", NULL, 0, 1); // hidden menu
+      menu("admin/locale/delete", "delete string", "locale_admin", NULL, 0, 1); // hidden menu
+
+      foreach ($languages as $key => $value) {
+        menu("admin/locale/$key", "$value", NULL, locale_help("admin/locale"));
+        menu("admin/locale/$key/translated", "translated strings", "locale_admin", locale_help("admin/locale/translated"));
+        menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin", locale_help("admin/locale/untranslated"));
+      }
     }
   }
 }
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index 873865bd05b2..fff214eecd35 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -69,18 +69,20 @@ function locale_perm() {
 function locale_link($type) {
   global $languages;
 
-  if ($type == "admin" && user_access("administer locales")) {
-
-    menu("admin/locale", "localization", NULL, locale_help("admin/locale"), 5);
-    menu("admin/locale/search", "search string", "locale_admin", locale_help("admin/locale/search"), 8);
-    menu("admin/locale/help", "help", "locale_help", NULL, 9);
-    menu("admin/locale/edit", "edit string", "locale_admin", NULL, 0, 1); // hidden menu
-    menu("admin/locale/delete", "delete string", "locale_admin", NULL, 0, 1); // hidden menu
-
-    foreach ($languages as $key => $value) {
-      menu("admin/locale/$key", "$value", NULL, locale_help("admin/locale"));
-      menu("admin/locale/$key/translated", "translated strings", "locale_admin", locale_help("admin/locale/translated"));
-      menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin", locale_help("admin/locale/untranslated"));
+  if ($type == "system") {
+    if (user_access("administer locales")) {
+
+      menu("admin/locale", "localization", NULL, locale_help("admin/locale"), 5);
+      menu("admin/locale/search", "search string", "locale_admin", locale_help("admin/locale/search"), 8);
+      menu("admin/locale/help", "help", "locale_help", NULL, 9);
+      menu("admin/locale/edit", "edit string", "locale_admin", NULL, 0, 1); // hidden menu
+      menu("admin/locale/delete", "delete string", "locale_admin", NULL, 0, 1); // hidden menu
+
+      foreach ($languages as $key => $value) {
+        menu("admin/locale/$key", "$value", NULL, locale_help("admin/locale"));
+        menu("admin/locale/$key/translated", "translated strings", "locale_admin", locale_help("admin/locale/translated"));
+        menu("admin/locale/$key/untranslated", "untranslated strings", "locale_admin", locale_help("admin/locale/untranslated"));
+      }
     }
   }
 }
diff --git a/modules/node.module b/modules/node.module
index f2e8ffb87170..d4b985eaab74 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -570,13 +570,14 @@ function node_link($type, $node = 0, $main = 0) {
     }
   }
 
-  if ($type == "admin" && user_access("administer nodes")) {
-
-    menu("admin/node", "content management", "node_admin", node_help("admin/node"));
-    menu("admin/node/search", "search posts", "node_admin", node_help("admin/node/search"), 8);
-    menu("admin/node/help", "help", "node_help", NULL, 9);
-    menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
-    menu("admin/node/settings", "content settings", "node_admin", node_help("admin/node/settings"), 8);
+  if ($type == "system") {
+    if (user_access("administer nodes")) {
+      menu("admin/node", "content management", "node_admin", node_help("admin/node"));
+      menu("admin/node/search", "search posts", "node_admin", node_help("admin/node/search"), 8);
+      menu("admin/node/help", "help", "node_help", NULL, 9);
+      menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
+      menu("admin/node/settings", "content settings", "node_admin", node_help("admin/node/settings"), 8);
+    }
   }
 
   return $links;
diff --git a/modules/node/node.module b/modules/node/node.module
index f2e8ffb87170..d4b985eaab74 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -570,13 +570,14 @@ function node_link($type, $node = 0, $main = 0) {
     }
   }
 
-  if ($type == "admin" && user_access("administer nodes")) {
-
-    menu("admin/node", "content management", "node_admin", node_help("admin/node"));
-    menu("admin/node/search", "search posts", "node_admin", node_help("admin/node/search"), 8);
-    menu("admin/node/help", "help", "node_help", NULL, 9);
-    menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
-    menu("admin/node/settings", "content settings", "node_admin", node_help("admin/node/settings"), 8);
+  if ($type == "system") {
+    if (user_access("administer nodes")) {
+      menu("admin/node", "content management", "node_admin", node_help("admin/node"));
+      menu("admin/node/search", "search posts", "node_admin", node_help("admin/node/search"), 8);
+      menu("admin/node/help", "help", "node_help", NULL, 9);
+      menu("admin/node/edit", "edit node", "node_admin", NULL, 0, 1);
+      menu("admin/node/settings", "content settings", "node_admin", node_help("admin/node/settings"), 8);
+    }
   }
 
   return $links;
diff --git a/modules/page.module b/modules/page.module
index 842f90e14a6c..f03699ccece7 100644
--- a/modules/page.module
+++ b/modules/page.module
@@ -95,8 +95,10 @@ function page_link($type) {
     }
   }
 
-  if ($type == "menu.create" && user_access("maintain static pages")) {
-    $links[] = l(t("create static page"), "node/add/page", array("title" => t("Add a new static page.")));
+  if ($type == "system") {
+    if (user_access("maintain static pages")) {
+      menu("node/add/page", t("create static page"), NULL, NULL, 0);
+    }
   }
 
   return $links;
diff --git a/modules/page/page.module b/modules/page/page.module
index 842f90e14a6c..f03699ccece7 100644
--- a/modules/page/page.module
+++ b/modules/page/page.module
@@ -95,8 +95,10 @@ function page_link($type) {
     }
   }
 
-  if ($type == "menu.create" && user_access("maintain static pages")) {
-    $links[] = l(t("create static page"), "node/add/page", array("title" => t("Add a new static page.")));
+  if ($type == "system") {
+    if (user_access("maintain static pages")) {
+      menu("node/add/page", t("create static page"), NULL, NULL, 0);
+    }
   }
 
   return $links;
diff --git a/modules/poll.module b/modules/poll.module
index b93cdbb8d68e..36a903bd56e5 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -161,8 +161,10 @@ function poll_insert($node) {
 function poll_link($type, $node = 0, $main) {
   $links = array();
 
-  if ($type == "menu.create" && user_access("create polls")) {
-    $links[] = l(t("create poll"), "node/add/poll", array("title" => t("Add a new poll.")));
+  if ($type == "system") {
+    if (user_access("create polls")) {
+      menu("node/add/poll",t("create poll"), NULL, NULL, 0);
+    }
   }
   else if ($type == "page" && user_access("access content")) {
     $links[] = l(t("polls"), "poll", array("title" => t("View the list of polls on this site.")));
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index b93cdbb8d68e..36a903bd56e5 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -161,8 +161,10 @@ function poll_insert($node) {
 function poll_link($type, $node = 0, $main) {
   $links = array();
 
-  if ($type == "menu.create" && user_access("create polls")) {
-    $links[] = l(t("create poll"), "node/add/poll", array("title" => t("Add a new poll.")));
+  if ($type == "system") {
+    if (user_access("create polls")) {
+      menu("node/add/poll",t("create poll"), NULL, NULL, 0);
+    }
   }
   else if ($type == "page" && user_access("access content")) {
     $links[] = l(t("polls"), "poll", array("title" => t("View the list of polls on this site.")));
diff --git a/modules/queue.module b/modules/queue.module
index aa4cf30be1ba..50745ac16814 100644
--- a/modules/queue.module
+++ b/modules/queue.module
@@ -42,8 +42,10 @@ function queue_perm() {
 }
 
 function queue_link($type) {
-  if ($type == "menu.view" && user_access("access submission queue")) {
-    $links[] = l(t("view submissions"), "queue", array("title" => t("Moderate the content in the submission queue."))) ." (<span class=\"queue-user-numeral\">". queue_count() ."</span>)";
+  if ($type == "system") {
+    if (user_access("access submission queue")) {
+      menu("queue", t("view submissions"), NULL, NULL, 1);
+    }
   }
 
   return $links ? $links : array();
diff --git a/modules/statistics.module b/modules/statistics.module
index 14d12f4d5532..cbe1a2f988e6 100644
--- a/modules/statistics.module
+++ b/modules/statistics.module
@@ -114,22 +114,24 @@ function statistics_link($type, $node = 0, $main = 0) {
     }
   }
 
-  if ($type == "admin" && (user_access("administer statistics module") || (user_access("administer statistics")))) {
-
-    menu("admin/statistics", "site statistics", "statistics_admin", statistics_help("admin/statistics"), 6);
-    menu("admin/statistics/referrers", "referrer log", "statistics_admin", statistics_help("admin/statistics/referrers") );
-    menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/internal") );
-    menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/external") );
-    menu("admin/statistics/log", "access log", "statistics_admin", statistics_help("admin/statistics/log") );
-    menu("admin/statistics/log/node", "track node", "statistics_admin", statistics_help("admin/statistics/log/node"), 0, 1); //hidden
-    menu("admin/statistics/log/user", "track user", "statistics_admin", statistics_help("admin/statistics/log/user"), 0, 1); //hidden
-    menu("admin/statistics/log/host", "track host", "statistics_admin", statistics_help("admin/statistics/log/host"), 0, 1); //hidden
-    menu("admin/statistics/top nodes page", "configure 'top nodes' page", "statistics_admin", statistics_help("admin/statistics/top nodes page"), 5);
-    menu("admin/statistics/help", "help", "statistics_help", NULL, 9);
-
-    // block configuration:
-    menu("admin/block/top nodes block", "configure 'top nodes' block", "statistics_admin", statistics_help("admin/block/top nodes/block"), 5);
-    menu("admin/block/whos online block", "configure 'who is online' block", "statistics_admin", statistics_help("admin/block/whos online block"), 5);
+  if ($type == "system") {
+    if ((user_access("administer statistics module") || (user_access("administer statistics")))) {
+
+      menu("admin/statistics", "site statistics", "statistics_admin", statistics_help("admin/statistics"), 6);
+      menu("admin/statistics/referrers", "referrer log", "statistics_admin", statistics_help("admin/statistics/referrers") );
+      menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/internal") );
+      menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/external") );
+      menu("admin/statistics/log", "access log", "statistics_admin", statistics_help("admin/statistics/log") );
+      menu("admin/statistics/log/node", "track node", "statistics_admin", statistics_help("admin/statistics/log/node"), 0, 1); //hidden
+      menu("admin/statistics/log/user", "track user", "statistics_admin", statistics_help("admin/statistics/log/user"), 0, 1); //hidden
+      menu("admin/statistics/log/host", "track host", "statistics_admin", statistics_help("admin/statistics/log/host"), 0, 1); //hidden
+      menu("admin/statistics/top nodes page", "configure 'top nodes' page", "statistics_admin", statistics_help("admin/statistics/top nodes page"), 5);
+      menu("admin/statistics/help", "help", "statistics_help", NULL, 9);
+
+      // block configuration:
+      menu("admin/block/top nodes block", "configure 'top nodes' block", "statistics_admin", statistics_help("admin/block/top nodes/block"), 5);
+      menu("admin/block/whos online block", "configure 'who is online' block", "statistics_admin", statistics_help("admin/block/whos online block"), 5);
+    }
   }
 
   return $links;
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index 14d12f4d5532..cbe1a2f988e6 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -114,22 +114,24 @@ function statistics_link($type, $node = 0, $main = 0) {
     }
   }
 
-  if ($type == "admin" && (user_access("administer statistics module") || (user_access("administer statistics")))) {
-
-    menu("admin/statistics", "site statistics", "statistics_admin", statistics_help("admin/statistics"), 6);
-    menu("admin/statistics/referrers", "referrer log", "statistics_admin", statistics_help("admin/statistics/referrers") );
-    menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/internal") );
-    menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/external") );
-    menu("admin/statistics/log", "access log", "statistics_admin", statistics_help("admin/statistics/log") );
-    menu("admin/statistics/log/node", "track node", "statistics_admin", statistics_help("admin/statistics/log/node"), 0, 1); //hidden
-    menu("admin/statistics/log/user", "track user", "statistics_admin", statistics_help("admin/statistics/log/user"), 0, 1); //hidden
-    menu("admin/statistics/log/host", "track host", "statistics_admin", statistics_help("admin/statistics/log/host"), 0, 1); //hidden
-    menu("admin/statistics/top nodes page", "configure 'top nodes' page", "statistics_admin", statistics_help("admin/statistics/top nodes page"), 5);
-    menu("admin/statistics/help", "help", "statistics_help", NULL, 9);
-
-    // block configuration:
-    menu("admin/block/top nodes block", "configure 'top nodes' block", "statistics_admin", statistics_help("admin/block/top nodes/block"), 5);
-    menu("admin/block/whos online block", "configure 'who is online' block", "statistics_admin", statistics_help("admin/block/whos online block"), 5);
+  if ($type == "system") {
+    if ((user_access("administer statistics module") || (user_access("administer statistics")))) {
+
+      menu("admin/statistics", "site statistics", "statistics_admin", statistics_help("admin/statistics"), 6);
+      menu("admin/statistics/referrers", "referrer log", "statistics_admin", statistics_help("admin/statistics/referrers") );
+      menu("admin/statistics/referrers/internal", "internal referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/internal") );
+      menu("admin/statistics/referrers/external", "external referrers only", "statistics_admin", statistics_help("admin/statistics/referrers/external") );
+      menu("admin/statistics/log", "access log", "statistics_admin", statistics_help("admin/statistics/log") );
+      menu("admin/statistics/log/node", "track node", "statistics_admin", statistics_help("admin/statistics/log/node"), 0, 1); //hidden
+      menu("admin/statistics/log/user", "track user", "statistics_admin", statistics_help("admin/statistics/log/user"), 0, 1); //hidden
+      menu("admin/statistics/log/host", "track host", "statistics_admin", statistics_help("admin/statistics/log/host"), 0, 1); //hidden
+      menu("admin/statistics/top nodes page", "configure 'top nodes' page", "statistics_admin", statistics_help("admin/statistics/top nodes page"), 5);
+      menu("admin/statistics/help", "help", "statistics_help", NULL, 9);
+
+      // block configuration:
+      menu("admin/block/top nodes block", "configure 'top nodes' block", "statistics_admin", statistics_help("admin/block/top nodes/block"), 5);
+      menu("admin/block/whos online block", "configure 'who is online' block", "statistics_admin", statistics_help("admin/block/whos online block"), 5);
+    }
   }
 
   return $links;
diff --git a/modules/story.module b/modules/story.module
index f58fa43815bf..0d00a1e9f473 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -54,8 +54,10 @@ function story_access($op, $node) {
 function story_link($type) {
   $links = array();
 
-  if ($type == "menu.create" && user_access("create stories")) {
-    $links[] = l(t("create story"), "node/add/story", array("title" => t("Add a new story.")));
+  if ($type == "system") {
+    if (user_access("create stories")) {
+      menu("node/add/story", t("create story"), NULL, NULL, 0);
+    }
   }
 
   return $links;
diff --git a/modules/story/story.module b/modules/story/story.module
index f58fa43815bf..0d00a1e9f473 100644
--- a/modules/story/story.module
+++ b/modules/story/story.module
@@ -54,8 +54,10 @@ function story_access($op, $node) {
 function story_link($type) {
   $links = array();
 
-  if ($type == "menu.create" && user_access("create stories")) {
-    $links[] = l(t("create story"), "node/add/story", array("title" => t("Add a new story.")));
+  if ($type == "system") {
+    if (user_access("create stories")) {
+      menu("node/add/story", t("create story"), NULL, NULL, 0);
+    }
   }
 
   return $links;
diff --git a/modules/system.module b/modules/system.module
index 689b8ad8bf5d..68259f334b90 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -52,33 +52,35 @@ function system_perm() {
 }
 
 function system_link($type) {
-  if ($type == "admin" && user_access("administer site configuration")) {
-    $help["general"] = t("General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.");
-    $help["themes"] = t("Select which themes are available to your users and specify the default theme.");
-    $help["modules"] = t("Modules are plugins for Drupal that extend its core functionality.  Here you can select which modules are enabled. On the left hand side click on the name of the module for their individual configurations.  Once a module is enabled, you will need to grant permissions to users in user management.");
-    $help["filters"] = t("Filters fit between the raw text in a node and the HTML output. They allow you to replace text selectively. Uses include automatic conversion of emoticons into graphics and filtering HTML content from users' submissions.");
-
-    menu("admin/system", "site configuration", "system_admin", system_help("admin/system"), 3);
-    menu("admin/system/themes", "themes", "system_admin", system_help("admin/system/themes"), 2);
-
-    foreach (theme_list(1) as $theme) {
-      // NOTE: refresh the list because some themes might have been enabled/disabled.
-      include_once "$theme->filename";
-      $function = $theme->name ."_settings";
-      if (function_exists($function)) {
-        menu("admin/system/themes/$theme->name", $theme->name, "system_admin");
+  if ($type == "system") {
+    if (user_access("administer site configuration")) {
+      $help["general"] = t("General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.");
+      $help["themes"] = t("Select which themes are available to your users and specify the default theme.");
+      $help["modules"] = t("Modules are plugins for Drupal that extend its core functionality.  Here you can select which modules are enabled. On the left hand side click on the name of the module for their individual configurations.  Once a module is enabled, you will need to grant permissions to users in user management.");
+      $help["filters"] = t("Filters fit between the raw text in a node and the HTML output. They allow you to replace text selectively. Uses include automatic conversion of emoticons into graphics and filtering HTML content from users' submissions.");
+
+      menu("admin/system", "site configuration", "system_admin", system_help("admin/system"), 3);
+      menu("admin/system/themes", "themes", "system_admin", system_help("admin/system/themes"), 2);
+
+      foreach (theme_list(1) as $theme) {
+        // NOTE: refresh the list because some themes might have been enabled/disabled.
+        include_once "$theme->filename";
+        $function = $theme->name ."_settings";
+        if (function_exists($function)) {
+          menu("admin/system/themes/$theme->name", $theme->name, "system_admin");
+        }
       }
-    }
 
-    menu("admin/system/modules", "modules", "system_admin", system_help("admin/system/modules"), 3);
-    foreach (module_list(1) as $name) {
-      // NOTE: refresh the list because some modules might have been enabled/disabled.
-      if (module_hook($name, "settings")) {
-        menu("admin/system/modules/$name", $name, "system_admin", module_invoke($name, "system", "admin_help"));
+      menu("admin/system/modules", "modules", "system_admin", system_help("admin/system/modules"), 3);
+      foreach (module_list(1) as $name) {
+        // NOTE: refresh the list because some modules might have been enabled/disabled.
+        if (module_hook($name, "settings")) {
+          menu("admin/system/modules/$name", $name, "system_admin", module_invoke($name, "system", "admin_help"));
+        }
       }
+      menu("admin/system/filters", "filters", "system_admin", system_help("admin/system/filters"), 4);
+      menu("admin/system/help", "help", "system_help", NULL, 9);
     }
-    menu("admin/system/filters", "filters", "system_admin", system_help("admin/system/filters"), 4);
-    menu("admin/system/help", "help", "system_help", NULL, 9);
   }
 }
 
diff --git a/modules/system/system.module b/modules/system/system.module
index 689b8ad8bf5d..68259f334b90 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -52,33 +52,35 @@ function system_perm() {
 }
 
 function system_link($type) {
-  if ($type == "admin" && user_access("administer site configuration")) {
-    $help["general"] = t("General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.");
-    $help["themes"] = t("Select which themes are available to your users and specify the default theme.");
-    $help["modules"] = t("Modules are plugins for Drupal that extend its core functionality.  Here you can select which modules are enabled. On the left hand side click on the name of the module for their individual configurations.  Once a module is enabled, you will need to grant permissions to users in user management.");
-    $help["filters"] = t("Filters fit between the raw text in a node and the HTML output. They allow you to replace text selectively. Uses include automatic conversion of emoticons into graphics and filtering HTML content from users' submissions.");
-
-    menu("admin/system", "site configuration", "system_admin", system_help("admin/system"), 3);
-    menu("admin/system/themes", "themes", "system_admin", system_help("admin/system/themes"), 2);
-
-    foreach (theme_list(1) as $theme) {
-      // NOTE: refresh the list because some themes might have been enabled/disabled.
-      include_once "$theme->filename";
-      $function = $theme->name ."_settings";
-      if (function_exists($function)) {
-        menu("admin/system/themes/$theme->name", $theme->name, "system_admin");
+  if ($type == "system") {
+    if (user_access("administer site configuration")) {
+      $help["general"] = t("General configuration options for your site. Set up the name of the site, e-mail address used in mail-outs, clean URL options, caching, etc.");
+      $help["themes"] = t("Select which themes are available to your users and specify the default theme.");
+      $help["modules"] = t("Modules are plugins for Drupal that extend its core functionality.  Here you can select which modules are enabled. On the left hand side click on the name of the module for their individual configurations.  Once a module is enabled, you will need to grant permissions to users in user management.");
+      $help["filters"] = t("Filters fit between the raw text in a node and the HTML output. They allow you to replace text selectively. Uses include automatic conversion of emoticons into graphics and filtering HTML content from users' submissions.");
+
+      menu("admin/system", "site configuration", "system_admin", system_help("admin/system"), 3);
+      menu("admin/system/themes", "themes", "system_admin", system_help("admin/system/themes"), 2);
+
+      foreach (theme_list(1) as $theme) {
+        // NOTE: refresh the list because some themes might have been enabled/disabled.
+        include_once "$theme->filename";
+        $function = $theme->name ."_settings";
+        if (function_exists($function)) {
+          menu("admin/system/themes/$theme->name", $theme->name, "system_admin");
+        }
       }
-    }
 
-    menu("admin/system/modules", "modules", "system_admin", system_help("admin/system/modules"), 3);
-    foreach (module_list(1) as $name) {
-      // NOTE: refresh the list because some modules might have been enabled/disabled.
-      if (module_hook($name, "settings")) {
-        menu("admin/system/modules/$name", $name, "system_admin", module_invoke($name, "system", "admin_help"));
+      menu("admin/system/modules", "modules", "system_admin", system_help("admin/system/modules"), 3);
+      foreach (module_list(1) as $name) {
+        // NOTE: refresh the list because some modules might have been enabled/disabled.
+        if (module_hook($name, "settings")) {
+          menu("admin/system/modules/$name", $name, "system_admin", module_invoke($name, "system", "admin_help"));
+        }
       }
+      menu("admin/system/filters", "filters", "system_admin", system_help("admin/system/filters"), 4);
+      menu("admin/system/help", "help", "system_help", NULL, 9);
     }
-    menu("admin/system/filters", "filters", "system_admin", system_help("admin/system/filters"), 4);
-    menu("admin/system/help", "help", "system_help", NULL, 9);
   }
 }
 
diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index df46f6624d86..19acb7dab98e 100644
--- a/modules/taxonomy.module
+++ b/modules/taxonomy.module
@@ -27,10 +27,12 @@ function taxonomy_perm() {
 }
 
 function taxonomy_link($type, $node = NULL) {
-  if ($type == "admin" && user_access("administer taxonomy")) {
-    menu("admin/taxonomy", "taxonomy", "taxonomy_admin", taxonomy_help("admin/taxonomy"), 3);
-    menu("admin/taxonomy/add/vocabulary", "create new vocabulary", "taxonomy_admin", taxonomy_help("admin/taxonomy/add/vocabulary"));
-    menu("admin/taxonomy/help", "help", "taxonomy_admin", NULL, 9);
+  if ($type == "system") {
+    if (user_access("administer taxonomy")) {
+      menu("admin/taxonomy", "taxonomy", "taxonomy_admin", taxonomy_help("admin/taxonomy"), 3);
+      menu("admin/taxonomy/add/vocabulary", "create new vocabulary", "taxonomy_admin", taxonomy_help("admin/taxonomy/add/vocabulary"));
+      menu("admin/taxonomy/help", "help", "taxonomy_admin", NULL, 9);
+    }
   }
   else if ($type == "taxonomy terms" && $node != NULL) {
 
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index df46f6624d86..19acb7dab98e 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -27,10 +27,12 @@ function taxonomy_perm() {
 }
 
 function taxonomy_link($type, $node = NULL) {
-  if ($type == "admin" && user_access("administer taxonomy")) {
-    menu("admin/taxonomy", "taxonomy", "taxonomy_admin", taxonomy_help("admin/taxonomy"), 3);
-    menu("admin/taxonomy/add/vocabulary", "create new vocabulary", "taxonomy_admin", taxonomy_help("admin/taxonomy/add/vocabulary"));
-    menu("admin/taxonomy/help", "help", "taxonomy_admin", NULL, 9);
+  if ($type == "system") {
+    if (user_access("administer taxonomy")) {
+      menu("admin/taxonomy", "taxonomy", "taxonomy_admin", taxonomy_help("admin/taxonomy"), 3);
+      menu("admin/taxonomy/add/vocabulary", "create new vocabulary", "taxonomy_admin", taxonomy_help("admin/taxonomy/add/vocabulary"));
+      menu("admin/taxonomy/help", "help", "taxonomy_admin", NULL, 9);
+    }
   }
   else if ($type == "taxonomy terms" && $node != NULL) {
 
diff --git a/modules/tracker.module b/modules/tracker.module
index 628d0abd2d70..bd5035c4ee5a 100644
--- a/modules/tracker.module
+++ b/modules/tracker.module
@@ -18,8 +18,10 @@ function tracker_link($type) {
 
   $links = array();
 
-  if ($type == "menu.view" && user_access("access content")) {
-    $links[] = l(t("view recent posts"), "tracker", array("title" => t("Display an overview of the recent posts.")));
+  if ($type == "system") {
+    if (user_access("access content")) {
+      menu("tracker", t("view recent posts"), NULL, NULL, 1);
+    }
   }
 
   return $links;
@@ -106,4 +108,4 @@ function tracker_page() {
   }
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module
index 628d0abd2d70..bd5035c4ee5a 100644
--- a/modules/tracker/tracker.module
+++ b/modules/tracker/tracker.module
@@ -18,8 +18,10 @@ function tracker_link($type) {
 
   $links = array();
 
-  if ($type == "menu.view" && user_access("access content")) {
-    $links[] = l(t("view recent posts"), "tracker", array("title" => t("Display an overview of the recent posts.")));
+  if ($type == "system") {
+    if (user_access("access content")) {
+      menu("tracker", t("view recent posts"), NULL, NULL, 1);
+    }
   }
 
   return $links;
@@ -106,4 +108,4 @@ function tracker_page() {
   }
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/modules/user.module b/modules/user.module
index 669a244d7f12..35c8fcf61bde 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -427,15 +427,11 @@ function user_block($op = "list", $delta = 0) {
         break;
       case 1:
         if ($user->uid) {
-          $output = "<div class=\"user-information-block\">\n";
-          $output .= theme("theme_menu_list", module_invoke_all("link", "menu.create"));
-          $output .= theme("theme_menu_list", module_invoke_all("link", "menu.view"));
-          $output .= theme("theme_menu_list", module_invoke_all("link", "menu.settings"));
-          $output .= theme("theme_menu_list", module_invoke_all("link", "menu.misc"));
-          $output .= "</div>\n";
 
           $block["subject"] = $user->name;
-          $block["content"] = "<div class=\"user-login-link\">$output</div>";
+          menu_build("system");
+          $block["content"] .= "<div id=\"menu\">". menu_tree()."</div>";
+
           return $block;
         }
         break;
@@ -472,35 +468,27 @@ function user_link($type) {
     $links[] = l(t("user account"), "user", array("title" => t("Create a user account, request a new password or edit your account settings.")));
   }
 
-  if ($type == "menu.settings") {
-    $links[] = l(t("edit account"), "user/edit", array("title" => t("View and edit your account information.")));
-  }
-
-  if ($type == "menu.misc") {
-    if (user_access("access administration pages")) {
-      $links[] = l(t("administer %a", array("%a" => variable_get("site_name", "drupal"))), "admin", array("title" => t("Access administration pages.")));
-    }
-
-    $links[] = l(t("logout"), "user/logout", array("title" => t("Logout.")));
-  }
-
-  if ($type == "admin" && user_access("administer users")) {
-    menu("admin/user", "user management", "user_admin", user_help("admin/user"), 2);
-    menu("admin/user/create", "create new account", "user_admin", user_help("admin/user/create"), 1);
-    menu("admin/user/account", "view user accounts", "user_admin", user_help("admin/user/account"), 2);
-    menu("admin/user/access", "access rules", NULL, user_help("admin/user/access"), 3);
-    menu("admin/user/access/mail", "e-mail rules", "user_admin", user_help("admin/user/access/mail"));
-    menu("admin/user/access/user", "username rules", "user_admin", user_help("admin/user/access/user"));
-    menu("admin/user/role", "user roles", "user_admin", user_help("admin/user/role"), 4);
-    menu("admin/user/permission", "user permissions", "user_admin", user_help("admin/user/permission"), 5);
-    menu("admin/user/search", "search accounts", "user_admin", user_help("admin/user/search"), 8);
-    menu("admin/user/help", "help", "user_help", NULL, 9);
-    menu("admin/user/edit", "edit user account", "user_admin", NULL, 0, 1); // hidden menu
-    menu("admin/user/account/1", "blocked users", "user_admin", user_help("admin/user/account/1"), 3);
-
-    $i = 2;
-    foreach (user_roles(1) as $key => $value) {
-      menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", NULL, 4);
+  if ($type == "system") {
+    menu("user/edit", t("edit account"), NULL, NULL, 8);
+    menu("user/logout", t("logout"), NULL, NULL, 10);
+    if (user_access("administer users")) {
+      menu("admin/user", "user management", "user_admin", user_help("admin/user"), 2);
+      menu("admin/user/create", "create new account", "user_admin", user_help("admin/user/create"), 1);
+      menu("admin/user/account", "view user accounts", "user_admin", user_help("admin/user/account"), 2);
+      menu("admin/user/access", "access rules", NULL, user_help("admin/user/access"), 3);
+      menu("admin/user/access/mail", "e-mail rules", "user_admin", user_help("admin/user/access/mail"));
+      menu("admin/user/access/user", "username rules", "user_admin", user_help("admin/user/access/user"));
+      menu("admin/user/role", "user roles", "user_admin", user_help("admin/user/role"), 4);
+      menu("admin/user/permission", "user permissions", "user_admin", user_help("admin/user/permission"), 5);
+      menu("admin/user/search", "search accounts", "user_admin", user_help("admin/user/search"), 8);
+      menu("admin/user/help", "help", "user_help", NULL, 9);
+      menu("admin/user/edit", "edit user account", "user_admin", NULL, 0, 1); // hidden menu
+      menu("admin/user/account/1", "blocked users", "user_admin", user_help("admin/user/account/1"), 3);
+
+      $i = 2;
+      foreach (user_roles(1) as $key => $value) {
+        menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", NULL, 4);
+      }
     }
   }
 
diff --git a/modules/user/user.module b/modules/user/user.module
index 669a244d7f12..35c8fcf61bde 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -427,15 +427,11 @@ function user_block($op = "list", $delta = 0) {
         break;
       case 1:
         if ($user->uid) {
-          $output = "<div class=\"user-information-block\">\n";
-          $output .= theme("theme_menu_list", module_invoke_all("link", "menu.create"));
-          $output .= theme("theme_menu_list", module_invoke_all("link", "menu.view"));
-          $output .= theme("theme_menu_list", module_invoke_all("link", "menu.settings"));
-          $output .= theme("theme_menu_list", module_invoke_all("link", "menu.misc"));
-          $output .= "</div>\n";
 
           $block["subject"] = $user->name;
-          $block["content"] = "<div class=\"user-login-link\">$output</div>";
+          menu_build("system");
+          $block["content"] .= "<div id=\"menu\">". menu_tree()."</div>";
+
           return $block;
         }
         break;
@@ -472,35 +468,27 @@ function user_link($type) {
     $links[] = l(t("user account"), "user", array("title" => t("Create a user account, request a new password or edit your account settings.")));
   }
 
-  if ($type == "menu.settings") {
-    $links[] = l(t("edit account"), "user/edit", array("title" => t("View and edit your account information.")));
-  }
-
-  if ($type == "menu.misc") {
-    if (user_access("access administration pages")) {
-      $links[] = l(t("administer %a", array("%a" => variable_get("site_name", "drupal"))), "admin", array("title" => t("Access administration pages.")));
-    }
-
-    $links[] = l(t("logout"), "user/logout", array("title" => t("Logout.")));
-  }
-
-  if ($type == "admin" && user_access("administer users")) {
-    menu("admin/user", "user management", "user_admin", user_help("admin/user"), 2);
-    menu("admin/user/create", "create new account", "user_admin", user_help("admin/user/create"), 1);
-    menu("admin/user/account", "view user accounts", "user_admin", user_help("admin/user/account"), 2);
-    menu("admin/user/access", "access rules", NULL, user_help("admin/user/access"), 3);
-    menu("admin/user/access/mail", "e-mail rules", "user_admin", user_help("admin/user/access/mail"));
-    menu("admin/user/access/user", "username rules", "user_admin", user_help("admin/user/access/user"));
-    menu("admin/user/role", "user roles", "user_admin", user_help("admin/user/role"), 4);
-    menu("admin/user/permission", "user permissions", "user_admin", user_help("admin/user/permission"), 5);
-    menu("admin/user/search", "search accounts", "user_admin", user_help("admin/user/search"), 8);
-    menu("admin/user/help", "help", "user_help", NULL, 9);
-    menu("admin/user/edit", "edit user account", "user_admin", NULL, 0, 1); // hidden menu
-    menu("admin/user/account/1", "blocked users", "user_admin", user_help("admin/user/account/1"), 3);
-
-    $i = 2;
-    foreach (user_roles(1) as $key => $value) {
-      menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", NULL, 4);
+  if ($type == "system") {
+    menu("user/edit", t("edit account"), NULL, NULL, 8);
+    menu("user/logout", t("logout"), NULL, NULL, 10);
+    if (user_access("administer users")) {
+      menu("admin/user", "user management", "user_admin", user_help("admin/user"), 2);
+      menu("admin/user/create", "create new account", "user_admin", user_help("admin/user/create"), 1);
+      menu("admin/user/account", "view user accounts", "user_admin", user_help("admin/user/account"), 2);
+      menu("admin/user/access", "access rules", NULL, user_help("admin/user/access"), 3);
+      menu("admin/user/access/mail", "e-mail rules", "user_admin", user_help("admin/user/access/mail"));
+      menu("admin/user/access/user", "username rules", "user_admin", user_help("admin/user/access/user"));
+      menu("admin/user/role", "user roles", "user_admin", user_help("admin/user/role"), 4);
+      menu("admin/user/permission", "user permissions", "user_admin", user_help("admin/user/permission"), 5);
+      menu("admin/user/search", "search accounts", "user_admin", user_help("admin/user/search"), 8);
+      menu("admin/user/help", "help", "user_help", NULL, 9);
+      menu("admin/user/edit", "edit user account", "user_admin", NULL, 0, 1); // hidden menu
+      menu("admin/user/account/1", "blocked users", "user_admin", user_help("admin/user/account/1"), 3);
+
+      $i = 2;
+      foreach (user_roles(1) as $key => $value) {
+        menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", NULL, 4);
+      }
     }
   }
 
diff --git a/modules/watchdog.module b/modules/watchdog.module
index 238479200c8d..6cf9ec52db68 100644
--- a/modules/watchdog.module
+++ b/modules/watchdog.module
@@ -45,15 +45,17 @@ function watchdog_perm() {
 }
 
 function watchdog_link($type) {
-  if ($type == "admin" && user_access("administer watchdog")) {
-    menu("admin/watchdog", "site monitoring", "watchdog_admin", watchdog_help("admin/watchdog"), 6);
-    menu("admin/watchdog/user", "user messages", "watchdog_admin", watchdog_help("admin/watchdog/user"));
-    menu("admin/watchdog/regular", "regular messages", "watchdog_admin", watchdog_help("admin/watchdog/regular"));
-    menu("admin/watchdog/special", "special messages", "watchdog_admin", watchdog_help("admin/watchdog/special"));
-    menu("admin/watchdog/warning", "warning messages", "watchdog_admin", watchdog_help("admin/watchdog/warning"));
-    menu("admin/watchdog/error", "error messages", "watchdog_admin", watchdog_help("admin/watchdog/error"));
-    menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", watchdog_help("admin/watchdog/httpd"));
-    menu("admin/watchdog/view", "view details", "watchdog_admin", NULL, 0, 1); // hidden menu
+  if ($type == "system") {
+    if (user_access("administer watchdog")) {
+      menu("admin/watchdog", "site monitoring", "watchdog_admin", watchdog_help("admin/watchdog"), 6);
+      menu("admin/watchdog/user", "user messages", "watchdog_admin", watchdog_help("admin/watchdog/user"));
+      menu("admin/watchdog/regular", "regular messages", "watchdog_admin", watchdog_help("admin/watchdog/regular"));
+      menu("admin/watchdog/special", "special messages", "watchdog_admin", watchdog_help("admin/watchdog/special"));
+      menu("admin/watchdog/warning", "warning messages", "watchdog_admin", watchdog_help("admin/watchdog/warning"));
+      menu("admin/watchdog/error", "error messages", "watchdog_admin", watchdog_help("admin/watchdog/error"));
+      menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", watchdog_help("admin/watchdog/httpd"));
+      menu("admin/watchdog/view", "view details", "watchdog_admin", NULL, 0, 1); // hidden menu
+    }
   }
 }
 
diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module
index 238479200c8d..6cf9ec52db68 100644
--- a/modules/watchdog/watchdog.module
+++ b/modules/watchdog/watchdog.module
@@ -45,15 +45,17 @@ function watchdog_perm() {
 }
 
 function watchdog_link($type) {
-  if ($type == "admin" && user_access("administer watchdog")) {
-    menu("admin/watchdog", "site monitoring", "watchdog_admin", watchdog_help("admin/watchdog"), 6);
-    menu("admin/watchdog/user", "user messages", "watchdog_admin", watchdog_help("admin/watchdog/user"));
-    menu("admin/watchdog/regular", "regular messages", "watchdog_admin", watchdog_help("admin/watchdog/regular"));
-    menu("admin/watchdog/special", "special messages", "watchdog_admin", watchdog_help("admin/watchdog/special"));
-    menu("admin/watchdog/warning", "warning messages", "watchdog_admin", watchdog_help("admin/watchdog/warning"));
-    menu("admin/watchdog/error", "error messages", "watchdog_admin", watchdog_help("admin/watchdog/error"));
-    menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", watchdog_help("admin/watchdog/httpd"));
-    menu("admin/watchdog/view", "view details", "watchdog_admin", NULL, 0, 1); // hidden menu
+  if ($type == "system") {
+    if (user_access("administer watchdog")) {
+      menu("admin/watchdog", "site monitoring", "watchdog_admin", watchdog_help("admin/watchdog"), 6);
+      menu("admin/watchdog/user", "user messages", "watchdog_admin", watchdog_help("admin/watchdog/user"));
+      menu("admin/watchdog/regular", "regular messages", "watchdog_admin", watchdog_help("admin/watchdog/regular"));
+      menu("admin/watchdog/special", "special messages", "watchdog_admin", watchdog_help("admin/watchdog/special"));
+      menu("admin/watchdog/warning", "warning messages", "watchdog_admin", watchdog_help("admin/watchdog/warning"));
+      menu("admin/watchdog/error", "error messages", "watchdog_admin", watchdog_help("admin/watchdog/error"));
+      menu("admin/watchdog/httpd", "httpd messages", "watchdog_admin", watchdog_help("admin/watchdog/httpd"));
+      menu("admin/watchdog/view", "view details", "watchdog_admin", NULL, 0, 1); // hidden menu
+    }
   }
 }
 
-- 
GitLab