diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-10-09 15:15:55 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2008-10-09 15:15:55 +0000 |
commit | d59ba41f65a26cdd31ae9da5b847be008cd365dd (patch) | |
tree | d430e5cfc24c758d856a44687b0676fcb084a6c6 /modules/user | |
parent | c9c35d2d58e7edede8548b42481a364c86ce642d (diff) | |
download | brdo-d59ba41f65a26cdd31ae9da5b847be008cd365dd.tar.gz brdo-d59ba41f65a26cdd31ae9da5b847be008cd365dd.tar.bz2 |
#313213 by maartenvg, Gábor Hojtsy: Add a 'title' attribute for permissions to allow for localization of permission names
Diffstat (limited to 'modules/user')
-rw-r--r-- | modules/user/user.admin.inc | 13 | ||||
-rw-r--r-- | modules/user/user.module | 20 |
2 files changed, 20 insertions, 13 deletions
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc index 9260da77f..84a1c79c2 100644 --- a/modules/user/user.admin.inc +++ b/modules/user/user.admin.inc @@ -514,18 +514,13 @@ function user_admin_perm($form_state, $rid = NULL) { if ($permissions = module_invoke($module, 'perm')) { $form['permission'][] = array( '#markup' => $module, - ); - foreach ($permissions as $perm => $description) { - // Account for permissions lacking a description. - if (is_int($perm)) { - $perm = $description; - $description = NULL; - } + ); + foreach ($permissions as $perm => $perm_item) { $options[$perm] = ''; $form['permission'][$perm] = array( '#type' => 'item', - '#markup' => t($perm), - '#description' => $hide_descriptions ? $description : NULL, + '#markup' => $perm_item['title'], + '#description' => $hide_descriptions ? $perm_item['description'] : NULL, ); foreach ($role_names as $rid => $name) { // Builds arrays for checked boxes for each role diff --git a/modules/user/user.module b/modules/user/user.module index e8d956d0f..ee189ff58 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -571,10 +571,22 @@ function user_is_blocked($name) { */ function user_perm() { return array( - 'administer permissions' => t('Manage the permissions assigned to user roles. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))), - 'administer users' => t('Manage or block users, and manage their role assignments.'), - 'access user profiles' => t('View profiles of users on the site, which may contain personal information.'), - 'change own username' => t('Select a different username.'), + 'administer permissions' => array( + 'title' => t('Administer permissions'), + 'description' => t('Manage the permissions assigned to user roles. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))), + ), + 'administer users' => array( + 'title' => t('Administer users'), + 'description' => t('Manage or block users, and manage their role assignments.'), + ), + 'access user profiles' => array( + 'title' => t('Access user profiles'), + 'description' => t('View profiles of users on the site, which may contain personal information.'), + ), + 'change own username' => array( + 'title' => t('Change own username'), + 'description' => t('Select a different username.'), + ), ); } |