diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-09-26 10:04:09 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-09-26 10:04:09 +0000 |
commit | f104d3cc12134fc574373d6a643d9c84a317de44 (patch) | |
tree | 838bcdb9cff17d43ec39a5ebdfd3274916839580 /modules | |
parent | 645d026e098a4dccef1bbbf0e40b9eecc8599daa (diff) | |
download | brdo-f104d3cc12134fc574373d6a643d9c84a317de44.tar.gz brdo-f104d3cc12134fc574373d6a643d9c84a317de44.tar.bz2 |
- Committed the admin menu integration patch. Thanks Adrian, Stefan and others.
Diffstat (limited to 'modules')
38 files changed, 410 insertions, 425 deletions
diff --git a/modules/admin.module b/modules/admin.module index 5af8a76c8..1f2994d0f 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 dab184fbd..4bb4431ec 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 dab184fbd..4bb4431ec 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 a1332619a..ac89366f6 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 a1332619a..ac89366f6 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 e66460334..5f00f3d8a 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 e66460334..5f00f3d8a 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 af0119679..bebd9a24d 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 af0119679..bebd9a24d 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 8895ade66..4e6ea5f25 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 43060e2a0..5e40378a7 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 43060e2a0..5e40378a7 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 157b37e0d..9719ba9e9 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 157b37e0d..9719ba9e9 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 dab184fbd..4bb4431ec 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 873865bd0..fff214eec 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 873865bd0..fff214eec 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 f2e8ffb87..d4b985eaa 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 f2e8ffb87..d4b985eaa 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 842f90e14..f03699cce 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 842f90e14..f03699cce 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 b93cdbb8d..36a903bd5 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 b93cdbb8d..36a903bd5 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 aa4cf30be..50745ac16 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 14d12f4d5..cbe1a2f98 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 14d12f4d5..cbe1a2f98 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 f58fa4381..0d00a1e9f 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 f58fa4381..0d00a1e9f 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 689b8ad8b..68259f334 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 689b8ad8b..68259f334 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 df46f6624..19acb7dab 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 df46f6624..19acb7dab 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 628d0abd2..bd5035c4e 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 628d0abd2..bd5035c4e 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 669a244d7..35c8fcf61 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 669a244d7..35c8fcf61 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 238479200..6cf9ec52d 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 238479200..6cf9ec52d 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 + } } } |