summaryrefslogtreecommitdiff
path: root/modules/user/user.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-11-20 21:51:23 +0000
committerDries Buytaert <dries@buytaert.net>2003-11-20 21:51:23 +0000
commit4bdac4333ba34adc61e19180b5f1bcde692615e2 (patch)
treeed30f0417f99d0257bef231f6652d1399d0e520a /modules/user/user.module
parent9000f825cc63e6b52ad4f19f633d67aa16fef799 (diff)
downloadbrdo-4bdac4333ba34adc61e19180b5f1bcde692615e2.tar.gz
brdo-4bdac4333ba34adc61e19180b5f1bcde692615e2.tar.bz2
- Patch by JonBob:
Phase 2 of the menu system integration project. This unifies the interface used by admin and non-admin pages, and deprecates the _page hook in favor of explicit callbacks from menu(). Breadcrumbs, titles, and help text go away as a result of this patch; they will return in the phase 3 patch, printed by the theme.
Diffstat (limited to 'modules/user/user.module')
-rw-r--r--modules/user/user.module32
1 files changed, 24 insertions, 8 deletions
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");
+}
+
?>