Code

Added dhcp plugin to general include list
[gosa.git] / include / class_tabs.inc
index 15c5fa0fe1a03197d2f96a005fe96bb21504747a..ba24d9530e8f047d06ba1633cd55b7ab1dc1322f 100644 (file)
@@ -86,7 +86,9 @@ class tabs
 
        $obj= $this->by_object[$this->current];
        $display.= $obj->execute();
-       $this->by_object[$this->current]= $obj;
+  if (is_php4()){
+    $this->by_object[$this->current]= $obj;
+  }
 
        /* Footer for tabbed dialog */
        $display.= "</td></tr></table>";
@@ -102,7 +104,9 @@ class tabs
 
                $obj= $this->by_object[$this->last];
                $obj->save_object ();
-               $this->by_object[$this->last]= $obj;
+    if (is_php4()){
+      $this->by_object[$this->last]= $obj;
+    }
        }
 
        /* Skip if curent and last are the same object */
@@ -118,7 +122,9 @@ class tabs
                        $this->current, "Saving (current)");
 
                $obj->save_object ();
-               $this->by_object[$this->current]= $obj;
+    if (is_php4()){
+      $this->by_object[$this->current]= $obj;
+    }
        }
 
   }
@@ -143,7 +149,7 @@ class tabs
                }
 
                /* Paint tab */
-               $display.= "<td style=\"vertical-align:bottom;width:1px;\">";
+               $display.= "<td style=\"vertical-align:bottom;width:1px;white-space:nowrap;\">";
 
                /* Shorten string if its too long for the tab headers*/
                $title= _($name);
@@ -153,11 +159,17 @@ class tabs
 
                $title= preg_replace("/ /", "&nbsp;", $title);
                
+               /* Take care about notifications */
+               if ($this->by_object[$class]->pl_notify){
+                       $notify= "id=\"notify\"";
+               } else {
+                       $notify= "";
+               }
                if ($_SESSION['js']==FALSE){    
-                       $display.= "<div class=\"$style[$index]\"><input type=\"submit\" name=\"$class\"".
+                       $display.= "<div class=\"$style[$index]\" $notify><input type=\"submit\" name=\"$class\"".
                                   " class=\"$style[$index]\" value=\"$title\"";
                } else {                         
-                       $display.= "<div class=\"$style[$index]\"><a class=\"$style[$index]\" onclick=\"return true;\" href=\"javascript:document.mainform.arg.value='$class';document.mainform.submit();\">$title</a";
+                       $display.= "<div $notify class=\"$style[$index]\"><a class=\"$style[$index]\" onclick=\"return true;\" href=\"javascript:document.mainform.arg.value='$class';document.mainform.submit();\">$title</a";
                }
                $display.= "></div></td>";
        }
@@ -177,7 +189,9 @@ class tabs
     foreach ($this->by_object as $key => $obj){
       $sacl= get_module_permission($acl, "$key", $this->dn);
       $obj->acl= $sacl;
-      $this->by_object[$key]= $obj;
+      if (is_php4()){
+        $this->by_object[$key]= $obj;
+      }
     }
   }
 
@@ -215,18 +229,31 @@ class tabs
        $this->save_object(TRUE);
        $messages= array();
 
+  $current_set = FALSE;
+
        /* Check all plugins */
        foreach ($this->by_object as $key => $obj){
                if ($obj->is_account || $ignore_account || $obj->ignore_account){
                        @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,
                                $key, "Checking");
 
-                       $messages= $obj->check();
-                       if (count($messages)){
-                               $this->current= $key;
-                               break;
-                       }
-               }
+                       $msg= $obj->check();
+      if (is_php4()){
+        $this->by_object[$key]= $obj;
+      }
+                       if (count($msg)){
+        $this->by_object[$key]->pl_notify= TRUE;
+        if(!$current_set){
+          $current_set = TRUE;
+                               $this->current= $key; 
+          $messages = $msg;
+        }
+                       }else{
+        $this->by_object[$key]->pl_notify= FALSE;
+      }
+               }else{
+      $this->by_object[$key]->pl_notify= FALSE;
+    }
        }
 
        return ($messages);
@@ -259,7 +286,9 @@ class tabs
                                  $key, "Adapting");
                  $obj->parent= &$this;
                  $obj->adapt_from_template($dn);
-                 $this->by_object[$key]= $obj;
+      if (is_php4()){
+        $this->by_object[$key]= $obj;
+      }
          }
   }