You are here

function feedback_admin_view_form_submit in Feedback 5.2

Same name and namespace in other branches
  1. 6.2 feedback.admin.inc \feedback_admin_view_form_submit()
  2. 7.2 feedback.admin.inc \feedback_admin_view_form_submit()

Form submit callback for admin view form.

File

./feedback.module, line 325
Allows site visitors and users to report issues about this site.

Code

function feedback_admin_view_form_submit($form_id, $form_values) {
  $update = array();

  // Determine feedback entries to update.
  foreach ($form_values['feedback-messages'] as $status => $entries) {
    $entries = array_filter($entries);
    foreach ($entries as $fid => $value) {

      // Lame for now. :(
      $update[$fid] = $status == 0 ? 1 : 0;
    }
  }

  // Update status of entries in database.
  foreach ($update as $fid => $value) {
    db_query("UPDATE {feedback} SET status = %d WHERE fid = %d", $value, $fid);
  }
}