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/node/node.module | 57 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 11 deletions(-) (limited to 'modules/node/node.module') diff --git a/modules/node/node.module b/modules/node/node.module index 104c0f1c1..0f8c5f9fd 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1170,12 +1170,30 @@ function theme_node_log_message($log) { */ function node_perm() { $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.'), + 'administer content types' => array( + 'title' => t('Administer content types'), + 'description' => t('Manage content types and content type administration settings.'), + ), + 'administer nodes' => array( + 'title' => t('Administer nodes'), + 'description' => 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' => array( + 'title' => t('Access content'), + 'description' => t('View published content.'), + ), + 'view revisions' => array( + 'title' => t('View revisions'), + 'description' => t('View content revisions.'), + ), + 'revert revisions' => array( + 'title' => t('Revert revisions'), + 'description' => t('Replace content with an older revision.'), + ), + 'delete revisions' => array( + 'title' => t('Delete revisions'), + 'description' => t('Delete content revisions.'), + ), ); foreach (node_get_types() as $type) { @@ -2874,11 +2892,28 @@ function node_list_permissions($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["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)); - $perms["delete own $type content"] = t('Delete %type_name content created by the user.', 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 = array( + "create $type content" => array( + 'title' => t('Create %type_name content', array('%type_name' => $info->name)), + 'description' => t('Create new %type_name content.', array('%type_name' => $info->name)), + ), + "edit own $type content" => array( + 'title' => t('Edit own %type_name content', array('%type_name' => $info->name)), + 'description' => t('Edit %type_name content created by the user.', array('%type_name' => $info->name)), + ), + "edit any $type content" => array( + 'title' => t('Edit any %type_name content', array('%type_name' => $info->name)), + 'description' => t('Edit any %type_name content, regardless of its author.', array('%type_name' => $info->name)), + ), + "delete own $type content" => array( + 'title' => t('Delete own %type_name content', array('%type_name' => $info->name)), + 'description' => t('Delete %type_name content created by the user.', array('%type_name' => $info->name)), + ), + "delete any $type content" => array( + 'title' => t('Delete any %type_name content', array('%type_name' => $info->name)), + 'description' => t('Delete any %type_name content, regardless of its author.', array('%type_name' => $info->name)), + ), + ); return $perms; } -- cgit v1.2.3