You are here

function biblio_admin_field_mapper_form_submit in Bibliography Module 6

Same name and namespace in other branches
  1. 6.2 includes/biblio.admin.inc \biblio_admin_field_mapper_form_submit()
  2. 7 includes/biblio.admin.inc \biblio_admin_field_mapper_form_submit()
  3. 7.2 includes/biblio.admin.inc \biblio_admin_field_mapper_form_submit()

File

./biblio.admin.inc, line 1179

Code

function biblio_admin_field_mapper_form_submit($form, $form_state) {
  if ($form_state['values']['op'] == t('Save')) {
    foreach ($form_state['values'] as $key => $value) {
      if (is_array($value)) {
        $map[$key] = $value['biblio'];
        $export_map[$value['biblio']] = $value['export'];
      }
    }
    variable_set('biblio_' . $form_state['values']['fileformat'] . '_field_map', $map);
    variable_set('biblio_' . $form_state['values']['fileformat'] . '_export_map', $export_map);
    drupal_goto('admin/settings/biblio/fields/typemap');
  }
  elseif ($form_state['values']['op'] == t('Reset to Defaults')) {
    variable_del('biblio_' . $form_state['values']['fileformat'] . '_field_map');
    variable_del('biblio_' . $form_state['values']['fileformat'] . '_export_map');
    drupal_goto('admin/settings/biblio/fields/fieldmap/' . $form_state['values']['fileformat']);
  }

  //  elseif ($form_state['values']['op'] == t('Add')) {
  //    $names = biblio_get_type_names($form_state['values']['fileformat']);
  //    $names[$form_state['values']['type_name']] = $form_state['values']['type_desc'];
  //    variable_set('biblio_'.$form_state['values']['fileformat'] .'_type_names', $names);
  //  }
}