You are here

function translation_overview_node_form_submit in Translation Overview 6.2

File

./translation_overview.pages.inc, line 100

Code

function translation_overview_node_form_submit($form, &$form_state) {
  $row = array(
    'tnid' => (int) $form_state['values']['tnid'],
  );
  foreach ($form_state['values']['languages'] as $language => $values) {
    $row[translation_overview_field_name($language)] = $values['priority'];
  }

  // We can assume that there will alwyas be a record with the given tnid
  // because translation_overview_get_node_priority() has been called and it
  // creates records if one is not present.
  if (drupal_write_record('translation_overview_priority', $row, 'tnid') !== FALSE) {
    drupal_set_message(t('The translation priorities have been saved.'));
  }
  else {
    drupal_set_message(t('There was a problem saving the translation priorities.'), 'error');
  }
}