From: hickert Date: Wed, 19 May 2010 13:08:09 +0000 (+0000) Subject: Show the available services directly in the service menu instead of a sub dialog X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=955c5c2944812395159fa32c932049d61c9938f8;p=gosa.git Show the available services directly in the service menu instead of a sub dialog git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18553 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/systems/admin/systems/class_serverService.inc b/gosa-plugins/systems/admin/systems/class_serverService.inc index 80bd240e0..5e4e35ced 100644 --- a/gosa-plugins/systems/admin/systems/class_serverService.inc +++ b/gosa-plugins/systems/admin/systems/class_serverService.inc @@ -73,12 +73,6 @@ class ServerService extends management } $this->setFilter($filter); - // Build headpage - $headpage = new listing(get_template_path("serverService-list.xml", true)); - $headpage->registerElementFilter("filterServiceStatus", "ServerService::filterServiceStatus"); - $headpage->setFilter($filter); - - // Initialize list of used and useable services. foreach ($config->data['TABS']['SERVERSERVICE'] as $plug){ if(class_available($plug['CLASS'])){ @@ -101,6 +95,24 @@ class ServerService extends management } } + // Load service xml file and fill in placeholders + $contents =file_get_contents(get_template_path("serverService-list.xml", true)); + $template = " + + new_%s + entry + + "; + $serviceList = ""; + foreach($this->getAllUnusedServices() as $name => $desc){ + $serviceList.= sprintf($template, $name,_($desc)); + } + $contents = preg_replace("/%SERVICES%/",$serviceList, $contents); + + $headpage = new listing($contents,TRUE); + $headpage->registerElementFilter("filterServiceStatus", "ServerService::filterServiceStatus"); + $headpage->setFilter($filter); + parent::__construct($config, $this->ui, "services", $headpage); $this->registerAction("new", "newService"); $this->registerAction("remove", "removeService"); diff --git a/gosa-plugins/systems/admin/systems/serverService-list.xml b/gosa-plugins/systems/admin/systems/serverService-list.xml index e4937c878..ddd3132cb 100644 --- a/gosa-plugins/systems/admin/systems/serverService-list.xml +++ b/gosa-plugins/systems/admin/systems/serverService-list.xml @@ -1,5 +1,4 @@ - false @@ -53,12 +52,8 @@ images/lists/element.png[new] - - new - entry - images/lists/element.png[new] - - + %SERVICES% +