summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 734385e)
raw | patch | inline | side by side (parent: 734385e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 Apr 2011 12:20:18 +0000 (12:20 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 Apr 2011 12:20:18 +0000 (12:20 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20656 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc
index ef0705cba199d441349004b550803edfecf5060f..cc59dc7cf9bcbf6c692a4df852cbdc0c5d7f5107 100644 (file)
// Load service xml file and fill in placeholders
$contents = file_get_contents(get_template_path("DeviceConfig-list.xml", true));
$contents = preg_replace("/%TYPES%/", $this->objectTypeStr, $contents);
- $contents = preg_replace("/%ITEMS%/", "", $contents);
+
+ // A list of dummy images
+ $images = array();
+ $images[] = 'images/lists/edit.png';
+ $images[] = 'images/caps.png';
+ $images[] = 'images/lists/trash.png';
+ $images[] = 'images/filter.png';
+ $images[] = 'images/find.png';
+
+
+ $items = "";
+ $i = 0;
+ foreach($this->parent->addableContainerItems as $item){
+ $desc = $this->parent->itemConfig[$item]['description'];
+ $img = $images[$i++];
+ $items .=
+ "<action>".
+ " <name>add_{$item}</name>".
+ " <type>entry</type>".
+ " <image>{$img}</image>".
+ " <label>{$desc}</label>".
+ "</action>";
+ }
+
+ if(!empty($items)){
+ $items =
+
+ "<action>".
+ " <type>sub</type>".
+ " <image>images/lists/element.png[new]</image>".
+ " <label>Create</label>".
+ " {$items}".
+ "</action>";
+ }
+
+ $contents = preg_replace("/%ITEMS%/", $items, $contents);
$headpage = new listing($contents,TRUE);
$headpage->setBase($this->base);
diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc
index 615c01a014b2e0798a8f4cdd399cfacdcfbe9584..bf29fc9e9fb2541d033195379ddf098938d0fd97 100644 (file)
*/
function setCurrentContainer($cont)
{
+
$this->selectedContainer = $cont;
// Update list of items within the selected container.
$method = $this->cfgTypeMap[$cont];
$this->setInstallMethod($method);
}
+
+ // Update the list of addable sub objects
+ $item = $this->dataModel->getItemByPath($cont);
+ if(isset($this->itemConfig[$item['type']]['container'])){
+ $this->addableContainerItems = $this->itemConfig[$item['type']]['container'];
+ }else{
+ $this->addableContainerItems = array();
+ }
}