From a49ffd63da675610c11e719d83c4564d7bd12b8a Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 28 Sep 2010 14:01:24 +0000 Subject: [PATCH] Updated dialog handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19840 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/Config/class_DeviceConfig.inc | 36 +++++++++++++------ .../goto/Config/class_TemplateEngine.inc | 5 ++- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc index fda9825ea..e42e4e05f 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc @@ -100,7 +100,9 @@ class DeviceConfig extends management function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="") { - echo "Jajajaaa"; + $this->dialogObject = $this->TemplateEngine; + $this->skipFooter = TRUE; + $this->dialog = TRUE; } @@ -134,7 +136,6 @@ class DeviceConfig extends management $this->itemContainerSelector->update(true); $this->itemContainerSelector->setBase($this->base); - $tpl = $this->TemplateEngine->render(); session::set('DEVICE_ITEMS', $this->currentItemValues); $this->rebuildListing(); $filter = $this->getFilter(); @@ -144,7 +145,7 @@ class DeviceConfig extends management $smarty = get_smarty(); $smarty->assign("RELEASE", $this->itemContainerSelector->render()); $display = $headpage->render(); - return($tpl.$this->getHeader().$display); + return($this->getHeader().$display); } @@ -189,15 +190,19 @@ class DeviceConfig extends management $this->registerAction("new", "newEntry"); $this->registerAction("edit", "openEntry"); // !! We forward 'edit' to 'open' to have a department like navigation. $this->registerAction("editEntry", "editEntry"); - $this->registerAction("apply", "applyChanges"); - $this->registerAction("save", "saveChanges"); - $this->registerAction("cancel", "cancelEdit"); - $this->registerAction("cancelDelete", "cancelEdit"); - $this->registerAction("remove", "removeEntryRequested"); - $this->registerAction("removeConfirmed", "removeEntryConfirmed"); + + $this->registerAction("saveItemChanges", "saveItemChanges"); + $this->registerAction("cancelItemEdit", "cancelItemEdit"); } + function cancelItemEdit() + { + $this->closeDialogs(); + $this->dialog = FALSE; + } + + /*! \brief Add a new child-item to the currently selected one. * * @param String type The 'type' of the new object, eg. 'KickstartTemplate' @@ -355,7 +360,18 @@ class DeviceConfig extends management } } } - + + + // Inject user actions + function detectPostActions() + { + $action = management::detectPostActions(); + if(isset($_POST['saveItemEdit'])) $action['action'] = "saveItemChanges"; + if(isset($_POST['cancelItemEdit'])) $action['action'] = "cancelItemEdit"; + return($action); + } + + function check() { return(array()); diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc index 8ae4650a2..0723bc4fd 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_TemplateEngine.inc @@ -117,7 +117,10 @@ class TemplateEngine $smarty->assign($widget->getName(), $widget->render()); $smarty->assign($widget->getName()."Name", $widget->getDisplayName()); } - return($smarty->fetch(get_template_path("goto/Config/{$this->template}", TRUE))); + $template = $smarty->fetch(get_template_path("goto/Config/{$this->template}", TRUE)); + + $smarty->assign('template', $template); + return($smarty->fetch(get_template_path("goto/Config/TemplateEngine.tpl", TRUE))); } -- 2.30.2