Code

Updated management class
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Nov 2009 07:25:57 +0000 (07:25 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Nov 2009 07:25:57 +0000 (07:25 +0000)
-Set parent in newly created tab and dialog objects.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14768 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_management.inc
gosa-core/include/class_tabs.inc

index 7e906d211620879d13e50ccf54226a7ca56e378b..6a4675e50651be9edbe13e081c4f40d0815524d3 100644 (file)
@@ -312,6 +312,7 @@ class management
         $this->tabObject= new $tabClass($this->config,$this->config->data['TABS'][$tabType], $this->dn, $aclCategory);
         $this->tabObject->set_acl_base($this->dn);
         $this->tabObject->delete ();
+        $this->tabObject->parent = &$this;
 
         // Remove the lock for the current object.
         del_lock($this->dn);        
@@ -383,6 +384,7 @@ class management
       if(!empty($entry) && $this->ui->allow_snapshot_create($entry,$this->aclCategory)){
         $this->dialogObject = new SnapShotDialog($this->config,$entry,$this);
         $this->dialogObject->aclCategories = array($this->aclCategory);
+        $this->dialogObject->parent = &$this;
 
       }else{
         msg_dialog::display(_("Permission"),sprintf(_("You are not allowed to create a snapshot for %s."),$entry),
@@ -463,6 +465,7 @@ class management
         $this->dialogObject->set_snapshot_bases($bases);
         $this->dialogObject->display_all_removed_objects = true;
         $this->dialogObject->display_restore_dialog = true;
+        $this->dialogObject->parent = &$this;
       }else{
         msg_dialog::display(_("Permission"),sprintf(_("You are not allowed to restore a snapshot for %s."),$entry),
             ERROR_DIALOG);
@@ -476,6 +479,7 @@ class management
         $this->dialogObject = new SnapShotDialog($this->config,$entry,$this);
         $this->dialogObject->set_snapshot_bases($bases);
         $this->dialogObject->display_restore_dialog = true;
+        $this->dialogObject->parent = &$this;
       }else{
         msg_dialog::display(_("Permission"),sprintf(_("You are not allowed to restore a snapshot for %s."),$entry),
             ERROR_DIALOG);
@@ -532,6 +536,7 @@ class management
     }else{
       $this->tabObject= new $tabClass($this->config,$this->config->data['TABS'][$tabType], $this->dn, $aclCategory);
       $this->tabObject->set_acl_base($this->headpage->getBase());
+      $this->tabObject->parent = &$this;
       @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dn,"Create new entry initiated!");
     }
   }
@@ -595,6 +600,7 @@ class management
         $this->tabObject= new $tab($this->config,$this->config->data['TABS'][$tabType], $this->dn,$aclCategory);
         @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$this->dn,"Edit entry initiated!");
         $this->tabObject->set_acl_base($this->dn);
+        $this->tabObject->parent = &$this;
       }
     }else{
 
index 71499f098a10f31bc988f7300fba1fac91b74667..ef670569c718c287a0d01f0b195da816086f96fd 100644 (file)
@@ -37,6 +37,8 @@ class tabs
   var $acl_category; 
   var $multiple_support_active = FALSE;
 
+  var $parent = null; // A parent object if available, e.g. a management class.
+
   var $read_only = FALSE; // Used when the entry is opened as "readonly" due to locks.
   var $hide_refs = FALSE;
   var $hide_acls = FALSE;