You are here

function resource_conflict_form_submit in Resource Conflict 5.2

Same name and namespace in other branches
  1. 6.2 resource_conflict.module \resource_conflict_form_submit()
  2. 7.3 resource_conflict.module \resource_conflict_form_submit()
  3. 7.2 resource_conflict.module \resource_conflict_form_submit()

Submit the node_type_form

File

./resource_conflict.module, line 253

Code

function resource_conflict_form_submit($form_id, $form_values) {
  $type = $form_values['type'];
  $old_type = $form_values['old_type'];
  $conflict_types = variable_get("rc_types", array());

  //unset old entry
  if (!empty($old_type)) {
    $key = array_search($old_type, $conflict_types);
    unset($conflict_types[$key]);
  }

  //make new entry if this type is conflict handled
  if ($form_values['rc_type']) {
    $conflict_types[] = $type;
  }
  variable_set("rc_types", $conflict_types);
}