Code

Updated listing for minimum column widths
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Oct 2009 10:09:09 +0000 (10:09 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Oct 2009 10:09:09 +0000 (10:09 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14704 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_listing.inc

index c917e961a2508fd926cec0885361520e076451ee..464f0a0dd38d7db327cf755abca375cbc25a3f52 100644 (file)
@@ -557,30 +557,35 @@ class listing {
     $cols= split("\|", $layout);
     foreach ($cols as $index => $config) {
       if ($config != "") {
+        $res= "";
         $components= split(';', $config);
-        $config= "";
         foreach ($components as $part) {
           if (preg_match("/^r$/", $part)) {
-            $config.= "text-align:right;";
+            $res.= "text-align:right;";
             continue;
           }
           if (preg_match("/^l$/", $part)) {
-            $config.= "text-align:left;";
+            $res.= "text-align:left;";
             continue;
           }
           if (preg_match("/^c$/", $part)) {
-            $config.= "text-align:center;";
+            $res.= "text-align:center;";
             continue;
           }
           if (preg_match("/^[0-9]+(|px|%)$/", $part)) {
-            $config.= "width:$part;";
+            $res.= "width:$part;min-width:$part;";
             continue;
           }
         }
 
-        $result[$index]= " style='$config' ";
+        // Add minimum width for scalable columns
+        if (!preg_match('/width:/', $res)){
+          $res.= "min-width:200px;";
+        }
+
+        $result[$index]= " style='$res' ";
       } else {
-        $result[$index]= null;
+        $result[$index]= " style='min-width:100px'";
       }
     }