Code

Hide the "apply" button if we are editing a new Device (ArpDevice)
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Oct 2007 08:16:25 +0000 (08:16 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Oct 2007 08:16:25 +0000 (08:16 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7614 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_systemManagement.inc

index 331e2add838bff3370b2cd26f758c97e79edc2a7..1685af29c2cc4282b0f8ee5f1ef61ea1aa9f303e 100644 (file)
@@ -815,15 +815,17 @@ class systems extends plugin
 
       /* Don't show buttons if tab dialog requests this */
 
-      $dialog = FALSE;
-      if(isset($this->systab->by_object[$this->systab->current]->dialog)){
+      $dialog     = FALSE;
+      $hide_apply = $this->dn == "new";
+      if(is_object($this->systab) && !isset($this->systab->by_object)){
+        $dialog = TRUE;
+        $hide_apply = TRUE;
+      }elseif(isset($this->systab->by_object[$this->systab->current]->dialog)){
         $dia = $this->systab->by_object[$this->systab->current]->dialog;
         if($dia === TRUE || is_object($dia)){
           $dialog = TRUE;
         }  
-      }
-
-      if(isset($this->systab->by_object[$this->systab->current]->netConfigDNS) && 
+      }elseif(isset($this->systab->by_object[$this->systab->current]->netConfigDNS) && 
         $this->systab->by_object[$this->systab->current]->netConfigDNS->dialog){
         $dialog = TRUE;
       }
@@ -832,7 +834,7 @@ class systems extends plugin
         $display.= "<p style=\"text-align:right\">\n";
         $display.= "<input type=\"submit\" name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
         $display.= "&nbsp;\n";
-        if ($this->dn != "new"){
+        if ($hide_apply){
           $display.= "<input type=submit name=\"edit_apply\" value=\""._("Apply")."\">\n";
           $display.= "&nbsp;\n";
         }