From 18699e426e570351b531ca83ea2f2063ec12131b Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 5 Apr 2011 07:14:48 +0000 Subject: [PATCH] automatically select the right installation method git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20650 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_newConfigManagement.inc | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index a5bcdd1dc..7a4d574ad 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -89,8 +89,10 @@ class newConfigManagement extends plugin msg_dialog::display(_("Error"), sprintf(_("Failed to load distributions: %s"), $rpc->get_error()),ERROR_DIALOG); return(NULL); }else{ + $this->cfgTypeMap = array(); foreach($res as $dist){ $this->dataModel->addItem('Distribution','/root', $dist['name'], $dist); + $this->cfgTypeMap['/root/'.$dist['name']] = $dist['installation_method']; foreach($dist['releases'] as $release){ $distPath = "/root/{$dist['name']}"; $this->dataModel->addItem('Release',$distPath, $release['name'], $release); @@ -207,9 +209,8 @@ class newConfigManagement extends plugin $this->listing->setContainer($cont); // Set the correct installation method for the selected item - $item = $this->dataModel->getItemByPath($cont); - if($this->cfgTypeMap[$item['type']]){ - $method = $this->cfgTypeMap[$item['type']]; + if(isset($this->cfgTypeMap[$cont])){ + $method = $this->cfgTypeMap[$cont]; $this->setInstallMethod($method); } } @@ -304,15 +305,6 @@ class newConfigManagement extends plugin msg_dialog::display(_("Setup"), $this->errorMessage , ERROR_DIALOG); $this->initFailed = TRUE; return; - }else{ - - $this->cfgTypeMap = array(); - foreach($this->installationMethods as $methodName => $data){ - foreach($data['items'] as $itemName => $itemData){ - $this->cfgTypeMap[$itemName] = $methodName; - } - } - } } -- 2.30.2