You are here

function patterns_export_validate in Patterns 7.2

Same name and namespace in other branches
  1. 7 patterns_export/patterns_export.module \patterns_export_validate()

validation function for import_module_form

1 string reference to 'patterns_export_validate'
patterns_export_page1 in patterns_export/patterns_export.module

File

patterns_export/patterns_export.module, line 158

Code

function patterns_export_validate($form, &$form_state) {
  if (!isset($form_state['values']['export']['type'])) {
    form_set_error('export[type]', t('No valid type of export selected.'));
  }
  if (!isset($form_state['values']['format'])) {
    form_set_error('format', t('No valid format selected.'));
  }
  if (!empty($form_state['values']['filename'])) {
    form_set_error('filename', t('Please specify a valid file name.'));
  }
  if (!isset($form_state['values']['export']['to'])) {
    form_set_error('export[to]', t('Please specify a valid export action.'));
  }
  if (!isset($form_state['values']['export']['mode'])) {
    form_set_error('export[mode]', t('Please specify a valid export mode.'));
  }
  if (!isset($form_state['values']['info'])) {
    form_set_error('info', t('No info section found.'));
  }
  return TRUE;
}