diff --git a/dlf/common/class.tx_dlf_document.php b/dlf/common/class.tx_dlf_document.php
index 49933df9..57616f36 100644
--- a/dlf/common/class.tx_dlf_document.php
+++ b/dlf/common/class.tx_dlf_document.php
@@ -316,7 +316,7 @@ final class tx_dlf_document {
*/
public function getFileLocation($id) {
- if (($location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/mets:FLocat[@LOCTYPE="URL"]'))) {
+ if (!empty($id) && ($location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/mets:FLocat[@LOCTYPE="URL"]'))) {
return (string) $location[0]->attributes('http://www.w3.org/1999/xlink')->href;
@@ -556,7 +556,7 @@ final class tx_dlf_document {
$details['points'] = max(intval(array_search($this->smLinks['l2p'][$details['id']][0], $this->physicalPages, TRUE)), 1);
- $details['thumbnailId'] = $this->physicalPagesInfo[$this->smLinks['l2p'][$details['id']][0]]['files'][strtolower($extConf['fileGrpThumbs'])];
+ $details['thumbnailId'] = @$this->physicalPagesInfo[$this->smLinks['l2p'][$details['id']][0]]['files'][strtolower($extConf['fileGrpThumbs'])];
// Get page number of the first page related to this structure element.
$details['pagination'] = $this->physicalPagesInfo[$id]['label'];
@@ -567,7 +567,7 @@ final class tx_dlf_document {
// Yes. Point to itself.
$details['points'] = 1;
- $details['thumbnailId'] = $this->physicalPagesInfo[$this->physicalPages[1]]['files'][strtolower($extConf['fileGrpThumbs'])];
+ $details['thumbnailId'] = @$this->physicalPagesInfo[$this->physicalPages[1]]['files'][strtolower($extConf['fileGrpThumbs'])];
}
@@ -1699,6 +1699,12 @@ final class tx_dlf_document {
$useGrps = t3lib_div::trimExplode(',', $extConf['fileGrps']);
+ if (!empty($extConf['fileGrpThumbs'])) {
+
+ $useGrps[] = $extConf['fileGrpThumbs'];
+
+ }
+
// Yes. Get concordance of @FILEID and @USE attributes.
$fileUse = array ();
@@ -1908,9 +1914,23 @@ final class tx_dlf_document {
}
- // Load plugin configuration.
+ // Load extension configuration.
$extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]);
+ if (empty($extConf['fileGrpThumbs'])) {
+
+ if (TYPO3_DLOG) {
+
+ t3lib_div::devLog('[tx_dlf_document->_getThumbnail()] No fileGrp for thumbnails specified', $this->extKey, SYSLOG_SEVERITY_WARNING);
+
+ }
+
+ $this->thumbnailLoaded = TRUE;
+
+ return $this->thumbnail;
+
+ }
+
$strctId = $this->_getToplevelId();
$metadata = $this->getTitledata($cPid);
diff --git a/dlf/common/class.tx_dlf_indexing.php b/dlf/common/class.tx_dlf_indexing.php
index 4176c462..408b9c31 100644
--- a/dlf/common/class.tx_dlf_indexing.php
+++ b/dlf/common/class.tx_dlf_indexing.php
@@ -553,7 +553,7 @@ class tx_dlf_indexing {
$solrDoc->setField('thumbnail', $doc->thumbnail);
- } else {
+ } elseif (!empty($logicalUnit['thumbnailId'])) {
$solrDoc->setField('thumbnail', $doc->getFileLocation($logicalUnit['thumbnailId']));
diff --git a/dlf/ext_conf_template.txt b/dlf/ext_conf_template.txt
index 4ba852a9..c9a33f32 100644
--- a/dlf/ext_conf_template.txt
+++ b/dlf/ext_conf_template.txt
@@ -17,7 +17,7 @@ publishNewCollections = 1
unhideOnIndex = 0
# cat=Files; type=string; label=LLL:EXT:dlf/locallang.xml:config.fileGrps
-fileGrps = THUMBS,MIN,DEFAULT,MAX
+fileGrps = MIN,DEFAULT,MAX
# cat=Files; type=string; label=LLL:EXT:dlf/locallang.xml:config.fileGrpThumbs
fileGrpThumbs = THUMBS
diff --git a/dlf/locallang.xml b/dlf/locallang.xml
index f7c1a879..709ad852 100644
--- a/dlf/locallang.xml
+++ b/dlf/locallang.xml
@@ -128,7 +128,7 @@
-
+
@@ -290,7 +290,7 @@
-
+
diff --git a/dlf/plugins/pagegrid/class.tx_dlf_pagegrid.php b/dlf/plugins/pagegrid/class.tx_dlf_pagegrid.php
index 72615094..5c966c4b 100644
--- a/dlf/plugins/pagegrid/class.tx_dlf_pagegrid.php
+++ b/dlf/plugins/pagegrid/class.tx_dlf_pagegrid.php
@@ -68,8 +68,20 @@ class tx_dlf_pagegrid extends tx_dlf_plugin {
// Set pagination.
$markerArray['###PAGINATION###'] = $this->doc->physicalPagesInfo[$this->doc->physicalPages[$number]]['label'];
- // Get thumbnail and link it to page view.
- $thumbnailFile = $this->doc->getFileLocation($this->doc->physicalPagesInfo[$this->doc->physicalPages[$number]]['files'][strtolower($this->conf['fileGrpThumbs'])]);
+ // Get thumbnail or placeholder.
+ if (!empty($this->doc->physicalPagesInfo[$this->doc->physicalPages[$number]]['files'][strtolower($this->conf['fileGrpThumbs'])])) {
+
+ $thumbnailFile = $this->doc->getFileLocation($this->doc->physicalPagesInfo[$this->doc->physicalPages[$number]]['files'][strtolower($this->conf['fileGrpThumbs'])]);
+
+ } elseif (!empty($this->conf['placeholder'])) {
+
+ $thumbnailFile = $this->conf['placeholder'];
+
+ } else {
+
+ $thumbnailFile = t3lib_extMgm::siteRelPath($this->extKey).'plugins/pagegrid/placeholder.jpg';
+
+ }
$thumbnail = '';
@@ -191,7 +203,7 @@ class tx_dlf_pagegrid extends tx_dlf_plugin {
$this->loadDocument();
- if ($this->doc === NULL || $this->doc->numPages < 1) {
+ if ($this->doc === NULL || $this->doc->numPages < 1 || empty($this->conf['fileGrpThumbs'])) {
// Quit without doing anything if required variables are not set.
return $content;
diff --git a/dlf/plugins/pagegrid/flexform.xml b/dlf/plugins/pagegrid/flexform.xml
index 10bd26c3..df5afff1 100644
--- a/dlf/plugins/pagegrid/flexform.xml
+++ b/dlf/plugins/pagegrid/flexform.xml
@@ -36,6 +36,20 @@
+
+
+ 1
+
+
+ group
+ file_reference
+ jpg,png,gif
+ 1
+ 1
+ 0
+
+
+
1
diff --git a/dlf/plugins/pagegrid/locallang.xml b/dlf/plugins/pagegrid/locallang.xml
index 26c30b2b..efa6147e 100644
--- a/dlf/plugins/pagegrid/locallang.xml
+++ b/dlf/plugins/pagegrid/locallang.xml
@@ -8,6 +8,7 @@
+
@@ -19,6 +20,7 @@
+
diff --git a/dlf/plugins/pagegrid/placeholder.jpg b/dlf/plugins/pagegrid/placeholder.jpg
new file mode 100644
index 00000000..9b533129
Binary files /dev/null and b/dlf/plugins/pagegrid/placeholder.jpg differ