Code

Fixed scroll
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 Nov 2007 11:06:50 +0000 (11:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 Nov 2007 11:06:50 +0000 (11:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-playground@7742 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_ObjectList.inc
include/class_ObjectListViewport.inc
test.php

index 01e7ac52838b6a0a2b5270284b828f14e01eaf7d..4763933b31aef4fc1712257d53d927af3149e0ab 100644 (file)
@@ -198,7 +198,7 @@ class ObjectList implements IteratorAggregate {
               "objectClass" => array('gotoWorkstation')),
 
  array("dn" => "cn=vserver-04.intranet.gonicus.de,ou=servers,ou=systems,o=Landeshauptstadt München,c=de",
-              "cn" => "vserver-04.intranet.gonicus.de [Mail Server]",
+              "cn" => "vserver-04.",
               "_icon" => "select_server.png",
               "_actions" => "CPSREDX",
               "objectClass" => array('gotoWorkstation')),
@@ -335,7 +335,7 @@ class ObjectList implements IteratorAggregate {
               "objectClass" => array('gotoWorkstation')),
 
  array("dn" => "cn=vserver-04.intranet.gonicus.de,ou=servers,ou=systems,o=Landeshauptstadt München,c=de",
-              "cn" => "vserver-04.intranet.gonicus.de [Mail Server]",
+              "cn" => "vsernicus.de",
               "_icon" => "select_server.png",
               "_actions" => "CPSREDX",
               "objectClass" => array('gotoWorkstation')),
index 959ae306775a8f651b15b2394f9a5690e15a9272..2cc44af49d46a7c7bb0a7857e717c623c051cb74 100644 (file)
@@ -84,12 +84,12 @@ class ObjectListViewport {
       \return HTML rendered headline
         */
   private function renderHeadline(){
-    $buffer ="<table class='ObjectListViewport_Headline_Table'>\n";
+    $buffer ="<table class='ObjectListViewport_Header_Table'>\n";
     $buffer.="<tr>\n";
     foreach($this->headline as $key => $value){
-      $buffer .= "<td class='ObjectListViewport_Headline_Cell' style='".$value['style']."'>".$value['name']."</td>\n";
+      $buffer .= "<td  style='".$value['style']."'>".$value['name']."</td>\n";
     }
-    $buffer.="<td style='width:12px;'>&nbsp;</td>";
+    $buffer.="<td style='width:13px;'>&nbsp;</td>";
     $buffer.="</tr>\n";
     $buffer.="</table>\n";
     return $buffer;
@@ -156,10 +156,10 @@ class ObjectListViewport {
     $buffer="<tr>\n";
     foreach($tmp as $key => $value){
 
-      if(empty($this->headline[$key]['width']) || preg_match("/\%/",$this->headline[$key]['width'])){
-        $buffer .= "<td nowrap class='ObjectListViewport_Entry_Cell' style='".$this->headline[$key]['style']."'>".
-          "<div style='overflow:hidden;width:100%;'>".
-          $value.
+      if(1 || empty($this->headline[$key]['width']) || preg_match("/\%/",$this->headline[$key]['width'])){
+        $buffer .= "<td class='ObjectListViewport_Entry_Cell' style='".$this->headline[$key]['style']."'>".
+          "<div style='overflow:hidden;".$this->headline[$key]['style']."'>".
+            $value.
           "</div>".
           "</td>\n";
       }else{
@@ -194,22 +194,51 @@ class ObjectListViewport {
         */
   public function render() {
 
-    /* Generate fixed headline */
-    $buffer= $this->renderHeadline();
+    $header = $this->renderHeadline();
+    $footer = $this->renderFooter();
 
     /* Apply current filter */
+    $entries = "";
     $objects= new ObjectListFilterIterator($this->objects->getIterator());
-   
-    $buffer.="<div style='overflow:auto' id='ObjectListViewport_Entry_Cover'>"; 
-    $buffer.="<table class='ObjectListViewport_Entry_Table'>\n"; 
     foreach ($objects as $value){
-      $buffer.= $this->renderEntry($value);
+      $entries .= $this->renderEntry($value);
     }
-    $buffer.="</table>\n"; 
-    $buffer.="</div>"; 
 
-    /* Generate footer */
-    $buffer.= $this->renderFooter();
+    
+
+    /* Generate fixed headline */
+    $buffer = "
+    <table class='ObjectListViewport' id='ObjectListViewport' cellspacing=o cellpadding=0
+          style=' width:100%;height:100%;; 
+                  border-collapse:collapse;'>
+      <tr>
+        <td>
+              <table class='ObjectListViewport_Table' id='ObjectListViewport_Table' cellpadding=0 cellspacing=0 >
+                <tr>
+                  <td class='ObjectListViewport_TD_Header' id='ObjectListViewport_TD_Header'>
+                    ".$header."
+                  </td>
+                </tr>
+                <tr>
+                  <td class='ObjectListViewport_TD_Entries' id='ObjectListViewport_TD_Entries'>
+                    <div style='overflow:auto' id='ObjectListViewport_Entry_Cover'> 
+                      <table class='ObjectListViewport_Entry_Table' id='ObjectListViewport_Entry_Table'>
+                        ".$entries."
+                      </table> 
+                    </div>
+                  </td>
+                </tr>
+                <tr>
+                  <td class='ObjectListViewport_TD_Footer' id='ObjectListViewport_TD_Footer'>
+                    ".$footer."
+                  </td>
+                </tr>
+              </table>
+
+        </td>
+      </tr>
+    </table>
+";
 
     return ($buffer);
   }
index 1b156e4b7cae469e59da5ed67881530e478c9b08..ce027aec44eef875fb03348633dbe300b7b32a81 100644 (file)
--- a/test.php
+++ b/test.php
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-       "http://www.w3.org/TR/html4/transitional.dtd">
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+            "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
 <style type="text/css">
-       
-.ObjectListViewport_Headline_Table {
-       background-color: #FF0000;
+
+.ObjectListViewport {
        width:100%;
-       border-collapse:collapse;
-}
-.ObjectListViewport_Headline_Cell {
-       border: 1px solid #000000;
 }
+
+.ObjectListViewport_Header_Table {
+       width:100%;
+       border: 0px;
+       border-collapse:collapse;
+}      
+       
 .ObjectListViewport_Entry_Table {
-       background-color: #00FF00;
        width:100%;
+       border: 0px;
        border-collapse:collapse;
 }
-.ObjectListViewport_Entry_Cell {
-       border: 1px solid #000000;
+
+.ObjectListViewport_Entry_Cover{
+
+       border: 0px;
+       margin:0px;
+       padding:0px;
 }
+
 .ObjectListViewport_Footer_Table {
-       background-color: #0000FF;
-       width:100%;
+    width:100%;
+    border: 0px;
+    border-collapse:collapse;
+}
+
+
+.ObjectListViewport_Table {
        border-collapse:collapse;
+    width:100%;
+       border: 0px;
+}
+
+.ObjectListViewport_TD_Header {
+       height:20px;
+       background-color: #CCCCCC;
+       vertical-align:middle;
+       border: 0px;
+       margin:0px;
+       padding:0px;
+}
+.ObjectListViewport_TD_Entries {
+       background-color: #009900;
+       vertical-align:middle;
+       border: 0px;
+       margin:0px;
+       padding:0px;
 }
-.ObjectListViewport_Footer_Cell {
-       border: 1px solid #000000;
+.ObjectListViewport_TD_Footer {
+       height:20px;
+       background-color: #CCCCCC;
+       vertical-align:middle;
+       border: 0px;
+       margin:0px;
+       padding:0px;
 }
+td {
+       border-left: solid 1px;
+       border-right: solid 1px;
+       font-size:1em;
+       height:22px;
+}
+
 </style>
 <script type="text/javascript">
+window.onload = setHeight;
+window.onresize = setHeight;
+
        function setHeight() {
                dbg = document.getElementById('debug');
-               OVP = document.getElementById('ObjectListViewport');
-               style = getComputedStyle(OVP,"");
-               dbg.value = style.height;
-               document.getElementById('ObjectListViewport_Entry_Cover').style.height= '200px' ;
+
+               OVP = getComputedStyle(document.getElementById('ObjectListViewport'),"").height;
+               OVP_h = parseInt(OVP.replace(/px/,''));
+
+               table             = getComputedStyle(document.getElementById('ObjectListViewport_Table'),"").height;
+               table_header  = getComputedStyle(document.getElementById('ObjectListViewport_TD_Header'),"").height;
+               table_entries = getComputedStyle(document.getElementById('ObjectListViewport_TD_Entries'),"").height;
+               table_footer  = getComputedStyle(document.getElementById('ObjectListViewport_TD_Footer'),"").height;
+
+               table_h                 = parseInt(table.replace(/px/,''));
+               table_header_h  = parseInt(table_header.replace(/px/,''));
+               table_entries_h = parseInt(table_entries.replace(/px/,'')); 
+               table_footer_h  = parseInt(table_footer.replace(/px/,''));
+                       
+               calc = (OVP_h  - ( table_header_h + table_footer_h ));
+               dbg.value = calc; 
+               document.getElementById('ObjectListViewport_Entry_Cover').style.height= calc + 'px' ;
+
+               OVP_T = getComputedStyle(document.getElementById('ObjectListViewport_Table'),"").width;
+               OVP_T_w = parseInt(OVP_T.replace(/px/,'',OVP_T));
+               
+
+               document.getElementById('ObjectListViewport_Entry_Table').style.width = (OVP_T_w - 16) + 'px';
+               dbg.value  = OVP_T_w + document.getElementById('ObjectListViewport_Entry_Table').style.width; 
        }
 </script>
 </head>
-<body onmouseover="setHeight();" >
-<input type='text' id='debug' value="">
-<div id='ObjectListViewport' style='height:20%;'>
-<?php
-echo passthru("./test");
-?>
-</div>
+<body>
+<input type='text' id='debug' value="" style='width:100%;'>
+       <table style='height:90%;width:100%;background-color:#6788FF;border: solid 5px #000000;'>
+               <tr>
+                       <td style='width:50%;background-color:#AAA006;'>
+                               hallo<br>
+                               hallo<br>
+                               hallo<br>
+                               hallo<br>
+                               hallo<br>
+                               hallo<br>
+                       </td>
+                       <td style='height:230px;background-color:#660099;'>
+                               <?php
+                               echo passthru("./test");
+                               ?>
+                       </td>
+               </tr>
+               <tr>
+                       <td style='background-color:#999777;'>
+                               hallo<br>
+                               hallo<br>
+                       </td>
+                       <td style='background-color:#AAA006;'>
+                               hallo<br>
+                               hallo<br>
+                       </td>
+               </tr>
+       </table>
+<script type="text/javascript">
+//     document.getElementById('ObjectListViewport_Entry_Cover').style.height= document.getElementById('ObjectListViewport').height;
+       document.getElementById('ObjectListViewport_Entry_Cover').style.height= "200px";
+</script>
 </body>
 </html>