aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/admin.css2
-rw-r--r--phpBB/adm/style/permission_mask.html14
-rw-r--r--phpBB/adm/style/permissions.js66
3 files changed, 72 insertions, 10 deletions
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index 34bddf390a..04aa71727d 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -570,7 +570,7 @@ dd textarea {
width: 100%;
}
-input.radio {
+input.radio, input.perm_cb {
width: auto !important;
background-color: transparent;
border: none;
diff --git a/phpBB/adm/style/permission_mask.html b/phpBB/adm/style/permission_mask.html
index 54ce67ebcf..dd0b7a8e17 100644
--- a/phpBB/adm/style/permission_mask.html
+++ b/phpBB/adm/style/permission_mask.html
@@ -16,15 +16,23 @@
</script>
<script language="javascript" type="text/javascript" src="style/permissions.js"></script>
+
<!-- BEGIN p_mask -->
<div class="clearfix"></div>
<h3>{p_mask.NAME}<!-- IF p_mask.S_LOCAL --> <span class="small"> [{p_mask.L_ACL_TYPE}]</span><!-- ENDIF --></h3>
<!-- BEGIN f_mask -->
-<fieldset class="perm" id="perm{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}">
- <legend id="legend{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}"><!-- IF not p_mask.S_VIEW --><input type="checkbox" class="radio" name="inherit[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" id="checkbox{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" value="1" onclick="toggle_opacity('{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')" /> <!-- ELSE --><!-- ENDIF -->{p_mask.f_mask.NAME}</legend>
+<fieldset class="perm" id="perm{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}">
+ <legend id="legend{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}">
+ <!-- IF not p_mask.S_VIEW -->
+ <input type="checkbox" style="display: none;" class="perm_cb" name="inherit[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" id="checkbox{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" value="1" onclick="toggle_opacity('{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')" />
+ <!-- ELSE -->
+ <!-- ENDIF -->
+
+ {p_mask.f_mask.NAME}
+ </legend>
<!-- IF not p_mask.S_VIEW -->
<div class="perm_switch">
<a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '0', true); return false;">{L_ADVANCED_PERMISSIONS}</a>
@@ -108,7 +116,9 @@
<fieldset class="quick" style="margin-right: 11px;">
<p class="small">{L_APPLY_PERMISSIONS_EXPLAIN}</p>
<input class="button1" type="submit" name="psubmit[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" value="{L_APPLY_PERMISSIONS}" />
+ <p class="small"><a href="#" onclick="reset_opacity(0, '{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="reset_opacity(1, '{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); return false;">{L_UNMARK_ALL}</a></p>
</fieldset>
+
<!-- ENDIF -->
<span class="corners-bottom"><span></span></span>
</div>
diff --git a/phpBB/adm/style/permissions.js b/phpBB/adm/style/permissions.js
index 32f337063b..eb84e40435 100644
--- a/phpBB/adm/style/permissions.js
+++ b/phpBB/adm/style/permissions.js
@@ -1,4 +1,37 @@
/**
+* 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
* value = 0 (hidden) till 10 (fully visible)
@@ -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