Browse Source

Actually use the fieldset that's defined.

pull/377/head
Jordan Dukart 12 years ago
parent
commit
1fa7d0790f
  1. 72
      includes/add_datastream.form.inc

72
includes/add_datastream.form.inc

@ -40,44 +40,44 @@ function islandora_add_datastream_form(array $form, array &$form_state, Abstract
'dsid' => array( 'dsid' => array(
'#title' => 'Datastream ID', '#title' => 'Datastream ID',
'#description' => t("An ID for this stream that is unique to this object. Must start with a letter and contain only alphanumeric characters, dashes and underscores. The following datastreams are defined by this content model but don't currently exist: <b>@unused_dsids</b>.", array('@unused_dsids' => $unused_datastreams)), '#description' => t("An ID for this stream that is unique to this object. Must start with a letter and contain only alphanumeric characters, dashes and underscores. The following datastreams are defined by this content model but don't currently exist: <b>@unused_dsids</b>.", array('@unused_dsids' => $unused_datastreams)),
'#type' => 'textfield',
'#size' => 64,
'#maxlength' => 64,
'#required' => TRUE,
'#element_validate' => array(
'islandora_add_datastream_form_field_is_not_an_existing_datastream_id',
'islandora_add_datastream_form_field_starts_with_a_letter',
'islandora_add_datastream_form_field_is_valid_dsid',
),
'#autocomplete_path' => "islandora/object/{$object->id}/manage/datastreams/add/autocomplete",
), ),
'#type' => 'textfield', 'label' => array(
'#size' => 64, '#title' => 'Datastream Label',
'#maxlength' => 64, '#required' => TRUE,
'#required' => TRUE, '#size' => 64,
'#element_validate' => array( '#maxlength' => 64,
'islandora_add_datastream_form_field_is_not_an_existing_datastream_id', '#description' => t('A human-readable label'),
'islandora_add_datastream_form_field_starts_with_a_letter', '#type' => 'textfield',
'islandora_add_datastream_form_field_is_valid_dsid', '#element_validate' => array('islandora_add_datastream_form_field_does_not_contain_a_forward_slash'),
), ),
'#autocomplete_path' => "islandora/object/{$object->id}/manage/datastreams/add/autocomplete", 'file' => array(
), '#type' => 'managed_file',
'label' => array( '#required' => TRUE,
'#title' => 'Datastream Label', '#title' => t('Upload Document'),
'#required' => TRUE, '#size' => 48,
'#size' => 64, '#description' => t('Select a file to upload.<br/>Files must be less than <b>@size MB.</b>', array('@size' => $upload_size)),
'#maxlength' => 64, '#default_value' => isset($form_state['values']['files']) ? $form_state['values']['files'] : NULL,
'#description' => t('A human-readable label'), '#upload_location' => 'temporary://',
'#type' => 'textfield', '#upload_validators' => array(
'#element_validate' => array('islandora_add_datastream_form_field_does_not_contain_a_forward_slash'), 'file_validate_extensions' => array(NULL),
), // Assume its specified in MB.
'file' => array( 'file_validate_size' => array($upload_size * 1024 * 1024),
'#type' => 'managed_file', ),
'#required' => TRUE, ),
'#title' => t('Upload Document'), 'submit' => array(
'#size' => 48, '#type' => 'submit',
'#description' => t('Select a file to upload.<br/>Files must be less than <b>@size MB.</b>', array('@size' => $upload_size)), '#value' => t('Add Datastream'),
'#default_value' => isset($form_state['values']['files']) ? $form_state['values']['files'] : NULL,
'#upload_location' => 'temporary://',
'#upload_validators' => array(
'file_validate_extensions' => array(NULL),
// Assume its specified in MB.
'file_validate_size' => array($upload_size * 1024 * 1024),
), ),
),
'submit' => array(
'#type' => 'submit',
'#value' => t('Add Datastream'),
), ),
); );
} }
@ -148,7 +148,7 @@ function islandora_add_datastream_form_field_does_not_contain_a_forward_slash(ar
} }
/** /**
* Checks if the given datastream requires the upload to be a certian MIME type. * Checks if the given datastream requires the upload to be a certain MIME type.
* *
* @param array $form * @param array $form
* The Drupal form. * The Drupal form.

Loading…
Cancel
Save