Code

Added fast acl toggle buttons
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 4 Dec 2006 06:58:01 +0000 (06:58 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 4 Dec 2006 06:58:01 +0000 (06:58 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5295 594d385d-05f5-0310-b6e9-bd551577e9d8

html/include/focus.js
include/class_acl.inc

index cc6bc15dff4cce53bcce59d4d18b70d27c7ff411..f5a61911111499e1261cd8cf4585364636986afe 100644 (file)
@@ -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;
index dec421bec554a299818248ac8a34567b071c4ee5..9024689fe136c322635f57f15903cc15f31a7f51 100644 (file)
@@ -503,6 +503,15 @@ class acl extends plugin
     $plist= $tmp->info;
     asort($plist);
 
+    /* Add select all/none buttons */
+    $display .= "<input type='button' name='all_create' onClick=\"acl_toggle_all('_0_c$');\" value='C'>&nbsp;";
+    $display .= "<input type='button' name='all_move'   onClick=\"acl_toggle_all('_0_m$');\" value='M'>&nbsp;";
+    $display .= "<input type='button' name='all_remove' onClick=\"acl_toggle_all('_0_d$');\" value='D'>&nbsp;";
+    $display .= "<input type='button' name='all_read'   onClick=\"acl_toggle_all('_0_r$');\" value='R'>&nbsp;";
+    $display .= "<input type='button' name='all_write'  onClick=\"acl_toggle_all('_0_w$');\" value='W'>&nbsp;";
+
+    $display .= "<input type='button' name='all_write'  onClick=\"acl_toggle_all('[^0]_r$');\" value='R+'>&nbsp;";
+    $display .= "<input type='button' name='all_write'  onClick=\"acl_toggle_all('[^0]_w$');\" value='W+'>&nbsp;";
     /* Build general objects */
 
     $list =$this->sort_by_priority($list);