Code

Added initial copy&paste.
[gosa.git] / include / class_tabs.inc
index f94d985014a5a480106ece032e5a44a16dc0a386..9c0ebfd560b258cee81aa4adebb47a101a4b341f 100644 (file)
@@ -74,11 +74,11 @@ class tabs
        $display= $this->gen_tabs();
 
        /* Show object */
-       $display.= "<table cellpadding=4 cellspacing=0 border=0 style=\"width:100%; background-color:#F0F0F0; border-style:solid; border-color:black; 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:#F0F0F0; border-style:solid; border-color:black; border-top-width:0px; border-bottom-width:1px; border-left-width:1px; border-right-width:1px;\">\n";
        $display.= "<tr><td>\n";
 
        $obj= $this->by_object[$this->current];
-       $display.= $obj->execute ();
+       $display.= $obj->execute();
        $this->by_object[$this->current]= $obj;
 
        /* Footer for tabbed dialog */
@@ -119,7 +119,7 @@ class tabs
   function gen_tabs()
   {
        $display= "<input type=\"hidden\" name=\"arg\" value=\"\">";
-       $display.= "<table cellpadding=0 cellspacing=0 border=0 style=\"width:100%;\"><tr>";
+       $display.= "<table summary=\"\" cellpadding=0 cellspacing=0 border=0 style=\"width:100%;\"><tr>";
        $index= 0;
        $style= array("tab_left", "tab_active", "tab_near_active", "tab_right");
        foreach ($this->by_name as $class => $name){
@@ -137,11 +137,18 @@ class tabs
 
                /* Paint tab */
                $display.= "<td style=\"vertical-align:bottom; width:100px;\">";
+
+               /* Shorten string if its too long for the tab headers*/
+               $title= _($name);
+               if (mb_strlen($title, 'UTF-8') > 14){
+                       $title= mb_substr($title,0, 12, 'UTF-8')."...";
+               }
+               
                if ($_SESSION['js']==FALSE){    
                        $display.= "<div class=\"$style[$index]\"><input type=\"submit\" name=\"$class\"".
-                                  " class=\"$style[$index]\" value=\""._($name)."\"";
+                                  " 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();\">"._($name)."</a";
+                       $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></td>";
        }
@@ -238,6 +245,28 @@ class tabs
          }
   }
 
+       
+  /* Save attributes posted by copy & paste dialog
+   */
+  function saveCopyDialog()
+  {
+         foreach ($this->by_object as $key => $obj){
+                 $this->by_object[$key]->saveCopyDialog();
+         }
+  }
+
+
+  /* return copy & paste dialog
+   */
+  function getCopyDialog()
+  {
+         $ret = "";
+         foreach ($this->by_object as $key => $obj){
+                 $ret .=  $this->by_object[$key]->getCopyDialog();
+         }
+         return($ret);
+  }
+
 }
 
 ?>