Javascripted ACL editor interface localized
authorDan
Mon, 29 Oct 2007 22:19:06 -0400
changeset 218 e878bcf0227e
parent 217 2b13497fe820
child 219 b1530b6a06d2
Javascripted ACL editor interface localized
includes/clientside/static/acl.js
includes/pageutils.php
includes/paths.php
language/english/enano.json
themes/oxygen/acledit.tpl
--- a/includes/clientside/static/acl.js	Mon Oct 29 21:27:11 2007 -0400
+++ b/includes/clientside/static/acl.js	Mon Oct 29 22:19:06 2007 -0400
@@ -59,7 +59,7 @@
       {
         document.getElementById(aclManagerID+'_main').innerHTML = '';
         document.getElementById(aclManagerID + '_back').style.display = 'none';
-        document.getElementById(aclManagerID + '_next').value = 'Next >';
+        document.getElementById(aclManagerID + '_next').value = $lang.get('etc_wizard_next');
         groups = parseJSON(ajax.responseText);
         if ( groups.mode == 'error' )
         {
@@ -104,13 +104,13 @@
   grpb.onclick = function() { seed = this.className; document.getElementById('enACL_grpbox_'+seed).style.display = 'block'; document.getElementById('enACL_usrbox_'+seed).style.display = 'none'; };
   lbl = document.createElement('label');
   lbl.appendChild(grpb);
-  lbl.appendChild(document.createTextNode('A usergroup'));
+  lbl.appendChild(document.createTextNode($lang.get('acl_radio_usergroup')));
   lbl.style.display = 'block';
   span.appendChild(grpsel);
   
   anoninfo = document.createElement('div');
   anoninfo.className = 'info-box-mini';
-  anoninfo.appendChild(document.createTextNode('To edit permissions for guests, select "a specific user", and enter Anonymous as the username.'));
+  anoninfo.appendChild(document.createTextNode($lang.get('acl_msg_guest_howto')));
   span.appendChild(document.createElement('br'));
   span.appendChild(anoninfo);
   
@@ -122,7 +122,7 @@
   usrb.onclick = function() { seed = this.className; document.getElementById('enACL_grpbox_'+seed).style.display = 'none'; document.getElementById('enACL_usrbox_'+seed).style.display = 'block'; };
   lbl2 = document.createElement('label');
   lbl2.appendChild(usrb);
-  lbl2.appendChild(document.createTextNode('A specific user'));
+  lbl2.appendChild(document.createTextNode($lang.get('acl_radio_user')));
   lbl2.style.display = 'block';
   
   usrsel = document.createElement('input');
@@ -167,21 +167,21 @@
     lblPage = document.createElement('label');
       lblPage.style.display = 'block';
       lblPage.appendChild(scopeRadioPage);
-      lblPage.appendChild(document.createTextNode('Only this page'));
+      lblPage.appendChild(document.createTextNode($lang.get('acl_radio_scope_thispage')));
     lblGlobal = document.createElement('label');
       lblGlobal.style.display = 'block';
       lblGlobal.appendChild(scopeRadioGlobal);
-      lblGlobal.appendChild(document.createTextNode('The entire website'));
+      lblGlobal.appendChild(document.createTextNode($lang.get('acl_radio_scope_wholesite')));
     lblGroup = document.createElement('label');
       lblGroup.style.display = 'block';
       lblGroup.appendChild(scopeRadioGroup);
-      lblGroup.appendChild(document.createTextNode('A group of pages'));
+      lblGroup.appendChild(document.createTextNode($lang.get('acl_radio_scope_pagegroup')));
     scopediv1.appendChild(lblPage);
     scopediv2.appendChild(lblGroup);
     scopediv3.appendChild(lblGlobal);
     
     scopedesc = document.createElement('p');
-    scopedesc.appendChild(document.createTextNode('What should this access rule control?'));
+    scopedesc.appendChild(document.createTextNode($lang.get('acl_lbl_scope')));
     
     scopePGrp = document.createElement('select');
     scopePGrp.style.marginLeft = '13px';
@@ -219,10 +219,10 @@
   container.style.paddingTop = '50px';
   
   head = document.createElement('h2');
-  head.appendChild(document.createTextNode('Manage page access'));
+  head.appendChild(document.createTextNode($lang.get('acl_lbl_welcome_title')));
   
   desc = document.createElement('p');
-  desc.appendChild(document.createTextNode('Please select who should be affected by this access rule.'));
+  desc.appendChild(document.createTextNode($lang.get('acl_lbl_welcome_body')));
   
   container.appendChild(head);
   container.appendChild(desc);
@@ -319,11 +319,14 @@
             
             // Build the ACL edit form
             // try {
-              act_desc = ( data.type == 'new' ) ? 'Create access rule' : 'Editing permissions';
-              target_type_t = ( data.target_type == 1 ) ? 'group' : 'user';
-              target_name_t = data.target_name;
-              var scope_type = ( data.page_id == false && data.namespace == false ) ? 'this entire site' : ( data.namespace == '__PageGroup' ) ? 'this group of pages' : 'this page';
-              html = '<h2>'+act_desc+'</h2><p>This panel allows you to edit what the '+target_type_t+' "<b>'+target_name_t+'</b>" can do on <b>' + scope_type + '</b>. Unless you set a permission to "Deny", these permissions may be overridden by other rules.</p>';
+            
+              var act_desc = ( data.type == 'new' ) ? $lang.get('acl_lbl_editwin_title_create') : $lang.get('acl_lbl_editwin_title_edit');
+              var target_type_t = ( data.target_type == 1 ) ? $lang.get('acl_target_type_group') : $lang.get('acl_target_type_user');
+              var target_name_t = data.target_name;
+              var scope_type = ( data.page_id == false && data.namespace == false ) ? $lang.get('acl_scope_type_wholesite') : ( data.namespace == '__PageGroup' ) ? $lang.get('acl_scope_type_pagegroup') : $lang.get('acl_scope_type_thispage');
+              
+              html = '<h2>'+act_desc+'</h2>';
+              html += '<p>' + $lang.get('acl_lbl_editwin_body', { target_type: target_type_t, target: target_name_t, scope_type: scope_type }) + '</p>';
               parser = new templateParser(data.template.acl_field_begin);
               html += parser.run();
               
@@ -335,7 +338,14 @@
                   cls = ( cls == 'row1' ) ? 'row2' : 'row1';
                   p = new templateParser(data.template.acl_field_item);
                   vars = new Object();
-                  vars['FIELD_DESC'] = data.acl_descs[i];
+                  if ( data.acl_descs[i].match(/^([a-z0-9_]+)$/) )
+                  {
+                    vars['FIELD_DESC'] = $lang.get(data.acl_descs[i]);
+                  }
+                  else
+                  {
+                    vars['FIELD_DESC'] = data.acl_descs[i];
+                  }
                   vars['FIELD_DENY_CHECKED'] = '';
                   vars['FIELD_DISALLOW_CHECKED'] = '';
                   vars['FIELD_WIKIMODE_CHECKED'] = '';
@@ -367,7 +377,7 @@
               html += parser.run();
               
               if(data.type == 'edit')
-                html += '<p id="'+aclManagerID+'_deletelnk" style="text-align: right;"><a href="#delete_acl_rule" onclick="if(confirm(\'Do you really want to delete this rule?\')) __aclDeleteRule(); return false;" style="color: red;">Delete this rule</a></p>';
+                html += '<p id="'+aclManagerID+'_deletelnk" style="text-align: right;"><a href="#delete_acl_rule" onclick="if(confirm(\'' + $lang.get('acl_msg_deleterule_confirm') + '\')) __aclDeleteRule(); return false;" style="color: red;">' + $lang.get('acl_lbl_deleterule') + '</a></p>';
               
               var main = document.getElementById(aclManagerID + '_main');
               main.innerHTML = html;
@@ -383,7 +393,7 @@
               aclPermList = array_keys(data.acl_types);
               
               document.getElementById(aclManagerID + '_back').style.display = 'inline';
-              document.getElementById(aclManagerID + '_next').value = 'Save Changes';
+              document.getElementById(aclManagerID + '_next').value = $lang.get('etc_save_changes');
               
             // } catch(e) { alert(e); aclDebug(ajax.responseText); }
             
@@ -393,24 +403,24 @@
             note.className = 'info-box';
             note.style.marginLeft = '0';
             var b = document.createElement('b');
-            b.appendChild(document.createTextNode('Permissions updated'));
+            b.appendChild(document.createTextNode($lang.get('acl_lbl_save_success_title')));
             note.appendChild(b);
             note.appendChild(document.createElement('br'));
-            note.appendChild(document.createTextNode('The permissions for '+data.target_name+' on this page have been updated successfully. If you changed permissions that affect your user account, you may not see changes until you reload the page.'));
+            note.appendChild(document.createTextNode($lang.get('acl_lbl_save_success_body', { target_name: data.target_name })));
             note.appendChild(document.createElement('br'));
             var a = document.createElement('a');
             a.href = 'javascript:void(0);';
             a.onclick = function() { this.parentNode.parentNode.removeChild(this.parentNode); return false; };
-            a.appendChild(document.createTextNode('[ dismiss :'));
+            a.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :'));
             note.appendChild(a);
             var a2 = document.createElement('a');
             a2.href = 'javascript:void(0);';
             a2.onclick = function() { killACLManager(); return false; };
-            a2.appendChild(document.createTextNode(': close manager ]'));
+            a2.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]'));
             note.appendChild(a2);
             document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild);
             if(!document.getElementById(aclManagerID+'_deletelnk'))
-              document.getElementById(aclManagerID + '_main').innerHTML += '<p id="'+aclManagerID+'_deletelnk" style="text-align: right;"><a href="#delete_acl_rule" onclick="if(confirm(\'Do you really want to delete this rule?\')) __aclDeleteRule(); return false;" style="color: red;">Delete this rule</a></p>';
+              document.getElementById(aclManagerID + '_main').innerHTML += '<p id="'+aclManagerID+'_deletelnk" style="text-align: right;"><a href="#delete_acl_rule" onclick="if(confirm(\'' + $lang.get('acl_msg_deleterule_confirm') + '\')) __aclDeleteRule(); return false;" style="color: red;">' + $lang.get('acl_lbl_deleterule') + '</a></p>';
             //fadeInfoBoxes();
             document.getElementById(aclManagerID+'_main').scrollTop = 0;
             
@@ -428,7 +438,7 @@
               {
                 document.getElementById(aclManagerID+'_main').innerHTML = '';
                 document.getElementById(aclManagerID + '_back').style.display = 'none';
-                document.getElementById(aclManagerID + '_next').value = 'Next >';
+                document.getElementById(aclManagerID + '_next').value = $lang.get('etc_wizard_next');
                 var thispage = strToPageID(title);
                 groups.page_id = thispage[0];
                 groups.namespace = thispage[1];
@@ -441,20 +451,20 @@
                 note.style.width = '558px';
                 note.id = 'aclSuccessNotice_' + Math.floor(Math.random() * 100000);
                 b = document.createElement('b');
-                b.appendChild(document.createTextNode('Entry deleted'));
+                b.appendChild(document.createTextNode($lang.get('acl_lbl_delete_success_title')));
                 note.appendChild(b);
                 note.appendChild(document.createElement('br'));
-                note.appendChild(document.createTextNode('The access rules for '+aclDataCache.target_name+' on this page have been deleted.'));
+                note.appendChild(document.createTextNode($lang.get('acl_lbl_delete_success_title', { target_name: aclDataCache.target_name })));
                 note.appendChild(document.createElement('br'));
                 a = document.createElement('a');
                 a.href = '#';
                 a.onclick = function() { opacity(this.parentNode.id, 100, 0, 1000); setTimeout('var div = document.getElementById("' + this.parentNode.id + '"); div.parentNode.removeChild(div);', 1100); return false; };
-                a.appendChild(document.createTextNode('[ dismiss :'));
+                a.appendChild(document.createTextNode('[ ' + $lang.get('acl_btn_success_dismiss') + ' :'));
                 note.appendChild(a);
                 a = document.createElement('a');
                 a.href = '#';
                 a.onclick = function() { killACLManager(); return false; };
-                a.appendChild(document.createTextNode(': close manager ]'));
+                a.appendChild(document.createTextNode(': ' + $lang.get('acl_btn_success_close') + ' ]'));
                 note.appendChild(a);
                 document.getElementById(aclManagerID + '_main').insertBefore(note, document.getElementById(aclManagerID + '_main').firstChild);
                 //fadeInfoBoxes();
@@ -542,7 +552,7 @@
   
   back = document.createElement('input');
   back.type = 'button';
-  back.value = '< Back';
+  back.value = $lang.get('etc_wizard_back');
   back.style.fontWeight = 'normal';
   back.onclick = function() { ajaxACLSwitchToSelector(); return false; };
   back.style.display = 'none';
@@ -550,14 +560,14 @@
   
   saver = document.createElement('input');
   saver.type = 'submit';
-  saver.value = 'Next >';
+  saver.value = $lang.get('etc_wizard_next');
   saver.style.fontWeight = 'bold';
   saver.id = aclManagerID + '_next';
   
   closer = document.createElement('input');
   closer.type = 'button';
-  closer.value = 'Cancel Changes';
-  closer.onclick = function() { if(!confirm('Do you really want to close the ACL manager?')) return false; killACLManager(); return false; }
+  closer.value = $lang.get('etc_cancel_changes');
+  closer.onclick = function() { if(!confirm($lang.get('acl_msg_closeacl_confirm'))) return false; killACLManager(); return false; }
   
   spacer1 = document.createTextNode('  ');
   spacer2 = document.createTextNode('  ');
@@ -624,7 +634,7 @@
       var target_type = parseInt(getRadioState(thefrm, 'target_type', ['1', '2']));
       if(isNaN(target_type))
       {
-        alert('Please select a target type.');
+        alert($lang.get('acl_err_pleaseselect_targettype'));
         return false;
       }
       target_id = ( target_type == 1 ) ? parseInt(thefrm.group_id.value) : thefrm.username.value;
@@ -666,7 +676,7 @@
       }
       if(target_id == '')
       {
-        alert('Please enter a username.');
+        alert($lang.get('acl_err_pleaseselect_username'));
         return false;
       }
       __aclJSONSubmitAjaxHandler(obj);
--- a/includes/pageutils.php	Mon Oct 29 21:27:11 2007 -0400
+++ b/includes/pageutils.php	Mon Oct 29 22:19:06 2007 -0400
@@ -1910,11 +1910,13 @@
   function acl_editor($parms = Array())
   {
     global $db, $session, $paths, $template, $plugins; // Common objects
+    global $lang;
+    
     if(!$session->get_permissions('edit_acl') && $session->user_level < USER_LEVEL_ADMIN)
     {
       return Array(
         'mode' => 'error',
-        'error' => 'You are not authorized to view or edit access control lists.'
+        'error' => $lang->get('acl_err_access_denied')
         );
     }
     $parms['page_id'] = ( isset($parms['page_id']) ) ? $parms['page_id'] : false;
@@ -1932,7 +1934,7 @@
     {
       return Array(
         'mode' => 'error',
-        'error' => 'It seems that (a) the file acledit.tpl is missing from this theme, and (b) the JSON response is working.',
+        'error' => $lang->get('acl_err_missing_template'),
       );
     }
     $return['template'] = $template->extract_vars('acledit.tpl');
@@ -1993,7 +1995,7 @@
                 if(!$q)
                   return(Array('mode'=>'error','error'=>mysql_error()));
                 if($db->numrows() < 1)
-                  return Array('mode'=>'error','error'=>'The username you entered was not found.');
+                  return Array('mode'=>'error','error'=>$lang->get('acl_err_user_not_found'));
                 $row = $db->fetchrow();
                 $return['target_name'] = $return['target_id'];
                 $return['target_id'] = intval($row['user_id']);
@@ -2040,7 +2042,7 @@
                 if(!$q)
                   return(Array('mode'=>'error','error'=>mysql_error()));
                 if($db->numrows() < 1)
-                  return Array('mode'=>'error','error'=>'The group ID you submitted is not valid.');
+                  return Array('mode'=>'error','error'=>$lang->get('acl_err_bad_group_id'));
                 $row = $db->fetchrow();
                 $return['target_name'] = $row['group_name'];
                 $return['target_id'] = intval($row['group_id']);
@@ -2082,7 +2084,7 @@
         case 'save_edit':
           if ( defined('ENANO_DEMO_MODE') )
           {
-            return Array('mode'=>'error','error'=>'Editing access control lists is disabled in the administration demo.');
+            return Array('mode'=>'error','error'=>$lang->get('acl_err_demo'));
           }
           $q = $db->sql_query('DELETE FROM ' . table_prefix.'acl WHERE target_type='.intval($parms['target_type']).' AND target_id='.intval($parms['target_id']).'
             ' . $page_where_clause_lite . ';');
@@ -2093,7 +2095,7 @@
           {
             return array(
                 'mode' => 'error', 
-                'error' => 'Supplied rule list has a length of zero'
+                'error' => $lang->get('acl_err_zero_list')
               );
           }
           $q = ($page_id && $namespace) ? 'INSERT INTO ' . table_prefix.'acl ( target_type, target_id, page_id, namespace, rules )
@@ -2113,7 +2115,7 @@
         case 'delete':
           if ( defined('ENANO_DEMO_MODE') )
           {
-            return Array('mode'=>'error','error'=>'Editing access control lists is disabled in the administration demo.');
+            return Array('mode'=>'error','error'=>$lang->get('acl_err_demo'));
           }
           $q = $db->sql_query('DELETE FROM ' . table_prefix.'acl WHERE target_type='.intval($parms['target_type']).' AND target_id='.intval($parms['target_id']).'
             ' . $page_where_clause_lite . ';');
--- a/includes/paths.php	Mon Oct 29 21:27:11 2007 -0400
+++ b/includes/paths.php	Mon Oct 29 22:19:06 2007 -0400
@@ -46,35 +46,35 @@
     // ACL types
     // These can also be added from within plugins
     
-    $session->register_acl_type('read',                   AUTH_ALLOW,    'Read page(s)');
-    $session->register_acl_type('post_comments',          AUTH_ALLOW,    'Post comments',                                                                                            Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('edit_comments',          AUTH_ALLOW,    'Edit own comments',                                                                                        Array('post_comments'),                                   'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('edit_page',              AUTH_WIKIMODE, 'Edit page',                                                                                                Array('view_source'),                                     'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('view_source',            AUTH_WIKIMODE, 'View source',                                                                                              Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category'); // Only used if the page is protected
-    $session->register_acl_type('mod_comments',           AUTH_DISALLOW, 'Moderate comments',                                                                                        Array('edit_comments'),                                   'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('history_view',           AUTH_WIKIMODE, 'View history/diffs',                                                                                       Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('history_rollback',       AUTH_DISALLOW, 'Rollback history',                                                                                         Array('history_view'),                                    'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('history_rollback_extra', AUTH_DISALLOW, 'Undelete page(s)',                                                                                         Array('history_rollback'),                                'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('protect',                AUTH_DISALLOW, 'Protect page(s)',                                                                                          Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('rename',                 AUTH_WIKIMODE, 'Rename page(s)',                                                                                           Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('clear_logs',             AUTH_DISALLOW, 'Clear page logs (dangerous)',                                                                              Array('read', 'protect', 'even_when_protected'),          'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('vote_delete',            AUTH_ALLOW,    'Vote to delete',                                                                                           Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('vote_reset',             AUTH_DISALLOW, 'Reset delete votes',                                                                                       Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('delete_page',            AUTH_DISALLOW, 'Delete page(s)',                                                                                           Array(),                                                  'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('tag_create',             AUTH_ALLOW,    'Tag page(s)',                                                                                              Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('tag_delete_own',         AUTH_ALLOW,    'Remove own page tags',                                                                                     Array('read', 'tag_create'),                              'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('tag_delete_other',       AUTH_DISALLOW, 'Remove others\' page tags',                                                                                Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('set_wiki_mode',          AUTH_DISALLOW, 'Set per-page wiki mode',                                                                                   Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('password_set',           AUTH_DISALLOW, 'Set password',                                                                                             Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('password_reset',         AUTH_DISALLOW, 'Disable/reset password',                                                                                   Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('mod_misc',               AUTH_DISALLOW, 'Super moderator (generate SQL backtraces, view IP addresses, and send large numbers of private messages)', Array(),                                                  'All');
-    $session->register_acl_type('edit_cat',               AUTH_WIKIMODE, 'Edit categorization',                                                                                      Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('even_when_protected',    AUTH_DISALLOW, 'Allow editing, renaming, and categorization even when protected',                                          Array('edit_page', 'rename', 'mod_comments', 'edit_cat'), 'Article|User|Project|Template|File|Help|System|Category');
-    $session->register_acl_type('upload_files',           AUTH_DISALLOW, 'Upload files',                                                                                             Array('create_page'),                                     'Article|User|Project|Template|File|Help|System|Category|Special');
-    $session->register_acl_type('upload_new_version',     AUTH_WIKIMODE, 'Upload new versions of files',                                                                             Array('upload_files'),                                    'Article|User|Project|Template|File|Help|System|Category|Special');
-    $session->register_acl_type('create_page',            AUTH_WIKIMODE, 'Create pages',                                                                                             Array(),                                                  'Article|User|Project|Template|File|Help|System|Category|Special');
-    $session->register_acl_type('php_in_pages',           AUTH_DISALLOW, 'Embed PHP code in pages',                                                                                  Array('edit_page'),                                       'Article|User|Project|Template|File|Help|System|Category|Admin');
-    $session->register_acl_type('edit_acl',               AUTH_DISALLOW, 'Edit access control lists', Array('read', 'post_comments', 'edit_comments', 'edit_page', 'view_source', 'mod_comments', 'history_view', 'history_rollback', 'history_rollback_extra', 'protect', 'rename', 'clear_logs', 'vote_delete', 'vote_reset', 'delete_page', 'set_wiki_mode', 'password_set', 'password_reset', 'mod_misc', 'edit_cat', 'even_when_protected', 'upload_files', 'upload_new_version', 'create_page', 'php_in_pages'));
+    $session->register_acl_type('read',                   AUTH_ALLOW,    'perm_read');
+    $session->register_acl_type('post_comments',          AUTH_ALLOW,    'perm_post_comments',          Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('edit_comments',          AUTH_ALLOW,    'perm_edit_comments',          Array('post_comments'),                                   'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('edit_page',              AUTH_WIKIMODE, 'perm_edit_page',              Array('view_source'),                                     'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('view_source',            AUTH_WIKIMODE, 'perm_view_source',            Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category'); // Only used if the page is protected
+    $session->register_acl_type('mod_comments',           AUTH_DISALLOW, 'perm_mod_comments',           Array('edit_comments'),                                   'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('history_view',           AUTH_WIKIMODE, 'perm_history_view',           Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('history_rollback',       AUTH_DISALLOW, 'perm_history_rollback',       Array('history_view'),                                    'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('history_rollback_extra', AUTH_DISALLOW, 'perm_history_rollback_extra', Array('history_rollback'),                                'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('protect',                AUTH_DISALLOW, 'perm_protect',                Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('rename',                 AUTH_WIKIMODE, 'perm_rename',                 Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('clear_logs',             AUTH_DISALLOW, 'perm_clear_logs',             Array('read', 'protect', 'even_when_protected'),          'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('vote_delete',            AUTH_ALLOW,    'perm_vote_delete',            Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('vote_reset',             AUTH_DISALLOW, 'perm_vote_reset',             Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('delete_page',            AUTH_DISALLOW, 'perm_delete_page',            Array(),                                                  'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('tag_create',             AUTH_ALLOW,    'perm_tag_create',             Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('tag_delete_own',         AUTH_ALLOW,    'perm_tag_delete_own',         Array('read', 'tag_create'),                              'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('tag_delete_other',       AUTH_DISALLOW, 'perm_tag_delete_other',       Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('set_wiki_mode',          AUTH_DISALLOW, 'perm_set_wiki_mode',          Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('password_set',           AUTH_DISALLOW, 'perm_password_set',           Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('password_reset',         AUTH_DISALLOW, 'perm_password_reset',         Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('mod_misc',               AUTH_DISALLOW, 'perm_mod_misc',               Array(),                                                  'All');
+    $session->register_acl_type('edit_cat',               AUTH_WIKIMODE, 'perm_edit_cat',               Array('read'),                                            'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('even_when_protected',    AUTH_DISALLOW, 'perm_even_when_protected',    Array('edit_page', 'rename', 'mod_comments', 'edit_cat'), 'Article|User|Project|Template|File|Help|System|Category');
+    $session->register_acl_type('upload_files',           AUTH_DISALLOW, 'perm_upload_files',           Array('create_page'),                                     'Article|User|Project|Template|File|Help|System|Category|Special');
+    $session->register_acl_type('upload_new_version',     AUTH_WIKIMODE, 'perm_upload_new_version',     Array('upload_files'),                                    'Article|User|Project|Template|File|Help|System|Category|Special');
+    $session->register_acl_type('create_page',            AUTH_WIKIMODE, 'perm_create_page',            Array(),                                                  'Article|User|Project|Template|File|Help|System|Category|Special');
+    $session->register_acl_type('php_in_pages',           AUTH_DISALLOW, 'perm_php_in_pages',           Array('edit_page'),                                       'Article|User|Project|Template|File|Help|System|Category|Admin');
+    $session->register_acl_type('edit_acl',               AUTH_DISALLOW, 'perm_edit_acl',               Array('read', 'post_comments', 'edit_comments', 'edit_page', 'view_source', 'mod_comments', 'history_view', 'history_rollback', 'history_rollback_extra', 'protect', 'rename', 'clear_logs', 'vote_delete', 'vote_reset', 'delete_page', 'set_wiki_mode', 'password_set', 'password_reset', 'mod_misc', 'edit_cat', 'even_when_protected', 'upload_files', 'upload_new_version', 'create_page', 'php_in_pages'));
     
     // DO NOT add new admin pages here! Use a plugin to call $paths->addAdminNode();
     $this->addAdminNode('adm_cat_general',    'adm_page_general_config', 'GeneralConfig');
--- a/language/english/enano.json	Mon Oct 29 21:27:11 2007 -0400
+++ b/language/english/enano.json	Mon Oct 29 22:19:06 2007 -0400
@@ -17,7 +17,8 @@
 
 var enano_lang = {
   categories: [
-    'adm', 'meta', 'user', 'page', 'comment', 'onpage', 'etc', 'editor', 'history', 'catedit', 'tags', 'delvote', 'ajax', 'sidebar',
+    'adm', 'meta', 'user', 'page', 'comment', 'onpage', 'etc', 'editor', 'history', 'catedit', 'tags', 'delvote', 'ajax', 'sidebar', 'acl',
+    'perm',
   ],
   strings: {
     meta: {
@@ -35,6 +36,8 @@
       delvote: 'Page deletion vote interface',
       ajax: 'On-page AJAX applets',
       sidebar: 'Default sidebar blocks and buttons',
+      acl: 'Access control list editor',
+      perm: 'Page actions (for ACLs)',
       plural: 's'
     },
     user: {
@@ -339,12 +342,96 @@
       btn_logout: 'Log out',
       btn_changestyle: 'Change theme',
     },
+    acl: {
+      err_access_denied: 'You are not authorized to view or edit access control lists.',
+      err_missing_template: 'It seems that (a) the file acledit.tpl is missing from this theme, and (b) the JSON response is working.',
+      err_user_not_found: 'The username you entered was not found.',
+      err_bad_group_id: 'The group ID you submitted is not valid.',
+      err_demo: 'Editing access control lists is disabled in the administration demo.',
+      err_zero_list: 'Supplied rule list has a length of zero',
+      err_pleaseselect_targettype: 'Please select a target type.',
+      err_pleaseselect_username: 'Please enter a username.',
+      
+      radio_usergroup: 'A usergroup',
+      radio_user: 'A specific user',
+      radio_scope_thispage: 'Only this page',
+      radio_scope_wholesite: 'The entire website',
+      radio_scope_pagegroup: 'A group of pages',
+      
+      lbl_scope: 'What should this access rule control?',
+      lbl_welcome_title: 'Manage page access',
+      lbl_welcome_body: 'Please select who should be affected by this access rule.',
+      lbl_editwin_title_create: 'Create access rule',
+      lbl_editwin_title_edit: 'Editing permissions',
+      lbl_editwin_body: 'This panel allows you to edit what the %target_type% "<b>%target%</b>" can do on <b>%scope_type%</b>. Unless you set a permission to "Deny", these permissions may be overridden by other rules.',
+      lbl_deleterule: 'Delete this rule',
+      lbl_save_success_title: 'Permissions updated',
+      lbl_save_success_body: 'The permissions for %target_name% on this page have been updated successfully. If you changed permissions that affect your user account, you may not see changes until you reload the page.',
+      lbl_delete_success_title: 'Rule deleted',
+      lbl_delete_success_body: 'The access rules for %target_name% on this page have been deleted.',
+      lbl_field_deny: 'Deny',
+      lbl_field_disallow: 'Disallow',
+      lbl_field_wikimode: 'Wiki mode',
+      lbl_field_allow: 'Allow',
+      lbl_help: '<p><b>Permission types:</b></p><ul><li><b>Allow</b> means that the user is allowed to access the item</li><li><b>Wiki mode</b> means the user can access the item if wiki mode is active (per-page wiki mode is taken into account)</li><li><b>Disallow</b> means the user is denied access unless something allows it.</li><li><b>Deny</b> means that the user is denied access to the item. This setting overrides all other permissions.</li></ul>',
+      
+      scope_type_wholesite: 'this entire site',
+      scope_type_thispage: 'this page',
+      scope_type_pagegroup: 'this group of pages',
+      
+      target_type_user: 'user',
+      target_type_group: 'group',
+      
+      msg_guest_howto: 'To edit permissions for guests, select "a specific user", and enter Anonymous as the username.',
+      msg_deleterule_confirm: 'Do you really want to delete this rule?',
+      msg_closeacl_confirm: 'Do you really want to close the ACL manager?',
+      
+      btn_success_dismiss: 'dismiss',
+      btn_success_close: 'close manager',
+    },
+    perm: {
+      read: 'Read page(s)',
+      post_comments: 'Post comments',
+      edit_comments: 'Edit own comments',
+      edit_page: 'Edit page',
+      view_source: 'View source',
+      mod_comments: 'Moderate comments',
+      history_view: 'View history/diffs',
+      history_rollback: 'Rollback history',
+      history_rollback_extra: 'Undelete page(s)',
+      protect: 'Protect page(s)',
+      rename: 'Rename page(s)',
+      clear_logs: 'Clear page logs (dangerous)',
+      vote_delete: 'Vote to delete',
+      vote_reset: 'Reset delete votes',
+      delete_page: 'Delete page(s)',
+      tag_create: 'Tag page(s)',
+      tag_delete_own: 'Remove own page tags',
+      tag_delete_other: 'Remove others\' page tags',
+      set_wiki_mode: 'Set per-page wiki mode',
+      password_set: 'Set password',
+      password_reset: 'Disable/reset password',
+      mod_misc: 'Super moderator (generate SQL backtraces, view IP addresses, and send large numbers of private messages)',
+      edit_cat: 'Edit categorization',
+      even_when_protected: 'Allow editing, renaming, and categorization even when protected',
+      upload_files: 'Upload files',
+      upload_new_version: 'Upload new versions of files',
+      create_page: 'Create pages',
+      php_in_pages: 'Embed PHP code in pages',
+      edit_acl: 'Edit access control lists',
+    },
     etc: {
       redirect_title: 'Redirecting...',
       redirect_body: 'Please wait while you are redirected.',
       redirect_timeout: 'If you are not redirected within %timeout% seconds, please <a href="%redirect_url%">click here</a>.',
       // Generic "Save Changes" button
       save_changes: 'Save changes',
+      // Generic "Cancel changes" button
+      cancel_changes: 'Cancel changes',
+      // Generic wizard buttons
+      wizard_next: 'Next >',
+      wizard_back: '< Back',
+      wizard_previous: '< Previous',
       // Generic "Notice:" label
       lbl_notice: 'Notice:',
       // Generic "Access denied"
@@ -354,7 +441,7 @@
       cancel: 'Cancel',
       yes: 'Yes',
       no: 'No'
-    },
+    }
   }
 };
 
--- a/themes/oxygen/acledit.tpl	Mon Oct 29 21:27:11 2007 -0400
+++ b/themes/oxygen/acledit.tpl	Mon Oct 29 22:19:06 2007 -0400
@@ -3,10 +3,10 @@
   <table border="0" cellspacing="1" cellpadding="4" style="width: 100%;">
     <tr>
       <th></th>
-      <th style='cursor: pointer;' title="Click to change all columns" onclick="__aclSetAllRadios('1');">Deny</th>
-      <th style='cursor: pointer;' title="Click to change all columns" onclick="__aclSetAllRadios('2');">Disallow</th>
-      <th style='cursor: pointer;' title="Click to change all columns" onclick="__aclSetAllRadios('3');">Wiki mode</th>
-      <th style='cursor: pointer;' title="Click to change all columns" onclick="__aclSetAllRadios('4');">Allow</th>
+      <th style='cursor: pointer;' title="Click to change all columns" onclick="__aclSetAllRadios('1');">{lang:acl_lbl_field_deny}</th>
+      <th style='cursor: pointer;' title="Click to change all columns" onclick="__aclSetAllRadios('2');">{lang:acl_lbl_field_disallow}</th>
+      <th style='cursor: pointer;' title="Click to change all columns" onclick="__aclSetAllRadios('3');">{lang:acl_lbl_field_wikimode}</th>
+      <th style='cursor: pointer;' title="Click to change all columns" onclick="__aclSetAllRadios('4');">{lang:acl_lbl_field_allow}</th>
     </tr>
 <!-- ENDVAR acl_field_begin -->
 <!-- VAR acl_field_item -->
@@ -21,13 +21,7 @@
 <!-- VAR acl_field_end -->
     <tr>
       <td colspan="5" class="row3">
-        <p><b>Permission types:</b></p>
-        <ul>
-          <li><b>Allow</b> means that the user is allowed to access the item</li>
-          <li><b>Wiki mode</b> means the user can access the item if wiki mode is active (per-page wiki mode is taken into account)</li>
-          <li><b>Disallow</b> means the user is denied access unless something allows it.</li>
-          <li><b>Deny</b> means that the user is denied access to the item. This setting overrides all other permissions.</li>
-        </ul>
+        {lang:acl_lbl_help}
       </td>
     </tr>
   </table>