Merge lp:~henrik-lochmann/goobi-presentation/bug-956155 into lp:~slub.team/goobi-presentation/old-bzr-trunk
- bug-956155
- Merge into old-bzr-trunk
Proposed by
Henrik Lochmann
Status: | Merged |
---|---|
Approved by: | Sebastian Meyer |
Approved revision: | 105 |
Merged at revision: | 116 |
Proposed branch: | lp:~henrik-lochmann/goobi-presentation/bug-956155 |
Merge into: | lp:~slub.team/goobi-presentation/old-bzr-trunk |
Diff against target: |
451 lines (+232/-10) 10 files modified
dlf/common/class.tx_dlf_document.php (+159/-1) dlf/common/class.tx_dlf_indexing.php (+7/-0) dlf/ext_conf_template.txt (+3/-0) dlf/ext_tables.sql (+4/-1) dlf/locallang.xml (+7/-1) dlf/plugins/collection/class.tx_dlf_collection.php (+3/-2) dlf/plugins/listview/class.tx_dlf_listview.php (+12/-1) dlf/plugins/listview/template.tmpl (+1/-0) dlf/plugins/search/class.tx_dlf_search.php (+5/-3) dlf/tca.php (+31/-1) |
To merge this branch: | bzr merge lp:~henrik-lochmann/goobi-presentation/bug-956155 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sebastian Meyer | Approve | ||
Review via email: mp+117030@code.launchpad.net |
Commit message
Description of the change
- fixing after internal review
To post a comment you must log in.
Revision history for this message
Sebastian Meyer (sebastian-meyer) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'dlf/common/class.tx_dlf_document.php' |
2 | --- dlf/common/class.tx_dlf_document.php 2012-05-15 07:43:50 +0000 |
3 | +++ dlf/common/class.tx_dlf_document.php 2012-07-27 10:23:21 +0000 |
4 | @@ -29,7 +29,7 @@ |
5 | /** |
6 | * Document class 'tx_dlf_document' for the 'dlf' extension. |
7 | * |
8 | - * @author Sebastian Meyer <sebastian.meyer@slub-dresden.de> |
9 | + * @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>, Henrik Lochmann <dev@mentalmotive.com> |
10 | * @copyright Copyright (c) 2011, Sebastian Meyer, SLUB Dresden |
11 | * @package TYPO3 |
12 | * @subpackage tx_dlf |
13 | @@ -248,6 +248,23 @@ |
14 | */ |
15 | protected $tableOfContentsLoaded = FALSE; |
16 | |
17 | + /** |
18 | + * This holds the document's thumbnail. |
19 | + * |
20 | + * @var string |
21 | + * @access protected |
22 | + */ |
23 | + protected $thumbnail = NULL; |
24 | + |
25 | + /** |
26 | + * Is the thumbnail loaded? |
27 | + * @see $thumbnail |
28 | + * |
29 | + * @var boolean |
30 | + * @access protected |
31 | + */ |
32 | + protected $thumbnailLoaded = FALSE; |
33 | + |
34 | /** |
35 | * This holds the UID or the URL of the document |
36 | * |
37 | @@ -798,6 +815,146 @@ |
38 | |
39 | } |
40 | |
41 | + /** |
42 | + * Returns a document thumbnail depending on ext configuration and structure element settings. |
43 | + * |
44 | + * @access public |
45 | + * |
46 | + * @param integer $pid: The PID for the metadata definitions |
47 | + * |
48 | + * @return mixed The thumbnail url or FALSE, if none could be found. |
49 | + */ |
50 | + public function getThumbnail($pid = -1) { |
51 | + |
52 | + if (!$this->thumbnailLoaded) { |
53 | + |
54 | + if ($pid === -1) { |
55 | + |
56 | + $pid = $this->pid; |
57 | + |
58 | + } |
59 | + |
60 | + $logicalUnitId = $this->getToplevelId(); |
61 | + |
62 | + $metadata = $this->getMetadata($logicalUnitId, $pid); |
63 | + |
64 | + $structureType = $metadata['type'][0]; |
65 | + |
66 | + // Check if for this structure/document type thumbnails shall be rendered. |
67 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
68 | + 'tx_dlf_structures.thumbnail AS thumbnail, tx_dlf_structures.thumbnail_source AS thumbnail_source', |
69 | + 'tx_dlf_structures', |
70 | + 'tx_dlf_structures.pid='.intval($pid).' AND tx_dlf_structures.index_name='.$GLOBALS['TYPO3_DB']->fullQuoteStr($structureType, 'tx_dlf_structures').tx_dlf_helper::whereClause('tx_dlf_structures'), |
71 | + '', |
72 | + '', |
73 | + '1' |
74 | + ); |
75 | + |
76 | + $resArray = array(); |
77 | + |
78 | + if (!($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))) { |
79 | + |
80 | + t3lib_div::devLog('[tx_dlf_document.getThumbnail] could not get thumbnail settings from DB', 'dlf', t3lib_div::SYSLOG_SEVERITY_ERROR); |
81 | + |
82 | + return FALSE; |
83 | + |
84 | + } |
85 | + |
86 | + if ($resArray['thumbnail'] != '1') { |
87 | + |
88 | + t3lib_div::devLog('[tx_dlf_document.getThumbnail] no thumbnail generation for '.$logicalUnitId, 'dlf', t3lib_div::SYSLOG_SEVERITY_NOTICE); |
89 | + |
90 | + return FALSE; |
91 | + |
92 | + } |
93 | + |
94 | + // Check desired thumbnail source. |
95 | + if (!empty($resArray['thumbnail_source'])) { |
96 | + |
97 | + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
98 | + 'tx_dlf_structures.index_name AS index_name', |
99 | + 'tx_dlf_structures', |
100 | + 'tx_dlf_structures.uid='.intval($resArray['thumbnail_source']).tx_dlf_helper::whereClause('tx_dlf_structures'), |
101 | + '', |
102 | + '', |
103 | + '1' |
104 | + ); |
105 | + |
106 | + if (!($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))) { |
107 | + |
108 | + t3lib_div::devLog('[tx_dlf_document.getThumbnail] could not get thumbnail source index name from DB', 'dlf', t3lib_div::SYSLOG_SEVERITY_ERROR); |
109 | + |
110 | + return FALSE; |
111 | + |
112 | + } |
113 | + |
114 | + // Check if this document has a sub element of the desired type. |
115 | + $nodes = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="'.$resArray['index_name'].'"]/@ID'); |
116 | + |
117 | + if (is_array($nodes) && count($nodes) > 0) { |
118 | + |
119 | + $subId = (string) $nodes[0]; |
120 | + |
121 | + t3lib_div::devLog('[tx_dlf_document.getThumbnail] thumb source element changed: oldId='.$logicalUnitId.', newId='.$subId, 'dlf', t3lib_div::SYSLOG_SEVERITY_NOTICE); |
122 | + |
123 | + $logicalUnitId = $subId; |
124 | + |
125 | + } else { |
126 | + |
127 | + t3lib_div::devLog('[tx_dlf_document.getThumbnail] no sub element found, taking toplevel element as thumb source', 'dlf', t3lib_div::SYSLOG_SEVERITY_NOTICE); |
128 | + |
129 | + } |
130 | + |
131 | + } |
132 | + |
133 | + // Extract and set thumbnail, if desired. |
134 | + t3lib_div::devLog('[tx_dlf_document.getThumbnail] thumbnails desired for '.$logicalUnitId, 'dlf', t3lib_div::SYSLOG_SEVERITY_NOTICE); |
135 | + |
136 | + $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dlf']); |
137 | + |
138 | + $fileGrp = $extConf['thumbFileGrp']; |
139 | + |
140 | + $this->thumbnail = 'not found'; |
141 | + |
142 | + $firstPageNode = $this->mets->xpath('./mets:structLink/mets:smLink[@xlink:from="'.$logicalUnitId.'"][1]/@xlink:to'); |
143 | + |
144 | + if (is_array($firstPageNode) && count($firstPageNode) > 0) { |
145 | + |
146 | + $firstPageId = $firstPageNode[0]; |
147 | + |
148 | + // den rest via physical pages |
149 | + t3lib_div::devLog('[tx_dlf_document.getThumbnail] first page='.$firstPageId, 'dlf', t3lib_div::SYSLOG_SEVERITY_NOTICE); |
150 | + |
151 | + $thumbnailNode = $this->mets->xpath('./mets:structMap[@TYPE="PHYSICAL"]/mets:div[@TYPE="physSequence"]/mets:div[@ID="'.$firstPageId.'"]/mets:fptr[substring(@FILEID, string-length(@FILEID) - '.(strlen($fileGrp) - 1).') = "'.$fileGrp.'"]/@FILEID'); |
152 | + |
153 | + if (is_array($firstPageNode) && count($thumbnailNode) > 0) { |
154 | + |
155 | + $thumbnailFileId = (string) $thumbnailNode[0]; |
156 | + |
157 | + $this->thumbnail = $this->getFileLocation($thumbnailFileId); |
158 | + |
159 | + t3lib_div::devLog('[tx_dlf_document.getThumbnail] thumbnail found, logicalUnit='.$logicalUnitId.', page='.$firstPageId.', thumb='.$thumbnailFileId.', thumb_url='.$this->thumbnail, 'dlf', t3lib_div::SYSLOG_SEVERITY_NOTICE); |
160 | + |
161 | + } else { |
162 | + |
163 | + t3lib_div::devLog('[tx_dlf_document.getThumbnail] no thumbnail found on first page (fileGrp='.$fileGrp.')', 'dlf', t3lib_div::SYSLOG_SEVERITY_NOTICE); |
164 | + |
165 | + } |
166 | + |
167 | + } else { |
168 | + |
169 | + t3lib_div::devLog('[tx_dlf_document.getThumbnail] no first page found', 'dlf', t3lib_div::SYSLOG_SEVERITY_NOTICE); |
170 | + |
171 | + } |
172 | + |
173 | + $this->thumbnailLoaded = TRUE; |
174 | + |
175 | + } |
176 | + |
177 | + return $this->thumbnail; |
178 | + |
179 | + } |
180 | + |
181 | /** |
182 | * This returns the ID of the toplevel logical structure node |
183 | * |
184 | @@ -1343,6 +1500,7 @@ |
185 | 'owner' => $owner, |
186 | 'solrcore' => $core, |
187 | 'status' => 0, |
188 | + 'thumbnail' => $this->getThumbnail($pid), |
189 | ); |
190 | |
191 | if ($location) { |
192 | |
193 | === modified file 'dlf/common/class.tx_dlf_indexing.php' |
194 | --- dlf/common/class.tx_dlf_indexing.php 2012-04-30 16:05:21 +0000 |
195 | +++ dlf/common/class.tx_dlf_indexing.php 2012-07-27 10:23:21 +0000 |
196 | @@ -500,6 +500,13 @@ |
197 | |
198 | $solrDoc->setField('type', $logicalUnit['type'], self::$fieldboost['type']); |
199 | |
200 | + // Index thumbnails for toplevel elements. |
201 | + if (in_array($logicalUnit['type'], self::$toplevel)) { |
202 | + |
203 | + $solrDoc->setField('thumbnail', $doc->getThumbnail($doc->pid)); |
204 | + |
205 | + } |
206 | + |
207 | $solrDoc->setField('title', $metadata['title'][0], self::$fieldboost['title']); |
208 | |
209 | $solrDoc->setField('author', $metadata['author'], self::$fieldboost['author']); |
210 | |
211 | === modified file 'dlf/ext_conf_template.txt' |
212 | --- dlf/ext_conf_template.txt 2012-03-29 08:32:14 +0000 |
213 | +++ dlf/ext_conf_template.txt 2012-07-27 10:23:21 +0000 |
214 | @@ -10,6 +10,9 @@ |
215 | # cat=Basic; type=string; label=LLL:EXT:dlf/locallang.xml:config.fileGrps |
216 | fileGrps = DEFAULT,MIN,MAX,THUMBS |
217 | |
218 | +# cat=Basic; type=string; label=LLL:EXT:dlf/locallang.xml:config.thumbFileGrp |
219 | +thumbFileGrp = THUMBS |
220 | + |
221 | # cat=Basic; type=boolean; label=LLL:EXT:dlf/locallang.xml:config.caching |
222 | caching = 0 |
223 | |
224 | |
225 | === modified file 'dlf/ext_tables.sql' |
226 | --- dlf/ext_tables.sql 2012-03-24 12:06:31 +0000 |
227 | +++ dlf/ext_tables.sql 2012-07-27 10:23:21 +0000 |
228 | @@ -34,7 +34,8 @@ |
229 | owner int(11) DEFAULT '0' NOT NULL, |
230 | solrcore int(11) DEFAULT '0' NOT NULL, |
231 | status tinyint(4) unsigned DEFAULT '0' NOT NULL, |
232 | - |
233 | + thumbnail tinytext NOT NULL, |
234 | + |
235 | PRIMARY KEY (uid), |
236 | KEY parent (pid), |
237 | INDEX partof (partof) |
238 | @@ -58,6 +59,8 @@ |
239 | label tinytext NOT NULL, |
240 | index_name tinytext NOT NULL, |
241 | oai_name tinytext NOT NULL, |
242 | + thumbnail tinyint(4) DEFAULT '0' NOT NULL, |
243 | + thumbnail_source int(11) DEFAULT '0' NOT NULL, |
244 | status tinyint(4) unsigned DEFAULT '0' NOT NULL, |
245 | |
246 | PRIMARY KEY (uid), |
247 | |
248 | === modified file 'dlf/locallang.xml' |
249 | --- dlf/locallang.xml 2012-04-20 08:23:36 +0000 |
250 | +++ dlf/locallang.xml 2012-07-27 10:23:21 +0000 |
251 | @@ -21,7 +21,7 @@ |
252 | <label index="tx_dlf_documents.year">Year of Publication</label> |
253 | <label index="tx_dlf_documents.year_sorting">Year of Publication (Sorting)</label> |
254 | <label index="tx_dlf_documents.place">Place of Publication</label> |
255 | - <label index="tx_dlf_documents.place_sorting">Place of Publication</label> |
256 | + <label index="tx_dlf_documents.place_sorting">Place of Publication (Sorting)</label> |
257 | <label index="tx_dlf_documents.structure">Typ of Document</label> |
258 | <label index="tx_dlf_documents.partof">Part of ...</label> |
259 | <label index="tx_dlf_documents.partof.none">none</label> |
260 | @@ -39,6 +39,8 @@ |
261 | <label index="tx_dlf_structures.label">Display Label</label> |
262 | <label index="tx_dlf_structures.index_name">Index Name</label> |
263 | <label index="tx_dlf_structures.oai_name">OAI Mapping</label> |
264 | + <label index="tx_dlf_structures.thumbnail">Show Thumbnail</label> |
265 | + <label index="tx_dlf_structures.thumbnail_source">Thumbnail Source</label> |
266 | <label index="tx_dlf_structures.status">Status</label> |
267 | <label index="tx_dlf_structures.status.default">default</label> |
268 | <label index="tx_dlf_structures.tab1">General</label> |
269 | @@ -124,6 +126,7 @@ |
270 | <label index="config.makeCliUserGroup">Create and configure CLI user/group automatically?: (default is "FALSE")</label> |
271 | <label index="config.useragent">DLF User-Agent: (default is "Goobi.Presentation")</label> |
272 | <label index="config.fileGrps">Additional METS fileGrps: comma-separated list of @USE attribute values (default is "DEFAULT,MIN,MAX,THUMBS")</label> |
273 | + <label index="config.thumbFileGrp">Thumbnails METS fileGrp: selects the fileGrp with by this @USE attribute value for thumbnail extraction</label> |
274 | <label index="config.caching">Cache parsed METS files: caching improves performance a little bit but can result in a very large "fe_session_data" table (default is "FALSE")</label> |
275 | <label index="config.solrConnect">Solr Connection</label> |
276 | <label index="config.solrHost">Solr Server Host: (default is "localhost")</label> |
277 | @@ -196,6 +199,8 @@ |
278 | <label index="tx_dlf_structures.label">Anzeigeform</label> |
279 | <label index="tx_dlf_structures.index_name">Index-Bezeichnung</label> |
280 | <label index="tx_dlf_structures.oai_name">OAI-Mapping</label> |
281 | + <label index="tx_dlf_structures.thumbnail">Vorschau zeigen</label> |
282 | + <label index="tx_dlf_structures.thumbnail_source">Vorschau-Quelle</label> |
283 | <label index="tx_dlf_structures.status">Status</label> |
284 | <label index="tx_dlf_structures.status.default">Standard</label> |
285 | <label index="tx_dlf_structures.tab1">Allgemein</label> |
286 | @@ -281,6 +286,7 @@ |
287 | <label index="config.makeCliUserGroup">CLI Benutzer/Gruppe automatisch anlegen?: (Standard ist "FALSE")</label> |
288 | <label index="config.useragent">DLF User-Agent: (Standard ist "Goobi.Presentation")</label> |
289 | <label index="config.fileGrps">Zusätzliche METS fileGrps: Komma-getrennte Liste von @USE Attributwerten (Standard ist "DEFAULT,MIN,MAX,THUMBS")</label> |
290 | + <label index="config.thumbFileGrp">Vorschau METS fileGrp: wählt die fileGrp mit diesem @USE Attributwert für die Thumbnail-Extraktion aus</label> |
291 | <label index="config.caching">Eingelesene METS Dateien zwischenspeichern: Dies kann die Geschwindigkeit geringfügig verbessern, führt aber zu einer sehr großen "fe_session_data" Tabelle (Standard ist "FALSE")</label> |
292 | <label index="config.solrConnect">Solr Verbindung</label> |
293 | <label index="config.solrHost">Solr Server Host: (Standard ist "localhost")</label> |
294 | |
295 | === modified file 'dlf/plugins/collection/class.tx_dlf_collection.php' |
296 | --- dlf/plugins/collection/class.tx_dlf_collection.php 2012-05-15 07:51:09 +0000 |
297 | +++ dlf/plugins/collection/class.tx_dlf_collection.php 2012-07-27 10:23:21 +0000 |
298 | @@ -254,7 +254,7 @@ |
299 | |
300 | // Get all documents in collection. |
301 | $result = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query( |
302 | - 'tx_dlf_collections.label AS collLabel,tx_dlf_collections.description AS collDesc,tx_dlf_documents.uid AS uid,tx_dlf_documents.title AS title,tx_dlf_documents.volume AS volume,tx_dlf_documents.volume_sorting AS volume_sorting,tx_dlf_documents.author AS author,tx_dlf_documents.place AS place,tx_dlf_documents.year AS year,tx_dlf_documents.structure AS type,tx_dlf_documents.partof AS partof', |
303 | + 'tx_dlf_collections.label AS collLabel,tx_dlf_collections.description AS collDesc,tx_dlf_documents.uid AS uid,tx_dlf_documents.title AS title,tx_dlf_documents.volume AS volume,tx_dlf_documents.volume_sorting AS volume_sorting,tx_dlf_documents.author AS author,tx_dlf_documents.place AS place,tx_dlf_documents.year AS year,tx_dlf_documents.structure AS type,tx_dlf_documents.partof AS partof,tx_dlf_documents.thumbnail AS thumbnail', |
304 | 'tx_dlf_documents', |
305 | 'tx_dlf_relations', |
306 | 'tx_dlf_collections', |
307 | @@ -297,7 +297,8 @@ |
308 | 'year' => array ($resArray['year']), |
309 | 'place' => array ($resArray['place']), |
310 | 'type' => array (tx_dlf_helper::getIndexName($resArray['type'], 'tx_dlf_structures', $this->conf['pages'])), |
311 | - 'subparts' => array () |
312 | + 'subparts' => array (), |
313 | + 'thumbnail' => $resArray['thumbnail'] |
314 | ); |
315 | |
316 | } else { |
317 | |
318 | === modified file 'dlf/plugins/listview/class.tx_dlf_listview.php' |
319 | --- dlf/plugins/listview/class.tx_dlf_listview.php 2012-05-15 07:51:09 +0000 |
320 | +++ dlf/plugins/listview/class.tx_dlf_listview.php 2012-07-27 10:23:21 +0000 |
321 | @@ -29,7 +29,7 @@ |
322 | /** |
323 | * Plugin 'DLF: List View' for the 'dlf' extension. |
324 | * |
325 | - * @author Sebastian Meyer <sebastian.meyer@slub-dresden.de> |
326 | + * @author Sebastian Meyer <sebastian.meyer@slub-dresden.de>, Henrik Lochmann <dev@mentalmotive.com> |
327 | * @copyright Copyright (c) 2011, Sebastian Meyer, SLUB Dresden |
328 | * @package TYPO3 |
329 | * @subpackage tx_dlf |
330 | @@ -232,6 +232,17 @@ |
331 | |
332 | } |
333 | |
334 | + // Add thumbnail. |
335 | + if (!empty($this->list->elements[$number]['thumbnail'])) { |
336 | + |
337 | + $markerArray['###THUMBNAIL###'] = '<img title="" alt="" src="'.$this->list->elements[$number]['thumbnail'].'"/>'; |
338 | + |
339 | + } else { |
340 | + |
341 | + $markerArray['###THUMBNAIL###'] = ''; |
342 | + |
343 | + } |
344 | + |
345 | if (!empty($this->list->elements[$number]['subparts'])) { |
346 | |
347 | $subpart = $this->getSubEntries($number, $template); |
348 | |
349 | === modified file 'dlf/plugins/listview/template.tmpl' |
350 | --- dlf/plugins/listview/template.tmpl 2012-03-16 09:06:25 +0000 |
351 | +++ dlf/plugins/listview/template.tmpl 2012-07-27 10:23:21 +0000 |
352 | @@ -6,6 +6,7 @@ |
353 | <ol class="tx-dlf-listview-list"> |
354 | <!-- ###ENTRY### --> |
355 | <li value="###NUMBER###"> |
356 | + <span>###THUMBNAIL###</span> |
357 | <dl> |
358 | ###METADATA### |
359 | </dl> |
360 | |
361 | === modified file 'dlf/plugins/search/class.tx_dlf_search.php' |
362 | --- dlf/plugins/search/class.tx_dlf_search.php 2012-05-05 11:10:37 +0000 |
363 | +++ dlf/plugins/search/class.tx_dlf_search.php 2012-07-27 10:23:21 +0000 |
364 | @@ -142,7 +142,8 @@ |
365 | 'year' => (is_array($doc->year) ? $doc->year : array ($doc->year)), |
366 | 'place' => (is_array($doc->place) ? $doc->place : array ($doc->place)), |
367 | 'type' => (is_array($doc->type) ? $doc->type : array ($doc->type)), |
368 | - 'subparts' => (!empty($toplevel[$doc->uid]['subparts']) ? $toplevel[$doc->uid]['subparts'] : array ()) |
369 | + 'subparts' => (!empty($toplevel[$doc->uid]['subparts']) ? $toplevel[$doc->uid]['subparts'] : array ()), |
370 | + 'thumbnail' => $doc->thumbnail |
371 | ); |
372 | |
373 | } else { |
374 | @@ -175,7 +176,7 @@ |
375 | |
376 | // Get information for toplevel document. |
377 | $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery( |
378 | - 'tx_dlf_documents.uid AS uid,tx_dlf_documents.title AS title,tx_dlf_documents.volume AS volume,tx_dlf_documents.author AS author,tx_dlf_documents.place AS place,tx_dlf_documents.year AS year,tx_dlf_documents.structure AS type', |
379 | + 'tx_dlf_documents.uid AS uid,tx_dlf_documents.title AS title,tx_dlf_documents.volume AS volume,tx_dlf_documents.author AS author,tx_dlf_documents.place AS place,tx_dlf_documents.year AS year,tx_dlf_documents.structure AS type,tx_dlf_documents.thumbnail AS thumbnail', |
380 | 'tx_dlf_documents', |
381 | 'tx_dlf_documents.uid='.intval($_check).tx_dlf_helper::whereClause('tx_dlf_documents'), |
382 | '', |
383 | @@ -197,7 +198,8 @@ |
384 | 'year' => array ($resArray['year']), |
385 | 'place' => array ($resArray['place']), |
386 | 'type' => array (tx_dlf_helper::getIndexName($resArray['type'], 'tx_dlf_structures', $this->conf['pages'])), |
387 | - 'subparts' => $toplevel[$_check]['subparts'] |
388 | + 'subparts' => $toplevel[$_check]['subparts'], |
389 | + 'thumbnail' => $resArray['thumbnail'] |
390 | ); |
391 | |
392 | } else { |
393 | |
394 | === modified file 'dlf/tca.php' |
395 | --- dlf/tca.php 2012-04-30 16:11:07 +0000 |
396 | +++ dlf/tca.php 2012-07-27 10:23:21 +0000 |
397 | @@ -314,6 +314,12 @@ |
398 | 'default' => 0, |
399 | ), |
400 | ), |
401 | + 'thumbnail' => array ( |
402 | + 'exclude' => 1, |
403 | + 'config' => array ( |
404 | + 'type' => 'passthrough', |
405 | + ), |
406 | + ), |
407 | ), |
408 | 'types' => array ( |
409 | '0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_documents.tab1, title;;1;;1-1-1, author;;2, year;;3, place;;4, structure;;5;;2-2-2, collections;;;;3-3-3, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_documents.tab2, location;;;;1-1-1, record_id, prod_id;;;;2-2-2, oai_id;;;;3-3-3, opac_id, union_id, urn, purl;;;;4-4-4, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_documents.tab3, hidden;;;;1-1-1, fe_group;;;;2-2-2, status;;;;3-3-3, owner;;;;4-4-4'), |
410 | @@ -411,6 +417,29 @@ |
411 | 'eval' => 'trim', |
412 | ), |
413 | ), |
414 | + 'thumbnail' => array ( |
415 | + 'exclude' => 1, |
416 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.thumbnail', |
417 | + 'config' => array ( |
418 | + 'type' => 'check', |
419 | + 'default' => 0, |
420 | + ), |
421 | + ), |
422 | + 'thumbnail_source' => array ( |
423 | + 'exclude' => 1, |
424 | + 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.thumbnail_source', |
425 | + 'config' => array ( |
426 | + 'type' => 'select', |
427 | + 'items' => array ( |
428 | + array ('[This Element]', 0), |
429 | + ), |
430 | + 'foreign_table' => 'tx_dlf_structures', |
431 | + 'foreign_table_where' => 'AND tx_dlf_structures.pid=###CURRENT_PID### AND tx_dlf_structures.toplevel=0 AND tx_dlf_structures.sys_language_uid IN (-1,0) ORDER BY tx_dlf_structures.label ', |
432 | + ), |
433 | + 'minitems' => 0, |
434 | + 'maxitems' => 1, |
435 | + 'default' => 0, |
436 | + ), |
437 | 'status' => array ( |
438 | 'exclude' => 1, |
439 | 'label' => 'LLL:EXT:dlf/locallang.xml:tx_dlf_structures.status', |
440 | @@ -427,10 +456,11 @@ |
441 | ), |
442 | ), |
443 | 'types' => array ( |
444 | - '0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_structures.tab1, toplevel;;;;1-1-1, label;;1, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_structures.tab2, sys_language_uid;;;;1-1-1, l18n_parent, l18n_diffsource, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_structures.tab3, hidden;;;;1-1-1, status;;;;2-2-2'), |
445 | + '0' => array ('showitem' => '--div--;LLL:EXT:dlf/locallang.xml:tx_dlf_structures.tab1, toplevel;;;;1-1-1, label;;1, thumbnail;;2, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_structures.tab2, sys_language_uid;;;;1-1-1, l18n_parent, l18n_diffsource, --div--;LLL:EXT:dlf/locallang.xml:tx_dlf_structures.tab3, hidden;;;;1-1-1, status;;;;2-2-2'), |
446 | ), |
447 | 'palettes' => array ( |
448 | '1' => array ('showitem' => 'index_name, --linebreak--, oai_name', 'canNotCollapse' => 1), |
449 | + '2' => array ('showitem' => 'thumbnail_source'), |
450 | ), |
451 | ); |
452 |