From 5c565cbee25b051ceaf11578aef1e806961afe3f Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 11 Apr 2011 13:21:56 +0000 Subject: [PATCH] Updated new config management git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20686 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_newConfigManagement.inc | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index 5812db35e..0668124b2 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -417,35 +417,38 @@ class newConfigManagement extends plugin - /*! \brief - * @param - * @return + /*! \brief Removes an entry from the listing. */ - function remove_lock() - { - } - function removeEntry($ids) { + $item = $this->dataModel->getItemById($ids[0]); - $release = preg_replace("/^.*\//","",$item['values']['__release']); - $path = $item['values']['__path']; - $rpc = $this->config->getRpcHandle(); - $rpc->removeConfigItem($release, $path); - if(!$rpc->success()){ - msg_dialog::display(_("Error"), sprintf(_("Failed to remove: %s"), $rpc->get_error()),ERROR_DIALOG); - return(NULL); + + // Is an config item. + if(isset($this->cfgItemMap[$item['type']])){ + $release = preg_replace("/^.*\//","",$item['values']['__release']); + $path = $item['values']['__path']; + $rpc = $this->config->getRpcHandle(); + $rpc->removeConfigItem($release, $path); + if(!$rpc->success()){ + msg_dialog::display(_("Error"), sprintf(_("Failed to remove: %s"), $rpc->get_error()),ERROR_DIALOG); + return(NULL); + }else{ + $this->dataModel->removeItem($item['path']); + } }else{ - $this->dataModel->removeItem($item['path']); + echo $item['type']." - are not handled yet!"; } } + + /*! \brief Edits a selected list item. + */ function editEntry($ids) { // Update the template engine to use another type of item and // some other values. $item = $this->dataModel->getItemById($ids[0]); - if(isset($this->cfgItemMap[$item['type']])){ $release = preg_replace("/^.*\//","",$item['values']['__release']); $path = $item['values']['__path']; @@ -582,6 +585,7 @@ class newConfigManagement extends plugin } } } + function remove_lock() {} } -- 2.30.2