You are here

function organigrams_form_import_validate in Organigrams 7

Validate function for organigrams_form_import.

File

./organigrams.admin.inc, line 775
Defines the administration forms for managing organigrams.

Code

function organigrams_form_import_validate($form, &$form_state) {

  // Also check if we have any import data.
  if (empty($form_state['values']['import'])) {
    form_set_error('import', t('No import data found.'));
  }
  $data = json_decode($form_state['values']['import']);
  if (empty($data->organigram)) {
    form_set_error('import', t('No organigram found.'));
  }
}