You are here

function i18n_node_select_translation_validate in Internationalization 7

Same name and namespace in other branches
  1. 6 i18n.pages.inc \i18n_node_select_translation_validate()

Form validation

File

i18n_node/i18n_node.pages.inc, line 171
User page callbacks for the translation module.

Code

function i18n_node_select_translation_validate($form, &$form_state) {
  foreach ($form_state['values']['translations']['node'] as $lang => $title) {
    if (!$title) {
      $nid = 0;
    }
    else {
      $nid = i18n_node_autocomplete2nid($title, "translations][node][{$lang}", array(
        $form_state['values']['node']->type,
      ), array(
        $lang,
      ));
    }
    $form_state['values']['translations']['nid'][$lang] = $nid;
  }
}