Code

Updated acl/actions
[gosa.git] / include / class_tabs.inc
index 78147cd0fa6332c23b400a2319e017b6d90e3f28..c71fa94920e3988584c1371a0642647d7e7d1145 100644 (file)
@@ -38,10 +38,19 @@ class tabs
        /* Save dn */
        $this->dn= $dn;
        $this->config= $config;
+       
+       $baseobject= NULL;
 
        foreach ($data as $tab){
                $this->by_name[$tab['CLASS']]= $tab['NAME'];
-               $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn);
+
+               if ($baseobject == NULL){
+                       $baseobject= new $tab['CLASS']($this->config, $this->dn);
+                       $this->by_object[$tab['CLASS']]= $baseobject;
+               } else {
+                       $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn, $baseobject);
+               }
+
                $this->by_object[$tab['CLASS']]->parent= &$this;
                $this->by_object[$tab['CLASS']]->set_acl_category($acl_category);
 
@@ -141,11 +150,14 @@ class tabs
                $display.= "<td style=\"vertical-align:bottom;width:1px;\">";
 
                /* Shorten string if its too long for the tab headers*/
-               $title= '<nobr>'._($name).'</nobr>';
+               $title= _($name);
                if (mb_strlen($title, 'UTF-8') > 28){
                        $title= mb_substr($title,0, 25, 'UTF-8')."...";
                }
-               
+                       
+               /* nobr causes w3c warnings so we use &nbsp; to keep the tab name in one line */
+               $title= preg_replace("/ /","&nbsp;",$title);
+
                if ($_SESSION['js']==FALSE){    
                        $display.= "<div class=\"$style[$index]\"><input type=\"submit\" name=\"$class\"".
                                   " class=\"$style[$index]\" value=\"$title\"";