From: hickert Date: Mon, 4 Dec 2006 06:58:01 +0000 (+0000) Subject: Added fast acl toggle buttons X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7cd8e100b582e4ee0176b366b16a9ccaef49d889;p=gosa.git Added fast acl toggle buttons git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5295 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/html/include/focus.js b/html/include/focus.js index cc6bc15df..f5a619111 100644 --- a/html/include/focus.js +++ b/html/include/focus.js @@ -15,6 +15,21 @@ for (iln = 0; iln < len; iln++){ netscape= (ver.charAt(iln+1).toUpperCase() != "C"); +/* Toggle checkbox that matches regex */ +function acl_toggle_all(regex) +{ + for (var i = 0; i < document.mainform.elements.length; i++) { + var _id=document.mainform.elements[i].id; + if(_id.match(regex)) { + if (document.getElementById(_id).checked == true){ + document.getElementById(_id).checked= false; + } else { + document.getElementById(_id).checked= true; + } + } + } +} + function keyPress(DnEvents) { // determines whether Netscape or Internet Explorer k = (netscape) ? DnEvents.keyCode : window.event.keyCode; diff --git a/include/class_acl.inc b/include/class_acl.inc index dec421bec..9024689fe 100644 --- a/include/class_acl.inc +++ b/include/class_acl.inc @@ -503,6 +503,15 @@ class acl extends plugin $plist= $tmp->info; asort($plist); + /* Add select all/none buttons */ + $display .= " "; + $display .= " "; + $display .= " "; + $display .= " "; + $display .= " "; + + $display .= " "; + $display .= " "; /* Build general objects */ $list =$this->sort_by_priority($list);