summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb6f738)
raw | patch | inline | side by side (parent: eb6f738)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 14 Mar 2011 09:08:30 +0000 (09:08 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 14 Mar 2011 09:08:30 +0000 (09:08 +0000) |
-Added abilitiy to disable automatic calls to 'save_object'.
-This can then be used in the myAccount tabs to prevent adapting values of
disabled input fields.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20620 594d385d-05f5-0310-b6e9-bd551577e9d8
-This can then be used in the myAccount tabs to prevent adapting values of
disabled input fields.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20620 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_tabs.inc | patch | blob | history |
index 7affa029d2235b3763948b383256b3a35346f255..efcaa4f4e5d8190ccb1d00503b637ded035b6e0f 100644 (file)
var $read_only = FALSE; // Used when the entry is opened as "readonly" due to locks.
var $hide_refs = FALSE;
var $hide_acls = FALSE;
+
+ // Normally 'save_object()' is called automatically when 'execute()' is called, but
+ // sometimes we do not want this behaviour, e.g. when a tab is opened readonly.
+ // If we call save_object for a 'read-only' tab, values may get lost.
+ var $skip_save_object = FALSE;
+
+
+ /*! \brief Enables or disables to automatic call to 'save_object' for a plugin,
+ * when 'execute()' is called.
+ */
+ function enableAutoSaveObject($bool)
+ {
+ $this->skip_save_object = ($bool == FALSE);
+ }
+
function tabs(&$config, $data, $dn, $acl_category= "", $hide_refs = FALSE, $hide_acls = FALSE)
{
}
}
- // Save last tab object
- if ($this->last == $this->current){
- $this->save_object(TRUE);
- } else {
- $this->save_object(FALSE);
+ // Save last tab object
+ if(!$this->skip_save_object){
+ if ($this->last == $this->current){
+ $this->save_object(TRUE);
+ } else {
+ $this->save_object(FALSE);
+ }
}
/* If multiple edit is enabled for this tab,