Browse Source

ISLANDORA-214 Handle multiple instances of one form on a page properly.

pull/105/head
Alexander O'Neill 14 years ago
parent
commit
d84a0086ba
  1. 15
      fedora_repository.module
  2. 8
      fedora_repository.solutionpacks.inc

15
fedora_repository.module

@ -1852,3 +1852,18 @@ function theme_fedora_repository_solution_packs_list($solution_packs) {
drupal_add_css(drupal_get_path('module', 'update') .'/update.css'); drupal_add_css(drupal_get_path('module', 'update') .'/update.css');
return $output; return $output;
} }
/**
* Implementation of hook_forms()
* @param string $form_id
* @return array
*/
function fedora_repository_forms($form_id) {
$forms = array();
if (strpos($form_id, 'fedora_repository_solution_pack_form_') === 0) {
$forms[$form_id] = array(
'callback' => 'fedora_repository_solution_pack_form',
);
}
return $forms;
}

8
fedora_repository.solutionpacks.inc

@ -35,7 +35,7 @@ function fedora_repository_solution_packs_page() {
break; break;
} }
} }
$output .= drupal_get_form('fedora_repository_solution_pack_form', $solution_pack_module, $solution_pack_name, $objects); $output .= drupal_get_form('fedora_repository_solution_pack_form_' . $solution_pack_module, $solution_pack_module, $solution_pack_name, $objects);
} }
return $output; return $output;
@ -123,7 +123,11 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul
'#value' => t('Install'), '#value' => t('Install'),
'#disabled' => !$needs_install, '#disabled' => !$needs_install,
'#type' => 'submit', '#type' => 'submit',
'#name' => 'ingest', '#name' => $solution_pack_module,
);
$form['#submit'] = array(
'fedora_repository_solution_pack_form_submit',
); );
return $form; return $form;
} }

Loading…
Cancel
Save