Code

seperated header & footer
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 6 Nov 2007 11:21:30 +0000 (11:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 6 Nov 2007 11:21:30 +0000 (11:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-playground@7739 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_ObjectListViewport.inc
test.php

index 6f070214b3fbb88ffac2a47a7265c7b95c90f96c..970d1aa0edbb73bdb5f4c9bb0491bac27f53f026 100644 (file)
@@ -84,11 +84,13 @@ class ObjectListViewport {
       \return HTML rendered headline
         */
   private function renderHeadline(){
-    $buffer ="<tr>\n";
+    $buffer ="<table class='ObjectListViewport_Headline_Table'>\n";
+    $buffer.="<tr>\n";
     foreach($this->headline as $key => $value){
-      $buffer .= "<td style='".$value['style']."'>".$value['name']."</td>\n";
+      $buffer .= "<td class='ObjectListViewport_Headline_Cell' style='".$value['style']."'>".$value['name']."</td>\n";
     }
     $buffer.="</tr>\n";
+    $buffer.="</table>\n";
     return $buffer;
   }
 
@@ -100,10 +102,11 @@ class ObjectListViewport {
       \return HTML rendered footer
         */
   private function renderFooter(){
-
-    $buffer ="<tr>\n";
-    $buffer .= "<td colspan='".count($this->headline)."'>".$this->footer."</td>\n";
+    $buffer ="<table class='ObjectListViewport_Footer_Table'>\n"; 
+    $buffer.="<tr>\n";
+    $buffer.= "<td class='ObjectListViewport_Footer_Cell' colspan='".count($this->headline)."'>".$this->footer."</td>\n";
     $buffer.="</tr>\n";
+    $buffer.="</table>\n";
     return $buffer;
   }
 
@@ -148,9 +151,10 @@ class ObjectListViewport {
 
     $tmp = split("\|",trim($buffer,"|"));  
 
-    $buffer ="<tr>\n";
+
+    $buffer="<tr>\n";
     foreach($tmp as $key => $value){
-      $buffer .= "<td class='ObjectListViewportEntry' style='".$this->headline[$key]['style']."'>".$value."</td>\n";
+      $buffer .= "<td class='ObjectListViewport_Entry_Cell' style='".$this->headline[$key]['style']."'>".$value."</td>\n";
     }
     $buffer.="</tr>\n";
 
@@ -184,15 +188,18 @@ class ObjectListViewport {
     /* Apply current filter */
     $objects= new ObjectListFilterIterator($this->objects->getIterator());
     
+    $buffer.="<div style='overflow:scroll; height:400px;'>
+              <table class='ObjectListViewport_Entry_Table'>\n"; 
     foreach ($objects as $value){
       $buffer.= $this->renderEntry($value);
     }
+    $buffer.="</table>
+              </div>\n"; 
 
     /* Generate footer */
     $buffer.= $this->renderFooter();
 
-
-    return ("<table class='ObjectListViewportTable'>".$buffer."</table>");
+    return ($buffer);
   }
 
 
index c58318f49e2bffcb40e205479f8d64c24456ec84..1393296955d6dfbf414dfb1e98911bc757105fe7 100644 (file)
--- a/test.php
+++ b/test.php
@@ -2,9 +2,38 @@
        "http://www.w3.org/TR/html4/transitional.dtd">
 <html>
 <head>
+<style type="text/css">
+       
+.ObjectListViewport_Headline_Table {
+       background-color: #FF0000;
+       width:100%;
+       height:20px;
+       border-collapse:collapse;
+}
+.ObjectListViewport_Headline_Cell {
+       border: 1px solid #000000;
+}
+.ObjectListViewport_Entry_Table {
+       background-color: #00FF00;
+       width:100%;
+       border-collapse:collapse;
+}
+.ObjectListViewport_Entry_Cell {
+       border: 1px solid #000000;
+}
+.ObjectListViewport_Footer_Table {
+       background-color: #0000FF;
+       height:20px;
+       width:100%;
+       border-collapse:collapse;
+}
+.ObjectListViewport_Footer_Cell {
+       border: 1px solid #000000;
+}
+</style>
 </head>
 <body>
-<div style='overflow:scroll;height:500px; width:700px;'>
+<div style='height:500px; width:700px;'>
 <?php
 echo passthru("./test");
 ?>