Browse Source

Merge pull request #72 from bwoodhead/6.x

6.x
pull/71/merge
Ben Woodhead 13 years ago
parent
commit
ffbe6afc21
  1. 4
      CollectionClass.inc
  2. 2
      ObjectHelper.inc
  3. 6
      SecurityClass.inc
  4. 13
      fedora_repository.module
  5. 4
      fedora_repository.solutionpacks.inc
  6. 2
      formClass.inc
  7. 4
      plugins/FormBuilder.inc
  8. 2
      plugins/PersonalCollectionClass.inc
  9. 4
      plugins/Refworks.inc
  10. 2
      plugins/ShowStreamsInFieldSets.inc

4
CollectionClass.inc

@ -343,7 +343,7 @@ class CollectionClass {
$thisClass = new $phpClass (); $thisClass = new $phpClass ();
$returnValue = $thisClass->$phpMethod($parametersArray, $dsid, $file, $file_ext); $returnValue = $thisClass->$phpMethod($parametersArray, $dsid, $file, $file_ext);
if (!$returnValue) { if (!$returnValue) {
drupal_set_message('Error! Failed running content model method !m !rv', array('!m' => $phpMethod, '!rv' => $returnValue)); drupal_set_message(t('Error! Failed running content model method !m !rv', array('!m' => $phpMethod, '!rv' => $returnValue)));
return FALSE; return FALSE;
} }
} }
@ -463,7 +463,7 @@ class CollectionClass {
module_load_include('inc', 'fedora_repository', 'plugins/PersonalCollectionClass'); module_load_include('inc', 'fedora_repository', 'plugins/PersonalCollectionClass');
$personalCollectionClass = new PersonalCollectionClass(); $personalCollectionClass = new PersonalCollectionClass();
if (!$personalCollectionClass->createCollection($user, $pid, $soapClient)) { if (!$personalCollectionClass->createCollection($user, $pid, $soapClient)) {
drupal_set_message("Did not create a personal collection object for !u", array('!u' => $user->name)); drupal_set_message(t("Did not create a personal collection object for !u", array('!u' => $user->name)));
return FALSE; //creation failed don't save the collection pid in drupal db return FALSE; //creation failed don't save the collection pid in drupal db
} }
user_save($user, $personal_collection_pid); user_save($user, $personal_collection_pid);

2
ObjectHelper.inc

@ -963,7 +963,7 @@ class ObjectHelper {
} }
else { else {
$breadcrumbs[] = l("Path Calculation Error", 'fedora/repository/' . $pid); $breadcrumbs[] = l(t("Path Calculation Error"), 'fedora/repository/' . $pid);
} }
} }
} }

6
SecurityClass.inc

@ -71,9 +71,9 @@ class SecurityClass {
try { try {
$xml = new SimpleXMLElement($policyStream); $xml = new SimpleXMLElement($policyStream);
} catch (Exception $e) { } catch (Exception $e) {
watchdog(t("Fedora_Repository"), t("No roles found in security policy, could not parse policy stream."), NULL, WATCHDOG_ERROR); watchdog(t("Fedora_Repository"), "No roles found in security policy, could not parse policy stream.", NULL, WATCHDOG_ERROR);
//we may not want to send this to the screen. //we may not want to send this to the screen.
drupal_set_message(t('No roles found in security policy, could not parse policy stream: !message', array('!message' => $e->getMessage())), 'error'); drupal_set_message(t('No roles found in security policy, could not parse policy stream: !message', array('!message' => check_plain($e->getMessage()))), 'error');
return NULL; return NULL;
} }
$xml->registerXPathNamespace('default', 'urn:oasis:names:tc:xacml:1.0:policy'); $xml->registerXPathNamespace('default', 'urn:oasis:names:tc:xacml:1.0:policy');
@ -110,7 +110,7 @@ class SecurityClass {
try { try {
$doc->load(drupal_get_path('module', 'Fedora_Repository') . '/policies/noObjectEditPolicy.xml'); $doc->load(drupal_get_path('module', 'Fedora_Repository') . '/policies/noObjectEditPolicy.xml');
} catch (exception $e) { } catch (exception $e) {
watchdog(t("Fedora_Repository"), t("Problem loading policy file."), NULL, WATCHDOG_ERROR); watchdog(t("Fedora_Repository"), "Problem loading policy file.", NULL, WATCHDOG_ERROR);
} }
$conditions = $doc->getElementsByTagName('Condition'); $conditions = $doc->getElementsByTagName('Condition');
foreach ($conditions as $condition) { foreach ($conditions as $condition) {

13
fedora_repository.module

@ -143,7 +143,7 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label
function fedora_repository_ingest_form_submit(array $form, array &$form_state) { function fedora_repository_ingest_form_submit(array $form, array &$form_state) {
//only validate the form if the submit button was pressed (other buttons may be used for AHAH //only validate the form if the submit button was pressed (other buttons may be used for AHAH
if ($form_state['ahah_submission']) { if ($form_state['ahah_submission']) {
$form_state['submitted'] = false; $form_state['submitted'] = FALSE;
return; return;
} }
if ($form_state['storage']['xml']) { if ($form_state['storage']['xml']) {
@ -202,7 +202,7 @@ function fedora_repository_ingest_form_submit(array $form, array &$form_state) {
function fedora_repository_ingest_form_validate($form, &$form_state) { function fedora_repository_ingest_form_validate($form, &$form_state) {
//only validate the form if the submit button was pressed (other buttons may be used for AHAH //only validate the form if the submit button was pressed (other buttons may be used for AHAH
if ($form_state['ahah_submission']) { if ($form_state['ahah_submission']) {
$form_state['submitted'] = false; $form_state['submitted'] = FALSE;
return; return;
} }
if ($form_state['clicked_button']['#id'] == 'edit-submit' && $form_state['ahah_submission'] != 1) { if ($form_state['clicked_button']['#id'] == 'edit-submit' && $form_state['ahah_submission'] != 1) {
@ -246,8 +246,11 @@ function fedora_repository_ingest_form_validate($form, &$form_state) {
if (!empty($file)) { if (!empty($file)) {
if (!in_array($dformat, $allowedMimeTypes)) { if (!in_array($dformat, $allowedMimeTypes)) {
form_set_error('ingest-file-location', t('The uploaded file\'s mimetype (' . $dformat . ') is not associated with this Content Model. The allowed types are ' . form_set_error('ingest-file-location',
implode(' ', $allowedMimeTypes))); t('The uploaded file\'s mimetype') .
' (' . $dformat . ') ' .
t('is not associated with this Content Model. The allowed types are') .
' ' . implode(' ', $allowedMimeTypes));
file_delete($file); file_delete($file);
return; return;
} }
@ -505,7 +508,7 @@ function fedora_repository_purge_object_form_validate($form, &$form_state) {
foreach ($contentModels as $contentModel) { foreach ($contentModels as $contentModel) {
if ($contentModel->pid == 'islandora:collectionCModel') { if ($contentModel->pid == 'islandora:collectionCModel') {
$member_pids = get_related_items_as_array($pid, 'isMemberOfCollection'); $member_pids = get_related_items_as_array($pid, 'isMemberOfCollection');
if (is_array($member_pids) && ! empty($member_pids)){ if (is_array($member_pids) && ! empty($member_pids)) {
form_set_error('new_collection_pid', t("Please purge all members of this collection before deleting the collection itself.")); form_set_error('new_collection_pid', t("Please purge all members of this collection before deleting the collection itself."));
return; return;
} }

4
fedora_repository.solutionpacks.inc

@ -181,7 +181,7 @@ function solution_pack_add_form($form_name, $form_xml) {
$object->name = $form_name; $object->name = $form_name;
$object->form = $form_xml; $object->form = $form_xml;
$result = drupal_write_record('xml_forms', $object); $result = drupal_write_record('xml_forms', $object);
drupal_set_message("Added $name"); drupal_set_message(t("Added @name", array("@name" => $name)));
} }
} }
@ -196,7 +196,7 @@ function solution_pack_add_form_association($content_model, $form_name) {
$object->title_field = "['titleInfo']['title']"; $object->title_field = "['titleInfo']['title']";
$object->transform = 'mods_to_dc.xsl'; $object->transform = 'mods_to_dc.xsl';
$result = drupal_write_record('islandora_content_model_forms', $object); $result = drupal_write_record('islandora_content_model_forms', $object);
drupal_set_message("Added association between $content_model$name"); drupal_set_message(t("Added association between @cm@name", array("@cm" => $content_model, "@name"=>$name)));
} }
} }

2
formClass.inc

@ -498,7 +498,7 @@ class formClass {
'#title' => t('Content models available'), '#title' => t('Content models available'),
'#options' => $potential_models, '#options' => $potential_models,
'#default_value' => $selected_model, '#default_value' => $selected_model,
'#description' => t('Content models define datastream composition, relationships between this and other content models, and the mandatory behaviors associated with each digital object.<br /> Additional information may be found <a href="https://wiki.duraspace.org/display/FEDORACREATE/Content+Models+Overview">here.</a> '), '#description' => t('Content models define datastream composition, relationships between this and other content models, and the mandatory behaviors associated with each digital object.<br /> Additional information may be found <a href="https://wiki.duraspace.org/display/FEDORACREATE/Content+Models+Overview">here.</a>'),
), ),
), ),
'collection_pid' => array( 'collection_pid' => array(

4
plugins/FormBuilder.inc

@ -95,7 +95,7 @@ class FormBuilder {
try { try {
$xml = new SimpleXMLElement($policyStreamDoc); $xml = new SimpleXMLElement($policyStreamDoc);
} catch (Exception $e) { } catch (Exception $e) {
watchdog(t("Fedora_Repository"), t("Problem getting security policy."), NULL, WATCHDOG_ERROR); watchdog(t("Fedora_Repository"), "Problem getting security policy.", NULL, WATCHDOG_ERROR);
drupal_set_message(t('Problem getting security policy: @e', array('@e' => check_plain($e->getMessage()))), 'error'); drupal_set_message(t('Problem getting security policy: @e', array('@e' => check_plain($e->getMessage()))), 'error');
return FALSE; return FALSE;
} }
@ -173,7 +173,7 @@ class FormBuilder {
$object = Fedora_Item::ingest_from_FOXML($dom); $object = Fedora_Item::ingest_from_FOXML($dom);
if (!empty($object->pid)) { if (!empty($object->pid)) {
// drupal_set_message("Item ". l($object->pid, 'fedora/repository/'. $object->pid) . " created successfully.", "status"); // drupal_set_message("Item ". l($object->pid, 'fedora/repository/'. $object->pid) . " created successfully.", "status");
drupal_set_message(t("Item !pid created successfully.", array('!pid' => l($object->pid, 'fedora/repository/' . $object->pid))), "status"); drupal_set_message(t("Item !pid created successfully.", array('!pid' => l(check_plain($object->pid), 'fedora/repository/' . check_plain($object->pid)))), "status");
} }
if (!empty($_SESSION['fedora_ingest_files'])) { if (!empty($_SESSION['fedora_ingest_files'])) {
foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) { foreach ($_SESSION['fedora_ingest_files'] as $dsid => $createdFile) {

2
plugins/PersonalCollectionClass.inc

@ -75,7 +75,7 @@ class PersonalCollectionClass {
try { try {
$xml = new SimpleXMLElement($collectionTemplate); $xml = new SimpleXMLElement($collectionTemplate);
} catch (Exception $e) { } catch (Exception $e) {
watchdog(t("Fedora_Repository"), t("Problem creating personal collection policy, could not parse collection policy stream."), NULL, WATCHDOG_ERROR); watchdog(t("Fedora_Repository"), "Problem creating personal collection policy, could not parse collection policy stream.", NULL, WATCHDOG_ERROR);
drupal_set_message(t('Problem creating personal collection policy, could not parse collection policy stream: @e', array('@e' => check_plain($e->getMessage()))), 'error'); drupal_set_message(t('Problem creating personal collection policy, could not parse collection policy stream: @e', array('@e' => check_plain($e->getMessage()))), 'error');
return FALSE; return FALSE;
} }

4
plugins/Refworks.inc

@ -83,7 +83,7 @@ class Refworks {
//$dom = dom_import_simplexml($xml);//test to see if it behaves better //$dom = dom_import_simplexml($xml);//test to see if it behaves better
//$xml = new SimpleXMLElement(trim(file_get_contents($file))); //$xml = new SimpleXMLElement(trim(file_get_contents($file)));
} catch (Exception $e) { } catch (Exception $e) {
drupal_set_message(t('Error processing Refworks file:') . " " . $e->getMessage()); drupal_set_message(t('Error processing Refworks file: @message', array('@message' => $e->getMessage())));
return FALSE; return FALSE;
} }
$this->referenceList = array(); $this->referenceList = array();
@ -296,7 +296,7 @@ class Refworks {
$object = $client->__soapCall('ingest', array( $object = $client->__soapCall('ingest', array(
$params $params
)); ));
watchdog(t("FEDORA_REPOSITORY"), t("Successfully added repository item !pid - !it", array('!pid' => $pid, '!it' => $item_title)), NULL, WATCHDOG_INFO); watchdog(t("FEDORA_REPOSITORY"), "Successfully added repository item " . $pid . " - ". $item_title, NULL, WATCHDOG_INFO);
$deleteFiles = $form_values['delete_file']; //remove files from drupal file system $deleteFiles = $form_values['delete_file']; //remove files from drupal file system
if ($deleteFiles > 0) { if ($deleteFiles > 0) {

2
plugins/ShowStreamsInFieldSets.inc

@ -109,7 +109,7 @@ class ShowStreamsInFieldSets {
} }
$dc_html = $objectHelper->getFormattedDC($item); $dc_html = $objectHelper->getFormattedDC($item);
$dl_link = l('<div style="float:left; padding: 10px"><img src="' . $tn_url . '"><br />View Document</div>', 'fedora/repository/' . $this->pid . '/OBJ', array('html' => TRUE)); $dl_link = l('<div style="float:left; padding: 10px"><img src="' . $tn_url . '"><br />' . t('View Document') .'</div>', 'fedora/repository/' . $this->pid . '/OBJ', array('html' => TRUE));
$tabset['first_tab']['tabs']['view'] = array( $tabset['first_tab']['tabs']['view'] = array(
'#type' => 'tabpage', '#type' => 'tabpage',

Loading…
Cancel
Save