summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8ca26b5)
raw | patch | inline | side by side (parent: 8ca26b5)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 25 Oct 2010 06:58:51 +0000 (06:58 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 25 Oct 2010 06:58:51 +0000 (06:58 +0000) |
-Seperated both base selectors
- One for the container objects and one for the items.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20132 594d385d-05f5-0310-b6e9-bd551577e9d8
- One for the container objects and one for the items.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20132 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementDataModel.inc b/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementDataModel.inc
index 2f35075ec0d7f752d04d8b6ac909af9861d0f45d..2113c46a1cac6fb95e569e76f3d938909dc9e19e 100644 (file)
}
}
- function getItemsByType($type)
+ function getItemsByType($types)
{
$res = array();
foreach($this->data['linear'] as $path => $item){
- if($item['type'] == $type) $res[] = $item;
+ if(in_array($item['type'],$types)) $res[] = $item;
}
return($res);
}
diff --git a/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc b/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc
index 427f02276abd18c8633342e913a64cd093ec4e84..9153c4db90073a15d6f5a99b88792155935ffec6 100644 (file)
$this->rebuildListing();
$this->containerSelector = new ItemSelector(array(),'/root','/root');
- $this->itemSelector = new ItemSelector(array(),'/root','/root');
+ $this->itemSelector = new ItemSelector(array(),'','');
}
function save_object()
diff --git a/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc
index 8b7cf00d4be5cdb904ed0e8a2901f83440ce539b..eb7b13e7355c7cb042de187e927d2d8aba30cb93 100644 (file)
$rpc->get_error()),ERROR_DIALOG);
}else{
$this->dataModel->setItemStatus($path, 'käse');
+ $rpc = $this->config->getRpcHandle();
+ $res = $rpc->getPackages($data['name']);
+
+ return;
foreach($res as $itemPath => $type){
// Make names dataModel conform
- $itemPath = $path.preg_replace("/^\//","/root", $itemPath);
+ $itemPath = $path.'/'.preg_replace("/^\//","/root", $itemPath);
$name = preg_replace("/^.*\//","",$itemPath);
-
$itemPath = preg_replace("/\/[^\/]*$/","", $itemPath);
-
- print_a(array($type, $itemPath, $name));
-
$this->dataModel->addItem($type, $itemPath, $name);
}
}
// Get the selected release and store it in a session variable
// to allow the configFilter to access it and display the
// packages and items.
- $item = $this->dataModel->getItemByPath($this->selectedItem);
+ $path = $this->selectedContainer.$this->selectedItem;
+ $item = $this->dataModel->getItemByPath($path);
session::set('CONFIG_ITEM', $item);
return($this->listing->renderList());
*/
function getItemList()
{
- $data = $this->dataModel->getItemByPath('/root');
- return($this->__recurseItem($data));
- $res = array();
- $dist = $this->selectedContainer;
- $list = $this->dataModel->getItemsByType('Release');
- foreach($list as $base => $entry){
- if($entry['parentPath'] != $dist) continue;
- $res[$entry['path']] = $entry['name'];
+ $data = $this->dataModel->getItemByPath($this->selectedContainer);
+ $res = array(""=>"/");
+ if($data['type'] != 'Release'){
+ }else{
+ $res = array_merge($res,$this->__recurseItem($data, array('Component'),$this->selectedContainer));
}
return($res);
}
function getDistList()
{
$data = $this->dataModel->getItemByPath('/root');
- return($this->__recurseItem($data));
-
-
- $list = $this->dataModel->getItemsByType('Distribution');
- $res = array();
- foreach($list as $base => $entry){
- $res[$entry['path']] = $entry['name'];
- }
+ $res["/root"] = "/";
+ $res = array_merge($res,$this->__recurseItem($data, array('Distribution','Release')));
return($res);
}
- function __recurseItem($item)
+ function __recurseItem($item, $types, $parent = "")
{
$res = array();
- $res[$item['path']] = $item['type'];
+ if(in_array($item['type'], $types)){
+ $path = preg_replace("/".preg_quote($parent,'/')."/","",$item['path']);
+ $res[$path] = $item['name'];
+ }
if(count($item['children'])){
foreach($item['children'] as $child){
- $res = array_merge($res, $this->__recurseItem($child));
+ $res = array_merge($res, $this->__recurseItem($child, $types, $parent));
}
}
return($res);