Code

Fixed comment
[gosa.git] / plugins / admin / systems / class_workstationService.inc
index 844dae87266bb1c07a01cdae33f144bf631cece1..51982ff1f7d2e3384742c9ee2bc808869bceda72 100644 (file)
@@ -26,13 +26,8 @@ class workservice extends plugin
   var $cn= "";
   var $orig_dn= "";
   var $XMethods= array();
-  var $XDrivers= array("ati", "atimisc", "chips", "cirrus", "cyrix", "fbdev",
-      "i128", "i740", "i810", "imstt", "mga", "neomagic", "newport", "nsc",  "nv",
-      "r128", "radeon", "rendition", "s3", "s3virge", "savage", "siliconmotion",
-      "sis", "tdfx", "tga", "trident", "tseng", "vesa", "vga", "vmware");
-
+  var $XDrivers= array();
   var $XResolutions = array();
-
   var $MouseTypes= array();
   var $MousePorts= array();
   var $hardware_list= array();
@@ -84,6 +79,9 @@ class workservice extends plugin
       }
     }
 
+    /* Get list of available xdrivers */
+    $this->XDrivers = $this->getListOfXDrivers();
+
     array_unshift($this->XDrivers, "["._("unknown")."]");
  
     $this->XColordepths= array( 
@@ -109,7 +107,7 @@ class workservice extends plugin
 
     /* Additional values will be extracted from CONFIG_DIR/gosa/keyboardLayouts */
     $this->XKbLayouts= array ("de"=> "de","intl" =>"intl","us" =>"us");
-    $this->XKbVariants= array ("nodeadkeys"=>"nodeadkeys", "basic"=>"basic");
+    $this->XKbVariants= array ("basic"=>"basic", "nodeadkeys"=>"nodeadkeys");
 
     /* try to read additional keyboard layouts 
      */
@@ -429,6 +427,27 @@ class workservice extends plugin
     $this->handle_post_events("modify");
   }
 
+
+  function getListOfXDrivers()
+  {
+    $drivers = array();
+
+    /* Generate a list of xdrivers from CONFIG_DIR/xdrivers */
+    if (file_exists(CONFIG_DIR.'/xdrivers')){
+      $xdrivers = file (CONFIG_DIR.'/xdrivers');
+      foreach ($xdrivers as $line){
+        if (!preg_match ("/^#/", $line)){
+          $drivers[]= trim($line);
+        }
+      }
+    } else {
+      $drivers = array("ati", "atimisc", "chips", "cirrus", "cyrix", "fbdev", "fglrx",
+          "i128", "i740", "i810", "imstt", "mga", "neomagic", "newport", "nsc",  "nv", "nvidia",
+          "r128", "radeon", "rendition", "s3", "s3virge", "savage", "siliconmotion",
+          "sis", "tdfx", "tga", "trident", "tseng", "vesa", "vga", "vmware");
+    }
+    return($drivers);
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: