You are here

function webform_validation_manage_overview_form_submit in Webform Validation 7

Submit function for rule overview form.

File

./webform_validation.admin.inc, line 155
Manages validation rules administration UI.

Code

function webform_validation_manage_overview_form_submit($form, $form_state) {

  // Save the rule weights.
  foreach ($form_state['values'] as $ruleid => $value) {
    if (is_numeric($ruleid)) {
      $update = db_update('webform_validation_rule')
        ->fields(array(
        'weight' => $value['weight'],
      ))
        ->condition('ruleid', $ruleid)
        ->execute();
    }
  }
  drupal_set_message(t('The order of the validation rules has been saved.'));
}