Code

Allow disabling of footer and header part
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 9 Nov 2007 07:01:17 +0000 (07:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 9 Nov 2007 07:01:17 +0000 (07:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-playground@7752 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa.conf
include/class_ObjectListViewport.inc

index ca705aa794a61e9dbfc07e12b374075c6f414864..dee0901005cd7758d759803a5d76921d9e2deaec 100644 (file)
--- a/gosa.conf
+++ b/gosa.conf
@@ -119,6 +119,6 @@ kiosk-path = "/var/spool/kiosk"
 ppd-path = "/var/spool/ppds"
 
 [plugin/sample]
-headline= "|{18px}|{:L}Name|{160px:R}Actions|"
+headline= "|{18px}|{:L}Name|{40%:R}Actions|"
 footer= "Statistics with no information currently"
 entryFormat= "|{_icon}|{cn} ({_filter(uppercase,{cn})})|{_actions}|"
index 693e424c187ace3e761b94494359dd80c0ef5f72..340a69f7d5dc4d8969400bf525daa9e4c652a572 100644 (file)
@@ -30,7 +30,9 @@ class ObjectListViewport {
   private $footer;
   private $entryFormat;
   private $attributes= array('cn', '_icon', '_actions', 'dn');
-
+  
+  private $b_displayHeader  = TRUE;
+  private $b_displayFooter    = TRUE;
   /* <---- Dummy here */
 
   /*!
@@ -192,8 +194,21 @@ class ObjectListViewport {
         */
   public function render() {
 
-    $header = $this->renderHeadline();
-    $footer = $this->renderFooter();
+    $header = $footer = "";
+    if($this->b_displayHeader){
+      $header ="<tr>
+                  <td class='ObjectListViewport_TD_Header' id='ObjectListViewport_TD_Header".$this->id."'>
+                    ".$this->renderHeadline()."
+                  </td>
+                </tr>";
+    }
+    if($this->b_displayFooter){
+      $footer ="<tr>
+                  <td class='ObjectListViewport_TD_Footer' id='ObjectListViewport_TD_Footer".$this->id."'>
+                    ".$this->renderFooter()."
+                  </td>
+                </tr>";
+    }
 
     /* Apply current filter */
     $entries = "";
@@ -208,11 +223,7 @@ class ObjectListViewport {
       <tr>
         <td>
               <table class='ObjectListViewport_Table' id='ObjectListViewport_Table".$this->id."' cellpadding=0 cellspacing=0 >
-                <tr>
-                  <td class='ObjectListViewport_TD_Header' id='ObjectListViewport_TD_Header".$this->id."'>
-                    ".$header."
-                  </td>
-                </tr>
+                ".$header."
                 <tr>
                   <td class='ObjectListViewport_TD_Entries' id='ObjectListViewport_TD_Entries".$this->id."'>
                     <div class='ObjectListViewport_Entry_Cover' id='ObjectListViewport_Entry_Cover".$this->id."'> 
@@ -222,11 +233,7 @@ class ObjectListViewport {
                     </div>
                   </td>
                 </tr>
-                <tr>
-                  <td class='ObjectListViewport_TD_Footer' id='ObjectListViewport_TD_Footer".$this->id."'>
-                    ".$footer."
-                  </td>
-                </tr>
+                ".$footer."
               </table>
 
         </td>
@@ -296,6 +303,12 @@ class ObjectListViewport {
   }
 
 
+  public function enableFooter($bool = TRUE){
+    $this->b_displayFooter = $bool;
+  }
+  public function enableHeader($bool = TRUE){
+    $this->b_displayHeader = $bool;
+  }
   
 }