From: Ben Klang Date: Wed, 13 Jan 2010 15:07:34 +0000 (-0500) Subject: Shout: Fix form handling (Thanks Jan for the tips) X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c68936c63459d481f1c708ffede02dfda0fdf235;p=horde.git Shout: Fix form handling (Thanks Jan for the tips) --- diff --git a/shout/devices.php b/shout/devices.php index 5133c4f98..6c1d00bfc 100644 --- a/shout/devices.php +++ b/shout/devices.php @@ -58,7 +58,7 @@ case 'edit': $vars->set('action', $action); $Form = new DeviceDetailsForm($vars); - $Form->open($RENDERER, $vars, Horde::applicationUrl('devices.php'), 'post'); + // Make sure we get the right template below. $action = 'edit'; @@ -88,7 +88,6 @@ case 'delete': $vars = Horde_Variables::getDefaultVariables(array()); $vars->set('context', $context); $Form = new DeviceDeleteForm($vars); - $Form->open($RENDERER, $vars, Horde::applicationUrl('devices.php'), 'post'); break; @@ -111,4 +110,4 @@ echo "
\n"; require SHOUT_TEMPLATES . '/devices/' . $action . '.inc'; -require $registry->get('templates', 'horde') . '/common-footer.inc'; \ No newline at end of file +require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/shout/extensions.php b/shout/extensions.php index 36e00aa55..b7f9684b4 100644 --- a/shout/extensions.php +++ b/shout/extensions.php @@ -57,7 +57,6 @@ case 'edit': } $vars->set('action', $action); $Form = new ExtensionDetailsForm($vars); - $Form->open($RENDERER, $vars, Horde::applicationUrl('extensions.php'), 'post'); // Make sure we get the right template below. $action = 'edit'; @@ -89,7 +88,6 @@ case 'delete': $vars = Horde_Variables::getDefaultVariables(array()); $vars->set('context', $context); $Form = new ExtensionDeleteForm($vars); - $Form->open($RENDERER, $vars, Horde::applicationUrl('extensions.php'), 'post'); break; @@ -114,4 +112,4 @@ echo "
\n"; require SHOUT_TEMPLATES . '/extensions/' . $action . '.inc'; -require $registry->get('templates', 'horde') . '/common-footer.inc'; \ No newline at end of file +require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/shout/templates/devices/delete.inc b/shout/templates/devices/delete.inc index 049b03925..4d49dc0f3 100644 --- a/shout/templates/devices/delete.inc +++ b/shout/templates/devices/delete.inc @@ -1,8 +1,4 @@ Device: get('devid'); ?>
beginActive($Form->getTitle()); -$RENDERER->renderFormActive($Form, $vars); -$RENDERER->submit(); -$RENDERER->end(); -$Form->close($RENDERER); +$Form->renderActive($RENDERER, $vars, Horde::applicationUrl('devices.php'), 'post'); ?> diff --git a/shout/templates/devices/edit.inc b/shout/templates/devices/edit.inc index a95682f37..d2f985695 100644 --- a/shout/templates/devices/edit.inc +++ b/shout/templates/devices/edit.inc @@ -1,6 +1,2 @@ beginActive($Form->getTitle()); -$RENDERER->renderFormActive($Form, $vars); -$RENDERER->submit(); -$RENDERER->end(); -$Form->close($RENDERER); \ No newline at end of file +$Form->renderActive($RENDERER, $vars, Horde::applicationUrl('devices.php'), 'post'); diff --git a/shout/templates/devices/list.inc b/shout/templates/devices/list.inc index 7e2cca9a7..dacfdc752 100644 --- a/shout/templates/devices/list.inc +++ b/shout/templates/devices/list.inc @@ -47,4 +47,4 @@ } ?> - \ No newline at end of file + diff --git a/shout/templates/extensions/delete.inc b/shout/templates/extensions/delete.inc index 1827a8a49..10d47dbff 100644 --- a/shout/templates/extensions/delete.inc +++ b/shout/templates/extensions/delete.inc @@ -1,8 +1,3 @@ Extension: get('extension'); ?>
beginActive($Form->getTitle()); -$RENDERER->renderFormActive($Form, $vars); -$RENDERER->submit(); -$RENDERER->end(); -$Form->close($RENDERER); -?> +$Form->open($RENDERER, $vars, Horde::applicationUrl('extensions.php'), 'post'); diff --git a/shout/templates/extensions/edit.inc b/shout/templates/extensions/edit.inc index 5ba2f592c..e9fe5a6a8 100644 --- a/shout/templates/extensions/edit.inc +++ b/shout/templates/extensions/edit.inc @@ -1,12 +1,8 @@ beginActive($Form->getTitle()); -$RENDERER->renderFormActive($Form, $vars); -$RENDERER->submit(); -$RENDERER->end(); -$Form->close($RENDERER); +$Form->open($RENDERER, $vars, Horde::applicationUrl('extensions.php'), 'post'); $deleteUrl = Horde::applicationUrl('extensions.php'); $params = array ('action' => 'delete', 'extension' => $extension); $deleteUrl = Horde_Util::addParameter($deleteUrl, $params); ?> -Delete Extension \ No newline at end of file +Delete Extension