diff --git a/BatchIngest.inc b/BatchIngest.inc index 621a674a..c78be313 100644 --- a/BatchIngest.inc +++ b/BatchIngest.inc @@ -65,22 +65,22 @@ function batch_creation_form(&$form_state, $collection_pid, $content_models) { */ function batch_creation_form_validate($form, &$form_state) { - $fieldName = 'file-location'; - if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name'][$fieldName])) { - $file = file_save_upload($fieldName); + $field_name = 'file-location'; + if (isset($_FILES['files']) && is_uploaded_file($_FILES['files']['tmp_name'][$field_name])) { + $file = file_save_upload($field_name); if ($file->filemime != 'application/zip') { - form_set_error($fieldName, 'Input file must be a .zip file'); + form_set_error($field_name, 'Input file must be a .zip file'); return; } if (!$file) { - form_set_error($fieldName, 'Error uploading file.'); + form_set_error($field_name, 'Error uploading file.'); return; } $form_state['values']['file'] = $file; } else { // set error - form_set_error($fieldName, 'Error uploading file.'); + form_set_error($field_name, 'Error uploading file.'); return; } } @@ -100,27 +100,27 @@ function batch_creation_form_submit($form, &$form_state) { } $namespace = $namespace_mappings[$content_model]; $namespace = preg_replace('/:.*/', '', $namespace); - $dirName = "temp" . $user->uid; - $tmpDir = file_directory_path() . '/' . $dirName . '/'; - mkdir($tmpDir); + $dir_name = "temp" . $user->uid; + $tmp_dir = file_directory_path() . '/' . $dir_name . '/'; + mkdir($tmp_dir); $file = $form_state['values']['file']; $fileName = $file->filepath; $file_list = array(); - $cmdString = "unzip -q -o -d $tmpDir \"$fileName\""; + $cmdString = "unzip -q -o -d $tmp_dir \"$fileName\""; system($cmdString, $retVal); $dirs = array(); - $doNotAdd = array('.', '..', '__MACOSX'); - array_push($dirs, $tmpDir); - $files = scandir($tmpDir); + $do_not_add = array('.', '..', '__MACOSX'); + array_push($dirs, $tmp_dir); + $files = scandir($tmp_dir); foreach ($files as $file) { - if (is_dir("$tmpDir/$file") & !in_array($file, $doNotAdd)) { - array_push($dirs, $tmpDir . $file); + if (is_dir("$tmp_dir/$file") & !in_array($file, $do_not_add)) { + array_push($dirs, $tmp_dir . $file); } } foreach ($dirs as $directory) { if ($inputs = opendir($directory)) { while (FALSE !== ($file_name = readdir($inputs))) { - if (!in_array($file_name, $doNotAdd) && is_dir($file_name) == FALSE) { + if (!in_array($file_name, $do_not_add) && is_dir($file_name) == FALSE) { $ext = strrchr($file_name, '.'); $base = preg_replace("/$ext$/", '', $file_name); $ext = substr($ext, 1); @@ -148,7 +148,7 @@ function batch_creation_form_submit($form, &$form_state) { foreach ($file_list as $label => $object_files) { $batch['operations'][] = array('create_batch_objects', array($label, $content_model, $object_files, $collection_pid, $namespace, $metadata)); } - $batch['operations'][] = array('recursive_directory_delete', array($tmpDir)); + $batch['operations'][] = array('recursive_directory_delete', array($tmp_dir)); batch_set($batch); batch_process(); } @@ -168,7 +168,7 @@ function create_batch_objects($label, $content_model, $object_files, $collection module_load_include('inc', 'fedora_reppository', 'api/fedora_item'); $cm = ContentModel::loadFromModel($content_model, 'ISLANDORACM'); - $allowedMimeTypes = $cm->getMimetypes(); + $allowed_mime_types = $cm->getMimetypes(); $mime_helper = new MimeClass(); $pid = fedora_item::get_next_PID_in_namespace($namespace); @@ -193,7 +193,7 @@ function create_batch_objects($label, $content_model, $object_files, $collection $use_primary = TRUE; foreach ($object_files as $ext => $filename) { $file_mimetype = $mime_helper->get_mimetype($filename); - if (in_array($file_mimetype, $allowedMimeTypes)) { + if (in_array($file_mimetype, $allowed_mime_types)) { $added = $cm->execIngestRules($filename, $file_mimetype); } else { @@ -229,7 +229,7 @@ function batch_create_dc_from_mods($mods_xml) { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return " "; } diff --git a/CollectionClass.inc b/CollectionClass.inc index ae68e2de..82e4739e 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -131,7 +131,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting relationship element from policy stream !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error getting relationship element from policy stream @e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } $relationship = $xml->relationship[0]; @@ -172,7 +172,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting PID namespace !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error getting PID namespace @e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } foreach ($xml->contentmodels->contentmodel as $contentModel) { @@ -199,7 +199,7 @@ class CollectionClass { $xml = new SimpleXMLElement($collection_stream); } catch (Exception $e) { if ($showError) { - drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); } return NULL; } @@ -239,7 +239,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error Getting FormHandler: !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error Getting FormHandler: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return NULL; } $formHandler = $xml->ingest_form; @@ -272,7 +272,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting content model stream for mime types !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error getting content model stream for mime types @e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } foreach ($xml->mimetypes->type as $type) { @@ -302,7 +302,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting content model stream !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error getting content model stream @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } foreach ($xml->ingest_rules->rule as $rule) { @@ -365,7 +365,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting ingest form stream !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error getting ingest form stream @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $docRoot = $_SERVER['DOCUMENT_ROOT']; @@ -451,7 +451,7 @@ class CollectionClass { $params )); } catch (exception $e) { - drupal_set_message(t('Error getting Next PID: !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error getting Next PID: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $pid = implode(get_object_vars($object)); @@ -663,7 +663,7 @@ class CollectionClass { throw new Exception("Invalid XML."); } } catch (Exception $e) { - drupal_set_message(t('!e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return ''; } } diff --git a/ConnectionHelper.inc b/ConnectionHelper.inc index 8225f0fc..59f811e2 100644 --- a/ConnectionHelper.inc +++ b/ConnectionHelper.inc @@ -1,6 +1,6 @@ $exceptions, )); } catch (SoapFault $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage()))); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage())))); return NULL; } } @@ -83,7 +83,7 @@ class ConnectionHelper { 'exceptions' => TRUE, )); } catch (SoapFault $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage()))); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage())))); return NULL; } } diff --git a/MimeClass.inc b/MimeClass.inc index 119a8f97..42c11e37 100644 --- a/MimeClass.inc +++ b/MimeClass.inc @@ -1,6 +1,6 @@ loadXML(trim($xmlstr)); } catch (exception $e) { - watchdog(t("Fedora_Repository"), "Problem loading XSL file: !e", array('!e' => $e), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "Problem loading XSL file: @e", array('@e' => $e), NULL, WATCHDOG_ERROR); } $xsl = $proc->importStylesheet($xsl); $newdom = $proc->transformToDoc($input); @@ -750,7 +750,7 @@ class ObjectHelper { try { $parent_collections = new SimpleXMLElement($parent_collections); } catch (exception $e) { - drupal_set_message(t('Error getting parent objects !e', array('!e' => $e->getMessage()))); + drupal_set_message(t('Error getting parent objects @e', array('@e' => check_plain($e->getMessage())))); return; } diff --git a/SearchClass.inc b/SearchClass.inc index 3f1c78d5..751dbbfa 100644 --- a/SearchClass.inc +++ b/SearchClass.inc @@ -1,6 +1,6 @@ $function_name, '!e' => $e), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), "Error Trying to call SOAP function @fn: @e", array('@fn' => $function_name, '@e' => $e), NULL, WATCHDOG_ERROR); } return NULL; } @@ -904,7 +904,7 @@ class Fedora_Item { } catch (exception $e) { if (!$quiet) { - watchdog(t("FEDORA_REPOSITORY"), "Error trying to call SOAP function !fn: !e", array('!fn' => $function_name, '!e' => $e), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), "Error trying to call SOAP function @fn: @e", array('@fn' => $function_name, '@e' => $e), NULL, WATCHDOG_ERROR); } return NULL; } diff --git a/api/fedora_utils.inc b/api/fedora_utils.inc index 917030ee..c154dbc4 100644 --- a/api/fedora_utils.inc +++ b/api/fedora_utils.inc @@ -1,6 +1,6 @@ item->modify_datastream_by_value($tagdoc->saveXML(), $this->tagsDSID, 'Tags', 'text/xml', 'X'); } } catch (exception $e) { - drupal_set_message(t('There was an error saving the tags datastream: !e'), array('!e' => $e), 'error'); + drupal_set_message(t('There was an error saving the tags datastream: @e'), array('@e' => $e), 'error'); return FALSE; } return TRUE; diff --git a/fedora_repository.module b/fedora_repository.module index e2153355..56859edb 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -54,10 +54,9 @@ function fedora_repository_purge_object($pid = NULL, $name = NULL) { drupal_set_message(t('You must specify an object pid to purge an object.'), 'error'); return ''; } - $output = t('Are you sure you wish to purge object %name %pid!
This cannot be undone
', - array( - '%name' => $name, - '%pid' => $pid) + $output = t('Are you sure you wish to purge object %name %pid!
This cannot be undone
', array( + '%name' => $name, + '%pid' => $pid) ); $output .= drupal_get_form('fedora_repository_purge_object_form', $pid); @@ -115,7 +114,7 @@ function fedora_repository_ingest_object($collection_pid=NULL, $collection_label $collection_pid = urldecode($collection_pid); } else { - drupal_set_message(t("This collection PID $collection_pid is not valid"), 'error'); + drupal_set_message(t("This collection PID @collection_pid is not valid", check_plain($collection_pid)), 'error'); return ' '; } } @@ -150,7 +149,7 @@ function fedora_repository_ingest_form_submit(array $form, array &$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; module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionPolicy'); @@ -240,14 +239,14 @@ function fedora_repository_ingest_form_validate($form, &$form_state) { if (!empty($file)) { 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 ' . - implode(' ', $allowedMimeTypes))); + implode(' ', $allowedMimeTypes))); file_delete($file); return; } elseif (!$cm->execIngestRules($file, $dformat)) { drupal_set_message(t('Error following Content Model Rules'), 'error'); 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); } catch (exception $e) { - drupal_set_message(t($e->getMessage()), 'error'); + drupal_set_message(t('@message', array('@message' => check_plain($e->getMessage()))), 'error'); return; } $form_state['rebuild'] = TRUE; @@ -436,7 +435,7 @@ function add_stream_form_validate($form, &$form_state) { return FALSE; } if (!(preg_match("/^[a-zA-Z]/", $dsid))) { - form_set_error('', t("Data stream ID ($dsid) has to start with a letter.")); + form_set_error('', t("Data stream ID (@dsid) has to start with a letter.", array( '@dsid' => check_plain($dsid)))); return FALSE; } if (strlen($dsLabel) > 64) { @@ -448,9 +447,9 @@ function add_stream_form_validate($form, &$form_state) { return FALSE; } $validators = array( - // 'file_validate_is_image' => array(), - // 'file_validate_image_resolution' => array('85x85'), - // 'file_validate_size' => array(30 * 1024), + // 'file_validate_is_image' => array(), + // 'file_validate_image_resolution' => array('85x85'), + // 'file_validate_size' => array(30 * 1024), ); $fileObject = file_save_upload('add-stream-file-location', $validators); @@ -482,9 +481,8 @@ function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL) return ' '; } - $output = t('Are you sure you wish to purge this datastream %name
', - array( - '%name' => $name) + $output = t('Are you sure you wish to purge this datastream %name
', array( + '%name' => $name) ); $output .= drupal_get_form('fedora_repository_purge_stream_form', $pid, $dsId); return $output; @@ -520,7 +518,7 @@ function fedora_repository_purge_object_form_submit($form, &$form_state) { drupal_set_message(t('Error: Insufficient permissions to purge object.'), 'error'); } else { - drupal_set_message(t($e->getMessage()), 'error'); + drupal_set_message(t('@message', array('@message' => check_plain($e->getMessage()))), 'error'); } return; } @@ -578,7 +576,7 @@ function fedora_repository_purge_stream_form_submit($form, &$form_state) { try { $item->purge_datastream($dsid); } catch (exception $e) { - drupal_set_message(t($e->getMessage()), 'error'); + drupal_set_message(t('@message', array('@message' => check_plain($e->getMessage()))), 'error'); } $form_state['redirect'] = $base_url . "/fedora/repository/$pid"; } @@ -909,12 +907,12 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU drupal_set_message(t('The Fedora repository server is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); return ''; } - + if (!risearch_available()) { drupal_set_message(t('The Fedora resource index search is currently unavailable. Please contact the site administrator.'), 'warning', FALSE); return ''; } - + if ($pid == NULL) { $pid = variable_get('fedora_repository_pid', 'islandora:root'); } @@ -936,7 +934,7 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU } if (!fedora_repository_access(OBJECTHELPER::$OBJECT_HELPER_VIEW_FEDORA, $pid, $user)) { if (user_access('access administration pages')) { - drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'warning'); + drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed @here", array('@here' => l('here', 'admin/settings/fedora_repository'))), 'warning'); } drupal_access_denied(); exit; @@ -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. $obj = new FedoraObjectDetailedContent($pid); $object_details = $obj->showFieldSets(); - if ($object_details['fedora_object_details']['#selected'] == TRUE){ - foreach($cmodels_tabs as $cmodel_tab){ - if (is_array($cmodel_tab)){ + if ($object_details['fedora_object_details']['#selected'] == TRUE) { + foreach ($cmodels_tabs as $cmodel_tab) { + if (is_array($cmodel_tab)) { $cmodel_tab['#selected'] = FALSE; } - } } $cmodels_tabs = array_merge($cmodels_tabs, $object_details); @@ -1068,7 +1065,7 @@ function repository_service($pid = NULL, $servicePid = NULL, $serviceMethod = NU //drupal_set_message(t("You do not have access to Fedora objects within the attempted namespace or access to Fedora denied"), 'error'); drupal_access_denied(); if (user_access('access administration pages')) { - drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed !here", array('!here' => l('here', 'admin/settings/fedora_repository'))), 'error'); + drupal_set_message(t("PIDs may be added to allowed namespaces, or all namespace restrictions removed @here", array('@here' => l('here', 'admin/settings/fedora_repository'))), 'error'); } return ' '; } @@ -1468,10 +1465,10 @@ function fedora_repository_demo_objects_form() { ); foreach (array( - 'islandora:collectionCModel' => 'Islandora default content models', - 'islandora:root' => 'Islandora top-level collection', - 'islandora:demos' => 'Islandora demos collection', - 'islandora:largeimages' => 'Sample large image content model (requires Djatoka and Kakadu.)', +'islandora:collectionCModel' => 'Islandora default content models', + 'islandora:root' => 'Islandora top-level collection', + 'islandora:demos' => 'Islandora demos collection', + 'islandora:largeimages' => 'Sample large image content model (requires Djatoka and Kakadu.)', ) as $available_demo => $available_demo_desc) { try { @@ -1580,7 +1577,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(t("Successfully installed islandora:ContentModelCollection."), 'message'); + drupal_set_message(t("Successfully installed islandora:ContentModelCollection.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { } @@ -1592,7 +1589,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(t("Successfully installed islandora:root."), 'message'); + drupal_set_message(t("Successfully installed islandora:root.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { } @@ -1612,7 +1609,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(t("Successfully installed islandora:demos."), 'message'); + drupal_set_message(t("Successfully installed islandora:demos.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { } @@ -1634,7 +1631,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(t("Successfully installed demo:SmileyStuff collection view."), 'message'); + drupal_set_message(t("Successfully installed demo:SmileyStuff collection view.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { } @@ -1643,7 +1640,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { if (!empty($form_state['values']['demo_collections']['islandora:largeimages'])) { $error = ''; foreach (array('islandora_jp2Sdep-slideCModel.xml', 'islandora_mods2htmlSdef.xml', 'islandora_mods2htmlSdep.xml', - 'islandora_slideCModel.xml', 'islandora_viewerSdep-slideCModel.xml', 'ilives_jp2Sdef.xml', 'ilives_viewerSdef.xml') as $foxml_file) { + 'islandora_slideCModel.xml', 'islandora_viewerSdep-slideCModel.xml', 'ilives_jp2Sdef.xml', 'ilives_viewerSdef.xml') as $foxml_file) { try { $item = Fedora_Item::ingest_from_FOXML_file(drupal_get_path('module', 'fedora_repository') . '/content_models/' . $foxml_file); } catch (exception $e) { @@ -1653,14 +1650,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(t("Successfully installed islandora:largeimages."), 'message'); + drupal_set_message(t("Successfully installed islandora:largeimages.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { $error .= " - Problem ingesting islandora:largeimages collection"; } } if (!empty($error)) { - drupal_set_message(t('Some problems occurred: ' . $error)); + drupal_set_message(t('Some problems occurred: @error', array('@error' => $error))); } } } @@ -1685,7 +1682,6 @@ function fedora_repository_required_fedora_objects() { 'dsversion' => 2, 'cmodel' => 'fedora-system:ContentModel-3.0', ), - array( 'pid' => 'islandora:root', 'label' => 'Islandora Top-level Collection', @@ -1701,7 +1697,7 @@ function fedora_repository_required_fedora_objects() { 'mimetype' => 'image/png', ), ), - ), + ), ), ), ); @@ -1956,7 +1952,7 @@ function fedora_repository_basket_form_submit($form, &$form_state) { $foxml_dir = $export_dir . '/foxml'; if (!file_exists($foxml_dir) && !@mkdir($foxml_dir, 0775, TRUE)) { - drupal_set_message(t("Failed to create foxml dir %dir. Check that export dir exsits and has correct permissions", array('%dir' => $foxml_dir)), 'error'); + drupal_set_message(t("Failed to create foxml dir @dir. Check that export dir exsits and has correct permissions", array('@dir' => $foxml_dir)), 'error'); return FALSE; } @@ -1965,7 +1961,7 @@ function fedora_repository_basket_form_submit($form, &$form_state) { $objects_dir = $export_dir . '/objects/' . $pid; if (!file_exists($objects_dir) && !@mkdir($objects_dir, 0775, TRUE)) { - drupal_set_message(t("Failed to create objects dir %dir. Check that export dir exsits and has correct permissions", array('%dir' => $objects_dir)), 'error'); + drupal_set_message(t("Failed to create objects dir @dir. Check that export dir exsits and has correct permissions", array('@dir' => $objects_dir)), 'error'); return FALSE; } @@ -2085,9 +2081,7 @@ function theme_add_to_basket_link($pid, $type = 'object') { */ if (!_is_added_to_basket($pid)) { 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))), - "fedora/repository/addToBasket/" . $path, - array('html' => TRUE) + 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) ); } diff --git a/formClass.inc b/formClass.inc index cfc240b6..be5ef9d2 100644 --- a/formClass.inc +++ b/formClass.inc @@ -1,6 +1,6 @@ $e->getMessage())), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return " "; } diff --git a/plugins/DemoFormBuilder.inc b/plugins/DemoFormBuilder.inc index ccc74ba2..05a9304f 100644 --- a/plugins/DemoFormBuilder.inc +++ b/plugins/DemoFormBuilder.inc @@ -1,6 +1,6 @@ appendChild($previousElement); } } catch (exception $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); continue; } } @@ -126,7 +126,7 @@ class FormBuilder { unlink($form_values['fullpath']); } } catch (exception $e) { - drupal_set_message(t('Error ingesting object: !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Error ingesting object: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } } diff --git a/plugins/FlvFormBuilder.inc b/plugins/FlvFormBuilder.inc index c259328c..8c2b5777 100644 --- a/plugins/FlvFormBuilder.inc +++ b/plugins/FlvFormBuilder.inc @@ -1,6 +1,6 @@ appendChild($previousElement); } } catch (exception $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); continue; } } @@ -96,7 +96,7 @@ class FormBuilder { $xml = new SimpleXMLElement($policyStreamDoc); } catch (Exception $e) { watchdog(t("Fedora_Repository"), t("Problem getting security policy."), NULL, WATCHDOG_ERROR); - drupal_set_message(t('Problem getting security policy: !e', array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('Problem getting security policy: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $policyElement = $dom->createDocumentFragment(); @@ -182,8 +182,8 @@ 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"), "Error ingesting object: !e", array('!e' => $e->getMessage()), NULL, WATCHDOG_ERROR); + drupal_set_message(t('Error ingesting object: @e', array('@e' => check_plain($e->getMessage()))), 'error'); + watchdog(t("Fedora_Repository"), "Error ingesting object: @e", array('@e' => check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); return; } } diff --git a/plugins/ImageManipulation.inc b/plugins/ImageManipulation.inc index 8f97ab94..4faabdd8 100644 --- a/plugins/ImageManipulation.inc +++ b/plugins/ImageManipulation.inc @@ -1,6 +1,6 @@ $e->getMessage())), 'error'); - watchdog(t("Fedora_Repository"), "Error ingesting object: !e", array('!e' => $e->getMessage()), NULL, WATCHDOG_ERROR); + drupal_set_message(t('Error ingesting object: @e', array('@e' => check_plain($e->getMessage()))), 'error'); + watchdog(t("Fedora_Repository"), "Error ingesting object: @e", array('@e' => check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); return; } } diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index 68ae5528..29c76cfa 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -1,6 +1,6 @@ $e->getMessage())), 'error'); + drupal_set_message(t('Error ingesting personal collection object: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } return TRUE; @@ -76,7 +76,7 @@ class PersonalCollectionClass { $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); - drupal_set_message(t('Problem creating personal collection policy, could not parse collection policy stream: !e', array('!e' => $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; } $policyElement = $dom->createDocumentFragment(); diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index 592a7e99..5e39b3c2 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -1,6 +1,6 @@ $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( @@ -305,7 +305,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"), t("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 b648df53..80f8017c 100644 --- a/plugins/ShowDemoStreamsInFieldSets.inc +++ b/plugins/ShowDemoStreamsInFieldSets.inc @@ -1,6 +1,6 @@ $e->getMessage())), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return " "; } $xsl = new DomDocument(); @@ -237,7 +237,7 @@ class ShowStreamsInFieldSets { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => $e->getMessage())), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } $xsl = new DomDocument(); diff --git a/plugins/map_viewer.inc b/plugins/map_viewer.inc index 3e9bcfb6..f3bfca80 100644 --- a/plugins/map_viewer.inc +++ b/plugins/map_viewer.inc @@ -1,6 +1,6 @@