summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e30ead8)
raw | patch | inline | side by side (parent: e30ead8)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 Apr 2011 09:23:34 +0000 (09:23 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 Apr 2011 09:23:34 +0000 (09:23 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20653 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc | patch | blob | history |
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc
index 2633eda4004eec32ca3188d126358120b76e99ab..e5ea6ff461923234553d40442d1ab4df0cafa4e4 100644 (file)
var $listing = NULL;
var $cfgTypeMap = NULL;
+ var $cfgItemMap = NULL;
/*! \brief Initialize the plugin and finally update the data model.
*/
$this->TemplateEngine = new TemplateEngine($config);
// Request an update of the data model
- $this->cfgTypeMap = array();
$this->loadInstallationMethods();
$this->updateDataModel();
$this->listing->setListingTypes($this->getListingTypes());
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'];
$this->initFailed = TRUE;
return;
}else{
+ $this->cfgItemMap = array();
foreach($this->installationMethods as $method => $items){
foreach($items['items'] as $itemName => $item){
- $this->cfgTypeMap[$itemName] = $method;
+ $this->cfgItemMap[$itemName] = $method;
}
}
}
// Update the template engine to use another type of item and
// some other values.
$item = $this->dataModel->getItemById($ids[0]);
- $release = preg_replace("/^.*\//","",$item['values']['__release']);
- $path = $item['values']['__path'];
-
- // Load item values on demand
- if($item['status'] == '-'){
- $rpc = $this->config->getRpcHandle();
- $item['values']['itemValues'] = $rpc->getConfigItem($release, $path);
- $this->dataModel->setItemStatus($item['path'], 'fetched');
- $this->dataModel->setItemValues($item['path'], $item['values']);
- }
- $method = $this->cfgTypeMap[$item['type']];
- $this->setInstallMethod($method);
- echo $method;
- $this->TemplateEngine->setValues($item['type'],$item['values']['itemValues']);
- $this->listing->setDialogObject($this->TemplateEngine);
+ if(isset($this->cfgItemMap[$item['type']])){
+ $release = preg_replace("/^.*\//","",$item['values']['__release']);
+ $path = $item['values']['__path'];
+ $method = $this->cfgItemMap[$item['type']];
+
+ // Load item values on demand
+ if($item['status'] == '-'){
+ $rpc = $this->config->getRpcHandle();
+ $item['values']['itemValues'] = $rpc->getConfigItem($release, $path);
+ $this->dataModel->setItemStatus($item['path'], 'fetched');
+ $this->dataModel->setItemValues($item['path'], $item['values']);
+ }
+
+ $this->setInstallMethod($method);
+ $this->TemplateEngine->setValues($item['type'],$item['values']['itemValues']);
+ $this->listing->setDialogObject($this->TemplateEngine);
+ }
}