You are here

function biblio_ris_form_biblio_form_alter in Bibliography Module 7.2

File

modules/RIS/biblio_ris.module, line 33

Code

function biblio_ris_form_biblio_form_alter(&$form, &$form_state) {
  global $user;
  if (!$form_state['submitted'] && !isset($form_state['values']) && !isset($form_state['biblio']->bid)) {
    if (!$form_state['submitted']) {
      $form['biblio_ris_paste'] = array(
        '#type' => 'fieldset',
        '#title' => t('Paste RIS Record'),
        '#weight' => -20,
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
      );
      $form['biblio_ris_paste']['paste_data_ris'] = array(
        '#type' => 'textarea',
        '#title' => t('RIS'),
        '#required' => FALSE,
        '#default_value' => isset($form_state['values']['paste_data_ris']) ? $form_state['values']['paste_data_ris'] : '',
        '#description' => t('Paste a RIS entry here'),
        '#size' => 60,
        '#weight' => -4,
      );
      $form['biblio_ris_paste']['paste_submit'] = array(
        '#type' => 'submit',
        '#value' => t('Populate using RIS'),
        '#submit' => array(
          'biblio_ris_form_biblio_form_submit',
        ),
      );
    }
  }
  $biblio_ris_id = isset($form_state['values']['biblio_ris_id']) ? $form_state['values']['biblio_ris_id'] : '';
  $biblio_ris_md5 = isset($form_state['values']['biblio_ris_md5']) ? $form_state['values']['biblio_ris_md5'] : '';
  $form['biblio_ris_id'] = array(
    '#type' => 'value',
    '#value' => $biblio_ris_id,
  );
  $form['biblio_ris_md5'] = array(
    '#type' => 'value',
    '#value' => $biblio_ris_md5,
  );
}