From d59ba41f65a26cdd31ae9da5b847be008cd365dd Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 9 Oct 2008 15:15:55 +0000 Subject: =?UTF-8?q?#313213=20by=20maartenvg,=20G=C3=A1bor=20Hojtsy:=20Add?= =?UTF-8?q?=20a=20'title'=20attribute=20for=20permissions=20to=20allow=20f?= =?UTF-8?q?or=20localization=20of=20permission=20names?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/user/user.admin.inc | 13 ++++--------- modules/user/user.module | 20 ++++++++++++++++---- 2 files changed, 20 insertions(+), 13 deletions(-) (limited to 'modules/user') 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.'), + ), ); } -- cgit v1.2.3