function schools_override_elements_form_submit

6.x schools.module schools_override_elements_form_submit($form, $form_state)
7.x schools.module schools_override_elements_form_submit($form, $form_state)
1 string reference to 'schools_override_elements_form_submit'
schools_form_alter in modules/schools/schools.module
Implements hook_form_alter

File

modules/schools/schools.module, line 1042
Schools module.

Code

function schools_override_elements_form_submit($form, $form_state) {

  // our override values will be in the POST, not the regular "values" area.
  $school_id = intval($form_state ['values']['school_id']);
  $fields_to_check_override = explode(",", $form_state ['POST']['fields_to_check_override']);


  foreach ($fields_to_check_override as $fieldname) {
    if ($fieldname == "") {
      continue;
    }

    // get the base fieldname (minus any school designation).
    $temp = explode("~~", $fieldname);
    $base_fieldname = $temp [0];

    if (@$form_state ['POST']["school_override__$fieldname"] === 'yes') {
      // We are overriding the fieldname.
      variable_set("school_override__$fieldname", "yes");

    } // if override == yes
    else {
      // We are NOT overriding it.      
      variable_set("school_override__$fieldname", "no");
    }
  } //foreach


}