You are here

function node_convert_bulk_validate in Node Convert 5

File

./node_convert.module, line 261

Code

function node_convert_bulk_validate($form_id, $form_values) {
  if ($form_values['step'] == "choose_source_dest_type") {
    if ($form_values['source_type'] == $form_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_values['step'] == "choose_nodes") {
    $no_nodes = TRUE;
    foreach ($form_values['nodes'] as $value) {
      if ($value != 0) {
        $no_nodes = FALSE;
        break;
      }
    }
    if ($no_nodes == TRUE) {
      form_set_error('', t('Please select at least one node.'));
    }
  }
}