From 2f8f48f32238ada85c82c8e2949dce4c986994dc Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel
Date: Fri, 26 Jun 2009 09:24:36 +0200 Subject: [PATCH] Refresh the buttons after an action has been performed. --- koward/lib/Koward/Controller/ObjectController.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/koward/lib/Koward/Controller/ObjectController.php b/koward/lib/Koward/Controller/ObjectController.php index 463c407e6..7a703585d 100644 --- a/koward/lib/Koward/Controller/ObjectController.php +++ b/koward/lib/Koward/Controller/ObjectController.php @@ -181,9 +181,17 @@ class ObjectController extends Koward_Controller_Application exit; } else if ($this->actions->validate()) { $action = $this->actions->execute(); - //FIXME: Hack + //FIXME: Hack $result = $this->object->$action(); + // Refresh the object view + $this->actions = null; + $this->object = $this->koward->getObject($this->params->id); + $buttons = $this->_getButtons($this->object, $this->object_type); + if (!empty($buttons)) { + $this->actions = new Koward_Form_Actions($this->object, $buttons); + } + $this->action_url = $this->urlFor(array('controller' => 'object', 'action' => 'view', 'id' => $this->params->id, -- 2.11.0