From b79b831152f79b412ce35c91193332c66ba94580 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 19 Aug 2003 20:48:25 +0000 Subject: - Updated the user module to use the new help system approach. --- modules/user.module | 81 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 34 deletions(-) (limited to 'modules/user.module') diff --git a/modules/user.module b/modules/user.module index e8468ff3d..f579fb2ff 100644 --- a/modules/user.module +++ b/modules/user.module @@ -458,39 +458,24 @@ function user_link($type) { } if ($type == "admin" && user_access("administer users")) { - $help["user"] = t("Drupal allows users to register, login, logout, maintain user profiles, etc. No participant can use his own name to post content until he signs up for a user account.
Click on either the \"username\" or \"edit account\" to edit a user's information."); - $help["create"] = t("This web page allows the administrators to register a new users by hand.
Note:"); - $help["view"] = t("This page allows you to review and edit any user's profile. To edit a profile click on either the \"username\" or \"edit account\"."); - $help["view-active"] = t("This page allows you to review and edit an active user's profile. To edit a profile click on either the \"username\" or \"edit account\"."); - $help["view-new"] = t("This page allows you to review and edit a new user's profile. To edit a profile click on either the \"username\" or \"edit account\"."); - $help["view-block"] = t("This page allows you to review and edit a blocked user's profile. To edit a profile click on either the \"username\" or \"edit account\"."); - $help["view-role"] = "This page allows you to review and edit a user with role '%role's profile. To edit a profile click on either the \"username\" or \"edit account\"."; - $help["access-overview"] = t("Access rules allow Drupal administrators to choose usernames and E-Mail address that are prevented from using drupal. To enter the mask for E-Mail addresses click on e-mail rules, for the username mask click on username rules", array("%e-mail" => url("admin/user/access/mail"), "%username" => url("admin/user/access/user"))); - $help["access-email"] = t("Setup and test the E-Mail access rules. The access function checks if you match a deny and not an allow. If you match only a deny then it is denied. Any other case, such as both a deny and an allow pattern matching, allows the pattern.
Notes: "); - $help["access-name"] = t("Setup and test the Username access rules. The access function checks if you match a deny and not an allow. If you do then it is denied. Any other case, such as a deny pattern and an allow pattern, allows the pattern.
Notes: "); - $help["permission"] = t("In this area you will define the permissions for each user role (Role names are defined in user roles). Each permission describes a fine-grained logical operation, such as being able to access the administration pages, or adding/modifying a user account. You could say a permission represents access granted to a user to perform a set of operations.", array("%role" => url("admin/user/role"))); - $help["role"] = t("Roles allow you to fine tune the security and administration of drupal. A role defines a group of users that have certain privileges as defined in user permissions. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the names of the various roles. To delete a role choose \"edit role\"
By default, Drupal comes with two user roles: ", array("%permission" => url("admin/user/permission"))); - $help["search"] = t("Enter a simple pattern ( '*' may be user as a wildcard match) to search for a username. For example, one may search for 'br' and Drupal might return 'brian', 'brad', and 'brenda'."); - - menu("admin/user", "user management", "user_admin", $help["user"], 2); - menu("admin/user/create", "create new account", "user_admin", $help["create"], 1); - menu("admin/user/account", "view user accounts", "user_admin", $help["view"], 2); - menu("admin/user/access", "access rules", NULL, $help["access-overview"], 3); - menu("admin/user/access/mail", "e-mail rules", "user_admin", $help["access-email"]); - menu("admin/user/access/user", "username rules", "user_admin", $help["access-name"]); - menu("admin/user/role", "user roles", "user_admin", $help["role"], 4); - menu("admin/user/permission", "user permissions", "user_admin", $help["permission"], 5); - menu("admin/user/search", "search accounts", "user_admin", $help["search"], 8); + 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/0", "active users", "user_admin", $help["view-active"], 1); - menu("admin/user/account/1", "new users", "user_admin", $help["view-new"], 2); - menu("admin/user/account/2", "blocked users", "user_admin", $help["view-block"], 3); + menu("admin/user/account/0", "active users", "user_admin", user_help("admin/user/account/0"), 1); + menu("admin/user/account/1", "new users", "user_admin", user_help("admin/user/account/1"), 2); + menu("admin/user/account/2", "blocked users", "user_admin", user_help("admin/user/account/2"), 3); $i = 3; foreach (user_roles(1) as $key => $value) { - $help_msg = t($help["view-role"], array("%role" => $value)); - menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", $help_msg, 4); + menu("admin/user/account/". $i++, "users with role '$value'", "user_admin", NULL, 4); } } @@ -1718,12 +1703,40 @@ function user_help_users_da() { } // the following functions comprise help for admins and developers -function user_help() { - $output .= user_help_admin(); - $output .= user_help_admin_da(); - $output .= user_help_devel_da(); - $output .= user_help_devel_userhook(); - return t($output); +function user_help($section = "admin/user/help") { + + switch ($section) { + case "admin/user/help": + $output = user_help_admin(); + $output .= user_help_admin_da(); + $output .= user_help_devel_da(); + $output .= user_help_devel_userhook(); + return t($output); + case "admin/user": + return t("Drupal allows users to register, login, logout, maintain user profiles, etc. No participant can use his own name to post content until he signs up for a user account.
Click on either the \"username\" or \"edit account\" to edit a user's information."); + case "admin/user/create": + return t("This web page allows the administrators to register a new users by hand.
Note:"); + case "admin/user/account": + return t("This page allows you to review and edit any user's profile. To edit a profile click on either the \"username\" or \"edit account\"."); + case "admin/user/account/0": + return t("This page allows you to review and edit an active user's profile. To edit a profile click on either the \"username\" or \"edit account\"."); + case "admin/user/account/1": + return t("This page allows you to review and edit a new user's profile. To edit a profile click on either the \"username\" or \"edit account\"."); + case "admin/user/account/2": + return t("This page allows you to review and edit a blocked user's profile. To edit a profile click on either the \"username\" or \"edit account\"."); + case "admin/user/access": + return t("Access rules allow Drupal administrators to choose usernames and e-mail address that are prevented from using drupal. To enter the mask for e-mail addresses click on e-mail rules, for the username mask click on username rules.", array("%e-mail" => url("admin/user/access/mail"), "%username" => url("admin/user/access/user"))); + case "admin/user/access/mail": + return t("Setup and test the e-mail access rules. The access function checks if you match a deny and not an allow. If you match only a deny then it is denied. Any other case, such as both a deny and an allow pattern matching, allows the pattern.
Notes: "); + case "admin/user/access/user": + return t("Setup and test the Username access rules. The access function checks if you match a deny and not an allow. If you do then it is denied. Any other case, such as a deny pattern and an allow pattern, allows the pattern.
Notes: "); + case "admin/user/permission": + return t("In this area you will define the permissions for each user role (role names are defined on the user roles page). Each permission describes a fine-grained logical operation, such as being able to access the administration pages, or adding/modifying a user account. You could say a permission represents access granted to a user to perform a set of operations.", array("%role" => url("admin/user/role"))); + case "admin/user/role": + return t("Roles allow you to fine tune the security and administration of drupal. A role defines a group of users that have certain privileges as defined in user permissions. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the names of the various roles. To delete a role choose \"edit role\"
By default, Drupal comes with two user roles: ", array("%permission" => url("admin/user/permission"))); + case "admin/user/search": + return t("Enter a simple pattern ( '*' may be user as a wildcard match) to search for a username. For example, one may search for 'br' and Drupal might return 'brian', 'brad', and 'brenda'."); + } } function user_help_admin() { -- cgit v1.2.3