Code

Added acls for printer glpi
[gosa.git] / plugins / admin / systems / tabs_terminal.inc
index 17a7c32a1f02e3c09adb74e782d318a836b8898c..7614608df23260c774ddd2ec788bb64b1b486e51 100644 (file)
@@ -3,7 +3,7 @@
 class termtabs extends tabs
 {
 
-  function termtabs($config, $data, $dn)
+  function termtabs($config, $data, $dn, $category)
   {
     /* Save dn */
     $this->dn= $dn;
@@ -12,11 +12,11 @@ class termtabs extends tabs
     foreach ($data as $tab){
       if($tab['CLASS'] == "printgeneric"){
         $this->by_name[$tab['CLASS']]= $tab['NAME'];
-        $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn,$this);
+        $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn, $category);
         $this->by_object[$tab['CLASS']]->parent= &$this;
       }else{
         $this->by_name[$tab['CLASS']]= $tab['NAME'];
-        $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn);
+        $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn, $category);
         $this->by_object[$tab['CLASS']]->parent= &$this;
       }
       /* Initialize current */
@@ -53,8 +53,10 @@ class termtabs extends tabs
     }
 
     tabs::save(TRUE);
-    if(($this->by_object['printgeneric']->is_account==false)&&($this->by_object['printgeneric']->initially_was_account==true)){
-      $this->by_object['printgeneric']->remove_from_parent();
+    if(isset($this->by_object['printgeneric'])){
+      if(($this->by_object['printgeneric']->is_account==false)&&($this->by_object['printgeneric']->initially_was_account==true)){
+        $this->by_object['printgeneric']->remove_from_parent();
+      }
     }
 
     /* Fix tagging if needed */