You are here

function biblio_citeproc_csl_editor_validate in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 modules/CiteProc/biblio_citeproc.admin.inc \biblio_citeproc_csl_editor_validate()
  2. 7.2 modules/CiteProc/biblio_citeproc.admin.inc \biblio_citeproc_csl_editor_validate()

File

modules/CiteProc/biblio_citeproc.admin.inc, line 672

Code

function biblio_citeproc_csl_editor_validate($form, &$form_state) {
  if ($form_state['triggering_element']['#value'] == t('Save')) {
    $csl = $form_state['values']['editor']['value'];
    $valid = biblio_citeproc_validate_csl($csl);
    if (!empty($valid)) {
      form_set_error('editor', $valid[0]);
    }
    else {
      $form_state['values']['editor']['value'] = $csl;
    }
  }
}