You are here

function bueditor_editor_import_validate in BUEditor 7

Same name and namespace in other branches
  1. 6.2 admin/bueditor.admin.inc \bueditor_editor_import_validate()

Editor import form validation.

1 string reference to 'bueditor_editor_import_validate'
bueditor_editor_import_form in admin/bueditor.admin.inc
Editor import form.

File

admin/bueditor.admin.inc, line 654

Code

function bueditor_editor_import_validate($form, &$form_state) {
  if (!($editor = bueditor_exec_editor_code($form_state['values']['code']))) {
    return form_error($form['code'], t('The editor code did not produce proper editor data.'));
  }
  $dirname = $form_state['values']['dirname'];
  if ($dirname) {
    $editor->custom_path = bueditor_public_dir() . '/' . $dirname;
    if (!file_prepare_directory($editor->custom_path, 1, 'dirname')) {
      return FALSE;
    }
  }
  $editor->name = $form_state['values']['name'];
  $editor->eid = $editor->overwrite = empty($form_state['values']['overwrite']) ? NULL : $form_state['values']['overwrite'];
  $form_state['editor'] = $editor;
}