Code

Added functions_FAI.inc to main.inc
[gosa.git] / include / class_tabs.inc
index f6865b9d08a99008db3bb2a164f0c0a840f062e5..e0e8dbe422b0bf555c7fe25940a04bdf3b5aa0bf 100644 (file)
@@ -30,6 +30,7 @@ class tabs
   var $disabled= "";
   var $by_name= array();
   var $by_object= array();
+  var $SubDialog = false;
 
   function tabs($config, $data, $dn)
   {
@@ -174,6 +175,15 @@ class tabs
 
   function delete()
   {
+       /* Check if all plugins will ACK for deletion */
+       foreach (array_reverse($this->by_object) as $key => $obj){
+               $reason= $obj->allow_remove();
+               if ($reason != ""){
+                       print_red(sprintf(_("Delete process has been canceled by plugin '%s': %s"), $key, $reason));
+                       return;
+               }
+       }
+
        /* Delete for all plugins */
        foreach (array_reverse($this->by_object) as $key => $obj){
                $obj->remove_from_parent();
@@ -263,9 +273,16 @@ class tabs
   function getCopyDialog()
   {
          $ret = "";
+         $this->SubDialog = false;
          foreach ($this->by_object as $key => $obj){
                  if($obj->is_account){
-                         $ret .=  $this->by_object[$key]->getCopyDialog();
+                         $tmp = $this->by_object[$key]->getCopyDialog();
+                         if($tmp['status'] == "SubDialog"){
+                                 $this->SubDialog = true;
+                     return($tmp['string']);
+                 }else{
+                 $ret .= $tmp['string'];
+                         }
                  }
          }
          return($ret);