summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 90441ec)
raw | patch | inline | side by side (parent: 90441ec)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 4 Apr 2011 06:33:08 +0000 (06:33 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 4 Apr 2011 06:33:08 +0000 (06:33 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20637 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/DeviceConfig-list.tpl b/gosa-plugins/goto-ng/admin/newConfigManagement/DeviceConfig-list.tpl
index e4c7373b2eb65cfacc08a8b464aa975ba8aba5ba..0620e18353ae1cef83d83f0352c4489c62acca75 100644 (file)
<tr>
<td>{$RELOAD}</td>
<td class="left-border">{t}Container{/t} {$CONTAINER}</td>
- <td class="left-border">{t}Item{/t} {$ITEM}</td>
<td class="left-border">{$ACTIONS}</td>
<td class="left-border">{$FILTER}</td>
</tr>
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc
index c1d4c93e4fc9af1651fc05f4fb191cebd36a4f71..3657adb88962bb5edf7b112f81b1d0324a3623b8 100644 (file)
private $base = "";
private $containerSelector = NULL;
- private $itemSelector = NULL;
private $objectTypeStr = "";
function __construct($config, $ui, $parent)
$this->rebuildListing();
$this->containerSelector = new ItemSelector(array(),'/root','/root');
- $this->itemSelector = new ItemSelector(array(),'','');
$this->parent = &$parent;
}
function save_object()
{
$this->containerSelector->update();
- $this->itemSelector->update();
}
function getSelectedContainer()
return($this->containerSelector->setBase($dist));
}
- function setItem($rel)
- {
- return($this->itemSelector->setBase($rel));
- }
-
- function getSelectedItem()
- {
- return($this->itemSelector->getBase());
- }
-
-
function setContainers($containers)
{
$this->containerSelector->setBases($containers);
$this->containerSelector->update(TRUE);
}
- function setItems($items)
- {
- $this->itemSelector->setBases($items);
- $this->itemSelector->update(TRUE);
- }
-
-
function renderList()
{
$headpage = $this->getHeadpage();
$headpage->update();
$smarty = get_smarty();
$smarty->assign("CONTAINER", $this->containerSelector->render());
- $smarty->assign("ITEM", $this->itemSelector->render());
$display = $headpage->render();
return($this->getHeader().$display);
}
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc
index dda5975ef37969189fe1caa1da83979ecd3c764d..d97831b33976e44ea14560bd302ee438ef4d04da 100644 (file)
var $plDescription = "Config management";
var $selectedContainer;
- var $selectedItem;
var $dataModel = NULL;
var $listing = NULL;
if(!$rpc->success()){
msg_dialog::display(_("Error"), sprintf(_("Failed to load distributions: %s"), $rpc->get_error()),ERROR_DIALOG);
return(NULL);
- }
- foreach($res as $dist){
- $this->dataModel->addItem('Distribution','/root', $dist['name'], $dist);
- foreach($dist['releases'] as $release){
- $distPath = "/root/{$dist['name']}";
- $this->dataModel->addItem('Release',$distPath, $release['name'], $release);
-
- foreach($dist['components'] as $component){
- $comPath = "{$distPath}/{$release['name']}";
- $this->dataModel->addItem('Component',$comPath, $component['name'], $component);
+ }else{
+ foreach($res as $dist){
+ $this->dataModel->addItem('Distribution','/root', $dist['name'], $dist);
+ foreach($dist['releases'] as $release){
+ $distPath = "/root/{$dist['name']}";
+ $this->dataModel->addItem('Release',$distPath, $release['name'], $release);
+
+ foreach($dist['components'] as $component){
+ $comPath = "{$distPath}/{$release['name']}";
+ $this->dataModel->addItem('Component',$comPath, $component['name'], $component);
+ }
}
}
}
// Get the selected distribution and release from the listing widget.
$cont = $this->listing->getSelectedContainer();
- $item = $this->listing->getSelectedItem();
- $this->setCurrentContainer($cont, $item);
+ $this->setCurrentContainer($cont);
}
* @param String The path of the item to set.
* @return
*/
- function setCurrentContainer($cont, $item)
+ function setCurrentContainer($cont)
{
$this->selectedContainer = $cont;
- $this->selectedItem = $item;
// Get a list of all available container and items.
- $distList = $this->getContainerList();
$releaseList = $this->getItemList();
- // Ensure that we've valid values selected.
- if(!isset($releaseList[$this->selectedItem])){
- if(count($releaseList)){
- echo "Fallback";
- $this->selectedItem = key($releaseList);
- }else{
- echo "Fallback 2";
- $this->selectedItem = "";
- }
- }
-
// Update list of items within the selected container.
$this->updateItemList($this->selectedContainer);
// Transfer checked values back to the listing class.
- $this->listing->setContainer($this->selectedContainer);
- $this->listing->setItem($this->selectedItem);
$this->listing->setContainers($this->getContainerList());
- $this->listing->setItems($this->getItemList());
}
function getItemsToBeDisplayed()
{
- $path = $this->selectedContainer.$this->selectedItem;
+ $path = $this->selectedContainer;
$item = $this->dataModel->getItemByPath($path);
return($item);
}
$item = $this->dataModel->getItemById($id);
if($item){
if(in_array($item['type'], array('Distribution', 'Release'))){
- $this->setCurrentContainer($item['path'], $this->selectedItem);
+ $this->setCurrentContainer($item['path']);
}elseif(in_array($item['type'], array('Component'))){
$next = preg_replace("/".preg_quote($this->selectedContainer,'/')."/","", $item['path']);
$this->setCurrentContainer($this->selectedContainer, $next);