Shout: Fix form handling (Thanks Jan for the tips)
authorBen Klang <ben@alkaloid.net>
Wed, 13 Jan 2010 15:07:34 +0000 (10:07 -0500)
committerBen Klang <ben@alkaloid.net>
Wed, 13 Jan 2010 15:14:05 +0000 (10:14 -0500)
shout/devices.php
shout/extensions.php
shout/templates/devices/delete.inc
shout/templates/devices/edit.inc
shout/templates/devices/list.inc
shout/templates/extensions/delete.inc
shout/templates/extensions/edit.inc

index 5133c4f..6c1d00b 100644 (file)
@@ -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 "<br>\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';
index 36e00aa..b7f9684 100644 (file)
@@ -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 "<br>\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';
index 049b039..4d49dc0 100644 (file)
@@ -1,8 +1,4 @@
 Device: <?php echo $vars->get('devid'); ?><br>
 <?php
-$RENDERER->beginActive($Form->getTitle());
-$RENDERER->renderFormActive($Form, $vars);
-$RENDERER->submit();
-$RENDERER->end();
-$Form->close($RENDERER);
+$Form->renderActive($RENDERER, $vars, Horde::applicationUrl('devices.php'), 'post');
 ?>
index a95682f..d2f9856 100644 (file)
@@ -1,6 +1,2 @@
 <?php
-$RENDERER->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');
index 7e2cca9..dacfdc7 100644 (file)
@@ -47,4 +47,4 @@
             }
         ?>
     </table>
-</div>
\ No newline at end of file
+</div>
index 1827a8a..10d47db 100644 (file)
@@ -1,8 +1,3 @@
 Extension: <?php echo $vars->get('extension'); ?><br>
 <?php
-$RENDERER->beginActive($Form->getTitle());
-$RENDERER->renderFormActive($Form, $vars);
-$RENDERER->submit();
-$RENDERER->end();
-$Form->close($RENDERER);
-?>
+$Form->open($RENDERER, $vars, Horde::applicationUrl('extensions.php'), 'post');
index 5ba2f59..e9fe5a6 100644 (file)
@@ -1,12 +1,8 @@
 <?php
-$RENDERER->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);
 ?>
-<a href="<?php echo $deleteUrl; ?>">Delete Extension</a>
\ No newline at end of file
+<a href="<?php echo $deleteUrl; ?>">Delete Extension</a>