diff --git a/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc
index 8b7cf00d4be5cdb904ed0e8a2901f83440ce539b..4d5822c88b70dd83d07cd184bd31f481d6eebbd3 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);
+ $this->listing->setListingTypes($this->getListingTypes());
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);
}
+ function getListingTypes()
+ {
+ $types= array();
+ $types['Distribution']['objectClass'] = 'Distribution';
+ $types['Distribution']['label'] = _('Distribution');
+ $types['Distribution']['image'] = 'images/lists/edit.png';
+ $types['Distribution']['category'] = 'Device';
+ $types['Distribution']['class'] = 'Device';
+
+ $types['Release']['objectClass'] = 'Release';
+ $types['Release']['label'] = _('Release');
+ $types['Release']['image'] = 'images/lists/edit.png';
+ $types['Release']['category'] = 'Device';
+ $types['Release']['class'] = 'Device';
+ return($types);
+ }
+
+
public static function plInfo()
{
return (array(