diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/user.module | 81 | ||||
-rw-r--r-- | modules/user/user.module | 81 |
2 files changed, 94 insertions, 68 deletions
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.<br />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.<br />Note:<ul><li>You cannot have a user where either the E-Mail address or the username match another user in the system</li></ul>"); - $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 <a href=\"%e-mail\">e-mail rules</a>, for the username mask click on <a href=\"%username\">username rules</a>", 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 <b>not</b> an allow. If you match <b>only</b> a deny then it is denied. Any other case, such as both a deny and an allow pattern matching, allows the pattern.<br />Notes: <ul><li>To delete a rule click on \"delete rule\".</li><li>The order of the rules does <b>not</b> matter.</li></ul>"); - $help["access-name"] = t("Setup and test the Username access rules. The access function checks if you match a deny and <b>not</b> an allow. If you do then it is denied. Any other case, such as a deny pattern and an allow pattern, allows the pattern.<br />Notes: <ul><li>To delete a rule click on \"delete rule\".</li><li>The order of the rules does <b>not</b> matter.</li></ul>"); - $help["permission"] = t("In this area you will define the <b>permissions</b> for each user role (Role names are defined in <a href=\"%role\">user roles</a>). 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 <a href=\"%permission\">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <b>names</b> of the various roles. To delete a role choose \"edit role\"<br />By default, Drupal comes with two user roles: <ul><li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li><li>Authenticated user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li></ul>", 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.<br />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.<br />Note:<ul><li>You cannot have a user where either the e-mail address or the username match another user in the system.</li></ul>"); + 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 <a href=\"%e-mail\">e-mail rules</a>, for the username mask click on <a href=\"%username\">username rules</a>.", 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 <b>not</b> an allow. If you match <b>only</b> a deny then it is denied. Any other case, such as both a deny and an allow pattern matching, allows the pattern.<br />Notes: <ul><li>To delete a rule click on \"delete rule\".</li><li>The order of the rules does <b>not</b> matter.</li></ul>"); + case "admin/user/access/user": + return t("Setup and test the Username access rules. The access function checks if you match a deny and <b>not</b> an allow. If you do then it is denied. Any other case, such as a deny pattern and an allow pattern, allows the pattern.<br />Notes: <ul><li>To delete a rule click on \"delete rule\".</li><li>The order of the rules does <b>not</b> matter.</li></ul>"); + case "admin/user/permission": + return t("In this area you will define the <b>permissions</b> for each user role (role names are defined on the <a href=\"%role\">user roles page</a>). 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 <a href=\"%permission\">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <b>names</b> of the various roles. To delete a role choose \"edit role\"<br />By default, Drupal comes with two user roles: <ul><li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li><li>Authenticated user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li></ul>", 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() { diff --git a/modules/user/user.module b/modules/user/user.module index e8468ff3d..f579fb2ff 100644 --- a/modules/user/user.module +++ b/modules/user/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.<br />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.<br />Note:<ul><li>You cannot have a user where either the E-Mail address or the username match another user in the system</li></ul>"); - $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 <a href=\"%e-mail\">e-mail rules</a>, for the username mask click on <a href=\"%username\">username rules</a>", 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 <b>not</b> an allow. If you match <b>only</b> a deny then it is denied. Any other case, such as both a deny and an allow pattern matching, allows the pattern.<br />Notes: <ul><li>To delete a rule click on \"delete rule\".</li><li>The order of the rules does <b>not</b> matter.</li></ul>"); - $help["access-name"] = t("Setup and test the Username access rules. The access function checks if you match a deny and <b>not</b> an allow. If you do then it is denied. Any other case, such as a deny pattern and an allow pattern, allows the pattern.<br />Notes: <ul><li>To delete a rule click on \"delete rule\".</li><li>The order of the rules does <b>not</b> matter.</li></ul>"); - $help["permission"] = t("In this area you will define the <b>permissions</b> for each user role (Role names are defined in <a href=\"%role\">user roles</a>). 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 <a href=\"%permission\">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <b>names</b> of the various roles. To delete a role choose \"edit role\"<br />By default, Drupal comes with two user roles: <ul><li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li><li>Authenticated user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li></ul>", 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.<br />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.<br />Note:<ul><li>You cannot have a user where either the e-mail address or the username match another user in the system.</li></ul>"); + 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 <a href=\"%e-mail\">e-mail rules</a>, for the username mask click on <a href=\"%username\">username rules</a>.", 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 <b>not</b> an allow. If you match <b>only</b> a deny then it is denied. Any other case, such as both a deny and an allow pattern matching, allows the pattern.<br />Notes: <ul><li>To delete a rule click on \"delete rule\".</li><li>The order of the rules does <b>not</b> matter.</li></ul>"); + case "admin/user/access/user": + return t("Setup and test the Username access rules. The access function checks if you match a deny and <b>not</b> an allow. If you do then it is denied. Any other case, such as a deny pattern and an allow pattern, allows the pattern.<br />Notes: <ul><li>To delete a rule click on \"delete rule\".</li><li>The order of the rules does <b>not</b> matter.</li></ul>"); + case "admin/user/permission": + return t("In this area you will define the <b>permissions</b> for each user role (role names are defined on the <a href=\"%role\">user roles page</a>). 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 <a href=\"%permission\">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <b>names</b> of the various roles. To delete a role choose \"edit role\"<br />By default, Drupal comes with two user roles: <ul><li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li><li>Authenticated user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li></ul>", 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() { |