Localize permission descriptions in "permission_descriptions" func

This commit is contained in:
Dmitriy Simushev 2014-07-28 10:12:12 +00:00
parent 4670851505
commit 650faf25f6

View File

@ -68,18 +68,18 @@ function permission_ids()
/** /**
* Map numerical permissions ids onto its descriptions. * Map numerical permissions ids onto its descriptions.
* *
* The descriptions are NOT localized. * The descriptions are localized.
* *
* @return array Array whose keys are numerical permission ids and values are * @return array Array whose keys are numerical permission ids and values are
* permission descriptions. * localized permission descriptions.
*/ */
function permission_descriptions() function permission_descriptions()
{ {
return array( return array(
CAN_ADMINISTRATE => 'System administration: settings, operators management, button generation', CAN_ADMINISTRATE => getlocal('System administration: settings, operators management, button generation'),
CAN_TAKEOVER => 'Take over chat thread', CAN_TAKEOVER => getlocal('Take over chat thread'),
CAN_VIEWTHREADS => 'View another operator\'s chat thread', CAN_VIEWTHREADS => getlocal('View another operator\'s chat thread'),
CAN_MODIFYPROFILE => 'Ability to modify profile', CAN_MODIFYPROFILE => getlocal('Ability to modify profile'),
); );
} }
@ -628,7 +628,7 @@ function get_permission_list()
foreach (permission_ids() as $perm_code => $perm_id) { foreach (permission_ids() as $perm_code => $perm_id) {
$permission_list[] = array( $permission_list[] = array(
'id' => $perm_id, 'id' => $perm_id,
'descr' => getlocal($descriptions[$perm_code]), 'descr' => $descriptions[$perm_code],
); );
} }
} }