Code

fixed style
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 Nov 2005 14:40:10 +0000 (14:40 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 Nov 2005 14:40:10 +0000 (14:40 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1836 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_divlist.inc
plugins/admin/applications/class_applicationManagement.inc
plugins/admin/departments/class_departmentManagement.inc
plugins/admin/groups/class_groupManagement.inc
plugins/admin/ogroups/class_ogroupManagement.inc
plugins/admin/systems/class_systemManagement.inc
plugins/admin/users/class_userManagement.inc

index 65fc872f2be9b03edede93cf0a37b1f40db2f6f7..f6bc8f9e99c93b4413e02dc0c054d2e753517ca0 100644 (file)
@@ -48,23 +48,26 @@ class divlist {
        }
        
        function DrawList(){
-               
                $s_return = "";
-               
-               $s_return.= "<table summary='".$this->s_summary."' width='600' cellspacing='0'>";
-
+               $s_return.= "<table summary='".$this->s_summary."' width='600' height='500' cellspacing='0'>";
     if($this->i_entriesPerPage==0) {
-    
-      $s_return.= "<thead>".$this->_generateHeader()."</thead>";
-
-      // Define an alternate style for IE
-      $s_return.= "<!--[if IE]><style type='text/css'>tbody.scrollcontent {overflow-y:scroll;max-height:480px;}</style><![endif]-->";
-    
-      $s_return.= "<tbody class='scrollcontent'>".$this->_generatePage()."</tbody>";
+      // TODO: Find a more convenient way to use the same functionality in both
+      // MSIE and non-MSIE browsers. ATM we need to manually set entriesPerPage to
+      // a non-zero value, because MSIE won't scroll the tbody properly.
+      if(strpos($_SERVER['HTTP_USER_AGENT'],'MSIE') == 0){
+        $s_return.= "<thead>".$this->_generateHeader()."</thead>";
+        // Define an alternate style for IE (not used ATM)
+        // $s_return.= "<!--[if IE]><style type='text/css'>tbody.scrollcontent {overflow-y:scroll;max-height:480px;}</style><![endif]-->";
+        $s_return.= "<tbody style='max-height:480px;overflow:auto;overflow:-moz-scrollbars-vertical;'>".$this->_generatePage()."</tbody>";
+      } else {
+        // Call ourself with i_entriesPerPage set to a default value
+        $this->SetEntriesPerPage(20);
+        $s_return.=$this->_generateHeader();
+        $s_return.=$this->_generatePage();
+      }
     } else {
-      $s_return.=$this->_generateHeader();
-
-      $s_return.=$this->_generatePage();
+        $s_return.=$this->_generateHeader();
+        $s_return.=$this->_generatePage();
     }
                //$s_return.= nl2br(htmlentities($this->_generatePage()));
                
@@ -102,9 +105,9 @@ class divlist {
                        if(!isset($s_value['attach'])){
                                $s_value['attach'] = "";
                        }
-                       
+       
       if($i_count == 0) {
-                       $s_return .= "\n<td class='listheader' style='border-right:0px;border-bottom:1px solid #b0b0b0;'".$s_value['attach'].">".$s_value['string']."</td>";
+                       $s_return .= "\n<td class='listheader' style='border-right:0px;border-bottom:1px solid #b0b0b0;' ".$s_value['attach'].">".$s_value['string']."</td>";
       } else {
                        $s_return .= "\n<td class='listheader' style='border-bottom:1px solid #b0b0b0;'".$s_value['attach'].">".$s_value['string']."</td>";
       }
@@ -113,7 +116,7 @@ class divlist {
                
     // Only create additional column if we're using scrollbars
     if($this->i_entriesPerPage==0) {
-      $s_return .= "<td class='listheader' style='border-right:0px;padding:0px;border-bottom:1px solid #b0b0b0;width:16px;'>&nbsp;</td>";
+      $s_return .= "\n<td class='listheader' style='border-right:0px;padding:0px;border-bottom:1px solid #b0b0b0;width:16px;'>&nbsp;</td>";
     }
                $s_return .= "\n</tr>";
                return $s_return;
@@ -214,58 +217,59 @@ class divlist {
                }
     } else {
       // We should display all entries on one page
-               foreach($this->a_entries as $s_key => $s_value){
-                       
-                       if($i_alternate){ 
+
+      $i = $this->_numEntries();
+           foreach($this->a_entries as $s_key => $s_value){
+                         $i--;
+
+        if($i_alternate!=0){ 
           $i_alternate=0; 
         } else {
           $i_alternate=1;
         }
-               
+                 
         $s_return .= "\n<tr>";
-                               
-               $cnt = 0;                                       
-                                       
-                       foreach($s_value as $s_key2 => $s_value2 ){                             
-  
-                               $this->cols = count($s_value) ;                                         
-                               $cnt++;                                 
-  
-                               if(!isset($s_value2['class'])){
-                                       $class = "list".$i_alternate; 
-                               } else {
-                                       $class = $s_value2['class'];
-                               }
-  
-                               if(!isset($s_value2['attach'])){
-                                       $style = "";
-                               } else {
-                                       $style = " ".$s_value2['attach']." "    ;
-                               }
-  
-                               $s_return .= "\n<td ".$style." class='".$class."'>";
-                               $s_return .= $s_value2['string'];
-                               $s_return .= "</td>";
-                       }
-                       
-        if($cnt == 0 ){
-                               $s_return.="\n<td>&nbsp;</td>";
-                       } else {
-                               //$s_return.="\n<td style='border:0px;padding:0px;' class='list".$i_alternate."'>&nbsp;</td>";
-        }
-                       $s_return .= "\n</tr>";
-               }
+                                 
+                   $cnt = 0;                                   
+                                         
+                         foreach($s_value as $s_key2 => $s_value2 ){                           
+
+                                 $this->cols = count($s_value) ;                                               
+                                 $cnt++;                                       
+
+                                 if(!isset($s_value2['class'])){
+                                         $class = "list".$i_alternate; 
+                                 } else {
+                                         $class = $s_value2['class'];
+                                 }
+
+                                 if(!isset($s_value2['attach'])){
+                                         $style = "";
+                                 } else {
+                                         $style = " ".$s_value2['attach']." "  ;
+                                 }
+          
+          $s_return .= "\n<td ".$style." class='".$class."'>";
+                                 $s_return .= $s_value2['string'];
+                                 $s_return .= "</td>";
+                         }
+                         $s_return .= "\n</tr>";
+                 }
     }
-         
-    $fill= "";
-    for ($i= 1; $i <= $this->cols; $i++){
-      if ($i == $this->cols){
-        $fill.= "<td class='list1' style='height:100%;border-right:0px'>&nbsp;</td>";
-      } else {
-        $fill.= "<td class='list1' style='height:100%'>&nbsp;</td>";
+
+    // if fewer than 22 Entries (list not full), print row to fill empty space
+    if($this->_numEntries()<22){
+      $fill= "";
+      for ($i= 1; $i <= $this->cols; $i++){
+        if ($i == $this->cols){
+         $fill.= "<td class='list1' style='height:100%;border-right:0px';>&nbsp;</td>";
+        } else {
+         $fill.= "<td class='list1' style='height:100%';>&nbsp;</td>";
+        }
       }
+      $s_return.="\n<tr>$fill</tr>";
     }
-    return $s_return."\n<tr>$fill</tr>";
+    return $s_return;
   }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index b72b7e2e9f82f30ff42373503c7bd7ae0da448c2..22e3947ae3ea931e0de563c0b4c31d72fd4a4483 100644 (file)
@@ -376,9 +376,9 @@ class applicationManagement extends plugin
             }
           }
 
-          $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>");
+          $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>","attach"=>"style='width:20px;text-align:center;'");
           $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val));
-          $field3 = array("string" => "&nbsp;","attach"=>"style='text-align:right;border:none'");
+          $field3 = array("string" => "&nbsp;","attach"=>"style='width:48px;text-align:left;border:none'");
 
           $divlist->AddEntry(array($field1,$field2,$field3));
         }
@@ -391,9 +391,9 @@ class applicationManagement extends plugin
           }else{
             $desc = " - [ ".$val['description'][0]." ]";
           }
-          $field1 = array("string" => sprintf($applimg,$val['dn']),"attach"=>"style='width:20px;align:middle;'");
+          $field1 = array("string" => sprintf($applimg,$val['dn']),"attach"=>"style='width:20px;align:center;text-align:center;'");
           $field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)),"attach"=>$title);
-          $field3 = array("string" => preg_replace("/%KEY%/", $key, $actions),"attach"=>"style='text-align:right;border:none'");
+          $field3 = array("string" => preg_replace("/%KEY%/", $key, $actions),"attach"=>"style='width:48px;text-align:right;border:none'");
 
           $divlist->AddEntry(array($field1,$field2,$field3));
         }
index 38451b25a76e3b7a34946d5084f4187541b2eea4..32f1998bddce13c3d04a7454693fed4cf36058b7 100644 (file)
@@ -315,9 +315,9 @@ class departmentManagement extends plugin
                                }
        
                                $title = $this->config->departments[$key];
-                               $field0 = array("string" => "<img src='images/".$non_empty."folder.png' title='"._("department")."' alt='department'>","attach"=>"style='width:20px;'");
-                               $field1 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style='width:516px' title='".$title."'");
-                               $field2 = array("string" => preg_replace("/%KEY%/", base64_encode($key), $actions),"attach"=>"style='text-align:left;border:none;width:48px;'");
+                               $field0 = array("string" => "<img src='images/".$non_empty."folder.png' title='"._("department")."' alt='department'>","attach"=>"style='text-align:center;width:20px;'");
+                               $field1 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style='text-align:left;' title='".$title."'");
+                               $field2 = array("string" => preg_replace("/%KEY%/", base64_encode($key), $actions),"attach"=>"style='text-align:right;border:none;width:48px;'");
 
                                $divlist->AddEntry( array($field0,$field1,$field2));
 
index b70a38cdeb5bbf10cff8767e5d51f87d41b38dd6..4e21b8bdff40fa088b9b921763681680ef0fbd2e 100644 (file)
@@ -409,10 +409,10 @@ class groupManagement extends plugin
       }
 
 
-      $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>");
+      $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>","attach"=>"style='text-align:center;width:20px;'");
       $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val));
       $field3 = array("string" => "&nbsp;");
-      $field4 = array("string" => "&nbsp;","attach"=>"style='text-align:right;border:none'");
+      $field4 = array("string" => "&nbsp;","attach"=>"style='text-align:right;border:none;width:48px;'");
 
       $divlist->AddEntry(array($field1,$field2,$field3,$field4));
     }
@@ -437,10 +437,10 @@ class groupManagement extends plugin
       }else{
         $desc = " - [ ".$val['description'][0]." ]";
       }      
-      $field1 = array("string" => sprintf($userimg,$val['dn']),"attach"=>"style='width:20px;align:middle;'");
+      $field1 = array("string" => sprintf($userimg,$val['dn']),"attach"=>"style='width:20px;text-align:center;'");
       $field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)),"attach"=>$title);
-      $field3 = array("string" => $posix."&nbsp;".$enviro."&nbsp;".$mail."&nbsp;".$samba."&nbsp;".$appl."&nbsp;".$phone);  
-      $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions),"attach"=>"style='text-align:right;border:none;width:32px;'");
+      $field3 = array("string" => $posix."&nbsp;".$enviro."&nbsp;".$mail."&nbsp;".$samba."&nbsp;".$appl."&nbsp;".$phone,"attach"=>"style='text-align:left;width:136px;'");  
+      $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions),"attach"=>"style='text-align:right;border:none;width:48px;'");
       
       $divlist->AddEntry(array($field1,$field2,$field3,$field4));    
     }
index e5f31081118f51c682ebabf6551e3e2176ee85de..c1f4b3f18095dedd7480d9e403852c47e5ce7c66 100644 (file)
@@ -416,7 +416,7 @@ name='dep_root' alt='"._("Root")."'>&nbsp;".
 
       $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='"._("Department")."'>","attach"=>"style='text-align:center;width:20px;'");
       $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val));
-      $field3 = array("string" => "&nbsp;","attach"=>"style='width:48;'");
+      $field3 = array("string" => "&nbsp;","attach"=>"style='width:136px;'");
       $field4 = array("string" => "&nbsp;","attach"=>"style='width:48px;text-align:left;border:none'");
 
       $divlist->AddEntry(array($field1,$field2,$field3,$field4));
@@ -438,7 +438,7 @@ name='dep_root' alt='"._("Root")."'>&nbsp;".
       }else{
         $desc = " - [ ".$val['description'][0]." ]";
       }
-      $field1 = array("string" => "<img src='images/list_ogroup.png' alt='"._("Object group")."' ".$title.">");
+      $field1 = array("string" => "<img src='images/list_ogroup.png' alt='"._("Object group")."' ".$title.">","attach"=>"style='text-align:center;width:20px;'");
       $field2 = array("string" => sprintf($editlink,$key,($val['cn']['0'].$desc)),"attach"=>$title);
       $field3 = array("string" => $this->convert_list($val)."&nbsp;".$mail);
       $field4 = array("string" => preg_replace("/%KEY%/", $key, $actions),"attach"=>"style='text-align:right;border:none'");
index badbc17d12bbd571785fcf323f0a18a15cc04721..968df5ed3378dfb23d7d77c4a6c6d40067a0b874 100644 (file)
@@ -610,9 +610,9 @@ class systems extends plugin
         }
       }
 
-      $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>");
+      $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>","attach"=>"style='width:20px;text-align:center;'");
       $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val));
-      $field3 = array("string" => "&nbsp;", "attach" => "style='border:none'");
+      $field3 = array("string" => "&nbsp;", "attach" => "style='border:none;width:48px;text-align:right;'");
       $divlist->AddEntry(array($field1,$field2,$field3));
     }
 
@@ -669,7 +669,7 @@ class systems extends plugin
 
       $img=$this->convert_list($val);
 
-      $field1 = array("string" => sprintf($img['img'],$val['dn']),"attach"=>"style='width:20px;align:middle;'");
+      $field1 = array("string" => sprintf($img['img'],$val['dn']),"attach"=>"style='width:20px;text-align:center;'");
       $field2 = array("string" => sprintf($editlink,$key,$display),"attach"=>"title='".$val['dn']."'");
       $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action),"attach" => "style='border:none; text-align:right;width:48px'");
       $divlist->AddEntry( array($field1,$field2,$field3));
index a47597dc1ff13145e300fc6ca882aea5c46c5cf3..3035d85141db10113f731c651b45193f8c1ec457 100644 (file)
@@ -712,10 +712,10 @@ class userManagement extends plugin
         }
       }
 
-      $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>");
+      $field1 = array("string" => "<img src='images/".$non_empty."folder.png' alt='department'>","attach"=>"style='width:20px;text-align:center;'");
       $field2 = array("string" => sprintf($linkopen,base64_encode($key),$val));
       $field3 = array("string" => "&nbsp;");
-      $field4 = array("string" => "&nbsp;", "attach" => "style='border:none'");
+      $field4 = array("string" => "&nbsp;", "attach" => "style='width:48px;border:none'");
 
 
       $divlist->AddEntry(array($field1,$field2,$field3,$field4));
@@ -861,10 +861,10 @@ class userManagement extends plugin
       }
 
       /* Create each field */
-      $field1 = array("string" => sprintf($tpl,$val['dn']),"attach"=>"style='width:20px;align:middle;'");
+      $field1 = array("string" => sprintf($tpl,$val['dn']),"attach"=>"style='width:20px;text-align:center;'");
       $field2 = array("string" => sprintf($editlink,$key,$display).$ip_port,"attach"=>"title='".$val['dn']."'");
-      $field3 = array("string" => $usrimg2."&nbsp;".$posix."&nbsp;".$enviro."&nbsp;".$maila."&nbsp;".$fonac."&nbsp;".$faxac."&nbsp;".$samba."&nbsp;".$s_img_create_from_template, "attach" => "style='width:155px;'");
-      $field4 = array("string" => preg_replace("/%KEY%/", "$key", $action),"attach" => "style='border:none; text-align:right;width:48px'");
+      $field3 = array("string" => $usrimg2."&nbsp;".$posix."&nbsp;".$enviro."&nbsp;".$maila."&nbsp;".$fonac."&nbsp;".$faxac."&nbsp;".$samba."&nbsp;".$s_img_create_from_template, "attach" => "style='width:136px;'");
+      $field4 = array("string" => preg_replace("/%KEY%/", "$key", $action),"attach" => "style='border:none;text-align:right;width:48px'");
 
       $add = array($field1,$field2,$field3,$field4);