Browse Source

Does this actually work

pull/46/head
Ben Woodhead 13 years ago
parent
commit
bba29d761a
  1. 28
      fedora_repository.module

28
fedora_repository.module

@ -54,8 +54,7 @@ function fedora_repository_purge_object($pid = NULL, $name = NULL) {
drupal_set_message(t('You must specify an object pid to purge an object.'), 'error'); drupal_set_message(t('You must specify an object pid to purge an object.'), 'error');
return ''; return '';
} }
$output = t('Are you sure you wish to purge object %name %pid!<br /><b>This cannot be undone</b><br />', $output = t('Are you sure you wish to purge object %name %pid!<br /><b>This cannot be undone</b><br />', array(
array(
'%name' => $name, '%name' => $name,
'%pid' => $pid) '%pid' => $pid)
); );
@ -115,7 +114,7 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label
$collection_pid = urldecode($collection_pid); $collection_pid = urldecode($collection_pid);
} }
else { else {
drupal_set_message(t("This collection PID @collection_pid is not valid", check_plain($collection_pid )), 'error'); drupal_set_message(t("This collection PID @collection_pid is not valid", check_plain($collection_pid)), 'error');
return ' '; return ' ';
} }
} }
@ -150,7 +149,7 @@ function fedora_repository_ingest_form_submit(array $form, array &$form_state) {
$xml_form->submit($form, $form_state); $xml_form->submit($form, $form_state);
} }
} }
else if ($form_state['clicked_button']['#id'] == 'edit-submit') { elseif ($form_state['clicked_button']['#id'] == 'edit-submit') {
global $base_url; global $base_url;
module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionClass');
module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy');
@ -247,7 +246,7 @@ function fedora_repository_ingest_form_validate($form, &$form_state) {
elseif (!$cm->execIngestRules($file, $dformat)) { elseif (!$cm->execIngestRules($file, $dformat)) {
drupal_set_message(t('Error following Content Model Rules'), 'error'); drupal_set_message(t('Error following Content Model Rules'), 'error');
foreach (ContentModel::$errors as $err) { foreach (ContentModel::$errors as $err) {
drupal_set_message($err, 'error'); drupal_set_message(check_plain($err), 'error');
} }
} }
} }
@ -400,7 +399,7 @@ function add_stream_form_submit($form, &$form_state) {
file_delete($file); file_delete($file);
} catch (exception $e) { } catch (exception $e) {
drupal_set_message(t($e->getMessage()), 'error'); drupal_set_message(t(check_plain($e->getMessage())), 'error');
return; return;
} }
$form_state['rebuild'] = TRUE; $form_state['rebuild'] = TRUE;
@ -482,8 +481,7 @@ function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL)
return ' '; return ' ';
} }
$output = t('Are you sure you wish to purge this datastream %name<br />', $output = t('Are you sure you wish to purge this datastream %name<br />', array(
array(
'%name' => $name) '%name' => $name)
); );
$output .= drupal_get_form('fedora_repository_purge_stream_form', $pid, $dsId); $output .= drupal_get_form('fedora_repository_purge_stream_form', $pid, $dsId);
@ -990,12 +988,11 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
// Add a 'manage object' tab for all objects, where detailed list of content is shown. // Add a 'manage object' tab for all objects, where detailed list of content is shown.
$obj = new FedoraObjectDetailedContent($pid); $obj = new FedoraObjectDetailedContent($pid);
$object_details = $obj->showFieldSets(); $object_details = $obj->showFieldSets();
if ($object_details['fedora_object_details']['#selected'] == TRUE){ if ($object_details['fedora_object_details']['#selected'] == TRUE) {
foreach($cmodels_tabs as $cmodel_tab){ foreach ($cmodels_tabs as $cmodel_tab) {
if (is_array($cmodel_tab)){ if (is_array($cmodel_tab)) {
$cmodel_tab['#selected'] = FALSE; $cmodel_tab['#selected'] = FALSE;
} }
} }
} }
$cmodels_tabs = array_merge($cmodels_tabs, $object_details); $cmodels_tabs = array_merge($cmodels_tabs, $object_details);
@ -1468,7 +1465,7 @@ function fedora_repository_demo_objects_form() {
); );
foreach (array( foreach (array(
'islandora:collectionCModel' => 'Islandora default content models', 'islandora:collectionCModel' => 'Islandora default content models',
'islandora:root' => 'Islandora top-level collection', 'islandora:root' => 'Islandora top-level collection',
'islandora:demos' => 'Islandora demos collection', 'islandora:demos' => 'Islandora demos collection',
'islandora:largeimages' => 'Sample large image content model (requires <a href="http://sourceforge.net/projects/djatoka/">Djatoka</a> and <a href="http://www.kakadusoftware.com/index.php?option=com_content&task=view&id=26&Itemid=22">Kakadu</a>.)', 'islandora:largeimages' => 'Sample large image content model (requires <a href="http://sourceforge.net/projects/djatoka/">Djatoka</a> and <a href="http://www.kakadusoftware.com/index.php?option=com_content&task=view&id=26&Itemid=22">Kakadu</a>.)',
@ -1685,7 +1682,6 @@ function fedora_repository_required_fedora_objects() {
'dsversion' => 2, 'dsversion' => 2,
'cmodel' => 'fedora-system:ContentModel-3.0', 'cmodel' => 'fedora-system:ContentModel-3.0',
), ),
array( array(
'pid' => 'islandora:root', 'pid' => 'islandora:root',
'label' => 'Islandora Top-level Collection', 'label' => 'Islandora Top-level Collection',
@ -2085,9 +2081,7 @@ function theme_add_to_basket_link($pid, $type = 'object') {
*/ */
if (!_is_added_to_basket($pid)) { if (!_is_added_to_basket($pid)) {
return l( return l(
theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))), theme('image', drupal_get_path('module', 'Fedora_Repository') . '/images/' . $save, t("Add to basket"), t("Add this @object to my basket", array('@object' => $object))), "fedora/repository/addToBasket/" . $path, array('html' => TRUE)
"fedora/repository/addToBasket/" . $path,
array('html' => TRUE)
); );
} }

Loading…
Cancel
Save