Code

Added dynamic acl divs for extended settings. Currently only firefox is supported.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 28 Jul 2006 14:02:07 +0000 (14:02 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 28 Jul 2006 14:02:07 +0000 (14:02 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4341 594d385d-05f5-0310-b6e9-bd551577e9d8

html/include/focus.js
include/class_acl.inc
plugins/admin/fai/branch_selector.tpl

index 2ee14d6b63c2cc088f12346022fbc4120f1af1c0..c5bf374908ca183a24ddfd827931d6cc419cba58 100644 (file)
@@ -195,6 +195,28 @@ function js_check(form) {
        form.javascript.value = 'true';
 }
 
+function divtoggle(element) {
+       var cell;
+       var cellname="tr_"+(element);
+
+       if (browserType == "gecko" ) {
+    document.poppedLayer = document.getElementById(element);
+               cell= document.getElementById(cellname);
+
+         if (document.poppedLayer.style.visibility == "visible") {
+                 hide (element);
+                       document.poppedLayer.style.height="0px";
+                       cell.style.height="1px";
+               } else {
+                 show (element);
+                       document.poppedLayer.style.height="";
+                       if(document.defaultView) {
+                               cell.style.height=document.defaultView.getComputedStyle(document.poppedLayer,"").getPropertyValue('height');
+                       }
+               }
+       }
+}
+
 window.onload = adjust;
 window.onresize = adjust;
 
index 398ecd0e188bf661f8490732bd027a6b9f42a69f..f3fed5371fa5cb4c5be52d753228c1f99e93d815 100644 (file)
@@ -487,7 +487,15 @@ class acl extends plugin
       $currentAcl= $this->aclContents[$key];
 
       /* Object header */
-      $display.= "<table style='width:100%;border:1px solid #A0A0A0' cellspacing=0 cellpadding=2><tr><td style='background-color:#C8C8C8;height:1.8em' colspan=$cols><b>"._("Object").": $name</b></td></tr>";
+      if($_SESSION['js']) {
+        if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/firefox/i",$_SERVER['HTTP_USER_AGENT'])) {
+          $display.= "<table style='width:100%;border:1px solid #A0A0A0' cellspacing=0 cellpadding=2><tr><td style='background-color:#C8C8C8;height:1.8em;' colspan=".($cols-1)."><b>"._("Object").": $name</b></td><td align='right' style='background-color:#C8C8C8;height:1.8em;'><input type='button' onclick='divtoggle(\"$name\");' value='"._("Show/Hide Advanced Settings")."' /></td></tr>";
+        } else {
+          $display.= "<table style='width:100%;border:1px solid #A0A0A0' cellspacing=0 cellpadding=2><tr><td style='background-color:#C8C8C8;height:1.8em;' colspan=$cols><b>"._("Object").": $name</b></td></tr>";
+        }
+      } else {
+          $display.= "<table style='width:100%;border:1px solid #A0A0A0' cellspacing=0 cellpadding=2><tr><td style='background-color:#C8C8C8;height:1.8em;' colspan=$cols><b>"._("Object").": $name</b></td></tr>";
+      }
 
       /* Generate options */
       $spc= "&nbsp;&nbsp;";
@@ -516,6 +524,11 @@ class acl extends plugin
       $cnt= 1;
       $splist= $plist[preg_replace('%^.*/%', '', $key)]['plProvidedAcls'];
       asort($splist);
+      if($_SESSION['js']) {
+        if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/firefox/i",$_SERVER['HTTP_USER_AGENT'])) {
+          $display.= "<tr id='tr_$name' style='vertical-align:top;height:0px;'><td colspan=".$cols."><div id='$name' style='visibility:hidden;height:0px;vertical-align:top;width:100%;'><table style='width:100%;'>";
+        }
+      }
       foreach($splist as $attr => $dsc){
 
         /* Skip pl* attributes, they are internal... */
@@ -552,7 +565,13 @@ class acl extends plugin
        $display.= str_repeat("<td style='border-top:1px solid #A0A0A0; width:".(int)(100/$cols)."%'>&nbsp;</td>", $cols-$cnt); 
       }
 
-      $display.= "</table><br>";
+      if($_SESSION['js']) {
+        if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/firefox/i",$_SERVER['HTTP_USER_AGENT'])) {
+          $display.= "</table></div></td></tr>";
+        }
+      }
+
+      $display.= "</table><br />";
     }
 
     return ($display);
index d76abb3586279b4ec57c93b752c2766dd3b8d907..642c9420e7a5d91c4c9218b4c7a1d0d78b94fc1b 100644 (file)
         <table summary="" style="width:100%;">
      <tr>
       <td>
-    <input type="image" align="middle" value="branch" name="branch_branch" src="images/branch_small.png">
+    <input type="image" align="middle" value="branch" name="branch_branch" src="images/branch_small.png" class="center" />
     &nbsp;
     {t}Create new branch{/t}
     <br>
-    <input type="image" align="middle" value="freeze" name="freeze_branch" src="images/closedlock.png">
+    <input type="image" align="middle" value="freeze" name="freeze_branch" src="images/closedlock.png" class="center" />
     &nbsp;
     {t}Create new locked branch{/t}
     {if $selectedBranch != "main"}
     <br>
-    <input type="image" align="middle" value="delete" name="remove_branch" src="images/edittrash.png">
+    <input type="image" align="middle" value="delete" name="remove_branch" src="images/edittrash.png" />
     &nbsp;
     {t}Delete current release{/t}
     {/if}