Browse Source

ISLANDORA-278 Updated files fixing Coder errors. Mostly t() errors.

pull/7/head^2
Nelson Hart 14 years ago
parent
commit
acad0a299e
  1. 16
      fedora_repository.module
  2. 5
      ilives/book.inc
  3. 5
      ilives/tests/fedora_ilives.test
  4. 2
      js/printer_tool.js
  5. 1
      plugins/CollectionFormBuilder.inc
  6. 2
      plugins/CreateCollection.inc
  7. 4
      plugins/DarwinCore.inc
  8. 2
      plugins/DemoFormBuilder.inc
  9. 8
      plugins/DocumentConverter.inc
  10. 2
      plugins/Exiftool.inc
  11. 2
      plugins/Ffmpeg.inc
  12. 1
      plugins/Flv.inc
  13. 1
      plugins/FlvFormBuilder.inc
  14. 9
      plugins/FormBuilder.inc
  15. 2
      plugins/ImageManipulation.inc
  16. 7
      plugins/ModsFormBuilder.inc
  17. 11
      plugins/PersonalCollectionClass.inc
  18. 11
      plugins/Refworks.inc
  19. 1
      plugins/ShowDemoStreamsInFieldSets.inc
  20. 5
      plugins/ShowStreamsInFieldSets.inc
  21. 5
      plugins/fedoraObject.inc
  22. 6
      plugins/fedora_attach/fedora_attach.admin.inc
  23. 5
      plugins/herbarium.inc
  24. 4
      plugins/islandora_newspaper/Newspaper.inc
  25. 5
      plugins/map_viewer.inc
  26. 5
      plugins/qt_viewer.inc
  27. 5
      plugins/slide_viewer.inc
  28. 1
      plugins/tagging_form.inc
  29. 5
      tests/fedora_repository.test

16
fedora_repository.module

@ -720,7 +720,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
if (!fedora_available()) {
drupal_set_message('The Fedora repository server is currently unavailable. Please contact the site administrator.', 'warning', FALSE);
drupal_set_message(t('The Fedora repository server is currently unavailable. Please contact the site administrator.'), 'warning', FALSE);
return '';
}
@ -1365,7 +1365,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) {
$cmodel_collection->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI);
$cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_views/simple_list_view.xml', 'COLLECTION_VIEW', 'Collection View', 'text/xml', 'X');
$cmodel_collection->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/contentModel.jpg', 'TN', 'Thumbnail', 'image/jpg', 'M');
drupal_set_message("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:ContentModelCollection\">islandora:ContentModelCollection</a>.", 'message');
drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:ContentModelCollection\">islandora:ContentModelCollection</a>."), 'message');
} catch (exception $e) {
}
@ -1377,7 +1377,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) {
$cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/COLLECTION-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X');
try {
$tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M');
drupal_set_message("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:top\">islandora:top</a>.", 'message');
drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:top\">islandora:top</a>."), 'message');
} catch (exception $e) {
}
@ -1397,7 +1397,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) {
$new_item->add_relationship('hasModel', 'islandora:collectionCModel', FEDORA_MODEL_URI);
$cp = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml', 'COLLECTION_POLICY', 'Collection Policy', 'text/xml', 'X');
$tn = $new_item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Crystal_Clear_mimetype_pdf.png', 'TN', 'Thumbnail.png', 'image/png', 'M');
drupal_set_message("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:demos\">islandora:demos</a>.", 'message');
drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:demos\">islandora:demos</a>."), 'message');
} catch (exception $e) {
}
@ -1419,7 +1419,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) {
$dual_res_image_collection_cmodel = new Fedora_Item('demo:DualResImageCollection');
try {
$cmstream = $dual_res_image_collection_cmodel->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/COLLECTIONCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X');
drupal_set_message("Successfully installed <a href=\"" . $base_url . "/fedora/repository/demo:SmileyStuff\">demo:SmileyStuff</a> collection view.", 'message');
drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/demo:SmileyStuff\">demo:SmileyStuff</a> collection view."), 'message');
} catch (exception $e) {
}
@ -1438,14 +1438,14 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) {
try {
$item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/islandora_largeimages.xml');
$tn = $item->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/images/Gnome-emblem-photos.png', 'TN', 'Thumbnail.png', 'image/png', 'M');
drupal_set_message("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:largeimages\">islandora:largeimages</a>.", 'message');
drupal_set_message(t("Successfully installed <a href=\"" . $base_url . "/fedora/repository/islandora:largeimages\">islandora:largeimages</a>."), 'message');
} catch (exception $e) {
$error .= " - Problem ingesting islandora:largeimages collection";
}
}
if (!empty($error)) {
drupal_set_message('Some problems occurred: ' . $error);
drupal_set_message(t('Some problems occurred: ' . $error));
}
}
}
@ -1893,7 +1893,7 @@ function _fedora_repository_empty_basket() {
function fedora_repository_add_to_basket($pid, $warn = TRUE, $searchResultsFlag = FALSE) {
if ($warn && _is_added_to_basket($pid)) {
drupal_set_message("Object already in basket");
drupal_set_message(t("Object already in basket"));
}
if (!isset($_SESSION['basket'])) {

5
ilives/book.inc

@ -1,6 +1,9 @@
<?php
/**
* @file
*
*/
class IslandoraBook {

5
ilives/tests/fedora_ilives.test

@ -2,7 +2,8 @@
/*
/**
* @file
* Tests the functions of the Fedora Repository module.
*/
@ -99,7 +100,7 @@ class FedoraBookTestCase extends DrupalWebTestCase {
}
$output_path = "$file_dir/$basename." . $this->randomName(10) . '.html';
$rv = file_put_contents($output_path, $this->drupalGetContent());
$this->pass("$description: Contents of result page are " . l('here', $output_path));
$this->pass("$description: Contents of result page are " . l(t('here'), $output_path));
}
protected function drupalCreateFedoraUser($permissions = array('access comments', 'access content', 'post comments', 'post comments without approval')) {

2
js/printer_tool.js

@ -7,7 +7,7 @@ PrinterTool.print = function (tagID) {
var target = document.getElementById(tagID);
var title = document.title;
if(!target || target.childNodes.length === 0) {
alert("Nothing to Print");
alert(t("Nothing to Print"));
return;
}
var content = target.innerHTML;

1
plugins/CollectionFormBuilder.inc

@ -4,6 +4,7 @@
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
/*
* @file
* Created on 19-Feb-08
*
*

2
plugins/CreateCollection.inc

@ -2,7 +2,7 @@
/*
/*@file
*
*
* This Class implements the methods defined in the STANDARD_IMAGE content model

4
plugins/DarwinCore.inc

@ -1,7 +1,11 @@
<?php
/* @file
*/
class DarwinCore {
function __construct($item = NULL) {

2
plugins/DemoFormBuilder.inc

@ -3,7 +3,7 @@
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
/*
/*@file
* Created on 19-Feb-08
*
*

8
plugins/DocumentConverter.inc

@ -2,8 +2,8 @@
/**
*
/*
*@file
* This class implements document (doc, odt, pdf, etc.) conversion for a generic
* multi-format document collection.
*/
@ -55,7 +55,7 @@ class DocumentConverter {
$returnValue = file_put_contents($outputFile, $data);
if ($returnValue > 0) {
drupal_set_message("Conversion successful.", 'status');
drupal_set_message(t("Conversion successful."), 'status');
$_SESSION['fedora_ingest_files']["$dsid"] = $outputFile;
return $outputFile;
}
@ -64,7 +64,7 @@ class DocumentConverter {
}
}
else {
drupal_set_message("Conversion Failed. Webservice returned $code.", 'status');
drupal_set_message(t("Conversion Failed. Webservice returned $code."), 'status');
return FALSE;
}
}

2
plugins/Exiftool.inc

@ -3,7 +3,7 @@
/*
*
*@file
*
* This Class implements the methods defined in the STANDARD_IMAGE content model
*/

2
plugins/Ffmpeg.inc

@ -3,7 +3,7 @@
/*
*
*@file
*
* This Class implements the methods defined in the STANDARD_QT content model
*/

1
plugins/Flv.inc

@ -3,6 +3,7 @@
/*
*@file
* Created on 19-Feb-08
*
*

1
plugins/FlvFormBuilder.inc

@ -5,6 +5,7 @@
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
/*
*@file
* implements methods from content model ingest form xml
* builds a dc metadata form
*/

9
plugins/FormBuilder.inc

@ -3,6 +3,7 @@
/*
* @file
* Created on 19-Feb-08
*
*
@ -78,21 +79,21 @@ class FormBuilder {
try {
$xml = new SimpleXMLElement($policyStreamDoc);
} 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' => $e->getMessage())), 'error');
return FALSE;
}
$policyElement = $dom->createDocumentFragment();
if (!$policyElement) {
drupal_set_message(t('Error parsing security policy stream.'));
watchdog(t("Fedora_Repository"), t("Error parsing security policy stream, could not parse policy stream."), NULL, WATCHDOG_NOTICE);
watchdog(t("Fedora_Repository"), "Error parsing security policy stream, could not parse policy stream.", NULL, WATCHDOG_NOTICE);
return FALSE;
}
$dom->importNode($policyElement, TRUE);
$value = $policyElement->appendXML($policyStreamDoc);
if (!$value) {
drupal_set_message(t('Error creating security policy stream.'));
watchdog(t("Fedora_Repository"), t("Error creating security policy stream, could not parse collection policy template file."), NULL, WATCHDOG_NOTICE);
watchdog(t("Fedora_Repository"), "Error creating security policy stream, could not parse collection policy template file.", NULL, WATCHDOG_NOTICE);
return FALSE;
}
@ -161,7 +162,7 @@ class FormBuilder {
file_delete($form_values['ingest-file-location']);
} catch (exception $e) {
drupal_set_message(t('Error ingesting object: !e', array('!e' => $e->getMessage())), 'error');
watchdog(t("Fedora_Repository"), t("Error ingesting object: !e", array('!e' => $e->getMessage())), NULL, WATCHDOG_ERROR);
watchdog(t("Fedora_Repository"), "Error ingesting object: !e", array('!e' => $e->getMessage()), NULL, WATCHDOG_ERROR);
return;
}
}

2
plugins/ImageManipulation.inc

@ -3,7 +3,7 @@
/*
*
*@file
*
* This Class implements the methods defined in the STANDARD_IMAGE content model
*/

7
plugins/ModsFormBuilder.inc

@ -1,6 +1,9 @@
<?php
/**
* @file
*
*/
module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder');
@ -291,7 +294,7 @@ class ModsFormBuilder extends FormBuilder {
file_delete($form_values['ingest-file-location']);
} catch (exception $e) {
drupal_set_message(t('Error ingesting object: !e', array('!e' => $e->getMessage())), 'error');
watchdog(t("Fedora_Repository"), t("Error ingesting object: !e", array('!e' => $e->getMessage())), NULL, WATCHDOG_ERROR);
watchdog(t("Fedora_Repository"), "Error ingesting object: !e", array('!e' => $e->getMessage()), NULL, WATCHDOG_ERROR);
return;
}
}

11
plugins/PersonalCollectionClass.inc

@ -1,6 +1,9 @@
<?php
/**
* @file
*
*/
class PersonalCollectionClass {
@ -50,7 +53,7 @@ class PersonalCollectionClass {
try {
$xml = new SimpleXMLElement($collectionTemplate);
} 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' => $e->getMessage())), 'error');
return FALSE;
}
@ -58,7 +61,7 @@ class PersonalCollectionClass {
if (!$policyElement) {
drupal_set_message(t('Error parsing policy stream.'));
watchdog(t("Fedora_Repository"), t("Error parsing policy stream, could not parse policy stream."), NULL, WATCHDOG_NOTICE);
watchdog(t("Fedora_Repository"), "Error parsing policy stream, could not parse policy stream.", NULL, WATCHDOG_NOTICE);
return FALSE;
}
$dom->importNode($policyElement, TRUE);
@ -66,7 +69,7 @@ class PersonalCollectionClass {
$value = $policyElement->appendXML($collectionTemplate);
if (!$value) {
drupal_set_message(t('Error creating collection policy stream.'));
watchdog(t("Fedora_Repository"), t("Error creating collection policy stream, could not parse collection policy template file."), NULL, WATCHDOG_NOTICE);
watchdog(t("Fedora_Repository"), "Error creating collection policy stream, could not parse collection policy template file.", NULL, WATCHDOG_NOTICE);
return FALSE;
}

11
plugins/Refworks.inc

@ -2,7 +2,8 @@
/*
/**
* @file
* Created on 26-Feb-08
*
* To change the template for this generated file go to
@ -71,7 +72,7 @@ class Refworks {
//$dom = dom_import_simplexml($xml);//test to see if it behaves better
//$xml = new SimpleXMLElement(trim(file_get_contents($file)));
} catch (Exception $e) {
drupal_set_message(t('Error processing Refworks file: ') . $e->getMessage());
drupal_set_message(t('Error processing Refworks file:') . $e->getMessage());
return FALSE;
}
$this->referenceList = array();
@ -267,13 +268,13 @@ class Refworks {
if ($client == NULL) {
drupal_set_message(t('Error getting SOAP client.'), 'error');
watchdog(t("FEDORA_REPOSITORY"), t("Error getting SOAP client: !e", array('!e' => $e)), NULL, WATCHDOG_ERROR);
watchdog(t("FEDORA_REPOSITORY"), "Error getting SOAP client: !e", array('!e' => $e), NULL, WATCHDOG_ERROR);
return;
}
$object = $client->__soapCall('ingest', array(
$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 - !it", array('!pid' => $pid, '!it' => $item_title), NULL, WATCHDOG_INFO);
$deleteFiles = $form_values['delete_file']; //remove files from drupal file system
if ($deleteFiles > 0) {
@ -282,7 +283,7 @@ class Refworks {
} catch (exception $e) {
$errors++;
$errorMessage = 'yes';
watchdog(t("FEDORA_REPOSITORY"), t("Error during ingest !it !e", array('!it' => $item_title, '!e' => $e)), NULL, WATCHDOG_ERROR);
watchdog(t("FEDORA_REPOSITORY"), "Error during ingest !it !e", array('!it' => $item_title, '!e' => $e), NULL, WATCHDOG_ERROR);
}
$success++;
}

1
plugins/ShowDemoStreamsInFieldSets.inc

@ -3,6 +3,7 @@
/*
* @file
* Created on 17-Apr-08
*
*

5
plugins/ShowStreamsInFieldSets.inc

@ -2,7 +2,8 @@
/*
/**
* @file
* Created on 17-Apr-08
*/
class ShowStreamsInFieldSets {
@ -83,7 +84,7 @@ class ShowStreamsInFieldSets {
}
$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(t('<div style="float:left; padding: 10px"><img src="' . $tn_url . '"><br />View Document</div>'), 'fedora/repository/' . $this->pid . '/OBJ', array('html' => TRUE));
$tabset['first_tab']['tabs']['view'] = array(
'#type' => 'tabpage',

5
plugins/fedoraObject.inc

@ -1,5 +1,10 @@
<?php
/**
* @file
*
*/
class FedoraObject {
function __construct($pid = '') {

6
plugins/fedora_attach/fedora_attach.admin.inc

@ -16,11 +16,11 @@
function fedora_attach_admin() {
$options = drupal_map_assoc(explode(" ", variable_get('fedora_pids_allowed', 'default: demo: changeme: islandora: ilives: ')));
$default_value = variable_get('fedora_attach_pid_namespace', 'default:');
$isRestricted = variable_get('fedora_namespace_restriction_enforced', TRUE);
$is_restricted = variable_get('fedora_namespace_restriction_enforced', TRUE);
if (!in_array($default_value, $options) && $isRestricted) {
drupal_set_message("The value last set here ($default_value) is not in the list of available PID namespaces (perhaps it has changed?). Please choose a valid option from the list.", 'warning');
if (!in_array($default_value, $options) && $is_restricted) {
drupal_set_message(t("The value last set here ($default_value) is not in the list of available PID namespaces (perhaps it has changed?). Please choose a valid option from the list."), 'warning');
}
$form = array();

5
plugins/herbarium.inc

@ -1,6 +1,9 @@
<?php
/**
* @file
*
*/
class Herbarium {

4
plugins/islandora_newspaper/Newspaper.inc

@ -1,6 +1,8 @@
<?php
/* @file
* News Paper Plugin for Fedora Repository module.
*/
class Newspaper {

5
plugins/map_viewer.inc

@ -1,6 +1,9 @@
<?php
/**
* @file
*
*/
class ShowMapStreamsInFieldSets {

5
plugins/qt_viewer.inc

@ -1,6 +1,9 @@
<?php
/**
* @file
*
*/
class ShowQtStreamsInFieldSets {

5
plugins/slide_viewer.inc

@ -1,6 +1,9 @@
<?php
/**
* @file
*
*/
class ShowSlideStreamsInFieldSets {

1
plugins/tagging_form.inc

@ -3,6 +3,7 @@
/*
* @file
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

5
tests/fedora_repository.test

@ -1,8 +1,7 @@
<?php
/*
/* @file
* Tests the functions of the Fedora Repository module.
*/
@ -153,7 +152,7 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase {
}
$output_path = "$file_dir/$basename." . $this->randomName(10) . '.html';
$rv = file_put_contents($output_path, $this->drupalGetContent());
$this->pass("$description: Contents of result page are " . l('here', $output_path));
$this->pass("$description: Contents of result page are " . l(t('here'), $output_path));
}
protected function drupalCreateFedoraUser($permissions = array('access comments', 'access content', 'post comments', 'post comments without approval')) {

Loading…
Cancel
Save