Browse Source

Fixed URL redirect.

pull/105/head
Alexander O'Neill 14 years ago
parent
commit
71115175c0
  1. 4
      ObjectHelper.inc
  2. 7
      fedora_repository.module

4
ObjectHelper.inc

@ -476,7 +476,7 @@ class ObjectHelper {
if ($allow) {
//$purgeObject = '<a title="' . t('Purge Object ') . $object_pid . '" href="' . base_path() . 'fedora/repository/purgeObject/' .
//$object_pid . '"><img src="' . $base_url . '/' . $path . '/images/purge_big.png" alt="' . t('Purge Object') . '" class="icon">' . t('Purge Object') . '</a>';
$purgeObject = drupal_get_form('fedora_repository_purge_object_form', $object_pid, check_plain(request_uri()));
$purgeObject = drupal_get_form('fedora_repository_purge_object_form', $object_pid, check_plain(substr(request_uri(), strlen(base_path()))));
}
} else {
$purgeObject = '&nbsp;';
@ -708,7 +708,7 @@ class ObjectHelper {
// $ingestObject = '<a title="'. t('Ingest a New object into ') . $collectionName . ' '. $collection_pid . '" href="'. base_path() .
$ingestObject = '<a title="' . t('Ingest a New object into !collection_name PID !collection_pid', array('!collection_name' => $collectionName, '!collection_pid' => $collection_pid)) . '" href="' . base_path() .
'fedora/ingestObject/' . $collection_pid . '/' . $collectionName . '"><img src="' . $base_url . '/' . $path .
'/images/ingest.png" alt="' . t('Add a New Object') . '" class="icon">' . t('Add to this Collection') . '</a>';
'/images/ingest.png" alt="' . t('Add a New Object') . '" class="icon"></a>' . t(' Add to this Collection');
}
}
}

7
fedora_repository.module

@ -254,7 +254,8 @@ function fedora_repository_purge_object_form(&$form_state, $pid, $referrer) {
$form['submit'] = array(
'#type' => 'image_button',
'#src' => drupal_get_path('module', 'fedora_repository').'/images/purge_big.png',
'#value' => t('Purge')
'#value' => t('Purge'),
'#suffix' => 'Purge this object',
);
if ($collectionPid == NULL) {
$collectionPid = $_SESSION['fedora_collection'];
@ -266,7 +267,7 @@ function fedora_repository_purge_object_form(&$form_state, $pid, $referrer) {
else {
// ALSO do $form definition here. Your final submit handler (after user clicks Yes, I Confirm) will only see $form_state info defined here. Form you create here passed as param1 to confirm_form
return confirm_form($form,'You Sure?', $base_url.$referrer, 'Description text','Yes, nuke it','Cancel'); //Had better luck leaving off last param 'name'
return confirm_form($form, 'Confirm Purge Object', $referrer, 'Are you sure you want to delete this object? This action cannot be undone.', 'Delete', 'Cancel'); //Had better luck leaving off last param 'name'
}
return $form;
}
@ -433,7 +434,7 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) {
$collectionPid = $_SESSION['fedora_collection'];
}
if (!empty($form_state['values']['referrer'])) {
$form_state['redirect'] = substr($form_state['values']['referrer'], 1);
$form_state['redirect'] = $form_state['values']['referrer'];
}
else {
$form_state['redirect'] = "fedora/repository/$collectionPid/";

Loading…
Cancel
Save