diff options
49 files changed, 490 insertions, 125 deletions
@@ -10,29 +10,11 @@ fix_gpc_magic(); menu_build("system"); if (menu_active_handler_exists()) { - $breadcrumb = menu_get_active_breadcrumb(); - array_pop($breadcrumb); - $title = menu_get_active_title(); - - print theme("header"); - print theme("breadcrumb", $breadcrumb); - if ($help = menu_get_active_help()) { - $contents = "<small>$help</small><hr />"; - } - $contents .= menu_execute_active_handler(); - print theme("box", $title, $contents); - print theme("footer"); + menu_execute_active_handler(); } else { - $mod = arg(0); - - if (isset($mod) && module_hook($mod, "page")) { - module_invoke($mod, "page"); - } - else { - print theme("header"); - print theme("footer"); - } + print theme("header"); + print theme("footer"); } drupal_page_footer(); diff --git a/modules/admin.module b/modules/admin.module index 0cb34a60a..e1de707d6 100644 --- a/modules/admin.module +++ b/modules/admin.module @@ -26,7 +26,14 @@ function admin_link($type) { function admin_admin() { if (user_access("access administration pages")) { - return watchdog_overview("actions"); + print theme("header"); + print watchdog_overview("actions"); + print theme("footer"); + } + else { + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/aggregator.module b/modules/aggregator.module index f668c5ffe..a01b46653 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -75,6 +75,12 @@ function import_help($section = "admin/help#import") { return $output; } +function import_help_page() { + print theme("header"); + print import_help(); + print theme("footer"); +} + function import_settings() { $number = array(5 => 5, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30, 35 => 35, 40 => 40, 45 => 45, 50 => 50, 55 => 55, 60 => 60, 65 => 65, 70 => 70, 75 => 75, 80 => 80, 85 => 85, 90 => 90, 95 => 95, 100 => 100); $output .= form_select(t("Items per block"), "import_block_limit", variable_get("import_block_limit", 15), $number, t("The maximum number of news items displayed in one block.")); @@ -103,7 +109,10 @@ function import_link($type) { menu("admin/node/syndication/news/add/feed", t("new feed"), "import_admin", 2); menu("admin/node/syndication/news/add/bundle", t("new bundle"), "import_admin", 3); menu("admin/node/syndication/news/tag", t("tag items"), "import_admin", 4); - menu("admin/node/syndication/news/help", t("help"), "import_help", 9); + menu("admin/node/syndication/news/help", t("help"), "import_help_page", 9); + } + if (user_access("access news feeds")) { + menu("import", t("news feeds"), "import_page", 0, 1); } } @@ -609,11 +618,14 @@ function import_admin() { default: $output .= import_view(); } - return $output; - + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index f668c5ffe..a01b46653 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -75,6 +75,12 @@ function import_help($section = "admin/help#import") { return $output; } +function import_help_page() { + print theme("header"); + print import_help(); + print theme("footer"); +} + function import_settings() { $number = array(5 => 5, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30, 35 => 35, 40 => 40, 45 => 45, 50 => 50, 55 => 55, 60 => 60, 65 => 65, 70 => 70, 75 => 75, 80 => 80, 85 => 85, 90 => 90, 95 => 95, 100 => 100); $output .= form_select(t("Items per block"), "import_block_limit", variable_get("import_block_limit", 15), $number, t("The maximum number of news items displayed in one block.")); @@ -103,7 +109,10 @@ function import_link($type) { menu("admin/node/syndication/news/add/feed", t("new feed"), "import_admin", 2); menu("admin/node/syndication/news/add/bundle", t("new bundle"), "import_admin", 3); menu("admin/node/syndication/news/tag", t("tag items"), "import_admin", 4); - menu("admin/node/syndication/news/help", t("help"), "import_help", 9); + menu("admin/node/syndication/news/help", t("help"), "import_help_page", 9); + } + if (user_access("access news feeds")) { + menu("import", t("news feeds"), "import_page", 0, 1); } } @@ -609,11 +618,14 @@ function import_admin() { default: $output .= import_view(); } - return $output; - + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/archive.module b/modules/archive.module index 0677b1766..58a682182 100644 --- a/modules/archive.module +++ b/modules/archive.module @@ -188,6 +188,12 @@ function archive_link($type) { $links[] = l(t("archives"), "archive", array("title" => t("Read the older content in our archive."))); } + if ($type == "system") { + if (user_access("access content")) { + menu("archive", t("archives"), "archive_page", 0, 1); + } + } + return $links; } diff --git a/modules/archive/archive.module b/modules/archive/archive.module index 0677b1766..58a682182 100644 --- a/modules/archive/archive.module +++ b/modules/archive/archive.module @@ -188,6 +188,12 @@ function archive_link($type) { $links[] = l(t("archives"), "archive", array("title" => t("Read the older content in our archive."))); } + if ($type == "system") { + if (user_access("access content")) { + menu("archive", t("archives"), "archive_page", 0, 1); + } + } + return $links; } diff --git a/modules/block.module b/modules/block.module index 381d31c78..df91c0cb6 100644 --- a/modules/block.module +++ b/modules/block.module @@ -53,6 +53,12 @@ function block_help($section = "admin/help#block") { return $output; } +function block_help_page() { + print theme("header"); + print block_help(); + print theme("footer"); +} + function block_perm() { return array("administer blocks"); } @@ -63,7 +69,7 @@ function block_link($type) { menu("admin/system/block", t("blocks"), "block_admin", 3); menu("admin/system/block/add", t("new block"), "block_admin", 2); menu("admin/system/block/preview", t("preview placement"), "block_admin", 3); - menu("admin/system/block/help", t("help"), "block_help", 9); + menu("admin/system/block/help", t("help"), "block_help_page", 9); } } @@ -306,10 +312,14 @@ function block_admin() { $output .= block_admin_display(); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/block/block.module b/modules/block/block.module index 381d31c78..df91c0cb6 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -53,6 +53,12 @@ function block_help($section = "admin/help#block") { return $output; } +function block_help_page() { + print theme("header"); + print block_help(); + print theme("footer"); +} + function block_perm() { return array("administer blocks"); } @@ -63,7 +69,7 @@ function block_link($type) { menu("admin/system/block", t("blocks"), "block_admin", 3); menu("admin/system/block/add", t("new block"), "block_admin", 2); menu("admin/system/block/preview", t("preview placement"), "block_admin", 3); - menu("admin/system/block/help", t("help"), "block_help", 9); + menu("admin/system/block/help", t("help"), "block_help_page", 9); } } @@ -306,10 +312,14 @@ function block_admin() { $output .= block_admin_display(); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/blog.module b/modules/blog.module index 9acaf7bb0..be73a62de 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -252,10 +252,13 @@ function blog_link($type, $node = 0, $main) { if ($type == "system") { if (user_access("maintain personal blog")) { - menu("node/add/blog", t("blog entry"), "page", 0); + menu("node/add/blog", t("blog entry"), "node_page", 0); } if (user_access("maintain personal blog")) { - menu("blog/" . $user->uid, t("my blog"), "page", 1); + menu("blog/" . $user->uid, t("my blog"), "blog_page", 1); + } + if (user_access("access content")) { + menu("blog", t("blog"), "blog_page", 0, 1); } } diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 9acaf7bb0..be73a62de 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -252,10 +252,13 @@ function blog_link($type, $node = 0, $main) { if ($type == "system") { if (user_access("maintain personal blog")) { - menu("node/add/blog", t("blog entry"), "page", 0); + menu("node/add/blog", t("blog entry"), "node_page", 0); } if (user_access("maintain personal blog")) { - menu("blog/" . $user->uid, t("my blog"), "page", 1); + menu("blog/" . $user->uid, t("my blog"), "blog_page", 1); + } + if (user_access("access content")) { + menu("blog", t("blog"), "blog_page", 0, 1); } } diff --git a/modules/book.module b/modules/book.module index 0a6f68a44..c431fdf47 100644 --- a/modules/book.module +++ b/modules/book.module @@ -76,14 +76,16 @@ function book_link($type, $node = 0, $main = 0) { if (user_access("administer nodes")) { menu("admin/node/book", t("books"), "book_admin", 4); menu("admin/node/book/orphan", t("orphan pages"), "book_admin_orphan", 8); - menu("admin/node/book/help", t("help"), "book_help", 9); + menu("admin/node/book/help", t("help"), "book_help_page", 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", t("'%title' book", array("%title" => $book->title)), "book_admin"); } } - + if (user_access("access content")) { + menu("book", t("books"), "book_page", 0, 1); + } } return $links; @@ -800,7 +802,9 @@ function book_admin_orphan() { $output .= theme("table", $header, $rows); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } function book_admin_links() { @@ -832,7 +836,14 @@ function book_admin() { $output .= book_admin_view(arg(3)); break; } - return $output; + print theme("header"); + print $output; + print theme("footer"); + } + else { + print theme("header"); + print message_access(); + print theme("footer"); } } @@ -867,4 +878,10 @@ function book_help($section = "admin/help#book") { return $output; } + +function book_help_page() { + print theme("header"); + print book_help(); + print theme("footer"); +} ?> diff --git a/modules/book/book.module b/modules/book/book.module index 0a6f68a44..c431fdf47 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -76,14 +76,16 @@ function book_link($type, $node = 0, $main = 0) { if (user_access("administer nodes")) { menu("admin/node/book", t("books"), "book_admin", 4); menu("admin/node/book/orphan", t("orphan pages"), "book_admin_orphan", 8); - menu("admin/node/book/help", t("help"), "book_help", 9); + menu("admin/node/book/help", t("help"), "book_help_page", 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", t("'%title' book", array("%title" => $book->title)), "book_admin"); } } - + if (user_access("access content")) { + menu("book", t("books"), "book_page", 0, 1); + } } return $links; @@ -800,7 +802,9 @@ function book_admin_orphan() { $output .= theme("table", $header, $rows); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } function book_admin_links() { @@ -832,7 +836,14 @@ function book_admin() { $output .= book_admin_view(arg(3)); break; } - return $output; + print theme("header"); + print $output; + print theme("footer"); + } + else { + print theme("header"); + print message_access(); + print theme("footer"); } } @@ -867,4 +878,10 @@ function book_help($section = "admin/help#book") { return $output; } + +function book_help_page() { + print theme("header"); + print book_help(); + print theme("footer"); +} ?> diff --git a/modules/comment.module b/modules/comment.module index 7007c01bb..7141d3da8 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -109,6 +109,12 @@ function comment_help($section = "admin/help#comment") { return $output; } +function comment_help_page() { + print theme("header"); + print comment_help(); + print theme("footer"); +} + function comment_settings() { $output .= form_radios(t("Default display mode"), "comment_default_mode", variable_get("comment_default_mode", 4), _comment_get_modes(), t("The default view for comments. Expanded views display the body of the comment. Threaded views keep replies together.")); @@ -827,7 +833,7 @@ function comment_link($type, $node = 0, $main = 0) { menu("admin/comment/comments/0", t("new/updated"), "comment_admin", 1); menu("admin/comment/comments/1", t("approval queue"), "comment_admin", 2); menu("admin/comment/search", t("search"), "comment_admin", 8); - menu("admin/comment/help", t("help"), "comment_help", 9); + menu("admin/comment/help", t("help"), "comment_help_page", 9); menu("admin/comment/edit", t("edit comment"), "comment_admin", 0, 1); // comment settings: @@ -839,6 +845,7 @@ function comment_link($type, $node = 0, $main = 0) { menu("admin/comment/moderation/roles", t("initial scores"), "comment_admin", 6); } } + menu("comment", t("comments"), "comment_page", 0, 1); } return $links ? $links : array(); @@ -1231,10 +1238,14 @@ function comment_admin() { $output = comment_admin_overview(0); } } - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 7007c01bb..7141d3da8 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -109,6 +109,12 @@ function comment_help($section = "admin/help#comment") { return $output; } +function comment_help_page() { + print theme("header"); + print comment_help(); + print theme("footer"); +} + function comment_settings() { $output .= form_radios(t("Default display mode"), "comment_default_mode", variable_get("comment_default_mode", 4), _comment_get_modes(), t("The default view for comments. Expanded views display the body of the comment. Threaded views keep replies together.")); @@ -827,7 +833,7 @@ function comment_link($type, $node = 0, $main = 0) { menu("admin/comment/comments/0", t("new/updated"), "comment_admin", 1); menu("admin/comment/comments/1", t("approval queue"), "comment_admin", 2); menu("admin/comment/search", t("search"), "comment_admin", 8); - menu("admin/comment/help", t("help"), "comment_help", 9); + menu("admin/comment/help", t("help"), "comment_help_page", 9); menu("admin/comment/edit", t("edit comment"), "comment_admin", 0, 1); // comment settings: @@ -839,6 +845,7 @@ function comment_link($type, $node = 0, $main = 0) { menu("admin/comment/moderation/roles", t("initial scores"), "comment_admin", 6); } } + menu("comment", t("comments"), "comment_page", 0, 1); } return $links ? $links : array(); @@ -1231,10 +1238,14 @@ function comment_admin() { $output = comment_admin_overview(0); } } - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/drupal.module b/modules/drupal.module index a2621e59d..df30832f9 100644 --- a/modules/drupal.module +++ b/modules/drupal.module @@ -155,6 +155,12 @@ function drupal_auth($username, $password, $server) { return $login; } +function drupal_link($type) { + if ($type == "system") { + menu("drupal", "Drupal", "drupal_page", 0, 1); + } +} + function drupal_page() { print theme("header"); diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module index a2621e59d..df30832f9 100644 --- a/modules/drupal/drupal.module +++ b/modules/drupal/drupal.module @@ -155,6 +155,12 @@ function drupal_auth($username, $password, $server) { return $login; } +function drupal_link($type) { + if ($type == "system") { + menu("drupal", "Drupal", "drupal_page", 0, 1); + } +} + function drupal_page() { print theme("header"); diff --git a/modules/forum.module b/modules/forum.module index 34709d39b..c1c6093ad 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -93,8 +93,13 @@ function forum_link($type, $node = 0, $main = 0) { $links[] = l(t("forums"), "forum"); } - if ($type == "system" && user_access("create forum topics")) { - menu("node/add/forum",t("forum topic"), "page"); + if ($type == "system") { + if (user_access("create forum topics")) { + menu("node/add/forum", t("forum topic"), "node_page"); + } + if (user_access("access content")) { + menu("forum", t("forums"), "forum_page", 0, 1); + } } if (!$main && $type == "node" && $node->type == "forum") { diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 34709d39b..c1c6093ad 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -93,8 +93,13 @@ function forum_link($type, $node = 0, $main = 0) { $links[] = l(t("forums"), "forum"); } - if ($type == "system" && user_access("create forum topics")) { - menu("node/add/forum",t("forum topic"), "page"); + if ($type == "system") { + if (user_access("create forum topics")) { + menu("node/add/forum", t("forum topic"), "node_page"); + } + if (user_access("access content")) { + menu("forum", t("forums"), "forum_page", 0, 1); + } } if (!$main && $type == "node" && $node->type == "forum") { diff --git a/modules/help.module b/modules/help.module index f7477a2ab..f53853e4f 100644 --- a/modules/help.module +++ b/modules/help.module @@ -4,7 +4,7 @@ function help_link($type) { if ($type == "system" && user_access("access administration pages")) { menu("admin/help/glossary", t("glossary"), "help_glossary", 8); - menu("admin/help", t("help"), "help_help", 9); + menu("admin/help", t("help"), "help_help_page", 9); } } @@ -28,7 +28,9 @@ function help_glossary() { $output .= "</dl>"; $output = t($output, array("%taxonomy" => l(t("taxonomy help"), "admin/taxonomy/help"))); - return $output; + print theme("header"); + print $output; + print theme("footer"); } function help_help($section = "admin/help#help") { @@ -59,4 +61,10 @@ function help_help($section = "admin/help#help") { return $output; } +function help_help_page() { + print theme("header"); + print help_help(); + print theme("footer"); +} + ?> diff --git a/modules/help/help.module b/modules/help/help.module index f7477a2ab..f53853e4f 100644 --- a/modules/help/help.module +++ b/modules/help/help.module @@ -4,7 +4,7 @@ function help_link($type) { if ($type == "system" && user_access("access administration pages")) { menu("admin/help/glossary", t("glossary"), "help_glossary", 8); - menu("admin/help", t("help"), "help_help", 9); + menu("admin/help", t("help"), "help_help_page", 9); } } @@ -28,7 +28,9 @@ function help_glossary() { $output .= "</dl>"; $output = t($output, array("%taxonomy" => l(t("taxonomy help"), "admin/taxonomy/help"))); - return $output; + print theme("header"); + print $output; + print theme("footer"); } function help_help($section = "admin/help#help") { @@ -59,4 +61,10 @@ function help_help($section = "admin/help#help") { return $output; } +function help_help_page() { + print theme("header"); + print help_help(); + print theme("footer"); +} + ?> diff --git a/modules/import.module b/modules/import.module index f668c5ffe..a01b46653 100644 --- a/modules/import.module +++ b/modules/import.module @@ -75,6 +75,12 @@ function import_help($section = "admin/help#import") { return $output; } +function import_help_page() { + print theme("header"); + print import_help(); + print theme("footer"); +} + function import_settings() { $number = array(5 => 5, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30, 35 => 35, 40 => 40, 45 => 45, 50 => 50, 55 => 55, 60 => 60, 65 => 65, 70 => 70, 75 => 75, 80 => 80, 85 => 85, 90 => 90, 95 => 95, 100 => 100); $output .= form_select(t("Items per block"), "import_block_limit", variable_get("import_block_limit", 15), $number, t("The maximum number of news items displayed in one block.")); @@ -103,7 +109,10 @@ function import_link($type) { menu("admin/node/syndication/news/add/feed", t("new feed"), "import_admin", 2); menu("admin/node/syndication/news/add/bundle", t("new bundle"), "import_admin", 3); menu("admin/node/syndication/news/tag", t("tag items"), "import_admin", 4); - menu("admin/node/syndication/news/help", t("help"), "import_help", 9); + menu("admin/node/syndication/news/help", t("help"), "import_help_page", 9); + } + if (user_access("access news feeds")) { + menu("import", t("news feeds"), "import_page", 0, 1); } } @@ -609,11 +618,14 @@ function import_admin() { default: $output .= import_view(); } - return $output; - + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/locale.module b/modules/locale.module index 84b466954..8e54b97a4 100644 --- a/modules/locale.module +++ b/modules/locale.module @@ -54,6 +54,12 @@ function locale_help($section = "admin/help#locale") { return $output; } +function locale_help_page() { + print theme("header"); + print locale_help(); + print theme("footer"); +} + function locale_perm() { return array("administer locales"); } @@ -66,7 +72,7 @@ function locale_link($type) { menu("admin/locale", t("localization"), NULL, 5); menu("admin/locale/search", t("search string"), "locale_admin", 8); - menu("admin/locale/help", t("help"), "locale_help", 9); + menu("admin/locale/help", t("help"), "locale_help_page", 9); menu("admin/locale/edit", t("edit string"), "locale_admin", 0, 1); // hidden menu menu("admin/locale/delete", t("delete string"), "locale_admin", 0, 1); // hidden menu @@ -294,10 +300,14 @@ function locale_admin() { $output = locale_seek(); $output .= locale_seek_form(); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 84b466954..8e54b97a4 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -54,6 +54,12 @@ function locale_help($section = "admin/help#locale") { return $output; } +function locale_help_page() { + print theme("header"); + print locale_help(); + print theme("footer"); +} + function locale_perm() { return array("administer locales"); } @@ -66,7 +72,7 @@ function locale_link($type) { menu("admin/locale", t("localization"), NULL, 5); menu("admin/locale/search", t("search string"), "locale_admin", 8); - menu("admin/locale/help", t("help"), "locale_help", 9); + menu("admin/locale/help", t("help"), "locale_help_page", 9); menu("admin/locale/edit", t("edit string"), "locale_admin", 0, 1); // hidden menu menu("admin/locale/delete", t("delete string"), "locale_admin", 0, 1); // hidden menu @@ -294,10 +300,14 @@ function locale_admin() { $output = locale_seek(); $output .= locale_seek_form(); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/node.module b/modules/node.module index a69e84b3a..f0abb2ce8 100644 --- a/modules/node.module +++ b/modules/node.module @@ -63,6 +63,13 @@ function node_help($section = "admin/help#node") { return $output; } +function node_help_page() { + print theme("header"); + print node_help(); + print theme("footer"); +} + + /* ** Accepts a DB result object which can be used to fetch node objects. ** Returns an HTML list suitable as content for a block. @@ -568,10 +575,14 @@ function node_link($type, $node = 0, $main = 0) { if (user_access("administer nodes")) { menu("admin/node", t("content"), "node_admin"); menu("admin/node/search", t("search"), "node_admin", 8); - menu("admin/node/help", t("help"), "node_help", 9); + menu("admin/node/help", t("help"), "node_help_page", 9); menu("admin/node/edit", t("edit post"), "node_admin", 0, 1); menu("admin/node/settings", t("settings"), "node_admin", 8); } + + if (user_access("access content")) { + menu("node", t("content"), "node_page", 0, 1); + } } return $links; @@ -920,10 +931,14 @@ function node_admin() { default: $output = node_admin_nodes(); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/node/node.module b/modules/node/node.module index a69e84b3a..f0abb2ce8 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -63,6 +63,13 @@ function node_help($section = "admin/help#node") { return $output; } +function node_help_page() { + print theme("header"); + print node_help(); + print theme("footer"); +} + + /* ** Accepts a DB result object which can be used to fetch node objects. ** Returns an HTML list suitable as content for a block. @@ -568,10 +575,14 @@ function node_link($type, $node = 0, $main = 0) { if (user_access("administer nodes")) { menu("admin/node", t("content"), "node_admin"); menu("admin/node/search", t("search"), "node_admin", 8); - menu("admin/node/help", t("help"), "node_help", 9); + menu("admin/node/help", t("help"), "node_help_page", 9); menu("admin/node/edit", t("edit post"), "node_admin", 0, 1); menu("admin/node/settings", t("settings"), "node_admin", 8); } + + if (user_access("access content")) { + menu("node", t("content"), "node_page", 0, 1); + } } return $links; @@ -920,10 +931,14 @@ function node_admin() { default: $output = node_admin_nodes(); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/page.module b/modules/page.module index aa75896e3..5b5629136 100644 --- a/modules/page.module +++ b/modules/page.module @@ -89,7 +89,7 @@ function page_link($type) { if ($type == "system") { if (user_access("maintain static pages")) { - menu("node/add/page", t("static page"), "page", 0); + menu("node/add/page", t("static page"), "node_page", 0); } } diff --git a/modules/page/page.module b/modules/page/page.module index aa75896e3..5b5629136 100644 --- a/modules/page/page.module +++ b/modules/page/page.module @@ -89,7 +89,7 @@ function page_link($type) { if ($type == "system") { if (user_access("maintain static pages")) { - menu("node/add/page", t("static page"), "page", 0); + menu("node/add/page", t("static page"), "node_page", 0); } } diff --git a/modules/path.module b/modules/path.module index 9a8ea9ff0..1d66bd366 100644 --- a/modules/path.module +++ b/modules/path.module @@ -38,10 +38,14 @@ function path_admin() { $output .= path_overview(); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/path/path.module b/modules/path/path.module index 9a8ea9ff0..1d66bd366 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -38,10 +38,14 @@ function path_admin() { $output .= path_overview(); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/poll.module b/modules/poll.module index e2b7085e9..6fba8859e 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -182,7 +182,10 @@ function poll_link($type, $node = 0, $main) { if ($type == "system") { if (user_access("create polls")) { - menu("node/add/poll", t("poll"), "page", 0); + menu("node/add/poll", t("poll"), "node_page", 0); + } + if (user_access("access content")) { + menu("poll", t("polls"), "poll_page", 0, 1); } } else if ($type == "page" && user_access("access content")) { diff --git a/modules/poll/poll.module b/modules/poll/poll.module index e2b7085e9..6fba8859e 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -182,7 +182,10 @@ function poll_link($type, $node = 0, $main) { if ($type == "system") { if (user_access("create polls")) { - menu("node/add/poll", t("poll"), "page", 0); + menu("node/add/poll", t("poll"), "node_page", 0); + } + if (user_access("access content")) { + menu("poll", t("polls"), "poll_page", 0, 1); } } else if ($type == "page" && user_access("access content")) { diff --git a/modules/queue.module b/modules/queue.module index 5de10711a..53fc56895 100644 --- a/modules/queue.module +++ b/modules/queue.module @@ -35,7 +35,7 @@ function queue_perm() { function queue_link($type) { if ($type == "system") { if (user_access("access submission queue")) { - menu("queue", t("view submissions"), "page", 1); + menu("queue", t("view submissions"), "queue_page", 1); } } diff --git a/modules/search.module b/modules/search.module index 6d9b1e842..78bca2a88 100644 --- a/modules/search.module +++ b/modules/search.module @@ -42,6 +42,10 @@ function search_link($type) { $links[] = l(t("search"), "search", array("title" => t("Search for older content."))); } + if ($type == "system" && user_access("search content")) { + menu("search", t("search"), "search_page", 0, 1); + } + return $links; } @@ -68,9 +72,16 @@ function search_admin() { $output = t("index invalidated") ."<br />\n"; search_cron(); $output .= t("index recreated") ."<br /><hr />\n"; - return $output; + print theme("header"); + print $output; + print theme("footer"); } } + else { + print theme("header"); + print message_access(); + print theme("footer"); + } } /** diff --git a/modules/search/search.module b/modules/search/search.module index 6d9b1e842..78bca2a88 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -42,6 +42,10 @@ function search_link($type) { $links[] = l(t("search"), "search", array("title" => t("Search for older content."))); } + if ($type == "system" && user_access("search content")) { + menu("search", t("search"), "search_page", 0, 1); + } + return $links; } @@ -68,9 +72,16 @@ function search_admin() { $output = t("index invalidated") ."<br />\n"; search_cron(); $output .= t("index recreated") ."<br /><hr />\n"; - return $output; + print theme("header"); + print $output; + print theme("footer"); } } + else { + print theme("header"); + print message_access(); + print theme("footer"); + } } /** diff --git a/modules/statistics.module b/modules/statistics.module index bbeb72cf6..08732b32f 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -115,12 +115,16 @@ function statistics_link($type, $node = 0, $main = 0) { menu("admin/statistics/log/user", t("track user"), "statistics_admin", 0, 1); //hidden menu("admin/statistics/log/host", t("track host"), "statistics_admin", 0, 1); //hidden menu("admin/statistics/top nodes page", t("configure 'top nodes' page"), "statistics_admin", 5); - menu("admin/statistics/help", t("help"), "statistics_help", 9); + menu("admin/statistics/help", t("help"), "statistics_help_page", 9); // block configuration: menu("admin/system/block/top nodes block", t("configure 'top nodes' block"), "statistics_admin", 5); menu("admin/system/block/whos online block", t("configure 'who is online' block"), "statistics_admin", 5); } + + if (user_access("access content")) { + menu("statistics", t("view top nodes"), statistics_page, 0, 1); + } } return $links; @@ -240,6 +244,12 @@ function statistics_help($section = "admin/help#statistics") { return $output; } +function statistics_help_page() { + print theme("header"); + print statistics_help(); + print theme("footer"); +} + /* Administration hook, defines module's administrative page */ function statistics_admin() { @@ -315,7 +325,14 @@ function statistics_admin() { $output .= statistics_admin_topnodes(); } } - return $output; + print theme("header"); + print $output; + print theme("footer"); + } + else { + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index bbeb72cf6..08732b32f 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -115,12 +115,16 @@ function statistics_link($type, $node = 0, $main = 0) { menu("admin/statistics/log/user", t("track user"), "statistics_admin", 0, 1); //hidden menu("admin/statistics/log/host", t("track host"), "statistics_admin", 0, 1); //hidden menu("admin/statistics/top nodes page", t("configure 'top nodes' page"), "statistics_admin", 5); - menu("admin/statistics/help", t("help"), "statistics_help", 9); + menu("admin/statistics/help", t("help"), "statistics_help_page", 9); // block configuration: menu("admin/system/block/top nodes block", t("configure 'top nodes' block"), "statistics_admin", 5); menu("admin/system/block/whos online block", t("configure 'who is online' block"), "statistics_admin", 5); } + + if (user_access("access content")) { + menu("statistics", t("view top nodes"), statistics_page, 0, 1); + } } return $links; @@ -240,6 +244,12 @@ function statistics_help($section = "admin/help#statistics") { return $output; } +function statistics_help_page() { + print theme("header"); + print statistics_help(); + print theme("footer"); +} + /* Administration hook, defines module's administrative page */ function statistics_admin() { @@ -315,7 +325,14 @@ function statistics_admin() { $output .= statistics_admin_topnodes(); } } - return $output; + print theme("header"); + print $output; + print theme("footer"); + } + else { + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/story.module b/modules/story.module index fe0408331..42550cef9 100644 --- a/modules/story.module +++ b/modules/story.module @@ -53,7 +53,7 @@ function story_link($type) { if ($type == "system") { if (user_access("create stories")) { - menu("node/add/story", t("story"), "page", 0); + menu("node/add/story", t("story"), "node_page", 0); } } diff --git a/modules/story/story.module b/modules/story/story.module index fe0408331..42550cef9 100644 --- a/modules/story/story.module +++ b/modules/story/story.module @@ -53,7 +53,7 @@ function story_link($type) { if ($type == "system") { if (user_access("create stories")) { - menu("node/add/story", t("story"), "page", 0); + menu("node/add/story", t("story"), "node_page", 0); } } diff --git a/modules/system.module b/modules/system.module index 67533f1d6..8e6f3bf4c 100644 --- a/modules/system.module +++ b/modules/system.module @@ -46,6 +46,12 @@ function system_help($section = "admin/help#system") { return $output; } +function system_help_page() { + print theme("header"); + print system_help(); + print theme("footer"); +} + function system_perm() { return array("administer site configuration", "access administration pages", "bypass input data check", "create php content"); } @@ -76,7 +82,7 @@ function system_link($type) { } } menu("admin/system/filters", t("filters"), "system_admin", 4); - menu("admin/system/help", t("help"), "system_help", 9); + menu("admin/system/help", t("help"), "system_help_page", 9); } } } @@ -346,10 +352,14 @@ function system_admin() { } $output .= system_view(arg(2), arg(3)); - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/system/system.module b/modules/system/system.module index 67533f1d6..8e6f3bf4c 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -46,6 +46,12 @@ function system_help($section = "admin/help#system") { return $output; } +function system_help_page() { + print theme("header"); + print system_help(); + print theme("footer"); +} + function system_perm() { return array("administer site configuration", "access administration pages", "bypass input data check", "create php content"); } @@ -76,7 +82,7 @@ function system_link($type) { } } menu("admin/system/filters", t("filters"), "system_admin", 4); - menu("admin/system/help", t("help"), "system_help", 9); + menu("admin/system/help", t("help"), "system_help_page", 9); } } } @@ -346,10 +352,14 @@ function system_admin() { } $output .= system_view(arg(2), arg(3)); - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/taxonomy.module b/modules/taxonomy.module index f26b36d1d..135241f43 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -28,6 +28,9 @@ function taxonomy_link($type, $node = NULL) { menu("admin/taxonomy/add/vocabulary", t("create new vocabulary"), "taxonomy_admin"); menu("admin/taxonomy/help", t("help"), "taxonomy_admin", 9); } + if (user_access("access content")) { + menu("taxonomy", t("taxonomy"), "taxonomy_page", 0, 1); + } } else if ($type == "taxonomy terms" && $node != NULL) { $links = array(); @@ -792,7 +795,9 @@ function taxonomy_admin() { $output .= message_access(); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } function taxonomy_help($section = "admin/help#taxonomy") { diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index f26b36d1d..135241f43 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -28,6 +28,9 @@ function taxonomy_link($type, $node = NULL) { menu("admin/taxonomy/add/vocabulary", t("create new vocabulary"), "taxonomy_admin"); menu("admin/taxonomy/help", t("help"), "taxonomy_admin", 9); } + if (user_access("access content")) { + menu("taxonomy", t("taxonomy"), "taxonomy_page", 0, 1); + } } else if ($type == "taxonomy terms" && $node != NULL) { $links = array(); @@ -792,7 +795,9 @@ function taxonomy_admin() { $output .= message_access(); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } function taxonomy_help($section = "admin/help#taxonomy") { diff --git a/modules/title.module b/modules/title.module index 9650ceeb5..9206f3605 100644 --- a/modules/title.module +++ b/modules/title.module @@ -13,6 +13,14 @@ function title_help($section) { return $output; } +function title_link($type) { + if ($type == "system") { + if (user_access("access content")) { + menu("title", t("search"), "title_page", 0, 1); + } + } +} + function title_page() { if (user_access("access content")) { diff --git a/modules/tracker.module b/modules/tracker.module index 094967458..3d82de563 100644 --- a/modules/tracker.module +++ b/modules/tracker.module @@ -22,7 +22,7 @@ function tracker_link($type) { if ($type == "system") { if (user_access("access content")) { - menu("tracker", t("recent posts"), "page", 1); + menu("tracker", t("recent posts"), "tracker_page", 1); } } @@ -108,6 +108,11 @@ function tracker_page() { print theme("box", t("Recent posts"), tracker_posts(arg(1))); print theme("footer"); } + else { + print theme("header"); + print message_access(); + print theme("footer"); + } } ?> diff --git a/modules/tracker/tracker.module b/modules/tracker/tracker.module index 094967458..3d82de563 100644 --- a/modules/tracker/tracker.module +++ b/modules/tracker/tracker.module @@ -22,7 +22,7 @@ function tracker_link($type) { if ($type == "system") { if (user_access("access content")) { - menu("tracker", t("recent posts"), "page", 1); + menu("tracker", t("recent posts"), "tracker_page", 1); } } @@ -108,6 +108,11 @@ function tracker_page() { print theme("box", t("Recent posts"), tracker_posts(arg(1))); print theme("footer"); } + else { + print theme("header"); + print message_access(); + print theme("footer"); + } } ?> diff --git a/modules/user.module b/modules/user.module index 435ba4956..1781c625d 100644 --- a/modules/user.module +++ b/modules/user.module @@ -398,9 +398,9 @@ function user_link($type) { if ($type == "system") { global $user; if ($user->uid) { - menu("user", t("my account"), "page", 8); - menu("user/edit", t("edit account"), "page", 0); - menu("user/logout", t("log out"), "page", 10); + menu("user", t("my account"), "user_page", 8); + menu("user/edit", t("edit account"), "user_page", 0); + menu("user/logout", t("log out"), "user_page", 10); } if (user_access("administer users")) { @@ -412,7 +412,7 @@ function user_link($type) { menu("admin/user/role", t("roles"), "user_admin", 4); menu("admin/user/permission", t("permissions"), "user_admin", 5); menu("admin/user/search", t("search"), "user_admin", 8); - menu("admin/user/help", t("help"), "user_help", 9); + menu("admin/user/help", t("help"), "user_help_page", 9); menu("admin/user/edit", t("edit user account"), "user_admin", 0, 1); // hidden menu } } @@ -1205,7 +1205,6 @@ function user_roles($membersonly = 0) { function user_admin_perm($edit = array()) { if ($edit) { - /* ** Save permissions: */ @@ -1219,9 +1218,13 @@ function user_admin_perm($edit = array()) { if ($perm) { db_query("INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')", $role->rid, $perm); } - // clear the cache, we might have changed the anonymous user's permissions - cache_clear_all(); } + + /* + ** Clear the cache, we might have changed the anonymous user's + ** permissions. + */ + cache_clear_all(); } /* @@ -1510,7 +1513,14 @@ function user_admin() { $output = user_admin_account(); } } - return $output; + print theme("header"); + print $output; + print theme("footer"); + } + else { + print theme("header"); + print message_access(); + print theme("footer"); } } // the following functions comprise help for admins and developers @@ -1731,4 +1741,10 @@ function julia_user(\$type, \$edit, &\$user) { return $output; } +function user_help_page() { + print theme("header"); + print user_help(); + print theme("footer"); +} + ?> diff --git a/modules/user/user.module b/modules/user/user.module index 435ba4956..1781c625d 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -398,9 +398,9 @@ function user_link($type) { if ($type == "system") { global $user; if ($user->uid) { - menu("user", t("my account"), "page", 8); - menu("user/edit", t("edit account"), "page", 0); - menu("user/logout", t("log out"), "page", 10); + menu("user", t("my account"), "user_page", 8); + menu("user/edit", t("edit account"), "user_page", 0); + menu("user/logout", t("log out"), "user_page", 10); } if (user_access("administer users")) { @@ -412,7 +412,7 @@ function user_link($type) { menu("admin/user/role", t("roles"), "user_admin", 4); menu("admin/user/permission", t("permissions"), "user_admin", 5); menu("admin/user/search", t("search"), "user_admin", 8); - menu("admin/user/help", t("help"), "user_help", 9); + menu("admin/user/help", t("help"), "user_help_page", 9); menu("admin/user/edit", t("edit user account"), "user_admin", 0, 1); // hidden menu } } @@ -1205,7 +1205,6 @@ function user_roles($membersonly = 0) { function user_admin_perm($edit = array()) { if ($edit) { - /* ** Save permissions: */ @@ -1219,9 +1218,13 @@ function user_admin_perm($edit = array()) { if ($perm) { db_query("INSERT INTO {permission} (rid, perm) VALUES (%d, '%s')", $role->rid, $perm); } - // clear the cache, we might have changed the anonymous user's permissions - cache_clear_all(); } + + /* + ** Clear the cache, we might have changed the anonymous user's + ** permissions. + */ + cache_clear_all(); } /* @@ -1510,7 +1513,14 @@ function user_admin() { $output = user_admin_account(); } } - return $output; + print theme("header"); + print $output; + print theme("footer"); + } + else { + print theme("header"); + print message_access(); + print theme("footer"); } } // the following functions comprise help for admins and developers @@ -1731,4 +1741,10 @@ function julia_user(\$type, \$edit, &\$user) { return $output; } +function user_help_page() { + print theme("header"); + print user_help(); + print theme("footer"); +} + ?> diff --git a/modules/watchdog.module b/modules/watchdog.module index f97464a16..5981f58d7 100644 --- a/modules/watchdog.module +++ b/modules/watchdog.module @@ -139,10 +139,14 @@ function watchdog_admin() { default: $output = watchdog_overview(arg(2)); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module index f97464a16..5981f58d7 100644 --- a/modules/watchdog/watchdog.module +++ b/modules/watchdog/watchdog.module @@ -139,10 +139,14 @@ function watchdog_admin() { default: $output = watchdog_overview(arg(2)); } - return $output; + print theme("header"); + print $output; + print theme("footer"); } else { - return message_access(); + print theme("header"); + print message_access(); + print theme("footer"); } } |