drupal_set_message(t('Could not connect to the repository. Please check the settings on the <ahref="!config_url"title="Islandora configuration page">Islandora configuration</a> page.', array('!config_url' => $config_url)), 'error');
@ -147,6 +162,10 @@ function islandora_solution_pack_form($form, &$form_state, $solution_pack_modul
$form['solution_pack']['install_status']['#markup'] .= ' ' . theme('image', array('path' => 'misc/watchdog-warning.png')) . ' ' . t('Some objects must be reinstalled. See objects list for details.');
$submit_button_text = t("Reinstall objects");
}
elseif ($could_not_connect) {
$form['solution_pack']['install_status']['#markup'] .= ' ' . theme('image', array('path' => 'misc/watchdog-error.png')) . ' ' . t('Could not connect to the repository.');
$submit_button_text = '';
}
// table
$form['solution_pack']['table'] = array(
@ -156,6 +175,7 @@ function islandora_solution_pack_form($form, &$form_state, $solution_pack_modul
}
// submit
if (!$could_not_connect) {
$form['solution_pack']['submit'] = array(
'#value' => $submit_button_text,
'#type' => 'submit',
@ -167,6 +187,7 @@ function islandora_solution_pack_form($form, &$form_state, $solution_pack_modul
$form['solution_pack']['#submit'] = array(
'islandora_solution_pack_form_submit',
);
}
return $form;
}
@ -272,23 +293,51 @@ function islandora_batch_reingest_object($object_model, &$context) {
* @TODO: add documentation
*/
function islandora_install_solution_pack($module_name = NULL, $op = 'install') {
// check if a module name is given. // @TODO: check module name for existance
drupal_set_message(st('@module_label: Did not install any objects. Could not connect to the repository. Please check the settings on the <ahref="!config_url"title="Islandora configuration page">Islandora configuration</a> page and install the required objects manually on the <ahref="!sp_url"title="Solution pack admin">solution pack admin</a> page.', array('@module_label' => $module_label, '!config_url' => $config_url, '!sp_url' => $sp_admin)), 'error');
break;
case 'uninstall':
drupal_set_message(st('@module_label: Did not uninstall any objects. Could not connect to the repository. Please check the settings on the <ahref="!config_url"title="Islandora configuration page">Islandora configuration</a> page and uninstall the required objects manually if necessary.', array('@module_label' => $module_label, '!config_url' => $config_url, '!sp_url' => $sp_admin)), 'error');
break;
}
return;
}
// create new connection
try {
$connection = new IslandoraTuque($user);
} catch (Exception $e) {
}
catch (Exception $e) {
drupal_set_message(st('Unable to connect to the repository %e', array('%e' => $e)), 'error');