? .rsvp.module.swp
Index: rsvp.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/rsvp/rsvp.module,v
retrieving revision 1.7
diff -u -F^f -r1.7 rsvp.module
--- rsvp.module	29 Jul 2005 23:56:41 -0000	1.7
+++ rsvp.module	18 Nov 2005 22:23:43 -0000
@@ -22,7 +22,7 @@
  * @return a &lt;style&gt; tag that indicates what file browsers should import
  */
 function rsvp_html_head() {
-  return '<style type="text/css">@import url('. drupal_get_path('module', 'rsvp') .'/rsvp.css);</style>';
+  theme_add_style(drupal_get_path('module', 'rsvp') .'/rsvp.css');
 }
 
 /**
@@ -34,20 +34,17 @@ function rsvp_help($section){
   switch($section) {
     case 'admin/modules#description' :
       return t('Provides rsvp functionality for node types enabled in the event system.');
-      break;
 
     case 'rsvp/'. arg(1) .'/message' :
       return t('You can send a message to the attendees of this rsvp here.');
-      break;
 
     case 'rsvp/'. arg(1) .'/attendees' :
       return t('You can add attendees, remove attendees, or view the status of an attendee\'s invitation here.');
-      break;
 
     case 'rsvp' :
     case 'rsvp/invites' :
       global $user;
-      if(!$user->uid) {
+      if (!$user->uid) {
         return t('You must %login or %register in order to manage your invitations to rsvp events from this site. Otherwise, please use the link provided in your email to reply. If the link does not work, contact the sender of the invitation to see if the event has been deleted.', array('%login' => l('login', 'user'), '%register' => l('create a user account', 'user/register')));
       }
   }
@@ -69,30 +66,31 @@ function rsvp_perm() {
  */
 function rsvp_link($type, $node = 0, $main = 0) {
   switch ($type) {
-  case 'node' :
-    if (event_is_enabled($node->type)) {
-      if(_rsvp_is_invited($node->nid)) {
-        $links[] =l(t('view invitation'), "rsvp/invites/node/$node->nid", array("title" => t('View your invitations to this event')));
-      }
-      if(_rsvp_has_rsvps($node->nid)) {
-        $links[] =l(t('manage rsvp'), "rsvp/manage/$node->nid", array("title" => t('Manage your rsvps for this event')));
-      }
-      if(user_access('create rsvp')) {
-        $links[] =l(t('create rsvp'), "rsvp/create/$node->nid", array("title" => t('Create an rsvp and invite others to this event')));
-      }
-    }
-    break;
-    case 'event_node_table' :
-    case 'event_node_day' :
-    case 'event_node_week' :
-    case 'event_node_month' :
-      if(_rsvp_is_invited($node->nid)) {
+    case 'node':
+      if (event_is_enabled($node->type)) {
+        if (_rsvp_is_invited($node->nid)) {
+          $links[] =l(t('view invitation'), "rsvp/invites/node/$node->nid", array("title" => t('View your invitations to this event')));
+        }
+        if (_rsvp_has_rsvps($node->nid)) {
+          $links[] =l(t('manage rsvp'), "rsvp/manage/$node->nid", array("title" => t('Manage your rsvps for this event')));
+        }
+        if (user_access('create rsvp')) {
+          $links[] =l(t('create rsvp'), "rsvp/create/$node->nid", array("title" => t('Create an rsvp and invite others to this event')));
+        }
+      }
+      break;
+
+    case 'event_node_table':
+    case 'event_node_day':
+    case 'event_node_week':
+    case 'event_node_month':
+      if (_rsvp_is_invited($node->nid)) {
         $links[] = l(t('view invites'), "rsvp/invites/$node->nid", array("title" => t('view your invitations to this event')));
       }
-      elseif(db_num_rows(_rsvp_get_node_rsvps($node->nid))) {
+      elseif (db_num_rows(_rsvp_get_node_rsvps($node->nid))) {
         $links[] = l(t('view rsvp'), "rsvp/manage/$node->nid", array("title" => t('view your rsvps for this event')));
       }
-      elseif(user_access('create rsvp')) {
+      elseif (user_access('create rsvp')) {
         $links[] = l(t('rsvp'), "rsvp/create/$node->nid", array("title" => t('create an rsvp and invite others to this event')));
       }
       break;
@@ -189,7 +187,7 @@ function rsvp_menu($may_cache) {
 */
 function rsvp_manage($nid = NULL) {
   if($nid) {
-    $node = node_load(array('nid' => $nid));
+    $node = node_load($nid);
     $rsvps = _rsvp_get_node_rsvps($nid);
 
     if(!db_num_rows($rsvps)) {
@@ -230,7 +228,7 @@ function rsvp_manage($nid = NULL) {
   }
 
   foreach($list as $nid => $rsvps) {
-    $node = node_load(array('nid' => $nid));
+    $node = node_load($nid);
     if($node->nid) {
       $content .= theme('item_list', $rsvps, l($node->title, 'node/'. $node->nid, array('title' => t('view this event'))) .' - '. format_date($node->event_start, 'small', '', $node->start_offset));
     }
@@ -240,7 +238,7 @@ function rsvp_manage($nid = NULL) {
     }
   }
 
-  print theme('page', $content);
+  return $content;
 }
 
 /**
@@ -264,12 +262,12 @@ function rsvp_create($nid) {
       $content .= theme('rsvp_send_status', $status);
       break;
     default :
-      $node = node_load(array("nid" => $nid));
+      $node = node_load($nid);
       $content = rsvp_create_form($nid);
       drupal_set_title(t('Create RSVP for: %title on %date', array('%title' => $node->title, '%date' => format_date($node->event_start, 'small', '', $node->start_offset))));
       break;
   }
-  print theme('page', $content);
+  return $content;
 }
 
 /**
@@ -293,7 +291,7 @@ function rsvp_view() {
   drupal_set_title(t('Manage RSVP: %name', array('%name' => $rsvp->name)));
   $content = rsvp_show_rsvp($rsvp);
 
-  print theme('page', $content);
+  return $content;
 }
 
 /**
@@ -316,27 +314,29 @@ function rsvp_edit() {
   $op = $_POST["op"];
   $edit = $_POST["edit"];
   switch ($op) {
-    case t('Delete RSVP') :
+    case t('Delete RSVP'):
         $bc[] = l(t('edit rsvp'), 'rsvp/'. $rid .'/edit');
         $content = rsvp_delete_form($rsvp);
-        drupal_set_title(t('Delete RSVP?'));
       break;
-    case t('Delete') :
+
+    case t('Delete'):
         rsvp_delete_rsvp($rid);
         drupal_goto("rsvp/manage");
       break;
-    case t('Update RSVP') :
+
+    case t('Update RSVP'):
         rsvp_update_rsvp($edit);
         drupal_goto('rsvp/'. $rid .'/view');
       break;
-    default :
+
+    default:
         $content = rsvp_edit_form($rsvp);
         drupal_set_title(t('Edit RSVP'));
       break;
   }
 
   drupal_set_breadcrumb($bc);
-  print theme('page', $content);
+  return $content;
 }
 
 /**
@@ -361,48 +361,48 @@ function rsvp_attendees($op = NULL, $has
   $bc[] = l(t('your rsvps'), 'rsvp/manage');
 
   switch($op) {
-    case 'remove' :
-        $bc[] = l(t('manage attendees'), 'rsvp/'. $rid .'/attendees');
-        $invite = _rsvp_get_invite($hash);
-        drupal_set_title(t('Delete attendee?'));
-        $content = t('Are you sure you want to delete the attendee: %name?', array('%name' =>   '<em>'. $invite->email .'</em>'));
-        $content .= '<br />'. t('Deleting an attendee will delete thier responses and remove thier access to their invitations to this rsvp.');
-        $content .= form(form_submit(t('Remove Attendee')) . form_submit(t('Cancel')));
+    case 'remove':
+      $bc[] = l(t('manage attendees'), 'rsvp/'. $rid .'/attendees');
+      $invite = _rsvp_get_invite($hash);
+      $content = confirm_form('rsvp_delete_confirm', array(),
+          t('Are you sure you want to delete the attendee %name?', array('%name' => theme('placeholder', $invite->email))),
+          'rsvp/'. $rid .'/attendees',
+          t('Deleting an attendee will delete their responses and remove their. access to their invitations to this rsvp.'),
+          t('Remove Attendee'), t('Cancel'));
       break;
 
-    case 'status' :
-        $bc[] = l(t('manage attendees'), 'rsvp/'. $rid .'/attendees');
-        $content = rsvp_attendee_status($hash);
+    case 'status':
+      $bc[] = l(t('manage attendees'), 'rsvp/'. $rid .'/attendees');
+      $content = rsvp_attendee_status($hash);
       break;
 
-    case 'send' :
-        $bc[] = l(t('manage attendees'), 'rsvp/'. $rid .'/attendees');
-        drupal_set_title(t('Invitation email sent for : %name', array('%name' => $rsvp->name)));
-        $status = _rsvp_mail_rsvp($rid);
-        $content = theme('rsvp_send_status', $status);
+    case 'send':
+      $bc[] = l(t('manage attendees'), 'rsvp/'. $rid .'/attendees');
+      drupal_set_title(t('Invitation email sent for : %name', array('%name' => $rsvp->name)));
+      $status = _rsvp_mail_rsvp($rid);
+      $content = theme('rsvp_send_status', $status);
       break;
 
-    case t('Cancel') :
-        drupal_goto('rsvp/'. $rid .'/attendees');
+    case t('Remove Attendee'):
+      _rsvp_remove_attendee($hash);
+      drupal_goto('rsvp/'. $rid .'/attendees');
       break;
 
-    case t('Send Invites') :
-        rsvp_set_invites($_POST['edit']['invite_list'], $rid);
-        $status = _rsvp_mail_rsvp($rid);
-        $content = theme('rsvp_send_status', $status);
-
-    case t('Remove Attendee') :
-        _rsvp_remove_attendee($hash);
+    case t('Send Invites'):
+      rsvp_set_invites($_POST['edit']['invite_list'], $rid);
+      $status = _rsvp_mail_rsvp($rid);
+      $content = theme('rsvp_send_status', $status);
+      // intentional fallthrough
 
-    default :
-        drupal_set_title(t('RSVP Manage Attendees - %name', array('%name' => $rsvp->name)));
-        $content .= rsvp_attendee_form($rid);
-        $content .= rsvp_show_attendees($rsvp);
+    default:
+      drupal_set_title(t('RSVP Manage Attendees - %name', array('%name' => $rsvp->name)));
+      $content .= rsvp_attendee_form($rid);
+      $content .= rsvp_show_attendees($rsvp);
       break;
   }
 
   drupal_set_breadcrumb($bc);
-  print theme('page', $content);
+  return $content;
 }
 
 /**
@@ -429,7 +429,7 @@ function rsvp_message() {
     drupal_set_title(t('Send email message to: %name', array('%name' => $rsvp->name)));
     $content = rsvp_message_form($rid);
   }
-  print theme('page', $content);
+  return $content;
 }
 
 
@@ -444,7 +444,7 @@ function rsvp_view_invites($nid = NULL) 
   if($user->uid) {
     // do not let anonymous users view invite lists since all unconfirmed invites have uid 0 by default
     if($nid) {
-      $node = node_load(array('nid' => $nid));
+      $node = node_load($nid);
       $invites = _rsvp_get_node_invites($nid);
       if(!db_num_rows($invites)) {
         drupal_set_message(t('no rsvps exist for the event: %name', array('%name' => $node->title)));
@@ -486,7 +486,7 @@ function rsvp_view_invites($nid = NULL) 
     }
     else {
       foreach($list as $nid => $links) {
-        $node = node_load(array("nid" => $nid));
+        $node = node_load($nid);
         if($node->nid) {
           $content .= theme('item_list', $links, t('for: ') . l($node->title, 'node/'. $node->nid, array('title' => t('view this event'))) .' - '. format_date($node->event_start, 'small', '', $node->start_offset));
         }
@@ -498,7 +498,7 @@ function rsvp_view_invites($nid = NULL) 
     }
   }
 
-  print theme('page', $content);
+  return $content;
 }
 
 /**
@@ -573,7 +573,7 @@ function rsvp_view_invite($hash) {
 
   drupal_set_title(t('Invite for %name', array('%name' => $invite->name)));
 
-  print theme('page', theme('rsvp_invite', $invite, $rsvp, $content));
+  return theme('rsvp_invite', $invite, $rsvp, $content);
 }
 
 /**
@@ -589,16 +589,61 @@ function rsvp_view_invite($hash) {
 * @return html formatted rsvp create form.
 */
 function rsvp_create_form($nid) {
-  $form = form_textfield(t('RSVP Name'),'name', '', 40, 40, t('This is the name of your rsvp'));
-  $form .= form_textarea(t('RSVP Message'), 'invite_text', '', 70, 5, t('This text will be sent to the people you invite'));
-  $form .= form_textarea(t('Invite List'), 'invite_list', '', 70, 5, t('Enter email addresses separated by commas'));
-  $form .= form_checkbox(t('Hide attendees'), 'blind', 1, 0, t('Prevent attendees from seeing who else is on the list'));
-  $form .= form_checkbox(t('Allow list email'), 'list_email', 1, 0, t('Allow attendees to send messages to the people invited to your rsvp'));
-  $form .= form_checkbox(t('Allow attendee invites'), 'allow_invite', 1, 0, t('Allow attendees to invite more people to the event'));
-  $form .= form_hidden("nid", $nid);
-  $form .= form_submit(t('Create RSVP'));
+  $form['name'] = array(
+      '#type' => 'textfield',
+      '#title' => t('RSVP Name'),
+      '#default_value' => '',
+      '#size' => 40,
+      '#maxlength' => 40,
+      '#description' => t('This is the name of your rsvp')
+      );
+  $form['invite_text'] = array(
+      '#type' => 'textarea',
+      '#title' => t('RSVP Message'),
+      '#default_value' => '',
+      '#cols' => 70,
+      '#rows' => 5,
+      '#description' => t('This text will be sent to the people you invite')
+      );
+  $form['invite_list'] = array(
+      '#type' => 'textarea',
+      '#title' => t('Invite List'),
+      '#default_value' => '',
+      '#cols' => 70,
+      '#rows' => 5,
+      '#description' => t('Enter email addresses separated by commas')
+      );
+  $form['blind'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Hide attendees'),
+      '#return_value' => 1,
+      '#default_value' => 0,
+      '#description' => t('Prevent attendees from seeing who else is on the list')
+      );
+  $form['list_email'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Allow list email'),
+      '#return_value' => 1,
+      '#default_value' => 0,
+      '#description' => t('Allow attendees to send messages to the people invited to your rsvp')
+      );
+  $form['allow_invite'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Allow attendee invites'),
+      '#return_value' => 1,
+      '#default_value' => 0,
+      '#description' => t('Allow attendees to invite more people to the event')
+      );
+  $form['nid'] = array(
+      '#type' => 'hidden',
+      '#value' => $nid
+      );
+  $form['op'] = array(
+      '#type' => 'submit',
+      '#value' => t('Create RSVP'),
+      );
 
-  return form($form);
+  return drupal_get_form('rsvp_create_form', $form);
 }
  
 /**
@@ -609,16 +654,60 @@ function rsvp_create_form($nid) {
 * @return html formatted rsvp edit form.
 */
 function rsvp_edit_form($rsvp) {
-  $form = form_textfield(t('RSVP Name'),'name', $rsvp->name, 40, 40, t('This is the name of your rsvp'));
-  $form .= form_textarea(t('RSVP Message'), 'invite_text', $rsvp->invite_text, 70, 10, t('This text will be sent to the people you invite'));
-  $form .= form_checkbox(t('Hide attendees'), 'blind', 1, $rsvp->blind, t('Prevent attendees from seeing who else is on the list'));
-  $form .= form_checkbox(t('Allow list email'), 'list_email', 1, $rsvp->list_email, t('Allow attendees to send messages to the people invited to your rsvp'));
-  $form .= form_checkbox(t('Allow attendee invites'), 'allow_invite', 1, $rsvp->allow_invite, t('Allow attendees to invite more people to the event'));
-  $form .= form_hidden("rid", $rsvp->rid);
-  $form .= form_submit(t('Update RSVP'));
-  $form .= form_submit(t('Delete RSVP'));
+  $form['name'] = array(
+      '#type' => 'textfield',
+      '#title' => t('RSVP Name'),
+      '#default_value' => $rsvp->name,
+      '#size' => 40,
+      '#maxlength' => 40,
+      '#description' => t('This is the name of your rsvp')
+      );
+  $form['invite_text'] = array(
+      '#type' => 'textarea',
+      '#title' => t('RSVP Message'),
+      '#default_value' => $rsvp->invite_text,
+      '#cols' => 70,
+      '#rows' => 10,
+      '#description' => t('This text will be sent to the people you invite')
+      );
+  $form['blind'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Hide attendees'),
+      '#return_value' => 1,
+      '#default_value' => $rsvp->blind,
+      '#description' => t('Prevent attendees from seeing who else is on the list')
+      );
+  $form['list_email'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Allow list email'),
+      '#return_value' => 1,
+      '#default_value' => $rsvp->list_email,
+      '#description' => t('Allow attendees to send messages to the people invited to your rsvp')
+      );
+  $form['allow_invite'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Allow attendee invites'),
+      '#return_value' => 1,
+      '#default_value' => $rsvp->allow_invite,
+      '#description' => t('Allow attendees to invite more people to the event')
+      );
+  $form['rid'] = array(
+      '#type' => 'hidden',
+      '#value' => $rsvp->rid
+      );
+
+  $form['update'] = array(
+      '#type' => 'submit',
+      '#value' => t('Update RSVP'),
+      '#name' => 'op'
+      );
+  $form['delete'] = array(
+      '#type' => 'submit',
+      '#value' => t('Delete RSVP'),
+      '#name' => 'op'
+      );
 
-  return form($form);
+  return drupal_get_form('rsvp_edit_form', $form);
 }
 
 /**
@@ -631,9 +720,22 @@ function rsvp_edit_form($rsvp) {
 function rsvp_attendee_form($rid) {
   global $user;
   if($user->uid) {
-    $form = form_textarea(t('Add Attendees'), 'invite_list', '', 70, 5, t('Enter email addresses separated by commas'));
-    $form .= form_submit(t('Send Invites'));
-    return form($form);
+    $form = array();
+    $form['invite_list'] = array(
+        '#type' => 'textarea',
+        '#title' => t('Add Attendees'),
+        '#default_value' => '',
+        '#cols' => 70,
+        '#rows' => 5,
+        '#description' => t('Enter email addresses separated by commas')
+        );
+
+    $form['op'] = array(
+        '#type' => 'submit',
+        '#value' => t('Send Invites'),
+        );
+
+    return drupal_get_form('rsvp_attendee_form', $form);
   }
   else {
     return '<p>'. t('If you %register or %login you can invite more people to this event!', array('%register' => l('create a user account', 'user/register'), '%login' => l('login', 'user'))) .'</p>';
@@ -648,11 +750,11 @@ function rsvp_attendee_form($rid) {
 * @return html formatted rsvp delete confirmation form.
 */
 function rsvp_delete_form($rsvp) {
-  $form = t('Really delete RSVP: %name?', array('%name' => $rsvp->name));
-  $form .= form_submit(t('Delete'));
-  $form .= form_submit(t('Cancel'));
-
-  return form($form);
+  return confirm_form('rsvp_delete_form', array(),
+      t('Are you sure you want to delete %name?', array('%name' => theme('placeholder', $rsvp->name))),
+      'rsvp/'. check_url(arg(1)) .'/edit',
+      t('This action cannot be undone.'),
+      t('Delete'), t('Cancel'));
 }
 
 /**
@@ -664,12 +766,36 @@ function rsvp_delete_form($rsvp) {
 */
 function rsvp_message_form($rid) {
   global $user;
-  if($user->uid) {
-    $form .= form_textfield(t('Message Subject'), 'subject', '', 40, 40, t('This is the subject for your email message'));
-    $form .= form_textarea(t('Message Body'), 'body', '', 70, 5, t('This is the body of the email message'));
-    $form .= form_hidden('rid', $rid);
-    $form .= form_submit(t('Send Message'));
-    return form($form);
+
+  if ($user->uid) {
+    $form = array();
+    $form['subject'] = array(
+        '#type' => 'textfield',
+        '#title' => t('Message Subject'),
+        '#default_value' => '',
+        '#size' => 40,
+        '#maxlength' => 40,
+        '#description' => t('This is the subject for your email message')
+        );
+    $form['body'] = array(
+        '#type' => 'textarea',
+        '#title' => t('Message Body'),
+        '#default_value' => '',
+        '#cols' => 70,
+        '#rows' => 5,
+        '#description' => t('This is the body of the email message')
+        );
+    $form['rid'] = array(
+        '#type' => 'hidden',
+        '#value' => $rid
+        );
+
+    $form['op'] = array(
+        '#type' => 'submit',
+        '#value' => t('Send Message'),
+        );
+
+    return drupal_get_form('rsvp_message_form', $form);
   }
   else {
     return '<p>'. t('If you %register or %login you can send a message to the attendees of this event!', array('%register' => l('create a user account', 'user/register'), '%login' => l('login', 'user'))) .'</p>';
@@ -689,14 +815,14 @@ function rsvp_message_form($rid) {
 */
 function rsvp_show_rsvp($rsvp) {
   $eid = db_fetch_object(db_query('SELECT nid FROM {rsvp} WHERE rid=%d', $rsvp->rid));
-  $node = node_load(array("nid" => $eid->nid));
+  $node = node_load($eid->nid);
   if($node->nid) {
     $content = theme('rsvp_event', $node);
   }
   else {
     drupal_set_message(t('The event associatted with this rsvp has been deleted'));
   }
-  $content .= form_item(t('Invite Message'), $rsvp->invite_text);
+  $content .= '<h3>'. t('Invite Message') .'</h3>'. $rsvp->invite_text;
   $content .= rsvp_show_attendees($rsvp, FALSE);
 
   return theme('rsvp', $rsvp, $content);
@@ -773,7 +899,7 @@ function rsvp_show_attendees($rsvp, $con
     $content .= theme('item_list', $maybe, t('Might attend'));
   }
 
-  return form_group(t('Responses'), $content);
+  return '<h3>'. t('Responses') .'</h3>'. $content;
 }
 
 /**
@@ -786,14 +912,29 @@ function rsvp_show_attendees($rsvp, $con
 function rsvp_reply_form($hash) {
   $invite = _rsvp_get_invite($hash);
   $responses = array('yes' => t('Yes'), 'no' => t('No'), 'maybe' => t('Maybe'));
-  if($invite->response == 'none') {
+  if ($invite->response == 'none') {
     $responses['none'] = t('None');
   }
-  $form = form_select(t('Your Reply'), 'invite_reply', $invite->response,	$responses, t('select your response to the invitation here'));
-  $form .= form_submit(t('Reply'));
-  $form .= form_hidden('hash', $hash);
 
-  return theme('rsvp_reply_form', form($form));
+  $form = array();
+  $form['invite_reply'] = array(
+      '#type' => 'select',
+      '#title' => t('Your Reply'),
+      '#default_value' => $invite->response,
+      '#options' => $responses,
+      '#description' => t('Select your response to the invitation here.')
+      );
+  $form['hash'] = array(
+      '#type' => 'hidden',
+      '#value' => $hash
+      );
+
+  $form['op'] = array(
+      '#type' => 'submit',
+      '#value' => t('Reply')
+      );
+
+  return theme('rsvp_reply', drupal_get_form('rsvp_reply_form', $form));
 }
 
 /**
@@ -834,10 +975,10 @@ function rsvp_create_rsvp($edit) {
   $vals[] = time();
   $markers[] = "%d";
 
-  foreach($edit as $key => $value) {
+  foreach(array('name', 'invite_text', 'invite_list', 'blind', 'list_email', 'allow_invite', 'nid') as $key) {
     if($key != 'invite_list') {
       $fields[] = $key;
-      $vals[] = $value;
+      $vals[] = $edit[$key];
       $markers[] = "'%s'";
     }
   }
@@ -866,19 +1007,16 @@ function rsvp_create_rsvp($edit) {
 * @return boolean true on success.
 */
 function rsvp_update_rsvp($edit) {
-
   $fields[] = 'timestamp = %d';
   $vals[] = time();
 
-  foreach($edit as $key => $value){
-    if($key != 'invite_list' && $key != 'rid'){
-      $fields[] = "$key = '%s'";
-      $vals[] = $value;
-    }
+  foreach (array('name', 'invite_text', 'blind', 'list_email', 'allow_invite') as $key) {
+    $fields[] = $key ." = '%s'";
+    $vals[] = $edit[$key];
   }
 
   if(!$edit['rid']) {
-    return false;
+    return FALSE;
   }
   else {
     $vals[] = $edit['rid'];
@@ -886,15 +1024,15 @@ function rsvp_update_rsvp($edit) {
 
   $vals[] = $rid;
   
-  $sql = 'UPDATE {rsvp} SET '. implode(", ", $fields) .' WHERE rid = %d';
+  $sql = 'UPDATE {rsvp} SET '. implode(', ', $fields) .' WHERE rid = %d';
 
   if(db_query($sql, $vals)) {
     drupal_set_message(t('RSVP Updated'));
-    return true;
+    return TRUE;
   }
   else {
     drupal_set_message(t('There was an error updating the RSVP'));
-    return false;
+    return FALSE;
   }
 }
 
@@ -908,7 +1046,7 @@ function rsvp_update_rsvp($edit) {
 function rsvp_delete_rsvp($rid) {
   if(db_query('DELETE FROM {rsvp} WHERE rid = %d', $rid)) {
     if(db_query('DELETE FROM {rsvp_invite} WHERE rid = %d', $rid)) {
-      drupal_set_message(t('RSVP Deleted'));
+      drupal_set_message(t('RSVP deleted.'));
       return TRUE;
     }
     else {
Index: rsvp.theme
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/rsvp/rsvp.theme,v
retrieving revision 1.2
diff -u -F^f -r1.2 rsvp.theme
--- rsvp.theme	29 Jul 2005 23:56:41 -0000	1.2
+++ rsvp.theme	18 Nov 2005 22:23:43 -0000
@@ -48,7 +48,7 @@ function theme_rsvp($rsvp, $content) {
   return $output;
 }
 
-function theme_rsvp_reply_form($content) {
+function theme_rsvp_reply($content) {
   $output = '<div class="rsvpreplybox">';
   $output .= $content;
   $output .= '</div>';
