From 48b5db297719e8d64eeb8acc07963674db036ba4 Mon Sep 17 00:00:00 2001 From: melaniekung Date: Fri, 15 Nov 2024 12:38:16 -0800 Subject: [PATCH] Hide hidden ISAD/RAD/DACs elements for public EAD XMLs. (#1879) --- .../templates/indexSuccessBody.xml.php | 51 +++++++++++-------- .../indexSuccessBodyDidElement.xml.php | 7 ++- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/plugins/sfEadPlugin/modules/sfEadPlugin/templates/indexSuccessBody.xml.php b/plugins/sfEadPlugin/modules/sfEadPlugin/templates/indexSuccessBody.xml.php index 46290c38f7..6f3d423b4f 100644 --- a/plugins/sfEadPlugin/modules/sfEadPlugin/templates/indexSuccessBody.xml.php +++ b/plugins/sfEadPlugin/modules/sfEadPlugin/templates/indexSuccessBody.xml.php @@ -59,7 +59,7 @@ - getPropertyByName('languageOfDescription')->__toString())) { ?> + getPropertyByName('languageOfDescription')->__toString()) && ($sf_user->isAuthenticated() || 1 == sfConfig::get('app_element_visibility_isad_control_languages'))) { ?> @@ -69,17 +69,21 @@ - scriptOfDescription as $code) { ?> - + isAuthenticated() || 1 == sfConfig::get('app_element_visibility_isad_control_scripts')) { ?> + scriptOfDescription as $code) { ?> + + - getRules(['cultureFallback' => true]))) { ?> + + getRules(['cultureFallback' => true])) && ($sf_user->isAuthenticated() || 1 == sfConfig::get($rulesConv))) { ?> getMetadataParameter('descrules'))) { ?>encodinganalog=""> -renderLOD($resource, $eadLevels); ?> relatedencoding="getMetadataParameter('relatedencoding'); ?>"> +getMetadataParameter('relatedencoding'); ?> +renderLOD($resource, $eadLevels); ?> relatedencoding=""> getCreators(); @@ -96,17 +100,21 @@ getPublicationStatus()) { ?>

getPublicationStatus())); ?>

- descriptionDetailId) { ?> + + descriptionDetailId && ($sf_user->isAuthenticated() || 1 == sfConfig::get($levelOfDetail))) { ?>

descriptionDetailId))); ?>

descriptionStatusId) ? QubitTerm::getById($resource->descriptionStatusId) : ''; ?> - + + isAuthenticated() || 1 == sfConfig::get($status))) { ?>

- descriptionIdentifier) { ?> + + descriptionIdentifier && ($sf_user->isAuthenticated() || 1 == sfConfig::get($descId))) { ?>

descriptionIdentifier)); ?>

- institutionResponsibleIdentifier) { ?> + + institutionResponsibleIdentifier && ($sf_user->isAuthenticated() || 1 == sfConfig::get($instId))) { ?>

institutionResponsibleIdentifier)); ?>

@@ -152,7 +160,9 @@ if (0 < count($notes = $resource->getNotesByType(['noteTypeId' => $noteTypeId]))) { foreach ($notes as $note) { ?> - getMetadataParameter($xmlType))) { ?>encodinganalog="">

getContent(['cultureFallback' => true]))); ?>

+ isAuthenticated() || 1 == sfConfig::get('app_element_visibility_rad_conservation_notes'))) && ('conservation' == $xmlType && ($sf_user->isAuthenticated() || 1 == sfConfig::get('app_element_visibility_rad_rights_notes')))) { ?> + getMetadataParameter($xmlType))) { ?>encodinganalog="">

getContent(['cultureFallback' => true]))); ?>

+ - getPhysicalCharacteristics(['cultureFallback' => true]))) { ?> + + getPhysicalCharacteristics(['cultureFallback' => true])) && ($sf_user->isAuthenticated() || 1 == sfConfig::get($physCond))) { ?>

- getAppraisal(['cultureFallback' => true]))) { ?> + getAppraisal(['cultureFallback' => true])) && ($sf_user->isAuthenticated() || 1 == sfConfig::get('app_element_visibility_isad_appraisal_destruction'))) { ?> getMetadataParameter('appraisal'))) { ?>encodinganalog="">

- getAcquisition(['cultureFallback' => true]))) { ?> + getAcquisition(['cultureFallback' => true])) && ($sf_user->isAuthenticated() || 1 == sfConfig::get('app_element_visibility_isad_archival_history'))) { ?>

getAccruals(['cultureFallback' => true]))) { ?>

- getArchivalHistory(['cultureFallback' => true]))) { ?> + getArchivalHistory(['cultureFallback' => true])) && ($sf_user->isAuthenticated() || 1 == sfConfig::get('app_element_visibility_isad_archival_history'))) { ?>

getNotesByType(['noteTypeId' => QubitTerm::ARCHIVIST_NOTE_ID]); ?> getRevisionHistory(['cultureFallback' => true])) || 0 < count($archivistsNotes)) { ?> - + - + isAuthenticated() || 1 == sfConfig::get($datesOfCreation))) { ?>

- + isAuthenticated() || 1 == sfConfig::get('app_element_visibility_isad_control_archivists_notes'))) { ?>

getContent(['cultureFallback' => true]))); ?>

@@ -380,7 +391,7 @@ - getPhysicalCharacteristics(['cultureFallback' => true]))) { ?> + getPhysicalCharacteristics(['cultureFallback' => true])) && ($sf_user->isAuthenticated() || 1 == sfConfig::get('app_element_visibility_rad_physical_condition'))) { ?>

@@ -388,7 +399,7 @@ getMetadataParameter('appraisal'))) { ?>encodinganalog="">

- getAcquisition(['cultureFallback' => true]))) { ?> + getAcquisition(['cultureFallback' => true])) && ($sf_user->isAuthenticated() || 1 == sfConfig::get('app_element_visibility_rad_immediate_source'))) { ?>

@@ -396,7 +407,7 @@

- getArchivalHistory(['cultureFallback' => true]))) { ?> + getArchivalHistory(['cultureFallback' => true])) && ($sf_user->isAuthenticated() || 1 == sfConfig::get('app_element_visibility_rad_archival_history'))) { ?>

diff --git a/plugins/sfEadPlugin/modules/sfEadPlugin/templates/indexSuccessBodyDidElement.xml.php b/plugins/sfEadPlugin/modules/sfEadPlugin/templates/indexSuccessBodyDidElement.xml.php index de77bdacd7..afea517272 100644 --- a/plugins/sfEadPlugin/modules/sfEadPlugin/templates/indexSuccessBodyDidElement.xml.php +++ b/plugins/sfEadPlugin/modules/sfEadPlugin/templates/indexSuccessBodyDidElement.xml.php @@ -137,11 +137,14 @@ - sources) { ?> + getMetadataParameter('relatedencoding'); ?> + + sources && ($sf_user->isAuthenticated() || 1 == sfConfig::get($controlSources))) { ?>

sources)); ?>

- getNotesByType(['noteTypeId' => QubitTerm::GENERAL_NOTE_ID]))) { ?> + + getNotesByType(['noteTypeId' => QubitTerm::GENERAL_NOTE_ID])) && ($sf_user->isAuthenticated() || 1 == sfConfig::get($generalNotes))) { ?> getMetadataParameter('generalNote'))) { ?>encodinganalog="">

getContent(['cultureFallback' => true]))); ?>