|
|
|
@ -455,9 +455,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); |
|
|
|
@ -496,6 +496,23 @@ function fedora_repository_purge_stream($pid = NULL, $dsId = NULL, $name = NULL)
|
|
|
|
|
return $output; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function fedora_repository_purge_object_form_validate($form, &$form_state) { |
|
|
|
|
module_load_include('inc', 'fedora_repository', 'api/fedora_collection'); |
|
|
|
|
$pid = $form_state['values']['pid']; |
|
|
|
|
|
|
|
|
|
$objectHelper = new ObjectHelper(); |
|
|
|
|
$contentModels = $objectHelper->get_content_models_list($pid); |
|
|
|
|
foreach ($contentModels as $contentModel) { |
|
|
|
|
if ($contentModel->pid == 'islandora:collectionCModel') { |
|
|
|
|
$member_pids = get_related_items_as_array($pid, 'isMemberOfCollection'); |
|
|
|
|
if (is_array($member_pids)){ |
|
|
|
|
form_set_error('new_collection_pid', t("Please purge all members of this collection before deleting the collection itself.")); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* fedora repository purge object form submit |
|
|
|
|
* @param type $form |
|
|
|
@ -667,7 +684,7 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) {
|
|
|
|
|
$pid = $form_state['values']['pid']; |
|
|
|
|
$dsid = $form_state['values']['dsId']; |
|
|
|
|
$dsLabel = $form_state['values']['dsLabel']; |
|
|
|
|
// Remove the original file extension from the label and add the new one |
|
|
|
|
// Remove the original file extension from the label and add the new one |
|
|
|
|
$indexOfDot = strrpos($dsLabel, '.'); //use strrpos to get the last dot |
|
|
|
|
if ($indexOfDot !== FALSE) { |
|
|
|
|
$dsLabel = substr($dsLabel, 0, $indexOfDot); |
|
|
|
|