You are here

function activity_comment_form_submit in Activity 6

FAPI #submit callback for activity_comments_comment_form().

File

./activity.module, line 1136
activity.module

Code

function activity_comment_form_submit($form, &$form_state) {
  global $user;
  $record = new stdClass();

  // oddly, when there are multiple forms on the page, the aid in
  // values is always from the first rendered form. we use the
  // value inside the post here to assign the right aid.
  $record->aid = $form_state['clicked_button']['#post']['aid'];
  $record->timestamp = time();
  $record->uid = $user->uid;
  $record->comment = $form_state['values']['activity-comment'];
  drupal_write_record('activity_comments', $record);
}