1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-10-04 11:41:38 +02:00

Some permission interface updates:

- checkbox now hidden by default, only shown when an advanced view is opened
- mark all and unmark all now available


git-svn-id: file:///svn/phpbb/trunk@6916 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Dominik Dröscher
2007-01-21 19:32:38 +00:00
parent 576bb754e9
commit 097856f4a0
3 changed files with 72 additions and 10 deletions

View File

@@ -1,3 +1,36 @@
/**
* Hide and show all checkboxes
* status = true (show boxes), false (hide boxes)
*/
function display_checkboxes(status)
{
var form = document.getElementById('set_permissions');
var cb = document.getElementsByTagName('input');
var display;
//show
if (status)
{
display = 'inline';
}
//hide
else
{
display = 'none';
}
for (var i = 0; i < cb.length; i++ )
{
if (cb[i].className == 'perm_cb')
{
cb[i].style.display = display;
}
}
}
/**
* Change opacity of element
* e = element
@@ -30,18 +63,34 @@ function toggle_opacity(block_id) {
/**
* Reset the opacity and checkboxes
* value = 0 (checked) and 1 (unchecked)
* except_id = id of the element not to hide
*/
function reset_opacity() {
function reset_opacity(status, except_id) {
var perm = document.getElementById('set_permissions');
var fs = perm.getElementsByTagName('fieldset');
var opacity = 5;
if (status)
{
opacity = 10;
}
for (var i = 0; i < fs.length; i++ )
{
set_opacity(fs[i], 10);
if (fs[i].className != 'quick')
{
set_opacity(fs[i], opacity);
}
}
if (typeof(except_id) != 'undefined')
{
set_opacity(document.getElementById('perm' + except_id), 10);
}
//reset checkboxes too
marklist('set_permissions', 'inherit', false);
marklist('set_permissions', 'inherit', !status);
}
@@ -166,7 +215,8 @@ function swap_options(pmask, fmask, cat, adv, view)
if (adv_block.style.display == 'block' && adv == true)
{
dE('advanced' + pmask + fmask, -1);
document.getElementById('checkbox' + pmask + fmask).style.display = 'inline';
reset_opacity(1);
display_checkboxes(false);
return;
}
@@ -180,12 +230,14 @@ function swap_options(pmask, fmask, cat, adv, view)
if (adv && (pmask + fmask) != (active_pmask + active_fmask))
{
init_colours(pmask + fmask);
reset_opacity();
display_checkboxes(true);
reset_opacity(1);
}
else if (adv)
{
//Checkbox might have been clicked, but we need full visibility
set_opacity(document.getElementById('perm' + pmask + fmask), 10);
display_checkboxes(true);
reset_opacity(1);
}
// set active tab