diff --git a/fedora_repository.module b/fedora_repository.module index 600e3bcb..05631b91 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -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); @@ -1554,14 +1571,14 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $collectioncm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); $collectioncm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/COLLECTIONCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); } catch (exception $e) { - + } try { $strictpdfcm = Fedora_Item::ingest_new_item('islandora:strict_pdf', 'A', 'Strict PDF Content Model'); $strictpdfcm->add_relationship('hasModel', 'fedora-system:ContentModel-3.0', FEDORA_MODEL_URI); $strictpdfcm->add_datastream_from_file(drupal_get_path('module', 'fedora_repository') . '/content_models/STRICT_PDFCM.xml', 'ISLANDORACM', 'Islandora Content Model.xml', 'application/xml', 'X'); } catch (exception $e) { - + } // Install a collection object that points to all content model objects @@ -1585,7 +1602,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $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.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { - + } } @@ -1597,7 +1614,7 @@ function fedora_repository_demo_objects_form_submit($form, &$form_state) { $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.", array('@base_url' => check_plain($base_url))), 'message'); } catch (exception $e) { - + } } @@ -1912,7 +1929,7 @@ function theme_fedora_repository_basket_form($form) { * @param type $form_state */ function fedora_repository_basket_form_validate($form, &$form_state) { - + } /** diff --git a/plugins/FedoraObjectDetailedContent.inc b/plugins/FedoraObjectDetailedContent.inc index 0eef0f75..55a3d31c 100644 --- a/plugins/FedoraObjectDetailedContent.inc +++ b/plugins/FedoraObjectDetailedContent.inc @@ -1,7 +1,5 @@ item->objectProfile->objLabel); $objectHelper = new ObjectHelper(); $tabset = array(); $show_purge_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_purge_object_form'); $show_edit_tab = (!empty($_POST['form_id']) && $_POST['form_id'] == 'fedora_repository_edit_qdc_form'); $purge_form = drupal_get_form('fedora_repository_purge_object_form', $this->pid, check_plain(substr(request_uri(), strlen(base_path())))); - $details_selected = ($show_purge_tab ||$show_edit_tab); + $details_selected = ($show_purge_tab || $show_edit_tab); $tabset['fedora_object_details'] = array( '#type' => 'tabpage', '#title' => t('Object Details'), diff --git a/xsl/sparql_to_html.xsl b/xsl/sparql_to_html.xsl index 1b042273..a4a4f934 100644 --- a/xsl/sparql_to_html.xsl +++ b/xsl/sparql_to_html.xsl @@ -8,7 +8,7 @@ - + @@ -72,23 +72,23 @@ + + + + + +/fedora/repository//TN + + + +/fedora/repository//-/ + + + + + +- +-->
@@ -160,7 +160,7 @@ - +
@@ -171,8 +171,8 @@ /fedora/repository//-/ - + /fedora/repository//-/ @@ -185,24 +185,24 @@ /fedora/repository//TN - + -
+
- + +
[[ + +/fedora/repository//-/ + +DETAILS + ]] +
--> + @@ -245,3 +245,4 @@ +