diff --git a/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php b/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php index c959eec5b6ebd3e2d0daed02702937a51870d0b5..74409d373d8889e426ff64edcd165b13a0f35021 100644 --- a/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php +++ b/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php @@ -197,15 +197,13 @@ class RecordDataFormatterFactory 'Title', 'getTitleDetails' ); - $spec->setTemplateLine( + $spec->setLine( 'Dates of publication', - 'getDateSpan', - 'data-escapeHtml.phtml' + 'getDateSpan' ); - $spec->setTemplateLine( + $spec->setLine( 'Summary', - 'getSummary', - 'data-escapeHtml.phtml' + 'getSummary' ); $spec->setTemplateLine( 'Published', @@ -225,15 +223,13 @@ class RecordDataFormatterFactory ); /* finc: remove 'Online Access' in record-details #13770 - VE */ /* $spec->setTemplateLine('Online Access', true, 'data-onlineAccess.phtml'); */ - $spec->setTemplateLine( + $spec->setLine( 'Item Description', - 'getGeneralNotes', - 'data-escapeHtml.phtml' + 'getGeneralNotes' ); - $spec->setTemplateLine( + $spec->setLine( 'Production Credits', - 'getProductionCredits', - 'data-escapeHtml.phtml' + 'getProductionCredits' ); $spec->setTemplateLine( 'Set Multipart', @@ -250,10 +246,10 @@ class RecordDataFormatterFactory 'getISSNs', 'data-issn.phtml' ); - $spec->setTemplateLine( + $spec->setLine( 'Notes', 'getAdditionalNotes', - 'data-escapeHtml.phtml', + null, [ 'useCache' => true ] @@ -310,15 +306,13 @@ class RecordDataFormatterFactory 'RecordHelper', ['helperMethod' => 'getFormatList'] ); - $spec->setTemplateLine( + $spec->setLine( 'Access', - 'getAccessRestrictions', - 'data-escapeHtml.phtml' + 'getAccessRestrictions' ); - $spec->setTemplateLine( + $spec->setLine( 'Related Items', - 'getRelationshipNotes', - 'data-escapeHtml.phtml' + 'getRelationshipNotes' ); return $spec->getArray(); } @@ -383,7 +377,10 @@ class RecordDataFormatterFactory $spec->setLine( 'Dissertation Note', 'getDissertationNote', - 'data-escapeHtmlCommaSep.phtml' + null, + [ + 'separator' => ', ' + ] ); $spec->setLine( 'Format', @@ -429,20 +426,19 @@ class RecordDataFormatterFactory 'getAdditionals', [$this,'additionals'] ); - $spec->setTemplateLine( + $spec->setLine( 'Source', - 'getMegaCollection', - 'data-escapeHtml.phtml' + 'getMegaCollection' ); $spec->setMultiLine( "Other Relationship Entry", 'getOtherRelationshipEntry', [$this,'otherRelationshipEntry'] ); - $spec->setTemplateLine( + $spec->setLine( 'Notes', 'getAdditionalNotes', - 'data-escapeHtml.phtml', + null, [ 'useCache' => true ] @@ -459,60 +455,49 @@ class RecordDataFormatterFactory public function getDefaultDescriptionSpecs() { $spec = new RecordDataFormatter\SpecBuilder(); - $spec->setTemplateLine( + $spec->setLine( 'Summary', - 'getSummary', - 'data-escapeHtml.phtml' + 'getSummary' ); - $spec->setTemplateLine( + $spec->setLine( 'Dates of publication', - 'getDateSpan', - 'data-escapeHtml.phtml' + 'getDateSpan' ); - $spec->setTemplateLine( + $spec->setLine( 'Item Description', - 'getGeneralNotes', - 'data-escapeHtml.phtml' + 'getGeneralNotes' ); - $spec->setTemplateLine( + $spec->setLine( 'Physical Description', - 'getPhysicalDescriptions', - 'data-escapeHtml.phtml' + 'getPhysicalDescriptions' ); - $spec->setTemplateLine( + $spec->setLine( 'Publication Frequency', - 'getPublicationFrequency', - 'data-escapeHtml.phtml' + 'getPublicationFrequency' ); - $spec->setTemplateLine( + $spec->setLine( 'Playing Time', - 'getPlayingTimes', - 'data-escapeHtml.phtml' + 'getPlayingTimes' ); - $spec->setTemplateLine( + $spec->setLine( 'Format', - 'getSystemDetails', - 'data-escapeHtml.phtml' + 'getSystemDetails' ); - $spec->setTemplateLine( + $spec->setLine( 'Audience', - 'getTargetAudienceNotes', - 'data-escapeHtml.phtml' + 'getTargetAudienceNotes' ); - $spec->setTemplateLine( + $spec->setLine( 'Awards', - 'getAwards', - 'data-escapeHtml.phtml' + 'getAwards' ); - $spec->setTemplateLine( + $spec->setLine( 'Production Credits', - 'getProductionCredits', - 'data-escapeHtml.phtml' + 'getProductionCredits' ); - $spec->setTemplateLine( + $spec->setLine( 'Bibliography', - 'getBibliographyNotes', - 'data-escapeHtml.phtml' + 'getBibliographyNotes' ); $spec->setTemplateLine( 'ISBN', @@ -524,35 +509,29 @@ class RecordDataFormatterFactory 'getISSNs', 'data-issn.phtml' ); - $spec->setTemplateLine( + $spec->setLine( 'DOI', - 'getCleanDOI', - 'data-escapeHtml.phtml' + 'getCleanDOI' ); - $spec->setTemplateLine( + $spec->setLine( 'EISSN', - 'getEISSNs', - 'data-escapeHtml.phtml' + 'getEISSNs' ); - $spec->setTemplateLine( + $spec->setLine( 'Related Items', - 'getRelationshipNotes', - 'data-escapeHtml.phtml' + 'getRelationshipNotes' ); - $spec->setTemplateLine( + $spec->setLine( 'Access', - 'getAccessRestrictions', - 'data-escapeHtml.phtml' + 'getAccessRestrictions' ); - $spec->setTemplateLine( + $spec->setLine( 'Finding Aid', - 'getFindingAids', - 'data-escapeHtml.phtml' + 'getFindingAids' ); - $spec->setTemplateLine( + $spec->setLine( 'Publication_Place', - 'getHierarchicalPlaceNames', - 'data-escapeHtml.phtml' + 'getHierarchicalPlaceNames' ); $spec->setTemplateLine( 'Author Notes', @@ -564,10 +543,10 @@ class RecordDataFormatterFactory 'getLocalSignature', 'data-localSignature.phtml' ); - $spec->setTemplateLine( + $spec->setLine( 'Notes', 'getAdditionalNotes', - 'data-escapeHtml.phtml', + null, [ 'useCache' => true ] @@ -636,86 +615,46 @@ class RecordDataFormatterFactory ], ] ); - $spec->setTemplateLine( + $spec->setLine( 'Subject Detail', - 'getSubjectDetails', - 'data-escapeHtml.phtml', - [ - 'context' => ['class' => 'recordSubjects'] - ] + 'getSubjectDetails' ); - $spec->setTemplateLine( + $spec->setLine( 'Subject Place', - 'getSubjectPlaces', - 'data-escapeHtml.phtml', - [ - 'context' => ['class' => 'recordSubjects'] - ] + 'getSubjectPlaces' ); - $spec->setTemplateLine( + $spec->setLine( 'Subject Date', - 'getSubjectDates', - 'data-escapeHtml.phtml', - [ - 'context' => ['class' => 'recordSubjects'] - ] + 'getSubjectDates' ); - $spec->setTemplateLine( + $spec->setLine( 'Subject Actor', - 'getSubjectActors', - 'data-escapeHtml.phtml', - [ - 'context' => ['class' => 'recordSubjects'] - ] + 'getSubjectActors' ); - $spec->setTemplateLine( + $spec->setLine( 'Institution', - 'getInstitutions', - 'data-institutions.phtml', - [ - 'context' => ['class' => 'recordInstitution'] - ] + 'getInstitutions' ); - $spec->setTemplateLine( + $spec->setLine( 'Inventory ID', - 'getIdentifier', - 'data-escapeHtml.phtml', - [ - 'context' => ['class' => 'recordIdentifier'] - ] + 'getIdentifier' ); - $spec->setTemplateLine( + $spec->setLine( 'Inventory ID', - 'getIdentifier', - 'data-escapeHtml.phtml', - [ - 'context' => ['class' => 'recordIdentifier'] - ] + 'getIdentifier' ); - $spec->setTemplateLine( + $spec->setLine( 'Measurements', - 'getMeasurements', - 'data-escapeHtml.phtml', - [ - 'context' => ['class' => 'recordMeasurements'] - ] + 'getMeasurements' ); - $spec->setTemplateLine( + $spec->setLine( 'Measurements', - 'getMeasurementsDescription', - 'data-escapeHtml.phtml', - [ - 'context' => ['class' => 'recordMeasurements'] - ] + 'getMeasurementsDescription' ); - $spec->setTemplateLine( + $spec->setLine( 'Collection', - 'getCollections', - 'data-escapeHtml.phtml', - [ - 'context' => ['class' => 'recordCollection'] - ] + 'getCollections' ); $spec->setLine( 'Object type', @@ -723,21 +662,13 @@ class RecordDataFormatterFactory 'RecordHelper', ['helperMethod' => 'getFormatList'] ); - $spec->setTemplateLine( + $spec->setLine( 'Other Classification', - 'getFormatClassifications', - 'data-escapeHtml.phtml', - [ - 'context' => ['class' => 'recordClassifications'] - ] + 'getFormatClassifications' ); - $spec->setTemplateLine( + $spec->setLine( 'Other ID', - 'getLocalIdentifiers', - 'data-escapeHtml.phtml', - [ - 'context' => ['class' => 'recordIdentifiers'] - ] + 'getLocalIdentifiers' ); $spec->setMultiLine( 'Events', @@ -750,15 +681,18 @@ class RecordDataFormatterFactory 'getLanguages', 'data-transEscCommaSepLang.phtml' ); - $spec->setTemplateLine( + $spec->setLine( 'Time of origin', 'getDateSpan', - 'data-dateSpan.phtml' + 'recordHelper', + [ + 'helperMethod' => 'mapDateListToRangeView' + ] ); - $spec->setTemplateLine( + $spec->setLine( 'Edition', 'getEdition', - 'data-escapeHtml.phtml', + null, [ 'prefix' => '<span property="bookEdition">', 'suffix' => '</span>' @@ -787,10 +721,13 @@ class RecordDataFormatterFactory public function getLidoDescriptionSpecs() { $spec = new RecordDataFormatter\SpecBuilder(); - $spec->setTemplateLine( + $spec->setLine( 'Time of origin', 'getDateSpan', - 'data-dateSpan.phtml' + 'recordHelper', + [ + 'helperMethod' => 'mapDateListToRangeView' + ] ); $spec->setTemplateLine( 'Access', @@ -858,7 +795,10 @@ class RecordDataFormatterFactory $spec->setLine( 'Dissertation Note', 'getDissertationNote', - 'data-escapeHtmlCommaSep.phtml' + null, + [ + 'separator' => ', ' + ] ); $spec->setLine( 'Format', @@ -919,20 +859,19 @@ class RecordDataFormatterFactory } ] ); - $spec->setTemplateLine( + $spec->setLine( 'Source', - 'getMegaCollection', - 'data-escapeHtml.phtml' + 'getMegaCollection' ); $spec->setMultiLine( "Other Relationship Entry", 'getOtherRelationshipEntry', [$this,'otherRelationshipEntry'] ); - $spec->setTemplateLine( + $spec->setLine( 'Notes', 'getAdditionalNotes', - 'data-escapeHtml.phtml', + null, [ 'useCache' => true ] diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/data-authors.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/data-authors.phtml index 7330dda85d6df9363ac774cb7b8047301bc1cea9..7fd72a9503a1776656d50eee812ec001bfd6620f 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/data-authors.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/data-authors.phtml @@ -53,5 +53,5 @@ $types = [ <?php endforeach; ?> <?php endif; ?> <?php endforeach; ?> -<?=implode(', ', $formattedAuthors)?> +<?=implode($separator ?? ', ', $formattedAuthors)?> <!-- finc: RecordDriver - DefaultRecord - data-authors - END --> diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/data-escapeHtml.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/data-escapeHtml.phtml deleted file mode 100644 index 2cf79df5dbd61162fe388d18b48e9eadfca53621..0000000000000000000000000000000000000000 --- a/themes/finc/templates/RecordDriver/DefaultRecord/data-escapeHtml.phtml +++ /dev/null @@ -1,8 +0,0 @@ -<?php // Don't add START and END comments ?> -<?php if (!empty($data)): ?> - <?php if (is_array($data)): ?> - <?=implode('<br/>', array_map(array($this, 'escapeHtml'), $data))?> - <?php else: ?> - <?=$this->escapeHtml($data)?> - <?php endif; ?> -<?php endif; ?> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/data-escapeHtmlCommaSep.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/data-escapeHtmlCommaSep.phtml deleted file mode 100644 index f1c711c47a800f75d5094f5f1ad8a29b615e8bd3..0000000000000000000000000000000000000000 --- a/themes/finc/templates/RecordDriver/DefaultRecord/data-escapeHtmlCommaSep.phtml +++ /dev/null @@ -1,9 +0,0 @@ -<!-- finc: RecordDriver - DefaultRecord - data-escapeHtmlCommaSep --> -<?php if (!empty($data)): ?> - <?php if (is_array($data)): ?> - <?=implode(', ', array_map(array($this, 'escapeHtml'), $data));?> - <?php else: ?> - <?=$this->escapeHtml($data)?> - <?php endif; ?> -<?php endif; ?> -<!-- finc: RecordDriver - DefaultRecord - data-escapeHtmlCommaSep - END --> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/data-transEsc.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/data-transEsc.phtml deleted file mode 100644 index efe6e050f56ae85d0e8df74a40c27e9d448c5fa1..0000000000000000000000000000000000000000 --- a/themes/finc/templates/RecordDriver/DefaultRecord/data-transEsc.phtml +++ /dev/null @@ -1,8 +0,0 @@ -<?php // Don't add START and END comments ?> -<?php if (!empty($data)): ?> - <?php if (is_array($data)): ?> - <?=implode('<br/>', array_map(array($this, 'transEsc'), $data))?> - <?php else: ?> - <?=$this->transEsc($data)?> - <?php endif; ?> -<?php endif; ?> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/data-transEscCommaSep.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/data-transEscCommaSep.phtml deleted file mode 100644 index 61fd836915c8f4d2070f3e0852caca91fdd9961c..0000000000000000000000000000000000000000 --- a/themes/finc/templates/RecordDriver/DefaultRecord/data-transEscCommaSep.phtml +++ /dev/null @@ -1,7 +0,0 @@ -<?php if (!empty($data)): ?> - <?php if (is_array($data)): ?> - <?=implode(', ', array_map(array($this, 'transEsc'), $data));?> - <?php else: ?> - <?=$this->transEsc($data)?> - <?php endif; ?> -<?php endif; ?> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/SolrLido/data-dateSpan.phtml b/themes/finc/templates/RecordDriver/SolrLido/data-dateSpan.phtml deleted file mode 100644 index 59a1191eb973159ce53acf6468a904e5f4d63b5e..0000000000000000000000000000000000000000 --- a/themes/finc/templates/RecordDriver/SolrLido/data-dateSpan.phtml +++ /dev/null @@ -1 +0,0 @@ -<?= $this->record($this->driver)->mapDateListToRangeView($data); ?> \ No newline at end of file