Code

Fixed department list
[gosa.git] / plugins / admin / fai / class_faiPackageConfiguration.inc
index bebd828679bed97845ced3e62b88eb28050de52a..63c2f90d5ad9d52d1a1c220e26526f718765489d 100644 (file)
@@ -12,8 +12,6 @@ class faiPackageConfiguration extends plugin
   var $attributes     = array();
   var $objectclasses  = array();
 
-  var $path;  
-
   var $Debconf_handle = NULL;
   var $pkg_config ;
   var $obj;
@@ -22,12 +20,17 @@ class faiPackageConfiguration extends plugin
   {
     plugin::plugin ($config, $dn);
     $this->obj = $obj;
-    $this->Debconf_handle = new debconf($this->obj, "de");
-    $this->Debconf_handle->set_template_directory($this->path);
-    $this->pkg_config = $pkg_config;
+    $this->Debconf_handle = new debconf();
+    $this->Debconf_handle->set_template_directory($path);
+    $this->Debconf_handle->set_package($this->obj);
+    $this->Debconf_handle->set_language(preg_replace('/_.*$/', '', get_browser_language()));
+
+    if( $this->Debconf_handle->load() ) {
+      $this->pkg_config = $pkg_config;
 
-    foreach($this->pkg_config as $var){
-      $this->Debconf_handle->SetDefault($var['Name'],$var['Value']);
+      foreach($this->pkg_config as $var){
+        $this->Debconf_handle->SetDefault($var['Name'],$var['Value']);
+      }
     }
   }
 
@@ -38,9 +41,10 @@ class faiPackageConfiguration extends plugin
 
     /* Fill templating stuff */
     $smarty     = get_smarty();
-    $display = "$this->obj";
+    $display = "";
+    $smarty->assign("headline", sprintf(_("Debconf information for package '%s'"), $this->obj));
 
-    $this->Debconf_handle -> PostCheck();
+    $this->Debconf_handle->PostCheck();
 
     $smarty->assign("Config",$this->Debconf_handle->get_dialog());
 
@@ -56,15 +60,15 @@ class faiPackageConfiguration extends plugin
   /* Check supplied data */
   function check()
   {
-    $message= array();
+    /* Call common method to give check the hook */
+    $message= plugin::check();
+
     return ($message);
   }
 
   function save()
   {
-    $this->Debconf_handle->set_template_directory($this->path);
-
-    $this->Debconf_handle  -> PostCheck();
+    $this->Debconf_handle->PostCheck();
     $pkgs = $this->Debconf_handle->template;
 
     $tmp = array();