diff --git a/includes/menu.inc b/includes/menu.inc index 617e9ed2201ec7cc09040cda52d7f38cef4244b6..18a6e5aca254d994b17a435f5a19fd01c51f4ed5 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(" » ", $links); + return $links; } function menu_help() { diff --git a/misc/admin.css b/misc/admin.css deleted file mode 100644 index 219c8e8c74afec69f3f6be9cfe8c482bb8fd64ce..0000000000000000000000000000000000000000 --- 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 894a762b6d99043b88796102c392400d9f9ba319..936715445b6cad0c7b9a21ba9f06d527d5c78ab6 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 7018396922dc6e54839b48edc48648a8f7c4eaff..5ae2274fbea4061da3e150e5aa63d6efce2e41e6 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 38e54e7b8057a3ff817b0df9d3e9564ae1d86f24..dfe822804c36642ccd3342287ac9a3617a1f322e 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 e40cb368652ef4e510616d38874c240e8dbf3a94..3b120a244eff561fe7be7e50c4dd95b370fe07af 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 5af8a76c8af3b9de9befb65c707b8b01212d0272..1f2994d0f987c44014d4d56ff50dd44e4670770a 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 dab184fbd6a49eebdfe7c017a1d7ae87299918c7..4bb4431ec0d33b8598e33cda45858a4b82d47f6b 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 dab184fbd6a49eebdfe7c017a1d7ae87299918c7..4bb4431ec0d33b8598e33cda45858a4b82d47f6b 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 a1332619af89ac70e6302cca22a7874b7b8ff4a1..ac89366f6ff54eb60c699cbe6d828e03aa6c85fc 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 a1332619af89ac70e6302cca22a7874b7b8ff4a1..ac89366f6ff54eb60c699cbe6d828e03aa6c85fc 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 e664603340959836db39fa6dbfef60e23e2dd3dc..5f00f3d8a965b853de7b7ba37cbc8d69761af9bd 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 e664603340959836db39fa6dbfef60e23e2dd3dc..5f00f3d8a965b853de7b7ba37cbc8d69761af9bd 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 af0119679a3d08a804905406cbc25f9f8cf194c3..bebd9a24d23ee3b0aab6951fc1a3ecc8808b1649 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 af0119679a3d08a804905406cbc25f9f8cf194c3..bebd9a24d23ee3b0aab6951fc1a3ecc8808b1649 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 8895ade66f4b217640c2df6543afaf536dadaa34..4e6ea5f2538ea2b556d502f1419dd88d7a852c3a 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 43060e2a03ad818608462d21874ebbb846e8545d..5e40378a7c19a85f15476df81053ba8630e57714 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 43060e2a03ad818608462d21874ebbb846e8545d..5e40378a7c19a85f15476df81053ba8630e57714 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 157b37e0d5c3719a60028b3f490a374a14f43673..9719ba9e97b7173aeb338e9cdfd0f25d675466e3 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(" · ", $links) ."</small><hr />". $output; return $output; } diff --git a/modules/help/help.module b/modules/help/help.module index 157b37e0d5c3719a60028b3f490a374a14f43673..9719ba9e97b7173aeb338e9cdfd0f25d675466e3 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(" · ", $links) ."</small><hr />". $output; return $output; } diff --git a/modules/import.module b/modules/import.module index dab184fbd6a49eebdfe7c017a1d7ae87299918c7..4bb4431ec0d33b8598e33cda45858a4b82d47f6b 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 873865bd05b277e50311e40a68ab44254cb486a3..fff214eecd3571c391933ef0aa1f236a04c2d69b 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 873865bd05b277e50311e40a68ab44254cb486a3..fff214eecd3571c391933ef0aa1f236a04c2d69b 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 f2e8ffb871709faed64cb3cc483f30ae03cfe185..d4b985eaab746a876ef6f496c4926fcf4df63312 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 f2e8ffb871709faed64cb3cc483f30ae03cfe185..d4b985eaab746a876ef6f496c4926fcf4df63312 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 842f90e14a6c6e6d194e8c2b52db71ba2448be24..f03699ccece765d22ba2ae4473d5c0644dfca696 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 842f90e14a6c6e6d194e8c2b52db71ba2448be24..f03699ccece765d22ba2ae4473d5c0644dfca696 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 b93cdbb8d68e8de2bdd68f9c9976e9ffa742bc3a..36a903bd56e5a676f081b06b08e814938bea1b80 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 b93cdbb8d68e8de2bdd68f9c9976e9ffa742bc3a..36a903bd56e5a676f081b06b08e814938bea1b80 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 aa4cf30be1bab21322ed6a5ad579cac593ec2a6b..50745ac168144057bad57097c7646aea84226e92 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 14d12f4d553254da3d030812e5d23715f60e39be..cbe1a2f988e66c1b26cda03071e28d72dbac2a58 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 14d12f4d553254da3d030812e5d23715f60e39be..cbe1a2f988e66c1b26cda03071e28d72dbac2a58 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 f58fa43815bf8cb0727c226d3b5e92cadedf0cfe..0d00a1e9f473007a1492dacfab2168e2757e457b 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 f58fa43815bf8cb0727c226d3b5e92cadedf0cfe..0d00a1e9f473007a1492dacfab2168e2757e457b 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 689b8ad8bf5dae7f66bd8db956b2f9c723d0dfbf..68259f334b90f0954cc41752897717edf127a438 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 689b8ad8bf5dae7f66bd8db956b2f9c723d0dfbf..68259f334b90f0954cc41752897717edf127a438 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 df46f6624d86216dcae8bf3b220984591642d264..19acb7dab98e07ba95dc7bab12ff6d6a76f5c613 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 df46f6624d86216dcae8bf3b220984591642d264..19acb7dab98e07ba95dc7bab12ff6d6a76f5c613 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 628d0abd2d70ae5502b23ea1389df02bc4102376..bd5035c4ee5a43b0b58cea0e390362660de22253 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 628d0abd2d70ae5502b23ea1389df02bc4102376..bd5035c4ee5a43b0b58cea0e390362660de22253 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 669a244d7f12da05421f207d6934eb503c15dcd8..35c8fcf61bde5c9841e67b7cbcf5445b6cbcc100 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 669a244d7f12da05421f207d6934eb503c15dcd8..35c8fcf61bde5c9841e67b7cbcf5445b6cbcc100 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 238479200c8de11f7595c30b8d5f683ba90289bd..6cf9ec52db683214ea1476b2187738da8b8081c2 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 238479200c8de11f7595c30b8d5f683ba90289bd..6cf9ec52db683214ea1476b2187738da8b8081c2 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 + } } }