From c969dcd5634731e2b28042aa0184e7d4c4c0f37e Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 7 May 2008 13:10:25 +0000 Subject: [PATCH] Added re_init function to tab class. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10821 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_tabs.inc | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/gosa-core/include/class_tabs.inc b/gosa-core/include/class_tabs.inc index d11d24b42..9748602c8 100644 --- a/gosa-core/include/class_tabs.inc +++ b/gosa-core/include/class_tabs.inc @@ -34,7 +34,7 @@ class tabs var $by_name= array(); var $by_object= array(); var $SubDialog = false; - + var $acl_category; var $multiple_support_active = FALSE; function tabs(&$config, $data, $dn, $acl_category= "") @@ -44,7 +44,7 @@ class tabs $this->config= &$config; $baseobject= NULL; - + $this->acl_category = $acl_category; foreach ($data as &$tab){ if (!plugin_available($tab['CLASS'])){ @@ -62,7 +62,7 @@ class tabs } $this->by_object[$tab['CLASS']]->parent= &$this; - $this->by_object[$tab['CLASS']]->set_acl_category($acl_category); + $this->by_object[$tab['CLASS']]->set_acl_category($this->acl_category); /* Initialize current */ if ($this->current == ""){ @@ -71,6 +71,28 @@ class tabs } } + + /*! \brief Reinitializes the tab classes with fresh ldap values. + This maybe usefull if for example if the apply button was pressed. + */ + function re_init() + { + $baseobject= NULL; + foreach($this->by_object as $name => $object){ + $class = get_class($object); + if(in_array($class,array("reference","acl"))) continue; + if ($baseobject === NULL){ + $baseobject= new $class($this->config, $this->dn); + $baseobject->enable_CSN_check(); + $this->by_object[$name]= $baseobject; + } else { + $this->by_object[$name]= new $class($this->config, $this->dn, $baseobject); + } + $this->by_object[$name]->parent= &$this; + $this->by_object[$name]->set_acl_category($this->acl_category); + } + } + function execute() { -- 2.30.2