From acad0a299e6239b9975775e3967511c0a14828c5 Mon Sep 17 00:00:00 2001 From: Nelson Hart Date: Fri, 17 Jun 2011 14:27:47 -0300 Subject: [PATCH] ISLANDORA-278 Updated files fixing Coder errors. Mostly t() errors. --- fedora_repository.module | 16 ++++++++-------- ilives/book.inc | 5 ++++- ilives/tests/fedora_ilives.test | 5 +++-- js/printer_tool.js | 2 +- plugins/CollectionFormBuilder.inc | 1 + plugins/CreateCollection.inc | 2 +- plugins/DarwinCore.inc | 4 ++++ plugins/DemoFormBuilder.inc | 2 +- plugins/DocumentConverter.inc | 8 ++++---- plugins/Exiftool.inc | 2 +- plugins/Ffmpeg.inc | 2 +- plugins/Flv.inc | 1 + plugins/FlvFormBuilder.inc | 1 + plugins/FormBuilder.inc | 9 +++++---- plugins/ImageManipulation.inc | 2 +- plugins/ModsFormBuilder.inc | 7 +++++-- plugins/PersonalCollectionClass.inc | 11 +++++++---- plugins/Refworks.inc | 11 ++++++----- plugins/ShowDemoStreamsInFieldSets.inc | 1 + plugins/ShowStreamsInFieldSets.inc | 5 +++-- plugins/fedoraObject.inc | 5 +++++ plugins/fedora_attach/fedora_attach.admin.inc | 6 +++--- plugins/herbarium.inc | 5 ++++- plugins/islandora_newspaper/Newspaper.inc | 4 +++- plugins/map_viewer.inc | 5 ++++- plugins/qt_viewer.inc | 5 ++++- plugins/slide_viewer.inc | 5 ++++- plugins/tagging_form.inc | 1 + tests/fedora_repository.test | 5 ++--- 29 files changed, 89 insertions(+), 49 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index d7765e01..f3ece0ad 100644 --- a/fedora_repository.module +++ b/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 islandora:ContentModelCollection.", 'message'); + drupal_set_message(t("Successfully installed islandora:ContentModelCollection."), '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 islandora:top.", 'message'); + drupal_set_message(t("Successfully installed islandora:top."), '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 islandora:demos.", 'message'); + drupal_set_message(t("Successfully installed islandora:demos."), '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 demo:SmileyStuff collection view.", 'message'); + drupal_set_message(t("Successfully installed demo:SmileyStuff 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 islandora:largeimages.", 'message'); + drupal_set_message(t("Successfully installed islandora:largeimages."), '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'])) { diff --git a/ilives/book.inc b/ilives/book.inc index 6d057156..6480dec1 100644 --- a/ilives/book.inc +++ b/ilives/book.inc @@ -1,6 +1,9 @@ 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')) { diff --git a/js/printer_tool.js b/js/printer_tool.js index 2d7da8dd..c76cf673 100644 --- a/js/printer_tool.js +++ b/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; diff --git a/plugins/CollectionFormBuilder.inc b/plugins/CollectionFormBuilder.inc index a76c9282..bc6c6282 100644 --- a/plugins/CollectionFormBuilder.inc +++ b/plugins/CollectionFormBuilder.inc @@ -4,6 +4,7 @@ module_load_include('inc', 'fedora_repository', 'plugins/FormBuilder'); /* + * @file * Created on 19-Feb-08 * * diff --git a/plugins/CreateCollection.inc b/plugins/CreateCollection.inc index 2fe5f8df..f537186b 100644 --- a/plugins/CreateCollection.inc +++ b/plugins/CreateCollection.inc @@ -2,7 +2,7 @@ -/* +/*@file * * * This Class implements the methods defined in the STANDARD_IMAGE content model diff --git a/plugins/DarwinCore.inc b/plugins/DarwinCore.inc index abf83f3d..ca34de17 100644 --- a/plugins/DarwinCore.inc +++ b/plugins/DarwinCore.inc @@ -1,7 +1,11 @@ 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; } } diff --git a/plugins/Exiftool.inc b/plugins/Exiftool.inc index 8a524d61..b395d017 100644 --- a/plugins/Exiftool.inc +++ b/plugins/Exiftool.inc @@ -3,7 +3,7 @@ /* - * + *@file * * This Class implements the methods defined in the STANDARD_IMAGE content model */ diff --git a/plugins/Ffmpeg.inc b/plugins/Ffmpeg.inc index 6013a358..3936883e 100644 --- a/plugins/Ffmpeg.inc +++ b/plugins/Ffmpeg.inc @@ -3,7 +3,7 @@ /* - * + *@file * * This Class implements the methods defined in the STANDARD_QT content model */ diff --git a/plugins/Flv.inc b/plugins/Flv.inc index 80a8f086..556bdcbe 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -3,6 +3,7 @@ /* + *@file * Created on 19-Feb-08 * * diff --git a/plugins/FlvFormBuilder.inc b/plugins/FlvFormBuilder.inc index eee6eec3..65faf5c0 100644 --- a/plugins/FlvFormBuilder.inc +++ b/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 */ diff --git a/plugins/FormBuilder.inc b/plugins/FormBuilder.inc index 990416d4..78dcd535 100644 --- a/plugins/FormBuilder.inc +++ b/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; } } diff --git a/plugins/ImageManipulation.inc b/plugins/ImageManipulation.inc index 4e3b65cb..b153d758 100644 --- a/plugins/ImageManipulation.inc +++ b/plugins/ImageManipulation.inc @@ -3,7 +3,7 @@ /* - * + *@file * * This Class implements the methods defined in the STANDARD_IMAGE content model */ diff --git a/plugins/ModsFormBuilder.inc b/plugins/ModsFormBuilder.inc index c0cca9a1..7466e2c6 100644 --- a/plugins/ModsFormBuilder.inc +++ b/plugins/ModsFormBuilder.inc @@ -1,6 +1,9 @@ $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; } } diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index f2fa3629..911c65dd 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -1,6 +1,9 @@ $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; } diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index 02745bce..87de1b83 100644 --- a/plugins/Refworks.inc +++ b/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++; } diff --git a/plugins/ShowDemoStreamsInFieldSets.inc b/plugins/ShowDemoStreamsInFieldSets.inc index ccc70c56..e06cd50b 100644 --- a/plugins/ShowDemoStreamsInFieldSets.inc +++ b/plugins/ShowDemoStreamsInFieldSets.inc @@ -3,6 +3,7 @@ /* + * @file * Created on 17-Apr-08 * * diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index caea2ca2..7292a926 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/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('

View Document
', 'fedora/repository/' . $this->pid . '/OBJ', array('html' => TRUE)); + $dl_link = l(t('

View Document
'), 'fedora/repository/' . $this->pid . '/OBJ', array('html' => TRUE)); $tabset['first_tab']['tabs']['view'] = array( '#type' => 'tabpage', diff --git a/plugins/fedoraObject.inc b/plugins/fedoraObject.inc index 7290a776..7270b715 100644 --- a/plugins/fedoraObject.inc +++ b/plugins/fedoraObject.inc @@ -1,5 +1,10 @@ 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')) {