Browse Source

Remove MIN from default fileGrps

pull/592/head
Sebastian Meyer 9 months ago
parent
commit
094d9ed1f1
  1. 10
      Classes/Common/IiifManifest.php
  2. 14
      Classes/Common/MetsDocument.php
  3. 2
      Classes/Plugin/PageView.php
  4. 2
      Configuration/Flexforms/Toolbox.xml
  5. 4
      Resources/Private/Language/Labels.xml
  6. 4
      Resources/Private/Language/Toolbox.xml
  7. 4
      ext_conf_template.txt

10
Classes/Common/IiifManifest.php

@ -230,8 +230,8 @@ final class IiifManifest extends Document
if (!$this->useGrpsLoaded) {
// Get configured USE attributes.
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);
if (!empty($extConf['fileGrps'])) {
$this->useGrps['fileGrps'] = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $extConf['fileGrps']);
if (!empty($extConf['fileGrpImages'])) {
$this->useGrps['fileGrpImages'] = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $extConf['fileGrpImages']);
}
if (!empty($extConf['fileGrpThumbs'])) {
$this->useGrps['fileGrpThumbs'] = $extConf['fileGrpThumbs'];
@ -240,7 +240,7 @@ final class IiifManifest extends Document
$this->useGrps['fileGrpDownload'] = $extConf['fileGrpDownload'];
}
if (!empty($extConf['fileGrpFulltext'])) {
$this->useGrps['fileGrpFulltext'] = $extConf['fileGrpFulltext'];
$this->useGrps['fileGrpFulltext'] = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $extConf['fileGrpFulltext']);
}
if (!empty($extConf['fileGrpAudio'])) {
$this->useGrps['fileGrpAudio'] = $extConf['fileGrpAudio'];
@ -272,7 +272,7 @@ final class IiifManifest extends Document
$fileUseDownload = $this->getUseGroups('fileGrpDownload');
$fileUseFulltext = $this->getUseGroups('fileGrpFulltext');
$fileUseThumbs = $this->getUseGroups('fileGrpThumbs');
$fileUses = $this->getUseGroups('fileGrps');
$fileUses = $this->getUseGroups('fileGrpImages');
if (isset($fileUseDownload)) {
$docPdfRendering = $this->iiif->getRenderingUrlsForFormat('application/pdf');
if (!empty($docPdfRendering)) {
@ -514,7 +514,7 @@ final class IiifManifest extends Document
$details['points'] = $startCanvasIndex + 1;
}
}
$useGroups = $this->getUseGroups('fileGrps');
$useGroups = $this->getUseGroups('fileGrpImages');
if (is_string($useGroups)) {
$useGroups = [$useGroups];
}

14
Classes/Common/MetsDocument.php

@ -93,7 +93,7 @@ final class MetsDocument extends Document
protected $fileGrps = [];
/**
* Are the file groups loaded?
* Are the image file groups loaded?
* @see $fileGrps
*
* @var bool
@ -838,18 +838,18 @@ final class MetsDocument extends Document
if (!$this->fileGrpsLoaded) {
// Get configured USE attributes.
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);
$useGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $extConf['fileGrps']);
$useGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $extConf['fileGrpImages']);
if (!empty($extConf['fileGrpThumbs'])) {
$useGrps[] = $extConf['fileGrpThumbs'];
$useGrps = array_merge($useGrps, \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $extConf['fileGrpThumbs']));
}
if (!empty($extConf['fileGrpDownload'])) {
$useGrps[] = $extConf['fileGrpDownload'];
$useGrps = array_merge($useGrps, \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $extConf['fileGrpDownload']));
}
if (!empty($extConf['fileGrpFulltext'])) {
$useGrps[] = $extConf['fileGrpFulltext'];
$useGrps = array_merge($useGrps, \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $extConf['fileGrpFulltext']));
}
if (!empty($extConf['fileGrpAudio'])) {
$useGrps[] = $extConf['fileGrpAudio'];
$useGrps = array_merge($useGrps, \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $extConf['fileGrpAudio']));
}
// Get all file groups.
$fileGrps = $this->mets->xpath('./mets:fileSec/mets:fileGrp');
@ -866,7 +866,7 @@ final class MetsDocument extends Document
// Are there any fulltext files available?
if (
!empty($extConf['fileGrpFulltext'])
&& in_array($extConf['fileGrpFulltext'], $this->fileGrps)
&& array_intersect(\TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $extConf['fileGrpFulltext']), $this->fileGrps) !== []
) {
$this->hasFulltext = true;
}

2
Classes/Plugin/PageView.php

@ -221,7 +221,7 @@ class PageView extends \Kitodo\Dlf\Common\AbstractPlugin
{
$image = [];
// Get @USE value of METS fileGrp.
$fileGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['fileGrps']);
$fileGrps = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->conf['fileGrpImages']);
while ($fileGrp = @array_pop($fileGrps)) {
// Get image link.
if (!empty($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrp])) {

2
Configuration/Flexforms/Toolbox.xml

@ -78,7 +78,7 @@
<type>input</type>
<size>30</size>
<max>30</max>
<default>MIN,DEFAULT,MAX</default>
<default>DEFAULT,MAX</default>
</config>
</TCEforms>
</fileGrpsImageDownload>

4
Resources/Private/Language/Labels.xml

@ -181,11 +181,11 @@
<label index="config.caching">Cache parsed METS files / IIIF manifests: Caching improves performance a little bit but can result in a very large "fe_session_data" table (default is "FALSE")</label>
<label index="config.publishNewCollections">Publish new collections?: Should new collections automatically be published in the OAI-PMH interface? (default is "TRUE")</label>
<label index="config.unhideOnIndex">Unhide indexed documents?: Should hidden documents be unhidden when re-indexing them? (default is "FALSE")</label>
<label index="config.fileGrps">Page fileGrps: comma-separated list of @USE attribute values ordered by increasing size (default is "MIN,DEFAULT,MAX")</label>
<label index="config.fileGrpThumbs">Thumbnail fileGrp: @USE attribute value (default is "THUMBS")</label>
<label index="config.fileGrpDownload">Download fileGrp: @USE attribute value (default is "DOWNLOAD")</label>
<label index="config.fileGrpFulltext">Fulltext fileGrp: @USE attribute value (default is "FULLTEXT")</label>
<label index="config.fileGrpAudio">Audio fileGrp: @USE attribute value (default is "AUDIO")</label>
<label index="config.fileGrpImages">Page fileGrps: comma-separated list of @USE attribute values ordered by increasing size (default is "DEFAULT,MAX")</label>
<label index="config.indexAnnotations">Handle IIIF annotations with motivation "painting" as fulltext?: Handling annotations as fulltexts means they are indexed (default is "FALSE")</label>
<label index="config.iiifThumbnailWidth">Maximum thumbnail width for IIIF images: Only for images without a thumbnail declaration (default is "150")</label>
<label index="config.iiifThumbnailHeight">Maximum thumbnail height for IIIF images: Only for images without a thumbnail declaration (default is "150")</label>
@ -366,11 +366,11 @@
<label index="config.caching">Eingelesene METS Dateien / IIIF-Manifeste zwischenspeichern: Dies kann die Geschwindigkeit geringfügig verbessern, führt aber zu einer sehr großen "fe_session_data" Tabelle (Standard ist "FALSE")</label>
<label index="config.publishNewCollections">Neue Kollektionen publizieren?: Sollen neue Kollektionen automatisch in der OAI-PMH-Schnittstelle veröffentlicht werden? (Standard ist "TRUE")</label>
<label index="config.unhideOnIndex">Indexierte Dokumente einblenden?: Sollen ausgeblendete Dokumente bei der erneuten Indexierung wieder eingeblendet werden? (Standard ist "FALSE")</label>
<label index="config.fileGrps">Seiten fileGrps: Komma-getrennte Liste der @USE Attributwerte der Seitenansichten nach aufsteigender Größe sortiert (Standard ist "MIN,DEFAULT,MAX")</label>
<label index="config.fileGrpThumbs">Vorschau fileGrp: @USE Attributwert der Vorschaubilder (Standard ist "THUMBS")</label>
<label index="config.fileGrpDownload">Download fileGrp: @USE Attributwert der Downloads (Standard ist "DOWNLOAD")</label>
<label index="config.fileGrpFulltext">Volltext fileGrp: @USE Attributwert der Volltexte (Standard ist "FULLTEXT")</label>
<label index="config.fileGrpAudio">Audio fileGrp: @USE Attributwert der Audiodateien (Standard ist "AUDIO")</label>
<label index="config.fileGrpImages">Seiten fileGrps: Komma-getrennte Liste der @USE Attributwerte der Seitenansichten nach aufsteigender Größe sortiert (Standard ist "DEFAULT,MAX")</label>
<label index="config.indexAnnotations">IIIF-Annotationen mit Motivation "painting" als Volltext behandeln?: Als Volltext behandelte Annotationen werden im Suchindex indexiert (Standard ist "FALSE")</label>
<label index="config.iiifThumbnailWidth">Maximale Thumbnail-Breite für IIIF-Images: Gilt nur für Bilder ohne Thumbnail-Angaben (Standard ist "150")</label>
<label index="config.iiifThumbnailHeight">Maximale Thumbnail-Höhe für IIIF-Images: Gilt nur für Bilder ohne Thumbnail-Angaben (Standard ist "150")</label>

4
Resources/Private/Language/Toolbox.xml

@ -20,7 +20,7 @@
<label index="tt_content.pi_flexform.sheet_general">Options</label>
<label index="tt_content.pi_flexform.tools">Tools</label>
<label index="tt_content.pi_flexform.templateFile">Template file</label>
<label index="tt_content.pi_flexform.fileGrps">Page fileGrps used by image download tool: comma-separated list of @USE attribute values ordered by increasing size (default is "MIN,DEFAULT,MAX")</label>
<label index="tt_content.pi_flexform.fileGrps">Page fileGrps used by image download tool: comma-separated list of @USE attribute values ordered by increasing size (default is "DEFAULT,MAX")</label>
</languageKey>
<languageKey index="de" type="array">
<label index="tt_content.plugin.title">Werkzeugkasten</label>
@ -28,7 +28,7 @@
<label index="tt_content.pi_flexform.sheet_general">Einstellungen</label>
<label index="tt_content.pi_flexform.tools">Werkzeuge</label>
<label index="tt_content.pi_flexform.templateFile">HTML-Template</label>
<label index="tt_content.pi_flexform.fileGrp">Seiten fileGrps für das Werkzeug Bild-Download: Komma-getrennte Liste der @USE Attributwerte der Seitenansichten nach aufsteigender Größe sortiert (Standard ist "MIN,DEFAULT,MAX")</label>
<label index="tt_content.pi_flexform.fileGrp">Seiten fileGrps für das Werkzeug Bild-Download: Komma-getrennte Liste der @USE Attributwerte der Seitenansichten nach aufsteigender Größe sortiert (Standard ist "DEFAULT,MAX")</label>
</languageKey>
</data>
</T3locallang>

4
ext_conf_template.txt

@ -12,8 +12,8 @@ caching = 0
publishNewCollections = 1
# cat=Basic; type=boolean; label=LLL:EXT:dlf/Resources/Private/Language/Labels.xml:config.unhideOnIndex
unhideOnIndex = 0
# cat=Files; type=string; label=LLL:EXT:dlf/Resources/Private/Language/Labels.xml:config.fileGrps
fileGrps = MIN,DEFAULT,MAX
# cat=Files; type=string; label=LLL:EXT:dlf/Resources/Private/Language/Labels.xml:config.fileGrpImages
fileGrpImages = DEFAULT,MAX
# cat=Files; type=string; label=LLL:EXT:dlf/Resources/Private/Language/Labels.xml:config.fileGrpThumbs
fileGrpThumbs = THUMBS
# cat=Files; type=string; label=LLL:EXT:dlf/Resources/Private/Language/Labels.xml:config.fileGrpDownload

Loading…
Cancel
Save