function feedback_admin_view_form_submit in Feedback 6.2
Same name and namespace in other branches
- 5.2 feedback.module \feedback_admin_view_form_submit()
- 7.2 feedback.admin.inc \feedback_admin_view_form_submit()
Form submit callback for admin view form.
File
- ./
feedback.admin.inc, line 106 - 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 => $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);
}
}