# HG changeset patch # User Dan # Date 1193711883 14400 # Node ID b1530b6a06d2f6ae613d69aec6fec0238ec0c67a # Parent e878bcf0227ee3af6303d7f5c87054e997b52af9 Failsafe ACL editor interface localized diff -r e878bcf0227e -r b1530b6a06d2 includes/pageutils.php --- a/includes/pageutils.php Mon Oct 29 22:19:06 2007 -0400 +++ b/includes/pageutils.php Mon Oct 29 22:38:03 2007 -0400 @@ -2162,6 +2162,7 @@ function aclmanager($parms) { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; ob_start(); // Convenience $formstart = '
' . htmlspecialchars($response['text']) . ''; break; case 'stage1': - echo '

Manage page access

-

Please select who should be affected by this access rule.

'; + echo '

' . $lang->get('acl_lbl_welcome_title') . '

+

' . $lang->get('acl_lbl_welcome_body') . '

'; echo $formstart; - echo '

+ echo '

A group of pages

+ $groupsel = '

-

+

' . $template->username_field('data[target_id_user]') . '

-

What should this access rule control?

-

+

' . $lang->get('acl_lbl_scope') . '

+

' . $groupsel . ' -

+

- +
'; echo $formend; break; case 'success': echo '
- Permissions updated
- The permissions for ' . $response['target_name'] . ' on this page have been updated successfully.
+ ' . $lang->get('acl_lbl_save_success_title') . '
+ ' . $lang->get('acl_lbl_save_success_body', array( 'target_name' => $response['target_name'] )) . '
' . $formstart . ' @@ -2231,14 +2233,14 @@ - + ' . $formend . '
'; break; case 'delete': echo '
- Rule deleted
- The selected access rule has been successfully deleted.
+ ' . $lang->get('acl_lbl_delete_success_title') . '
+ ' . $lang->get('acl_lbl_delete_success_body', array('target_name' => $response['target_name'])) . '
' . $formstart . ' @@ -2247,22 +2249,27 @@ - + ' . $formend . '
'; break; case 'seltarget': if ( $response['type'] == 'edit' ) { - echo '

Editing permissions

'; + echo '

' . $lang->get('acl_lbl_editwin_title_edit') . '

'; } else { - echo '

Create new rule

'; + echo '

' . $lang->get('acl_lbl_editwin_title_create') . '

'; } - $type = ( $response['target_type'] == ACL_TYPE_GROUP ) ? 'group' : 'user'; - $scope = ( $response['page_id'] ) ? ( $response['namespace'] == '__PageGroup' ? 'this group of pages' : 'this page' ) : 'this entire site'; - echo 'This panel allows you to edit what the ' . $type . ' "' . $response['target_name'] . '" can do on ' . $scope . '. Unless you set a permission to "Deny", these permissions may be overridden by other rules.'; + $type = ( $response['target_type'] == ACL_TYPE_GROUP ) ? $lang->get('acl_target_type_group') : $lang->get('acl_target_type_user'); + $scope = ( $response['page_id'] ) ? ( $response['namespace'] == '__PageGroup' ? $lang->get('acl_scope_type_pagegroup') : $lang->get('acl_scope_type_thispage') ) : $lang->get('acl_scope_type_wholesite'); + $subs = array( + 'target_type' => $type, + 'target' => $response['target_name'], + 'scope_type' => $scope + ); + echo $lang->get('acl_lbl_editwin_body', $subs); echo $formstart; $parser = $template->makeParserText( $response['template']['acl_field_begin'] ); echo $parser->run(); @@ -2296,7 +2303,14 @@ break; } $vars['FIELD_NAME'] = 'data[perms][' . $acl_type . ']'; - $vars['FIELD_DESC'] = $response['acl_descs'][$acl_type]; + if ( preg_match('/^([a-z0-9_]+)$/', $response['acl_descs'][$acl_type]) ) + { + $vars['FIELD_DESC'] = $lang->get($response['acl_descs'][$acl_type]); + } + else + { + $vars['FIELD_DESC'] = $response['acl_descs'][$acl_type]; + } $parser->assign_vars($vars); echo $parser->run(); } @@ -2309,7 +2323,7 @@ - ' . ( ( $response['type'] == 'edit' ) ? '  ' : '' ) . ' + ' . ( ( $response['type'] == 'edit' ) ? '  ' : '' ) . ' '; echo $formend; break; diff -r e878bcf0227e -r b1530b6a06d2 language/english/enano.json --- a/language/english/enano.json Mon Oct 29 22:19:06 2007 -0400 +++ b/language/english/enano.json Mon Oct 29 22:38:03 2007 -0400 @@ -388,6 +388,10 @@ btn_success_dismiss: 'dismiss', btn_success_close: 'close manager', + btn_deleterule: 'Delete rule', + btn_createrule: 'Create rule', + btn_returnto_editor: 'Return to ACL editor', + btn_returnto_userscope: 'Return to user/scope selection', }, perm: { read: 'Read page(s)',