Browse Source

Merge pull request #562 from matthewperry/7.x-LIB-38

Add a hidden next button at the top of the form so that it becomes the ...
pull/564/head
Jordan Dukart 10 years ago
parent
commit
902a1a34cd
  1. 8
      includes/ingest.form.inc

8
includes/ingest.form.inc

@ -499,6 +499,14 @@ function islandora_ingest_form_stepify(array $form, array &$form_state, array $s
);
$form['prev'] = $first_form_step ? NULL : islandora_ingest_form_previous_button($form_state);
$form['next'] = $last_form_step ? islandora_ingest_form_ingest_button($form_state) : islandora_ingest_form_next_button($form_state);
// Duplicate next button and hide it at the top of the form so that the form
// always triggers "next" if the user submits the form with the enter key.
if (!is_null($form['prev'])) {
$form['hidden_next'] = $form['next'];
$form['hidden_next']['#weight'] = -99;
$form['hidden_next']['#prefix'] = '<div style="display:none;">';
$form['hidden_next']['#suffix'] = '</div>';
}
// Allow for a hook_form_FORM_ID_alter().
drupal_alter(array('form_' . $step['form_id'], 'form'), $form, $form_state, $step['form_id']);
return $form;

Loading…
Cancel
Save