diff --git a/database/database.mysql b/database/database.mysql index d84761b4bb8..5a75d15fcad 100644 --- a/database/database.mysql +++ b/database/database.mysql @@ -229,8 +229,7 @@ CREATE TABLE menu ( help TEXT default '', title varchar(255) NOT NULL default '', parent varchar(255) NOT NULL default '', - weight tinyint(4) DEFAULT '0' NOT NULL, - overview tinyint(1) DEFAULT '0' NOT NULL + weight tinyint(4) DEFAULT '0' NOT NULL ) TYPE=MyISAM; -- diff --git a/database/database.pgsql b/database/database.pgsql index 7c0c04c589e..f564135d838 100644 --- a/database/database.pgsql +++ b/database/database.pgsql @@ -226,8 +226,7 @@ CREATE TABLE menu ( help TEXT default '', title varchar(255) NOT NULL default '', parent varchar(255) NOT NULL default '', - weight tinyint(4) DEFAULT '0' NOT NULL, - overview tinyint(1) DEFAULT '0' NOT NULL + weight tinyint(4) DEFAULT '0' NOT NULL ); -- diff --git a/includes/menu.inc b/includes/menu.inc index 345f42d0385..df54d723294 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -36,6 +36,17 @@ function menu_trail() { return $trail; } +function menu_in_trail($item) { + $trail = menu_trail(); + + foreach ($trail as $menu) { + if ($menu->link == $item->link) { + return 1; + } + } + return 0; +} + function menu_item($item) { /* @@ -99,15 +110,18 @@ function menu_help() { return $output; } -function menu_tree($parent = "", $overview = 0) { +function menu_tree($parent = "", $all = 1) { - $result = db_query("SELECT * FROM menu WHERE parent = '%s' AND overview = '%d' ORDER BY weight, name", $parent, $overview); + if ($all) { + $result = db_query("SELECT * FROM menu WHERE parent = '%s' ORDER BY weight, name", $parent); + } if (db_num_rows($result)) { $output = ""; } @@ -115,10 +129,10 @@ function menu_tree($parent = "", $overview = 0) { return $output; } -function menu_add($name, $link, $title = NULL, $help = NULL, $parent = NULL, $weight = 1, $overview = 0) { +function menu_add($name, $link, $title = NULL, $help = NULL, $parent = NULL, $weight = 1) { if (!db_result(db_query("SELECT name FROM menu WHERE link = '%s'", $link))) { - db_query("INSERT INTO menu (name, link, title, help, parent, weight, overview) VALUES ('%s', '%s', '%s', '%s', '%s', '%d', '%d')", $name, $link, $title, $help, $parent, $weight, $overview); + db_query("INSERT INTO menu (name, link, title, help, parent, weight) VALUES ('%s', '%s', '%s', '%s', '%s', '%d')", $name, $link, $title, $help, $parent, $weight); } } -?> \ No newline at end of file +?> diff --git a/modules/comment.module b/modules/comment.module index 73c7d898fd2..79b71522f33 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -660,7 +660,7 @@ function comment_link($type, $node = 0, $main = 0) { if ($type == "admin" && user_access("administer comments")) { $settings = "If you really have a lot of comments, you can enable moderation. You assign moderation permissions to role(s), then setup some 'moderation votes'; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, a value, which can be either positive or negative; use the moderation matrix to do this. This allows for some roles having greater 'weight' in their moderation, if you wish. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Finally, you may want to setup the comment thresholds: these are floor/ceiling values which users see in the comment control panel. Threshholds are useful for hiding poorly rated comments while reading your site."; - menu_add("comment management", url("admin/comment"), "Administer comments.", $help["comment"], "content management", 1, 1); + menu_add("comment management", url("admin/comment"), "Administer comments.", $help["comment"], "content management", 1); menu_add("new or updated comments", url("admin/comment&status=0"), "Display new or updated comments.", NULL, "comment management"); menu_add("comments that await approval", url("admin/comment&status=1"), "Display comments that await approval.", NULL, "comment management"); menu_add("search comment", url("admin/comment/search"), "Search a comment.", NULL, "comment management", 8); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 73c7d898fd2..79b71522f33 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -660,7 +660,7 @@ function comment_link($type, $node = 0, $main = 0) { if ($type == "admin" && user_access("administer comments")) { $settings = "If you really have a lot of comments, you can enable moderation. You assign moderation permissions to role(s), then setup some 'moderation votes'; these votes will appear to moderators in a dropdown menu near the comment. You also have to assign, for every role and every vote, a value, which can be either positive or negative; use the moderation matrix to do this. This allows for some roles having greater 'weight' in their moderation, if you wish. If you set a value to 0, that vote won't be available to that role. When a user moderates, the value of their vote is added or subtracted to the score of that comment. Finally, you may want to setup the comment thresholds: these are floor/ceiling values which users see in the comment control panel. Threshholds are useful for hiding poorly rated comments while reading your site."; - menu_add("comment management", url("admin/comment"), "Administer comments.", $help["comment"], "content management", 1, 1); + menu_add("comment management", url("admin/comment"), "Administer comments.", $help["comment"], "content management", 1); menu_add("new or updated comments", url("admin/comment&status=0"), "Display new or updated comments.", NULL, "comment management"); menu_add("comments that await approval", url("admin/comment&status=1"), "Display comments that await approval.", NULL, "comment management"); menu_add("search comment", url("admin/comment/search"), "Search a comment.", NULL, "comment management", 8); diff --git a/modules/node.module b/modules/node.module index e48945e0204..ba89972b7b5 100644 --- a/modules/node.module +++ b/modules/node.module @@ -454,9 +454,9 @@ function node_link($type, $node = 0, $main = 0) { $search = "On this page you can search for a post. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'."; menu_add("content management", url("admin/node"), "Content management.", NULL, NULL); - menu_add("submit new content", url("node/add"), "Submit new content.", NULL, "content management", -1, 1); - menu_add("new or updated posts", url("admin/node/nodes/0"), "Display all new or updated posts.", NULL, "content management", 0, 1); - menu_add("posts that await approval", url("admin/node/nodes/1"), "Display posts that await approval.", NULL, "content management", 0, 1); + menu_add("submit new content", url("node/add"), "Submit new content.", NULL, "content management", -1); + menu_add("new or updated posts", url("admin/node/nodes/0"), "Display all new or updated posts.", NULL, "content management", 0); + menu_add("posts that await approval", url("admin/node/nodes/1"), "Display posts that await approval.", NULL, "content management", 0); menu_add("search content", url("admin/node/search"), "Search a post.", $search, "content management", 5); menu_add("help", url("admin/node/help"), "More information about content management.", NULL, "content management", 7); } diff --git a/modules/node/node.module b/modules/node/node.module index e48945e0204..ba89972b7b5 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -454,9 +454,9 @@ function node_link($type, $node = 0, $main = 0) { $search = "On this page you can search for a post. For example, one may search for 'br' and Drupal might return 'bread brakers', 'our daily bread' and 'brenda'."; menu_add("content management", url("admin/node"), "Content management.", NULL, NULL); - menu_add("submit new content", url("node/add"), "Submit new content.", NULL, "content management", -1, 1); - menu_add("new or updated posts", url("admin/node/nodes/0"), "Display all new or updated posts.", NULL, "content management", 0, 1); - menu_add("posts that await approval", url("admin/node/nodes/1"), "Display posts that await approval.", NULL, "content management", 0, 1); + menu_add("submit new content", url("node/add"), "Submit new content.", NULL, "content management", -1); + menu_add("new or updated posts", url("admin/node/nodes/0"), "Display all new or updated posts.", NULL, "content management", 0); + menu_add("posts that await approval", url("admin/node/nodes/1"), "Display posts that await approval.", NULL, "content management", 0); menu_add("search content", url("admin/node/search"), "Search a post.", $search, "content management", 5); menu_add("help", url("admin/node/help"), "More information about content management.", NULL, "content management", 7); } diff --git a/modules/taxonomy.module b/modules/taxonomy.module index cee760d4f50..f899a86b5d2 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -48,7 +48,7 @@ function taxonomy_link($type) { $help["taxonomy"] = "The taxonomy module allows you to classify post into categories and subcategories; it allows multiple lists of categories for classification (controlled vocabularies) and offers the possibility of creating thesauri (controlled vocabularies that indicate the relationship of terms) and taxonomies (controlled vocabularies where relationships are indicated hierarchically)."; $help["vocabulary"] = "When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot.org's or Kuro5hin.org's sections. For more complex implementations, you might create a hierarchical list of categories."; - menu_add("taxonomy", url("admin/taxonomy"), "Administer taxonomies.", $help["taxonomy"], "content management", 1, 1); + menu_add("taxonomy", url("admin/taxonomy"), "Administer taxonomies.", $help["taxonomy"], "content management", 1); menu_add("add new vocabulary", url("admin/taxonomy/add/vocabulary"), "Add a new vocabulary.", $help["vocabulary"], "taxonomy"); menu_add("help", url("admin/taxonomy/help"), "More information about taxonomies.", NULL, "taxonomy", 9); } @@ -785,4 +785,4 @@ function taxonomy_help() {

Every term, or collection of terms, provides an RSS feed to which interested users may subscribe. The URL format for an sample RSS feed is ">.

\ No newline at end of file +?> diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index cee760d4f50..f899a86b5d2 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -48,7 +48,7 @@ function taxonomy_link($type) { $help["taxonomy"] = "The taxonomy module allows you to classify post into categories and subcategories; it allows multiple lists of categories for classification (controlled vocabularies) and offers the possibility of creating thesauri (controlled vocabularies that indicate the relationship of terms) and taxonomies (controlled vocabularies where relationships are indicated hierarchically)."; $help["vocabulary"] = "When you create a controlled vocabulary you are creating a set of terms to use for describing content (known as descriptors in indexing lingo). Drupal allows you to describe each node of content (blog, story, etc.) using one or many of these terms. For simple implementations, you might create a set of categories without subcategories, similar to Slashdot.org's or Kuro5hin.org's sections. For more complex implementations, you might create a hierarchical list of categories."; - menu_add("taxonomy", url("admin/taxonomy"), "Administer taxonomies.", $help["taxonomy"], "content management", 1, 1); + menu_add("taxonomy", url("admin/taxonomy"), "Administer taxonomies.", $help["taxonomy"], "content management", 1); menu_add("add new vocabulary", url("admin/taxonomy/add/vocabulary"), "Add a new vocabulary.", $help["vocabulary"], "taxonomy"); menu_add("help", url("admin/taxonomy/help"), "More information about taxonomies.", NULL, "taxonomy", 9); } @@ -785,4 +785,4 @@ function taxonomy_help() {

Every term, or collection of terms, provides an RSS feed to which interested users may subscribe. The URL format for an sample RSS feed is ">.

\ No newline at end of file +?> diff --git a/modules/user.module b/modules/user.module index 537ce008d2f..cb41b40a5af 100644 --- a/modules/user.module +++ b/modules/user.module @@ -404,7 +404,7 @@ function user_link($type) { menu_add("user management", url("admin/user"), "User management", $help["user"]); menu_add("create new account", url("admin/user/create"), "Create a new user account.", $help["create"], "user management", 1); - menu_add("view user accounts", url("admin/user/account"), "Display user account listings.", $help["view"], "user management", 2, 1); + menu_add("view user accounts", url("admin/user/account"), "Display user account listings.", $help["view"], "user management", 2); menu_add("access rules", url("admin/user/access"), "Configure access rules.", $help["access"], "user management", 3); menu_add("e-mail rules", url("admin/user/access/mail"), "Allow or deny certain e-mail addresses.", $help["access"], "access rules"); menu_add("username rules", url("admin/user/access/user"), "Allow or deny certain usernames.", $help["access"], "access rules"); diff --git a/modules/user/user.module b/modules/user/user.module index 537ce008d2f..cb41b40a5af 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -404,7 +404,7 @@ function user_link($type) { menu_add("user management", url("admin/user"), "User management", $help["user"]); menu_add("create new account", url("admin/user/create"), "Create a new user account.", $help["create"], "user management", 1); - menu_add("view user accounts", url("admin/user/account"), "Display user account listings.", $help["view"], "user management", 2, 1); + menu_add("view user accounts", url("admin/user/account"), "Display user account listings.", $help["view"], "user management", 2); menu_add("access rules", url("admin/user/access"), "Configure access rules.", $help["access"], "user management", 3); menu_add("e-mail rules", url("admin/user/access/mail"), "Allow or deny certain e-mail addresses.", $help["access"], "access rules"); menu_add("username rules", url("admin/user/access/user"), "Allow or deny certain usernames.", $help["access"], "access rules"); diff --git a/modules/watchdog.module b/modules/watchdog.module index 8f5e044d83e..64c3772f5dc 100644 --- a/modules/watchdog.module +++ b/modules/watchdog.module @@ -22,7 +22,7 @@ function watchdog_link($type) { $help = "The watchdog module monitors your website, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on."; menu_add("site monitoring", url("admin/watchdog"), "Monitor your site.", NULL, NULL, 2); - menu_add("watchdog", url("admin/watchdog/list/all"), "Display system events.", $help, "site monitoring", 1, 1); + menu_add("watchdog", url("admin/watchdog/list/all"), "Display system events.", $help, "site monitoring", 1); menu_add("user messages", url("admin/watchdog/list/user"), "Display system events", $help, "watchdog"); menu_add("regular messages", url("admin/watchdog/list/regular"), "Display system events", $help, "watchdog"); menu_add("special messages", url("admin/watchdog/list/special"), "Display system events", $help, "watchdog"); diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module index 8f5e044d83e..64c3772f5dc 100644 --- a/modules/watchdog/watchdog.module +++ b/modules/watchdog/watchdog.module @@ -22,7 +22,7 @@ function watchdog_link($type) { $help = "The watchdog module monitors your website, captures system events in a log and records them to be reviewed by an authorized individual at a later time. The watchdog log is simply a list of events recorded during operation and contains usage data, performance data, errors, warnings and operational information. It is vital to check the watchdog report on a regular basis as it is often the only way to tell what is going on."; menu_add("site monitoring", url("admin/watchdog"), "Monitor your site.", NULL, NULL, 2); - menu_add("watchdog", url("admin/watchdog/list/all"), "Display system events.", $help, "site monitoring", 1, 1); + menu_add("watchdog", url("admin/watchdog/list/all"), "Display system events.", $help, "site monitoring", 1); menu_add("user messages", url("admin/watchdog/list/user"), "Display system events", $help, "watchdog"); menu_add("regular messages", url("admin/watchdog/list/regular"), "Display system events", $help, "watchdog"); menu_add("special messages", url("admin/watchdog/list/special"), "Display system events", $help, "watchdog"); diff --git a/update.php b/update.php index 430a33c5584..6b7eb571280 100644 --- a/update.php +++ b/update.php @@ -653,8 +653,7 @@ function update_47() { help TEXT default '', title varchar(255) NOT NULL default '', parent varchar(255) NOT NULL default '', - weight tinyint(4) DEFAULT '0' NOT NULL, - overview tinyint(1) DEFAULT '0' NOT NULL + weight tinyint(4) DEFAULT '0' NOT NULL );"); } @@ -856,4 +855,4 @@ if ($op) { else { update_info(); } -?> \ No newline at end of file +?>