You are here

function node_convert_add_template_validate in Node Convert 6

Same name and namespace in other branches
  1. 7 node_convert.admin.inc \node_convert_add_template_validate()

File

./node_convert.module, line 396
The node_convert module converts nodes from one type to another.

Code

function node_convert_add_template_validate($form, &$form_state) {
  if ($form_state['values']['step'] == 'choose_destination_type') {
    if ($form_state['values']['source_type'] == $form_state['values']['dest_type']) {
      form_set_error('source_type', t('Please select different node types.'));
      form_set_error('dest_type', t('Please select different node types.'));
    }
  }
  elseif ($form_state['values']['step'] == 'choose_destination_fields') {
    module_invoke_all('node_convert_change', array(
      'dest_node_type' => $form_state['values']['info']['dest_type'],
      'form_state' => $form_state,
    ), 'options validate');
  }
}