Browse Source

Fix for spelling mistakes and coder recommendations.

pull/203/head
Nigel Banks 12 years ago
parent
commit
595cbb43f4
  1. 10
      includes/add_datastream.form.inc
  2. 2
      includes/delete_datastream.form.inc
  3. 2
      includes/delete_object.form.inc
  4. 3
      includes/globals.inc

10
includes/add_datastream.form.inc

@ -70,7 +70,7 @@ function islandora_add_datastream_form(array $form, array &$form_state, FedoraOb
'#required' => TRUE, '#required' => TRUE,
'#title' => t('Upload Document'), '#title' => t('Upload Document'),
'#size' => 48, '#size' => 48,
'#description' => t('Select a file to upload.<br/>Files must be less than <b>!size MB.</b>', array('!size' => $upload_size)), '#description' => t('Select a file to upload.<br/>Files must be less than <b>@size MB.</b>', array('@size' => $upload_size)),
'#default_value' => isset($form_state['values']['files']) ? $form_state['values']['files'] : NULL, '#default_value' => isset($form_state['values']['files']) ? $form_state['values']['files'] : NULL,
'#upload_location' => 'temporary://', '#upload_location' => 'temporary://',
'#upload_validators' => array( '#upload_validators' => array(
@ -98,7 +98,7 @@ function islandora_add_datastream_form(array $form, array &$form_state, FedoraOb
*/ */
function islandora_add_datastream_form_field_is_not_an_existing_datastream_id(array $element, array &$form_state, array $form) { function islandora_add_datastream_form_field_is_not_an_existing_datastream_id(array $element, array &$form_state, array $form) {
if (isset($form_state['object'][$element['#value']])) { if (isset($form_state['object'][$element['#value']])) {
form_error($element, t("!title already exists in the object.", array('!title' => $element['#title']))); form_error($element, t("@title already exists in the object.", array('@title' => $element['#title'])));
} }
} }
@ -114,7 +114,7 @@ function islandora_add_datastream_form_field_is_not_an_existing_datastream_id(ar
*/ */
function islandora_add_datastream_form_field_starts_with_a_letter(array $element, array &$form_state, array $form) { function islandora_add_datastream_form_field_starts_with_a_letter(array $element, array &$form_state, array $form) {
if (!(preg_match("/^[a-zA-Z]/", $element['#value']))) { if (!(preg_match("/^[a-zA-Z]/", $element['#value']))) {
form_error($element, t("!title has to start with a letter.", array('!title' => $element['#title']))); form_error($element, t("@title has to start with a letter.", array('@title' => $element['#title'])));
} }
} }
@ -131,7 +131,7 @@ function islandora_add_datastream_form_field_starts_with_a_letter(array $element
function islandora_add_datastream_form_field_is_valid_dsid(array $element, array &$form_state, array $form) { function islandora_add_datastream_form_field_is_valid_dsid(array $element, array &$form_state, array $form) {
module_load_include('inc', 'islandora', 'includes/utilities'); module_load_include('inc', 'islandora', 'includes/utilities');
if (!islandora_is_valid_dsid($element['#value'])) { if (!islandora_is_valid_dsid($element['#value'])) {
form_error($element, t("!title contains invalid characters.", array('!title' => $element['#title']))); form_error($element, t("@title contains invalid characters.", array('@title' => $element['#title'])));
} }
} }
@ -147,7 +147,7 @@ function islandora_add_datastream_form_field_is_valid_dsid(array $element, array
*/ */
function islandora_add_datastream_form_field_does_not_contain_a_forward_slash(array $element, array &$form_state, array $form) { function islandora_add_datastream_form_field_does_not_contain_a_forward_slash(array $element, array &$form_state, array $form) {
if (strpos($element['#value'], '/') !== FALSE) { if (strpos($element['#value'], '/') !== FALSE) {
form_error($element, t('!title cannot contain a "/" character.', array('!title' => $element['#title']))); form_error($element, t('@title cannot contain a "/" character.', array('@title' => $element['#title'])));
} }
} }

2
includes/delete_datastream.form.inc

@ -36,7 +36,7 @@ function islandora_delete_datastream_form(array $form, array &$form_state, Fedor
* The ISLANDORA_PRE_PURGE_DATASTREAM_HOOK will query other modules as to whether the given FedoraDatastream * The ISLANDORA_PRE_PURGE_DATASTREAM_HOOK will query other modules as to whether the given FedoraDatastream
* should be: blocked from purging; state set to 'Deleted'; or purged. * should be: blocked from purging; state set to 'Deleted'; or purged.
* *
* @see islanodra_delete_datastream(). * @see islandora_delete_datastream().
* *
* @param string $object_id * @param string $object_id
* ID of the object * ID of the object

2
includes/delete_object.form.inc

@ -33,7 +33,7 @@ function islandora_delete_object_form(array $form, array &$form_state, FedoraObj
/** /**
* Gives the option of deleting or purging and object. * Gives the option of deleting or purging and object.
* *
* @note The description below probably applies to islanodra_object_purge() function... * @note The description below probably applies to islandora_object_purge() function...
* *
* The default behaviour is to purge the object to reduce maintenance. * The default behaviour is to purge the object to reduce maintenance.
* If a solution pack wants to change this behaviour and have the object set to deleted then * If a solution pack wants to change this behaviour and have the object set to deleted then

3
includes/globals.inc

@ -43,7 +43,8 @@ function islandora_get_object_by_id($object_id) {
} catch (Exception $e) { } catch (Exception $e) {
if ($e->getCode() == '404') { if ($e->getCode() == '404') {
return FALSE; return FALSE;
} else { }
else {
return NULL; return NULL;
} }
} }

Loading…
Cancel
Save