summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt1
-rw-r--r--modules/aggregator/aggregator.module5
-rw-r--r--modules/block/block.module5
-rw-r--r--modules/blog/blog.module12
-rw-r--r--modules/blogapi/blogapi.module4
-rw-r--r--modules/book/book.module7
-rw-r--r--modules/comment/comment.module7
-rw-r--r--modules/contact/contact.module6
-rw-r--r--modules/filter/filter.module4
-rw-r--r--modules/forum/forum.module12
-rw-r--r--modules/locale/locale.module5
-rw-r--r--modules/menu/menu.module4
-rw-r--r--modules/node/node.module38
-rw-r--r--modules/path/path.module5
-rw-r--r--modules/poll/poll.module9
-rw-r--r--modules/search/search.module6
-rw-r--r--modules/statistics/statistics.module5
-rw-r--r--modules/system/system.admin.inc21
-rw-r--r--modules/system/system.install39
-rw-r--r--modules/system/system.module40
-rw-r--r--modules/taxonomy/taxonomy.module4
-rw-r--r--modules/translation/translation.module4
-rw-r--r--modules/upload/upload.module5
-rw-r--r--modules/user/user.admin.inc25
-rw-r--r--modules/user/user.css3
-rw-r--r--modules/user/user.module7
26 files changed, 223 insertions, 60 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 583e5e608..acf1c2f9b 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -4,6 +4,7 @@ Drupal 7.0, xxxx-xx-xx (development version)
----------------------
- Usability:
* Implemented drag-and-drop positioning for input format listings.
+ * Provide descriptions for permissions on the administration page.
Drupal 6.0, 2008-02-13
----------------------
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 0475edba8..ba8344a8a 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -277,7 +277,10 @@ function _aggregator_has_categories() {
* Implementation of hook_perm().
*/
function aggregator_perm() {
- return array('administer news feeds', 'access news feeds');
+ return array(
+ 'administer news feeds' => t('Add, edit or delete news feeds that are aggregated to your site.'),
+ 'access news feeds' => t('View aggregated news feed items.'),
+ );
}
/**
diff --git a/modules/block/block.module b/modules/block/block.module
index fe8e8b547..64719f56a 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -110,7 +110,10 @@ function block_theme() {
* Implementation of hook_perm().
*/
function block_perm() {
- return array('administer blocks', 'use PHP for block visibility');
+ return array(
+ 'administer blocks' => t('Select which blocks are displayed, and arrange them on the page.'),
+ 'use PHP for block visibility' => t('Enter PHP code in the field for block visibility settings. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))),
+ );
}
/**
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index 2a757cfec..172f6833d 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -23,7 +23,7 @@ function blog_node_info() {
* Implementation of hook_perm().
*/
function blog_perm() {
- return array('create blog entries', 'delete own blog entries', 'delete any blog entry', 'edit own blog entries', 'edit any blog entry');
+ return node_list_permissions('blog');
}
/**
@@ -33,11 +33,11 @@ function blog_access($op, $node, $account) {
switch ($op) {
case 'create':
// Anonymous users cannot post even if they have the permission.
- return user_access('create blog entries', $account) && $account->uid;
+ return user_access('create blog content', $account) && $account->uid;
case 'update':
- return user_access('edit any blog entry', $account) || (user_access('edit own blog entries', $account) && ($node->uid == $account->uid));
+ return user_access('edit any blog content', $account) || (user_access('edit own blog content', $account) && ($node->uid == $account->uid));
case 'delete':
- return user_access('delete any blog entry', $account) || (user_access('delete own blog entries', $account) && ($node->uid == $account->uid));
+ return user_access('delete any blog content', $account) || (user_access('delete own blog content', $account) && ($node->uid == $account->uid));
}
}
@@ -45,7 +45,7 @@ function blog_access($op, $node, $account) {
* Implementation of hook_user().
*/
function blog_user($type, &$edit, &$user) {
- if ($type == 'view' && user_access('create blog entries', $user)) {
+ if ($type == 'view' && user_access('create blog content', $user)) {
$user->content['summary']['blog'] = array(
'#type' => 'user_profile_item',
'#title' => t('Blog'),
@@ -145,7 +145,7 @@ function blog_menu() {
'page callback' => 'blog_page_user',
'page arguments' => array(1),
'access callback' => 'user_access',
- 'access arguments' => array('create blog entries', 1),
+ 'access arguments' => array('create blog content', 1),
'file' => 'blog.pages.inc',
);
$items['blog/%user/feed'] = array(
diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module
index 40395a8c0..b23f288d4 100644
--- a/modules/blogapi/blogapi.module
+++ b/modules/blogapi/blogapi.module
@@ -24,7 +24,9 @@ function blogapi_help($path, $arg) {
* Implementation of hook_perm().
*/
function blogapi_perm() {
- return array('administer content with blog api');
+ return array(
+ 'administer content with blog api' => t('Manage website content from external tools.'),
+ );
}
/**
diff --git a/modules/book/book.module b/modules/book/book.module
index f4dc78999..31ddb5526 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -40,7 +40,12 @@ function book_theme() {
* Implementation of hook_perm().
*/
function book_perm() {
- return array('add content to books', 'administer book outlines', 'create new books', 'access printer-friendly version');
+ return array(
+ 'add content to books' => t('Add new content and child pages to books.'),
+ 'administer book outlines' => t('Manage books through the administration panel.'),
+ 'create new books' => t('Add new top-level books.'),
+ 'access printer-friendly version' => t('View a book page and all of its sub-pages as a single document for ease of printing. Can be performance heavy.'),
+ );
}
/**
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index faf77f741..2eb985559 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -271,7 +271,12 @@ function comment_node_type($op, $info) {
* Implementation of hook_perm().
*/
function comment_perm() {
- return array('access comments', 'post comments', 'administer comments', 'post comments without approval');
+ return array(
+ 'access comments' => t('View comments attached to content.'),
+ 'post comments' => t('Add comments to content (approval required).'),
+ 'post comments without approval' => t('Add comments to content (no approval required).'),
+ 'administer comments' => t('Manage and approve comments, and configure comment administration settings.'),
+ );
}
/**
diff --git a/modules/contact/contact.module b/modules/contact/contact.module
index 5a51385cd..7883fe869 100644
--- a/modules/contact/contact.module
+++ b/modules/contact/contact.module
@@ -36,8 +36,12 @@ function contact_help($path, $arg) {
* Implementation of hook_perm
*/
function contact_perm() {
- return array('access site-wide contact form', 'administer site-wide contact form');
+ return array(
+ 'access site-wide contact form' => t('Send feedback to administrators via e-mail using the site-wide contact form.'),
+ 'administer site-wide contact form' => t('Configure site-wide contact form administration settings.'),
+ );
}
+
/**
* Implementation of hook_menu().
*/
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index bb125aa5e..522b7a0f9 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -150,7 +150,9 @@ function filter_admin_format_title($format) {
* Implementation of hook_perm().
*/
function filter_perm() {
- return array('administer filters');
+ return array(
+ 'administer filters' => t('Manage input formats and filters, and select which roles may use them. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))),
+ );
}
/**
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index a58c62f33..29c97ca7b 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -307,11 +307,11 @@ function forum_node_info() {
function forum_access($op, $node, $account) {
switch ($op) {
case 'create':
- return user_access('create forum topics', $account);
+ return user_access('create forum content', $account);
case 'update':
- return user_access('edit any forum topic', $account) || (user_access('edit own forum topics', $account) && ($account->uid == $node->uid));
+ return user_access('edit any forum content', $account) || (user_access('edit own forum content', $account) && ($account->uid == $node->uid));
case 'delete':
- return user_access('delete any forum topic', $account) || (user_access('delete own forum topics', $account) && ($account->uid == $node->uid));
+ return user_access('delete any forum content', $account) || (user_access('delete own forum content', $account) && ($account->uid == $node->uid));
}
}
@@ -319,7 +319,11 @@ function forum_access($op, $node, $account) {
* Implementation of hook_perm().
*/
function forum_perm() {
- return array('create forum topics', 'delete own forum topics', 'delete any forum topic', 'edit own forum topics', 'edit any forum topic', 'administer forums');
+ $perms = array(
+ 'administer forums' => t('Manage forums and configure forum administration settings.'),
+ );
+ $perms += node_list_permissions('forum');
+ return $perms;
}
/**
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index 3aafbda17..26d83ee4d 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -186,7 +186,10 @@ function locale_inc_callback() {
* Implementation of hook_perm().
*/
function locale_perm() {
- return array('administer languages', 'translate interface');
+ return array(
+ 'administer languages' => t('Manage the languages in which the website content and interface text may be displayed.'),
+ 'translate interface' => t('Translate the text of the website interface.'),
+ );
}
/**
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index 03fca87a1..cce0dac6f 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -37,7 +37,9 @@ function menu_help($path, $arg) {
* Implementation of hook_perm().
*/
function menu_perm() {
- return array('administer menu');
+ return array(
+ 'administer menu' => t('Manage menus and menu items.'),
+ );
}
/**
diff --git a/modules/node/node.module b/modules/node/node.module
index b517608d9..9213311fb 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1120,16 +1120,18 @@ function theme_node_log_message($log) {
* Implementation of hook_perm().
*/
function node_perm() {
- $perms = array('administer content types', 'administer nodes', 'access content', 'view revisions', 'revert revisions', 'delete revisions');
+ $perms = array(
+ 'administer content types' => t('Manage content types and content type administration settings.'),
+ 'administer nodes' => t('Manage all website content, and bypass any content-related access control. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))),
+ 'access content' => t('View published content.'),
+ 'view revisions' => t('View content revisions.'),
+ 'revert revisions' => t('Replace content with an older revision.'),
+ 'delete revisions' => t('Delete content revisions.'),
+ );
foreach (node_get_types() as $type) {
if ($type->module == 'node') {
- $name = check_plain($type->type);
- $perms[] = 'create '. $name .' content';
- $perms[] = 'delete own '. $name .' content';
- $perms[] = 'delete any '. $name .' content';
- $perms[] = 'edit own '. $name .' content';
- $perms[] = 'edit any '. $name .' content';
+ $perms += node_list_permissions($type);
}
}
@@ -2731,3 +2733,25 @@ function node_unpublish_by_keyword_action($node, $context) {
}
}
}
+
+/**
+ * Helper function to generate standard node permission list for a given type.
+ *
+ * @param $type
+ * The machine-readable name of the node type.
+ * @return array
+ * An array of permission names and descriptions.
+ */
+function node_list_permissions($type) {
+ $info = node_get_types('type', $type);
+ $type = check_plain($info->type);
+
+ // Build standard list of node permissions for this type.
+ $perms["create $type content"] = t('Create new %type_name content.', array('%type_name' => $info->name));
+ $perms["delete any $type content"] = t('Delete any %type_name content, regardless of its author.', array('%type_name' => $info->name));
+ $perms["delete own $type content"] = t('Delete %type_name content created by the user.', array('%type_name' => $info->name));
+ $perms["edit own $type content"] = t('Edit %type_name content created by the user.', array('%type_name' => $info->name));
+ $perms["edit any $type content"] = t('Edit any %type_name content, regardless of its author.', array('%type_name' => $info->name));
+
+ return $perms;
+}
diff --git a/modules/path/path.module b/modules/path/path.module
index 87bd6cdfe..29db175a6 100644
--- a/modules/path/path.module
+++ b/modules/path/path.module
@@ -206,7 +206,10 @@ function path_form_alter(&$form, $form_state, $form_id) {
* Implementation of hook_perm().
*/
function path_perm() {
- return array('create url aliases', 'administer url aliases');
+ return array(
+ 'create url aliases' => t('Manage URL aliases on content.'),
+ 'administer url aliases' => t('Manage URL aliases across the entire website.'),
+ );
}
/**
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index 155b3c7ad..68df707a7 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -54,7 +54,14 @@ function poll_theme() {
* Implementation of hook_perm().
*/
function poll_perm() {
- return array('create poll content', 'delete own poll content', 'delete any poll content', 'edit any poll content', 'edit own poll content', 'vote on polls', 'cancel own vote', 'inspect all votes');
+ $perms = node_list_permissions('poll');
+ $perms += array(
+ 'vote on polls' => t('Cast votes on polls.'),
+ 'cancel own vote' => t('Retract and optionally change own votes.'),
+ 'inspect all votes' => t('View voting results.'),
+ );
+
+ return $perms;
}
/**
diff --git a/modules/search/search.module b/modules/search/search.module
index 56bb1baa8..082b626d3 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -141,7 +141,11 @@ function search_theme() {
* Implementation of hook_perm().
*/
function search_perm() {
- return array('search content', 'use advanced search', 'administer search');
+ return array(
+ 'search content' => t('Search website content.'),
+ 'use advanced search' => t('Limit search results with additional criteria, such as specific content types. Could have performance implications.'),
+ 'administer search' => t('Configure search administration settings.'),
+ );
}
/**
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index 1242e973b..b92f79c90 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -69,7 +69,10 @@ function statistics_exit() {
* Implementation of hook_perm().
*/
function statistics_perm() {
- return array('access statistics', 'view post access counter');
+ return array(
+ 'access statistics' => t('View content access statistics.'),
+ 'view post access counter' => t('View the total number of times a piece of content has been accessed.'),
+ );
}
/**
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index edfb2a926..9ec72a6d2 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -82,18 +82,6 @@ function system_admin_menu_block_page() {
}
/**
- * Menu callback; Sets whether the admin menu is in compact mode or not.
- *
- * @param $mode
- * Valid values are 'on' and 'off'.
- */
-function system_admin_compact_page($mode = 'off') {
- global $user;
- user_save($user, array('admin_compact_mode' => ($mode == 'on')));
- drupal_goto('admin');
-}
-
-/**
* Menu callback; prints a listing of admin tasks for each installed module.
*/
function system_admin_by_module() {
@@ -1899,14 +1887,7 @@ function theme_admin_page($blocks) {
}
$output = '<div class="admin clear-block">';
- $output .= '<div class="compact-link">';
- if (system_admin_compact_mode()) {
- $output .= l(t('Show descriptions'), 'admin/compact/off', array('title' => t('Expand layout to include descriptions.')));
- }
- else {
- $output .= l(t('Hide descriptions'), 'admin/compact/on', array('title' => t('Compress layout by hiding descriptions.')));
- }
- $output .= '</div>';
+ $output .= theme('system_compact_link');
foreach ($container as $id => $data) {
$output .= '<div class="'. $id .' clear-block">';
diff --git a/modules/system/system.install b/modules/system/system.install
index 2f70091b3..d0fd48c45 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -2471,3 +2471,42 @@ function system_update_6047() {
* @} End of "defgroup updates-5.x-to-6.x"
* The next series of updates should start at 7000.
*/
+
+/**
+ * @defgroup updates-6.x-to-7.x System updates from 6.x to 7.x
+ * @{
+ */
+
+/**
+ * Rename blog and forum permissions to be consistent with other content types.
+ */
+function system_update_7000() {
+ $ret = array();
+ $result = db_query("SELECT rid, perm FROM {permission} ORDER BY rid");
+ while ($role = db_fetch_object($result)) {
+ $renamed_permission = preg_replace('/(?<=^|,\ )create\ blog\ entries(?=,|$)/', 'create blog content', $role->perm);
+ $renamed_permission = preg_replace('/(?<=^|,\ )edit\ own\ blog\ entries(?=,|$)/', 'edit own blog content', $role->perm);
+ $renamed_permission = preg_replace('/(?<=^|,\ )edit\ any\ blog\ entry(?=,|$)/', 'edit any blog content', $role->perm);
+ $renamed_permission = preg_replace('/(?<=^|,\ )delete\ own\ blog\ entries(?=,|$)/', 'delete own blog content', $role->perm);
+ $renamed_permission = preg_replace('/(?<=^|,\ )delete\ any\ blog\ entry(?=,|$)/', 'delete any blog content', $role->perm);
+
+ $renamed_permission = preg_replace('/(?<=^|,\ )create\ forum\ topics(?=,|$)/', 'create forum content', $role->perm);
+ $renamed_permission = preg_replace('/(?<=^|,\ )delete\ any\ forum\ topic(?=,|$)/', 'delete any forum content', $role->perm);
+ $renamed_permission = preg_replace('/(?<=^|,\ )delete\ own\ forum\ topics(?=,|$)/', 'delete own forum content', $role->perm);
+ $renamed_permission = preg_replace('/(?<=^|,\ )edit\ any\ forum\ topic(?=,|$)/', 'edit any forum content', $role->perm);
+ $renamed_permission = preg_replace('/(?<=^|,\ )edit\ own\ forum\ topics(?=,|$)/', 'edit own forum content', $role->perm);
+
+ if ($renamed_permission != $role->perm) {
+ $ret[] = update_sql("UPDATE {permission} SET perm = '$renamed_permission' WHERE rid = $role->rid");
+ }
+ }
+
+ return $ret;
+}
+
+/**
+ * @} End of "defgroup updates-6.x-to-7.x"
+ * The next series of updates should start at 8000.
+ */
+
+
diff --git a/modules/system/system.module b/modules/system/system.module
index d3f9d6fae..67a32cee6 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -148,6 +148,7 @@ function system_theme() {
'system_powered_by' => array(
'arguments' => array('image_path' => NULL),
),
+ 'system_compact_link' => array(),
));
}
@@ -155,7 +156,14 @@ function system_theme() {
* Implementation of hook_perm().
*/
function system_perm() {
- return array('administer site configuration', 'access administration pages', 'administer actions', 'access site reports', 'select different theme', 'administer files');
+ return array(
+ 'administer site configuration' => t('Configure site-wide settings such as module or theme administration settings.'),
+ 'access administration pages' => t('View the administration panel and browse the help system.'),
+ 'administer actions' => t('Manage the actions defined for your site.'),
+ 'access site reports' => t('View reports from system logs and other status information.'),
+ 'select different theme' => t('Select a theme other than the default theme set by the site administrator.'),
+ 'administer files' => t('Manage user-uploaded files.'),
+ );
}
/**
@@ -1159,6 +1167,18 @@ function system_admin_compact_mode() {
}
/**
+ * Menu callback; Sets whether the admin menu is in compact mode or not.
+ *
+ * @param $mode
+ * Valid values are 'on' and 'off'.
+ */
+function system_admin_compact_page($mode = 'off') {
+ global $user;
+ user_save($user, array('admin_compact_mode' => ($mode == 'on')));
+ drupal_goto(drupal_get_destination());
+}
+
+/**
* Generate a list of tasks offered by a specified module.
*
* @param $module
@@ -1875,3 +1895,21 @@ function theme_system_powered_by($image_path) {
$image = theme('image', $image_path, t('Powered by Drupal, an open source content management system'), t('Powered by Drupal, an open source content management system'));
return l($image, 'http://drupal.org', array('html' => TRUE, 'absolute' => TRUE, 'external' => TRUE));
}
+
+/**
+ * Display the link to show or hide inline help descriptions.
+ *
+ * @ingroup themeable
+ */
+function theme_system_compact_link() {
+ $output = '<div class="compact-link">';
+ if (system_admin_compact_mode()) {
+ $output .= l(t('Show descriptions'), 'admin/compact/off', array('title' => t('Expand layout to include descriptions.'), 'query' => drupal_get_destination()));
+ }
+ else {
+ $output .= l(t('Hide descriptions'), 'admin/compact/on', array('title' => t('Compress layout by hiding descriptions.'), 'query' => drupal_get_destination()));
+ }
+ $output .= '</div>';
+
+ return $output;
+}
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index d649a7bc6..3f7a194c6 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -10,7 +10,9 @@
* Implementation of hook_perm().
*/
function taxonomy_perm() {
- return array('administer taxonomy');
+ return array(
+ 'administer taxonomy' => t('Manage taxonomy vocabularies and terms.'),
+ );
}
/**
diff --git a/modules/translation/translation.module b/modules/translation/translation.module
index 0a59861cb..baed4d15a 100644
--- a/modules/translation/translation.module
+++ b/modules/translation/translation.module
@@ -86,7 +86,9 @@ function _translation_tab_access($node) {
* Implementation of hook_perm().
*/
function translation_perm() {
- return array('translate content');
+ return array(
+ 'translate content' => t('Translate website content.'),
+ );
}
/**
diff --git a/modules/upload/upload.module b/modules/upload/upload.module
index d291faa39..117333793 100644
--- a/modules/upload/upload.module
+++ b/modules/upload/upload.module
@@ -43,7 +43,10 @@ function upload_theme() {
* Implementation of hook_perm().
*/
function upload_perm() {
- return array('upload files', 'view uploaded files');
+ return array(
+ 'upload files' => t('Attach images and other files to content.'),
+ 'view uploaded files' => t('View and download files attached to content.'),
+ );
}
/**
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc
index c639280c3..3e554151e 100644
--- a/modules/user/user.admin.inc
+++ b/modules/user/user.admin.inc
@@ -516,15 +516,25 @@ function user_admin_perm($form_state, $rid = NULL) {
// Render role/permission overview:
$options = array();
+ $hide_descriptions = !system_admin_compact_mode();
foreach (module_list(FALSE, FALSE, TRUE) as $module) {
if ($permissions = module_invoke($module, 'perm')) {
$form['permission'][] = array(
'#value' => $module,
);
- asort($permissions);
- foreach ($permissions as $perm) {
+ ksort($permissions);
+ foreach ($permissions as $perm => $description) {
+ // Account for permissions lacking a description.
+ if (is_int($perm)) {
+ $perm = $description;
+ $description = NULL;
+ }
$options[$perm] = '';
- $form['permission'][$perm] = array('#value' => t($perm));
+ $form['permission'][$perm] = array(
+ '#type' => 'item',
+ '#value' => t($perm),
+ '#description' => $hide_descriptions ? $description : NULL,
+ );
foreach ($role_names as $rid => $name) {
// Builds arrays for checked boxes for each role
if (strpos($role_permissions[$rid], $perm .',') !== FALSE) {
@@ -582,7 +592,11 @@ function theme_user_admin_perm($form) {
$row[] = array('data' => t('@module module', array('@module' => drupal_render($form['permission'][$key]))), 'class' => 'module', 'id' => 'module-'. $form['permission'][$key]['#value'], 'colspan' => count($form['role_names']) + 1);
}
else {
- $row[] = array('data' => drupal_render($form['permission'][$key]), 'class' => 'permission');
+ // Permission row.
+ $row[] = array(
+ 'data' => drupal_render($form['permission'][$key]),
+ 'class' => 'permission',
+ );
foreach (element_children($form['checkboxes']) as $rid) {
if (is_array($form['checkboxes'][$rid])) {
$row[] = array('data' => drupal_render($form['checkboxes'][$rid][$key]), 'class' => 'checkbox', 'title' => $roles[$rid] .' : '. t($key));
@@ -598,7 +612,8 @@ function theme_user_admin_perm($form) {
$header[] = array('data' => drupal_render($form['role_names'][$rid]), 'class' => 'checkbox');
}
}
- $output = theme('table', $header, $rows, array('id' => 'permissions'));
+ $output = theme('system_compact_link');
+ $output .= theme('table', $header, $rows, array('id' => 'permissions'));
$output .= drupal_render($form);
return $output;
}
diff --git a/modules/user/user.css b/modules/user/user.css
index 8e08c778a..977badd70 100644
--- a/modules/user/user.css
+++ b/modules/user/user.css
@@ -6,6 +6,9 @@
#permissions td.permission {
padding-left: 1.5em; /* LTR */
}
+#permissions tr.odd .form-item, tr.even .form-item {
+ white-space: normal;
+}
#access-rules .access-type, #access-rules .rule-type {
margin-right: 1em; /* LTR */
float: left; /* LTR */
diff --git a/modules/user/user.module b/modules/user/user.module
index 0effc2601..d59cd9d99 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -491,7 +491,12 @@ function user_is_blocked($name) {
* Implementation of hook_perm().
*/
function user_perm() {
- return array('administer permissions', 'administer users', 'access user profiles', 'change own username');
+ 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.'),
+ );
}
/**