index c7666fddff52ffb86e498d1299977eb3bb6f2fb1..feb50d164a248281a5baeef5b6e52b04a601c68d 100644 (file)
var $acl_category;
var $multiple_support_active = FALSE;
+ var $read_only = FALSE; // Used when the entry is opened as "readonly" due to locks.
+
function tabs(&$config, $data, $dn, $acl_category= "")
{
/* Save dn */
$this->dn= $dn;
$this->config= &$config;
+ if(!count($data)) {
+ $data[] = array("CLASS" => 'plugin',"NAME" => 'Error');
+ msg_dialog::display(_("Error"),
+ sprintf(_("No plugin definitions found to initialize '%s', please check your configuration file."),get_class($this)),
+ "ERROR_DIALOG");
+ }
+
$baseobject= NULL;
$this->acl_category = $acl_category;
foreach ($data as &$tab){
$this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn, $baseobject);
}
+ $this->read_only |= $this->by_object[$tab['CLASS']]->read_only;
$this->by_object[$tab['CLASS']]->parent= &$this;
$this->by_object[$tab['CLASS']]->set_acl_category($this->acl_category);
$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,
}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);
}
}
}
- 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>";
}
/* nobr causes w3c warnings so we use to keep the tab name in one line */
- $title= preg_replace("/ /"," ",$title);
+ $title= str_replace(" "," ",$title);
/* Take care about notifications */
$obj = $this->by_object[$class];
$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::global_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\"> </div></td></tr></table>";