Code

Updated plugin&&tabs, implemented tab disabling -> allows modal dialogs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 Nov 2008 14:47:13 +0000 (14:47 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 Nov 2008 14:47:13 +0000 (14:47 +0000)
-Currently not activated, should be checked before.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13058 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_plugin.inc
gosa-core/include/class_tabs.inc

index 2c804e967ad20073832cd07e700064cb0fd23e45..60f0878b0f9cf1b594f374099c2b60938e40402e 100644 (file)
@@ -2063,6 +2063,12 @@ class plugin
   {
      return(array());
   }
+
+  function is_modal_dialog()
+  {
+    return(FALSE); 
+    // return(isset($this->dialog) && $this->dialog);
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index a679baa5f6e3253911a5bc30bba7e63ef00e762b..38567747c6439b9c4128f76d60b30e297116e3f4 100644 (file)
@@ -124,11 +124,8 @@ class tabs
       $this->save_object(FALSE);
     }
 
-    /* Build tab line */
-    $display= $this->gen_tabs();
-
     /* Show object */
-    $display.= "<table summary=\"\" cellpadding=4 cellspacing=0 border=0 style=\"width:100%; background-color:#F8F8F8; border-style:solid; border-color:#AAA; border-top-width:0px; border-bottom-width:1px; border-left-width:1px; border-right-width:1px;\">\n";
+    $display = "<table summary=\"\" cellpadding=4 cellspacing=0 border=0 style=\"width:100%; background-color:#F8F8F8; border-style:solid; border-color:#AAA; border-top-width:0px; border-bottom-width:1px; border-left-width:1px; border-right-width:1px;\">\n";
     $display.= "<tr><td>\n";
 
     /* If multiple edit is enabled for this tab, 
@@ -138,9 +135,14 @@ class tabs
     }else{
       $display.= $this->by_object[$this->current]->multiple_execute();
     }
+    $modal_dialog = $this->by_object[$this->current]->is_modal_dialog();
+    
+    /* Build tab line */
+    $modal = TRUE;
+    $tabs= $this->gen_tabs($modal_dialog);
 
     /* Footer for tabbed dialog */
-    $display.= "</td></tr></table>";
+    $display = $tabs.$display."</td></tr></table>";
 
     return ($display);
   }
@@ -179,7 +181,7 @@ class tabs
     }
   }
 
-  function gen_tabs()
+  function gen_tabs($disabled = FALSE)
   {
     $display= "<input type=\"hidden\" name=\"arg\" value=\"\">";
     $display.= "<table summary=\"\" cellpadding=0 cellspacing=0 border=0 style=\"width:100%;\"><tr>";
@@ -218,13 +220,19 @@ class tabs
         $notify= "";
       }
 
-      if (session::get('js')==FALSE){  
+      if($disabled){
+        $display.= "<div ".$notify." class=\"$style[$index]\" 
+          style=' font-family:arial,helvetica,sans-serif;
+                  font-weight:bold;
+                  font-size:13px; 
+                  color: gray;'
+          title=\"$title\">".$title."</div>";
+      }elseif (session::get('js')==FALSE){     
         $display.= "<div ".$notify." class=\"$style[$index]\"><input type=\"submit\" name=\"$class\"".
-          " class=\"$style[$index]\" value=\"$title\"";
+          " class=\"$style[$index]\" value=\"$title\"></div></td>";
       } else {                  
-        $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 ".$notify." class=\"$style[$index]\"><a class=\"$style[$index]\" onclick=\"return true;\" href=\"javascript:document.mainform.arg.value='$class';document.mainform.submit();\">$title</a></div></td>";
       }
-      $display.= "></div></td>";
     }
     $display.= "<td style=\"vertical-align:bottom;\">\n";
     $display.= "<div class=\"tab_border\">&nbsp;</div></td></tr></table>";