summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5028b53)
raw | patch | inline | side by side (parent: 5028b53)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 Apr 2011 09:21:04 +0000 (09:21 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 Apr 2011 09:21:04 +0000 (09:21 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20652 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc
index 5ab5259728220275e6981783f649a6d5b4df3418..062d4681879094968d2d41a611cc6232e9cba6cd 100644 (file)
}
}
+ function setItemValues($path, $values)
+ {
+ if(!$this->itemExistsByPath($path)){
+ trigger_error("Invalid item path '{$path}'!");
+ }else{
+ $this->data['linear'][$path]['values'] = $values;
+ }
+ }
+
function getItemsByType($types)
{
$res = array();
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc
index f6acaf539ae2cc966b1bedc89f8bedea439e9f86..ef0705cba199d441349004b550803edfecf5060f 100644 (file)
function setDialogObject($o)
{
$this->dialogObject = &$o;
- $this->listing->skipFooter = TRUE;
- $this->listing->dialog = TRUE;
+ $this->skipFooter = TRUE;
+ $this->dialog = TRUE;
}
}
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc
index 1b6bba4b89f4a0e1b9e547c9bc8b0b7b910696ed..2633eda4004eec32ca3188d126358120b76e99ab 100644 (file)
// Load the template engine and tell her what template
// to use for the HTML it produces.
$this->TemplateEngine = new TemplateEngine($config);
- $this->TemplateEngine->setTemplate('puppet.tpl');
// Request an update of the data model
+ $this->cfgTypeMap = array();
$this->loadInstallationMethods();
$this->updateDataModel();
$this->listing->setListingTypes($this->getListingTypes());
msg_dialog::display(_("Setup"), $this->errorMessage, ERROR_DIALOG);
return(FALSE);
}else{
-
+
+ $this->TemplateEngine->setTemplate($str.".tpl");
$this->itemConfig = $this->installationMethods[$str]['items'];
$this->invalidInstallMethod =FALSE;
$this->TemplateEngine->load($this->itemConfig);
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'];
msg_dialog::display(_("Setup"), $this->errorMessage , ERROR_DIALOG);
$this->initFailed = TRUE;
return;
+ }else{
+ foreach($this->installationMethods as $method => $items){
+ foreach($items['items'] as $itemName => $item){
+ $this->cfgTypeMap[$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'] == '-'){
- $release = preg_replace("/^.*\//","",$item['values']['__release']);
- $path = $item['values']['__path'];
-
- //$rpc = $this->config->getRpcHandle();
- //$res = $rpc->getConfigItem();
- $item['values']['distribution'] = 'debian';
- $item['values']['dependency'] = array('debian');
- $item['values']['version'] = '10.0.0';
- $item['values']['name'] = $item['name'];
- $item['values']['description'] = 'bla';
+ $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->TemplateEngine->setValues($item['type'],$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);
}