Refresh the buttons after an action has been performed.
authorGunnar Wrobel <p@rdus.de>
Fri, 26 Jun 2009 07:24:36 +0000 (09:24 +0200)
committerGunnar Wrobel <p@rdus.de>
Fri, 26 Jun 2009 07:24:36 +0000 (09:24 +0200)
koward/lib/Koward/Controller/ObjectController.php

index 463c407..7a70358 100644 (file)
@@ -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,