You are here

function feedback_admin_view_form_submit in Feedback 7.2

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

Form submit callback for admin view form.

File

./feedback.admin.inc, line 147
Administrative functionality for Feedback module.

Code

function feedback_admin_view_form_submit($form, &$form_state) {
  $update = array();

  // Determine feedback entries to update.
  foreach ($form_state['values']['feedback-messages'] as $status => $values) {
    $values = array_filter($values);
    if (!empty($values)) {
      $entries = feedback_load_multiple(array_keys($values));
      foreach ($entries as $fid => $entry) {
        $entry->status = $status == FEEDBACK_OPEN ? FEEDBACK_PROCESSED : FEEDBACK_OPEN;
        feedback_save($entry);
      }
    }
  }
}