--- webform.orig/webform.inc	2005-03-27 16:18:27.000000000 +0100
+++ webform/webform.inc	2005-03-27 17:31:43.000000000 +0100
@@ -31,27 +31,26 @@
   print theme('page', $content, $title);
 } // end function _webform_page
 
+/*
+* Delete all submission for a form
+* @param	integer	ID of node for which to clear submissions
+*/
 function _webform_results_clear($nid) {
-
-  if (arg(4) == "confirm") {
-
+  if ($_POST['edit']['confirm']) {
     $query = 'DELETE FROM {webform_submitted_data} WHERE nid = %d';
     $res = db_query($query, $nid);
     $node = node_load(array('nid' => $nid));
     $title = $node->title;
 
     watchdog('webform','webform "' . $title . '" entries cleared.');
-   drupal_goto('webform');
+    drupal_goto('webform');
   }
   else {
-    $content = "<p>Do you really want to delete the submissions of this form?</p>".
-    l(t('yes'), "node/".$nid."/results/clear/confirm")." | ".
-    l(t('no'), "webform")
-    ."</p>";
+    $content = theme('confirm', 'Do you really want to delete the submissions for this form?', 'webform', NULL, 'yes', 'no', NULL);
 
-    //print theme('page', $content, $title);
     return $content;
   }
+
 }
 
 /*
@@ -60,17 +59,14 @@
 * @param	integer	ID of submission to be deleted (from webform_submitted_data)
 */
 function _webform_submission_delete($nid, $sid) {
-  if (arg(5) == "confirm") {
+  if ($_POST['edit']['confirm']) {
     $query = 'DELETE FROM {webform_submitted_data} WHERE nid = %d AND sid = %d';
     $res = db_query($query, $nid, $sid);
 
     drupal_goto('webform');
   }
   else {
-    $content = "<p>Do you really want to delete this form submission?</p>".
-    l(t('yes'), "node/$nid/results/delete/$sid/confirm")." | ".
-    l(t('no'), "webform")
-    ."</p>";
+    $content = theme('confirm', 'Do you really want to delete this form submission?', 'webform', NULL, 'yes', 'no', NULL);
 
     return $content;
   }
