|
|
|
@ -46,19 +46,21 @@ function fedora_repository_solution_packs_page() {
|
|
|
|
|
* @param array $solution_pack |
|
|
|
|
*/ |
|
|
|
|
function fedora_repository_solution_pack_form(&$form_state, $solution_pack_module, $solution_pack_name, $objects = array()) { |
|
|
|
|
|
|
|
|
|
// Check each object to see if it is in the repository. |
|
|
|
|
module_load_include('inc', 'fedora_repository', 'api/fedora_item'); |
|
|
|
|
global $base_path; |
|
|
|
|
$needs_update = FALSE; |
|
|
|
|
$needs_install = FALSE; |
|
|
|
|
$form = array(); |
|
|
|
|
|
|
|
|
|
$form['solution_pack_module'] = array( |
|
|
|
|
'#type' => 'hidden', |
|
|
|
|
'#value' => $solution_pack_module, |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (!$form_state['submitted']) { |
|
|
|
|
$form['soluction_pack_name'] = array( |
|
|
|
|
$form['solution_pack_name'] = array( |
|
|
|
|
'#type' => 'markup', |
|
|
|
|
'#value' => t($solution_pack_name), |
|
|
|
|
'#prefix' => '<h3>', |
|
|
|
@ -75,7 +77,6 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul
|
|
|
|
|
$table_header = array('PID', 'Status'); |
|
|
|
|
$table_rows = array(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($objects as $object) { |
|
|
|
|
$datastreams = NULL; |
|
|
|
|
if (isset($object['pid'])) { |
|
|
|
@ -149,6 +150,12 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul
|
|
|
|
|
'#type' => 'submit', |
|
|
|
|
'#name' => $solution_pack_module, |
|
|
|
|
); |
|
|
|
|
$form['forcesubmit'] = array( |
|
|
|
|
'#value' => t('Force Reinstall'), |
|
|
|
|
//'#disabled' => !$needs_install && !$needs_update, |
|
|
|
|
'#type' => 'submit', |
|
|
|
|
'#name' => $solution_pack_module, |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$form['#submit'] = array( |
|
|
|
|
'fedora_repository_solution_pack_form_submit', |
|
|
|
@ -159,7 +166,11 @@ function fedora_repository_solution_pack_form(&$form_state, $solution_pack_modul
|
|
|
|
|
function fedora_repository_solution_pack_form_submit($form, &$form_state) { |
|
|
|
|
$what = $form_state; |
|
|
|
|
$module_name = $form_state['values']['solution_pack_module']; |
|
|
|
|
|
|
|
|
|
// This should be replaced with module_invoke |
|
|
|
|
$solution_pack_info = call_user_func($module_name . '_required_fedora_objects'); |
|
|
|
|
//$solution_pack_info = module_invoke($module_name, 'required_fedora_objects'); |
|
|
|
|
|
|
|
|
|
$batch = array( |
|
|
|
|
'title' => t('Installing / updating solution pack objects'), |
|
|
|
|
'file' => drupal_get_path('module', 'fedora_repository') . '/fedora_repository.module', |
|
|
|
@ -171,6 +182,9 @@ function fedora_repository_solution_pack_form_submit($form, &$form_state) {
|
|
|
|
|
// Add this object to the batch job queue. |
|
|
|
|
$batch['operations'][] = array('fedora_repository_batch_reingest_object', array($object)); |
|
|
|
|
} |
|
|
|
|
foreach($batch['operations'] as $key => $value) { |
|
|
|
|
//var_dump($value); |
|
|
|
|
} |
|
|
|
|
batch_set($batch); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|